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