@shavin/ui 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 (471) hide show
  1. package/CHANGELOG.md +94 -0
  2. package/LICENSE +21 -0
  3. package/README.md +81 -2
  4. package/components.json +15771 -0
  5. package/dist/authoring/types.js +0 -0
  6. package/dist/icons.d.ts +20 -0
  7. package/dist/icons.js +6 -0
  8. package/dist/index.d.ts +3325 -0
  9. package/dist/index.js +531 -0
  10. package/dist/inspector/FindingPopover.js +252 -0
  11. package/dist/inspector/Highlight.js +76 -0
  12. package/dist/inspector/Inspector.js +420 -0
  13. package/dist/inspector/InspectorRoot.js +75 -0
  14. package/dist/inspector/IssuesLayer.js +134 -0
  15. package/dist/inspector/IssuesList.js +174 -0
  16. package/dist/inspector/SettingsPanel.js +89 -0
  17. package/dist/inspector/ShavinMark.js +22 -0
  18. package/dist/inspector/Toolbar.js +202 -0
  19. package/dist/inspector/barPlacement.js +117 -0
  20. package/dist/inspector/env.js +59 -0
  21. package/dist/inspector/geometry.js +44 -0
  22. package/dist/inspector/ignored.js +52 -0
  23. package/dist/inspector/index.js +7 -0
  24. package/dist/inspector/journalClient.js +57 -0
  25. package/dist/inspector/journalState.js +36 -0
  26. package/dist/inspector/pin.js +43 -0
  27. package/dist/inspector/placement.js +96 -0
  28. package/dist/inspector/prompt.js +63 -0
  29. package/dist/inspector/scheme.js +56 -0
  30. package/dist/inspector/settings.js +54 -0
  31. package/dist/inspector/strings.js +67 -0
  32. package/dist/inspector/targets.js +31 -0
  33. package/dist/inspector/theme/ThemeControls.js +351 -0
  34. package/dist/inspector/theme/ThemePanel.js +32 -0
  35. package/dist/inspector/theme/useThemeController.js +560 -0
  36. package/dist/inspector/usePhone.js +32 -0
  37. package/dist/inspector/useSelectTool.js +82 -0
  38. package/dist/inspector/useTimeouts.js +22 -0
  39. package/dist/inspector/useTrackedRect.js +39 -0
  40. package/dist/lib/announce.js +47 -0
  41. package/dist/lib/bridge.js +43 -0
  42. package/dist/lib/buttonState.js +81 -0
  43. package/dist/lib/chart-kit.js +226 -0
  44. package/dist/lib/cn.js +8 -0
  45. package/dist/lib/color-space.js +315 -0
  46. package/dist/lib/concentric.js +85 -0
  47. package/dist/lib/hit-area.js +25 -0
  48. package/dist/lib/inspector/collect.js +299 -0
  49. package/dist/lib/inspector/color.js +58 -0
  50. package/dist/lib/inspector/console-capture.js +96 -0
  51. package/dist/lib/inspector/index.js +8 -0
  52. package/dist/lib/inspector/rules.js +232 -0
  53. package/dist/lib/inspector/run.js +35 -0
  54. package/dist/lib/inspector/schema.js +110 -0
  55. package/dist/lib/inspector/selector.js +103 -0
  56. package/dist/lib/inspector/tokens.js +34 -0
  57. package/dist/lib/media-overlay-presets.js +284 -0
  58. package/dist/lib/media-overlays.js +381 -0
  59. package/dist/lib/meta.js +70 -0
  60. package/dist/lib/motion-gsap.js +25 -0
  61. package/dist/lib/motion-runtime.js +283 -0
  62. package/dist/lib/neutral-tint.js +108 -0
  63. package/dist/lib/portal-container.js +12 -0
  64. package/dist/lib/scroll-edges.js +41 -0
  65. package/dist/lib/surface.js +6 -0
  66. package/dist/lib/syntax.js +115 -0
  67. package/dist/lib/theme-presets.d.ts +1 -0
  68. package/dist/lib/theme-presets.js +759 -0
  69. package/dist/lib/useClientLocale.js +11 -0
  70. package/dist/lib/useFieldErrorAnnouncement.js +15 -0
  71. package/dist/lib/useReducedMotion.js +17 -0
  72. package/dist/lib/useResizable.js +313 -0
  73. package/dist/lib/useReturnFocus.js +24 -0
  74. package/dist/lib/useSlidingIndicator.js +56 -0
  75. package/dist/panels.d.ts +37 -0
  76. package/dist/panels.js +19 -0
  77. package/dist/primitives/Accordion/Accordion.doc.js +37 -0
  78. package/dist/primitives/Accordion/Accordion.js +87 -0
  79. package/dist/primitives/Accordion/index.js +2 -0
  80. package/dist/primitives/ActionBar/ActionBar.doc.js +37 -0
  81. package/dist/primitives/ActionBar/ActionBar.js +126 -0
  82. package/dist/primitives/ActionBar/index.js +2 -0
  83. package/dist/primitives/AlertDialog/AlertDialog.doc.js +54 -0
  84. package/dist/primitives/AlertDialog/AlertDialog.js +113 -0
  85. package/dist/primitives/AlertDialog/index.js +2 -0
  86. package/dist/primitives/AppShell/AppShell.doc.js +81 -0
  87. package/dist/primitives/AppShell/AppShell.js +178 -0
  88. package/dist/primitives/AppShell/frame-context.js +10 -0
  89. package/dist/primitives/AppShell/index.js +2 -0
  90. package/dist/primitives/AspectRatio/AspectRatio.doc.js +34 -0
  91. package/dist/primitives/AspectRatio/AspectRatio.js +5 -0
  92. package/dist/primitives/AspectRatio/index.js +2 -0
  93. package/dist/primitives/Avatar/Avatar.doc.js +40 -0
  94. package/dist/primitives/Avatar/Avatar.js +62 -0
  95. package/dist/primitives/Avatar/index.js +2 -0
  96. package/dist/primitives/Backdrop/Backdrop.doc.js +24 -0
  97. package/dist/primitives/Backdrop/Backdrop.js +42 -0
  98. package/dist/primitives/Backdrop/index.js +2 -0
  99. package/dist/primitives/Badge/Badge.doc.js +35 -0
  100. package/dist/primitives/Badge/Badge.js +95 -0
  101. package/dist/primitives/Badge/index.js +2 -0
  102. package/dist/primitives/BarChart/BarChart.doc.js +59 -0
  103. package/dist/primitives/BarChart/BarChart.js +154 -0
  104. package/dist/primitives/BarChart/index.js +2 -0
  105. package/dist/primitives/BlockPreview/BlockPreview.doc.js +51 -0
  106. package/dist/primitives/BlockPreview/BlockPreview.js +485 -0
  107. package/dist/primitives/BlockPreview/index.js +8 -0
  108. package/dist/primitives/Blockquote/Blockquote.doc.js +25 -0
  109. package/dist/primitives/Blockquote/Blockquote.js +19 -0
  110. package/dist/primitives/Blockquote/index.js +2 -0
  111. package/dist/primitives/BottomNav/BottomNav.doc.js +37 -0
  112. package/dist/primitives/BottomNav/BottomNav.js +54 -0
  113. package/dist/primitives/BottomNav/index.js +2 -0
  114. package/dist/primitives/Box/Box.doc.js +45 -0
  115. package/dist/primitives/Box/Box.js +51 -0
  116. package/dist/primitives/Box/index.js +2 -0
  117. package/dist/primitives/Breadcrumbs/Breadcrumbs.doc.js +35 -0
  118. package/dist/primitives/Breadcrumbs/Breadcrumbs.js +40 -0
  119. package/dist/primitives/Breadcrumbs/index.js +2 -0
  120. package/dist/primitives/Button/Button.doc.js +80 -0
  121. package/dist/primitives/Button/Button.js +132 -0
  122. package/dist/primitives/Button/index.js +2 -0
  123. package/dist/primitives/Calendar/Calendar.doc.js +36 -0
  124. package/dist/primitives/Calendar/Calendar.js +502 -0
  125. package/dist/primitives/Calendar/index.js +2 -0
  126. package/dist/primitives/Callout/Callout.doc.js +34 -0
  127. package/dist/primitives/Callout/Callout.js +63 -0
  128. package/dist/primitives/Callout/index.js +2 -0
  129. package/dist/primitives/Card/Card.doc.js +46 -0
  130. package/dist/primitives/Card/Card.js +159 -0
  131. package/dist/primitives/Card/index.js +2 -0
  132. package/dist/primitives/Carousel/Carousel.doc.js +61 -0
  133. package/dist/primitives/Carousel/Carousel.js +369 -0
  134. package/dist/primitives/Carousel/index.js +1 -0
  135. package/dist/primitives/ChatBubble/ChatBubble.doc.js +37 -0
  136. package/dist/primitives/ChatBubble/ChatBubble.js +120 -0
  137. package/dist/primitives/ChatBubble/index.js +2 -0
  138. package/dist/primitives/Checkbox/Checkbox.doc.js +36 -0
  139. package/dist/primitives/Checkbox/Checkbox.js +57 -0
  140. package/dist/primitives/Checkbox/index.js +2 -0
  141. package/dist/primitives/CheckboxCards/CheckboxCards.doc.js +35 -0
  142. package/dist/primitives/CheckboxCards/CheckboxCards.js +47 -0
  143. package/dist/primitives/CheckboxCards/index.js +2 -0
  144. package/dist/primitives/CheckboxGroup/CheckboxGroup.doc.js +35 -0
  145. package/dist/primitives/CheckboxGroup/CheckboxGroup.js +40 -0
  146. package/dist/primitives/CheckboxGroup/index.js +2 -0
  147. package/dist/primitives/Code/Code.doc.js +22 -0
  148. package/dist/primitives/Code/Code.js +17 -0
  149. package/dist/primitives/Code/index.js +2 -0
  150. package/dist/primitives/CodeBlock/CodeBlock.doc.js +36 -0
  151. package/dist/primitives/CodeBlock/CodeBlock.js +205 -0
  152. package/dist/primitives/CodeBlock/index.js +2 -0
  153. package/dist/primitives/CodeEditor/CodeEditor.doc.js +53 -0
  154. package/dist/primitives/CodeEditor/CodeEditor.js +204 -0
  155. package/dist/primitives/CodeEditor/index.js +4 -0
  156. package/dist/primitives/ColorPicker/ColorPicker.doc.js +37 -0
  157. package/dist/primitives/ColorPicker/ColorPicker.js +776 -0
  158. package/dist/primitives/ColorPicker/index.js +2 -0
  159. package/dist/primitives/Combobox/Combobox.doc.js +36 -0
  160. package/dist/primitives/Combobox/Combobox.js +199 -0
  161. package/dist/primitives/Combobox/index.js +2 -0
  162. package/dist/primitives/Container/Container.doc.js +46 -0
  163. package/dist/primitives/Container/Container.js +54 -0
  164. package/dist/primitives/Container/index.js +2 -0
  165. package/dist/primitives/ContextMenu/ContextMenu.doc.js +36 -0
  166. package/dist/primitives/ContextMenu/ContextMenu.js +59 -0
  167. package/dist/primitives/ContextMenu/index.js +2 -0
  168. package/dist/primitives/DataList/DataList.doc.js +34 -0
  169. package/dist/primitives/DataList/DataList.js +35 -0
  170. package/dist/primitives/DataList/index.js +2 -0
  171. package/dist/primitives/DatePicker/DatePicker.doc.js +36 -0
  172. package/dist/primitives/DatePicker/DatePicker.js +398 -0
  173. package/dist/primitives/DatePicker/index.js +2 -0
  174. package/dist/primitives/Dialog/Dialog.doc.js +107 -0
  175. package/dist/primitives/Dialog/Dialog.js +143 -0
  176. package/dist/primitives/Dialog/index.js +2 -0
  177. package/dist/primitives/DonutChart/DonutChart.doc.js +26 -0
  178. package/dist/primitives/DonutChart/DonutChart.js +71 -0
  179. package/dist/primitives/DonutChart/index.js +2 -0
  180. package/dist/primitives/Drawer/Drawer.doc.js +44 -0
  181. package/dist/primitives/Drawer/Drawer.js +158 -0
  182. package/dist/primitives/Drawer/index.js +2 -0
  183. package/dist/primitives/Dropdown/Dropdown.doc.js +40 -0
  184. package/dist/primitives/Dropdown/Dropdown.js +146 -0
  185. package/dist/primitives/Dropdown/index.js +2 -0
  186. package/dist/primitives/Emphasis/Emphasis.doc.js +28 -0
  187. package/dist/primitives/Emphasis/Emphasis.js +25 -0
  188. package/dist/primitives/Emphasis/index.js +2 -0
  189. package/dist/primitives/EmptyState/EmptyState.doc.js +76 -0
  190. package/dist/primitives/EmptyState/EmptyState.js +118 -0
  191. package/dist/primitives/EmptyState/index.js +2 -0
  192. package/dist/primitives/FileOutput/FileOutput.doc.js +26 -0
  193. package/dist/primitives/FileOutput/FileOutput.js +55 -0
  194. package/dist/primitives/FileOutput/index.js +2 -0
  195. package/dist/primitives/Flex/Flex.doc.js +58 -0
  196. package/dist/primitives/Flex/Flex.js +98 -0
  197. package/dist/primitives/Flex/index.js +2 -0
  198. package/dist/primitives/FormErrorSummary/FormErrorSummary.doc.js +39 -0
  199. package/dist/primitives/FormErrorSummary/FormErrorSummary.js +61 -0
  200. package/dist/primitives/FormErrorSummary/index.js +2 -0
  201. package/dist/primitives/FormField/FormField.doc.js +68 -0
  202. package/dist/primitives/FormField/FormField.js +149 -0
  203. package/dist/primitives/FormField/index.js +2 -0
  204. package/dist/primitives/FunnelChart/FunnelChart.doc.js +45 -0
  205. package/dist/primitives/FunnelChart/FunnelChart.js +54 -0
  206. package/dist/primitives/FunnelChart/index.js +2 -0
  207. package/dist/primitives/Grid/Grid.doc.js +57 -0
  208. package/dist/primitives/Grid/Grid.js +122 -0
  209. package/dist/primitives/Grid/index.js +2 -0
  210. package/dist/primitives/Heading/Heading.doc.js +46 -0
  211. package/dist/primitives/Heading/Heading.js +80 -0
  212. package/dist/primitives/Heading/index.js +2 -0
  213. package/dist/primitives/Heatmap/Heatmap.doc.js +49 -0
  214. package/dist/primitives/Heatmap/Heatmap.js +42 -0
  215. package/dist/primitives/Heatmap/index.js +2 -0
  216. package/dist/primitives/HoverCard/HoverCard.doc.js +36 -0
  217. package/dist/primitives/HoverCard/HoverCard.js +39 -0
  218. package/dist/primitives/HoverCard/index.js +2 -0
  219. package/dist/primitives/Icon/Icon.doc.js +49 -0
  220. package/dist/primitives/Icon/Icon.js +214 -0
  221. package/dist/primitives/Icon/buckets/lucide-a.js +214 -0
  222. package/dist/primitives/Icon/buckets/lucide-b.js +298 -0
  223. package/dist/primitives/Icon/buckets/lucide-c.js +524 -0
  224. package/dist/primitives/Icon/buckets/lucide-d.js +110 -0
  225. package/dist/primitives/Icon/buckets/lucide-e.js +50 -0
  226. package/dist/primitives/Icon/buckets/lucide-f.js +264 -0
  227. package/dist/primitives/Icon/buckets/lucide-g.js +108 -0
  228. package/dist/primitives/Icon/buckets/lucide-h.js +112 -0
  229. package/dist/primitives/Icon/buckets/lucide-i.js +46 -0
  230. package/dist/primitives/Icon/buckets/lucide-j.js +6 -0
  231. package/dist/primitives/Icon/buckets/lucide-k.js +18 -0
  232. package/dist/primitives/Icon/buckets/lucide-l.js +162 -0
  233. package/dist/primitives/Icon/buckets/lucide-m.js +266 -0
  234. package/dist/primitives/Icon/buckets/lucide-n.js +34 -0
  235. package/dist/primitives/Icon/buckets/lucide-o.js +20 -0
  236. package/dist/primitives/Icon/buckets/lucide-p.js +216 -0
  237. package/dist/primitives/Icon/buckets/lucide-q.js +6 -0
  238. package/dist/primitives/Icon/buckets/lucide-r.js +140 -0
  239. package/dist/primitives/Icon/buckets/lucide-s.js +490 -0
  240. package/dist/primitives/Icon/buckets/lucide-t.js +204 -0
  241. package/dist/primitives/Icon/buckets/lucide-u.js +84 -0
  242. package/dist/primitives/Icon/buckets/lucide-v.js +46 -0
  243. package/dist/primitives/Icon/buckets/lucide-w.js +82 -0
  244. package/dist/primitives/Icon/buckets/lucide-x.js +6 -0
  245. package/dist/primitives/Icon/buckets/lucide-z.js +36 -0
  246. package/dist/primitives/Icon/buckets/phosphor-a.js +250 -0
  247. package/dist/primitives/Icon/buckets/phosphor-b.js +158 -0
  248. package/dist/primitives/Icon/buckets/phosphor-c.js +320 -0
  249. package/dist/primitives/Icon/buckets/phosphor-d.js +90 -0
  250. package/dist/primitives/Icon/buckets/phosphor-e.js +52 -0
  251. package/dist/primitives/Icon/buckets/phosphor-f.js +162 -0
  252. package/dist/primitives/Icon/buckets/phosphor-g.js +92 -0
  253. package/dist/primitives/Icon/buckets/phosphor-h.js +88 -0
  254. package/dist/primitives/Icon/buckets/phosphor-i.js +26 -0
  255. package/dist/primitives/Icon/buckets/phosphor-j.js +8 -0
  256. package/dist/primitives/Icon/buckets/phosphor-k.js +8 -0
  257. package/dist/primitives/Icon/buckets/phosphor-l.js +84 -0
  258. package/dist/primitives/Icon/buckets/phosphor-m.js +110 -0
  259. package/dist/primitives/Icon/buckets/phosphor-n.js +100 -0
  260. package/dist/primitives/Icon/buckets/phosphor-o.js +14 -0
  261. package/dist/primitives/Icon/buckets/phosphor-p.js +166 -0
  262. package/dist/primitives/Icon/buckets/phosphor-q.js +10 -0
  263. package/dist/primitives/Icon/buckets/phosphor-r.js +46 -0
  264. package/dist/primitives/Icon/buckets/phosphor-s.js +254 -0
  265. package/dist/primitives/Icon/buckets/phosphor-t.js +152 -0
  266. package/dist/primitives/Icon/buckets/phosphor-u.js +38 -0
  267. package/dist/primitives/Icon/buckets/phosphor-v.js +22 -0
  268. package/dist/primitives/Icon/buckets/phosphor-w.js +48 -0
  269. package/dist/primitives/Icon/buckets/phosphor-x.js +4 -0
  270. package/dist/primitives/Icon/buckets/phosphor-y.js +8 -0
  271. package/dist/primitives/Icon/icon-display-names.generated.js +4 -0
  272. package/dist/primitives/Icon/icon-loaders.generated.js +70 -0
  273. package/dist/primitives/Icon/icon-names-material.generated.js +4 -0
  274. package/dist/primitives/Icon/icon-names.js +11 -0
  275. package/dist/primitives/Icon/index.js +7 -0
  276. package/dist/primitives/IconButton/IconButton.doc.js +43 -0
  277. package/dist/primitives/IconButton/IconButton.js +98 -0
  278. package/dist/primitives/IconButton/index.js +2 -0
  279. package/dist/primitives/IconPicker/IconPicker.doc.js +52 -0
  280. package/dist/primitives/IconPicker/IconPicker.js +193 -0
  281. package/dist/primitives/IconPicker/index.js +2 -0
  282. package/dist/primitives/IconPicker/registry.js +98 -0
  283. package/dist/primitives/Image/Image.doc.js +40 -0
  284. package/dist/primitives/Image/Image.js +76 -0
  285. package/dist/primitives/Image/index.js +2 -0
  286. package/dist/primitives/Inset/Inset.doc.js +34 -0
  287. package/dist/primitives/Inset/Inset.js +51 -0
  288. package/dist/primitives/Inset/index.js +2 -0
  289. package/dist/primitives/Kbd/Kbd.doc.js +22 -0
  290. package/dist/primitives/Kbd/Kbd.js +17 -0
  291. package/dist/primitives/Kbd/index.js +2 -0
  292. package/dist/primitives/LineChart/LineChart.doc.js +61 -0
  293. package/dist/primitives/LineChart/LineChart.js +146 -0
  294. package/dist/primitives/LineChart/index.js +2 -0
  295. package/dist/primitives/Link/Link.doc.js +45 -0
  296. package/dist/primitives/Link/Link.js +37 -0
  297. package/dist/primitives/Link/index.js +2 -0
  298. package/dist/primitives/List/List.doc.js +35 -0
  299. package/dist/primitives/List/List.js +35 -0
  300. package/dist/primitives/List/index.js +2 -0
  301. package/dist/primitives/Menu/Menu.doc.js +37 -0
  302. package/dist/primitives/Menu/Menu.js +117 -0
  303. package/dist/primitives/Menu/index.js +2 -0
  304. package/dist/primitives/Murmur/Murmur.doc.js +32 -0
  305. package/dist/primitives/Murmur/Murmur.js +85 -0
  306. package/dist/primitives/Murmur/engine.js +163 -0
  307. package/dist/primitives/Murmur/index.js +12 -0
  308. package/dist/primitives/Pagination/Pagination.doc.js +37 -0
  309. package/dist/primitives/Pagination/Pagination.js +183 -0
  310. package/dist/primitives/Pagination/index.js +2 -0
  311. package/dist/primitives/PanelGroup/PanelGroup.doc.js +41 -0
  312. package/dist/primitives/PanelGroup/PanelGroup.js +142 -0
  313. package/dist/primitives/PanelGroup/index.js +2 -0
  314. package/dist/primitives/Popover/Popover.doc.js +36 -0
  315. package/dist/primitives/Popover/Popover.js +41 -0
  316. package/dist/primitives/Popover/index.js +2 -0
  317. package/dist/primitives/Progress/Progress.doc.js +35 -0
  318. package/dist/primitives/Progress/Progress.js +77 -0
  319. package/dist/primitives/Progress/index.js +2 -0
  320. package/dist/primitives/RadioGroup/RadioGroup.doc.js +36 -0
  321. package/dist/primitives/RadioGroup/RadioGroup.js +132 -0
  322. package/dist/primitives/RadioGroup/index.js +2 -0
  323. package/dist/primitives/Rating/NpsScale.js +102 -0
  324. package/dist/primitives/Rating/Rating.doc.js +35 -0
  325. package/dist/primitives/Rating/Rating.js +116 -0
  326. package/dist/primitives/Rating/RatingSummary.js +50 -0
  327. package/dist/primitives/Rating/SentimentRating.js +81 -0
  328. package/dist/primitives/Rating/index.js +5 -0
  329. package/dist/primitives/Reasoning/Reasoning.doc.js +28 -0
  330. package/dist/primitives/Reasoning/Reasoning.js +73 -0
  331. package/dist/primitives/Reasoning/index.js +2 -0
  332. package/dist/primitives/Resizable/Resizable.doc.js +50 -0
  333. package/dist/primitives/Resizable/ResizeHandle.js +185 -0
  334. package/dist/primitives/Resizable/index.js +2 -0
  335. package/dist/primitives/Row/Row.doc.js +36 -0
  336. package/dist/primitives/Row/Row.js +53 -0
  337. package/dist/primitives/Row/index.js +2 -0
  338. package/dist/primitives/ScrollArea/ScrollArea.doc.js +35 -0
  339. package/dist/primitives/ScrollArea/ScrollArea.js +50 -0
  340. package/dist/primitives/ScrollArea/index.js +2 -0
  341. package/dist/primitives/Section/Section.doc.js +64 -0
  342. package/dist/primitives/Section/Section.js +76 -0
  343. package/dist/primitives/Section/index.js +2 -0
  344. package/dist/primitives/SegmentedControl/SegmentedControl.doc.js +75 -0
  345. package/dist/primitives/SegmentedControl/SegmentedControl.js +160 -0
  346. package/dist/primitives/SegmentedControl/index.js +2 -0
  347. package/dist/primitives/Select/Select.doc.js +42 -0
  348. package/dist/primitives/Select/Select.js +180 -0
  349. package/dist/primitives/Select/index.js +2 -0
  350. package/dist/primitives/Separator/Separator.doc.js +34 -0
  351. package/dist/primitives/Separator/Separator.js +84 -0
  352. package/dist/primitives/Separator/index.js +2 -0
  353. package/dist/primitives/ShavinDevTools/DevToolsPanel.js +2050 -0
  354. package/dist/primitives/ShavinDevTools/ShavinDevTools.doc.js +44 -0
  355. package/dist/primitives/ShavinDevTools/ShavinDevTools.js +15 -0
  356. package/dist/primitives/ShavinDevTools/index.js +8 -0
  357. package/dist/primitives/ShavinDevTools/types.js +0 -0
  358. package/dist/primitives/Sidebar/Sidebar.doc.js +39 -0
  359. package/dist/primitives/Sidebar/Sidebar.js +295 -0
  360. package/dist/primitives/Sidebar/index.js +2 -0
  361. package/dist/primitives/Skeleton/Skeleton.doc.js +38 -0
  362. package/dist/primitives/Skeleton/Skeleton.js +36 -0
  363. package/dist/primitives/Skeleton/index.js +2 -0
  364. package/dist/primitives/Slider/Slider.doc.js +45 -0
  365. package/dist/primitives/Slider/Slider.js +406 -0
  366. package/dist/primitives/Slider/index.js +2 -0
  367. package/dist/primitives/Sortable/Sortable.doc.js +35 -0
  368. package/dist/primitives/Sortable/Sortable.js +179 -0
  369. package/dist/primitives/Sortable/index.js +2 -0
  370. package/dist/primitives/Sparkline/Sparkline.doc.js +25 -0
  371. package/dist/primitives/Sparkline/Sparkline.js +46 -0
  372. package/dist/primitives/Sparkline/index.js +2 -0
  373. package/dist/primitives/Spinner/Spinner.doc.js +35 -0
  374. package/dist/primitives/Spinner/Spinner.js +162 -0
  375. package/dist/primitives/Spinner/index.js +2 -0
  376. package/dist/primitives/Spotlight/Spotlight.doc.js +36 -0
  377. package/dist/primitives/Spotlight/Spotlight.js +139 -0
  378. package/dist/primitives/Spotlight/index.js +2 -0
  379. package/dist/primitives/Stepper/Stepper.doc.js +46 -0
  380. package/dist/primitives/Stepper/Stepper.js +235 -0
  381. package/dist/primitives/Stepper/index.js +2 -0
  382. package/dist/primitives/Switch/Switch.doc.js +36 -0
  383. package/dist/primitives/Switch/Switch.js +54 -0
  384. package/dist/primitives/Switch/index.js +2 -0
  385. package/dist/primitives/Table/Table.doc.js +47 -0
  386. package/dist/primitives/Table/Table.js +63 -0
  387. package/dist/primitives/Table/index.js +2 -0
  388. package/dist/primitives/Tabs/Tabs.doc.js +53 -0
  389. package/dist/primitives/Tabs/Tabs.js +275 -0
  390. package/dist/primitives/Tabs/index.js +2 -0
  391. package/dist/primitives/Text/Text.doc.js +35 -0
  392. package/dist/primitives/Text/Text.js +67 -0
  393. package/dist/primitives/Text/index.js +2 -0
  394. package/dist/primitives/TextArea/TextArea.doc.js +35 -0
  395. package/dist/primitives/TextArea/TextArea.js +45 -0
  396. package/dist/primitives/TextArea/index.js +2 -0
  397. package/dist/primitives/TextField/TextField.doc.js +41 -0
  398. package/dist/primitives/TextField/TextField.js +290 -0
  399. package/dist/primitives/TextField/index.js +2 -0
  400. package/dist/primitives/ThemeProvider/ScopedThemeProvider.js +71 -0
  401. package/dist/primitives/ThemeProvider/ThemeProvider.doc.js +61 -0
  402. package/dist/primitives/ThemeProvider/ThemeProvider.js +143 -0
  403. package/dist/primitives/ThemeProvider/clientTheme.js +47 -0
  404. package/dist/primitives/ThemeProvider/index.js +3 -0
  405. package/dist/primitives/ThemeProvider/themeContext.js +11 -0
  406. package/dist/primitives/ThemeSwitcher/ThemeSwitcher.doc.js +49 -0
  407. package/dist/primitives/ThemeSwitcher/ThemeSwitcher.js +323 -0
  408. package/dist/primitives/ThemeSwitcher/index.js +2 -0
  409. package/dist/primitives/TimePicker/TimePicker.doc.js +36 -0
  410. package/dist/primitives/TimePicker/TimePicker.js +368 -0
  411. package/dist/primitives/TimePicker/index.js +2 -0
  412. package/dist/primitives/Toast/Toast.doc.js +65 -0
  413. package/dist/primitives/Toast/Toast.js +304 -0
  414. package/dist/primitives/Toast/index.js +2 -0
  415. package/dist/primitives/ToolCall/ToolCall.doc.js +29 -0
  416. package/dist/primitives/ToolCall/ToolCall.js +75 -0
  417. package/dist/primitives/ToolCall/index.js +2 -0
  418. package/dist/primitives/Tooltip/Tooltip.doc.js +37 -0
  419. package/dist/primitives/Tooltip/Tooltip.js +55 -0
  420. package/dist/primitives/Tooltip/index.js +2 -0
  421. package/dist/primitives/TopBar/TopBar.doc.js +34 -0
  422. package/dist/primitives/TopBar/TopBar.js +8 -0
  423. package/dist/primitives/TopBar/index.js +2 -0
  424. package/dist/primitives/Video/PauseToggle.js +49 -0
  425. package/dist/primitives/Video/Video.doc.js +47 -0
  426. package/dist/primitives/Video/Video.js +104 -0
  427. package/dist/primitives/Video/index.js +1 -0
  428. package/dist/primitives/VoiceInput/VoiceInput.doc.js +38 -0
  429. package/dist/primitives/VoiceInput/VoiceInput.js +96 -0
  430. package/dist/primitives/VoiceInput/index.js +2 -0
  431. package/dist/primitives/WiseOwlLogo/WiseOwlLogo.doc.js +38 -0
  432. package/dist/primitives/WiseOwlLogo/WiseOwlLogo.js +82 -0
  433. package/dist/primitives/WiseOwlLogo/index.js +2 -0
  434. package/dist/primitives/WiseOwlLogo/paths.js +10 -0
  435. package/dist/server.d.ts +256 -0
  436. package/dist/server.js +22 -0
  437. package/dist/styles/base-oklch.css +124 -0
  438. package/dist/styles/base-oklch.d.ts +2 -0
  439. package/dist/styles/base.css +124 -0
  440. package/dist/styles/base.d.ts +2 -0
  441. package/dist/styles/brand-preset.d.ts +22 -0
  442. package/dist/styles/brand-preset.js +13 -0
  443. package/dist/styles/brand-theme-v4-oklch.css +2 -0
  444. package/dist/styles/brand-theme-v4-oklch.d.ts +2 -0
  445. package/dist/styles/brand-theme-v4.css +2 -0
  446. package/dist/styles/brand-theme-v4.d.ts +2 -0
  447. package/dist/styles/brand-tokens-oklch.css +6 -0
  448. package/dist/styles/brand-tokens-oklch.d.ts +2 -0
  449. package/dist/styles/brand-tokens.css +6 -0
  450. package/dist/styles/brand-tokens.d.ts +2 -0
  451. package/dist/styles/global-oklch.css +1329 -0
  452. package/dist/styles/global-oklch.d.ts +2 -0
  453. package/dist/styles/global.css +1329 -0
  454. package/dist/styles/global.d.ts +2 -0
  455. package/dist/styles/theme-v4-oklch.css +22 -0
  456. package/dist/styles/theme-v4-oklch.d.ts +2 -0
  457. package/dist/styles/theme-v4.css +22 -0
  458. package/dist/styles/theme-v4.d.ts +2 -0
  459. package/dist/styles/tokens-oklch.css +1204 -0
  460. package/dist/styles/tokens-oklch.d.ts +2 -0
  461. package/dist/styles/tokens.css +1204 -0
  462. package/dist/styles/tokens.d.ts +2 -0
  463. package/dist/tailwind-preset.cjs +155 -0
  464. package/dist/tailwind-preset.d.ts +112 -0
  465. package/dist/tailwind-preset.js +133 -0
  466. package/dist/theme-presets-BVWZ_TxX.d.ts +514 -0
  467. package/global-oklch.css +3 -0
  468. package/package.json +169 -4
  469. package/styles.css +3 -0
  470. package/tailwind-preset.ts +140 -0
  471. package/tokens.json +423 -0
@@ -0,0 +1,126 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { useMemo, useRef, useState } from "react";
4
+ import { Popover, PopoverTrigger, PopoverContent } from "../Popover/index.js";
5
+ import { cn } from "../../lib/cn.js";
6
+ function ActionBar({ groups, onAction, className, ariaLabel = "Action Bar" }) {
7
+ const [openKey, setOpenKey] = useState(null);
8
+ const handleAction = (groupKey, value) => {
9
+ onAction?.(groupKey, value);
10
+ };
11
+ return /* @__PURE__ */ jsx(
12
+ "div",
13
+ {
14
+ role: "toolbar",
15
+ "aria-label": ariaLabel,
16
+ className: cn(
17
+ "inline-flex w-fit items-center gap-1 rounded-[var(--radius-panel)] border border-hairline bg-surface p-1 shadow-panel",
18
+ className
19
+ ),
20
+ children: groups.map((group) => /* @__PURE__ */ jsx(
21
+ ActionBarGroupTrigger,
22
+ {
23
+ group,
24
+ open: openKey === group.key,
25
+ onOpenChange: (next) => setOpenKey(next ? group.key : null),
26
+ onAction: handleAction
27
+ },
28
+ group.key
29
+ ))
30
+ }
31
+ );
32
+ }
33
+ function ActionBarGroupTrigger({
34
+ group,
35
+ open,
36
+ onOpenChange,
37
+ onAction
38
+ }) {
39
+ const [query, setQuery] = useState("");
40
+ const inputRef = useRef(null);
41
+ const filtered = useMemo(() => {
42
+ const q = query.trim().toLowerCase();
43
+ if (!q) return group.items;
44
+ return group.items.filter(
45
+ (item) => item.label.toLowerCase().includes(q) || (item.keywords ?? []).some((k) => k.toLowerCase().includes(q))
46
+ );
47
+ }, [group.items, query]);
48
+ function handleOpenChange(next) {
49
+ if (!next) setQuery("");
50
+ onOpenChange(next);
51
+ }
52
+ function triggerAction(value) {
53
+ onAction(group.key, value);
54
+ setQuery("");
55
+ onOpenChange(false);
56
+ }
57
+ function onKeyDown(e) {
58
+ if (e.key === "Enter") {
59
+ e.preventDefault();
60
+ if (filtered[0]) triggerAction(filtered[0].value);
61
+ } else if (e.key === "Escape") {
62
+ e.preventDefault();
63
+ handleOpenChange(false);
64
+ }
65
+ }
66
+ return /* @__PURE__ */ jsxs(Popover, { open, onOpenChange: handleOpenChange, children: [
67
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
68
+ "button",
69
+ {
70
+ type: "button",
71
+ "aria-label": group.label,
72
+ className: cn(
73
+ "flex items-center gap-1.5 rounded-[var(--radius-lg)] px-3 py-1.5 text-sm text-fg-muted transition hover:bg-surface-hover hover:text-fg active:scale-[0.97] cursor-pointer",
74
+ open && "bg-surface-hover text-fg"
75
+ ),
76
+ children: [
77
+ group.icon && /* @__PURE__ */ jsx("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center", children: group.icon }),
78
+ /* @__PURE__ */ jsx("span", { className: "whitespace-nowrap", children: group.label })
79
+ ]
80
+ }
81
+ ) }),
82
+ /* @__PURE__ */ jsxs(
83
+ PopoverContent,
84
+ {
85
+ side: "top",
86
+ align: "start",
87
+ sideOffset: 8,
88
+ className: "w-64 p-2",
89
+ onOpenAutoFocus: (e) => {
90
+ e.preventDefault();
91
+ inputRef.current?.focus();
92
+ },
93
+ children: [
94
+ /* @__PURE__ */ jsx(
95
+ "input",
96
+ {
97
+ ref: inputRef,
98
+ value: query,
99
+ onChange: (e) => setQuery(e.target.value),
100
+ onKeyDown,
101
+ placeholder: "Search\u2026",
102
+ "aria-label": `Search ${group.label}`,
103
+ className: "mb-2 w-full rounded-[var(--radius-lg)] border border-border-control bg-surface-hover px-2.5 py-1.5 text-sm text-fg placeholder:text-fg-subtle"
104
+ }
105
+ ),
106
+ /* @__PURE__ */ jsx("div", { className: "max-h-64 overflow-y-auto", children: filtered.length === 0 ? /* @__PURE__ */ jsx("div", { className: "px-2.5 py-6 text-center text-sm text-fg-subtle", children: "No matches" }) : filtered.map((item) => /* @__PURE__ */ jsxs(
107
+ "button",
108
+ {
109
+ type: "button",
110
+ onClick: () => triggerAction(item.value),
111
+ className: "flex w-full items-center gap-2 rounded-[var(--radius-lg)] px-2.5 py-1.5 text-left text-sm text-fg-muted transition hover:bg-surface-hover hover:text-fg cursor-pointer",
112
+ children: [
113
+ item.icon && /* @__PURE__ */ jsx("span", { className: "flex h-4 w-4 shrink-0 items-center justify-center", children: item.icon }),
114
+ /* @__PURE__ */ jsx("span", { className: "truncate", children: item.label })
115
+ ]
116
+ },
117
+ item.value
118
+ )) })
119
+ ]
120
+ }
121
+ )
122
+ ] });
123
+ }
124
+ export {
125
+ ActionBar
126
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./ActionBar.js";
2
+ export * from "./ActionBar.doc.js";
@@ -0,0 +1,54 @@
1
+ const docs = {
2
+ name: "AlertDialog",
3
+ description: "Asks the user to confirm an important or destructive action before it happens. Clicking outside doesn't close it, and it comes in danger, warning, success and info tones.",
4
+ features: [
5
+ "Intents: info, warning, success, danger, default",
6
+ "Layouts: default (left-aligned), centered (hero icon visual tile)",
7
+ "Traps focus on Cancel action by default for maximum accessibility safety",
8
+ "Disables backdrop dismiss and ESC dismiss to force explicit user decision"
9
+ ],
10
+ accessibility: [
11
+ "Focus defaults to Cancel button on open to prevent accidental destructive confirmation",
12
+ "Omits outside-click and ESC key dismiss to enforce explicit decision contract",
13
+ "Exposes role='alertdialog' with aria-labelledby and aria-describedby"
14
+ ],
15
+ keyboard: "Tab/Shift+Tab to navigate between Cancel and Confirm buttons",
16
+ usage: {
17
+ bestPractices: [
18
+ {
19
+ guidance: true,
20
+ description: "Use AlertDialog for irreversible destructive actions like deleting accounts or dropping database records."
21
+ },
22
+ {
23
+ guidance: false,
24
+ description: "Do not use AlertDialog for casual dismissible dialogs \u2014 use standard Dialog instead."
25
+ }
26
+ ]
27
+ },
28
+ examples: [
29
+ {
30
+ title: "Confirm a destructive action",
31
+ description: "Keep the open state in the parent and open the dialog from a trigger.",
32
+ code: `function DeleteProject() {
33
+ const [open, setOpen] = useState(false);
34
+ return (
35
+ <>
36
+ <Button variant="soft" tone="danger" onClick={() => setOpen(true)}>Delete project</Button>
37
+ <AlertDialog
38
+ open={open}
39
+ onOpenChange={setOpen}
40
+ title="Delete project?"
41
+ description="This action cannot be undone."
42
+ intent="danger"
43
+ confirmLabel="Delete"
44
+ onConfirm={() => setOpen(false)}
45
+ />
46
+ </>
47
+ );
48
+ }`
49
+ }
50
+ ]
51
+ };
52
+ export {
53
+ docs
54
+ };
@@ -0,0 +1,113 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog";
4
+ import { cn } from "../../lib/cn.js";
5
+ import { useReturnFocus } from "../../lib/useReturnFocus.js";
6
+ import { modalPanelVariants } from "../Dialog/Dialog.js";
7
+ import { Button } from "../Button/Button.js";
8
+ import { AlertTriangle, CheckCircle2, Info, Trash2 } from "lucide-react";
9
+ function AlertDialog({
10
+ open,
11
+ onOpenChange,
12
+ title,
13
+ description,
14
+ confirmLabel = "Confirm",
15
+ cancelLabel = "Cancel",
16
+ onConfirm,
17
+ danger = false,
18
+ intent = "default",
19
+ layout = "default",
20
+ badgeText,
21
+ icon,
22
+ children
23
+ }) {
24
+ const resolvedIntent = danger ? "danger" : intent;
25
+ const defaultIcons = {
26
+ danger: /* @__PURE__ */ jsx(Trash2, { className: "h-5 w-5 shrink-0" }),
27
+ warning: /* @__PURE__ */ jsx(AlertTriangle, { className: "h-5 w-5 shrink-0" }),
28
+ success: /* @__PURE__ */ jsx(CheckCircle2, { className: "h-5 w-5 shrink-0" }),
29
+ info: /* @__PURE__ */ jsx(Info, { className: "h-5 w-5 shrink-0" }),
30
+ default: null
31
+ };
32
+ const largeIcons = {
33
+ danger: /* @__PURE__ */ jsx(Trash2, { className: "h-6 w-6 shrink-0" }),
34
+ warning: /* @__PURE__ */ jsx(AlertTriangle, { className: "h-6 w-6 shrink-0" }),
35
+ success: /* @__PURE__ */ jsx(CheckCircle2, { className: "h-6 w-6 shrink-0" }),
36
+ info: /* @__PURE__ */ jsx(Info, { className: "h-6 w-6 shrink-0" }),
37
+ default: null
38
+ };
39
+ const iconElement = icon || (layout === "centered" ? largeIcons[resolvedIntent] : defaultIcons[resolvedIntent]);
40
+ const circleClasses = {
41
+ danger: "bg-danger/10 text-danger",
42
+ warning: "bg-warning/15 text-warning",
43
+ success: "bg-success/15 text-success",
44
+ info: "bg-brand/10 text-brand-text",
45
+ default: "bg-surface-hover text-fg"
46
+ };
47
+ const confirmClasses = {
48
+ danger: "bg-danger text-danger-fg",
49
+ warning: "bg-warning text-warning-fg hover:opacity-90",
50
+ success: "bg-success text-success-fg hover:opacity-90",
51
+ info: "bg-brand-solid text-brand-fg",
52
+ default: "bg-brand-solid text-brand-fg"
53
+ };
54
+ const returnFocus = useReturnFocus(open);
55
+ const resolvedCircleClass = circleClasses[resolvedIntent];
56
+ const confirmButtonClass = confirmClasses[resolvedIntent];
57
+ return /* @__PURE__ */ jsx(AlertDialogPrimitive.Root, { open, onOpenChange, children: /* @__PURE__ */ jsxs(AlertDialogPrimitive.Portal, { children: [
58
+ /* @__PURE__ */ jsx(AlertDialogPrimitive.Overlay, { className: "animate-overlay fixed inset-0 z-[85]" }),
59
+ /* @__PURE__ */ jsx(
60
+ AlertDialogPrimitive.Content,
61
+ {
62
+ className: "animate-modal-wrap fixed inset-0 z-[85] flex items-center justify-center p-4",
63
+ ...description ? {} : { "aria-describedby": void 0 },
64
+ onCloseAutoFocus: returnFocus,
65
+ children: /* @__PURE__ */ jsxs("div", { "data-panel": true, className: cn(modalPanelVariants({ size: "sm" }), "p-6"), children: [
66
+ layout === "centered" ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center text-center", children: [
67
+ iconElement && /* @__PURE__ */ jsx("div", { className: cn("h-12 w-12 rounded-full flex items-center justify-center mb-4 shrink-0", resolvedCircleClass), children: iconElement }),
68
+ /* @__PURE__ */ jsx(AlertDialogPrimitive.Title, { className: "font-subheading text-lg font-semibold text-center w-full", children: title }),
69
+ badgeText && /* @__PURE__ */ jsx("div", { className: "mt-2", children: /* @__PURE__ */ jsx("span", { className: cn(
70
+ "px-2.5 py-0.5 text-xs font-semibold rounded-full border",
71
+ resolvedIntent === "danger" ? "bg-danger/10 text-danger border-danger/20" : resolvedIntent === "warning" ? "bg-warning/15 text-warning border-warning/20" : resolvedIntent === "success" ? "bg-success/15 text-success border-success/20" : "bg-brand/10 text-brand-text border-brand/20"
72
+ ), children: badgeText }) }),
73
+ description && /* @__PURE__ */ jsx(AlertDialogPrimitive.Description, { className: "mt-3.5 text-sm text-fg-muted leading-relaxed text-center max-w-sm", children: description })
74
+ ] }) : /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
75
+ iconElement && /* @__PURE__ */ jsx("div", { className: "mt-0.5 text-fg shrink-0", children: iconElement }),
76
+ /* @__PURE__ */ jsxs("div", { className: "flex-1 text-left", children: [
77
+ /* @__PURE__ */ jsx(AlertDialogPrimitive.Title, { className: "font-subheading text-lg font-semibold", children: title }),
78
+ badgeText && /* @__PURE__ */ jsx("div", { className: "mt-1", children: /* @__PURE__ */ jsx("span", { className: "inline-block bg-surface-hover border border-hairline px-2 py-0.5 text-[10px] font-semibold rounded-[var(--radius-lg)]", children: badgeText }) }),
79
+ description && /* @__PURE__ */ jsx(AlertDialogPrimitive.Description, { className: "mt-1.5 text-sm text-fg-muted leading-relaxed", children: description })
80
+ ] })
81
+ ] }),
82
+ children && /* @__PURE__ */ jsx("div", { className: "mt-4 w-full", children }),
83
+ /* @__PURE__ */ jsxs("div", { className: cn("mt-6 gap-2.5", layout === "centered" ? "flex flex-col-reverse sm:flex-row sm:justify-center w-full" : "flex flex-row justify-end"), children: [
84
+ /* @__PURE__ */ jsx(AlertDialogPrimitive.Cancel, { asChild: true, children: /* @__PURE__ */ jsx(
85
+ Button,
86
+ {
87
+ variant: "outline",
88
+ className: cn(layout === "centered" ? "w-full sm:w-auto" : ""),
89
+ children: cancelLabel
90
+ }
91
+ ) }),
92
+ /* @__PURE__ */ jsx(AlertDialogPrimitive.Action, { asChild: true, children: /* @__PURE__ */ jsx(
93
+ Button,
94
+ {
95
+ tone: resolvedIntent === "danger" ? "danger" : "brand",
96
+ className: cn(
97
+ confirmButtonClass,
98
+ "font-semibold",
99
+ layout === "centered" ? "w-full sm:w-auto" : ""
100
+ ),
101
+ onClick: onConfirm,
102
+ children: confirmLabel
103
+ }
104
+ ) })
105
+ ] })
106
+ ] })
107
+ }
108
+ )
109
+ ] }) });
110
+ }
111
+ export {
112
+ AlertDialog
113
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./AlertDialog.js";
2
+ export * from "./AlertDialog.doc.js";
@@ -0,0 +1,81 @@
1
+ const docs = {
2
+ name: "AppFrame",
3
+ group: "layout",
4
+ description: "Application shell: a Sidebar plus a main column. The frame measures its own width, so the same markup works on a phone, in a narrow window and in a Studio device preview. When it runs out of room the Sidebar becomes a slide-in drawer, written once, with no breakpoint classes, hamburger state or second copy of the navigation.",
5
+ features: [
6
+ "Wide: the Sidebar sits in flow exactly as written",
7
+ "Compact (frame narrower than compactBelow: md 768px default, lg 1024px): the same Sidebar slides over the content as a drawer",
8
+ "Container-driven, not viewport-driven: responds to the frame's own width, so it is correct inside previews, panels and embeds",
9
+ "SidebarTrigger placed in the TopBar appears automatically (only) in compact mode and opens the drawer",
10
+ "routeKey={pathname} closes the drawer on every route change; SidebarNavItem also closes it on click; custom controls can call useAppFrame().closeNav()",
11
+ "Drawer behaviour: scrim, inert background, focus moves in and returns to the trigger, Escape closes, swipe left to close with the drawer following the finger",
12
+ "A collapsed icon-rail Sidebar is shown in full inside the drawer",
13
+ "Respects prefers-reduced-motion"
14
+ ],
15
+ accessibility: [
16
+ "Native <aside> (Sidebar) and <main> landmarks",
17
+ "In compact mode the navigation is a modal dialog (aria-modal, aria-label from navLabel) and is inert while closed, so off-screen links are never tabbable",
18
+ "The page behind an open drawer is inert",
19
+ "Trigger exposes aria-expanded and aria-controls"
20
+ ],
21
+ keyboard: "Tab to the menu trigger and press Enter/Space to open; focus moves into the navigation; Escape closes and returns focus to the trigger.",
22
+ usage: {
23
+ bestPractices: [
24
+ {
25
+ guidance: true,
26
+ description: "Build app screens as <AppFrame sidebar={<Sidebar>\u2026</Sidebar>}><TopBar><SidebarTrigger />\u2026</TopBar>\u2026</AppFrame>. Write the navigation once."
27
+ },
28
+ {
29
+ guidance: true,
30
+ description: "Pass routeKey={usePathname()} (or your router's equivalent) so the drawer closes after navigation. Put <SidebarTrigger /> in the TopBar. Do not hand-write hidden md:block / md:hidden wrappers, a hamburger IconButton, a navOpen state or a second Drawer copy of the navigation."
31
+ },
32
+ {
33
+ guidance: true,
34
+ description: 'Inside the main column, size content with Grid columns="auto" and Flex wrap so it reflows when the sidebar opens, collapses or becomes a drawer.'
35
+ },
36
+ {
37
+ guidance: true,
38
+ description: 'To show something only when the frame is compact (a logo in the TopBar while the sidebar is a drawer) use className="shavin-frame-compact-only"; to hide it then (a breadcrumb parent), use "shavin-frame-wide-only". Both follow the frame width and compactBelow, never the window, so they stay right in a narrow panel or a Studio preview. Do not use md:hidden or hidden md:block inside an AppFrame.'
39
+ },
40
+ {
41
+ guidance: false,
42
+ description: "Do not use AppFrame for marketing pages or simple single-column sites."
43
+ }
44
+ ]
45
+ },
46
+ examples: [
47
+ {
48
+ title: "Responsive application shell",
49
+ description: "Resize the frame: below 768px wide the Sidebar becomes a drawer and the menu button appears.",
50
+ code: `function Shell() {
51
+ const [view, setView] = React.useState("overview");
52
+ return (
53
+ <div className="h-[420px] overflow-hidden rounded-[var(--radius-panel)] border border-hairline">
54
+ <AppFrame
55
+ className="h-full"
56
+ sidebar={
57
+ <Sidebar width="w-56">
58
+ <SidebarHeader><Text as="span" weight="semibold">Acme</Text></SidebarHeader>
59
+ <SidebarBody>
60
+ <SidebarSection title="Workspace">
61
+ <SidebarNavItem label="Overview" active={view === "overview"} onClick={() => setView("overview")} />
62
+ <SidebarNavItem label="Reports" active={view === "reports"} onClick={() => setView("reports")} />
63
+ </SidebarSection>
64
+ </SidebarBody>
65
+ </Sidebar>
66
+ }
67
+ >
68
+ <TopBar className="gap-2"><SidebarTrigger /><Text as="span" weight="medium">{view}</Text></TopBar>
69
+ <div className="min-h-0 flex-1 overflow-y-auto p-4">
70
+ <Grid columns="auto" minWidth="sm" gap="3"><Card padding="md">One</Card><Card padding="md">Two</Card><Card padding="md">Three</Card></Grid>
71
+ </div>
72
+ </AppFrame>
73
+ </div>
74
+ );
75
+ }`
76
+ }
77
+ ]
78
+ };
79
+ export {
80
+ docs
81
+ };
@@ -0,0 +1,178 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import {
4
+ useCallback,
5
+ useEffect,
6
+ useId,
7
+ useLayoutEffect,
8
+ useMemo,
9
+ useRef,
10
+ useState
11
+ } from "react";
12
+ import { cn } from "../../lib/cn.js";
13
+ import { AppFrameContext } from "./frame-context.js";
14
+ import { useAppFrame } from "./frame-context.js";
15
+ const useIsoLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
16
+ const COMPACT_LIMIT = { md: 768, lg: 1024 };
17
+ const FOCUSABLE = 'a[href],button:not([disabled]),input:not([disabled]),select:not([disabled]),textarea:not([disabled]),[tabindex]:not([tabindex="-1"])';
18
+ function inertProps(on) {
19
+ return on ? { inert: true } : {};
20
+ }
21
+ function AppFrame({ sidebar, children, compactBelow = "md", navLabel = "Navigation", routeKey, className }) {
22
+ const rootRef = useRef(null);
23
+ const navRef = useRef(null);
24
+ const scrimRef = useRef(null);
25
+ const returnFocusRef = useRef(null);
26
+ const navId = useId();
27
+ const mainId = useId();
28
+ const [compact, setCompact] = useState(false);
29
+ const [open, setOpen] = useState(false);
30
+ const limit = COMPACT_LIMIT[compactBelow];
31
+ useIsoLayoutEffect(() => {
32
+ const el = rootRef.current;
33
+ if (!el) return;
34
+ const measure = () => setCompact(el.clientWidth < limit);
35
+ measure();
36
+ if (typeof ResizeObserver === "undefined") return;
37
+ const ro = new ResizeObserver(measure);
38
+ ro.observe(el);
39
+ return () => ro.disconnect();
40
+ }, [limit]);
41
+ const isOpen = compact && open;
42
+ useEffect(() => {
43
+ setOpen(false);
44
+ }, [routeKey]);
45
+ useEffect(() => {
46
+ if (!compact) setOpen(false);
47
+ }, [compact]);
48
+ useEffect(() => {
49
+ if (isOpen) {
50
+ const active = document.activeElement;
51
+ if (!returnFocusRef.current && active instanceof HTMLElement && active !== document.body) returnFocusRef.current = active;
52
+ const nav = navRef.current;
53
+ const target = nav?.querySelector(FOCUSABLE) ?? nav;
54
+ requestAnimationFrame(() => target?.focus({ preventScroll: true }));
55
+ } else if (returnFocusRef.current) {
56
+ const back = returnFocusRef.current;
57
+ returnFocusRef.current = null;
58
+ const active = document.activeElement;
59
+ if (back.isConnected && (!active || active === document.body || navRef.current?.contains(active))) {
60
+ back.focus({ preventScroll: true });
61
+ }
62
+ }
63
+ }, [isOpen]);
64
+ const closeNav = useCallback(() => setOpen(false), []);
65
+ const toggleNav = useCallback(() => setOpen((v) => !v), []);
66
+ const value = useMemo(
67
+ () => ({ compact, open: isOpen, navId, returnFocusRef, setOpen, toggleNav, closeNav }),
68
+ [compact, isOpen, navId, toggleNav, closeNav]
69
+ );
70
+ const drag = useRef(null);
71
+ const clearDrag = () => {
72
+ const nav = navRef.current;
73
+ if (nav) {
74
+ nav.style.transform = "";
75
+ nav.style.transition = "";
76
+ }
77
+ if (scrimRef.current) {
78
+ scrimRef.current.style.opacity = "";
79
+ scrimRef.current.style.transition = "";
80
+ }
81
+ };
82
+ const onPointerDown = (e) => {
83
+ if (!isOpen || e.pointerType !== "touch") return;
84
+ drag.current = { x: e.clientX, y: e.clientY, t: performance.now(), locked: false, dx: 0, w: e.currentTarget.offsetWidth || 1, id: e.pointerId };
85
+ };
86
+ const onPointerMove = (e) => {
87
+ const d = drag.current;
88
+ if (!d) return;
89
+ const dx = e.clientX - d.x;
90
+ const dy = e.clientY - d.y;
91
+ if (!d.locked) {
92
+ if (Math.abs(dy) > 10 && Math.abs(dy) > Math.abs(dx)) {
93
+ drag.current = null;
94
+ return;
95
+ }
96
+ if (dx < -10) {
97
+ d.locked = true;
98
+ try {
99
+ e.currentTarget.setPointerCapture(d.id);
100
+ } catch {
101
+ }
102
+ } else return;
103
+ }
104
+ d.dx = Math.min(0, Math.max(-d.w, dx));
105
+ const nav = navRef.current;
106
+ if (nav) {
107
+ nav.style.transition = "none";
108
+ nav.style.transform = `translateX(${d.dx}px)`;
109
+ }
110
+ if (scrimRef.current) {
111
+ scrimRef.current.style.transition = "none";
112
+ scrimRef.current.style.opacity = String(1 + d.dx / d.w);
113
+ }
114
+ };
115
+ const endDrag = () => {
116
+ const d = drag.current;
117
+ drag.current = null;
118
+ if (!d || !d.locked) return;
119
+ const velocity = d.dx / Math.max(1, performance.now() - d.t);
120
+ clearDrag();
121
+ if (d.dx < -d.w * 0.3 || velocity < -0.5) setOpen(false);
122
+ };
123
+ return /* @__PURE__ */ jsx(AppFrameContext.Provider, { value, children: /* @__PURE__ */ jsxs(
124
+ "div",
125
+ {
126
+ ref: rootRef,
127
+ "data-compact-below": compactBelow,
128
+ "data-compact": compact || void 0,
129
+ className: cn("shavin-frame h-dvh", className),
130
+ onKeyDown: (e) => {
131
+ if (e.key === "Escape" && isOpen) {
132
+ e.stopPropagation();
133
+ setOpen(false);
134
+ }
135
+ },
136
+ children: [
137
+ /* @__PURE__ */ jsx(
138
+ "a",
139
+ {
140
+ href: `#${mainId}`,
141
+ onClick: (e) => {
142
+ e.preventDefault();
143
+ document.getElementById(mainId)?.focus();
144
+ },
145
+ className: "sr-only focus:not-sr-only focus:absolute focus:left-3 focus:top-3 focus:z-[var(--z-floating)] focus:rounded-[var(--radius-lg)] focus:bg-surface focus:px-3 focus:py-2 focus:text-sm focus:text-fg focus:shadow-panel",
146
+ children: "Skip to content"
147
+ }
148
+ ),
149
+ /* @__PURE__ */ jsxs("div", { className: "shavin-frame__inner", children: [
150
+ /* @__PURE__ */ jsx(
151
+ "div",
152
+ {
153
+ ref: navRef,
154
+ id: navId,
155
+ className: "shavin-frame__nav",
156
+ "data-open": isOpen || void 0,
157
+ role: compact ? "dialog" : void 0,
158
+ "aria-modal": isOpen || void 0,
159
+ "aria-label": compact ? navLabel : void 0,
160
+ onPointerDown,
161
+ onPointerMove,
162
+ onPointerUp: endDrag,
163
+ onPointerCancel: endDrag,
164
+ ...inertProps(compact && !isOpen),
165
+ children: sidebar
166
+ }
167
+ ),
168
+ /* @__PURE__ */ jsx("div", { ref: scrimRef, className: "shavin-frame__scrim", "data-open": isOpen || void 0, "aria-hidden": true, onClick: closeNav }),
169
+ /* @__PURE__ */ jsx("main", { id: mainId, tabIndex: -1, className: "flex min-w-0 flex-1 flex-col overflow-hidden outline-none", ...inertProps(isOpen), children })
170
+ ] })
171
+ ]
172
+ }
173
+ ) });
174
+ }
175
+ export {
176
+ AppFrame,
177
+ useAppFrame
178
+ };
@@ -0,0 +1,10 @@
1
+ "use client";
2
+ import { createContext, useContext } from "react";
3
+ const AppFrameContext = createContext(null);
4
+ function useAppFrame() {
5
+ return useContext(AppFrameContext);
6
+ }
7
+ export {
8
+ AppFrameContext,
9
+ useAppFrame
10
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./AppShell.js";
2
+ export * from "./AppShell.doc.js";
@@ -0,0 +1,34 @@
1
+ const docs = {
2
+ name: "AspectRatio",
3
+ group: "layout",
4
+ description: "Keeps its content at a fixed width-to-height ratio, such as 16:9, so images and video hold their space while they load.",
5
+ features: [
6
+ "Built on @radix-ui/react-aspect-ratio",
7
+ "Prevents Cumulative Layout Shift (CLS) on dynamic image and video loads",
8
+ "Configurable ratio prop (e.g. ratio={16 / 9}, ratio={4 / 3})"
9
+ ],
10
+ accessibility: [
11
+ "Maintains DOM container space preserving page scroll position during asset load"
12
+ ],
13
+ usage: {
14
+ bestPractices: [
15
+ {
16
+ guidance: true,
17
+ description: "Use AspectRatio around images, video embeds, and map containers."
18
+ },
19
+ {
20
+ guidance: false,
21
+ description: "Do not leave media elements without aspect ratio preservation \u2014 use AspectRatio to prevent layout shifts."
22
+ }
23
+ ]
24
+ },
25
+ examples: [
26
+ {
27
+ title: "16:9 Video Embed Wrapper",
28
+ code: '<AspectRatio ratio={16 / 9}><Image src="cover.jpg" alt="Video thumbnail" fit="cover" /></AspectRatio>'
29
+ }
30
+ ]
31
+ };
32
+ export {
33
+ docs
34
+ };
@@ -0,0 +1,5 @@
1
+ import * as AspectRatioPrimitive from "@radix-ui/react-aspect-ratio";
2
+ const AspectRatio = AspectRatioPrimitive.Root;
3
+ export {
4
+ AspectRatio
5
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./AspectRatio.js";
2
+ export * from "./AspectRatio.doc.js";
@@ -0,0 +1,40 @@
1
+ const docs = {
2
+ name: "Avatar",
3
+ description: "A picture of a person or team. Without an image it shows initials, an icon or a default person icon, in a neutral or coloured fill.",
4
+ features: [
5
+ "Sizes: sm (28px), md (36px), lg (56px), xl (96px)",
6
+ "Supports radius escape hatch (radius='none|small|medium|large|full|inherit')",
7
+ "Defaults to rounded-full shape per Radix Themes avatar design convention",
8
+ "Flicker-free fallback delay handling via Radix Avatar",
9
+ "Colour fallbacks for projects, workspaces and teams: color='brand|success|warning|danger' with variant='soft|solid', plus fallbackIcon"
10
+ ],
11
+ accessibility: [
12
+ "Provides screen reader accessible alt text",
13
+ "Displays initials or user icon fallback when image fails to load"
14
+ ],
15
+ usage: {
16
+ bestPractices: [
17
+ {
18
+ guidance: true,
19
+ description: "Always pass initials (e.g. fallback='JD') or an alt label for screen readers."
20
+ },
21
+ {
22
+ guidance: false,
23
+ description: "Do not force radius='none' globally on avatars unless rendering a square badge or logo tile."
24
+ }
25
+ ]
26
+ },
27
+ examples: [
28
+ {
29
+ title: "User Avatar with Initials Fallback",
30
+ code: '<Avatar src="https://images.unsplash.com/photo-1534528741775-53994a69daeb?w=100" fallback="JD" size="md" />'
31
+ },
32
+ {
33
+ title: "Icon avatar with a colour fill (projects, workspaces)",
34
+ code: '<Flex gap="3"><Avatar radius="medium" color="brand" variant="solid" fallbackIcon={<Icon name="globe" size="sm" color="inherit" />} /><Avatar radius="medium" color="success" fallbackIcon={<Icon name="smartphone" size="sm" color="inherit" />} /><Avatar radius="medium" color="warning" fallback="DS" /></Flex>'
35
+ }
36
+ ]
37
+ };
38
+ export {
39
+ docs
40
+ };