create-lego-one 2.0.10 → 2.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (242) hide show
  1. package/dist/index.cjs +179 -0
  2. package/dist/index.cjs.map +1 -1
  3. package/package.json +5 -3
  4. package/template/.cursor/rules/rules.mdc +639 -0
  5. package/template/.dockerignore +58 -0
  6. package/template/.env.example +18 -0
  7. package/template/.eslintignore +5 -0
  8. package/template/.eslintrc.js +28 -0
  9. package/template/.prettierignore +6 -0
  10. package/template/.prettierrc +11 -0
  11. package/template/CLAUDE.md +634 -0
  12. package/template/Dockerfile +67 -0
  13. package/template/PROMPT.md +457 -0
  14. package/template/README.md +325 -0
  15. package/template/docker-compose.yml +48 -0
  16. package/template/docker-entrypoint.sh +23 -0
  17. package/template/docs/checkpoints/.template.md +64 -0
  18. package/template/docs/checkpoints/framework/01-infrastructure-setup.md +132 -0
  19. package/template/docs/checkpoints/framework/02-pocketbase-setup.md +155 -0
  20. package/template/docs/checkpoints/framework/03-host-kernel.md +170 -0
  21. package/template/docs/checkpoints/framework/04-auth-system.md +163 -0
  22. package/template/docs/checkpoints/framework/phase-05-multitenancy-rbac.md +223 -0
  23. package/template/docs/checkpoints/framework/phase-06-ui-components.md +260 -0
  24. package/template/docs/checkpoints/framework/phase-07-communication-system.md +276 -0
  25. package/template/docs/checkpoints/framework/phase-08-plugin-system.md +91 -0
  26. package/template/docs/checkpoints/framework/phase-09-dashboard-plugin.md +111 -0
  27. package/template/docs/checkpoints/framework/phase-10-todo-plugin.md +169 -0
  28. package/template/docs/checkpoints/framework/phase-11-testing.md +264 -0
  29. package/template/docs/checkpoints/framework/phase-12-deployment.md +294 -0
  30. package/template/docs/checkpoints/framework/phase-13-documentation.md +312 -0
  31. package/template/docs/framework/plans/00-index.md +164 -0
  32. package/template/docs/framework/plans/01-infrastructure-setup.md +855 -0
  33. package/template/docs/framework/plans/02-pocketbase-setup.md +1374 -0
  34. package/template/docs/framework/plans/03-host-kernel.md +1518 -0
  35. package/template/docs/framework/plans/04-auth-system.md +1466 -0
  36. package/template/docs/framework/plans/05-multitenancy-rbac.md +1527 -0
  37. package/template/docs/framework/plans/06-ui-components.md +1478 -0
  38. package/template/docs/framework/plans/07-communication-system.md +1106 -0
  39. package/template/docs/framework/plans/08-plugin-system.md +1179 -0
  40. package/template/docs/framework/plans/09-dashboard-plugin.md +1137 -0
  41. package/template/docs/framework/plans/10-todo-plugin.md +1343 -0
  42. package/template/docs/framework/plans/11-testing.md +935 -0
  43. package/template/docs/framework/plans/12-deployment.md +896 -0
  44. package/template/docs/framework/prompts/0-boilerplate-modernjs.md +151 -0
  45. package/template/docs/framework/research/00-modernjs-audit.md +488 -0
  46. package/template/docs/framework/research/01-system-blueprint.md +721 -0
  47. package/template/docs/framework/research/02-data-migration-protocol.md +699 -0
  48. package/template/docs/framework/research/03-host-setup.md +714 -0
  49. package/template/docs/framework/research/04-plugin-architecture.md +645 -0
  50. package/template/docs/framework/research/05-slot-injection-pattern.md +671 -0
  51. package/template/docs/framework/research/06-cli-strategy.md +615 -0
  52. package/template/docs/framework/research/07-deployment.md +629 -0
  53. package/template/docs/framework/research/README.md +282 -0
  54. package/template/docs/framework/setup/00-index.md +210 -0
  55. package/template/docs/framework/setup/01-framework-structure.md +308 -0
  56. package/template/docs/framework/setup/02-development-workflow.md +405 -0
  57. package/template/docs/framework/setup/03-environment-setup.md +215 -0
  58. package/template/docs/framework/setup/04-kernel-architecture.md +499 -0
  59. package/template/docs/framework/setup/05-plugin-system.md +620 -0
  60. package/template/docs/framework/setup/06-communication-patterns.md +451 -0
  61. package/template/docs/framework/setup/07-plugin-development.md +582 -0
  62. package/template/docs/framework/setup/08-component-library.md +658 -0
  63. package/template/docs/framework/setup/09-data-integration.md +609 -0
  64. package/template/docs/framework/setup/10-auth-rbac.md +497 -0
  65. package/template/docs/framework/setup/11-hooks-api.md +393 -0
  66. package/template/docs/framework/setup/12-components-api.md +665 -0
  67. package/template/docs/framework/setup/13-deployment-guide.md +566 -0
  68. package/template/docs/framework/setup/README.md +548 -0
  69. package/template/host/e2e/auth.spec.ts +38 -0
  70. package/template/host/e2e/layout.spec.ts +38 -0
  71. package/template/host/modern.config.ts +19 -0
  72. package/template/host/package.json +71 -0
  73. package/template/host/playwright.config.ts +34 -0
  74. package/template/host/postcss.config.mjs +6 -0
  75. package/template/host/src/App.tsx +6 -0
  76. package/template/host/src/bootstrap.tsx +74 -0
  77. package/template/host/src/global.css +59 -0
  78. package/template/host/src/index.ts +2 -0
  79. package/template/host/src/kernel/__tests__/lib-utils.test.ts +32 -0
  80. package/template/host/src/kernel/__tests__/rbac-hooks.test.tsx +114 -0
  81. package/template/host/src/kernel/__tests__/rbac-utils.test.ts +108 -0
  82. package/template/host/src/kernel/auth/ProtectedRoute.tsx +41 -0
  83. package/template/host/src/kernel/auth/components/LoginForm.tsx +97 -0
  84. package/template/host/src/kernel/auth/components/LogoutButton.tsx +79 -0
  85. package/template/host/src/kernel/auth/hooks.ts +174 -0
  86. package/template/host/src/kernel/auth/index.ts +5 -0
  87. package/template/host/src/kernel/auth/schemas.ts +27 -0
  88. package/template/host/src/kernel/auth/service.ts +197 -0
  89. package/template/host/src/kernel/auth/types.ts +36 -0
  90. package/template/host/src/kernel/channels/ChannelBus.ts +181 -0
  91. package/template/host/src/kernel/channels/ChannelProvider.tsx +57 -0
  92. package/template/host/src/kernel/channels/events.ts +27 -0
  93. package/template/host/src/kernel/channels/hooks.ts +168 -0
  94. package/template/host/src/kernel/channels/index.ts +6 -0
  95. package/template/host/src/kernel/channels/integrations/ToastIntegration.tsx +60 -0
  96. package/template/host/src/kernel/channels/plugin-hooks.ts +72 -0
  97. package/template/host/src/kernel/channels/types.ts +112 -0
  98. package/template/host/src/kernel/components/__tests__/Badge.test.tsx +35 -0
  99. package/template/host/src/kernel/components/__tests__/Button.test.tsx +63 -0
  100. package/template/host/src/kernel/components/__tests__/Input.test.tsx +64 -0
  101. package/template/host/src/kernel/components/index.ts +32 -0
  102. package/template/host/src/kernel/components/ui/alert.tsx +58 -0
  103. package/template/host/src/kernel/components/ui/avatar.tsx +47 -0
  104. package/template/host/src/kernel/components/ui/badge.tsx +35 -0
  105. package/template/host/src/kernel/components/ui/button.tsx +50 -0
  106. package/template/host/src/kernel/components/ui/card.tsx +78 -0
  107. package/template/host/src/kernel/components/ui/dialog.tsx +116 -0
  108. package/template/host/src/kernel/components/ui/dropdown-menu.tsx +192 -0
  109. package/template/host/src/kernel/components/ui/index.ts +7 -0
  110. package/template/host/src/kernel/components/ui/input.tsx +24 -0
  111. package/template/host/src/kernel/components/ui/label.tsx +21 -0
  112. package/template/host/src/kernel/components/ui/popover.tsx +28 -0
  113. package/template/host/src/kernel/components/ui/progress.tsx +25 -0
  114. package/template/host/src/kernel/components/ui/scroll-area.tsx +45 -0
  115. package/template/host/src/kernel/components/ui/select.tsx +155 -0
  116. package/template/host/src/kernel/components/ui/separator.tsx +28 -0
  117. package/template/host/src/kernel/components/ui/skeleton.tsx +15 -0
  118. package/template/host/src/kernel/components/ui/switch.tsx +26 -0
  119. package/template/host/src/kernel/components/ui/table.tsx +116 -0
  120. package/template/host/src/kernel/components/ui/tabs.tsx +52 -0
  121. package/template/host/src/kernel/components/ui/toast.tsx +126 -0
  122. package/template/host/src/kernel/components/ui/toaster.tsx +34 -0
  123. package/template/host/src/kernel/components/ui/tooltip.tsx +27 -0
  124. package/template/host/src/kernel/components/ui/use-toast.ts +183 -0
  125. package/template/host/src/kernel/index.ts +48 -0
  126. package/template/host/src/kernel/lib/cn.ts +1 -0
  127. package/template/host/src/kernel/lib/utils.ts +36 -0
  128. package/template/host/src/kernel/plugins/Slot.tsx +41 -0
  129. package/template/host/src/kernel/plugins/SlotProvider.tsx +88 -0
  130. package/template/host/src/kernel/plugins/index.ts +23 -0
  131. package/template/host/src/kernel/plugins/loader.ts +122 -0
  132. package/template/host/src/kernel/plugins/schemas.ts +54 -0
  133. package/template/host/src/kernel/plugins/store.ts +185 -0
  134. package/template/host/src/kernel/plugins/types.ts +103 -0
  135. package/template/host/src/kernel/providers/PocketBaseProvider.tsx +70 -0
  136. package/template/host/src/kernel/providers/QueryProvider.tsx +28 -0
  137. package/template/host/src/kernel/providers/ThemeProvider.tsx +25 -0
  138. package/template/host/src/kernel/providers/index.ts +3 -0
  139. package/template/host/src/kernel/rbac/components/OrganizationSelector.tsx +69 -0
  140. package/template/host/src/kernel/rbac/components/PermissionGate.tsx +43 -0
  141. package/template/host/src/kernel/rbac/hooks.ts +379 -0
  142. package/template/host/src/kernel/rbac/index.ts +6 -0
  143. package/template/host/src/kernel/rbac/service.ts +504 -0
  144. package/template/host/src/kernel/rbac/types.ts +164 -0
  145. package/template/host/src/kernel/rbac/utils.ts +34 -0
  146. package/template/host/src/kernel/shared-state/bridge.ts +31 -0
  147. package/template/host/src/kernel/shared-state/index.ts +3 -0
  148. package/template/host/src/kernel/shared-state/store.ts +62 -0
  149. package/template/host/src/kernel/shared-state/types.ts +60 -0
  150. package/template/host/src/kernel/use-migrations.ts +72 -0
  151. package/template/host/src/layout/MobileMenu.tsx +61 -0
  152. package/template/host/src/layout/Shell.tsx +42 -0
  153. package/template/host/src/layout/Sidebar.tsx +178 -0
  154. package/template/host/src/layout/Topbar.tsx +50 -0
  155. package/template/host/src/layout/index.ts +4 -0
  156. package/template/host/src/lib/pocketbase/client.ts +38 -0
  157. package/template/host/src/lib/pocketbase/collections/audit_logs.ts +87 -0
  158. package/template/host/src/lib/pocketbase/collections/index.ts +19 -0
  159. package/template/host/src/lib/pocketbase/collections/organizations.ts +63 -0
  160. package/template/host/src/lib/pocketbase/collections/permissions.ts +57 -0
  161. package/template/host/src/lib/pocketbase/collections/roles.ts +55 -0
  162. package/template/host/src/lib/pocketbase/collections/todos.ts +74 -0
  163. package/template/host/src/lib/pocketbase/collections/user_roles.ts +57 -0
  164. package/template/host/src/lib/pocketbase/collections/users.ts +43 -0
  165. package/template/host/src/lib/pocketbase/index.ts +5 -0
  166. package/template/host/src/lib/pocketbase/migrations.ts +44 -0
  167. package/template/host/src/lib/pocketbase/seed/permissions.ts +8 -0
  168. package/template/host/src/lib/pocketbase/seed/roles.ts +22 -0
  169. package/template/host/src/lib/pocketbase/seed.ts +113 -0
  170. package/template/host/src/lib/pocketbase/types.ts +102 -0
  171. package/template/host/src/modern.runtime.ts +26 -0
  172. package/template/host/src/plugins.d.ts +9 -0
  173. package/template/host/src/providers/PocketBaseProvider.tsx +30 -0
  174. package/template/host/src/routes/_.tsx +6 -0
  175. package/template/host/src/routes/dashboard._.tsx +41 -0
  176. package/template/host/src/routes/index.tsx +93 -0
  177. package/template/host/src/routes/login.tsx +36 -0
  178. package/template/host/src/saas.config.ts +52 -0
  179. package/template/host/src/test/setup.ts +65 -0
  180. package/template/host/src/test/utils.tsx +69 -0
  181. package/template/host/src/test/vitest-globals.d.ts +19 -0
  182. package/template/host/src/vite-env.d.ts +16 -0
  183. package/template/host/tailwind.config.ts +77 -0
  184. package/template/host/tsconfig.json +19 -0
  185. package/template/host/vitest.config.ts +30 -0
  186. package/template/nginx.conf +72 -0
  187. package/template/package.json +44 -0
  188. package/template/packages/plugins/@lego/plugin-dashboard/modern.config.ts +19 -0
  189. package/template/packages/plugins/@lego/plugin-dashboard/package.json +35 -0
  190. package/template/packages/plugins/@lego/plugin-dashboard/postcss.config.mjs +6 -0
  191. package/template/packages/plugins/@lego/plugin-dashboard/src/App.tsx +27 -0
  192. package/template/packages/plugins/@lego/plugin-dashboard/src/components/ActivityFeed.tsx +63 -0
  193. package/template/packages/plugins/@lego/plugin-dashboard/src/components/QuickActionSlot.tsx +11 -0
  194. package/template/packages/plugins/@lego/plugin-dashboard/src/components/QuickActions.tsx +68 -0
  195. package/template/packages/plugins/@lego/plugin-dashboard/src/components/SidebarWidget.tsx +35 -0
  196. package/template/packages/plugins/@lego/plugin-dashboard/src/components/StatCard.tsx +47 -0
  197. package/template/packages/plugins/@lego/plugin-dashboard/src/global.css +24 -0
  198. package/template/packages/plugins/@lego/plugin-dashboard/src/hooks/useChannelIntegration.ts +43 -0
  199. package/template/packages/plugins/@lego/plugin-dashboard/src/hooks/useDashboardStats.ts +65 -0
  200. package/template/packages/plugins/@lego/plugin-dashboard/src/hooks/usePocketBase.ts +47 -0
  201. package/template/packages/plugins/@lego/plugin-dashboard/src/hooks/useRecentActivity.ts +55 -0
  202. package/template/packages/plugins/@lego/plugin-dashboard/src/lib/utils.ts +6 -0
  203. package/template/packages/plugins/@lego/plugin-dashboard/src/pages/DashboardPage.tsx +105 -0
  204. package/template/packages/plugins/@lego/plugin-dashboard/src/plugin.config.ts +121 -0
  205. package/template/packages/plugins/@lego/plugin-dashboard/src/plugin.ts +18 -0
  206. package/template/packages/plugins/@lego/plugin-dashboard/src/vite-env.d.ts +32 -0
  207. package/template/packages/plugins/@lego/plugin-dashboard/tailwind.config.ts +35 -0
  208. package/template/packages/plugins/@lego/plugin-dashboard/tsconfig.json +18 -0
  209. package/template/packages/plugins/@lego/plugin-todo/modern.config.ts +18 -0
  210. package/template/packages/plugins/@lego/plugin-todo/package.json +41 -0
  211. package/template/packages/plugins/@lego/plugin-todo/postcss.config.mjs +6 -0
  212. package/template/packages/plugins/@lego/plugin-todo/src/App.tsx +12 -0
  213. package/template/packages/plugins/@lego/plugin-todo/src/components/SidebarWidget.tsx +16 -0
  214. package/template/packages/plugins/@lego/plugin-todo/src/components/TodoDialog.tsx +55 -0
  215. package/template/packages/plugins/@lego/plugin-todo/src/components/TodoFilters.tsx +79 -0
  216. package/template/packages/plugins/@lego/plugin-todo/src/components/TodoForm.tsx +94 -0
  217. package/template/packages/plugins/@lego/plugin-todo/src/components/TodoItem.tsx +121 -0
  218. package/template/packages/plugins/@lego/plugin-todo/src/components/TodoList.tsx +41 -0
  219. package/template/packages/plugins/@lego/plugin-todo/src/components/index.ts +6 -0
  220. package/template/packages/plugins/@lego/plugin-todo/src/global.css +59 -0
  221. package/template/packages/plugins/@lego/plugin-todo/src/hooks/useCreateTodo.ts +62 -0
  222. package/template/packages/plugins/@lego/plugin-todo/src/hooks/useDeleteTodo.ts +46 -0
  223. package/template/packages/plugins/@lego/plugin-todo/src/hooks/usePocketBase.ts +38 -0
  224. package/template/packages/plugins/@lego/plugin-todo/src/hooks/useTodos.ts +64 -0
  225. package/template/packages/plugins/@lego/plugin-todo/src/hooks/useUpdateTodo.ts +35 -0
  226. package/template/packages/plugins/@lego/plugin-todo/src/index.tsx +5 -0
  227. package/template/packages/plugins/@lego/plugin-todo/src/lib/utils.ts +20 -0
  228. package/template/packages/plugins/@lego/plugin-todo/src/pages/TodoPage.tsx +89 -0
  229. package/template/packages/plugins/@lego/plugin-todo/src/plugin.config.ts +104 -0
  230. package/template/packages/plugins/@lego/plugin-todo/src/plugin.ts +13 -0
  231. package/template/packages/plugins/@lego/plugin-todo/src/schemas.ts +37 -0
  232. package/template/packages/plugins/@lego/plugin-todo/src/types.ts +42 -0
  233. package/template/packages/plugins/@lego/plugin-todo/src/vite-env.d.ts +31 -0
  234. package/template/packages/plugins/@lego/plugin-todo/tailwind.config.ts +51 -0
  235. package/template/packages/plugins/@lego/plugin-todo/tsconfig.json +18 -0
  236. package/template/pnpm-workspace.yaml +4 -0
  237. package/template/pocketbase/CHANGELOG.md +911 -0
  238. package/template/pocketbase/LICENSE.md +17 -0
  239. package/template/scripts/create-plugin.js +221 -0
  240. package/template/scripts/deploy.sh +56 -0
  241. package/template/tsconfig.base.json +26 -0
  242. package/template/tsconfig.json +8 -0
@@ -0,0 +1,665 @@
1
+ # Components API Reference
2
+
3
+ **UI Component Library**
4
+
5
+ ---
6
+
7
+ ## Overview
8
+
9
+ Lego-One provides a set of reusable UI components built with Radix UI primitives and styled with Tailwind CSS. All components support dark mode and follow accessibility best practices.
10
+
11
+ ---
12
+
13
+ ## Installation
14
+
15
+ Components are available via `@lego/kernel/components`:
16
+
17
+ ```typescript
18
+ import { Button, Input, Card } from '@lego/kernel/components';
19
+ ```
20
+
21
+ ---
22
+
23
+ ## Form Components
24
+
25
+ ### Button
26
+
27
+ A versatile button component with multiple variants and sizes.
28
+
29
+ **Import:**
30
+ ```typescript
31
+ import { Button } from '@lego/kernel/components';
32
+ ```
33
+
34
+ **Props:**
35
+ ```typescript
36
+ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
37
+ variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link';
38
+ size?: 'default' | 'sm' | 'lg' | 'icon';
39
+ asChild?: boolean;
40
+ }
41
+ ```
42
+
43
+ **Variants:**
44
+ - `default` - Primary action button (blue)
45
+ - `destructive` - Dangerous actions (red)
46
+ - `outline` - Secondary action with border
47
+ - `secondary` - Alternative secondary action
48
+ - `ghost` - Minimal styling, hover background
49
+ - `link` - Text link style
50
+
51
+ **Sizes:**
52
+ - `default` - 40px height (h-10)
53
+ - `sm` - 36px height (h-9)
54
+ - `lg` - 44px height (h-11)
55
+ - `icon` - Square button (40px x 40px)
56
+
57
+ **Examples:**
58
+ ```tsx
59
+ <Button>Click me</Button>
60
+ <Button variant="destructive">Delete</Button>
61
+ <Button variant="outline" size="sm">Cancel</Button>
62
+ <Button size="icon"><Icon /></Button>
63
+ <Button disabled>Disabled</Button>
64
+ ```
65
+
66
+ ---
67
+
68
+ ### Input
69
+
70
+ A text input field with consistent styling.
71
+
72
+ **Import:**
73
+ ```typescript
74
+ import { Input } from '@lego/kernel/components';
75
+ ```
76
+
77
+ **Props:**
78
+ ```typescript
79
+ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {}
80
+ ```
81
+
82
+ **Examples:**
83
+ ```tsx
84
+ <Input placeholder="Enter email..." />
85
+ <Input type="password" placeholder="Password" />
86
+ <Input disabled value="Disabled" />
87
+ <Input className="w-full" />
88
+ ```
89
+
90
+ ---
91
+
92
+ ### Label
93
+
94
+ Form label with proper accessibility.
95
+
96
+ **Import:**
97
+ ```typescript
98
+ import { Label } from '@lego/kernel/components';
99
+ ```
100
+
101
+ **Props:**
102
+ ```typescript
103
+ interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {}
104
+ ```
105
+
106
+ **Examples:**
107
+ ```tsx
108
+ <Label htmlFor="email">Email</Label>
109
+ <Input id="email" type="email" />
110
+ ```
111
+
112
+ ---
113
+
114
+ ### Select
115
+
116
+ Dropdown select component using Radix UI.
117
+
118
+ **Import:**
119
+ ```typescript
120
+ import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@lego/kernel/components';
121
+ ```
122
+
123
+ **Examples:**
124
+ ```tsx
125
+ <Select>
126
+ <SelectTrigger>
127
+ <SelectValue placeholder="Select option" />
128
+ </SelectTrigger>
129
+ <SelectContent>
130
+ <SelectItem value="1">Option 1</SelectItem>
131
+ <SelectItem value="2">Option 2</SelectItem>
132
+ <SelectItem value="3">Option 3</SelectItem>
133
+ </SelectContent>
134
+ </Select>
135
+ ```
136
+
137
+ ---
138
+
139
+ ### Switch
140
+
141
+ Toggle switch component.
142
+
143
+ **Import:**
144
+ ```typescript
145
+ import { Switch } from '@lego/kernel/components';
146
+ ```
147
+
148
+ **Props:**
149
+ ```typescript
150
+ interface SwitchProps extends React.ComponentProps<typeof SwitchPrimitive.Root> {}
151
+ ```
152
+
153
+ **Examples:**
154
+ ```tsx
155
+ <Switch checked={enabled} onCheckedChange={setEnabled} />
156
+ <Switch disabled />
157
+ ```
158
+
159
+ ---
160
+
161
+ ## Layout Components
162
+
163
+ ### Card
164
+
165
+ Container component with header, content, and footer sections.
166
+
167
+ **Import:**
168
+ ```typescript
169
+ import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from '@lego/kernel/components';
170
+ ```
171
+
172
+ **Examples:**
173
+ ```tsx
174
+ <Card>
175
+ <CardHeader>
176
+ <CardTitle>Card Title</CardTitle>
177
+ <CardDescription>Card description goes here</CardDescription>
178
+ </CardHeader>
179
+ <CardContent>
180
+ <p>Card content</p>
181
+ </CardContent>
182
+ <CardFooter>
183
+ <Button>Action</Button>
184
+ </CardFooter>
185
+ </Card>
186
+ ```
187
+
188
+ ---
189
+
190
+ ### Separator
191
+
192
+ Visual separator/divider line.
193
+
194
+ **Import:**
195
+ ```typescript
196
+ import { Separator } from '@lego/kernel/components';
197
+ ```
198
+
199
+ **Props:**
200
+ ```typescript
201
+ interface SeparatorProps extends React.ComponentProps<typeof SeparatorPrimitive.Root> {}
202
+ ```
203
+
204
+ **Orientation:**
205
+ - `horizontal` (default)
206
+ - `vertical`
207
+
208
+ **Examples:**
209
+ ```tsx
210
+ <Separator />
211
+ <Separator orientation="vertical" className="h-8" />
212
+ ```
213
+
214
+ ---
215
+
216
+ ### ScrollArea
217
+
218
+ Custom scrollable container with styled scrollbars.
219
+
220
+ **Import:**
221
+ ```typescript
222
+ import { ScrollArea } from '@lego/kernel/components';
223
+ ```
224
+
225
+ **Examples:**
226
+ ```tsx
227
+ <ScrollArea className="h-96">
228
+ <div className="p-4">
229
+ {/* Long content */}
230
+ </div>
231
+ </ScrollArea>
232
+ ```
233
+
234
+ ---
235
+
236
+ ## Feedback Components
237
+
238
+ ### Alert
239
+
240
+ Notification alert with different severity levels.
241
+
242
+ **Import:**
243
+ ```typescript
244
+ import { Alert, AlertDescription, AlertTitle } from '@lego/kernel/components';
245
+ ```
246
+
247
+ **Variants:**
248
+ - `default` - Neutral info
249
+ - `destructive` - Error/warning
250
+
251
+ **Examples:**
252
+ ```tsx
253
+ <Alert>
254
+ <AlertCircle className="h-4 w-4" />
255
+ <AlertTitle>Info</AlertTitle>
256
+ <AlertDescription>This is an informational message.</AlertDescription>
257
+ </Alert>
258
+
259
+ <Alert variant="destructive">
260
+ <AlertTitle>Error</AlertTitle>
261
+ <AlertDescription>Something went wrong.</AlertDescription>
262
+ </Alert>
263
+ ```
264
+
265
+ ---
266
+
267
+ ### Badge
268
+
269
+ Small status or label indicator.
270
+
271
+ **Import:**
272
+ ```typescript
273
+ import { Badge } from '@lego/kernel/components';
274
+ ```
275
+
276
+ **Props:**
277
+ ```typescript
278
+ interface BadgeProps extends React.HTMLAttributes<HTMLDivElement> {
279
+ variant?: 'default' | 'secondary' | 'destructive' | 'outline';
280
+ }
281
+ ```
282
+
283
+ **Examples:**
284
+ ```tsx
285
+ <Badge>Default</Badge>
286
+ <Badge variant="secondary">Secondary</Badge>
287
+ <Badge variant="destructive">Error</Badge>
288
+ <Badge variant="outline">Outline</Badge>
289
+ ```
290
+
291
+ ---
292
+
293
+ ### Progress
294
+
295
+ Progress bar indicator.
296
+
297
+ **Import:**
298
+ ```typescript
299
+ import { Progress } from '@lego/kernel/components';
300
+ ```
301
+
302
+ **Examples:**
303
+ ```tsx
304
+ <Progress value={33} />
305
+ <Progress value={66} className="w-96" />
306
+ ```
307
+
308
+ ---
309
+
310
+ ### Skeleton
311
+
312
+ Loading placeholder content.
313
+
314
+ **Import:**
315
+ ```typescript
316
+ import { Skeleton } from '@lego/kernel/components';
317
+ ```
318
+
319
+ **Examples:**
320
+ ```tsx
321
+ <Skeleton className="h-12 w-12 rounded-full" />
322
+ <Skeleton className="h-4 w-64" />
323
+ <Skeleton className="h-96 w-full" />
324
+ ```
325
+
326
+ ---
327
+
328
+ ### Toast
329
+
330
+ Notification toast messages.
331
+
332
+ **Import:**
333
+ ```typescript
334
+ import { useToast } from '@lego/kernel/components';
335
+ import { ToastProvider, Toast, ToastTitle, ToastDescription } from '@lego/kernel/components';
336
+ ```
337
+
338
+ **Usage:**
339
+ ```tsx
340
+ function App() {
341
+ return (
342
+ <ToastProvider>
343
+ {/* Your app */}
344
+ <Toaster />
345
+ </ToastProvider>
346
+ );
347
+ }
348
+
349
+ function MyComponent() {
350
+ const { toast } = useToast();
351
+
352
+ return (
353
+ <Button onClick={() => {
354
+ toast({
355
+ title: 'Success',
356
+ description: 'Operation completed successfully',
357
+ });
358
+ }}>
359
+ Show Toast
360
+ </Button>
361
+ );
362
+ }
363
+ ```
364
+
365
+ ---
366
+
367
+ ## Navigation Components
368
+
369
+ ### Tabs
370
+
371
+ Tabbed content interface.
372
+
373
+ **Import:**
374
+ ```typescript
375
+ import { Tabs, TabsList, TabsTrigger, TabsContent } from '@lego/kernel/components';
376
+ ```
377
+
378
+ **Examples:**
379
+ ```tsx
380
+ <Tabs defaultValue="tab1">
381
+ <TabsList>
382
+ <TabsTrigger value="tab1">Tab 1</TabsTrigger>
383
+ <TabsTrigger value="tab2">Tab 2</TabsTrigger>
384
+ <TabsTrigger value="tab3">Tab 3</TabsTrigger>
385
+ </TabsList>
386
+ <TabsContent value="tab1">
387
+ Content 1
388
+ </TabsContent>
389
+ <TabsContent value="tab2">
390
+ Content 2
391
+ </TabsContent>
392
+ <TabsContent value="tab3">
393
+ Content 3
394
+ </TabsContent>
395
+ </Tabs>
396
+ ```
397
+
398
+ ---
399
+
400
+ ### Dropdown Menu
401
+
402
+ Context menu or dropdown menu.
403
+
404
+ **Import:**
405
+ ```typescript
406
+ import {
407
+ DropdownMenu,
408
+ DropdownMenuTrigger,
409
+ DropdownMenuContent,
410
+ DropdownMenuItem,
411
+ DropdownMenuLabel,
412
+ DropdownMenuSeparator,
413
+ } from '@lego/kernel/components';
414
+ ```
415
+
416
+ **Examples:**
417
+ ```tsx
418
+ <DropdownMenu>
419
+ <DropdownMenuTrigger asChild>
420
+ <Button variant="ghost">Menu</Button>
421
+ </DropdownMenuTrigger>
422
+ <DropdownMenuContent>
423
+ <DropdownMenuLabel>My Account</DropdownMenuLabel>
424
+ <DropdownMenuSeparator />
425
+ <DropdownMenuItem>Profile</DropdownMenuItem>
426
+ <DropdownMenuItem>Settings</DropdownMenuItem>
427
+ <DropdownMenuSeparator />
428
+ <DropdownMenuItem>Logout</DropdownMenuItem>
429
+ </DropdownMenuContent>
430
+ </DropdownMenu>
431
+ ```
432
+
433
+ ---
434
+
435
+ ## Display Components
436
+
437
+ ### Avatar
438
+
439
+ User avatar with image and fallback.
440
+
441
+ **Import:**
442
+ ```typescript
443
+ import { Avatar, AvatarImage, AvatarFallback } from '@lego/kernel/components';
444
+ ```
445
+
446
+ **Examples:**
447
+ ```tsx
448
+ <Avatar>
449
+ <AvatarImage src="/avatar.jpg" alt="User" />
450
+ <AvatarFallback>JD</AvatarFallback>
451
+ </Avatar>
452
+
453
+ <Avatar>
454
+ <AvatarFallback className="bg-primary text-primary-foreground">
455
+ <User className="h-4 w-4" />
456
+ </AvatarFallback>
457
+ </Avatar>
458
+ ```
459
+
460
+ ---
461
+
462
+ ### Table
463
+
464
+ Data table with consistent styling.
465
+
466
+ **Import:**
467
+ ```typescript
468
+ import {
469
+ Table,
470
+ TableHeader,
471
+ TableBody,
472
+ TableFooter,
473
+ TableHead,
474
+ TableRow,
475
+ TableCell,
476
+ } from '@lego/kernel/components';
477
+ ```
478
+
479
+ **Examples:**
480
+ ```tsx
481
+ <Table>
482
+ <TableHeader>
483
+ <TableRow>
484
+ <TableHead>Name</TableHead>
485
+ <TableHead>Email</TableHead>
486
+ <TableHead>Status</TableHead>
487
+ </TableRow>
488
+ </TableHeader>
489
+ <TableBody>
490
+ <TableRow>
491
+ <TableCell>John Doe</TableCell>
492
+ <TableCell>john@example.com</TableCell>
493
+ <TableCell>Active</TableCell>
494
+ </TableRow>
495
+ </TableBody>
496
+ </Table>
497
+ ```
498
+
499
+ ---
500
+
501
+ ## Overlay Components
502
+
503
+ ### Dialog
504
+
505
+ Modal dialog component.
506
+
507
+ **Import:**
508
+ ```typescript
509
+ import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle, DialogTrigger } from '@lego/kernel/components';
510
+ ```
511
+
512
+ **Examples:**
513
+ ```tsx
514
+ <Dialog>
515
+ <DialogTrigger asChild>
516
+ <Button>Open Dialog</Button>
517
+ </DialogTrigger>
518
+ <DialogContent>
519
+ <DialogHeader>
520
+ <DialogTitle>Are you sure?</DialogTitle>
521
+ <DialogDescription>
522
+ This action cannot be undone.
523
+ </DialogDescription>
524
+ </DialogHeader>
525
+ <DialogFooter>
526
+ <Button variant="outline">Cancel</Button>
527
+ <Button>Confirm</Button>
528
+ </DialogFooter>
529
+ </DialogContent>
530
+ </Dialog>
531
+ ```
532
+
533
+ ---
534
+
535
+ ### Popover
536
+
537
+ Floating popover content.
538
+
539
+ **Import:**
540
+ ```typescript
541
+ import { Popover, PopoverContent, PopoverTrigger } from '@lego/kernel/components';
542
+ ```
543
+
544
+ **Examples:**
545
+ ```tsx
546
+ <Popover>
547
+ <PopoverTrigger asChild>
548
+ <Button variant="ghost">Trigger</Button>
549
+ </PopoverTrigger>
550
+ <PopoverContent>
551
+ <div className="grid gap-4">
552
+ <h4 className="font-medium">Popover Content</h4>
553
+ <p className="text-sm text-muted-foreground">
554
+ Additional information here.
555
+ </p>
556
+ </div>
557
+ </PopoverContent>
558
+ </Popover>
559
+ ```
560
+
561
+ ---
562
+
563
+ ### Tooltip
564
+
565
+ Hover tooltip for additional context.
566
+
567
+ **Import:**
568
+ ```typescript
569
+ import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@lego/kernel/components';
570
+ ```
571
+
572
+ **Usage:**
573
+ ```tsx
574
+ // Wrap your app in TooltipProvider once
575
+ function App() {
576
+ return (
577
+ <TooltipProvider>
578
+ {/* Your app */}
579
+ </TooltipProvider>
580
+ );
581
+ }
582
+
583
+ // Use tooltips
584
+ <Tooltip>
585
+ <TooltipTrigger>Hover me</TooltipTrigger>
586
+ <TooltipContent>
587
+ <p>Additional information</p>
588
+ </TooltipContent>
589
+ </Tooltip>
590
+ ```
591
+
592
+ ---
593
+
594
+ ## Utility Components
595
+
596
+ ### useToast Hook
597
+
598
+ Programmatically show toast notifications.
599
+
600
+ ```typescript
601
+ const { toast } = useToast();
602
+
603
+ toast({
604
+ title: 'Success',
605
+ description: 'File uploaded successfully',
606
+ variant: 'default', // or 'destructive'
607
+ });
608
+ ```
609
+
610
+ ---
611
+
612
+ ## Theming
613
+
614
+ All components support CSS variables for theming:
615
+
616
+ ```css
617
+ :root {
618
+ --background: 0 0% 100%;
619
+ --foreground: 222.2 84% 4.9%;
620
+ --primary: 221.2 83.2% 53.3%;
621
+ --primary-foreground: 210 40% 98%;
622
+ --secondary: 210 40% 96.1%;
623
+ --secondary-foreground: 222.2 47.4% 11.2%;
624
+ --muted: 210 40% 96.1%;
625
+ --muted-foreground: 215.4 16.3% 46.9%;
626
+ --accent: 210 40% 96.1%;
627
+ --accent-foreground: 222.2 47.4% 11.2%;
628
+ --destructive: 0 84.2% 60.2%;
629
+ --destructive-foreground: 210 40% 98%;
630
+ --border: 214.3 31.8% 91.4%;
631
+ --input: 214.3 31.8% 91.4%;
632
+ --ring: 221.2 83.2% 53.3%;
633
+ --radius: 0.5rem;
634
+ }
635
+ ```
636
+
637
+ Dark mode support is built-in via the `dark:` class prefix.
638
+
639
+ ---
640
+
641
+ ## Accessibility
642
+
643
+ All components follow WCAG 2.1 AA guidelines:
644
+
645
+ - Keyboard navigation support
646
+ - ARIA attributes included
647
+ - Focus management
648
+ - Screen reader support
649
+ - High contrast mode support
650
+
651
+ ---
652
+
653
+ ## Best Practices
654
+
655
+ 1. **Always provide labels** for form inputs
656
+ 2. **Use semantic HTML** when building custom components
657
+ 3. **Test keyboard navigation** in your application
658
+ 4. **Provide sufficient color contrast** for text
659
+ 5. **Include loading states** for async actions
660
+ 6. **Handle errors gracefully** with user feedback
661
+ 7. **Use consistent spacing** via spacing scale
662
+
663
+ ---
664
+
665
+ **Next:** Read [`13-deployment-guide.md`](./13-deployment-guide.md) for deployment instructions.