diff --git a/PRPs/ui-style-guide-refactor.md b/PRPs/ui-style-guide-refactor.md new file mode 100644 index 00000000..890f0718 --- /dev/null +++ b/PRPs/ui-style-guide-refactor.md @@ -0,0 +1,1852 @@ +name: "UI Style Guide Refactor - 3-Tab Organization with Layout Examples" +description: | + Refactor the Archon style guide into a focused, AI-friendly reference with three distinct tabs: + 1. Style Guide - Traditional design system (typography, colors, spacing) + 2. Layouts - Page layout examples (Projects, Settings, Knowledge) with navigation patterns + 3. Configurators - Interactive component configurators with live code generation + +--- + +## Goal + +**Feature Goal**: Transform the current cluttered style guide into a focused, well-organized reference that serves both human users and AI agents, with clear separation between design foundations, layout patterns, and interactive component configuration. + +**Deliverable**: +- Refactored `/style-guide` page with 3-tab navigation (Style Guide, Layouts, Configurators) +- `components.json` mapping file documenting all reusable components with locations and purposes +- Hard-coded layout examples (Projects, Settings, Knowledge pages) with NO data/functionality +- Simplified style guide tab showing typography, colors, spacing, effects foundations +- Configurators tab with existing interactive component configurators + +**Success Definition**: +- AI agents can quickly find component examples via `components.json` +- Users can see layout options and understand visual hierarchy patterns +- Design system foundations (typography, colors) are clearly documented +- Interactive configurators provide live code generation for components + +## User Persona + +**Target User**: +1. **AI Coding Assistants** (Primary) - Need clear component references and code patterns +2. **Developers** - Building new features, need layout examples and component patterns +3. **Designers** - Understanding and extending the Tron-inspired glassmorphism system + +**Use Case**: +- AI agent needs to build a new page: consults `components.json` → finds layout examples → copies patterns +- Developer adding a feature: reviews Layout tab → picks appropriate page structure → implements with hard-coded examples as reference +- Designer adjusting colors/typography: uses Style Guide tab → interactive configurators for testing + +**User Journey**: +1. Open Style Guide page +2. See 3 clear tabs (Style Guide, Layouts, Configurators) +3. For layouts: Click "Layouts" → See 3 example pages (Projects, Settings, Knowledge) with explanatory text +4. For foundations: Click "Style Guide" → Review typography, colors, spacing, effects +5. For interactive config: Click "Configurators" → Play with glass cards, buttons, forms with live code + +**Pain Points Addressed**: +- **Current**: Style guide is cluttered and mixes foundations, components, patterns, and examples +- **Current**: No clear separation between what's for learning vs what's for interactive configuration +- **Current**: AI agents struggle to find the right component because there's no index/map +- **New**: Clean 3-tab separation makes navigation obvious +- **New**: `components.json` provides quick component discovery for AI +- **New**: Hard-coded layout examples show patterns without complexity of real data + +## Why + +- **For AI Agents**: Reduce context needed - `components.json` points directly to relevant components, layout examples show patterns without implementation details +- **For Developers**: Faster feature development - see complete page layouts (Projects card grid, Settings bento, Knowledge view switching) to copy structure +- **For Design System**: Clearer documentation - separate "what colors exist" from "how to configure a glass card interactively" +- **Integration**: Existing configurators (GlassCard, Button, Modal, etc.) are preserved and moved to Configurators tab +- **User Experience**: Users can quickly understand options (layouts), learn basics (style guide), or interactively configure (configurators) + +## What + +### Success Criteria + +- [ ] 3-tab navigation works smoothly (Style Guide, Layouts, Configurators) +- [ ] `components.json` file maps all reusable components with file paths and usage descriptions +- [ ] Layouts tab shows 3 example pages: + - Projects: Card grid layout with horizontal scroll and project selection + - Settings: Bento grid with CollapsibleSettingsCard components + - Knowledge: View switching example (grid/table) with filters +- [ ] Style Guide tab shows traditional foundations: Typography, Colors, Spacing, Effects +- [ ] Configurators tab contains all existing interactive configurators +- [ ] All layout examples use hard-coded data (no API calls, no real functionality) +- [ ] Navigation explanation describes main nav (left sidebar) vs page nav (top tabs/pills) +- [ ] Each layout example includes explanatory text about when to use it + +## All Needed Context + +### Context Completeness Check + +_This PRP provides complete context for refactoring the style guide without prior Archon knowledge. It includes:_ +- ✅ Existing file structure and patterns to follow +- ✅ Specific component examples to extract (ProjectCard, CollapsibleSettingsCard, view switching) +- ✅ Exact tab structure and organization (3 tabs) +- ✅ Clear separation of concerns (foundations vs layouts vs configurators) +- ✅ `components.json` schema and purpose +- ✅ Hard-coded data examples for each layout type + +### Documentation & References + +```yaml +# Core Style Guide Files - READ THESE FIRST +- file: archon-ui-main/src/features/style-guide/components/StyleGuideView.tsx + why: Current implementation - understand existing structure and tab navigation pattern + pattern: PillNavigation component with sections and items + gotcha: Currently has 4 sections (foundations, components, patterns, examples) - we're consolidating to 3 tabs + +- file: archon-ui-main/src/features/style-guide/shared/PillNavigation.tsx + why: Tab navigation component - will be adapted for 3-tab structure + pattern: Pill-based navigation with dropdown per section + gotcha: Current implementation has dropdown per section - new design has direct tabs + +# Typography & Colors (Keep for Style Guide Tab) +- file: archon-ui-main/src/features/style-guide/foundations/TypographyFoundation.tsx + why: Typography scale and configurator - moves to Style Guide tab + pattern: Interactive configurator with live examples + +- file: archon-ui-main/src/features/style-guide/foundations/ColorsFoundation.tsx + why: Color palette with interactive swatches - moves to Style Guide tab + pattern: Color variants with slider, copy-to-clipboard + +- file: archon-ui-main/src/features/style-guide/foundations/SpacingFoundation.tsx + why: Spacing scale visualization - moves to Style Guide tab + +- file: archon-ui-main/src/features/style-guide/foundations/EffectsFoundation.tsx + why: Glassmorphism effects examples - moves to Style Guide tab + +# Configurators (Move to Configurators Tab) +- file: archon-ui-main/src/features/style-guide/configurators/GlassCardConfigurator.tsx + why: Interactive glass card builder with code generation + pattern: Showcase/Configurator toggle, live preview, code display + +- file: archon-ui-main/src/features/style-guide/configurators/ButtonConfigurator.tsx + why: Button variants configurator - keep in Configurators tab + +- file: archon-ui-main/src/features/style-guide/configurators/ModalConfigurator.tsx + why: Modal preview and configuration - keep in Configurators tab + +- file: archon-ui-main/src/features/style-guide/configurators/FormConfigurator.tsx + why: Form elements configurator - keep in Configurators tab + +- file: archon-ui-main/src/features/style-guide/configurators/TableConfigurator.tsx + why: Table styling configurator - keep in Configurators tab + +- file: archon-ui-main/src/features/style-guide/patterns/NavigationPattern.tsx + why: Pill navigation configurator with dropdown sub-menus + pattern: PillNavigationConfigurator component with live preview and code generation + critical: MOVE this to configurators as NavigationConfigurator - it's an interactive configurator, not a pattern + +# Layout Examples (Source Components for Layouts Tab) +- file: archon-ui-main/src/features/projects/components/ProjectCard.tsx + why: Example card component with glassmorphism, task counts, selection states + pattern: Card with gradient backgrounds, hover effects, neon glow borders + gotcha: Uses real data and optimistic updates - strip to hard-coded example + +- file: archon-ui-main/src/features/projects/components/ProjectList.tsx + why: Horizontal scrolling card grid layout pattern + pattern: Flex container with overflow-x-auto, gap-4 spacing + +- file: archon-ui-main/src/components/ui/CollapsibleSettingsCard.tsx + why: Collapsible card component for bento grid + pattern: PowerButton toggle, AnimatePresence for expand/collapse + gotcha: Uses localStorage - remove for hard-coded example + +- file: archon-ui-main/src/pages/SettingsPage.tsx + why: Bento grid layout example (2-column responsive) + pattern: grid grid-cols-1 lg:grid-cols-2 gap-6 + +- file: archon-ui-main/src/features/knowledge/views/KnowledgeView.tsx + why: View mode switching pattern (grid vs table) + pattern: useState for viewMode, conditional rendering + gotcha: Has real data fetching - create simplified hard-coded version + +- file: archon-ui-main/src/features/knowledge/components/KnowledgeHeader.tsx + why: View toggle buttons (grid/table icons) + pattern: Button group with active state styling + +- file: archon-ui-main/src/features/knowledge/components/DocumentBrowser.tsx + why: Information display modal with tabs, search, and expandable content + pattern: Dialog + Tabs + Search + Collapsible content items + critical: KEY PATTERN for displaying structured information in modals (documents, code examples, logs, etc.) + +# Navigation Patterns +- file: archon-ui-main/src/components/layout/Navigation.tsx + why: Main sidebar navigation with glassmorphism + pattern: Fixed left sidebar, tooltip on hover, active state with neon glow + +- file: archon-ui-main/src/components/layout/MainLayout.tsx + why: Overall page layout structure + pattern: Fixed nav sidebar, content area with padding + +- file: archon-ui-main/src/features/projects/views/ProjectsView.tsx + why: Top tabs navigation example (Docs/Tasks tabs) + pattern: Radix Tabs component with TabsList and TabsTrigger + +# Glassmorphism System +- file: archon-ui-main/src/features/ui/primitives/styles.ts + why: Complete glassmorphism design system with all utilities + pattern: glassmorphism object with background, border, shadow, variants + critical: This is the foundation for all glass styling - reference extensively + +# Tailwind Configuration +- file: archon-ui-main/tailwind.config.js + why: Theme configuration, custom colors, animations + pattern: HSL-based color tokens, custom keyframes + +# Radix UI Primitives - ALL COMPONENTS MUST USE THESE +- file: archon-ui-main/src/features/ui/primitives/tabs.tsx + why: Radix Tabs primitive with glassmorphism styling + pattern: Tabs, TabsList, TabsTrigger, TabsContent components + critical: Use for all tab navigation (Style Guide, Layouts, Configurators main tabs AND within examples) + +- file: archon-ui-main/src/features/ui/primitives/select.tsx + why: Radix Select primitive with glassmorphism and color variants + pattern: Select, SelectTrigger, SelectValue, SelectContent, SelectItem + critical: Use for ALL dropdowns - never use native HTML select + +- file: archon-ui-main/src/features/ui/primitives/dialog.tsx + why: Radix Dialog primitive for modals + pattern: Dialog, DialogTrigger, DialogContent, DialogHeader, DialogTitle, DialogDescription + +- file: archon-ui-main/src/features/ui/primitives/button.tsx + why: Button primitive with glassmorphism variants + pattern: Supports variants (default, destructive, outline, ghost, cyan, purple, green) and sizes (sm, md, lg, icon) + +- file: archon-ui-main/src/features/ui/primitives/card.tsx + why: GlassCard primitive with configurable blur, transparency, tints, edges + pattern: Card component with extensive glassmorphism options + +- file: archon-ui-main/src/features/ui/primitives/checkbox.tsx + why: Radix Checkbox with glassmorphism and color variants + pattern: Checkbox component with color prop (cyan, purple, blue, green, etc.) + +- file: archon-ui-main/src/features/ui/primitives/switch.tsx + why: Radix Switch toggle with glassmorphism + pattern: Switch component with smooth animations + +- file: archon-ui-main/src/features/ui/primitives/tooltip.tsx + why: Radix Tooltip for hover hints + pattern: Tooltip, TooltipTrigger, TooltipContent, TooltipProvider + +- file: archon-ui-main/src/features/ui/primitives/dropdown-menu.tsx + why: Radix DropdownMenu for context menus + pattern: DropdownMenu, DropdownMenuTrigger, DropdownMenuContent, DropdownMenuItem + +- file: archon-ui-main/src/features/ui/primitives/toggle-group.tsx + why: Radix ToggleGroup for mutually exclusive selections + pattern: ToggleGroup, ToggleGroupItem with single/multiple type + +- file: archon-ui-main/src/features/ui/primitives/input.tsx + why: Styled input component (not Radix, but used with Radix forms) + pattern: Input component for text fields + +- file: archon-ui-main/src/features/ui/primitives/label.tsx + why: Label component for form fields + pattern: Label primitive for accessibility + +- file: archon-ui-main/src/features/ui/primitives/radio-group.tsx + why: Radix RadioGroup for mutually exclusive options + pattern: RadioGroup, RadioGroupItem + +- file: archon-ui-main/src/features/ui/primitives/alert-dialog.tsx + why: Radix AlertDialog for confirmation dialogs + pattern: AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogAction + +- url: https://www.radix-ui.com/primitives/docs/overview/introduction + why: Radix UI documentation - understand composition patterns + critical: All primitives use compound component pattern (Root + Sub-components) + source_id: 72f799530ca992a6 +``` + +### Current Codebase Tree + +``` +archon-ui-main/src/features/style-guide/ +├── components/ +│ └── StyleGuideView.tsx # Main view - refactor this +├── shared/ +│ ├── PillNavigation.tsx # Adapt for 3 tabs +│ ├── CodeDisplay.tsx # Reuse for code examples +│ └── ConfiguratorCard.tsx # Reuse for configurators +├── foundations/ # KEEP - move to Style Guide tab +│ ├── TypographyFoundation.tsx +│ ├── ColorsFoundation.tsx +│ ├── SpacingFoundation.tsx +│ └── EffectsFoundation.tsx +├── configurators/ # KEEP - move to Configurators tab +│ ├── GlassCardConfigurator.tsx +│ ├── ButtonConfigurator.tsx +│ ├── ModalConfigurator.tsx +│ ├── FormConfigurator.tsx +│ ├── TableConfigurator.tsx +│ ├── ToggleConfigurator.tsx +│ ├── SwitchConfigurator.tsx +│ ├── CheckboxConfigurator.tsx +│ └── NavigationConfigurator.tsx # MOVE from patterns/NavigationPattern.tsx +├── patterns/ # DELETE - will be replaced by Layouts tab +│ ├── LayoutsPattern.tsx +│ ├── FeedbackPattern.tsx +│ ├── NavigationPattern.tsx # MOVE to configurators/NavigationConfigurator.tsx +│ └── DataDisplayPattern.tsx +└── examples/ # DELETE - replaced by hard-coded layout examples + ├── CompositionsExample.tsx + ├── PagesExample.tsx + ├── WorkflowsExample.tsx + └── RAGSettingsExample.tsx +``` + +### Desired Codebase Tree + +``` +archon-ui-main/src/features/style-guide/ +├── components/ +│ └── StyleGuideView.tsx # REFACTORED - 3-tab structure +├── shared/ +│ ├── SimpleTabNavigation.tsx # NEW - simple 3-tab nav (no dropdowns) +│ ├── CodeDisplay.tsx # KEEP as-is +│ └── ConfiguratorCard.tsx # KEEP as-is +├── tabs/ # NEW DIRECTORY +│ ├── StyleGuideTab.tsx # NEW - contains foundations +│ ├── LayoutsTab.tsx # NEW - contains layout examples +│ └── ConfiguratorsTab.tsx # NEW - contains configurators +├── foundations/ # KEEP - used by StyleGuideTab +│ ├── TypographyFoundation.tsx # KEEP as-is +│ ├── ColorsFoundation.tsx # KEEP as-is +│ ├── SpacingFoundation.tsx # KEEP as-is +│ └── EffectsFoundation.tsx # KEEP as-is +├── configurators/ # KEEP - used by ConfiguratorsTab +│ ├── GlassCardConfigurator.tsx # KEEP as-is +│ ├── ButtonConfigurator.tsx # KEEP as-is +│ ├── ModalConfigurator.tsx # KEEP as-is +│ ├── FormConfigurator.tsx # KEEP as-is +│ ├── TableConfigurator.tsx # KEEP as-is +│ ├── ToggleConfigurator.tsx # KEEP as-is +│ ├── SwitchConfigurator.tsx # KEEP as-is +│ ├── CheckboxConfigurator.tsx # KEEP as-is +│ └── NavigationConfigurator.tsx # MOVED from patterns/NavigationPattern.tsx +└── layouts/ # NEW DIRECTORY + ├── ProjectsLayoutExample.tsx # NEW - hard-coded Projects page (horizontal + sidebar) + ├── SettingsLayoutExample.tsx # NEW - hard-coded Settings bento grid + ├── KnowledgeLayoutExample.tsx # NEW - hard-coded view switching + ├── DocumentBrowserExample.tsx # NEW - information display modal example + └── NavigationExplanation.tsx # NEW - nav patterns explanation + +archon-ui-main/public/ +└── components.json # NEW - component mapping for AI +``` + +### Known Gotchas & Library Quirks + +```typescript +// CRITICAL: Framer Motion AnimatePresence +// When removing items from arrays, use layout prop and unique keys + + {items.map((item) => ( + + {/* content */} + + ))} + + +// CRITICAL: Radix UI Tabs +// Always wrap TabsContent in conditional or it will still render in DOM +{activeTab === "docs" && ( + {/* content */} +)} + +// CRITICAL: Glassmorphism Styles +// Import from primitives/styles.ts, NOT from local constants +import { glassmorphism, glassCard, cn } from '@/features/ui/primitives/styles'; + +// CRITICAL: Hard-coded Data for Layouts +// NO real data, NO API calls, NO useState for data +// ONLY useState for UI state (view mode, selected tab, etc.) +const MOCK_PROJECTS = [ + { id: '1', title: 'Project Alpha', pinned: true, taskCounts: { todo: 5, doing: 2, review: 1, done: 12 } }, + { id: '2', title: 'Project Beta', pinned: false, taskCounts: { todo: 3, doing: 1, review: 0, done: 8 } }, +]; + +// CRITICAL: View Mode Pattern +// Always use type-safe union types for view modes +const [viewMode, setViewMode] = useState<"grid" | "table">("grid"); + +// CRITICAL: Lucide React Icons +// Standard sizes are w-4 h-4 (small), w-5 h-5 (medium), w-6 h-6 (large) +import { Grid, List, LayoutGrid, Table } from 'lucide-react'; + +// CRITICAL: Radix UI Compound Component Pattern +// All Radix components use composition pattern (Root + Sub-components) +// Example - Tabs: +import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/features/ui/primitives/tabs'; + + + Tasks + Docs + + {/* content */} + + +// Example - Select: +import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '@/features/ui/primitives/select'; + + +// CRITICAL: Never use native HTML elements for these interactions +// ❌ WRONG: +// ✅ CORRECT: Use Radix Select primitive +// ❌ WRONG: +// ✅ CORRECT: Use Radix Checkbox primitive +// ❌ WRONG: + ))} + + + ); + }; + ``` + +Task 3: CREATE archon-ui-main/src/features/style-guide/layouts/NavigationExplanation.tsx + - IMPLEMENT: Visual explanation of navigation patterns + - CONTENT: + - Main Navigation: Left sidebar, fixed position (left-6), icon-based, 72px wide + - Content Area: pl-[100px] to accommodate main nav, all page content lives here + - Page Navigation: Top tabs/pills for page sections (e.g., Docs/Tasks) + - View Controls: Toggle buttons for grid/table views + - CRITICAL: Explain that main nav is OUTSIDE content area, page layouts are INSIDE content area + - VISUAL: Show diagram/examples with code snippets + - PLACEMENT: Top of Layouts tab as introduction + +Task 4: CREATE archon-ui-main/src/features/style-guide/layouts/ProjectsLayoutExample.tsx + - IMPLEMENT: Hard-coded Projects page layout example with dual layout modes + - MOCK DATA: 3-4 mock projects with task counts, one pinned + - FEATURES: + - Layout toggle: Horizontal cards (default) OR Sidebar list view + - Horizontal scrolling card grid with project selection highlighting + - Sidebar variant: Smaller card list on left with search bar + - RADIX: Use Tabs primitive for Docs/Tasks navigation example, Input for search + - LAYOUT MODES: + - "horizontal": Cards across top (current ProjectList pattern) + - "sidebar": Vertical list on left WITHIN content area (not covering main nav) + - CRITICAL POSITIONING: + - This component renders INSIDE the main content area (pl-[100px]) + - Main navigation is OUTSIDE at fixed left-6 (72px wide) + - Sidebar layout should use relative positioning, NOT fixed + - Sidebar project list: w-72 (288px) on left, flex-1 for content on right + - Total width respects parent container, doesn't overlap main nav + - STRIP: All real data fetching, optimistic updates, mutations + - KEEP: Visual styling, layout structure, selection state (local) + - PATTERN: + ```tsx + import { Input } from '@/features/ui/primitives/input'; + import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/features/ui/primitives/tabs'; + + const MOCK_PROJECTS = [ + { id: '1', title: 'Design System', pinned: true, taskCounts: { todo: 5, doing: 2, review: 1, done: 12 } }, + { id: '2', title: 'API Integration', pinned: false, taskCounts: { todo: 3, doing: 1, review: 0, done: 8 } }, + { id: '3', title: 'Mobile App', pinned: false, taskCounts: { todo: 8, doing: 0, review: 0, done: 0 } }, + ]; + const [selectedId, setSelectedId] = useState('1'); + const [layoutMode, setLayoutMode] = useState<'horizontal' | 'sidebar'>('horizontal'); + + // Layout toggle buttons (LayoutGrid icon for horizontal, List icon for sidebar) + // Horizontal layout: flex gap-4 overflow-x-auto (current pattern) + // Sidebar layout: flex gap-6 (left sidebar w-72, right content flex-1) - RELATIVE positioning + // Sidebar DOES NOT use fixed/absolute - it's a flex container within the content area + ``` + - EXPLANATION TEXT: "Use this layout for: Horizontal scrolling items (default), OR sidebar navigation for projects. Toggle shows both layout options. Sidebar respects main navigation (doesn't overlap). Cards with real-time data displays." + +Task 5: CREATE archon-ui-main/src/features/style-guide/layouts/SettingsLayoutExample.tsx + - IMPLEMENT: Hard-coded Settings bento grid layout + - MOCK SECTIONS: 4-6 collapsible card sections (Features, API Keys, RAG, Code Extraction, etc.) + - FEATURES: 2-column responsive grid, collapsible cards with PowerButton + - STRIP: All real settings data, localStorage, API calls + - KEEP: Visual layout, expand/collapse animation, accent colors + - PATTERN: + ```tsx +
+ + {/* Mock content */} + + {/* More cards */} +
+ ``` + - EXPLANATION TEXT: "Use this layout for: Settings pages, dashboard widgets, grouped configuration sections" + +Task 6: CREATE archon-ui-main/src/features/style-guide/layouts/KnowledgeLayoutExample.tsx + - IMPLEMENT: Hard-coded Knowledge page with view switching + - MOCK DATA: 6-8 mock knowledge items (docs, websites, etc.) + - FEATURES: View mode toggle (grid/table), filters, search (UI only, no real filtering) + - RADIX: Use ToggleGroup for type filter (All/Technical/Business) + - VIEW MODES: Grid (responsive columns) and Table (overflow-x-auto) + - STRIP: All real data fetching, delete actions, real search/filter logic + - KEEP: View switching logic, layout patterns, visual styling + - PATTERN: + ```tsx + const [viewMode, setViewMode] = useState<"grid" | "table">("grid"); + + {viewMode === "table" ? ( +
+ {/* table content */}
+
+ ) : ( +
+ {/* grid items */} +
+ )} + ``` + - EXPLANATION TEXT: "Use this layout for: Switchable views (grid/table/list), filterable data, search interfaces" + +Task 7: CREATE archon-ui-main/src/features/style-guide/layouts/DocumentBrowserExample.tsx + - IMPLEMENT: Hard-coded information display modal example + - MOCK DATA: 5-6 mock document chunks, 3-4 mock code examples + - FEATURES: Dialog modal with Tabs (Documents/Code), Search input, Expandable content + - RADIX: Dialog, Tabs, Input primitives + - STRIP: All real data fetching, real search logic + - KEEP: Visual structure, tab switching, expand/collapse interaction, search UI + - PATTERN: + ```tsx + import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/features/ui/primitives/dialog'; + import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/features/ui/primitives/tabs'; + import { Input } from '@/features/ui/primitives/input'; + import { Button } from '@/features/ui/primitives/button'; + + const MOCK_DOCUMENTS = [ + { id: '1', title: 'Getting Started', content: 'Full document content...', tags: ['guide', 'intro'] }, + { id: '2', title: 'API Reference', content: 'API documentation...', tags: ['api', 'reference'] }, + ]; + + const MOCK_CODE = [ + { id: '1', language: 'typescript', summary: 'React component example', code: 'const Example = () => {...}' }, + { id: '2', language: 'python', summary: 'FastAPI endpoint', code: '@app.get("/api/items")...' }, + ]; + + const [open, setOpen] = useState(false); + const [activeTab, setActiveTab] = useState<'documents' | 'code'>('documents'); + const [searchQuery, setSearchQuery] = useState(''); + const [expandedItems, setExpandedItems] = useState>(new Set()); + + // Dialog with max-w-4xl, h-[80vh], flex flex-col for full-height modal + // Search input in DialogHeader with Search icon (absolute left-3) + // Tabs with icon + label + counts: "Documents (5)", "Code Examples (3)" + // TabsContent with flex-1 overflow-hidden for scrollable content + // Expandable items: Set for tracking expanded state + // Toggle pattern: ChevronRight (collapsed) / ChevronDown (expanded) + // Content preview: first 200 chars with "Show more" link + // Code display:
 with syntax highlighting classes
+
+    // Example Button to Open Modal:
+    
+    
+    ```
+  - EXPLANATION TEXT: "Use this pattern for: Displaying structured information in modals (documents, logs, code, API responses). Tabs organize different data types, search filters content, items expand/collapse for details."
+
+Task 8: CREATE archon-ui-main/src/features/style-guide/tabs/StyleGuideTab.tsx
+  - IMPLEMENT: Container component for foundations
+  - RENDER: TypographyFoundation, ColorsFoundation, SpacingFoundation, EffectsFoundation
+  - LAYOUT: Vertical stack with spacing
+  - PATTERN:
+    ```tsx
+    
+ + + + +
+ ``` + +Task 9: CREATE archon-ui-main/src/features/style-guide/tabs/LayoutsTab.tsx + - IMPLEMENT: Container component for layout examples + - RENDER: NavigationExplanation, ProjectsLayoutExample, SettingsLayoutExample, KnowledgeLayoutExample, DocumentBrowserExample + - LAYOUT: Vertical stack with large spacing and section headers + - PATTERN: + ```tsx +
+ +
+

Projects Layout

+

+ Horizontal scrolling cards OR sidebar navigation with search. Toggle to see both modes. +

+ +
+
+

Settings Layout

+

+ Bento grid (2-column responsive) with collapsible cards. +

+ +
+
+

Knowledge Layout

+

+ Switchable views (grid/table) with filters and search. +

+ +
+
+

Information Display Modal

+

+ Modal with tabs, search, and expandable content for documents, code, logs. +

+ +
+
+ ``` + +Task 10: MOVE archon-ui-main/src/features/style-guide/patterns/NavigationPattern.tsx + - RENAME: NavigationPattern.tsx → NavigationConfigurator.tsx + - MOVE TO: archon-ui-main/src/features/style-guide/configurators/NavigationConfigurator.tsx + - KEEP: All existing functionality (pill navigation with dropdowns, color variants, size options) + - UPDATE EXPORT: Change export name if needed to match configurator pattern + - VERIFY: Import in ConfiguratorsTab works correctly + +Task 11: CREATE archon-ui-main/src/features/style-guide/tabs/ConfiguratorsTab.tsx + - IMPLEMENT: Container component for all configurators + - RENDER: All 9 configurators (GlassCard, Button, Modal, Form, Table, Toggle, Switch, Checkbox, Navigation) + - LAYOUT: Vertical stack with spacing, section headers per configurator + - PATTERN: + ```tsx + import { GlassCardConfigurator } from '../configurators/GlassCardConfigurator'; + import { ButtonConfigurator } from '../configurators/ButtonConfigurator'; + import { ModalConfigurator } from '../configurators/ModalConfigurator'; + import { FormConfigurator } from '../configurators/FormConfigurator'; + import { TableConfigurator } from '../configurators/TableConfigurator'; + import { ToggleConfigurator } from '../configurators/ToggleConfigurator'; + import { SwitchConfigurator } from '../configurators/SwitchConfigurator'; + import { CheckboxConfigurator } from '../configurators/CheckboxConfigurator'; + import { NavigationConfigurator } from '../configurators/NavigationConfigurator'; + + export const ConfiguratorsTab = () => { + return ( +
+
+

Glass Card Configurator

+ +
+
+

Button Configurator

+ +
+
+

Navigation Configurator

+ +
+
+

Modal Configurator

+ +
+
+

Form Configurator

+ +
+
+

Table Configurator

+ +
+
+

Toggle Configurator

+ +
+
+

Switch Configurator

+ +
+
+

Checkbox Configurator

+ +
+
+ ); + }; + ``` + +Task 12: MODIFY archon-ui-main/src/features/style-guide/components/StyleGuideView.tsx + - REFACTOR: Replace complex navigation with SimpleTabNavigation + - STATE: const [activeTab, setActiveTab] = useState<'style-guide' | 'layouts' | 'configurators'>('style-guide') + - RENDER: Conditional rendering based on activeTab + - REMOVE: All old FOUNDATION_TABS, COMPONENT_TABS, PATTERN_TABS, EXAMPLE_TABS arrays + - KEEP: Header with title and description + - KEEP: ThemeToggle component in top right corner + - PATTERN: + ```tsx + import { SimpleTabNavigation } from '../shared/SimpleTabNavigation'; + import { StyleGuideTab } from '../tabs/StyleGuideTab'; + import { LayoutsTab } from '../tabs/LayoutsTab'; + import { ConfiguratorsTab } from '../tabs/ConfiguratorsTab'; + import { ThemeToggle } from '@/components/ui/ThemeToggle'; + + export const StyleGuideView = () => { + const [activeTab, setActiveTab] = useState<'style-guide' | 'layouts' | 'configurators'>('style-guide'); + + return ( +
+ {/* Header */} +
+
+ +
+
+

+ Archon UI Style Guide +

+

+ Design system foundations, layout patterns, and interactive component configurators. +

+
+
+ + {/* Tab Navigation */} +
+ +
+ + {/* Tab Content */} +
+ {activeTab === 'style-guide' && } + {activeTab === 'layouts' && } + {activeTab === 'configurators' && } +
+
+ ); + }; + ``` + +Task 13: DELETE old pattern and example files (AFTER Tasks 1-12 complete) + - DELETE: archon-ui-main/src/features/style-guide/patterns/ (entire directory) + - DELETE: archon-ui-main/src/features/style-guide/examples/ (entire directory) + - DELETE: archon-ui-main/src/features/style-guide/shared/PillNavigation.tsx (if not used elsewhere) + - VERIFY: No imports referencing deleted files + +Task 14: UPDATE archon-ui-main/src/features/style-guide/index.ts + - MODIFY: Export new tab components and SimpleTabNavigation + - REMOVE: Exports for deleted patterns and examples + - ADD: + ```typescript + export { StyleGuideView } from './components/StyleGuideView'; + export { SimpleTabNavigation } from './shared/SimpleTabNavigation'; + export { StyleGuideTab } from './tabs/StyleGuideTab'; + export { LayoutsTab } from './tabs/LayoutsTab'; + export { ConfiguratorsTab } from './tabs/ConfiguratorsTab'; + ``` +``` + +### Implementation Patterns & Key Details + +```typescript +// SimpleTabNavigation Component Pattern +// archon-ui-main/src/features/style-guide/shared/SimpleTabNavigation.tsx +import { cn } from '@/features/ui/primitives/styles'; + +interface SimpleTabNavigationProps { + activeTab: 'style-guide' | 'layouts' | 'configurators'; + onTabChange: (tab: 'style-guide' | 'layouts' | 'configurators') => void; +} + +export const SimpleTabNavigation = ({ activeTab, onTabChange }: SimpleTabNavigationProps) => { + const tabs = [ + { id: 'style-guide' as const, label: 'Style Guide' }, + { id: 'layouts' as const, label: 'Layouts' }, + { id: 'configurators' as const, label: 'Configurators' }, + ]; + + return ( +
+
+ {tabs.map((tab) => ( + + ))} +
+
+ ); +}; + +// Hard-Coded Project Card Pattern (Simplified) +// archon-ui-main/src/features/style-guide/layouts/ProjectsLayoutExample.tsx +const MOCK_PROJECTS = [ + { + id: '1', + title: 'Design System', + pinned: true, + taskCounts: { todo: 5, doing: 2, review: 1, done: 12 } + }, + { + id: '2', + title: 'API Integration', + pinned: false, + taskCounts: { todo: 3, doing: 1, review: 0, done: 8 } + }, + { + id: '3', + title: 'Mobile App', + pinned: false, + taskCounts: { todo: 8, doing: 0, review: 0, done: 0 } + }, +]; + +// Projects Layout with Horizontal vs Sidebar Toggle +const ProjectsLayoutExample = () => { + const [selectedId, setSelectedId] = useState('1'); + const [layoutMode, setLayoutMode] = useState<'horizontal' | 'sidebar'>('horizontal'); + + return ( +
+ {/* Layout Mode Toggle */} +
+
+ + +
+
+ + {/* Conditional Layout Rendering */} + {layoutMode === 'horizontal' ? ( + // Horizontal scrolling card grid (current pattern) +
+
+ {MOCK_PROJECTS.map((project) => ( + + ))} +
+
+ ) : ( + // Sidebar layout (new pattern) - RELATIVE positioning within content area +
+ {/* Left Sidebar: Project List - w-72 (288px) */} +
+ +
+ {MOCK_PROJECTS.map((project) => ( + + ))} +
+
+ {/* Right: Main Content - flex-1 takes remaining space */} +
+ {/* Example: Tabs for Docs/Tasks */} + + + Tasks + Docs + + + Task content area... + + + Docs content area... + + +
+
+ )} +
+ ); +}; + +// CRITICAL: Sidebar Positioning +// - Main nav: fixed left-6 (72px wide, 24px from left edge) +// - Content area: pl-[100px] (gives space for 72px nav + 28px gap) +// - Sidebar layout: INSIDE content area (relative positioning) +// - Total layout: [Main Nav (72px)] [Gap (28px)] [Content: [Sidebar (288px)] [Gap (24px)] [Main Content (flex-1)]] +// - No overlap with main navigation + +// Full ProjectCard for horizontal layout (w-72, min-h-[180px]) +const SimplifiedProjectCard = ({ project, isSelected, onSelect }) => { + return ( +
onSelect(project.id)} + className={cn( + "relative rounded-xl backdrop-blur-md w-72 min-h-[180px] cursor-pointer", + "transition-all duration-300", + project.pinned + ? "bg-gradient-to-b from-purple-100/80 to-purple-100/50" + : isSelected + ? "bg-gradient-to-b from-white/70 to-white/50" + : "bg-gradient-to-b from-white/80 to-white/60", + // ... rest of styling from ProjectCard.tsx but without real data logic + )} + > + {/* Card content - copy structure from ProjectCard but with mock data */} +
+ ); +}; + +// Compact SidebarProjectCard for sidebar layout (full width, h-auto) +const SimplifiedSidebarProjectCard = ({ project, isSelected, onSelect }) => { + return ( +
onSelect(project.id)} + className={cn( + "relative rounded-lg backdrop-blur-md p-3 cursor-pointer", + "transition-all duration-300", + project.pinned + ? "bg-gradient-to-r from-purple-100/80 to-purple-100/50 border-l-2 border-purple-500" + : isSelected + ? "bg-gradient-to-r from-white/70 to-white/50 border-l-2 border-cyan-500" + : "bg-gradient-to-r from-white/80 to-white/60 border-l-2 border-transparent", + )} + > +

{project.title}

+
+ {project.taskCounts.todo} todo + {project.taskCounts.doing} doing + {project.taskCounts.done} done +
+
+ ); +}; + +// View Mode Toggle Pattern +// archon-ui-main/src/features/style-guide/layouts/KnowledgeLayoutExample.tsx +const ViewModeToggle = ({ viewMode, onViewModeChange }) => { + return ( +
+ + +
+ ); +}; + +// ===== RADIX UI PRIMITIVES - COMPREHENSIVE GUIDE ===== + +// TABS PRIMITIVE PATTERN (for page-level navigation) +// archon-ui-main/src/features/projects/views/ProjectsView.tsx:188-210 +import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/features/ui/primitives/tabs'; + +const PageWithTabs = () => { + const [activeTab, setActiveTab] = useState("tasks"); + + return ( + + + + Tasks + + + Docs + + + + {/* CRITICAL: Wrap TabsContent in conditional to prevent rendering when inactive */} + {activeTab === "tasks" && ( + + {/* Task content */} + + )} + {activeTab === "docs" && ( + + {/* Docs content */} + + )} + + ); +}; + +// SELECT PRIMITIVE PATTERN (for dropdowns, always use this over native select) +// archon-ui-main/src/features/style-guide/configurators/GlassCardConfigurator.tsx:245-262 +import { Select, SelectTrigger, SelectValue, SelectContent, SelectItem } from '@/features/ui/primitives/select'; + +const DropdownExample = () => { + const [value, setValue] = useState("medium"); + + return ( + + ); +}; + +// CHECKBOX PRIMITIVE PATTERN +// archon-ui-main/src/features/style-guide/patterns/NavigationPattern.tsx:423-432 +import { Checkbox } from '@/features/ui/primitives/checkbox'; + +const CheckboxExample = () => { + const [checked, setChecked] = useState(false); + + return ( +
+ + +
+ ); +}; + +// TOGGLE GROUP PRIMITIVE PATTERN (for filters, view modes) +// archon-ui-main/src/features/knowledge/components/KnowledgeHeader.tsx:59-75 +import { ToggleGroup, ToggleGroupItem } from '@/features/ui/primitives/toggle-group'; +import { Asterisk, Terminal, FileCode } from 'lucide-react'; + +const FilterExample = () => { + const [filter, setFilter] = useState("all"); + + return ( + v && setFilter(v)} + aria-label="Filter type" + > + + + + + + + + + + + ); +}; + +// TOOLTIP PRIMITIVE PATTERN +// archon-ui-main/src/components/layout/Navigation.tsx:89-130 +import { Tooltip, TooltipContent, TooltipTrigger, TooltipProvider } from '@/features/ui/primitives/tooltip'; + +// CRITICAL: TooltipProvider must wrap entire app (already in App.tsx) +const TooltipExample = () => { + return ( + + + + + +

Tooltip content

+
+
+ ); +}; + +// DIALOG PRIMITIVE PATTERN (for modals) +// archon-ui-main/src/features/projects/components/NewProjectModal.tsx (reference) +import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/features/ui/primitives/dialog'; + +const ModalExample = () => { + const [open, setOpen] = useState(false); + + return ( + + + + Modal Title + + {/* Modal content */} + + + ); +}; + +// ===== DOCUMENT BROWSER PATTERN - Information Display Modal ===== +// archon-ui-main/src/features/knowledge/components/DocumentBrowser.tsx +// CRITICAL: This is the pattern for displaying structured information in modals + +import { Dialog, DialogContent, DialogHeader, DialogTitle } from '@/features/ui/primitives/dialog'; +import { Tabs, TabsList, TabsTrigger, TabsContent } from '@/features/ui/primitives/tabs'; +import { Input } from '@/features/ui/primitives/input'; +import { ChevronDown, ChevronRight, Code, FileText, Search } from 'lucide-react'; + +const DocumentBrowserExample = ({ open, onOpenChange }: { open: boolean, onOpenChange: (open: boolean) => void }) => { + const [activeTab, setActiveTab] = useState<'documents' | 'code'>('documents'); + const [searchQuery, setSearchQuery] = useState(''); + const [expandedItems, setExpandedItems] = useState>(new Set()); + + const MOCK_DOCUMENTS = [ + { id: '1', title: 'Getting Started', content: 'Long content here...', tags: ['guide', 'intro'] }, + { id: '2', title: 'API Reference', content: 'API documentation...', tags: ['api', 'reference'] }, + ]; + + const MOCK_CODE = [ + { id: '1', language: 'typescript', summary: 'React component', code: 'const Example = () => {...}', file_path: 'src/components/Example.tsx' }, + { id: '2', language: 'python', summary: 'FastAPI endpoint', code: '@app.get("/api/items")...', file_path: 'src/api/routes.py' }, + ]; + + const toggleExpanded = (id: string) => { + setExpandedItems(prev => { + const next = new Set(prev); + if (next.has(id)) next.delete(id); + else next.add(id); + return next; + }); + }; + + return ( + + + + Document Browser +
+
+ + setSearchQuery(e.target.value)} + className="pl-10 bg-black/30 border-white/10" + /> +
+
+
+ + setActiveTab(v as any)} className="flex-1 flex flex-col"> + + + + Documents ({MOCK_DOCUMENTS.length}) + + + + Code ({MOCK_CODE.length}) + + + + +
+ {MOCK_DOCUMENTS.map((doc) => { + const isExpanded = expandedItems.has(doc.id); + const preview = doc.content.substring(0, 200); + const needsExpansion = doc.content.length > 200; + + return ( +
+

+ {needsExpansion && ( + + )} + {doc.title} +

+
+ {isExpanded || !needsExpansion ? doc.content : `${preview}...`} +
+ {doc.tags && ( +
+ {doc.tags.map(tag => ( + + {tag} + + ))} +
+ )} +
+ ); + })} +
+
+ + +
+ {MOCK_CODE.map((example) => ( +
+
+
+ + + {example.language} + +
+ {example.file_path} +
+
{example.summary}
+
+                    {example.code}
+                  
+
+ ))} +
+
+
+
+
+ ); +}; +``` + +## Validation Loop + +### Level 1: Syntax & Style (Immediate Feedback) + +```bash +# Run after each file creation - fix before proceeding +cd archon-ui-main + +# TypeScript type checking +npx tsc --noEmit + +# Biome for features directory +npm run biome + +# Expected: Zero errors. If errors exist, READ output and fix before proceeding. +``` + +### Level 2: Component Validation (Build Testing) + +```bash +# Build the frontend to ensure no import errors +cd archon-ui-main +npm run build + +# Expected: Clean build with no errors +# Common issues: +# - Missing imports (add them) +# - Circular dependencies (refactor imports) +# - Type mismatches (fix type definitions) +``` + +### Level 3: Visual Validation (Manual Testing) + +```bash +# Start dev server +cd archon-ui-main +npm run dev + +# Manual checks: +# 1. Navigate to http://localhost:3737/style-guide +# 2. Verify 3 tabs appear (Style Guide, Layouts, Configurators) +# 3. Click each tab and verify content renders: +# - Style Guide: Typography, Colors, Spacing, Effects visible +# - Layouts: Navigation explanation, 3 layout examples visible +# - Configurators: All 8 configurators render correctly +# 4. In Layouts tab, test each example: +# - Projects: Click different project cards, see selection change +# - Settings: Click PowerButton icons, see cards expand/collapse +# - Knowledge: Toggle grid/table view, see layout switch +# 5. In Configurators tab, test one configurator: +# - GlassCard: Change settings, see live preview update, see code generate +# 6. Verify components.json accessible at http://localhost:3737/components.json +``` + +### Level 4: AI-Friendliness Validation + +```bash +# Test components.json structure +curl http://localhost:3737/components.json | jq '.' + +# Expected output: Valid JSON with categories, components, paths, usage +# Verify AI can parse: +# - Each component has "name", "path", "usage" +# - Paths are relative from project root +# - Examples point to specific line numbers + +# Simulated AI Query Test: +# Query: "How do I create a horizontal scrolling card layout?" +# AI should: +# 1. Check components.json → find "CardGridLayout" +# 2. See path: archon-ui-main/src/features/projects/components/ProjectList.tsx:100-117 +# 3. See pattern: "flex gap-4 overflow-x-auto with min-w-max" +# 4. Navigate to Layouts tab for visual example +``` + +## Final Validation Checklist + +### Technical Validation + +- [ ] All 14 implementation tasks completed successfully +- [ ] No TypeScript errors: `npx tsc --noEmit` +- [ ] No linting errors: `npm run biome` +- [ ] Clean build: `npm run build` +- [ ] Frontend dev server runs without errors: `npm run dev` + +### Feature Validation + +- [ ] 3 tabs render correctly (Style Guide, Layouts, Configurators) +- [ ] Tab navigation works smoothly (click transitions, active states) +- [ ] Style Guide tab shows all 4 foundations (Typography, Colors, Spacing, Effects) +- [ ] Layouts tab shows Navigation explanation + 4 layout examples (Projects, Settings, Knowledge, DocumentBrowser) +- [ ] Configurators tab shows all 9 configurators (GlassCard, Button, Navigation, Modal, Form, Table, Toggle, Switch, Checkbox) +- [ ] All layout examples use hard-coded data (no API calls visible in Network tab) +- [ ] Projects layout: Can select different mock projects, see styling change +- [ ] Settings layout: Can expand/collapse mock cards with PowerButton +- [ ] Knowledge layout: Can toggle grid/table view modes +- [ ] DocumentBrowser layout: Can open modal, switch tabs, see expandable content +- [ ] Projects sidebar mode: Sidebar doesn't cover main navigation (properly positioned) +- [ ] components.json file accessible at /components.json URL +- [ ] components.json has valid JSON structure +- [ ] All Radix primitives used (no native HTML selects, checkboxes, etc.) + +### Code Quality Validation + +- [ ] Follows Archon vertical slice architecture (features own their code) +- [ ] Uses glassmorphism styles from primitives/styles.ts +- [ ] All hard-coded examples clearly marked with MOCK_ prefix for data +- [ ] No real data fetching in layout examples (no useQuery, no service calls) +- [ ] Proper TypeScript typing (no `any` types) +- [ ] Follows existing naming conventions (camelCase for functions, PascalCase for components) +- [ ] No console.log statements left in code +- [ ] Comments explain "why" not "what" where needed + +### User Experience Validation + +- [ ] Tab labels are clear and descriptive +- [ ] Layout examples have explanatory text ("Use this layout for...") +- [ ] Navigation explanation is easy to understand +- [ ] Interactive elements have hover states +- [ ] Glassmorphism styling is consistent across all examples +- [ ] Dark mode works correctly for all tabs +- [ ] Responsive layout works on mobile, tablet, desktop +- [ ] No visual glitches or overlapping elements + +### AI-Friendliness Validation + +- [ ] components.json is valid JSON and parseable +- [ ] All component paths are correct and relative to project root +- [ ] Usage descriptions are clear and actionable +- [ ] Examples include specific line numbers where helpful +- [ ] Component categories make logical sense (navigation, layouts, cards, buttons) +- [ ] Pattern descriptions use code-friendly terminology +- [ ] No ambiguous component names + +--- + +## Anti-Patterns to Avoid + +### File Organization Anti-Patterns + +- ❌ Don't create components outside the `features/style-guide` directory +- ❌ Don't mix layout examples with real feature code (Projects, Settings, Knowledge) +- ❌ Don't leave old pattern/example files after refactor +- ❌ Don't create nested subdirectories beyond `tabs/` and `layouts/` + +### Code Anti-Patterns + +- ❌ Don't use real data fetching in layout examples (no useQuery, no API calls) +- ❌ Don't import glassmorphism styles from anywhere except `features/ui/primitives/styles.ts` +- ❌ Don't create new glassmorphism constants - use existing `glassmorphism` and `glassCard` objects +- ❌ Don't hardcode colors - use Tailwind classes and theme variables +- ❌ Don't use `any` types - always provide proper TypeScript types +- ❌ Don't mix Framer Motion animation patterns - follow existing component patterns + +### State Management Anti-Patterns + +- ❌ Don't use useState for mock data in layout examples - define as constants +- ❌ Don't add localStorage persistence to hard-coded layout examples +- ❌ Don't create global state for style guide - keep it component-local +- ❌ Don't use React Context for tab navigation - simple prop drilling is fine + +### Styling Anti-Patterns + +- ❌ Don't inline style objects - use Tailwind classes +- ❌ Don't create custom CSS files - use Tailwind utilities +- ❌ Don't duplicate glassmorphism patterns - import from primitives +- ❌ Don't use arbitrary values without reason - prefer Tailwind tokens +- ❌ Don't forget dark mode variants - always include `dark:` prefixes + +### Documentation Anti-Patterns + +- ❌ Don't create verbose explanatory text - keep it concise (1-2 sentences) +- ❌ Don't include code comments in components.json - keep it data-only +- ❌ Don't use generic descriptions - be specific ("horizontal scrolling card grid" not "card layout") +- ❌ Don't forget to update components.json when adding new layout patterns + +### Radix UI Anti-Patterns + +- ❌ Don't use native HTML form elements (``, ``) +- ❌ Don't import from `@radix-ui/react-*` directly - import from `@/features/ui/primitives/*` +- ❌ Don't create custom styled versions of Radix components - use existing primitives +- ❌ Don't forget compound component pattern - use all required parts (Trigger, Content, Item, etc.) +- ❌ Don't skip accessibility props (aria-label, aria-labelledby, id for labels) +- ❌ Don't forget TooltipProvider wrapper (already in App.tsx, don't add again) +- ❌ Don't use incorrect Radix data attributes (use `data-[state=active]` not `.active` class) +- ❌ Don't forget asChild prop when wrapping custom elements in Radix Trigger components + +--- + +## Confidence Score + +**10/10** - One-pass implementation success likelihood + +**Reasoning**: +- ✅ Complete file structure provided (current → desired) +- ✅ All source components identified with exact file paths and line numbers +- ✅ All 9 configurators documented (including NavigationConfigurator that was in patterns) +- ✅ Comprehensive Radix UI primitive documentation with code examples +- ✅ Detailed implementation tasks (14 tasks) with code patterns +- ✅ Hard-coded data examples for each layout type with exact mock data structures +- ✅ components.json schema includes all Radix primitives with package names and "information_display" category +- ✅ Clear separation of concerns (3 tabs with explicit purpose) +- ✅ Validation checklist covers technical, feature, UX, and AI aspects (updated to 14 tasks, 4 layout examples) +- ✅ Anti-patterns section includes Radix-specific gotchas (8 specific rules) +- ✅ Comprehensive Radix UI patterns section with 7 primitive examples (added DocumentBrowser) +- ✅ All layout examples specify which Radix components to use +- ✅ Explicit guidance on NOT using native HTML elements +- ✅ DocumentBrowser pattern added for information display modals +- ✅ Sidebar layout positioning clarified (doesn't cover main nav, uses relative positioning) + +**No Deductions**: All critical information provided, including: +- NavigationConfigurator (moved from patterns to configurators) +- DocumentBrowser pattern for structured information display +- Complete Radix UI primitive reference with compound component patterns +- Exact code examples for Tabs, Select, Checkbox, ToggleGroup, Tooltip, Dialog, DocumentBrowser +- Clear guidance on when to use Radix vs styled buttons +- Component mapping includes Radix package names and all 16 primitives +- Sidebar layout respects main navigation positioning (pl-[100px] content area) + +--- + +## Additional Notes + +### For the Implementing Agent + +1. **Start with components.json** - This gives you a map of what needs to be created +2. **Create SimpleTabNavigation first** - You'll need this for the main refactor +3. **Move NavigationPattern → NavigationConfigurator** - Simple rename and file move (Task 10) +4. **Create tab container components** (StyleGuideTab, LayoutsTab, ConfiguratorsTab) before refactoring StyleGuideView +5. **For layout examples**: Copy component structure, strip functionality, add mock data +6. **CRITICAL: Use only Radix primitives** - Never use native HTML ``, etc. +7. **Import Radix from primitives** - Always `@/features/ui/primitives/*`, never direct `@radix-ui/*` +8. **Sidebar positioning**: Ensure sidebar layouts use relative positioning within content area (pl-[100px]) +9. **DocumentBrowser**: Full modal with tabs, search, expandable content - use Set for expanded state +10. **Test each tab independently** before moving to the next +11. **Delete old files last** after verifying new implementation works + +### Radix UI Quick Reference + +**When implementing layout examples, use these Radix primitives:** + +| Native HTML | ❌ WRONG | ✅ CORRECT Radix Primitive | Import Path | +|-------------|----------|---------------------------|-------------| +| `` | `@/features/ui/primitives/select` | +| `` | Native checkbox | `` | `@/features/ui/primitives/checkbox` | +| `` | Native radio | `` | `@/features/ui/primitives/radio-group` | +| Tab buttons | Custom button tabs | `` | `@/features/ui/primitives/tabs` | +| Modal backdrop | Custom modal | `` | `@/features/ui/primitives/dialog` | +| Toggle buttons | Button group | `` | `@/features/ui/primitives/toggle-group` | +| Hover tooltip | CSS :hover | `` | `@/features/ui/primitives/tooltip` | +| Context menu | Custom dropdown | `` | `@/features/ui/primitives/dropdown-menu` | + +**Color Prop Pattern:** +All Archon Radix primitives support color prop for theme variants: +```tsx +Tab + + +``` + +Available colors: `cyan`, `blue`, `purple`, `green`, `orange`, `pink` + +### Complete List of Archon Radix Primitives + +**Available in `archon-ui-main/src/features/ui/primitives/`:** + +1. ✅ **Tabs** - Tab navigation with color variants (`tabs.tsx`) +2. ✅ **Select** - Dropdown select (`select.tsx`) +3. ✅ **Dialog** - Modal dialogs (`dialog.tsx`) +4. ✅ **Checkbox** - Checkbox with colors (`checkbox.tsx`) +5. ✅ **Switch** - Toggle switch (`switch.tsx`) +6. ✅ **Tooltip** - Hover tooltips (`tooltip.tsx`) +7. ✅ **DropdownMenu** - Context menus (`dropdown-menu.tsx`) +8. ✅ **ToggleGroup** - Button groups (`toggle-group.tsx`) +9. ✅ **RadioGroup** - Radio buttons (`radio-group.tsx`) +10. ✅ **AlertDialog** - Confirmation dialogs (`alert-dialog.tsx`) +11. ✅ **Button** - Button with variants (`button.tsx`) +12. ✅ **Card** - GlassCard component (`card.tsx`) +13. ✅ **Input** - Styled text input (`input.tsx`) +14. ✅ **Label** - Form labels (`label.tsx`) +15. ✅ **Toast** - Toast notifications (`toast.tsx`) +16. ✅ **Pill** - Custom pill component (`pill.tsx`) + +**When building layout examples, use these primitives exclusively:** +- Forms → Select, Checkbox, Switch, RadioGroup, Input, Label +- Navigation → Tabs (page-level), buttons (styled pill groups) +- Filters → ToggleGroup +- Modals → Dialog, AlertDialog +- Interactive → Tooltip, DropdownMenu +- Display → Card, Button + +### Implementation Summary + +**Files to CREATE (10 new files):** +1. `archon-ui-main/public/components.json` - Component mapping +2. `archon-ui-main/src/features/style-guide/shared/SimpleTabNavigation.tsx` - 3-tab nav +3. `archon-ui-main/src/features/style-guide/layouts/NavigationExplanation.tsx` - Nav patterns doc +4. `archon-ui-main/src/features/style-guide/layouts/ProjectsLayoutExample.tsx` - Projects (horizontal + sidebar) +5. `archon-ui-main/src/features/style-guide/layouts/SettingsLayoutExample.tsx` - Settings bento grid +6. `archon-ui-main/src/features/style-guide/layouts/KnowledgeLayoutExample.tsx` - Knowledge grid/table +7. `archon-ui-main/src/features/style-guide/layouts/DocumentBrowserExample.tsx` - Info display modal +8. `archon-ui-main/src/features/style-guide/tabs/StyleGuideTab.tsx` - Foundations container +9. `archon-ui-main/src/features/style-guide/tabs/LayoutsTab.tsx` - Layouts container +10. `archon-ui-main/src/features/style-guide/tabs/ConfiguratorsTab.tsx` - Configurators container + +**Files to MOVE (1 file):** +- `patterns/NavigationPattern.tsx` → `configurators/NavigationConfigurator.tsx` + +**Files to MODIFY (2 files):** +- `archon-ui-main/src/features/style-guide/components/StyleGuideView.tsx` - Main refactor +- `archon-ui-main/src/features/style-guide/index.ts` - Update exports + +**Files to DELETE (3 directories):** +- `archon-ui-main/src/features/style-guide/patterns/` - All files +- `archon-ui-main/src/features/style-guide/examples/` - All files +- `archon-ui-main/src/features/style-guide/shared/PillNavigation.tsx` - If not used elsewhere + +**Files to KEEP (13 files - no changes):** +- All foundations (Typography, Colors, Spacing, Effects) +- All configurators (GlassCard, Button, Modal, Form, Table, Toggle, Switch, Checkbox) +- Shared utilities (CodeDisplay, ConfiguratorCard, etc.) + +### Future Enhancements (Out of Scope) + +- Interactive layout customizer (adjust grid columns, spacing, etc.) +- Export layout examples as code snippets +- Component variant preview gallery +- Search functionality in components.json +- Layout comparison tool (side-by-side) +- Responsive breakpoint visualizer +- Code syntax highlighting library integration for DocumentBrowser diff --git a/archon-ui-main/src/features/style-guide/components.json b/archon-ui-main/src/features/style-guide/components.json new file mode 100644 index 00000000..06d7e533 --- /dev/null +++ b/archon-ui-main/src/features/style-guide/components.json @@ -0,0 +1,204 @@ +{ + "$schema": "https://json-schema.org/draft-07/schema#", + "version": "1.0.0", + "description": "Archon UI Component Reference for AI Agents and Developers", + "categories": { + "navigation": { + "description": "Navigation components for app and page-level navigation", + "components": [ + { + "name": "MainNavigation", + "path": "archon-ui-main/src/components/layout/Navigation.tsx", + "usage": "Fixed left sidebar navigation with glassmorphism, tooltips, and active state indicators", + "props": ["className?"], + "example": "Fixed position, icon-based, tooltip on hover, neon glow on active" + }, + { + "name": "PageTabs", + "path": "archon-ui-main/src/features/ui/primitives/tabs.tsx (Radix Tabs)", + "usage": "Top-level page navigation tabs (e.g., Docs/Tasks in Projects)", + "props": ["defaultValue", "value", "onValueChange"], + "example": "See Projects page (Docs/Tasks tabs) - archon-ui-main/src/features/projects/views/ProjectsView.tsx:188-210" + }, + { + "name": "ViewToggleButtons", + "path": "archon-ui-main/src/features/knowledge/components/KnowledgeHeader.tsx:88-118", + "usage": "Toggle between grid and table views", + "props": ["viewMode", "onViewModeChange"], + "example": "Grid/List icon buttons with active state styling" + } + ] + }, + "layouts": { + "description": "Page layout patterns", + "components": [ + { + "name": "CardGridLayout", + "path": "archon-ui-main/src/features/projects/components/ProjectList.tsx:100-117", + "usage": "Horizontal scrolling card grid for project cards or similar items", + "pattern": "flex gap-4 overflow-x-auto with min-w-max", + "example": "Projects page - horizontal scrollable cards", + "variant": "horizontal (default)" + }, + { + "name": "SidebarListLayout", + "path": "archon-ui-main/src/features/style-guide/layouts/ProjectsLayoutExample.tsx", + "usage": "Sidebar navigation list with compact cards and search", + "pattern": "Fixed left column (w-72) with vertical list, Input for search, main content on right (flex-1)", + "example": "Projects page sidebar variant - vertical list with smaller cards", + "variant": "sidebar (alternative to horizontal cards)" + }, + { + "name": "BentoGridLayout", + "path": "archon-ui-main/src/pages/SettingsPage.tsx:125-223", + "usage": "Two-column responsive grid for collapsible settings cards", + "pattern": "grid grid-cols-1 lg:grid-cols-2 gap-6", + "example": "Settings page - left/right column layout" + }, + { + "name": "ResponsiveGridLayout", + "path": "archon-ui-main/src/features/knowledge/components/KnowledgeList.tsx:158-183", + "usage": "Responsive grid for card items (1/2/3/4 columns)", + "pattern": "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4", + "example": "Knowledge page grid view" + }, + { + "name": "TableLayout", + "path": "archon-ui-main/src/features/knowledge/components/KnowledgeTable.tsx:68-209", + "usage": "Table with glassmorphism styling, hover states, and action buttons", + "pattern": "overflow-x-auto wrapper with full-width table", + "example": "Knowledge page table view" + } + ] + }, + "cards": { + "description": "Card components for various use cases", + "components": [ + { + "name": "ProjectCard", + "path": "archon-ui-main/src/features/projects/components/ProjectCard.tsx", + "usage": "Card with real-time data (task counts), selection states, pinned indicator", + "features": ["glassmorphism", "hover effects", "neon glow borders", "task count pills", "pin badge"], + "example": "w-72 min-h-[180px] with gradient backgrounds" + }, + { + "name": "CollapsibleSettingsCard", + "path": "archon-ui-main/src/components/ui/CollapsibleSettingsCard.tsx", + "usage": "Collapsible card with PowerButton toggle and flicker animation", + "features": ["expand/collapse", "localStorage persistence", "accent colors"], + "example": "Settings page cards" + }, + { + "name": "GlassCard (Primitive)", + "path": "archon-ui-main/src/features/ui/primitives/card.tsx", + "usage": "Base glassmorphism card with configurable blur, transparency, tints, edges", + "props": ["blur?", "transparency?", "glassTint?", "edgePosition?", "edgeColor?", "size?"], + "example": "See GlassCardConfigurator for all options" + } + ] + }, + "information_display": { + "description": "Patterns for displaying structured information", + "components": [ + { + "name": "DocumentBrowser", + "path": "archon-ui-main/src/features/knowledge/components/DocumentBrowser.tsx", + "usage": "Modal for displaying documents, code, logs, or structured information with tabs and search", + "features": ["Dialog modal", "Tabs navigation", "Search filtering", "Expandable content", "Code syntax highlighting"], + "radix_used": ["Dialog", "Tabs", "Input"], + "pattern": "Dialog + Tabs + Search input + Collapsible items with expand/collapse", + "example": "Knowledge inspector, document viewer, code browser, log viewer" + } + ] + }, + "buttons": { + "description": "Button components and variants", + "components": [ + { + "name": "Button (Primitive)", + "path": "archon-ui-main/src/features/ui/primitives/button.tsx", + "usage": "Base button with glassmorphism variants", + "variants": ["default", "destructive", "outline", "ghost", "cyan", "purple", "green"], + "sizes": ["sm", "md", "lg", "icon"], + "example": "See ButtonConfigurator for all variants" + } + ] + }, + "radix_primitives": { + "description": "Radix UI primitives with Archon glassmorphism styling", + "components": [ + { + "name": "Tabs", + "path": "archon-ui-main/src/features/ui/primitives/tabs.tsx", + "usage": "Tab navigation with color variants and neon glow effects", + "radix_package": "@radix-ui/react-tabs", + "parts": ["Tabs", "TabsList", "TabsTrigger", "TabsContent"], + "props": ["defaultValue", "value", "onValueChange", "color (cyan|blue|purple|orange|green|pink)"], + "example": "Projects page Docs/Tasks tabs" + }, + { + "name": "Select", + "path": "archon-ui-main/src/features/ui/primitives/select.tsx", + "usage": "Dropdown select with glassmorphism and color variants", + "radix_package": "@radix-ui/react-select", + "parts": ["Select", "SelectTrigger", "SelectValue", "SelectContent", "SelectItem"], + "props": ["value", "onValueChange", "color (purple|blue|green|pink|orange|cyan)"], + "example": "Configurators use Select for all dropdowns" + }, + { + "name": "Dialog", + "path": "archon-ui-main/src/features/ui/primitives/dialog.tsx", + "usage": "Modal dialogs with glassmorphism backdrop", + "radix_package": "@radix-ui/react-dialog", + "parts": ["Dialog", "DialogTrigger", "DialogContent", "DialogHeader", "DialogTitle", "DialogDescription"], + "props": ["open", "onOpenChange"], + "example": "NewProjectModal, EditTaskModal" + }, + { + "name": "Checkbox", + "path": "archon-ui-main/src/features/ui/primitives/checkbox.tsx", + "usage": "Styled checkbox with color variants", + "radix_package": "@radix-ui/react-checkbox", + "parts": ["Checkbox"], + "props": ["checked", "onCheckedChange", "color (cyan|purple|blue|green|etc)"], + "example": "Settings toggles, NavigationConfigurator" + }, + { + "name": "Switch", + "path": "archon-ui-main/src/features/ui/primitives/switch.tsx", + "usage": "Toggle switch with smooth animations", + "radix_package": "@radix-ui/react-switch", + "parts": ["Switch"], + "props": ["checked", "onCheckedChange"], + "example": "Feature toggles in Settings" + }, + { + "name": "Tooltip", + "path": "archon-ui-main/src/features/ui/primitives/tooltip.tsx", + "usage": "Hover tooltips with glassmorphism", + "radix_package": "@radix-ui/react-tooltip", + "parts": ["TooltipProvider", "Tooltip", "TooltipTrigger", "TooltipContent"], + "props": ["delayDuration", "side", "align"], + "example": "Navigation sidebar icons" + }, + { + "name": "DropdownMenu", + "path": "archon-ui-main/src/features/ui/primitives/dropdown-menu.tsx", + "usage": "Context menus with glassmorphism", + "radix_package": "@radix-ui/react-dropdown-menu", + "parts": ["DropdownMenu", "DropdownMenuTrigger", "DropdownMenuContent", "DropdownMenuItem"], + "example": "ProjectCardActions, context menus" + }, + { + "name": "ToggleGroup", + "path": "archon-ui-main/src/features/ui/primitives/toggle-group.tsx", + "usage": "Mutually exclusive button group", + "radix_package": "@radix-ui/react-toggle-group", + "parts": ["ToggleGroup", "ToggleGroupItem"], + "props": ["type (single|multiple)", "value", "onValueChange"], + "example": "KnowledgeHeader type filter" + } + ] + } + } +} diff --git a/archon-ui-main/src/features/style-guide/components/StyleGuideView.tsx b/archon-ui-main/src/features/style-guide/components/StyleGuideView.tsx index d2439612..4b51da75 100644 --- a/archon-ui-main/src/features/style-guide/components/StyleGuideView.tsx +++ b/archon-ui-main/src/features/style-guide/components/StyleGuideView.tsx @@ -1,156 +1,58 @@ -import { useState } from 'react'; -import { Palette, Component, Layout, Code } from 'lucide-react'; -import { PillNavigation } from '../shared/PillNavigation'; -import { ThemeToggle } from '../../../components/ui/ThemeToggle'; -import { GlassCardConfigurator } from '../configurators/GlassCardConfigurator'; -import { ButtonConfigurator } from '../configurators/ButtonConfigurator'; -import { ModalConfigurator } from '../configurators/ModalConfigurator'; -import { FormConfigurator } from '../configurators/FormConfigurator'; -import { TableConfigurator } from '../configurators/TableConfigurator'; -import { ToggleConfigurator } from '../configurators/ToggleConfigurator'; -import { SwitchConfigurator } from '../configurators/SwitchConfigurator'; -import { CheckboxConfigurator } from '../configurators/CheckboxConfigurator'; -import { ColorsFoundation } from '../foundations/ColorsFoundation'; -import { TypographyFoundation } from '../foundations/TypographyFoundation'; -import { SpacingFoundation } from '../foundations/SpacingFoundation'; -import { EffectsFoundation } from '../foundations/EffectsFoundation'; -import { LayoutsPattern } from '../patterns/LayoutsPattern'; -import { FeedbackPattern } from '../patterns/FeedbackPattern'; -import { NavigationPattern } from '../patterns/NavigationPattern'; -import { DataDisplayPattern } from '../patterns/DataDisplayPattern'; -import { CompositionsExample } from '../examples/CompositionsExample'; -import { PagesExample } from '../examples/PagesExample'; -import { WorkflowsExample } from '../examples/WorkflowsExample'; -import { RAGSettingsExample } from '../examples/RAGSettingsExample'; - -const FOUNDATION_TABS = [ - { id: 'Colors', label: 'Colors', component: ColorsFoundation }, - { id: 'Typography', label: 'Typography', component: TypographyFoundation }, - { id: 'Spacing', label: 'Spacing', component: SpacingFoundation }, - { id: 'Effects', label: 'Effects', component: EffectsFoundation }, -]; - -const COMPONENT_TABS = [ - { id: 'Cards', label: 'Cards', component: GlassCardConfigurator }, - { id: 'Buttons', label: 'Buttons', component: ButtonConfigurator }, - { id: 'Forms', label: 'Forms', component: FormConfigurator }, - { id: 'Tables', label: 'Tables', component: TableConfigurator }, - { id: 'Modals', label: 'Modals', component: ModalConfigurator }, - { id: 'Toggles', label: 'Toggles', component: ToggleConfigurator }, - { id: 'Switches', label: 'Switches', component: SwitchConfigurator }, - { id: 'Checkboxes', label: 'Checkboxes', component: CheckboxConfigurator }, -]; - -const PATTERN_TABS = [ - { id: 'Layouts', label: 'Layouts', component: LayoutsPattern }, - { id: 'Feedback', label: 'Feedback', component: FeedbackPattern }, - { id: 'Navigation', label: 'Navigation', component: NavigationPattern }, - { id: 'Data Display', label: 'Data Display', component: DataDisplayPattern }, -]; - -const EXAMPLE_TABS = [ - { id: 'Compositions', label: 'Compositions', component: CompositionsExample }, - { id: 'Pages', label: 'Pages', component: PagesExample }, - { id: 'Workflows', label: 'Workflows', component: WorkflowsExample }, - { id: 'RAG Settings', label: 'RAG Settings', component: RAGSettingsExample }, -]; +import { useState } from "react"; +import { Palette, Layout, Settings } from "lucide-react"; +import { PillNavigation, type PillNavigationItem } from "../shared/PillNavigation"; +import { StyleGuideTab } from "../tabs/StyleGuideTab"; +import { LayoutsTab } from "../tabs/LayoutsTab"; +import { ConfiguratorsTab } from "../tabs/ConfiguratorsTab"; +import { ThemeToggle } from "../../../components/ui/ThemeToggle"; export const StyleGuideView = () => { - const [selectedSection, setSelectedSection] = useState('foundations'); - const [selectedComponent, setSelectedComponent] = useState('Colors'); + const [activeTab, setActiveTab] = useState<"style-guide" | "layouts" | "configurators">( + "style-guide", + ); - const handleSectionChange = (section: string) => { - setSelectedSection(section); - // Reset to first item of new section - if (section === 'foundations') setSelectedComponent('Colors'); - else if (section === 'components') setSelectedComponent('Cards'); - else if (section === 'patterns') setSelectedComponent('Layouts'); - else if (section === 'examples') setSelectedComponent('Compositions'); - else setSelectedComponent(null); - }; - - const renderContent = () => { - if (selectedSection === 'foundations' && selectedComponent) { - const tab = FOUNDATION_TABS.find(t => t.id === selectedComponent); - if (tab) { - const FoundationComponent = tab.component; - return ; - } - } - - if (selectedSection === 'components' && selectedComponent) { - const tab = COMPONENT_TABS.find(t => t.id === selectedComponent); - if (tab) { - const ComponentConfigurator = tab.component; - return ; - } - } - - if (selectedSection === 'patterns' && selectedComponent) { - const tab = PATTERN_TABS.find(t => t.id === selectedComponent); - if (tab) { - const PatternComponent = tab.component; - return ; - } - } - - if (selectedSection === 'examples' && selectedComponent) { - const tab = EXAMPLE_TABS.find(t => t.id === selectedComponent); - if (tab) { - const ExampleComponent = tab.component; - return ; - } - } - - // Default content for other sections or no selection - const sectionContent = { - foundations: { icon: , text: "Select a foundation element from the dropdown above" }, - components: { icon: , text: "Select a component from the dropdown above" }, - patterns: { icon: , text: "Select a pattern from the dropdown above" }, - examples: { icon: , text: "Select an example from the dropdown above" } - }; - - const content = sectionContent[selectedSection as keyof typeof sectionContent]; - - return ( -
- {content.icon} -

{content.text}

-
- ); - }; + const navigationItems: PillNavigationItem[] = [ + { id: "style-guide", label: "Style Guide", icon: }, + { id: "layouts", label: "Layouts", icon: }, + { id: "configurators", label: "Configurators", icon: }, + ]; return (
{/* Header */}
- {/* Theme Toggle in top right */}
-
-

Interactive Style Guide

+

+ Archon UI Style Guide +

- Configure and preview Archon's glassmorphism components with live code generation. + Design system foundations, layout patterns, and interactive component configurators.

- {/* Pill Navigation */} + {/* Tab Navigation - Blue Pill Navigation */}
setActiveTab(id as typeof activeTab)} + colorVariant="blue" + showIcons={true} + showText={true} + hasSubmenus={false} />
- {/* Content */} + {/* Tab Content */}
- {renderContent()} + {activeTab === "style-guide" && } + {activeTab === "layouts" && } + {activeTab === "configurators" && }
); -}; \ No newline at end of file +}; diff --git a/archon-ui-main/src/features/style-guide/patterns/NavigationPattern.tsx b/archon-ui-main/src/features/style-guide/configurators/NavigationConfigurator.tsx similarity index 100% rename from archon-ui-main/src/features/style-guide/patterns/NavigationPattern.tsx rename to archon-ui-main/src/features/style-guide/configurators/NavigationConfigurator.tsx diff --git a/archon-ui-main/src/features/style-guide/examples/CompositionsExample.tsx b/archon-ui-main/src/features/style-guide/examples/CompositionsExample.tsx deleted file mode 100644 index dc3289df..00000000 --- a/archon-ui-main/src/features/style-guide/examples/CompositionsExample.tsx +++ /dev/null @@ -1,638 +0,0 @@ -import React, { useState } from 'react'; -import { Card } from '@/features/ui/primitives/card'; -import type { GlowColor } from '../types'; -import { Button } from '@/features/ui/primitives/button'; -import { CodeDisplay } from '../shared/CodeDisplay'; -import { LivePreview } from '../shared/LivePreview'; -import { cn, glassmorphism } from '@/features/ui/primitives/styles'; -import { - Home, - Settings, - User, - FileText, - BarChart, - Plus, - Search, - Bell, - MoreVertical, - Calendar, -} from 'lucide-react'; - -interface ExampleComposition { - id: string; - name: string; - description: string; - usage: string; - component: React.ComponentType; -} - -// Complete Dashboard Composition -const DashboardComposition = () => { - return ( -
- {/* Top Navigation */} - -
-
-
- Archon -
- -
- - - -
-
- - -
- {/* Sidebar */} - -
- -
-
- - {/* Main Content */} -
- {/* Stats Grid */} -
- {[ - { label: 'Projects', value: '24', color: 'purple' }, - { label: 'Tasks', value: '156', color: 'blue' }, - { label: 'Team', value: '8', color: 'green' } - ].map((stat) => ( - -

{stat.value}

-

{stat.label}

-
- ))} -
- - {/* Content Grid */} -
- -

Recent Activity

-
- {['Project updated', 'Task completed', 'New member'].map((activity, i) => ( -
- {activity} -
- ))} -
-
- -

Quick Actions

-
- - -
-
-
-
-
-
- ); -}; - -// Project Card Collection -const ProjectCardsComposition = () => { - const projects = [ - { title: 'Alpha', status: 'Active', progress: 75, color: 'purple' }, - { title: 'Beta', status: 'Review', progress: 90, color: 'blue' }, - { title: 'Gamma', status: 'Planning', progress: 25, color: 'orange' } - ]; - - return ( -
-
-

Projects

- -
- -
- {projects.map((project) => ( - -
-

Project {project.title}

- -
- -

- Development project with team collaboration features. -

- -
-
- Progress - {project.progress}% -
-
-
-
-
- -
- - - Due: 2 weeks - - - - 5 members - -
- - ))} -
-
- ); -}; - -// Modal with Form -const ModalFormComposition = () => { - const [showModal, setShowModal] = useState(false); - - return ( -
-
- -
- - {showModal && ( -
- -
-

Create New Task

- -
- -
-
- - -
- -
- - -
- -
- -