@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,11 @@
1
+ "use client";
2
+ import { useEffect, useState } from "react";
3
+ function useClientLocale(locale) {
4
+ const [mounted, setMounted] = useState(false);
5
+ useEffect(() => setMounted(true), []);
6
+ if (locale) return locale;
7
+ return mounted ? void 0 : "en-US";
8
+ }
9
+ export {
10
+ useClientLocale
11
+ };
@@ -0,0 +1,15 @@
1
+ "use client";
2
+ import { useEffect, useRef } from "react";
3
+ import { announce, fieldErrorAnnouncementsSilenced } from "./announce.js";
4
+ function useFieldErrorAnnouncement(error, enabled = true) {
5
+ const prev = useRef(void 0);
6
+ useEffect(() => {
7
+ const had = Boolean(prev.current);
8
+ prev.current = error;
9
+ if (!error || had || !enabled || fieldErrorAnnouncementsSilenced()) return;
10
+ announce(error, "polite");
11
+ }, [error, enabled]);
12
+ }
13
+ export {
14
+ useFieldErrorAnnouncement
15
+ };
@@ -0,0 +1,17 @@
1
+ "use client";
2
+ import { useEffect, useState } from "react";
3
+ function useReducedMotion() {
4
+ const [reduced, setReduced] = useState(false);
5
+ useEffect(() => {
6
+ if (typeof window === "undefined" || !window.matchMedia) return;
7
+ const mq = window.matchMedia("(prefers-reduced-motion: reduce)");
8
+ setReduced(mq.matches);
9
+ const on = (e) => setReduced(e.matches);
10
+ mq.addEventListener?.("change", on);
11
+ return () => mq.removeEventListener?.("change", on);
12
+ }, []);
13
+ return reduced;
14
+ }
15
+ export {
16
+ useReducedMotion
17
+ };
@@ -0,0 +1,313 @@
1
+ import {
2
+ useCallback,
3
+ useEffect,
4
+ useLayoutEffect,
5
+ useMemo,
6
+ useRef,
7
+ useState
8
+ } from "react";
9
+ const ALL_EDGES = ["top", "right", "bottom", "left", "top-left", "top-right", "bottom-left", "bottom-right"];
10
+ function resolveResizeEdges(edges) {
11
+ if (!edges) return [];
12
+ if (edges === true || edges === "both") return ["right", "bottom", "bottom-right"];
13
+ if (edges === "x") return ["left", "right"];
14
+ if (edges === "y") return ["top", "bottom"];
15
+ const list = Array.isArray(edges) ? edges : [edges];
16
+ return ALL_EDGES.filter((e) => list.includes(e));
17
+ }
18
+ function edgeAxes(edge) {
19
+ return {
20
+ x: edge.includes("right") ? 1 : edge.includes("left") ? -1 : 0,
21
+ y: edge.includes("bottom") ? 1 : edge.includes("top") ? -1 : 0
22
+ };
23
+ }
24
+ function trackResizeThumb(handle, edge, clientX, clientY) {
25
+ const axes = edgeAxes(edge);
26
+ if (axes.x && axes.y) return;
27
+ const rect = handle.getBoundingClientRect();
28
+ const along = axes.x ? (clientY - rect.top) / (handle.offsetHeight ? rect.height / handle.offsetHeight : 1) : (clientX - rect.left) / (handle.offsetWidth ? rect.width / handle.offsetWidth : 1);
29
+ handle.style.setProperty("--resize-thumb", `${Math.round(along)}px`);
30
+ }
31
+ function resizeCursor(edge) {
32
+ if (edge === "left" || edge === "right") return "ew-resize";
33
+ if (edge === "top" || edge === "bottom") return "ns-resize";
34
+ return edge === "top-left" || edge === "bottom-right" ? "nwse-resize" : "nesw-resize";
35
+ }
36
+ const clamp = (value, min, max) => Math.min(max ?? Infinity, Math.max(min ?? 0, value));
37
+ const storageKey = (key) => `shavin:resize:${key}`;
38
+ function readStored(key) {
39
+ try {
40
+ const raw = window.localStorage.getItem(storageKey(key));
41
+ const parsed = raw ? JSON.parse(raw) : null;
42
+ if (!parsed || typeof parsed !== "object") return null;
43
+ const out = {};
44
+ if (typeof parsed.width === "number") out.width = parsed.width;
45
+ if (typeof parsed.height === "number") out.height = parsed.height;
46
+ return out.width !== void 0 || out.height !== void 0 ? out : null;
47
+ } catch {
48
+ return null;
49
+ }
50
+ }
51
+ function writeStored(key, size) {
52
+ try {
53
+ if (size) window.localStorage.setItem(storageKey(key), JSON.stringify(size));
54
+ else window.localStorage.removeItem(storageKey(key));
55
+ } catch {
56
+ }
57
+ }
58
+ function cornerRadius(value, width, height) {
59
+ const first = value.trim().split(/\s+/)[0] ?? "0";
60
+ const n = parseFloat(first);
61
+ if (!Number.isFinite(n)) return 0;
62
+ return first.endsWith("%") ? n / 100 * Math.min(width, height) : n;
63
+ }
64
+ function readRadii(el, width, height) {
65
+ const cs = getComputedStyle(el);
66
+ const cap = Math.min(width, height) / 2;
67
+ const r = (v) => Math.round(Math.min(cap, cornerRadius(v, width, height)) * 10) / 10;
68
+ return {
69
+ topLeft: r(cs.borderTopLeftRadius),
70
+ topRight: r(cs.borderTopRightRadius),
71
+ bottomRight: r(cs.borderBottomRightRadius),
72
+ bottomLeft: r(cs.borderBottomLeftRadius)
73
+ };
74
+ }
75
+ const sameRadii = (a, b) => !!a && a.topLeft === b.topLeft && a.topRight === b.topRight && a.bottomRight === b.bottomRight && a.bottomLeft === b.bottomLeft;
76
+ const useIsoLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
77
+ function useResizable(options = {}) {
78
+ const { edges: edgesOption, minWidth, maxWidth, minHeight, maxHeight, step = 16, disabled, persistKey } = options;
79
+ const edgeKey = Array.isArray(edgesOption) ? edgesOption.join(",") : String(edgesOption ?? "");
80
+ const edges = useMemo(() => resolveResizeEdges(edgesOption), [edgeKey]);
81
+ const enabled = edges.length > 0 && !disabled;
82
+ const elementRef = useRef(null);
83
+ const [node, setNode] = useState(null);
84
+ const ref = useCallback((el) => {
85
+ elementRef.current = el;
86
+ setNode(el);
87
+ }, []);
88
+ const [size, setSize] = useState(null);
89
+ const [measured, setMeasured] = useState(null);
90
+ const [radii, setRadii] = useState(null);
91
+ const [activeEdge, setActiveEdge] = useState(null);
92
+ const optionsRef = useRef(options);
93
+ optionsRef.current = options;
94
+ const sizeRef = useRef(size);
95
+ sizeRef.current = size;
96
+ const endDragRef = useRef(null);
97
+ useEffect(() => {
98
+ if (!persistKey) return;
99
+ const stored = readStored(persistKey);
100
+ if (stored) setSize(stored);
101
+ }, [persistKey]);
102
+ useIsoLayoutEffect(() => {
103
+ if (!enabled || !node) return;
104
+ const update = () => {
105
+ const next = { width: node.offsetWidth, height: node.offsetHeight };
106
+ setMeasured((prev) => prev && prev.width === next.width && prev.height === next.height ? prev : next);
107
+ const nextRadii = readRadii(node, next.width, next.height);
108
+ setRadii((prev) => sameRadii(prev, nextRadii) ? prev : nextRadii);
109
+ };
110
+ update();
111
+ if (typeof ResizeObserver === "undefined") return;
112
+ const observer = new ResizeObserver(update);
113
+ observer.observe(node);
114
+ return () => observer.disconnect();
115
+ }, [enabled, node]);
116
+ useEffect(() => () => endDragRef.current?.(), []);
117
+ const computeSize = useCallback(
118
+ (start, dx, dy, edge, applySnap) => {
119
+ const o = optionsRef.current;
120
+ const axes = edgeAxes(edge);
121
+ const round = (v) => applySnap && o.snap ? Math.round(v / o.snap) * o.snap : v;
122
+ let width = axes.x ? round(start.width + axes.x * dx) : void 0;
123
+ let height = axes.y ? round(start.height + axes.y * dy) : void 0;
124
+ if (o.lockAspectRatio && start.height > 0) {
125
+ const ratio = start.width / start.height;
126
+ if (width !== void 0 && (height === void 0 || Math.abs(dx) >= Math.abs(dy))) height = width / ratio;
127
+ else if (height !== void 0) width = height * ratio;
128
+ }
129
+ const next = {};
130
+ if (width !== void 0) next.width = Math.round(clamp(width, o.minWidth, o.maxWidth));
131
+ if (height !== void 0) next.height = Math.round(clamp(height, o.minHeight, o.maxHeight));
132
+ return next;
133
+ },
134
+ []
135
+ );
136
+ const commit = useCallback((next, final) => {
137
+ const merged = { ...sizeRef.current, ...next };
138
+ sizeRef.current = merged;
139
+ setSize(merged);
140
+ const el = elementRef.current;
141
+ const full = {
142
+ width: merged.width ?? el?.offsetWidth ?? 0,
143
+ height: merged.height ?? el?.offsetHeight ?? 0
144
+ };
145
+ const o = optionsRef.current;
146
+ o.onResize?.(full);
147
+ if (final) {
148
+ if (o.persistKey) writeStored(o.persistKey, merged);
149
+ o.onResizeEnd?.(full);
150
+ }
151
+ }, []);
152
+ const reset = useCallback(() => {
153
+ sizeRef.current = null;
154
+ setSize(null);
155
+ if (optionsRef.current.persistKey) writeStored(optionsRef.current.persistKey, null);
156
+ }, []);
157
+ const startDrag = useCallback(
158
+ (edge, event) => {
159
+ const el = elementRef.current;
160
+ if (!el || event.button !== 0) return;
161
+ event.preventDefault();
162
+ event.stopPropagation();
163
+ const rect = el.getBoundingClientRect();
164
+ const scaleX = el.offsetWidth ? rect.width / el.offsetWidth : 1;
165
+ const scaleY = el.offsetHeight ? rect.height / el.offsetHeight : 1;
166
+ const start = { width: el.offsetWidth, height: el.offsetHeight };
167
+ const startX = event.clientX;
168
+ const startY = event.clientY;
169
+ const handle = event.currentTarget;
170
+ trackResizeThumb(handle, edge, startX, startY);
171
+ const overlay = document.createElement("div");
172
+ overlay.setAttribute("data-shavin-resize-overlay", "");
173
+ Object.assign(overlay.style, { position: "fixed", inset: "0", zIndex: "2147483647", cursor: resizeCursor(edge) });
174
+ document.body.appendChild(overlay);
175
+ const prevUserSelect = document.body.style.userSelect;
176
+ document.body.style.userSelect = "none";
177
+ let frame = 0;
178
+ let pending = null;
179
+ const flush = () => {
180
+ frame = 0;
181
+ if (pending) commit(pending, false);
182
+ };
183
+ const onMove = (e) => {
184
+ trackResizeThumb(handle, edge, e.clientX, e.clientY);
185
+ pending = computeSize(start, (e.clientX - startX) / scaleX, (e.clientY - startY) / scaleY, edge, true);
186
+ if (!frame) frame = requestAnimationFrame(flush);
187
+ };
188
+ const end = () => {
189
+ window.removeEventListener("pointermove", onMove);
190
+ window.removeEventListener("pointerup", end);
191
+ window.removeEventListener("pointercancel", end);
192
+ if (frame) cancelAnimationFrame(frame);
193
+ overlay.remove();
194
+ document.body.style.userSelect = prevUserSelect;
195
+ handle.style.removeProperty("--resize-thumb");
196
+ endDragRef.current = null;
197
+ setActiveEdge(null);
198
+ if (pending) commit(pending, true);
199
+ };
200
+ window.addEventListener("pointermove", onMove);
201
+ window.addEventListener("pointerup", end);
202
+ window.addEventListener("pointercancel", end);
203
+ endDragRef.current = end;
204
+ setActiveEdge(edge);
205
+ },
206
+ [commit, computeSize]
207
+ );
208
+ const onKey = useCallback(
209
+ (edge, event) => {
210
+ const el = elementRef.current;
211
+ if (!el) return;
212
+ const o = optionsRef.current;
213
+ const axes = edgeAxes(edge);
214
+ const start = { width: el.offsetWidth, height: el.offsetHeight };
215
+ const amount = (o.step ?? 16) * (event.shiftKey ? 4 : 1);
216
+ let next = null;
217
+ switch (event.key) {
218
+ // Arrows move the focused edge in their direction: ArrowRight grows a right
219
+ // edge and shrinks a left one.
220
+ case "ArrowLeft":
221
+ case "ArrowRight":
222
+ if (axes.x) next = computeSize(start, event.key === "ArrowRight" ? amount : -amount, 0, edge, false);
223
+ break;
224
+ case "ArrowUp":
225
+ case "ArrowDown":
226
+ if (axes.y) next = computeSize(start, 0, event.key === "ArrowDown" ? amount : -amount, edge, false);
227
+ break;
228
+ case "Home":
229
+ next = {};
230
+ if (axes.x && o.minWidth !== void 0) next.width = o.minWidth;
231
+ if (axes.y && o.minHeight !== void 0) next.height = o.minHeight;
232
+ break;
233
+ case "End":
234
+ next = {};
235
+ if (axes.x && o.maxWidth !== void 0) next.width = o.maxWidth;
236
+ if (axes.y && o.maxHeight !== void 0) next.height = o.maxHeight;
237
+ break;
238
+ case "Enter":
239
+ event.preventDefault();
240
+ reset();
241
+ return;
242
+ default:
243
+ return;
244
+ }
245
+ if (!next || next.width === void 0 && next.height === void 0) return;
246
+ event.preventDefault();
247
+ commit(next, true);
248
+ },
249
+ [commit, computeSize, reset]
250
+ );
251
+ const getHandleProps = useCallback(
252
+ (edge) => {
253
+ const axes = edgeAxes(edge);
254
+ const horizontal = axes.x !== 0;
255
+ const corner = axes.x !== 0 && axes.y !== 0;
256
+ return {
257
+ role: "separator",
258
+ tabIndex: 0,
259
+ "aria-label": corner ? "Resize" : horizontal ? "Resize width" : "Resize height",
260
+ // A separator between left/right content is a vertical line.
261
+ "aria-orientation": corner ? void 0 : horizontal ? "vertical" : "horizontal",
262
+ "aria-valuenow": horizontal ? measured?.width : measured?.height,
263
+ "aria-valuemin": horizontal ? minWidth : minHeight,
264
+ "aria-valuemax": horizontal ? maxWidth : maxHeight,
265
+ "data-edge": edge,
266
+ "data-resizing": activeEdge === edge ? "" : void 0,
267
+ onPointerDown: (e) => startDrag(edge, e),
268
+ onKeyDown: (e) => onKey(edge, e),
269
+ onDoubleClick: reset
270
+ };
271
+ },
272
+ [activeEdge, maxHeight, maxWidth, measured, minHeight, minWidth, onKey, reset, startDrag]
273
+ );
274
+ const style = useMemo(() => {
275
+ if (!enabled) return {};
276
+ const s = {};
277
+ if (size?.width !== void 0) s.width = size.width;
278
+ if (size?.height !== void 0) s.height = size.height;
279
+ if (minWidth !== void 0) s.minWidth = minWidth;
280
+ if (maxWidth !== void 0) s.maxWidth = maxWidth;
281
+ if (minHeight !== void 0) s.minHeight = minHeight;
282
+ if (maxHeight !== void 0) s.maxHeight = maxHeight;
283
+ return s;
284
+ }, [enabled, size, minWidth, maxWidth, minHeight, maxHeight]);
285
+ return {
286
+ ref,
287
+ enabled,
288
+ edges: enabled ? edges : [],
289
+ size,
290
+ measured,
291
+ radii,
292
+ style,
293
+ isResizing: activeEdge !== null,
294
+ activeEdge,
295
+ getHandleProps,
296
+ reset
297
+ };
298
+ }
299
+ function useMergedRef(...refs) {
300
+ return useCallback((value) => {
301
+ for (const r of refs) {
302
+ if (typeof r === "function") r(value);
303
+ else if (r) r.current = value;
304
+ }
305
+ }, refs);
306
+ }
307
+ export {
308
+ resizeCursor,
309
+ resolveResizeEdges,
310
+ trackResizeThumb,
311
+ useMergedRef,
312
+ useResizable
313
+ };
@@ -0,0 +1,24 @@
1
+ "use client";
2
+ import { useCallback, useLayoutEffect, useRef } from "react";
3
+ function useReturnFocus(open, hasTrigger = false) {
4
+ const previous = useRef(null);
5
+ useLayoutEffect(() => {
6
+ if (open && typeof document !== "undefined") {
7
+ previous.current = document.activeElement instanceof HTMLElement ? document.activeElement : null;
8
+ }
9
+ }, [open]);
10
+ return useCallback(
11
+ (event) => {
12
+ if (hasTrigger) return;
13
+ const el = previous.current;
14
+ if (el && el.isConnected && el !== document.body) {
15
+ event.preventDefault();
16
+ el.focus();
17
+ }
18
+ },
19
+ [hasTrigger]
20
+ );
21
+ }
22
+ export {
23
+ useReturnFocus
24
+ };
@@ -0,0 +1,56 @@
1
+ "use client";
2
+ import { useCallback, useEffect, useRef, useState } from "react";
3
+ function useSlidingIndicator({
4
+ enabled,
5
+ orientation = "horizontal",
6
+ activeSelector
7
+ }) {
8
+ const ref = useRef(null);
9
+ const indicatorRef = useRef(null);
10
+ const [state, setState] = useState({ pos: 0, size: 0, on: false, ready: false });
11
+ const horizontal = orientation !== "vertical";
12
+ const measure = useCallback(() => {
13
+ const root = ref.current;
14
+ if (!root) return;
15
+ const el = root.querySelector(activeSelector);
16
+ if (!el) {
17
+ setState((s) => ({ ...s, on: false }));
18
+ return;
19
+ }
20
+ const ind = indicatorRef.current;
21
+ const base = ind ? horizontal ? ind.offsetLeft : ind.offsetTop : 0;
22
+ setState((s) => ({
23
+ pos: (horizontal ? el.offsetLeft : el.offsetTop) - base,
24
+ size: horizontal ? el.offsetWidth : el.offsetHeight,
25
+ on: true,
26
+ ready: s.on || s.ready
27
+ }));
28
+ }, [horizontal, activeSelector]);
29
+ useEffect(() => {
30
+ if (!enabled) return;
31
+ const root = ref.current;
32
+ if (!root) return;
33
+ measure();
34
+ const ro = new ResizeObserver(() => measure());
35
+ const observeAll = () => {
36
+ ro.disconnect();
37
+ ro.observe(root);
38
+ for (const child of Array.from(root.children)) ro.observe(child);
39
+ };
40
+ observeAll();
41
+ const mo = new MutationObserver(() => {
42
+ observeAll();
43
+ measure();
44
+ });
45
+ mo.observe(root, { attributes: true, childList: true, subtree: true, attributeFilter: ["data-state"] });
46
+ return () => {
47
+ mo.disconnect();
48
+ ro.disconnect();
49
+ };
50
+ }, [enabled, measure]);
51
+ const transitionClass = state.ready ? "transition-[transform,width,height] duration-200 ease-[cubic-bezier(0.4,0,0.2,1)] motion-reduce:transition-none" : "";
52
+ return { ref, indicatorRef, pos: state.pos, size: state.size, on: state.on, transitionClass };
53
+ }
54
+ export {
55
+ useSlidingIndicator
56
+ };
@@ -0,0 +1,37 @@
1
+ import * as class_variance_authority_types from 'class-variance-authority/types';
2
+ import * as React from 'react';
3
+ import { PanelProps as PanelProps$1, GroupProps, LayoutStorage, SeparatorProps } from 'react-resizable-panels';
4
+ export { GroupImperativeHandle, PanelImperativeHandle, Layout as PanelLayout, LayoutStorage as PanelLayoutStorage, useGroupRef, usePanelRef } from 'react-resizable-panels';
5
+ import { VariantProps } from 'class-variance-authority';
6
+
7
+ interface PanelGroupProps extends GroupProps {
8
+ /** Split direction: "horizontal" puts panels side by side, "vertical" stacks them. Default "horizontal". */
9
+ orientation?: "horizontal" | "vertical";
10
+ /** Remember the layout under this key (saved after the user resizes). Panels need stable `id`s. */
11
+ persistKey?: string;
12
+ /** Where `persistKey` saves the layout. Default localStorage. For SSR without a layout jump, read the layout from a cookie on the server and pass it as `defaultLayout`. */
13
+ storage?: LayoutStorage;
14
+ }
15
+ /**
16
+ * Panes that trade space with each other. Import from "@shavin/ui/panels".
17
+ * For a single element that resizes itself, use the `resizable` prop on Box / Flex / Card.
18
+ */
19
+ declare function PanelGroup({ persistKey, storage, defaultLayout, onLayoutChanged, groupRef, elementRef, className, onPointerMove, ...props }: PanelGroupProps): React.JSX.Element;
20
+ interface PanelProps extends PanelProps$1 {
21
+ /** Stable id; required for `persistKey` and imperative APIs. */
22
+ id?: string;
23
+ }
24
+ /**
25
+ * One pane of a PanelGroup. Sizes: numbers are px, unitless strings are %, or use "px", "%", "rem", "vh", "vw".
26
+ */
27
+ declare function Panel({ className, ...props }: PanelProps): React.JSX.Element;
28
+ declare const panelHandleVariants: (props?: ({
29
+ variant?: "line" | "grip" | "invisible" | null | undefined;
30
+ color?: "brand" | "neutral" | "brand-subtle" | null | undefined;
31
+ } & class_variance_authority_types.ClassProp) | undefined) => string;
32
+ interface PanelHandleProps extends Omit<SeparatorProps, "color">, VariantProps<typeof panelHandleVariants> {
33
+ }
34
+ /** Resize handle between two Panels. Must be a direct child of PanelGroup. */
35
+ declare function PanelHandle({ variant, color, className, ...props }: PanelHandleProps): React.JSX.Element;
36
+
37
+ export { Panel, PanelGroup, type PanelGroupProps, PanelHandle, type PanelHandleProps, type PanelProps, panelHandleVariants };
package/dist/panels.js ADDED
@@ -0,0 +1,19 @@
1
+ "use client";
2
+ import {
3
+ PanelGroup,
4
+ Panel,
5
+ PanelHandle,
6
+ panelHandleVariants
7
+ } from "./primitives/PanelGroup/PanelGroup.js";
8
+ import {
9
+ usePanelRef,
10
+ useGroupRef
11
+ } from "react-resizable-panels";
12
+ export {
13
+ Panel,
14
+ PanelGroup,
15
+ PanelHandle,
16
+ panelHandleVariants,
17
+ useGroupRef,
18
+ usePanelRef
19
+ };
@@ -0,0 +1,37 @@
1
+ const docs = {
2
+ name: "Accordion",
3
+ description: "Sections that expand and collapse under a heading. Allow one open at a time or several, in default, outline or ghost styles.",
4
+ features: [
5
+ "Variants: default (divided list), outline, ghost",
6
+ "Supports type='single' and type='multiple' modes",
7
+ "ChevronDown indicator rotates 180 degrees when open per AGENTS.md rule",
8
+ "Uses panel radius --radius-panel for container geometry"
9
+ ],
10
+ accessibility: [
11
+ "Built on WAI-ARIA Disclosure & Accordion pattern with role='region'",
12
+ "Keyboard navigation via Arrow keys, Home, and End",
13
+ "Space/Enter toggles expand/collapse state"
14
+ ],
15
+ keyboard: "Up/Down arrows to move focus, Space/Enter to expand panel",
16
+ usage: {
17
+ bestPractices: [
18
+ {
19
+ guidance: true,
20
+ description: "Use Accordion for grouping secondary FAQs, settings sections, or dense collapsible details."
21
+ },
22
+ {
23
+ guidance: false,
24
+ description: "Do not use ChevronRight for accordion triggers \u2014 use ChevronDown with 180deg rotation per section 4 convention."
25
+ }
26
+ ]
27
+ },
28
+ examples: [
29
+ {
30
+ title: "Collapsible FAQ Accordion",
31
+ code: '<Accordion type="single" collapsible><AccordionItem value="1"><AccordionTrigger>What is @shavin/ui?</AccordionTrigger><AccordionContent>Enterprise React design system engine.</AccordionContent></AccordionItem></Accordion>'
32
+ }
33
+ ]
34
+ };
35
+ export {
36
+ docs
37
+ };
@@ -0,0 +1,87 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { forwardRef } from "react";
4
+ import * as RadixAccordion from "@radix-ui/react-accordion";
5
+ import { cva } from "class-variance-authority";
6
+ import { cn } from "../../lib/cn.js";
7
+ const accordionVariants = cva("w-full", {
8
+ variants: {
9
+ variant: {
10
+ default: "divide-y divide-hairline border-y border-hairline",
11
+ outline: "space-y-2",
12
+ ghost: "space-y-0.5"
13
+ }
14
+ },
15
+ defaultVariants: {
16
+ variant: "default"
17
+ }
18
+ });
19
+ const Accordion = forwardRef(
20
+ ({ className, variant, ...props }, ref) => /* @__PURE__ */ jsx(
21
+ RadixAccordion.Root,
22
+ {
23
+ ref,
24
+ className: cn(accordionVariants({ variant }), className),
25
+ ...props
26
+ }
27
+ )
28
+ );
29
+ Accordion.displayName = "Accordion";
30
+ const AccordionItem = forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx(
31
+ RadixAccordion.Item,
32
+ {
33
+ ref,
34
+ className: cn("transition-colors", className),
35
+ ...props
36
+ }
37
+ ));
38
+ AccordionItem.displayName = "AccordionItem";
39
+ const AccordionTrigger = forwardRef(({ className, children, headingLevel = 3, ...props }, ref) => {
40
+ const HeadingTag = `h${headingLevel}`;
41
+ return /* @__PURE__ */ jsx(RadixAccordion.Header, { asChild: true, children: /* @__PURE__ */ jsx(HeadingTag, { className: "flex", children: /* @__PURE__ */ jsxs(
42
+ RadixAccordion.Trigger,
43
+ {
44
+ ref,
45
+ className: cn(
46
+ "flex flex-1 items-center justify-between py-3 text-sm font-medium text-fg transition cursor-pointer hover:text-fg [&[data-state=open]>svg]:rotate-180",
47
+ className
48
+ ),
49
+ ...props,
50
+ children: [
51
+ children,
52
+ /* @__PURE__ */ jsx(
53
+ "svg",
54
+ {
55
+ viewBox: "0 0 24 24",
56
+ className: "h-4 w-4 shrink-0 text-fg-subtle transition-transform duration-200",
57
+ fill: "none",
58
+ stroke: "currentColor",
59
+ strokeWidth: "1.8",
60
+ strokeLinecap: "round",
61
+ strokeLinejoin: "round",
62
+ "aria-hidden": "true",
63
+ children: /* @__PURE__ */ jsx("polyline", { points: "6 9 12 15 18 9" })
64
+ }
65
+ )
66
+ ]
67
+ }
68
+ ) }) });
69
+ });
70
+ AccordionTrigger.displayName = "AccordionTrigger";
71
+ const AccordionContent = forwardRef(({ className, children, ...props }, ref) => /* @__PURE__ */ jsx(
72
+ RadixAccordion.Content,
73
+ {
74
+ ref,
75
+ className: "shavin-accordion-content overflow-hidden text-sm",
76
+ ...props,
77
+ children: /* @__PURE__ */ jsx("div", { className: cn("pt-0 pb-4 text-fg-muted", className), children })
78
+ }
79
+ ));
80
+ AccordionContent.displayName = "AccordionContent";
81
+ export {
82
+ Accordion,
83
+ AccordionContent,
84
+ AccordionItem,
85
+ AccordionTrigger,
86
+ accordionVariants
87
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./Accordion.js";
2
+ export * from "./Accordion.doc.js";
@@ -0,0 +1,37 @@
1
+ const docs = {
2
+ name: "ActionBar",
3
+ description: "Floating action bar pill for canvas tools, block insertion, and rich editor controls with searchable popovers.",
4
+ features: [
5
+ "Searchable action group popovers opening above the toolbar",
6
+ "Keyword alias filtering per action item",
7
+ "Uses panel radius --radius-panel for container bar geometry and control radius --radius-lg for action triggers",
8
+ "Single active popover state handling"
9
+ ],
10
+ accessibility: [
11
+ "Renders native <div role='toolbar'> container",
12
+ "Auto-focuses search input when action group popover opens",
13
+ "Enter key triggers top filtered action match; Escape dismisses popover"
14
+ ],
15
+ keyboard: "Type to search options, Enter to select top match, Escape to dismiss",
16
+ usage: {
17
+ bestPractices: [
18
+ {
19
+ guidance: true,
20
+ description: "Use ActionBar for canvas editing tools (e.g. Add Component, Theme Switcher, Zoom Controls)."
21
+ },
22
+ {
23
+ guidance: false,
24
+ description: "Do not use ActionBar for primary page navigation \u2014 reach for TopBar or Tabs instead."
25
+ }
26
+ ]
27
+ },
28
+ examples: [
29
+ {
30
+ title: "Canvas Action Bar",
31
+ code: '<ActionBar groups={[{ key: "add", label: "Add Block", items: [{ value: "hero", label: "Hero Section" }, { value: "pricing", label: "Pricing Table" }] }]} onAction={() => {}} />'
32
+ }
33
+ ]
34
+ };
35
+ export {
36
+ docs
37
+ };