@sanity/ui 3.0.0-static.3 → 3.0.0-static.31

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 (1359) hide show
  1. package/README.md +7 -9
  2. package/dist/_chunks-cjs/_visual-editing.cjs +2357 -0
  3. package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -0
  4. package/dist/_chunks-cjs/refractor.cjs +26 -0
  5. package/dist/_chunks-cjs/refractor.cjs.map +1 -0
  6. package/dist/_chunks-es/_visual-editing.js +2370 -0
  7. package/dist/_chunks-es/_visual-editing.js.map +1 -0
  8. package/dist/_chunks-es/refractor.js +25 -0
  9. package/dist/_chunks-es/refractor.js.map +1 -0
  10. package/dist/_visual-editing.cjs +30 -0
  11. package/dist/_visual-editing.cjs.map +1 -0
  12. package/dist/_visual-editing.d.cts +894 -0
  13. package/dist/_visual-editing.d.ts +504 -418
  14. package/dist/_visual-editing.js +29 -30
  15. package/dist/_visual-editing.js.map +1 -1
  16. package/dist/css/index.cjs +617 -0
  17. package/dist/css/index.cjs.map +1 -0
  18. package/dist/css/index.css +1 -0
  19. package/dist/css/index.d.cts +14902 -0
  20. package/dist/css/index.d.ts +14902 -0
  21. package/dist/css/index.js +617 -0
  22. package/dist/css/index.js.map +1 -0
  23. package/dist/css/layers.css +4 -0
  24. package/dist/css/primitives/popover/popover.css +4 -0
  25. package/dist/index.cjs +2472 -0
  26. package/dist/index.cjs.map +1 -0
  27. package/dist/index.d.cts +3212 -0
  28. package/dist/index.d.ts +1336 -993
  29. package/dist/index.js +1616 -692
  30. package/dist/index.js.map +1 -1
  31. package/dist/theme.cjs +4791 -0
  32. package/dist/theme.cjs.map +1 -0
  33. package/dist/theme.d.cts +1903 -0
  34. package/dist/theme.d.ts +329 -309
  35. package/dist/theme.js +3188 -1384
  36. package/dist/theme.js.map +1 -1
  37. package/exports/_visual-editing.ts +26 -27
  38. package/exports/index.ts +1 -1
  39. package/package.json +81 -93
  40. package/src/core/__DEV__.ts +5 -0
  41. package/src/core/_compat/helpers.ts +72 -0
  42. package/src/core/_compat/styles/_responsive.ts +19 -0
  43. package/src/core/_compat/theme/theme.test.tsx +73 -0
  44. package/src/core/_compat/theme/themeColorProvider.tsx +24 -0
  45. package/src/core/_compat/theme/themeContext.ts +10 -0
  46. package/src/core/_compat/theme/themeProvider.tsx +68 -0
  47. package/src/core/_compat/theme/types.ts +10 -0
  48. package/src/core/_compat/theme/useRootTheme.ts +15 -0
  49. package/src/core/_compat/theme/useTheme.ts +12 -0
  50. package/src/core/_compat/types.ts +191 -0
  51. package/src/core/components/autocomplete/__workshop__/async.tsx +156 -0
  52. package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +131 -0
  53. package/src/core/components/autocomplete/__workshop__/custom.tsx +91 -0
  54. package/src/core/components/autocomplete/__workshop__/example.tsx +80 -0
  55. package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +36 -0
  56. package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +292 -0
  57. package/src/core/components/autocomplete/__workshop__/index.ts +39 -0
  58. package/src/core/components/autocomplete/autocomplete.tsx +690 -0
  59. package/src/core/components/autocomplete/autocompleteOption.tsx +45 -0
  60. package/src/core/components/autocomplete/autocompleteReducer.ts +47 -0
  61. package/src/core/components/autocomplete/constants.ts +28 -0
  62. package/src/core/components/autocomplete/types.ts +103 -0
  63. package/src/core/components/breadcrumbs/__workshop__/example.tsx +61 -0
  64. package/src/core/components/breadcrumbs/breadcrumbs.tsx +136 -0
  65. package/src/core/components/dialog/__workshop__/activate.tsx +141 -0
  66. package/src/core/components/dialog/__workshop__/autoFocus.tsx +29 -0
  67. package/src/core/components/dialog/__workshop__/onScroll.tsx +51 -0
  68. package/src/core/components/dialog/__workshop__/panes.tsx +89 -0
  69. package/src/core/components/dialog/__workshop__/position.tsx +30 -0
  70. package/src/core/components/dialog/__workshop__/props.tsx +77 -0
  71. package/src/core/components/dialog/__workshop__/wrapped.tsx +76 -0
  72. package/src/core/components/dialog/dialog.tsx +233 -0
  73. package/src/core/components/dialog/dialogCard.tsx +233 -0
  74. package/src/core/components/dialog/dialogContext.ts +22 -0
  75. package/src/core/components/dialog/dialogProvider.tsx +34 -0
  76. package/src/core/components/dialog/isTargetWithinScope.ts +14 -0
  77. package/src/core/components/dialog/types.ts +2 -0
  78. package/src/core/components/dialog/useDialog.ts +11 -0
  79. package/src/core/components/hotkeys/hotkeys.tsx +71 -0
  80. package/src/core/components/menu/__workshop__/asComponent.tsx +45 -0
  81. package/src/core/components/menu/__workshop__/avatarMenu.tsx +57 -0
  82. package/src/core/components/menu/__workshop__/closableMenuButton.tsx +47 -0
  83. package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +133 -0
  84. package/src/core/components/menu/__workshop__/customMenuItem.tsx +45 -0
  85. package/src/core/components/menu/__workshop__/customSelectedState.tsx +35 -0
  86. package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +40 -0
  87. package/src/core/components/menu/__workshop__/groups.tsx +156 -0
  88. package/src/core/components/menu/__workshop__/menuButton.tsx +80 -0
  89. package/src/core/components/menu/__workshop__/menuGroupRight.tsx +65 -0
  90. package/src/core/components/menu/__workshop__/nestedMenu.tsx +22 -0
  91. package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +50 -0
  92. package/src/core/components/menu/__workshop__/selectedItem.tsx +69 -0
  93. package/src/core/components/menu/__workshop__/shouldFocus.tsx +42 -0
  94. package/src/core/components/menu/__workshop__/tones.tsx +25 -0
  95. package/src/core/components/menu/__workshop__/withoutArrow.tsx +32 -0
  96. package/src/core/components/menu/helpers.ts +82 -0
  97. package/src/core/components/menu/menu.test.tsx +128 -0
  98. package/src/core/components/menu/menu.tsx +194 -0
  99. package/src/core/components/menu/menuButton.tsx +271 -0
  100. package/src/core/components/menu/menuContext.ts +31 -0
  101. package/src/core/components/menu/menuDivider.tsx +32 -0
  102. package/src/core/components/menu/menuGroup.tsx +238 -0
  103. package/src/core/components/menu/menuItem.tsx +194 -0
  104. package/src/core/components/menu/useMenu.ts +21 -0
  105. package/src/core/components/menu/useMenuController.ts +241 -0
  106. package/src/core/components/tab/__workshop__/example.tsx +79 -0
  107. package/src/core/components/tab/tab.tsx +107 -0
  108. package/src/core/components/tab/tabList.tsx +95 -0
  109. package/src/core/components/tab/tabPanel.tsx +47 -0
  110. package/src/core/components/toast/__workshop__/hook.tsx +71 -0
  111. package/src/core/components/toast/__workshop__/toast.tsx +26 -0
  112. package/src/core/components/toast/toast.test.tsx +102 -0
  113. package/src/core/components/toast/toast.tsx +189 -0
  114. package/src/core/components/toast/toastContext.ts +7 -0
  115. package/src/core/components/toast/toastLayer.tsx +54 -0
  116. package/src/core/components/toast/toastProvider.tsx +112 -0
  117. package/src/core/components/toast/types.ts +24 -0
  118. package/src/core/components/toast/useToast.ts +23 -0
  119. package/src/core/components/tree/__workshop__/basic.perf.ts +19 -0
  120. package/src/core/components/tree/__workshop__/basic.tsx +105 -0
  121. package/src/core/components/tree/__workshop__/tabFromElement.tsx +84 -0
  122. package/src/core/components/tree/helpers.ts +105 -0
  123. package/src/core/components/tree/tree.tsx +249 -0
  124. package/src/core/components/tree/treeContext.ts +10 -0
  125. package/src/core/components/tree/treeGroup.tsx +48 -0
  126. package/src/core/components/tree/treeItem.tsx +237 -0
  127. package/src/core/components/tree/types.ts +24 -0
  128. package/src/core/components/tree/useTree.ts +17 -0
  129. package/src/core/components/virtualList/__workshop__/index.ts +29 -0
  130. package/src/core/components/virtualList/__workshop__/infiniteList.tsx +48 -0
  131. package/src/core/components/virtualList/virtualList.tsx +209 -0
  132. package/src/core/constants.ts +85 -0
  133. package/src/core/helpers/focus.ts +92 -0
  134. package/src/core/helpers/props.ts +28 -0
  135. package/src/core/hooks/useArrayProp.ts +26 -0
  136. package/src/core/hooks/useClickOutside.test.tsx +481 -0
  137. package/src/core/hooks/useClickOutside.ts +113 -0
  138. package/src/core/hooks/useClickOutsideEvent.test.tsx +114 -0
  139. package/src/core/hooks/useClickOutsideEvent.ts +67 -0
  140. package/src/core/hooks/useDelayed.test.ts +67 -0
  141. package/src/core/hooks/useDelayedState.ts +28 -0
  142. package/src/core/hooks/useElementRect/__workshop__/example.tsx +30 -0
  143. package/src/core/hooks/useElementSize.ts +19 -0
  144. package/src/core/hooks/useForwardedRef.ts +19 -0
  145. package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +14 -0
  146. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +21 -0
  147. package/src/core/hooks/useMediaIndex/useMediaIndex.ts +102 -0
  148. package/src/core/hooks/usePrefersDark.hydration.test.tsx +56 -0
  149. package/src/core/hooks/usePrefersDark.test.tsx +20 -0
  150. package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +56 -0
  151. package/src/core/hooks/usePrefersReducedMotion.test.tsx +20 -0
  152. package/src/core/hooks/useResponsiveProp.ts +28 -0
  153. package/src/core/index.ts +136 -0
  154. package/src/core/lib/createGlobalScopedContext.ts +37 -0
  155. package/src/core/lib/globalScope.ts +19 -0
  156. package/src/core/lib/isArray.ts +3 -0
  157. package/src/core/middleware/origin.ts +47 -0
  158. package/src/core/observers/elementSize.ts +116 -0
  159. package/src/core/primitives/arrow/arrow.tsx +74 -0
  160. package/src/core/primitives/avatar/__workshop__/asButton.tsx +14 -0
  161. package/src/core/primitives/avatar/__workshop__/stack.tsx +25 -0
  162. package/src/core/primitives/avatar/__workshop__/withinButton.tsx +55 -0
  163. package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +72 -0
  164. package/src/core/primitives/avatar/avatar.tsx +154 -0
  165. package/src/core/primitives/avatar/avatarCounter.tsx +69 -0
  166. package/src/core/primitives/avatar/avatarStack.tsx +81 -0
  167. package/src/core/primitives/avatar/types.ts +34 -0
  168. package/src/core/primitives/badge/__workshop__/props.tsx +19 -0
  169. package/src/core/primitives/badge/__workshop__/tones.tsx +16 -0
  170. package/src/core/primitives/badge/badge.test.tsx +15 -0
  171. package/src/core/primitives/badge/badge.tsx +60 -0
  172. package/src/core/primitives/badge/types.ts +18 -0
  173. package/src/core/primitives/box/__workshop__/props.tsx +20 -0
  174. package/src/core/primitives/box/__workshop__/responsive.tsx +20 -0
  175. package/src/core/primitives/box/box.tsx +219 -0
  176. package/src/core/primitives/button/__workshop__/custom.tsx +27 -0
  177. package/src/core/primitives/button/__workshop__/customIcons.tsx +30 -0
  178. package/src/core/primitives/button/__workshop__/disabled.tsx +54 -0
  179. package/src/core/primitives/button/__workshop__/index.ts +64 -0
  180. package/src/core/primitives/button/__workshop__/props.tsx +55 -0
  181. package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +36 -0
  182. package/src/core/primitives/button/__workshop__/stacked.tsx +58 -0
  183. package/src/core/primitives/button/__workshop__/textOverflow.tsx +13 -0
  184. package/src/core/primitives/button/__workshop__/uploadButton.tsx +29 -0
  185. package/src/core/primitives/button/button.test.tsx +29 -0
  186. package/src/core/primitives/button/button.tsx +196 -0
  187. package/src/core/primitives/button/types.ts +22 -0
  188. package/src/core/primitives/card/__workshop__/asButton.tsx +107 -0
  189. package/src/core/primitives/card/__workshop__/asComponent.tsx +27 -0
  190. package/src/core/primitives/card/__workshop__/checkered.tsx +26 -0
  191. package/src/core/primitives/card/__workshop__/index.ts +18 -0
  192. package/src/core/primitives/card/__workshop__/interactive.tsx +29 -0
  193. package/src/core/primitives/card/__workshop__/listNavigation.tsx +78 -0
  194. package/src/core/primitives/card/__workshop__/props.tsx +52 -0
  195. package/src/core/primitives/card/__workshop__/selected.tsx +62 -0
  196. package/src/core/primitives/card/__workshop__/tones.tsx +27 -0
  197. package/src/core/primitives/card/card.tsx +106 -0
  198. package/src/core/primitives/card/cardContext.ts +10 -0
  199. package/src/core/primitives/card/cardProvider.tsx +27 -0
  200. package/src/core/primitives/card/types.ts +31 -0
  201. package/src/core/primitives/card/useCard.ts +9 -0
  202. package/src/core/primitives/checkbox/__workshop__/props.tsx +35 -0
  203. package/src/core/primitives/checkbox/__workshop__/tones.tsx +27 -0
  204. package/src/core/primitives/checkbox/checkbox.tsx +80 -0
  205. package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +23 -0
  206. package/src/core/primitives/code/__workshop__/props.tsx +18 -0
  207. package/src/core/primitives/code/code.tsx +46 -0
  208. package/src/core/primitives/code/refractor.tsx +18 -0
  209. package/src/core/primitives/container/__workshop__/example.tsx +20 -0
  210. package/src/core/primitives/container/container.tsx +37 -0
  211. package/src/core/primitives/flex/__workshop__/example.tsx +34 -0
  212. package/src/core/primitives/flex/flex.tsx +56 -0
  213. package/src/core/primitives/flex/types.ts +27 -0
  214. package/src/core/primitives/grid/grid.tsx +33 -0
  215. package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +54 -0
  216. package/src/core/primitives/heading/__workshop__/plain.tsx +29 -0
  217. package/src/core/primitives/heading/heading.tsx +80 -0
  218. package/src/core/primitives/inline/__workshop__/plain.tsx +24 -0
  219. package/src/core/primitives/inline/inline.tsx +69 -0
  220. package/src/core/primitives/kbd/kbd.tsx +55 -0
  221. package/src/core/primitives/label/__workshop__/plain.tsx +28 -0
  222. package/src/core/primitives/label/label.tsx +77 -0
  223. package/src/core/primitives/layer/__workshop__/index.ts +24 -0
  224. package/src/core/primitives/layer/__workshop__/multipleRoots.tsx +49 -0
  225. package/src/core/primitives/layer/__workshop__/nested.tsx +98 -0
  226. package/src/core/primitives/layer/__workshop__/responsiveZOffset.tsx +17 -0
  227. package/src/core/primitives/layer/getLayerContext.test.ts +32 -0
  228. package/src/core/primitives/layer/getLayerContext.ts +21 -0
  229. package/src/core/primitives/layer/layer.test.tsx +109 -0
  230. package/src/core/primitives/layer/layer.tsx +42 -0
  231. package/src/core/primitives/layer/layerCard.tsx +90 -0
  232. package/src/core/primitives/layer/layerContext.ts +7 -0
  233. package/src/core/primitives/layer/layerProvider.tsx +114 -0
  234. package/src/core/primitives/layer/useLayer.ts +24 -0
  235. package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +77 -0
  236. package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +32 -0
  237. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +71 -0
  238. package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +69 -0
  239. package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +96 -0
  240. package/src/core/primitives/popover/__workshop__/TestStory.tsx +100 -0
  241. package/src/core/primitives/popover/constants.ts +22 -0
  242. package/src/core/primitives/popover/floating-ui/size.ts +83 -0
  243. package/src/core/primitives/popover/helpers.ts +32 -0
  244. package/src/core/primitives/popover/popover.tsx +428 -0
  245. package/src/core/primitives/popover/popoverLayer.tsx +149 -0
  246. package/src/core/primitives/popover/types.ts +12 -0
  247. package/src/core/primitives/radio/__workshop__/example.tsx +63 -0
  248. package/src/core/primitives/radio/__workshop__/plain.tsx +28 -0
  249. package/src/core/primitives/radio/radio.tsx +64 -0
  250. package/src/core/primitives/root/Root.tsx +84 -0
  251. package/src/core/primitives/root/RootProvider.tsx +40 -0
  252. package/src/core/primitives/root/__workshop__/boundary.tsx +5 -0
  253. package/src/core/primitives/root/__workshop__/index.ts +8 -0
  254. package/src/core/primitives/select/__workshop__/plain.tsx +39 -0
  255. package/src/core/primitives/select/__workshop__/readOnly.tsx +23 -0
  256. package/src/core/primitives/select/select.tsx +85 -0
  257. package/src/core/primitives/selectable/selectable.tsx +50 -0
  258. package/src/core/primitives/selectable/types.ts +7 -0
  259. package/src/core/primitives/skeleton/__workshop__/delay.tsx +70 -0
  260. package/src/core/primitives/skeleton/__workshop__/index.ts +11 -0
  261. package/src/core/primitives/skeleton/__workshop__/skeleton.tsx +64 -0
  262. package/src/core/primitives/skeleton/codeSkeleton.tsx +49 -0
  263. package/src/core/primitives/skeleton/headingSkeleton.tsx +48 -0
  264. package/src/core/primitives/skeleton/labelSkeleton.tsx +47 -0
  265. package/src/core/primitives/skeleton/skeleton.tsx +71 -0
  266. package/src/core/primitives/skeleton/textSkeleton.tsx +49 -0
  267. package/src/core/primitives/spinner/__workshop__/Props.tsx +15 -0
  268. package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +14 -0
  269. package/src/core/primitives/spinner/spinner.tsx +45 -0
  270. package/src/core/primitives/srOnly/srOnly.tsx +33 -0
  271. package/src/core/primitives/stack/__workshop__/plain.tsx +32 -0
  272. package/src/core/primitives/stack/stack.tsx +65 -0
  273. package/src/core/primitives/switch/switch.tsx +84 -0
  274. package/src/core/primitives/text/__workshop__/colored.tsx +23 -0
  275. package/src/core/primitives/text/__workshop__/example.tsx +28 -0
  276. package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +23 -0
  277. package/src/core/primitives/text/text.tsx +74 -0
  278. package/src/core/primitives/textArea/__workshop__/plain.tsx +61 -0
  279. package/src/core/primitives/textArea/textArea.tsx +94 -0
  280. package/src/core/primitives/textInput/__workshop__/customValidity.tsx +17 -0
  281. package/src/core/primitives/textInput/__workshop__/plain.tsx +110 -0
  282. package/src/core/primitives/textInput/__workshop__/states.tsx +53 -0
  283. package/src/core/primitives/textInput/__workshop__/tones.tsx +277 -0
  284. package/src/core/primitives/textInput/__workshop__/typed.tsx +23 -0
  285. package/src/core/primitives/textInput/textInput.tsx +261 -0
  286. package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +102 -0
  287. package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +74 -0
  288. package/src/core/primitives/tooltip/__workshop__/props.tsx +112 -0
  289. package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +86 -0
  290. package/src/core/primitives/tooltip/constants.ts +23 -0
  291. package/src/core/primitives/tooltip/tooltip.test.tsx +454 -0
  292. package/src/core/primitives/tooltip/tooltip.tsx +489 -0
  293. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +11 -0
  294. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +53 -0
  295. package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +13 -0
  296. package/src/core/primitives/tooltip/tooltipLayer.tsx +106 -0
  297. package/src/core/primitives/types.ts +153 -0
  298. package/src/core/types/props.ts +29 -0
  299. package/src/core/types/radius.ts +7 -0
  300. package/src/core/utils/boundaryElement/boundaryElement.test.tsx +101 -0
  301. package/src/core/utils/boundaryElement/boundaryElementContext.ts +7 -0
  302. package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +18 -0
  303. package/src/core/utils/boundaryElement/types.ts +5 -0
  304. package/src/core/utils/boundaryElement/useBoundaryElement.ts +24 -0
  305. package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +41 -0
  306. package/src/core/utils/elementQuery/elementQuery.tsx +75 -0
  307. package/src/core/utils/errorBoundary.tsx +50 -0
  308. package/src/core/utils/getElementRef.ts +29 -0
  309. package/src/core/utils/portal/__workshop__/named.tsx +63 -0
  310. package/src/core/utils/portal/portal.test.tsx +104 -0
  311. package/src/core/utils/portal/portal.tsx +40 -0
  312. package/src/core/utils/portal/portalContext.ts +34 -0
  313. package/src/core/utils/portal/portalProvider.tsx +73 -0
  314. package/src/core/utils/portal/types.ts +7 -0
  315. package/src/core/utils/portal/usePortal.ts +23 -0
  316. package/src/css/_assign.ts +3 -0
  317. package/src/css/_composeClassNames.ts +12 -0
  318. package/src/css/_fromEntries.ts +3 -0
  319. package/src/css/_getClassNames.ts +9 -0
  320. package/src/css/_responsiveClassName.ts +45 -0
  321. package/src/css/_responsiveStyle.css.ts +34 -0
  322. package/src/css/_style.css.ts +9 -0
  323. package/src/css/components/breadcrumbs/breadcrumbs.css.ts +6 -0
  324. package/src/css/components/breadcrumbs/breadcrumbs.ts +5 -3
  325. package/src/css/components/dialog/dialog.css.ts +106 -0
  326. package/src/css/components/dialog/dialog.ts +42 -14
  327. package/src/css/components/menu/menu.css.ts +14 -0
  328. package/src/css/components/menu/menu.ts +8 -5
  329. package/src/css/components/skeleton/skeleton.css.ts +132 -0
  330. package/src/css/components/skeleton/skeleton.ts +16 -9
  331. package/src/css/components/skeleton/types.ts +16 -6
  332. package/src/css/components/toast/toast.css.ts +17 -0
  333. package/src/css/components/toast/toast.ts +5 -15
  334. package/src/css/components/tree/tree.css.ts +65 -0
  335. package/src/css/components/tree/tree.ts +5 -3
  336. package/src/css/constants.ts +10 -1
  337. package/src/css/defaultTheme.css.ts +521 -0
  338. package/src/css/index.ts +141 -39
  339. package/src/css/layers.css.ts +9 -0
  340. package/src/css/primitives/_arrow/_arrow.css.ts +68 -0
  341. package/src/css/primitives/_arrow/_arrow.ts +16 -4
  342. package/src/css/primitives/_input/_input.css.ts +261 -0
  343. package/src/css/primitives/_input/input.ts +16 -12
  344. package/src/css/primitives/_input/types.ts +4 -3
  345. package/src/css/primitives/_selectable/_selectable.css.ts +131 -0
  346. package/src/css/primitives/_selectable/selectable.ts +5 -5
  347. package/src/css/primitives/_selectable/types.ts +3 -2
  348. package/src/css/primitives/avatar/avatar.css.ts +198 -0
  349. package/src/css/primitives/avatar/avatar.ts +52 -11
  350. package/src/css/primitives/avatar/types.ts +5 -3
  351. package/src/css/primitives/badge/badge.css.ts +27 -0
  352. package/src/css/primitives/badge/badge.ts +4 -4
  353. package/src/css/primitives/badge/types.ts +4 -5
  354. package/src/css/primitives/box/box.css.ts +19 -0
  355. package/src/css/primitives/box/box.ts +63 -31
  356. package/src/css/primitives/box/types.ts +56 -30
  357. package/src/css/primitives/button/button.css.ts +287 -0
  358. package/src/css/primitives/button/button.ts +19 -34
  359. package/src/css/primitives/button/types.ts +12 -0
  360. package/src/css/primitives/card/__workshop__/color.tsx +75 -0
  361. package/src/css/primitives/card/__workshop__/index.ts +14 -0
  362. package/src/css/primitives/card/card.css.ts +370 -0
  363. package/src/css/primitives/card/card.ts +9 -10
  364. package/src/css/primitives/card/types.ts +4 -6
  365. package/src/css/primitives/checkbox/checkbox.css.ts +193 -0
  366. package/src/css/primitives/checkbox/checkbox.ts +13 -5
  367. package/src/css/primitives/code/code.css.ts +271 -0
  368. package/src/css/primitives/code/code.ts +15 -5
  369. package/src/css/primitives/code/types.ts +5 -3
  370. package/src/css/primitives/container/container.css.ts +4 -0
  371. package/src/css/primitives/container/container.ts +14 -4
  372. package/src/css/primitives/container/types.ts +4 -2
  373. package/src/css/primitives/heading/heading.css.ts +85 -0
  374. package/src/css/primitives/heading/heading.ts +16 -11
  375. package/src/css/primitives/heading/types.ts +8 -3
  376. package/src/css/primitives/kbd/kbd.css.ts +16 -0
  377. package/src/css/primitives/kbd/kbd.ts +6 -4
  378. package/src/css/primitives/kbd/types.ts +2 -3
  379. package/src/css/primitives/label/label.css.ts +86 -0
  380. package/src/css/primitives/label/label.ts +16 -10
  381. package/src/css/primitives/label/types.ts +15 -5
  382. package/src/css/primitives/popover/popover.css.ts +6 -0
  383. package/src/css/primitives/popover/popover.ts +10 -3
  384. package/src/css/primitives/radio/radio.css.ts +78 -0
  385. package/src/css/primitives/radio/radio.ts +15 -3
  386. package/src/css/primitives/root/root.css.ts +15 -0
  387. package/src/css/primitives/root/root.ts +17 -0
  388. package/src/css/primitives/root/types.ts +10 -0
  389. package/src/css/primitives/select/select.css.ts +24 -0
  390. package/src/css/primitives/select/select.ts +8 -6
  391. package/src/css/primitives/select/types.ts +1 -1
  392. package/src/css/primitives/spinner/spinner.css.ts +23 -0
  393. package/src/css/primitives/spinner/spinner.ts +9 -5
  394. package/src/css/primitives/spinner/types.ts +4 -0
  395. package/src/css/primitives/srOnly/srOnly.css.ts +10 -0
  396. package/src/css/primitives/srOnly/srOnly.ts +7 -0
  397. package/src/css/primitives/stack/stack.css.ts +6 -0
  398. package/src/css/primitives/stack/stack.ts +7 -0
  399. package/src/css/primitives/switch/switch.css.ts +98 -0
  400. package/src/css/primitives/switch/switch.ts +13 -7
  401. package/src/css/primitives/text/text.css.ts +85 -0
  402. package/src/css/primitives/text/text.ts +18 -11
  403. package/src/css/primitives/text/types.ts +12 -3
  404. package/src/css/primitives/textArea/textArea.css.ts +4 -0
  405. package/src/css/primitives/textArea/textArea.ts +6 -5
  406. package/src/css/primitives/textArea/types.ts +5 -3
  407. package/src/css/primitives/textInput/textInput.css.ts +41 -0
  408. package/src/css/primitives/textInput/textInput.ts +21 -5
  409. package/src/css/primitives/textInput/types.ts +3 -7
  410. package/src/css/primitives/tooltip/tooltip.css.ts +4 -0
  411. package/src/css/primitives/tooltip/tooltip.ts +6 -7
  412. package/src/css/primitives/tooltip/types.ts +4 -0
  413. package/src/css/props/alignItems/alignItems.css.ts +22 -0
  414. package/src/css/props/alignItems/alignItems.ts +8 -0
  415. package/src/css/props/alignItems/types.ts +9 -0
  416. package/src/css/props/border/border.css.ts +65 -0
  417. package/src/css/props/border/border.ts +36 -0
  418. package/src/css/props/border/types.ts +13 -0
  419. package/src/css/props/boxSizing/boxSizing.css.ts +11 -0
  420. package/src/css/props/boxSizing/boxSizing.ts +10 -0
  421. package/src/css/props/boxSizing/types.ts +7 -0
  422. package/src/css/props/display/display.css.ts +56 -0
  423. package/src/css/props/display/display.ts +17 -0
  424. package/src/css/props/display/types.ts +16 -0
  425. package/src/css/props/flex/flex.css.ts +52 -0
  426. package/src/css/props/flex/flex.ts +8 -0
  427. package/src/css/props/flex/types.ts +9 -0
  428. package/src/css/props/flexDirection/flexDirection.css.ts +19 -0
  429. package/src/css/props/flexDirection/flexDirection.ts +8 -0
  430. package/src/css/props/flexDirection/types.ts +9 -0
  431. package/src/css/props/flexWrap/flexWrap.css.ts +16 -0
  432. package/src/css/props/flexWrap/flexWrap.ts +8 -0
  433. package/src/css/props/flexWrap/types.ts +9 -0
  434. package/src/css/props/font/font.css.ts +93 -0
  435. package/src/css/props/font/font.ts +8 -0
  436. package/src/css/props/font/types.ts +6 -0
  437. package/src/css/props/gap/gap.css.ts +40 -0
  438. package/src/css/props/gap/gap.ts +13 -0
  439. package/src/css/props/gap/types.ts +10 -0
  440. package/src/css/props/gridAutoColumns/gridAutoColumns.css.ts +19 -0
  441. package/src/css/props/gridAutoColumns/gridAutoColumns.ts +8 -0
  442. package/src/css/props/gridAutoColumns/types.ts +19 -0
  443. package/src/css/props/gridAutoFlow/gridAutoFlow.css.ts +19 -0
  444. package/src/css/props/gridAutoFlow/gridAutoFlow.ts +8 -0
  445. package/src/css/props/gridAutoFlow/types.ts +13 -0
  446. package/src/css/props/gridAutoRows/gridAutoRows.css.ts +19 -0
  447. package/src/css/props/gridAutoRows/gridAutoRows.ts +8 -0
  448. package/src/css/props/gridAutoRows/types.ts +13 -0
  449. package/src/css/props/gridColumn/gridColumn.css.ts +49 -0
  450. package/src/css/props/gridColumn/gridColumn.ts +8 -0
  451. package/src/css/props/gridColumn/types.ts +19 -0
  452. package/src/css/props/gridColumnEnd/gridColumnEnd.css.ts +46 -0
  453. package/src/css/props/gridColumnEnd/gridColumnEnd.ts +8 -0
  454. package/src/css/props/gridColumnEnd/types.ts +19 -0
  455. package/src/css/props/gridColumnStart/gridColumnStart.css.ts +46 -0
  456. package/src/css/props/gridColumnStart/gridColumnStart.ts +11 -0
  457. package/src/css/props/gridColumnStart/types.ts +19 -0
  458. package/src/css/props/gridRow/gridRow.css.ts +49 -0
  459. package/src/css/props/gridRow/gridRow.ts +8 -0
  460. package/src/css/props/gridRow/types.ts +19 -0
  461. package/src/css/props/gridRowEnd/gridRowEnd.css.ts +46 -0
  462. package/src/css/props/gridRowEnd/gridRowEnd.ts +8 -0
  463. package/src/css/props/gridRowEnd/types.ts +19 -0
  464. package/src/css/props/gridRowStart/gridRowStart.css.ts +46 -0
  465. package/src/css/props/gridRowStart/gridRowStart.ts +8 -0
  466. package/src/css/props/gridRowStart/types.ts +19 -0
  467. package/src/css/props/gridTemplateColumns/gridTemplateColumns.css.ts +43 -0
  468. package/src/css/props/gridTemplateColumns/gridTemplateColumns.ts +8 -0
  469. package/src/css/props/gridTemplateColumns/types.ts +19 -0
  470. package/src/css/props/gridTemplateRows/gridTemplateRows.css.ts +43 -0
  471. package/src/css/props/gridTemplateRows/gridTemplateRows.ts +8 -0
  472. package/src/css/props/gridTemplateRows/types.ts +19 -0
  473. package/src/css/props/height/height.css.ts +25 -0
  474. package/src/css/props/height/height.ts +8 -0
  475. package/src/css/props/height/types.ts +15 -0
  476. package/src/css/props/inset/inset.css.ts +37 -0
  477. package/src/css/props/inset/inset.ts +21 -0
  478. package/src/css/props/inset/types.ts +13 -0
  479. package/src/css/props/justifyContent/justifyContent.css.ts +25 -0
  480. package/src/css/props/justifyContent/justifyContent.ts +8 -0
  481. package/src/css/props/justifyContent/types.ts +15 -0
  482. package/src/css/props/margin/margin.css.ts +117 -0
  483. package/src/css/props/margin/margin.ts +25 -0
  484. package/src/css/props/margin/types.ts +17 -0
  485. package/src/css/props/maxWidth/maxWidth.css.ts +32 -0
  486. package/src/css/props/maxWidth/maxWidth.ts +8 -0
  487. package/src/css/props/maxWidth/types.ts +11 -0
  488. package/src/css/props/minHeight/minHeight.css.ts +13 -0
  489. package/src/css/props/minHeight/minHeight.ts +8 -0
  490. package/src/css/props/minHeight/types.ts +9 -0
  491. package/src/css/props/minWidth/minWidth.css.ts +25 -0
  492. package/src/css/props/minWidth/minWidth.ts +8 -0
  493. package/src/css/props/minWidth/types.ts +9 -0
  494. package/src/css/props/outline/outline.css.ts +10 -0
  495. package/src/css/props/outline/outline.ts +8 -0
  496. package/src/css/props/outline/types.ts +7 -0
  497. package/src/css/props/overflow/overflow.css.ts +16 -0
  498. package/src/css/props/overflow/overflow.ts +8 -0
  499. package/src/css/props/overflow/types.ts +17 -0
  500. package/src/css/props/padding/padding.css.ts +87 -0
  501. package/src/css/props/padding/padding.ts +25 -0
  502. package/src/css/props/padding/types.ts +17 -0
  503. package/src/css/props/pointerEvents/pointerEvents.css.ts +13 -0
  504. package/src/css/props/pointerEvents/pointerEvents.ts +8 -0
  505. package/src/css/props/position/position.css.ts +22 -0
  506. package/src/css/props/position/position.ts +8 -0
  507. package/src/css/props/position/types.ts +9 -0
  508. package/src/css/props/radius/radius.css.ts +21 -0
  509. package/src/css/props/radius/radius.ts +8 -0
  510. package/src/css/props/radius/types.ts +8 -0
  511. package/src/css/props/shadow/shadow.css.ts +23 -0
  512. package/src/css/props/shadow/shadow.ts +8 -0
  513. package/src/css/props/shadow/types.ts +8 -0
  514. package/src/css/props/textAlign/textAlign.css.ts +22 -0
  515. package/src/css/props/textAlign/textAlign.ts +8 -0
  516. package/src/css/props/textAlign/types.ts +7 -0
  517. package/src/css/props/textOverflow/textOverflow.css.ts +19 -0
  518. package/src/css/props/textOverflow/textOverflow.ts +8 -0
  519. package/src/css/props/textOverflow/types.ts +12 -0
  520. package/src/css/props/width/types.ts +11 -0
  521. package/src/css/props/width/width.css.ts +31 -0
  522. package/src/css/props/width/width.ts +8 -0
  523. package/src/css/types.ts +221 -810
  524. package/src/css/util.ts +3 -8
  525. package/src/css/vars.css.ts +676 -0
  526. package/src/theme/getScopedTheme.ts +4 -4
  527. package/src/theme/index.ts +0 -5
  528. package/src/theme/types.ts +6 -10
  529. package/src/theme/v0/color/_generic.ts +1 -1
  530. package/src/theme/v0/color/button.ts +1 -1
  531. package/src/theme/v0/color/card.ts +1 -1
  532. package/src/theme/v0/color/color.ts +11 -11
  533. package/src/theme/v0/color/input.ts +1 -1
  534. package/src/theme/v0/color/muted.ts +1 -1
  535. package/src/theme/v0/color/selectable.ts +1 -1
  536. package/src/theme/v0/color/solid.ts +1 -1
  537. package/src/theme/v0/color/spot.ts +1 -1
  538. package/src/theme/v0/css.ts +2 -0
  539. package/src/theme/v0/focusRing.ts +1 -3
  540. package/src/theme/v0/font.ts +6 -19
  541. package/src/theme/v0/layer.ts +1 -3
  542. package/src/theme/v0/shadow.ts +2 -6
  543. package/src/theme/v0/styles.ts +1 -1
  544. package/src/theme/v0/theme.ts +7 -7
  545. package/src/theme/v2/avatar.ts +2 -4
  546. package/src/theme/v2/build/_deprecated/color/_selectable/createSelectableTones.ts +76 -0
  547. package/src/theme/v2/build/_deprecated/color/_solid/createSolidTones.ts +54 -0
  548. package/src/theme/v2/build/_deprecated/color/button/createButtonModes.ts +22 -0
  549. package/src/theme/v2/build/_deprecated/color/button/createButtonTones.ts +55 -0
  550. package/src/theme/v2/build/_deprecated/color/card/createCardStates.ts +60 -0
  551. package/src/theme/v2/build/_deprecated/color/color.test.ts +63 -0
  552. package/src/theme/v2/build/_deprecated/color/defaults.ts +390 -0
  553. package/src/theme/v2/build/_deprecated/color/factory.ts +141 -0
  554. package/src/theme/v2/build/_deprecated/color/input/createInputModes.ts +86 -0
  555. package/src/theme/v2/build/_deprecated/color/muted/createMuted.ts +54 -0
  556. package/src/theme/v2/build/_deprecated/color/spot/createSpot.ts +20 -0
  557. package/src/theme/v2/build/buildColorTheme.test.ts +185 -0
  558. package/src/theme/v2/build/buildColorTheme.ts +494 -0
  559. package/src/theme/v2/build/buildTheme.test.ts +89 -0
  560. package/src/theme/v2/build/buildTheme.ts +37 -0
  561. package/src/theme/v2/build/colorToken/colorToken.ts +19 -0
  562. package/src/theme/v2/build/colorToken/compileColorToken.ts +21 -0
  563. package/src/theme/v2/build/colorToken/types.ts +6 -0
  564. package/src/theme/v2/build/lib/color-fns/blend/mix.ts +21 -0
  565. package/src/theme/v2/build/lib/color-fns/blend/multiply.ts +18 -0
  566. package/src/theme/v2/build/lib/color-fns/blend/screen.ts +18 -0
  567. package/src/theme/v2/build/lib/color-fns/color-fns.test.ts +68 -0
  568. package/src/theme/v2/build/lib/color-fns/contrastRatio.ts +34 -0
  569. package/src/theme/v2/build/lib/color-fns/convert.ts +150 -0
  570. package/src/theme/v2/build/lib/color-fns/parse.ts +60 -0
  571. package/src/theme/v2/build/merge.ts +28 -0
  572. package/src/theme/v2/build/mixThemeColor.test.ts +23 -0
  573. package/src/theme/v2/build/mixThemeColor.ts +53 -0
  574. package/src/theme/v2/build/renderColorTheme.ts +532 -0
  575. package/src/theme/v2/build/renderColorValue.ts +85 -0
  576. package/src/theme/v2/build/resolveColorTokens.ts +268 -0
  577. package/src/theme/v2/color/_helpers.ts +2 -2
  578. package/src/theme/v2/color/_system.ts +2 -4
  579. package/src/theme/v2/color/avatar.ts +3 -7
  580. package/src/theme/v2/color/badge.ts +3 -7
  581. package/src/theme/v2/color/button.ts +5 -11
  582. package/src/theme/v2/color/color.ts +10 -16
  583. package/src/theme/v2/color/input.ts +8 -10
  584. package/src/theme/v2/color/kbd.ts +1 -3
  585. package/src/theme/v2/color/selectable.ts +4 -8
  586. package/src/theme/v2/color/state.ts +5 -7
  587. package/src/theme/v2/color/syntax.ts +1 -3
  588. package/src/theme/v2/config/helpers.ts +48 -0
  589. package/src/theme/v2/config/system.ts +114 -0
  590. package/src/theme/v2/config/tokens/color/types.ts +137 -0
  591. package/src/theme/v2/config/tokens/index.ts +3 -0
  592. package/src/theme/v2/config/tokens/parseTokenValue.test.ts +44 -0
  593. package/src/theme/v2/config/tokens/parseTokenValue.ts +133 -0
  594. package/src/theme/v2/config/tokens/types.ts +53 -0
  595. package/src/theme/v2/config/types.ts +47 -0
  596. package/src/theme/v2/defaults/colorPalette.ts +5 -0
  597. package/src/theme/v2/defaults/colorTokens.ts +648 -0
  598. package/src/theme/v2/defaults/config.ts +84 -0
  599. package/src/theme/v2/defaults/fonts.ts +227 -0
  600. package/src/theme/v2/index.ts +2 -0
  601. package/src/theme/v2/input.ts +2 -4
  602. package/src/theme/v2/theme.ts +10 -14
  603. package/src/theme/v3/_constants.ts +29 -0
  604. package/src/theme/v3/_parseColorToken.ts +180 -0
  605. package/src/theme/v3/buildTheme_v3.ts +20 -11
  606. package/src/theme/v3/color/_constants.ts +15 -0
  607. package/src/theme/v3/color/avatar.ts +14 -0
  608. package/src/theme/v3/color/card.ts +58 -95
  609. package/src/theme/v3/color/color.ts +75 -71
  610. package/src/theme/v3/color/element.ts +8 -8
  611. package/src/theme/v3/color/index.ts +2 -2
  612. package/src/theme/v3/color/token.ts +19 -4
  613. package/src/theme/v3/color/tokens.ts +2 -2
  614. package/src/theme/v3/defaultFonts.ts +250 -0
  615. package/src/theme/v3/defaultTokens.ts +199 -0
  616. package/src/theme/v3/index.ts +4 -1
  617. package/src/theme/v3/merge.ts +2 -0
  618. package/src/theme/v3/palette/constants.ts +15 -0
  619. package/src/theme/v3/palette/types.ts +7 -0
  620. package/src/theme/v3/resolveTokens.ts +70 -65
  621. package/src/theme/v3/tokens.ts +2 -2
  622. package/src/theme/v3/types.ts +97 -12
  623. package/src/theme/versioning/getTheme_v2.ts +3 -3
  624. package/src/theme/versioning/is_v0.ts +2 -2
  625. package/src/theme/versioning/is_v2.ts +2 -2
  626. package/src/theme/versioning/themeColor_v0_v2.ts +2 -2
  627. package/src/theme/versioning/themeColor_v2_v2_9.ts +1 -1
  628. package/src/theme/versioning/themeColor_v3_v2.ts +229 -52
  629. package/src/theme/versioning/v0_v2.ts +3 -3
  630. package/src/theme/versioning/v2_v0.ts +4 -4
  631. package/src/theme/versioning/v3_v2.ts +62 -40
  632. package/bin/ui.js +0 -5
  633. package/dist/_chunks-cjs/_visual-editing.js +0 -3100
  634. package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
  635. package/dist/_chunks-cjs/buildCommand.js +0 -32
  636. package/dist/_chunks-cjs/buildCommand.js.map +0 -1
  637. package/dist/_chunks-cjs/refractor.js +0 -27
  638. package/dist/_chunks-cjs/refractor.js.map +0 -1
  639. package/dist/_chunks-cjs/v3_v2.js +0 -251
  640. package/dist/_chunks-cjs/v3_v2.js.map +0 -1
  641. package/dist/_chunks-es/_visual-editing.mjs +0 -3107
  642. package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
  643. package/dist/_chunks-es/refractor.mjs +0 -26
  644. package/dist/_chunks-es/refractor.mjs.map +0 -1
  645. package/dist/_chunks-es/v3_v2.mjs +0 -252
  646. package/dist/_chunks-es/v3_v2.mjs.map +0 -1
  647. package/dist/_visual-editing.d.mts +0 -808
  648. package/dist/_visual-editing.mjs +0 -31
  649. package/dist/_visual-editing.mjs.map +0 -1
  650. package/dist/cli.d.ts +0 -1
  651. package/dist/cli.js +0 -357
  652. package/dist/cli.js.map +0 -1
  653. package/dist/css.d.mts +0 -2197
  654. package/dist/css.d.ts +0 -2197
  655. package/dist/css.js +0 -4769
  656. package/dist/css.js.map +0 -1
  657. package/dist/css.mjs +0 -4770
  658. package/dist/css.mjs.map +0 -1
  659. package/dist/index.d.mts +0 -2869
  660. package/dist/index.mjs +0 -1545
  661. package/dist/index.mjs.map +0 -1
  662. package/dist/sanity-palette.css +0 -9
  663. package/dist/sanity-theme.css +0 -1
  664. package/dist/system.css +0 -22813
  665. package/dist/theme.d.mts +0 -1883
  666. package/dist/theme.mjs +0 -2989
  667. package/dist/theme.mjs.map +0 -1
  668. package/src/cli/buildCommand.ts +0 -48
  669. package/src/cli/index.ts +0 -38
  670. package/src/css/_comp.test.ts +0 -7
  671. package/src/css/_comp.ts +0 -10
  672. package/src/css/_mergeStyles.ts +0 -31
  673. package/src/css/_resp.ts +0 -38
  674. package/src/css/_responsiveRule.ts +0 -38
  675. package/src/css/aspects/border/border.style.ts +0 -13
  676. package/src/css/aspects/border/border.ts +0 -14
  677. package/src/css/aspects/border/index.ts +0 -2
  678. package/src/css/aspects/border/types.ts +0 -10
  679. package/src/css/aspects/display/display.style.ts +0 -34
  680. package/src/css/aspects/display/display.ts +0 -7
  681. package/src/css/aspects/display/index.ts +0 -2
  682. package/src/css/aspects/display/types.ts +0 -17
  683. package/src/css/aspects/flex/flex.style.ts +0 -30
  684. package/src/css/aspects/flex/flex.ts +0 -13
  685. package/src/css/aspects/flex/flexAlign.style.ts +0 -12
  686. package/src/css/aspects/flex/flexDirection.style.ts +0 -11
  687. package/src/css/aspects/flex/flexJustify.style.ts +0 -13
  688. package/src/css/aspects/flex/flexWrap.style.ts +0 -10
  689. package/src/css/aspects/flex/index.ts +0 -2
  690. package/src/css/aspects/flex/types.ts +0 -35
  691. package/src/css/aspects/flexItem/flex.style.ts +0 -22
  692. package/src/css/aspects/flexItem/flexItem.ts +0 -8
  693. package/src/css/aspects/flexItem/index.ts +0 -2
  694. package/src/css/aspects/flexItem/types.ts +0 -27
  695. package/src/css/aspects/font/font.style.ts +0 -151
  696. package/src/css/aspects/font/font.ts +0 -12
  697. package/src/css/aspects/font/index.ts +0 -2
  698. package/src/css/aspects/font/types.ts +0 -12
  699. package/src/css/aspects/gap/gap.style.ts +0 -21
  700. package/src/css/aspects/gap/gap.ts +0 -8
  701. package/src/css/aspects/gap/index.ts +0 -2
  702. package/src/css/aspects/gap/types.ts +0 -10
  703. package/src/css/aspects/grid/grid.ts +0 -13
  704. package/src/css/aspects/grid/gridAutoColumns.style.ts +0 -11
  705. package/src/css/aspects/grid/gridAutoFlow.style.ts +0 -11
  706. package/src/css/aspects/grid/gridAutoRows.style.ts +0 -11
  707. package/src/css/aspects/grid/gridColumns.style.ts +0 -18
  708. package/src/css/aspects/grid/gridRows.style.ts +0 -18
  709. package/src/css/aspects/grid/index.ts +0 -2
  710. package/src/css/aspects/grid/types.ts +0 -29
  711. package/src/css/aspects/gridItem/gridColumn.style.ts +0 -20
  712. package/src/css/aspects/gridItem/gridColumnEnd.style.ts +0 -20
  713. package/src/css/aspects/gridItem/gridColumnStart.style.ts +0 -20
  714. package/src/css/aspects/gridItem/gridItem.ts +0 -15
  715. package/src/css/aspects/gridItem/gridRow.style.ts +0 -20
  716. package/src/css/aspects/gridItem/gridRowEnd.style.ts +0 -20
  717. package/src/css/aspects/gridItem/gridRowStart.style.ts +0 -20
  718. package/src/css/aspects/gridItem/index.ts +0 -2
  719. package/src/css/aspects/gridItem/types.ts +0 -41
  720. package/src/css/aspects/height/height.style.ts +0 -9
  721. package/src/css/aspects/height/height.ts +0 -17
  722. package/src/css/aspects/height/index.ts +0 -1
  723. package/src/css/aspects/height/rules.ts +0 -7
  724. package/src/css/aspects/index.ts +0 -20
  725. package/src/css/aspects/inset/index.ts +0 -2
  726. package/src/css/aspects/inset/inset.style.ts +0 -12
  727. package/src/css/aspects/inset/inset.ts +0 -13
  728. package/src/css/aspects/inset/types.ts +0 -13
  729. package/src/css/aspects/margin/index.ts +0 -2
  730. package/src/css/aspects/margin/margin.style.ts +0 -46
  731. package/src/css/aspects/margin/margin.ts +0 -15
  732. package/src/css/aspects/margin/types.ts +0 -11
  733. package/src/css/aspects/maxWidth/index.ts +0 -2
  734. package/src/css/aspects/maxWidth/maxWidth.style.ts +0 -16
  735. package/src/css/aspects/maxWidth/maxWidth.ts +0 -6
  736. package/src/css/aspects/maxWidth/types.ts +0 -7
  737. package/src/css/aspects/outline/outline.style.ts +0 -9
  738. package/src/css/aspects/overflow/index.ts +0 -2
  739. package/src/css/aspects/overflow/overflow.style.ts +0 -11
  740. package/src/css/aspects/overflow/overflow.ts +0 -11
  741. package/src/css/aspects/overflow/types.ts +0 -11
  742. package/src/css/aspects/padding/index.ts +0 -2
  743. package/src/css/aspects/padding/padding.style.ts +0 -46
  744. package/src/css/aspects/padding/padding.ts +0 -15
  745. package/src/css/aspects/padding/types.ts +0 -14
  746. package/src/css/aspects/pointerEvents/index.ts +0 -2
  747. package/src/css/aspects/pointerEvents/pointerEvents.style.ts +0 -13
  748. package/src/css/aspects/pointerEvents/pointerEvents.ts +0 -6
  749. package/src/css/aspects/position/index.ts +0 -2
  750. package/src/css/aspects/position/position.style.ts +0 -12
  751. package/src/css/aspects/position/position.ts +0 -7
  752. package/src/css/aspects/position/types.ts +0 -9
  753. package/src/css/aspects/radius/index.ts +0 -2
  754. package/src/css/aspects/radius/radius.style.ts +0 -16
  755. package/src/css/aspects/radius/radius.ts +0 -8
  756. package/src/css/aspects/radius/types.ts +0 -8
  757. package/src/css/aspects/shadow/index.ts +0 -2
  758. package/src/css/aspects/shadow/shadow.style.ts +0 -49
  759. package/src/css/aspects/shadow/shadow.ts +0 -7
  760. package/src/css/aspects/shadow/types.ts +0 -8
  761. package/src/css/aspects/textOverflow/index.ts +0 -2
  762. package/src/css/aspects/textOverflow/textOverflow.style.ts +0 -21
  763. package/src/css/aspects/textOverflow/textOverflow.ts +0 -6
  764. package/src/css/aspects/textOverflow/types.ts +0 -8
  765. package/src/css/aspects/width/index.ts +0 -2
  766. package/src/css/aspects/width/rules.ts +0 -8
  767. package/src/css/aspects/width/types.ts +0 -9
  768. package/src/css/aspects/width/width.style.ts +0 -11
  769. package/src/css/aspects/width/width.ts +0 -6
  770. package/src/css/compile/compilePalette.ts +0 -60
  771. package/src/css/compile/compileRule.ts +0 -96
  772. package/src/css/compile/compileRules.test.ts +0 -36
  773. package/src/css/compile/compileRules.ts +0 -43
  774. package/src/css/compile/compileStyle.ts +0 -148
  775. package/src/css/compile/compileSystem.ts +0 -10
  776. package/src/css/compile/compileTheme.ts +0 -15
  777. package/src/css/compile/compileTheme_v3.ts +0 -410
  778. package/src/css/compile/types.ts +0 -6
  779. package/src/css/components/breadcrumbs/breadcrumbs.style.ts +0 -9
  780. package/src/css/components/breadcrumbs/index.ts +0 -1
  781. package/src/css/components/breadcrumbs/rules.ts +0 -25
  782. package/src/css/components/dialog/dialog.style.ts +0 -79
  783. package/src/css/components/dialog/index.ts +0 -1
  784. package/src/css/components/dialog/rules.ts +0 -78
  785. package/src/css/components/menu/index.ts +0 -1
  786. package/src/css/components/menu/menu.style.ts +0 -17
  787. package/src/css/components/menu/rules.ts +0 -15
  788. package/src/css/components/skeleton/index.ts +0 -2
  789. package/src/css/components/skeleton/rules.ts +0 -113
  790. package/src/css/components/skeleton/skeleton.style.ts +0 -96
  791. package/src/css/components/toast/index.ts +0 -1
  792. package/src/css/components/toast/rules.ts +0 -18
  793. package/src/css/components/toast/toast.style.ts +0 -20
  794. package/src/css/components/tree/index.ts +0 -1
  795. package/src/css/components/tree/rules.ts +0 -168
  796. package/src/css/components/tree/tree.style.ts +0 -55
  797. package/src/css/composeClassNames.ts +0 -17
  798. package/src/css/primitives/_arrow/_arrow.style.ts +0 -73
  799. package/src/css/primitives/_arrow/index.ts +0 -1
  800. package/src/css/primitives/_input/__workshop__/customInput.tsx +0 -16
  801. package/src/css/primitives/_input/__workshop__/index.ts +0 -14
  802. package/src/css/primitives/_input/_input.style.ts +0 -162
  803. package/src/css/primitives/_input/index.ts +0 -2
  804. package/src/css/primitives/_selectable/__style.ts +0 -117
  805. package/src/css/primitives/_selectable/_contants.ts +0 -11
  806. package/src/css/primitives/_selectable/_selectable.style.ts +0 -132
  807. package/src/css/primitives/_selectable/index.ts +0 -2
  808. package/src/css/primitives/avatar/avatar.style.ts +0 -175
  809. package/src/css/primitives/avatar/index.ts +0 -2
  810. package/src/css/primitives/avatar/rules.ts +0 -176
  811. package/src/css/primitives/badge/badge.style.ts +0 -22
  812. package/src/css/primitives/badge/index.ts +0 -2
  813. package/src/css/primitives/box/box.style.ts +0 -31
  814. package/src/css/primitives/box/index.ts +0 -2
  815. package/src/css/primitives/button/_constants.ts +0 -17
  816. package/src/css/primitives/button/button.style.ts +0 -182
  817. package/src/css/primitives/button/index.ts +0 -1
  818. package/src/css/primitives/button/rules.ts +0 -302
  819. package/src/css/primitives/card/_constants.ts +0 -13
  820. package/src/css/primitives/card/card.style.ts +0 -198
  821. package/src/css/primitives/card/index.ts +0 -2
  822. package/src/css/primitives/card/rules.ts +0 -473
  823. package/src/css/primitives/checkbox/__styles.ts +0 -129
  824. package/src/css/primitives/checkbox/checkbox.style.ts +0 -154
  825. package/src/css/primitives/checkbox/index.ts +0 -1
  826. package/src/css/primitives/checkbox/rules.ts +0 -152
  827. package/src/css/primitives/code/code.style.ts +0 -62
  828. package/src/css/primitives/code/index.ts +0 -2
  829. package/src/css/primitives/code/rules.ts +0 -96
  830. package/src/css/primitives/container/container.style.ts +0 -10
  831. package/src/css/primitives/container/index.ts +0 -2
  832. package/src/css/primitives/container/rules.ts +0 -8
  833. package/src/css/primitives/heading/heading.style.ts +0 -47
  834. package/src/css/primitives/heading/index.ts +0 -2
  835. package/src/css/primitives/heading/rules.ts +0 -155
  836. package/src/css/primitives/kbd/index.ts +0 -2
  837. package/src/css/primitives/kbd/kbd.style.ts +0 -22
  838. package/src/css/primitives/kbd/rules.ts +0 -20
  839. package/src/css/primitives/label/index.ts +0 -2
  840. package/src/css/primitives/label/label.style.ts +0 -48
  841. package/src/css/primitives/label/rules.ts +0 -137
  842. package/src/css/primitives/popover/index.ts +0 -1
  843. package/src/css/primitives/popover/popover.style.ts +0 -5
  844. package/src/css/primitives/popover/rules.ts +0 -5
  845. package/src/css/primitives/radio/index.ts +0 -1
  846. package/src/css/primitives/radio/radio.style.ts +0 -123
  847. package/src/css/primitives/radio/rules.ts +0 -121
  848. package/src/css/primitives/select/index.ts +0 -2
  849. package/src/css/primitives/select/rules.ts +0 -22
  850. package/src/css/primitives/select/select.style.ts +0 -24
  851. package/src/css/primitives/spinner/index.ts +0 -1
  852. package/src/css/primitives/spinner/rules.ts +0 -21
  853. package/src/css/primitives/spinner/spinner.style.ts +0 -22
  854. package/src/css/primitives/switch/index.ts +0 -1
  855. package/src/css/primitives/switch/rules.ts +0 -340
  856. package/src/css/primitives/switch/switch.style.ts +0 -169
  857. package/src/css/primitives/text/index.ts +0 -2
  858. package/src/css/primitives/text/rules.ts +0 -164
  859. package/src/css/primitives/text/text.style.ts +0 -56
  860. package/src/css/primitives/textArea/index.ts +0 -2
  861. package/src/css/primitives/textArea/rules.ts +0 -7
  862. package/src/css/primitives/textArea/textArea.style.ts +0 -9
  863. package/src/css/primitives/textInput/index.ts +0 -2
  864. package/src/css/primitives/textInput/rules.ts +0 -224
  865. package/src/css/primitives/textInput/textInput.style.ts +0 -167
  866. package/src/css/primitives/token/rules.ts +0 -45
  867. package/src/css/primitives/token/token.style.ts +0 -49
  868. package/src/css/primitives/tooltip/index.ts +0 -1
  869. package/src/css/primitives/tooltip/rules.ts +0 -19
  870. package/src/css/primitives/tooltip/tooltip.style.ts +0 -21
  871. package/src/css/responsiveRules.ts +0 -25
  872. package/src/css/scopeClassName.ts +0 -6
  873. package/src/css/system.style.ts +0 -154
  874. package/src/css/utils/srOnly/index.ts +0 -1
  875. package/src/css/utils/srOnly/srOnly.style.ts +0 -14
  876. package/src/css/utils/srOnly/srOnly.ts +0 -5
  877. package/src/css/varNames.ts +0 -486
  878. package/src/css/vars.ts +0 -456
  879. package/src/theme/_constants.ts +0 -26
  880. package/src/theme/_types.ts +0 -41
  881. package/src/theme/build/_deprecated/color/_selectable/createSelectableTones.ts +0 -76
  882. package/src/theme/build/_deprecated/color/_solid/createSolidTones.ts +0 -54
  883. package/src/theme/build/_deprecated/color/button/createButtonModes.ts +0 -17
  884. package/src/theme/build/_deprecated/color/button/createButtonTones.ts +0 -55
  885. package/src/theme/build/_deprecated/color/card/createCardStates.ts +0 -60
  886. package/src/theme/build/_deprecated/color/color.test.ts +0 -63
  887. package/src/theme/build/_deprecated/color/defaults.ts +0 -390
  888. package/src/theme/build/_deprecated/color/factory.ts +0 -141
  889. package/src/theme/build/_deprecated/color/input/createInputModes.ts +0 -81
  890. package/src/theme/build/_deprecated/color/muted/createMuted.ts +0 -54
  891. package/src/theme/build/_deprecated/color/spot/createSpot.ts +0 -20
  892. package/src/theme/build/buildColorTheme.test.ts +0 -183
  893. package/src/theme/build/buildColorTheme.ts +0 -494
  894. package/src/theme/build/buildTheme.test.ts +0 -87
  895. package/src/theme/build/buildTheme.ts +0 -12
  896. package/src/theme/build/colorToken/colorToken.ts +0 -19
  897. package/src/theme/build/colorToken/compileColorToken.ts +0 -21
  898. package/src/theme/build/colorToken/types.ts +0 -6
  899. package/src/theme/build/lib/color-fns/blend/mix.ts +0 -21
  900. package/src/theme/build/lib/color-fns/blend/multiply.ts +0 -18
  901. package/src/theme/build/lib/color-fns/blend/screen.ts +0 -18
  902. package/src/theme/build/lib/color-fns/color-fns.test.ts +0 -68
  903. package/src/theme/build/lib/color-fns/contrastRatio.ts +0 -31
  904. package/src/theme/build/lib/color-fns/convert.ts +0 -150
  905. package/src/theme/build/lib/color-fns/parse.ts +0 -60
  906. package/src/theme/build/merge.ts +0 -26
  907. package/src/theme/build/mixThemeColor.test.ts +0 -21
  908. package/src/theme/build/mixThemeColor.ts +0 -53
  909. package/src/theme/build/renderColorTheme.ts +0 -532
  910. package/src/theme/build/renderColorValue.ts +0 -85
  911. package/src/theme/build/resolveColorTokens.ts +0 -268
  912. package/src/theme/build/theme.test.ts +0 -27
  913. package/src/theme/config/helpers.ts +0 -55
  914. package/src/theme/config/system.ts +0 -115
  915. package/src/theme/config/tokens/color/types.ts +0 -133
  916. package/src/theme/config/tokens/index.ts +0 -4
  917. package/src/theme/config/tokens/parseTokenKey.test.ts +0 -64
  918. package/src/theme/config/tokens/parseTokenKey.ts +0 -67
  919. package/src/theme/config/tokens/parseTokenValue.test.ts +0 -42
  920. package/src/theme/config/tokens/parseTokenValue.ts +0 -133
  921. package/src/theme/config/tokens/types.ts +0 -53
  922. package/src/theme/config/types.ts +0 -45
  923. package/src/theme/defaults/colorPalette.ts +0 -5
  924. package/src/theme/defaults/colorTokens.ts +0 -648
  925. package/src/theme/defaults/config.ts +0 -84
  926. package/src/theme/defaults/fonts.ts +0 -228
  927. package/src/theme/palette/constants.ts +0 -15
  928. package/src/theme/palette/types.ts +0 -16
  929. package/src/theme/v3/buildTheme_v3.test.ts +0 -40
  930. package/src/theme/v3/color/buildColor_v3.ts +0 -193
  931. package/src/theme/v3/color/parseColor.test.ts +0 -79
  932. package/src/theme/v3/color/parseColor.ts +0 -167
  933. package/src/theme/v3/color/renderColor.test.ts +0 -19
  934. package/src/theme/v3/color/renderColor.ts +0 -33
  935. package/src/theme/v3/defaults.ts +0 -205
  936. package/src/ui/StyleTags.tsx +0 -24
  937. package/src/ui/_compat/index.ts +0 -9
  938. package/src/ui/_compat/styles/_responsive.ts +0 -19
  939. package/src/ui/_compat/styles/index.ts +0 -1
  940. package/src/ui/_compat/theme/index.ts +0 -5
  941. package/src/ui/_compat/theme/theme.test.tsx +0 -73
  942. package/src/ui/_compat/theme/themeColorProvider.tsx +0 -30
  943. package/src/ui/_compat/theme/themeContext.ts +0 -10
  944. package/src/ui/_compat/theme/themeProvider.tsx +0 -74
  945. package/src/ui/_compat/theme/types.ts +0 -12
  946. package/src/ui/_compat/theme/useRootTheme.ts +0 -17
  947. package/src/ui/_compat/theme/useTheme.ts +0 -16
  948. package/src/ui/_compat/types.ts +0 -274
  949. package/src/ui/components/autocomplete/__workshop__/async.tsx +0 -157
  950. package/src/ui/components/autocomplete/__workshop__/constrainedHeight.tsx +0 -131
  951. package/src/ui/components/autocomplete/__workshop__/custom.tsx +0 -90
  952. package/src/ui/components/autocomplete/__workshop__/example.tsx +0 -80
  953. package/src/ui/components/autocomplete/__workshop__/focusAndBlur.tsx +0 -36
  954. package/src/ui/components/autocomplete/__workshop__/fullscreen.tsx +0 -293
  955. package/src/ui/components/autocomplete/__workshop__/index.ts +0 -39
  956. package/src/ui/components/autocomplete/autocomplete.tsx +0 -731
  957. package/src/ui/components/autocomplete/autocompleteOption.tsx +0 -45
  958. package/src/ui/components/autocomplete/autocompleteReducer.ts +0 -47
  959. package/src/ui/components/autocomplete/constants.ts +0 -28
  960. package/src/ui/components/autocomplete/index.ts +0 -2
  961. package/src/ui/components/autocomplete/types.ts +0 -108
  962. package/src/ui/components/breadcrumbs/__workshop__/example.tsx +0 -62
  963. package/src/ui/components/breadcrumbs/breadcrumbs.tsx +0 -127
  964. package/src/ui/components/breadcrumbs/index.ts +0 -1
  965. package/src/ui/components/dialog/__workshop__/activate.tsx +0 -134
  966. package/src/ui/components/dialog/__workshop__/autoFocus.tsx +0 -29
  967. package/src/ui/components/dialog/__workshop__/onScroll.tsx +0 -39
  968. package/src/ui/components/dialog/__workshop__/panes.tsx +0 -82
  969. package/src/ui/components/dialog/__workshop__/position.tsx +0 -30
  970. package/src/ui/components/dialog/__workshop__/props.tsx +0 -77
  971. package/src/ui/components/dialog/__workshop__/wrapped.tsx +0 -76
  972. package/src/ui/components/dialog/dialog.tsx +0 -433
  973. package/src/ui/components/dialog/dialogContext.ts +0 -20
  974. package/src/ui/components/dialog/dialogProvider.tsx +0 -35
  975. package/src/ui/components/dialog/index.ts +0 -4
  976. package/src/ui/components/dialog/useDialog.ts +0 -11
  977. package/src/ui/components/hotkeys/hotkeys.tsx +0 -54
  978. package/src/ui/components/hotkeys/index.ts +0 -1
  979. package/src/ui/components/index.ts +0 -9
  980. package/src/ui/components/menu/__workshop__/asComponent.tsx +0 -45
  981. package/src/ui/components/menu/__workshop__/avatarMenu.tsx +0 -51
  982. package/src/ui/components/menu/__workshop__/closableMenuButton.tsx +0 -46
  983. package/src/ui/components/menu/__workshop__/constrainedInBoundary.tsx +0 -134
  984. package/src/ui/components/menu/__workshop__/customMenuItem.tsx +0 -45
  985. package/src/ui/components/menu/__workshop__/customSelectedState.tsx +0 -39
  986. package/src/ui/components/menu/__workshop__/disableFocusOnClose.tsx +0 -40
  987. package/src/ui/components/menu/__workshop__/groups.tsx +0 -156
  988. package/src/ui/components/menu/__workshop__/menuButton.tsx +0 -80
  989. package/src/ui/components/menu/__workshop__/menuGroupRight.tsx +0 -65
  990. package/src/ui/components/menu/__workshop__/nestedMenu.tsx +0 -22
  991. package/src/ui/components/menu/__workshop__/onCloseMenuButton.tsx +0 -41
  992. package/src/ui/components/menu/__workshop__/selectedItem.tsx +0 -69
  993. package/src/ui/components/menu/__workshop__/shouldFocus.tsx +0 -47
  994. package/src/ui/components/menu/__workshop__/tones.tsx +0 -25
  995. package/src/ui/components/menu/__workshop__/withoutArrow.tsx +0 -32
  996. package/src/ui/components/menu/helpers.ts +0 -82
  997. package/src/ui/components/menu/index.ts +0 -5
  998. package/src/ui/components/menu/menu.test.tsx +0 -128
  999. package/src/ui/components/menu/menu.tsx +0 -200
  1000. package/src/ui/components/menu/menuButton.tsx +0 -275
  1001. package/src/ui/components/menu/menuContext.ts +0 -31
  1002. package/src/ui/components/menu/menuDivider.tsx +0 -22
  1003. package/src/ui/components/menu/menuGroup.tsx +0 -228
  1004. package/src/ui/components/menu/menuItem.tsx +0 -180
  1005. package/src/ui/components/menu/useMenu.ts +0 -21
  1006. package/src/ui/components/menu/useMenuController.ts +0 -241
  1007. package/src/ui/components/skeleton/__workshop__/delay.tsx +0 -70
  1008. package/src/ui/components/skeleton/__workshop__/index.ts +0 -11
  1009. package/src/ui/components/skeleton/__workshop__/skeleton.tsx +0 -64
  1010. package/src/ui/components/skeleton/index.ts +0 -2
  1011. package/src/ui/components/skeleton/skeleton.tsx +0 -53
  1012. package/src/ui/components/skeleton/textSkeleton.tsx +0 -132
  1013. package/src/ui/components/tab/__workshop__/example.tsx +0 -79
  1014. package/src/ui/components/tab/index.ts +0 -3
  1015. package/src/ui/components/tab/tab.tsx +0 -105
  1016. package/src/ui/components/tab/tabList.tsx +0 -74
  1017. package/src/ui/components/tab/tabPanel.tsx +0 -40
  1018. package/src/ui/components/toast/__workshop__/hook.tsx +0 -71
  1019. package/src/ui/components/toast/__workshop__/toast.tsx +0 -26
  1020. package/src/ui/components/toast/index.ts +0 -4
  1021. package/src/ui/components/toast/toast.test.tsx +0 -101
  1022. package/src/ui/components/toast/toast.tsx +0 -211
  1023. package/src/ui/components/toast/toastContext.ts +0 -7
  1024. package/src/ui/components/toast/toastLayer.tsx +0 -38
  1025. package/src/ui/components/toast/toastProvider.tsx +0 -113
  1026. package/src/ui/components/toast/types.ts +0 -28
  1027. package/src/ui/components/toast/useToast.ts +0 -25
  1028. package/src/ui/components/tree/__workshop__/basic.perf.ts +0 -19
  1029. package/src/ui/components/tree/__workshop__/basic.tsx +0 -105
  1030. package/src/ui/components/tree/__workshop__/tabFromElement.tsx +0 -84
  1031. package/src/ui/components/tree/helpers.ts +0 -105
  1032. package/src/ui/components/tree/index.ts +0 -4
  1033. package/src/ui/components/tree/tree.tsx +0 -244
  1034. package/src/ui/components/tree/treeContext.ts +0 -10
  1035. package/src/ui/components/tree/treeGroup.tsx +0 -30
  1036. package/src/ui/components/tree/treeItem.tsx +0 -220
  1037. package/src/ui/components/tree/types.ts +0 -25
  1038. package/src/ui/components/tree/useTree.ts +0 -17
  1039. package/src/ui/constants.ts +0 -79
  1040. package/src/ui/global.ts +0 -6
  1041. package/src/ui/helpers/focus.ts +0 -100
  1042. package/src/ui/helpers/index.ts +0 -5
  1043. package/src/ui/helpers/props.ts +0 -10
  1044. package/src/ui/hooks/index.ts +0 -12
  1045. package/src/ui/hooks/useArrayProp.ts +0 -29
  1046. package/src/ui/hooks/useClickOutside.test.tsx +0 -482
  1047. package/src/ui/hooks/useClickOutside.ts +0 -117
  1048. package/src/ui/hooks/useClickOutsideEvent.test.tsx +0 -115
  1049. package/src/ui/hooks/useClickOutsideEvent.ts +0 -73
  1050. package/src/ui/hooks/useDelayed.test.ts +0 -68
  1051. package/src/ui/hooks/useDelayedState.ts +0 -28
  1052. package/src/ui/hooks/useElementRect/__workshop__/example.tsx +0 -32
  1053. package/src/ui/hooks/useElementRect/index.ts +0 -1
  1054. package/src/ui/hooks/useElementSize.ts +0 -19
  1055. package/src/ui/hooks/useForwardedRef.ts +0 -19
  1056. package/src/ui/hooks/useMediaIndex/__workshop__/test.tsx +0 -14
  1057. package/src/ui/hooks/useMediaIndex/index.ts +0 -1
  1058. package/src/ui/hooks/useMediaIndex/useMediaIndex.test.tsx +0 -36
  1059. package/src/ui/hooks/useMediaIndex/useMediaIndex.ts +0 -104
  1060. package/src/ui/hooks/usePrefersDark.hydration.test.tsx +0 -56
  1061. package/src/ui/hooks/usePrefersDark.test.tsx +0 -19
  1062. package/src/ui/hooks/usePrefersReducedMotion.hydration.test.tsx +0 -56
  1063. package/src/ui/hooks/usePrefersReducedMotion.test.tsx +0 -19
  1064. package/src/ui/index.ts +0 -9
  1065. package/src/ui/lib/createGlobalScopedContext.ts +0 -34
  1066. package/src/ui/lib/globalScope.ts +0 -19
  1067. package/src/ui/middleware/origin.ts +0 -47
  1068. package/src/ui/observers/elementSizeObserver.ts +0 -116
  1069. package/src/ui/observers/index.ts +0 -2
  1070. package/src/ui/primitives/_selectable/index.ts +0 -1
  1071. package/src/ui/primitives/_selectable/selectable.tsx +0 -31
  1072. package/src/ui/primitives/avatar/__workshop__/asButton.tsx +0 -14
  1073. package/src/ui/primitives/avatar/__workshop__/stack.tsx +0 -25
  1074. package/src/ui/primitives/avatar/__workshop__/withinButton.tsx +0 -63
  1075. package/src/ui/primitives/avatar/__workshop__/withinMenuItem.tsx +0 -72
  1076. package/src/ui/primitives/avatar/avatar.tsx +0 -158
  1077. package/src/ui/primitives/avatar/avatarCounter.tsx +0 -62
  1078. package/src/ui/primitives/avatar/avatarStack.tsx +0 -82
  1079. package/src/ui/primitives/avatar/index.ts +0 -4
  1080. package/src/ui/primitives/avatar/types.ts +0 -17
  1081. package/src/ui/primitives/badge/__workshop__/props.tsx +0 -30
  1082. package/src/ui/primitives/badge/__workshop__/tones.tsx +0 -21
  1083. package/src/ui/primitives/badge/badge.test.tsx +0 -16
  1084. package/src/ui/primitives/badge/badge.tsx +0 -64
  1085. package/src/ui/primitives/badge/index.ts +0 -1
  1086. package/src/ui/primitives/badge/types.ts +0 -8
  1087. package/src/ui/primitives/box/__workshop__/props.tsx +0 -20
  1088. package/src/ui/primitives/box/__workshop__/responsive.tsx +0 -20
  1089. package/src/ui/primitives/box/box.tsx +0 -155
  1090. package/src/ui/primitives/box/index.ts +0 -1
  1091. package/src/ui/primitives/button/__workshop__/custom.tsx +0 -50
  1092. package/src/ui/primitives/button/__workshop__/customIcons.tsx +0 -30
  1093. package/src/ui/primitives/button/__workshop__/disabled.tsx +0 -74
  1094. package/src/ui/primitives/button/__workshop__/index.ts +0 -59
  1095. package/src/ui/primitives/button/__workshop__/props.tsx +0 -58
  1096. package/src/ui/primitives/button/__workshop__/sanityUploadButton.tsx +0 -36
  1097. package/src/ui/primitives/button/__workshop__/stacked.tsx +0 -59
  1098. package/src/ui/primitives/button/__workshop__/uploadButton.tsx +0 -28
  1099. package/src/ui/primitives/button/button.test.tsx +0 -44
  1100. package/src/ui/primitives/button/button.tsx +0 -206
  1101. package/src/ui/primitives/button/index.ts +0 -1
  1102. package/src/ui/primitives/card/__workshop__/allTones.tsx +0 -27
  1103. package/src/ui/primitives/card/__workshop__/asButton.tsx +0 -107
  1104. package/src/ui/primitives/card/__workshop__/asComponent.tsx +0 -27
  1105. package/src/ui/primitives/card/__workshop__/checkered.tsx +0 -26
  1106. package/src/ui/primitives/card/__workshop__/index.ts +0 -18
  1107. package/src/ui/primitives/card/__workshop__/interactive.tsx +0 -30
  1108. package/src/ui/primitives/card/__workshop__/listNavigation.tsx +0 -80
  1109. package/src/ui/primitives/card/__workshop__/props.tsx +0 -55
  1110. package/src/ui/primitives/card/__workshop__/selected.tsx +0 -93
  1111. package/src/ui/primitives/card/card.tsx +0 -119
  1112. package/src/ui/primitives/card/cardContext.ts +0 -10
  1113. package/src/ui/primitives/card/cardProvider.tsx +0 -19
  1114. package/src/ui/primitives/card/index.ts +0 -4
  1115. package/src/ui/primitives/card/types.ts +0 -27
  1116. package/src/ui/primitives/card/useCard.ts +0 -7
  1117. package/src/ui/primitives/checkbox/__workshop__/props.tsx +0 -33
  1118. package/src/ui/primitives/checkbox/__workshop__/tones.tsx +0 -28
  1119. package/src/ui/primitives/checkbox/checkbox.tsx +0 -74
  1120. package/src/ui/primitives/checkbox/index.ts +0 -1
  1121. package/src/ui/primitives/code/__workshop__/opticalAlignment.tsx +0 -48
  1122. package/src/ui/primitives/code/__workshop__/props.tsx +0 -21
  1123. package/src/ui/primitives/code/code.tsx +0 -49
  1124. package/src/ui/primitives/code/index.ts +0 -1
  1125. package/src/ui/primitives/code/refractor.tsx +0 -20
  1126. package/src/ui/primitives/container/__workshop__/example.tsx +0 -20
  1127. package/src/ui/primitives/container/container.tsx +0 -35
  1128. package/src/ui/primitives/container/index.ts +0 -2
  1129. package/src/ui/primitives/flex/__workshop__/example.tsx +0 -34
  1130. package/src/ui/primitives/flex/flex.tsx +0 -29
  1131. package/src/ui/primitives/flex/index.ts +0 -1
  1132. package/src/ui/primitives/grid/grid.tsx +0 -30
  1133. package/src/ui/primitives/grid/index.ts +0 -1
  1134. package/src/ui/primitives/heading/__workshop__/opticalAlignment.tsx +0 -54
  1135. package/src/ui/primitives/heading/__workshop__/plain.tsx +0 -32
  1136. package/src/ui/primitives/heading/heading.tsx +0 -62
  1137. package/src/ui/primitives/heading/index.ts +0 -1
  1138. package/src/ui/primitives/index.ts +0 -27
  1139. package/src/ui/primitives/inline/__workshop__/plain.tsx +0 -27
  1140. package/src/ui/primitives/inline/index.ts +0 -1
  1141. package/src/ui/primitives/inline/inline.tsx +0 -50
  1142. package/src/ui/primitives/inline/types.ts +0 -6
  1143. package/src/ui/primitives/kbd/index.ts +0 -1
  1144. package/src/ui/primitives/kbd/kbd.tsx +0 -55
  1145. package/src/ui/primitives/label/__workshop__/plain.tsx +0 -37
  1146. package/src/ui/primitives/label/index.ts +0 -1
  1147. package/src/ui/primitives/label/label.tsx +0 -67
  1148. package/src/ui/primitives/popover/__workshop__/AlignedStory.tsx +0 -77
  1149. package/src/ui/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -32
  1150. package/src/ui/primitives/popover/__workshop__/PlainStory.tsx +0 -71
  1151. package/src/ui/primitives/popover/__workshop__/RecursiveStory.tsx +0 -70
  1152. package/src/ui/primitives/popover/__workshop__/SidePanelStory.tsx +0 -93
  1153. package/src/ui/primitives/popover/__workshop__/TestStory.tsx +0 -98
  1154. package/src/ui/primitives/popover/constants.ts +0 -22
  1155. package/src/ui/primitives/popover/floating-ui/size.ts +0 -83
  1156. package/src/ui/primitives/popover/helpers.ts +0 -32
  1157. package/src/ui/primitives/popover/index.ts +0 -2
  1158. package/src/ui/primitives/popover/popover.tsx +0 -492
  1159. package/src/ui/primitives/popover/popoverCard.tsx +0 -155
  1160. package/src/ui/primitives/popover/types.ts +0 -6
  1161. package/src/ui/primitives/radio/__workshop__/example.tsx +0 -63
  1162. package/src/ui/primitives/radio/__workshop__/plain.tsx +0 -28
  1163. package/src/ui/primitives/radio/index.ts +0 -1
  1164. package/src/ui/primitives/radio/radio.tsx +0 -49
  1165. package/src/ui/primitives/select/__workshop__/plain.tsx +0 -30
  1166. package/src/ui/primitives/select/__workshop__/readOnly.tsx +0 -23
  1167. package/src/ui/primitives/select/index.ts +0 -1
  1168. package/src/ui/primitives/select/select.tsx +0 -85
  1169. package/src/ui/primitives/spinner/__workshop__/Props.tsx +0 -16
  1170. package/src/ui/primitives/spinner/animatedSpinnerIcon.tsx +0 -16
  1171. package/src/ui/primitives/spinner/index.ts +0 -1
  1172. package/src/ui/primitives/spinner/spinner.tsx +0 -33
  1173. package/src/ui/primitives/stack/__workshop__/plain.tsx +0 -32
  1174. package/src/ui/primitives/stack/index.ts +0 -1
  1175. package/src/ui/primitives/stack/stack.tsx +0 -40
  1176. package/src/ui/primitives/switch/index.ts +0 -1
  1177. package/src/ui/primitives/switch/switch.tsx +0 -75
  1178. package/src/ui/primitives/text/__workshop__/colored.tsx +0 -23
  1179. package/src/ui/primitives/text/__workshop__/example.tsx +0 -39
  1180. package/src/ui/primitives/text/__workshop__/opticalAlignment.tsx +0 -48
  1181. package/src/ui/primitives/text/index.ts +0 -1
  1182. package/src/ui/primitives/text/text.tsx +0 -64
  1183. package/src/ui/primitives/textArea/__workshop__/plain.tsx +0 -50
  1184. package/src/ui/primitives/textArea/index.ts +0 -1
  1185. package/src/ui/primitives/textArea/textArea.tsx +0 -71
  1186. package/src/ui/primitives/textInput/__workshop__/customValidity.tsx +0 -17
  1187. package/src/ui/primitives/textInput/__workshop__/plain.tsx +0 -104
  1188. package/src/ui/primitives/textInput/__workshop__/states.tsx +0 -53
  1189. package/src/ui/primitives/textInput/__workshop__/tones.tsx +0 -277
  1190. package/src/ui/primitives/textInput/__workshop__/typed.tsx +0 -23
  1191. package/src/ui/primitives/textInput/index.ts +0 -1
  1192. package/src/ui/primitives/textInput/textInput.tsx +0 -286
  1193. package/src/ui/primitives/tooltip/__workshop__/customPortal.tsx +0 -102
  1194. package/src/ui/primitives/tooltip/__workshop__/overflowingBoundary.tsx +0 -74
  1195. package/src/ui/primitives/tooltip/__workshop__/props.tsx +0 -111
  1196. package/src/ui/primitives/tooltip/__workshop__/resizableBoundary.tsx +0 -86
  1197. package/src/ui/primitives/tooltip/constants.ts +0 -23
  1198. package/src/ui/primitives/tooltip/index.ts +0 -2
  1199. package/src/ui/primitives/tooltip/tooltip.test.tsx +0 -453
  1200. package/src/ui/primitives/tooltip/tooltip.tsx +0 -467
  1201. package/src/ui/primitives/tooltip/tooltipCard.tsx +0 -115
  1202. package/src/ui/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +0 -11
  1203. package/src/ui/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +0 -55
  1204. package/src/ui/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +0 -13
  1205. package/src/ui/primitives/types.ts +0 -166
  1206. package/src/ui/types/avatar.ts +0 -19
  1207. package/src/ui/types/badge.ts +0 -12
  1208. package/src/ui/types/button.ts +0 -24
  1209. package/src/ui/types/card.ts +0 -6
  1210. package/src/ui/types/dialog.ts +0 -4
  1211. package/src/ui/types/flex.ts +0 -27
  1212. package/src/ui/types/index.ts +0 -15
  1213. package/src/ui/types/popover.ts +0 -4
  1214. package/src/ui/types/props.ts +0 -18
  1215. package/src/ui/types/radius.ts +0 -7
  1216. package/src/ui/types/selectable.ts +0 -7
  1217. package/src/ui/utils/arrow/arrow.tsx +0 -59
  1218. package/src/ui/utils/arrow/index.ts +0 -1
  1219. package/src/ui/utils/boundaryElement/boundaryElement.test.tsx +0 -100
  1220. package/src/ui/utils/boundaryElement/boundaryElementContext.ts +0 -7
  1221. package/src/ui/utils/boundaryElement/boundaryElementProvider.tsx +0 -24
  1222. package/src/ui/utils/boundaryElement/index.ts +0 -3
  1223. package/src/ui/utils/boundaryElement/types.ts +0 -7
  1224. package/src/ui/utils/boundaryElement/useBoundaryElement.ts +0 -26
  1225. package/src/ui/utils/conditionalWrapper/conditionalWrapper.tsx +0 -23
  1226. package/src/ui/utils/conditionalWrapper/index.ts +0 -1
  1227. package/src/ui/utils/elementQuery/__workshop__/customMedia.tsx +0 -30
  1228. package/src/ui/utils/elementQuery/elementQuery.tsx +0 -53
  1229. package/src/ui/utils/elementQuery/index.ts +0 -1
  1230. package/src/ui/utils/errorBoundary.tsx +0 -48
  1231. package/src/ui/utils/getElementRef.ts +0 -26
  1232. package/src/ui/utils/index.ts +0 -9
  1233. package/src/ui/utils/layer/__workshop__/index.ts +0 -24
  1234. package/src/ui/utils/layer/__workshop__/multipleRoots.tsx +0 -49
  1235. package/src/ui/utils/layer/__workshop__/nested.tsx +0 -98
  1236. package/src/ui/utils/layer/__workshop__/responsiveZOffset.tsx +0 -13
  1237. package/src/ui/utils/layer/getLayerContext.test.ts +0 -30
  1238. package/src/ui/utils/layer/getLayerContext.ts +0 -21
  1239. package/src/ui/utils/layer/index.ts +0 -4
  1240. package/src/ui/utils/layer/layer.test.tsx +0 -108
  1241. package/src/ui/utils/layer/layer.tsx +0 -112
  1242. package/src/ui/utils/layer/layerContext.ts +0 -7
  1243. package/src/ui/utils/layer/layerProvider.tsx +0 -110
  1244. package/src/ui/utils/layer/useLayer.ts +0 -26
  1245. package/src/ui/utils/portal/__workshop__/named.tsx +0 -63
  1246. package/src/ui/utils/portal/index.ts +0 -4
  1247. package/src/ui/utils/portal/portal.test.tsx +0 -103
  1248. package/src/ui/utils/portal/portal.ts +0 -46
  1249. package/src/ui/utils/portal/portalContext.ts +0 -31
  1250. package/src/ui/utils/portal/portalProvider.tsx +0 -79
  1251. package/src/ui/utils/portal/types.ts +0 -9
  1252. package/src/ui/utils/portal/usePortal.ts +0 -25
  1253. package/src/ui/utils/srOnly/index.ts +0 -1
  1254. package/src/ui/utils/srOnly/srOnly.tsx +0 -35
  1255. package/src/ui/utils/virtualList/__workshop__/index.ts +0 -29
  1256. package/src/ui/utils/virtualList/__workshop__/infiniteList.tsx +0 -48
  1257. package/src/ui/utils/virtualList/index.ts +0 -1
  1258. package/src/ui/utils/virtualList/virtualList.tsx +0 -189
  1259. /package/src/{ui/components/autocomplete/__mocks__ → core/components/autocomplete/__workshop__/mock}/apiStore.ts +0 -0
  1260. /package/src/{ui/components/autocomplete/__mocks__ → core/components/autocomplete/__workshop__/mock}/countries.ts +0 -0
  1261. /package/src/{ui → core}/components/autocomplete/__workshop__/types.ts +0 -0
  1262. /package/src/{ui → core}/components/breadcrumbs/__workshop__/index.ts +0 -0
  1263. /package/src/{ui → core}/components/dialog/__workshop__/index.ts +0 -0
  1264. /package/src/{ui → core}/components/dialog/__workshop__/layering.tsx +0 -0
  1265. /package/src/{ui → core}/components/dialog/__workshop__/nested.tsx +0 -0
  1266. /package/src/{ui → core}/components/dialog/__workshop__/provider.tsx +0 -0
  1267. /package/src/{ui → core}/components/hotkeys/__workshop__/index.ts +0 -0
  1268. /package/src/{ui → core}/components/hotkeys/__workshop__/plain.tsx +0 -0
  1269. /package/src/{ui → core}/components/menu/__workshop__/index.ts +0 -0
  1270. /package/src/{ui → core}/components/tab/__workshop__/index.ts +0 -0
  1271. /package/src/{ui → core}/components/toast/__workshop__/index.ts +0 -0
  1272. /package/src/{ui → core}/components/toast/toastState.ts +0 -0
  1273. /package/src/{ui → core}/components/tree/__workshop__/index.ts +0 -0
  1274. /package/src/{ui/utils → core/components}/virtualList/__workshop__/changingProps.tsx +0 -0
  1275. /package/src/{ui/utils → core/components}/virtualList/__workshop__/elementScroll.tsx +0 -0
  1276. /package/src/{ui/utils → core/components}/virtualList/__workshop__/windowScrolll.tsx +0 -0
  1277. /package/src/{ui → core}/helpers/animation.ts +0 -0
  1278. /package/src/{ui → core}/helpers/element.ts +0 -0
  1279. /package/src/{ui → core}/helpers/scroll.ts +0 -0
  1280. /package/src/{ui → core}/hooks/useCustomValidity.ts +0 -0
  1281. /package/src/{ui → core}/hooks/useElementRect/__workshop__/index.ts +0 -0
  1282. /package/src/{ui → core}/hooks/useElementRect/useElementRect.ts +0 -0
  1283. /package/src/{ui → core}/hooks/useGlobalKeyDown.ts +0 -0
  1284. /package/src/{ui → core}/hooks/useIsomorphicEffect.ts +0 -0
  1285. /package/src/{ui → core}/hooks/useMatchMedia.ts +0 -0
  1286. /package/src/{ui → core}/hooks/useMediaIndex/__workshop__/index.ts +0 -0
  1287. /package/src/{ui → core}/hooks/useMounted.ts +0 -0
  1288. /package/src/{ui → core}/hooks/usePrefersDark.ts +0 -0
  1289. /package/src/{ui → core}/hooks/usePrefersReducedMotion.ts +0 -0
  1290. /package/src/{theme/build → core}/lib/isRecord.ts +0 -0
  1291. /package/src/{ui/observers/resizeObserver.ts → core/observers/resize.ts} +0 -0
  1292. /package/src/{ui/utils → core/primitives}/arrow/cmds.ts +0 -0
  1293. /package/src/{ui → core}/primitives/avatar/__workshop__/index.ts +0 -0
  1294. /package/src/{ui → core}/primitives/badge/__workshop__/index.ts +0 -0
  1295. /package/src/{ui → core}/primitives/box/__workshop__/index.ts +0 -0
  1296. /package/src/{ui/types/box.ts → core/primitives/box/types.ts} +0 -0
  1297. /package/src/{ui → core}/primitives/button/__workshop__/mixedChildren.tsx +0 -0
  1298. /package/src/{ui → core}/primitives/button/__workshop__/styled1.tsx +0 -0
  1299. /package/src/{ui → core}/primitives/button/__workshop__/styled2.tsx +0 -0
  1300. /package/src/{ui → core}/primitives/card/__workshop__/styled.tsx +0 -0
  1301. /package/src/{ui → core}/primitives/checkbox/__workshop__/example.tsx +0 -0
  1302. /package/src/{ui → core}/primitives/checkbox/__workshop__/index.ts +0 -0
  1303. /package/src/{ui → core}/primitives/checkbox/__workshop__/readOnly.tsx +0 -0
  1304. /package/src/{ui → core}/primitives/code/__workshop__/index.ts +0 -0
  1305. /package/src/{ui → core}/primitives/container/__workshop__/index.ts +0 -0
  1306. /package/src/{ui → core}/primitives/container/types.ts +0 -0
  1307. /package/src/{ui → core}/primitives/flex/__workshop__/gap.tsx +0 -0
  1308. /package/src/{ui → core}/primitives/flex/__workshop__/index.ts +0 -0
  1309. /package/src/{ui → core}/primitives/grid/__workshop__/index.ts +0 -0
  1310. /package/src/{ui → core}/primitives/grid/__workshop__/responsive.tsx +0 -0
  1311. /package/src/{ui/types/grid.ts → core/primitives/grid/types.ts} +0 -0
  1312. /package/src/{ui → core}/primitives/heading/__workshop__/index.ts +0 -0
  1313. /package/src/{ui → core}/primitives/inline/__workshop__/index.ts +0 -0
  1314. /package/src/{ui → core}/primitives/kbd/__workshop__/index.ts +0 -0
  1315. /package/src/{ui → core}/primitives/kbd/__workshop__/plain.tsx +0 -0
  1316. /package/src/{ui → core}/primitives/label/__workshop__/index.ts +0 -0
  1317. /package/src/{ui → core}/primitives/label/__workshop__/opticalAlignment.tsx +0 -0
  1318. /package/src/{ui/utils → core/primitives}/layer/__workshop__/_debug.tsx +0 -0
  1319. /package/src/{ui/utils → core/primitives}/layer/types.ts +0 -0
  1320. /package/src/{ui → core}/primitives/popover/__workshop__/MarginsStory.tsx +0 -0
  1321. /package/src/{ui → core}/primitives/popover/__workshop__/OpenOnMountStory.tsx +0 -0
  1322. /package/src/{ui → core}/primitives/popover/__workshop__/index.ts +0 -0
  1323. /package/src/{ui → core}/primitives/radio/__workshop__/index.ts +0 -0
  1324. /package/src/{ui → core}/primitives/select/__workshop__/index.ts +0 -0
  1325. /package/src/{ui → core}/primitives/spinner/__workshop__/index.ts +0 -0
  1326. /package/src/{ui → core}/primitives/stack/__workshop__/index.ts +0 -0
  1327. /package/src/{ui → core}/primitives/switch/__workshop__/example.tsx +0 -0
  1328. /package/src/{ui → core}/primitives/switch/__workshop__/index.ts +0 -0
  1329. /package/src/{ui → core}/primitives/switch/__workshop__/props.tsx +0 -0
  1330. /package/src/{ui → core}/primitives/text/__workshop__/index.ts +0 -0
  1331. /package/src/{ui → core}/primitives/textArea/__workshop__/index.ts +0 -0
  1332. /package/src/{ui → core}/primitives/textInput/__workshop__/clearButton.tsx +0 -0
  1333. /package/src/{ui → core}/primitives/textInput/__workshop__/index.ts +0 -0
  1334. /package/src/{ui → core}/primitives/textInput/__workshop__/readOnly.tsx +0 -0
  1335. /package/src/{ui → core}/primitives/tooltip/__workshop__/index.ts +0 -0
  1336. /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/index.ts +0 -0
  1337. /package/src/{ui → core}/primitives/tooltip/tooltipDelayGroup/types.ts +0 -0
  1338. /package/src/{ui → core}/types/gridItem.ts +0 -0
  1339. /package/src/{ui → core}/types/placement.ts +0 -0
  1340. /package/src/{ui/types/text.ts → core/types/textAlign.ts} +0 -0
  1341. /package/src/{ui → core}/utils/boundaryElement/__workshop__/index.ts +0 -0
  1342. /package/src/{ui → core}/utils/boundaryElement/__workshop__/plain.tsx +0 -0
  1343. /package/src/{ui → core}/utils/elementQuery/__workshop__/index.ts +0 -0
  1344. /package/src/{ui → core}/utils/elementQuery/helpers.ts +0 -0
  1345. /package/src/{ui → core}/utils/portal/__workshop__/index.ts +0 -0
  1346. /package/src/{ui → core}/utils/spanWithTextOverflow.tsx +0 -0
  1347. /package/src/css/{aspects → props}/pointerEvents/types.ts +0 -0
  1348. /package/src/theme/{build → v2/build}/_deprecated/color/index.ts +0 -0
  1349. /package/src/theme/{build → v2/build}/colorToken/index.ts +0 -0
  1350. /package/src/theme/{build → v2/build}/index.ts +0 -0
  1351. /package/src/theme/{build → v2/build}/lib/color-fns/blend/index.ts +0 -0
  1352. /package/src/theme/{build → v2/build}/lib/color-fns/index.ts +0 -0
  1353. /package/src/theme/{build → v2/build}/lib/color-fns/rgba.ts +0 -0
  1354. /package/src/theme/{build → v2/build}/lib/color-fns/types.ts +0 -0
  1355. /package/src/{ui → theme/v2/build}/lib/isRecord.ts +0 -0
  1356. /package/src/theme/{build → v2/build}/lib/utils.ts +0 -0
  1357. /package/src/theme/{config → v2/config}/index.ts +0 -0
  1358. /package/src/theme/{config → v2/config}/tokens/color/index.ts +0 -0
  1359. /package/src/theme/{palette → v3/palette}/index.ts +0 -0
package/dist/theme.cjs ADDED
@@ -0,0 +1,4791 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: !0 });
3
+ var color = require("@sanity/color");
4
+ const defaultThemeConfig = {
5
+ avatar: {
6
+ sizes: [{
7
+ distance: -4,
8
+ size: 19
9
+ }, {
10
+ distance: -4,
11
+ size: 25
12
+ }, {
13
+ distance: -8,
14
+ size: 33
15
+ }, {
16
+ distance: -12,
17
+ size: 49
18
+ }],
19
+ focusRing: {
20
+ offset: 1,
21
+ width: 1
22
+ }
23
+ },
24
+ button: {
25
+ textWeight: "medium",
26
+ border: {
27
+ width: 1
28
+ },
29
+ focusRing: {
30
+ offset: -1,
31
+ width: 1
32
+ }
33
+ },
34
+ card: {
35
+ border: {
36
+ width: 1
37
+ },
38
+ focusRing: {
39
+ offset: -1,
40
+ width: 1
41
+ },
42
+ shadow: {
43
+ outline: 0.5
44
+ }
45
+ },
46
+ container: [320, 640, 960, 1280, 1600, 1920],
47
+ media: [360, 600, 900, 1200, 1800, 2400],
48
+ layer: {
49
+ dialog: {
50
+ zOffset: 600
51
+ },
52
+ popover: {
53
+ zOffset: 400
54
+ },
55
+ tooltip: {
56
+ zOffset: 200
57
+ }
58
+ },
59
+ radius: [0, 1, 3, 7, 11, 15, 23, 43, 75, 127],
60
+ shadow: [null, {
61
+ umbra: [0, 0, 0, 0],
62
+ penumbra: [0, 0, 0, 0],
63
+ ambient: [0, 0, 0, 0]
64
+ }, {
65
+ umbra: [0, 3, 5, -2],
66
+ penumbra: [0, 6, 10, 0],
67
+ ambient: [0, 1, 18, 1]
68
+ }, {
69
+ umbra: [0, 7, 8, -4],
70
+ penumbra: [0, 12, 17, 2],
71
+ ambient: [0, 5, 22, 4]
72
+ }, {
73
+ umbra: [0, 9, 11, -5],
74
+ penumbra: [0, 18, 28, 2],
75
+ ambient: [0, 7, 34, 6]
76
+ }, {
77
+ umbra: [0, 11, 15, -7],
78
+ penumbra: [0, 24, 38, 3],
79
+ ambient: [0, 9, 46, 8]
80
+ }],
81
+ space: [0, 4, 8, 12, 20, 32, 52, 84, 136, 220],
82
+ input: {
83
+ border: {
84
+ width: 1
85
+ },
86
+ checkbox: {
87
+ size: 17,
88
+ focusRing: {
89
+ offset: -1,
90
+ width: 1
91
+ }
92
+ },
93
+ radio: {
94
+ size: 17,
95
+ markSize: 9,
96
+ focusRing: {
97
+ offset: -1,
98
+ width: 1
99
+ }
100
+ },
101
+ switch: {
102
+ width: 25,
103
+ height: 17,
104
+ padding: 5,
105
+ transitionDurationMs: 150,
106
+ transitionTimingFunction: "ease-out",
107
+ focusRing: {
108
+ offset: 1,
109
+ width: 1
110
+ }
111
+ },
112
+ select: {
113
+ focusRing: {
114
+ offset: -1,
115
+ width: 1
116
+ }
117
+ },
118
+ text: {
119
+ focusRing: {
120
+ offset: -1,
121
+ width: 1
122
+ }
123
+ }
124
+ },
125
+ style: {
126
+ button: {
127
+ root: {
128
+ transition: "background-color 100ms,border-color 100ms,color 100ms"
129
+ }
130
+ }
131
+ // card: {
132
+ // root: {
133
+ // transition: 'background-color 100ms,border-color 100ms,color 100ms',
134
+ // },
135
+ // },
136
+ }
137
+ };
138
+ function is_v2(themeProp) {
139
+ return themeProp._version === 2;
140
+ }
141
+ function themeColor_v0_v2_9(color2) {
142
+ if ("neutral" in color2.badge)
143
+ return color2;
144
+ const colors2 = color2;
145
+ return {
146
+ ...colors2,
147
+ badge: {
148
+ ...colors2.badge,
149
+ neutral: colors2.badge.default,
150
+ suggest: colors2.badge.primary
151
+ },
152
+ button: {
153
+ bleed: {
154
+ ...colors2.button.bleed,
155
+ neutral: colors2.button.bleed.default,
156
+ suggest: colors2.button.bleed.primary
157
+ },
158
+ default: {
159
+ ...colors2.button.default,
160
+ neutral: colors2.button.default.default,
161
+ suggest: colors2.button.default.primary
162
+ },
163
+ ghost: {
164
+ ...colors2.button.ghost,
165
+ neutral: colors2.button.ghost.default,
166
+ suggest: colors2.button.ghost.primary
167
+ }
168
+ },
169
+ selectable: {
170
+ ...colors2.selectable,
171
+ neutral: colors2.selectable.default,
172
+ suggest: colors2.selectable.primary
173
+ }
174
+ };
175
+ }
176
+ const cache$4 = /* @__PURE__ */ new WeakMap();
177
+ function themeColor_v0_v2(color_v0) {
178
+ const cached_v2 = cache$4.get(color_v0);
179
+ if (cached_v2) return cached_v2;
180
+ const base = stateThemeColor_v0_v2(color_v0, color_v0.card.enabled), color_v2 = {
181
+ _blend: color_v0._blend || (color_v0.dark ? "screen" : "multiply"),
182
+ _dark: color_v0.dark,
183
+ accent: base.accent,
184
+ avatar: base.avatar,
185
+ backdrop: color_v0.base.shadow.ambient,
186
+ badge: base.badge,
187
+ bg: color_v0.base.bg,
188
+ border: color_v0.base.border,
189
+ button: {
190
+ default: stateTonesThemeColor_v0_v2(color_v0, color_v0.button.default),
191
+ ghost: stateTonesThemeColor_v0_v2(color_v0, color_v0.button.ghost),
192
+ bleed: stateTonesThemeColor_v0_v2(color_v0, color_v0.button.bleed)
193
+ },
194
+ code: base.code,
195
+ fg: color_v0.base.fg,
196
+ focusRing: color_v0.base.focusRing,
197
+ icon: base.muted.fg,
198
+ input: {
199
+ default: inputStatesThemeColor_v0_v2(color_v0.input.default),
200
+ invalid: inputStatesThemeColor_v0_v2(color_v0.input.invalid)
201
+ },
202
+ kbd: base.kbd,
203
+ link: base.link,
204
+ muted: {
205
+ ...base.muted,
206
+ bg: color_v0.selectable?.default.enabled.bg2 || color_v0.base.bg
207
+ },
208
+ selectable: stateTonesThemeColor_v0_v2(color_v0, color_v0.selectable || color_v0.muted),
209
+ shadow: color_v0.base.shadow,
210
+ skeleton: {
211
+ from: color_v0.skeleton?.from || color_v0.base.border,
212
+ to: color_v0.skeleton?.to || color_v0.base.border
213
+ },
214
+ syntax: color_v0.syntax
215
+ };
216
+ return cache$4.set(color_v0, color_v2), color_v2;
217
+ }
218
+ function stateTonesThemeColor_v0_v2(v0, t) {
219
+ return {
220
+ default: {
221
+ enabled: stateThemeColor_v0_v2(v0, t.default.enabled),
222
+ hovered: stateThemeColor_v0_v2(v0, t.default.hovered),
223
+ pressed: stateThemeColor_v0_v2(v0, t.default.pressed),
224
+ selected: stateThemeColor_v0_v2(v0, t.default.selected),
225
+ disabled: stateThemeColor_v0_v2(v0, t.default.disabled)
226
+ },
227
+ neutral: {
228
+ enabled: stateThemeColor_v0_v2(v0, t.default.enabled),
229
+ hovered: stateThemeColor_v0_v2(v0, t.default.hovered),
230
+ pressed: stateThemeColor_v0_v2(v0, t.default.pressed),
231
+ selected: stateThemeColor_v0_v2(v0, t.default.selected),
232
+ disabled: stateThemeColor_v0_v2(v0, t.default.disabled)
233
+ },
234
+ primary: {
235
+ enabled: stateThemeColor_v0_v2(v0, t.primary.enabled),
236
+ hovered: stateThemeColor_v0_v2(v0, t.primary.hovered),
237
+ pressed: stateThemeColor_v0_v2(v0, t.primary.pressed),
238
+ selected: stateThemeColor_v0_v2(v0, t.primary.selected),
239
+ disabled: stateThemeColor_v0_v2(v0, t.primary.disabled)
240
+ },
241
+ suggest: {
242
+ enabled: stateThemeColor_v0_v2(v0, t.primary.enabled),
243
+ hovered: stateThemeColor_v0_v2(v0, t.primary.hovered),
244
+ pressed: stateThemeColor_v0_v2(v0, t.primary.pressed),
245
+ selected: stateThemeColor_v0_v2(v0, t.primary.selected),
246
+ disabled: stateThemeColor_v0_v2(v0, t.primary.disabled)
247
+ },
248
+ positive: {
249
+ enabled: stateThemeColor_v0_v2(v0, t.positive.enabled),
250
+ hovered: stateThemeColor_v0_v2(v0, t.positive.hovered),
251
+ pressed: stateThemeColor_v0_v2(v0, t.positive.pressed),
252
+ selected: stateThemeColor_v0_v2(v0, t.positive.selected),
253
+ disabled: stateThemeColor_v0_v2(v0, t.positive.disabled)
254
+ },
255
+ caution: {
256
+ enabled: stateThemeColor_v0_v2(v0, t.caution.enabled),
257
+ hovered: stateThemeColor_v0_v2(v0, t.caution.hovered),
258
+ pressed: stateThemeColor_v0_v2(v0, t.caution.pressed),
259
+ selected: stateThemeColor_v0_v2(v0, t.caution.selected),
260
+ disabled: stateThemeColor_v0_v2(v0, t.caution.disabled)
261
+ },
262
+ critical: {
263
+ enabled: stateThemeColor_v0_v2(v0, t.critical.enabled),
264
+ hovered: stateThemeColor_v0_v2(v0, t.critical.hovered),
265
+ pressed: stateThemeColor_v0_v2(v0, t.critical.pressed),
266
+ selected: stateThemeColor_v0_v2(v0, t.critical.selected),
267
+ disabled: stateThemeColor_v0_v2(v0, t.critical.disabled)
268
+ }
269
+ };
270
+ }
271
+ function stateThemeColor_v0_v2(v0, state) {
272
+ return {
273
+ ...state,
274
+ avatar: {
275
+ gray: {
276
+ bg: v0.spot.gray,
277
+ fg: v0.base.bg
278
+ },
279
+ blue: {
280
+ bg: v0.spot.blue,
281
+ fg: v0.base.bg
282
+ },
283
+ purple: {
284
+ bg: v0.spot.purple,
285
+ fg: v0.base.bg
286
+ },
287
+ magenta: {
288
+ bg: v0.spot.magenta,
289
+ fg: v0.base.bg
290
+ },
291
+ red: {
292
+ bg: v0.spot.red,
293
+ fg: v0.base.bg
294
+ },
295
+ orange: {
296
+ bg: v0.spot.orange,
297
+ fg: v0.base.bg
298
+ },
299
+ yellow: {
300
+ bg: v0.spot.yellow,
301
+ fg: v0.base.bg
302
+ },
303
+ green: {
304
+ bg: v0.spot.green,
305
+ fg: v0.base.bg
306
+ },
307
+ cyan: {
308
+ bg: v0.spot.cyan,
309
+ fg: v0.base.bg
310
+ }
311
+ },
312
+ badge: {
313
+ default: {
314
+ bg: v0.muted.default.enabled.bg,
315
+ fg: v0.muted.default.enabled.fg,
316
+ dot: v0.muted.default.enabled.muted.fg,
317
+ icon: v0.muted.default.enabled.muted.fg
318
+ },
319
+ neutral: {
320
+ bg: v0.muted.transparent.enabled.bg,
321
+ fg: v0.muted.transparent.enabled.fg,
322
+ dot: v0.muted.transparent.enabled.muted.fg,
323
+ icon: v0.muted.transparent.enabled.muted.fg
324
+ },
325
+ primary: {
326
+ bg: v0.muted.primary.enabled.bg,
327
+ fg: v0.muted.primary.enabled.fg,
328
+ dot: v0.muted.primary.enabled.muted.fg,
329
+ icon: v0.muted.primary.enabled.muted.fg
330
+ },
331
+ suggest: {
332
+ bg: v0.muted.primary.enabled.bg,
333
+ fg: v0.muted.primary.enabled.fg,
334
+ dot: v0.muted.primary.enabled.muted.fg,
335
+ icon: v0.muted.primary.enabled.muted.fg
336
+ },
337
+ positive: {
338
+ bg: v0.muted.positive.enabled.bg,
339
+ fg: v0.muted.positive.enabled.fg,
340
+ dot: v0.muted.positive.enabled.muted.fg,
341
+ icon: v0.muted.positive.enabled.muted.fg
342
+ },
343
+ caution: {
344
+ bg: v0.muted.caution.enabled.bg,
345
+ fg: v0.muted.caution.enabled.fg,
346
+ dot: v0.muted.caution.enabled.muted.fg,
347
+ icon: v0.muted.caution.enabled.muted.fg
348
+ },
349
+ critical: {
350
+ bg: v0.muted.critical.enabled.bg,
351
+ fg: v0.muted.critical.enabled.fg,
352
+ dot: v0.muted.critical.enabled.muted.fg,
353
+ icon: v0.muted.critical.enabled.muted.fg
354
+ }
355
+ },
356
+ kbd: {
357
+ bg: v0.muted.default.enabled.bg,
358
+ fg: v0.muted.default.enabled.fg,
359
+ border: v0.muted.default.enabled.border
360
+ },
361
+ muted: {
362
+ ...v0.muted.default.enabled.muted,
363
+ bg: state.bg2 || state.bg
364
+ },
365
+ skeleton: {
366
+ from: state.skeleton?.from || state.border,
367
+ to: state.skeleton?.to || state.border
368
+ }
369
+ };
370
+ }
371
+ function inputStatesThemeColor_v0_v2(states) {
372
+ return {
373
+ enabled: inputStateThemeColor_v0_v2(states.enabled),
374
+ disabled: inputStateThemeColor_v0_v2(states.disabled),
375
+ readOnly: inputStateThemeColor_v0_v2(states.readOnly),
376
+ hovered: inputStateThemeColor_v0_v2(states.hovered)
377
+ };
378
+ }
379
+ function inputStateThemeColor_v0_v2(state) {
380
+ return {
381
+ bg: state.bg,
382
+ border: state.border,
383
+ fg: state.fg,
384
+ muted: {
385
+ bg: state.bg2
386
+ },
387
+ placeholder: state.placeholder
388
+ };
389
+ }
390
+ const cache$3 = /* @__PURE__ */ new WeakMap();
391
+ function v0_v2(v0) {
392
+ if (v0.v2) return v0.v2;
393
+ const cached_v2 = cache$3.get(v0);
394
+ if (cached_v2) return cached_v2;
395
+ const {
396
+ avatar,
397
+ button,
398
+ color: color2,
399
+ container,
400
+ fonts: font,
401
+ input,
402
+ layer,
403
+ media,
404
+ radius,
405
+ shadows: shadow,
406
+ space,
407
+ styles: style
408
+ } = v0, v2 = {
409
+ _version: 2,
410
+ avatar: {
411
+ ...defaultThemeConfig.avatar,
412
+ ...avatar
413
+ },
414
+ button: {
415
+ ...defaultThemeConfig.button,
416
+ ...button
417
+ },
418
+ card: defaultThemeConfig.card,
419
+ color: {
420
+ light: {
421
+ transparent: themeColor_v0_v2(color2.light.transparent),
422
+ default: themeColor_v0_v2(color2.light.default),
423
+ neutral: themeColor_v0_v2(color2.light.transparent),
424
+ primary: themeColor_v0_v2(color2.light.primary),
425
+ suggest: themeColor_v0_v2(color2.light.primary),
426
+ positive: themeColor_v0_v2(color2.light.positive),
427
+ caution: themeColor_v0_v2(color2.light.caution),
428
+ critical: themeColor_v0_v2(color2.light.critical)
429
+ },
430
+ dark: {
431
+ transparent: themeColor_v0_v2(color2.dark.transparent),
432
+ default: themeColor_v0_v2(color2.dark.default),
433
+ neutral: themeColor_v0_v2(color2.dark.transparent),
434
+ primary: themeColor_v0_v2(color2.dark.primary),
435
+ suggest: themeColor_v0_v2(color2.dark.primary),
436
+ positive: themeColor_v0_v2(color2.dark.positive),
437
+ caution: themeColor_v0_v2(color2.dark.caution),
438
+ critical: themeColor_v0_v2(color2.dark.critical)
439
+ }
440
+ },
441
+ container,
442
+ font,
443
+ input: {
444
+ ...defaultThemeConfig.input,
445
+ ...input,
446
+ checkbox: {
447
+ ...defaultThemeConfig.input.checkbox,
448
+ ...input.checkbox
449
+ },
450
+ radio: {
451
+ ...defaultThemeConfig.input.radio,
452
+ ...input.radio
453
+ },
454
+ switch: {
455
+ ...defaultThemeConfig.input.switch,
456
+ ...input.switch
457
+ }
458
+ },
459
+ layer: layer ?? defaultThemeConfig.layer,
460
+ media,
461
+ radius,
462
+ shadow,
463
+ space,
464
+ style
465
+ };
466
+ return cache$3.set(v0, v2), v2;
467
+ }
468
+ const cache$2 = /* @__PURE__ */ new WeakMap();
469
+ function v2_v0(v2, v3) {
470
+ const cachedTheme = cache$2.get(v2);
471
+ if (cachedTheme) return cachedTheme;
472
+ const {
473
+ avatar,
474
+ button,
475
+ color: color2,
476
+ container,
477
+ font: fonts,
478
+ input,
479
+ media,
480
+ radius,
481
+ shadow: shadows,
482
+ space,
483
+ style: styles
484
+ } = v2;
485
+ return {
486
+ _version: 0,
487
+ avatar,
488
+ button,
489
+ container,
490
+ color: {
491
+ light: {
492
+ transparent: themeColor_v2_v0(color2.light.transparent),
493
+ default: themeColor_v2_v0(color2.light.default),
494
+ primary: themeColor_v2_v0(color2.light.primary),
495
+ positive: themeColor_v2_v0(color2.light.positive),
496
+ caution: themeColor_v2_v0(color2.light.caution),
497
+ critical: themeColor_v2_v0(color2.light.critical)
498
+ },
499
+ dark: {
500
+ transparent: themeColor_v2_v0(color2.dark.transparent),
501
+ default: themeColor_v2_v0(color2.dark.default),
502
+ primary: themeColor_v2_v0(color2.dark.primary),
503
+ positive: themeColor_v2_v0(color2.dark.positive),
504
+ caution: themeColor_v2_v0(color2.dark.caution),
505
+ critical: themeColor_v2_v0(color2.dark.critical)
506
+ }
507
+ },
508
+ focusRing: input.text.focusRing,
509
+ fonts,
510
+ input,
511
+ media,
512
+ radius,
513
+ shadows,
514
+ space,
515
+ styles,
516
+ v2,
517
+ v3
518
+ };
519
+ }
520
+ function themeColor_v2_v0(color_v2) {
521
+ return {
522
+ base: {
523
+ bg: color_v2.bg,
524
+ fg: color_v2.fg,
525
+ border: color_v2.border,
526
+ focusRing: color_v2.focusRing,
527
+ shadow: color_v2.shadow
528
+ },
529
+ button: color_v2.button,
530
+ card: color_v2.selectable.default,
531
+ dark: color_v2._dark,
532
+ input: {
533
+ default: inputStatesThemeColor_v2_v0(color_v2.input.default),
534
+ invalid: inputStatesThemeColor_v2_v0(color_v2.input.invalid)
535
+ },
536
+ muted: {
537
+ ...color_v2.button.ghost,
538
+ transparent: color_v2.button.ghost.default
539
+ },
540
+ solid: {
541
+ ...color_v2.button.default,
542
+ transparent: color_v2.button.default.default
543
+ },
544
+ selectable: color_v2.selectable,
545
+ spot: {
546
+ gray: color_v2.avatar.gray.bg,
547
+ blue: color_v2.avatar.blue.bg,
548
+ purple: color_v2.avatar.purple.bg,
549
+ magenta: color_v2.avatar.magenta.bg,
550
+ red: color_v2.avatar.red.bg,
551
+ orange: color_v2.avatar.orange.bg,
552
+ yellow: color_v2.avatar.yellow.bg,
553
+ green: color_v2.avatar.green.bg,
554
+ cyan: color_v2.avatar.cyan.bg
555
+ },
556
+ syntax: color_v2.syntax
557
+ };
558
+ }
559
+ function inputStatesThemeColor_v2_v0(t) {
560
+ return {
561
+ enabled: inputStateThemeColor_v2_v0(t.enabled),
562
+ disabled: inputStateThemeColor_v2_v0(t.disabled),
563
+ readOnly: inputStateThemeColor_v2_v0(t.readOnly),
564
+ hovered: inputStateThemeColor_v2_v0(t.hovered)
565
+ };
566
+ }
567
+ function inputStateThemeColor_v2_v0(t) {
568
+ return {
569
+ bg: t.bg,
570
+ bg2: t.muted.bg,
571
+ border: t.border,
572
+ fg: t.fg,
573
+ placeholder: t.placeholder
574
+ };
575
+ }
576
+ const cache$1 = /* @__PURE__ */ new Map();
577
+ function getScopedTheme(themeProp, scheme, tone) {
578
+ const cachedTheme = _getCachedTheme(themeProp, scheme, tone);
579
+ if (cachedTheme) return cachedTheme;
580
+ const v0 = is_v2(themeProp) ? v2_v0(themeProp) : themeProp, v2 = is_v2(themeProp) ? themeProp : v0_v2(themeProp), colorScheme_v0 = v0.color[scheme] || v0.color.light, color_v0 = colorScheme_v0[tone] || colorScheme_v0.default, layer_v0 = v0.layer || defaultThemeConfig.layer, colorScheme_v2 = v2.color[scheme] || v2.color.light, color_v2 = colorScheme_v2[tone] || colorScheme_v2.default, color_v2_9 = themeColor_v0_v2_9(color_v2), layer_v2 = v2.layer || defaultThemeConfig.layer, theme = {
581
+ sanity: {
582
+ ...v0,
583
+ color: color_v0,
584
+ layer: layer_v0,
585
+ v2: {
586
+ ...v2,
587
+ _resolved: !0,
588
+ color: color_v2_9,
589
+ layer: layer_v2
590
+ }
591
+ }
592
+ };
593
+ return _setCachedTheme(themeProp, scheme, tone, theme), theme;
594
+ }
595
+ function _getCachedTheme(rootTheme, scheme, tone) {
596
+ const schemeCache = cache$1.get(scheme);
597
+ if (!schemeCache) return;
598
+ const toneCache = schemeCache.get(tone);
599
+ if (toneCache)
600
+ return toneCache.get(rootTheme);
601
+ }
602
+ function _setCachedTheme(rootTheme, scheme, tone, theme) {
603
+ cache$1.has(scheme) || cache$1.set(scheme, /* @__PURE__ */ new Map());
604
+ const schemeCache = cache$1.get(scheme);
605
+ schemeCache.has(tone) || schemeCache.set(tone, /* @__PURE__ */ new WeakMap()), schemeCache.get(tone).set(rootTheme, theme);
606
+ }
607
+ function createSelectableTones(opts, base, dark, solid, muted) {
608
+ return {
609
+ default: _createSelectableStates(opts, base, dark, solid, muted, "default"),
610
+ primary: _createSelectableStates(opts, base, dark, solid, muted, "primary"),
611
+ positive: _createSelectableStates(opts, base, dark, solid, muted, "positive"),
612
+ caution: _createSelectableStates(opts, base, dark, solid, muted, "caution"),
613
+ critical: _createSelectableStates(opts, base, dark, solid, muted, "critical")
614
+ };
615
+ }
616
+ function _createSelectableStates(opts, base, dark, solid, muted, tone) {
617
+ return {
618
+ enabled: opts.selectable({
619
+ base,
620
+ dark,
621
+ solid,
622
+ muted,
623
+ state: "enabled",
624
+ tone
625
+ }),
626
+ hovered: opts.selectable({
627
+ base,
628
+ dark,
629
+ solid,
630
+ muted,
631
+ state: "hovered",
632
+ tone
633
+ }),
634
+ pressed: opts.selectable({
635
+ base,
636
+ dark,
637
+ solid,
638
+ muted,
639
+ state: "pressed",
640
+ tone
641
+ }),
642
+ selected: opts.selectable({
643
+ base,
644
+ dark,
645
+ solid,
646
+ muted,
647
+ state: "selected",
648
+ tone
649
+ }),
650
+ disabled: opts.selectable({
651
+ base,
652
+ dark,
653
+ solid,
654
+ muted,
655
+ state: "disabled",
656
+ tone
657
+ })
658
+ };
659
+ }
660
+ function createSolidTones(opts, base, dark, name) {
661
+ return {
662
+ default: {
663
+ enabled: opts.solid({
664
+ base,
665
+ dark,
666
+ tone: "default",
667
+ name,
668
+ state: "enabled"
669
+ }),
670
+ disabled: opts.solid({
671
+ base,
672
+ dark,
673
+ tone: "default",
674
+ name,
675
+ state: "disabled"
676
+ }),
677
+ hovered: opts.solid({
678
+ base,
679
+ dark,
680
+ tone: "default",
681
+ name,
682
+ state: "hovered"
683
+ }),
684
+ pressed: opts.solid({
685
+ base,
686
+ dark,
687
+ tone: "default",
688
+ name,
689
+ state: "pressed"
690
+ }),
691
+ selected: opts.solid({
692
+ base,
693
+ dark,
694
+ tone: "default",
695
+ name,
696
+ state: "selected"
697
+ })
698
+ },
699
+ transparent: {
700
+ enabled: opts.solid({
701
+ base,
702
+ dark,
703
+ tone: "transparent",
704
+ name,
705
+ state: "enabled"
706
+ }),
707
+ disabled: opts.solid({
708
+ base,
709
+ dark,
710
+ tone: "transparent",
711
+ name,
712
+ state: "disabled"
713
+ }),
714
+ hovered: opts.solid({
715
+ base,
716
+ dark,
717
+ tone: "transparent",
718
+ name,
719
+ state: "hovered"
720
+ }),
721
+ pressed: opts.solid({
722
+ base,
723
+ dark,
724
+ tone: "transparent",
725
+ name,
726
+ state: "pressed"
727
+ }),
728
+ selected: opts.solid({
729
+ base,
730
+ dark,
731
+ tone: "transparent",
732
+ name,
733
+ state: "selected"
734
+ })
735
+ },
736
+ primary: {
737
+ enabled: opts.solid({
738
+ base,
739
+ dark,
740
+ tone: "primary",
741
+ name,
742
+ state: "enabled"
743
+ }),
744
+ disabled: opts.solid({
745
+ base,
746
+ dark,
747
+ tone: "primary",
748
+ name,
749
+ state: "disabled"
750
+ }),
751
+ hovered: opts.solid({
752
+ base,
753
+ dark,
754
+ tone: "primary",
755
+ name,
756
+ state: "hovered"
757
+ }),
758
+ pressed: opts.solid({
759
+ base,
760
+ dark,
761
+ tone: "primary",
762
+ name,
763
+ state: "pressed"
764
+ }),
765
+ selected: opts.solid({
766
+ base,
767
+ dark,
768
+ tone: "primary",
769
+ name,
770
+ state: "selected"
771
+ })
772
+ },
773
+ positive: {
774
+ enabled: opts.solid({
775
+ base,
776
+ dark,
777
+ tone: "positive",
778
+ name,
779
+ state: "enabled"
780
+ }),
781
+ disabled: opts.solid({
782
+ base,
783
+ dark,
784
+ tone: "positive",
785
+ name,
786
+ state: "disabled"
787
+ }),
788
+ hovered: opts.solid({
789
+ base,
790
+ dark,
791
+ tone: "positive",
792
+ name,
793
+ state: "hovered"
794
+ }),
795
+ pressed: opts.solid({
796
+ base,
797
+ dark,
798
+ tone: "positive",
799
+ name,
800
+ state: "pressed"
801
+ }),
802
+ selected: opts.solid({
803
+ base,
804
+ dark,
805
+ tone: "positive",
806
+ name,
807
+ state: "selected"
808
+ })
809
+ },
810
+ caution: {
811
+ enabled: opts.solid({
812
+ base,
813
+ dark,
814
+ tone: "caution",
815
+ name,
816
+ state: "enabled"
817
+ }),
818
+ disabled: opts.solid({
819
+ base,
820
+ dark,
821
+ tone: "caution",
822
+ name,
823
+ state: "disabled"
824
+ }),
825
+ hovered: opts.solid({
826
+ base,
827
+ dark,
828
+ tone: "caution",
829
+ name,
830
+ state: "hovered"
831
+ }),
832
+ pressed: opts.solid({
833
+ base,
834
+ dark,
835
+ tone: "caution",
836
+ name,
837
+ state: "pressed"
838
+ }),
839
+ selected: opts.solid({
840
+ base,
841
+ dark,
842
+ tone: "caution",
843
+ name,
844
+ state: "selected"
845
+ })
846
+ },
847
+ critical: {
848
+ enabled: opts.solid({
849
+ base,
850
+ dark,
851
+ tone: "critical",
852
+ name,
853
+ state: "enabled"
854
+ }),
855
+ disabled: opts.solid({
856
+ base,
857
+ dark,
858
+ tone: "critical",
859
+ name,
860
+ state: "disabled"
861
+ }),
862
+ hovered: opts.solid({
863
+ base,
864
+ dark,
865
+ tone: "critical",
866
+ name,
867
+ state: "hovered"
868
+ }),
869
+ pressed: opts.solid({
870
+ base,
871
+ dark,
872
+ tone: "critical",
873
+ name,
874
+ state: "pressed"
875
+ }),
876
+ selected: opts.solid({
877
+ base,
878
+ dark,
879
+ tone: "critical",
880
+ name,
881
+ state: "selected"
882
+ })
883
+ }
884
+ };
885
+ }
886
+ function createButtonTones(opts, base, dark, solid, muted, mode) {
887
+ return {
888
+ default: opts.button({
889
+ base,
890
+ dark,
891
+ solid: solid.default,
892
+ muted: muted.default,
893
+ mode
894
+ }),
895
+ primary: opts.button({
896
+ base,
897
+ dark,
898
+ solid: solid.primary,
899
+ muted: muted.primary,
900
+ mode
901
+ }),
902
+ positive: opts.button({
903
+ base,
904
+ dark,
905
+ solid: solid.positive,
906
+ muted: muted.positive,
907
+ mode
908
+ }),
909
+ caution: opts.button({
910
+ base,
911
+ dark,
912
+ solid: solid.caution,
913
+ muted: muted.caution,
914
+ mode
915
+ }),
916
+ critical: opts.button({
917
+ base,
918
+ dark,
919
+ solid: solid.critical,
920
+ muted: muted.critical,
921
+ mode
922
+ })
923
+ };
924
+ }
925
+ function createButtonModes(opts, base, dark, solid, muted) {
926
+ return {
927
+ default: createButtonTones(opts, base, dark, solid, muted, "default"),
928
+ ghost: createButtonTones(opts, base, dark, solid, muted, "ghost"),
929
+ bleed: createButtonTones(opts, base, dark, solid, muted, "bleed")
930
+ };
931
+ }
932
+ function createCardStates(opts, base, dark, name, solid, muted) {
933
+ return {
934
+ enabled: opts.card({
935
+ base,
936
+ dark,
937
+ name,
938
+ state: "enabled",
939
+ solid,
940
+ muted
941
+ }),
942
+ disabled: opts.card({
943
+ base,
944
+ dark,
945
+ name,
946
+ state: "disabled",
947
+ solid,
948
+ muted
949
+ }),
950
+ hovered: opts.card({
951
+ base,
952
+ dark,
953
+ name,
954
+ state: "hovered",
955
+ solid,
956
+ muted
957
+ }),
958
+ pressed: opts.card({
959
+ base,
960
+ dark,
961
+ name,
962
+ state: "pressed",
963
+ solid,
964
+ muted
965
+ }),
966
+ selected: opts.card({
967
+ base,
968
+ dark,
969
+ name,
970
+ state: "selected",
971
+ solid,
972
+ muted
973
+ })
974
+ };
975
+ }
976
+ const black = "hsl(0, 0%, 0%)", white = "hsl(0, 0%, 100%)", colors = {
977
+ default: {
978
+ lightest: "hsl(0, 0%, 95%)",
979
+ lighter: "hsl(0, 0%, 70%)",
980
+ light: "hsl(0, 0%, 65%)",
981
+ base: "hsl(0, 0%, 50%)",
982
+ dark: "hsl(0, 0%, 35%)",
983
+ darker: "hsl(0, 0%, 20%)",
984
+ darkest: "hsl(0, 0%, 5%)"
985
+ },
986
+ transparent: {
987
+ lightest: "hsl(240, 100%, 95%)",
988
+ lighter: "hsl(240, 100%, 70%)",
989
+ light: "hsl(240, 100%, 65%)",
990
+ base: "hsl(240, 100%, 50%)",
991
+ dark: "hsl(240, 100%, 35%)",
992
+ darker: "hsl(240, 100%, 20%)",
993
+ darkest: "hsl(240, 100%, 5%)"
994
+ },
995
+ primary: {
996
+ lightest: "hsl(240, 100%, 95%)",
997
+ lighter: "hsl(240, 100%, 70%)",
998
+ light: "hsl(240, 100%, 65%)",
999
+ base: "hsl(240, 100%, 50%)",
1000
+ dark: "hsl(240, 100%, 35%)",
1001
+ darker: "hsl(240, 100%, 20%)",
1002
+ darkest: "hsl(240, 100%, 5%)"
1003
+ },
1004
+ positive: {
1005
+ lightest: "hsl(120, 100%, 95%)",
1006
+ lighter: "hsl(120, 100%, 70%)",
1007
+ light: "hsl(120, 100%, 65%)",
1008
+ base: "hsl(120, 100%, 50%)",
1009
+ dark: "hsl(120, 100%, 35%)",
1010
+ darker: "hsl(120, 100%, 20%)",
1011
+ darkest: "hsl(120, 100%, 5%)"
1012
+ },
1013
+ caution: {
1014
+ lightest: "hsl(60, 100%, 95%)",
1015
+ lighter: "hsl(60, 100%, 70%)",
1016
+ light: "hsl(60, 100%, 65%)",
1017
+ base: "hsl(60, 100%, 50%)",
1018
+ dark: "hsl(60, 100%, 35%)",
1019
+ darker: "hsl(60, 100%, 20%)",
1020
+ darkest: "hsl(60, 100%, 5%)"
1021
+ },
1022
+ critical: {
1023
+ lightest: "hsl(0, 100%, 95%)",
1024
+ lighter: "hsl(0, 100%, 70%)",
1025
+ light: "hsl(0, 100%, 65%)",
1026
+ base: "hsl(0, 100%, 50%)",
1027
+ dark: "hsl(0, 100%, 35%)",
1028
+ darker: "hsl(0, 100%, 20%)",
1029
+ darkest: "hsl(0, 100%, 5%)"
1030
+ }
1031
+ }, spots = {
1032
+ gray: "hsl(0, 0%, 50%)",
1033
+ red: "hsl(0, 100%, 50%)",
1034
+ orange: "hsl(30, 100%, 50%)",
1035
+ yellow: "hsl(60, 100%, 50%)",
1036
+ green: "hsl(120, 100%, 50%)",
1037
+ cyan: "hsl(180, 100%, 50%)",
1038
+ blue: "hsl(240, 100%, 50%)",
1039
+ purple: "hsl(270, 100%, 50%)",
1040
+ magenta: "hsl(300, 100%, 50%)"
1041
+ }, tones = {
1042
+ transparent: {
1043
+ bg: [colors.transparent.darkest, colors.transparent.lightest],
1044
+ fg: [colors.transparent.lightest, colors.transparent.darkest],
1045
+ border: [colors.transparent.darker, colors.transparent.lighter],
1046
+ focusRing: [colors.transparent.base, colors.transparent.base]
1047
+ },
1048
+ primary: {
1049
+ bg: [colors.primary.darkest, colors.primary.lightest],
1050
+ fg: [colors.primary.lightest, colors.primary.darkest],
1051
+ border: [colors.primary.darker, colors.primary.lighter],
1052
+ focusRing: [colors.primary.base, colors.primary.base]
1053
+ },
1054
+ positive: {
1055
+ bg: [colors.positive.darkest, colors.positive.lightest],
1056
+ fg: [colors.positive.lightest, colors.positive.darkest],
1057
+ border: [colors.positive.darker, colors.positive.lighter],
1058
+ focusRing: [colors.positive.base, colors.positive.base]
1059
+ },
1060
+ caution: {
1061
+ bg: [colors.caution.darkest, colors.caution.lightest],
1062
+ fg: [colors.caution.lightest, colors.caution.darkest],
1063
+ border: [colors.caution.darker, colors.caution.lighter],
1064
+ focusRing: [colors.caution.base, colors.caution.base]
1065
+ },
1066
+ critical: {
1067
+ bg: [colors.critical.darkest, colors.critical.lightest],
1068
+ fg: [colors.critical.lightest, colors.critical.darkest],
1069
+ border: [colors.critical.darker, colors.critical.lighter],
1070
+ focusRing: [colors.critical.base, colors.critical.base]
1071
+ }
1072
+ }, defaultOpts = {
1073
+ base: ({
1074
+ dark,
1075
+ name
1076
+ }) => name === "default" ? {
1077
+ bg: dark ? black : white,
1078
+ fg: dark ? white : black,
1079
+ border: dark ? colors.default.darkest : colors.default.lightest,
1080
+ focusRing: colors.primary.base,
1081
+ shadow: {
1082
+ outline: black,
1083
+ umbra: black,
1084
+ penumbra: black,
1085
+ ambient: black
1086
+ },
1087
+ skeleton: {
1088
+ from: dark ? white : black,
1089
+ to: dark ? white : black
1090
+ }
1091
+ } : {
1092
+ bg: tones[name].bg[dark ? 0 : 1],
1093
+ fg: tones[name].fg[dark ? 0 : 1],
1094
+ border: tones[name].border[dark ? 0 : 1],
1095
+ focusRing: tones[name].focusRing[dark ? 0 : 1],
1096
+ shadow: {
1097
+ outline: black,
1098
+ umbra: black,
1099
+ penumbra: black,
1100
+ ambient: black
1101
+ },
1102
+ skeleton: {
1103
+ from: dark ? white : black,
1104
+ to: dark ? white : black
1105
+ }
1106
+ },
1107
+ solid: ({
1108
+ base,
1109
+ dark,
1110
+ state,
1111
+ tone
1112
+ }) => {
1113
+ const color2 = colors[tone];
1114
+ return state === "hovered" ? {
1115
+ bg: dark ? color2.light : color2.dark,
1116
+ bg2: dark ? color2.light : color2.dark,
1117
+ border: dark ? color2.lighter : color2.darker,
1118
+ fg: dark ? color2.darkest : color2.lightest,
1119
+ icon: dark ? color2.darkest : color2.lightest,
1120
+ muted: {
1121
+ fg: black
1122
+ },
1123
+ accent: {
1124
+ fg: black
1125
+ },
1126
+ link: {
1127
+ fg: black
1128
+ },
1129
+ code: {
1130
+ bg: black,
1131
+ fg: black
1132
+ },
1133
+ skeleton: base.skeleton
1134
+ } : {
1135
+ bg: color2.base,
1136
+ bg2: color2.base,
1137
+ border: dark ? color2.light : color2.dark,
1138
+ fg: dark ? color2.darkest : color2.lightest,
1139
+ icon: dark ? color2.darkest : color2.lightest,
1140
+ muted: {
1141
+ fg: black
1142
+ },
1143
+ accent: {
1144
+ fg: black
1145
+ },
1146
+ link: {
1147
+ fg: black
1148
+ },
1149
+ code: {
1150
+ bg: black,
1151
+ fg: black
1152
+ },
1153
+ skeleton: base.skeleton
1154
+ };
1155
+ },
1156
+ muted: ({
1157
+ base,
1158
+ dark,
1159
+ state,
1160
+ tone
1161
+ }) => {
1162
+ const color2 = colors[tone];
1163
+ return state === "hovered" ? {
1164
+ bg: dark ? color2.darker : color2.lighter,
1165
+ bg2: dark ? color2.darker : color2.lighter,
1166
+ border: dark ? color2.lighter : color2.darker,
1167
+ fg: dark ? color2.lightest : color2.darkest,
1168
+ icon: dark ? color2.lightest : color2.darkest,
1169
+ muted: {
1170
+ fg: black
1171
+ },
1172
+ accent: {
1173
+ fg: black
1174
+ },
1175
+ link: {
1176
+ fg: black
1177
+ },
1178
+ code: {
1179
+ bg: black,
1180
+ fg: black
1181
+ },
1182
+ skeleton: base.skeleton
1183
+ } : {
1184
+ bg: dark ? color2.darkest : color2.lightest,
1185
+ bg2: dark ? color2.darkest : color2.lightest,
1186
+ border: dark ? color2.darker : color2.lighter,
1187
+ fg: dark ? color2.lighter : color2.darker,
1188
+ icon: dark ? color2.lighter : color2.darker,
1189
+ muted: {
1190
+ fg: black
1191
+ },
1192
+ accent: {
1193
+ fg: black
1194
+ },
1195
+ link: {
1196
+ fg: black
1197
+ },
1198
+ code: {
1199
+ bg: black,
1200
+ fg: black
1201
+ },
1202
+ skeleton: base.skeleton
1203
+ };
1204
+ },
1205
+ button: ({
1206
+ base,
1207
+ mode,
1208
+ muted,
1209
+ solid
1210
+ }) => mode === "bleed" ? {
1211
+ ...muted,
1212
+ enabled: {
1213
+ bg: "transparent",
1214
+ bg2: "transparent",
1215
+ fg: muted.enabled.fg,
1216
+ icon: muted.enabled.fg,
1217
+ border: "transparent",
1218
+ muted: {
1219
+ fg: black
1220
+ },
1221
+ accent: {
1222
+ fg: black
1223
+ },
1224
+ link: {
1225
+ fg: black
1226
+ },
1227
+ code: {
1228
+ bg: black,
1229
+ fg: black
1230
+ },
1231
+ skeleton: base.skeleton
1232
+ },
1233
+ hovered: {
1234
+ bg: muted.enabled.bg,
1235
+ bg2: muted.enabled.bg,
1236
+ fg: muted.hovered.fg,
1237
+ icon: muted.hovered.fg,
1238
+ border: "transparent",
1239
+ muted: {
1240
+ fg: black
1241
+ },
1242
+ accent: {
1243
+ fg: black
1244
+ },
1245
+ link: {
1246
+ fg: black
1247
+ },
1248
+ code: {
1249
+ bg: black,
1250
+ fg: black
1251
+ },
1252
+ skeleton: base.skeleton
1253
+ }
1254
+ } : mode === "ghost" ? {
1255
+ ...solid,
1256
+ enabled: muted.enabled
1257
+ } : solid,
1258
+ card: ({
1259
+ base
1260
+ }) => ({
1261
+ bg: black,
1262
+ bg2: black,
1263
+ fg: black,
1264
+ icon: black,
1265
+ border: black,
1266
+ muted: {
1267
+ fg: black
1268
+ },
1269
+ accent: {
1270
+ fg: black
1271
+ },
1272
+ link: {
1273
+ fg: black
1274
+ },
1275
+ code: {
1276
+ bg: black,
1277
+ fg: black
1278
+ },
1279
+ skeleton: base.skeleton
1280
+ }),
1281
+ input: () => ({
1282
+ bg: black,
1283
+ bg2: black,
1284
+ fg: black,
1285
+ border: black,
1286
+ placeholder: black
1287
+ }),
1288
+ selectable: ({
1289
+ muted,
1290
+ state,
1291
+ tone
1292
+ }) => muted[tone][state],
1293
+ spot: ({
1294
+ key
1295
+ }) => spots[key],
1296
+ syntax: () => ({
1297
+ atrule: black,
1298
+ attrName: black,
1299
+ attrValue: black,
1300
+ attribute: black,
1301
+ boolean: black,
1302
+ builtin: black,
1303
+ cdata: black,
1304
+ char: black,
1305
+ class: black,
1306
+ className: black,
1307
+ comment: black,
1308
+ constant: black,
1309
+ deleted: black,
1310
+ doctype: black,
1311
+ entity: black,
1312
+ function: black,
1313
+ hexcode: black,
1314
+ id: black,
1315
+ important: black,
1316
+ inserted: black,
1317
+ keyword: black,
1318
+ number: black,
1319
+ operator: black,
1320
+ prolog: black,
1321
+ property: black,
1322
+ pseudoClass: black,
1323
+ pseudoElement: black,
1324
+ punctuation: black,
1325
+ regex: black,
1326
+ selector: black,
1327
+ string: black,
1328
+ symbol: black,
1329
+ tag: black,
1330
+ unit: black,
1331
+ url: black,
1332
+ variable: black
1333
+ })
1334
+ };
1335
+ function createInputModes(opts, base, dark, solid, muted) {
1336
+ return {
1337
+ default: {
1338
+ enabled: opts.input({
1339
+ base,
1340
+ dark,
1341
+ mode: "default",
1342
+ state: "enabled",
1343
+ solid: solid.default,
1344
+ muted: muted.default
1345
+ }),
1346
+ disabled: opts.input({
1347
+ base,
1348
+ dark,
1349
+ mode: "default",
1350
+ state: "disabled",
1351
+ solid: solid.default,
1352
+ muted: muted.default
1353
+ }),
1354
+ hovered: opts.input({
1355
+ base,
1356
+ dark,
1357
+ mode: "default",
1358
+ state: "hovered",
1359
+ solid: solid.default,
1360
+ muted: muted.default
1361
+ }),
1362
+ readOnly: opts.input({
1363
+ base,
1364
+ dark,
1365
+ mode: "default",
1366
+ state: "readOnly",
1367
+ solid: solid.default,
1368
+ muted: muted.default
1369
+ })
1370
+ },
1371
+ invalid: {
1372
+ enabled: opts.input({
1373
+ base,
1374
+ dark,
1375
+ mode: "invalid",
1376
+ state: "enabled",
1377
+ solid: solid.default,
1378
+ muted: muted.default
1379
+ }),
1380
+ disabled: opts.input({
1381
+ base,
1382
+ dark,
1383
+ mode: "invalid",
1384
+ state: "disabled",
1385
+ solid: solid.default,
1386
+ muted: muted.default
1387
+ }),
1388
+ hovered: opts.input({
1389
+ base,
1390
+ dark,
1391
+ mode: "invalid",
1392
+ state: "hovered",
1393
+ solid: solid.default,
1394
+ muted: muted.default
1395
+ }),
1396
+ readOnly: opts.input({
1397
+ base,
1398
+ dark,
1399
+ mode: "invalid",
1400
+ state: "readOnly",
1401
+ solid: solid.default,
1402
+ muted: muted.default
1403
+ })
1404
+ }
1405
+ };
1406
+ }
1407
+ function createMutedTones(opts, base, dark, name) {
1408
+ return {
1409
+ default: {
1410
+ enabled: opts.muted({
1411
+ base,
1412
+ dark,
1413
+ tone: "default",
1414
+ name,
1415
+ state: "enabled"
1416
+ }),
1417
+ disabled: opts.muted({
1418
+ base,
1419
+ dark,
1420
+ tone: "default",
1421
+ name,
1422
+ state: "disabled"
1423
+ }),
1424
+ hovered: opts.muted({
1425
+ base,
1426
+ dark,
1427
+ tone: "default",
1428
+ name,
1429
+ state: "hovered"
1430
+ }),
1431
+ pressed: opts.muted({
1432
+ base,
1433
+ dark,
1434
+ tone: "default",
1435
+ name,
1436
+ state: "pressed"
1437
+ }),
1438
+ selected: opts.muted({
1439
+ base,
1440
+ dark,
1441
+ tone: "default",
1442
+ name,
1443
+ state: "selected"
1444
+ })
1445
+ },
1446
+ transparent: {
1447
+ enabled: opts.muted({
1448
+ base,
1449
+ dark,
1450
+ tone: "transparent",
1451
+ name,
1452
+ state: "enabled"
1453
+ }),
1454
+ disabled: opts.muted({
1455
+ base,
1456
+ dark,
1457
+ tone: "transparent",
1458
+ name,
1459
+ state: "disabled"
1460
+ }),
1461
+ hovered: opts.muted({
1462
+ base,
1463
+ dark,
1464
+ tone: "transparent",
1465
+ name,
1466
+ state: "hovered"
1467
+ }),
1468
+ pressed: opts.muted({
1469
+ base,
1470
+ dark,
1471
+ tone: "transparent",
1472
+ name,
1473
+ state: "pressed"
1474
+ }),
1475
+ selected: opts.muted({
1476
+ base,
1477
+ dark,
1478
+ tone: "transparent",
1479
+ name,
1480
+ state: "selected"
1481
+ })
1482
+ },
1483
+ primary: {
1484
+ enabled: opts.muted({
1485
+ base,
1486
+ dark,
1487
+ tone: "primary",
1488
+ name,
1489
+ state: "enabled"
1490
+ }),
1491
+ disabled: opts.muted({
1492
+ base,
1493
+ dark,
1494
+ tone: "primary",
1495
+ name,
1496
+ state: "disabled"
1497
+ }),
1498
+ hovered: opts.muted({
1499
+ base,
1500
+ dark,
1501
+ tone: "primary",
1502
+ name,
1503
+ state: "hovered"
1504
+ }),
1505
+ pressed: opts.muted({
1506
+ base,
1507
+ dark,
1508
+ tone: "primary",
1509
+ name,
1510
+ state: "pressed"
1511
+ }),
1512
+ selected: opts.muted({
1513
+ base,
1514
+ dark,
1515
+ tone: "primary",
1516
+ name,
1517
+ state: "selected"
1518
+ })
1519
+ },
1520
+ positive: {
1521
+ enabled: opts.muted({
1522
+ base,
1523
+ dark,
1524
+ tone: "positive",
1525
+ name,
1526
+ state: "enabled"
1527
+ }),
1528
+ disabled: opts.muted({
1529
+ base,
1530
+ dark,
1531
+ tone: "positive",
1532
+ name,
1533
+ state: "disabled"
1534
+ }),
1535
+ hovered: opts.muted({
1536
+ base,
1537
+ dark,
1538
+ tone: "positive",
1539
+ name,
1540
+ state: "hovered"
1541
+ }),
1542
+ pressed: opts.muted({
1543
+ base,
1544
+ dark,
1545
+ tone: "positive",
1546
+ name,
1547
+ state: "pressed"
1548
+ }),
1549
+ selected: opts.muted({
1550
+ base,
1551
+ dark,
1552
+ tone: "positive",
1553
+ name,
1554
+ state: "selected"
1555
+ })
1556
+ },
1557
+ caution: {
1558
+ enabled: opts.muted({
1559
+ base,
1560
+ dark,
1561
+ tone: "caution",
1562
+ name,
1563
+ state: "enabled"
1564
+ }),
1565
+ disabled: opts.muted({
1566
+ base,
1567
+ dark,
1568
+ tone: "caution",
1569
+ name,
1570
+ state: "disabled"
1571
+ }),
1572
+ hovered: opts.muted({
1573
+ base,
1574
+ dark,
1575
+ tone: "caution",
1576
+ name,
1577
+ state: "hovered"
1578
+ }),
1579
+ pressed: opts.muted({
1580
+ base,
1581
+ dark,
1582
+ tone: "caution",
1583
+ name,
1584
+ state: "pressed"
1585
+ }),
1586
+ selected: opts.muted({
1587
+ base,
1588
+ dark,
1589
+ tone: "caution",
1590
+ name,
1591
+ state: "selected"
1592
+ })
1593
+ },
1594
+ critical: {
1595
+ enabled: opts.muted({
1596
+ base,
1597
+ dark,
1598
+ tone: "critical",
1599
+ name,
1600
+ state: "enabled"
1601
+ }),
1602
+ disabled: opts.muted({
1603
+ base,
1604
+ dark,
1605
+ tone: "critical",
1606
+ name,
1607
+ state: "disabled"
1608
+ }),
1609
+ hovered: opts.muted({
1610
+ base,
1611
+ dark,
1612
+ tone: "critical",
1613
+ name,
1614
+ state: "hovered"
1615
+ }),
1616
+ pressed: opts.muted({
1617
+ base,
1618
+ dark,
1619
+ tone: "critical",
1620
+ name,
1621
+ state: "pressed"
1622
+ }),
1623
+ selected: opts.muted({
1624
+ base,
1625
+ dark,
1626
+ tone: "critical",
1627
+ name,
1628
+ state: "selected"
1629
+ })
1630
+ }
1631
+ };
1632
+ }
1633
+ function createSpot(opts, base, dark) {
1634
+ return {
1635
+ gray: opts.spot({
1636
+ base,
1637
+ dark,
1638
+ key: "gray"
1639
+ }),
1640
+ blue: opts.spot({
1641
+ base,
1642
+ dark,
1643
+ key: "blue"
1644
+ }),
1645
+ purple: opts.spot({
1646
+ base,
1647
+ dark,
1648
+ key: "purple"
1649
+ }),
1650
+ magenta: opts.spot({
1651
+ base,
1652
+ dark,
1653
+ key: "magenta"
1654
+ }),
1655
+ red: opts.spot({
1656
+ base,
1657
+ dark,
1658
+ key: "red"
1659
+ }),
1660
+ orange: opts.spot({
1661
+ base,
1662
+ dark,
1663
+ key: "orange"
1664
+ }),
1665
+ yellow: opts.spot({
1666
+ base,
1667
+ dark,
1668
+ key: "yellow"
1669
+ }),
1670
+ green: opts.spot({
1671
+ base,
1672
+ dark,
1673
+ key: "green"
1674
+ }),
1675
+ cyan: opts.spot({
1676
+ base,
1677
+ dark,
1678
+ key: "cyan"
1679
+ })
1680
+ };
1681
+ }
1682
+ function createColorTheme(partialOpts = {}) {
1683
+ const builders = {
1684
+ ...defaultOpts,
1685
+ ...partialOpts
1686
+ };
1687
+ return {
1688
+ light: _createColorScheme(builders, !1),
1689
+ dark: _createColorScheme(builders, !0)
1690
+ };
1691
+ }
1692
+ function _createColorScheme(opts, dark) {
1693
+ return {
1694
+ default: _createColor(opts, dark, "default"),
1695
+ transparent: _createColor(opts, dark, "transparent"),
1696
+ primary: _createColor(opts, dark, "primary"),
1697
+ positive: _createColor(opts, dark, "positive"),
1698
+ caution: _createColor(opts, dark, "caution"),
1699
+ critical: _createColor(opts, dark, "critical")
1700
+ };
1701
+ }
1702
+ function _createColor(opts, dark, name) {
1703
+ const base = opts.base({
1704
+ dark,
1705
+ name
1706
+ }), solid = createSolidTones(opts, base, dark, name), muted = createMutedTones(opts, base, dark, name);
1707
+ return {
1708
+ base,
1709
+ button: createButtonModes(opts, base, dark, solid, muted),
1710
+ card: createCardStates(opts, base, dark, name, solid, muted),
1711
+ dark,
1712
+ input: createInputModes(opts, base, dark, solid, muted),
1713
+ selectable: createSelectableTones(opts, base, dark, solid, muted),
1714
+ spot: createSpot(opts, base, dark),
1715
+ syntax: opts.syntax({
1716
+ base,
1717
+ dark
1718
+ }),
1719
+ solid,
1720
+ muted
1721
+ };
1722
+ }
1723
+ const defaultThemeFonts$1 = {
1724
+ code: {
1725
+ family: "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
1726
+ weights: {
1727
+ regular: 400,
1728
+ medium: 500,
1729
+ semibold: 600,
1730
+ bold: 700
1731
+ },
1732
+ sizes: [{
1733
+ ascenderHeight: 4,
1734
+ descenderHeight: 4,
1735
+ fontSize: 10,
1736
+ iconSize: 17,
1737
+ lineHeight: 15,
1738
+ letterSpacing: 0
1739
+ }, {
1740
+ ascenderHeight: 5,
1741
+ descenderHeight: 5,
1742
+ fontSize: 13,
1743
+ iconSize: 21,
1744
+ lineHeight: 19,
1745
+ letterSpacing: 0
1746
+ }, {
1747
+ ascenderHeight: 6,
1748
+ descenderHeight: 6,
1749
+ fontSize: 16,
1750
+ iconSize: 25,
1751
+ lineHeight: 23,
1752
+ letterSpacing: 0
1753
+ }, {
1754
+ ascenderHeight: 7,
1755
+ descenderHeight: 7,
1756
+ fontSize: 19,
1757
+ iconSize: 29,
1758
+ lineHeight: 27,
1759
+ letterSpacing: 0
1760
+ }, {
1761
+ ascenderHeight: 8,
1762
+ descenderHeight: 8,
1763
+ fontSize: 22,
1764
+ iconSize: 33,
1765
+ lineHeight: 31,
1766
+ letterSpacing: 0
1767
+ }]
1768
+ },
1769
+ heading: {
1770
+ family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
1771
+ weights: {
1772
+ regular: 600,
1773
+ medium: 700,
1774
+ semibold: 800,
1775
+ bold: 900
1776
+ },
1777
+ sizes: [{
1778
+ ascenderHeight: 5,
1779
+ descenderHeight: 5,
1780
+ fontSize: 13,
1781
+ iconSize: 17,
1782
+ lineHeight: 19,
1783
+ letterSpacing: 0
1784
+ }, {
1785
+ ascenderHeight: 6,
1786
+ descenderHeight: 6,
1787
+ fontSize: 16,
1788
+ iconSize: 25,
1789
+ lineHeight: 23,
1790
+ letterSpacing: 0
1791
+ }, {
1792
+ ascenderHeight: 7,
1793
+ descenderHeight: 7,
1794
+ fontSize: 21,
1795
+ iconSize: 33,
1796
+ lineHeight: 29,
1797
+ letterSpacing: -0.25
1798
+ }, {
1799
+ ascenderHeight: 8,
1800
+ descenderHeight: 8,
1801
+ fontSize: 27,
1802
+ iconSize: 41,
1803
+ lineHeight: 35,
1804
+ letterSpacing: -0.5
1805
+ }, {
1806
+ ascenderHeight: 9.5,
1807
+ descenderHeight: 8.5,
1808
+ fontSize: 33,
1809
+ iconSize: 49,
1810
+ lineHeight: 41,
1811
+ letterSpacing: -1
1812
+ }, {
1813
+ ascenderHeight: 10.5,
1814
+ descenderHeight: 9.5,
1815
+ fontSize: 38,
1816
+ iconSize: 53,
1817
+ lineHeight: 47,
1818
+ letterSpacing: -1
1819
+ }]
1820
+ },
1821
+ label: {
1822
+ family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", system-ui, sans-serif',
1823
+ weights: {
1824
+ regular: 500,
1825
+ medium: 600,
1826
+ semibold: 700,
1827
+ bold: 800
1828
+ },
1829
+ sizes: [{
1830
+ ascenderHeight: 2,
1831
+ descenderHeight: 2,
1832
+ fontSize: 8.1,
1833
+ iconSize: 13,
1834
+ lineHeight: 10,
1835
+ letterSpacing: 0.5
1836
+ }, {
1837
+ ascenderHeight: 1.5,
1838
+ descenderHeight: 2.5,
1839
+ fontSize: 9.5,
1840
+ iconSize: 15,
1841
+ lineHeight: 11,
1842
+ letterSpacing: 0.5
1843
+ }, {
1844
+ ascenderHeight: 2,
1845
+ descenderHeight: 2,
1846
+ fontSize: 10.8,
1847
+ iconSize: 17,
1848
+ lineHeight: 12,
1849
+ letterSpacing: 0.5
1850
+ }, {
1851
+ ascenderHeight: 2,
1852
+ descenderHeight: 2,
1853
+ fontSize: 12.25,
1854
+ iconSize: 19,
1855
+ lineHeight: 13,
1856
+ letterSpacing: 0.5
1857
+ }, {
1858
+ ascenderHeight: 1.5,
1859
+ descenderHeight: 2.5,
1860
+ fontSize: 13.6,
1861
+ iconSize: 21,
1862
+ lineHeight: 14,
1863
+ letterSpacing: 0.5
1864
+ }, {
1865
+ ascenderHeight: 2,
1866
+ descenderHeight: 2,
1867
+ fontSize: 15,
1868
+ iconSize: 23,
1869
+ lineHeight: 15,
1870
+ letterSpacing: 0.5
1871
+ }]
1872
+ },
1873
+ text: {
1874
+ family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
1875
+ weights: {
1876
+ regular: 400,
1877
+ medium: 500,
1878
+ semibold: 600,
1879
+ bold: 700
1880
+ },
1881
+ sizes: [{
1882
+ ascenderHeight: 4,
1883
+ descenderHeight: 4,
1884
+ fontSize: 10,
1885
+ iconSize: 17,
1886
+ lineHeight: 15,
1887
+ letterSpacing: 0
1888
+ }, {
1889
+ ascenderHeight: 5,
1890
+ descenderHeight: 5,
1891
+ fontSize: 13,
1892
+ iconSize: 21,
1893
+ lineHeight: 19,
1894
+ letterSpacing: 0
1895
+ }, {
1896
+ ascenderHeight: 6,
1897
+ descenderHeight: 6,
1898
+ fontSize: 15,
1899
+ iconSize: 25,
1900
+ lineHeight: 23,
1901
+ letterSpacing: 0
1902
+ }, {
1903
+ ascenderHeight: 7,
1904
+ descenderHeight: 7,
1905
+ fontSize: 18,
1906
+ iconSize: 29,
1907
+ lineHeight: 27,
1908
+ letterSpacing: 0
1909
+ }, {
1910
+ ascenderHeight: 8,
1911
+ descenderHeight: 8,
1912
+ fontSize: 21,
1913
+ iconSize: 33,
1914
+ lineHeight: 31,
1915
+ letterSpacing: 0
1916
+ }]
1917
+ }
1918
+ }, THEME_COLOR_SCHEMES = ["light", "dark"], THEME_COLOR_BLEND_MODES = ["multiply", "screen"], THEME_COLOR_CARD_TONES = [
1919
+ "transparent",
1920
+ "default",
1921
+ "neutral",
1922
+ "primary",
1923
+ // deprecated
1924
+ "suggest",
1925
+ "positive",
1926
+ "caution",
1927
+ "critical"
1928
+ ], THEME_COLOR_STATE_TONES = [
1929
+ "default",
1930
+ "neutral",
1931
+ "primary",
1932
+ // deprecated
1933
+ "suggest",
1934
+ "positive",
1935
+ "caution",
1936
+ "critical"
1937
+ ], THEME_COLOR_STATES = ["enabled", "hovered", "pressed", "selected", "disabled"], THEME_COLOR_BUTTON_MODES = ["default", "ghost", "bleed"], THEME_COLOR_INPUT_MODES = ["default", "invalid"], THEME_COLOR_INPUT_STATES = ["enabled", "hovered", "readOnly", "disabled"], THEME_COLOR_AVATAR_COLORS = color.COLOR_HUES;
1938
+ function isColorBlendModeValue(str) {
1939
+ return THEME_COLOR_BLEND_MODES.includes(str);
1940
+ }
1941
+ function isColorHueKey(str) {
1942
+ return color.COLOR_HUES.includes(str);
1943
+ }
1944
+ function isColorTintKey(str) {
1945
+ return color.COLOR_TINTS.includes(str);
1946
+ }
1947
+ function isColorButtonMode(str) {
1948
+ return THEME_COLOR_BUTTON_MODES.includes(str);
1949
+ }
1950
+ const COLOR_CONFIG_STATE_KEYS = ["_hue", "bg", "fg", "border", "focusRing", "muted/fg", "accent/fg", "link/fg", "code/bg", "code/fg", "skeleton/from", "skeleton/to", "status/dot", "status/icon"], COLOR_CONFIG_CARD_KEYS = [...COLOR_CONFIG_STATE_KEYS, "_hue", "bg", "fg", "border", "focusRing", "shadow/outline", "shadow/umbra", "shadow/penumbra", "shadow/ambient"], COLOR_CONFIG_BLEND_KEYS = ["_blend"], COLOR_CONFIG_AVATAR_COLORS = ["*", ...THEME_COLOR_AVATAR_COLORS], COLOR_CONFIG_CARD_TONES = ["*", ...THEME_COLOR_CARD_TONES], COLOR_CONFIG_STATE_TONES = ["*", ...THEME_COLOR_STATE_TONES], COLOR_CONFIG_STATES = ["*", ...THEME_COLOR_STATES], COLOR_CONFIG_INPUT_MODES = ["*", ...THEME_COLOR_INPUT_MODES], COLOR_CONFIG_INPUT_STATES = ["*", ...THEME_COLOR_INPUT_STATES];
1951
+ function isColorConfigBaseTone(str) {
1952
+ return COLOR_CONFIG_CARD_TONES.includes(str);
1953
+ }
1954
+ function isColorConfigBaseKey(str) {
1955
+ return COLOR_CONFIG_CARD_KEYS.includes(str);
1956
+ }
1957
+ function isColorConfigStateKey(str) {
1958
+ return COLOR_CONFIG_STATE_KEYS.includes(str);
1959
+ }
1960
+ function isColorConfigStateTone(str) {
1961
+ return COLOR_CONFIG_STATE_TONES.includes(str);
1962
+ }
1963
+ function isColorConfigBlendKey(str) {
1964
+ return COLOR_CONFIG_BLEND_KEYS.includes(str);
1965
+ }
1966
+ function isColorValue(str) {
1967
+ return str === "black" || str === "white";
1968
+ }
1969
+ function isColorOpacityValue(str) {
1970
+ return str === "0" || /^0\.[0-9]+$/.test(str) || str === "1";
1971
+ }
1972
+ function isColorMixPercentValue(str) {
1973
+ return /^\d+%$/.test(str);
1974
+ }
1975
+ function parseTokenValue(str) {
1976
+ const segments = str.split("/");
1977
+ let nextSegment = segments.shift() || "";
1978
+ const [segment0, segment0mix] = nextSegment.split(" ");
1979
+ if (isColorTintKey(segment0)) {
1980
+ const tint = segment0, segment1 = segments.shift() || "";
1981
+ if (isColorMixPercentValue(segment0mix)) {
1982
+ const mix2 = Number(segment0mix.slice(0, -1)) / 100;
1983
+ return {
1984
+ type: "color",
1985
+ tint,
1986
+ mix: mix2
1987
+ };
1988
+ }
1989
+ if (isColorOpacityValue(segment1)) {
1990
+ const opacity = Number(segment1);
1991
+ return {
1992
+ type: "color",
1993
+ tint,
1994
+ opacity
1995
+ };
1996
+ }
1997
+ return {
1998
+ type: "color",
1999
+ tint
2000
+ };
2001
+ }
2002
+ if (isColorValue(segment0)) {
2003
+ const key = segment0, segment1 = segments.shift() || "";
2004
+ if (isColorMixPercentValue(segment0mix)) {
2005
+ const mix2 = Number(segment0mix.slice(0, -1)) / 100;
2006
+ return {
2007
+ type: "color",
2008
+ key,
2009
+ mix: mix2
2010
+ };
2011
+ }
2012
+ if (isColorOpacityValue(segment1)) {
2013
+ const opacity = Number(segment1);
2014
+ return {
2015
+ type: "color",
2016
+ key,
2017
+ opacity
2018
+ };
2019
+ }
2020
+ return {
2021
+ type: "color",
2022
+ key
2023
+ };
2024
+ }
2025
+ if (isColorHueKey(segment0)) {
2026
+ const hue = segment0;
2027
+ nextSegment = segments.shift() || "";
2028
+ const [segment1, segment1mix] = nextSegment.split(" ");
2029
+ if (isColorTintKey(segment1)) {
2030
+ const tint = segment1, segment2 = segments.shift() || "";
2031
+ if (isColorMixPercentValue(segment1mix)) {
2032
+ const mix2 = Number(segment1mix.slice(0, -1)) / 100;
2033
+ return {
2034
+ type: "color",
2035
+ hue,
2036
+ tint,
2037
+ mix: mix2
2038
+ };
2039
+ }
2040
+ if (isColorOpacityValue(segment2)) {
2041
+ const opacity = Number(segment2);
2042
+ return {
2043
+ type: "color",
2044
+ hue,
2045
+ tint,
2046
+ opacity
2047
+ };
2048
+ }
2049
+ return {
2050
+ type: "color",
2051
+ hue,
2052
+ tint
2053
+ };
2054
+ }
2055
+ return {
2056
+ type: "hue",
2057
+ value: hue
2058
+ };
2059
+ }
2060
+ if (isColorBlendModeValue(segment0))
2061
+ return {
2062
+ type: "blendMode",
2063
+ value: segment0
2064
+ };
2065
+ }
2066
+ function compileColorTokenValue(node) {
2067
+ let key = "";
2068
+ return node.key === "black" || node.key === "white" ? key = node.key : key = `${node.hue}/${node.tint}`, node.mix !== void 0 ? `${key} ${node.mix * 100}%` : (node.opacity !== void 0 && (key += `/${node.opacity}`), key);
2069
+ }
2070
+ const DEFAULT_COLOR_TOKEN_VALUE = ["500", "500"];
2071
+ function resolveColorTokenValue(context, value = DEFAULT_COLOR_TOKEN_VALUE) {
2072
+ const {
2073
+ hue,
2074
+ scheme
2075
+ } = context, node = parseTokenValue(value[scheme === "light" ? 0 : 1]);
2076
+ if (!node || node.type !== "color")
2077
+ throw new Error(`Invalid color token: ${value[0]}`);
2078
+ return compileColorTokenValue({
2079
+ ...node,
2080
+ hue: node.hue || hue
2081
+ });
2082
+ }
2083
+ const defaultColorTokens = {
2084
+ base: {
2085
+ "*": {
2086
+ _blend: ["multiply", "screen"],
2087
+ accent: {
2088
+ fg: ["purple/600", "purple/400"]
2089
+ },
2090
+ avatar: {
2091
+ "*": {
2092
+ _blend: ["screen", "multiply"],
2093
+ bg: ["500", "400"],
2094
+ fg: ["white", "black"]
2095
+ }
2096
+ },
2097
+ backdrop: ["gray/200/0.5", "black/0.5"],
2098
+ badge: {
2099
+ "*": {
2100
+ bg: ["100", "900"],
2101
+ fg: ["600", "400"],
2102
+ icon: ["500", "500"],
2103
+ dot: ["500", "500"]
2104
+ },
2105
+ positive: {
2106
+ bg: ["200 50%", "900"],
2107
+ fg: ["600", "500"]
2108
+ },
2109
+ caution: {
2110
+ bg: ["200 50%", "900"],
2111
+ fg: ["600", "500"]
2112
+ }
2113
+ },
2114
+ bg: ["50", "950"],
2115
+ border: ["200", "800"],
2116
+ code: {
2117
+ bg: ["50", "950"],
2118
+ fg: ["600", "400"]
2119
+ },
2120
+ fg: ["800", "200"],
2121
+ focusRing: ["blue/500", "blue/500"],
2122
+ icon: ["600", "400"],
2123
+ kbd: {
2124
+ bg: ["white", "black"],
2125
+ fg: ["600", "400"],
2126
+ border: ["200", "800"]
2127
+ },
2128
+ link: {
2129
+ fg: ["blue/600", "blue/300"]
2130
+ },
2131
+ muted: {
2132
+ bg: ["50", "950"],
2133
+ fg: ["700 75%", "300 75%"]
2134
+ },
2135
+ shadow: {
2136
+ outline: ["500/0.3", "500/0.4"],
2137
+ umbra: ["gray/500/0.1", "black/0.2"],
2138
+ penumbra: ["gray/500/0.07", "black/0.14"],
2139
+ ambient: ["gray/500/0.06", "black/0.12"]
2140
+ },
2141
+ skeleton: {
2142
+ from: ["100", "900"],
2143
+ to: ["100 50%", "900 50%"]
2144
+ }
2145
+ },
2146
+ transparent: {
2147
+ bg: ["50", "black"]
2148
+ },
2149
+ default: {
2150
+ bg: ["white", "950"],
2151
+ fg: ["800", "200"],
2152
+ muted: {
2153
+ fg: ["600", "400"]
2154
+ }
2155
+ },
2156
+ primary: {
2157
+ _hue: "blue"
2158
+ },
2159
+ suggest: {
2160
+ _hue: "purple"
2161
+ },
2162
+ positive: {
2163
+ _hue: "green",
2164
+ shadow: {
2165
+ outline: ["500/0.4", "500/0.4"]
2166
+ }
2167
+ },
2168
+ caution: {
2169
+ _hue: "yellow",
2170
+ shadow: {
2171
+ outline: ["600/0.3", "500/0.4"]
2172
+ }
2173
+ },
2174
+ critical: {
2175
+ _hue: "red"
2176
+ }
2177
+ },
2178
+ button: {
2179
+ default: {
2180
+ "*": {
2181
+ "*": {
2182
+ _blend: ["screen", "multiply"],
2183
+ accent: {
2184
+ fg: ["purple/300", "purple/700"]
2185
+ },
2186
+ avatar: {
2187
+ "*": {
2188
+ _blend: ["screen", "multiply"],
2189
+ bg: ["500", "400"],
2190
+ fg: ["white", "black"]
2191
+ }
2192
+ },
2193
+ badge: {
2194
+ "*": {
2195
+ bg: ["900", "100"],
2196
+ fg: ["400", "600"],
2197
+ dot: ["500", "500"],
2198
+ icon: ["500", "500"]
2199
+ }
2200
+ },
2201
+ bg: ["500", "400"],
2202
+ border: ["500/0", "400/0"],
2203
+ code: {
2204
+ bg: ["500 20%", "400 20%"],
2205
+ fg: ["200", "600"]
2206
+ },
2207
+ fg: ["white", "black"],
2208
+ icon: ["100 70%", "900 70%"],
2209
+ kbd: {
2210
+ bg: ["black", "white"],
2211
+ fg: ["200", "600"],
2212
+ border: ["800", "200"]
2213
+ },
2214
+ link: {
2215
+ fg: ["blue/200", "blue/600"]
2216
+ },
2217
+ muted: {
2218
+ bg: ["950", "50"],
2219
+ fg: ["100 70%", "900 70%"]
2220
+ },
2221
+ skeleton: {
2222
+ from: ["900", "100"],
2223
+ to: ["900 50%", "100 50%"]
2224
+ }
2225
+ },
2226
+ hovered: {
2227
+ bg: ["600", "300"],
2228
+ border: ["700/0", "300/0"]
2229
+ },
2230
+ pressed: {
2231
+ bg: ["700", "300"]
2232
+ },
2233
+ selected: {
2234
+ bg: ["700", "300"]
2235
+ },
2236
+ disabled: {
2237
+ _hue: "gray",
2238
+ accent: {
2239
+ fg: ["100 70%", "900 70%"]
2240
+ },
2241
+ avatar: {
2242
+ "*": {
2243
+ _blend: ["screen", "multiply"],
2244
+ bg: ["gray/500", "gray/400"],
2245
+ fg: ["white", "black"]
2246
+ }
2247
+ },
2248
+ badge: {
2249
+ "*": {
2250
+ bg: ["gray/700", "gray/300"],
2251
+ fg: ["white", "black"],
2252
+ dot: ["white", "black"],
2253
+ icon: ["white", "black"]
2254
+ }
2255
+ },
2256
+ bg: ["300", "600"],
2257
+ code: {
2258
+ bg: ["950", "50"],
2259
+ fg: ["300", "600"]
2260
+ },
2261
+ fg: ["300", "600"],
2262
+ muted: {
2263
+ bg: ["950", "50"],
2264
+ fg: ["300", "600"]
2265
+ },
2266
+ kbd: {
2267
+ bg: ["black", "white"],
2268
+ fg: ["white", "black"],
2269
+ border: ["700", "300"]
2270
+ },
2271
+ link: {
2272
+ fg: ["100 70%", "900 70%"]
2273
+ }
2274
+ }
2275
+ },
2276
+ default: {
2277
+ "*": {
2278
+ avatar: {
2279
+ "*": {
2280
+ _blend: ["screen", "multiply"],
2281
+ bg: ["500", "400"],
2282
+ fg: ["white", "black"]
2283
+ }
2284
+ },
2285
+ bg: ["800", "200"],
2286
+ muted: {
2287
+ bg: ["950", "50"],
2288
+ fg: ["400", "600"]
2289
+ }
2290
+ },
2291
+ hovered: {
2292
+ bg: ["900", "100"]
2293
+ },
2294
+ pressed: {
2295
+ bg: ["black", "white"]
2296
+ },
2297
+ selected: {
2298
+ bg: ["black", "white"]
2299
+ }
2300
+ }
2301
+ },
2302
+ ghost: {
2303
+ "*": {
2304
+ "*": {
2305
+ _blend: ["multiply", "screen"],
2306
+ accent: {
2307
+ fg: ["purple/700 60%", "purple/300 70%"]
2308
+ },
2309
+ avatar: {
2310
+ "*": {
2311
+ _blend: ["screen", "multiply"],
2312
+ bg: ["500", "400"],
2313
+ fg: ["white", "black"]
2314
+ }
2315
+ },
2316
+ badge: {
2317
+ "*": {
2318
+ bg: ["100", "900"],
2319
+ fg: ["600", "400"],
2320
+ dot: ["500", "500"],
2321
+ icon: ["500", "500"]
2322
+ }
2323
+ },
2324
+ bg: ["50", "950"],
2325
+ border: ["100", "900"],
2326
+ code: {
2327
+ bg: ["500 10%", "400 10%"],
2328
+ fg: ["700 60%", "400 60%"]
2329
+ },
2330
+ fg: ["600", "400"],
2331
+ icon: ["700 60%", "300 60%"],
2332
+ kbd: {
2333
+ bg: ["white", "black"],
2334
+ fg: ["600", "400"],
2335
+ border: ["200", "800"]
2336
+ },
2337
+ link: {
2338
+ fg: ["blue/700 60%", "blue/300 60%"]
2339
+ },
2340
+ muted: {
2341
+ bg: ["100", "950"],
2342
+ fg: ["700 60%", "300 60%"]
2343
+ },
2344
+ skeleton: {
2345
+ from: ["100", "900"],
2346
+ to: ["100 50%", "900 50%"]
2347
+ }
2348
+ },
2349
+ hovered: {
2350
+ bg: ["100", "900"],
2351
+ fg: ["700", "300"]
2352
+ },
2353
+ pressed: {
2354
+ bg: ["200", "800"],
2355
+ fg: ["800", "200"]
2356
+ },
2357
+ selected: {
2358
+ bg: ["200", "800"],
2359
+ fg: ["800", "200"]
2360
+ },
2361
+ disabled: {
2362
+ _hue: "gray",
2363
+ accent: {
2364
+ fg: ["200", "800"]
2365
+ },
2366
+ avatar: {
2367
+ "*": {
2368
+ _blend: ["screen", "multiply"],
2369
+ bg: ["gray/100", "gray/900"],
2370
+ fg: ["white", "black"]
2371
+ }
2372
+ },
2373
+ badge: {
2374
+ "*": {
2375
+ _hue: "gray",
2376
+ bg: ["50", "950"],
2377
+ fg: ["gray/200", "gray/800"],
2378
+ dot: ["gray/200", "gray/800"],
2379
+ icon: ["gray/200", "gray/800"]
2380
+ }
2381
+ },
2382
+ border: ["100", "900"],
2383
+ code: {
2384
+ bg: ["50", "950"],
2385
+ fg: ["200", "800"]
2386
+ },
2387
+ fg: ["400", "600"],
2388
+ icon: ["300", "700"],
2389
+ muted: {
2390
+ fg: ["300", "700"]
2391
+ },
2392
+ kbd: {
2393
+ bg: ["white", "black"],
2394
+ fg: ["200", "800"],
2395
+ border: ["100", "900"]
2396
+ },
2397
+ link: {
2398
+ fg: ["200", "800"]
2399
+ }
2400
+ }
2401
+ },
2402
+ positive: {
2403
+ "*": {
2404
+ border: ["600 20%", "800"]
2405
+ }
2406
+ },
2407
+ caution: {
2408
+ "*": {
2409
+ border: ["600 20%", "800"]
2410
+ }
2411
+ }
2412
+ },
2413
+ bleed: {
2414
+ "*": {
2415
+ "*": {
2416
+ _blend: ["multiply", "screen"],
2417
+ accent: {
2418
+ fg: ["purple/700 70%", "purple/300 70%"]
2419
+ },
2420
+ avatar: {
2421
+ "*": {
2422
+ _blend: ["screen", "multiply"],
2423
+ bg: ["500", "400"],
2424
+ fg: ["white", "black"]
2425
+ }
2426
+ },
2427
+ badge: {
2428
+ "*": {
2429
+ bg: ["100", "900"],
2430
+ fg: ["600", "400"],
2431
+ dot: ["500", "500"],
2432
+ icon: ["500", "500"]
2433
+ }
2434
+ },
2435
+ bg: ["white", "black"],
2436
+ border: ["white/0", "black/0"],
2437
+ code: {
2438
+ bg: ["50", "950"],
2439
+ fg: ["700 75%", "300 75%"]
2440
+ },
2441
+ fg: ["700", "300"],
2442
+ icon: ["700 75%", "300 75%"],
2443
+ kbd: {
2444
+ bg: ["white", "black"],
2445
+ fg: ["700", "300"],
2446
+ border: ["200", "800"]
2447
+ },
2448
+ link: {
2449
+ fg: ["blue/700 70%", "blue/300 70%"]
2450
+ },
2451
+ muted: {
2452
+ bg: ["100", "950"],
2453
+ fg: ["700 75%", "300 75%"]
2454
+ },
2455
+ skeleton: {
2456
+ from: ["100", "900"],
2457
+ to: ["100 50%", "900 50%"]
2458
+ }
2459
+ },
2460
+ hovered: {
2461
+ bg: ["50", "900"],
2462
+ fg: ["800", "200"],
2463
+ icon: ["800 70%", "300 70%"]
2464
+ },
2465
+ pressed: {
2466
+ bg: ["100", "800"],
2467
+ fg: ["800", "200"],
2468
+ icon: ["800 70%", "200 70%"]
2469
+ },
2470
+ selected: {
2471
+ bg: ["100", "900"],
2472
+ fg: ["800", "200"],
2473
+ icon: ["800 60%", "200 60%"]
2474
+ },
2475
+ disabled: {
2476
+ _hue: "gray",
2477
+ accent: {
2478
+ fg: ["200", "800"]
2479
+ },
2480
+ avatar: {
2481
+ "*": {
2482
+ _blend: ["screen", "multiply"],
2483
+ bg: ["gray/100", "gray/900"],
2484
+ fg: ["white", "black"]
2485
+ }
2486
+ },
2487
+ badge: {
2488
+ "*": {
2489
+ _hue: "gray",
2490
+ bg: ["50", "950"],
2491
+ fg: ["gray/200", "gray/800"],
2492
+ dot: ["gray/200", "gray/800"],
2493
+ icon: ["gray/200", "gray/800"]
2494
+ }
2495
+ },
2496
+ code: {
2497
+ bg: ["50", "950"],
2498
+ fg: ["200", "800"]
2499
+ },
2500
+ fg: ["400", "600"],
2501
+ icon: ["300", "700"],
2502
+ muted: {
2503
+ fg: ["400", "600"]
2504
+ },
2505
+ kbd: {
2506
+ bg: ["white", "black"],
2507
+ fg: ["200", "800"],
2508
+ border: ["100", "900"]
2509
+ },
2510
+ link: {
2511
+ fg: ["200", "800"]
2512
+ }
2513
+ }
2514
+ }
2515
+ }
2516
+ },
2517
+ input: {
2518
+ "*": {
2519
+ "*": {
2520
+ _blend: ["multiply", "screen"],
2521
+ bg: ["white", "black"],
2522
+ border: ["200", "700"],
2523
+ fg: ["black", "200"],
2524
+ muted: {
2525
+ bg: ["50", "950"]
2526
+ },
2527
+ placeholder: ["400", "600"]
2528
+ },
2529
+ hovered: {
2530
+ border: ["300", "700"]
2531
+ },
2532
+ readOnly: {
2533
+ bg: ["50", "950"],
2534
+ border: ["200", "800"],
2535
+ fg: ["800", "200"]
2536
+ },
2537
+ disabled: {
2538
+ bg: ["50", "950"],
2539
+ fg: ["400", "600"],
2540
+ border: ["100", "900"],
2541
+ placeholder: ["200", "800 50%"]
2542
+ }
2543
+ },
2544
+ invalid: {
2545
+ "*": {
2546
+ _hue: "red",
2547
+ bg: ["100", "950"]
2548
+ }
2549
+ }
2550
+ },
2551
+ selectable: {
2552
+ "*": {
2553
+ "*": {
2554
+ _blend: ["multiply", "screen"],
2555
+ accent: {
2556
+ fg: ["purple/700 70%", "purple/300 70%"]
2557
+ },
2558
+ avatar: {
2559
+ "*": {
2560
+ _blend: ["screen", "multiply"],
2561
+ bg: ["500", "400"],
2562
+ fg: ["white", "black"]
2563
+ }
2564
+ },
2565
+ badge: {
2566
+ "*": {
2567
+ bg: ["100", "900"],
2568
+ fg: ["600", "400"],
2569
+ dot: ["500", "500"],
2570
+ icon: ["500", "500"]
2571
+ }
2572
+ },
2573
+ bg: ["white", "black"],
2574
+ border: ["200", "800"],
2575
+ code: {
2576
+ bg: ["50", "950"],
2577
+ fg: ["600", "400"]
2578
+ },
2579
+ fg: ["700", "300"],
2580
+ icon: ["700 75%", "300 75%"],
2581
+ kbd: {
2582
+ bg: ["white", "black"],
2583
+ fg: ["600", "400"],
2584
+ border: ["200", "800"]
2585
+ },
2586
+ link: {
2587
+ fg: ["blue/700 70%", "blue/300 70%"]
2588
+ },
2589
+ muted: {
2590
+ bg: ["50", "950"],
2591
+ fg: ["700 75%", "300 75%"]
2592
+ },
2593
+ skeleton: {
2594
+ from: ["100", "900"],
2595
+ to: ["100 50%", "900 50%"]
2596
+ }
2597
+ },
2598
+ hovered: {
2599
+ bg: ["50", "950"]
2600
+ },
2601
+ pressed: {
2602
+ bg: ["100", "900"]
2603
+ },
2604
+ selected: {
2605
+ _blend: ["screen", "multiply"],
2606
+ accent: {
2607
+ fg: ["purple/300", "purple/700"]
2608
+ },
2609
+ avatar: {
2610
+ "*": {
2611
+ _blend: ["multiply", "screen"],
2612
+ bg: ["white", "black"],
2613
+ fg: ["black", "white"]
2614
+ }
2615
+ },
2616
+ badge: {
2617
+ "*": {
2618
+ bg: ["900", "100"],
2619
+ fg: ["400", "600"],
2620
+ dot: ["500", "500"],
2621
+ icon: ["500", "500"]
2622
+ }
2623
+ },
2624
+ bg: ["500", "400"],
2625
+ border: ["500 20%", "400 20%"],
2626
+ code: {
2627
+ bg: ["500 20%", "400 20%"],
2628
+ fg: ["200", "600"]
2629
+ },
2630
+ fg: ["white", "black"],
2631
+ icon: ["100 70%", "900 70%"],
2632
+ kbd: {
2633
+ bg: ["black", "white"],
2634
+ fg: ["200", "600"],
2635
+ border: ["800", "200"]
2636
+ },
2637
+ link: {
2638
+ fg: ["blue/200", "blue/600"]
2639
+ },
2640
+ muted: {
2641
+ bg: ["500 10%", "400 10%"],
2642
+ fg: ["100 70%", "900 70%"]
2643
+ },
2644
+ skeleton: {
2645
+ from: ["900", "100"],
2646
+ to: ["900 50%", "100 50%"]
2647
+ }
2648
+ },
2649
+ disabled: {
2650
+ _hue: "gray",
2651
+ accent: {
2652
+ fg: ["200", "800"]
2653
+ },
2654
+ avatar: {
2655
+ "*": {
2656
+ _blend: ["screen", "multiply"],
2657
+ bg: ["gray/100", "gray/900"],
2658
+ fg: ["white", "black"]
2659
+ }
2660
+ },
2661
+ badge: {
2662
+ "*": {
2663
+ _hue: "gray",
2664
+ bg: ["50", "950"],
2665
+ fg: ["gray/200", "gray/800"],
2666
+ dot: ["gray/200", "gray/800"],
2667
+ icon: ["gray/200", "gray/800"]
2668
+ }
2669
+ },
2670
+ border: ["100", "900"],
2671
+ code: {
2672
+ bg: ["50", "950"],
2673
+ fg: ["200", "800"]
2674
+ },
2675
+ fg: ["200", "800"],
2676
+ icon: ["200", "800"],
2677
+ kbd: {
2678
+ bg: ["white", "black"],
2679
+ fg: ["200", "800"],
2680
+ border: ["100", "900"]
2681
+ },
2682
+ link: {
2683
+ fg: ["200", "800"]
2684
+ },
2685
+ muted: {
2686
+ bg: ["50 50%", "950 50%"],
2687
+ fg: ["200", "800"]
2688
+ }
2689
+ }
2690
+ },
2691
+ default: {
2692
+ selected: {
2693
+ _hue: "blue"
2694
+ }
2695
+ },
2696
+ critical: {
2697
+ disabled: {
2698
+ bg: ["50 50%", "950 50%"]
2699
+ }
2700
+ }
2701
+ },
2702
+ syntax: {
2703
+ atrule: ["purple/600", "purple/400"],
2704
+ attrName: ["green/600", "green/400"],
2705
+ attrValue: ["yellow/600", "yellow/400"],
2706
+ attribute: ["yellow/600", "yellow/400"],
2707
+ boolean: ["purple/600", "purple/400"],
2708
+ builtin: ["purple/600", "purple/400"],
2709
+ cdata: ["yellow/600", "yellow/400"],
2710
+ char: ["yellow/600", "yellow/400"],
2711
+ class: ["orange/600", "orange/400"],
2712
+ className: ["cyan/600", "cyan/400"],
2713
+ comment: ["gray/400", "gray/600"],
2714
+ constant: ["purple/600", "purple/400"],
2715
+ deleted: ["red/600", "red/400"],
2716
+ entity: ["red/600", "red/400"],
2717
+ function: ["green/600", "green/400"],
2718
+ hexcode: ["blue/600", "blue/400"],
2719
+ id: ["purple/600", "purple/400"],
2720
+ important: ["purple/600", "purple/400"],
2721
+ inserted: ["yellow/600", "yellow/400"],
2722
+ keyword: ["magenta/600", "magenta/400"],
2723
+ number: ["purple/600", "purple/400"],
2724
+ operator: ["magenta/600", "magenta/400"],
2725
+ property: ["blue/600", "blue/400"],
2726
+ pseudoClass: ["yellow/600", "yellow/400"],
2727
+ pseudoElement: ["yellow/600", "yellow/400"],
2728
+ punctuation: ["gray/600", "gray/400"],
2729
+ regex: ["blue/600", "blue/400"],
2730
+ selector: ["red/600", "red/400"],
2731
+ string: ["yellow/600", "yellow/400"],
2732
+ symbol: ["purple/600", "purple/400"],
2733
+ tag: ["red/600", "red/400"],
2734
+ unit: ["orange/600", "orange/400"],
2735
+ url: ["red/600", "red/400"],
2736
+ variable: ["red/600", "red/400"]
2737
+ }
2738
+ };
2739
+ function isRecord$1(value) {
2740
+ return !!(value && typeof value == "object" && !Array.isArray(value));
2741
+ }
2742
+ function merge$1(...records) {
2743
+ const _records = records.filter(Boolean);
2744
+ return _records.length === 0 ? {} : _records.reduce(_merge$1, {});
2745
+ }
2746
+ function _merge$1(acc, source) {
2747
+ for (const key of Object.keys(source)) {
2748
+ const prevValue = acc[key], nextValue = source[key];
2749
+ isRecord$1(prevValue) && isRecord$1(nextValue) ? acc[key] = merge$1(prevValue, nextValue) : acc[key] = nextValue;
2750
+ }
2751
+ return acc;
2752
+ }
2753
+ function resolveColorTokens(inputTokens) {
2754
+ const tokens = merge$1(defaultColorTokens, inputTokens);
2755
+ return {
2756
+ base: resolveBaseColorTokens(tokens),
2757
+ button: resolveButtonColorTokens(tokens),
2758
+ input: resolveInputColorTokens(tokens),
2759
+ selectable: resolveSelectableColorTokens(tokens),
2760
+ syntax: tokens.syntax
2761
+ };
2762
+ }
2763
+ function resolveBaseColorTokens(sparseTokens) {
2764
+ const tokens = {};
2765
+ for (const tone of THEME_COLOR_CARD_TONES)
2766
+ tokens[tone] = resolveBaseColorTones(sparseTokens, tone);
2767
+ return tokens;
2768
+ }
2769
+ function resolveBaseColorTones(inputTokens, tone) {
2770
+ const spec = merge$1(inputTokens?.base?.["*"], inputTokens?.base?.[tone]), hue = spec._hue || inputTokens?.base?.[tone]?._hue || "gray";
2771
+ return {
2772
+ ...spec,
2773
+ _hue: hue,
2774
+ avatar: color.COLOR_HUES.reduce((acc, hue2) => ({
2775
+ ...acc,
2776
+ [hue2]: merge$1({
2777
+ _hue: hue2
2778
+ }, spec.avatar?.["*"], spec.avatar?.[hue2])
2779
+ }), {}),
2780
+ badge: THEME_COLOR_STATE_TONES.reduce((acc, tone2) => ({
2781
+ ...acc,
2782
+ [tone2]: {
2783
+ _hue: inputTokens?.base?.[tone2]?._hue || hue,
2784
+ ...spec.badge?.["*"],
2785
+ ...spec.badge?.[tone2]
2786
+ }
2787
+ }), {})
2788
+ };
2789
+ }
2790
+ function resolveButtonColorTokens(inputTokens) {
2791
+ const tokens = {};
2792
+ for (const mode of THEME_COLOR_BUTTON_MODES)
2793
+ tokens[mode] = resolveButtonToneColorTokens(inputTokens, mode);
2794
+ return tokens;
2795
+ }
2796
+ function resolveButtonToneColorTokens(inputTokens, mode) {
2797
+ const tokens = {};
2798
+ for (const tone of THEME_COLOR_STATE_TONES)
2799
+ tokens[tone] = resolveButtonModeColorTokens(inputTokens, mode, tone);
2800
+ return tokens;
2801
+ }
2802
+ function resolveButtonModeColorTokens(inputTokens, mode, tone) {
2803
+ const tokens = {};
2804
+ for (const state of THEME_COLOR_STATES)
2805
+ tokens[state] = resolveButtonStateColorTokens(inputTokens, tone, mode, state);
2806
+ return tokens;
2807
+ }
2808
+ function resolveButtonStateColorTokens(inputTokens, tone, mode, state) {
2809
+ const spec = merge$1(inputTokens?.button?.[mode]?.["*"]?.["*"], inputTokens?.button?.[mode]?.[tone]?.["*"], inputTokens?.button?.[mode]?.["*"]?.[state], inputTokens?.button?.[mode]?.[tone]?.[state]), hue = spec._hue || inputTokens?.base?.[tone]?._hue;
2810
+ return {
2811
+ ...spec,
2812
+ _hue: hue,
2813
+ avatar: color.COLOR_HUES.reduce((acc, hue2) => ({
2814
+ ...acc,
2815
+ [hue2]: merge$1({
2816
+ _hue: hue2
2817
+ }, spec.avatar?.["*"], spec.avatar?.[hue2])
2818
+ }), {}),
2819
+ badge: THEME_COLOR_STATE_TONES.reduce((acc, tone2) => ({
2820
+ ...acc,
2821
+ [tone2]: {
2822
+ _hue: inputTokens?.base?.[tone2]?._hue || hue,
2823
+ ...spec.badge?.["*"],
2824
+ ...spec.badge?.[tone2]
2825
+ }
2826
+ }), {})
2827
+ };
2828
+ }
2829
+ function resolveInputColorTokens(inputTokens) {
2830
+ const tokens = {};
2831
+ for (const mode of THEME_COLOR_INPUT_MODES)
2832
+ tokens[mode] = resolveInputModeColorTokens(inputTokens, mode);
2833
+ return tokens;
2834
+ }
2835
+ function resolveInputModeColorTokens(inputTokens, mode) {
2836
+ const states = {};
2837
+ for (const state of THEME_COLOR_INPUT_STATES)
2838
+ states[state] = resolveInputStateColorTokens(inputTokens, mode, state);
2839
+ return states;
2840
+ }
2841
+ function resolveInputStateColorTokens(inputTokens, mode, state) {
2842
+ const spec = merge$1(inputTokens?.input?.["*"]?.["*"], inputTokens?.input?.[mode]?.["*"], inputTokens?.input?.["*"]?.[state], inputTokens?.input?.[mode]?.[state]), hue = spec._hue || inputTokens?.input?.[mode]?._hue;
2843
+ return {
2844
+ ...spec,
2845
+ _hue: hue
2846
+ };
2847
+ }
2848
+ function resolveSelectableColorTokens(inputTokens) {
2849
+ const tokens = {};
2850
+ for (const tone of THEME_COLOR_STATE_TONES)
2851
+ tokens[tone] = resolveSelectableToneColorTokens(inputTokens, tone);
2852
+ return tokens;
2853
+ }
2854
+ function resolveSelectableToneColorTokens(inputTokens, tone) {
2855
+ const states = {
2856
+ _hue: inputTokens?.selectable?.[tone]?._hue || inputTokens?.base?.[tone]?._hue
2857
+ };
2858
+ for (const state of THEME_COLOR_STATES)
2859
+ states[state] = resolveSelectableStateColorTokens(inputTokens, tone, state);
2860
+ return states;
2861
+ }
2862
+ function resolveSelectableStateColorTokens(inputTokens, tone, state) {
2863
+ const spec = merge$1(inputTokens?.selectable?.["*"]?.["*"], inputTokens?.selectable?.[tone]?.["*"], inputTokens?.selectable?.["*"]?.[state], inputTokens?.selectable?.[tone]?.[state]), hue = spec._hue || inputTokens?.base?.[tone]?._hue;
2864
+ return {
2865
+ ...spec,
2866
+ _hue: hue,
2867
+ avatar: color.COLOR_HUES.reduce((acc, hue2) => ({
2868
+ ...acc,
2869
+ [hue2]: merge$1({
2870
+ _hue: hue2
2871
+ }, spec.avatar?.["*"], spec.avatar?.[hue2])
2872
+ }), {}),
2873
+ badge: THEME_COLOR_STATE_TONES.reduce((acc, tone2) => ({
2874
+ ...acc,
2875
+ [tone2]: {
2876
+ _hue: inputTokens?.base?.[tone2]?._hue || hue,
2877
+ ...spec.badge?.["*"],
2878
+ ...spec.badge?.[tone2]
2879
+ }
2880
+ }), {})
2881
+ };
2882
+ }
2883
+ function buildColorTheme(config) {
2884
+ const resolvedConfig = {
2885
+ color: resolveColorTokens(config?.color)
2886
+ };
2887
+ return {
2888
+ light: buildColorScheme({
2889
+ scheme: "light"
2890
+ }, resolvedConfig),
2891
+ dark: buildColorScheme({
2892
+ scheme: "dark"
2893
+ }, resolvedConfig)
2894
+ };
2895
+ }
2896
+ function buildColorScheme(options, config) {
2897
+ const {
2898
+ scheme
2899
+ } = options, colorScheme = {};
2900
+ for (const tone of THEME_COLOR_CARD_TONES)
2901
+ colorScheme[tone] = buildCardColorTheme({
2902
+ scheme,
2903
+ tone
2904
+ }, config);
2905
+ return colorScheme;
2906
+ }
2907
+ function buildCardColorTheme(options, config) {
2908
+ const {
2909
+ scheme,
2910
+ tone
2911
+ } = options, tokens = config?.color?.base?.[tone], context = {
2912
+ hue: tokens?._hue || "gray",
2913
+ scheme
2914
+ };
2915
+ return {
2916
+ _blend: (tokens?._blend || ["multiply", "screen"])[scheme === "light" ? 0 : 1],
2917
+ _dark: scheme === "dark",
2918
+ accent: {
2919
+ fg: resolveColorTokenValue(context, tokens?.accent?.fg)
2920
+ },
2921
+ avatar: buildAvatarColorTheme({
2922
+ scheme
2923
+ }, tokens),
2924
+ backdrop: resolveColorTokenValue(context, tokens?.backdrop),
2925
+ badge: buildBadgeColorTheme(tokens?.badge, {
2926
+ scheme
2927
+ }, config),
2928
+ bg: resolveColorTokenValue(context, tokens?.bg),
2929
+ border: resolveColorTokenValue(context, tokens?.border),
2930
+ button: buildButtonColorTheme({
2931
+ scheme,
2932
+ tone
2933
+ }, config),
2934
+ code: {
2935
+ bg: resolveColorTokenValue(context, tokens?.code?.bg),
2936
+ fg: resolveColorTokenValue(context, tokens?.code?.fg)
2937
+ },
2938
+ fg: resolveColorTokenValue(context, tokens?.fg),
2939
+ focusRing: resolveColorTokenValue(context, tokens?.focusRing),
2940
+ icon: resolveColorTokenValue(context, tokens?.icon),
2941
+ input: buildInputColorTheme({
2942
+ scheme,
2943
+ tone
2944
+ }, config),
2945
+ kbd: {
2946
+ bg: resolveColorTokenValue(context, tokens?.kbd?.bg),
2947
+ fg: resolveColorTokenValue(context, tokens?.kbd?.fg),
2948
+ border: resolveColorTokenValue(context, tokens?.kbd?.border)
2949
+ },
2950
+ link: {
2951
+ fg: resolveColorTokenValue(context, tokens?.link?.fg)
2952
+ },
2953
+ muted: {
2954
+ bg: resolveColorTokenValue(context, tokens?.muted?.bg),
2955
+ fg: resolveColorTokenValue(context, tokens?.muted?.fg)
2956
+ },
2957
+ selectable: buildSelectableColorTheme({
2958
+ scheme,
2959
+ tone
2960
+ }, config),
2961
+ shadow: buildShadowColorTheme({
2962
+ scheme,
2963
+ tone
2964
+ }, config),
2965
+ skeleton: {
2966
+ from: resolveColorTokenValue(context, tokens?.skeleton?.from),
2967
+ to: resolveColorTokenValue(context, tokens?.skeleton?.to)
2968
+ },
2969
+ syntax: buildSyntaxColorTheme({
2970
+ scheme
2971
+ }, config)
2972
+ };
2973
+ }
2974
+ function buildShadowColorTheme(options, config) {
2975
+ const {
2976
+ scheme,
2977
+ tone
2978
+ } = options, tokens = config?.color?.base?.[tone], context = {
2979
+ hue: tokens?._hue || "gray",
2980
+ scheme
2981
+ };
2982
+ return {
2983
+ outline: resolveColorTokenValue(context, tokens?.shadow?.outline),
2984
+ umbra: resolveColorTokenValue(context, tokens?.shadow?.umbra),
2985
+ penumbra: resolveColorTokenValue(context, tokens?.shadow?.penumbra),
2986
+ ambient: resolveColorTokenValue(context, tokens?.shadow?.ambient)
2987
+ };
2988
+ }
2989
+ function buildAvatarColorTheme(options, stateTokens) {
2990
+ const {
2991
+ scheme
2992
+ } = options;
2993
+ return {
2994
+ gray: _buildAvatarColorTheme({
2995
+ color: "gray",
2996
+ scheme
2997
+ }, stateTokens),
2998
+ blue: _buildAvatarColorTheme({
2999
+ color: "blue",
3000
+ scheme
3001
+ }, stateTokens),
3002
+ purple: _buildAvatarColorTheme({
3003
+ color: "purple",
3004
+ scheme
3005
+ }, stateTokens),
3006
+ magenta: _buildAvatarColorTheme({
3007
+ color: "magenta",
3008
+ scheme
3009
+ }, stateTokens),
3010
+ red: _buildAvatarColorTheme({
3011
+ color: "red",
3012
+ scheme
3013
+ }, stateTokens),
3014
+ orange: _buildAvatarColorTheme({
3015
+ color: "orange",
3016
+ scheme
3017
+ }, stateTokens),
3018
+ yellow: _buildAvatarColorTheme({
3019
+ color: "yellow",
3020
+ scheme
3021
+ }, stateTokens),
3022
+ green: _buildAvatarColorTheme({
3023
+ color: "green",
3024
+ scheme
3025
+ }, stateTokens),
3026
+ cyan: _buildAvatarColorTheme({
3027
+ color: "cyan",
3028
+ scheme
3029
+ }, stateTokens)
3030
+ };
3031
+ }
3032
+ function _buildAvatarColorTheme(options, stateTokens) {
3033
+ const {
3034
+ color: color2,
3035
+ scheme
3036
+ } = options, tokens = stateTokens?.avatar?.[color2], context = {
3037
+ hue: tokens?._hue || "gray",
3038
+ scheme
3039
+ };
3040
+ return {
3041
+ _blend: (tokens?._blend || ["screen", "multiply"])[scheme === "light" ? 0 : 1],
3042
+ bg: resolveColorTokenValue(context, tokens?.bg),
3043
+ fg: resolveColorTokenValue(context, tokens?.fg)
3044
+ };
3045
+ }
3046
+ function buildBadgeColorTheme(tokens, options, config) {
3047
+ const {
3048
+ scheme
3049
+ } = options, colorBadge = {};
3050
+ for (const tone of THEME_COLOR_STATE_TONES)
3051
+ colorBadge[tone] = _buildBadgeColorTheme(tokens, {
3052
+ scheme,
3053
+ tone
3054
+ }, config);
3055
+ return colorBadge;
3056
+ }
3057
+ function _buildBadgeColorTheme(parentTokens, options, config) {
3058
+ const {
3059
+ scheme,
3060
+ tone
3061
+ } = options, tokens = parentTokens?.[tone], context = {
3062
+ hue: tokens?._hue || config?.color?.base?.[tone]?._hue || "gray",
3063
+ scheme
3064
+ };
3065
+ return {
3066
+ bg: resolveColorTokenValue(context, tokens?.bg),
3067
+ fg: resolveColorTokenValue(context, tokens?.fg),
3068
+ dot: resolveColorTokenValue(context, tokens?.dot),
3069
+ icon: resolveColorTokenValue(context, tokens?.icon)
3070
+ };
3071
+ }
3072
+ function buildButtonColorTheme(options, config) {
3073
+ const {
3074
+ scheme,
3075
+ tone: cardTone
3076
+ } = options, modes = {};
3077
+ for (const mode of THEME_COLOR_BUTTON_MODES)
3078
+ modes[mode] = buildButtonTonesColorTheme({
3079
+ cardTone,
3080
+ scheme,
3081
+ mode
3082
+ }, config);
3083
+ return modes;
3084
+ }
3085
+ function buildButtonTonesColorTheme(options, config) {
3086
+ const {
3087
+ cardTone,
3088
+ mode,
3089
+ scheme
3090
+ } = options, tones2 = {};
3091
+ for (const tone of THEME_COLOR_STATE_TONES)
3092
+ tones2[tone] = buildButtonStatesColorTheme({
3093
+ cardTone,
3094
+ mode,
3095
+ scheme,
3096
+ tone
3097
+ }, config);
3098
+ return tones2;
3099
+ }
3100
+ function buildButtonStatesColorTheme(options, config) {
3101
+ const {
3102
+ cardTone,
3103
+ mode,
3104
+ scheme,
3105
+ tone
3106
+ } = options, states = {};
3107
+ for (const state of THEME_COLOR_STATES)
3108
+ states[state] = buildButtonStateColorTheme({
3109
+ cardTone,
3110
+ mode,
3111
+ tone,
3112
+ scheme,
3113
+ state
3114
+ }, config);
3115
+ return states;
3116
+ }
3117
+ function buildButtonStateColorTheme(options, config) {
3118
+ const {
3119
+ cardTone,
3120
+ mode,
3121
+ tone,
3122
+ scheme,
3123
+ state
3124
+ } = options, cardTokens = config?.color?.base?.[cardTone], tokens = config?.color?.button?.[mode]?.[tone]?.[state], hue = tokens?._hue || cardTokens?._hue || "gray", blendMode = tokens?._blend || ["screen", "multiply"], context = {
3125
+ hue,
3126
+ scheme
3127
+ };
3128
+ return {
3129
+ _blend: blendMode[scheme === "light" ? 0 : 1],
3130
+ accent: {
3131
+ fg: resolveColorTokenValue(context, tokens?.accent?.fg)
3132
+ },
3133
+ avatar: buildAvatarColorTheme({
3134
+ scheme
3135
+ }, tokens),
3136
+ badge: buildBadgeColorTheme(tokens?.badge, {
3137
+ scheme
3138
+ }, config),
3139
+ bg: resolveColorTokenValue(context, tokens?.bg),
3140
+ border: resolveColorTokenValue(context, tokens?.border),
3141
+ code: {
3142
+ bg: resolveColorTokenValue(context, tokens?.code?.bg),
3143
+ fg: resolveColorTokenValue(context, tokens?.code?.fg)
3144
+ },
3145
+ fg: resolveColorTokenValue(context, tokens?.fg),
3146
+ icon: resolveColorTokenValue(context, tokens?.icon),
3147
+ muted: {
3148
+ bg: resolveColorTokenValue(context, tokens?.muted?.bg),
3149
+ fg: resolveColorTokenValue(context, tokens?.muted?.fg)
3150
+ },
3151
+ kbd: {
3152
+ bg: resolveColorTokenValue(context, tokens?.kbd?.bg),
3153
+ fg: resolveColorTokenValue(context, tokens?.kbd?.fg),
3154
+ border: resolveColorTokenValue(context, tokens?.kbd?.border)
3155
+ },
3156
+ link: {
3157
+ fg: resolveColorTokenValue(context, tokens?.link?.fg)
3158
+ },
3159
+ skeleton: {
3160
+ from: resolveColorTokenValue(context, tokens?.skeleton?.from),
3161
+ to: resolveColorTokenValue(context, tokens?.skeleton?.to)
3162
+ }
3163
+ };
3164
+ }
3165
+ function buildInputColorTheme(options, config) {
3166
+ const {
3167
+ scheme,
3168
+ tone
3169
+ } = options;
3170
+ return {
3171
+ default: buildInputStatesColorTheme({
3172
+ mode: "default",
3173
+ scheme,
3174
+ tone
3175
+ }, config),
3176
+ invalid: buildInputStatesColorTheme({
3177
+ mode: "invalid",
3178
+ scheme,
3179
+ tone
3180
+ }, config)
3181
+ };
3182
+ }
3183
+ function buildInputStatesColorTheme(options, config) {
3184
+ const {
3185
+ mode,
3186
+ scheme,
3187
+ tone
3188
+ } = options;
3189
+ return {
3190
+ enabled: buildInputStateColorTheme({
3191
+ mode,
3192
+ scheme,
3193
+ state: "enabled",
3194
+ cardTone: tone
3195
+ }, config),
3196
+ hovered: buildInputStateColorTheme({
3197
+ mode,
3198
+ scheme,
3199
+ state: "hovered",
3200
+ cardTone: tone
3201
+ }, config),
3202
+ readOnly: buildInputStateColorTheme({
3203
+ mode,
3204
+ scheme,
3205
+ state: "readOnly",
3206
+ cardTone: tone
3207
+ }, config),
3208
+ disabled: buildInputStateColorTheme({
3209
+ mode,
3210
+ scheme,
3211
+ state: "disabled",
3212
+ cardTone: tone
3213
+ }, config)
3214
+ };
3215
+ }
3216
+ function buildInputStateColorTheme(options, config) {
3217
+ const {
3218
+ cardTone,
3219
+ mode,
3220
+ scheme,
3221
+ state
3222
+ } = options, cardTokens = config?.color?.base?.[cardTone], tokens = config?.color?.input?.[mode]?.[state], hue = tokens?._hue || cardTokens?._hue || "gray", blendMode = tokens?._blend || ["screen", "multiply"], context = {
3223
+ hue,
3224
+ scheme
3225
+ };
3226
+ return {
3227
+ _blend: blendMode[scheme === "light" ? 0 : 1],
3228
+ bg: resolveColorTokenValue(context, tokens?.bg),
3229
+ border: resolveColorTokenValue(context, tokens?.border),
3230
+ fg: resolveColorTokenValue(context, tokens?.fg),
3231
+ muted: {
3232
+ bg: resolveColorTokenValue(context, tokens?.muted?.bg)
3233
+ },
3234
+ placeholder: resolveColorTokenValue(context, tokens?.placeholder)
3235
+ };
3236
+ }
3237
+ function buildSelectableColorTheme(options, config) {
3238
+ const {
3239
+ scheme,
3240
+ tone: cardTone
3241
+ } = options, tones2 = {};
3242
+ for (const tone of THEME_COLOR_STATE_TONES)
3243
+ tones2[tone] = buildSelectableStatesColorTheme({
3244
+ cardTone,
3245
+ scheme,
3246
+ tone
3247
+ }, config);
3248
+ return tones2;
3249
+ }
3250
+ function buildSelectableStatesColorTheme(options, config) {
3251
+ const {
3252
+ cardTone,
3253
+ scheme,
3254
+ tone
3255
+ } = options, states = {};
3256
+ for (const state of THEME_COLOR_STATES)
3257
+ states[state] = buildSelectableStateColorTheme({
3258
+ cardTone,
3259
+ tone,
3260
+ scheme,
3261
+ state
3262
+ }, config);
3263
+ return states;
3264
+ }
3265
+ function buildSelectableStateColorTheme(options, config) {
3266
+ const {
3267
+ cardTone,
3268
+ scheme,
3269
+ state,
3270
+ tone
3271
+ } = options, cardTokens = config?.color?.base?.[cardTone], tokens = config?.color?.selectable?.[tone]?.[state], hue = tokens?._hue || cardTokens?._hue || "gray", blendMode = tokens?._blend || ["screen", "multiply"], context = {
3272
+ hue,
3273
+ scheme
3274
+ };
3275
+ return {
3276
+ _blend: blendMode[scheme === "light" ? 0 : 1],
3277
+ accent: {
3278
+ fg: resolveColorTokenValue(context, tokens?.accent?.fg)
3279
+ },
3280
+ avatar: buildAvatarColorTheme({
3281
+ scheme
3282
+ }, tokens),
3283
+ badge: buildBadgeColorTheme(tokens?.badge, {
3284
+ scheme
3285
+ }, config),
3286
+ bg: resolveColorTokenValue(context, tokens?.bg),
3287
+ border: resolveColorTokenValue(context, tokens?.border),
3288
+ code: {
3289
+ bg: resolveColorTokenValue(context, tokens?.code?.bg),
3290
+ fg: resolveColorTokenValue(context, tokens?.code?.fg)
3291
+ },
3292
+ fg: resolveColorTokenValue(context, tokens?.fg),
3293
+ icon: resolveColorTokenValue(context, tokens?.icon),
3294
+ muted: {
3295
+ bg: resolveColorTokenValue(context, tokens?.muted?.bg),
3296
+ fg: resolveColorTokenValue(context, tokens?.muted?.fg)
3297
+ },
3298
+ kbd: {
3299
+ bg: resolveColorTokenValue(context, tokens?.kbd?.bg),
3300
+ fg: resolveColorTokenValue(context, tokens?.kbd?.fg),
3301
+ border: resolveColorTokenValue(context, tokens?.kbd?.border)
3302
+ },
3303
+ link: {
3304
+ fg: resolveColorTokenValue(context, tokens?.link?.fg)
3305
+ },
3306
+ skeleton: {
3307
+ from: resolveColorTokenValue(context, tokens?.skeleton?.from),
3308
+ to: resolveColorTokenValue(context, tokens?.skeleton?.to)
3309
+ }
3310
+ };
3311
+ }
3312
+ function buildSyntaxColorTheme(options, config) {
3313
+ const {
3314
+ scheme
3315
+ } = options, tokens = config?.color?.syntax, context = {
3316
+ hue: "gray",
3317
+ scheme
3318
+ };
3319
+ return {
3320
+ atrule: resolveColorTokenValue(context, tokens?.atrule),
3321
+ attrName: resolveColorTokenValue(context, tokens?.attrName),
3322
+ attrValue: resolveColorTokenValue(context, tokens?.attrValue),
3323
+ attribute: resolveColorTokenValue(context, tokens?.attribute),
3324
+ boolean: resolveColorTokenValue(context, tokens?.boolean),
3325
+ builtin: resolveColorTokenValue(context, tokens?.builtin),
3326
+ cdata: resolveColorTokenValue(context, tokens?.cdata),
3327
+ char: resolveColorTokenValue(context, tokens?.char),
3328
+ class: resolveColorTokenValue(context, tokens?.class),
3329
+ className: resolveColorTokenValue(context, tokens?.className),
3330
+ comment: resolveColorTokenValue(context, tokens?.comment),
3331
+ constant: resolveColorTokenValue(context, tokens?.constant),
3332
+ deleted: resolveColorTokenValue(context, tokens?.deleted),
3333
+ doctype: resolveColorTokenValue(context, tokens?.doctype),
3334
+ entity: resolveColorTokenValue(context, tokens?.entity),
3335
+ function: resolveColorTokenValue(context, tokens?.function),
3336
+ hexcode: resolveColorTokenValue(context, tokens?.hexcode),
3337
+ id: resolveColorTokenValue(context, tokens?.id),
3338
+ important: resolveColorTokenValue(context, tokens?.important),
3339
+ inserted: resolveColorTokenValue(context, tokens?.inserted),
3340
+ keyword: resolveColorTokenValue(context, tokens?.keyword),
3341
+ number: resolveColorTokenValue(context, tokens?.number),
3342
+ operator: resolveColorTokenValue(context, tokens?.operator),
3343
+ prolog: resolveColorTokenValue(context, tokens?.prolog),
3344
+ property: resolveColorTokenValue(context, tokens?.property),
3345
+ pseudoClass: resolveColorTokenValue(context, tokens?.pseudoClass),
3346
+ pseudoElement: resolveColorTokenValue(context, tokens?.pseudoElement),
3347
+ punctuation: resolveColorTokenValue(context, tokens?.punctuation),
3348
+ regex: resolveColorTokenValue(context, tokens?.regex),
3349
+ selector: resolveColorTokenValue(context, tokens?.selector),
3350
+ string: resolveColorTokenValue(context, tokens?.string),
3351
+ symbol: resolveColorTokenValue(context, tokens?.symbol),
3352
+ tag: resolveColorTokenValue(context, tokens?.tag),
3353
+ unit: resolveColorTokenValue(context, tokens?.unit),
3354
+ url: resolveColorTokenValue(context, tokens?.url),
3355
+ variable: resolveColorTokenValue(context, tokens?.variable)
3356
+ };
3357
+ }
3358
+ const defaultColorPalette = color.color;
3359
+ function mixChannel(b, s, weight) {
3360
+ const delta = (s - b) * weight;
3361
+ return b + delta;
3362
+ }
3363
+ function mix(b, s, weight) {
3364
+ return {
3365
+ r: mixChannel(b.r, s.r, weight),
3366
+ g: mixChannel(b.g, s.g, weight),
3367
+ b: mixChannel(b.b, s.b, weight)
3368
+ };
3369
+ }
3370
+ function multiplyChannel(b, s) {
3371
+ return b * s;
3372
+ }
3373
+ function multiply(b, s) {
3374
+ return {
3375
+ r: multiplyChannel(b.r / 255, s.r / 255) * 255,
3376
+ g: multiplyChannel(b.g / 255, s.g / 255) * 255,
3377
+ b: multiplyChannel(b.b / 255, s.b / 255) * 255
3378
+ };
3379
+ }
3380
+ function screenChannel(b, s) {
3381
+ return b + s - b * s;
3382
+ }
3383
+ function screen(b, s) {
3384
+ return {
3385
+ r: screenChannel(b.r / 255, s.r / 255) * 255,
3386
+ g: screenChannel(b.g / 255, s.g / 255) * 255,
3387
+ b: screenChannel(b.b / 255, s.b / 255) * 255
3388
+ };
3389
+ }
3390
+ function lerp(x, y, a) {
3391
+ return x * (1 - a) + y * a;
3392
+ }
3393
+ function invlerp(x, y, a) {
3394
+ return clamp((a - x) / (y - x));
3395
+ }
3396
+ function clamp(a, min = 0, max = 1) {
3397
+ return Math.min(max, Math.max(min, a));
3398
+ }
3399
+ function range(x1, y1, x2, y2, a) {
3400
+ return lerp(x2, y2, invlerp(x1, y1, a));
3401
+ }
3402
+ function round(value) {
3403
+ return Math.round(value);
3404
+ }
3405
+ function hexToRgb(hex) {
3406
+ if (hex.length === 4) {
3407
+ const hexR = hex.slice(1, 2), hexG = hex.slice(2, 3), hexB = hex.slice(3, 4);
3408
+ return {
3409
+ r: parseInt(hexR + hexR, 16),
3410
+ g: parseInt(hexG + hexG, 16),
3411
+ b: parseInt(hexB + hexB, 16)
3412
+ };
3413
+ }
3414
+ return {
3415
+ r: parseInt(hex.slice(1, 3), 16),
3416
+ g: parseInt(hex.slice(3, 5), 16),
3417
+ b: parseInt(hex.slice(5, 7), 16)
3418
+ };
3419
+ }
3420
+ function rgbaToRGBA(rgba2) {
3421
+ const values = rgba2.replace(/rgba\(|\)/g, "").split(",");
3422
+ return {
3423
+ r: parseInt(values[0]),
3424
+ g: parseInt(values[1]),
3425
+ b: parseInt(values[2]),
3426
+ a: parseFloat(values[3])
3427
+ };
3428
+ }
3429
+ function rgbToHex(color2) {
3430
+ const r = round(clamp(Math.round(color2.r), 0, 255)), g = round(clamp(Math.round(color2.g), 0, 255)), b = round(clamp(Math.round(color2.b), 0, 255));
3431
+ return "a" in color2 ? `rgba(${r},${g},${b},${color2.a})` : "#" + ((1 << 24) + (r << 16) + (g << 8) + b).toString(16).slice(1);
3432
+ }
3433
+ function rgbToHsl({
3434
+ r,
3435
+ g,
3436
+ b
3437
+ }) {
3438
+ r /= 255, g /= 255, b /= 255;
3439
+ const cmin = Math.min(r, g, b), cmax = Math.max(r, g, b), delta = cmax - cmin;
3440
+ let h = 0, s = 0, l = 0;
3441
+ return delta == 0 ? h = 0 : cmax == r ? h = (g - b) / delta % 6 : cmax == g ? h = (b - r) / delta + 2 : h = (r - g) / delta + 4, h = Math.round(h * 60), h < 0 && (h += 360), l = (cmax + cmin) / 2, s = delta == 0 ? 0 : delta / (1 - Math.abs(2 * l - 1)), s = +(s * 100).toFixed(1), l = +(l * 100).toFixed(1), {
3442
+ h,
3443
+ s,
3444
+ l
3445
+ };
3446
+ }
3447
+ function hslToRgb(hsl) {
3448
+ const s = hsl.s / 100, l = hsl.l / 100, c = (1 - Math.abs(2 * l - 1)) * s, x = c * (1 - Math.abs(hsl.h / 60 % 2 - 1)), m = l - c / 2;
3449
+ let r = 0, g = 0, b = 0;
3450
+ return 0 <= hsl.h && hsl.h < 60 ? (r = c, g = x, b = 0) : 60 <= hsl.h && hsl.h < 120 ? (r = x, g = c, b = 0) : 120 <= hsl.h && hsl.h < 180 ? (r = 0, g = c, b = x) : 180 <= hsl.h && hsl.h < 240 ? (r = 0, g = x, b = c) : 240 <= hsl.h && hsl.h < 300 ? (r = x, g = 0, b = c) : 300 <= hsl.h && hsl.h < 360 && (r = c, g = 0, b = x), {
3451
+ r: Math.round((r + m) * 255),
3452
+ g: Math.round((g + m) * 255),
3453
+ b: Math.round((b + m) * 255)
3454
+ };
3455
+ }
3456
+ const HEX_CHARS = "0123456789ABCDEFabcdef", HSL_RE = /hsl\(\s*(\d+)\s*,\s*((\d+(?:\.\d+)?)%)\s*,\s*((\d+(?:\.\d+)?)%)\s*\)/i;
3457
+ function isHexChars(str) {
3458
+ for (const c of str)
3459
+ if (HEX_CHARS.indexOf(c) === -1)
3460
+ return !1;
3461
+ return !0;
3462
+ }
3463
+ function isHex(str) {
3464
+ return str[0] !== "#" || !(str.length === 4 || str.length === 7) ? !1 : isHexChars(str.slice(1));
3465
+ }
3466
+ function parseHsl(str) {
3467
+ const res = HSL_RE.exec(str);
3468
+ if (!res)
3469
+ throw new Error(`parseHsl: string is not a HSL color: "${str}"`);
3470
+ return {
3471
+ h: parseInt(res[1]),
3472
+ s: parseFloat(res[3]),
3473
+ l: parseFloat(res[5])
3474
+ };
3475
+ }
3476
+ function parseColor(color2) {
3477
+ if (!color2) return {
3478
+ r: 0,
3479
+ g: 0,
3480
+ b: 0
3481
+ };
3482
+ if (typeof color2 != "string")
3483
+ throw new Error("parseColor: expected a string");
3484
+ if (isHex(color2))
3485
+ return hexToRgb(color2);
3486
+ if (color2.startsWith("hsl("))
3487
+ return hslToRgb(parseHsl(color2));
3488
+ if (color2.startsWith("rgba("))
3489
+ return rgbaToRGBA(color2);
3490
+ throw new Error(`parseColor: unexpected color format: "${color2}"`);
3491
+ }
3492
+ function getContrastRatio(bg, fg) {
3493
+ const rgb1 = parseColor(bg), rgb2 = parseColor(fg), c1 = rgb_lrgb(rgb1), c2 = rgb_lrgb(rgb2), l1 = lrgb_luminance(c1), l2 = lrgb_luminance(c2);
3494
+ return (Math.max(l1, l2) + 0.05) / (Math.min(l1, l2) + 0.05);
3495
+ }
3496
+ function rgb_lrgb({
3497
+ r,
3498
+ g,
3499
+ b
3500
+ }) {
3501
+ return [rgb_lrgb1(r / 255), rgb_lrgb1(g / 255), rgb_lrgb1(b / 255)];
3502
+ }
3503
+ function rgb_lrgb1(v) {
3504
+ return v <= 0.04045 ? v / 12.92 : ((v + 0.055) / 1.055) ** 2.4;
3505
+ }
3506
+ function lrgb_luminance([r, g, b]) {
3507
+ return 0.2126 * r + 0.7152 * g + 0.0722 * b;
3508
+ }
3509
+ function rgba(color2, a) {
3510
+ if (typeof color2 == "string" && color2.startsWith("var("))
3511
+ return `color-mix(in srgb, transparent, ${color2} ${a * 100}%)`;
3512
+ const rgb = parseColor(color2);
3513
+ return `rgba(${rgb.r},${rgb.g},${rgb.b},${a})`;
3514
+ }
3515
+ const RGB_RANGE = [0, 255];
3516
+ function mixThemeColor(value, options) {
3517
+ const {
3518
+ blendMode
3519
+ } = options, color2 = parseColor(value), black2 = parseColor(options.black), white2 = parseColor(options.white), bg = options.bg ? parseColor(options.bg) : blendMode === "multiply" ? white2 : black2, paletteRange = {
3520
+ r: [black2.r, white2.r],
3521
+ g: [black2.g, white2.g],
3522
+ b: [black2.b, white2.b]
3523
+ }, convertedBgColor = {
3524
+ r: clamp(range(...paletteRange.r, ...RGB_RANGE, bg.r), ...RGB_RANGE),
3525
+ g: clamp(range(...paletteRange.g, ...RGB_RANGE, bg.g), ...RGB_RANGE),
3526
+ b: clamp(range(...paletteRange.b, ...RGB_RANGE, bg.b), ...RGB_RANGE)
3527
+ }, convertedColor = {
3528
+ r: clamp(range(...paletteRange.r, ...RGB_RANGE, color2.r), ...RGB_RANGE),
3529
+ g: clamp(range(...paletteRange.g, ...RGB_RANGE, color2.g), ...RGB_RANGE),
3530
+ b: clamp(range(...paletteRange.b, ...RGB_RANGE, color2.b), ...RGB_RANGE)
3531
+ }, resultColor = blendMode === "multiply" ? multiply(convertedBgColor, convertedColor) : screen(convertedBgColor, convertedColor), v = {
3532
+ r: clamp(range(...RGB_RANGE, ...paletteRange.r, resultColor.r), ...paletteRange.r),
3533
+ g: clamp(range(...RGB_RANGE, ...paletteRange.g, resultColor.g), ...paletteRange.g),
3534
+ b: clamp(range(...RGB_RANGE, ...paletteRange.b, resultColor.b), ...paletteRange.b)
3535
+ };
3536
+ return rgbToHex(v);
3537
+ }
3538
+ function renderColorValue(str, options) {
3539
+ const {
3540
+ bg,
3541
+ blendMode,
3542
+ colorPalette
3543
+ } = options;
3544
+ if (bg === "white")
3545
+ throw new Error("Cannot blend with white background");
3546
+ const node = parseTokenValue(str);
3547
+ if (!node || node.type !== "color")
3548
+ throw new Error(`Invalid color token value: ${str}`);
3549
+ let hex = "";
3550
+ if (node.key === "black" && (hex = renderColorHex(colorPalette.black)), node.key === "white" && (hex = renderColorHex(colorPalette.white)), node.hue && node.tint && (hex = renderColorHex(colorPalette[node.hue][node.tint])), !hex)
3551
+ throw new Error(`Invalid color token value: ${str}`);
3552
+ const hexBeforeMix = hex, mixOptions = {
3553
+ blendMode,
3554
+ bg,
3555
+ black: renderColorHex(colorPalette.black),
3556
+ // opacity: node.opacity,
3557
+ white: renderColorHex(colorPalette.white)
3558
+ };
3559
+ try {
3560
+ if (hex = mixThemeColor(hex, mixOptions), bg && node.mix !== void 0) {
3561
+ const from = hexToRgb(bg), to = hexToRgb(hex);
3562
+ hex = rgbToHex(mix(from, to, node.mix));
3563
+ }
3564
+ } catch (err) {
3565
+ throw console.warn("could not blend", hex, mixOptions), err;
3566
+ }
3567
+ return hex === "#aN" && (console.warn(`invalid color token value: ${str}`), hex = hexBeforeMix), node.opacity !== void 0 && (hex = rgba(hex, node.opacity)), hex;
3568
+ }
3569
+ function renderColorHex(color2) {
3570
+ return typeof color2 == "string" ? color2 : color2.hex;
3571
+ }
3572
+ function renderThemeColorSchemes(value, config) {
3573
+ const colorPalette = config?.palette ?? defaultColorPalette;
3574
+ return {
3575
+ light: renderThemeColorScheme(colorPalette, value.light),
3576
+ dark: renderThemeColorScheme(colorPalette, value.dark)
3577
+ };
3578
+ }
3579
+ function renderThemeColorScheme(colorPalette, value) {
3580
+ const toneEntries = Object.entries(value), [, transparentTone] = toneEntries.find(([k]) => k === "transparent"), [, defaultTone] = toneEntries.find(([k]) => k === "default"), renderedTransparentTone = renderThemeColor(transparentTone, {
3581
+ colorPalette
3582
+ }), renderedDefaultTone = renderThemeColor(defaultTone, {
3583
+ colorPalette
3584
+ }), bg = renderedDefaultTone.bg;
3585
+ if (bg === "white")
3586
+ throw new Error("Cannot blend with white background");
3587
+ return Object.fromEntries([["transparent", renderedTransparentTone], ["default", renderedDefaultTone], ...toneEntries.filter(([k]) => k !== "default" && k !== "transparent").map(([k, v]) => [k, renderThemeColor(v, {
3588
+ bg,
3589
+ colorPalette
3590
+ })])]);
3591
+ }
3592
+ function renderThemeColor(value, options) {
3593
+ const {
3594
+ colorPalette,
3595
+ bg
3596
+ } = options, blendMode = value._blend || "multiply", baseBg = renderColorValue(value.bg, {
3597
+ colorPalette,
3598
+ bg,
3599
+ blendMode
3600
+ }), colorOptions = {
3601
+ colorPalette,
3602
+ bg: baseBg,
3603
+ blendMode
3604
+ }, button = renderThemeColorButton(value.button, {
3605
+ baseBg,
3606
+ blendMode,
3607
+ colorPalette
3608
+ }), selectable = renderThemeColorSelectable(value.selectable, {
3609
+ colorPalette,
3610
+ baseBg,
3611
+ blendMode
3612
+ }), shadow = {
3613
+ outline: renderColorValue(value.shadow.outline, colorOptions),
3614
+ umbra: renderColorValue(value.shadow.umbra, {
3615
+ ...colorOptions,
3616
+ bg: void 0,
3617
+ colorPalette: {
3618
+ ...colorPalette,
3619
+ black: "#000000"
3620
+ }
3621
+ }),
3622
+ penumbra: renderColorValue(value.shadow.penumbra, {
3623
+ ...colorOptions,
3624
+ bg: void 0,
3625
+ colorPalette: {
3626
+ ...colorPalette,
3627
+ black: "#000000"
3628
+ }
3629
+ }),
3630
+ ambient: renderColorValue(value.shadow.ambient, {
3631
+ ...colorOptions,
3632
+ bg: void 0,
3633
+ colorPalette: {
3634
+ ...colorPalette,
3635
+ black: "#000000"
3636
+ }
3637
+ })
3638
+ };
3639
+ return {
3640
+ _blend: blendMode,
3641
+ _dark: value._dark,
3642
+ accent: {
3643
+ fg: renderColorValue(value.accent.fg, colorOptions)
3644
+ },
3645
+ avatar: renderThemeColorAvatar(value.avatar, {
3646
+ baseBg,
3647
+ colorPalette,
3648
+ blendMode
3649
+ }),
3650
+ backdrop: renderColorValue(value.backdrop, colorOptions),
3651
+ badge: renderThemeColorBadge(value.badge, {
3652
+ baseBg,
3653
+ colorPalette,
3654
+ blendMode
3655
+ }),
3656
+ bg: baseBg,
3657
+ border: renderColorValue(value.border, colorOptions),
3658
+ button,
3659
+ code: {
3660
+ bg: renderColorValue(value.code.bg, colorOptions),
3661
+ fg: renderColorValue(value.code.fg, colorOptions)
3662
+ },
3663
+ fg: renderColorValue(value.fg, colorOptions),
3664
+ focusRing: renderColorValue(value.focusRing, colorOptions),
3665
+ icon: renderColorValue(value.icon, colorOptions),
3666
+ input: renderThemeColorInput(value.input, {
3667
+ baseBg,
3668
+ colorPalette,
3669
+ blendMode
3670
+ }),
3671
+ kbd: renderThemeColorKBD(value.kbd, {
3672
+ baseBg,
3673
+ colorPalette,
3674
+ blendMode
3675
+ }),
3676
+ link: {
3677
+ fg: renderColorValue(value.link.fg, colorOptions)
3678
+ },
3679
+ muted: {
3680
+ bg: renderColorValue(value.muted.bg, colorOptions),
3681
+ fg: renderColorValue(value.muted.fg, colorOptions)
3682
+ },
3683
+ shadow,
3684
+ skeleton: {
3685
+ from: renderColorValue(value.skeleton.from, colorOptions),
3686
+ to: renderColorValue(value.skeleton.to, colorOptions)
3687
+ },
3688
+ syntax: renderSyntaxColorTheme(value.syntax, {
3689
+ baseBg,
3690
+ colorPalette,
3691
+ blendMode
3692
+ }),
3693
+ selectable
3694
+ };
3695
+ }
3696
+ function renderThemeColorKBD(value, options) {
3697
+ const {
3698
+ baseBg,
3699
+ blendMode,
3700
+ colorPalette
3701
+ } = options, rootOptions = {
3702
+ bg: baseBg,
3703
+ blendMode,
3704
+ colorPalette
3705
+ }, bg = renderColorValue(value.bg, rootOptions), colorOptions = {
3706
+ bg,
3707
+ blendMode,
3708
+ colorPalette
3709
+ };
3710
+ return {
3711
+ bg,
3712
+ fg: renderColorValue(value.fg, colorOptions),
3713
+ border: renderColorValue(value.border, colorOptions)
3714
+ };
3715
+ }
3716
+ function renderThemeColorAvatar(value, options) {
3717
+ const colorAvatar = {};
3718
+ for (const hue of color.COLOR_HUES)
3719
+ colorAvatar[hue] = renderThemeColorAvatarColor(value[hue], options);
3720
+ return colorAvatar;
3721
+ }
3722
+ function renderThemeColorAvatarColor(value, options) {
3723
+ const {
3724
+ baseBg,
3725
+ blendMode: rootBlendMode,
3726
+ colorPalette
3727
+ } = options, blendMode = value._blend || "multiply", rootOptions = {
3728
+ bg: baseBg,
3729
+ blendMode: rootBlendMode,
3730
+ colorPalette
3731
+ }, bg = renderColorValue(value.bg, rootOptions), colorOptions = {
3732
+ bg,
3733
+ blendMode,
3734
+ colorPalette
3735
+ };
3736
+ return {
3737
+ _blend: blendMode,
3738
+ bg,
3739
+ fg: renderColorValue(value.fg, colorOptions)
3740
+ };
3741
+ }
3742
+ function renderThemeColorBadge(value, options) {
3743
+ const colorBadge = {};
3744
+ for (const tone of THEME_COLOR_STATE_TONES)
3745
+ colorBadge[tone] = renderThemeColorBadgeColor(value[tone], options);
3746
+ return colorBadge;
3747
+ }
3748
+ function renderThemeColorBadgeColor(value, options) {
3749
+ const {
3750
+ baseBg,
3751
+ blendMode: rootBlendMode,
3752
+ colorPalette
3753
+ } = options, blendMode = rootBlendMode, rootOptions = {
3754
+ bg: baseBg,
3755
+ blendMode: rootBlendMode,
3756
+ colorPalette
3757
+ }, bg = renderColorValue(value.bg, rootOptions), colorOptions = {
3758
+ bg,
3759
+ blendMode,
3760
+ colorPalette
3761
+ };
3762
+ return {
3763
+ bg,
3764
+ dot: renderColorValue(value.dot, colorOptions),
3765
+ fg: renderColorValue(value.fg, colorOptions),
3766
+ icon: renderColorValue(value.icon, colorOptions)
3767
+ };
3768
+ }
3769
+ function renderThemeColorButton(value, options) {
3770
+ return {
3771
+ default: renderThemeColorButtonTones(value.default, options),
3772
+ ghost: renderThemeColorButtonTones(value.ghost, options),
3773
+ bleed: renderThemeColorButtonTones(value.bleed, options)
3774
+ };
3775
+ }
3776
+ function renderThemeColorButtonTones(value, options) {
3777
+ const colorButtonMode = {};
3778
+ for (const tone of THEME_COLOR_STATE_TONES)
3779
+ colorButtonMode[tone] = renderThemeColorButtonStates(value[tone], options);
3780
+ return colorButtonMode;
3781
+ }
3782
+ function renderThemeColorButtonStates(value, options) {
3783
+ return {
3784
+ enabled: renderThemeColorState(value.enabled, options),
3785
+ hovered: renderThemeColorState(value.hovered, options),
3786
+ pressed: renderThemeColorState(value.pressed, options),
3787
+ selected: renderThemeColorState(value.selected, options),
3788
+ disabled: renderThemeColorState(value.disabled, options)
3789
+ };
3790
+ }
3791
+ function renderThemeColorState(value, options) {
3792
+ const {
3793
+ baseBg,
3794
+ blendMode: rootBlendMode,
3795
+ colorPalette
3796
+ } = options, blendMode = value._blend || "multiply", rootOptions = {
3797
+ bg: baseBg,
3798
+ blendMode: rootBlendMode,
3799
+ colorPalette
3800
+ }, bg = renderColorValue(value.bg, rootOptions), colorOptions = {
3801
+ bg,
3802
+ blendMode,
3803
+ colorPalette
3804
+ };
3805
+ return {
3806
+ _blend: blendMode,
3807
+ accent: {
3808
+ fg: renderColorValue(value.accent.fg, colorOptions)
3809
+ },
3810
+ avatar: renderThemeColorAvatar(value.avatar, {
3811
+ baseBg: bg,
3812
+ colorPalette,
3813
+ blendMode
3814
+ }),
3815
+ badge: renderThemeColorBadge(value.badge, {
3816
+ baseBg: bg,
3817
+ colorPalette,
3818
+ blendMode
3819
+ }),
3820
+ bg,
3821
+ border: renderColorValue(value.border, colorOptions),
3822
+ code: {
3823
+ bg: renderColorValue(value.code.bg, colorOptions),
3824
+ fg: renderColorValue(value.code.fg, colorOptions)
3825
+ },
3826
+ fg: renderColorValue(value.fg, colorOptions),
3827
+ icon: renderColorValue(value.icon, colorOptions),
3828
+ link: {
3829
+ fg: renderColorValue(value.link.fg, colorOptions)
3830
+ },
3831
+ muted: {
3832
+ bg: renderColorValue(value.muted.bg, colorOptions),
3833
+ fg: renderColorValue(value.muted.fg, colorOptions)
3834
+ },
3835
+ kbd: {
3836
+ bg: renderColorValue(value.kbd.bg, colorOptions),
3837
+ fg: renderColorValue(value.kbd.fg, colorOptions),
3838
+ border: renderColorValue(value.kbd.border, colorOptions)
3839
+ },
3840
+ skeleton: {
3841
+ from: renderColorValue(value.skeleton?.from, colorOptions),
3842
+ to: renderColorValue(value.skeleton?.to, colorOptions)
3843
+ }
3844
+ };
3845
+ }
3846
+ function renderThemeColorInput(value, options) {
3847
+ return {
3848
+ default: renderInputStatesColorTheme(value.default, options),
3849
+ invalid: renderInputStatesColorTheme(value.invalid, options)
3850
+ };
3851
+ }
3852
+ function renderInputStatesColorTheme(value, options) {
3853
+ return {
3854
+ enabled: renderInputStateColorTheme(value.enabled, options),
3855
+ hovered: renderInputStateColorTheme(value.hovered, options),
3856
+ readOnly: renderInputStateColorTheme(value.readOnly, options),
3857
+ disabled: renderInputStateColorTheme(value.disabled, options)
3858
+ };
3859
+ }
3860
+ function renderInputStateColorTheme(value, options) {
3861
+ const {
3862
+ baseBg,
3863
+ blendMode: rootBlendMode,
3864
+ colorPalette
3865
+ } = options, blendMode = value._blend || "multiply", rootOptions = {
3866
+ colorPalette,
3867
+ bg: baseBg,
3868
+ blendMode: rootBlendMode
3869
+ }, bg = renderColorValue(value.bg, rootOptions), colorOptions = {
3870
+ colorPalette,
3871
+ bg,
3872
+ blendMode
3873
+ };
3874
+ return {
3875
+ _blend: blendMode,
3876
+ bg,
3877
+ border: renderColorValue(value.border, colorOptions),
3878
+ fg: renderColorValue(value.fg, colorOptions),
3879
+ muted: {
3880
+ bg: renderColorValue(value.muted.bg, colorOptions)
3881
+ },
3882
+ placeholder: renderColorValue(value.placeholder, colorOptions)
3883
+ };
3884
+ }
3885
+ function renderThemeColorSelectable(value, options) {
3886
+ const colorSelectable = {};
3887
+ for (const tone of THEME_COLOR_STATE_TONES)
3888
+ colorSelectable[tone] = renderThemeColorSelectableStates(value[tone], options);
3889
+ return colorSelectable;
3890
+ }
3891
+ function renderThemeColorSelectableStates(value, options) {
3892
+ return {
3893
+ enabled: renderThemeColorState(value.enabled, options),
3894
+ hovered: renderThemeColorState(value.hovered, options),
3895
+ pressed: renderThemeColorState(value.pressed, options),
3896
+ selected: renderThemeColorState(value.selected, options),
3897
+ disabled: renderThemeColorState(value.disabled, options)
3898
+ };
3899
+ }
3900
+ function renderSyntaxColorTheme(value, options) {
3901
+ const {
3902
+ colorPalette,
3903
+ baseBg,
3904
+ blendMode
3905
+ } = options, colorOptions = {
3906
+ colorPalette,
3907
+ bg: baseBg,
3908
+ blendMode
3909
+ };
3910
+ return {
3911
+ atrule: renderColorValue(value.atrule, colorOptions),
3912
+ attrName: renderColorValue(value.attrName, colorOptions),
3913
+ attrValue: renderColorValue(value.attrValue, colorOptions),
3914
+ attribute: renderColorValue(value.attribute, colorOptions),
3915
+ boolean: renderColorValue(value.boolean, colorOptions),
3916
+ builtin: renderColorValue(value.builtin, colorOptions),
3917
+ cdata: renderColorValue(value.cdata, colorOptions),
3918
+ char: renderColorValue(value.char, colorOptions),
3919
+ class: renderColorValue(value.class, colorOptions),
3920
+ className: renderColorValue(value.className, colorOptions),
3921
+ comment: renderColorValue(value.comment, colorOptions),
3922
+ constant: renderColorValue(value.constant, colorOptions),
3923
+ deleted: renderColorValue(value.deleted, colorOptions),
3924
+ doctype: renderColorValue(value.doctype, colorOptions),
3925
+ entity: renderColorValue(value.entity, colorOptions),
3926
+ function: renderColorValue(value.function, colorOptions),
3927
+ hexcode: renderColorValue(value.hexcode, colorOptions),
3928
+ id: renderColorValue(value.id, colorOptions),
3929
+ important: renderColorValue(value.important, colorOptions),
3930
+ inserted: renderColorValue(value.inserted, colorOptions),
3931
+ keyword: renderColorValue(value.keyword, colorOptions),
3932
+ number: renderColorValue(value.number, colorOptions),
3933
+ operator: renderColorValue(value.operator, colorOptions),
3934
+ prolog: renderColorValue(value.prolog, colorOptions),
3935
+ property: renderColorValue(value.property, colorOptions),
3936
+ pseudoClass: renderColorValue(value.pseudoClass, colorOptions),
3937
+ pseudoElement: renderColorValue(value.pseudoElement, colorOptions),
3938
+ punctuation: renderColorValue(value.punctuation, colorOptions),
3939
+ regex: renderColorValue(value.regex, colorOptions),
3940
+ selector: renderColorValue(value.selector, colorOptions),
3941
+ string: renderColorValue(value.string, colorOptions),
3942
+ symbol: renderColorValue(value.symbol, colorOptions),
3943
+ tag: renderColorValue(value.tag, colorOptions),
3944
+ unit: renderColorValue(value.unit, colorOptions),
3945
+ url: renderColorValue(value.url, colorOptions),
3946
+ variable: renderColorValue(value.variable, colorOptions)
3947
+ };
3948
+ }
3949
+ function buildTheme(config) {
3950
+ const colorTheme = buildColorTheme(config), v2 = {
3951
+ _version: 2,
3952
+ avatar: config?.avatar ?? defaultThemeConfig.avatar,
3953
+ button: config?.button ?? defaultThemeConfig.button,
3954
+ card: config?.card ?? defaultThemeConfig.card,
3955
+ // How colors are generated:
3956
+ // 1. Merge custom tokens with default tokens
3957
+ // 2. Generate tree of color keys (gray/500, black, white, etc.)
3958
+ // 3. Apply mixing and render to hex values
3959
+ // render(build(mergeWithDefaults()))
3960
+ color: renderThemeColorSchemes(colorTheme, config),
3961
+ container: config?.container ?? defaultThemeConfig.container,
3962
+ font: config?.font ?? defaultThemeFonts$1,
3963
+ input: config?.input ?? defaultThemeConfig.input,
3964
+ layer: config?.layer ?? defaultThemeConfig.layer,
3965
+ media: config?.media ?? defaultThemeConfig.media,
3966
+ radius: config?.radius ?? defaultThemeConfig.radius,
3967
+ shadow: config?.shadow ?? defaultThemeConfig.shadow,
3968
+ space: config?.space ?? defaultThemeConfig.space,
3969
+ style: config?.style ?? defaultThemeConfig.style
3970
+ };
3971
+ return v2_v0(v2);
3972
+ }
3973
+ const AVATAR_SIZE = [0, 1, 2, 3], CONTAINER_SCALE = [0, 1, 2, 3, 4, 5], CONTAINER = [...CONTAINER_SCALE, "auto"], RADIUS = [0, 1, 2, 3, 4, 5, 6], SPACE = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], FONT_CODE_SIZE = [0, 1, 2, 3, 4], FONT_HEADING_SIZE = [0, 1, 2, 3, 4, 5], FONT_LABEL_SIZE = [0, 1, 2, 3, 4, 5], FONT_TEXT_SIZE = [0, 1, 2, 3, 4], SHADOW = [0, 1, 2, 3, 4, 5], HUES = ["gray", "blue", "purple", "magenta", "red", "orange", "yellow", "green", "cyan"], TINTS = [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950], RE_PERCENTAGE = /^([0-9]+)%/, RE_OPACITY = /^(1|0\.[0-9]+)?/;
3974
+ function _parseColorToken(str, options) {
3975
+ const {
3976
+ defaultHue
3977
+ } = options;
3978
+ let cursor = 0;
3979
+ return parseColorNode();
3980
+ function _consume(s) {
3981
+ if (str.startsWith(s, cursor))
3982
+ return cursor += s.length, s;
3983
+ }
3984
+ function _peek() {
3985
+ return str[cursor];
3986
+ }
3987
+ function parseColorNode() {
3988
+ ignoreWhitespace();
3989
+ let v = _consume("black") || _consume("white");
3990
+ if (v)
3991
+ return {
3992
+ type: "color",
3993
+ name: v,
3994
+ opacity: parseOpacity() ?? 1,
3995
+ mix: parseMix() ?? 1
3996
+ };
3997
+ for (const hue of HUES)
3998
+ if (v = _consume(String(hue)), v) {
3999
+ if (_peek() !== "-")
4000
+ throw new Error('Expected "-" after hue key');
4001
+ cursor += 1;
4002
+ const tint2 = parseTint();
4003
+ if (!tint2)
4004
+ throw new Error("Expected tint after hue");
4005
+ return {
4006
+ type: "tint",
4007
+ hue,
4008
+ tint: tint2,
4009
+ opacity: parseOpacity() ?? 1,
4010
+ mix: parseMix() ?? 1
4011
+ };
4012
+ }
4013
+ const tint = parseTint();
4014
+ if (tint)
4015
+ return {
4016
+ type: "tint",
4017
+ hue: defaultHue,
4018
+ tint,
4019
+ opacity: parseOpacity() ?? 1,
4020
+ mix: parseMix() ?? 1
4021
+ };
4022
+ if (str === "inherit")
4023
+ return {
4024
+ type: "inherit"
4025
+ };
4026
+ throw new Error(`Invalid color: ${str}`);
4027
+ }
4028
+ function parseTint() {
4029
+ ignoreWhitespace();
4030
+ let v = Number(str.slice(cursor, cursor + 3));
4031
+ if (TINTS.includes(v))
4032
+ return cursor += 3, v;
4033
+ if (v = Number(str.slice(cursor, cursor + 2)), TINTS.includes(v))
4034
+ return cursor += 2, v;
4035
+ }
4036
+ function parseMix() {
4037
+ ignoreWhitespace();
4038
+ const match = RE_PERCENTAGE.exec(str.slice(cursor));
4039
+ if (match)
4040
+ return cursor += match[0].length, parseFloat(match[1]) / 100;
4041
+ }
4042
+ function parseOpacity() {
4043
+ if (ignoreWhitespace(), _peek() === "/") {
4044
+ cursor += 1;
4045
+ const match = RE_OPACITY.exec(str.slice(cursor));
4046
+ if (match)
4047
+ return cursor += match[0].length, parseFloat(match[1]);
4048
+ cursor -= 1;
4049
+ }
4050
+ }
4051
+ function ignoreWhitespace() {
4052
+ for (; _peek() === " "; )
4053
+ cursor++;
4054
+ }
4055
+ }
4056
+ const defaultThemeFonts = {
4057
+ code: {
4058
+ family: "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
4059
+ weight: {
4060
+ regular: 400,
4061
+ medium: 500,
4062
+ semibold: 600,
4063
+ bold: 700
4064
+ },
4065
+ scale: [{
4066
+ ascenderHeight: 4,
4067
+ descenderHeight: 4,
4068
+ fontSize: 10,
4069
+ iconSize: 17,
4070
+ lineHeight: 15,
4071
+ letterSpacing: 0,
4072
+ customIconSize: 12
4073
+ }, {
4074
+ ascenderHeight: 5,
4075
+ descenderHeight: 5,
4076
+ fontSize: 13,
4077
+ iconSize: 21,
4078
+ lineHeight: 19,
4079
+ letterSpacing: 0,
4080
+ customIconSize: 16
4081
+ }, {
4082
+ ascenderHeight: 6,
4083
+ descenderHeight: 6,
4084
+ fontSize: 16,
4085
+ iconSize: 25,
4086
+ lineHeight: 23,
4087
+ letterSpacing: 0,
4088
+ customIconSize: 20
4089
+ }, {
4090
+ ascenderHeight: 7,
4091
+ descenderHeight: 7,
4092
+ fontSize: 18.75,
4093
+ iconSize: 29,
4094
+ lineHeight: 27,
4095
+ letterSpacing: 0,
4096
+ customIconSize: 24
4097
+ }, {
4098
+ ascenderHeight: 8,
4099
+ descenderHeight: 8,
4100
+ fontSize: 21.5,
4101
+ iconSize: 33,
4102
+ lineHeight: 31,
4103
+ letterSpacing: 0,
4104
+ customIconSize: 28
4105
+ }]
4106
+ },
4107
+ heading: {
4108
+ family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
4109
+ featureSettings: "'liga' 1, 'calt' 1, 'ss01' 1, 'ss03' 1, 'zero' 1",
4110
+ weight: {
4111
+ regular: 600,
4112
+ medium: 700,
4113
+ semibold: 800,
4114
+ bold: 900
4115
+ },
4116
+ scale: [{
4117
+ ascenderHeight: 5,
4118
+ descenderHeight: 5,
4119
+ fontSize: 13,
4120
+ iconSize: 17,
4121
+ lineHeight: 19,
4122
+ letterSpacing: 0,
4123
+ customIconSize: 12
4124
+ }, {
4125
+ ascenderHeight: 6,
4126
+ descenderHeight: 6,
4127
+ fontSize: 16,
4128
+ iconSize: 25,
4129
+ lineHeight: 23,
4130
+ letterSpacing: 0,
4131
+ customIconSize: 20
4132
+ }, {
4133
+ ascenderHeight: 7,
4134
+ descenderHeight: 7,
4135
+ fontSize: 21,
4136
+ iconSize: 33,
4137
+ lineHeight: 29,
4138
+ letterSpacing: -0.25,
4139
+ customIconSize: 28
4140
+ }, {
4141
+ ascenderHeight: 8,
4142
+ descenderHeight: 8,
4143
+ fontSize: 27,
4144
+ iconSize: 41,
4145
+ lineHeight: 35,
4146
+ letterSpacing: -0.5,
4147
+ customIconSize: 36
4148
+ }, {
4149
+ ascenderHeight: 9.5,
4150
+ descenderHeight: 8.5,
4151
+ fontSize: 33,
4152
+ iconSize: 49,
4153
+ lineHeight: 41,
4154
+ letterSpacing: -1,
4155
+ customIconSize: 44
4156
+ }, {
4157
+ ascenderHeight: 10.5,
4158
+ descenderHeight: 9.5,
4159
+ fontSize: 38,
4160
+ iconSize: 53,
4161
+ lineHeight: 47,
4162
+ letterSpacing: -1,
4163
+ customIconSize: 48
4164
+ }]
4165
+ },
4166
+ label: {
4167
+ family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", system-ui, sans-serif',
4168
+ weight: {
4169
+ regular: 500,
4170
+ medium: 600,
4171
+ semibold: 700,
4172
+ bold: 800
4173
+ },
4174
+ scale: [{
4175
+ ascenderHeight: 2,
4176
+ descenderHeight: 2,
4177
+ fontSize: 8.1,
4178
+ iconSize: 13,
4179
+ lineHeight: 10,
4180
+ letterSpacing: 0.5,
4181
+ customIconSize: 8
4182
+ }, {
4183
+ ascenderHeight: 1.5,
4184
+ descenderHeight: 2.5,
4185
+ fontSize: 9.5,
4186
+ iconSize: 15,
4187
+ lineHeight: 11,
4188
+ letterSpacing: 0.5,
4189
+ customIconSize: 10
4190
+ }, {
4191
+ ascenderHeight: 2,
4192
+ descenderHeight: 2,
4193
+ fontSize: 10.8,
4194
+ iconSize: 17,
4195
+ lineHeight: 12,
4196
+ letterSpacing: 0.5,
4197
+ customIconSize: 12
4198
+ }, {
4199
+ ascenderHeight: 2,
4200
+ descenderHeight: 2,
4201
+ fontSize: 12.25,
4202
+ iconSize: 19,
4203
+ lineHeight: 13,
4204
+ letterSpacing: 0.5,
4205
+ customIconSize: 14
4206
+ }, {
4207
+ ascenderHeight: 1.5,
4208
+ descenderHeight: 2.5,
4209
+ fontSize: 13.6,
4210
+ iconSize: 21,
4211
+ lineHeight: 14,
4212
+ letterSpacing: 0.5,
4213
+ customIconSize: 16
4214
+ }, {
4215
+ ascenderHeight: 2,
4216
+ descenderHeight: 2,
4217
+ fontSize: 15,
4218
+ iconSize: 23,
4219
+ lineHeight: 15,
4220
+ letterSpacing: 0.5,
4221
+ customIconSize: 18
4222
+ }]
4223
+ },
4224
+ text: {
4225
+ family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
4226
+ weight: {
4227
+ regular: 400,
4228
+ medium: 500,
4229
+ semibold: 600,
4230
+ bold: 700
4231
+ },
4232
+ scale: [{
4233
+ ascenderHeight: 4,
4234
+ descenderHeight: 4,
4235
+ fontSize: 9.75,
4236
+ iconSize: 17,
4237
+ lineHeight: 15,
4238
+ letterSpacing: 0,
4239
+ customIconSize: 12
4240
+ }, {
4241
+ ascenderHeight: 5,
4242
+ descenderHeight: 5,
4243
+ fontSize: 12.5,
4244
+ iconSize: 21,
4245
+ lineHeight: 19,
4246
+ letterSpacing: 0,
4247
+ customIconSize: 16
4248
+ }, {
4249
+ ascenderHeight: 6,
4250
+ descenderHeight: 6,
4251
+ fontSize: 15.25,
4252
+ iconSize: 25,
4253
+ lineHeight: 23,
4254
+ letterSpacing: 0,
4255
+ customIconSize: 20
4256
+ }, {
4257
+ ascenderHeight: 7,
4258
+ descenderHeight: 7,
4259
+ fontSize: 18,
4260
+ iconSize: 29,
4261
+ lineHeight: 27,
4262
+ letterSpacing: 0,
4263
+ customIconSize: 24
4264
+ }, {
4265
+ ascenderHeight: 8,
4266
+ descenderHeight: 8,
4267
+ fontSize: 20.75,
4268
+ iconSize: 33,
4269
+ lineHeight: 31,
4270
+ letterSpacing: 0,
4271
+ customIconSize: 28
4272
+ }]
4273
+ }
4274
+ }, defaultTokens = {
4275
+ color: {
4276
+ "*": {
4277
+ backdrop: ["gray-100/0.5", "black/0.5"],
4278
+ code: {
4279
+ bg: ["50", "950"],
4280
+ fg: ["700", "300"],
4281
+ token: {
4282
+ atrule: ["purple-600", "purple-400"],
4283
+ attrName: ["green-600", "green-400"],
4284
+ attrValue: ["yellow-600", "yellow-400"],
4285
+ attribute: ["yellow-600", "yellow-400"],
4286
+ boolean: ["purple-600", "purple-400"],
4287
+ builtin: ["purple-600", "purple-400"],
4288
+ cdata: ["yellow-600", "yellow-400"],
4289
+ char: ["yellow-600", "yellow-400"],
4290
+ class: ["orange-600", "orange-400"],
4291
+ className: ["cyan-600", "cyan-400"],
4292
+ comment: ["gray-400", "gray-600"],
4293
+ constant: ["purple-600", "purple-400"],
4294
+ deleted: ["red-600", "red-400"],
4295
+ entity: ["red-600", "red-400"],
4296
+ function: ["green-600", "green-400"],
4297
+ hexcode: ["blue-600", "blue-400"],
4298
+ id: ["purple-600", "purple-400"],
4299
+ important: ["purple-600", "purple-400"],
4300
+ inserted: ["green-600", "green-400"],
4301
+ keyword: ["magenta-600", "magenta-400"],
4302
+ number: ["purple-600", "purple-400"],
4303
+ operator: ["magenta-600", "magenta-400"],
4304
+ prolog: ["gray-600", "gray-400"],
4305
+ property: ["blue-600", "blue-400"],
4306
+ pseudoClass: ["yellow-600", "yellow-400"],
4307
+ pseudoElement: ["yellow-600", "yellow-400"],
4308
+ punctuation: ["gray-600", "gray-400"],
4309
+ regex: ["blue-600", "blue-400"],
4310
+ selector: ["red-600", "red-400"],
4311
+ string: ["yellow-600", "yellow-400"],
4312
+ symbol: ["purple-600", "purple-400"],
4313
+ tag: ["red-600", "red-400"],
4314
+ unit: ["orange-600", "orange-400"],
4315
+ url: ["red-600", "red-400"],
4316
+ variable: ["red-600", "red-400"]
4317
+ }
4318
+ },
4319
+ focusRing: ["blue-500", "blue-500"],
4320
+ link: {
4321
+ fg: ["blue-600", "blue-400"]
4322
+ },
4323
+ shadow: {
4324
+ outline: ["600/0.3", "500/0.4"],
4325
+ umbra: ["600/0.1", "black/0.2"],
4326
+ penumbra: ["600/0.07", "black/0.14"],
4327
+ ambient: ["600/0.06", "black/0.12"]
4328
+ },
4329
+ skeleton: {
4330
+ from: ["200 70%", "800 35%"],
4331
+ to: ["200 40%", "800 50%"]
4332
+ },
4333
+ variant: {
4334
+ tinted: {
4335
+ "*": {
4336
+ bg: {
4337
+ 0: ["100 75%", "900 75%"],
4338
+ 4: ["300", "700"]
4339
+ },
4340
+ border: {
4341
+ 0: ["200", "700 50%"],
4342
+ 4: ["300 75%", "500"]
4343
+ },
4344
+ fg: {
4345
+ 0: ["900", "100"],
4346
+ 4: ["700", "300"]
4347
+ }
4348
+ },
4349
+ primary: {
4350
+ _hue: "blue",
4351
+ bg: {
4352
+ 0: ["inherit", "inherit"]
4353
+ }
4354
+ },
4355
+ suggest: {
4356
+ _hue: "purple",
4357
+ bg: {
4358
+ 0: ["inherit", "inherit"]
4359
+ }
4360
+ },
4361
+ positive: {
4362
+ _hue: "green",
4363
+ bg: {
4364
+ 0: ["inherit", "inherit"]
4365
+ }
4366
+ },
4367
+ caution: {
4368
+ _hue: "yellow",
4369
+ bg: {
4370
+ 0: ["inherit", "inherit"]
4371
+ }
4372
+ },
4373
+ critical: {
4374
+ _hue: "red",
4375
+ bg: {
4376
+ 0: ["inherit", "inherit"]
4377
+ }
4378
+ }
4379
+ },
4380
+ solid: {
4381
+ "*": {
4382
+ bg: {
4383
+ 0: ["500", "400"],
4384
+ 4: ["600", "300"]
4385
+ },
4386
+ border: {
4387
+ 0: ["400", "200"],
4388
+ 4: ["500", "100"]
4389
+ },
4390
+ fg: {
4391
+ 0: ["white", "black"],
4392
+ 4: ["200", "700"]
4393
+ }
4394
+ },
4395
+ default: {
4396
+ bg: {
4397
+ 0: ["800", "200"],
4398
+ 4: ["black", "white"]
4399
+ },
4400
+ border: {
4401
+ 0: ["700", "300"],
4402
+ 4: ["800", "200"]
4403
+ }
4404
+ },
4405
+ primary: {
4406
+ _hue: "blue"
4407
+ },
4408
+ suggest: {
4409
+ _hue: "purple"
4410
+ },
4411
+ positive: {
4412
+ _hue: "green"
4413
+ },
4414
+ caution: {
4415
+ _hue: "yellow"
4416
+ },
4417
+ critical: {
4418
+ _hue: "red"
4419
+ }
4420
+ }
4421
+ }
4422
+ },
4423
+ transparent: {
4424
+ variant: {
4425
+ tinted: {
4426
+ "*": {
4427
+ bg: {
4428
+ 0: ["gray-50", "black"],
4429
+ 4: ["300 75%", "700 75%"]
4430
+ },
4431
+ border: {
4432
+ 0: ["200", "800 75%"],
4433
+ 4: ["400", "700"]
4434
+ },
4435
+ fg: {
4436
+ 0: ["black", "100"],
4437
+ 4: ["700", "400"]
4438
+ }
4439
+ }
4440
+ }
4441
+ }
4442
+ },
4443
+ default: {
4444
+ variant: {
4445
+ tinted: {
4446
+ "*": {
4447
+ bg: {
4448
+ 0: ["white", "950"],
4449
+ 4: ["300 75%", "700"]
4450
+ },
4451
+ border: {
4452
+ 0: ["200", "800 75%"],
4453
+ 4: ["400", "700"]
4454
+ },
4455
+ fg: {
4456
+ 0: ["black", "white"],
4457
+ 4: ["600", "400"]
4458
+ }
4459
+ }
4460
+ }
4461
+ }
4462
+ },
4463
+ primary: {
4464
+ _hue: "blue"
4465
+ },
4466
+ suggest: {
4467
+ _hue: "purple"
4468
+ },
4469
+ positive: {
4470
+ _hue: "green"
4471
+ },
4472
+ caution: {
4473
+ _hue: "yellow"
4474
+ },
4475
+ critical: {
4476
+ _hue: "red"
4477
+ }
4478
+ }
4479
+ };
4480
+ function merge(...records) {
4481
+ return records.filter(Boolean).reduce(_merge, {});
4482
+ }
4483
+ function _merge(acc, source) {
4484
+ for (const key of Object.keys(source)) {
4485
+ const prevValue = acc[key], nextValue = source[key];
4486
+ isRecord(prevValue) && isRecord(nextValue) ? acc[key] = merge(prevValue, nextValue) : acc[key] = nextValue;
4487
+ }
4488
+ return acc;
4489
+ }
4490
+ function isRecord(value) {
4491
+ return value !== null && typeof value == "object" && !Array.isArray(value);
4492
+ }
4493
+ const defaultElementTokens = {
4494
+ bg: {
4495
+ 0: ["950", "50"],
4496
+ 4: ["700", "300"]
4497
+ },
4498
+ border: {
4499
+ 0: ["700", "300"],
4500
+ 4: ["400", "600"]
4501
+ },
4502
+ fg: {
4503
+ 0: ["100", "900"],
4504
+ 4: ["400", "600"]
4505
+ }
4506
+ };
4507
+ function resolveTokens(tokens = {}) {
4508
+ return {
4509
+ color: {
4510
+ "*": resolveCardColorTokens(tokens.color?.["*"]),
4511
+ ...THEME_COLOR_CARD_TONES.reduce((acc, tone) => ({
4512
+ ...acc,
4513
+ [tone]: resolveCardColorTokens(merge(tokens.color?.["*"], tokens.color?.[tone]))
4514
+ }), {})
4515
+ }
4516
+ };
4517
+ }
4518
+ function resolveCardColorTokens(tokens) {
4519
+ return {
4520
+ _hue: tokens?._hue ?? "gray",
4521
+ avatar: {
4522
+ gray: {
4523
+ _hue: tokens?.avatar?.gray?._hue ?? "gray",
4524
+ bg: tokens?.avatar?.gray?.bg ?? ["500", "400"],
4525
+ fg: tokens?.avatar?.gray?.fg ?? ["white", "900"]
4526
+ },
4527
+ blue: {
4528
+ _hue: tokens?.avatar?.blue?._hue ?? "blue",
4529
+ bg: tokens?.avatar?.blue?.bg ?? ["500", "400"],
4530
+ fg: tokens?.avatar?.blue?.fg ?? ["white", "900"]
4531
+ },
4532
+ purple: {
4533
+ _hue: tokens?.avatar?.purple?._hue ?? "purple",
4534
+ bg: tokens?.avatar?.purple?.bg ?? ["500", "400"],
4535
+ fg: tokens?.avatar?.purple?.fg ?? ["white", "900"]
4536
+ },
4537
+ magenta: {
4538
+ _hue: tokens?.avatar?.magenta?._hue ?? "magenta",
4539
+ bg: tokens?.avatar?.magenta?.bg ?? ["500", "400"],
4540
+ fg: tokens?.avatar?.magenta?.fg ?? ["white", "900"]
4541
+ },
4542
+ red: {
4543
+ _hue: tokens?.avatar?.red?._hue ?? "red",
4544
+ bg: tokens?.avatar?.red?.bg ?? ["500", "400"],
4545
+ fg: tokens?.avatar?.red?.fg ?? ["white", "900"]
4546
+ },
4547
+ orange: {
4548
+ _hue: tokens?.avatar?.orange?._hue ?? "orange",
4549
+ bg: tokens?.avatar?.orange?.bg ?? ["500", "400"],
4550
+ fg: tokens?.avatar?.orange?.fg ?? ["white", "900"]
4551
+ },
4552
+ yellow: {
4553
+ _hue: tokens?.avatar?.yellow?._hue ?? "yellow",
4554
+ bg: tokens?.avatar?.yellow?.bg ?? ["500", "400"],
4555
+ fg: tokens?.avatar?.yellow?.fg ?? ["white", "900"]
4556
+ },
4557
+ green: {
4558
+ _hue: tokens?.avatar?.green?._hue ?? "green",
4559
+ bg: tokens?.avatar?.green?.bg ?? ["500", "400"],
4560
+ fg: tokens?.avatar?.green?.fg ?? ["white", "900"]
4561
+ },
4562
+ cyan: {
4563
+ _hue: tokens?.avatar?.cyan?._hue ?? "cyan",
4564
+ bg: tokens?.avatar?.cyan?.bg ?? ["500", "400"],
4565
+ fg: tokens?.avatar?.cyan?.fg ?? ["white", "900"]
4566
+ }
4567
+ },
4568
+ backdrop: tokens?.backdrop ?? ["100", "900"],
4569
+ code: {
4570
+ bg: tokens?.code?.bg ?? ["50", "950"],
4571
+ fg: tokens?.code?.fg ?? ["600", "400"],
4572
+ token: {
4573
+ atrule: tokens?.code?.token?.atrule ?? ["600", "400"],
4574
+ attribute: tokens?.code?.token?.attribute ?? ["600", "400"],
4575
+ attrName: tokens?.code?.token?.attrName ?? ["600", "400"],
4576
+ attrValue: tokens?.code?.token?.attrValue ?? ["600", "400"],
4577
+ boolean: tokens?.code?.token?.boolean ?? ["600", "400"],
4578
+ builtin: tokens?.code?.token?.builtin ?? ["600", "400"],
4579
+ cdata: tokens?.code?.token?.cdata ?? ["600", "400"],
4580
+ char: tokens?.code?.token?.char ?? ["600", "400"],
4581
+ class: tokens?.code?.token?.class ?? ["600", "400"],
4582
+ className: tokens?.code?.token?.className ?? ["600", "400"],
4583
+ comment: tokens?.code?.token?.comment ?? ["400", "600"],
4584
+ constant: tokens?.code?.token?.constant ?? ["600", "400"],
4585
+ deleted: tokens?.code?.token?.deleted ?? ["600", "400"],
4586
+ doctype: tokens?.code?.token?.doctype ?? ["600", "400"],
4587
+ entity: tokens?.code?.token?.entity ?? ["600", "400"],
4588
+ function: tokens?.code?.token?.function ?? ["600", "400"],
4589
+ hexcode: tokens?.code?.token?.hexcode ?? ["600", "400"],
4590
+ id: tokens?.code?.token?.id ?? ["600", "400"],
4591
+ important: tokens?.code?.token?.important ?? ["600", "400"],
4592
+ inserted: tokens?.code?.token?.inserted ?? ["600", "400"],
4593
+ keyword: tokens?.code?.token?.keyword ?? ["600", "400"],
4594
+ number: tokens?.code?.token?.number ?? ["600", "400"],
4595
+ operator: tokens?.code?.token?.operator ?? ["600", "400"],
4596
+ prolog: tokens?.code?.token?.prolog ?? ["600", "400"],
4597
+ property: tokens?.code?.token?.property ?? ["600", "400"],
4598
+ pseudoClass: tokens?.code?.token?.pseudoClass ?? ["600", "400"],
4599
+ pseudoElement: tokens?.code?.token?.pseudoElement ?? ["600", "400"],
4600
+ punctuation: tokens?.code?.token?.punctuation ?? ["600", "400"],
4601
+ regex: tokens?.code?.token?.regex ?? ["600", "400"],
4602
+ selector: tokens?.code?.token?.selector ?? ["600", "400"],
4603
+ string: tokens?.code?.token?.string ?? ["600", "400"],
4604
+ symbol: tokens?.code?.token?.symbol ?? ["600", "400"],
4605
+ tag: tokens?.code?.token?.tag ?? ["600", "400"],
4606
+ unit: tokens?.code?.token?.unit ?? ["600", "400"],
4607
+ url: tokens?.code?.token?.url ?? ["600", "400"],
4608
+ variable: tokens?.code?.token?.variable ?? ["600", "400"]
4609
+ }
4610
+ },
4611
+ focusRing: tokens?.focusRing ?? ["500", "500"],
4612
+ link: {
4613
+ fg: tokens?.link?.fg ?? ["600", "400"]
4614
+ },
4615
+ shadow: {
4616
+ outline: tokens?.shadow?.outline ?? ["500", "500"],
4617
+ umbra: tokens?.shadow?.umbra ?? ["500", "500"],
4618
+ penumbra: tokens?.shadow?.penumbra ?? ["500", "500"],
4619
+ ambient: tokens?.shadow?.ambient ?? ["500", "500"]
4620
+ },
4621
+ skeleton: {
4622
+ from: tokens?.skeleton?.from ?? ["100", "900"],
4623
+ to: tokens?.skeleton?.to ?? ["50", "950"]
4624
+ },
4625
+ variant: {
4626
+ solid: {
4627
+ "*": resolveElementTokens(tokens?.variant?.solid?.["*"]),
4628
+ ...THEME_COLOR_STATE_TONES.reduce((acc, tone) => (acc[tone] = resolveElementTokens(merge(tokens, tokens?.variant?.solid?.["*"], tokens?.variant?.solid?.[tone])), acc), {})
4629
+ },
4630
+ tinted: {
4631
+ "*": resolveElementTokens(tokens?.variant?.tinted?.["*"]),
4632
+ ...THEME_COLOR_STATE_TONES.reduce((acc, tone) => (acc[tone] = resolveElementTokens(merge(tokens, tokens?.variant?.tinted?.["*"], tokens?.variant?.tinted?.[tone])), acc), {})
4633
+ }
4634
+ }
4635
+ };
4636
+ }
4637
+ function resolveElementTokens(tokens) {
4638
+ return {
4639
+ _hue: tokens?._hue ?? "gray",
4640
+ bg: {
4641
+ 0: tokens?.bg?.[0] ?? defaultElementTokens.bg[0],
4642
+ 4: tokens?.bg?.[4] ?? defaultElementTokens.bg[4]
4643
+ },
4644
+ border: {
4645
+ 0: tokens?.border?.[0] ?? defaultElementTokens.border[0],
4646
+ 4: tokens?.border?.[4] ?? defaultElementTokens.border[4]
4647
+ },
4648
+ fg: {
4649
+ 0: tokens?.fg?.[0] ?? defaultElementTokens.fg[0],
4650
+ 4: tokens?.fg?.[4] ?? defaultElementTokens.fg[4]
4651
+ }
4652
+ };
4653
+ }
4654
+ function buildTheme_v3(options) {
4655
+ const {
4656
+ v2
4657
+ } = options ?? {}, tokens = resolveTokens(options?.tokens ?? defaultTokens);
4658
+ return {
4659
+ _version: 3,
4660
+ _tokens: tokens,
4661
+ avatar: v2?.avatar ?? defaultThemeConfig.avatar,
4662
+ button: v2?.button ?? defaultThemeConfig.button,
4663
+ card: v2?.card ?? defaultThemeConfig.card,
4664
+ color: tokens.color,
4665
+ container: v2?.container ?? defaultThemeConfig.container,
4666
+ font: defaultThemeFonts,
4667
+ input: v2?.input ?? defaultThemeConfig.input,
4668
+ layer: v2?.layer ?? defaultThemeConfig.layer,
4669
+ media: v2?.media ?? defaultThemeConfig.media,
4670
+ palette: {
4671
+ black: color.black,
4672
+ white: color.white,
4673
+ hues: color.hues
4674
+ },
4675
+ // TODO
4676
+ radius: v2?.radius ?? defaultThemeConfig.radius,
4677
+ // TODO
4678
+ shadow: v2?.shadow ?? defaultThemeConfig.shadow,
4679
+ // TODO
4680
+ space: v2?.space ?? defaultThemeConfig.space
4681
+ };
4682
+ }
4683
+ const COLOR_VARIANTS = ["tinted", "solid"], AVATAR_COLORS = ["gray", "blue", "purple", "magenta", "red", "orange", "yellow", "green", "cyan"], cache = /* @__PURE__ */ new WeakMap();
4684
+ function getTheme_v2(theme) {
4685
+ if (theme.sanity.v2?._resolved) return theme.sanity.v2;
4686
+ const cached_v2 = cache.get(theme);
4687
+ if (cached_v2) return cached_v2;
4688
+ const v2 = {
4689
+ _version: 2,
4690
+ _resolved: !0,
4691
+ avatar: {
4692
+ ...defaultThemeConfig.avatar,
4693
+ ...theme.sanity.avatar
4694
+ },
4695
+ button: {
4696
+ ...defaultThemeConfig.button,
4697
+ ...theme.sanity.button
4698
+ },
4699
+ card: defaultThemeConfig.card,
4700
+ color: themeColor_v0_v2(theme.sanity.color),
4701
+ container: theme.sanity.container,
4702
+ font: theme.sanity.fonts,
4703
+ input: {
4704
+ ...defaultThemeConfig.input,
4705
+ ...theme.sanity.input,
4706
+ checkbox: {
4707
+ ...defaultThemeConfig.input.checkbox,
4708
+ ...theme.sanity.input.checkbox
4709
+ },
4710
+ radio: {
4711
+ ...defaultThemeConfig.input.radio,
4712
+ ...theme.sanity.input.radio
4713
+ },
4714
+ switch: {
4715
+ ...defaultThemeConfig.input.switch,
4716
+ ...theme.sanity.input.switch
4717
+ }
4718
+ },
4719
+ layer: theme.sanity.layer ?? defaultThemeConfig.layer,
4720
+ media: theme.sanity.media,
4721
+ radius: theme.sanity.radius,
4722
+ shadow: theme.sanity.shadows,
4723
+ space: theme.sanity.space,
4724
+ style: theme.sanity.styles
4725
+ };
4726
+ return cache.set(theme, v2), v2;
4727
+ }
4728
+ exports.AVATAR_COLORS = AVATAR_COLORS;
4729
+ exports.AVATAR_SIZE = AVATAR_SIZE;
4730
+ exports.COLOR_CONFIG_AVATAR_COLORS = COLOR_CONFIG_AVATAR_COLORS;
4731
+ exports.COLOR_CONFIG_BLEND_KEYS = COLOR_CONFIG_BLEND_KEYS;
4732
+ exports.COLOR_CONFIG_CARD_KEYS = COLOR_CONFIG_CARD_KEYS;
4733
+ exports.COLOR_CONFIG_CARD_TONES = COLOR_CONFIG_CARD_TONES;
4734
+ exports.COLOR_CONFIG_INPUT_MODES = COLOR_CONFIG_INPUT_MODES;
4735
+ exports.COLOR_CONFIG_INPUT_STATES = COLOR_CONFIG_INPUT_STATES;
4736
+ exports.COLOR_CONFIG_STATES = COLOR_CONFIG_STATES;
4737
+ exports.COLOR_CONFIG_STATE_KEYS = COLOR_CONFIG_STATE_KEYS;
4738
+ exports.COLOR_CONFIG_STATE_TONES = COLOR_CONFIG_STATE_TONES;
4739
+ exports.COLOR_VARIANTS = COLOR_VARIANTS;
4740
+ exports.CONTAINER = CONTAINER;
4741
+ exports.CONTAINER_SCALE = CONTAINER_SCALE;
4742
+ exports.FONT_CODE_SIZE = FONT_CODE_SIZE;
4743
+ exports.FONT_HEADING_SIZE = FONT_HEADING_SIZE;
4744
+ exports.FONT_LABEL_SIZE = FONT_LABEL_SIZE;
4745
+ exports.FONT_TEXT_SIZE = FONT_TEXT_SIZE;
4746
+ exports.HUES = HUES;
4747
+ exports.RADIUS = RADIUS;
4748
+ exports.SHADOW = SHADOW;
4749
+ exports.SPACE = SPACE;
4750
+ exports.THEME_COLOR_AVATAR_COLORS = THEME_COLOR_AVATAR_COLORS;
4751
+ exports.THEME_COLOR_BLEND_MODES = THEME_COLOR_BLEND_MODES;
4752
+ exports.THEME_COLOR_BUTTON_MODES = THEME_COLOR_BUTTON_MODES;
4753
+ exports.THEME_COLOR_CARD_TONES = THEME_COLOR_CARD_TONES;
4754
+ exports.THEME_COLOR_INPUT_MODES = THEME_COLOR_INPUT_MODES;
4755
+ exports.THEME_COLOR_INPUT_STATES = THEME_COLOR_INPUT_STATES;
4756
+ exports.THEME_COLOR_SCHEMES = THEME_COLOR_SCHEMES;
4757
+ exports.THEME_COLOR_STATES = THEME_COLOR_STATES;
4758
+ exports.THEME_COLOR_STATE_TONES = THEME_COLOR_STATE_TONES;
4759
+ exports.TINTS = TINTS;
4760
+ exports._parseColorToken = _parseColorToken;
4761
+ exports.buildTheme = buildTheme;
4762
+ exports.buildTheme_v3 = buildTheme_v3;
4763
+ exports.createColorTheme = createColorTheme;
4764
+ exports.defaultTokens = defaultTokens;
4765
+ exports.getContrastRatio = getContrastRatio;
4766
+ exports.getScopedTheme = getScopedTheme;
4767
+ exports.getTheme_v2 = getTheme_v2;
4768
+ exports.hexToRgb = hexToRgb;
4769
+ exports.hslToRgb = hslToRgb;
4770
+ exports.isColorBlendModeValue = isColorBlendModeValue;
4771
+ exports.isColorButtonMode = isColorButtonMode;
4772
+ exports.isColorConfigBaseKey = isColorConfigBaseKey;
4773
+ exports.isColorConfigBaseTone = isColorConfigBaseTone;
4774
+ exports.isColorConfigBlendKey = isColorConfigBlendKey;
4775
+ exports.isColorConfigStateKey = isColorConfigStateKey;
4776
+ exports.isColorConfigStateTone = isColorConfigStateTone;
4777
+ exports.isColorHueKey = isColorHueKey;
4778
+ exports.isColorOpacityValue = isColorOpacityValue;
4779
+ exports.isColorTintKey = isColorTintKey;
4780
+ exports.isColorValue = isColorValue;
4781
+ exports.mix = mix;
4782
+ exports.multiply = multiply;
4783
+ exports.parseColor = parseColor;
4784
+ exports.parseTokenValue = parseTokenValue;
4785
+ exports.resolveTokens = resolveTokens;
4786
+ exports.rgbToHex = rgbToHex;
4787
+ exports.rgbToHsl = rgbToHsl;
4788
+ exports.rgba = rgba;
4789
+ exports.rgbaToRGBA = rgbaToRGBA;
4790
+ exports.screen = screen;
4791
+ //# sourceMappingURL=theme.cjs.map