# Component Guide - Dish Planner This guide documents the standardized UI components in the Dish Planner application. All components use Tailwind CSS with our custom color variables from the design system. ## Design System ### Colors Our color palette is defined in `src/styles/theme/colors/root.css` and integrated into Tailwind via `tailwind.config.ts`: - **Primary (Rose)**: `bg-primary`, `text-primary`, `border-primary` with shades 50-950 - **Secondary (Deluge)**: `bg-secondary`, `text-secondary`, `border-secondary` with shades 50-950 - **Accent (Malibu Blue)**: `bg-accent`, `text-accent`, `border-accent` with shades 50-950 - **Yellow (Gamboge)**: `bg-yellow`, `text-yellow`, `border-yellow` with shades 50-950 - **Gray (Ebony Clay)**: `bg-gray`, `text-gray`, `border-gray` with shades 100-950 - **Semantic Colors**: - Danger (Alizarin Crimson): `bg-danger`, `text-danger`, `border-danger` - Success (Spring Green): `bg-success`, `text-success`, `border-success` - Warning (Burning Orange): `bg-warning`, `text-warning`, `border-warning` ## Components ### Button (`src/components/ui/Button.tsx`) Unified button component supporting multiple variants, appearances, and states. #### Props ```typescript interface ButtonProps { appearance?: 'solid' | 'outline' | 'text'; // Default: 'solid' variant?: 'primary' | 'secondary' | 'accent' | 'danger'; // Default: 'primary' size?: 'small' | 'medium' | 'large'; // Default: 'medium' type?: 'button' | 'submit' | 'reset'; // Default: 'button' href?: string; // For link buttons icon?: ReactNode; disabled?: boolean; onClick?: () => void; className?: string; children: ReactNode; } ``` #### Examples ```tsx // Solid primary button // Outline accent button with icon // Text danger button // Link button ``` ### Input (`src/components/ui/Input.tsx`) Standardized text input component with label, error, and helper text support. #### Props ```typescript interface InputProps extends InputHTMLAttributes { label?: string; error?: string; helperText?: string; fullWidth?: boolean; // Default: true } ``` #### Examples ```tsx // Basic input with label setEmail(e.target.value)} required /> // Input with error // Input with helper text ``` ### Select (`src/components/ui/Select.tsx`) Standardized select dropdown component. #### Props ```typescript interface SelectProps extends SelectHTMLAttributes { label?: string; error?: string; helperText?: string; fullWidth?: boolean; // Default: true options: Array<{ value: string | number; label: string }>; } ``` #### Example ```tsx