Component library providing reusable UI components for Journeys. This is a published package that includes Storybook for component documentation and visual testing.
- Components:
src/components/- Components definition - Stories:
src/stories/- Storybook stories for components - Utils:
src/utils/- Shared utilities
- Framework: React 18+ with TypeScript as peer dependency
- Build and tests: Vite, Vitest and Storybook with a11y addon for accessibility tests
- Styling: SCSS modules with typescript definitions
- Component primitives: Radix UI for accessible primitives
- Animation: Motion (Framer Motion) for animations
- Form management: React Hook Form support
pnpm install # Install dependencies
pnpm check # Run lint, tests and storybook build to verify changes
pnpm storybook # Run storybook (http://localhost:6006)
pnpm build:package # Production build
pnpm build:storybook # Builds storybook
pnpm lint # Check formatting with ESLint and Prettier
pnpm lint:fix # Automatically resolve lint errors
pnpm test # Run unit tests
pnpm changelog # Generate changelog
pnpm release # Release new package version- Use TypeScript strict mode
- Use modern and idiomatic syntax
- Component interfaces need to be accessible and meet WCAG standards
- Prefer Radix UI primitives as a base for new components
- Use
import type { ... }for type-only imports - Use specific imports to improve tree shaking
- Start Storybook:
pnpm storybookto develop components interactively - Write components: In
src/components/ComponentName/ - Declare types: Declare component types in co-colated
types.tsfile - Style: Style components in co-colated SCSS modules, generate TypeScript definitions
- Document: Create stories in
src/stories/or co-located - Test: Write Vitest tests for component logic and accessibility requirements
- Build: Test package build with
pnpm build:package
- Make changes: Update components, add tests, update stories, commit
- Verify changes:
pnpm checkto verify changes - Publish: Ask for confirmation, then
pnpm release(publishes to npm)
- Published: This package is published to npm (MIT license)
- Versioning: Uses semantic versioning (patch version auto-bumped on publish)
- Changelog: Are auto-generated from commits
- Storybook: Primary development and documentation tool
- See root
AGENTS.mdfor monorepo-wide context