@elabs-ai/components-ui 4.0.0 → 4.1.0

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 (223) hide show
  1. package/README.md +10 -8
  2. package/dist/chunk-JKPPTL63.js +48 -0
  3. package/dist/chunk-JKPPTL63.js.map +1 -0
  4. package/dist/form.d.ts +28 -0
  5. package/dist/form.js +123 -0
  6. package/dist/form.js.map +1 -0
  7. package/dist/index.d.ts +2485 -167
  8. package/dist/index.js +10716 -2706
  9. package/dist/index.js.map +1 -1
  10. package/package.json +21 -7
  11. package/src/_peer-deps.test.ts +59 -0
  12. package/src/blocks-comparison-table.stories.tsx +2 -2
  13. package/src/components/accordion/accordion.tsx +1 -1
  14. package/src/components/advanced-group/advanced-group.tsx +1 -1
  15. package/src/components/alert/alert.tsx +4 -1
  16. package/src/components/app-shell/app-shell.stories.tsx +44 -2
  17. package/src/components/app-shell/app-shell.tsx +35 -2
  18. package/src/components/app-sidebar/app-sidebar.stories.tsx +9 -1
  19. package/src/components/attribution-panel/attribution-panel.tsx +1 -1
  20. package/src/components/attribution-panel/attributions.generated.ts +81 -77
  21. package/src/components/badge/badge.stories.tsx +8 -0
  22. package/src/components/badge/badge.tsx +1 -1
  23. package/src/components/bento-grid/bento-grid.test.tsx +1 -1
  24. package/src/components/bento-grid/bento-grid.tsx +1 -1
  25. package/src/components/breadcrumb/breadcrumb.stories.tsx +38 -0
  26. package/src/components/breadcrumb/breadcrumb.test.tsx +24 -1
  27. package/src/components/breadcrumb/breadcrumb.tsx +7 -2
  28. package/src/components/button/button.stories.tsx +116 -8
  29. package/src/components/button/button.tsx +1 -1
  30. package/src/components/card/card.stories.tsx +11 -6
  31. package/src/components/card/card.tsx +1 -1
  32. package/src/components/change-review/change-review.stories.tsx +145 -1
  33. package/src/components/change-review/change-review.test.tsx +143 -0
  34. package/src/components/change-review/change-review.tsx +185 -4
  35. package/src/components/checkbox/checkbox.tsx +1 -1
  36. package/src/components/color-picker/color-picker.tsx +6 -5
  37. package/src/components/command/command.stories.tsx +16 -6
  38. package/src/components/command/command.test.tsx +73 -0
  39. package/src/components/command/command.tsx +30 -7
  40. package/src/components/command/index.ts +1 -0
  41. package/src/components/command-trigger/command-trigger.stories.tsx +39 -0
  42. package/src/components/command-trigger/command-trigger.test.tsx +18 -0
  43. package/src/components/command-trigger/command-trigger.tsx +70 -0
  44. package/src/components/command-trigger/index.ts +1 -0
  45. package/src/components/context-rail/context-rail.stories.tsx +285 -0
  46. package/src/components/context-rail/context-rail.test.tsx +263 -0
  47. package/src/components/context-rail/context-rail.tsx +678 -0
  48. package/src/components/context-rail/index.ts +1 -0
  49. package/src/components/copyable-value/copyable-value.tsx +1 -1
  50. package/src/components/dialog/dialog.tsx +2 -2
  51. package/src/components/dropdown-menu/dropdown-menu.stories.tsx +1 -1
  52. package/src/components/empty-state/empty-state.test.tsx +26 -0
  53. package/src/components/empty-state/empty-state.tsx +6 -1
  54. package/src/components/expand-dialog/expand-dialog.tsx +1 -2
  55. package/src/components/field/field-context.ts +59 -0
  56. package/src/components/field/field.stories.tsx +142 -0
  57. package/src/components/field/field.test.tsx +415 -0
  58. package/src/components/field/field.tsx +340 -0
  59. package/src/components/field/index.ts +9 -0
  60. package/src/components/field-row/field-row.stories.tsx +85 -1
  61. package/src/components/field-row/field-row.test.tsx +145 -0
  62. package/src/components/field-row/field-row.tsx +48 -6
  63. package/src/components/file-upload/file-upload.stories.tsx +16 -0
  64. package/src/components/file-upload/file-upload.test.tsx +7 -2
  65. package/src/components/file-upload/file-upload.tsx +15 -4
  66. package/src/components/form/form.tsx +5 -2
  67. package/src/components/icon-button/icon-button.test.tsx +1 -1
  68. package/src/components/icon-button/icon-button.tsx +2 -2
  69. package/src/components/input/input.stories.tsx +121 -0
  70. package/src/components/input/input.test.tsx +13 -0
  71. package/src/components/input/input.tsx +2 -2
  72. package/src/components/input-group/input-group.stories.tsx +74 -0
  73. package/src/components/input-group/input-group.tsx +13 -4
  74. package/src/components/input-otp/input-otp.tsx +5 -1
  75. package/src/components/keyboard-shortcuts/index.ts +6 -0
  76. package/src/components/keyboard-shortcuts/keyboard-shortcuts.stories.tsx +177 -0
  77. package/src/components/keyboard-shortcuts/keyboard-shortcuts.test.tsx +73 -0
  78. package/src/components/keyboard-shortcuts/keyboard-shortcuts.tsx +203 -0
  79. package/src/components/link-preview/link-preview.tsx +1 -1
  80. package/src/components/locale-provider/index.ts +6 -1
  81. package/src/components/locale-provider/locale-provider.stories.tsx +89 -1
  82. package/src/components/locale-provider/locale-provider.test.tsx +257 -1
  83. package/src/components/locale-provider/locale-provider.tsx +63 -8
  84. package/src/components/locale-provider/messages.ts +501 -2
  85. package/src/components/match-highlight/match-highlight.stories.tsx +1 -1
  86. package/src/components/mention-input/mention-input-mirror.stories.tsx +9 -1
  87. package/src/components/mention-input/mention-input.tsx +8 -38
  88. package/src/components/mention-input/mention-value.ts +8 -2
  89. package/src/components/metric-card/metric-card.stories.tsx +5 -3
  90. package/src/components/metric-card/metric-card.tsx +21 -2
  91. package/src/components/model-picker/model-picker.stories.tsx +63 -3
  92. package/src/components/model-picker/model-picker.test.tsx +63 -0
  93. package/src/components/model-picker/model-picker.tsx +62 -36
  94. package/src/components/nav-main/nav-main.tsx +1 -1
  95. package/src/components/nav-notifications/nav-notifications.stories.tsx +110 -0
  96. package/src/components/nav-notifications/nav-notifications.tsx +57 -5
  97. package/src/components/navigation-menu/navigation-menu.stories.tsx +22 -0
  98. package/src/components/navigation-menu/navigation-menu.test.tsx +174 -0
  99. package/src/components/navigation-menu/navigation-menu.tsx +189 -12
  100. package/src/components/page-shell/page-shell.stories.tsx +163 -0
  101. package/src/components/page-shell/page-shell.test.tsx +229 -0
  102. package/src/components/page-shell/page-shell.tsx +108 -25
  103. package/src/components/pagination/pagination.test.tsx +90 -0
  104. package/src/components/pagination/pagination.tsx +9 -5
  105. package/src/components/radio-group/radio-group.tsx +1 -1
  106. package/src/components/rating/rating.tsx +1 -1
  107. package/src/components/resizable/resizable.stories.tsx +114 -2
  108. package/src/components/resizable/resizable.tsx +1 -1
  109. package/src/components/revision-timeline/revision-timeline.stories.tsx +8 -1
  110. package/src/components/revision-timeline/revision-timeline.test.tsx +26 -0
  111. package/src/components/revision-timeline/revision-timeline.tsx +46 -3
  112. package/src/components/schema-form/from-json-schema.test.ts +390 -0
  113. package/src/components/schema-form/from-json-schema.ts +375 -0
  114. package/src/components/schema-form/index.ts +81 -0
  115. package/src/components/schema-form/schema-form-spec.ts +698 -0
  116. package/src/components/schema-form/schema-form.stories.tsx +566 -0
  117. package/src/components/schema-form/schema-form.test.tsx +900 -0
  118. package/src/components/schema-form/schema-form.tsx +1545 -0
  119. package/src/components/section-header/section-header.stories.tsx +37 -0
  120. package/src/components/section-header/section-header.tsx +12 -1
  121. package/src/components/select/select.tsx +6 -2
  122. package/src/components/sheet/sheet.tsx +1 -1
  123. package/src/components/side-dock/index.ts +1 -0
  124. package/src/components/side-dock/side-dock.stories.tsx +137 -0
  125. package/src/components/side-dock/side-dock.test.tsx +273 -0
  126. package/src/components/side-dock/side-dock.tsx +502 -0
  127. package/src/components/sidebar/index.ts +1 -0
  128. package/src/components/sidebar/sidebar-frame.test.tsx +162 -0
  129. package/src/components/sidebar/sidebar.stories.tsx +421 -1
  130. package/src/components/sidebar/sidebar.test.tsx +36 -1
  131. package/src/components/sidebar/sidebar.tsx +245 -33
  132. package/src/components/skip-link/index.ts +1 -0
  133. package/src/components/skip-link/skip-link.stories.tsx +106 -0
  134. package/src/components/skip-link/skip-link.test.tsx +20 -0
  135. package/src/components/skip-link/skip-link.tsx +34 -0
  136. package/src/components/slider/slider.tsx +1 -1
  137. package/src/components/split-panel/index.ts +6 -1
  138. package/src/components/split-panel/split-panel.stories.tsx +18 -2
  139. package/src/components/split-panel/split-panel.test.tsx +20 -0
  140. package/src/components/split-panel/split-panel.tsx +28 -8
  141. package/src/components/state-panel/state-panel.stories.tsx +52 -0
  142. package/src/components/state-panel/state-panel.test.tsx +125 -0
  143. package/src/components/state-panel/state-panel.tsx +96 -17
  144. package/src/components/status-badge/status-badge.stories.tsx +8 -0
  145. package/src/components/switch/switch.tsx +1 -1
  146. package/src/components/table/table.stories.tsx +62 -0
  147. package/src/components/table/table.test.tsx +142 -1
  148. package/src/components/table/table.tsx +60 -1
  149. package/src/components/tabs/tabs.tsx +8 -2
  150. package/src/components/tag-input/tag-input.tsx +3 -2
  151. package/src/components/team-switcher/team-switcher.tsx +34 -5
  152. package/src/components/textarea/textarea.tsx +1 -1
  153. package/src/components/theme-switcher/theme-switcher.tsx +6 -2
  154. package/src/components/theme-switcher/use-theme-transition.ts +2 -2
  155. package/src/components/timeline/timeline.stories.tsx +27 -0
  156. package/src/components/timeline/timeline.tsx +11 -1
  157. package/src/components/toggle/toggle.tsx +1 -1
  158. package/src/components/toolbar/toolbar.stories.tsx +10 -2
  159. package/src/components/tree/tree.stories.tsx +2 -2
  160. package/src/components/tree/tree.tsx +14 -9
  161. package/src/components/typography/prose.tsx +1 -1
  162. package/src/components/typography/typography.stories.tsx +228 -0
  163. package/src/components/view-toolbar/view-toolbar.stories.tsx +41 -1
  164. package/src/components/view-toolbar/view-toolbar.test.tsx +33 -0
  165. package/src/components/view-toolbar/view-toolbar.tsx +37 -4
  166. package/src/components/virtual-select/virtual-select.test.tsx +1 -1
  167. package/src/components/wizard/wizard.tsx +1 -1
  168. package/src/components/workspace-picker/index.ts +3 -0
  169. package/src/components/workspace-picker/workspace-picker-state.ts +50 -0
  170. package/src/components/workspace-picker/workspace-picker.stories.tsx +126 -0
  171. package/src/components/workspace-picker/workspace-picker.test.tsx +207 -0
  172. package/src/components/workspace-picker/workspace-picker.tsx +172 -0
  173. package/src/illustrations/empty-list-illustration.tsx +26 -0
  174. package/src/illustrations/error-illustration.tsx +60 -0
  175. package/src/illustrations/first-run-illustration.tsx +27 -0
  176. package/src/illustrations/illustration-base.tsx +108 -0
  177. package/src/illustrations/illustrations.stories.tsx +94 -0
  178. package/src/illustrations/illustrations.test.tsx +98 -0
  179. package/src/illustrations/index.ts +16 -0
  180. package/src/illustrations/no-access-illustration.tsx +45 -0
  181. package/src/illustrations/no-results-illustration.tsx +46 -0
  182. package/src/illustrations/offline-illustration.tsx +37 -0
  183. package/src/illustrations/success-illustration.tsx +40 -0
  184. package/src/index.ts +75 -2
  185. package/src/lib/agent-event-model.test.ts +12 -0
  186. package/src/lib/agent-event-model.ts +42 -0
  187. package/src/lib/approval-option.test.ts +17 -0
  188. package/src/lib/approval-option.ts +53 -0
  189. package/src/lib/check-result.ts +33 -0
  190. package/src/lib/diff-line.test.ts +36 -0
  191. package/src/lib/diff-line.ts +63 -0
  192. package/src/lib/diff-rows.test.ts +76 -0
  193. package/src/lib/diff-rows.ts +92 -0
  194. package/src/lib/format-duration.test.ts +22 -0
  195. package/src/lib/format-duration.ts +30 -0
  196. package/src/lib/has-renderable-content.test.ts +49 -0
  197. package/src/lib/has-renderable-content.ts +32 -0
  198. package/src/lib/operating-mode.test.ts +36 -0
  199. package/src/lib/operating-mode.ts +81 -0
  200. package/src/lib/optional-peer.ts +59 -0
  201. package/src/lib/session-launch.ts +37 -0
  202. package/src/lib/slash-command.test.ts +44 -0
  203. package/src/lib/slash-command.ts +45 -0
  204. package/src/lib/trigger-query.test.ts +94 -0
  205. package/src/lib/trigger-query.ts +88 -0
  206. package/src/lib/use-mobile.ts +12 -6
  207. package/src/motion.stories.tsx +6 -0
  208. package/src/templates-object-detail-hub.stories.tsx +2 -2
  209. package/src/templates-screen-states.stories.tsx +5 -5
  210. package/src/templates-settings.stories.tsx +1 -1
  211. package/src/blocks/sidebar-02/app-sidebar.tsx +0 -160
  212. package/src/blocks/sidebar-02/logo.tsx +0 -18
  213. package/src/blocks/sidebar-02/nav-main.tsx +0 -13
  214. package/src/blocks/sidebar-02/nav-notifications.tsx +0 -7
  215. package/src/blocks/sidebar-02/sidebar-02.stories.tsx +0 -23
  216. package/src/blocks/sidebar-02/team-switcher.tsx +0 -7
  217. package/src/blocks/sidebar-04/app-sidebar.tsx +0 -236
  218. package/src/blocks/sidebar-04/mail-context.tsx +0 -29
  219. package/src/blocks/sidebar-04/nav-user.tsx +0 -6
  220. package/src/blocks/sidebar-04/sidebar-04.stories.tsx +0 -150
  221. package/src/blocks/sidebar-05/app-sidebar.tsx +0 -375
  222. package/src/blocks/sidebar-05/sidebar-05.stories.tsx +0 -18
  223. package/src/blocks/sidebar-05/team-switcher.tsx +0 -6
@@ -1,375 +0,0 @@
1
- /** sidebar-05 — double-sided sidebar (copy-owned block). Adapted from blocks.so
2
- * (ephraim duncan). Icons mapped from @tabler/icons-react to lucide-react. */
3
- "use client";
4
-
5
- import type React from "react";
6
- import { useState } from "react";
7
- import {
8
- Activity,
9
- Archive,
10
- BarChart3,
11
- Bell,
12
- Bug,
13
- ChevronRight,
14
- Cloud,
15
- Database,
16
- Eye,
17
- FileText,
18
- Fingerprint,
19
- Folder,
20
- Folders,
21
- Package2,
22
- GitCommitHorizontal,
23
- GitMerge,
24
- GitPullRequest,
25
- Globe,
26
- Hexagon,
27
- Home,
28
- Key,
29
- Lock,
30
- Package,
31
- PackageOpen,
32
- Play,
33
- Settings,
34
- ShieldAlert,
35
- ShieldCheck,
36
- Sparkles,
37
- Star,
38
- Target,
39
- Terminal,
40
- User,
41
- UserPlus,
42
- Webhook,
43
- Workflow,
44
- X,
45
- } from "lucide-react";
46
- import {
47
- NavUser,
48
- Sidebar,
49
- SidebarContent,
50
- SidebarFooter,
51
- SidebarGroup,
52
- SidebarGroupContent,
53
- SidebarHeader,
54
- SidebarMenu,
55
- SidebarMenuBadge,
56
- SidebarMenuButton,
57
- SidebarMenuItem,
58
- TeamSwitcher,
59
- cn,
60
- } from "@elabs-ai/components-ui";
61
-
62
- const data = {
63
- user: { name: "ephraim", email: "ephraim@blocks.so", avatar: "" },
64
- teams: [
65
- { name: "OpenAI", logo: Sparkles, plan: "Enterprise" },
66
- { name: "Anthropic", logo: Star, plan: "Pro" },
67
- { name: "Google", logo: Globe, plan: "Free" },
68
- { name: "Meta", logo: Hexagon, plan: "Free" },
69
- ],
70
- };
71
-
72
- interface NavItem {
73
- id: string;
74
- label: string;
75
- icon: React.ComponentType<{ className?: string }>;
76
- badge?: string;
77
- hasSubItems?: boolean;
78
- route?: string;
79
- subItems?: {
80
- id: string;
81
- label: string;
82
- icon: React.ComponentType<{ className?: string }>;
83
- description?: string;
84
- }[];
85
- }
86
-
87
- const sidebarItems: NavItem[] = [
88
- {
89
- id: "overview",
90
- label: "Overview",
91
- icon: Home,
92
- hasSubItems: true,
93
- subItems: [
94
- {
95
- id: "dashboard",
96
- label: "Dashboard",
97
- icon: BarChart3,
98
- description: "Project overview and activity",
99
- },
100
- {
101
- id: "activity",
102
- label: "Activity",
103
- icon: Activity,
104
- description: "Recent commits and changes",
105
- },
106
- {
107
- id: "insights",
108
- label: "Insights",
109
- icon: Target,
110
- description: "Code analytics and metrics",
111
- },
112
- ],
113
- },
114
- {
115
- id: "repositories",
116
- label: "Repositories",
117
- icon: Folders,
118
- badge: "12",
119
- hasSubItems: true,
120
- subItems: [
121
- {
122
- id: "all-repos",
123
- label: "All Repositories",
124
- icon: Folder,
125
- description: "Browse all your repositories",
126
- },
127
- { id: "starred", label: "Starred", icon: Star, description: "Your starred repositories" },
128
- { id: "archived", label: "Archived", icon: Archive, description: "Archived repositories" },
129
- ],
130
- },
131
- {
132
- id: "pull-requests",
133
- label: "Pull Requests",
134
- icon: GitPullRequest,
135
- badge: "3",
136
- hasSubItems: true,
137
- subItems: [
138
- { id: "open-prs", label: "Open", icon: GitPullRequest, description: "Open pull requests" },
139
- {
140
- id: "review",
141
- label: "Review Requests",
142
- icon: Eye,
143
- description: "PRs awaiting your review",
144
- },
145
- { id: "merged", label: "Merged", icon: GitMerge, description: "Recently merged PRs" },
146
- ],
147
- },
148
- {
149
- id: "issues",
150
- label: "Issues",
151
- icon: Bug,
152
- badge: "7",
153
- hasSubItems: true,
154
- subItems: [
155
- { id: "open-issues", label: "Open Issues", icon: Bug, description: "Active issues and bugs" },
156
- {
157
- id: "assigned",
158
- label: "Assigned to Me",
159
- icon: UserPlus,
160
- description: "Issues assigned to you",
161
- },
162
- {
163
- id: "created",
164
- label: "Created by Me",
165
- icon: GitCommitHorizontal,
166
- description: "Issues you've created",
167
- },
168
- ],
169
- },
170
- {
171
- id: "actions",
172
- label: "Actions",
173
- icon: Workflow,
174
- hasSubItems: true,
175
- subItems: [
176
- {
177
- id: "workflows",
178
- label: "Workflows",
179
- icon: Play,
180
- description: "CI/CD workflows and pipelines",
181
- },
182
- { id: "runners", label: "Runners", icon: Terminal, description: "Self-hosted runners" },
183
- { id: "deployments", label: "Deployments", icon: Cloud, description: "Deployment history" },
184
- ],
185
- },
186
- {
187
- id: "packages",
188
- label: "Packages",
189
- icon: Package,
190
- hasSubItems: true,
191
- subItems: [
192
- {
193
- id: "published",
194
- label: "Published",
195
- icon: PackageOpen,
196
- description: "Your published packages",
197
- },
198
- {
199
- id: "containers",
200
- label: "Container Registry",
201
- icon: Database,
202
- description: "Docker images and containers",
203
- },
204
- { id: "npm", label: "npm Packages", icon: Package2, description: "Node.js packages" },
205
- ],
206
- },
207
- {
208
- id: "security",
209
- label: "Security",
210
- icon: Lock,
211
- badge: "2",
212
- hasSubItems: true,
213
- subItems: [
214
- {
215
- id: "alerts",
216
- label: "Security Alerts",
217
- icon: ShieldAlert,
218
- description: "Vulnerability alerts",
219
- },
220
- {
221
- id: "advisories",
222
- label: "Advisories",
223
- icon: ShieldCheck,
224
- description: "Security advisories",
225
- },
226
- { id: "secrets", label: "Secrets", icon: Fingerprint, description: "Repository secrets" },
227
- ],
228
- },
229
- {
230
- id: "settings",
231
- label: "Settings",
232
- icon: Settings,
233
- hasSubItems: true,
234
- subItems: [
235
- { id: "profile", label: "Profile", icon: User, description: "Your profile settings" },
236
- {
237
- id: "notifications",
238
- label: "Notifications",
239
- icon: Bell,
240
- description: "Notification preferences",
241
- },
242
- { id: "webhooks", label: "Webhooks", icon: Webhook, description: "Webhook configurations" },
243
- { id: "api-keys", label: "API Keys", icon: Key, description: "Personal access tokens" },
244
- ],
245
- },
246
- { id: "docs", label: "Documentation", icon: FileText, hasSubItems: false, route: "/docs" },
247
- ];
248
-
249
- export function AppSidebar() {
250
- const [activeItem, setActiveItem] = useState<string | null>("overview");
251
- const [selectedSubItem, setSelectedSubItem] = useState<string | null>(null);
252
- const activeItemData = sidebarItems.find((item) => item.id === activeItem);
253
-
254
- const handleItemClick = (item: NavItem) => {
255
- if (item.hasSubItems) {
256
- const isActive = activeItem === item.id;
257
- setActiveItem(isActive ? null : item.id);
258
- if (isActive) setSelectedSubItem(null);
259
- } else {
260
- setActiveItem(null);
261
- setSelectedSubItem(null);
262
- }
263
- };
264
-
265
- return (
266
- <div className="flex h-dvh bg-background">
267
- <Sidebar side="left" variant="sidebar" collapsible="none" className="w-64 border-e">
268
- <SidebarHeader>
269
- <TeamSwitcher teams={data.teams} />
270
- </SidebarHeader>
271
- <SidebarContent>
272
- <SidebarGroup>
273
- <SidebarGroupContent>
274
- <SidebarMenu>
275
- {sidebarItems.map((item) => {
276
- const Icon = item.icon;
277
- const isActive = activeItem === item.id;
278
- const chevron = (
279
- <ChevronRight
280
- className={cn(
281
- "h-4 w-4 shrink-0 transition-transform",
282
- isActive && "rotate-90",
283
- )}
284
- />
285
- );
286
- return (
287
- <SidebarMenuItem key={item.id}>
288
- <SidebarMenuButton
289
- isActive={isActive}
290
- className="h-10 w-full px-3"
291
- onClick={() => handleItemClick(item)}
292
- >
293
- <div className="flex min-w-0 flex-1 items-center gap-3">
294
- <Icon className="h-4 w-4 shrink-0" />
295
- <span className="truncate">{item.label}</span>
296
- </div>
297
- <div className="ms-auto flex min-w-fit shrink-0 items-center gap-1">
298
- {(item.badge || item.hasSubItems) &&
299
- (item.badge ? (
300
- <SidebarMenuBadge
301
- className={cn("min-w-fit", item.hasSubItems && "gap-x-3")}
302
- >
303
- {item.badge}
304
- {item.hasSubItems && chevron}
305
- </SidebarMenuBadge>
306
- ) : (
307
- chevron
308
- ))}
309
- </div>
310
- </SidebarMenuButton>
311
- </SidebarMenuItem>
312
- );
313
- })}
314
- </SidebarMenu>
315
- </SidebarGroupContent>
316
- </SidebarGroup>
317
- </SidebarContent>
318
- <SidebarFooter>
319
- <NavUser user={data.user} />
320
- </SidebarFooter>
321
- </Sidebar>
322
-
323
- {activeItem && activeItemData?.subItems && (
324
- <Sidebar
325
- side="left"
326
- variant="sidebar"
327
- collapsible="none"
328
- className="w-72 animate-in slide-in-from-left-5 border-e duration-base ease-entrance"
329
- >
330
- <SidebarHeader className="flex flex-row items-center justify-between border-b px-4">
331
- <h3 className="font-medium">{activeItemData.label}</h3>
332
- <button
333
- onClick={() => setActiveItem(null)}
334
- className="flex h-6 w-6 items-center justify-center rounded-md p-0 hover:bg-sidebar-accent"
335
- aria-label="Close panel"
336
- >
337
- <X className="h-4 w-4" />
338
- </button>
339
- </SidebarHeader>
340
- <SidebarContent>
341
- <SidebarGroup>
342
- <SidebarGroupContent>
343
- <SidebarMenu>
344
- {activeItemData.subItems.map((subItem) => {
345
- const SubIcon = subItem.icon;
346
- const isSelected = selectedSubItem === subItem.id;
347
- return (
348
- <SidebarMenuItem key={subItem.id}>
349
- <SidebarMenuButton
350
- isActive={isSelected}
351
- className="h-auto w-full justify-start gap-3 px-3 py-2"
352
- onClick={() => setSelectedSubItem(isSelected ? null : subItem.id)}
353
- >
354
- <SubIcon className="mt-0.5 h-5 w-5 shrink-0 self-start" />
355
- <div className="min-w-0 flex-1 text-start">
356
- <div className="font-medium">{subItem.label}</div>
357
- {subItem.description && (
358
- <div className="mt-0.5 text-xs text-muted-foreground">
359
- {subItem.description}
360
- </div>
361
- )}
362
- </div>
363
- </SidebarMenuButton>
364
- </SidebarMenuItem>
365
- );
366
- })}
367
- </SidebarMenu>
368
- </SidebarGroupContent>
369
- </SidebarGroup>
370
- </SidebarContent>
371
- </Sidebar>
372
- )}
373
- </div>
374
- );
375
- }
@@ -1,18 +0,0 @@
1
- import type { Meta, StoryObj } from "@storybook/react-vite";
2
- import { SidebarProvider } from "@elabs-ai/components-ui";
3
- import { AppSidebar } from "./app-sidebar";
4
-
5
- const meta = {
6
- title: "Layout/App Shell/Double-Sided",
7
- parameters: { layout: "fullscreen" },
8
- } satisfies Meta;
9
- export default meta;
10
- type Story = StoryObj<typeof meta>;
11
-
12
- export const Default: Story = {
13
- render: () => (
14
- <SidebarProvider>
15
- <AppSidebar />
16
- </SidebarProvider>
17
- ),
18
- };
@@ -1,6 +0,0 @@
1
- /**
2
- * sidebar-05 — team switcher. The shared `TeamSwitcher` nav primitive lives in
3
- * `@elabs-ai/components-ui` (#99); this block re-exports it rather than forking a local copy
4
- * (which drifts). The block's `app-sidebar.tsx` already imports it from `@elabs-ai/components-ui`.
5
- */
6
- export { TeamSwitcher } from "@elabs-ai/components-ui";