# PRD: UI Kit Showcase Extension ## Problem Statement Extension developers need a reference implementation demonstrating all UI kit components (`@alga/ui-kit`) with their variants, states, and usage patterns. Currently there is no comprehensive example showing how to use the full component library within an extension context. Additionally, the UI kit uses `--alga-*` CSS variables while the main app uses `--color-*` variables, causing theming inconsistencies. A theme bridge is needed to ensure UI kit components render correctly within the host application. ## Goals 1. Create a sample extension that showcases every UI kit component 2. Demonstrate all variants, sizes, and states for each component 3. Provide interactive examples that developers can reference 4. Create a theme bridge mapping `--alga-*` to `--color-*` variables 5. Serve as a living documentation and testing ground for the UI kit ## Non-Goals - Production use case functionality (this is purely a demo) - Backend/handler logic beyond minimal scaffolding - Persisting any data - Authentication or authorization flows ## Target Users - Extension developers building on Alga PSA - Internal developers testing UI kit components - QA engineers validating component behavior ## Primary Flows ### Flow 1: Browse Component Categories User opens the extension → sees tabbed navigation with categories: - **Core**: Button, Input, CustomSelect, Card, Alert, Text, Stack, Badge - **Data**: DataTable - **Dialogs**: Dialog, ConfirmDialog - **Feedback**: Spinner, LoadingIndicator, Tooltip, Progress, Skeleton - **Form**: Checkbox, Switch, TextArea, Label, SearchInput - **Navigation**: Tabs, Drawer, DropdownMenu ### Flow 2: Interact with Component Demo User selects a component → sees: 1. Live interactive example 2. All variants displayed (e.g., Button: primary, secondary, ghost, danger) 3. All sizes displayed (e.g., sm, md, lg) 4. All states (disabled, loading, error, etc.) 5. Props control panel to toggle options in real-time ### Flow 3: Theme Preview User toggles theme → components update to show light/dark mode rendering via the theme bridge. ## UX/UI Notes ### Layout Structure ``` ┌─────────────────────────────────────────────────┐ │ UI Kit Showcase [Theme Toggle] │ ├─────────────────────────────────────────────────┤ │ [Core] [Data] [Dialogs] [Feedback] [Form] [Nav] │ ├─────────────────────────────────────────────────┤ │ │ │ Component Name │ │ ───────────────── │ │ │ │ ┌─────────────────────────────────────────┐ │ │ │ Live Demo Area │ │ │ │ (Interactive component examples) │ │ │ └─────────────────────────────────────────┘ │ │ │ │ Variants │ │ ───────── │ │ [primary] [secondary] [ghost] [danger] │ │ │ │ Sizes │ │ ───── │ │ [sm] [md] [lg] │ │ │ │ States │ │ ────── │ │ ☐ Disabled ☐ Loading │ │ │ └─────────────────────────────────────────────────┘ ``` ### Component Sections Each component demo section includes: - **Title** with component name - **Description** of component purpose - **Live examples** showing the component in action - **Variant showcase** showing all style variants - **Size showcase** showing all size options - **State toggles** for interactive state changes ## Technical Approach ### Extension Structure ``` ee/extensions/samples/ui-kit-showcase/ ├── manifest.json ├── package.json ├── tsconfig.json ├── vite.iframe.config.ts ├── ui/ │ └── index.html └── src/ ├── iframe/ │ └── main.tsx # Entry point ├── components/ │ ├── ThemeBridge.tsx # CSS variable mapping │ ├── DemoSection.tsx # Reusable demo wrapper │ └── PropsPanel.tsx # Interactive props control └── demos/ ├── ButtonDemo.tsx ├── InputDemo.tsx ├── SelectDemo.tsx ├── CardDemo.tsx ├── AlertDemo.tsx ├── TextDemo.tsx ├── StackDemo.tsx ├── BadgeDemo.tsx ├── DataTableDemo.tsx ├── DialogDemo.tsx ├── SpinnerDemo.tsx ├── TooltipDemo.tsx ├── ProgressDemo.tsx ├── SkeletonDemo.tsx ├── CheckboxDemo.tsx ├── SwitchDemo.tsx ├── TextAreaDemo.tsx ├── LabelDemo.tsx ├── SearchInputDemo.tsx ├── TabsDemo.tsx ├── DrawerDemo.tsx └── DropdownMenuDemo.tsx ``` ### Theme Bridge Implementation The theme bridge will: 1. Map `--color-*` variables from the host app to `--alga-*` variables 2. Listen for theme changes (light/dark mode) 3. Apply mappings via a `