@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,35 @@
1
+ import { collectPage } from "./collect.js";
2
+ import { analyzePage } from "./rules.js";
3
+ import { contextLabel, uniqueSelector } from "./selector.js";
4
+ function domHooks(doc) {
5
+ const selectors = /* @__PURE__ */ new WeakMap();
6
+ const contexts = /* @__PURE__ */ new WeakMap();
7
+ return {
8
+ selectorOf(ref) {
9
+ if (!ref || typeof ref !== "object") return String(ref);
10
+ let s = selectors.get(ref);
11
+ if (s === void 0) {
12
+ s = uniqueSelector(ref, doc);
13
+ selectors.set(ref, s);
14
+ }
15
+ return s;
16
+ },
17
+ contextOf(ref) {
18
+ if (!ref || typeof ref !== "object") return "";
19
+ let s = contexts.get(ref);
20
+ if (s === void 0) {
21
+ s = contextLabel(ref);
22
+ contexts.set(ref, s);
23
+ }
24
+ return s;
25
+ }
26
+ };
27
+ }
28
+ function inspectDocument(options = {}) {
29
+ const doc = options.doc ?? document;
30
+ return analyzePage(collectPage({ ...options, doc }), domHooks(doc));
31
+ }
32
+ export {
33
+ domHooks,
34
+ inspectDocument
35
+ };
@@ -0,0 +1,110 @@
1
+ const FINDING_CAPS = {
2
+ message: 300,
3
+ fixHint: 300,
4
+ selector: 500,
5
+ context: 200,
6
+ text: 60,
7
+ comment: 2e3,
8
+ rule: 60,
9
+ evidenceValue: 300,
10
+ propValue: 120,
11
+ props: 12,
12
+ /** Findings kept per scan; the rest are dropped after sorting errors first. */
13
+ perScan: 200
14
+ };
15
+ const CONTROL_CHARS = new RegExp("[\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f-\\u009f\\u2028\\u2029\\u202a-\\u202e\\u2066-\\u2069]", "g");
16
+ function clampText(value, max) {
17
+ const s = String(value ?? "").replace(CONTROL_CHARS, "").replace(/\s+/g, " ").trim();
18
+ return s.length > max ? `${s.slice(0, Math.max(0, max - 1))}\u2026` : s;
19
+ }
20
+ function clampNote(value, max) {
21
+ const s = String(value ?? "").replace(CONTROL_CHARS, "").replace(/\r\n?/g, "\n").trim();
22
+ return s.length > max ? s.slice(0, max) : s;
23
+ }
24
+ function fnv1a(input, seed) {
25
+ let h = seed >>> 0;
26
+ for (let i = 0; i < input.length; i++) {
27
+ h ^= input.charCodeAt(i);
28
+ h = Math.imul(h, 16777619) >>> 0;
29
+ }
30
+ return h >>> 0;
31
+ }
32
+ function fingerprint(detector, rule, selector, text = "") {
33
+ const key = [detector, rule, selector, text.slice(0, 24)].join("|");
34
+ return `f_${fnv1a(key, 2166136261).toString(16).padStart(8, "0")}`;
35
+ }
36
+ const FINDING_ID = /^f_[0-9a-f]{8}$/;
37
+ const isFindingId = (value) => typeof value === "string" && FINDING_ID.test(value);
38
+ const round = (n) => Math.round(n * 10) / 10;
39
+ function cleanRect(rect) {
40
+ if (!rect) return null;
41
+ const vals = [rect.x, rect.y, rect.w, rect.h, rect.scrollX, rect.scrollY];
42
+ if (!vals.every((v) => typeof v === "number" && Number.isFinite(v))) return null;
43
+ return { x: round(rect.x), y: round(rect.y), w: round(rect.w), h: round(rect.h), scrollX: round(rect.scrollX), scrollY: round(rect.scrollY) };
44
+ }
45
+ function makeFinding(input) {
46
+ const selector = clampText(input.selector, FINDING_CAPS.selector) || "(page)";
47
+ const text = input.text ? clampText(input.text, FINDING_CAPS.text) : "";
48
+ const evidence = {};
49
+ for (const [k, v] of Object.entries(input.evidence ?? {})) {
50
+ if (v === void 0) continue;
51
+ evidence[clampText(k, 40)] = clampText(v, FINDING_CAPS.evidenceValue);
52
+ }
53
+ const finding = {
54
+ id: fingerprint(input.detector, input.rule, selector, text),
55
+ detector: input.detector,
56
+ rule: clampText(input.rule, FINDING_CAPS.rule),
57
+ severity: input.severity,
58
+ message: clampText(input.message, FINDING_CAPS.message),
59
+ evidence,
60
+ fixHint: clampText(input.fixHint, FINDING_CAPS.fixHint),
61
+ selector,
62
+ context: clampText(input.context ?? "", FINDING_CAPS.context),
63
+ rect: cleanRect(input.rect),
64
+ source: "inspector@1",
65
+ at: input.at ?? Date.now()
66
+ };
67
+ if (text) finding.text = text;
68
+ if (input.comment) finding.comment = clampNote(input.comment, FINDING_CAPS.comment);
69
+ if (input.props) {
70
+ const props = {};
71
+ for (const [k, v] of Object.entries(input.props).slice(0, FINDING_CAPS.props)) {
72
+ props[clampText(k, 40)] = clampText(v, FINDING_CAPS.propValue);
73
+ }
74
+ if (Object.keys(props).length) finding.props = props;
75
+ }
76
+ return finding;
77
+ }
78
+ const SEVERITY_RANK = { error: 0, warning: 1 };
79
+ function rankFindings(list, cap = FINDING_CAPS.perScan) {
80
+ const seen = /* @__PURE__ */ new Set();
81
+ const unique = [];
82
+ for (const f of list) {
83
+ if (seen.has(f.id)) continue;
84
+ seen.add(f.id);
85
+ unique.push(f);
86
+ }
87
+ unique.sort((a, b) => SEVERITY_RANK[a.severity] - SEVERITY_RANK[b.severity]);
88
+ return { findings: unique.slice(0, cap), dropped: Math.max(0, unique.length - cap) };
89
+ }
90
+ function countFindings(list, ignored = /* @__PURE__ */ new Set()) {
91
+ let errors = 0;
92
+ let warnings = 0;
93
+ for (const f of list) {
94
+ if (ignored.has(f.id)) continue;
95
+ if (f.severity === "error") errors++;
96
+ else warnings++;
97
+ }
98
+ const total = errors + warnings;
99
+ return { total, errors, warnings, clean: total === 0 };
100
+ }
101
+ export {
102
+ FINDING_CAPS,
103
+ clampNote,
104
+ clampText,
105
+ countFindings,
106
+ fingerprint,
107
+ isFindingId,
108
+ makeFinding,
109
+ rankFindings
110
+ };
@@ -0,0 +1,103 @@
1
+ const MAX_DEPTH = 8;
2
+ function esc(value) {
3
+ const css = globalThis.CSS;
4
+ if (css?.escape) return css.escape(value);
5
+ return value.replace(/[^a-zA-Z0-9_\u00a0-\uffff-]/g, (c) => `\\${c}`);
6
+ }
7
+ function looksGenerated(token) {
8
+ if (/^:r[0-9a-z]+:$/i.test(token)) return true;
9
+ if (/\d{4,}/.test(token)) return true;
10
+ if (/^[a-z]{1,4}[-_][0-9a-f]{5,}$/i.test(token)) return true;
11
+ if (/[0-9a-f]{8,}$/i.test(token) && /\d/.test(token)) return true;
12
+ return false;
13
+ }
14
+ function stableClasses(el) {
15
+ const out = [];
16
+ for (const c of Array.from(el.classList)) {
17
+ if (c.length > 28 || /[:[\]/%.!]/.test(c) || looksGenerated(c)) continue;
18
+ out.push(c);
19
+ if (out.length === 2) break;
20
+ }
21
+ return out;
22
+ }
23
+ function matchCount(root, selector) {
24
+ try {
25
+ return root.querySelectorAll(selector).length;
26
+ } catch {
27
+ return Infinity;
28
+ }
29
+ }
30
+ function anchor(el) {
31
+ const id = el.getAttribute("id");
32
+ if (id && /^[A-Za-z][\w-]*$/.test(id) && !looksGenerated(id)) return `#${esc(id)}`;
33
+ for (const attr of ["data-testid", "data-test", "data-cy"]) {
34
+ const v = el.getAttribute(attr);
35
+ if (v && v.length <= 60 && !/["\\]/.test(v)) return `[${attr}="${v}"]`;
36
+ }
37
+ return null;
38
+ }
39
+ function nthOfType(el) {
40
+ let n = 1;
41
+ for (let s = el.previousElementSibling; s; s = s.previousElementSibling) if (s.tagName === el.tagName) n++;
42
+ return n;
43
+ }
44
+ function hasSameTypeSibling(el) {
45
+ const parent = el.parentElement;
46
+ if (!parent) return false;
47
+ for (const s of Array.from(parent.children)) if (s !== el && s.tagName === el.tagName) return true;
48
+ return false;
49
+ }
50
+ function segment(el, withNth) {
51
+ const tag = el.tagName.toLowerCase();
52
+ const classes = stableClasses(el).map((c) => `.${esc(c)}`).join("");
53
+ const base = `${tag}${classes}`;
54
+ return withNth && hasSameTypeSibling(el) ? `${base}:nth-of-type(${nthOfType(el)})` : base;
55
+ }
56
+ function uniqueSelector(el, root = el.ownerDocument) {
57
+ if (!el || el.nodeType !== 1) return "";
58
+ const own = anchor(el);
59
+ if (own && matchCount(root, own) === 1) return own;
60
+ for (const withNth of [false, true]) {
61
+ const parts = [];
62
+ let node2 = el;
63
+ for (let depth = 0; node2 && depth < MAX_DEPTH; depth++) {
64
+ const a = depth > 0 ? anchor(node2) : null;
65
+ if (a && matchCount(root, a) === 1) {
66
+ parts.unshift(a);
67
+ break;
68
+ }
69
+ parts.unshift(segment(node2, withNth));
70
+ const candidate2 = parts.join(" > ");
71
+ if (matchCount(root, candidate2) === 1 && root.querySelector(candidate2) === el) return candidate2;
72
+ node2 = node2.parentElement;
73
+ if (!node2 || node2 === (el.ownerDocument?.documentElement ?? null)) break;
74
+ }
75
+ const candidate = parts.join(" > ");
76
+ if (candidate && matchCount(root, candidate) === 1 && root.querySelector(candidate) === el) return candidate;
77
+ }
78
+ const path = [];
79
+ let node = el;
80
+ while (node && node.tagName !== "BODY" && node.tagName !== "HTML" && path.length < 24) {
81
+ const parent = node.parentElement;
82
+ const index = parent ? Array.from(parent.children).indexOf(node) + 1 : 1;
83
+ path.unshift(`${node.tagName.toLowerCase()}:nth-child(${index})`);
84
+ node = parent;
85
+ }
86
+ return `body > ${path.join(" > ")}`;
87
+ }
88
+ function describeElement(el) {
89
+ const tag = el.tagName.toLowerCase();
90
+ const classes = stableClasses(el).map((c) => `.${c}`).join("");
91
+ return `${tag}${classes}`;
92
+ }
93
+ function contextLabel(el) {
94
+ const parent = el.parentElement;
95
+ const self = describeElement(el);
96
+ if (!parent || parent.tagName === "BODY" || parent.tagName === "HTML") return self;
97
+ return `${describeElement(parent)} > ${self}`;
98
+ }
99
+ export {
100
+ contextLabel,
101
+ describeElement,
102
+ uniqueSelector
103
+ };
@@ -0,0 +1,34 @@
1
+ import { makeFinding } from "./schema.js";
2
+ const RULE_BY_CATEGORY = {
3
+ "Token Purity": "tokens.purity",
4
+ "Semantic Tokens": "tokens.semantic",
5
+ "Concentric Radius": "tokens.radius",
6
+ "Surface Elevation": "tokens.surface",
7
+ "Typography Scale": "tokens.type"
8
+ };
9
+ function tokenFindings(issues, hooks) {
10
+ const out = [];
11
+ for (const issue of issues) {
12
+ const node = issue.node;
13
+ if (!node || node.nodeType !== 1) continue;
14
+ const r = node.getBoundingClientRect();
15
+ out.push(
16
+ makeFinding({
17
+ detector: "tokens",
18
+ rule: RULE_BY_CATEGORY[issue.category] ?? "tokens.purity",
19
+ severity: issue.severity,
20
+ message: "Style bypasses the design tokens.",
21
+ evidence: { measured: issue.detail, expected: "a semantic token", category: issue.category },
22
+ fixHint: "Use the semantic token (bg-surface, text-fg, border-hairline, shadow-card, rounded-[var(--radius-panel)]).",
23
+ selector: hooks.selectorOf(node),
24
+ context: hooks.contextOf(node),
25
+ rect: { x: r.x, y: r.y, w: r.width, h: r.height, scrollX: hooks.scroll.x, scrollY: hooks.scroll.y },
26
+ text: (node.textContent ?? "").trim().slice(0, 40)
27
+ })
28
+ );
29
+ }
30
+ return out;
31
+ }
32
+ export {
33
+ tokenFindings
34
+ };
@@ -0,0 +1,284 @@
1
+ const OVERLAY_PRESET_STYLES = {
2
+ "gradient-bottom": { background: "linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.8) 100%)" },
3
+ "gradient-top": { background: "linear-gradient(to top, rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 50%, rgba(0,0,0,0.8) 100%)" },
4
+ "gradient-radial": { background: "radial-gradient(circle at center, rgba(0,0,0,0) 0%, rgba(0,0,0,0.4) 60%, rgba(0,0,0,0.85) 100%)" },
5
+ "vignette": { background: "radial-gradient(circle at center, rgba(0,0,0,0) 40%, rgba(0,0,0,0.85) 100%)" },
6
+ "scrim": { background: "linear-gradient(to bottom, rgba(0,0,0,0.1) 0%, rgba(0,0,0,0.5) 50%, rgba(0,0,0,0.85) 100%)" },
7
+ "dark-20": { backgroundColor: "rgba(0,0,0,0.2)" },
8
+ "dark-30": { backgroundColor: "rgba(0,0,0,0.3)" },
9
+ "dark-50": { backgroundColor: "rgba(0,0,0,0.5)" },
10
+ "dark-75": { backgroundColor: "rgba(0,0,0,0.75)" },
11
+ "light-20": { backgroundColor: "rgba(255,255,255,0.2)" },
12
+ "light-30": { backgroundColor: "rgba(255,255,255,0.3)" },
13
+ "light-50": { backgroundColor: "rgba(255,255,255,0.5)" },
14
+ // Directional scrim for left-aligned copy over media (dense left, clear right).
15
+ "scrim-left": { background: "linear-gradient(to right, rgba(0,0,0,0.78) 0%, rgba(0,0,0,0.5) 45%, rgba(0,0,0,0) 85%)" },
16
+ // Dissolves media into the page canvas — theme-aware, for photos that bleed into the next section.
17
+ "fade-canvas": { background: "linear-gradient(to bottom, rgb(var(--bg-canvas) / 0) 35%, rgb(var(--bg-canvas) / 0.85) 80%, rgb(var(--bg-canvas)) 100%)" },
18
+ // Mesh backdrops. mesh-brand follows the theme brand; the others are fixed pastel palettes
19
+ // (Lummi-style atmosphere) that read well under both light and dark copy with a scrim.
20
+ "mesh-brand": { background: "radial-gradient(at 12% 18%, rgb(var(--brand) / 0.16) 0px, transparent 55%), radial-gradient(at 88% 12%, rgb(var(--brand) / 0.08) 0px, transparent 50%), radial-gradient(at 70% 92%, rgb(var(--brand) / 0.12) 0px, transparent 55%), rgb(var(--bg-canvas))" },
21
+ "mesh-mint": { background: "radial-gradient(at 10% 10%, rgba(167,243,208,0.7) 0px, transparent 55%), radial-gradient(at 90% 20%, rgba(186,230,253,0.7) 0px, transparent 50%), radial-gradient(at 50% 90%, rgba(254,240,138,0.55) 0px, transparent 55%), rgb(248 250 252)" },
22
+ // Wave meshes — wide elliptical washes (no hard blobs), tuned by eye on real hero backgrounds.
23
+ "mesh-dawn": { background: "radial-gradient(ellipse 70% 55% at 88% 8%, hsla(13, 100%, 88%, 0.75) 0%, transparent 70%), radial-gradient(ellipse 85% 60% at 62% 40%, hsla(323, 100%, 90%, 0.7) 0%, transparent 72%), radial-gradient(ellipse 90% 65% at 30% 92%, hsla(268, 100%, 90%, 0.75) 0%, transparent 70%), radial-gradient(ellipse 60% 50% at 5% 20%, hsla(190, 90%, 92%, 0.6) 0%, transparent 70%), rgb(253 251 255)" },
24
+ "mesh-night": { background: "radial-gradient(ellipse 80% 60% at 15% 85%, hsla(257, 91%, 30%, 0.55) 0%, transparent 70%), radial-gradient(ellipse 70% 55% at 85% 15%, hsla(227, 98%, 55%, 0.45) 0%, transparent 70%), radial-gradient(ellipse 60% 50% at 100% 60%, hsla(166, 71%, 60%, 0.18) 0%, transparent 70%), radial-gradient(ellipse 90% 70% at 40% 105%, hsla(212, 100%, 50%, 0.3) 0%, transparent 70%), rgb(6 7 14)" },
25
+ "mesh-lime": { background: "radial-gradient(ellipse 75% 55% at 18% 0%, hsla(82, 85%, 55%, 0.22) 0%, transparent 70%), radial-gradient(ellipse 70% 60% at 92% 30%, hsla(165, 70%, 45%, 0.2) 0%, transparent 70%), radial-gradient(ellipse 95% 65% at 50% 110%, hsla(140, 60%, 30%, 0.35) 0%, transparent 72%), radial-gradient(ellipse 50% 40% at 70% 70%, hsla(82, 85%, 60%, 0.08) 0%, transparent 70%), rgb(8 10 9)" },
26
+ // Ported 1:1 from the Shavin website's rose gradients.
27
+ "mesh-rose": { background: "radial-gradient(circle at 93% 93%, hsla(0, 0%, 0%, 1) 14.5%, transparent 72%), radial-gradient(circle at 26% 9%, hsla(0, 0%, 0%, 1) 0%, transparent 45%), radial-gradient(circle at 15% 79%, hsla(325, 80%, 65%, 0.16) 3%, transparent 35%), radial-gradient(circle at 40% 104%, hsla(14, 85%, 65%, 0.14) 4%, transparent 50%), radial-gradient(circle at 0% 60%, hsla(268, 75%, 68%, 0.16) 2%, transparent 38%), radial-gradient(circle at 92% 37%, hsla(330, 70%, 55%, 0.12) 3%, transparent 35%), radial-gradient(circle at 101% 16%, hsla(18, 90%, 68%, 0.10) 13%, transparent 40%), radial-gradient(circle at 90% 13%, hsla(280, 80%, 68%, 0.14) 1%, transparent 35%), radial-gradient(circle at 104% 56%, hsla(340, 85%, 68%, 0.12) 4%, transparent 25%), radial-gradient(circle at 97% 19%, hsla(260, 65%, 50%, 0.10) 18%, transparent 35%), hsla(0, 0%, 0%, 1)" },
28
+ "mesh-rose-vibrant": { background: "radial-gradient(circle at 93% 93%, hsla(320, 0%, 0%, 1) 14.5%, transparent 72%), radial-gradient(circle at 26% 9%, hsla(320, 0%, 0%, 1) 0%, transparent 45%), radial-gradient(circle at 15% 79%, hsla(323, 90%, 36%, 0.45) 3%, transparent 35%), radial-gradient(circle at 40% 104%, hsla(13, 95%, 52%, 0.42) 4%, transparent 50%), radial-gradient(circle at 0% 60%, hsla(268, 75%, 38%, 0.65) 2%, transparent 38%), radial-gradient(circle at 92% 37%, hsla(335, 78%, 28%, 0.75) 3%, transparent 35%), radial-gradient(circle at 101% 16%, hsla(18, 92%, 58%, 0.28) 13%, transparent 40%), radial-gradient(circle at 90% 13%, hsla(285, 88%, 52%, 0.55) 1%, transparent 35%), radial-gradient(circle at 104% 56%, hsla(340, 85%, 58%, 0.38) 4%, transparent 25%), radial-gradient(circle at 97% 19%, hsla(260, 70%, 25%, 0.35) 18%, transparent 35%), hsla(320, 10%, 2%, 1)" },
29
+ "mesh-peach": { background: "radial-gradient(at 15% 20%, rgba(254,205,211,0.8) 0px, transparent 55%), radial-gradient(at 85% 15%, rgba(253,230,138,0.6) 0px, transparent 50%), radial-gradient(at 60% 95%, rgba(221,214,254,0.75) 0px, transparent 55%), rgb(255 251 245)" }
30
+ };
31
+ const ANIMATABLE_PRESET_PREFIX = "mesh-";
32
+ const ANIMATED_SUFFIX = "-animated";
33
+ const OVERLAY_PRESET_KEYS = Object.keys(OVERLAY_PRESET_STYLES);
34
+ const FX_TOKEN_RE = /^fx:([A-Za-z0-9][\w-]*)(?:\s*\(([\s\S]*)\))?$/;
35
+ const FX_BARE_VALUE_RE = /^[\w.#%+-]+$/;
36
+ function parseFxParams(raw) {
37
+ const out = {};
38
+ let i = 0;
39
+ const n = raw.length;
40
+ while (i < n) {
41
+ while (i < n && /[\s,]/.test(raw[i])) i++;
42
+ if (i >= n) break;
43
+ const keyMatch = /^[A-Za-z_][\w-]*/.exec(raw.slice(i));
44
+ if (!keyMatch) return null;
45
+ const key = keyMatch[0];
46
+ i += key.length;
47
+ if (raw[i] !== "=") return null;
48
+ i++;
49
+ let value = "";
50
+ if (raw[i] === "'") {
51
+ i++;
52
+ while (i < n && raw[i] !== "'") {
53
+ if (raw[i] === "\\" && i + 1 < n) i++;
54
+ value += raw[i++];
55
+ }
56
+ if (raw[i] !== "'") return null;
57
+ i++;
58
+ } else {
59
+ while (i < n && !/[\s,]/.test(raw[i])) value += raw[i++];
60
+ }
61
+ out[key] = value;
62
+ }
63
+ return out;
64
+ }
65
+ function printFxParamValue(v) {
66
+ return FX_BARE_VALUE_RE.test(v) ? v : `'${v.replace(/\\/g, "\\\\").replace(/'/g, "\\'")}'`;
67
+ }
68
+ function parseShorthandToken(token, index) {
69
+ const { core, opacity } = splitTrailingOpacity(token);
70
+ const id = `overlay-${index + 1}`;
71
+ const fxMatch = core.match(FX_TOKEN_RE);
72
+ if (fxMatch) {
73
+ const fxParams = fxMatch[2] !== void 0 ? parseFxParams(fxMatch[2]) : {};
74
+ if (!fxParams) return null;
75
+ return {
76
+ id,
77
+ type: "fx",
78
+ fxKey: fxMatch[1],
79
+ ...Object.keys(fxParams).length ? { fxParams } : {},
80
+ opacity,
81
+ visible: true
82
+ };
83
+ }
84
+ if (core in OVERLAY_PRESET_STYLES) {
85
+ return { id, type: "preset", presetKey: core, opacity, visible: true };
86
+ }
87
+ if (core.endsWith(ANIMATED_SUFFIX)) {
88
+ const base = core.slice(0, -ANIMATED_SUFFIX.length);
89
+ if (base in OVERLAY_PRESET_STYLES && base.startsWith(ANIMATABLE_PRESET_PREFIX)) {
90
+ return { id, type: "preset", presetKey: base, animated: true, opacity, visible: true };
91
+ }
92
+ }
93
+ if (/^#[0-9a-fA-F]{3,8}$/.test(core)) {
94
+ return { id, type: "solid", color: core, opacity, visible: true };
95
+ }
96
+ const tokenMatch = core.match(/^\((.+)\)$/);
97
+ if (tokenMatch) {
98
+ return { id, type: "solid", token: tokenMatch[1].trim(), opacity, visible: true };
99
+ }
100
+ const gradMatch = core.match(/^(linear|radial)\s*\(([\s\S]*)\)$/i);
101
+ if (gradMatch) {
102
+ const gradType = gradMatch[1].toLowerCase();
103
+ const inner = gradMatch[2].trim();
104
+ let angle;
105
+ let position;
106
+ let stopsStr = inner;
107
+ if (gradType === "radial") {
108
+ const posMatch = inner.match(/^at\s+([^,]+?)\s*,\s*([\s\S]*)$/);
109
+ if (posMatch) {
110
+ position = posMatch[1].trim();
111
+ stopsStr = posMatch[2];
112
+ }
113
+ }
114
+ if (gradType === "linear") {
115
+ const angleMatch = inner.match(/^(\d+)deg\s*,\s*([\s\S]*)$/);
116
+ if (angleMatch) {
117
+ angle = parseInt(angleMatch[1], 10);
118
+ stopsStr = angleMatch[2];
119
+ } else {
120
+ angle = 180;
121
+ }
122
+ }
123
+ const stops = parseGradientStops(stopsStr);
124
+ if (stops.length >= 2) {
125
+ return {
126
+ id,
127
+ type: gradType,
128
+ angle,
129
+ position,
130
+ stops,
131
+ opacity,
132
+ visible: true
133
+ };
134
+ }
135
+ }
136
+ return null;
137
+ }
138
+ function splitTrailingOpacity(token) {
139
+ let depth = 0;
140
+ let slashIdx = -1;
141
+ let quoted = false;
142
+ for (let i = token.length - 1; i >= 0; i--) {
143
+ const ch = token[i];
144
+ if (ch === "'" && token[i - 1] !== "\\") {
145
+ quoted = !quoted;
146
+ continue;
147
+ }
148
+ if (quoted) continue;
149
+ if (ch === ")") depth++;
150
+ else if (ch === "(") depth--;
151
+ else if (ch === "/" && depth === 0) {
152
+ slashIdx = i;
153
+ break;
154
+ }
155
+ }
156
+ if (slashIdx > 0) {
157
+ const core = token.slice(0, slashIdx).trim();
158
+ const opStr = token.slice(slashIdx + 1).trim();
159
+ const opVal = parseInt(opStr, 10);
160
+ if (!isNaN(opVal)) {
161
+ return { core, opacity: Math.max(0, Math.min(100, opVal)) };
162
+ }
163
+ }
164
+ return { core: token.trim(), opacity: 100 };
165
+ }
166
+ function parseGradientStops(stopsStr) {
167
+ const stops = [];
168
+ const parts = splitByCommaRespectingParens(stopsStr);
169
+ for (const part of parts) {
170
+ const trimmed = part.trim();
171
+ if (!trimmed) continue;
172
+ const segs = trimmed.split("/").map((s) => s.trim());
173
+ if (segs.length < 2 || segs.length > 3) continue;
174
+ const [colorPart, offsetStr, stopOpStr] = segs;
175
+ const offsetMatch = offsetStr.match(/^(\d+(?:\.\d+)?)%?$/);
176
+ if (!offsetMatch) continue;
177
+ const offset = parseFloat(offsetMatch[1]);
178
+ let opacity = 100;
179
+ if (stopOpStr !== void 0) {
180
+ const opMatch = stopOpStr.match(/^(\d+(?:\.\d+)?)$/);
181
+ if (!opMatch) continue;
182
+ opacity = Math.max(0, Math.min(100, parseFloat(opMatch[1])));
183
+ }
184
+ const tokenMatch = colorPart.match(/^\((.+)\)$/);
185
+ if (tokenMatch) {
186
+ stops.push({ color: "", token: tokenMatch[1].trim(), offset, opacity });
187
+ } else if (/^#[0-9a-fA-F]{3,8}$/.test(colorPart)) {
188
+ stops.push({ color: colorPart, offset, opacity });
189
+ }
190
+ }
191
+ return stops;
192
+ }
193
+ function splitByCommaRespectingParens(str) {
194
+ const parts = [];
195
+ let depth = 0;
196
+ let current = "";
197
+ let quoted = false;
198
+ for (let i = 0; i < str.length; i++) {
199
+ const ch = str[i];
200
+ if (quoted) {
201
+ current += ch;
202
+ if (ch === "\\" && i + 1 < str.length) current += str[++i];
203
+ else if (ch === "'") quoted = false;
204
+ continue;
205
+ }
206
+ if (ch === "'") quoted = true;
207
+ else if (ch === "(") depth++;
208
+ else if (ch === ")") depth--;
209
+ if (ch === "," && depth === 0) {
210
+ parts.push(current);
211
+ current = "";
212
+ } else {
213
+ current += ch;
214
+ }
215
+ }
216
+ if (current.trim()) parts.push(current);
217
+ return parts;
218
+ }
219
+ function parseOverlayShorthand(raw) {
220
+ const tokens = splitByCommaRespectingParens(raw);
221
+ if (tokens.length === 0) return [];
222
+ const layers = [];
223
+ for (let i = 0; i < tokens.length; i++) {
224
+ const token = tokens[i].trim();
225
+ if (!token) continue;
226
+ const layer = parseShorthandToken(token, i);
227
+ if (!layer) return [];
228
+ layers.push(layer);
229
+ }
230
+ return layers;
231
+ }
232
+ function overlayLayersToShorthand(layers) {
233
+ if (layers.length === 0) return null;
234
+ const parts = [];
235
+ for (const layer of layers) {
236
+ if (layer.visible === false) return null;
237
+ const op = layer.opacity ?? 100;
238
+ const opSuffix = op === 100 ? "" : `/${op}`;
239
+ if (layer.type === "preset") {
240
+ if (!layer.presetKey || !(layer.presetKey in OVERLAY_PRESET_STYLES)) return null;
241
+ parts.push(`${layer.presetKey}${layer.animated ? ANIMATED_SUFFIX : ""}${opSuffix}`);
242
+ } else if (layer.type === "solid") {
243
+ if (layer.token) {
244
+ parts.push(`(${layer.token})${opSuffix}`);
245
+ } else if (layer.color) {
246
+ parts.push(`${layer.color}${opSuffix}`);
247
+ } else {
248
+ return null;
249
+ }
250
+ } else if (layer.type === "linear" || layer.type === "radial") {
251
+ if (!layer.stops || layer.stops.length < 2) return null;
252
+ const stopStr = layer.stops.map((s) => {
253
+ const c = s.token ? `(${s.token})` : s.color;
254
+ const stopOp = s.opacity !== void 0 && s.opacity !== 100 ? `/${s.opacity}` : "";
255
+ return `${c}/${s.offset}%${stopOp}`;
256
+ }).join(", ");
257
+ if (layer.type === "linear") {
258
+ const angle = layer.angle ?? 180;
259
+ parts.push(`linear(${angle}deg, ${stopStr})${opSuffix}`);
260
+ } else {
261
+ const at = layer.position && layer.position !== "center" ? `at ${layer.position}, ` : "";
262
+ parts.push(`radial(${at}${stopStr})${opSuffix}`);
263
+ }
264
+ } else if (layer.type === "fx") {
265
+ if (!layer.fxKey || !/^[A-Za-z0-9][\w-]*$/.test(layer.fxKey)) return null;
266
+ const params = Object.entries(layer.fxParams ?? {}).filter(
267
+ ([k, v]) => v !== "" && v != null && /^[A-Za-z_][\w-]*$/.test(k)
268
+ );
269
+ const paramStr = params.length ? `(${params.map(([k, v]) => `${k}=${printFxParamValue(String(v))}`).join(" ")})` : "";
270
+ parts.push(`fx:${layer.fxKey}${paramStr}${opSuffix}`);
271
+ } else {
272
+ return null;
273
+ }
274
+ }
275
+ return parts.join(", ");
276
+ }
277
+ export {
278
+ ANIMATABLE_PRESET_PREFIX,
279
+ ANIMATED_SUFFIX,
280
+ OVERLAY_PRESET_KEYS,
281
+ OVERLAY_PRESET_STYLES,
282
+ overlayLayersToShorthand,
283
+ parseOverlayShorthand
284
+ };