@bulpara/digitoon-design-system
v1.0.0
Published
Production-grade design system for Digitoon web and mobile applications
Maintainers
Readme
@digitoon/design-system
Production-grade design system for Digitoon web and mobile applications, built with Tamagui for universal compatibility.
Features
- 🎨 Universal Design System - Works across React Native, Next.js, and web
- 🎯 TypeScript First - Full type safety and IntelliSense support
- 🚀 Performance Optimized - Tree-shakeable, optimized bundle sizes
- 📱 Mobile & Web - Responsive design with platform-specific optimizations
- 🎭 Multiple Themes - Light, dark, and sepia themes with easy customization
- 🔧 Production Ready - Comprehensive testing, linting, and build pipeline
Installation
# Using pnpm (recommended)
pnpm add @digitoon/design-system
# Using npm
npm install @digitoon/design-system
# Using yarn
yarn add @digitoon/design-systemPeer Dependencies
Make sure you have the required peer dependencies installed:
pnpm add react react-native # react-native is optional for web-only projectsQuick Start
Next.js Setup
- Install the Next.js plugin:
pnpm add @tamagui/next-plugin- Configure your
next.config.js:
import { withTamagui } from '@tamagui/next-plugin'
const nextConfig = {
transpilePackages: ['@digitoon/design-system'],
}
export default withTamagui(nextConfig, {
config: './tamagui.config.ts',
components: ['@digitoon/design-system'],
})- Create
tamagui.config.ts:
import { config } from '@digitoon/design-system/config'
export default config- Wrap your app with TamaguiProvider:
import { TamaguiProvider } from '@digitoon/design-system'
import { config } from '@digitoon/design-system/config'
export default function App({ children }) {
return (
<TamaguiProvider config={config} defaultTheme="light">
{children}
</TamaguiProvider>
)
}React Native Setup
- Install Tamagui core packages:
pnpm add @tamagui/core- Configure your app:
import { TamaguiProvider } from '@digitoon/design-system'
import { config } from '@digitoon/design-system/config'
export default function App() {
return (
<TamaguiProvider config={config} defaultTheme="light">
{/* Your app content */}
</TamaguiProvider>
)
}Usage
Basic Components
import {
DigitoonButton,
DigitoonCard,
DigitoonText,
DigitoonHeading,
XStack,
YStack,
} from '@digitoon/design-system'
function MyComponent() {
return (
<YStack padding="$4" gap="$4">
<DigitoonHeading level={1}>Welcome to Digitoon</DigitoonHeading>
<DigitoonCard variant="elevated">
<DigitoonText>This is a card component</DigitoonText>
</DigitoonCard>
<XStack gap="$2">
<DigitoonButton variant="primary">Primary</DigitoonButton>
<DigitoonButton variant="secondary">Secondary</DigitoonButton>
</XStack>
</YStack>
)
}Theming
import { Theme, useTheme } from '@digitoon/design-system'
function ThemedComponent() {
const theme = useTheme()
return (
<Theme name="dark">
<YStack backgroundColor="$background" padding="$4">
<DigitoonText color="$color">Dark theme content</DigitoonText>
</YStack>
</Theme>
)
}Design Tokens
import { tokens, themes } from '@digitoon/design-system'
// Access design tokens
const primaryColor = tokens.color.primary500
const spacing = tokens.space[4]
// Use in styled components
const StyledView = styled(View, {
backgroundColor: '$primary',
padding: '$4',
borderRadius: '$md',
})Available Components
Layout
XStack,YStack,ZStack- Flex layout componentsView,Stack- Basic view components
Typography
DigitoonText- Customizable text componentDigitoonHeading- Heading component with levels 1-6- Standard HTML headings:
H1,H2,H3,H4,H5,H6
Form Controls
DigitoonButton- Button with multiple variantsDigitoonInput- Input field with validation states
Containers
DigitoonCard- Card container with variantsCardHeader,CardContent,CardFooter- Card sections
Theming
Theme- Theme provider componentTamaguiProvider- Root provider
Design Tokens
The design system includes comprehensive design tokens:
- Colors: Brand colors, semantic colors, neutral scales
- Typography: Font sizes, weights, line heights
- Spacing: Consistent spacing scale
- Radii: Border radius values
- Shadows: Elevation and shadow tokens
Themes
Three built-in themes:
- Light: Default light theme
- Dark: Dark theme optimized for night reading
- Sepia: Warm theme for comfortable reading
Development
Prerequisites
- Node.js 18+
- pnpm 8+
Setup
git clone <repository-url>
cd design-system
pnpm installAvailable Scripts
pnpm build # Build the package
pnpm dev # Watch mode for development
pnpm test # Run tests
pnpm test:watch # Run tests in watch mode
pnpm test:coverage # Run tests with coverage
pnpm lint # Lint the code
pnpm lint:fix # Fix linting issues
pnpm typecheck # Type checkingTesting
The design system includes comprehensive testing setup with Jest and Testing Library:
# Run all tests
pnpm test
# Run tests in watch mode
pnpm test:watch
# Generate coverage report
pnpm test:coverageContributing
- Fork the repository
- Create a feature branch:
git checkout -b feature/new-component - Make your changes
- Run tests:
pnpm test - Run linting:
pnpm lint:fix - Commit your changes:
git commit -m 'Add new component' - Push to the branch:
git push origin feature/new-component - Submit a pull request
License
MIT License - see LICENSE file for details.
Support
For questions and support:
- Create an issue in the repository
- Check the documentation
- Contact the Digitoon team
