@conty/design-system into the conty-web project, which uses Next.js 16, React 19, and TypeScript 5.
Prerequisites
The conty-web stack:- Framework: Next.js 16 with App Router
- React: Version 19
- TypeScript: Version 5
- Current UI Stack: Tailwind 4 + shadcn/ui + Radix UI
Installation
Component Usage Examples
Button
TheButton component replaces the existing button from src/components/ui/button.tsx.
default, secondary, destructive, outline, ghost, link
Supported sizes: default, sm, lg, icon, icon-sm, icon-lg
Badge
TheBadge component replaces src/components/ui/badge.tsx.
default, secondary, destructive, outline
The
warning variant from the legacy conty-web badge was intentionally excluded from Wave 1 to avoid hardcoded visual values outside the token contract.Card
TheCard component system replaces src/components/ui/card.tsx with a composition API.
Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter
The composition API is preserved from the legacy implementation for seamless incremental migration.
Incremental Adoption Strategy
Start with low-risk components
Begin migration with foundational, low-risk components:
ButtonBadgeCard
- High usage across the application
- Simple, stable APIs
- Low risk of regression
Validate visual semantics
Compare the visual output between the legacy conty-web components and the design system equivalents:
- Open the component in Storybook at
http://localhost:6006 - Compare with the same component in your local conty-web development environment
- Verify spacing, colors, borders, and interactive states match expectations
- Test dark mode rendering
Visual Regression Testing Checklist
Visual Regression Testing Checklist
- Default state matches legacy component
- Hover states are consistent
- Focus states show proper ring indicators
- Disabled states have correct opacity
- Dark mode colors are appropriate
- Component responds to container sizing
- Icons scale correctly
Migrate by module
Apply the design system components module by module rather than globally:Recommended migration order by module:
- Authentication/onboarding flows
- Dashboard and main feed
- Settings pages
- Billing and payments
- Advanced features and admin areas
- Validate each module independently
- Rollback easily if issues arise
- Maintain both legacy and new components during transition
Wave 1 Component Migration Baseline
The initial migration wave focuses on three foundational components.Migration Mapping
| Legacy Component | Design System | Variants Supported |
|---|---|---|
src/components/ui/button.tsx | Button from @conty/design-system | default, secondary, destructive, outline, ghost, link |
src/components/ui/badge.tsx | Badge from @conty/design-system | default, secondary, destructive, outline |
src/components/ui/card.tsx | Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter from @conty/design-system | Composition API preserved |
Code Migration Examples
Design Tokens Used in Wave 1
All Wave 1 components consume semantic tokens from@conty/tokens/tokens.json.
Token Categories Applied
- Surface colors:
color.surface.default,color.surface.elevated,color.surface.muted - Text colors:
color.text.default,color.text.muted,color.text.onBrand - Brand colors:
color.brand.primary - Border colors:
color.border.default,color.border.focus - Status colors:
color.status.destructive,color.status.onDestructive - Spacing:
space.1throughspace.8 - Radius:
radius.sm,radius.md,radius.lg - Typography:
typography.fontFamily.sans,typography.text.sm,typography.text.base,typography.text.lg
Token Runtime Layer
Tokens are compiled to CSS custom properties intheme.css, which serves as the runtime layer for the web:
Legacy Token Aliases
The@conty/tokens package maintains backward-compatible aliases in index.ts for gradual transition:
colors(legacy) → semantic color tokensspacing(legacy) →space.*tokensradii(legacy) →radius.*tokenstypography(legacy) →typography.*tokens
Testing Integration
Accessibility validation
Run automated accessibility checks:Ensure no critical violations are introduced.
Troubleshooting
Styles not applying correctly
Styles not applying correctly
Cause: CSS import order is incorrect.Solution: Ensure
@conty/design-system/styles.css is imported before your custom styles:Dark mode not working
Dark mode not working
Cause: The
dark class is not being applied to the HTML element.Solution: Verify your theme provider is configured correctly:TypeScript errors on component props
TypeScript errors on component props
Cause: Peer dependencies may not be installed.Solution: Ensure React 19 is installed:
Component looks different from Storybook
Component looks different from Storybook
Cause: Missing CSS or token variables.Solution: Verify the import chain:
- Check that
@conty/design-system/styles.cssis imported - Inspect the DOM to ensure CSS custom properties are defined
- Clear your build cache:
rm -rf .next && npm run dev
Next Steps
Migration Strategy
Learn the full incremental migration approach
Components Reference
Explore all available components and APIs
Design Tokens
Deep dive into the token system
Storybook
View components in Storybook