@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,85 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { useEffect, useMemo, useRef } from "react";
4
+ import { cn } from "../../lib/cn.js";
5
+ import { getMurmurState, makeDots } from "./engine.js";
6
+ function Murmur({ state = "thinking", size = 24, level = 0, speed = 1, dots, dotSize = 0.4, label, className, style, ...props }) {
7
+ const canvas = useRef(null);
8
+ const live = useRef({ state, level, speed, dotSize });
9
+ live.current = { state, level, speed, dotSize };
10
+ const count = dots ?? Math.max(32, Math.min(200, Math.round(size * 1.8)));
11
+ const swarm = useMemo(() => makeDots(count), [count]);
12
+ useEffect(() => {
13
+ const el = canvas.current;
14
+ const ctx = el?.getContext("2d");
15
+ if (!el || !ctx) return;
16
+ const dpr = Math.min(window.devicePixelRatio || 1, 2);
17
+ el.width = Math.round(size * dpr);
18
+ el.height = Math.round(size * dpr);
19
+ const reduced = window.matchMedia("(prefers-reduced-motion: reduce)").matches;
20
+ const out = { x: 0, y: 0, z: 0, size: 1, alpha: 1 };
21
+ let raf = 0;
22
+ let visible = true;
23
+ let color = "";
24
+ let colorAt = -1e9;
25
+ const start = performance.now();
26
+ const draw = (now) => {
27
+ if (now - colorAt > 500) {
28
+ color = getComputedStyle(el).color;
29
+ colorAt = now;
30
+ }
31
+ const { state: s, level: l, speed: sp, dotSize: ds } = live.current;
32
+ const fn = getMurmurState(s);
33
+ const frame = { t: reduced ? 0 : now - start, level: l, speed: sp };
34
+ const c = size / 2;
35
+ const R = c * 0.78;
36
+ const base = (0.3 + size * 0.022) * 0.8 * ds;
37
+ ctx.setTransform(dpr, 0, 0, dpr, 0, 0);
38
+ ctx.clearRect(0, 0, size, size);
39
+ ctx.fillStyle = color;
40
+ for (const d of swarm) {
41
+ fn(d, frame, out);
42
+ const persp = 1 / (1 - out.z * 0.3);
43
+ const depth = 0.55 + 0.45 * ((out.z + 1.2) / 2.4);
44
+ ctx.globalAlpha = Math.max(0, Math.min(1, out.alpha * depth));
45
+ ctx.beginPath();
46
+ ctx.arc(c + out.x * R * persp, c + out.y * R * persp, Math.max(0.25, base * out.size * persp), 0, Math.PI * 2);
47
+ ctx.fill();
48
+ }
49
+ ctx.globalAlpha = 1;
50
+ };
51
+ const loop = (now) => {
52
+ if (visible) draw(now);
53
+ raf = requestAnimationFrame(loop);
54
+ };
55
+ if (reduced) {
56
+ draw(performance.now());
57
+ } else {
58
+ raf = requestAnimationFrame(loop);
59
+ }
60
+ const io = typeof IntersectionObserver !== "undefined" ? new IntersectionObserver(([e]) => {
61
+ visible = e.isIntersecting;
62
+ }) : null;
63
+ io?.observe(el);
64
+ return () => {
65
+ cancelAnimationFrame(raf);
66
+ io?.disconnect();
67
+ };
68
+ }, [size, swarm, state]);
69
+ const name = label ?? state.charAt(0).toUpperCase() + state.slice(1);
70
+ return /* @__PURE__ */ jsx(
71
+ "span",
72
+ {
73
+ role: name ? "img" : void 0,
74
+ "aria-label": name || void 0,
75
+ "aria-hidden": name ? void 0 : true,
76
+ className: cn("inline-flex shrink-0 align-middle text-brand-contrast", className),
77
+ style: { width: size, height: size, ...style },
78
+ ...props,
79
+ children: /* @__PURE__ */ jsx("canvas", { ref: canvas, style: { width: size, height: size }, "aria-hidden": true })
80
+ }
81
+ );
82
+ }
83
+ export {
84
+ Murmur
85
+ };
@@ -0,0 +1,163 @@
1
+ function rotateY(o, a) {
2
+ const c = Math.cos(a);
3
+ const s = Math.sin(a);
4
+ const x = o.x * c + o.z * s;
5
+ o.z = -o.x * s + o.z * c;
6
+ o.x = x;
7
+ }
8
+ function rotateX(o, a) {
9
+ const c = Math.cos(a);
10
+ const s = Math.sin(a);
11
+ const y = o.y * c - o.z * s;
12
+ o.z = o.y * s + o.z * c;
13
+ o.y = y;
14
+ }
15
+ function place(dot, o, radius = 1) {
16
+ o.x = dot.x * radius;
17
+ o.y = dot.y * radius;
18
+ o.z = dot.z * radius;
19
+ o.size = 1;
20
+ o.alpha = 1;
21
+ }
22
+ function makeDots(count) {
23
+ const golden = Math.PI * (3 - Math.sqrt(5));
24
+ let seed = 7;
25
+ const rand = () => {
26
+ seed = seed * 16807 % 2147483647;
27
+ return seed / 2147483647;
28
+ };
29
+ return Array.from({ length: count }, (_, i) => {
30
+ const y = 1 - i / Math.max(1, count - 1) * 2;
31
+ const r = Math.sqrt(1 - y * y);
32
+ const a = golden * i;
33
+ return { x: Math.cos(a) * r, y, z: Math.sin(a) * r, phase: rand() * Math.PI * 2, index: i / Math.max(1, count - 1) };
34
+ });
35
+ }
36
+ const spin = (x, z, a) => {
37
+ const c = Math.cos(a), s = Math.sin(a);
38
+ return [x * c + z * s, -x * s + z * c];
39
+ };
40
+ const searching = (d, f, o) => {
41
+ const t = f.t / 1e3 * f.speed;
42
+ const [x, z] = spin(d.x, d.z, t * 0.6);
43
+ const sweep = (Math.sin(t * 2.2 - d.y * 3) + 1) / 2;
44
+ const r = 1 + 0.12 * sweep;
45
+ o.x = x * r;
46
+ o.y = d.y * r;
47
+ o.z = z * r;
48
+ o.size = 0.8 + sweep * 0.9;
49
+ o.alpha = 0.3 + sweep * 0.7;
50
+ };
51
+ const composing = (d, f, o) => {
52
+ const t = f.t / 1e3 * f.speed;
53
+ const [x, z] = spin(d.x, d.z, t * 0.25);
54
+ const bob = Math.sin(t * 3 + d.index * 18) * 0.08;
55
+ o.x = x;
56
+ o.y = d.y + bob;
57
+ o.z = z;
58
+ const lead = (Math.sin(t * 2 - d.index * 6) + 1) / 2;
59
+ o.size = 0.7 + lead * 0.8;
60
+ o.alpha = 0.35 + lead * 0.65;
61
+ };
62
+ const weaving = (d, f, o) => {
63
+ const t = f.t / 1e3 * f.speed;
64
+ const dir = d.index < 0.5 ? 1 : -1;
65
+ const [x, z] = spin(d.x, d.z, t * 0.9 * dir);
66
+ const wave = Math.sin(d.y * 6 + t * 2 * dir) * 0.1;
67
+ o.x = x * (1 + wave);
68
+ o.y = d.y;
69
+ o.z = z * (1 + wave);
70
+ o.size = 0.9 + Math.abs(wave) * 5;
71
+ o.alpha = 0.5 + 0.5 * Math.sin(t * 2 + d.phase);
72
+ };
73
+ const connecting = (d, f, o) => {
74
+ const t = f.t / 1e3 * f.speed;
75
+ const pulse = (Math.sin(t * 2.4) + 1) / 2;
76
+ const r = 0.55 + 0.5 * pulse;
77
+ const [x, z] = spin(d.x, d.z, t * 0.4);
78
+ o.x = x * r;
79
+ o.y = d.y * r;
80
+ o.z = z * r;
81
+ o.size = 0.8 + pulse * 0.8;
82
+ o.alpha = 0.4 + pulse * 0.6;
83
+ };
84
+ const orbiting = (d, f, o) => {
85
+ const t = f.t / 1e3 * f.speed;
86
+ const ang = d.index * Math.PI * 2 - Math.PI / 2;
87
+ const head = t * 2.4;
88
+ const lit = Math.pow(0.5 + 0.5 * Math.cos(ang - head), 6);
89
+ const r = 0.92 + 0.04 * Math.sin(t * 1.6);
90
+ o.x = Math.cos(ang) * r;
91
+ o.y = Math.sin(ang) * r;
92
+ o.z = 0;
93
+ o.size = 0.55 + lit * 0.9;
94
+ o.alpha = 0.25 + lit * 0.75;
95
+ };
96
+ const looping = (d, f, o) => {
97
+ const t = f.t / 1e3 * f.speed;
98
+ const s = d.index * Math.PI * 2;
99
+ const den = 1 + Math.sin(s) * Math.sin(s);
100
+ const behind = ((t * 0.32 - d.index) % 1 + 1) % 1;
101
+ const lit = Math.pow(1 - behind, 3);
102
+ o.x = Math.cos(s) / den;
103
+ o.y = Math.sin(s) * Math.cos(s) / den;
104
+ o.z = 0;
105
+ o.size = 0.45 + lit * 0.9;
106
+ o.alpha = 0.18 + lit * 0.82;
107
+ };
108
+ const twinkle = (d, t, rate) => 0.5 + 0.5 * Math.sin(t * rate + d.phase);
109
+ const BUILT_IN = {
110
+ /** Resting: slow turn, dim. */
111
+ idle(d, f, o) {
112
+ place(d, o);
113
+ rotateY(o, f.t * 2e-4 * f.speed);
114
+ o.size = 0.95;
115
+ o.alpha = 0.6;
116
+ },
117
+ /** The model is reasoning: a slow turn, a gentle breath and dots that twinkle. */
118
+ thinking(d, f, o) {
119
+ place(d, o, 1 + 0.05 * Math.sin(f.t * 15e-4 + d.phase * 0.5));
120
+ rotateY(o, f.t * 6e-4 * f.speed);
121
+ const k = twinkle(d, f.t, 3e-3 * f.speed);
122
+ o.size = 0.85 + 0.6 * k;
123
+ o.alpha = 0.6 + 0.4 * k;
124
+ },
125
+ /** A tool is running: faster, twisted by latitude and tumbling. */
126
+ working(d, f, o) {
127
+ place(d, o, 1 + 0.12 * Math.sin(f.t * 4e-3 * f.speed + d.phase));
128
+ rotateY(o, f.t * 16e-4 * f.speed + d.y * 1.8);
129
+ rotateX(o, Math.sin(f.t * 8e-4 * f.speed) * 0.5);
130
+ o.size = 1;
131
+ o.alpha = 0.9;
132
+ },
133
+ /** Voice input: rings travel up the sphere and swell with the live level. */
134
+ listening(d, f, o) {
135
+ place(d, o, 1 + (0.08 + 0.4 * f.level) * Math.sin(d.y * 5 - f.t * 8e-3 * f.speed));
136
+ rotateY(o, f.t * 4e-4 * f.speed);
137
+ o.size = 0.9 + f.level * 0.8;
138
+ o.alpha = 0.7 + 0.3 * Math.min(1, f.level * 1.5 + 0.2);
139
+ },
140
+ searching,
141
+ composing,
142
+ weaving,
143
+ connecting,
144
+ orbiting,
145
+ looping
146
+ };
147
+ const registry = new Map(Object.entries(BUILT_IN));
148
+ function registerMurmurState(name, fn) {
149
+ registry.set(name, fn);
150
+ }
151
+ function getMurmurState(name) {
152
+ return registry.get(name) ?? BUILT_IN.thinking;
153
+ }
154
+ const MURMUR_STATES = Object.keys(BUILT_IN);
155
+ export {
156
+ MURMUR_STATES,
157
+ getMurmurState,
158
+ makeDots,
159
+ place,
160
+ registerMurmurState,
161
+ rotateX,
162
+ rotateY
163
+ };
@@ -0,0 +1,12 @@
1
+ export * from "./Murmur.js";
2
+ export * from "./Murmur.doc.js";
3
+ import { registerMurmurState, getMurmurState, makeDots, rotateX, rotateY, place, MURMUR_STATES } from "./engine.js";
4
+ export {
5
+ MURMUR_STATES,
6
+ getMurmurState,
7
+ makeDots,
8
+ place,
9
+ registerMurmurState,
10
+ rotateX,
11
+ rotateY
12
+ };
@@ -0,0 +1,37 @@
1
+ const docs = {
2
+ name: "Pagination",
3
+ description: 'Moves between pages of a table, list or document. Shows page numbers, a compact previous and next with "Page 2 of 10", or cards linking to the previous and next article.',
4
+ features: [
5
+ "Variants: numeric (numbered pagination bar), simple ('Page X of Y'), cards (editorial Next/Previous cards)",
6
+ "Sizes: sm, md, lg",
7
+ "Supports auto-ellipsis calculation for large page counts (e.g. 1 2 3 ... 10)",
8
+ "Supports link href mode (prevHref, nextHref) or client-side callback mode (onPageChange)"
9
+ ],
10
+ accessibility: [
11
+ "Built with native <nav aria-label='Pagination'> element",
12
+ "Applies aria-current='page' to active page number button",
13
+ "Disables prev/next controls on first/last pages with disabled opacity"
14
+ ],
15
+ keyboard: "Tab to cycle through page buttons, Space/Enter to change page",
16
+ usage: {
17
+ bestPractices: [
18
+ {
19
+ guidance: true,
20
+ description: "Use variant='numeric' for data tables and search results; use variant='cards' for documentation portals."
21
+ },
22
+ {
23
+ guidance: false,
24
+ description: "Do not display pagination controls if totalPages === 1."
25
+ }
26
+ ]
27
+ },
28
+ examples: [
29
+ {
30
+ title: "Numeric Page Navigation",
31
+ code: "<Pagination page={1} totalPages={10} onPageChange={() => {}} />"
32
+ }
33
+ ]
34
+ };
35
+ export {
36
+ docs
37
+ };
@@ -0,0 +1,183 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import React from "react";
4
+ import { cva } from "class-variance-authority";
5
+ import { cn } from "../../lib/cn.js";
6
+ const paginationVariants = cva("flex items-center gap-1.5", {
7
+ variants: {
8
+ variant: {
9
+ numeric: "justify-center",
10
+ simple: "justify-between",
11
+ cards: "grid grid-cols-1 sm:grid-cols-2 gap-4 w-full"
12
+ },
13
+ size: {
14
+ sm: "text-xs",
15
+ md: "text-sm",
16
+ lg: "text-base"
17
+ }
18
+ },
19
+ defaultVariants: {
20
+ variant: "numeric",
21
+ size: "md"
22
+ }
23
+ });
24
+ function Pagination({
25
+ page = 1,
26
+ totalPages = 1,
27
+ onPageChange,
28
+ variant = "numeric",
29
+ size,
30
+ prevLabel = "Previous",
31
+ nextLabel = "Next",
32
+ prevTitle,
33
+ nextTitle,
34
+ prevHref,
35
+ nextHref,
36
+ className,
37
+ ...props
38
+ }) {
39
+ const isFirst = page <= 1;
40
+ const isLast = page >= totalPages;
41
+ const pages = React.useMemo(() => {
42
+ if (totalPages <= 7) {
43
+ return Array.from({ length: totalPages }, (_, i) => i + 1);
44
+ }
45
+ if (page <= 3) {
46
+ return [1, 2, 3, 4, "...", totalPages];
47
+ }
48
+ if (page >= totalPages - 2) {
49
+ return [1, "...", totalPages - 3, totalPages - 2, totalPages - 1, totalPages];
50
+ }
51
+ return [1, "...", page - 1, page, page + 1, "...", totalPages];
52
+ }, [page, totalPages]);
53
+ if (variant === "cards") {
54
+ return /* @__PURE__ */ jsxs("nav", { "aria-label": "Pagination", className: cn(paginationVariants({ variant, size }), className), ...props, children: [
55
+ prevTitle ? /* @__PURE__ */ jsxs(
56
+ "a",
57
+ {
58
+ href: prevHref || "#",
59
+ onClick: (e) => {
60
+ if (onPageChange && !prevHref) {
61
+ e.preventDefault();
62
+ onPageChange(page - 1);
63
+ }
64
+ },
65
+ className: "group block rounded-[var(--radius-panel)] border border-hairline bg-surface-hover/60 hover:bg-surface-hover hover:border-hairline-strong p-4 transition cursor-pointer",
66
+ children: [
67
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 text-xs font-medium text-fg-subtle group-hover:text-brand-text transition", children: [
68
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\u2190" }),
69
+ /* @__PURE__ */ jsx("span", { children: prevLabel })
70
+ ] }),
71
+ /* @__PURE__ */ jsx("div", { className: "mt-1 text-base font-semibold text-fg group-hover:text-brand-text transition", children: prevTitle })
72
+ ]
73
+ }
74
+ ) : /* @__PURE__ */ jsx("div", {}),
75
+ nextTitle ? /* @__PURE__ */ jsxs(
76
+ "a",
77
+ {
78
+ href: nextHref || "#",
79
+ onClick: (e) => {
80
+ if (onPageChange && !nextHref) {
81
+ e.preventDefault();
82
+ onPageChange(page + 1);
83
+ }
84
+ },
85
+ className: "group block rounded-[var(--radius-panel)] border border-hairline bg-surface-hover/60 hover:bg-surface-hover hover:border-hairline-strong p-4 transition cursor-pointer sm:text-right",
86
+ children: [
87
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5 justify-end text-xs font-medium text-fg-subtle group-hover:text-brand-text transition sm:justify-end", children: [
88
+ /* @__PURE__ */ jsx("span", { children: nextLabel === "Next" ? "Up next" : nextLabel }),
89
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\u2192" })
90
+ ] }),
91
+ /* @__PURE__ */ jsx("div", { className: "mt-1 text-base font-semibold text-fg group-hover:text-brand-text transition", children: nextTitle })
92
+ ]
93
+ }
94
+ ) : /* @__PURE__ */ jsx("div", {})
95
+ ] });
96
+ }
97
+ if (variant === "simple") {
98
+ return /* @__PURE__ */ jsxs("nav", { "aria-label": "Pagination", className: cn(paginationVariants({ variant, size }), className), ...props, children: [
99
+ /* @__PURE__ */ jsxs(
100
+ "button",
101
+ {
102
+ type: "button",
103
+ disabled: isFirst,
104
+ onClick: () => onPageChange?.(page - 1),
105
+ "aria-label": "Previous Page",
106
+ className: "flex items-center gap-1.5 rounded-[var(--radius-lg)] border border-hairline bg-surface px-3 py-1.5 text-xs font-medium text-fg transition hover:bg-surface-hover disabled:opacity-40 disabled:pointer-events-none cursor-pointer",
107
+ children: [
108
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\u2190" }),
109
+ /* @__PURE__ */ jsx("span", { children: prevLabel })
110
+ ]
111
+ }
112
+ ),
113
+ /* @__PURE__ */ jsxs("span", { className: "text-xs font-medium text-fg-muted", children: [
114
+ "Page ",
115
+ page,
116
+ " of ",
117
+ totalPages
118
+ ] }),
119
+ /* @__PURE__ */ jsxs(
120
+ "button",
121
+ {
122
+ type: "button",
123
+ disabled: isLast,
124
+ onClick: () => onPageChange?.(page + 1),
125
+ "aria-label": "Next Page",
126
+ className: "flex items-center gap-1.5 rounded-[var(--radius-lg)] border border-hairline bg-surface px-3 py-1.5 text-xs font-medium text-fg transition hover:bg-surface-hover disabled:opacity-40 disabled:pointer-events-none cursor-pointer",
127
+ children: [
128
+ /* @__PURE__ */ jsx("span", { children: nextLabel }),
129
+ /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\u2192" })
130
+ ]
131
+ }
132
+ )
133
+ ] });
134
+ }
135
+ return /* @__PURE__ */ jsxs("nav", { "aria-label": "Pagination", className: cn(paginationVariants({ variant, size }), className), ...props, children: [
136
+ /* @__PURE__ */ jsx(
137
+ "button",
138
+ {
139
+ type: "button",
140
+ disabled: isFirst,
141
+ onClick: () => onPageChange?.(page - 1),
142
+ "aria-label": "Previous Page",
143
+ className: "flex h-8 w-8 items-center justify-center rounded-[var(--radius-lg)] border border-hairline bg-surface text-fg transition hover:bg-surface-hover disabled:opacity-40 disabled:pointer-events-none cursor-pointer",
144
+ children: /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\u2190" })
145
+ }
146
+ ),
147
+ pages.map((p, idx) => {
148
+ if (typeof p === "string") {
149
+ return /* @__PURE__ */ jsx("span", { className: "px-1.5 text-xs text-fg-subtle select-none", children: p }, `ellipsis-${idx}`);
150
+ }
151
+ const isActive = p === page;
152
+ return /* @__PURE__ */ jsx(
153
+ "button",
154
+ {
155
+ type: "button",
156
+ "aria-current": isActive ? "page" : void 0,
157
+ onClick: () => onPageChange?.(p),
158
+ className: cn(
159
+ "flex h-8 min-w-[32px] items-center justify-center rounded-[var(--radius-lg)] px-2 text-xs font-medium transition cursor-pointer",
160
+ isActive ? "bg-brand-solid text-brand-fg font-semibold shadow-card" : "border border-hairline bg-surface text-fg hover:bg-surface-hover"
161
+ ),
162
+ children: p
163
+ },
164
+ p
165
+ );
166
+ }),
167
+ /* @__PURE__ */ jsx(
168
+ "button",
169
+ {
170
+ type: "button",
171
+ disabled: isLast,
172
+ onClick: () => onPageChange?.(page + 1),
173
+ "aria-label": "Next Page",
174
+ className: "flex h-8 w-8 items-center justify-center rounded-[var(--radius-lg)] border border-hairline bg-surface text-fg transition hover:bg-surface-hover disabled:opacity-40 disabled:pointer-events-none cursor-pointer",
175
+ children: /* @__PURE__ */ jsx("span", { "aria-hidden": true, children: "\u2192" })
176
+ }
177
+ )
178
+ ] });
179
+ }
180
+ export {
181
+ Pagination,
182
+ paginationVariants
183
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./Pagination.js";
2
+ export * from "./Pagination.doc.js";
@@ -0,0 +1,41 @@
1
+ const docs = {
2
+ name: "PanelGroup",
3
+ group: "layout",
4
+ description: 'Side-by-side or stacked panes the user resizes by dragging the divider between them, such as code, preview and terminal. It can remember the layout. Import it from "@shavin/ui/panels", not the root. For one element that resizes itself, use the resizable prop on Box, Flex or Card.',
5
+ features: [
6
+ 'PanelGroup, Panel and PanelHandle from "@shavin/ui/panels"',
7
+ 'orientation="horizontal" (side by side) or "vertical" (stacked); groups nest',
8
+ "Panel sizes in px (numbers) or %, rem, vh, vw (strings); minSize, maxSize, collapsible, collapsedSize",
9
+ "persistKey remembers the layout in localStorage; pass storage for cookies or server sync",
10
+ "PanelHandle looks: line (hairline divider), grip (pill), invisible; color: brand-subtle (default), brand, neutral; while dragging the grip follows the pointer along the divider and re-centres on release",
11
+ "usePanelRef / useGroupRef for collapse(), expand(), resize() and setLayout()"
12
+ ],
13
+ accessibility: [
14
+ 'PanelHandle is a focusable role="separator" with aria-valuenow, aria-valuemin, aria-valuemax and aria-controls',
15
+ "Arrow keys resize, Home / End jump to the bounds, Enter toggles a collapsible panel",
16
+ "Hit targets grow on touch screens"
17
+ ],
18
+ usage: {
19
+ bestPractices: [
20
+ { guidance: true, description: 'Import from "@shavin/ui/panels" so apps that never split panes do not bundle the panel engine.' },
21
+ { guidance: true, description: "Give every Panel a stable id when using persistKey or the imperative refs." },
22
+ { guidance: true, description: "Give the PanelGroup's parent a fixed height (h-full inside an app shell, or an explicit height)." },
23
+ { guidance: false, description: "Do not use PanelGroup for a single sidebar next to flexible content; use Sidebar resizable or Box resizable." },
24
+ { guidance: false, description: "Do not wrap PanelHandle in another element; it must be a direct child of PanelGroup." }
25
+ ]
26
+ },
27
+ examples: [
28
+ {
29
+ title: "Editor split",
30
+ description: "Three panes, the first collapsible, layout remembered",
31
+ code: '<PanelGroup orientation="horizontal" persistKey="editor" className="h-96"><Panel id="files" defaultSize="20%" minSize={160} collapsible><Box className="h-full p-4">Files</Box></Panel><PanelHandle /><Panel id="code" minSize="30%"><Box className="h-full p-4">Code</Box></Panel><PanelHandle variant="grip" /><Panel id="preview" defaultSize="35%"><Box className="h-full p-4">Preview</Box></Panel></PanelGroup>'
32
+ },
33
+ {
34
+ title: "Nested vertical split",
35
+ code: '<PanelGroup className="h-96"><Panel id="main"><PanelGroup orientation="vertical"><Panel id="editor"><Box className="h-full p-4">Editor</Box></Panel><PanelHandle /><Panel id="terminal" defaultSize="30%" minSize={80}><Box className="h-full p-4">Terminal</Box></Panel></PanelGroup></Panel><PanelHandle /><Panel id="chat" defaultSize="30%"><Box className="h-full p-4">Chat</Box></Panel></PanelGroup>'
36
+ }
37
+ ]
38
+ };
39
+ export {
40
+ docs
41
+ };
@@ -0,0 +1,142 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useLayoutEffect, useRef } from "react";
3
+ import {
4
+ Group,
5
+ Panel as PanelPrimitive,
6
+ Separator
7
+ } from "react-resizable-panels";
8
+ import { cva } from "class-variance-authority";
9
+ import { cn } from "../../lib/cn.js";
10
+ const browserStorage = {
11
+ getItem: (key) => {
12
+ try {
13
+ return window.localStorage.getItem(key);
14
+ } catch {
15
+ return null;
16
+ }
17
+ },
18
+ setItem: (key, value) => {
19
+ try {
20
+ window.localStorage.setItem(key, value);
21
+ } catch {
22
+ }
23
+ }
24
+ };
25
+ const useIsoLayoutEffect = typeof window === "undefined" ? useEffect : useLayoutEffect;
26
+ function readLayout(storage, key) {
27
+ try {
28
+ const parsed = JSON.parse(storage.getItem(key) ?? "null");
29
+ if (!parsed || typeof parsed !== "object") return null;
30
+ return Object.values(parsed).every((v) => typeof v === "number") ? parsed : null;
31
+ } catch {
32
+ return null;
33
+ }
34
+ }
35
+ function slideGrips(group, clientX, clientY) {
36
+ for (const child of Array.from(group.children)) {
37
+ const el = child;
38
+ if (el.dataset.separator !== "active") continue;
39
+ const rect = el.getBoundingClientRect();
40
+ const along = el.getAttribute("aria-orientation") === "horizontal" ? clientX - rect.left : clientY - rect.top;
41
+ el.style.setProperty("--resize-thumb", `${Math.round(along)}px`);
42
+ }
43
+ }
44
+ function centreGrips(group) {
45
+ for (const child of Array.from(group.children)) child.style.removeProperty("--resize-thumb");
46
+ }
47
+ function PanelGroup({
48
+ persistKey,
49
+ storage,
50
+ defaultLayout,
51
+ onLayoutChanged,
52
+ groupRef,
53
+ elementRef,
54
+ className,
55
+ onPointerMove,
56
+ ...props
57
+ }) {
58
+ const handleRef = useRef(null);
59
+ const groupEl = useRef(null);
60
+ const setGroupEl = useCallback(
61
+ (el) => {
62
+ groupEl.current = el;
63
+ if (typeof elementRef === "function") elementRef(el);
64
+ else if (elementRef) elementRef.current = el;
65
+ },
66
+ [elementRef]
67
+ );
68
+ useEffect(() => {
69
+ const onUp = () => groupEl.current && centreGrips(groupEl.current);
70
+ document.addEventListener("pointerup", onUp);
71
+ document.addEventListener("pointercancel", onUp);
72
+ return () => {
73
+ document.removeEventListener("pointerup", onUp);
74
+ document.removeEventListener("pointercancel", onUp);
75
+ };
76
+ }, []);
77
+ const setGroupRef = useCallback(
78
+ (handle) => {
79
+ handleRef.current = handle;
80
+ if (typeof groupRef === "function") groupRef(handle);
81
+ else if (groupRef) groupRef.current = handle;
82
+ },
83
+ [groupRef]
84
+ );
85
+ const storageKey = persistKey ? `shavin:panels:${persistKey}` : null;
86
+ const store = storage ?? browserStorage;
87
+ useIsoLayoutEffect(() => {
88
+ if (!storageKey || defaultLayout) return;
89
+ const saved = readLayout(store, storageKey);
90
+ if (saved) handleRef.current?.setLayout(saved);
91
+ }, [storageKey]);
92
+ return /* @__PURE__ */ jsx(
93
+ Group,
94
+ {
95
+ className: cn("h-full w-full", className),
96
+ defaultLayout,
97
+ groupRef: setGroupRef,
98
+ elementRef: setGroupEl,
99
+ resizeTargetMinimumSize: { coarse: 44, fine: 24 },
100
+ onPointerMove: (e) => {
101
+ slideGrips(e.currentTarget, e.clientX, e.clientY);
102
+ onPointerMove?.(e);
103
+ },
104
+ onLayoutChanged: (layout, meta) => {
105
+ if (storageKey && meta.isUserInteraction) store.setItem(storageKey, JSON.stringify(meta.requestedLayout ?? layout));
106
+ onLayoutChanged?.(layout, meta);
107
+ },
108
+ ...props
109
+ }
110
+ );
111
+ }
112
+ function Panel({ className, ...props }) {
113
+ return /* @__PURE__ */ jsx(PanelPrimitive, { className: cn("min-h-0 min-w-0", className), ...props });
114
+ }
115
+ const panelHandleVariants = cva(
116
+ "relative flex-none focus-visible:outline-offset-0 transition-colors duration-150 [&[aria-orientation=vertical]]:w-px [&[aria-orientation=horizontal]]:h-px data-[separator=disabled]:opacity-50 before:pointer-events-none before:absolute before:-translate-x-1/2 before:-translate-y-1/2 before:rounded-full before:transition-[background-color,top,left] before:duration-150 data-[separator=active]:before:transition-[background-color] [&[aria-orientation=vertical]]:before:left-1/2 [&[aria-orientation=vertical]]:before:top-[clamp(12px,var(--resize-thumb,50%),calc(100%_-_12px))] [&[aria-orientation=horizontal]]:before:top-1/2 [&[aria-orientation=horizontal]]:before:left-[clamp(12px,var(--resize-thumb,50%),calc(100%_-_12px))]",
117
+ {
118
+ variants: {
119
+ variant: {
120
+ line: "bg-hairline",
121
+ grip: "bg-hairline before:bg-hairline-strong [&[aria-orientation=vertical]]:before:h-6 [&[aria-orientation=vertical]]:before:w-1 [&[aria-orientation=horizontal]]:before:h-1 [&[aria-orientation=horizontal]]:before:w-6",
122
+ invisible: "bg-transparent"
123
+ },
124
+ // Hover, focus and drag colours of the divider and the grip.
125
+ color: {
126
+ brand: "data-[separator=hover]:bg-brand data-[separator=active]:bg-brand data-[separator=focus]:bg-brand data-[separator=hover]:before:bg-brand data-[separator=active]:before:bg-brand data-[separator=focus]:before:bg-brand",
127
+ "brand-subtle": "data-[separator=hover]:bg-brand/40 data-[separator=active]:bg-brand/60 data-[separator=focus]:bg-brand/60 data-[separator=hover]:before:bg-brand/40 data-[separator=active]:before:bg-brand/60 data-[separator=focus]:before:bg-brand/60",
128
+ neutral: "data-[separator=hover]:bg-fg-subtle data-[separator=active]:bg-fg-muted data-[separator=focus]:bg-fg-muted data-[separator=hover]:before:bg-fg-subtle data-[separator=active]:before:bg-fg-muted data-[separator=focus]:before:bg-fg-muted"
129
+ }
130
+ },
131
+ defaultVariants: { variant: "line", color: "brand-subtle" }
132
+ }
133
+ );
134
+ function PanelHandle({ variant, color, className, ...props }) {
135
+ return /* @__PURE__ */ jsx(Separator, { "aria-label": "Resize panels", className: cn(panelHandleVariants({ variant, color }), className), ...props });
136
+ }
137
+ export {
138
+ Panel,
139
+ PanelGroup,
140
+ PanelHandle,
141
+ panelHandleVariants
142
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./PanelGroup.js";
2
+ export * from "./PanelGroup.doc.js";