@acryldev/plugin-context 0.0.0-stage → 0.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 (284) hide show
  1. package/LICENSE +21 -0
  2. package/docs/README.md +160 -0
  3. package/docs/delivery/local-live.md +113 -0
  4. package/docs/delivery/marketplace.md +16 -0
  5. package/docs/docs.json +2836 -0
  6. package/docs/extending/agent-preset.md +37 -0
  7. package/docs/extending/chat-command.md +28 -0
  8. package/docs/extending/client-slot.md +135 -0
  9. package/docs/extending/config-schema.md +7 -0
  10. package/docs/extending/cordis-core.md +63 -0
  11. package/docs/extending/desktop-app.md +53 -0
  12. package/docs/extending/desktop-main.md +25 -0
  13. package/docs/extending/event-hook.md +14 -0
  14. package/docs/extending/host-route.md +33 -0
  15. package/docs/extending/llm-adapter.md +38 -0
  16. package/docs/extending/packaging.md +53 -0
  17. package/docs/extending/prompt-contribution.md +9 -0
  18. package/docs/extending/service.md +13 -0
  19. package/docs/extending/skill-provider.md +9 -0
  20. package/docs/extending/state-and-persistence.md +71 -0
  21. package/docs/extending/three-role-capability.md +33 -0
  22. package/docs/extending/tool-plugin.md +24 -0
  23. package/docs/extending/tui-command.md +8 -0
  24. package/docs/extending/tui-components.md +61 -0
  25. package/docs/extending/ui-branding.md +43 -0
  26. package/docs/extending/ui-components.md +56 -0
  27. package/docs/extending/ui-customization.md +41 -0
  28. package/docs/extending/ui-library.md +66 -0
  29. package/docs/extending/ui-theme.md +55 -0
  30. package/docs/extending/workspace-tab.md +50 -0
  31. package/docs/maps/events.md +108 -0
  32. package/docs/maps/mount-points.md +154 -0
  33. package/docs/maps/slot-contracts.md +3376 -0
  34. package/docs/maps/taxonomy.md +306 -0
  35. package/docs/maps/theme-tokens.md +115 -0
  36. package/docs/maps/ui-components.md +26 -0
  37. package/docs/reference/cookbook/adding-a-package.md +174 -0
  38. package/docs/reference/cookbook/adding-a-remote-api.md +199 -0
  39. package/docs/reference/cookbook/adding-a-settings-card.md +74 -0
  40. package/docs/reference/cookbook/adding-a-tool.md +103 -0
  41. package/docs/reference/cookbook/adding-an-llm-adapter.md +45 -0
  42. package/docs/reference/cookbook/extension-cookbook.md +134 -0
  43. package/docs/reference/cordis-api/context.md +366 -0
  44. package/docs/reference/cordis-api/events.md +209 -0
  45. package/docs/reference/cordis-api/fiber.md +377 -0
  46. package/docs/reference/cordis-api/inherited.md +40 -0
  47. package/docs/reference/cordis-api/registry.md +154 -0
  48. package/docs/reference/cordis-api/service.md +104 -0
  49. package/docs/reference/cordis-guides/cordis-usage-cheatsheet.md +167 -0
  50. package/docs/reference/cordis-guides/cordis_system_guide_for_coding_agents.md +4666 -0
  51. package/docs/reference/cordis-guides/development-canvas-plugin.md +109 -0
  52. package/docs/reference/cordis-guides/hello-world-plugin-guide.md +517 -0
  53. package/docs/reference/harness/agent-lifecycle.md +93 -0
  54. package/docs/reference/harness/architecture.md +168 -0
  55. package/docs/reference/harness/capability-seams.md +675 -0
  56. package/docs/reference/harness/config-catalog.md +4523 -0
  57. package/docs/reference/harness/cordis-primer.md +47 -0
  58. package/docs/reference/harness/defensive-patterns.md +35 -0
  59. package/docs/reference/harness/event-producer-consumer.md +111 -0
  60. package/docs/reference/harness/glossary.md +47 -0
  61. package/docs/reference/harness/tool-catalog.md +2721 -0
  62. package/docs/reference/harness/tool-execution-pipeline.md +67 -0
  63. package/docs/reference/subsystems/README.md +75 -0
  64. package/docs/reference/subsystems/agent-team.md +233 -0
  65. package/docs/reference/subsystems/approval.md +172 -0
  66. package/docs/reference/subsystems/attachment.md +363 -0
  67. package/docs/reference/subsystems/boot.md +324 -0
  68. package/docs/reference/subsystems/browser-use.md +69 -0
  69. package/docs/reference/subsystems/client-modules.md +186 -0
  70. package/docs/reference/subsystems/client-resources.md +94 -0
  71. package/docs/reference/subsystems/commands.md +225 -0
  72. package/docs/reference/subsystems/compaction.md +286 -0
  73. package/docs/reference/subsystems/computer-use.md +58 -0
  74. package/docs/reference/subsystems/conversation.md +287 -0
  75. package/docs/reference/subsystems/core.md +1107 -0
  76. package/docs/reference/subsystems/credentials.md +497 -0
  77. package/docs/reference/subsystems/deliverables.md +180 -0
  78. package/docs/reference/subsystems/extensions.md +386 -0
  79. package/docs/reference/subsystems/feedback.md +402 -0
  80. package/docs/reference/subsystems/filesystem.md +532 -0
  81. package/docs/reference/subsystems/goal.md +315 -0
  82. package/docs/reference/subsystems/invariants.md +90 -0
  83. package/docs/reference/subsystems/jobs.md +501 -0
  84. package/docs/reference/subsystems/llm-streaming.md +1131 -0
  85. package/docs/reference/subsystems/lsp.md +204 -0
  86. package/docs/reference/subsystems/mcp.md +141 -0
  87. package/docs/reference/subsystems/office-to-pdf.md +89 -0
  88. package/docs/reference/subsystems/otel.md +46 -0
  89. package/docs/reference/subsystems/permission-presets.md +169 -0
  90. package/docs/reference/subsystems/persistence.md +418 -0
  91. package/docs/reference/subsystems/plan.md +89 -0
  92. package/docs/reference/subsystems/product-telemetry.md +81 -0
  93. package/docs/reference/subsystems/ptc-runtime.md +234 -0
  94. package/docs/reference/subsystems/sandbox.md +223 -0
  95. package/docs/reference/subsystems/schedule.md +545 -0
  96. package/docs/reference/subsystems/scope.md +61 -0
  97. package/docs/reference/subsystems/session-projection.md +358 -0
  98. package/docs/reference/subsystems/session-query.md +511 -0
  99. package/docs/reference/subsystems/session-reference.md +226 -0
  100. package/docs/reference/subsystems/session-telemetry.md +214 -0
  101. package/docs/reference/subsystems/session-title.md +206 -0
  102. package/docs/reference/subsystems/session.md +1300 -0
  103. package/docs/reference/subsystems/settings.md +157 -0
  104. package/docs/reference/subsystems/shell.md +316 -0
  105. package/docs/reference/subsystems/sidebar-right.md +160 -0
  106. package/docs/reference/subsystems/skills.md +354 -0
  107. package/docs/reference/subsystems/slots.md +201 -0
  108. package/docs/reference/subsystems/spill.md +126 -0
  109. package/docs/reference/subsystems/ssh.md +137 -0
  110. package/docs/reference/subsystems/storage.md +262 -0
  111. package/docs/reference/subsystems/subagent.md +762 -0
  112. package/docs/reference/subsystems/subprocess.md +323 -0
  113. package/docs/reference/subsystems/system-prompt.md +226 -0
  114. package/docs/reference/subsystems/terminal.md +186 -0
  115. package/docs/reference/subsystems/todo.md +34 -0
  116. package/docs/reference/subsystems/token-meter.md +108 -0
  117. package/docs/reference/subsystems/tools.md +749 -0
  118. package/docs/reference/subsystems/typert.md +489 -0
  119. package/docs/reference/subsystems/user-questions.md +309 -0
  120. package/docs/reference/subsystems/voice-input.md +166 -0
  121. package/docs/reference/subsystems/web-client.md +102 -0
  122. package/docs/reference/subsystems/web-server.md +228 -0
  123. package/docs/reference/subsystems/web.md +208 -0
  124. package/docs/reference/subsystems/webhook.md +72 -0
  125. package/docs/reference/subsystems/workflow.md +280 -0
  126. package/docs/reference/subsystems/workspace.md +661 -0
  127. package/docs/start-here/blueprints.md +33 -0
  128. package/docs/start-here/this-runtime.md +84 -0
  129. package/docs/start-here/troubleshooting.md +29 -0
  130. package/docs/start-here/trust-and-safety.md +39 -0
  131. package/docs/start-here/verify-before-done.md +46 -0
  132. package/example-plugins/README.md +45 -0
  133. package/example-plugins/packages/agent-preset-reviewer/agent.cordis.yml +18 -0
  134. package/example-plugins/packages/agent-preset-reviewer/preset.yml +3 -0
  135. package/example-plugins/packages/capability-swap-consumer/cordis.patch.yml +3 -0
  136. package/example-plugins/packages/capability-swap-consumer/index.js +14 -0
  137. package/example-plugins/packages/capability-swap-consumer/package.json +25 -0
  138. package/example-plugins/packages/capability-swap-provider-loud/cordis.patch.yml +3 -0
  139. package/example-plugins/packages/capability-swap-provider-loud/index.js +20 -0
  140. package/example-plugins/packages/capability-swap-provider-loud/package.json +25 -0
  141. package/example-plugins/packages/capability-swap-provider-quiet/cordis.patch.yml +3 -0
  142. package/example-plugins/packages/capability-swap-provider-quiet/index.js +20 -0
  143. package/example-plugins/packages/capability-swap-provider-quiet/package.json +25 -0
  144. package/example-plugins/packages/chat-command-basic/cordis.patch.yml +3 -0
  145. package/example-plugins/packages/chat-command-basic/index.js +26 -0
  146. package/example-plugins/packages/chat-command-basic/package.json +25 -0
  147. package/example-plugins/packages/client-chat-message-action/client.js +46 -0
  148. package/example-plugins/packages/client-chat-message-action/cordis.patch.yml +3 -0
  149. package/example-plugins/packages/client-chat-message-action/index.js +9 -0
  150. package/example-plugins/packages/client-chat-message-action/package.json +31 -0
  151. package/example-plugins/packages/client-slot-header-action/client.js +57 -0
  152. package/example-plugins/packages/client-slot-header-action/cordis.patch.yml +3 -0
  153. package/example-plugins/packages/client-slot-header-action/index.js +13 -0
  154. package/example-plugins/packages/client-slot-header-action/package.json +31 -0
  155. package/example-plugins/packages/client-slot-sidebar-tab/client.js +57 -0
  156. package/example-plugins/packages/client-slot-sidebar-tab/cordis.patch.yml +3 -0
  157. package/example-plugins/packages/client-slot-sidebar-tab/index.js +9 -0
  158. package/example-plugins/packages/client-slot-sidebar-tab/package.json +32 -0
  159. package/example-plugins/packages/client-theme-override/client.js +52 -0
  160. package/example-plugins/packages/client-theme-override/cordis.patch.yml +3 -0
  161. package/example-plugins/packages/client-theme-override/index.js +9 -0
  162. package/example-plugins/packages/client-theme-override/package.json +30 -0
  163. package/example-plugins/packages/client-tool-view/client.js +47 -0
  164. package/example-plugins/packages/client-tool-view/cordis.patch.yml +3 -0
  165. package/example-plugins/packages/client-tool-view/index.js +24 -0
  166. package/example-plugins/packages/client-tool-view/package.json +34 -0
  167. package/example-plugins/packages/client-ui-components/client.js +77 -0
  168. package/example-plugins/packages/client-ui-components/cordis.patch.yml +3 -0
  169. package/example-plugins/packages/client-ui-components/index.js +9 -0
  170. package/example-plugins/packages/client-ui-components/package.json +31 -0
  171. package/example-plugins/packages/client-ui-library/client.js +715 -0
  172. package/example-plugins/packages/client-ui-library/cordis.patch.yml +3 -0
  173. package/example-plugins/packages/client-ui-library/index.js +9 -0
  174. package/example-plugins/packages/client-ui-library/package.json +37 -0
  175. package/example-plugins/packages/client-workspace-tab/client.js +72 -0
  176. package/example-plugins/packages/client-workspace-tab/cordis.patch.yml +3 -0
  177. package/example-plugins/packages/client-workspace-tab/index.js +9 -0
  178. package/example-plugins/packages/client-workspace-tab/package.json +30 -0
  179. package/example-plugins/packages/config-schema-basic/cordis.patch.yml +3 -0
  180. package/example-plugins/packages/config-schema-basic/index.js +19 -0
  181. package/example-plugins/packages/config-schema-basic/package.json +25 -0
  182. package/example-plugins/packages/desktop-main-profile-info/cordis.patch.yml +3 -0
  183. package/example-plugins/packages/desktop-main-profile-info/index.js +22 -0
  184. package/example-plugins/packages/desktop-main-profile-info/package.json +25 -0
  185. package/example-plugins/packages/event-hook-basic/cordis.patch.yml +3 -0
  186. package/example-plugins/packages/event-hook-basic/index.js +17 -0
  187. package/example-plugins/packages/event-hook-basic/package.json +22 -0
  188. package/example-plugins/packages/generated-capability-template/cordis.patch.yml +3 -0
  189. package/example-plugins/packages/generated-capability-template/index.js +16 -0
  190. package/example-plugins/packages/generated-capability-template/package.json +42 -0
  191. package/example-plugins/packages/host-route-basic/cordis.patch.yml +3 -0
  192. package/example-plugins/packages/host-route-basic/index.js +20 -0
  193. package/example-plugins/packages/host-route-basic/package.json +29 -0
  194. package/example-plugins/packages/lifecycle-function-basic/cordis.patch.yml +3 -0
  195. package/example-plugins/packages/lifecycle-function-basic/index.js +12 -0
  196. package/example-plugins/packages/lifecycle-function-basic/package.json +15 -0
  197. package/example-plugins/packages/lifecycle-function-hot-shim/cordis.patch.yml +3 -0
  198. package/example-plugins/packages/lifecycle-function-hot-shim/impl.js +5 -0
  199. package/example-plugins/packages/lifecycle-function-hot-shim/index.js +18 -0
  200. package/example-plugins/packages/lifecycle-function-hot-shim/package.json +23 -0
  201. package/example-plugins/packages/lifecycle-hooks-observer/cordis.patch.yml +3 -0
  202. package/example-plugins/packages/lifecycle-hooks-observer/index.js +23 -0
  203. package/example-plugins/packages/lifecycle-hooks-observer/package.json +22 -0
  204. package/example-plugins/packages/llm-adapter-echo/cordis.patch.yml +3 -0
  205. package/example-plugins/packages/llm-adapter-echo/index.js +42 -0
  206. package/example-plugins/packages/llm-adapter-echo/package.json +25 -0
  207. package/example-plugins/packages/prompt-assemble-hook/cordis.patch.yml +3 -0
  208. package/example-plugins/packages/prompt-assemble-hook/index.js +22 -0
  209. package/example-plugins/packages/prompt-assemble-hook/package.json +22 -0
  210. package/example-plugins/packages/prompt-contribution-basic/cordis.patch.yml +3 -0
  211. package/example-plugins/packages/prompt-contribution-basic/index.js +18 -0
  212. package/example-plugins/packages/prompt-contribution-basic/package.json +22 -0
  213. package/example-plugins/packages/service-consumer-greeter/cordis.patch.yml +3 -0
  214. package/example-plugins/packages/service-consumer-greeter/index.js +14 -0
  215. package/example-plugins/packages/service-consumer-greeter/package.json +22 -0
  216. package/example-plugins/packages/service-provider-greeter/cordis.patch.yml +3 -0
  217. package/example-plugins/packages/service-provider-greeter/index.js +22 -0
  218. package/example-plugins/packages/service-provider-greeter/package.json +25 -0
  219. package/example-plugins/packages/settings-section-basic/cordis.patch.yml +3 -0
  220. package/example-plugins/packages/settings-section-basic/index.js +34 -0
  221. package/example-plugins/packages/settings-section-basic/package.json +26 -0
  222. package/example-plugins/packages/skill-provider-basic/cordis.patch.yml +3 -0
  223. package/example-plugins/packages/skill-provider-basic/index.js +31 -0
  224. package/example-plugins/packages/skill-provider-basic/package.json +22 -0
  225. package/example-plugins/packages/state-host-store/client.js +57 -0
  226. package/example-plugins/packages/state-host-store/cordis.patch.yml +3 -0
  227. package/example-plugins/packages/state-host-store/index.js +90 -0
  228. package/example-plugins/packages/state-host-store/package.json +31 -0
  229. package/example-plugins/packages/state-workspace-file/cordis.patch.yml +3 -0
  230. package/example-plugins/packages/state-workspace-file/index.js +52 -0
  231. package/example-plugins/packages/state-workspace-file/package.json +25 -0
  232. package/example-plugins/packages/tool-basic/cordis.patch.yml +3 -0
  233. package/example-plugins/packages/tool-basic/index.js +25 -0
  234. package/example-plugins/packages/tool-basic/package.json +25 -0
  235. package/example-plugins/packages/tool-policy-hook/cordis.patch.yml +3 -0
  236. package/example-plugins/packages/tool-policy-hook/index.js +28 -0
  237. package/example-plugins/packages/tool-policy-hook/package.json +25 -0
  238. package/example-plugins/packages/tui-command-basic/cordis.patch.yml +3 -0
  239. package/example-plugins/packages/tui-command-basic/index.js +24 -0
  240. package/example-plugins/packages/tui-command-basic/package.json +22 -0
  241. package/example-plugins/packages/tui-overlay-themed/cordis.patch.yml +3 -0
  242. package/example-plugins/packages/tui-overlay-themed/index.js +65 -0
  243. package/example-plugins/packages/tui-overlay-themed/package.json +25 -0
  244. package/example-plugins/packages/tui-ui-library/cordis.patch.yml +3 -0
  245. package/example-plugins/packages/tui-ui-library/index.js +73 -0
  246. package/example-plugins/packages/tui-ui-library/package.json +29 -0
  247. package/example-plugins/packages/web-page-branding/cordis.patch.yml +3 -0
  248. package/example-plugins/packages/web-page-branding/index.js +31 -0
  249. package/example-plugins/packages/web-page-branding/package.json +22 -0
  250. package/example-plugins/scenarios.json +11 -0
  251. package/index.js +384 -0
  252. package/lib/blend-apply.js +107 -0
  253. package/lib/blend-capture.js +249 -0
  254. package/lib/blend-ledger.js +76 -0
  255. package/lib/contract.js +5 -0
  256. package/lib/install.js +516 -0
  257. package/lib/lookup.js +67 -0
  258. package/lib/manifest.js +56 -0
  259. package/lib/pack-root.js +22 -0
  260. package/lib/provenance.js +110 -0
  261. package/lib/publish.js +64 -0
  262. package/lib/reconcile.js +83 -0
  263. package/lib/router.js +55 -0
  264. package/lib/scopes.js +82 -0
  265. package/lib/skills.js +54 -0
  266. package/lib/stage.js +157 -0
  267. package/lib/verify.js +77 -0
  268. package/package.json +56 -3
  269. package/scripts/lib/indexes.mjs +45 -0
  270. package/scripts/lib/manifest.mjs +127 -0
  271. package/scripts/lib/maps.mjs +482 -0
  272. package/skills/acryl-add-provider-or-capability/SKILL.md +12 -0
  273. package/skills/acryl-add-ui/SKILL.md +18 -0
  274. package/skills/acryl-build-plugin/SKILL.md +21 -0
  275. package/skills/acryl-change-plugin/SKILL.md +16 -0
  276. package/skills/acryl-desktop-shell/SKILL.md +12 -0
  277. package/skills/acryl-diagnose-plugin/SKILL.md +10 -0
  278. package/skills/acryl-fix-plugin/SKILL.md +12 -0
  279. package/skills/acryl-improve-ui/SKILL.md +10 -0
  280. package/skills/acryl-remove-plugin/SKILL.md +11 -0
  281. package/skills/acryl-restyle-ui/SKILL.md +14 -0
  282. package/skills/acryl-share-plugin/SKILL.md +23 -0
  283. package/skills/acryl-tui-ui/SKILL.md +12 -0
  284. package/README.md +0 -3
@@ -0,0 +1,715 @@
1
+ // Example: ui-library.gallery (browser half)
2
+ // Type: client-slot
3
+ // Surfaces: web desktop
4
+ // Teaches: build a Settings page (`ui.settingsSection`) from `@acryldev/ui` instead of hand-styling: `require('@acryldev/ui')` gives Card, Field, SwitchField, SettingsRow, SelectField,
5
+ // Segmented, Tabs, Dialog, EmptyState, Stack, the app's Button/Tag/Pill/Toast/Modal re-exported, the semantic color roles, and slot helpers. List
6
+ // "@acryldev/ui" in `dsh.client.inject` (package.json). The library already follows light and dark; use `ui.roles.<role>` for any color of your own.
7
+ // Expect: a "UI library" entry in the Settings screen's left navigation; its page has tabs: Components, Settings form, Conversation, Colors (DSH token names).
8
+ // Docs: extending.ui-library
9
+ window.__ModuleLoader__.load({ id: 'acryl-example-ui-library', factory: (require) => {
10
+ var module = { exports: {} }; var exports = module.exports;
11
+
12
+ const React = require('react')
13
+ const ui = require('@acryldev/ui')
14
+ const h = React.createElement
15
+ const { Stack, Card, Field, SwitchField, SettingsRow, SelectField, Segmented, Tabs, Dialog, EmptyState, Button, Tag, Pill } = ui
16
+ const { StateDot, DisclosureRow, Switch, Input, JsonTree, TerminalBlock, ReadBlock, DiffBlock, RiskConfirmation, ConnectionIndicator, WebBlock, CodeBlock, JsonBlock, MarkdownText, ReferenceIcon, LinkIcon, DocumentFileIcon } = ui
17
+ const { Badge, Skeleton, Spinner, Alert, Separator, Progress, Avatar, Label, Textarea, Checkbox, AspectRatio, Breadcrumb, BreadcrumbList, BreadcrumbItem, BreadcrumbLink, BreadcrumbPage, BreadcrumbSeparator, Toggle, ButtonGroup, ButtonGroupText, ButtonGroupSeparator, Accordion, AccordionItem, AccordionTrigger, AccordionContent, RadioGroup, Collapsible, CollapsibleTrigger, CollapsibleContent, ToggleGroup, ToggleGroupItem } = ui
18
+ // T045 batch 1 (spec 038-ui-component-library): ported from shadcn/ui, no Radix.
19
+ const { Table, TableCaption, TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, DirectionProvider, useDirection, Marker, MarkerContent, MarkerIcon, Message, MessageGroup, MessageAvatar, MessageContent, MessageHeader, MessageFooter, Bubble, BubbleContent, BubbleReactions, Pagination, PaginationContent, PaginationItem, PaginationLink, PaginationPrevious, PaginationNext, PaginationEllipsis, NativeSelect, NativeSelectOption } = ui
20
+ // T045 batch 2 (spec 038-ui-component-library): the items that compose shadcn siblings - resolved without a single cross-item import.
21
+ const { ScrollArea, InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator, Item, ItemGroup, ItemSeparator, ItemMedia, ItemContent, ItemTitle, ItemDescription, ItemActions, Attachment, AttachmentGroup, AttachmentMedia, AttachmentContent, AttachmentTitle, AttachmentDescription, AttachmentActions, AttachmentAction, AttachmentTrigger, InputGroup, InputGroupAddon, InputGroupButton, InputGroupText, InputGroupInput, FormField, FieldSet, FieldLegend, FieldGroup, FieldContent, FieldLabel, FieldDescription, FieldSeparator, FieldError } = ui
22
+ // T045 batch 3 (spec 038-ui-component-library): Radix overlays and input primitives rewritten by hand.
23
+ const { Popover, PopoverTrigger, PopoverContent, PopoverHeader, PopoverTitle, PopoverDescription, Slider } = ui
24
+ // T045 batch 4: Sheet, built on the overlay pattern Popover's port established.
25
+ const { Sheet, SheetTrigger, SheetClose, SheetContent, SheetHeader, SheetFooter, SheetTitle, SheetDescription } = ui
26
+ // T045 batch 4b: Drawer, the same overlay with drag-to-dismiss.
27
+ const { Drawer, DrawerTrigger, DrawerClose, DrawerContent, DrawerHeader, DrawerFooter, DrawerTitle, DrawerDescription } = ui
28
+ // T045 batch 5a: Command, cmdk rewritten by hand.
29
+ const { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandShortcut, CommandSeparator } = ui
30
+ // T045 batch 5b: Combobox, single-select core, with InputGroup's chrome restated for its field.
31
+ const { Combobox, ComboboxInput, ComboboxTrigger, ComboboxClear, ComboboxContent, ComboboxList, ComboboxGroup, ComboboxLabel, ComboboxEmpty, ComboboxSeparator, ComboboxItem } = ui
32
+ // T045 batch 6a: ContextMenu, the anchored-listbox shape anchored at the pointer.
33
+ const { ContextMenu, ContextMenuTrigger, ContextMenuContent, ContextMenuItem, ContextMenuCheckboxItem, ContextMenuRadioGroup, ContextMenuRadioItem, ContextMenuLabel, ContextMenuSeparator, ContextMenuShortcut } = ui
34
+ // T045 batch 6b: Carousel, the platform's scroller with snap points in place of embla.
35
+ const { Carousel, CarouselContent, CarouselItem, CarouselPrevious, CarouselNext } = ui
36
+ // T045 batch 6c: ResizablePanelGroup, drag or key the dividers between panels.
37
+ const { ResizablePanelGroup, ResizablePanel, ResizableHandle } = ui
38
+ // T045 batch 7: Menubar and NavigationMenu, the two bars.
39
+ const { Menubar, MenubarMenu, MenubarTrigger, MenubarContent, MenubarGroup, MenubarLabel, MenubarItem, MenubarShortcut, MenubarCheckboxItem, MenubarRadioGroup, MenubarRadioItem, MenubarSeparator } = ui
40
+ const { NavigationMenu, NavigationMenuList, NavigationMenuItem, NavigationMenuTrigger, NavigationMenuContent, NavigationMenuLink } = ui
41
+ // T045 batch 8: Calendar, the hand-rolled month grid.
42
+ const { Calendar } = ui
43
+ // T045 batch 9: the Sidebar rail.
44
+ const { SidebarProvider, Sidebar, SidebarTrigger, SidebarRail, SidebarInset, SidebarHeader, SidebarContent, SidebarFooter, SidebarSeparator, SidebarGroup, SidebarGroupLabel, SidebarGroupContent, SidebarMenu, SidebarMenuItem, SidebarMenuButton, SidebarMenuAction, SidebarMenuBadge, SidebarMenuSub, SidebarMenuSubItem, SidebarMenuSubButton, useSidebar } = ui
45
+
46
+ // Every part below is live: type, click, toggle, open. The catalogue is the point, so each entry is a working instance, not a picture.
47
+ function Section({ name, note, children }) {
48
+ return h(Card, { title: name }, h('p', { style: { margin: '0 0 12px', color: ui.roles.textMuted, fontSize: 12 } }, note), children)
49
+ }
50
+
51
+ function Components() {
52
+ const [name, setName] = React.useState('')
53
+ const [on, setOn] = React.useState(true)
54
+ const [clicks, setClicks] = React.useState(0)
55
+ const [tab, setTab] = React.useState('one')
56
+ const [pick, setPick] = React.useState('write')
57
+ const [seg, setSeg] = React.useState('dark')
58
+ const [modal, setModal] = React.useState(false)
59
+ const [answer, setAnswer] = React.useState('nothing yet')
60
+ return h(Stack, { gap: 'md' },
61
+ h(Section, { name: 'Button', note: 'ui.Button: primary, ghost, disabled. Click them.' },
62
+ h(Stack, { direction: 'row', gap: 'sm', align: 'center' },
63
+ h(ui.Button, { variant: 'primary', size: 'sm', onClick: () => setClicks(clicks + 1) }, 'Primary (' + clicks + ')'),
64
+ h(ui.Button, { variant: 'ghost', size: 'sm', onClick: () => setClicks(0) }, 'Reset'),
65
+ h(ui.Button, { variant: 'primary', size: 'sm', disabled: true }, 'Disabled'))),
66
+ h(Section, { name: 'Field and SwitchField', note: 'Type in the field; more than 12 characters shows the error state.' },
67
+ h(Field, { label: 'Name', value: name, onChange: setName, hint: 'Shown in the header', error: name.length > 12 ? 'Too long (max 12)' : undefined }),
68
+ h(SwitchField, { label: 'Loud mode', checked: on, onChange: setOn, hint: on ? 'On: uppercase everything' : 'Off' })),
69
+ h(Section, { name: 'SelectField and Segmented', note: 'Open the menu; pick a tile. The value shown below each is live.' },
70
+ h(SelectField, { label: 'Permission', value: pick, onChange: setPick, options: [{ id: 'read', label: 'Read Only' }, { id: 'write', label: 'Workspace Write' }, { id: 'full', label: 'Full access' }] }),
71
+ h(Segmented, { title: 'Appearance', value: seg, onChange: setSeg, options: [{ id: 'light', label: 'Light' }, { id: 'dark', label: 'Dark' }, { id: 'system', label: 'System' }] }),
72
+ h('p', { style: { margin: '8px 0 0', color: ui.roles.textMuted, fontSize: 12 } }, 'permission = ' + pick + ', appearance = ' + seg)),
73
+ h(Section, { name: 'Tabs', note: 'Arrow keys move between tabs.' },
74
+ h(ui.Tabs, { label: 'Demo', value: tab, onChange: setTab, tabs: [{ id: 'one', label: 'One' }, { id: 'two', label: 'Two' }] }, h('p', { style: { margin: 0 } }, 'Panel ' + tab))),
75
+ h(Section, { name: 'Tag, Pill, Tooltip', note: 'Hover the button for the tooltip.' },
76
+ h(Stack, { direction: 'row', gap: 'sm', align: 'center' },
77
+ h(ui.Tag, null, 'Tag'), h(ui.Pill, null, 'Pill'),
78
+ h(ui.Tooltip, { label: 'This is a tooltip' }, h(ui.Button, { variant: 'ghost', size: 'sm' }, 'Hover me')))),
79
+ h(Section, { name: 'Dialog', note: 'A confirm dialog over the app Modal.' },
80
+ h(Stack, { direction: 'row', gap: 'sm', align: 'center' },
81
+ h(ui.Button, { variant: 'primary', size: 'sm', onClick: () => setModal(true) }, 'Open dialog'),
82
+ h('span', { style: { color: ui.roles.textMuted, fontSize: 12 } }, 'last answer: ' + answer)),
83
+ h(Dialog, { open: modal, title: 'Delete item?', onClose: () => setModal(false), onConfirm: () => setAnswer('confirmed'), confirmLabel: 'Delete' }, 'This cannot be undone.')),
84
+ h(EmptyState, { title: 'Nothing yet', description: 'Saved items appear here' }))
85
+ }
86
+
87
+ function Blocks2() {
88
+ const codeLabels = { copyLabel: 'Copy', copiedLabel: 'Copied' }
89
+ const markdownLabels = { code: codeLabels, footnotes: 'Footnotes' }
90
+ return h(Stack, { gap: 'md' },
91
+ h(Section, { name: 'ReferenceIcon, LinkIcon, DocumentFileIcon', note: 'Small glyphs used in mentions and attachments.' },
92
+ h(Stack, { direction: 'row', gap: 'md', align: 'center' },
93
+ h(ReferenceIcon, { kind: 'file' }), h(ReferenceIcon, { kind: 'folder' }), h(ReferenceIcon, { kind: 'session' }),
94
+ h(LinkIcon, { kind: 'code' }), h(DocumentFileIcon, null))),
95
+ h(Section, { name: 'WebBlock', note: 'A web-search result card with two sources.' },
96
+ h(WebBlock, { kind: 'search', labels: { noResults: 'No results', sourcesTruncated: 'More sources hidden', http: 'HTTP', contentTruncated: 'Content truncated', markdown: markdownLabels }, answer: 'Cordis is a lifecycle framework.', sources: [{ url: 'https://example.test/a', title: 'Example A', snippet: 'First source.' }, { url: 'https://example.test/b', title: 'Example B' }], truncated: false })),
97
+ h(Section, { name: 'CodeBlock and JsonBlock', note: 'Used inside MarkdownText for fenced code and JSON.' },
98
+ h(CodeBlock, { code: 'export const x = 1', lang: 'ts' }),
99
+ h(JsonBlock, { label: 'Payload', payload: { ok: true, count: 3 }, truncatedLabel: n => 'Truncated (' + n + ' chars)' })),
100
+ h(Section, { name: 'MarkdownText', note: 'Full markdown rendering: headings, lists, code.' },
101
+ h(MarkdownText, { text: '## Heading\n\nSome **bold** text and a list:\n\n- one\n- two\n\n```ts\nconst x = 1\n```', labels: markdownLabels })))
102
+ }
103
+
104
+ function ShadcnBatch3() {
105
+ const [radio, setRadio] = React.useState('a')
106
+ const [multi, setMulti] = React.useState(['bold'])
107
+ return h(Stack, { gap: 'md' },
108
+ h(Section, { name: 'RadioGroup', note: 'Classic radio dots, distinct from the tile-style AppearanceCubes.' },
109
+ h(RadioGroup, { name: 'demo-radio', value: radio, onChange: setRadio, options: [{ id: 'a', label: 'Option A' }, { id: 'b', label: 'Option B' }, { id: 'c', label: 'Option C' }] })),
110
+ h(Section, { name: 'Collapsible', note: 'The bare primitive: no icon or chevron chrome.' },
111
+ h(Collapsible, { defaultOpen: false },
112
+ h(CollapsibleTrigger, null, 'Toggle details'),
113
+ h(CollapsibleContent, null, h('p', { style: { margin: '8px 0 0' } }, 'Plain content, no chrome.')))),
114
+ h(Section, { name: 'ToggleGroup', note: 'Multiple selection: click to toggle bold/italic independently.' },
115
+ h(ToggleGroup, { type: 'multiple', value: multi, onChange: setMulti },
116
+ h(ToggleGroupItem, { value: 'bold' }, 'B'),
117
+ h(ToggleGroupItem, { value: 'italic' }, 'I'),
118
+ h(ToggleGroupItem, { value: 'underline' }, 'U'))))
119
+ }
120
+
121
+ function ShadcnBatch2() {
122
+ const [checked, setChecked] = React.useState(false)
123
+ const [pressed, setPressed] = React.useState(false)
124
+ const [text, setText] = React.useState('')
125
+ return h(Stack, { gap: 'md' },
126
+ h(Section, { name: 'Label, Textarea, Checkbox', note: 'A native label, a growable textarea and a checkbox.' },
127
+ h(Label, { htmlFor: 'demo-textarea' }, 'Notes'),
128
+ h(Textarea, { value: text, onChange: setText, placeholder: 'Type something...' }),
129
+ h(Checkbox, { checked, onChange: setChecked, label: 'I agree' })),
130
+ h(Section, { name: 'Toggle', note: 'Click to press/unpress.' },
131
+ h(Toggle, { pressed, onPressedChange: setPressed, variant: 'outline' }, pressed ? 'Pressed' : 'Not pressed')),
132
+ h(Section, { name: 'Breadcrumb', note: 'A trail with the current page last.' },
133
+ h(Breadcrumb, null, h(BreadcrumbList, null,
134
+ h(BreadcrumbItem, null, h(BreadcrumbLink, { href: '#' }, 'Home')),
135
+ h(BreadcrumbSeparator, null),
136
+ h(BreadcrumbItem, null, h(BreadcrumbLink, { href: '#' }, 'Settings')),
137
+ h(BreadcrumbSeparator, null),
138
+ h(BreadcrumbItem, null, h(BreadcrumbPage, null, 'UI library'))))),
139
+ h(Section, { name: 'AspectRatio', note: '16:9 box.' },
140
+ h(AspectRatio, { ratio: 16 / 9 }, h('div', { style: { width: '100%', height: '100%', background: ui.roles.surfaceRaised, display: 'flex', alignItems: 'center', justifyContent: 'center' } }, '16:9'))),
141
+ h(Section, { name: 'ButtonGroup', note: 'Corners merge between adjacent controls.' },
142
+ h(ButtonGroup, null, h(Button, { variant: 'outline', size: 'sm' }, 'Left'), h(Button, { variant: 'outline', size: 'sm' }, 'Middle'), h(Button, { variant: 'outline', size: 'sm' }, 'Right'))),
143
+ h(Section, { name: 'Accordion', note: 'Single mode: opening one closes the other.' },
144
+ h(Accordion, { type: 'single' },
145
+ h(AccordionItem, { value: 'a' }, h(AccordionTrigger, null, 'Section A'), h(AccordionContent, null, 'Content of A.')),
146
+ h(AccordionItem, { value: 'b' }, h(AccordionTrigger, null, 'Section B'), h(AccordionContent, null, 'Content of B.')))))
147
+ }
148
+
149
+ // shadcn/ui conversions (spec 038-ui-component-library T040): ported source, no Radix or lucide-react.
150
+ function ShadcnBatch() {
151
+ const [progress, setProgress] = React.useState(40)
152
+ return h(Stack, { gap: 'md' },
153
+ h(Section, { name: 'Badge', note: 'Five variants.' },
154
+ h(Stack, { direction: 'row', gap: 'sm' },
155
+ h(Badge, null, 'Default'), h(Badge, { variant: 'primary' }, 'Primary'), h(Badge, { variant: 'success' }, 'Success'), h(Badge, { variant: 'warning' }, 'Warning'), h(Badge, { variant: 'error' }, 'Error'))),
156
+ h(Section, { name: 'Avatar', note: 'Falls back to initials when there is no image or it fails to load.' },
157
+ h(Stack, { direction: 'row', gap: 'sm', align: 'center' },
158
+ h(Avatar, { fallback: 'AM', size: 'sm' }), h(Avatar, { fallback: 'AM' }), h(Avatar, { fallback: 'AM', size: 'lg' }), h(Avatar, { src: 'https://broken.invalid/x.png', fallback: 'Broken image ->' }))),
159
+ h(Section, { name: 'Alert', note: 'Default and error variants.' },
160
+ h(Alert, { title: 'Heads up' }, 'This is a default alert.'),
161
+ h(Alert, { variant: 'error', title: 'Something failed' }, 'This is an error alert.')),
162
+ h(Section, { name: 'Progress', note: 'Click to advance.' },
163
+ h(Progress, { value: progress }),
164
+ h(Button, { variant: 'ghost', size: 'sm', onClick: () => setProgress(p => (p + 20) % 120) }, 'Advance')),
165
+ h(Section, { name: 'Skeleton and Spinner', note: 'A loading placeholder and a rotating indicator.' },
166
+ h(Stack, { direction: 'row', gap: 'md', align: 'center' },
167
+ h(Skeleton, { style: { width: 120, height: 16 } }), h(Spinner, null))),
168
+ h(Section, { name: 'Separator', note: 'Horizontal between two lines; vertical between two words.' },
169
+ h('div', null, 'Above'), h(Separator, null), h('div', null, 'Below'),
170
+ h(Stack, { direction: 'row', gap: 'sm', align: 'center' }, h('span', null, 'Left'), h('div', { style: { height: 16 } }, h(Separator, { orientation: 'vertical', decorative: true })), h('span', null, 'Right'))))
171
+ }
172
+
173
+ // The 15 primitives re-exported straight from the app this pass (spec 038-ui-component-library T035). Each one below is real, live output, not a mock; the tool
174
+ // blocks are given real-shaped fixture data so the truncation, copy button and status pill all behave as they would on a real tool call.
175
+ function Blocks() {
176
+ const [open, setOpen] = React.useState(false)
177
+ const [risk, setRisk] = React.useState(false)
178
+ const [ack, setAck] = React.useState(false)
179
+ return h(Stack, { gap: 'md' },
180
+ h(Section, { name: 'StateDot and ConnectionIndicator', note: 'Status dots used by ToolCallCard and the connection banner.' },
181
+ h(Stack, { direction: 'row', gap: 'md', align: 'center' },
182
+ h(StateDot, { state: 'done' }), h(StateDot, { state: 'error' }), h(StateDot, { state: 'ongoing' }),
183
+ h(ConnectionIndicator, { state: 'connected' }))),
184
+ h(Section, { name: 'DisclosureRow', note: 'The collapsible row ToolCallCard is built on.' },
185
+ h(DisclosureRow, { icon: h(StateDot, { state: 'done' }), title: 'Read', open, expandable: true, onToggle: () => setOpen(!open), collapsedContent: h('span', null, 'a.ts') }, h('p', { style: { margin: 0 } }, 'expanded body')),
186
+ h('span', { style: { color: ui.roles.textMuted, fontSize: 12 } }, 'open = ' + open)),
187
+ h(Section, { name: 'Switch and Input (bare)', note: 'The primitives SwitchField and Field build on; Switch needs its own visible label, Input has none.' },
188
+ h(Stack, { direction: 'row', gap: 'md', align: 'center' },
189
+ h(Switch, { checked: risk, onChange: setRisk, label: 'Bare switch' }), h(Input, { value: '', onChange: () => {} }))),
190
+ h(Section, { name: 'TerminalBlock', note: 'A settled command with a non-zero exit.' },
191
+ h(TerminalBlock, { command: 'pnpm test', output: '1 failing\n expected true to be false', exitCode: 1, labels: { signal: s => 'signal ' + s, exitCode: c => 'exit ' + c, running: 'Running', failed: 'Failed', done: 'Done', copy: 'Copy', copied: 'Copied', noOutput: 'No output', collapseAria: 'Collapse', expandAria: n => 'Show ' + n + ' more' } })),
192
+ h(Section, { name: 'ReadBlock', note: 'A file window with line numbers.' },
193
+ h(ReadBlock, { label: 'src/index.ts', totalLines: 42, lines: [{ number: 1, text: 'export const x = 1' }, { number: 2, text: 'export const y = 2' }], labels: { window: (n, t) => 'Showing ' + n + ' of ' + t, copy: 'Copy', copied: 'Copied', collapseAria: 'Collapse', expandAria: n => 'Show ' + n + ' more', collapse: 'Collapse', expand: n => 'Show ' + n + ' more' } })),
194
+ h(Section, { name: 'DiffBlock', note: 'One hunk, added and removed lines.' },
195
+ h(DiffBlock, { diffs: [{ path: 'src/index.ts', oldText: 'const x = 1\n', newText: 'const x = 2\n' }], labels: { copy: 'Copy', copied: 'Copied', collapseAria: 'Collapse', expandAria: n => 'Show ' + n + ' more', collapse: 'Collapse', expand: n => 'Show ' + n + ' more', files: n => n + ' file' } })),
196
+ h(Section, { name: 'JsonTree', note: 'A collapsible tree; click a row to expand.' },
197
+ h(JsonTree, { data: { name: 'acryl', tags: ['ui', 'cordis'] }, label: 'Demo JSON', labels: { copyValue: 'Copy value', copyJson: 'Copy JSON', copyPath: 'Copy path', copyPrettyJson: 'Copy pretty', copyCompactJson: 'Copy compact', copied: 'Copied', copyFailed: 'Copy failed', collapseNode: 'Collapse', expandNode: 'Expand' } })),
198
+ h(Section, { name: 'RiskConfirmation', note: 'The app\'s own destructive-confirmation control (Dialog has no danger state on web); the confirm button stays disabled until acknowledged is checked.' },
199
+ h(RiskConfirmation, { open: true, title: 'Delete workspace?', description: 'This removes every session in it. This cannot be undone.', acknowledgeLabel: 'I understand this cannot be undone', cancelLabel: 'Cancel', closeLabel: 'Close', confirmLabel: 'Delete', acknowledged: ack, onAcknowledgedChange: setAck, onCancel: () => setAck(false), onConfirm: () => {} })))
200
+ }
201
+
202
+ function SettingsForm() {
203
+ const [permission, setPermission] = React.useState('write')
204
+ const [theme, setTheme] = React.useState('system')
205
+ const [queue, setQueue] = React.useState(true)
206
+ const [confirm, setConfirm] = React.useState(false)
207
+ return h('div', null,
208
+ h(SettingsRow, { label: 'Permission', description: 'Choose the default permission mode for new sessions' },
209
+ h(SelectField, { label: 'Permission', value: permission, onChange: setPermission, options: [{ id: 'read', label: 'Read Only' }, { id: 'write', label: 'Workspace Write' }, { id: 'full', label: 'Full access' }] })),
210
+ h(Segmented, { title: 'Appearance', value: theme, onChange: setTheme, options: [{ id: 'light', label: 'Light' }, { id: 'dark', label: 'Dark' }, { id: 'system', label: 'System' }] }),
211
+ h(SettingsRow, { label: 'Queue while busy', description: 'What Enter does while the agent is running' }, h(SwitchField, { label: 'Queue', checked: queue, onChange: setQueue })),
212
+ h(SettingsRow, { label: 'Reset settings', description: 'Restores every default' }, h(Button, { variant: 'ghost', size: 'sm', onClick: () => setConfirm(true) }, 'Reset')),
213
+ h(Dialog, { open: confirm, title: 'Reset settings?', onClose: () => setConfirm(false), onConfirm: () => { setPermission('write'); setTheme('system'); setQueue(true) }, confirmLabel: 'Reset', danger: true }, 'This restores every setting to its default.'))
214
+ }
215
+
216
+ // The app's own tokens: each swatch is the DSH token the role resolves to, so nothing here is a color of our own except the two registered through the theme service.
217
+ function Colors() {
218
+ return h(Stack, { gap: 'sm' }, Object.entries(ui.roles).map(([role, value]) =>
219
+ h(Stack, { key: role, direction: 'row', gap: 'md', align: 'center' },
220
+ h('span', { style: { width: 28, height: 28, borderRadius: 8, border: '0.5px solid ' + ui.roles.border, background: value }, 'aria-hidden': true }),
221
+ h('code', null, value.replace(/^var\((.*)\)$/u, '$1')),
222
+ h('span', { style: { color: ui.roles.textMuted, fontSize: 12 } }, role))))
223
+ }
224
+
225
+ const labels = { input: 'IN', output: 'OUT', running: 'Running', failed: 'Failed', stopped: 'Stopped' }
226
+ const dot = h('span', { 'aria-hidden': true }, '\u25B8')
227
+
228
+ // The conversation's tool-call row and the sidebar's New Session bar, extracted from the app itself.
229
+ function Conversation() {
230
+ const [wide, setWide] = React.useState(true)
231
+ return h(Stack, { gap: 'md' },
232
+ h(ui.ToolCallCard, { icon: dot, title: 'Read', summary: 'src/index.ts', state: 'ok', input: 'src/index.ts', output: '42 lines', labels }),
233
+ h(ui.ToolCallCard, { icon: dot, title: 'Bash', summary: 'pnpm test', state: 'running', input: 'pnpm test', labels }),
234
+ h(ui.ToolCallCard, { icon: dot, title: 'Bash', summary: 'pnpm build', errorSummary: 'exit code 1', state: 'error', input: 'pnpm build', output: 'error TS2304', labels }),
235
+ h(Stack, { direction: 'row', gap: 'md', align: 'center' },
236
+ h('div', { style: { width: wide ? 220 : 56 } }, h(ui.SidebarRow, { icon: dot, label: 'New session', wide, onClick: () => setWide(!wide) })),
237
+ h('span', { style: { color: ui.roles.textMuted, fontSize: 12 } }, 'Click to switch between the wide sidebar and the rail')))
238
+ }
239
+
240
+ // T045 batch 1 (spec 038-ui-component-library): Table, Direction, Marker, Message, Bubble, Pagination and NativeSelect, all ported from
241
+ // shadcn/ui's own source (new-york-v4, MIT) onto --dsw-alias-* tokens with no Radix and no new dependency.
242
+ function DirReadout() {
243
+ return h('code', null, useDirection())
244
+ }
245
+
246
+ function T045Batch1() {
247
+ const [page, setPage] = React.useState(2)
248
+ const [mode, setMode] = React.useState('write')
249
+ const [dir, setDir] = React.useState('ltr')
250
+ const go = (event, next) => { event.preventDefault(); setPage(next) }
251
+ const rows = [{ file: 'src/index.ts', lines: 42 }, { file: 'README.md', lines: 8 }, { file: 'package.json', lines: 31 }]
252
+ const total = rows.reduce((sum, row) => sum + row.lines, 0)
253
+ return h(Stack, { gap: 'md' },
254
+ h(Section, { name: 'Table', note: 'A real table: caption, header, body and a footer total. Hover a row.' },
255
+ h(Table, null,
256
+ h(TableCaption, null, rows.length + ' files'),
257
+ h(TableHeader, null, h(TableRow, null, h(TableHead, null, 'File'), h(TableHead, null, 'Lines'))),
258
+ h(TableBody, null, rows.map(row => h(TableRow, { key: row.file }, h(TableCell, null, row.file), h(TableCell, null, String(row.lines))))),
259
+ h(TableFooter, null, h(TableRow, null, h(TableCell, null, 'Total'), h(TableCell, null, String(total))))),
260
+ h('p', { style: { margin: '8px 0 0', color: ui.roles.textMuted, fontSize: 12 } }, 'Rendered with this library\'s Table, not hand-rolled markup.')),
261
+ h(Section, { name: 'Pagination', note: 'Click a page number, or Previous/Next. The current page carries aria-current=page.' },
262
+ h(Pagination, null, h(PaginationContent, null,
263
+ h(PaginationItem, null, h(PaginationPrevious, { href: '#', onClick: e => go(e, Math.max(1, page - 1)) })),
264
+ [1, 2, 3].map(n => h(PaginationItem, { key: n }, h(PaginationLink, { href: '#', isActive: page === n, onClick: e => go(e, n) }, String(n)))),
265
+ h(PaginationItem, null, h(PaginationEllipsis, null)),
266
+ h(PaginationItem, null, h(PaginationNext, { href: '#', onClick: e => go(e, Math.min(3, page + 1)) })))),
267
+ h('p', { style: { margin: '8px 0 0', color: ui.roles.textMuted, fontSize: 12 } }, 'page = ' + page)),
268
+ h(Section, { name: 'NativeSelect', note: 'The platform\'s own dropdown - not the menu-overlay SelectField. Open it and pick a mode.' },
269
+ h(NativeSelect, { value: mode, onChange: e => setMode(e.target.value), 'aria-label': 'Default permission mode' },
270
+ h(NativeSelectOption, { value: 'read' }, 'Read Only'),
271
+ h(NativeSelectOption, { value: 'write' }, 'Workspace Write'),
272
+ h(NativeSelectOption, { value: 'full' }, 'Full access')),
273
+ h('p', { style: { margin: '8px 0 0', color: ui.roles.textMuted, fontSize: 12 } }, 'mode = ' + mode)),
274
+ h(Section, { name: 'Marker, Message and Bubble', note: 'A chat exchange: Marker as the day divider, Message rows around Bubble content (ghost and destructive variants below), a reaction pill on the second.' },
275
+ h(Stack, { direction: 'row', gap: 'sm', align: 'center' },
276
+ h(Button, { variant: 'outline', size: 'sm', onClick: () => setDir(dir === 'ltr' ? 'rtl' : 'ltr') }, 'Toggle direction'),
277
+ h('span', { style: { color: ui.roles.textMuted, fontSize: 12 } }, 'useDirection() inside = '),
278
+ h(DirectionProvider, { dir }, h(DirReadout))),
279
+ h(DirectionProvider, { dir },
280
+ h(MessageGroup, null,
281
+ h(Marker, { variant: 'separator' }, h(MarkerContent, null, 'Today')),
282
+ h(Message, null,
283
+ h(MessageAvatar, null, 'A'),
284
+ h(MessageContent, null,
285
+ h(MessageHeader, null, 'Ada'),
286
+ h(Bubble, null, h(BubbleContent, null, 'Is the table ported yet?')),
287
+ h(MessageFooter, null, '10:04'))),
288
+ h(Message, { align: 'end' },
289
+ h(MessageAvatar, null, 'M'),
290
+ h(MessageContent, null,
291
+ h(MessageHeader, null, 'You'),
292
+ h(Bubble, { variant: 'secondary', align: 'end' },
293
+ h(BubbleContent, null, 'Yes - and so is this bubble.'),
294
+ h(BubbleReactions, { side: 'bottom', align: 'end' }, '+1')),
295
+ h(MessageFooter, null, '10:05'))),
296
+ h(Message, null,
297
+ h(MessageContent, null,
298
+ h(Bubble, { variant: 'ghost' }, h(BubbleContent, null, 'ghost variant: no chrome at all')),
299
+ h(MessageFooter, null, '10:06'))),
300
+ h(Message, null,
301
+ h(MessageContent, null,
302
+ h(Bubble, { variant: 'destructive' }, h(BubbleContent, null, 'destructive variant: the run failed')),
303
+ h(MessageFooter, null, '10:07'))),
304
+ h(Marker, { variant: 'border' }, h(MarkerIcon, null, '\u2022'), h(MarkerContent, null, 'end of the demo'))))))
305
+ }
306
+
307
+ // T045 batch 2: ScrollArea, InputOTP, Item, Attachment, InputGroup, FormField. Every one of these composes shadcn sibling items in its
308
+ // source (Input, Textarea, Button, Label, Separator); each resolves that by styling the part locally, so none imports another item's file.
309
+ function T045Batch2() {
310
+ const [otp, setOtp] = React.useState('12')
311
+ const [invalid, setInvalid] = React.useState(false)
312
+ const [copied, setCopied] = React.useState('')
313
+ const [opened, setOpened] = React.useState('')
314
+ const [removed, setRemoved] = React.useState('')
315
+ const chips = [
316
+ { state: 'done', title: 'notes.md', description: '12 KB' },
317
+ { state: 'uploading', title: 'report.pdf', description: '1.4 MB' },
318
+ { state: 'idle', title: 'drop a file here', description: 'idle' },
319
+ { state: 'error', title: 'broken.png', description: 'upload failed' }
320
+ ]
321
+ const files = [
322
+ { title: 'Table.tsx', description: 'A data table, ported first', size: 'default', variant: 'default' },
323
+ { title: 'InputGroup.tsx', description: 'One border around a control and its addons', size: 'default', variant: 'outline' },
324
+ { title: 'FormField.tsx', description: 'The layout around a field', size: 'sm', variant: 'muted' }
325
+ ]
326
+ return h(Stack, { gap: 'md' },
327
+ h(Section, { name: 'ScrollArea', note: 'A fixed-height box that scrolls inside itself: the scrollbar is the platform\'s, styled, and reaching the end does not scroll the page behind it. The height goes on ScrollArea itself - that is the element that has to be definite.' },
328
+ h(ScrollArea, { style: { height: 120 } }, Array.from({ length: 18 }, (_, index) => h('p', { key: index, style: { margin: '0 0 8px', color: ui.roles.textMuted, fontSize: 12 } }, 'line ' + (index + 1) + ' - scroll to the end and the page stays put')))),
329
+ h(Section, { name: 'InputOTP', note: 'Type, paste, or arrow around: it is one real input covering the slots, so the platform handles all of it. The active slot blinks a caret.' },
330
+ h(InputOTP, { value: otp, onChange: setOtp, maxLength: 6, label: 'Verification code' },
331
+ h(InputOTPGroup, null, [0, 1, 2].map(index => h(InputOTPSlot, { key: index, index }))),
332
+ h(InputOTPSeparator, null),
333
+ h(InputOTPGroup, null, [3, 4, 5].map(index => h(InputOTPSlot, { key: index, index })))),
334
+ h('p', { style: { margin: '8px 0 0', color: ui.roles.textMuted, fontSize: 12 } }, 'code = ' + (otp === '' ? '(empty)' : otp))),
335
+ h(Section, { name: 'Item', note: 'List rows: media, content, description and actions, in the default, outline and muted variants with a separator between them.' },
336
+ h(ItemGroup, null,
337
+ h(Item, { variant: files[0].variant, size: 'default' },
338
+ h(ItemMedia, { variant: 'icon' }, h('span', null, 'T')),
339
+ h(ItemContent, null, h(ItemTitle, null, files[0].title), h(ItemDescription, null, files[0].description)),
340
+ h(ItemActions, null, h(Button, { variant: 'outline', size: 'sm', onClick: () => setOpened(files[0].title) }, 'Open'))),
341
+ h(ItemSeparator, null),
342
+ h(Item, { variant: files[1].variant, size: 'default' },
343
+ h(ItemMedia, { variant: 'icon' }, h('span', null, 'I')),
344
+ h(ItemContent, null, h(ItemTitle, null, files[1].title), h(ItemDescription, null, files[1].description)),
345
+ h(ItemActions, null, h(Button, { variant: 'outline', size: 'sm', onClick: () => setOpened(files[1].title) }, 'Open'))),
346
+ h(ItemSeparator, null),
347
+ h(Item, { variant: files[2].variant, size: 'sm' },
348
+ h(ItemMedia, { variant: 'icon' }, h('span', null, 'F')),
349
+ h(ItemContent, null, h(ItemTitle, null, files[2].title), h(ItemDescription, null, files[2].description)),
350
+ h(ItemActions, null, h(Button, { variant: 'outline', size: 'sm', onClick: () => setOpened(files[2].title) }, 'Open')))),
351
+ h('p', { style: { margin: '8px 0 0', color: ui.roles.textMuted, fontSize: 12 } }, 'opened = ' + (opened === '' ? 'nothing yet' : opened))),
352
+ h(Section, { name: 'Attachment', note: 'File chips in every state, in a snapping row. The whole chip is the trigger; the x is its own action, so it never fires the trigger.' },
353
+ h(AttachmentGroup, null, chips.map(chip => h(Attachment, { key: chip.title, state: chip.state },
354
+ h(AttachmentMedia, { variant: 'icon' }, h('span', null, '\u2022')),
355
+ h(AttachmentContent, null, h(AttachmentTitle, null, chip.title), h(AttachmentDescription, null, chip.description)),
356
+ h(AttachmentActions, null, h(AttachmentAction, { label: 'Remove ' + chip.title, onClick: () => setRemoved(chip.title) }, h('span', null, '\u00d7'))),
357
+ h(AttachmentTrigger, { label: 'Open ' + chip.title, onClick: () => setOpened(chip.title) })))),
358
+ h('p', { style: { margin: '8px 0 0', color: ui.roles.textMuted, fontSize: 12 } }, 'opened = ' + (opened === '' ? '-' : opened) + ' removed = ' + (removed === '' ? '-' : removed))),
359
+ h(Section, { name: 'InputGroup', note: 'One border around the control and its addons, so the focus ring and the error tint wrap the whole thing. Click the https:// prefix: the control focuses.' },
360
+ h(InputGroup, null,
361
+ h(InputGroupAddon, null, h(InputGroupText, null, 'https://')),
362
+ h(InputGroupInput, { defaultValue: 'ui.shadcn.com', 'aria-label': 'URL', 'aria-invalid': invalid }),
363
+ h(InputGroupAddon, { align: 'inline-end' }, h(InputGroupButton, { label: 'Copy URL', onClick: () => setCopied('ui.shadcn.com') }, 'Copy'))),
364
+ h(InputGroup, null,
365
+ h(InputGroupAddon, null, h(InputGroupText, null, 'Search')),
366
+ h(InputGroupInput, { defaultValue: '', 'aria-label': 'Search', placeholder: 'Type to filter' }),
367
+ h(InputGroupAddon, { align: 'inline-end' }, h('kbd', null, 'K'))),
368
+ h(Stack, { direction: 'row', gap: 'sm', align: 'center' },
369
+ h(Button, { variant: 'outline', size: 'sm', onClick: () => setInvalid(!invalid) }, 'Toggle aria-invalid'),
370
+ h('span', { style: { color: ui.roles.textMuted, fontSize: 12 } }, 'copied = ' + (copied === '' ? 'not yet' : copied)))),
371
+ h(Section, { name: 'FormField', note: 'A field set with a legend, a horizontal field, a separator and an error that appears on the same toggle as the group above.' },
372
+ h(FieldSet, null,
373
+ h(FieldLegend, null, 'Permissions'),
374
+ h(FieldGroup, null,
375
+ h(FormField, { orientation: 'horizontal', invalid },
376
+ h(FieldLabel, null, 'Workspace write'),
377
+ h(FieldContent, null,
378
+ h(FieldDescription, null, 'Let the agent write files in this workspace.'),
379
+ invalid && h(FieldError, { errors: [{ message: 'Workspace write needs full access mode' }] }))),
380
+ h(FieldSeparator, null, 'or'),
381
+ h(FormField, { invalid },
382
+ h(FieldLabel, null, 'Read only'),
383
+ h(FieldContent, null, h(FieldDescription, null, 'Everything stays readable, and nothing is written.')))))))
384
+ }
385
+
386
+ // T045 batch 3: Popover and Slider. Both drop a Radix primitive for behaviour written by hand - open state plus
387
+ // outside-click/Escape/focus handling, and thumb arithmetic plus pointer and keyboard input respectively.
388
+ function T045Batch3() {
389
+ const [notify, setNotify] = React.useState(true)
390
+ const [open, setOpen] = React.useState(false)
391
+ const [volume, setVolume] = React.useState([40])
392
+ const [band, setBand] = React.useState([20, 80])
393
+ const readout = text => h('p', { style: { margin: '8px 0 0', color: ui.roles.textMuted, fontSize: 12 } }, text)
394
+ const popoverSection = h(Section, { name: 'Popover', note: 'A floating panel: click the trigger to open it, then click outside to close. Focus moves into the panel and back to the trigger. The width is fixed at 288px.' },
395
+ h(Popover, { open, onOpenChange: setOpen },
396
+ h(PopoverTrigger, { className: 'acryl-popover-trigger' }, 'Notifications'),
397
+ h(PopoverContent, { label: 'Notification settings' },
398
+ h(PopoverHeader, null,
399
+ h(PopoverTitle, null, 'Notifications'),
400
+ h(PopoverDescription, null, 'How the app tells you a run finished.')),
401
+ h(Stack, { gap: 'sm' },
402
+ h(SwitchField, { label: 'Notify on finish', checked: notify, onChange: setNotify }),
403
+ h(Button, { variant: 'outline', size: 'sm', onClick: () => setOpen(false) }, 'Done')))),
404
+ readout('open = ' + open + ' notify = ' + notify))
405
+ const sliderSection = h(Section, { name: 'Slider', note: 'One thumb for a value, two for a range. Drag a thumb, or click anywhere on the track to move the nearest one. Each thumb takes arrow keys, PageUp/PageDown and Home/End.' },
406
+ h(Slider, { value: volume, onValueChange: setVolume, label: 'Volume' }),
407
+ readout('volume = ' + volume.join(', ')),
408
+ h('div', { style: { height: 12 } }),
409
+ h(Slider, { value: band, onValueChange: setBand, step: 5, label: 'Frequency band' }),
410
+ readout('band = ' + band.join(' - ')))
411
+ return h(Stack, { gap: 'md' }, popoverSection, sliderSection)
412
+ }
413
+
414
+ // T045 batch 4: Sheet, then Drawer - the same overlay pattern plus drag-to-dismiss. Both replace their Radix/vaul primitive by hand.
415
+ function T045Batch4() {
416
+ const [side, setSide] = React.useState('right')
417
+ const [open, setOpen] = React.useState(false)
418
+ const [drawerOpen, setDrawerOpen] = React.useState(false)
419
+ const [direction, setDirection] = React.useState('bottom')
420
+ const readout = text => h('p', { style: { margin: '8px 0 0', color: ui.roles.textMuted, fontSize: 12 } }, text)
421
+ const sideButtons = (current, choose) => h(Stack, { direction: 'row', gap: 'sm', align: 'center' },
422
+ ['top', 'right', 'bottom', 'left'].map(name => h(Button, { key: name, variant: current === name ? 'default' : 'outline', size: 'sm', onClick: () => choose(name) }, name)))
423
+ const sheetSection = h(Section, { name: 'Sheet', note: 'An edge panel: pick a side, open it, then dismiss it with Escape, the close button, or a press on the overlay. Tab and Shift-Tab wrap inside the panel.' },
424
+ sideButtons(side, setSide),
425
+ h(Sheet, { open, onOpenChange: setOpen },
426
+ h(SheetTrigger, null, 'Open sheet'),
427
+ h(SheetContent, { side, label: 'Sheet demonstration' },
428
+ h(SheetHeader, null,
429
+ h(SheetTitle, null, 'From the ' + side + ' edge'),
430
+ h(SheetDescription, null, 'Escape, the close button and an overlay press all dismiss this panel.')),
431
+ h(SheetFooter, null,
432
+ h(SheetClose, null, h(Button, { variant: 'outline', size: 'sm' }, 'Close from the footer'))))),
433
+ readout('open = ' + open + ' side = ' + side))
434
+ const drawerSection = h(Section, { name: 'Drawer', note: 'The same overlay with a drag: pull the handle past a quarter of the panel and it dismisses, a shorter pull springs back, and a press on a button inside never starts a drag.' },
435
+ sideButtons(direction, setDirection),
436
+ h(Drawer, { open: drawerOpen, onOpenChange: setDrawerOpen, direction },
437
+ h(DrawerTrigger, null, 'Open drawer'),
438
+ h(DrawerContent, { label: 'Drawer demonstration' },
439
+ h(DrawerHeader, null,
440
+ h(DrawerTitle, null, 'From the ' + direction + ' edge'),
441
+ h(DrawerDescription, null, 'Drag the handle, or dismiss from the footer.')),
442
+ h(DrawerFooter, null,
443
+ h(DrawerClose, null, h(Button, { variant: 'outline', size: 'sm' }, 'Close from the footer'))))),
444
+ readout('drawer open = ' + drawerOpen + ' direction = ' + direction))
445
+ return h(Stack, { gap: 'md' }, sheetSection, drawerSection)
446
+ }
447
+
448
+ // T045 batch 5a: Command. cmdk's filtering and keyboard listbox written by hand.
449
+ function T045Batch5() {
450
+ const [chosen, setChosen] = React.useState('nothing yet')
451
+ const [picked, setPicked] = React.useState(null)
452
+ const readout = text => h('p', { style: { margin: '8px 0 0', color: ui.roles.textMuted, fontSize: 12 } }, text)
453
+ const commandItem = (value, label, shortcut) => h(CommandItem, { key: value, value, onSelect: () => setChosen(value) }, label, shortcut === undefined ? null : h(CommandShortcut, null, shortcut))
454
+ const commandSection = h(Section, { name: 'Command', note: 'Type to filter, walk the list with the arrow keys and choose with Enter. A junk query shows the empty state, and a chosen item reports itself below.' },
455
+ h(Command, { label: 'Demo commands' },
456
+ h(CommandInput, { placeholder: 'Type a command' }),
457
+ h(CommandList, null,
458
+ h(CommandGroup, { heading: 'Sessions' },
459
+ commandItem('New session', 'New session', 'N'),
460
+ commandItem('Search sessions', 'Search sessions', 'K')),
461
+ h(CommandSeparator, null),
462
+ h(CommandGroup, { heading: 'Workspace' },
463
+ commandItem('Rename workspace', 'Rename workspace'),
464
+ commandItem('Delete workspace', 'Delete workspace')),
465
+ h(CommandEmpty, null, 'Nothing matches.'))),
466
+ readout('chosen = ' + chosen))
467
+ const workspaceItem = value => h(ComboboxItem, { key: value, value }, value)
468
+ const comboboxSection = h(Section, { name: 'Combobox', note: 'A single-select combobox: focus the field to open the panel, type to filter, walk with the arrow keys and choose with Enter. The clear button empties it. Its field restates InputGroup chrome, so the group carries the focus ring.' },
469
+ h(Combobox, { value: picked, onValueChange: setPicked },
470
+ h(ComboboxInput, { placeholder: 'Pick a workspace', 'aria-label': 'Workspace' }),
471
+ h(ComboboxContent, null,
472
+ h(ComboboxList, null,
473
+ h(ComboboxGroup, null,
474
+ h(ComboboxLabel, null, 'Recent'),
475
+ workspaceItem('alpha'),
476
+ workspaceItem('beta')),
477
+ h(ComboboxSeparator, null),
478
+ h(ComboboxGroup, null,
479
+ h(ComboboxLabel, null, 'All'),
480
+ workspaceItem('gamma'),
481
+ workspaceItem('delta')),
482
+ h(ComboboxEmpty, null, 'No workspace matches.')))),
483
+ readout('picked = ' + String(picked)))
484
+ return h(Stack, { gap: 'md' }, commandSection, comboboxSection)
485
+ }
486
+
487
+ // T045 batch 6a: ContextMenu. A real right-click opens it at the pointer, with checkbox and radio rows.
488
+ function T045Batch6() {
489
+ const [log, setLog] = React.useState('nothing yet')
490
+ const [wrap, setWrap] = React.useState(true)
491
+ const [sort, setSort] = React.useState('name')
492
+ const readout = text => h('p', { style: { margin: '8px 0 0', color: ui.roles.textMuted, fontSize: 12 } }, text)
493
+ const row = (label, shortcut) => h(ContextMenuItem, { key: label, onSelect: () => setLog(label) }, label, shortcut === undefined ? null : h(ContextMenuShortcut, null, shortcut))
494
+ const area = h('div', { style: { padding: 24, border: '1px dashed var(--dsw-alias-border-l4)', borderRadius: 6, color: ui.roles.textMuted, fontSize: 13 } }, 'Right-click anywhere in this box')
495
+ const menuContent = h(ContextMenuContent, null,
496
+ h(ContextMenuLabel, { inset: true }, 'Clipboard'),
497
+ row('Copy', 'C'),
498
+ row('Paste', 'V'),
499
+ h(ContextMenuSeparator, null),
500
+ h(ContextMenuCheckboxItem, { checked: wrap, onCheckedChange: setWrap }, 'Wrap lines'),
501
+ h(ContextMenuRadioGroup, { value: sort, onValueChange: setSort },
502
+ h(ContextMenuRadioItem, { value: 'name' }, 'Sort by name'),
503
+ h(ContextMenuRadioItem, { value: 'date' }, 'Sort by date')),
504
+ h(ContextMenuSeparator, null),
505
+ h(ContextMenuItem, { variant: 'destructive', onSelect: () => setLog('Delete') }, 'Delete'))
506
+ const menuSection = h(Section, { name: 'Context menu', note: 'Right-click the box below. The arrow keys and Enter work too; Escape or a press outside closes it. The checkbox and radio rows hold their own state.' },
507
+ h(ContextMenu, null, h(ContextMenuTrigger, null, area), menuContent),
508
+ readout('chosen = ' + log + ' wrap = ' + wrap + ' sort = ' + sort))
509
+ return h(Stack, { gap: 'md' }, menuSection)
510
+ }
511
+
512
+ // T045 batch 6b: Carousel. Both axes, and the api the component hands out through setApi - which is what the readouts below are: the live answers to
513
+ // canScrollPrev/canScrollNext/selectedIndex, refreshed on scroll, after each arrow press and on resize.
514
+ function T045Batch6b() {
515
+ const [api, setApi] = React.useState(null)
516
+ const [horizontal, setHorizontal] = React.useState('waiting for the api')
517
+ const [verticalApi, setVerticalApi] = React.useState(null)
518
+ const [vertical, setVertical] = React.useState('waiting for the api')
519
+ const horizontalRoot = React.useRef(null)
520
+ const verticalRoot = React.useRef(null)
521
+ const readout = text => h('p', { style: { margin: '8px 0 0', color: ui.roles.textMuted, fontSize: 12 } }, text)
522
+ // Scroll events do not bubble, so the listener is registered in the capture phase on the region that contains the track.
523
+ const bind = (carouselApi, root, setter) => {
524
+ const node = root.current
525
+ if (node === null || carouselApi === null) return undefined
526
+ const read = () => setter('prev=' + carouselApi.canScrollPrev() + ' next=' + carouselApi.canScrollNext() + ' index=' + carouselApi.selectedIndex())
527
+ read()
528
+ node.addEventListener('scroll', read, true)
529
+ window.addEventListener('resize', read)
530
+ return () => { node.removeEventListener('scroll', read, true); window.removeEventListener('resize', read) }
531
+ }
532
+ React.useEffect(() => bind(api, horizontalRoot, setHorizontal), [api])
533
+ React.useEffect(() => bind(verticalApi, verticalRoot, setVertical), [verticalApi])
534
+ const slide = (n, height) => h(CarouselItem, { key: n },
535
+ // boxSizing is explicit here for the same reason Carousel's own module declares it: the app ships no global reset, so a height plus a border would
536
+ // otherwise overflow the slide by the border's width.
537
+ h('div', { style: { height, boxSizing: 'border-box', borderRadius: 6, border: '1px solid var(--dsw-alias-border-l4)', display: 'flex', alignItems: 'center', justifyContent: 'center', color: ui.roles.text, fontSize: 13 } }, 'Slide ' + n))
538
+ // Both carousels are given room with margin rather than padding: the arrows are placed just OUTSIDE the track (the source's own -left-12/-top-12), so
539
+ // the space they need is space the caller leaves around the component, not space inside it.
540
+ const horizontalSection = h(Section, { name: 'Carousel', note: 'One slide at a time, with the platform doing the scrolling: a trackpad or a touch drag moves it and the snap points decide where it rests. The arrows are disabled while the track cannot move that way, and the arrow keys work from anywhere inside it. The arrows sit just outside the track, so leave room around the component. The readout is the api the component hands out through setApi.' },
541
+ h('div', { ref: horizontalRoot },
542
+ h(Carousel, { setApi: setApi, style: { margin: '0 56px' } },
543
+ h(CarouselContent, null, [1, 2, 3].map(n => slide(n, 120))),
544
+ h(CarouselPrevious, null),
545
+ h(CarouselNext, null))),
546
+ readout('horizontal: ' + horizontal))
547
+ const verticalSection = h(Section, { name: 'Carousel, vertical', note: 'The same component on the other axis. A vertical carousel needs a definite height on CarouselContent: that height is what an item resolves its own height against, which is why a vertical one whose height a caller cannot set would grow instead of sliding.' },
548
+ h('div', { ref: verticalRoot },
549
+ h(Carousel, { orientation: 'vertical', setApi: setVerticalApi, style: { margin: '56px 0', width: 260 } },
550
+ h(CarouselContent, { style: { height: 120 } }, [1, 2, 3].map(n => slide(n, 120))),
551
+ h(CarouselPrevious, null),
552
+ h(CarouselNext, null))),
553
+ readout('vertical: ' + vertical))
554
+ return h(Stack, { gap: 'md' }, horizontalSection, verticalSection)
555
+ }
556
+
557
+ // T045 batch 6c: ResizablePanelGroup. Both axes, a panel held inside its limits, and one that collapses - so the drag, the arrow keys, Home/End, the Enter
558
+ // toggle and the reported layout are all reachable by hand and by the browser check.
559
+ function T045Batch6c() {
560
+ const [horizontal, setHorizontal] = React.useState({})
561
+ const [collapsing, setCollapsing] = React.useState({})
562
+ const [vertical, setVertical] = React.useState({})
563
+ const readout = text => h('p', { style: { margin: '8px 0 0', color: ui.roles.textMuted, fontSize: 12 } }, text)
564
+ const asText = layout => Object.keys(layout).length === 0 ? 'not measured yet' : Object.keys(layout).sort().map(id => id + '=' + Math.round(layout[id])).join(' ')
565
+ const frame = { height: '100%', boxSizing: 'border-box', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: 13, color: ui.roles.textMuted }
566
+ const box = { height: 160, border: '1px solid var(--dsw-alias-border-l4)', borderRadius: 6 }
567
+ const horizontalSection = h(Section, { name: 'Resizable', note: 'Drag the divider, or focus it and resize from the keyboard: the arrows move it 5 points at a time, and Home and End take it as far as it can go. Panel a is held between 20 and 70, and panel b cannot shrink below 30, so End stops where b runs out rather than at a max.' },
568
+ h(ResizablePanelGroup, { orientation: 'horizontal', onLayoutChange: setHorizontal, style: box },
569
+ h(ResizablePanel, { id: 'a', defaultSize: '50%', minSize: 20, maxSize: 70 }, h('div', { style: frame }, 'a')),
570
+ h(ResizableHandle, { withHandle: true }),
571
+ h(ResizablePanel, { id: 'b', defaultSize: '50%', minSize: 30 }, h('div', { style: frame }, 'b'))),
572
+ readout('layout: ' + asText(horizontal)))
573
+ const collapseSection = h(Section, { name: 'Resizable, collapsing', note: 'Enter on a focused divider collapses the panel BEFORE it and brings it back - the same panel upstream collapses. Panel c collapses to 10.' },
574
+ h(ResizablePanelGroup, { orientation: 'horizontal', onLayoutChange: setCollapsing, style: box },
575
+ h(ResizablePanel, { id: 'c', defaultSize: '50%', collapsible: true, collapsedSize: 10 }, h('div', { style: frame }, 'c')),
576
+ h(ResizableHandle, { withHandle: true }),
577
+ h(ResizablePanel, { id: 'd', defaultSize: '50%' }, h('div', { style: frame }, 'd'))),
578
+ readout('layout: ' + asText(collapsing)))
579
+ const verticalSection = h(Section, { name: 'Resizable, vertical', note: 'The same group on the other axis: the divider is a horizontal rule, and the arrow keys that move it are the vertical ones.' },
580
+ h(ResizablePanelGroup, { orientation: 'vertical', onLayoutChange: setVertical, style: box },
581
+ h(ResizablePanel, { id: 'top', defaultSize: '25%' }, h('div', { style: frame }, 'top')),
582
+ h(ResizableHandle, { withHandle: true }),
583
+ h(ResizablePanel, { id: 'bottom', defaultSize: '75%' }, h('div', { style: frame }, 'bottom'))),
584
+ readout('layout: ' + asText(vertical)))
585
+ return h(Stack, { gap: 'md' }, horizontalSection, collapseSection, verticalSection)
586
+ }
587
+
588
+ // T045 batch 7: the two bars. The menubar is one Tab stop with arrow keys, hover-switching and a menu panel; the navigation bar opens its panel after a
589
+ // hover that rests and paints one shared surface under the whole bar.
590
+ function T045Batch7() {
591
+ const [log, setLog] = React.useState('nothing yet')
592
+ const [wrap, setWrap] = React.useState(true)
593
+ const [sort, setSort] = React.useState('name')
594
+ const readout = text => h('p', { style: { margin: '8px 0 0', color: ui.roles.textMuted, fontSize: 12 } }, text)
595
+ const menuSection = h(Section, { name: 'Menubar', note: 'One Tab stop: the arrow keys walk the triggers, and with a menu open they open the one they land on. A pointer sliding across the bar switches menus too. Escape closes and returns focus; the checkbox and radio rows keep the panel open.' },
596
+ h(Menubar, null,
597
+ h(MenubarMenu, null,
598
+ h(MenubarTrigger, null, 'File'),
599
+ h(MenubarContent, null,
600
+ h(MenubarLabel, { inset: true }, 'File'),
601
+ h(MenubarItem, { onSelect: () => setLog('New') }, 'New', h(MenubarShortcut, null, '\u2318N')),
602
+ h(MenubarItem, { onSelect: () => setLog('Open') }, 'Open'),
603
+ h(MenubarSeparator, null),
604
+ h(MenubarCheckboxItem, { checked: wrap, onCheckedChange: setWrap }, 'Wrap lines'),
605
+ h(MenubarRadioGroup, { value: sort, onValueChange: setSort },
606
+ h(MenubarRadioItem, { value: 'name' }, 'Sort by name'),
607
+ h(MenubarRadioItem, { value: 'date' }, 'Sort by date')),
608
+ h(MenubarSeparator, null),
609
+ h(MenubarItem, { variant: 'destructive', onSelect: () => setLog('Delete') }, 'Delete'))),
610
+ h(MenubarMenu, null,
611
+ h(MenubarTrigger, null, 'Edit'),
612
+ h(MenubarContent, null,
613
+ h(MenubarItem, { onSelect: () => setLog('Copy') }, 'Copy', h(MenubarShortcut, null, '\u2318C')),
614
+ h(MenubarItem, { disabled: true }, 'Paste')))),
615
+ readout('chosen = ' + log + ' wrap = ' + wrap + ' sort = ' + sort))
616
+ const navSection = h(Section, { name: 'Navigation menu', note: 'Hover a trigger and hold: the panel opens after a moment, because a pointer crossing the bar should not flash panels. With one open, moving to another trigger switches at once. Every panel is painted on one shared surface under the bar, so switching does not move it.' },
617
+ h(NavigationMenu, { style: { border: '1px solid var(--dsw-alias-border-l4)', borderRadius: 6, padding: '0 8px', width: 'fit-content' } },
618
+ h(NavigationMenuList, null,
619
+ h(NavigationMenuItem, null,
620
+ h(NavigationMenuTrigger, null, 'Products'),
621
+ h(NavigationMenuContent, null,
622
+ h('div', { style: { display: 'grid', gap: 4, width: 260 } },
623
+ h(NavigationMenuLink, { href: '#products-overview', active: true }, 'Overview'),
624
+ h(NavigationMenuLink, { href: '#products-changelog' }, 'Changelog')))),
625
+ h(NavigationMenuItem, null,
626
+ h(NavigationMenuTrigger, null, 'Docs'),
627
+ h(NavigationMenuContent, null,
628
+ h('div', { style: { display: 'grid', gap: 4, width: 220 } },
629
+ h(NavigationMenuLink, { href: '#docs-start' }, 'Getting started'),
630
+ h(NavigationMenuLink, { href: '#docs-api' }, 'API')))),
631
+ h(NavigationMenuItem, null, h(NavigationMenuLink, { href: '#pricing' }, 'Pricing')))))
632
+ return h(Stack, { gap: 'md' }, menuSection, navSection)
633
+ }
634
+
635
+ // T045 batch 8: Calendar. Both modes and a disabled predicate. The months are pinned rather than "this month", so the example reads the same every day and the
636
+ // browser check has fixed days to press.
637
+ function T045Batch8() {
638
+ const [day, setDay] = React.useState(new Date(2026, 2, 17))
639
+ const [span, setSpan] = React.useState({ from: new Date(2026, 3, 10), to: null })
640
+ const [caption, setCaption] = React.useState('March 2026')
641
+ const readout = text => h('p', { style: { margin: '8px 0 0', color: ui.roles.textMuted, fontSize: 12 } }, text)
642
+ const asText = date => date === null || date === undefined ? 'none' : date.getFullYear() + '-' + String(date.getMonth() + 1).padStart(2, '0') + '-' + String(date.getDate()).padStart(2, '0')
643
+ const singleSection = h(Section, { name: 'Calendar', note: 'One day at a time, with weekends disabled through a predicate. Tab reaches the chosen day, the arrows move by day and by week, Home and End go to the week\'s ends, PageUp and PageDown change the month, and Enter chooses.' },
644
+ h(Calendar, { defaultMonth: new Date(2026, 2, 15), selected: day, onSelect: value => setDay(value), onMonthChange: month => setCaption(new Intl.DateTimeFormat('en-US', { month: 'long', year: 'numeric' }).format(month)), disabled: date => date.getDay() === 0 || date.getDay() === 6 }),
645
+ readout('chosen = ' + asText(day) + ' month = ' + caption))
646
+ const rangeSection = h(Section, { name: 'Calendar, range', note: 'Press a start and then an end, whichever side of the start it falls on. The two edges are chosen and the days between them are shaded.' },
647
+ h(Calendar, { mode: 'range', defaultMonth: new Date(2026, 3, 15), selected: span, onSelect: value => setSpan(value) }),
648
+ readout('from = ' + asText(span.from) + ' to = ' + asText(span.to)))
649
+ return h(Stack, { gap: 'md' }, singleSection, rangeSection)
650
+ }
651
+
652
+ // T045 batch 9: Sidebar. Two rails: one that slides away and one that narrows to icons. Mod+B toggles either, as does the trigger inside the inset, and the
653
+ // strip on the rail's edge.
654
+ function T045Batch9() {
655
+ const readout = text => h('p', { style: { margin: '8px 0 0', color: ui.roles.textMuted, fontSize: 12 } }, text)
656
+ const StateReadout = () => {
657
+ const sidebar = useSidebar()
658
+ return readout('state = ' + sidebar.state + ' isMobile = ' + String(sidebar.isMobile))
659
+ }
660
+ const rows = h(SidebarGroupContent, null,
661
+ h(SidebarMenu, null,
662
+ h(SidebarMenuItem, null,
663
+ h(SidebarMenuButton, { isActive: true }, h('span', null, '\u25a0'), h('span', null, 'Overview')),
664
+ h(SidebarMenuBadge, null, '3')),
665
+ h(SidebarMenuItem, null,
666
+ h(SidebarMenuButton, null, h('span', null, '\u25a1'), h('span', null, 'Sessions')),
667
+ h(SidebarMenuAction, { onClick: () => undefined, title: 'New session' }, '+')),
668
+ h(SidebarMenuItem, null,
669
+ h(SidebarMenuButton, null, h('span', null, '\u25c7'), h('span', null, 'Settings')),
670
+ h(SidebarMenuSub, null,
671
+ h(SidebarMenuSubItem, null, h(SidebarMenuSubButton, { href: '#appearance', isActive: true }, 'Appearance')),
672
+ h(SidebarMenuSubItem, null, h(SidebarMenuSubButton, { href: '#models' }, 'Models'))))))
673
+ // A definite width, not a fit-content one: the rail and the inset share this box, so a parent that shrank to its content would take the freed width with
674
+ // it and the inset would never grow. This is the one thing a caller has to get right for a rail to be worth collapsing.
675
+ const frame = { width: 480, height: 260, border: '1px solid var(--dsw-alias-border-l4)', borderRadius: 6, overflow: 'hidden', display: 'flex' }
676
+ const slidingSection = h(Section, { name: 'Sidebar', note: 'The rail is a flex sibling of the inset, so collapsing it is the only thing that moves. Mod+B toggles it, the trigger in the inset toggles it, and the strip on the rail\'s right edge brings a slid-away rail back. An active row reports aria-current.' },
677
+ h('div', null,
678
+ h(SidebarProvider, null,
679
+ h('div', { style: frame },
680
+ h(Sidebar, null,
681
+ h(SidebarHeader, null, h('strong', { style: { fontSize: 13, color: ui.roles.text } }, 'Workspace')),
682
+ h(SidebarContent, null, rows),
683
+ h(SidebarSeparator, null),
684
+ h(SidebarFooter, null, h('span', { style: { fontSize: 12, color: ui.roles.textMuted } }, 'v0.2.0')),
685
+ h(SidebarRail, null)),
686
+ h(SidebarInset, null,
687
+ h('div', { style: { display: 'flex', alignItems: 'center', gap: 8, padding: 8 } }, h(SidebarTrigger, null), h('span', { style: { fontSize: 13, color: ui.roles.text } }, 'Content')),
688
+ h('div', { style: { padding: '0 8px' } }, h(StateReadout, null))))),
689
+ readout('Mod+B or the trigger toggles the rail.')))
690
+ const iconSection = h(Section, { name: 'Sidebar, collapsed to icons', note: 'The same rail with collapsible="icon" starting closed: it narrows to the icon width and the label at the end of each row is hidden, which is the convention the row uses - icon first, label last.' },
691
+ h(SidebarProvider, { defaultOpen: false },
692
+ h('div', { style: frame },
693
+ h(Sidebar, { collapsible: 'icon' },
694
+ h(SidebarContent, null, rows),
695
+ h(SidebarRail, null)),
696
+ h(SidebarInset, null,
697
+ h('div', { style: { display: 'flex', alignItems: 'center', gap: 8, padding: 8 } }, h(SidebarTrigger, null), h('span', { style: { fontSize: 13, color: ui.roles.text } }, 'Content')),
698
+ h('div', { style: { padding: '0 8px' } }, h(StateReadout, null))))))
699
+ return h(Stack, { gap: 'md' }, slidingSection, iconSection)
700
+ }
701
+
702
+ // A Settings page, not a dialog: the gallery is a catalogue for people building UI, so it lives in Settings (nav entry "UI library"), out of the everyday screens.
703
+ function Gallery() {
704
+ const [tab, setTab] = React.useState('components')
705
+ return h(Stack, { gap: 'md' },
706
+ h('h2', { style: { margin: 0, fontSize: 18, fontWeight: 500, color: ui.roles.text } }, 'ACRYL UI library'),
707
+ h('p', { style: { margin: 0, color: ui.roles.textMuted, fontSize: 13 } }, 'Ready-made parts for building screens: use them instead of hand-styling.'),
708
+ h(Tabs, { label: 'Gallery sections', value: tab, onChange: setTab, tabs: [{ id: 'components', label: 'Components' }, { id: 'settings', label: 'Settings form' }, { id: 'conversation', label: 'Conversation' }, { id: 'blocks', label: 'Blocks' }, { id: 'blocks2', label: 'More blocks' }, { id: 'shadcn', label: 'shadcn ports' }, { id: 'shadcn2', label: 'shadcn ports 2' }, { id: 'shadcn3', label: 'shadcn ports 3' }, { id: 't045b1', label: 'T045 ports 1' }, { id: 't045b2', label: 'T045 ports 2' }, { id: 't045b3', label: 'T045 ports 3' }, { id: 't045b4', label: 'T045 ports 4' }, { id: 't045b5', label: 'T045 ports 5' }, { id: 't045b6', label: 'T045 ports 6' }, { id: 't045b6b', label: 'T045 ports 6b' }, { id: 't045b6c', label: 'T045 ports 6c' }, { id: 't045b7', label: 'T045 ports 7' }, { id: 't045b8', label: 'T045 ports 8' }, { id: 't045b9', label: 'T045 ports 9' }, { id: 'colors', label: 'Colors' }] },
709
+ tab === 'components' ? h(Components) : tab === 'settings' ? h(SettingsForm) : tab === 'conversation' ? h(Conversation) : tab === 'blocks' ? h(Blocks) : tab === 'blocks2' ? h(Blocks2) : tab === 'shadcn' ? h(ShadcnBatch) : tab === 'shadcn2' ? h(ShadcnBatch2) : tab === 'shadcn3' ? h(ShadcnBatch3) : tab === 't045b1' ? h(T045Batch1) : tab === 't045b2' ? h(T045Batch2) : tab === 't045b3' ? h(T045Batch3) : tab === 't045b4' ? h(T045Batch4) : tab === 't045b5' ? h(T045Batch5) : tab === 't045b6' ? h(T045Batch6) : tab === 't045b6b' ? h(T045Batch6b) : tab === 't045b6c' ? h(T045Batch6c) : tab === 't045b7' ? h(T045Batch7) : tab === 't045b8' ? h(T045Batch8) : tab === 't045b9' ? h(T045Batch9) : h(Colors)))
710
+ }
711
+
712
+ exports.inject = ['slots']
713
+ exports.apply = function apply(ctx) { ui.settingsSection(ctx, { id: 'example-ui-library', order: 90, label: 'UI library' }, Gallery) }
714
+
715
+ return module.exports; } });