@sanity/ui 2.0.0-alpha.9 → 2.0.0-beta.10

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