# MediaHub Design System
## ๐ Overview
The MediaHub Design System provides a comprehensive set of design tokens, components, and utilities to ensure consistency across the application. This system is built on modern design principles and follows accessibility best practices.
## ๐จ Design Tokens
### Colors
Our color system is organized into semantic categories for consistent usage across the application.
#### Primary Colors
```typescript
import { colors } from '@/lib/design-system';
// Primary brand colors
colors.primary[50] // Lightest shade
colors.primary[100] // Very light
colors.primary[500] // Main brand color
colors.primary[600] // Darker shade
colors.primary[900] // Darkest shade
```
#### Neutral Colors
```typescript
// Neutral colors for text, backgrounds, and borders
colors.neutral[50] // Background colors
colors.neutral[100] // Light backgrounds
colors.neutral[500] // Medium text
colors.neutral[700] // Dark text
colors.neutral[900] // Darkest text
```
#### Semantic Colors
```typescript
// Success states
colors.semantic.success.DEFAULT
colors.semantic.success[50] // Light background
colors.semantic.success[500] // Main success color
// Warning states
colors.semantic.warning.DEFAULT
colors.semantic.warning[50] // Light background
colors.semantic.warning[500] // Main warning color
// Error states
colors.semantic.error.DEFAULT
colors.semantic.error[50] // Light background
colors.semantic.error[500] // Main error color
// Info states
colors.semantic.info.DEFAULT
colors.semantic.info[50] // Light background
colors.semantic.info[500] // Main info color
```
#### Surface Colors
```typescript
// Surface colors for UI elements
colors.surface.background // Main background
colors.surface.foreground // Main text
colors.surface.card // Card backgrounds
colors.surface.border // Border colors
colors.surface.muted // Muted backgrounds
```
### Spacing
Our spacing system uses a 4px base unit for consistent spacing across the application.
```typescript
import { spacing } from '@/lib/design-system';
// Base spacing units
spacing.xs // 4px
spacing.sm // 8px
spacing.md // 16px
spacing.lg // 24px
spacing.xl // 32px
spacing['2xl'] // 48px
spacing['3xl'] // 64px
spacing['4xl'] // 96px
spacing['5xl'] // 128px
// Component-specific spacing
spacing.component.padding.xs // 8px
spacing.component.padding.md // 16px
spacing.component.padding.lg // 24px
spacing.component.margin.xs // 8px
spacing.component.margin.md // 16px
spacing.component.margin.lg // 24px
spacing.component.gap.xs // 4px
spacing.component.gap.md // 16px
spacing.component.gap.lg // 24px
```
### Typography
Our typography system provides consistent text styles with proper hierarchy.
#### Font Families
```typescript
import { typography } from '@/lib/design-system';
// Font families
typography.fontFamily.sans // DM Sans, system-ui, sans-serif
typography.fontFamily.mono // JetBrains Mono, Consolas, monospace
```
#### Font Sizes
```typescript
// Font sizes
typography.fontSize.xs // 12px
typography.fontSize.sm // 14px
typography.fontSize.base // 16px
typography.fontSize.lg // 18px
typography.fontSize.xl // 20px
typography.fontSize['2xl'] // 24px
typography.fontSize['3xl'] // 30px
typography.fontSize['4xl'] // 36px
typography.fontSize['5xl'] // 48px
typography.fontSize['6xl'] // 60px
```
#### Typography Presets
```typescript
// Predefined typography styles
typography.presets.h1 // Large headings
typography.presets.h2 // Medium headings
typography.presets.h3 // Small headings
typography.presets.body // Body text
typography.presets.bodySmall // Small body text
typography.presets.caption // Caption text
typography.presets.button // Button text
```
### Border Radius
Consistent border radius values for rounded corners.
```typescript
import { borderRadius } from '@/lib/design-system';
borderRadius.none // 0
borderRadius.sm // 2px
borderRadius.md // 4px
borderRadius.lg // 8px
borderRadius.xl // 12px
borderRadius['2xl'] // 16px
borderRadius['3xl'] // 24px
borderRadius.full // 9999px (fully rounded)
```
### Shadows
Elevation and depth through consistent shadow values.
```typescript
import { shadows } from '@/lib/design-system';
// Elevation shadows
shadows.sm // Subtle elevation
shadows.md // Medium elevation
shadows.lg // Large elevation
shadows.xl // Extra large elevation
shadows['2xl'] // Maximum elevation
// Custom shadows
shadows.card // Card shadows
shadows.dropdown // Dropdown shadows
shadows.modal // Modal shadows
shadows.focus // Focus ring shadows
```
### Animations
Smooth, consistent animations for better user experience.
```typescript
import { animations } from '@/lib/design-system';
// Animation durations
animations.duration.fast // 150ms
animations.duration.normal // 250ms
animations.duration.slow // 350ms
animations.duration.slower // 500ms
// Animation presets
animations.presets.fadeIn // Fade in animation
animations.presets.fadeOut // Fade out animation
animations.presets.slideInFromTop // Slide in from top
animations.presets.slideInFromBottom // Slide in from bottom
animations.presets.scaleIn // Scale in animation
animations.presets.scaleOut // Scale out animation
animations.presets.spin // Spinning animation
animations.presets.pulse // Pulsing animation
animations.presets.bounce // Bouncing animation
```
## ๐งฉ Component Library
### Core Components
Our component library is built on top of shadcn/ui and Radix UI primitives, enhanced with our design system.
#### Button Component
```tsx
import { Button } from '@/components/ui/button';
// Usage examples
```
#### Card Component
```tsx
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';