@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.js CHANGED
@@ -1,19 +1,607 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: !0 });
3
- var v3_v2 = require("./_chunks-cjs/v3_v2.js"), color = require("@sanity/color");
4
- function isColorBlendModeValue(str) {
5
- return v3_v2.THEME_COLOR_BLEND_MODES.includes(str);
1
+ import { COLOR_HUES, COLOR_TINTS, color, hues, white as white$1, black as black$1 } from "@sanity/color";
2
+ const defaultThemeConfig = {
3
+ avatar: {
4
+ sizes: [{
5
+ distance: -4,
6
+ size: 19
7
+ }, {
8
+ distance: -4,
9
+ size: 25
10
+ }, {
11
+ distance: -8,
12
+ size: 33
13
+ }, {
14
+ distance: -12,
15
+ size: 49
16
+ }],
17
+ focusRing: {
18
+ offset: 1,
19
+ width: 1
20
+ }
21
+ },
22
+ button: {
23
+ textWeight: "medium",
24
+ border: {
25
+ width: 1
26
+ },
27
+ focusRing: {
28
+ offset: -1,
29
+ width: 1
30
+ }
31
+ },
32
+ card: {
33
+ border: {
34
+ width: 1
35
+ },
36
+ focusRing: {
37
+ offset: -1,
38
+ width: 1
39
+ },
40
+ shadow: {
41
+ outline: 0.5
42
+ }
43
+ },
44
+ container: [320, 640, 960, 1280, 1600, 1920],
45
+ media: [360, 600, 900, 1200, 1800, 2400],
46
+ layer: {
47
+ dialog: {
48
+ zOffset: 600
49
+ },
50
+ popover: {
51
+ zOffset: 400
52
+ },
53
+ tooltip: {
54
+ zOffset: 200
55
+ }
56
+ },
57
+ radius: [0, 1, 3, 7, 11, 15, 23, 43, 75, 127],
58
+ shadow: [null, {
59
+ umbra: [0, 0, 0, 0],
60
+ penumbra: [0, 0, 0, 0],
61
+ ambient: [0, 0, 0, 0]
62
+ }, {
63
+ umbra: [0, 3, 5, -2],
64
+ penumbra: [0, 6, 10, 0],
65
+ ambient: [0, 1, 18, 1]
66
+ }, {
67
+ umbra: [0, 7, 8, -4],
68
+ penumbra: [0, 12, 17, 2],
69
+ ambient: [0, 5, 22, 4]
70
+ }, {
71
+ umbra: [0, 9, 11, -5],
72
+ penumbra: [0, 18, 28, 2],
73
+ ambient: [0, 7, 34, 6]
74
+ }, {
75
+ umbra: [0, 11, 15, -7],
76
+ penumbra: [0, 24, 38, 3],
77
+ ambient: [0, 9, 46, 8]
78
+ }],
79
+ space: [0, 4, 8, 12, 20, 32, 52, 84, 136, 220],
80
+ input: {
81
+ border: {
82
+ width: 1
83
+ },
84
+ checkbox: {
85
+ size: 17,
86
+ focusRing: {
87
+ offset: -1,
88
+ width: 1
89
+ }
90
+ },
91
+ radio: {
92
+ size: 17,
93
+ markSize: 9,
94
+ focusRing: {
95
+ offset: -1,
96
+ width: 1
97
+ }
98
+ },
99
+ switch: {
100
+ width: 25,
101
+ height: 17,
102
+ padding: 5,
103
+ transitionDurationMs: 150,
104
+ transitionTimingFunction: "ease-out",
105
+ focusRing: {
106
+ offset: 1,
107
+ width: 1
108
+ }
109
+ },
110
+ select: {
111
+ focusRing: {
112
+ offset: -1,
113
+ width: 1
114
+ }
115
+ },
116
+ text: {
117
+ focusRing: {
118
+ offset: -1,
119
+ width: 1
120
+ }
121
+ }
122
+ },
123
+ style: {
124
+ button: {
125
+ root: {
126
+ transition: "background-color 100ms,border-color 100ms,color 100ms"
127
+ }
128
+ }
129
+ // card: {
130
+ // root: {
131
+ // transition: 'background-color 100ms,border-color 100ms,color 100ms',
132
+ // },
133
+ // },
134
+ }
135
+ };
136
+ function is_v2(themeProp) {
137
+ return themeProp._version === 2;
138
+ }
139
+ function themeColor_v0_v2_9(color2) {
140
+ if ("neutral" in color2.badge)
141
+ return color2;
142
+ const colors2 = color2;
143
+ return {
144
+ ...colors2,
145
+ badge: {
146
+ ...colors2.badge,
147
+ neutral: colors2.badge.default,
148
+ suggest: colors2.badge.primary
149
+ },
150
+ button: {
151
+ bleed: {
152
+ ...colors2.button.bleed,
153
+ neutral: colors2.button.bleed.default,
154
+ suggest: colors2.button.bleed.primary
155
+ },
156
+ default: {
157
+ ...colors2.button.default,
158
+ neutral: colors2.button.default.default,
159
+ suggest: colors2.button.default.primary
160
+ },
161
+ ghost: {
162
+ ...colors2.button.ghost,
163
+ neutral: colors2.button.ghost.default,
164
+ suggest: colors2.button.ghost.primary
165
+ }
166
+ },
167
+ selectable: {
168
+ ...colors2.selectable,
169
+ neutral: colors2.selectable.default,
170
+ suggest: colors2.selectable.primary
171
+ }
172
+ };
173
+ }
174
+ const cache$4 = /* @__PURE__ */ new WeakMap();
175
+ function themeColor_v0_v2(color_v0) {
176
+ const cached_v2 = cache$4.get(color_v0);
177
+ if (cached_v2) return cached_v2;
178
+ const base = stateThemeColor_v0_v2(color_v0, color_v0.card.enabled), color_v2 = {
179
+ _blend: color_v0._blend || (color_v0.dark ? "screen" : "multiply"),
180
+ _dark: color_v0.dark,
181
+ accent: base.accent,
182
+ avatar: base.avatar,
183
+ backdrop: color_v0.base.shadow.ambient,
184
+ badge: base.badge,
185
+ bg: color_v0.base.bg,
186
+ border: color_v0.base.border,
187
+ button: {
188
+ default: stateTonesThemeColor_v0_v2(color_v0, color_v0.button.default),
189
+ ghost: stateTonesThemeColor_v0_v2(color_v0, color_v0.button.ghost),
190
+ bleed: stateTonesThemeColor_v0_v2(color_v0, color_v0.button.bleed)
191
+ },
192
+ code: base.code,
193
+ fg: color_v0.base.fg,
194
+ focusRing: color_v0.base.focusRing,
195
+ icon: base.muted.fg,
196
+ input: {
197
+ default: inputStatesThemeColor_v0_v2(color_v0.input.default),
198
+ invalid: inputStatesThemeColor_v0_v2(color_v0.input.invalid)
199
+ },
200
+ kbd: base.kbd,
201
+ link: base.link,
202
+ muted: {
203
+ ...base.muted,
204
+ bg: color_v0.selectable?.default.enabled.bg2 || color_v0.base.bg
205
+ },
206
+ selectable: stateTonesThemeColor_v0_v2(color_v0, color_v0.selectable || color_v0.muted),
207
+ shadow: color_v0.base.shadow,
208
+ skeleton: {
209
+ from: color_v0.skeleton?.from || color_v0.base.border,
210
+ to: color_v0.skeleton?.to || color_v0.base.border
211
+ },
212
+ syntax: color_v0.syntax
213
+ };
214
+ return cache$4.set(color_v0, color_v2), color_v2;
215
+ }
216
+ function stateTonesThemeColor_v0_v2(v0, t) {
217
+ return {
218
+ default: {
219
+ enabled: stateThemeColor_v0_v2(v0, t.default.enabled),
220
+ hovered: stateThemeColor_v0_v2(v0, t.default.hovered),
221
+ pressed: stateThemeColor_v0_v2(v0, t.default.pressed),
222
+ selected: stateThemeColor_v0_v2(v0, t.default.selected),
223
+ disabled: stateThemeColor_v0_v2(v0, t.default.disabled)
224
+ },
225
+ neutral: {
226
+ enabled: stateThemeColor_v0_v2(v0, t.default.enabled),
227
+ hovered: stateThemeColor_v0_v2(v0, t.default.hovered),
228
+ pressed: stateThemeColor_v0_v2(v0, t.default.pressed),
229
+ selected: stateThemeColor_v0_v2(v0, t.default.selected),
230
+ disabled: stateThemeColor_v0_v2(v0, t.default.disabled)
231
+ },
232
+ primary: {
233
+ enabled: stateThemeColor_v0_v2(v0, t.primary.enabled),
234
+ hovered: stateThemeColor_v0_v2(v0, t.primary.hovered),
235
+ pressed: stateThemeColor_v0_v2(v0, t.primary.pressed),
236
+ selected: stateThemeColor_v0_v2(v0, t.primary.selected),
237
+ disabled: stateThemeColor_v0_v2(v0, t.primary.disabled)
238
+ },
239
+ suggest: {
240
+ enabled: stateThemeColor_v0_v2(v0, t.primary.enabled),
241
+ hovered: stateThemeColor_v0_v2(v0, t.primary.hovered),
242
+ pressed: stateThemeColor_v0_v2(v0, t.primary.pressed),
243
+ selected: stateThemeColor_v0_v2(v0, t.primary.selected),
244
+ disabled: stateThemeColor_v0_v2(v0, t.primary.disabled)
245
+ },
246
+ positive: {
247
+ enabled: stateThemeColor_v0_v2(v0, t.positive.enabled),
248
+ hovered: stateThemeColor_v0_v2(v0, t.positive.hovered),
249
+ pressed: stateThemeColor_v0_v2(v0, t.positive.pressed),
250
+ selected: stateThemeColor_v0_v2(v0, t.positive.selected),
251
+ disabled: stateThemeColor_v0_v2(v0, t.positive.disabled)
252
+ },
253
+ caution: {
254
+ enabled: stateThemeColor_v0_v2(v0, t.caution.enabled),
255
+ hovered: stateThemeColor_v0_v2(v0, t.caution.hovered),
256
+ pressed: stateThemeColor_v0_v2(v0, t.caution.pressed),
257
+ selected: stateThemeColor_v0_v2(v0, t.caution.selected),
258
+ disabled: stateThemeColor_v0_v2(v0, t.caution.disabled)
259
+ },
260
+ critical: {
261
+ enabled: stateThemeColor_v0_v2(v0, t.critical.enabled),
262
+ hovered: stateThemeColor_v0_v2(v0, t.critical.hovered),
263
+ pressed: stateThemeColor_v0_v2(v0, t.critical.pressed),
264
+ selected: stateThemeColor_v0_v2(v0, t.critical.selected),
265
+ disabled: stateThemeColor_v0_v2(v0, t.critical.disabled)
266
+ }
267
+ };
268
+ }
269
+ function stateThemeColor_v0_v2(v0, state) {
270
+ return {
271
+ ...state,
272
+ avatar: {
273
+ gray: {
274
+ bg: v0.spot.gray,
275
+ fg: v0.base.bg
276
+ },
277
+ blue: {
278
+ bg: v0.spot.blue,
279
+ fg: v0.base.bg
280
+ },
281
+ purple: {
282
+ bg: v0.spot.purple,
283
+ fg: v0.base.bg
284
+ },
285
+ magenta: {
286
+ bg: v0.spot.magenta,
287
+ fg: v0.base.bg
288
+ },
289
+ red: {
290
+ bg: v0.spot.red,
291
+ fg: v0.base.bg
292
+ },
293
+ orange: {
294
+ bg: v0.spot.orange,
295
+ fg: v0.base.bg
296
+ },
297
+ yellow: {
298
+ bg: v0.spot.yellow,
299
+ fg: v0.base.bg
300
+ },
301
+ green: {
302
+ bg: v0.spot.green,
303
+ fg: v0.base.bg
304
+ },
305
+ cyan: {
306
+ bg: v0.spot.cyan,
307
+ fg: v0.base.bg
308
+ }
309
+ },
310
+ badge: {
311
+ default: {
312
+ bg: v0.muted.default.enabled.bg,
313
+ fg: v0.muted.default.enabled.fg,
314
+ dot: v0.muted.default.enabled.muted.fg,
315
+ icon: v0.muted.default.enabled.muted.fg
316
+ },
317
+ neutral: {
318
+ bg: v0.muted.transparent.enabled.bg,
319
+ fg: v0.muted.transparent.enabled.fg,
320
+ dot: v0.muted.transparent.enabled.muted.fg,
321
+ icon: v0.muted.transparent.enabled.muted.fg
322
+ },
323
+ primary: {
324
+ bg: v0.muted.primary.enabled.bg,
325
+ fg: v0.muted.primary.enabled.fg,
326
+ dot: v0.muted.primary.enabled.muted.fg,
327
+ icon: v0.muted.primary.enabled.muted.fg
328
+ },
329
+ suggest: {
330
+ bg: v0.muted.primary.enabled.bg,
331
+ fg: v0.muted.primary.enabled.fg,
332
+ dot: v0.muted.primary.enabled.muted.fg,
333
+ icon: v0.muted.primary.enabled.muted.fg
334
+ },
335
+ positive: {
336
+ bg: v0.muted.positive.enabled.bg,
337
+ fg: v0.muted.positive.enabled.fg,
338
+ dot: v0.muted.positive.enabled.muted.fg,
339
+ icon: v0.muted.positive.enabled.muted.fg
340
+ },
341
+ caution: {
342
+ bg: v0.muted.caution.enabled.bg,
343
+ fg: v0.muted.caution.enabled.fg,
344
+ dot: v0.muted.caution.enabled.muted.fg,
345
+ icon: v0.muted.caution.enabled.muted.fg
346
+ },
347
+ critical: {
348
+ bg: v0.muted.critical.enabled.bg,
349
+ fg: v0.muted.critical.enabled.fg,
350
+ dot: v0.muted.critical.enabled.muted.fg,
351
+ icon: v0.muted.critical.enabled.muted.fg
352
+ }
353
+ },
354
+ kbd: {
355
+ bg: v0.muted.default.enabled.bg,
356
+ fg: v0.muted.default.enabled.fg,
357
+ border: v0.muted.default.enabled.border
358
+ },
359
+ muted: {
360
+ ...v0.muted.default.enabled.muted,
361
+ bg: state.bg2 || state.bg
362
+ },
363
+ skeleton: {
364
+ from: state.skeleton?.from || state.border,
365
+ to: state.skeleton?.to || state.border
366
+ }
367
+ };
368
+ }
369
+ function inputStatesThemeColor_v0_v2(states) {
370
+ return {
371
+ enabled: inputStateThemeColor_v0_v2(states.enabled),
372
+ disabled: inputStateThemeColor_v0_v2(states.disabled),
373
+ readOnly: inputStateThemeColor_v0_v2(states.readOnly),
374
+ hovered: inputStateThemeColor_v0_v2(states.hovered)
375
+ };
376
+ }
377
+ function inputStateThemeColor_v0_v2(state) {
378
+ return {
379
+ bg: state.bg,
380
+ border: state.border,
381
+ fg: state.fg,
382
+ muted: {
383
+ bg: state.bg2
384
+ },
385
+ placeholder: state.placeholder
386
+ };
387
+ }
388
+ const cache$3 = /* @__PURE__ */ new WeakMap();
389
+ function v0_v2(v0) {
390
+ if (v0.v2) return v0.v2;
391
+ const cached_v2 = cache$3.get(v0);
392
+ if (cached_v2) return cached_v2;
393
+ const {
394
+ avatar,
395
+ button,
396
+ color: color2,
397
+ container,
398
+ fonts: font,
399
+ input,
400
+ layer,
401
+ media,
402
+ radius,
403
+ shadows: shadow,
404
+ space,
405
+ styles: style
406
+ } = v0, v2 = {
407
+ _version: 2,
408
+ avatar: {
409
+ ...defaultThemeConfig.avatar,
410
+ ...avatar
411
+ },
412
+ button: {
413
+ ...defaultThemeConfig.button,
414
+ ...button
415
+ },
416
+ card: defaultThemeConfig.card,
417
+ color: {
418
+ light: {
419
+ transparent: themeColor_v0_v2(color2.light.transparent),
420
+ default: themeColor_v0_v2(color2.light.default),
421
+ neutral: themeColor_v0_v2(color2.light.transparent),
422
+ primary: themeColor_v0_v2(color2.light.primary),
423
+ suggest: themeColor_v0_v2(color2.light.primary),
424
+ positive: themeColor_v0_v2(color2.light.positive),
425
+ caution: themeColor_v0_v2(color2.light.caution),
426
+ critical: themeColor_v0_v2(color2.light.critical)
427
+ },
428
+ dark: {
429
+ transparent: themeColor_v0_v2(color2.dark.transparent),
430
+ default: themeColor_v0_v2(color2.dark.default),
431
+ neutral: themeColor_v0_v2(color2.dark.transparent),
432
+ primary: themeColor_v0_v2(color2.dark.primary),
433
+ suggest: themeColor_v0_v2(color2.dark.primary),
434
+ positive: themeColor_v0_v2(color2.dark.positive),
435
+ caution: themeColor_v0_v2(color2.dark.caution),
436
+ critical: themeColor_v0_v2(color2.dark.critical)
437
+ }
438
+ },
439
+ container,
440
+ font,
441
+ input: {
442
+ ...defaultThemeConfig.input,
443
+ ...input,
444
+ checkbox: {
445
+ ...defaultThemeConfig.input.checkbox,
446
+ ...input.checkbox
447
+ },
448
+ radio: {
449
+ ...defaultThemeConfig.input.radio,
450
+ ...input.radio
451
+ },
452
+ switch: {
453
+ ...defaultThemeConfig.input.switch,
454
+ ...input.switch
455
+ }
456
+ },
457
+ layer: layer ?? defaultThemeConfig.layer,
458
+ media,
459
+ radius,
460
+ shadow,
461
+ space,
462
+ style
463
+ };
464
+ return cache$3.set(v0, v2), v2;
465
+ }
466
+ const cache$2 = /* @__PURE__ */ new WeakMap();
467
+ function v2_v0(v2, v3) {
468
+ const cachedTheme = cache$2.get(v2);
469
+ if (cachedTheme) return cachedTheme;
470
+ const {
471
+ avatar,
472
+ button,
473
+ color: color2,
474
+ container,
475
+ font: fonts,
476
+ input,
477
+ media,
478
+ radius,
479
+ shadow: shadows,
480
+ space,
481
+ style: styles
482
+ } = v2;
483
+ return {
484
+ _version: 0,
485
+ avatar,
486
+ button,
487
+ container,
488
+ color: {
489
+ light: {
490
+ transparent: themeColor_v2_v0(color2.light.transparent),
491
+ default: themeColor_v2_v0(color2.light.default),
492
+ primary: themeColor_v2_v0(color2.light.primary),
493
+ positive: themeColor_v2_v0(color2.light.positive),
494
+ caution: themeColor_v2_v0(color2.light.caution),
495
+ critical: themeColor_v2_v0(color2.light.critical)
496
+ },
497
+ dark: {
498
+ transparent: themeColor_v2_v0(color2.dark.transparent),
499
+ default: themeColor_v2_v0(color2.dark.default),
500
+ primary: themeColor_v2_v0(color2.dark.primary),
501
+ positive: themeColor_v2_v0(color2.dark.positive),
502
+ caution: themeColor_v2_v0(color2.dark.caution),
503
+ critical: themeColor_v2_v0(color2.dark.critical)
504
+ }
505
+ },
506
+ focusRing: input.text.focusRing,
507
+ fonts,
508
+ input,
509
+ media,
510
+ radius,
511
+ shadows,
512
+ space,
513
+ styles,
514
+ v2,
515
+ v3
516
+ };
517
+ }
518
+ function themeColor_v2_v0(color_v2) {
519
+ return {
520
+ base: {
521
+ bg: color_v2.bg,
522
+ fg: color_v2.fg,
523
+ border: color_v2.border,
524
+ focusRing: color_v2.focusRing,
525
+ shadow: color_v2.shadow
526
+ },
527
+ button: color_v2.button,
528
+ card: color_v2.selectable.default,
529
+ dark: color_v2._dark,
530
+ input: {
531
+ default: inputStatesThemeColor_v2_v0(color_v2.input.default),
532
+ invalid: inputStatesThemeColor_v2_v0(color_v2.input.invalid)
533
+ },
534
+ muted: {
535
+ ...color_v2.button.ghost,
536
+ transparent: color_v2.button.ghost.default
537
+ },
538
+ solid: {
539
+ ...color_v2.button.default,
540
+ transparent: color_v2.button.default.default
541
+ },
542
+ selectable: color_v2.selectable,
543
+ spot: {
544
+ gray: color_v2.avatar.gray.bg,
545
+ blue: color_v2.avatar.blue.bg,
546
+ purple: color_v2.avatar.purple.bg,
547
+ magenta: color_v2.avatar.magenta.bg,
548
+ red: color_v2.avatar.red.bg,
549
+ orange: color_v2.avatar.orange.bg,
550
+ yellow: color_v2.avatar.yellow.bg,
551
+ green: color_v2.avatar.green.bg,
552
+ cyan: color_v2.avatar.cyan.bg
553
+ },
554
+ syntax: color_v2.syntax
555
+ };
6
556
  }
7
- function isColorHueKey(str) {
8
- return color.COLOR_HUES.includes(str);
557
+ function inputStatesThemeColor_v2_v0(t) {
558
+ return {
559
+ enabled: inputStateThemeColor_v2_v0(t.enabled),
560
+ disabled: inputStateThemeColor_v2_v0(t.disabled),
561
+ readOnly: inputStateThemeColor_v2_v0(t.readOnly),
562
+ hovered: inputStateThemeColor_v2_v0(t.hovered)
563
+ };
9
564
  }
10
- function isColorTintKey(str) {
11
- return color.COLOR_TINTS.includes(str);
565
+ function inputStateThemeColor_v2_v0(t) {
566
+ return {
567
+ bg: t.bg,
568
+ bg2: t.muted.bg,
569
+ border: t.border,
570
+ fg: t.fg,
571
+ placeholder: t.placeholder
572
+ };
12
573
  }
13
- function isColorButtonMode(str) {
14
- return v3_v2.THEME_COLOR_BUTTON_MODES.includes(str);
574
+ const cache$1 = /* @__PURE__ */ new Map();
575
+ function getScopedTheme(themeProp, scheme, tone) {
576
+ const cachedTheme = _getCachedTheme(themeProp, scheme, tone);
577
+ if (cachedTheme) return cachedTheme;
578
+ 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 = {
579
+ sanity: {
580
+ ...v0,
581
+ color: color_v0,
582
+ layer: layer_v0,
583
+ v2: {
584
+ ...v2,
585
+ _resolved: !0,
586
+ color: color_v2_9,
587
+ layer: layer_v2
588
+ }
589
+ }
590
+ };
591
+ return _setCachedTheme(themeProp, scheme, tone, theme), theme;
592
+ }
593
+ function _getCachedTheme(rootTheme, scheme, tone) {
594
+ const schemeCache = cache$1.get(scheme);
595
+ if (!schemeCache) return;
596
+ const toneCache = schemeCache.get(tone);
597
+ if (toneCache)
598
+ return toneCache.get(rootTheme);
599
+ }
600
+ function _setCachedTheme(rootTheme, scheme, tone, theme) {
601
+ cache$1.has(scheme) || cache$1.set(scheme, /* @__PURE__ */ new Map());
602
+ const schemeCache = cache$1.get(scheme);
603
+ schemeCache.has(tone) || schemeCache.set(tone, /* @__PURE__ */ new WeakMap()), schemeCache.get(tone).set(rootTheme, theme);
15
604
  }
16
- const AVATAR_SIZE = [0, 1, 2, 3], CONTAINER = [0, 1, 2, 3, 4, 5, "auto"], RADIUS = [0, 1, 2, 3, 4, 5, 6, "full"], SPACE = [0, 0.5, 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];
17
605
  function createSelectableTones(opts, base, dark, solid, muted) {
18
606
  return {
19
607
  default: _createSelectableStates(opts, base, dark, solid, muted, "default"),
@@ -1056,202 +1644,81 @@ function createSpot(opts, base, dark) {
1056
1644
  base,
1057
1645
  dark,
1058
1646
  key: "purple"
1059
- }),
1060
- magenta: opts.spot({
1061
- base,
1062
- dark,
1063
- key: "magenta"
1064
- }),
1065
- red: opts.spot({
1066
- base,
1067
- dark,
1068
- key: "red"
1069
- }),
1070
- orange: opts.spot({
1071
- base,
1072
- dark,
1073
- key: "orange"
1074
- }),
1075
- yellow: opts.spot({
1076
- base,
1077
- dark,
1078
- key: "yellow"
1079
- }),
1080
- green: opts.spot({
1081
- base,
1082
- dark,
1083
- key: "green"
1084
- }),
1085
- cyan: opts.spot({
1086
- base,
1087
- dark,
1088
- key: "cyan"
1089
- })
1090
- };
1091
- }
1092
- function createColorTheme(partialOpts = {}) {
1093
- const builders = {
1094
- ...defaultOpts,
1095
- ...partialOpts
1096
- };
1097
- return {
1098
- light: _createColorScheme(builders, !1),
1099
- dark: _createColorScheme(builders, !0)
1100
- };
1101
- }
1102
- function _createColorScheme(opts, dark) {
1103
- return {
1104
- default: _createColor(opts, dark, "default"),
1105
- transparent: _createColor(opts, dark, "transparent"),
1106
- primary: _createColor(opts, dark, "primary"),
1107
- positive: _createColor(opts, dark, "positive"),
1108
- caution: _createColor(opts, dark, "caution"),
1109
- critical: _createColor(opts, dark, "critical")
1110
- };
1111
- }
1112
- function _createColor(opts, dark, name) {
1113
- const base = opts.base({
1114
- dark,
1115
- name
1116
- }), solid = createSolidTones(opts, base, dark, name), muted = createMutedTones(opts, base, dark, name);
1117
- return {
1118
- base,
1119
- button: createButtonModes(opts, base, dark, solid, muted),
1120
- card: createCardStates(opts, base, dark, name, solid, muted),
1121
- dark,
1122
- input: createInputModes(opts, base, dark, solid, muted),
1123
- selectable: createSelectableTones(opts, base, dark, solid, muted),
1124
- spot: createSpot(opts, base, dark),
1125
- syntax: opts.syntax({
1126
- base,
1127
- dark
1128
- }),
1129
- solid,
1130
- muted
1131
- };
1132
- }
1133
- const defaultThemeConfig = {
1134
- avatar: {
1135
- sizes: [{
1136
- distance: -4,
1137
- size: 19
1138
- }, {
1139
- distance: -4,
1140
- size: 25
1141
- }, {
1142
- distance: -8,
1143
- size: 33
1144
- }, {
1145
- distance: -12,
1146
- size: 49
1147
- }],
1148
- focusRing: {
1149
- offset: 1,
1150
- width: 1
1151
- }
1152
- },
1153
- button: {
1154
- textWeight: "medium",
1155
- border: {
1156
- width: 0.5
1157
- },
1158
- focusRing: {
1159
- offset: -1,
1160
- width: 1
1161
- }
1162
- },
1163
- card: {
1164
- border: {
1165
- width: 0.5
1166
- },
1167
- focusRing: {
1168
- offset: -1,
1169
- width: 1
1170
- },
1171
- shadow: {
1172
- outline: 0.5
1173
- }
1174
- },
1175
- container: [320, 640, 960, 1280, 1600, 1920],
1176
- media: [360, 600, 900, 1200, 1800, 2400],
1177
- layer: {
1178
- dialog: {
1179
- zOffset: 600
1180
- },
1181
- popover: {
1182
- zOffset: 400
1183
- },
1184
- tooltip: {
1185
- zOffset: 200
1186
- }
1187
- },
1188
- radius: [0, 1, 5, 9, 13, 17, 25, 45, 77, 129],
1189
- shadow: [null, {
1190
- umbra: [0, 0, 0, 0],
1191
- penumbra: [0, 0, 0, 0],
1192
- ambient: [0, 0, 0, 0]
1193
- }, {
1194
- umbra: [0, 3, 5, -2],
1195
- penumbra: [0, 6, 10, 0],
1196
- ambient: [0, 1, 18, 1]
1197
- }, {
1198
- umbra: [0, 7, 8, -4],
1199
- penumbra: [0, 12, 17, 2],
1200
- ambient: [0, 5, 22, 4]
1201
- }, {
1202
- umbra: [0, 9, 11, -5],
1203
- penumbra: [0, 18, 28, 2],
1204
- ambient: [0, 7, 34, 6]
1205
- }, {
1206
- umbra: [0, 11, 15, -7],
1207
- penumbra: [0, 24, 38, 3],
1208
- ambient: [0, 9, 46, 8]
1209
- }],
1210
- space: [0, 4, 8, 12, 20, 32, 52, 84, 136, 220],
1211
- input: {
1212
- border: {
1213
- width: 0.5
1214
- },
1215
- checkbox: {
1216
- size: 17,
1217
- focusRing: {
1218
- offset: -1,
1219
- width: 1
1220
- }
1221
- },
1222
- radio: {
1223
- size: 17,
1224
- markSize: 9,
1225
- focusRing: {
1226
- offset: -1,
1227
- width: 1
1228
- }
1229
- },
1230
- switch: {
1231
- width: 25,
1232
- height: 17,
1233
- padding: 5,
1234
- transitionDurationMs: 150,
1235
- transitionTimingFunction: "ease-out",
1236
- focusRing: {
1237
- offset: 1,
1238
- width: 1
1239
- }
1240
- },
1241
- select: {
1242
- focusRing: {
1243
- offset: -1,
1244
- width: 1
1245
- }
1246
- },
1247
- text: {
1248
- focusRing: {
1249
- offset: -1,
1250
- width: 1
1251
- }
1252
- }
1253
- }
1254
- }, defaultThemeFonts = {
1647
+ }),
1648
+ magenta: opts.spot({
1649
+ base,
1650
+ dark,
1651
+ key: "magenta"
1652
+ }),
1653
+ red: opts.spot({
1654
+ base,
1655
+ dark,
1656
+ key: "red"
1657
+ }),
1658
+ orange: opts.spot({
1659
+ base,
1660
+ dark,
1661
+ key: "orange"
1662
+ }),
1663
+ yellow: opts.spot({
1664
+ base,
1665
+ dark,
1666
+ key: "yellow"
1667
+ }),
1668
+ green: opts.spot({
1669
+ base,
1670
+ dark,
1671
+ key: "green"
1672
+ }),
1673
+ cyan: opts.spot({
1674
+ base,
1675
+ dark,
1676
+ key: "cyan"
1677
+ })
1678
+ };
1679
+ }
1680
+ function createColorTheme(partialOpts = {}) {
1681
+ const builders = {
1682
+ ...defaultOpts,
1683
+ ...partialOpts
1684
+ };
1685
+ return {
1686
+ light: _createColorScheme(builders, !1),
1687
+ dark: _createColorScheme(builders, !0)
1688
+ };
1689
+ }
1690
+ function _createColorScheme(opts, dark) {
1691
+ return {
1692
+ default: _createColor(opts, dark, "default"),
1693
+ transparent: _createColor(opts, dark, "transparent"),
1694
+ primary: _createColor(opts, dark, "primary"),
1695
+ positive: _createColor(opts, dark, "positive"),
1696
+ caution: _createColor(opts, dark, "caution"),
1697
+ critical: _createColor(opts, dark, "critical")
1698
+ };
1699
+ }
1700
+ function _createColor(opts, dark, name) {
1701
+ const base = opts.base({
1702
+ dark,
1703
+ name
1704
+ }), solid = createSolidTones(opts, base, dark, name), muted = createMutedTones(opts, base, dark, name);
1705
+ return {
1706
+ base,
1707
+ button: createButtonModes(opts, base, dark, solid, muted),
1708
+ card: createCardStates(opts, base, dark, name, solid, muted),
1709
+ dark,
1710
+ input: createInputModes(opts, base, dark, solid, muted),
1711
+ selectable: createSelectableTones(opts, base, dark, solid, muted),
1712
+ spot: createSpot(opts, base, dark),
1713
+ syntax: opts.syntax({
1714
+ base,
1715
+ dark
1716
+ }),
1717
+ solid,
1718
+ muted
1719
+ };
1720
+ }
1721
+ const defaultThemeFonts$1 = {
1255
1722
  code: {
1256
1723
  family: "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
1257
1724
  weights: {
@@ -1299,12 +1766,11 @@ const defaultThemeConfig = {
1299
1766
  },
1300
1767
  heading: {
1301
1768
  family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
1302
- featureSettings: "'liga' 1, 'calt' 1, 'ss01' 1, 'ss03' 1, 'zero' 1",
1303
1769
  weights: {
1304
- regular: 400,
1305
- medium: 500,
1306
- semibold: 600,
1307
- bold: 700
1770
+ regular: 600,
1771
+ medium: 700,
1772
+ semibold: 800,
1773
+ bold: 900
1308
1774
  },
1309
1775
  sizes: [{
1310
1776
  ascenderHeight: 5,
@@ -1447,766 +1913,1447 @@ const defaultThemeConfig = {
1447
1913
  letterSpacing: 0
1448
1914
  }]
1449
1915
  }
1450
- }, HUES = ["gray", "blue", "purple", "magenta", "red", "orange", "yellow", "green", "cyan"], TINTS = [50, 100, 150, 200, 250, 300, 350, 400, 450, 500, 550, 600, 650, 700, 750, 800, 850, 900, 950], RE_PERCENTAGE = /^([0-9]+)%/, RE_OPACITY = /^(1|0\.[0-9]+)?/;
1451
- function parseColor$1(str) {
1452
- let cursor = 0;
1453
- const color2 = getColor();
1454
- if (!color2)
1455
- throw new Error(`Invalid color: ${str}`);
1456
- const opacity = getOpacity(), mix2 = getMixPercentage();
1457
- return {
1458
- color: color2,
1459
- mix: mix2,
1460
- opacity
1461
- };
1462
- function _consume(s) {
1463
- if (str.startsWith(s, cursor))
1464
- return cursor += s.length, s;
1465
- }
1466
- function _peek() {
1467
- return str[cursor];
1468
- }
1469
- function getColor() {
1470
- ignoreWhitespace();
1471
- let v = _consume("black") || _consume("white");
1472
- if (v)
1916
+ }, THEME_COLOR_SCHEMES = ["light", "dark"], THEME_COLOR_BLEND_MODES = ["multiply", "screen"], THEME_COLOR_CARD_TONES = [
1917
+ "transparent",
1918
+ "default",
1919
+ "neutral",
1920
+ "primary",
1921
+ // deprecated
1922
+ "suggest",
1923
+ "positive",
1924
+ "caution",
1925
+ "critical"
1926
+ ], THEME_COLOR_STATE_TONES = [
1927
+ "default",
1928
+ "neutral",
1929
+ "primary",
1930
+ // deprecated
1931
+ "suggest",
1932
+ "positive",
1933
+ "caution",
1934
+ "critical"
1935
+ ], 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_HUES;
1936
+ function isColorBlendModeValue(str) {
1937
+ return THEME_COLOR_BLEND_MODES.includes(str);
1938
+ }
1939
+ function isColorHueKey(str) {
1940
+ return COLOR_HUES.includes(str);
1941
+ }
1942
+ function isColorTintKey(str) {
1943
+ return COLOR_TINTS.includes(str);
1944
+ }
1945
+ function isColorButtonMode(str) {
1946
+ return THEME_COLOR_BUTTON_MODES.includes(str);
1947
+ }
1948
+ 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];
1949
+ function isColorConfigBaseTone(str) {
1950
+ return COLOR_CONFIG_CARD_TONES.includes(str);
1951
+ }
1952
+ function isColorConfigBaseKey(str) {
1953
+ return COLOR_CONFIG_CARD_KEYS.includes(str);
1954
+ }
1955
+ function isColorConfigStateKey(str) {
1956
+ return COLOR_CONFIG_STATE_KEYS.includes(str);
1957
+ }
1958
+ function isColorConfigStateTone(str) {
1959
+ return COLOR_CONFIG_STATE_TONES.includes(str);
1960
+ }
1961
+ function isColorConfigBlendKey(str) {
1962
+ return COLOR_CONFIG_BLEND_KEYS.includes(str);
1963
+ }
1964
+ function isColorValue(str) {
1965
+ return str === "black" || str === "white";
1966
+ }
1967
+ function isColorOpacityValue(str) {
1968
+ return str === "0" || /^0\.[0-9]+$/.test(str) || str === "1";
1969
+ }
1970
+ function isColorMixPercentValue(str) {
1971
+ return /^\d+%$/.test(str);
1972
+ }
1973
+ function parseTokenValue(str) {
1974
+ const segments = str.split("/");
1975
+ let nextSegment = segments.shift() || "";
1976
+ const [segment0, segment0mix] = nextSegment.split(" ");
1977
+ if (isColorTintKey(segment0)) {
1978
+ const tint = segment0, segment1 = segments.shift() || "";
1979
+ if (isColorMixPercentValue(segment0mix)) {
1980
+ const mix2 = Number(segment0mix.slice(0, -1)) / 100;
1473
1981
  return {
1474
- type: v
1982
+ type: "color",
1983
+ tint,
1984
+ mix: mix2
1475
1985
  };
1476
- for (const hue of HUES)
1477
- if (v = _consume(String(hue)), v) {
1478
- if (_peek() !== "/")
1479
- throw new Error("Expected slash after hue");
1480
- cursor += 1;
1481
- const tint2 = getTint();
1482
- if (!tint2)
1483
- throw new Error("Expected tint after hue");
1484
- return {
1485
- type: "hue",
1486
- hue,
1487
- tint: tint2
1488
- };
1489
- }
1490
- const tint = getTint();
1491
- if (tint)
1986
+ }
1987
+ if (isColorOpacityValue(segment1)) {
1988
+ const opacity = Number(segment1);
1492
1989
  return {
1493
- type: "hue",
1494
- hue: void 0,
1495
- tint
1990
+ type: "color",
1991
+ tint,
1992
+ opacity
1496
1993
  };
1497
- }
1498
- function getTint() {
1499
- ignoreWhitespace();
1500
- let v = Number(str.slice(cursor, cursor + 3));
1501
- if (TINTS.includes(v))
1502
- return cursor += 3, v;
1503
- if (v = Number(str.slice(cursor, cursor + 2)), TINTS.includes(v))
1504
- return cursor += 2, v;
1505
- }
1506
- function getMixPercentage() {
1507
- ignoreWhitespace();
1508
- const match = RE_PERCENTAGE.exec(str.slice(cursor));
1509
- if (match)
1510
- return cursor += match[0].length, parseFloat(match[1]);
1511
- }
1512
- function getOpacity() {
1513
- if (ignoreWhitespace(), _peek() === "/") {
1514
- cursor += 1;
1515
- const match = RE_OPACITY.exec(str.slice(cursor));
1516
- if (match)
1517
- return cursor += match[0].length, parseFloat(match[1]);
1518
- cursor -= 1;
1519
1994
  }
1995
+ return {
1996
+ type: "color",
1997
+ tint
1998
+ };
1520
1999
  }
1521
- function ignoreWhitespace() {
1522
- for (; _peek() === " "; )
1523
- cursor++;
2000
+ if (isColorValue(segment0)) {
2001
+ const key = segment0, segment1 = segments.shift() || "";
2002
+ if (isColorMixPercentValue(segment0mix)) {
2003
+ const mix2 = Number(segment0mix.slice(0, -1)) / 100;
2004
+ return {
2005
+ type: "color",
2006
+ key,
2007
+ mix: mix2
2008
+ };
2009
+ }
2010
+ if (isColorOpacityValue(segment1)) {
2011
+ const opacity = Number(segment1);
2012
+ return {
2013
+ type: "color",
2014
+ key,
2015
+ opacity
2016
+ };
2017
+ }
2018
+ return {
2019
+ type: "color",
2020
+ key
2021
+ };
1524
2022
  }
1525
- }
1526
- function renderColor(token, context) {
1527
- const {
1528
- bgVar,
1529
- hue,
1530
- scheme
1531
- } = context, result = parseColor$1(token[scheme === "dark" ? 0 : 1]), colorVar = result.color.type === "hue" ? `--${result.color.hue ?? hue}-${result.color.tint}` : `--${result.color.type}`;
1532
- return result.mix !== void 0 ? `color-mix(in srgb, var(${bgVar}), var(${colorVar}) ${result.mix}%)` : result.opacity !== void 0 ? `color-mix(in srgb, transparent, var(${colorVar}) ${result.opacity * 100}%)` : `var(${colorVar})`;
1533
- }
1534
- function buildColor_v3(tokens) {
1535
- return {
1536
- dark: buildColorScheme_v3(tokens, {
1537
- scheme: "dark"
1538
- }),
1539
- light: buildColorScheme_v3(tokens, {
1540
- scheme: "light"
1541
- })
1542
- };
1543
- }
1544
- function buildColorScheme_v3(tokens, options) {
1545
- const {
1546
- scheme
1547
- } = options;
1548
- return {
1549
- card: v3_v2.THEME_COLOR_CARD_TONES.reduce((acc, tone) => (acc[tone] = buildColorCard_v3(tokens[tone], {
1550
- scheme
1551
- }), acc), {})
1552
- };
1553
- }
1554
- function buildColorCard_v3(tokens, options) {
1555
- const {
1556
- scheme
1557
- } = options, context = {
1558
- bgVar: "--color-bg-1",
1559
- hue: tokens._hue,
1560
- scheme
1561
- };
1562
- return {
1563
- _hue: tokens._hue ?? "gray",
1564
- avatar: v3_v2.THEME_COLOR_AVATAR_COLORS.reduce((acc, hue) => {
1565
- const avatarTokens = tokens.avatar[hue];
1566
- return acc[hue] = {
1567
- bg: renderColor(avatarTokens.bg, {
1568
- bgVar: "--color-bg-1",
1569
- hue: avatarTokens._hue,
1570
- scheme
1571
- }),
1572
- fg: renderColor(avatarTokens.fg, {
1573
- bgVar: "--color-bg-1",
1574
- hue: avatarTokens._hue,
1575
- scheme
1576
- })
1577
- }, acc;
1578
- }, {}),
1579
- backdrop: renderColor(tokens.backdrop, context),
1580
- focusRing: renderColor(tokens.focusRing, context),
1581
- shadow: {
1582
- outline: renderColor(tokens.shadow.outline, context),
1583
- umbra: renderColor(tokens.shadow.umbra, context),
1584
- penumbra: renderColor(tokens.shadow.penumbra, context),
1585
- ambient: renderColor(tokens.shadow.ambient, context)
1586
- },
1587
- skeleton: {
1588
- from: renderColor(tokens.skeleton.from, context),
1589
- to: renderColor(tokens.skeleton.to, context)
1590
- },
1591
- token: {
1592
- atrule: renderColor(tokens.token.atrule, context),
1593
- attrName: renderColor(tokens.token.attrName, context),
1594
- attrValue: renderColor(tokens.token.attrValue, context),
1595
- attribute: renderColor(tokens.token.attribute, context),
1596
- boolean: renderColor(tokens.token.boolean, context),
1597
- builtin: renderColor(tokens.token.builtin, context),
1598
- cdata: renderColor(tokens.token.cdata, context),
1599
- char: renderColor(tokens.token.char, context),
1600
- class: renderColor(tokens.token.class, context),
1601
- className: renderColor(tokens.token.className, context),
1602
- comment: renderColor(tokens.token.comment, context),
1603
- constant: renderColor(tokens.token.constant, context),
1604
- deleted: renderColor(tokens.token.deleted, context),
1605
- doctype: renderColor(tokens.token.doctype, context),
1606
- entity: renderColor(tokens.token.entity, context),
1607
- function: renderColor(tokens.token.function, context),
1608
- hexcode: renderColor(tokens.token.hexcode, context),
1609
- id: renderColor(tokens.token.id, context),
1610
- important: renderColor(tokens.token.important, context),
1611
- inserted: renderColor(tokens.token.inserted, context),
1612
- keyword: renderColor(tokens.token.keyword, context),
1613
- number: renderColor(tokens.token.number, context),
1614
- operator: renderColor(tokens.token.operator, context),
1615
- prolog: renderColor(tokens.token.prolog, context),
1616
- property: renderColor(tokens.token.property, context),
1617
- pseudoClass: renderColor(tokens.token.pseudoClass, context),
1618
- pseudoElement: renderColor(tokens.token.pseudoElement, context),
1619
- punctuation: renderColor(tokens.token.punctuation, context),
1620
- regex: renderColor(tokens.token.regex, context),
1621
- selector: renderColor(tokens.token.selector, context),
1622
- string: renderColor(tokens.token.string, context),
1623
- symbol: renderColor(tokens.token.symbol, context),
1624
- tag: renderColor(tokens.token.tag, context),
1625
- unit: renderColor(tokens.token.unit, context),
1626
- url: renderColor(tokens.token.url, context),
1627
- variable: renderColor(tokens.token.variable, context)
1628
- },
1629
- variant: {
1630
- solid: {
1631
- ...v3_v2.THEME_COLOR_STATE_TONES.reduce((acc, tone) => ({
1632
- ...acc,
1633
- [tone]: buildColorElement_v3(tokens.variant.solid[tone], {
1634
- scheme
1635
- })
1636
- }), {})
1637
- },
1638
- tinted: {
1639
- ...v3_v2.THEME_COLOR_STATE_TONES.reduce((acc, tone) => ({
1640
- ...acc,
1641
- [tone]: buildColorElement_v3(tokens.variant.tinted[tone], {
1642
- scheme
1643
- })
1644
- }), {})
2023
+ if (isColorHueKey(segment0)) {
2024
+ const hue = segment0;
2025
+ nextSegment = segments.shift() || "";
2026
+ const [segment1, segment1mix] = nextSegment.split(" ");
2027
+ if (isColorTintKey(segment1)) {
2028
+ const tint = segment1, segment2 = segments.shift() || "";
2029
+ if (isColorMixPercentValue(segment1mix)) {
2030
+ const mix2 = Number(segment1mix.slice(0, -1)) / 100;
2031
+ return {
2032
+ type: "color",
2033
+ hue,
2034
+ tint,
2035
+ mix: mix2
2036
+ };
2037
+ }
2038
+ if (isColorOpacityValue(segment2)) {
2039
+ const opacity = Number(segment2);
2040
+ return {
2041
+ type: "color",
2042
+ hue,
2043
+ tint,
2044
+ opacity
2045
+ };
1645
2046
  }
2047
+ return {
2048
+ type: "color",
2049
+ hue,
2050
+ tint
2051
+ };
1646
2052
  }
1647
- };
2053
+ return {
2054
+ type: "hue",
2055
+ value: hue
2056
+ };
2057
+ }
2058
+ if (isColorBlendModeValue(segment0))
2059
+ return {
2060
+ type: "blendMode",
2061
+ value: segment0
2062
+ };
1648
2063
  }
1649
- function buildColorElement_v3(tokens, options) {
2064
+ function compileColorTokenValue(node) {
2065
+ let key = "";
2066
+ 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);
2067
+ }
2068
+ const DEFAULT_COLOR_TOKEN_VALUE = ["500", "500"];
2069
+ function resolveColorTokenValue(context, value = DEFAULT_COLOR_TOKEN_VALUE) {
1650
2070
  const {
2071
+ hue,
1651
2072
  scheme
1652
- } = options, context = {
1653
- bgVar: "--bg",
1654
- hue: tokens._hue,
1655
- scheme
1656
- };
1657
- return {
1658
- _hue: tokens._hue ?? "gray",
1659
- bg: {
1660
- 0: renderColor(tokens.bg[0], context),
1661
- 4: renderColor(tokens.bg[4], context)
1662
- },
1663
- border: {
1664
- 0: renderColor(tokens.border[0], context),
1665
- 4: renderColor(tokens.border[4], context)
1666
- },
1667
- fg: {
1668
- 0: renderColor(tokens.fg[0], context),
1669
- 4: renderColor(tokens.fg[4], context)
1670
- }
1671
- };
2073
+ } = context, node = parseTokenValue(value[scheme === "light" ? 0 : 1]);
2074
+ if (!node || node.type !== "color")
2075
+ throw new Error(`Invalid color token: ${value[0]}`);
2076
+ return compileColorTokenValue({
2077
+ ...node,
2078
+ hue: node.hue || hue
2079
+ });
1672
2080
  }
1673
- const defaultPalette = {
1674
- chroma: {
1675
- min: 5e-3,
1676
- max: 0.2325
1677
- },
1678
- luminosity: {
1679
- min: 0.1875,
1680
- max: 1
1681
- },
1682
- hues: {
1683
- gray: {
1684
- h: 277,
1685
- c: 0.04
1686
- },
1687
- blue: {
1688
- h: 273,
1689
- c: 0.185
1690
- },
1691
- purple: {
1692
- h: 295,
1693
- c: 0.4
1694
- },
1695
- magenta: {
1696
- h: 12,
1697
- c: 0.4
1698
- },
1699
- red: {
1700
- h: 30,
1701
- c: 0.4
1702
- },
1703
- orange: {
1704
- h: 68,
1705
- c: 0.4
1706
- },
1707
- yellow: {
1708
- h: 90,
1709
- c: 0.4
1710
- },
1711
- green: {
1712
- h: 171,
1713
- c: 0.4
1714
- },
1715
- cyan: {
1716
- h: 194,
1717
- c: 0.4
1718
- }
1719
- }
1720
- }, defaultTokens = {
1721
- color: {
2081
+ const defaultColorTokens = {
2082
+ base: {
1722
2083
  "*": {
1723
- // backdrop: ['black/0.2', '200/0.2'],
1724
- backdrop: ["black/0.5", "gray/100/0.5"],
1725
- focusRing: ["blue/500", "blue/300"],
2084
+ _blend: ["multiply", "screen"],
2085
+ accent: {
2086
+ fg: ["purple/600", "purple/400"]
2087
+ },
2088
+ avatar: {
2089
+ "*": {
2090
+ _blend: ["screen", "multiply"],
2091
+ bg: ["500", "400"],
2092
+ fg: ["white", "black"]
2093
+ }
2094
+ },
2095
+ backdrop: ["gray/200/0.5", "black/0.5"],
2096
+ badge: {
2097
+ "*": {
2098
+ bg: ["100", "900"],
2099
+ fg: ["600", "400"],
2100
+ icon: ["500", "500"],
2101
+ dot: ["500", "500"]
2102
+ },
2103
+ positive: {
2104
+ bg: ["200 50%", "900"],
2105
+ fg: ["600", "500"]
2106
+ },
2107
+ caution: {
2108
+ bg: ["200 50%", "900"],
2109
+ fg: ["600", "500"]
2110
+ }
2111
+ },
2112
+ bg: ["50", "950"],
2113
+ border: ["200", "800"],
2114
+ code: {
2115
+ bg: ["50", "950"],
2116
+ fg: ["600", "400"]
2117
+ },
2118
+ fg: ["800", "200"],
2119
+ focusRing: ["blue/500", "blue/500"],
2120
+ icon: ["600", "400"],
2121
+ kbd: {
2122
+ bg: ["white", "black"],
2123
+ fg: ["600", "400"],
2124
+ border: ["200", "800"]
2125
+ },
1726
2126
  link: {
1727
- fg: ["blue/400", "blue/600"]
2127
+ fg: ["blue/600", "blue/300"]
1728
2128
  },
1729
- shadow: {
1730
- outline: ["500/0.4", "500/0.3"],
1731
- umbra: ["black/0.2", "500/0.1"],
1732
- penumbra: ["black/0.14", "500/0.07"],
1733
- ambient: ["black/0.12", "500/0.06"]
2129
+ muted: {
2130
+ bg: ["50", "950"],
2131
+ fg: ["700 75%", "300 75%"]
1734
2132
  },
1735
- token: {
1736
- atrule: ["purple/300", "purple/600"],
1737
- attrName: ["green/300", "green/600"],
1738
- attrValue: ["yellow/300", "yellow/600"],
1739
- attribute: ["yellow/300", "yellow/600"],
1740
- boolean: ["purple/300", "purple/600"],
1741
- builtin: ["purple/300", "purple/600"],
1742
- cdata: ["yellow/300", "yellow/600"],
1743
- char: ["yellow/300", "yellow/600"],
1744
- class: ["orange/300", "orange/600"],
1745
- className: ["cyan/300", "cyan/600"],
1746
- comment: ["gray/600", "gray/300"],
1747
- constant: ["purple/300", "purple/600"],
1748
- deleted: ["red/300", "red/600"],
1749
- entity: ["red/300", "red/600"],
1750
- function: ["green/300", "green/600"],
1751
- hexcode: ["blue/300", "blue/600"],
1752
- id: ["purple/300", "purple/600"],
1753
- important: ["purple/300", "purple/600"],
1754
- inserted: ["green/300", "green/600"],
1755
- keyword: ["magenta/300", "magenta/600"],
1756
- number: ["purple/300", "purple/600"],
1757
- operator: ["magenta/300", "magenta/600"],
1758
- prolog: ["gray/300", "gray/600"],
1759
- property: ["blue/300", "blue/600"],
1760
- pseudoClass: ["yellow/300", "yellow/600"],
1761
- pseudoElement: ["yellow/300", "yellow/600"],
1762
- punctuation: ["gray/300", "gray/600"],
1763
- regex: ["blue/300", "blue/600"],
1764
- selector: ["red/300", "red/600"],
1765
- string: ["yellow/300", "yellow/600"],
1766
- symbol: ["purple/300", "purple/600"],
1767
- tag: ["red/300", "red/600"],
1768
- unit: ["orange/300", "orange/600"],
1769
- url: ["red/300", "red/600"],
1770
- variable: ["red/300", "red/600"]
2133
+ shadow: {
2134
+ outline: ["500/0.3", "500/0.4"],
2135
+ umbra: ["gray/500/0.1", "black/0.2"],
2136
+ penumbra: ["gray/500/0.07", "black/0.14"],
2137
+ ambient: ["gray/500/0.06", "black/0.12"]
1771
2138
  },
1772
- variant: {
1773
- tinted: {
1774
- "*": {
1775
- bg: {
1776
- 0: ["900", "50"],
1777
- 4: ["800", "150"]
1778
- },
1779
- border: {
1780
- 0: ["800", "150"],
1781
- 4: ["600", "350"]
1782
- },
1783
- fg: {
1784
- 0: ["100", "900"],
1785
- 4: ["300", "700"]
2139
+ skeleton: {
2140
+ from: ["100", "900"],
2141
+ to: ["100 50%", "900 50%"]
2142
+ }
2143
+ },
2144
+ transparent: {
2145
+ bg: ["50", "black"]
2146
+ },
2147
+ default: {
2148
+ bg: ["white", "950"],
2149
+ fg: ["800", "200"],
2150
+ muted: {
2151
+ fg: ["600", "400"]
2152
+ }
2153
+ },
2154
+ primary: {
2155
+ _hue: "blue"
2156
+ },
2157
+ suggest: {
2158
+ _hue: "purple"
2159
+ },
2160
+ positive: {
2161
+ _hue: "green",
2162
+ shadow: {
2163
+ outline: ["500/0.4", "500/0.4"]
2164
+ }
2165
+ },
2166
+ caution: {
2167
+ _hue: "yellow",
2168
+ shadow: {
2169
+ outline: ["600/0.3", "500/0.4"]
2170
+ }
2171
+ },
2172
+ critical: {
2173
+ _hue: "red"
2174
+ }
2175
+ },
2176
+ button: {
2177
+ default: {
2178
+ "*": {
2179
+ "*": {
2180
+ _blend: ["screen", "multiply"],
2181
+ accent: {
2182
+ fg: ["purple/300", "purple/700"]
2183
+ },
2184
+ avatar: {
2185
+ "*": {
2186
+ _blend: ["screen", "multiply"],
2187
+ bg: ["500", "400"],
2188
+ fg: ["white", "black"]
1786
2189
  }
1787
2190
  },
1788
- primary: {
1789
- _hue: "blue"
2191
+ badge: {
2192
+ "*": {
2193
+ bg: ["900", "100"],
2194
+ fg: ["400", "600"],
2195
+ dot: ["500", "500"],
2196
+ icon: ["500", "500"]
2197
+ }
1790
2198
  },
1791
- suggest: {
1792
- _hue: "purple"
2199
+ bg: ["500", "400"],
2200
+ border: ["500/0", "400/0"],
2201
+ code: {
2202
+ bg: ["500 20%", "400 20%"],
2203
+ fg: ["200", "600"]
1793
2204
  },
1794
- positive: {
1795
- _hue: "green"
2205
+ fg: ["white", "black"],
2206
+ icon: ["100 70%", "900 70%"],
2207
+ kbd: {
2208
+ bg: ["black", "white"],
2209
+ fg: ["200", "600"],
2210
+ border: ["800", "200"]
1796
2211
  },
1797
- caution: {
1798
- _hue: "yellow"
2212
+ link: {
2213
+ fg: ["blue/200", "blue/600"]
1799
2214
  },
1800
- critical: {
1801
- _hue: "red"
2215
+ muted: {
2216
+ bg: ["950", "50"],
2217
+ fg: ["100 70%", "900 70%"]
2218
+ },
2219
+ skeleton: {
2220
+ from: ["900", "100"],
2221
+ to: ["900 50%", "100 50%"]
1802
2222
  }
1803
2223
  },
1804
- solid: {
1805
- "*": {
1806
- bg: {
1807
- 0: ["300", "500"],
1808
- 4: ["200", "600"]
1809
- },
1810
- border: {
1811
- 0: ["200", "400"],
1812
- 4: ["100", "500"]
1813
- },
1814
- fg: {
1815
- 0: ["black", "white"],
1816
- 4: ["600", "400"]
2224
+ hovered: {
2225
+ bg: ["600", "300"],
2226
+ border: ["700/0", "300/0"]
2227
+ },
2228
+ pressed: {
2229
+ bg: ["700", "300"]
2230
+ },
2231
+ selected: {
2232
+ bg: ["700", "300"]
2233
+ },
2234
+ disabled: {
2235
+ _hue: "gray",
2236
+ accent: {
2237
+ fg: ["100 70%", "900 70%"]
2238
+ },
2239
+ avatar: {
2240
+ "*": {
2241
+ _blend: ["screen", "multiply"],
2242
+ bg: ["gray/500", "gray/400"],
2243
+ fg: ["white", "black"]
1817
2244
  }
1818
2245
  },
1819
- default: {
1820
- bg: {
1821
- 0: ["200", "800"],
1822
- 4: ["white", "black"]
1823
- },
1824
- border: {
1825
- 0: ["300", "700"],
1826
- 4: ["200", "800"]
2246
+ badge: {
2247
+ "*": {
2248
+ bg: ["gray/700", "gray/300"],
2249
+ fg: ["white", "black"],
2250
+ dot: ["white", "black"],
2251
+ icon: ["white", "black"]
1827
2252
  }
1828
2253
  },
1829
- primary: {
1830
- _hue: "blue"
2254
+ bg: ["300", "600"],
2255
+ code: {
2256
+ bg: ["950", "50"],
2257
+ fg: ["300", "600"]
1831
2258
  },
1832
- suggest: {
1833
- _hue: "purple"
2259
+ fg: ["300", "600"],
2260
+ muted: {
2261
+ bg: ["950", "50"],
2262
+ fg: ["300", "600"]
1834
2263
  },
1835
- positive: {
1836
- _hue: "green"
2264
+ kbd: {
2265
+ bg: ["black", "white"],
2266
+ fg: ["white", "black"],
2267
+ border: ["700", "300"]
1837
2268
  },
1838
- caution: {
1839
- _hue: "yellow"
2269
+ link: {
2270
+ fg: ["100 70%", "900 70%"]
2271
+ }
2272
+ }
2273
+ },
2274
+ default: {
2275
+ "*": {
2276
+ avatar: {
2277
+ "*": {
2278
+ _blend: ["screen", "multiply"],
2279
+ bg: ["500", "400"],
2280
+ fg: ["white", "black"]
2281
+ }
1840
2282
  },
1841
- critical: {
1842
- _hue: "red"
2283
+ bg: ["800", "200"],
2284
+ muted: {
2285
+ bg: ["950", "50"],
2286
+ fg: ["400", "600"]
1843
2287
  }
2288
+ },
2289
+ hovered: {
2290
+ bg: ["900", "100"]
2291
+ },
2292
+ pressed: {
2293
+ bg: ["black", "white"]
2294
+ },
2295
+ selected: {
2296
+ bg: ["black", "white"]
1844
2297
  }
1845
2298
  }
1846
2299
  },
1847
- transparent: {
1848
- variant: {
1849
- tinted: {
1850
- "*": {
1851
- bg: {
1852
- 0: ["black", "gray/50"],
1853
- 4: ["900", "150"]
1854
- },
1855
- border: {
1856
- 0: ["900", "150"],
1857
- 4: ["700", "350"]
1858
- },
1859
- fg: {
1860
- 0: ["150", "black"],
1861
- 4: ["550", "600"]
2300
+ ghost: {
2301
+ "*": {
2302
+ "*": {
2303
+ _blend: ["multiply", "screen"],
2304
+ accent: {
2305
+ fg: ["purple/700 60%", "purple/300 70%"]
2306
+ },
2307
+ avatar: {
2308
+ "*": {
2309
+ _blend: ["screen", "multiply"],
2310
+ bg: ["500", "400"],
2311
+ fg: ["white", "black"]
2312
+ }
2313
+ },
2314
+ badge: {
2315
+ "*": {
2316
+ bg: ["100", "900"],
2317
+ fg: ["600", "400"],
2318
+ dot: ["500", "500"],
2319
+ icon: ["500", "500"]
2320
+ }
2321
+ },
2322
+ bg: ["50", "950"],
2323
+ border: ["100", "900"],
2324
+ code: {
2325
+ bg: ["500 10%", "400 10%"],
2326
+ fg: ["700 60%", "400 60%"]
2327
+ },
2328
+ fg: ["600", "400"],
2329
+ icon: ["700 60%", "300 60%"],
2330
+ kbd: {
2331
+ bg: ["white", "black"],
2332
+ fg: ["600", "400"],
2333
+ border: ["200", "800"]
2334
+ },
2335
+ link: {
2336
+ fg: ["blue/700 60%", "blue/300 60%"]
2337
+ },
2338
+ muted: {
2339
+ bg: ["100", "950"],
2340
+ fg: ["700 60%", "300 60%"]
2341
+ },
2342
+ skeleton: {
2343
+ from: ["100", "900"],
2344
+ to: ["100 50%", "900 50%"]
2345
+ }
2346
+ },
2347
+ hovered: {
2348
+ bg: ["100", "900"],
2349
+ fg: ["700", "300"]
2350
+ },
2351
+ pressed: {
2352
+ bg: ["200", "800"],
2353
+ fg: ["800", "200"]
2354
+ },
2355
+ selected: {
2356
+ bg: ["200", "800"],
2357
+ fg: ["800", "200"]
2358
+ },
2359
+ disabled: {
2360
+ _hue: "gray",
2361
+ accent: {
2362
+ fg: ["200", "800"]
2363
+ },
2364
+ avatar: {
2365
+ "*": {
2366
+ _blend: ["screen", "multiply"],
2367
+ bg: ["gray/100", "gray/900"],
2368
+ fg: ["white", "black"]
2369
+ }
2370
+ },
2371
+ badge: {
2372
+ "*": {
2373
+ _hue: "gray",
2374
+ bg: ["50", "950"],
2375
+ fg: ["gray/200", "gray/800"],
2376
+ dot: ["gray/200", "gray/800"],
2377
+ icon: ["gray/200", "gray/800"]
1862
2378
  }
2379
+ },
2380
+ border: ["100", "900"],
2381
+ code: {
2382
+ bg: ["50", "950"],
2383
+ fg: ["200", "800"]
2384
+ },
2385
+ fg: ["400", "600"],
2386
+ icon: ["300", "700"],
2387
+ muted: {
2388
+ fg: ["300", "700"]
2389
+ },
2390
+ kbd: {
2391
+ bg: ["white", "black"],
2392
+ fg: ["200", "800"],
2393
+ border: ["100", "900"]
2394
+ },
2395
+ link: {
2396
+ fg: ["200", "800"]
1863
2397
  }
1864
2398
  }
2399
+ },
2400
+ positive: {
2401
+ "*": {
2402
+ border: ["600 20%", "800"]
2403
+ }
2404
+ },
2405
+ caution: {
2406
+ "*": {
2407
+ border: ["600 20%", "800"]
2408
+ }
1865
2409
  }
1866
2410
  },
1867
- default: {
1868
- variant: {
1869
- tinted: {
1870
- "*": {
1871
- bg: {
1872
- 0: ["gray/950", "white"],
1873
- 4: ["850", "100"]
1874
- },
1875
- border: {
1876
- 0: ["850", "100"],
1877
- 4: ["650", "300"]
1878
- },
1879
- fg: {
1880
- 0: ["white", "black"],
1881
- 4: ["400", "600"]
2411
+ bleed: {
2412
+ "*": {
2413
+ "*": {
2414
+ _blend: ["multiply", "screen"],
2415
+ accent: {
2416
+ fg: ["purple/700 70%", "purple/300 70%"]
2417
+ },
2418
+ avatar: {
2419
+ "*": {
2420
+ _blend: ["screen", "multiply"],
2421
+ bg: ["500", "400"],
2422
+ fg: ["white", "black"]
2423
+ }
2424
+ },
2425
+ badge: {
2426
+ "*": {
2427
+ bg: ["100", "900"],
2428
+ fg: ["600", "400"],
2429
+ dot: ["500", "500"],
2430
+ icon: ["500", "500"]
2431
+ }
2432
+ },
2433
+ bg: ["white", "black"],
2434
+ border: ["white/0", "black/0"],
2435
+ code: {
2436
+ bg: ["50", "950"],
2437
+ fg: ["700 75%", "300 75%"]
2438
+ },
2439
+ fg: ["700", "300"],
2440
+ icon: ["700 75%", "300 75%"],
2441
+ kbd: {
2442
+ bg: ["white", "black"],
2443
+ fg: ["700", "300"],
2444
+ border: ["200", "800"]
2445
+ },
2446
+ link: {
2447
+ fg: ["blue/700 70%", "blue/300 70%"]
2448
+ },
2449
+ muted: {
2450
+ bg: ["100", "950"],
2451
+ fg: ["700 75%", "300 75%"]
2452
+ },
2453
+ skeleton: {
2454
+ from: ["100", "900"],
2455
+ to: ["100 50%", "900 50%"]
2456
+ }
2457
+ },
2458
+ hovered: {
2459
+ bg: ["50", "900"],
2460
+ fg: ["800", "200"],
2461
+ icon: ["800 70%", "300 70%"]
2462
+ },
2463
+ pressed: {
2464
+ bg: ["100", "800"],
2465
+ fg: ["800", "200"],
2466
+ icon: ["800 70%", "200 70%"]
2467
+ },
2468
+ selected: {
2469
+ bg: ["100", "900"],
2470
+ fg: ["800", "200"],
2471
+ icon: ["800 60%", "200 60%"]
2472
+ },
2473
+ disabled: {
2474
+ _hue: "gray",
2475
+ accent: {
2476
+ fg: ["200", "800"]
2477
+ },
2478
+ avatar: {
2479
+ "*": {
2480
+ _blend: ["screen", "multiply"],
2481
+ bg: ["gray/100", "gray/900"],
2482
+ fg: ["white", "black"]
1882
2483
  }
2484
+ },
2485
+ badge: {
2486
+ "*": {
2487
+ _hue: "gray",
2488
+ bg: ["50", "950"],
2489
+ fg: ["gray/200", "gray/800"],
2490
+ dot: ["gray/200", "gray/800"],
2491
+ icon: ["gray/200", "gray/800"]
2492
+ }
2493
+ },
2494
+ code: {
2495
+ bg: ["50", "950"],
2496
+ fg: ["200", "800"]
2497
+ },
2498
+ fg: ["400", "600"],
2499
+ icon: ["300", "700"],
2500
+ muted: {
2501
+ fg: ["400", "600"]
2502
+ },
2503
+ kbd: {
2504
+ bg: ["white", "black"],
2505
+ fg: ["200", "800"],
2506
+ border: ["100", "900"]
2507
+ },
2508
+ link: {
2509
+ fg: ["200", "800"]
2510
+ }
2511
+ }
2512
+ }
2513
+ }
2514
+ },
2515
+ input: {
2516
+ "*": {
2517
+ "*": {
2518
+ _blend: ["multiply", "screen"],
2519
+ bg: ["white", "black"],
2520
+ border: ["200", "700"],
2521
+ fg: ["black", "200"],
2522
+ muted: {
2523
+ bg: ["50", "950"]
2524
+ },
2525
+ placeholder: ["400", "600"]
2526
+ },
2527
+ hovered: {
2528
+ border: ["300", "700"]
2529
+ },
2530
+ readOnly: {
2531
+ bg: ["50", "950"],
2532
+ border: ["200", "800"],
2533
+ fg: ["800", "200"]
2534
+ },
2535
+ disabled: {
2536
+ bg: ["50", "950"],
2537
+ fg: ["400", "600"],
2538
+ border: ["100", "900"],
2539
+ placeholder: ["200", "800 50%"]
2540
+ }
2541
+ },
2542
+ invalid: {
2543
+ "*": {
2544
+ _hue: "red",
2545
+ bg: ["100", "950"]
2546
+ }
2547
+ }
2548
+ },
2549
+ selectable: {
2550
+ "*": {
2551
+ "*": {
2552
+ _blend: ["multiply", "screen"],
2553
+ accent: {
2554
+ fg: ["purple/700 70%", "purple/300 70%"]
2555
+ },
2556
+ avatar: {
2557
+ "*": {
2558
+ _blend: ["screen", "multiply"],
2559
+ bg: ["500", "400"],
2560
+ fg: ["white", "black"]
2561
+ }
2562
+ },
2563
+ badge: {
2564
+ "*": {
2565
+ bg: ["100", "900"],
2566
+ fg: ["600", "400"],
2567
+ dot: ["500", "500"],
2568
+ icon: ["500", "500"]
2569
+ }
2570
+ },
2571
+ bg: ["white", "black"],
2572
+ border: ["200", "800"],
2573
+ code: {
2574
+ bg: ["50", "950"],
2575
+ fg: ["600", "400"]
2576
+ },
2577
+ fg: ["700", "300"],
2578
+ icon: ["700 75%", "300 75%"],
2579
+ kbd: {
2580
+ bg: ["white", "black"],
2581
+ fg: ["600", "400"],
2582
+ border: ["200", "800"]
2583
+ },
2584
+ link: {
2585
+ fg: ["blue/700 70%", "blue/300 70%"]
2586
+ },
2587
+ muted: {
2588
+ bg: ["50", "950"],
2589
+ fg: ["700 75%", "300 75%"]
2590
+ },
2591
+ skeleton: {
2592
+ from: ["100", "900"],
2593
+ to: ["100 50%", "900 50%"]
2594
+ }
2595
+ },
2596
+ hovered: {
2597
+ bg: ["50", "950"]
2598
+ },
2599
+ pressed: {
2600
+ bg: ["100", "900"]
2601
+ },
2602
+ selected: {
2603
+ _blend: ["screen", "multiply"],
2604
+ accent: {
2605
+ fg: ["purple/300", "purple/700"]
2606
+ },
2607
+ avatar: {
2608
+ "*": {
2609
+ _blend: ["multiply", "screen"],
2610
+ bg: ["white", "black"],
2611
+ fg: ["black", "white"]
2612
+ }
2613
+ },
2614
+ badge: {
2615
+ "*": {
2616
+ bg: ["900", "100"],
2617
+ fg: ["400", "600"],
2618
+ dot: ["500", "500"],
2619
+ icon: ["500", "500"]
1883
2620
  }
2621
+ },
2622
+ bg: ["500", "400"],
2623
+ border: ["500 20%", "400 20%"],
2624
+ code: {
2625
+ bg: ["500 20%", "400 20%"],
2626
+ fg: ["200", "600"]
2627
+ },
2628
+ fg: ["white", "black"],
2629
+ icon: ["100 70%", "900 70%"],
2630
+ kbd: {
2631
+ bg: ["black", "white"],
2632
+ fg: ["200", "600"],
2633
+ border: ["800", "200"]
2634
+ },
2635
+ link: {
2636
+ fg: ["blue/200", "blue/600"]
2637
+ },
2638
+ muted: {
2639
+ bg: ["500 10%", "400 10%"],
2640
+ fg: ["100 70%", "900 70%"]
2641
+ },
2642
+ skeleton: {
2643
+ from: ["900", "100"],
2644
+ to: ["900 50%", "100 50%"]
2645
+ }
2646
+ },
2647
+ disabled: {
2648
+ _hue: "gray",
2649
+ accent: {
2650
+ fg: ["200", "800"]
2651
+ },
2652
+ avatar: {
2653
+ "*": {
2654
+ _blend: ["screen", "multiply"],
2655
+ bg: ["gray/100", "gray/900"],
2656
+ fg: ["white", "black"]
2657
+ }
2658
+ },
2659
+ badge: {
2660
+ "*": {
2661
+ _hue: "gray",
2662
+ bg: ["50", "950"],
2663
+ fg: ["gray/200", "gray/800"],
2664
+ dot: ["gray/200", "gray/800"],
2665
+ icon: ["gray/200", "gray/800"]
2666
+ }
2667
+ },
2668
+ border: ["100", "900"],
2669
+ code: {
2670
+ bg: ["50", "950"],
2671
+ fg: ["200", "800"]
2672
+ },
2673
+ fg: ["200", "800"],
2674
+ icon: ["200", "800"],
2675
+ kbd: {
2676
+ bg: ["white", "black"],
2677
+ fg: ["200", "800"],
2678
+ border: ["100", "900"]
2679
+ },
2680
+ link: {
2681
+ fg: ["200", "800"]
2682
+ },
2683
+ muted: {
2684
+ bg: ["50 50%", "950 50%"],
2685
+ fg: ["200", "800"]
1884
2686
  }
1885
2687
  }
1886
2688
  },
1887
- primary: {
1888
- _hue: "blue"
1889
- },
1890
- suggest: {
1891
- _hue: "purple"
1892
- },
1893
- positive: {
1894
- _hue: "green"
1895
- },
1896
- caution: {
1897
- _hue: "yellow"
2689
+ default: {
2690
+ selected: {
2691
+ _hue: "blue"
2692
+ }
1898
2693
  },
1899
2694
  critical: {
1900
- _hue: "red"
2695
+ disabled: {
2696
+ bg: ["50 50%", "950 50%"]
2697
+ }
1901
2698
  }
2699
+ },
2700
+ syntax: {
2701
+ atrule: ["purple/600", "purple/400"],
2702
+ attrName: ["green/600", "green/400"],
2703
+ attrValue: ["yellow/600", "yellow/400"],
2704
+ attribute: ["yellow/600", "yellow/400"],
2705
+ boolean: ["purple/600", "purple/400"],
2706
+ builtin: ["purple/600", "purple/400"],
2707
+ cdata: ["yellow/600", "yellow/400"],
2708
+ char: ["yellow/600", "yellow/400"],
2709
+ class: ["orange/600", "orange/400"],
2710
+ className: ["cyan/600", "cyan/400"],
2711
+ comment: ["gray/400", "gray/600"],
2712
+ constant: ["purple/600", "purple/400"],
2713
+ deleted: ["red/600", "red/400"],
2714
+ entity: ["red/600", "red/400"],
2715
+ function: ["green/600", "green/400"],
2716
+ hexcode: ["blue/600", "blue/400"],
2717
+ id: ["purple/600", "purple/400"],
2718
+ important: ["purple/600", "purple/400"],
2719
+ inserted: ["yellow/600", "yellow/400"],
2720
+ keyword: ["magenta/600", "magenta/400"],
2721
+ number: ["purple/600", "purple/400"],
2722
+ operator: ["magenta/600", "magenta/400"],
2723
+ property: ["blue/600", "blue/400"],
2724
+ pseudoClass: ["yellow/600", "yellow/400"],
2725
+ pseudoElement: ["yellow/600", "yellow/400"],
2726
+ punctuation: ["gray/600", "gray/400"],
2727
+ regex: ["blue/600", "blue/400"],
2728
+ selector: ["red/600", "red/400"],
2729
+ string: ["yellow/600", "yellow/400"],
2730
+ symbol: ["purple/600", "purple/400"],
2731
+ tag: ["red/600", "red/400"],
2732
+ unit: ["orange/600", "orange/400"],
2733
+ url: ["red/600", "red/400"],
2734
+ variable: ["red/600", "red/400"]
1902
2735
  }
1903
2736
  };
1904
- function merge(...records) {
1905
- return records.filter(Boolean).reduce(_merge, {});
2737
+ function isRecord$1(value) {
2738
+ return !!(value && typeof value == "object" && !Array.isArray(value));
1906
2739
  }
1907
- function _merge(acc, source) {
2740
+ function merge$1(...records) {
2741
+ const _records = records.filter(Boolean);
2742
+ return _records.length === 0 ? {} : _records.reduce(_merge$1, {});
2743
+ }
2744
+ function _merge$1(acc, source) {
1908
2745
  for (const key of Object.keys(source)) {
1909
2746
  const prevValue = acc[key], nextValue = source[key];
1910
- isRecord(prevValue) && isRecord(nextValue) ? acc[key] = merge(prevValue, nextValue) : acc[key] = nextValue;
2747
+ isRecord$1(prevValue) && isRecord$1(nextValue) ? acc[key] = merge$1(prevValue, nextValue) : acc[key] = nextValue;
1911
2748
  }
1912
2749
  return acc;
1913
2750
  }
1914
- function isRecord(value) {
1915
- return value !== null && typeof value == "object" && !Array.isArray(value);
2751
+ function resolveColorTokens(inputTokens) {
2752
+ const tokens = merge$1(defaultColorTokens, inputTokens);
2753
+ return {
2754
+ base: resolveBaseColorTokens(tokens),
2755
+ button: resolveButtonColorTokens(tokens),
2756
+ input: resolveInputColorTokens(tokens),
2757
+ selectable: resolveSelectableColorTokens(tokens),
2758
+ syntax: tokens.syntax
2759
+ };
1916
2760
  }
1917
- const defaultElementTokens = {
1918
- bg: {
1919
- 0: ["950", "50"],
1920
- 4: ["700", "300"]
1921
- },
1922
- border: {
1923
- 0: ["700", "300"],
1924
- 4: ["400", "600"]
1925
- },
1926
- fg: {
1927
- 0: ["100", "900"],
1928
- 4: ["400", "600"]
1929
- }
1930
- };
1931
- function resolveTokens(tokens = {}) {
2761
+ function resolveBaseColorTokens(sparseTokens) {
2762
+ const tokens = {};
2763
+ for (const tone of THEME_COLOR_CARD_TONES)
2764
+ tokens[tone] = resolveBaseColorTones(sparseTokens, tone);
2765
+ return tokens;
2766
+ }
2767
+ function resolveBaseColorTones(inputTokens, tone) {
2768
+ const spec = merge$1(inputTokens?.base?.["*"], inputTokens?.base?.[tone]), hue = spec._hue || inputTokens?.base?.[tone]?._hue || "gray";
1932
2769
  return {
1933
- color: {
1934
- "*": resolveCardColorTokens(tokens.color?.["*"]),
1935
- ...v3_v2.THEME_COLOR_CARD_TONES.reduce((acc, tone) => ({
1936
- ...acc,
1937
- [tone]: resolveCardColorTokens(merge(tokens.color?.["*"], tokens.color?.[tone]))
1938
- }), {})
1939
- }
2770
+ ...spec,
2771
+ _hue: hue,
2772
+ avatar: COLOR_HUES.reduce((acc, hue2) => ({
2773
+ ...acc,
2774
+ [hue2]: merge$1({
2775
+ _hue: hue2
2776
+ }, spec.avatar?.["*"], spec.avatar?.[hue2])
2777
+ }), {}),
2778
+ badge: THEME_COLOR_STATE_TONES.reduce((acc, tone2) => ({
2779
+ ...acc,
2780
+ [tone2]: {
2781
+ _hue: inputTokens?.base?.[tone2]?._hue || hue,
2782
+ ...spec.badge?.["*"],
2783
+ ...spec.badge?.[tone2]
2784
+ }
2785
+ }), {})
1940
2786
  };
1941
2787
  }
1942
- function resolveCardColorTokens(tokens) {
2788
+ function resolveButtonColorTokens(inputTokens) {
2789
+ const tokens = {};
2790
+ for (const mode of THEME_COLOR_BUTTON_MODES)
2791
+ tokens[mode] = resolveButtonToneColorTokens(inputTokens, mode);
2792
+ return tokens;
2793
+ }
2794
+ function resolveButtonToneColorTokens(inputTokens, mode) {
2795
+ const tokens = {};
2796
+ for (const tone of THEME_COLOR_STATE_TONES)
2797
+ tokens[tone] = resolveButtonModeColorTokens(inputTokens, mode, tone);
2798
+ return tokens;
2799
+ }
2800
+ function resolveButtonModeColorTokens(inputTokens, mode, tone) {
2801
+ const tokens = {};
2802
+ for (const state of THEME_COLOR_STATES)
2803
+ tokens[state] = resolveButtonStateColorTokens(inputTokens, tone, mode, state);
2804
+ return tokens;
2805
+ }
2806
+ function resolveButtonStateColorTokens(inputTokens, tone, mode, state) {
2807
+ 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;
1943
2808
  return {
1944
- _hue: tokens?._hue ?? "gray",
1945
- avatar: {
1946
- gray: {
1947
- _hue: tokens?.avatar?.gray?._hue ?? "gray",
1948
- bg: tokens?.avatar?.gray?.bg ?? ["400", "400"],
1949
- fg: tokens?.avatar?.gray?.fg ?? ["900", "900"]
1950
- },
1951
- blue: {
1952
- _hue: tokens?.avatar?.blue?._hue ?? "blue",
1953
- bg: tokens?.avatar?.blue?.bg ?? ["400", "400"],
1954
- fg: tokens?.avatar?.blue?.fg ?? ["900", "900"]
1955
- },
1956
- purple: {
1957
- _hue: tokens?.avatar?.purple?._hue ?? "purple",
1958
- bg: tokens?.avatar?.purple?.bg ?? ["400", "400"],
1959
- fg: tokens?.avatar?.purple?.fg ?? ["900", "900"]
1960
- },
1961
- magenta: {
1962
- _hue: tokens?.avatar?.magenta?._hue ?? "magenta",
1963
- bg: tokens?.avatar?.magenta?.bg ?? ["400", "400"],
1964
- fg: tokens?.avatar?.magenta?.fg ?? ["900", "900"]
1965
- },
1966
- red: {
1967
- _hue: tokens?.avatar?.red?._hue ?? "red",
1968
- bg: tokens?.avatar?.red?.bg ?? ["400", "400"],
1969
- fg: tokens?.avatar?.red?.fg ?? ["900", "900"]
1970
- },
1971
- orange: {
1972
- _hue: tokens?.avatar?.orange?._hue ?? "orange",
1973
- bg: tokens?.avatar?.orange?.bg ?? ["400", "400"],
1974
- fg: tokens?.avatar?.orange?.fg ?? ["900", "900"]
1975
- },
1976
- yellow: {
1977
- _hue: tokens?.avatar?.yellow?._hue ?? "yellow",
1978
- bg: tokens?.avatar?.yellow?.bg ?? ["400", "400"],
1979
- fg: tokens?.avatar?.yellow?.fg ?? ["900", "900"]
1980
- },
1981
- green: {
1982
- _hue: tokens?.avatar?.green?._hue ?? "green",
1983
- bg: tokens?.avatar?.green?.bg ?? ["400", "400"],
1984
- fg: tokens?.avatar?.green?.fg ?? ["900", "900"]
1985
- },
1986
- cyan: {
1987
- _hue: tokens?.avatar?.cyan?._hue ?? "cyan",
1988
- bg: tokens?.avatar?.cyan?.bg ?? ["400", "400"],
1989
- fg: tokens?.avatar?.cyan?.fg ?? ["900", "900"]
2809
+ ...spec,
2810
+ _hue: hue,
2811
+ avatar: COLOR_HUES.reduce((acc, hue2) => ({
2812
+ ...acc,
2813
+ [hue2]: merge$1({
2814
+ _hue: hue2
2815
+ }, spec.avatar?.["*"], spec.avatar?.[hue2])
2816
+ }), {}),
2817
+ badge: THEME_COLOR_STATE_TONES.reduce((acc, tone2) => ({
2818
+ ...acc,
2819
+ [tone2]: {
2820
+ _hue: inputTokens?.base?.[tone2]?._hue || hue,
2821
+ ...spec.badge?.["*"],
2822
+ ...spec.badge?.[tone2]
2823
+ }
2824
+ }), {})
2825
+ };
2826
+ }
2827
+ function resolveInputColorTokens(inputTokens) {
2828
+ const tokens = {};
2829
+ for (const mode of THEME_COLOR_INPUT_MODES)
2830
+ tokens[mode] = resolveInputModeColorTokens(inputTokens, mode);
2831
+ return tokens;
2832
+ }
2833
+ function resolveInputModeColorTokens(inputTokens, mode) {
2834
+ const states = {};
2835
+ for (const state of THEME_COLOR_INPUT_STATES)
2836
+ states[state] = resolveInputStateColorTokens(inputTokens, mode, state);
2837
+ return states;
2838
+ }
2839
+ function resolveInputStateColorTokens(inputTokens, mode, state) {
2840
+ const spec = merge$1(inputTokens?.input?.["*"]?.["*"], inputTokens?.input?.[mode]?.["*"], inputTokens?.input?.["*"]?.[state], inputTokens?.input?.[mode]?.[state]), hue = spec._hue || inputTokens?.input?.[mode]?._hue;
2841
+ return {
2842
+ ...spec,
2843
+ _hue: hue
2844
+ };
2845
+ }
2846
+ function resolveSelectableColorTokens(inputTokens) {
2847
+ const tokens = {};
2848
+ for (const tone of THEME_COLOR_STATE_TONES)
2849
+ tokens[tone] = resolveSelectableToneColorTokens(inputTokens, tone);
2850
+ return tokens;
2851
+ }
2852
+ function resolveSelectableToneColorTokens(inputTokens, tone) {
2853
+ const states = {
2854
+ _hue: inputTokens?.selectable?.[tone]?._hue || inputTokens?.base?.[tone]?._hue
2855
+ };
2856
+ for (const state of THEME_COLOR_STATES)
2857
+ states[state] = resolveSelectableStateColorTokens(inputTokens, tone, state);
2858
+ return states;
2859
+ }
2860
+ function resolveSelectableStateColorTokens(inputTokens, tone, state) {
2861
+ const spec = merge$1(inputTokens?.selectable?.["*"]?.["*"], inputTokens?.selectable?.[tone]?.["*"], inputTokens?.selectable?.["*"]?.[state], inputTokens?.selectable?.[tone]?.[state]), hue = spec._hue || inputTokens?.base?.[tone]?._hue;
2862
+ return {
2863
+ ...spec,
2864
+ _hue: hue,
2865
+ avatar: COLOR_HUES.reduce((acc, hue2) => ({
2866
+ ...acc,
2867
+ [hue2]: merge$1({
2868
+ _hue: hue2
2869
+ }, spec.avatar?.["*"], spec.avatar?.[hue2])
2870
+ }), {}),
2871
+ badge: THEME_COLOR_STATE_TONES.reduce((acc, tone2) => ({
2872
+ ...acc,
2873
+ [tone2]: {
2874
+ _hue: inputTokens?.base?.[tone2]?._hue || hue,
2875
+ ...spec.badge?.["*"],
2876
+ ...spec.badge?.[tone2]
1990
2877
  }
2878
+ }), {})
2879
+ };
2880
+ }
2881
+ function buildColorTheme(config) {
2882
+ const resolvedConfig = {
2883
+ color: resolveColorTokens(config?.color)
2884
+ };
2885
+ return {
2886
+ light: buildColorScheme({
2887
+ scheme: "light"
2888
+ }, resolvedConfig),
2889
+ dark: buildColorScheme({
2890
+ scheme: "dark"
2891
+ }, resolvedConfig)
2892
+ };
2893
+ }
2894
+ function buildColorScheme(options, config) {
2895
+ const {
2896
+ scheme
2897
+ } = options, colorScheme = {};
2898
+ for (const tone of THEME_COLOR_CARD_TONES)
2899
+ colorScheme[tone] = buildCardColorTheme({
2900
+ scheme,
2901
+ tone
2902
+ }, config);
2903
+ return colorScheme;
2904
+ }
2905
+ function buildCardColorTheme(options, config) {
2906
+ const {
2907
+ scheme,
2908
+ tone
2909
+ } = options, tokens = config?.color?.base?.[tone], context = {
2910
+ hue: tokens?._hue || "gray",
2911
+ scheme
2912
+ };
2913
+ return {
2914
+ _blend: (tokens?._blend || ["multiply", "screen"])[scheme === "light" ? 0 : 1],
2915
+ _dark: scheme === "dark",
2916
+ accent: {
2917
+ fg: resolveColorTokenValue(context, tokens?.accent?.fg)
2918
+ },
2919
+ avatar: buildAvatarColorTheme({
2920
+ scheme
2921
+ }, tokens),
2922
+ backdrop: resolveColorTokenValue(context, tokens?.backdrop),
2923
+ badge: buildBadgeColorTheme(tokens?.badge, {
2924
+ scheme
2925
+ }, config),
2926
+ bg: resolveColorTokenValue(context, tokens?.bg),
2927
+ border: resolveColorTokenValue(context, tokens?.border),
2928
+ button: buildButtonColorTheme({
2929
+ scheme,
2930
+ tone
2931
+ }, config),
2932
+ code: {
2933
+ bg: resolveColorTokenValue(context, tokens?.code?.bg),
2934
+ fg: resolveColorTokenValue(context, tokens?.code?.fg)
2935
+ },
2936
+ fg: resolveColorTokenValue(context, tokens?.fg),
2937
+ focusRing: resolveColorTokenValue(context, tokens?.focusRing),
2938
+ icon: resolveColorTokenValue(context, tokens?.icon),
2939
+ input: buildInputColorTheme({
2940
+ scheme,
2941
+ tone
2942
+ }, config),
2943
+ kbd: {
2944
+ bg: resolveColorTokenValue(context, tokens?.kbd?.bg),
2945
+ fg: resolveColorTokenValue(context, tokens?.kbd?.fg),
2946
+ border: resolveColorTokenValue(context, tokens?.kbd?.border)
1991
2947
  },
1992
- backdrop: tokens?.backdrop ?? ["900", "100"],
1993
- focusRing: tokens?.focusRing ?? ["500", "500"],
1994
2948
  link: {
1995
- fg: tokens?.link?.fg ?? ["400", "600"]
2949
+ fg: resolveColorTokenValue(context, tokens?.link?.fg)
1996
2950
  },
1997
- shadow: {
1998
- outline: tokens?.shadow?.outline ?? ["500", "500"],
1999
- umbra: tokens?.shadow?.umbra ?? ["500", "500"],
2000
- penumbra: tokens?.shadow?.penumbra ?? ["500", "500"],
2001
- ambient: tokens?.shadow?.ambient ?? ["500", "500"]
2951
+ muted: {
2952
+ bg: resolveColorTokenValue(context, tokens?.muted?.bg),
2953
+ fg: resolveColorTokenValue(context, tokens?.muted?.fg)
2002
2954
  },
2955
+ selectable: buildSelectableColorTheme({
2956
+ scheme,
2957
+ tone
2958
+ }, config),
2959
+ shadow: buildShadowColorTheme({
2960
+ scheme,
2961
+ tone
2962
+ }, config),
2003
2963
  skeleton: {
2004
- from: tokens?.skeleton?.from ?? ["900", "100"],
2005
- to: tokens?.skeleton?.to ?? ["950", "50"]
2006
- },
2007
- token: {
2008
- atrule: tokens?.token?.atrule ?? ["400", "600"],
2009
- attribute: tokens?.token?.attribute ?? ["400", "600"],
2010
- attrName: tokens?.token?.attrName ?? ["400", "600"],
2011
- attrValue: tokens?.token?.attrValue ?? ["400", "600"],
2012
- boolean: tokens?.token?.boolean ?? ["400", "600"],
2013
- builtin: tokens?.token?.builtin ?? ["400", "600"],
2014
- cdata: tokens?.token?.cdata ?? ["400", "600"],
2015
- char: tokens?.token?.char ?? ["400", "600"],
2016
- class: tokens?.token?.class ?? ["400", "600"],
2017
- className: tokens?.token?.className ?? ["400", "600"],
2018
- comment: tokens?.token?.comment ?? ["600", "400"],
2019
- constant: tokens?.token?.constant ?? ["400", "600"],
2020
- deleted: tokens?.token?.deleted ?? ["400", "600"],
2021
- doctype: tokens?.token?.doctype ?? ["400", "600"],
2022
- entity: tokens?.token?.entity ?? ["400", "600"],
2023
- function: tokens?.token?.function ?? ["400", "600"],
2024
- hexcode: tokens?.token?.hexcode ?? ["400", "600"],
2025
- id: tokens?.token?.id ?? ["400", "600"],
2026
- important: tokens?.token?.important ?? ["400", "600"],
2027
- inserted: tokens?.token?.inserted ?? ["400", "600"],
2028
- keyword: tokens?.token?.keyword ?? ["400", "600"],
2029
- number: tokens?.token?.number ?? ["400", "600"],
2030
- operator: tokens?.token?.operator ?? ["400", "600"],
2031
- prolog: tokens?.token?.prolog ?? ["400", "600"],
2032
- property: tokens?.token?.property ?? ["400", "600"],
2033
- pseudoClass: tokens?.token?.pseudoClass ?? ["400", "600"],
2034
- pseudoElement: tokens?.token?.pseudoElement ?? ["400", "600"],
2035
- punctuation: tokens?.token?.punctuation ?? ["400", "600"],
2036
- regex: tokens?.token?.regex ?? ["400", "600"],
2037
- selector: tokens?.token?.selector ?? ["400", "600"],
2038
- string: tokens?.token?.string ?? ["400", "600"],
2039
- symbol: tokens?.token?.symbol ?? ["400", "600"],
2040
- tag: tokens?.token?.tag ?? ["400", "600"],
2041
- unit: tokens?.token?.unit ?? ["400", "600"],
2042
- url: tokens?.token?.url ?? ["400", "600"],
2043
- variable: tokens?.token?.variable ?? ["400", "600"]
2964
+ from: resolveColorTokenValue(context, tokens?.skeleton?.from),
2965
+ to: resolveColorTokenValue(context, tokens?.skeleton?.to)
2044
2966
  },
2045
- variant: {
2046
- solid: {
2047
- "*": resolveElementTokens(tokens?.variant?.solid?.["*"]),
2048
- ...v3_v2.THEME_COLOR_STATE_TONES.reduce((acc, tone) => (acc[tone] = resolveElementTokens(merge(tokens, tokens?.variant?.solid?.["*"], tokens?.variant?.solid?.[tone])), acc), {})
2049
- },
2050
- tinted: {
2051
- "*": resolveElementTokens(tokens?.variant?.tinted?.["*"]),
2052
- ...v3_v2.THEME_COLOR_STATE_TONES.reduce((acc, tone) => (acc[tone] = resolveElementTokens(merge(tokens, tokens?.variant?.tinted?.["*"], tokens?.variant?.tinted?.[tone])), acc), {})
2053
- }
2054
- }
2967
+ syntax: buildSyntaxColorTheme({
2968
+ scheme
2969
+ }, config)
2055
2970
  };
2056
2971
  }
2057
- function resolveElementTokens(tokens) {
2972
+ function buildShadowColorTheme(options, config) {
2973
+ const {
2974
+ scheme,
2975
+ tone
2976
+ } = options, tokens = config?.color?.base?.[tone], context = {
2977
+ hue: tokens?._hue || "gray",
2978
+ scheme
2979
+ };
2058
2980
  return {
2059
- _hue: tokens?._hue ?? "gray",
2060
- bg: {
2061
- 0: tokens?.bg?.[0] ?? defaultElementTokens.bg[0],
2062
- 4: tokens?.bg?.[4] ?? defaultElementTokens.bg[4]
2063
- },
2064
- border: {
2065
- 0: tokens?.border?.[0] ?? defaultElementTokens.border[0],
2066
- 4: tokens?.border?.[4] ?? defaultElementTokens.border[4]
2067
- },
2068
- fg: {
2069
- 0: tokens?.fg?.[0] ?? defaultElementTokens.fg[0],
2070
- 4: tokens?.fg?.[4] ?? defaultElementTokens.fg[4]
2071
- }
2981
+ outline: resolveColorTokenValue(context, tokens?.shadow?.outline),
2982
+ umbra: resolveColorTokenValue(context, tokens?.shadow?.umbra),
2983
+ penumbra: resolveColorTokenValue(context, tokens?.shadow?.penumbra),
2984
+ ambient: resolveColorTokenValue(context, tokens?.shadow?.ambient)
2072
2985
  };
2073
2986
  }
2074
- function buildTheme_v3(options) {
2987
+ function buildAvatarColorTheme(options, stateTokens) {
2075
2988
  const {
2076
- v2
2077
- } = options ?? {}, tokens = resolveTokens(options?.tokens ?? defaultTokens);
2989
+ scheme
2990
+ } = options;
2078
2991
  return {
2079
- _version: 3,
2080
- _palette: options?.palette ?? defaultPalette,
2081
- _tokens: tokens,
2082
- avatar: v2?.avatar ?? defaultThemeConfig.avatar,
2083
- button: v2?.button ?? defaultThemeConfig.button,
2084
- card: v2?.card ?? defaultThemeConfig.card,
2085
- color: buildColor_v3(tokens.color),
2086
- container: v2?.container ?? defaultThemeConfig.container,
2087
- font: v2?.font ?? defaultThemeFonts,
2088
- input: v2?.input ?? defaultThemeConfig.input,
2089
- layer: v2?.layer ?? defaultThemeConfig.layer,
2090
- media: v2?.media ?? defaultThemeConfig.media,
2091
- radius: v2?.radius ?? defaultThemeConfig.radius,
2092
- shadow: v2?.shadow ?? defaultThemeConfig.shadow,
2093
- space: v2?.space ?? defaultThemeConfig.space
2992
+ gray: _buildAvatarColorTheme({
2993
+ color: "gray",
2994
+ scheme
2995
+ }, stateTokens),
2996
+ blue: _buildAvatarColorTheme({
2997
+ color: "blue",
2998
+ scheme
2999
+ }, stateTokens),
3000
+ purple: _buildAvatarColorTheme({
3001
+ color: "purple",
3002
+ scheme
3003
+ }, stateTokens),
3004
+ magenta: _buildAvatarColorTheme({
3005
+ color: "magenta",
3006
+ scheme
3007
+ }, stateTokens),
3008
+ red: _buildAvatarColorTheme({
3009
+ color: "red",
3010
+ scheme
3011
+ }, stateTokens),
3012
+ orange: _buildAvatarColorTheme({
3013
+ color: "orange",
3014
+ scheme
3015
+ }, stateTokens),
3016
+ yellow: _buildAvatarColorTheme({
3017
+ color: "yellow",
3018
+ scheme
3019
+ }, stateTokens),
3020
+ green: _buildAvatarColorTheme({
3021
+ color: "green",
3022
+ scheme
3023
+ }, stateTokens),
3024
+ cyan: _buildAvatarColorTheme({
3025
+ color: "cyan",
3026
+ scheme
3027
+ }, stateTokens)
2094
3028
  };
2095
3029
  }
2096
- const cache$4 = /* @__PURE__ */ new WeakMap();
2097
- function v2_v0(v2, v3) {
2098
- const cachedTheme = cache$4.get(v2);
2099
- if (cachedTheme) return cachedTheme;
3030
+ function _buildAvatarColorTheme(options, stateTokens) {
2100
3031
  const {
2101
- avatar,
2102
- button,
2103
3032
  color: color2,
2104
- container,
2105
- font: fonts,
2106
- input,
2107
- media,
2108
- radius,
2109
- shadow: shadows,
2110
- space,
2111
- style: styles
2112
- } = v2;
3033
+ scheme
3034
+ } = options, tokens = stateTokens?.avatar?.[color2], context = {
3035
+ hue: tokens?._hue || "gray",
3036
+ scheme
3037
+ };
2113
3038
  return {
2114
- _version: 0,
2115
- avatar,
2116
- button,
2117
- container,
2118
- color: {
2119
- light: {
2120
- transparent: themeColor_v2_v0(color2.light.transparent),
2121
- default: themeColor_v2_v0(color2.light.default),
2122
- primary: themeColor_v2_v0(color2.light.primary),
2123
- positive: themeColor_v2_v0(color2.light.positive),
2124
- caution: themeColor_v2_v0(color2.light.caution),
2125
- critical: themeColor_v2_v0(color2.light.critical)
2126
- },
2127
- dark: {
2128
- transparent: themeColor_v2_v0(color2.dark.transparent),
2129
- default: themeColor_v2_v0(color2.dark.default),
2130
- primary: themeColor_v2_v0(color2.dark.primary),
2131
- positive: themeColor_v2_v0(color2.dark.positive),
2132
- caution: themeColor_v2_v0(color2.dark.caution),
2133
- critical: themeColor_v2_v0(color2.dark.critical)
2134
- }
2135
- },
2136
- focusRing: input.text.focusRing,
2137
- fonts,
2138
- input,
2139
- media,
2140
- radius,
2141
- shadows,
2142
- space,
2143
- styles,
2144
- v2,
2145
- v3
3039
+ _blend: (tokens?._blend || ["screen", "multiply"])[scheme === "light" ? 0 : 1],
3040
+ bg: resolveColorTokenValue(context, tokens?.bg),
3041
+ fg: resolveColorTokenValue(context, tokens?.fg)
3042
+ };
3043
+ }
3044
+ function buildBadgeColorTheme(tokens, options, config) {
3045
+ const {
3046
+ scheme
3047
+ } = options, colorBadge = {};
3048
+ for (const tone of THEME_COLOR_STATE_TONES)
3049
+ colorBadge[tone] = _buildBadgeColorTheme(tokens, {
3050
+ scheme,
3051
+ tone
3052
+ }, config);
3053
+ return colorBadge;
3054
+ }
3055
+ function _buildBadgeColorTheme(parentTokens, options, config) {
3056
+ const {
3057
+ scheme,
3058
+ tone
3059
+ } = options, tokens = parentTokens?.[tone], context = {
3060
+ hue: tokens?._hue || config?.color?.base?.[tone]?._hue || "gray",
3061
+ scheme
3062
+ };
3063
+ return {
3064
+ bg: resolveColorTokenValue(context, tokens?.bg),
3065
+ fg: resolveColorTokenValue(context, tokens?.fg),
3066
+ dot: resolveColorTokenValue(context, tokens?.dot),
3067
+ icon: resolveColorTokenValue(context, tokens?.icon)
3068
+ };
3069
+ }
3070
+ function buildButtonColorTheme(options, config) {
3071
+ const {
3072
+ scheme,
3073
+ tone: cardTone
3074
+ } = options, modes = {};
3075
+ for (const mode of THEME_COLOR_BUTTON_MODES)
3076
+ modes[mode] = buildButtonTonesColorTheme({
3077
+ cardTone,
3078
+ scheme,
3079
+ mode
3080
+ }, config);
3081
+ return modes;
3082
+ }
3083
+ function buildButtonTonesColorTheme(options, config) {
3084
+ const {
3085
+ cardTone,
3086
+ mode,
3087
+ scheme
3088
+ } = options, tones2 = {};
3089
+ for (const tone of THEME_COLOR_STATE_TONES)
3090
+ tones2[tone] = buildButtonStatesColorTheme({
3091
+ cardTone,
3092
+ mode,
3093
+ scheme,
3094
+ tone
3095
+ }, config);
3096
+ return tones2;
3097
+ }
3098
+ function buildButtonStatesColorTheme(options, config) {
3099
+ const {
3100
+ cardTone,
3101
+ mode,
3102
+ scheme,
3103
+ tone
3104
+ } = options, states = {};
3105
+ for (const state of THEME_COLOR_STATES)
3106
+ states[state] = buildButtonStateColorTheme({
3107
+ cardTone,
3108
+ mode,
3109
+ tone,
3110
+ scheme,
3111
+ state
3112
+ }, config);
3113
+ return states;
3114
+ }
3115
+ function buildButtonStateColorTheme(options, config) {
3116
+ const {
3117
+ cardTone,
3118
+ mode,
3119
+ tone,
3120
+ scheme,
3121
+ state
3122
+ } = 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 = {
3123
+ hue,
3124
+ scheme
2146
3125
  };
2147
- }
2148
- function themeColor_v2_v0(color_v2) {
2149
3126
  return {
2150
- base: {
2151
- bg: color_v2.bg,
2152
- fg: color_v2.fg,
2153
- border: color_v2.border,
2154
- focusRing: color_v2.focusRing,
2155
- shadow: color_v2.shadow
3127
+ _blend: blendMode[scheme === "light" ? 0 : 1],
3128
+ accent: {
3129
+ fg: resolveColorTokenValue(context, tokens?.accent?.fg)
2156
3130
  },
2157
- button: color_v2.button,
2158
- card: color_v2.selectable.default,
2159
- dark: color_v2._dark,
2160
- input: {
2161
- default: inputStatesThemeColor_v2_v0(color_v2.input.default),
2162
- invalid: inputStatesThemeColor_v2_v0(color_v2.input.invalid)
3131
+ avatar: buildAvatarColorTheme({
3132
+ scheme
3133
+ }, tokens),
3134
+ badge: buildBadgeColorTheme(tokens?.badge, {
3135
+ scheme
3136
+ }, config),
3137
+ bg: resolveColorTokenValue(context, tokens?.bg),
3138
+ border: resolveColorTokenValue(context, tokens?.border),
3139
+ code: {
3140
+ bg: resolveColorTokenValue(context, tokens?.code?.bg),
3141
+ fg: resolveColorTokenValue(context, tokens?.code?.fg)
2163
3142
  },
3143
+ fg: resolveColorTokenValue(context, tokens?.fg),
3144
+ icon: resolveColorTokenValue(context, tokens?.icon),
2164
3145
  muted: {
2165
- ...color_v2.button.ghost,
2166
- transparent: color_v2.button.ghost.default
3146
+ bg: resolveColorTokenValue(context, tokens?.muted?.bg),
3147
+ fg: resolveColorTokenValue(context, tokens?.muted?.fg)
2167
3148
  },
2168
- solid: {
2169
- ...color_v2.button.default,
2170
- transparent: color_v2.button.default.default
3149
+ kbd: {
3150
+ bg: resolveColorTokenValue(context, tokens?.kbd?.bg),
3151
+ fg: resolveColorTokenValue(context, tokens?.kbd?.fg),
3152
+ border: resolveColorTokenValue(context, tokens?.kbd?.border)
2171
3153
  },
2172
- selectable: color_v2.selectable,
2173
- spot: {
2174
- gray: color_v2.avatar.gray.bg,
2175
- blue: color_v2.avatar.blue.bg,
2176
- purple: color_v2.avatar.purple.bg,
2177
- magenta: color_v2.avatar.magenta.bg,
2178
- red: color_v2.avatar.red.bg,
2179
- orange: color_v2.avatar.orange.bg,
2180
- yellow: color_v2.avatar.yellow.bg,
2181
- green: color_v2.avatar.green.bg,
2182
- cyan: color_v2.avatar.cyan.bg
3154
+ link: {
3155
+ fg: resolveColorTokenValue(context, tokens?.link?.fg)
2183
3156
  },
2184
- syntax: color_v2.syntax
3157
+ skeleton: {
3158
+ from: resolveColorTokenValue(context, tokens?.skeleton?.from),
3159
+ to: resolveColorTokenValue(context, tokens?.skeleton?.to)
3160
+ }
2185
3161
  };
2186
3162
  }
2187
- function inputStatesThemeColor_v2_v0(t) {
3163
+ function buildInputColorTheme(options, config) {
3164
+ const {
3165
+ scheme,
3166
+ tone
3167
+ } = options;
2188
3168
  return {
2189
- enabled: inputStateThemeColor_v2_v0(t.enabled),
2190
- disabled: inputStateThemeColor_v2_v0(t.disabled),
2191
- readOnly: inputStateThemeColor_v2_v0(t.readOnly),
2192
- hovered: inputStateThemeColor_v2_v0(t.hovered)
3169
+ default: buildInputStatesColorTheme({
3170
+ mode: "default",
3171
+ scheme,
3172
+ tone
3173
+ }, config),
3174
+ invalid: buildInputStatesColorTheme({
3175
+ mode: "invalid",
3176
+ scheme,
3177
+ tone
3178
+ }, config)
2193
3179
  };
2194
3180
  }
2195
- function inputStateThemeColor_v2_v0(t) {
3181
+ function buildInputStatesColorTheme(options, config) {
3182
+ const {
3183
+ mode,
3184
+ scheme,
3185
+ tone
3186
+ } = options;
2196
3187
  return {
2197
- bg: t.bg,
2198
- bg2: t.muted.bg,
2199
- border: t.border,
2200
- fg: t.fg,
2201
- placeholder: t.placeholder
3188
+ enabled: buildInputStateColorTheme({
3189
+ mode,
3190
+ scheme,
3191
+ state: "enabled",
3192
+ cardTone: tone
3193
+ }, config),
3194
+ hovered: buildInputStateColorTheme({
3195
+ mode,
3196
+ scheme,
3197
+ state: "hovered",
3198
+ cardTone: tone
3199
+ }, config),
3200
+ readOnly: buildInputStateColorTheme({
3201
+ mode,
3202
+ scheme,
3203
+ state: "readOnly",
3204
+ cardTone: tone
3205
+ }, config),
3206
+ disabled: buildInputStateColorTheme({
3207
+ mode,
3208
+ scheme,
3209
+ state: "disabled",
3210
+ cardTone: tone
3211
+ }, config)
2202
3212
  };
2203
3213
  }
2204
- function buildTheme(_config) {
2205
- const v3 = buildTheme_v3({
2206
- v2: _config
2207
- });
2208
- return v2_v0(v3_v2.v3_v2(v3), v3);
3214
+ function buildInputStateColorTheme(options, config) {
3215
+ const {
3216
+ cardTone,
3217
+ mode,
3218
+ scheme,
3219
+ state
3220
+ } = options, cardTokens = config?.color?.base?.[cardTone], tokens = config?.color?.input?.[mode]?.[state], hue = tokens?._hue || cardTokens?._hue || "gray", blendMode = tokens?._blend || ["screen", "multiply"], context = {
3221
+ hue,
3222
+ scheme
3223
+ };
3224
+ return {
3225
+ _blend: blendMode[scheme === "light" ? 0 : 1],
3226
+ bg: resolveColorTokenValue(context, tokens?.bg),
3227
+ border: resolveColorTokenValue(context, tokens?.border),
3228
+ fg: resolveColorTokenValue(context, tokens?.fg),
3229
+ muted: {
3230
+ bg: resolveColorTokenValue(context, tokens?.muted?.bg)
3231
+ },
3232
+ placeholder: resolveColorTokenValue(context, tokens?.placeholder)
3233
+ };
3234
+ }
3235
+ function buildSelectableColorTheme(options, config) {
3236
+ const {
3237
+ scheme,
3238
+ tone: cardTone
3239
+ } = options, tones2 = {};
3240
+ for (const tone of THEME_COLOR_STATE_TONES)
3241
+ tones2[tone] = buildSelectableStatesColorTheme({
3242
+ cardTone,
3243
+ scheme,
3244
+ tone
3245
+ }, config);
3246
+ return tones2;
3247
+ }
3248
+ function buildSelectableStatesColorTheme(options, config) {
3249
+ const {
3250
+ cardTone,
3251
+ scheme,
3252
+ tone
3253
+ } = options, states = {};
3254
+ for (const state of THEME_COLOR_STATES)
3255
+ states[state] = buildSelectableStateColorTheme({
3256
+ cardTone,
3257
+ tone,
3258
+ scheme,
3259
+ state
3260
+ }, config);
3261
+ return states;
3262
+ }
3263
+ function buildSelectableStateColorTheme(options, config) {
3264
+ const {
3265
+ cardTone,
3266
+ scheme,
3267
+ state,
3268
+ tone
3269
+ } = options, cardTokens = config?.color?.base?.[cardTone], tokens = config?.color?.selectable?.[tone]?.[state], hue = tokens?._hue || cardTokens?._hue || "gray", blendMode = tokens?._blend || ["screen", "multiply"], context = {
3270
+ hue,
3271
+ scheme
3272
+ };
3273
+ return {
3274
+ _blend: blendMode[scheme === "light" ? 0 : 1],
3275
+ accent: {
3276
+ fg: resolveColorTokenValue(context, tokens?.accent?.fg)
3277
+ },
3278
+ avatar: buildAvatarColorTheme({
3279
+ scheme
3280
+ }, tokens),
3281
+ badge: buildBadgeColorTheme(tokens?.badge, {
3282
+ scheme
3283
+ }, config),
3284
+ bg: resolveColorTokenValue(context, tokens?.bg),
3285
+ border: resolveColorTokenValue(context, tokens?.border),
3286
+ code: {
3287
+ bg: resolveColorTokenValue(context, tokens?.code?.bg),
3288
+ fg: resolveColorTokenValue(context, tokens?.code?.fg)
3289
+ },
3290
+ fg: resolveColorTokenValue(context, tokens?.fg),
3291
+ icon: resolveColorTokenValue(context, tokens?.icon),
3292
+ muted: {
3293
+ bg: resolveColorTokenValue(context, tokens?.muted?.bg),
3294
+ fg: resolveColorTokenValue(context, tokens?.muted?.fg)
3295
+ },
3296
+ kbd: {
3297
+ bg: resolveColorTokenValue(context, tokens?.kbd?.bg),
3298
+ fg: resolveColorTokenValue(context, tokens?.kbd?.fg),
3299
+ border: resolveColorTokenValue(context, tokens?.kbd?.border)
3300
+ },
3301
+ link: {
3302
+ fg: resolveColorTokenValue(context, tokens?.link?.fg)
3303
+ },
3304
+ skeleton: {
3305
+ from: resolveColorTokenValue(context, tokens?.skeleton?.from),
3306
+ to: resolveColorTokenValue(context, tokens?.skeleton?.to)
3307
+ }
3308
+ };
2209
3309
  }
3310
+ function buildSyntaxColorTheme(options, config) {
3311
+ const {
3312
+ scheme
3313
+ } = options, tokens = config?.color?.syntax, context = {
3314
+ hue: "gray",
3315
+ scheme
3316
+ };
3317
+ return {
3318
+ atrule: resolveColorTokenValue(context, tokens?.atrule),
3319
+ attrName: resolveColorTokenValue(context, tokens?.attrName),
3320
+ attrValue: resolveColorTokenValue(context, tokens?.attrValue),
3321
+ attribute: resolveColorTokenValue(context, tokens?.attribute),
3322
+ boolean: resolveColorTokenValue(context, tokens?.boolean),
3323
+ builtin: resolveColorTokenValue(context, tokens?.builtin),
3324
+ cdata: resolveColorTokenValue(context, tokens?.cdata),
3325
+ char: resolveColorTokenValue(context, tokens?.char),
3326
+ class: resolveColorTokenValue(context, tokens?.class),
3327
+ className: resolveColorTokenValue(context, tokens?.className),
3328
+ comment: resolveColorTokenValue(context, tokens?.comment),
3329
+ constant: resolveColorTokenValue(context, tokens?.constant),
3330
+ deleted: resolveColorTokenValue(context, tokens?.deleted),
3331
+ doctype: resolveColorTokenValue(context, tokens?.doctype),
3332
+ entity: resolveColorTokenValue(context, tokens?.entity),
3333
+ function: resolveColorTokenValue(context, tokens?.function),
3334
+ hexcode: resolveColorTokenValue(context, tokens?.hexcode),
3335
+ id: resolveColorTokenValue(context, tokens?.id),
3336
+ important: resolveColorTokenValue(context, tokens?.important),
3337
+ inserted: resolveColorTokenValue(context, tokens?.inserted),
3338
+ keyword: resolveColorTokenValue(context, tokens?.keyword),
3339
+ number: resolveColorTokenValue(context, tokens?.number),
3340
+ operator: resolveColorTokenValue(context, tokens?.operator),
3341
+ prolog: resolveColorTokenValue(context, tokens?.prolog),
3342
+ property: resolveColorTokenValue(context, tokens?.property),
3343
+ pseudoClass: resolveColorTokenValue(context, tokens?.pseudoClass),
3344
+ pseudoElement: resolveColorTokenValue(context, tokens?.pseudoElement),
3345
+ punctuation: resolveColorTokenValue(context, tokens?.punctuation),
3346
+ regex: resolveColorTokenValue(context, tokens?.regex),
3347
+ selector: resolveColorTokenValue(context, tokens?.selector),
3348
+ string: resolveColorTokenValue(context, tokens?.string),
3349
+ symbol: resolveColorTokenValue(context, tokens?.symbol),
3350
+ tag: resolveColorTokenValue(context, tokens?.tag),
3351
+ unit: resolveColorTokenValue(context, tokens?.unit),
3352
+ url: resolveColorTokenValue(context, tokens?.url),
3353
+ variable: resolveColorTokenValue(context, tokens?.variable)
3354
+ };
3355
+ }
3356
+ const defaultColorPalette = color;
2210
3357
  function mixChannel(b, s, weight) {
2211
3358
  const delta = (s - b) * weight;
2212
3359
  return b + delta;
@@ -2238,9 +3385,18 @@ function screen(b, s) {
2238
3385
  b: screenChannel(b.b / 255, s.b / 255) * 255
2239
3386
  };
2240
3387
  }
3388
+ function lerp(x, y, a) {
3389
+ return x * (1 - a) + y * a;
3390
+ }
3391
+ function invlerp(x, y, a) {
3392
+ return clamp((a - x) / (y - x));
3393
+ }
2241
3394
  function clamp(a, min = 0, max = 1) {
2242
3395
  return Math.min(max, Math.max(min, a));
2243
3396
  }
3397
+ function range(x1, y1, x2, y2, a) {
3398
+ return lerp(x2, y2, invlerp(x1, y1, a));
3399
+ }
2244
3400
  function round(value) {
2245
3401
  return Math.round(value);
2246
3402
  }
@@ -2354,528 +3510,1175 @@ function rgba(color2, a) {
2354
3510
  const rgb = parseColor(color2);
2355
3511
  return `rgba(${rgb.r},${rgb.g},${rgb.b},${a})`;
2356
3512
  }
2357
- 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 = ["*", ...v3_v2.THEME_COLOR_AVATAR_COLORS], COLOR_CONFIG_CARD_TONES = ["*", ...v3_v2.THEME_COLOR_CARD_TONES], COLOR_CONFIG_STATE_TONES = ["*", ...v3_v2.THEME_COLOR_STATE_TONES], COLOR_CONFIG_STATES = ["*", ...v3_v2.THEME_COLOR_STATES], COLOR_CONFIG_INPUT_MODES = ["*", ...v3_v2.THEME_COLOR_INPUT_MODES], COLOR_CONFIG_INPUT_STATES = ["*", ...v3_v2.THEME_COLOR_INPUT_STATES];
2358
- function parseTokenKey(str) {
2359
- const segments = str.split("/"), segment0 = segments.shift() || "";
2360
- if (isColorConfigBaseTone(segment0)) {
2361
- const key = segments.join("/");
2362
- if (isColorConfigBaseKey(key))
2363
- return {
2364
- type: "base",
2365
- tone: segment0,
2366
- key
2367
- };
2368
- if (isColorConfigBlendKey(key))
2369
- return {
2370
- type: "base",
2371
- tone: segment0,
2372
- key
2373
- };
2374
- }
2375
- if (segment0 === "button") {
2376
- const segment1 = segments.shift() || "";
2377
- if (isColorConfigStateTone(segment1)) {
2378
- const segment2 = segments.shift() || "";
2379
- if (isColorButtonMode(segment2)) {
2380
- const key = segments.join("/");
2381
- if (isColorConfigStateKey(key))
2382
- return {
2383
- type: "button",
2384
- tone: segment1,
2385
- mode: segment2,
2386
- key
2387
- };
2388
- if (isColorConfigBlendKey(key))
2389
- return {
2390
- type: "button",
2391
- tone: segment1,
2392
- mode: segment2,
2393
- key
2394
- };
2395
- }
3513
+ const RGB_RANGE = [0, 255];
3514
+ function mixThemeColor(value, options) {
3515
+ const {
3516
+ blendMode
3517
+ } = options, color2 = parseColor(value), black2 = parseColor(options.black), white2 = parseColor(options.white), bg = options.bg ? parseColor(options.bg) : blendMode === "multiply" ? white2 : black2, paletteRange = {
3518
+ r: [black2.r, white2.r],
3519
+ g: [black2.g, white2.g],
3520
+ b: [black2.b, white2.b]
3521
+ }, convertedBgColor = {
3522
+ r: clamp(range(...paletteRange.r, ...RGB_RANGE, bg.r), ...RGB_RANGE),
3523
+ g: clamp(range(...paletteRange.g, ...RGB_RANGE, bg.g), ...RGB_RANGE),
3524
+ b: clamp(range(...paletteRange.b, ...RGB_RANGE, bg.b), ...RGB_RANGE)
3525
+ }, convertedColor = {
3526
+ r: clamp(range(...paletteRange.r, ...RGB_RANGE, color2.r), ...RGB_RANGE),
3527
+ g: clamp(range(...paletteRange.g, ...RGB_RANGE, color2.g), ...RGB_RANGE),
3528
+ b: clamp(range(...paletteRange.b, ...RGB_RANGE, color2.b), ...RGB_RANGE)
3529
+ }, resultColor = blendMode === "multiply" ? multiply(convertedBgColor, convertedColor) : screen(convertedBgColor, convertedColor), v = {
3530
+ r: clamp(range(...RGB_RANGE, ...paletteRange.r, resultColor.r), ...paletteRange.r),
3531
+ g: clamp(range(...RGB_RANGE, ...paletteRange.g, resultColor.g), ...paletteRange.g),
3532
+ b: clamp(range(...RGB_RANGE, ...paletteRange.b, resultColor.b), ...paletteRange.b)
3533
+ };
3534
+ return rgbToHex(v);
3535
+ }
3536
+ function renderColorValue(str, options) {
3537
+ const {
3538
+ bg,
3539
+ blendMode,
3540
+ colorPalette
3541
+ } = options;
3542
+ if (bg === "white")
3543
+ throw new Error("Cannot blend with white background");
3544
+ const node = parseTokenValue(str);
3545
+ if (!node || node.type !== "color")
3546
+ throw new Error(`Invalid color token value: ${str}`);
3547
+ let hex = "";
3548
+ 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)
3549
+ throw new Error(`Invalid color token value: ${str}`);
3550
+ const hexBeforeMix = hex, mixOptions = {
3551
+ blendMode,
3552
+ bg,
3553
+ black: renderColorHex(colorPalette.black),
3554
+ // opacity: node.opacity,
3555
+ white: renderColorHex(colorPalette.white)
3556
+ };
3557
+ try {
3558
+ if (hex = mixThemeColor(hex, mixOptions), bg && node.mix !== void 0) {
3559
+ const from = hexToRgb(bg), to = hexToRgb(hex);
3560
+ hex = rgbToHex(mix(from, to, node.mix));
2396
3561
  }
3562
+ } catch (err) {
3563
+ throw console.warn("could not blend", hex, mixOptions), err;
2397
3564
  }
3565
+ return hex === "#aN" && (console.warn(`invalid color token value: ${str}`), hex = hexBeforeMix), node.opacity !== void 0 && (hex = rgba(hex, node.opacity)), hex;
2398
3566
  }
2399
- function isColorMixPercentValue(str) {
2400
- return /^\d+%$/.test(str);
3567
+ function renderColorHex(color2) {
3568
+ return typeof color2 == "string" ? color2 : color2.hex;
2401
3569
  }
2402
- function parseTokenValue(str) {
2403
- const segments = str.split("/");
2404
- let nextSegment = segments.shift() || "";
2405
- const [segment0, segment0mix] = nextSegment.split(" ");
2406
- if (isColorTintKey(segment0)) {
2407
- const tint = segment0, segment1 = segments.shift() || "";
2408
- if (isColorMixPercentValue(segment0mix)) {
2409
- const mix2 = Number(segment0mix.slice(0, -1)) / 100;
2410
- return {
2411
- type: "color",
2412
- tint,
2413
- mix: mix2
2414
- };
2415
- }
2416
- if (isColorOpacityValue(segment1)) {
2417
- const opacity = Number(segment1);
2418
- return {
2419
- type: "color",
2420
- tint,
2421
- opacity
2422
- };
3570
+ function renderThemeColorSchemes(value, config) {
3571
+ const colorPalette = config?.palette ?? defaultColorPalette;
3572
+ return {
3573
+ light: renderThemeColorScheme(colorPalette, value.light),
3574
+ dark: renderThemeColorScheme(colorPalette, value.dark)
3575
+ };
3576
+ }
3577
+ function renderThemeColorScheme(colorPalette, value) {
3578
+ const toneEntries = Object.entries(value), [, transparentTone] = toneEntries.find(([k]) => k === "transparent"), [, defaultTone] = toneEntries.find(([k]) => k === "default"), renderedTransparentTone = renderThemeColor(transparentTone, {
3579
+ colorPalette
3580
+ }), renderedDefaultTone = renderThemeColor(defaultTone, {
3581
+ colorPalette
3582
+ }), bg = renderedDefaultTone.bg;
3583
+ if (bg === "white")
3584
+ throw new Error("Cannot blend with white background");
3585
+ return Object.fromEntries([["transparent", renderedTransparentTone], ["default", renderedDefaultTone], ...toneEntries.filter(([k]) => k !== "default" && k !== "transparent").map(([k, v]) => [k, renderThemeColor(v, {
3586
+ bg,
3587
+ colorPalette
3588
+ })])]);
3589
+ }
3590
+ function renderThemeColor(value, options) {
3591
+ const {
3592
+ colorPalette,
3593
+ bg
3594
+ } = options, blendMode = value._blend || "multiply", baseBg = renderColorValue(value.bg, {
3595
+ colorPalette,
3596
+ bg,
3597
+ blendMode
3598
+ }), colorOptions = {
3599
+ colorPalette,
3600
+ bg: baseBg,
3601
+ blendMode
3602
+ }, button = renderThemeColorButton(value.button, {
3603
+ baseBg,
3604
+ blendMode,
3605
+ colorPalette
3606
+ }), selectable = renderThemeColorSelectable(value.selectable, {
3607
+ colorPalette,
3608
+ baseBg,
3609
+ blendMode
3610
+ }), shadow = {
3611
+ outline: renderColorValue(value.shadow.outline, colorOptions),
3612
+ umbra: renderColorValue(value.shadow.umbra, {
3613
+ ...colorOptions,
3614
+ bg: void 0,
3615
+ colorPalette: {
3616
+ ...colorPalette,
3617
+ black: "#000000"
3618
+ }
3619
+ }),
3620
+ penumbra: renderColorValue(value.shadow.penumbra, {
3621
+ ...colorOptions,
3622
+ bg: void 0,
3623
+ colorPalette: {
3624
+ ...colorPalette,
3625
+ black: "#000000"
3626
+ }
3627
+ }),
3628
+ ambient: renderColorValue(value.shadow.ambient, {
3629
+ ...colorOptions,
3630
+ bg: void 0,
3631
+ colorPalette: {
3632
+ ...colorPalette,
3633
+ black: "#000000"
3634
+ }
3635
+ })
3636
+ };
3637
+ return {
3638
+ _blend: blendMode,
3639
+ _dark: value._dark,
3640
+ accent: {
3641
+ fg: renderColorValue(value.accent.fg, colorOptions)
3642
+ },
3643
+ avatar: renderThemeColorAvatar(value.avatar, {
3644
+ baseBg,
3645
+ colorPalette,
3646
+ blendMode
3647
+ }),
3648
+ backdrop: renderColorValue(value.backdrop, colorOptions),
3649
+ badge: renderThemeColorBadge(value.badge, {
3650
+ baseBg,
3651
+ colorPalette,
3652
+ blendMode
3653
+ }),
3654
+ bg: baseBg,
3655
+ border: renderColorValue(value.border, colorOptions),
3656
+ button,
3657
+ code: {
3658
+ bg: renderColorValue(value.code.bg, colorOptions),
3659
+ fg: renderColorValue(value.code.fg, colorOptions)
3660
+ },
3661
+ fg: renderColorValue(value.fg, colorOptions),
3662
+ focusRing: renderColorValue(value.focusRing, colorOptions),
3663
+ icon: renderColorValue(value.icon, colorOptions),
3664
+ input: renderThemeColorInput(value.input, {
3665
+ baseBg,
3666
+ colorPalette,
3667
+ blendMode
3668
+ }),
3669
+ kbd: renderThemeColorKBD(value.kbd, {
3670
+ baseBg,
3671
+ colorPalette,
3672
+ blendMode
3673
+ }),
3674
+ link: {
3675
+ fg: renderColorValue(value.link.fg, colorOptions)
3676
+ },
3677
+ muted: {
3678
+ bg: renderColorValue(value.muted.bg, colorOptions),
3679
+ fg: renderColorValue(value.muted.fg, colorOptions)
3680
+ },
3681
+ shadow,
3682
+ skeleton: {
3683
+ from: renderColorValue(value.skeleton.from, colorOptions),
3684
+ to: renderColorValue(value.skeleton.to, colorOptions)
3685
+ },
3686
+ syntax: renderSyntaxColorTheme(value.syntax, {
3687
+ baseBg,
3688
+ colorPalette,
3689
+ blendMode
3690
+ }),
3691
+ selectable
3692
+ };
3693
+ }
3694
+ function renderThemeColorKBD(value, options) {
3695
+ const {
3696
+ baseBg,
3697
+ blendMode,
3698
+ colorPalette
3699
+ } = options, rootOptions = {
3700
+ bg: baseBg,
3701
+ blendMode,
3702
+ colorPalette
3703
+ }, bg = renderColorValue(value.bg, rootOptions), colorOptions = {
3704
+ bg,
3705
+ blendMode,
3706
+ colorPalette
3707
+ };
3708
+ return {
3709
+ bg,
3710
+ fg: renderColorValue(value.fg, colorOptions),
3711
+ border: renderColorValue(value.border, colorOptions)
3712
+ };
3713
+ }
3714
+ function renderThemeColorAvatar(value, options) {
3715
+ const colorAvatar = {};
3716
+ for (const hue of COLOR_HUES)
3717
+ colorAvatar[hue] = renderThemeColorAvatarColor(value[hue], options);
3718
+ return colorAvatar;
3719
+ }
3720
+ function renderThemeColorAvatarColor(value, options) {
3721
+ const {
3722
+ baseBg,
3723
+ blendMode: rootBlendMode,
3724
+ colorPalette
3725
+ } = options, blendMode = value._blend || "multiply", rootOptions = {
3726
+ bg: baseBg,
3727
+ blendMode: rootBlendMode,
3728
+ colorPalette
3729
+ }, bg = renderColorValue(value.bg, rootOptions), colorOptions = {
3730
+ bg,
3731
+ blendMode,
3732
+ colorPalette
3733
+ };
3734
+ return {
3735
+ _blend: blendMode,
3736
+ bg,
3737
+ fg: renderColorValue(value.fg, colorOptions)
3738
+ };
3739
+ }
3740
+ function renderThemeColorBadge(value, options) {
3741
+ const colorBadge = {};
3742
+ for (const tone of THEME_COLOR_STATE_TONES)
3743
+ colorBadge[tone] = renderThemeColorBadgeColor(value[tone], options);
3744
+ return colorBadge;
3745
+ }
3746
+ function renderThemeColorBadgeColor(value, options) {
3747
+ const {
3748
+ baseBg,
3749
+ blendMode: rootBlendMode,
3750
+ colorPalette
3751
+ } = options, blendMode = rootBlendMode, rootOptions = {
3752
+ bg: baseBg,
3753
+ blendMode: rootBlendMode,
3754
+ colorPalette
3755
+ }, bg = renderColorValue(value.bg, rootOptions), colorOptions = {
3756
+ bg,
3757
+ blendMode,
3758
+ colorPalette
3759
+ };
3760
+ return {
3761
+ bg,
3762
+ dot: renderColorValue(value.dot, colorOptions),
3763
+ fg: renderColorValue(value.fg, colorOptions),
3764
+ icon: renderColorValue(value.icon, colorOptions)
3765
+ };
3766
+ }
3767
+ function renderThemeColorButton(value, options) {
3768
+ return {
3769
+ default: renderThemeColorButtonTones(value.default, options),
3770
+ ghost: renderThemeColorButtonTones(value.ghost, options),
3771
+ bleed: renderThemeColorButtonTones(value.bleed, options)
3772
+ };
3773
+ }
3774
+ function renderThemeColorButtonTones(value, options) {
3775
+ const colorButtonMode = {};
3776
+ for (const tone of THEME_COLOR_STATE_TONES)
3777
+ colorButtonMode[tone] = renderThemeColorButtonStates(value[tone], options);
3778
+ return colorButtonMode;
3779
+ }
3780
+ function renderThemeColorButtonStates(value, options) {
3781
+ return {
3782
+ enabled: renderThemeColorState(value.enabled, options),
3783
+ hovered: renderThemeColorState(value.hovered, options),
3784
+ pressed: renderThemeColorState(value.pressed, options),
3785
+ selected: renderThemeColorState(value.selected, options),
3786
+ disabled: renderThemeColorState(value.disabled, options)
3787
+ };
3788
+ }
3789
+ function renderThemeColorState(value, options) {
3790
+ const {
3791
+ baseBg,
3792
+ blendMode: rootBlendMode,
3793
+ colorPalette
3794
+ } = options, blendMode = value._blend || "multiply", rootOptions = {
3795
+ bg: baseBg,
3796
+ blendMode: rootBlendMode,
3797
+ colorPalette
3798
+ }, bg = renderColorValue(value.bg, rootOptions), colorOptions = {
3799
+ bg,
3800
+ blendMode,
3801
+ colorPalette
3802
+ };
3803
+ return {
3804
+ _blend: blendMode,
3805
+ accent: {
3806
+ fg: renderColorValue(value.accent.fg, colorOptions)
3807
+ },
3808
+ avatar: renderThemeColorAvatar(value.avatar, {
3809
+ baseBg: bg,
3810
+ colorPalette,
3811
+ blendMode
3812
+ }),
3813
+ badge: renderThemeColorBadge(value.badge, {
3814
+ baseBg: bg,
3815
+ colorPalette,
3816
+ blendMode
3817
+ }),
3818
+ bg,
3819
+ border: renderColorValue(value.border, colorOptions),
3820
+ code: {
3821
+ bg: renderColorValue(value.code.bg, colorOptions),
3822
+ fg: renderColorValue(value.code.fg, colorOptions)
3823
+ },
3824
+ fg: renderColorValue(value.fg, colorOptions),
3825
+ icon: renderColorValue(value.icon, colorOptions),
3826
+ link: {
3827
+ fg: renderColorValue(value.link.fg, colorOptions)
3828
+ },
3829
+ muted: {
3830
+ bg: renderColorValue(value.muted.bg, colorOptions),
3831
+ fg: renderColorValue(value.muted.fg, colorOptions)
3832
+ },
3833
+ kbd: {
3834
+ bg: renderColorValue(value.kbd.bg, colorOptions),
3835
+ fg: renderColorValue(value.kbd.fg, colorOptions),
3836
+ border: renderColorValue(value.kbd.border, colorOptions)
3837
+ },
3838
+ skeleton: {
3839
+ from: renderColorValue(value.skeleton?.from, colorOptions),
3840
+ to: renderColorValue(value.skeleton?.to, colorOptions)
2423
3841
  }
2424
- return {
2425
- type: "color",
2426
- tint
2427
- };
3842
+ };
3843
+ }
3844
+ function renderThemeColorInput(value, options) {
3845
+ return {
3846
+ default: renderInputStatesColorTheme(value.default, options),
3847
+ invalid: renderInputStatesColorTheme(value.invalid, options)
3848
+ };
3849
+ }
3850
+ function renderInputStatesColorTheme(value, options) {
3851
+ return {
3852
+ enabled: renderInputStateColorTheme(value.enabled, options),
3853
+ hovered: renderInputStateColorTheme(value.hovered, options),
3854
+ readOnly: renderInputStateColorTheme(value.readOnly, options),
3855
+ disabled: renderInputStateColorTheme(value.disabled, options)
3856
+ };
3857
+ }
3858
+ function renderInputStateColorTheme(value, options) {
3859
+ const {
3860
+ baseBg,
3861
+ blendMode: rootBlendMode,
3862
+ colorPalette
3863
+ } = options, blendMode = value._blend || "multiply", rootOptions = {
3864
+ colorPalette,
3865
+ bg: baseBg,
3866
+ blendMode: rootBlendMode
3867
+ }, bg = renderColorValue(value.bg, rootOptions), colorOptions = {
3868
+ colorPalette,
3869
+ bg,
3870
+ blendMode
3871
+ };
3872
+ return {
3873
+ _blend: blendMode,
3874
+ bg,
3875
+ border: renderColorValue(value.border, colorOptions),
3876
+ fg: renderColorValue(value.fg, colorOptions),
3877
+ muted: {
3878
+ bg: renderColorValue(value.muted.bg, colorOptions)
3879
+ },
3880
+ placeholder: renderColorValue(value.placeholder, colorOptions)
3881
+ };
3882
+ }
3883
+ function renderThemeColorSelectable(value, options) {
3884
+ const colorSelectable = {};
3885
+ for (const tone of THEME_COLOR_STATE_TONES)
3886
+ colorSelectable[tone] = renderThemeColorSelectableStates(value[tone], options);
3887
+ return colorSelectable;
3888
+ }
3889
+ function renderThemeColorSelectableStates(value, options) {
3890
+ return {
3891
+ enabled: renderThemeColorState(value.enabled, options),
3892
+ hovered: renderThemeColorState(value.hovered, options),
3893
+ pressed: renderThemeColorState(value.pressed, options),
3894
+ selected: renderThemeColorState(value.selected, options),
3895
+ disabled: renderThemeColorState(value.disabled, options)
3896
+ };
3897
+ }
3898
+ function renderSyntaxColorTheme(value, options) {
3899
+ const {
3900
+ colorPalette,
3901
+ baseBg,
3902
+ blendMode
3903
+ } = options, colorOptions = {
3904
+ colorPalette,
3905
+ bg: baseBg,
3906
+ blendMode
3907
+ };
3908
+ return {
3909
+ atrule: renderColorValue(value.atrule, colorOptions),
3910
+ attrName: renderColorValue(value.attrName, colorOptions),
3911
+ attrValue: renderColorValue(value.attrValue, colorOptions),
3912
+ attribute: renderColorValue(value.attribute, colorOptions),
3913
+ boolean: renderColorValue(value.boolean, colorOptions),
3914
+ builtin: renderColorValue(value.builtin, colorOptions),
3915
+ cdata: renderColorValue(value.cdata, colorOptions),
3916
+ char: renderColorValue(value.char, colorOptions),
3917
+ class: renderColorValue(value.class, colorOptions),
3918
+ className: renderColorValue(value.className, colorOptions),
3919
+ comment: renderColorValue(value.comment, colorOptions),
3920
+ constant: renderColorValue(value.constant, colorOptions),
3921
+ deleted: renderColorValue(value.deleted, colorOptions),
3922
+ doctype: renderColorValue(value.doctype, colorOptions),
3923
+ entity: renderColorValue(value.entity, colorOptions),
3924
+ function: renderColorValue(value.function, colorOptions),
3925
+ hexcode: renderColorValue(value.hexcode, colorOptions),
3926
+ id: renderColorValue(value.id, colorOptions),
3927
+ important: renderColorValue(value.important, colorOptions),
3928
+ inserted: renderColorValue(value.inserted, colorOptions),
3929
+ keyword: renderColorValue(value.keyword, colorOptions),
3930
+ number: renderColorValue(value.number, colorOptions),
3931
+ operator: renderColorValue(value.operator, colorOptions),
3932
+ prolog: renderColorValue(value.prolog, colorOptions),
3933
+ property: renderColorValue(value.property, colorOptions),
3934
+ pseudoClass: renderColorValue(value.pseudoClass, colorOptions),
3935
+ pseudoElement: renderColorValue(value.pseudoElement, colorOptions),
3936
+ punctuation: renderColorValue(value.punctuation, colorOptions),
3937
+ regex: renderColorValue(value.regex, colorOptions),
3938
+ selector: renderColorValue(value.selector, colorOptions),
3939
+ string: renderColorValue(value.string, colorOptions),
3940
+ symbol: renderColorValue(value.symbol, colorOptions),
3941
+ tag: renderColorValue(value.tag, colorOptions),
3942
+ unit: renderColorValue(value.unit, colorOptions),
3943
+ url: renderColorValue(value.url, colorOptions),
3944
+ variable: renderColorValue(value.variable, colorOptions)
3945
+ };
3946
+ }
3947
+ function buildTheme(config) {
3948
+ const colorTheme = buildColorTheme(config), v2 = {
3949
+ _version: 2,
3950
+ avatar: config?.avatar ?? defaultThemeConfig.avatar,
3951
+ button: config?.button ?? defaultThemeConfig.button,
3952
+ card: config?.card ?? defaultThemeConfig.card,
3953
+ // How colors are generated:
3954
+ // 1. Merge custom tokens with default tokens
3955
+ // 2. Generate tree of color keys (gray/500, black, white, etc.)
3956
+ // 3. Apply mixing and render to hex values
3957
+ // render(build(mergeWithDefaults()))
3958
+ color: renderThemeColorSchemes(colorTheme, config),
3959
+ container: config?.container ?? defaultThemeConfig.container,
3960
+ font: config?.font ?? defaultThemeFonts$1,
3961
+ input: config?.input ?? defaultThemeConfig.input,
3962
+ layer: config?.layer ?? defaultThemeConfig.layer,
3963
+ media: config?.media ?? defaultThemeConfig.media,
3964
+ radius: config?.radius ?? defaultThemeConfig.radius,
3965
+ shadow: config?.shadow ?? defaultThemeConfig.shadow,
3966
+ space: config?.space ?? defaultThemeConfig.space,
3967
+ style: config?.style ?? defaultThemeConfig.style
3968
+ };
3969
+ return v2_v0(v2);
3970
+ }
3971
+ 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]+)?/;
3972
+ function _parseColorToken(str, options) {
3973
+ const {
3974
+ defaultHue
3975
+ } = options;
3976
+ let cursor = 0;
3977
+ return parseColorNode();
3978
+ function _consume(s) {
3979
+ if (str.startsWith(s, cursor))
3980
+ return cursor += s.length, s;
2428
3981
  }
2429
- if (isColorValue(segment0)) {
2430
- const key = segment0, segment1 = segments.shift() || "";
2431
- if (isColorMixPercentValue(segment0mix)) {
2432
- const mix2 = Number(segment0mix.slice(0, -1)) / 100;
2433
- return {
2434
- type: "color",
2435
- key,
2436
- mix: mix2
2437
- };
2438
- }
2439
- if (isColorOpacityValue(segment1)) {
2440
- const opacity = Number(segment1);
3982
+ function _peek() {
3983
+ return str[cursor];
3984
+ }
3985
+ function parseColorNode() {
3986
+ ignoreWhitespace();
3987
+ let v = _consume("black") || _consume("white");
3988
+ if (v)
2441
3989
  return {
2442
3990
  type: "color",
2443
- key,
2444
- opacity
3991
+ name: v,
3992
+ opacity: parseOpacity() ?? 1,
3993
+ mix: parseMix() ?? 1
2445
3994
  };
2446
- }
2447
- return {
2448
- type: "color",
2449
- key
2450
- };
2451
- }
2452
- if (isColorHueKey(segment0)) {
2453
- const hue = segment0;
2454
- nextSegment = segments.shift() || "";
2455
- const [segment1, segment1mix] = nextSegment.split(" ");
2456
- if (isColorTintKey(segment1)) {
2457
- const tint = segment1, segment2 = segments.shift() || "";
2458
- if (isColorMixPercentValue(segment1mix)) {
2459
- const mix2 = Number(segment1mix.slice(0, -1)) / 100;
2460
- return {
2461
- type: "color",
2462
- hue,
2463
- tint,
2464
- mix: mix2
2465
- };
2466
- }
2467
- if (isColorOpacityValue(segment2)) {
2468
- const opacity = Number(segment2);
3995
+ for (const hue of HUES)
3996
+ if (v = _consume(String(hue)), v) {
3997
+ if (_peek() !== "-")
3998
+ throw new Error('Expected "-" after hue key');
3999
+ cursor += 1;
4000
+ const tint2 = parseTint();
4001
+ if (!tint2)
4002
+ throw new Error("Expected tint after hue");
2469
4003
  return {
2470
- type: "color",
4004
+ type: "tint",
2471
4005
  hue,
2472
- tint,
2473
- opacity
4006
+ tint: tint2,
4007
+ opacity: parseOpacity() ?? 1,
4008
+ mix: parseMix() ?? 1
2474
4009
  };
2475
4010
  }
4011
+ const tint = parseTint();
4012
+ if (tint)
2476
4013
  return {
2477
- type: "color",
2478
- hue,
2479
- tint
4014
+ type: "tint",
4015
+ hue: defaultHue,
4016
+ tint,
4017
+ opacity: parseOpacity() ?? 1,
4018
+ mix: parseMix() ?? 1
4019
+ };
4020
+ if (str === "inherit")
4021
+ return {
4022
+ type: "inherit"
2480
4023
  };
4024
+ throw new Error(`Invalid color: ${str}`);
4025
+ }
4026
+ function parseTint() {
4027
+ ignoreWhitespace();
4028
+ let v = Number(str.slice(cursor, cursor + 3));
4029
+ if (TINTS.includes(v))
4030
+ return cursor += 3, v;
4031
+ if (v = Number(str.slice(cursor, cursor + 2)), TINTS.includes(v))
4032
+ return cursor += 2, v;
4033
+ }
4034
+ function parseMix() {
4035
+ ignoreWhitespace();
4036
+ const match = RE_PERCENTAGE.exec(str.slice(cursor));
4037
+ if (match)
4038
+ return cursor += match[0].length, parseFloat(match[1]) / 100;
4039
+ }
4040
+ function parseOpacity() {
4041
+ if (ignoreWhitespace(), _peek() === "/") {
4042
+ cursor += 1;
4043
+ const match = RE_OPACITY.exec(str.slice(cursor));
4044
+ if (match)
4045
+ return cursor += match[0].length, parseFloat(match[1]);
4046
+ cursor -= 1;
2481
4047
  }
2482
- return {
2483
- type: "hue",
2484
- value: hue
2485
- };
2486
4048
  }
2487
- if (isColorBlendModeValue(segment0))
2488
- return {
2489
- type: "blendMode",
2490
- value: segment0
2491
- };
2492
- }
2493
- function isColorConfigBaseTone(str) {
2494
- return COLOR_CONFIG_CARD_TONES.includes(str);
2495
- }
2496
- function isColorConfigBaseKey(str) {
2497
- return COLOR_CONFIG_CARD_KEYS.includes(str);
2498
- }
2499
- function isColorConfigStateKey(str) {
2500
- return COLOR_CONFIG_STATE_KEYS.includes(str);
2501
- }
2502
- function isColorConfigStateTone(str) {
2503
- return COLOR_CONFIG_STATE_TONES.includes(str);
2504
- }
2505
- function isColorConfigBlendKey(str) {
2506
- return COLOR_CONFIG_BLEND_KEYS.includes(str);
2507
- }
2508
- function isColorTokenValue(str) {
2509
- return parseTokenValue(str)?.type === "color" || parseTokenValue(str)?.type === "hue";
2510
- }
2511
- function isColorValue(str) {
2512
- return str === "black" || str === "white";
2513
- }
2514
- function isColorOpacityValue(str) {
2515
- return str === "0" || /^0\.[0-9]+$/.test(str) || str === "1";
2516
- }
2517
- function is_v2(themeProp) {
2518
- return themeProp._version === 2;
4049
+ function ignoreWhitespace() {
4050
+ for (; _peek() === " "; )
4051
+ cursor++;
4052
+ }
2519
4053
  }
2520
- function themeColor_v0_v2_9(color2) {
2521
- if ("neutral" in color2.badge)
2522
- return color2;
2523
- const colors2 = color2;
2524
- return {
2525
- ...colors2,
2526
- badge: {
2527
- ...colors2.badge,
2528
- neutral: colors2.badge.default,
2529
- suggest: colors2.badge.primary
4054
+ const defaultThemeFonts = {
4055
+ code: {
4056
+ family: "ui-monospace, SFMono-Regular, SF Mono, Menlo, Consolas, Liberation Mono, monospace",
4057
+ weight: {
4058
+ regular: 400,
4059
+ medium: 500,
4060
+ semibold: 600,
4061
+ bold: 700
2530
4062
  },
2531
- button: {
2532
- bleed: {
2533
- ...colors2.button.bleed,
2534
- neutral: colors2.button.bleed.default,
2535
- suggest: colors2.button.bleed.primary
4063
+ scale: [{
4064
+ ascenderHeight: 4,
4065
+ descenderHeight: 4,
4066
+ fontSize: 10,
4067
+ iconSize: 17,
4068
+ lineHeight: 15,
4069
+ letterSpacing: 0,
4070
+ customIconSize: 12
4071
+ }, {
4072
+ ascenderHeight: 5,
4073
+ descenderHeight: 5,
4074
+ fontSize: 13,
4075
+ iconSize: 21,
4076
+ lineHeight: 19,
4077
+ letterSpacing: 0,
4078
+ customIconSize: 16
4079
+ }, {
4080
+ ascenderHeight: 6,
4081
+ descenderHeight: 6,
4082
+ fontSize: 16,
4083
+ iconSize: 25,
4084
+ lineHeight: 23,
4085
+ letterSpacing: 0,
4086
+ customIconSize: 20
4087
+ }, {
4088
+ ascenderHeight: 7,
4089
+ descenderHeight: 7,
4090
+ fontSize: 18.75,
4091
+ iconSize: 29,
4092
+ lineHeight: 27,
4093
+ letterSpacing: 0,
4094
+ customIconSize: 24
4095
+ }, {
4096
+ ascenderHeight: 8,
4097
+ descenderHeight: 8,
4098
+ fontSize: 21.5,
4099
+ iconSize: 33,
4100
+ lineHeight: 31,
4101
+ letterSpacing: 0,
4102
+ customIconSize: 28
4103
+ }]
4104
+ },
4105
+ heading: {
4106
+ family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
4107
+ featureSettings: "'liga' 1, 'calt' 1, 'ss01' 1, 'ss03' 1, 'zero' 1",
4108
+ weight: {
4109
+ regular: 600,
4110
+ medium: 700,
4111
+ semibold: 800,
4112
+ bold: 900
4113
+ },
4114
+ scale: [{
4115
+ ascenderHeight: 5,
4116
+ descenderHeight: 5,
4117
+ fontSize: 13,
4118
+ iconSize: 17,
4119
+ lineHeight: 19,
4120
+ letterSpacing: 0,
4121
+ customIconSize: 12
4122
+ }, {
4123
+ ascenderHeight: 6,
4124
+ descenderHeight: 6,
4125
+ fontSize: 16,
4126
+ iconSize: 25,
4127
+ lineHeight: 23,
4128
+ letterSpacing: 0,
4129
+ customIconSize: 20
4130
+ }, {
4131
+ ascenderHeight: 7,
4132
+ descenderHeight: 7,
4133
+ fontSize: 21,
4134
+ iconSize: 33,
4135
+ lineHeight: 29,
4136
+ letterSpacing: -0.25,
4137
+ customIconSize: 28
4138
+ }, {
4139
+ ascenderHeight: 8,
4140
+ descenderHeight: 8,
4141
+ fontSize: 27,
4142
+ iconSize: 41,
4143
+ lineHeight: 35,
4144
+ letterSpacing: -0.5,
4145
+ customIconSize: 36
4146
+ }, {
4147
+ ascenderHeight: 9.5,
4148
+ descenderHeight: 8.5,
4149
+ fontSize: 33,
4150
+ iconSize: 49,
4151
+ lineHeight: 41,
4152
+ letterSpacing: -1,
4153
+ customIconSize: 44
4154
+ }, {
4155
+ ascenderHeight: 10.5,
4156
+ descenderHeight: 9.5,
4157
+ fontSize: 38,
4158
+ iconSize: 53,
4159
+ lineHeight: 47,
4160
+ letterSpacing: -1,
4161
+ customIconSize: 48
4162
+ }]
4163
+ },
4164
+ label: {
4165
+ family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", system-ui, sans-serif',
4166
+ weight: {
4167
+ regular: 500,
4168
+ medium: 600,
4169
+ semibold: 700,
4170
+ bold: 800
4171
+ },
4172
+ scale: [{
4173
+ ascenderHeight: 2,
4174
+ descenderHeight: 2,
4175
+ fontSize: 8.1,
4176
+ iconSize: 13,
4177
+ lineHeight: 10,
4178
+ letterSpacing: 0.5,
4179
+ customIconSize: 8
4180
+ }, {
4181
+ ascenderHeight: 1.5,
4182
+ descenderHeight: 2.5,
4183
+ fontSize: 9.5,
4184
+ iconSize: 15,
4185
+ lineHeight: 11,
4186
+ letterSpacing: 0.5,
4187
+ customIconSize: 10
4188
+ }, {
4189
+ ascenderHeight: 2,
4190
+ descenderHeight: 2,
4191
+ fontSize: 10.8,
4192
+ iconSize: 17,
4193
+ lineHeight: 12,
4194
+ letterSpacing: 0.5,
4195
+ customIconSize: 12
4196
+ }, {
4197
+ ascenderHeight: 2,
4198
+ descenderHeight: 2,
4199
+ fontSize: 12.25,
4200
+ iconSize: 19,
4201
+ lineHeight: 13,
4202
+ letterSpacing: 0.5,
4203
+ customIconSize: 14
4204
+ }, {
4205
+ ascenderHeight: 1.5,
4206
+ descenderHeight: 2.5,
4207
+ fontSize: 13.6,
4208
+ iconSize: 21,
4209
+ lineHeight: 14,
4210
+ letterSpacing: 0.5,
4211
+ customIconSize: 16
4212
+ }, {
4213
+ ascenderHeight: 2,
4214
+ descenderHeight: 2,
4215
+ fontSize: 15,
4216
+ iconSize: 23,
4217
+ lineHeight: 15,
4218
+ letterSpacing: 0.5,
4219
+ customIconSize: 18
4220
+ }]
4221
+ },
4222
+ text: {
4223
+ family: 'Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", "Liberation Sans", Helvetica, Arial, system-ui, sans-serif',
4224
+ weight: {
4225
+ regular: 400,
4226
+ medium: 500,
4227
+ semibold: 600,
4228
+ bold: 700
4229
+ },
4230
+ scale: [{
4231
+ ascenderHeight: 4,
4232
+ descenderHeight: 4,
4233
+ fontSize: 9.75,
4234
+ iconSize: 17,
4235
+ lineHeight: 15,
4236
+ letterSpacing: 0,
4237
+ customIconSize: 12
4238
+ }, {
4239
+ ascenderHeight: 5,
4240
+ descenderHeight: 5,
4241
+ fontSize: 12.5,
4242
+ iconSize: 21,
4243
+ lineHeight: 19,
4244
+ letterSpacing: 0,
4245
+ customIconSize: 16
4246
+ }, {
4247
+ ascenderHeight: 6,
4248
+ descenderHeight: 6,
4249
+ fontSize: 15.25,
4250
+ iconSize: 25,
4251
+ lineHeight: 23,
4252
+ letterSpacing: 0,
4253
+ customIconSize: 20
4254
+ }, {
4255
+ ascenderHeight: 7,
4256
+ descenderHeight: 7,
4257
+ fontSize: 18,
4258
+ iconSize: 29,
4259
+ lineHeight: 27,
4260
+ letterSpacing: 0,
4261
+ customIconSize: 24
4262
+ }, {
4263
+ ascenderHeight: 8,
4264
+ descenderHeight: 8,
4265
+ fontSize: 20.75,
4266
+ iconSize: 33,
4267
+ lineHeight: 31,
4268
+ letterSpacing: 0,
4269
+ customIconSize: 28
4270
+ }]
4271
+ }
4272
+ }, defaultTokens = {
4273
+ color: {
4274
+ "*": {
4275
+ backdrop: ["gray-100/0.5", "black/0.5"],
4276
+ code: {
4277
+ bg: ["50", "950"],
4278
+ fg: ["700", "300"],
4279
+ token: {
4280
+ atrule: ["purple-600", "purple-400"],
4281
+ attrName: ["green-600", "green-400"],
4282
+ attrValue: ["yellow-600", "yellow-400"],
4283
+ attribute: ["yellow-600", "yellow-400"],
4284
+ boolean: ["purple-600", "purple-400"],
4285
+ builtin: ["purple-600", "purple-400"],
4286
+ cdata: ["yellow-600", "yellow-400"],
4287
+ char: ["yellow-600", "yellow-400"],
4288
+ class: ["orange-600", "orange-400"],
4289
+ className: ["cyan-600", "cyan-400"],
4290
+ comment: ["gray-400", "gray-600"],
4291
+ constant: ["purple-600", "purple-400"],
4292
+ deleted: ["red-600", "red-400"],
4293
+ entity: ["red-600", "red-400"],
4294
+ function: ["green-600", "green-400"],
4295
+ hexcode: ["blue-600", "blue-400"],
4296
+ id: ["purple-600", "purple-400"],
4297
+ important: ["purple-600", "purple-400"],
4298
+ inserted: ["green-600", "green-400"],
4299
+ keyword: ["magenta-600", "magenta-400"],
4300
+ number: ["purple-600", "purple-400"],
4301
+ operator: ["magenta-600", "magenta-400"],
4302
+ prolog: ["gray-600", "gray-400"],
4303
+ property: ["blue-600", "blue-400"],
4304
+ pseudoClass: ["yellow-600", "yellow-400"],
4305
+ pseudoElement: ["yellow-600", "yellow-400"],
4306
+ punctuation: ["gray-600", "gray-400"],
4307
+ regex: ["blue-600", "blue-400"],
4308
+ selector: ["red-600", "red-400"],
4309
+ string: ["yellow-600", "yellow-400"],
4310
+ symbol: ["purple-600", "purple-400"],
4311
+ tag: ["red-600", "red-400"],
4312
+ unit: ["orange-600", "orange-400"],
4313
+ url: ["red-600", "red-400"],
4314
+ variable: ["red-600", "red-400"]
4315
+ }
2536
4316
  },
2537
- default: {
2538
- ...colors2.button.default,
2539
- neutral: colors2.button.default.default,
2540
- suggest: colors2.button.default.primary
4317
+ focusRing: ["blue-500", "blue-500"],
4318
+ link: {
4319
+ fg: ["blue-600", "blue-400"]
2541
4320
  },
2542
- ghost: {
2543
- ...colors2.button.ghost,
2544
- neutral: colors2.button.ghost.default,
2545
- suggest: colors2.button.ghost.primary
4321
+ shadow: {
4322
+ outline: ["600/0.3", "500/0.4"],
4323
+ umbra: ["600/0.1", "black/0.2"],
4324
+ penumbra: ["600/0.07", "black/0.14"],
4325
+ ambient: ["600/0.06", "black/0.12"]
4326
+ },
4327
+ skeleton: {
4328
+ from: ["200 70%", "800 35%"],
4329
+ to: ["200 40%", "800 50%"]
4330
+ },
4331
+ variant: {
4332
+ tinted: {
4333
+ "*": {
4334
+ bg: {
4335
+ 0: ["100 75%", "900 75%"],
4336
+ 4: ["300", "700"]
4337
+ },
4338
+ border: {
4339
+ 0: ["200", "700 50%"],
4340
+ 4: ["300 75%", "500"]
4341
+ },
4342
+ fg: {
4343
+ 0: ["900", "100"],
4344
+ 4: ["700", "300"]
4345
+ }
4346
+ },
4347
+ primary: {
4348
+ _hue: "blue",
4349
+ bg: {
4350
+ 0: ["inherit", "inherit"]
4351
+ }
4352
+ },
4353
+ suggest: {
4354
+ _hue: "purple",
4355
+ bg: {
4356
+ 0: ["inherit", "inherit"]
4357
+ }
4358
+ },
4359
+ positive: {
4360
+ _hue: "green",
4361
+ bg: {
4362
+ 0: ["inherit", "inherit"]
4363
+ }
4364
+ },
4365
+ caution: {
4366
+ _hue: "yellow",
4367
+ bg: {
4368
+ 0: ["inherit", "inherit"]
4369
+ }
4370
+ },
4371
+ critical: {
4372
+ _hue: "red",
4373
+ bg: {
4374
+ 0: ["inherit", "inherit"]
4375
+ }
4376
+ }
4377
+ },
4378
+ solid: {
4379
+ "*": {
4380
+ bg: {
4381
+ 0: ["500", "400"],
4382
+ 4: ["600", "300"]
4383
+ },
4384
+ border: {
4385
+ 0: ["400", "200"],
4386
+ 4: ["500", "100"]
4387
+ },
4388
+ fg: {
4389
+ 0: ["white", "black"],
4390
+ 4: ["200", "700"]
4391
+ }
4392
+ },
4393
+ default: {
4394
+ bg: {
4395
+ 0: ["800", "200"],
4396
+ 4: ["black", "white"]
4397
+ },
4398
+ border: {
4399
+ 0: ["700", "300"],
4400
+ 4: ["800", "200"]
4401
+ }
4402
+ },
4403
+ primary: {
4404
+ _hue: "blue"
4405
+ },
4406
+ suggest: {
4407
+ _hue: "purple"
4408
+ },
4409
+ positive: {
4410
+ _hue: "green"
4411
+ },
4412
+ caution: {
4413
+ _hue: "yellow"
4414
+ },
4415
+ critical: {
4416
+ _hue: "red"
4417
+ }
4418
+ }
2546
4419
  }
2547
4420
  },
2548
- selectable: {
2549
- ...colors2.selectable,
2550
- neutral: colors2.selectable.default,
2551
- suggest: colors2.selectable.primary
2552
- }
2553
- };
2554
- }
2555
- const cache$3 = /* @__PURE__ */ new WeakMap();
2556
- function themeColor_v0_v2(color_v0) {
2557
- const cached_v2 = cache$3.get(color_v0);
2558
- if (cached_v2) return cached_v2;
2559
- const base = stateThemeColor_v0_v2(color_v0, color_v0.card.enabled), color_v2 = {
2560
- _blend: color_v0._blend || (color_v0.dark ? "screen" : "multiply"),
2561
- _dark: color_v0.dark,
2562
- accent: base.accent,
2563
- avatar: base.avatar,
2564
- backdrop: color_v0.base.shadow.ambient,
2565
- badge: base.badge,
2566
- bg: color_v0.base.bg,
2567
- border: color_v0.base.border,
2568
- button: {
2569
- default: stateTonesThemeColor_v0_v2(color_v0, color_v0.button.default),
2570
- ghost: stateTonesThemeColor_v0_v2(color_v0, color_v0.button.ghost),
2571
- bleed: stateTonesThemeColor_v0_v2(color_v0, color_v0.button.bleed)
2572
- },
2573
- code: base.code,
2574
- fg: color_v0.base.fg,
2575
- focusRing: color_v0.base.focusRing,
2576
- icon: base.muted.fg,
2577
- input: {
2578
- default: inputStatesThemeColor_v0_v2(color_v0.input.default),
2579
- invalid: inputStatesThemeColor_v0_v2(color_v0.input.invalid)
2580
- },
2581
- kbd: base.kbd,
2582
- link: base.link,
2583
- muted: {
2584
- ...base.muted,
2585
- bg: color_v0.selectable?.default.enabled.bg2 || color_v0.base.bg
2586
- },
2587
- selectable: stateTonesThemeColor_v0_v2(color_v0, color_v0.selectable || color_v0.muted),
2588
- shadow: color_v0.base.shadow,
2589
- skeleton: {
2590
- from: color_v0.skeleton?.from || color_v0.base.border,
2591
- to: color_v0.skeleton?.to || color_v0.base.border
4421
+ transparent: {
4422
+ variant: {
4423
+ tinted: {
4424
+ "*": {
4425
+ bg: {
4426
+ 0: ["gray-50", "black"],
4427
+ 4: ["300 75%", "700 75%"]
4428
+ },
4429
+ border: {
4430
+ 0: ["200", "800 75%"],
4431
+ 4: ["400", "700"]
4432
+ },
4433
+ fg: {
4434
+ 0: ["black", "100"],
4435
+ 4: ["700", "400"]
4436
+ }
4437
+ }
4438
+ }
4439
+ }
2592
4440
  },
2593
- syntax: color_v0.syntax
2594
- };
2595
- return cache$3.set(color_v0, color_v2), color_v2;
2596
- }
2597
- function stateTonesThemeColor_v0_v2(v0, t) {
2598
- return {
2599
4441
  default: {
2600
- enabled: stateThemeColor_v0_v2(v0, t.default.enabled),
2601
- hovered: stateThemeColor_v0_v2(v0, t.default.hovered),
2602
- pressed: stateThemeColor_v0_v2(v0, t.default.pressed),
2603
- selected: stateThemeColor_v0_v2(v0, t.default.selected),
2604
- disabled: stateThemeColor_v0_v2(v0, t.default.disabled)
2605
- },
2606
- neutral: {
2607
- enabled: stateThemeColor_v0_v2(v0, t.default.enabled),
2608
- hovered: stateThemeColor_v0_v2(v0, t.default.hovered),
2609
- pressed: stateThemeColor_v0_v2(v0, t.default.pressed),
2610
- selected: stateThemeColor_v0_v2(v0, t.default.selected),
2611
- disabled: stateThemeColor_v0_v2(v0, t.default.disabled)
4442
+ variant: {
4443
+ tinted: {
4444
+ "*": {
4445
+ bg: {
4446
+ 0: ["white", "950"],
4447
+ 4: ["300 75%", "700"]
4448
+ },
4449
+ border: {
4450
+ 0: ["200", "800 75%"],
4451
+ 4: ["400", "700"]
4452
+ },
4453
+ fg: {
4454
+ 0: ["black", "white"],
4455
+ 4: ["600", "400"]
4456
+ }
4457
+ }
4458
+ }
4459
+ }
2612
4460
  },
2613
4461
  primary: {
2614
- enabled: stateThemeColor_v0_v2(v0, t.primary.enabled),
2615
- hovered: stateThemeColor_v0_v2(v0, t.primary.hovered),
2616
- pressed: stateThemeColor_v0_v2(v0, t.primary.pressed),
2617
- selected: stateThemeColor_v0_v2(v0, t.primary.selected),
2618
- disabled: stateThemeColor_v0_v2(v0, t.primary.disabled)
4462
+ _hue: "blue"
2619
4463
  },
2620
4464
  suggest: {
2621
- enabled: stateThemeColor_v0_v2(v0, t.primary.enabled),
2622
- hovered: stateThemeColor_v0_v2(v0, t.primary.hovered),
2623
- pressed: stateThemeColor_v0_v2(v0, t.primary.pressed),
2624
- selected: stateThemeColor_v0_v2(v0, t.primary.selected),
2625
- disabled: stateThemeColor_v0_v2(v0, t.primary.disabled)
4465
+ _hue: "purple"
2626
4466
  },
2627
4467
  positive: {
2628
- enabled: stateThemeColor_v0_v2(v0, t.positive.enabled),
2629
- hovered: stateThemeColor_v0_v2(v0, t.positive.hovered),
2630
- pressed: stateThemeColor_v0_v2(v0, t.positive.pressed),
2631
- selected: stateThemeColor_v0_v2(v0, t.positive.selected),
2632
- disabled: stateThemeColor_v0_v2(v0, t.positive.disabled)
4468
+ _hue: "green"
2633
4469
  },
2634
4470
  caution: {
2635
- enabled: stateThemeColor_v0_v2(v0, t.caution.enabled),
2636
- hovered: stateThemeColor_v0_v2(v0, t.caution.hovered),
2637
- pressed: stateThemeColor_v0_v2(v0, t.caution.pressed),
2638
- selected: stateThemeColor_v0_v2(v0, t.caution.selected),
2639
- disabled: stateThemeColor_v0_v2(v0, t.caution.disabled)
4471
+ _hue: "yellow"
2640
4472
  },
2641
4473
  critical: {
2642
- enabled: stateThemeColor_v0_v2(v0, t.critical.enabled),
2643
- hovered: stateThemeColor_v0_v2(v0, t.critical.hovered),
2644
- pressed: stateThemeColor_v0_v2(v0, t.critical.pressed),
2645
- selected: stateThemeColor_v0_v2(v0, t.critical.selected),
2646
- disabled: stateThemeColor_v0_v2(v0, t.critical.disabled)
4474
+ _hue: "red"
4475
+ }
4476
+ }
4477
+ };
4478
+ function merge(...records) {
4479
+ return records.filter(Boolean).reduce(_merge, {});
4480
+ }
4481
+ function _merge(acc, source) {
4482
+ for (const key of Object.keys(source)) {
4483
+ const prevValue = acc[key], nextValue = source[key];
4484
+ isRecord(prevValue) && isRecord(nextValue) ? acc[key] = merge(prevValue, nextValue) : acc[key] = nextValue;
4485
+ }
4486
+ return acc;
4487
+ }
4488
+ function isRecord(value) {
4489
+ return value !== null && typeof value == "object" && !Array.isArray(value);
4490
+ }
4491
+ const defaultElementTokens = {
4492
+ bg: {
4493
+ 0: ["950", "50"],
4494
+ 4: ["700", "300"]
4495
+ },
4496
+ border: {
4497
+ 0: ["700", "300"],
4498
+ 4: ["400", "600"]
4499
+ },
4500
+ fg: {
4501
+ 0: ["100", "900"],
4502
+ 4: ["400", "600"]
4503
+ }
4504
+ };
4505
+ function resolveTokens(tokens = {}) {
4506
+ return {
4507
+ color: {
4508
+ "*": resolveCardColorTokens(tokens.color?.["*"]),
4509
+ ...THEME_COLOR_CARD_TONES.reduce((acc, tone) => ({
4510
+ ...acc,
4511
+ [tone]: resolveCardColorTokens(merge(tokens.color?.["*"], tokens.color?.[tone]))
4512
+ }), {})
2647
4513
  }
2648
4514
  };
2649
4515
  }
2650
- function stateThemeColor_v0_v2(v0, state) {
4516
+ function resolveCardColorTokens(tokens) {
2651
4517
  return {
2652
- ...state,
4518
+ _hue: tokens?._hue ?? "gray",
2653
4519
  avatar: {
2654
4520
  gray: {
2655
- bg: v0.spot.gray,
2656
- fg: v0.base.bg
4521
+ _hue: tokens?.avatar?.gray?._hue ?? "gray",
4522
+ bg: tokens?.avatar?.gray?.bg ?? ["500", "400"],
4523
+ fg: tokens?.avatar?.gray?.fg ?? ["white", "900"]
2657
4524
  },
2658
4525
  blue: {
2659
- bg: v0.spot.blue,
2660
- fg: v0.base.bg
4526
+ _hue: tokens?.avatar?.blue?._hue ?? "blue",
4527
+ bg: tokens?.avatar?.blue?.bg ?? ["500", "400"],
4528
+ fg: tokens?.avatar?.blue?.fg ?? ["white", "900"]
2661
4529
  },
2662
4530
  purple: {
2663
- bg: v0.spot.purple,
2664
- fg: v0.base.bg
4531
+ _hue: tokens?.avatar?.purple?._hue ?? "purple",
4532
+ bg: tokens?.avatar?.purple?.bg ?? ["500", "400"],
4533
+ fg: tokens?.avatar?.purple?.fg ?? ["white", "900"]
2665
4534
  },
2666
4535
  magenta: {
2667
- bg: v0.spot.magenta,
2668
- fg: v0.base.bg
4536
+ _hue: tokens?.avatar?.magenta?._hue ?? "magenta",
4537
+ bg: tokens?.avatar?.magenta?.bg ?? ["500", "400"],
4538
+ fg: tokens?.avatar?.magenta?.fg ?? ["white", "900"]
2669
4539
  },
2670
4540
  red: {
2671
- bg: v0.spot.red,
2672
- fg: v0.base.bg
4541
+ _hue: tokens?.avatar?.red?._hue ?? "red",
4542
+ bg: tokens?.avatar?.red?.bg ?? ["500", "400"],
4543
+ fg: tokens?.avatar?.red?.fg ?? ["white", "900"]
2673
4544
  },
2674
4545
  orange: {
2675
- bg: v0.spot.orange,
2676
- fg: v0.base.bg
4546
+ _hue: tokens?.avatar?.orange?._hue ?? "orange",
4547
+ bg: tokens?.avatar?.orange?.bg ?? ["500", "400"],
4548
+ fg: tokens?.avatar?.orange?.fg ?? ["white", "900"]
2677
4549
  },
2678
4550
  yellow: {
2679
- bg: v0.spot.yellow,
2680
- fg: v0.base.bg
4551
+ _hue: tokens?.avatar?.yellow?._hue ?? "yellow",
4552
+ bg: tokens?.avatar?.yellow?.bg ?? ["500", "400"],
4553
+ fg: tokens?.avatar?.yellow?.fg ?? ["white", "900"]
2681
4554
  },
2682
4555
  green: {
2683
- bg: v0.spot.green,
2684
- fg: v0.base.bg
4556
+ _hue: tokens?.avatar?.green?._hue ?? "green",
4557
+ bg: tokens?.avatar?.green?.bg ?? ["500", "400"],
4558
+ fg: tokens?.avatar?.green?.fg ?? ["white", "900"]
2685
4559
  },
2686
4560
  cyan: {
2687
- bg: v0.spot.cyan,
2688
- fg: v0.base.bg
4561
+ _hue: tokens?.avatar?.cyan?._hue ?? "cyan",
4562
+ bg: tokens?.avatar?.cyan?.bg ?? ["500", "400"],
4563
+ fg: tokens?.avatar?.cyan?.fg ?? ["white", "900"]
2689
4564
  }
2690
4565
  },
2691
- badge: {
2692
- default: {
2693
- bg: v0.muted.default.enabled.bg,
2694
- fg: v0.muted.default.enabled.fg,
2695
- dot: v0.muted.default.enabled.muted.fg,
2696
- icon: v0.muted.default.enabled.muted.fg
2697
- },
2698
- neutral: {
2699
- bg: v0.muted.transparent.enabled.bg,
2700
- fg: v0.muted.transparent.enabled.fg,
2701
- dot: v0.muted.transparent.enabled.muted.fg,
2702
- icon: v0.muted.transparent.enabled.muted.fg
2703
- },
2704
- primary: {
2705
- bg: v0.muted.primary.enabled.bg,
2706
- fg: v0.muted.primary.enabled.fg,
2707
- dot: v0.muted.primary.enabled.muted.fg,
2708
- icon: v0.muted.primary.enabled.muted.fg
2709
- },
2710
- suggest: {
2711
- bg: v0.muted.primary.enabled.bg,
2712
- fg: v0.muted.primary.enabled.fg,
2713
- dot: v0.muted.primary.enabled.muted.fg,
2714
- icon: v0.muted.primary.enabled.muted.fg
2715
- },
2716
- positive: {
2717
- bg: v0.muted.positive.enabled.bg,
2718
- fg: v0.muted.positive.enabled.fg,
2719
- dot: v0.muted.positive.enabled.muted.fg,
2720
- icon: v0.muted.positive.enabled.muted.fg
2721
- },
2722
- caution: {
2723
- bg: v0.muted.caution.enabled.bg,
2724
- fg: v0.muted.caution.enabled.fg,
2725
- dot: v0.muted.caution.enabled.muted.fg,
2726
- icon: v0.muted.caution.enabled.muted.fg
2727
- },
2728
- critical: {
2729
- bg: v0.muted.critical.enabled.bg,
2730
- fg: v0.muted.critical.enabled.fg,
2731
- dot: v0.muted.critical.enabled.muted.fg,
2732
- icon: v0.muted.critical.enabled.muted.fg
4566
+ backdrop: tokens?.backdrop ?? ["100", "900"],
4567
+ code: {
4568
+ bg: tokens?.code?.bg ?? ["50", "950"],
4569
+ fg: tokens?.code?.fg ?? ["600", "400"],
4570
+ token: {
4571
+ atrule: tokens?.code?.token?.atrule ?? ["600", "400"],
4572
+ attribute: tokens?.code?.token?.attribute ?? ["600", "400"],
4573
+ attrName: tokens?.code?.token?.attrName ?? ["600", "400"],
4574
+ attrValue: tokens?.code?.token?.attrValue ?? ["600", "400"],
4575
+ boolean: tokens?.code?.token?.boolean ?? ["600", "400"],
4576
+ builtin: tokens?.code?.token?.builtin ?? ["600", "400"],
4577
+ cdata: tokens?.code?.token?.cdata ?? ["600", "400"],
4578
+ char: tokens?.code?.token?.char ?? ["600", "400"],
4579
+ class: tokens?.code?.token?.class ?? ["600", "400"],
4580
+ className: tokens?.code?.token?.className ?? ["600", "400"],
4581
+ comment: tokens?.code?.token?.comment ?? ["400", "600"],
4582
+ constant: tokens?.code?.token?.constant ?? ["600", "400"],
4583
+ deleted: tokens?.code?.token?.deleted ?? ["600", "400"],
4584
+ doctype: tokens?.code?.token?.doctype ?? ["600", "400"],
4585
+ entity: tokens?.code?.token?.entity ?? ["600", "400"],
4586
+ function: tokens?.code?.token?.function ?? ["600", "400"],
4587
+ hexcode: tokens?.code?.token?.hexcode ?? ["600", "400"],
4588
+ id: tokens?.code?.token?.id ?? ["600", "400"],
4589
+ important: tokens?.code?.token?.important ?? ["600", "400"],
4590
+ inserted: tokens?.code?.token?.inserted ?? ["600", "400"],
4591
+ keyword: tokens?.code?.token?.keyword ?? ["600", "400"],
4592
+ number: tokens?.code?.token?.number ?? ["600", "400"],
4593
+ operator: tokens?.code?.token?.operator ?? ["600", "400"],
4594
+ prolog: tokens?.code?.token?.prolog ?? ["600", "400"],
4595
+ property: tokens?.code?.token?.property ?? ["600", "400"],
4596
+ pseudoClass: tokens?.code?.token?.pseudoClass ?? ["600", "400"],
4597
+ pseudoElement: tokens?.code?.token?.pseudoElement ?? ["600", "400"],
4598
+ punctuation: tokens?.code?.token?.punctuation ?? ["600", "400"],
4599
+ regex: tokens?.code?.token?.regex ?? ["600", "400"],
4600
+ selector: tokens?.code?.token?.selector ?? ["600", "400"],
4601
+ string: tokens?.code?.token?.string ?? ["600", "400"],
4602
+ symbol: tokens?.code?.token?.symbol ?? ["600", "400"],
4603
+ tag: tokens?.code?.token?.tag ?? ["600", "400"],
4604
+ unit: tokens?.code?.token?.unit ?? ["600", "400"],
4605
+ url: tokens?.code?.token?.url ?? ["600", "400"],
4606
+ variable: tokens?.code?.token?.variable ?? ["600", "400"]
2733
4607
  }
2734
4608
  },
2735
- kbd: {
2736
- bg: v0.muted.default.enabled.bg,
2737
- fg: v0.muted.default.enabled.fg,
2738
- border: v0.muted.default.enabled.border
4609
+ focusRing: tokens?.focusRing ?? ["500", "500"],
4610
+ link: {
4611
+ fg: tokens?.link?.fg ?? ["600", "400"]
2739
4612
  },
2740
- muted: {
2741
- ...v0.muted.default.enabled.muted,
2742
- bg: state.bg2 || state.bg
4613
+ shadow: {
4614
+ outline: tokens?.shadow?.outline ?? ["500", "500"],
4615
+ umbra: tokens?.shadow?.umbra ?? ["500", "500"],
4616
+ penumbra: tokens?.shadow?.penumbra ?? ["500", "500"],
4617
+ ambient: tokens?.shadow?.ambient ?? ["500", "500"]
2743
4618
  },
2744
4619
  skeleton: {
2745
- from: state.skeleton?.from || state.border,
2746
- to: state.skeleton?.to || state.border
4620
+ from: tokens?.skeleton?.from ?? ["100", "900"],
4621
+ to: tokens?.skeleton?.to ?? ["50", "950"]
4622
+ },
4623
+ variant: {
4624
+ solid: {
4625
+ "*": resolveElementTokens(tokens?.variant?.solid?.["*"]),
4626
+ ...THEME_COLOR_STATE_TONES.reduce((acc, tone) => (acc[tone] = resolveElementTokens(merge(tokens, tokens?.variant?.solid?.["*"], tokens?.variant?.solid?.[tone])), acc), {})
4627
+ },
4628
+ tinted: {
4629
+ "*": resolveElementTokens(tokens?.variant?.tinted?.["*"]),
4630
+ ...THEME_COLOR_STATE_TONES.reduce((acc, tone) => (acc[tone] = resolveElementTokens(merge(tokens, tokens?.variant?.tinted?.["*"], tokens?.variant?.tinted?.[tone])), acc), {})
4631
+ }
2747
4632
  }
2748
4633
  };
2749
4634
  }
2750
- function inputStatesThemeColor_v0_v2(states) {
2751
- return {
2752
- enabled: inputStateThemeColor_v0_v2(states.enabled),
2753
- disabled: inputStateThemeColor_v0_v2(states.disabled),
2754
- readOnly: inputStateThemeColor_v0_v2(states.readOnly),
2755
- hovered: inputStateThemeColor_v0_v2(states.hovered)
2756
- };
2757
- }
2758
- function inputStateThemeColor_v0_v2(state) {
4635
+ function resolveElementTokens(tokens) {
2759
4636
  return {
2760
- bg: state.bg,
2761
- border: state.border,
2762
- fg: state.fg,
2763
- muted: {
2764
- bg: state.bg2
4637
+ _hue: tokens?._hue ?? "gray",
4638
+ bg: {
4639
+ 0: tokens?.bg?.[0] ?? defaultElementTokens.bg[0],
4640
+ 4: tokens?.bg?.[4] ?? defaultElementTokens.bg[4]
2765
4641
  },
2766
- placeholder: state.placeholder
4642
+ border: {
4643
+ 0: tokens?.border?.[0] ?? defaultElementTokens.border[0],
4644
+ 4: tokens?.border?.[4] ?? defaultElementTokens.border[4]
4645
+ },
4646
+ fg: {
4647
+ 0: tokens?.fg?.[0] ?? defaultElementTokens.fg[0],
4648
+ 4: tokens?.fg?.[4] ?? defaultElementTokens.fg[4]
4649
+ }
2767
4650
  };
2768
4651
  }
2769
- const cache$2 = /* @__PURE__ */ new WeakMap();
2770
- function v0_v2(v0) {
2771
- if (v0.v2) return v0.v2;
2772
- const cached_v2 = cache$2.get(v0);
2773
- if (cached_v2) return cached_v2;
4652
+ function buildTheme_v3(options) {
2774
4653
  const {
2775
- avatar,
2776
- button,
2777
- color: color2,
2778
- container,
2779
- fonts: font,
2780
- input,
2781
- layer,
2782
- media,
2783
- radius,
2784
- shadows: shadow,
2785
- space,
2786
- styles: style
2787
- } = v0, v2 = {
2788
- _version: 2,
2789
- avatar: {
2790
- ...defaultThemeConfig.avatar,
2791
- ...avatar
2792
- },
2793
- button: {
2794
- ...defaultThemeConfig.button,
2795
- ...button
2796
- },
2797
- card: defaultThemeConfig.card,
2798
- color: {
2799
- light: {
2800
- transparent: themeColor_v0_v2(color2.light.transparent),
2801
- default: themeColor_v0_v2(color2.light.default),
2802
- neutral: themeColor_v0_v2(color2.light.transparent),
2803
- primary: themeColor_v0_v2(color2.light.primary),
2804
- suggest: themeColor_v0_v2(color2.light.primary),
2805
- positive: themeColor_v0_v2(color2.light.positive),
2806
- caution: themeColor_v0_v2(color2.light.caution),
2807
- critical: themeColor_v0_v2(color2.light.critical)
2808
- },
2809
- dark: {
2810
- transparent: themeColor_v0_v2(color2.dark.transparent),
2811
- default: themeColor_v0_v2(color2.dark.default),
2812
- neutral: themeColor_v0_v2(color2.dark.transparent),
2813
- primary: themeColor_v0_v2(color2.dark.primary),
2814
- suggest: themeColor_v0_v2(color2.dark.primary),
2815
- positive: themeColor_v0_v2(color2.dark.positive),
2816
- caution: themeColor_v0_v2(color2.dark.caution),
2817
- critical: themeColor_v0_v2(color2.dark.critical)
2818
- }
2819
- },
2820
- container,
2821
- font,
2822
- input: {
2823
- ...defaultThemeConfig.input,
2824
- ...input,
2825
- checkbox: {
2826
- ...defaultThemeConfig.input.checkbox,
2827
- ...input.checkbox
2828
- },
2829
- radio: {
2830
- ...defaultThemeConfig.input.radio,
2831
- ...input.radio
2832
- },
2833
- switch: {
2834
- ...defaultThemeConfig.input.switch,
2835
- ...input.switch
2836
- }
4654
+ v2
4655
+ } = options ?? {}, tokens = resolveTokens(options?.tokens ?? defaultTokens);
4656
+ return {
4657
+ _version: 3,
4658
+ _tokens: tokens,
4659
+ avatar: v2?.avatar ?? defaultThemeConfig.avatar,
4660
+ button: v2?.button ?? defaultThemeConfig.button,
4661
+ card: v2?.card ?? defaultThemeConfig.card,
4662
+ color: tokens.color,
4663
+ container: v2?.container ?? defaultThemeConfig.container,
4664
+ font: defaultThemeFonts,
4665
+ input: v2?.input ?? defaultThemeConfig.input,
4666
+ layer: v2?.layer ?? defaultThemeConfig.layer,
4667
+ media: v2?.media ?? defaultThemeConfig.media,
4668
+ palette: {
4669
+ black: black$1,
4670
+ white: white$1,
4671
+ hues
2837
4672
  },
2838
- layer: layer ?? defaultThemeConfig.layer,
2839
- media,
2840
- radius,
2841
- shadow,
2842
- space,
2843
- style
2844
- };
2845
- return cache$2.set(v0, v2), v2;
2846
- }
2847
- const cache$1 = /* @__PURE__ */ new Map();
2848
- function getScopedTheme(themeProp, scheme, tone) {
2849
- const cachedTheme = _getCachedTheme(themeProp, scheme, tone);
2850
- if (cachedTheme) return cachedTheme;
2851
- 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 = {
2852
- sanity: {
2853
- ...v0,
2854
- color: color_v0,
2855
- layer: layer_v0,
2856
- v2: {
2857
- ...v2,
2858
- _resolved: !0,
2859
- color: color_v2_9,
2860
- layer: layer_v2
2861
- }
2862
- }
4673
+ // TODO
4674
+ radius: v2?.radius ?? defaultThemeConfig.radius,
4675
+ // TODO
4676
+ shadow: v2?.shadow ?? defaultThemeConfig.shadow,
4677
+ // TODO
4678
+ space: v2?.space ?? defaultThemeConfig.space
2863
4679
  };
2864
- return _setCachedTheme(themeProp, scheme, tone, theme), theme;
2865
- }
2866
- function _getCachedTheme(rootTheme, scheme, tone) {
2867
- const schemeCache = cache$1.get(scheme);
2868
- if (!schemeCache) return;
2869
- const toneCache = schemeCache.get(tone);
2870
- if (toneCache)
2871
- return toneCache.get(rootTheme);
2872
- }
2873
- function _setCachedTheme(rootTheme, scheme, tone, theme) {
2874
- cache$1.has(scheme) || cache$1.set(scheme, /* @__PURE__ */ new Map());
2875
- const schemeCache = cache$1.get(scheme);
2876
- schemeCache.has(tone) || schemeCache.set(tone, /* @__PURE__ */ new WeakMap()), schemeCache.get(tone).set(rootTheme, theme);
2877
4680
  }
2878
- const cache = /* @__PURE__ */ new WeakMap();
4681
+ const COLOR_VARIANTS = ["tinted", "solid"], AVATAR_COLORS = ["gray", "blue", "purple", "magenta", "red", "orange", "yellow", "green", "cyan"], cache = /* @__PURE__ */ new WeakMap();
2879
4682
  function getTheme_v2(theme) {
2880
4683
  if (theme.sanity.v2?._resolved) return theme.sanity.v2;
2881
4684
  const cached_v2 = cache.get(theme);
@@ -2920,68 +4723,69 @@ function getTheme_v2(theme) {
2920
4723
  };
2921
4724
  return cache.set(theme, v2), v2;
2922
4725
  }
2923
- exports.THEME_COLOR_AVATAR_COLORS = v3_v2.THEME_COLOR_AVATAR_COLORS;
2924
- exports.THEME_COLOR_BLEND_MODES = v3_v2.THEME_COLOR_BLEND_MODES;
2925
- exports.THEME_COLOR_BUTTON_MODES = v3_v2.THEME_COLOR_BUTTON_MODES;
2926
- exports.THEME_COLOR_CARD_TONES = v3_v2.THEME_COLOR_CARD_TONES;
2927
- exports.THEME_COLOR_INPUT_MODES = v3_v2.THEME_COLOR_INPUT_MODES;
2928
- exports.THEME_COLOR_INPUT_STATES = v3_v2.THEME_COLOR_INPUT_STATES;
2929
- exports.THEME_COLOR_SCHEMES = v3_v2.THEME_COLOR_SCHEMES;
2930
- exports.THEME_COLOR_STATES = v3_v2.THEME_COLOR_STATES;
2931
- exports.THEME_COLOR_STATE_TONES = v3_v2.THEME_COLOR_STATE_TONES;
2932
- exports.AVATAR_SIZE = AVATAR_SIZE;
2933
- exports.COLOR_CONFIG_AVATAR_COLORS = COLOR_CONFIG_AVATAR_COLORS;
2934
- exports.COLOR_CONFIG_BLEND_KEYS = COLOR_CONFIG_BLEND_KEYS;
2935
- exports.COLOR_CONFIG_CARD_KEYS = COLOR_CONFIG_CARD_KEYS;
2936
- exports.COLOR_CONFIG_CARD_TONES = COLOR_CONFIG_CARD_TONES;
2937
- exports.COLOR_CONFIG_INPUT_MODES = COLOR_CONFIG_INPUT_MODES;
2938
- exports.COLOR_CONFIG_INPUT_STATES = COLOR_CONFIG_INPUT_STATES;
2939
- exports.COLOR_CONFIG_STATES = COLOR_CONFIG_STATES;
2940
- exports.COLOR_CONFIG_STATE_KEYS = COLOR_CONFIG_STATE_KEYS;
2941
- exports.COLOR_CONFIG_STATE_TONES = COLOR_CONFIG_STATE_TONES;
2942
- exports.CONTAINER = CONTAINER;
2943
- exports.FONT_CODE_SIZE = FONT_CODE_SIZE;
2944
- exports.FONT_HEADING_SIZE = FONT_HEADING_SIZE;
2945
- exports.FONT_LABEL_SIZE = FONT_LABEL_SIZE;
2946
- exports.FONT_TEXT_SIZE = FONT_TEXT_SIZE;
2947
- exports.HUES = HUES;
2948
- exports.RADIUS = RADIUS;
2949
- exports.SHADOW = SHADOW;
2950
- exports.SPACE = SPACE;
2951
- exports.TINTS = TINTS;
2952
- exports.buildColor_v3 = buildColor_v3;
2953
- exports.buildTheme = buildTheme;
2954
- exports.buildTheme_v3 = buildTheme_v3;
2955
- exports.createColorTheme = createColorTheme;
2956
- exports.defaultPalette = defaultPalette;
2957
- exports.defaultTokens = defaultTokens;
2958
- exports.getContrastRatio = getContrastRatio;
2959
- exports.getScopedTheme = getScopedTheme;
2960
- exports.getTheme_v2 = getTheme_v2;
2961
- exports.hexToRgb = hexToRgb;
2962
- exports.hslToRgb = hslToRgb;
2963
- exports.isColorBlendModeValue = isColorBlendModeValue;
2964
- exports.isColorButtonMode = isColorButtonMode;
2965
- exports.isColorConfigBaseKey = isColorConfigBaseKey;
2966
- exports.isColorConfigBaseTone = isColorConfigBaseTone;
2967
- exports.isColorConfigBlendKey = isColorConfigBlendKey;
2968
- exports.isColorConfigStateKey = isColorConfigStateKey;
2969
- exports.isColorConfigStateTone = isColorConfigStateTone;
2970
- exports.isColorHueKey = isColorHueKey;
2971
- exports.isColorOpacityValue = isColorOpacityValue;
2972
- exports.isColorTintKey = isColorTintKey;
2973
- exports.isColorTokenValue = isColorTokenValue;
2974
- exports.isColorValue = isColorValue;
2975
- exports.mix = mix;
2976
- exports.multiply = multiply;
2977
- exports.parseColor = parseColor;
2978
- exports.parseTokenKey = parseTokenKey;
2979
- exports.parseTokenValue = parseTokenValue;
2980
- exports.renderColor = renderColor;
2981
- exports.resolveTokens = resolveTokens;
2982
- exports.rgbToHex = rgbToHex;
2983
- exports.rgbToHsl = rgbToHsl;
2984
- exports.rgba = rgba;
2985
- exports.rgbaToRGBA = rgbaToRGBA;
2986
- exports.screen = screen;
4726
+ export {
4727
+ AVATAR_COLORS,
4728
+ AVATAR_SIZE,
4729
+ COLOR_CONFIG_AVATAR_COLORS,
4730
+ COLOR_CONFIG_BLEND_KEYS,
4731
+ COLOR_CONFIG_CARD_KEYS,
4732
+ COLOR_CONFIG_CARD_TONES,
4733
+ COLOR_CONFIG_INPUT_MODES,
4734
+ COLOR_CONFIG_INPUT_STATES,
4735
+ COLOR_CONFIG_STATES,
4736
+ COLOR_CONFIG_STATE_KEYS,
4737
+ COLOR_CONFIG_STATE_TONES,
4738
+ COLOR_VARIANTS,
4739
+ CONTAINER,
4740
+ CONTAINER_SCALE,
4741
+ FONT_CODE_SIZE,
4742
+ FONT_HEADING_SIZE,
4743
+ FONT_LABEL_SIZE,
4744
+ FONT_TEXT_SIZE,
4745
+ HUES,
4746
+ RADIUS,
4747
+ SHADOW,
4748
+ SPACE,
4749
+ THEME_COLOR_AVATAR_COLORS,
4750
+ THEME_COLOR_BLEND_MODES,
4751
+ THEME_COLOR_BUTTON_MODES,
4752
+ THEME_COLOR_CARD_TONES,
4753
+ THEME_COLOR_INPUT_MODES,
4754
+ THEME_COLOR_INPUT_STATES,
4755
+ THEME_COLOR_SCHEMES,
4756
+ THEME_COLOR_STATES,
4757
+ THEME_COLOR_STATE_TONES,
4758
+ TINTS,
4759
+ _parseColorToken,
4760
+ buildTheme,
4761
+ buildTheme_v3,
4762
+ createColorTheme,
4763
+ defaultTokens,
4764
+ getContrastRatio,
4765
+ getScopedTheme,
4766
+ getTheme_v2,
4767
+ hexToRgb,
4768
+ hslToRgb,
4769
+ isColorBlendModeValue,
4770
+ isColorButtonMode,
4771
+ isColorConfigBaseKey,
4772
+ isColorConfigBaseTone,
4773
+ isColorConfigBlendKey,
4774
+ isColorConfigStateKey,
4775
+ isColorConfigStateTone,
4776
+ isColorHueKey,
4777
+ isColorOpacityValue,
4778
+ isColorTintKey,
4779
+ isColorValue,
4780
+ mix,
4781
+ multiply,
4782
+ parseColor,
4783
+ parseTokenValue,
4784
+ resolveTokens,
4785
+ rgbToHex,
4786
+ rgbToHsl,
4787
+ rgba,
4788
+ rgbaToRGBA,
4789
+ screen
4790
+ };
2987
4791
  //# sourceMappingURL=theme.js.map