@sanity/ui 3.0.0-static.8 → 3.0.0

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