@sanity/ui 3.0.0-static.32 → 3.0.0-static.34

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 (582) hide show
  1. package/README.md +1 -1
  2. package/dist/_chunks-cjs/_visual-editing.cjs +269 -378
  3. package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -1
  4. package/dist/_chunks-cjs/refractor.cjs.map +1 -1
  5. package/dist/_chunks-es/_visual-editing.js +270 -381
  6. package/dist/_chunks-es/_visual-editing.js.map +1 -1
  7. package/dist/_chunks-es/refractor.js.map +1 -1
  8. package/dist/_visual-editing.cjs +0 -2
  9. package/dist/_visual-editing.cjs.map +1 -1
  10. package/dist/_visual-editing.d.cts +2 -894
  11. package/dist/_visual-editing.d.ts +2 -894
  12. package/dist/_visual-editing.js +2 -4
  13. package/dist/css/index.cjs +13 -13
  14. package/dist/css/index.cjs.map +1 -1
  15. package/dist/css/index.css +1 -1
  16. package/dist/css/index.d.cts +805 -14697
  17. package/dist/css/index.d.ts +805 -14697
  18. package/dist/css/index.js +13 -13
  19. package/dist/css/index.js.map +1 -1
  20. package/dist/index.cjs +242 -367
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.d.cts +990 -3085
  23. package/dist/index.d.ts +990 -3085
  24. package/dist/index.js +244 -361
  25. package/dist/index.js.map +1 -1
  26. package/dist/portalProvider-DgNIVviV.d.ts +575 -0
  27. package/dist/theme.cjs +367 -4288
  28. package/dist/theme.cjs.map +1 -1
  29. package/dist/theme.d.cts +272 -1806
  30. package/dist/theme.d.ts +272 -1806
  31. package/dist/theme.js +371 -4292
  32. package/dist/theme.js.map +1 -1
  33. package/exports/_visual-editing.ts +0 -2
  34. package/package.json +8 -9
  35. package/src/core/Root.tsx +6 -4
  36. package/src/core/RootProvider.tsx +4 -4
  37. package/src/core/__workshop__/boundary.tsx +1 -1
  38. package/src/core/__workshop__/index.ts +5 -3
  39. package/src/core/components/autocomplete/__workshop__/async.tsx +1 -1
  40. package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -2
  41. package/src/core/components/autocomplete/__workshop__/custom.tsx +2 -2
  42. package/src/core/components/autocomplete/__workshop__/example.tsx +2 -2
  43. package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +1 -1
  44. package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +1 -1
  45. package/src/core/components/autocomplete/__workshop__/index.ts +5 -3
  46. package/src/core/components/autocomplete/__workshop__/mock/apiStore.ts +1 -1
  47. package/src/core/components/autocomplete/__workshop__/mock/countries.ts +1 -1
  48. package/src/core/components/autocomplete/autocomplete.tsx +2 -2
  49. package/src/core/components/autocomplete/autocompleteOption.tsx +2 -2
  50. package/src/core/components/autocomplete/constants.ts +2 -2
  51. package/src/core/components/breadcrumbs/__workshop__/example.tsx +1 -1
  52. package/src/core/components/breadcrumbs/__workshop__/index.ts +5 -3
  53. package/src/core/components/breadcrumbs/breadcrumbs.tsx +6 -11
  54. package/src/core/components/dialog/__workshop__/activate.tsx +1 -1
  55. package/src/core/components/dialog/__workshop__/autoFocus.tsx +1 -1
  56. package/src/core/components/dialog/__workshop__/index.ts +5 -3
  57. package/src/core/components/dialog/__workshop__/layering.tsx +1 -1
  58. package/src/core/components/dialog/__workshop__/nested.tsx +2 -3
  59. package/src/core/components/dialog/__workshop__/onScroll.tsx +1 -1
  60. package/src/core/components/dialog/__workshop__/panes.tsx +1 -1
  61. package/src/core/components/dialog/__workshop__/position.tsx +1 -1
  62. package/src/core/components/dialog/__workshop__/props.tsx +1 -1
  63. package/src/core/components/dialog/__workshop__/provider.tsx +1 -1
  64. package/src/core/components/dialog/__workshop__/wrapped.tsx +1 -1
  65. package/src/core/components/dialog/dialog.tsx +5 -6
  66. package/src/core/components/dialog/dialogCard.tsx +2 -2
  67. package/src/core/components/dialog/dialogContext.ts +3 -4
  68. package/src/core/components/dialog/dialogProvider.tsx +2 -2
  69. package/src/core/components/hotkeys/__workshop__/index.ts +5 -3
  70. package/src/core/components/hotkeys/__workshop__/plain.tsx +1 -1
  71. package/src/core/components/hotkeys/hotkeys.tsx +4 -15
  72. package/src/core/components/menu/__workshop__/asComponent.tsx +1 -1
  73. package/src/core/components/menu/__workshop__/avatarMenu.tsx +1 -1
  74. package/src/core/components/menu/__workshop__/closableMenuButton.tsx +1 -1
  75. package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +3 -3
  76. package/src/core/components/menu/__workshop__/customMenuItem.tsx +1 -1
  77. package/src/core/components/menu/__workshop__/customSelectedState.tsx +1 -1
  78. package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +1 -1
  79. package/src/core/components/menu/__workshop__/groups.tsx +1 -1
  80. package/src/core/components/menu/__workshop__/index.ts +5 -3
  81. package/src/core/components/menu/__workshop__/menuButton.tsx +2 -2
  82. package/src/core/components/menu/__workshop__/menuGroupRight.tsx +1 -1
  83. package/src/core/components/menu/__workshop__/nestedMenu.tsx +1 -1
  84. package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +1 -1
  85. package/src/core/components/menu/__workshop__/selectedItem.tsx +1 -1
  86. package/src/core/components/menu/__workshop__/shouldFocus.tsx +1 -1
  87. package/src/core/components/menu/__workshop__/tones.tsx +3 -3
  88. package/src/core/components/menu/__workshop__/withoutArrow.tsx +1 -1
  89. package/src/core/components/menu/menu.test.tsx +2 -1
  90. package/src/core/components/menu/menu.tsx +7 -22
  91. package/src/core/components/menu/menuButton.tsx +4 -50
  92. package/src/core/components/menu/menuContext.ts +3 -15
  93. package/src/core/components/menu/menuDivider.tsx +2 -2
  94. package/src/core/components/menu/menuGroup.tsx +10 -15
  95. package/src/core/components/menu/menuItem.tsx +7 -18
  96. package/src/core/components/tab/__workshop__/example.tsx +1 -1
  97. package/src/core/components/tab/__workshop__/index.ts +5 -3
  98. package/src/core/components/tab/tab.tsx +6 -4
  99. package/src/core/components/tab/tabList.tsx +3 -8
  100. package/src/core/components/tab/tabPanel.tsx +2 -2
  101. package/src/core/components/toast/__workshop__/hook.tsx +1 -1
  102. package/src/core/components/toast/__workshop__/index.ts +5 -3
  103. package/src/core/components/toast/__workshop__/toast.tsx +1 -1
  104. package/src/core/components/toast/toast.test.tsx +2 -1
  105. package/src/core/components/toast/toast.tsx +2 -2
  106. package/src/core/components/toast/toastContext.ts +4 -4
  107. package/src/core/components/toast/toastLayer.tsx +3 -3
  108. package/src/core/components/tree/__workshop__/basic.perf.ts +1 -1
  109. package/src/core/components/tree/__workshop__/basic.tsx +1 -1
  110. package/src/core/components/tree/__workshop__/index.ts +5 -3
  111. package/src/core/components/tree/__workshop__/tabFromElement.tsx +1 -1
  112. package/src/core/components/tree/tree.tsx +8 -9
  113. package/src/core/components/tree/treeContext.ts +4 -4
  114. package/src/core/components/tree/treeGroup.tsx +6 -8
  115. package/src/core/components/tree/treeItem.tsx +4 -4
  116. package/src/core/components/tree/types.ts +1 -1
  117. package/src/core/components/virtualList/__workshop__/changingProps.tsx +1 -1
  118. package/src/core/components/virtualList/__workshop__/elementScroll.tsx +1 -1
  119. package/src/core/components/virtualList/__workshop__/index.ts +5 -3
  120. package/src/core/components/virtualList/__workshop__/infiniteList.tsx +1 -1
  121. package/src/core/components/virtualList/__workshop__/windowScrolll.tsx +1 -1
  122. package/src/core/components/virtualList/virtualList.tsx +2 -2
  123. package/src/core/constants.ts +0 -18
  124. package/src/core/hooks/useMediaIndex/__workshop__/index.ts +5 -3
  125. package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +1 -1
  126. package/src/core/hooks/useMediaIndex/useMediaIndex.ts +6 -1
  127. package/src/core/index.ts +1 -24
  128. package/src/core/lib/createGlobalScopedContext.ts +1 -1
  129. package/src/core/lib/globalScope.ts +1 -1
  130. package/src/core/observers/elementSize.ts +1 -1
  131. package/src/core/primitives/arrow/arrow.tsx +2 -2
  132. package/src/core/primitives/avatar/__workshop__/asButton.tsx +1 -1
  133. package/src/core/primitives/avatar/__workshop__/index.ts +5 -3
  134. package/src/core/primitives/avatar/__workshop__/stack.tsx +1 -1
  135. package/src/core/primitives/avatar/__workshop__/withinButton.tsx +1 -1
  136. package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +1 -1
  137. package/src/core/primitives/avatar/avatar.tsx +3 -10
  138. package/src/core/primitives/avatar/avatarCounter.tsx +2 -2
  139. package/src/core/primitives/avatar/avatarStack.tsx +2 -4
  140. package/src/core/primitives/avatar/types.ts +0 -32
  141. package/src/core/primitives/badge/__workshop__/index.ts +5 -3
  142. package/src/core/primitives/badge/__workshop__/props.tsx +1 -1
  143. package/src/core/primitives/badge/__workshop__/tones.tsx +3 -3
  144. package/src/core/primitives/badge/badge.test.tsx +2 -1
  145. package/src/core/primitives/badge/badge.tsx +12 -11
  146. package/src/core/primitives/box/__workshop__/index.ts +5 -3
  147. package/src/core/primitives/box/__workshop__/props.tsx +1 -1
  148. package/src/core/primitives/box/__workshop__/responsive.tsx +1 -1
  149. package/src/core/primitives/box/box.tsx +28 -32
  150. package/src/core/primitives/button/__workshop__/custom.tsx +5 -5
  151. package/src/core/primitives/button/__workshop__/customIcons.tsx +1 -1
  152. package/src/core/primitives/button/__workshop__/disabled.tsx +3 -3
  153. package/src/core/primitives/button/__workshop__/index.ts +5 -3
  154. package/src/core/primitives/button/__workshop__/mixedChildren.tsx +1 -1
  155. package/src/core/primitives/button/__workshop__/props.tsx +1 -1
  156. package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +1 -1
  157. package/src/core/primitives/button/__workshop__/stacked.tsx +1 -1
  158. package/src/core/primitives/button/__workshop__/styled1.tsx +1 -1
  159. package/src/core/primitives/button/__workshop__/styled2.tsx +1 -1
  160. package/src/core/primitives/button/__workshop__/textOverflow.tsx +1 -1
  161. package/src/core/primitives/button/__workshop__/uploadButton.tsx +1 -1
  162. package/src/core/primitives/button/button.test.tsx +2 -1
  163. package/src/core/primitives/button/button.tsx +4 -7
  164. package/src/core/primitives/button/types.ts +0 -20
  165. package/src/core/primitives/card/__workshop__/asButton.tsx +2 -2
  166. package/src/core/primitives/card/__workshop__/asComponent.tsx +1 -1
  167. package/src/core/primitives/card/__workshop__/checkered.tsx +3 -3
  168. package/src/core/primitives/card/__workshop__/index.ts +5 -3
  169. package/src/core/primitives/card/__workshop__/interactive.tsx +1 -1
  170. package/src/core/primitives/card/__workshop__/listNavigation.tsx +1 -1
  171. package/src/core/primitives/card/__workshop__/props.tsx +1 -1
  172. package/src/core/primitives/card/__workshop__/selected.tsx +1 -1
  173. package/src/core/primitives/card/__workshop__/styled.tsx +1 -1
  174. package/src/core/primitives/card/__workshop__/tones.tsx +3 -3
  175. package/src/core/primitives/card/card.tsx +4 -2
  176. package/src/core/primitives/card/cardContext.ts +1 -1
  177. package/src/core/primitives/card/cardProvider.tsx +4 -4
  178. package/src/core/primitives/card/types.ts +5 -19
  179. package/src/core/primitives/checkbox/__workshop__/example.tsx +1 -1
  180. package/src/core/primitives/checkbox/__workshop__/index.ts +5 -3
  181. package/src/core/primitives/checkbox/__workshop__/props.tsx +1 -1
  182. package/src/core/primitives/checkbox/__workshop__/readOnly.tsx +1 -1
  183. package/src/core/primitives/checkbox/__workshop__/tones.tsx +3 -3
  184. package/src/core/primitives/checkbox/checkbox.tsx +2 -2
  185. package/src/core/primitives/code/__workshop__/index.ts +5 -3
  186. package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +1 -1
  187. package/src/core/primitives/code/__workshop__/props.tsx +1 -1
  188. package/src/core/primitives/code/code.tsx +4 -2
  189. package/src/core/primitives/code/refractor.tsx +1 -1
  190. package/src/core/primitives/container/__workshop__/example.tsx +1 -1
  191. package/src/core/primitives/container/__workshop__/index.ts +5 -3
  192. package/src/core/primitives/container/container.tsx +2 -2
  193. package/src/core/primitives/flex/__workshop__/example.tsx +1 -1
  194. package/src/core/primitives/flex/__workshop__/gap.tsx +1 -1
  195. package/src/core/primitives/flex/__workshop__/index.ts +5 -3
  196. package/src/core/primitives/flex/flex.tsx +4 -2
  197. package/src/core/primitives/grid/__workshop__/index.ts +5 -3
  198. package/src/core/primitives/grid/__workshop__/responsive.tsx +3 -3
  199. package/src/core/primitives/grid/grid.tsx +4 -2
  200. package/src/core/primitives/heading/__workshop__/index.ts +5 -3
  201. package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +1 -1
  202. package/src/core/primitives/heading/__workshop__/plain.tsx +1 -1
  203. package/src/core/primitives/heading/heading.tsx +2 -4
  204. package/src/core/primitives/inline/__workshop__/index.ts +5 -3
  205. package/src/core/primitives/inline/__workshop__/plain.tsx +1 -1
  206. package/src/core/primitives/inline/inline.tsx +4 -11
  207. package/src/core/primitives/kbd/__workshop__/index.ts +5 -3
  208. package/src/core/primitives/kbd/__workshop__/plain.tsx +1 -1
  209. package/src/core/primitives/kbd/kbd.tsx +4 -2
  210. package/src/core/primitives/label/__workshop__/index.ts +5 -3
  211. package/src/core/primitives/label/__workshop__/opticalAlignment.tsx +1 -1
  212. package/src/core/primitives/label/__workshop__/plain.tsx +1 -1
  213. package/src/core/primitives/label/label.tsx +2 -4
  214. package/src/core/primitives/layer/__workshop__/_debug.tsx +1 -1
  215. package/src/core/primitives/layer/__workshop__/index.ts +5 -3
  216. package/src/core/primitives/layer/__workshop__/multipleRoots.tsx +1 -1
  217. package/src/core/primitives/layer/__workshop__/nested.tsx +1 -1
  218. package/src/core/primitives/layer/__workshop__/responsiveZOffset.tsx +1 -1
  219. package/src/core/primitives/layer/layer.test.tsx +2 -1
  220. package/src/core/primitives/layer/layer.tsx +2 -2
  221. package/src/core/primitives/layer/layerCard.tsx +2 -2
  222. package/src/core/primitives/layer/layerContext.ts +4 -4
  223. package/src/core/primitives/layer/layerProvider.tsx +2 -10
  224. package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +2 -2
  225. package/src/core/primitives/popover/__workshop__/MarginsStory.tsx +1 -1
  226. package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +1 -1
  227. package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +1 -1
  228. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +2 -2
  229. package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +3 -3
  230. package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +3 -3
  231. package/src/core/primitives/popover/__workshop__/index.ts +5 -3
  232. package/src/core/primitives/popover/popover.tsx +34 -17
  233. package/src/core/primitives/popover/popoverLayer.tsx +2 -2
  234. package/src/core/primitives/radio/__workshop__/example.tsx +1 -1
  235. package/src/core/primitives/radio/__workshop__/index.ts +5 -3
  236. package/src/core/primitives/radio/__workshop__/plain.tsx +1 -1
  237. package/src/core/primitives/radio/radio.tsx +2 -2
  238. package/src/core/primitives/select/__workshop__/index.ts +5 -3
  239. package/src/core/primitives/select/__workshop__/plain.tsx +1 -1
  240. package/src/core/primitives/select/__workshop__/readOnly.tsx +1 -1
  241. package/src/core/primitives/select/select.tsx +5 -15
  242. package/src/core/primitives/selectable/selectable.tsx +4 -4
  243. package/src/core/primitives/skeleton/__workshop__/delay.tsx +1 -1
  244. package/src/core/primitives/skeleton/__workshop__/index.ts +5 -3
  245. package/src/core/primitives/skeleton/__workshop__/skeleton.tsx +2 -2
  246. package/src/core/primitives/skeleton/codeSkeleton.tsx +2 -2
  247. package/src/core/primitives/skeleton/headingSkeleton.tsx +2 -2
  248. package/src/core/primitives/skeleton/labelSkeleton.tsx +2 -2
  249. package/src/core/primitives/skeleton/skeleton.tsx +2 -2
  250. package/src/core/primitives/skeleton/textSkeleton.tsx +2 -2
  251. package/src/core/primitives/spinner/__workshop__/Props.tsx +1 -1
  252. package/src/core/primitives/spinner/__workshop__/index.ts +5 -3
  253. package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +2 -2
  254. package/src/core/primitives/spinner/spinner.tsx +2 -2
  255. package/src/core/primitives/srOnly/srOnly.tsx +2 -2
  256. package/src/core/primitives/stack/__workshop__/index.ts +5 -3
  257. package/src/core/primitives/stack/__workshop__/plain.tsx +1 -1
  258. package/src/core/primitives/stack/stack.tsx +5 -10
  259. package/src/core/primitives/switch/__workshop__/example.tsx +1 -1
  260. package/src/core/primitives/switch/__workshop__/index.ts +5 -3
  261. package/src/core/primitives/switch/__workshop__/props.tsx +1 -1
  262. package/src/core/primitives/switch/switch.tsx +2 -2
  263. package/src/core/primitives/text/__workshop__/colored.tsx +1 -1
  264. package/src/core/primitives/text/__workshop__/example.tsx +1 -1
  265. package/src/core/primitives/text/__workshop__/index.ts +5 -3
  266. package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +1 -1
  267. package/src/core/primitives/text/text.tsx +4 -4
  268. package/src/core/primitives/textArea/__workshop__/index.ts +5 -3
  269. package/src/core/primitives/textArea/__workshop__/plain.tsx +1 -1
  270. package/src/core/primitives/textArea/textArea.tsx +5 -15
  271. package/src/core/primitives/textInput/__workshop__/clearButton.tsx +1 -1
  272. package/src/core/primitives/textInput/__workshop__/customValidity.tsx +1 -1
  273. package/src/core/primitives/textInput/__workshop__/index.ts +5 -3
  274. package/src/core/primitives/textInput/__workshop__/plain.tsx +1 -1
  275. package/src/core/primitives/textInput/__workshop__/readOnly.tsx +1 -1
  276. package/src/core/primitives/textInput/__workshop__/states.tsx +1 -1
  277. package/src/core/primitives/textInput/__workshop__/tones.tsx +1 -1
  278. package/src/core/primitives/textInput/__workshop__/typed.tsx +1 -1
  279. package/src/core/primitives/textInput/textInput.tsx +6 -9
  280. package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +1 -1
  281. package/src/core/primitives/tooltip/__workshop__/index.ts +5 -3
  282. package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +1 -1
  283. package/src/core/primitives/tooltip/__workshop__/props.tsx +1 -1
  284. package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +1 -1
  285. package/src/core/primitives/tooltip/constants.ts +1 -1
  286. package/src/core/primitives/tooltip/tooltip.test.tsx +2 -4
  287. package/src/core/primitives/tooltip/tooltip.tsx +5 -9
  288. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +4 -2
  289. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +5 -3
  290. package/src/core/primitives/tooltip/tooltipLayer.tsx +2 -2
  291. package/src/core/{types/props.ts → types.ts} +27 -0
  292. package/src/core/utils/boundaryElement/__workshop__/index.ts +5 -3
  293. package/src/core/utils/boundaryElement/__workshop__/plain.tsx +1 -1
  294. package/src/core/utils/boundaryElement/boundaryElement.test.tsx +2 -1
  295. package/src/core/utils/boundaryElement/boundaryElementContext.ts +7 -4
  296. package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +2 -2
  297. package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +1 -1
  298. package/src/core/utils/elementQuery/__workshop__/index.ts +5 -3
  299. package/src/core/utils/elementQuery/elementQuery.tsx +2 -2
  300. package/src/core/utils/getElementRef.ts +1 -1
  301. package/src/core/utils/portal/__workshop__/index.ts +5 -3
  302. package/src/core/utils/portal/__workshop__/named.tsx +1 -1
  303. package/src/core/utils/portal/portal.test.tsx +2 -1
  304. package/src/core/utils/portal/portalContext.ts +5 -2
  305. package/src/core/utils/portal/portalProvider.tsx +5 -9
  306. package/src/css/_responsiveClassName.ts +2 -2
  307. package/src/css/_style.css.ts +1 -1
  308. package/src/css/components/breadcrumbs/breadcrumbs.css.ts +1 -1
  309. package/src/css/components/dialog/dialog.css.ts +9 -17
  310. package/src/css/components/menu/menu.css.ts +2 -2
  311. package/src/css/components/menu/menu.ts +2 -2
  312. package/src/css/components/skeleton/skeleton.css.ts +2 -6
  313. package/src/css/components/toast/toast.css.ts +2 -2
  314. package/src/css/components/toast/toast.ts +2 -2
  315. package/src/css/components/tree/tree.css.ts +1 -1
  316. package/src/css/components/tree/tree.ts +1 -1
  317. package/src/css/defaultTheme.css.ts +59 -60
  318. package/src/css/layers.css.ts +4 -1
  319. package/src/css/primitives/_arrow/_arrow.css.ts +5 -5
  320. package/src/css/primitives/_input/_input.css.ts +4 -4
  321. package/src/css/primitives/_selectable/_selectable.css.ts +4 -4
  322. package/src/css/primitives/_selectable/types.ts +2 -2
  323. package/src/css/primitives/avatar/avatar.css.ts +10 -10
  324. package/src/css/primitives/badge/badge.css.ts +4 -4
  325. package/src/css/primitives/badge/types.ts +8 -2
  326. package/src/css/primitives/box/box.css.ts +2 -2
  327. package/src/css/primitives/button/button.css.ts +6 -6
  328. package/src/css/primitives/button/button.ts +2 -2
  329. package/src/css/primitives/button/types.ts +3 -3
  330. package/src/css/primitives/card/__workshop__/color.tsx +9 -9
  331. package/src/css/primitives/card/__workshop__/index.ts +5 -3
  332. package/src/css/primitives/card/card.css.ts +12 -18
  333. package/src/css/primitives/card/types.ts +3 -3
  334. package/src/css/primitives/checkbox/checkbox.css.ts +3 -3
  335. package/src/css/primitives/checkbox/checkbox.ts +3 -3
  336. package/src/css/primitives/code/code.css.ts +4 -3
  337. package/src/css/primitives/code/types.ts +3 -4
  338. package/src/css/primitives/container/container.css.ts +1 -1
  339. package/src/css/primitives/heading/heading.css.ts +5 -4
  340. package/src/css/primitives/heading/types.ts +3 -6
  341. package/src/css/primitives/kbd/kbd.css.ts +1 -1
  342. package/src/css/primitives/label/label.css.ts +5 -4
  343. package/src/css/primitives/label/types.ts +0 -8
  344. package/src/css/primitives/popover/popover.css.ts +2 -2
  345. package/src/css/primitives/popover/popover.ts +2 -2
  346. package/src/css/primitives/radio/radio.css.ts +3 -3
  347. package/src/css/primitives/radio/radio.ts +3 -3
  348. package/src/css/primitives/root/root.css.ts +2 -2
  349. package/src/css/primitives/root/root.ts +2 -2
  350. package/src/css/primitives/root/types.ts +3 -3
  351. package/src/css/primitives/select/select.css.ts +3 -3
  352. package/src/css/primitives/spinner/spinner.css.ts +2 -6
  353. package/src/css/primitives/spinner/spinner.ts +2 -2
  354. package/src/css/primitives/srOnly/srOnly.css.ts +1 -1
  355. package/src/css/primitives/srOnly/srOnly.ts +1 -1
  356. package/src/css/primitives/stack/stack.css.ts +1 -1
  357. package/src/css/primitives/stack/stack.ts +1 -1
  358. package/src/css/primitives/switch/switch.css.ts +5 -5
  359. package/src/css/primitives/text/text.css.ts +5 -4
  360. package/src/css/primitives/text/types.ts +3 -5
  361. package/src/css/primitives/textArea/textArea.css.ts +1 -1
  362. package/src/css/primitives/textInput/textInput.css.ts +4 -4
  363. package/src/css/primitives/tooltip/tooltip.css.ts +1 -1
  364. package/src/css/props/alignItems/alignItems.ts +1 -1
  365. package/src/css/props/border/border.ts +1 -16
  366. package/src/css/props/boxSizing/boxSizing.css.ts +2 -1
  367. package/src/css/props/boxSizing/boxSizing.ts +0 -3
  368. package/src/css/props/display/display.ts +1 -10
  369. package/src/css/props/flex/flex.ts +1 -1
  370. package/src/css/props/flexDirection/flexDirection.ts +1 -1
  371. package/src/css/props/flexWrap/flexWrap.ts +1 -1
  372. package/src/css/props/font/font.css.ts +3 -2
  373. package/src/css/props/font/font.ts +1 -1
  374. package/src/css/props/gap/gap.ts +1 -1
  375. package/src/css/props/gridAutoColumns/gridAutoColumns.css.ts +2 -2
  376. package/src/css/props/gridAutoColumns/gridAutoColumns.ts +2 -2
  377. package/src/css/props/gridAutoColumns/types.ts +0 -10
  378. package/src/css/props/gridAutoFlow/gridAutoFlow.ts +2 -2
  379. package/src/css/props/gridAutoFlow/types.ts +0 -4
  380. package/src/css/props/gridAutoRows/gridAutoRows.ts +2 -2
  381. package/src/css/props/gridAutoRows/types.ts +0 -4
  382. package/src/css/props/gridColumn/gridColumn.ts +3 -3
  383. package/src/css/props/gridColumn/types.ts +0 -10
  384. package/src/css/props/gridColumnEnd/gridColumnEnd.ts +3 -3
  385. package/src/css/props/gridColumnEnd/types.ts +0 -10
  386. package/src/css/props/gridColumnStart/gridColumnStart.ts +3 -6
  387. package/src/css/props/gridColumnStart/types.ts +0 -10
  388. package/src/css/props/gridRow/gridRow.ts +3 -3
  389. package/src/css/props/gridRow/types.ts +0 -10
  390. package/src/css/props/gridRowEnd/gridRowEnd.ts +3 -3
  391. package/src/css/props/gridRowEnd/types.ts +0 -10
  392. package/src/css/props/gridRowStart/gridRowStart.ts +3 -3
  393. package/src/css/props/gridRowStart/types.ts +0 -10
  394. package/src/css/props/gridTemplateColumns/gridTemplateColumns.ts +2 -2
  395. package/src/css/props/gridTemplateColumns/types.ts +0 -10
  396. package/src/css/props/gridTemplateRows/gridTemplateRows.ts +2 -2
  397. package/src/css/props/gridTemplateRows/types.ts +0 -10
  398. package/src/css/props/height/height.ts +1 -1
  399. package/src/css/props/height/types.ts +0 -6
  400. package/src/css/props/inset/inset.ts +1 -1
  401. package/src/css/props/justifyContent/justifyContent.ts +1 -1
  402. package/src/css/props/margin/margin.ts +1 -1
  403. package/src/css/props/maxWidth/maxWidth.ts +1 -1
  404. package/src/css/props/minHeight/minHeight.ts +1 -1
  405. package/src/css/props/minWidth/minWidth.ts +1 -1
  406. package/src/css/props/outline/outline.ts +1 -1
  407. package/src/css/props/overflow/overflow.ts +1 -1
  408. package/src/css/props/overflow/types.ts +0 -6
  409. package/src/css/props/padding/padding.ts +1 -1
  410. package/src/css/props/pointerEvents/pointerEvents.ts +1 -1
  411. package/src/css/props/position/position.ts +1 -1
  412. package/src/css/props/radius/radius.ts +1 -1
  413. package/src/css/props/shadow/shadow.ts +1 -1
  414. package/src/css/props/textAlign/textAlign.ts +1 -1
  415. package/src/css/props/textOverflow/textOverflow.ts +1 -1
  416. package/src/css/props/width/width.ts +1 -1
  417. package/src/css/types.ts +225 -53
  418. package/src/css/util.ts +2 -2
  419. package/src/css/vars.css.ts +33 -36
  420. package/src/theme/{v3/_parseColorToken.ts → _parseColorToken.ts} +2 -2
  421. package/src/theme/buildTheme.ts +33 -0
  422. package/src/theme/constants.ts +90 -0
  423. package/src/theme/defaults/color.ts +197 -0
  424. package/src/theme/{v2/defaults/config.ts → defaults/common.ts} +3 -16
  425. package/src/theme/{v3/defaultFonts.ts → defaults/fonts.ts} +2 -2
  426. package/src/theme/index.ts +4 -5
  427. package/src/theme/{v3/resolveTokens.ts → resolveTokens.ts} +15 -15
  428. package/src/theme/types.ts +355 -15
  429. package/dist/css/layers.css +0 -4
  430. package/dist/css/primitives/popover/popover.css +0 -4
  431. package/src/core/__DEV__.ts +0 -5
  432. package/src/core/_compat/helpers.ts +0 -72
  433. package/src/core/_compat/styles/_responsive.ts +0 -19
  434. package/src/core/_compat/theme/theme.test.tsx +0 -73
  435. package/src/core/_compat/theme/themeColorProvider.tsx +0 -24
  436. package/src/core/_compat/theme/themeContext.ts +0 -10
  437. package/src/core/_compat/theme/themeProvider.tsx +0 -68
  438. package/src/core/_compat/theme/types.ts +0 -10
  439. package/src/core/_compat/theme/useRootTheme.ts +0 -15
  440. package/src/core/_compat/theme/useTheme.ts +0 -12
  441. package/src/core/_compat/types.ts +0 -191
  442. package/src/core/hooks/useArrayProp.ts +0 -26
  443. package/src/core/hooks/useClickOutside.test.tsx +0 -481
  444. package/src/core/hooks/useClickOutside.ts +0 -113
  445. package/src/core/hooks/useElementRect/__workshop__/example.tsx +0 -30
  446. package/src/core/hooks/useElementRect/__workshop__/index.ts +0 -14
  447. package/src/core/hooks/useElementRect/useElementRect.ts +0 -13
  448. package/src/core/hooks/useForwardedRef.ts +0 -19
  449. package/src/core/hooks/useIsomorphicEffect.ts +0 -7
  450. package/src/core/primitives/badge/types.ts +0 -18
  451. package/src/core/primitives/box/types.ts +0 -22
  452. package/src/core/primitives/flex/types.ts +0 -27
  453. package/src/core/primitives/grid/types.ts +0 -17
  454. package/src/core/primitives/selectable/types.ts +0 -7
  455. package/src/core/primitives/types.ts +0 -153
  456. package/src/core/types/gridItem.ts +0 -32
  457. package/src/core/types/placement.ts +0 -18
  458. package/src/core/types/radius.ts +0 -7
  459. package/src/core/types/textAlign.ts +0 -7
  460. package/src/core/utils/spanWithTextOverflow.tsx +0 -10
  461. package/src/theme/getScopedTheme.ts +0 -88
  462. package/src/theme/v0/avatar.ts +0 -10
  463. package/src/theme/v0/color/_generic.ts +0 -35
  464. package/src/theme/v0/color/_system.ts +0 -17
  465. package/src/theme/v0/color/base.ts +0 -21
  466. package/src/theme/v0/color/button.ts +0 -42
  467. package/src/theme/v0/color/card.ts +0 -19
  468. package/src/theme/v0/color/color.ts +0 -40
  469. package/src/theme/v0/color/index.ts +0 -11
  470. package/src/theme/v0/color/input.ts +0 -34
  471. package/src/theme/v0/color/muted.ts +0 -26
  472. package/src/theme/v0/color/selectable.ts +0 -31
  473. package/src/theme/v0/color/solid.ts +0 -26
  474. package/src/theme/v0/color/spot.ts +0 -13
  475. package/src/theme/v0/css.ts +0 -10
  476. package/src/theme/v0/focusRing.ts +0 -5
  477. package/src/theme/v0/font.ts +0 -40
  478. package/src/theme/v0/index.ts +0 -10
  479. package/src/theme/v0/input.ts +0 -23
  480. package/src/theme/v0/layer.ts +0 -6
  481. package/src/theme/v0/shadow.ts +0 -15
  482. package/src/theme/v0/styles.ts +0 -13
  483. package/src/theme/v0/theme.ts +0 -72
  484. package/src/theme/v2/avatar.ts +0 -12
  485. package/src/theme/v2/build/_deprecated/color/_selectable/createSelectableTones.ts +0 -76
  486. package/src/theme/v2/build/_deprecated/color/_solid/createSolidTones.ts +0 -54
  487. package/src/theme/v2/build/_deprecated/color/button/createButtonModes.ts +0 -22
  488. package/src/theme/v2/build/_deprecated/color/button/createButtonTones.ts +0 -55
  489. package/src/theme/v2/build/_deprecated/color/card/createCardStates.ts +0 -60
  490. package/src/theme/v2/build/_deprecated/color/color.test.ts +0 -63
  491. package/src/theme/v2/build/_deprecated/color/defaults.ts +0 -390
  492. package/src/theme/v2/build/_deprecated/color/factory.ts +0 -141
  493. package/src/theme/v2/build/_deprecated/color/index.ts +0 -1
  494. package/src/theme/v2/build/_deprecated/color/input/createInputModes.ts +0 -86
  495. package/src/theme/v2/build/_deprecated/color/muted/createMuted.ts +0 -54
  496. package/src/theme/v2/build/_deprecated/color/spot/createSpot.ts +0 -20
  497. package/src/theme/v2/build/buildColorTheme.test.ts +0 -185
  498. package/src/theme/v2/build/buildColorTheme.ts +0 -494
  499. package/src/theme/v2/build/buildTheme.test.ts +0 -89
  500. package/src/theme/v2/build/buildTheme.ts +0 -37
  501. package/src/theme/v2/build/colorToken/colorToken.ts +0 -19
  502. package/src/theme/v2/build/colorToken/compileColorToken.ts +0 -21
  503. package/src/theme/v2/build/colorToken/index.ts +0 -2
  504. package/src/theme/v2/build/colorToken/types.ts +0 -6
  505. package/src/theme/v2/build/index.ts +0 -3
  506. package/src/theme/v2/build/lib/color-fns/blend/index.ts +0 -3
  507. package/src/theme/v2/build/lib/color-fns/blend/mix.ts +0 -21
  508. package/src/theme/v2/build/lib/color-fns/blend/multiply.ts +0 -18
  509. package/src/theme/v2/build/lib/color-fns/blend/screen.ts +0 -18
  510. package/src/theme/v2/build/lib/color-fns/color-fns.test.ts +0 -68
  511. package/src/theme/v2/build/lib/color-fns/contrastRatio.ts +0 -34
  512. package/src/theme/v2/build/lib/color-fns/convert.ts +0 -150
  513. package/src/theme/v2/build/lib/color-fns/index.ts +0 -6
  514. package/src/theme/v2/build/lib/color-fns/parse.ts +0 -60
  515. package/src/theme/v2/build/lib/color-fns/rgba.ts +0 -14
  516. package/src/theme/v2/build/lib/color-fns/types.ts +0 -28
  517. package/src/theme/v2/build/lib/isRecord.ts +0 -3
  518. package/src/theme/v2/build/lib/utils.ts +0 -19
  519. package/src/theme/v2/build/merge.ts +0 -28
  520. package/src/theme/v2/build/mixThemeColor.test.ts +0 -23
  521. package/src/theme/v2/build/mixThemeColor.ts +0 -53
  522. package/src/theme/v2/build/renderColorTheme.ts +0 -532
  523. package/src/theme/v2/build/renderColorValue.ts +0 -85
  524. package/src/theme/v2/build/resolveColorTokens.ts +0 -268
  525. package/src/theme/v2/color/_constants.ts +0 -45
  526. package/src/theme/v2/color/_helpers.ts +0 -24
  527. package/src/theme/v2/color/_system.ts +0 -38
  528. package/src/theme/v2/color/avatar.ts +0 -11
  529. package/src/theme/v2/color/badge.ts +0 -12
  530. package/src/theme/v2/color/button.ts +0 -11
  531. package/src/theme/v2/color/color.ts +0 -28
  532. package/src/theme/v2/color/index.ts +0 -13
  533. package/src/theme/v2/color/input.ts +0 -23
  534. package/src/theme/v2/color/kbd.ts +0 -6
  535. package/src/theme/v2/color/selectable.ts +0 -8
  536. package/src/theme/v2/color/shadow.ts +0 -7
  537. package/src/theme/v2/color/state.ts +0 -41
  538. package/src/theme/v2/color/syntax.ts +0 -39
  539. package/src/theme/v2/config/helpers.ts +0 -48
  540. package/src/theme/v2/config/index.ts +0 -4
  541. package/src/theme/v2/config/system.ts +0 -114
  542. package/src/theme/v2/config/tokens/color/index.ts +0 -1
  543. package/src/theme/v2/config/tokens/color/types.ts +0 -137
  544. package/src/theme/v2/config/tokens/index.ts +0 -3
  545. package/src/theme/v2/config/tokens/parseTokenValue.test.ts +0 -44
  546. package/src/theme/v2/config/tokens/parseTokenValue.ts +0 -133
  547. package/src/theme/v2/config/tokens/types.ts +0 -53
  548. package/src/theme/v2/config/types.ts +0 -47
  549. package/src/theme/v2/defaults/colorPalette.ts +0 -5
  550. package/src/theme/v2/defaults/colorTokens.ts +0 -648
  551. package/src/theme/v2/defaults/fonts.ts +0 -227
  552. package/src/theme/v2/index.ts +0 -6
  553. package/src/theme/v2/input.ts +0 -31
  554. package/src/theme/v2/theme.ts +0 -45
  555. package/src/theme/v3/_constants.ts +0 -29
  556. package/src/theme/v3/buildTheme_v3.ts +0 -39
  557. package/src/theme/v3/color/_constants.ts +0 -15
  558. package/src/theme/v3/color/avatar.ts +0 -14
  559. package/src/theme/v3/color/card.ts +0 -79
  560. package/src/theme/v3/color/color.ts +0 -98
  561. package/src/theme/v3/color/element.ts +0 -19
  562. package/src/theme/v3/color/index.ts +0 -7
  563. package/src/theme/v3/color/token.ts +0 -32
  564. package/src/theme/v3/color/tokens.ts +0 -5
  565. package/src/theme/v3/defaultTokens.ts +0 -199
  566. package/src/theme/v3/index.ts +0 -9
  567. package/src/theme/v3/palette/constants.ts +0 -15
  568. package/src/theme/v3/palette/index.ts +0 -2
  569. package/src/theme/v3/palette/types.ts +0 -7
  570. package/src/theme/v3/tokens.ts +0 -16
  571. package/src/theme/v3/types.ts +0 -133
  572. package/src/theme/versioning/getTheme_v2.ts +0 -58
  573. package/src/theme/versioning/index.ts +0 -1
  574. package/src/theme/versioning/is_v0.ts +0 -7
  575. package/src/theme/versioning/is_v2.ts +0 -7
  576. package/src/theme/versioning/themeColor_v0_v2.ts +0 -245
  577. package/src/theme/versioning/themeColor_v2_v2_9.ts +0 -49
  578. package/src/theme/versioning/themeColor_v3_v2.ts +0 -383
  579. package/src/theme/versioning/v0_v2.ts +0 -95
  580. package/src/theme/versioning/v2_v0.ts +0 -127
  581. package/src/theme/versioning/v3_v2.ts +0 -130
  582. /package/src/theme/{v3/merge.ts → merge.ts} +0 -0
package/dist/theme.d.cts CHANGED
@@ -1,1903 +1,369 @@
1
- import {ColorHueKey} from '@sanity/color'
2
- import type {ColorHues} from '@sanity/color'
3
- import type {ColorTint} from '@sanity/color'
4
- import {ColorTintKey} from '@sanity/color'
5
- import type {Hue as Hue_2} from '@sanity/ui/theme'
6
- import type {StyledObject} from 'styled-components'
7
-
1
+ import { ColorHues, ColorTint } from "@sanity/color";
8
2
  /** @public */
9
- export declare const AVATAR_COLORS: readonly [
10
- 'gray',
11
- 'blue',
12
- 'purple',
13
- 'magenta',
14
- 'red',
15
- 'orange',
16
- 'yellow',
17
- 'green',
18
- 'cyan',
19
- ]
20
-
3
+ declare const HUES: readonly ["gray", "blue", "purple", "magenta", "red", "orange", "yellow", "green", "cyan"];
21
4
  /** @public */
22
- export declare const AVATAR_SIZE: readonly [0, 1, 2, 3]
23
-
5
+ declare const TINTS: readonly [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950];
24
6
  /** @public */
25
- export declare type AvatarColor = (typeof AVATAR_COLORS)[number]
26
-
7
+ declare const AVATAR_SIZE: readonly [0, 1, 2, 3];
27
8
  /** @public */
28
- export declare type AvatarSize = (typeof AVATAR_SIZE)[number]
29
-
9
+ declare const CONTAINER_SCALE: readonly [0, 1, 2, 3, 4, 5];
30
10
  /** @public */
31
- export declare type BaseTheme = RootTheme
32
-
33
- /** @internal */
34
- export declare function buildTheme(config?: ThemeConfig): RootTheme
35
-
36
- /** @public */
37
- export declare function buildTheme_v3(options?: ThemeOptions): Theme_v3
38
-
39
- /** @public */
40
- export declare interface CardColorTokens {
41
- _hue: Hue
42
- avatar: Record<
43
- Hue,
44
- {
45
- _hue: Hue
46
- bg: ColorValue
47
- fg: ColorValue
48
- }
49
- >
50
- backdrop: ColorValue
51
- code: {
52
- bg: ColorValue
53
- fg: ColorValue
54
- token: {
55
- atrule: ColorValue
56
- attrName: ColorValue
57
- attrValue: ColorValue
58
- attribute: ColorValue
59
- boolean: ColorValue
60
- builtin: ColorValue
61
- cdata: ColorValue
62
- char: ColorValue
63
- class: ColorValue
64
- className: ColorValue
65
- comment: ColorValue
66
- constant: ColorValue
67
- deleted: ColorValue
68
- doctype: ColorValue
69
- entity: ColorValue
70
- function: ColorValue
71
- hexcode: ColorValue
72
- id: ColorValue
73
- important: ColorValue
74
- inserted: ColorValue
75
- keyword: ColorValue
76
- number: ColorValue
77
- operator: ColorValue
78
- prolog: ColorValue
79
- property: ColorValue
80
- pseudoClass: ColorValue
81
- pseudoElement: ColorValue
82
- punctuation: ColorValue
83
- regex: ColorValue
84
- selector: ColorValue
85
- string: ColorValue
86
- symbol: ColorValue
87
- tag: ColorValue
88
- unit: ColorValue
89
- url: ColorValue
90
- variable: ColorValue
91
- }
92
- }
93
- focusRing: ColorValue
94
- link: {
95
- fg: ColorValue
96
- }
97
- shadow: {
98
- outline: ColorValue
99
- umbra: ColorValue
100
- penumbra: ColorValue
101
- ambient: ColorValue
102
- }
103
- skeleton: {
104
- from: ColorValue
105
- to: ColorValue
106
- }
107
- variant: {
108
- solid: Record<'*' | ThemeColorStateToneKey, ElementColorTokens>
109
- tinted: Record<'*' | ThemeColorStateToneKey, ElementColorTokens>
110
- }
111
- }
112
-
11
+ declare const CONTAINER: [...typeof CONTAINER_SCALE, "auto"];
113
12
  /** @public */
114
- export declare const COLOR_CONFIG_AVATAR_COLORS: readonly ['*', ...ColorHueKey[]]
115
-
13
+ declare const RADIUS: readonly [0, 1, 2, 3, 4, 5, 6];
116
14
  /** @public */
117
- export declare const COLOR_CONFIG_BLEND_KEYS: readonly ['_blend']
118
-
15
+ declare const SPACE: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9];
119
16
  /** @public */
120
- export declare const COLOR_CONFIG_CARD_KEYS: readonly [
121
- '_hue',
122
- 'bg',
123
- 'fg',
124
- 'border',
125
- 'focusRing',
126
- 'muted/fg',
127
- 'accent/fg',
128
- 'link/fg',
129
- 'code/bg',
130
- 'code/fg',
131
- 'skeleton/from',
132
- 'skeleton/to',
133
- 'status/dot',
134
- 'status/icon',
135
- '_hue',
136
- 'bg',
137
- 'fg',
138
- 'border',
139
- 'focusRing',
140
- 'shadow/outline',
141
- 'shadow/umbra',
142
- 'shadow/penumbra',
143
- 'shadow/ambient',
144
- ]
145
-
17
+ declare const FONT_CODE_SIZE: readonly [0, 1, 2, 3, 4];
146
18
  /** @public */
147
- export declare const COLOR_CONFIG_CARD_TONES: readonly [
148
- '*',
149
- 'transparent',
150
- 'default',
151
- 'neutral',
152
- 'primary',
153
- 'suggest',
154
- 'positive',
155
- 'caution',
156
- 'critical',
157
- ]
158
-
19
+ declare const FONT_HEADING_SIZE: readonly [0, 1, 2, 3, 4, 5];
159
20
  /** @public */
160
- export declare const COLOR_CONFIG_INPUT_MODES: readonly ['*', 'default', 'invalid']
161
-
21
+ declare const FONT_LABEL_SIZE: readonly [0, 1, 2, 3, 4, 5];
162
22
  /** @public */
163
- export declare const COLOR_CONFIG_INPUT_STATES: readonly [
164
- '*',
165
- 'enabled',
166
- 'hovered',
167
- 'readOnly',
168
- 'disabled',
169
- ]
170
-
23
+ declare const FONT_TEXT_SIZE: readonly [0, 1, 2, 3, 4];
171
24
  /** @public */
172
- export declare const COLOR_CONFIG_STATE_KEYS: readonly [
173
- '_hue',
174
- 'bg',
175
- 'fg',
176
- 'border',
177
- 'focusRing',
178
- 'muted/fg',
179
- 'accent/fg',
180
- 'link/fg',
181
- 'code/bg',
182
- 'code/fg',
183
- 'skeleton/from',
184
- 'skeleton/to',
185
- 'status/dot',
186
- 'status/icon',
187
- ]
188
-
25
+ declare const SHADOW: readonly [0, 1, 2, 3, 4, 5];
189
26
  /** @public */
190
- export declare const COLOR_CONFIG_STATE_TONES: readonly [
191
- '*',
192
- 'default',
193
- 'neutral',
194
- 'primary',
195
- 'suggest',
196
- 'positive',
197
- 'caution',
198
- 'critical',
199
- ]
200
-
27
+ declare const COLOR_SCHEMES: readonly ["light", "dark"];
201
28
  /** @public */
202
- export declare const COLOR_CONFIG_STATES: readonly [
203
- '*',
204
- 'enabled',
205
- 'hovered',
206
- 'pressed',
207
- 'selected',
208
- 'disabled',
209
- ]
210
-
29
+ declare const COLOR_VARIANTS: readonly ["tinted", "solid"];
211
30
  /** @public */
212
- export declare const COLOR_VARIANTS: readonly ['tinted', 'solid']
213
-
31
+ declare const AVATAR_COLORS: readonly ["gray", "blue", "purple", "magenta", "red", "orange", "yellow", "green", "cyan"];
214
32
  /** @public */
215
- export declare type ColorBlendModeTokenValue = [ThemeColorBlendModeKey, ThemeColorBlendModeKey]
216
-
33
+ declare const CARD_TONES: readonly ["transparent", "default", "neutral", "primary", "suggest", "positive", "caution", "critical"];
217
34
  /** @public */
218
- export declare type ColorConfigAvatarColor = (typeof COLOR_CONFIG_AVATAR_COLORS)[number]
219
-
35
+ declare const ELEMENT_TONES: readonly ["default", "neutral", "primary", "suggest", "positive", "caution", "critical"];
220
36
  /** @public */
221
- export declare type ColorConfigBlendKey = (typeof COLOR_CONFIG_BLEND_KEYS)[number]
222
-
37
+ declare const BUTTON_MODES: readonly ["default", "ghost", "bleed"];
223
38
  /** @public */
224
- export declare type ColorConfigCardKey = (typeof COLOR_CONFIG_CARD_KEYS)[number]
225
-
39
+ type Hue = (typeof HUES)[number];
226
40
  /** @public */
227
- export declare type ColorConfigCardTone = (typeof COLOR_CONFIG_CARD_TONES)[number]
228
-
41
+ type Tint = (typeof TINTS)[number];
229
42
  /** @public */
230
- export declare type ColorConfigInputMode = (typeof COLOR_CONFIG_INPUT_MODES)[number]
231
-
43
+ type AvatarColor = (typeof AVATAR_COLORS)[number];
232
44
  /** @public */
233
- export declare type ColorConfigInputState = (typeof COLOR_CONFIG_INPUT_STATES)[number]
234
-
45
+ type ColorTokenOpacityValue = `0` | `0.${number}` | `1`;
235
46
  /** @public */
236
- export declare type ColorConfigOpacityValue = `0` | `0.${number}` | `1`
237
-
47
+ type ColorToken = `inherit` | `black` | `black/${ColorTokenOpacityValue}` | `white` | `white/${ColorTokenOpacityValue}` | `${Hue}-${Tint}` | `${Hue}-${Tint}/${ColorTokenOpacityValue}` | `${Hue}-${Tint} ${number}%` | `${Tint}` | `${Tint}/${ColorTokenOpacityValue}` | `${Tint} ${number}%`;
238
48
  /** @public */
239
- export declare type ColorConfigState = (typeof COLOR_CONFIG_STATES)[number]
240
-
241
- /** @public */
242
- export declare type ColorConfigStateKey = (typeof COLOR_CONFIG_STATE_KEYS)[number]
243
-
244
- /** @public */
245
- export declare type ColorConfigStateTone = (typeof COLOR_CONFIG_STATE_TONES)[number]
246
-
247
- /** @public */
248
- export declare type ColorConfigValue =
249
- | `black`
250
- | `white`
251
- | `black/${ColorConfigOpacityValue}`
252
- | `white/${ColorConfigOpacityValue}`
253
- | `${Hue}`
254
- | `${Hue} ${number}%`
255
- | `${Hue}/${Tint}`
256
- | `${Hue}/${Tint} ${number}%`
257
- | `${Hue}/${Tint}/${ColorConfigOpacityValue}`
258
- | `${Tint}`
259
- | `${Tint} ${number}%`
260
- | `${Tint}/${ColorConfigOpacityValue}`
261
-
262
- /** @internal */
263
- export declare interface ColorInheritNode {
264
- type: 'inherit'
49
+ interface ResolvedColorToken {
50
+ color: {
51
+ type: "inherit";
52
+ } | {
53
+ type: "black" | "white";
54
+ } | {
55
+ type: "hue";
56
+ hue: Hue;
57
+ tint: Tint;
58
+ };
59
+ opacity: number;
60
+ mix: number;
265
61
  }
266
-
267
- /** @internal */
268
- export declare interface ColorNode {
269
- type: 'color'
270
- name: 'black' | 'white'
271
- /** Between 0 and 1 */
272
- opacity: number
273
- /** Between 0 and 1 */
274
- mix: number
275
- }
276
-
277
- /** @internal */
278
- export declare interface ColorTintNode {
279
- type: 'tint'
280
- hue: Hue
281
- tint: Tint
282
- /** Between 0 and 1 */
283
- opacity: number
284
- /** Between 0 and 1 */
285
- mix: number
286
- }
287
-
288
62
  /** @public */
289
- export declare type ColorToken =
290
- | `inherit`
291
- | `black`
292
- | `black/${ColorTokenOpacityValue}`
293
- | `white`
294
- | `white/${ColorTokenOpacityValue}`
295
- | `${Hue}-${Tint}`
296
- | `${Hue}-${Tint}/${ColorTokenOpacityValue}`
297
- | `${Hue}-${Tint} ${number}%`
298
- | `${Tint}`
299
- | `${Tint}/${ColorTokenOpacityValue}`
300
- | `${Tint} ${number}%`
301
-
63
+ type ColorTokens = Record<"*" | CardTone, CardColorTokens>;
302
64
  /** @public */
303
- export declare type ColorTokenOpacityValue = `0` | `0.${number}` | `1`
304
-
65
+ interface Tokens {
66
+ color: ColorTokens;
67
+ }
305
68
  /** @public */
306
- export declare type ColorTokens = Record<'*' | ThemeColorCardToneKey, CardColorTokens>
307
-
69
+ type PartialTokens<T> = T extends [ColorToken, ColorToken] ? T : T extends {} ? { [P in keyof T]?: PartialTokens<T[P]> } : T;
308
70
  /**
309
- * Theme color values are tuples of [light, dark] color tokens.
310
- *
311
- * @public
312
- */
313
- export declare type ColorValue = [ColorToken, ColorToken]
314
-
315
- /** @public */
316
- export declare const CONTAINER: readonly [0, 1, 2, 3, 4, 5, 'auto']
317
-
71
+ * Theme color values are tuples of [light, dark] color tokens.
72
+ *
73
+ * @public
74
+ */
75
+ type ColorValue = [ColorToken, ColorToken];
318
76
  /** @public */
319
- export declare const CONTAINER_SCALE: readonly [0, 1, 2, 3, 4, 5]
320
-
77
+ interface AvatarColorProperties {
78
+ _hue: Hue;
79
+ bg: ColorValue;
80
+ fg: ColorValue;
81
+ }
321
82
  /** @public */
322
- export declare type ContainerScale = (typeof CONTAINER_SCALE)[number]
323
-
83
+ type AvatarsColor = Record<AvatarColor, AvatarColorProperties>;
324
84
  /** @public */
325
- export declare type ContainerWidth = (typeof CONTAINER)[number]
326
-
327
- /**
328
- * @public
329
- * @deprecated Use `buildColorTheme` instead.
330
- */
331
- export declare function createColorTheme(
332
- partialOpts?: PartialThemeColorBuilderOpts,
333
- ): ThemeColorSchemes
334
-
335
- /**
336
- * Work around types that are missing in `styled-components@6`
337
- * https://github.com/styled-components/styled-components/issues/4062
338
- * @internal
339
- */
340
- export declare type CSSObject = StyledObject<any>
341
-
342
- /** @internal */
343
- export declare const defaultTokens: PartialTokens<Tokens>
344
-
345
- /** @public */
346
- export declare interface ElementColorTokens {
347
- _hue: Hue
85
+ interface ElementColorTokens {
86
+ _hue: Hue;
348
87
  bg: {
349
- 0: ColorValue
350
- 4: ColorValue
351
- }
88
+ 0: ColorValue;
89
+ 4: ColorValue;
90
+ };
352
91
  border: {
353
- 0: ColorValue
354
- 4: ColorValue
355
- }
92
+ 0: ColorValue;
93
+ 4: ColorValue;
94
+ };
356
95
  fg: {
357
- 0: ColorValue
358
- 4: ColorValue
359
- }
360
- }
361
-
362
- /** @public */
363
- export declare const FONT_CODE_SIZE: readonly [0, 1, 2, 3, 4]
364
-
365
- /** @public */
366
- export declare const FONT_HEADING_SIZE: readonly [0, 1, 2, 3, 4, 5]
367
-
368
- /** @public */
369
- export declare const FONT_LABEL_SIZE: readonly [0, 1, 2, 3, 4, 5]
370
-
371
- /** @public */
372
- export declare const FONT_TEXT_SIZE: readonly [0, 1, 2, 3, 4]
373
-
374
- /** @public */
375
- export declare type FontCodeSize = (typeof FONT_CODE_SIZE)[number]
376
-
377
- /** @public */
378
- export declare type FontHeadingSize = (typeof FONT_HEADING_SIZE)[number]
379
-
380
- /** @public */
381
- export declare type FontLabelSize = (typeof FONT_LABEL_SIZE)[number]
382
-
383
- /** @public */
384
- export declare type FontTextSize = (typeof FONT_TEXT_SIZE)[number]
385
-
386
- /** @public */
387
- export declare type FontWeight = 'regular' | 'medium' | 'semibold' | 'bold'
388
-
389
- /**
390
- * @internal
391
- * @deprecated Will be removed in next major version
392
- */
393
- export declare function getContrastRatio(bg: string, fg: string): number
394
-
395
- /** @internal */
396
- export declare function getScopedTheme(
397
- themeProp: RootTheme | RootTheme_v2,
398
- scheme: ThemeColorSchemeKey,
399
- tone: ThemeColorCardToneKey,
400
- ): Theme
401
-
402
- /** @public */
403
- export declare function getTheme_v2(theme: Theme): Theme_v2
404
-
405
- /**
406
- * @internal
407
- */
408
- export declare function hexToRgb(hex: string): RGB
409
-
410
- /**
411
- * @internal
412
- */
413
- export declare interface HSL {
414
- h: number
415
- s: number
416
- l: number
417
- }
418
-
419
- /**
420
- * @internal
421
- */
422
- export declare function hslToRgb(hsl: HSL): RGB
423
-
424
- /** @public */
425
- export declare type Hue = (typeof HUES)[number]
426
-
427
- /** @public */
428
- export declare const HUES: readonly [
429
- 'gray',
430
- 'blue',
431
- 'purple',
432
- 'magenta',
433
- 'red',
434
- 'orange',
435
- 'yellow',
436
- 'green',
437
- 'cyan',
438
- ]
439
-
440
- /** @internal */
441
- export declare function isColorBlendModeValue(str: string): str is ThemeColorBlendModeKey
442
-
443
- /** @internal */
444
- export declare function isColorButtonMode(str: string): str is ThemeColorButtonModeKey
445
-
446
- /** @internal */
447
- export declare function isColorConfigBaseKey(str: string): str is ColorConfigCardKey
448
-
449
- /** @internal */
450
- export declare function isColorConfigBaseTone(str: string): str is ColorConfigCardTone
451
-
452
- /** @internal */
453
- export declare function isColorConfigBlendKey(str: string): str is ColorConfigBlendKey
454
-
455
- /** @internal */
456
- export declare function isColorConfigStateKey(str: string): str is ColorConfigStateKey
457
-
458
- /** @internal */
459
- export declare function isColorConfigStateTone(str: string): str is ColorConfigStateTone
460
-
461
- /** @internal */
462
- export declare function isColorHueKey(str: string): str is ColorHueKey
463
-
464
- /** @internal */
465
- export declare function isColorOpacityValue(str: string): str is ColorConfigOpacityValue
466
-
467
- /** @internal */
468
- export declare function isColorTintKey(str: string): str is ColorTintKey
469
-
470
- /** @internal */
471
- export declare function isColorValue(str: string): str is 'black' | 'white'
472
-
473
- /**
474
- * Apply the \`mix\` blend mode
475
- * @internal
476
- */
477
- export declare function mix(b: RGB | RGBA, s: RGB | RGBA, weight: number): RGB
478
-
479
- /**
480
- * Apply the \`multiply\` blend mode
481
- * Source: https://www.w3.org/TR/compositing-1/#blendingmultiply
482
- * @internal
483
- */
484
- export declare function multiply(b: RGB | RGBA, s: RGB | RGBA): RGB
485
-
486
- /**
487
- * @internal
488
- */
489
- export declare function parseColor(color: unknown): RGB | RGBA
490
-
491
- /** @internal */
492
- export declare function _parseColorToken(
493
- str: ColorToken,
494
- options: {
495
- defaultHue: Hue
496
- },
497
- ): TokenizeColorResult
498
-
499
- /** @internal */
500
- export declare function parseTokenValue(str: string): TokenValueNode | undefined
501
-
502
- /**
503
- * @public
504
- * @deprecated Use `ThemeConfig` instead.
505
- */
506
- export declare type PartialThemeColorBuilderOpts = Partial<ThemeColorBuilderOpts>
507
-
508
- /** @public */
509
- export declare type PartialTokens<T> = T extends [ColorToken, ColorToken]
510
- ? T
511
- : T extends {}
512
- ? {
513
- [P in keyof T]?: PartialTokens<T[P]>
514
- }
515
- : T
516
-
517
- /** @public */
518
- export declare const RADIUS: readonly [0, 1, 2, 3, 4, 5, 6]
519
-
520
- /** @public */
521
- export declare type Radius = (typeof RADIUS)[number]
522
-
523
- /** @public */
524
- export declare interface ResolvedColorToken {
525
- color:
526
- | {
527
- type: 'inherit'
528
- }
529
- | {
530
- type: 'black' | 'white'
531
- }
532
- | {
533
- type: 'hue'
534
- hue: Hue
535
- tint: Tint
536
- }
537
- opacity: number
538
- mix: number
539
- }
540
-
541
- /** @internal */
542
- export declare function resolveTokens(tokens?: PartialTokens<Tokens>): Tokens
543
-
544
- /**
545
- * @internal
546
- */
547
- export declare interface RGB {
548
- r: number
549
- g: number
550
- b: number
551
- a?: undefined
96
+ 0: ColorValue;
97
+ 4: ColorValue;
98
+ };
552
99
  }
553
-
554
- /**
555
- * @internal
556
- */
557
- export declare interface RGBA {
558
- r: number
559
- g: number
560
- b: number
561
- a: number
562
- }
563
-
564
- /**
565
- * @internal
566
- */
567
- export declare function rgba(color: unknown, a: number): string
568
-
569
- /**
570
- * @internal
571
- */
572
- export declare function rgbaToRGBA(rgba: string): RGBA
573
-
574
- /**
575
- * @internal
576
- */
577
- export declare function rgbToHex(color: RGB | RGBA): string
578
-
579
- /**
580
- * @internal
581
- * @see https://css-tricks.com/converting-color-spaces-in-javascript/
582
- */
583
- export declare function rgbToHsl({r, g, b}: RGB): HSL
584
-
585
100
  /** @public */
586
- export declare interface RootTheme extends RootTheme_v0 {
587
- v2?: RootTheme_v2
588
- v3?: Theme_v3
589
- }
590
-
101
+ type ElementsColorTokens = Record<"*" | ElementTone, ElementColorTokens>;
591
102
  /** @public */
592
- export declare interface RootTheme_v0 {
593
- _version?: 0
594
- /**
595
- * @deprecated Use `v2.avatar` instead
596
- */
597
- avatar: ThemeAvatar
598
- /**
599
- * @deprecated Use `v2.button` instead
600
- */
601
- button: {
602
- textWeight: ThemeFontWeightKey
603
- }
604
- /**
605
- * @deprecated Use `v2.color` instead
606
- */
607
- color: ThemeColorSchemes
608
- /**
609
- * @deprecated Use `v2.container` instead
610
- */
611
- container: number[]
612
- /**
613
- * @deprecated Use component-specific `v2.{button | card | input}.focusRing` values instead
614
- */
615
- focusRing: {
616
- offset: number
617
- width: number
618
- }
619
- /**
620
- * @deprecated Use `v2.font` instead
621
- */
622
- fonts: ThemeFonts
623
- /**
624
- * @deprecated Use `v2.input` instead
625
- */
626
- input: ThemeInput
627
- /**
628
- * THIS API MAY BE UNSTABLE. DO NOT USE IN PRODUCTION.
629
- * @beta
630
- * @deprecated Use `v2.layer` instead
631
- */
632
- layer?: ThemeLayer
633
- /**
634
- * @deprecated Use `v2.media` instead
635
- */
636
- media: number[]
637
- /**
638
- * @deprecated Use `v2.radius` instead
639
- */
640
- radius: number[]
641
- /**
642
- * @deprecated Use `v2.shadow` instead
643
- */
644
- shadows: Array<ThemeShadow | null>
645
- /**
646
- * @deprecated Use `v2.space` instead
647
- */
648
- space: number[]
649
- /**
650
- * @internal
651
- * @deprecated Use `v2.style` instead
652
- */
653
- styles?: ThemeStyles
654
- }
655
-
103
+ type ColorVariant = (typeof COLOR_VARIANTS)[number];
656
104
  /** @public */
657
- export declare interface RootTheme_v2 {
658
- _version: 2
659
- avatar: ThemeAvatar_v2
660
- button: {
661
- border: {
662
- width: number
663
- }
664
- focusRing: ThemeFocusRing
665
- textWeight: ThemeFontWeightKey
666
- }
667
- card: {
668
- border: {
669
- width: number
670
- }
671
- focusRing: ThemeFocusRing
672
- shadow: {
673
- outline: number
674
- }
675
- }
676
- color: ThemeColorSchemes_v2
677
- container: number[]
678
- font: ThemeFonts
679
- input: ThemeInput_v2
680
- layer: ThemeLayer
681
- media: number[]
682
- radius: number[]
683
- shadow: Array<ThemeShadow | null>
684
- space: number[]
685
- /** @internal */
686
- style?: ThemeStyles
687
- }
688
-
689
- /**
690
- * Apply the \`screen\` blend mode
691
- * Source: https://www.w3.org/TR/compositing-1/#blendingscreen
692
- * @internal
693
- */
694
- declare function screen_2(b: RGB | RGBA, s: RGB | RGBA): RGB
695
- export {screen_2 as screen}
696
-
697
- /** @public */
698
- export declare const SHADOW: readonly [0, 1, 2, 3, 4, 5]
699
-
700
- /** @public */
701
- export declare type Shadow = (typeof SHADOW)[number]
702
-
703
- /** @public */
704
- export declare const SPACE: readonly [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
705
-
706
- /** @public */
707
- export declare type Space = (typeof SPACE)[number]
708
-
709
- /**
710
- * Used for the `theme` prop in `styled-components`’s `ThemeProvider`.
711
- *
712
- * @public
713
- */
714
- export declare interface Theme {
715
- sanity: Omit<RootTheme, 'color' | 'v2'> & {
716
- /**
717
- * @deprecated Use `v2.color` instead
718
- */
719
- color: ThemeColor
720
- v2?: Theme_v2
721
- }
722
- }
723
-
724
- /** @public */
725
- export declare const THEME_COLOR_AVATAR_COLORS: ColorHueKey[]
726
-
727
- /** @public */
728
- export declare const THEME_COLOR_BLEND_MODES: readonly ['multiply', 'screen']
729
-
730
- /** @public */
731
- export declare const THEME_COLOR_BUTTON_MODES: readonly ['default', 'ghost', 'bleed']
732
-
733
- /** @public */
734
- export declare const THEME_COLOR_CARD_TONES: readonly [
735
- 'transparent',
736
- 'default',
737
- 'neutral',
738
- 'primary',
739
- 'suggest',
740
- 'positive',
741
- 'caution',
742
- 'critical',
743
- ]
744
-
745
- /** @public */
746
- export declare const THEME_COLOR_INPUT_MODES: readonly ['default', 'invalid']
747
-
748
- /** @public */
749
- export declare const THEME_COLOR_INPUT_STATES: readonly [
750
- 'enabled',
751
- 'hovered',
752
- 'readOnly',
753
- 'disabled',
754
- ]
755
-
756
- /** @public */
757
- export declare const THEME_COLOR_SCHEMES: readonly ['light', 'dark']
758
-
759
- /** @public */
760
- export declare const THEME_COLOR_STATE_TONES: readonly [
761
- 'default',
762
- 'neutral',
763
- 'primary',
764
- 'suggest',
765
- 'positive',
766
- 'caution',
767
- 'critical',
768
- ]
769
-
770
- /** @public */
771
- export declare const THEME_COLOR_STATES: readonly [
772
- 'enabled',
773
- 'hovered',
774
- 'pressed',
775
- 'selected',
776
- 'disabled',
777
- ]
778
-
779
- /** @public */
780
- export declare type Theme_v2 = Omit<RootTheme_v2, 'color'> & {
781
- color: ThemeColorCard_v2
782
- /**
783
- * Indicates whether the theme is resolved or raw, it's necessary to avoid issues
784
- * with sanity V2 components accessing a v1 <ThemeProvider>.
785
- * See https://github.com/sanity-io/ui/pull/1203 for more info.
786
- */
787
- _resolved: boolean
788
- }
789
-
790
- /**
791
- * Supersedes `RootTheme` and `RootTheme_v2`.
792
- *
793
- * @public
794
- */
795
- export declare interface Theme_v3 {
796
- _version: 3
797
- _tokens: Tokens
798
- avatar: ThemeAvatar_v2
799
- button: {
800
- border: {
801
- width: number
802
- }
803
- focusRing: ThemeFocusRing
804
- textWeight: ThemeFontWeightKey
805
- }
806
- card: {
807
- border: {
808
- width: number
809
- }
810
- focusRing: ThemeFocusRing
811
- shadow: {
812
- outline: number
813
- }
814
- }
815
- color: ThemeColor_v3
816
- container: number[]
817
- font: ThemeFonts_v3
818
- input: ThemeInput_v2
819
- layer: ThemeLayer
820
- media: number[]
821
- palette: ThemePalette_v3
822
- radius: Record<Radius, number>
823
- shadow: Record<Shadow, ThemeShadow | undefined>
824
- space: Record<Space, number>
825
- }
826
-
827
- /**
828
- * @public
829
- * @deprecated Use `ThemeAvatar_v2` from `@sanity/ui/theme` instead.
830
- */
831
- export declare interface ThemeAvatar {
832
- sizes: {
833
- distance: number
834
- size: number
835
- }[]
836
- }
837
-
838
- /** @public */
839
- export declare interface ThemeAvatar_v2 {
840
- sizes: {
841
- /** Spacing between avatars in an <AvatarStack> component (px) */
842
- distance: number
843
- /** Diameter of the avatar (px) */
844
- size: number
845
- }[]
846
- focusRing: ThemeFocusRing
847
- }
848
-
849
- /** @public */
850
- export declare type ThemeBoxShadow = [number, number, number, number]
851
-
852
- /**
853
- * @public
854
- * @deprecated Use `ThemeColor_v2` instead.
855
- */
856
- export declare interface ThemeColor extends Partial<Omit<ThemeColorGenericState, 'muted'>> {
857
- base: ThemeColorBase
858
- button: ThemeColorButton
859
- card: ThemeColorCard
860
- dark: boolean
861
- input: ThemeColorInput
862
- muted: ThemeColorMuted
863
- selectable?: ThemeColorSelectable
864
- solid: ThemeColorSolid
865
- spot: ThemeColorSpot
866
- syntax: ThemeColorSyntax
867
- }
868
-
869
- /** @public */
870
- export declare type ThemeColor_v3 = Record<ThemeColorCardToneKey, ThemeColorCard_v3>
871
-
872
- /** @public */
873
- export declare type ThemeColorAvatar_v2 = Record<ThemeColorAvatarColorKey, ThemeColorAvatarHue_v2>
874
-
875
- /** @public */
876
- export declare type ThemeColorAvatar_v3 = Record<AvatarColor, ThemeColorAvatarHue_v3>
877
-
878
- /** @public */
879
- export declare type ThemeColorAvatarColorKey = (typeof THEME_COLOR_AVATAR_COLORS)[number]
880
-
881
- /** @public */
882
- export declare interface ThemeColorAvatarHue_v2 {
883
- _blend?: ThemeColorBlendModeKey
884
- bg: string
885
- fg: string
886
- }
887
-
888
- /** @public */
889
- export declare interface ThemeColorAvatarHue_v3 {
890
- bg: ColorValue
891
- fg: ColorValue
892
- }
893
-
894
- /** @public */
895
- export declare interface ThemeColorAvatarHueTokens {
896
- _blend?: ColorBlendModeTokenValue
897
- _hue?: Hue_2
898
- bg?: ThemeColorTokenValue
899
- fg?: ThemeColorTokenValue
900
- }
901
-
902
- /** @public */
903
- export declare interface ThemeColorAvatarTokens {
904
- '*'?: ThemeColorAvatarHueTokens
905
- 'gray'?: ThemeColorAvatarHueTokens
906
- 'blue'?: ThemeColorAvatarHueTokens
907
- 'purple'?: ThemeColorAvatarHueTokens
908
- 'magenta'?: ThemeColorAvatarHueTokens
909
- 'red'?: ThemeColorAvatarHueTokens
910
- 'orange'?: ThemeColorAvatarHueTokens
911
- 'yellow'?: ThemeColorAvatarHueTokens
912
- 'green'?: ThemeColorAvatarHueTokens
913
- 'cyan'?: ThemeColorAvatarHueTokens
914
- }
915
-
916
- /** @public */
917
- export declare type ThemeColorBadge_v2 = Record<ThemeColorStateToneKey, ThemeColorBadgeTone_v2>
918
-
919
- /** @public */
920
- export declare type ThemeColorBadgeTokens = Partial<
921
- Record<'*' | ThemeColorStateToneKey, ThemeColorBadgeToneTokens>
922
- >
923
-
924
- /** @public */
925
- export declare interface ThemeColorBadgeTone_v2 {
926
- bg: string
927
- fg: string
928
- dot: string
929
- icon: string
930
- }
931
-
932
- /** @public */
933
- export declare interface ThemeColorBadgeToneTokens {
934
- _blend?: ColorBlendModeTokenValue
935
- _hue?: Hue_2
936
- bg?: ThemeColorTokenValue
937
- dot?: ThemeColorTokenValue
938
- fg?: ThemeColorTokenValue
939
- icon?: ThemeColorTokenValue
940
- }
941
-
942
- /**
943
- * @public
944
- * @deprecated Use `ThemeColorCard_v2` instead.
945
- */
946
- export declare interface ThemeColorBase {
947
- bg: string
948
- fg: string
949
- border: string
950
- focusRing: string
951
- backdrop?: string
952
- shadow: {
953
- outline: string
954
- umbra: string
955
- penumbra: string
956
- ambient: string
957
- }
958
- skeleton?: {
959
- from: string
960
- to: string
961
- }
962
- }
963
-
964
- /** @public */
965
- export declare interface ThemeColorBaseTokens extends ThemeColorStateTokens {
966
- focusRing?: ThemeColorTokenValue
967
- backdrop?: ThemeColorTokenValue
968
- shadow?: {
969
- outline?: ThemeColorTokenValue
970
- umbra?: ThemeColorTokenValue
971
- penumbra?: ThemeColorTokenValue
972
- ambient?: ThemeColorTokenValue
973
- }
974
- }
975
-
976
- /** @public */
977
- export declare type ThemeColorBlendModeKey = (typeof THEME_COLOR_BLEND_MODES)[number]
978
-
979
- /**
980
- * @public
981
- * @deprecated Use `buildColorTheme` instead.
982
- */
983
- export declare interface ThemeColorBuilderOpts {
984
- base: (opts: {dark: boolean; name: ThemeColorName}) => ThemeColorBase
985
- solid: (opts: {
986
- base: ThemeColorBase
987
- dark: boolean
988
- tone: ThemeColorName
989
- name: ThemeColorName
990
- state: 'enabled' | 'disabled' | 'hovered' | 'pressed' | 'selected'
991
- }) => ThemeColorGenericState
992
- muted: (opts: {
993
- base: ThemeColorBase
994
- dark: boolean
995
- tone: ThemeColorToneKey
996
- name: ThemeColorName
997
- state: 'enabled' | 'disabled' | 'hovered' | 'pressed' | 'selected'
998
- }) => ThemeColorGenericState
999
- card: (opts: {
1000
- base: ThemeColorBase
1001
- dark: boolean
1002
- muted: ThemeColorMuted
1003
- name: ThemeColorName
1004
- solid: ThemeColorSolid
1005
- state: 'enabled' | 'disabled' | 'hovered' | 'pressed' | 'selected'
1006
- }) => ThemeColorGenericState
1007
- button: (opts: {
1008
- dark: boolean
1009
- mode: ThemeColorButtonModeKey
1010
- base: ThemeColorBase
1011
- solid: ThemeColorSolidTone
1012
- muted: ThemeColorMutedTone
1013
- }) => ThemeColorButtonStates
1014
- input: (opts: {
1015
- base: ThemeColorBase
1016
- solid: ThemeColorSolidTone
1017
- muted: ThemeColorMutedTone
1018
- dark: boolean
1019
- mode: 'default' | 'invalid'
1020
- state: 'enabled' | 'disabled' | 'hovered' | 'readOnly'
1021
- }) => ThemeColorInputState
1022
- selectable: (opts: {
1023
- dark: boolean
1024
- base: ThemeColorBase
1025
- solid: ThemeColorSolid
1026
- muted: ThemeColorMuted
1027
- state: 'enabled' | 'disabled' | 'hovered' | 'pressed' | 'selected'
1028
- tone: 'default' | 'primary' | 'positive' | 'caution' | 'critical'
1029
- }) => ThemeColorGenericState
1030
- syntax: (opts: {base: ThemeColorBase; dark: boolean}) => ThemeColorSyntax
1031
- spot: (opts: {base: ThemeColorBase; dark: boolean; key: ThemeColorSpotKey}) => string
1032
- }
1033
-
1034
- /**
1035
- * @public
1036
- * @deprecated Use `ThemeColorButton_v2` instead.
1037
- */
1038
- export declare interface ThemeColorButton {
1039
- default: ThemeColorButtonTones
1040
- ghost: ThemeColorButtonTones
1041
- bleed: ThemeColorButtonTones
1042
- }
1043
-
1044
- /** @public */
1045
- export declare type ThemeColorButton_v2 = Record<ThemeColorButtonModeKey, ThemeColorButtonMode_v2>
1046
-
1047
- /** @public */
1048
- export declare type ThemeColorButtonMode_v2 = Record<
1049
- ThemeColorStateToneKey,
1050
- ThemeColorButtonTone_v2
1051
- >
1052
-
1053
- /** @public */
1054
- export declare type ThemeColorButtonModeKey = (typeof THEME_COLOR_BUTTON_MODES)[number]
1055
-
1056
- /**
1057
- * @public
1058
- * @deprecated Use `ThemeColorState_v2` instead.
1059
- */
1060
- export declare type ThemeColorButtonState = ThemeColorGenericState
1061
-
1062
- /**
1063
- * @public
1064
- * @deprecated Use `ThemeColorButtonStates_v2` instead.
1065
- */
1066
- export declare interface ThemeColorButtonStates {
1067
- enabled: ThemeColorGenericState
1068
- hovered: ThemeColorGenericState
1069
- pressed: ThemeColorGenericState
1070
- selected: ThemeColorGenericState
1071
- disabled: ThemeColorGenericState
1072
- }
1073
-
1074
- /** @public */
1075
- export declare interface ThemeColorButtonTokens
1076
- extends Partial<Record<ColorConfigStateTone, ThemeColorStatesTokens>> {
1077
- _hue?: Hue_2
1078
- }
1079
-
1080
- /** @public */
1081
- export declare type ThemeColorButtonTone_v2 = Record<ThemeColorStateKey, ThemeColorState_v2>
1082
-
1083
- /**
1084
- * TODO: Rename to `ThemeColorButtonMode`.
1085
- * @public
1086
- * @deprecated Use `ThemeColorButtonTones_v2` instead.
1087
- */
1088
- export declare interface ThemeColorButtonTones {
1089
- default: ThemeColorButtonStates
1090
- primary: ThemeColorButtonStates
1091
- positive: ThemeColorButtonStates
1092
- caution: ThemeColorButtonStates
1093
- critical: ThemeColorButtonStates
1094
- }
1095
-
1096
- /**
1097
- * @public
1098
- * @deprecated Use `ThemeColorSelectable_v2` instead.
1099
- */
1100
- export declare interface ThemeColorCard {
1101
- enabled: ThemeColorGenericState
1102
- hovered: ThemeColorGenericState
1103
- pressed: ThemeColorGenericState
1104
- selected: ThemeColorGenericState
1105
- disabled: ThemeColorGenericState
1106
- }
1107
-
1108
- /** @public */
1109
- export declare interface ThemeColorCard_v2 extends ThemeColorState_v2 {
1110
- /** @internal */
1111
- _blend: ThemeColorBlendModeKey
1112
- _dark: boolean
1113
- backdrop: string
1114
- button: ThemeColorButton_v2
1115
- focusRing: string
1116
- input: ThemeColorInput_v2
1117
- selectable: ThemeColorSelectable_v2
1118
- shadow: ThemeColorShadow
1119
- syntax: ThemeColorSyntax
1120
- }
1121
-
1122
- /** @public */
1123
- export declare interface ThemeColorCard_v3 {
1124
- _hue: Hue
1125
- avatar: ThemeColorAvatar_v3
1126
- backdrop: ColorValue
105
+ interface CardColorTokens {
106
+ _hue: Hue;
107
+ avatar: AvatarsColor;
108
+ backdrop: ColorValue;
1127
109
  code: {
1128
- bg: ColorValue
1129
- fg: ColorValue
110
+ bg: ColorValue;
111
+ fg: ColorValue;
1130
112
  token: {
1131
- atrule: ColorValue
1132
- attrName: ColorValue
1133
- attrValue: ColorValue
1134
- attribute: ColorValue
1135
- boolean: ColorValue
1136
- builtin: ColorValue
1137
- cdata: ColorValue
1138
- char: ColorValue
1139
- class: ColorValue
1140
- className: ColorValue
1141
- comment: ColorValue
1142
- constant: ColorValue
1143
- deleted: ColorValue
1144
- doctype: ColorValue
1145
- entity: ColorValue
1146
- function: ColorValue
1147
- hexcode: ColorValue
1148
- id: ColorValue
1149
- important: ColorValue
1150
- inserted: ColorValue
1151
- keyword: ColorValue
1152
- number: ColorValue
1153
- operator: ColorValue
1154
- prolog: ColorValue
1155
- property: ColorValue
1156
- pseudoClass: ColorValue
1157
- pseudoElement: ColorValue
1158
- punctuation: ColorValue
1159
- regex: ColorValue
1160
- selector: ColorValue
1161
- string: ColorValue
1162
- symbol: ColorValue
1163
- tag: ColorValue
1164
- unit: ColorValue
1165
- url: ColorValue
1166
- variable: ColorValue
1167
- }
1168
- }
1169
- focusRing: ColorValue
113
+ atrule: ColorValue;
114
+ attrName: ColorValue;
115
+ attrValue: ColorValue;
116
+ attribute: ColorValue;
117
+ boolean: ColorValue;
118
+ builtin: ColorValue;
119
+ cdata: ColorValue;
120
+ char: ColorValue;
121
+ class: ColorValue;
122
+ className: ColorValue;
123
+ comment: ColorValue;
124
+ constant: ColorValue;
125
+ deleted: ColorValue;
126
+ doctype: ColorValue;
127
+ entity: ColorValue;
128
+ function: ColorValue;
129
+ hexcode: ColorValue;
130
+ id: ColorValue;
131
+ important: ColorValue;
132
+ inserted: ColorValue;
133
+ keyword: ColorValue;
134
+ number: ColorValue;
135
+ operator: ColorValue;
136
+ prolog: ColorValue;
137
+ property: ColorValue;
138
+ pseudoClass: ColorValue;
139
+ pseudoElement: ColorValue;
140
+ punctuation: ColorValue;
141
+ regex: ColorValue;
142
+ selector: ColorValue;
143
+ string: ColorValue;
144
+ symbol: ColorValue;
145
+ tag: ColorValue;
146
+ unit: ColorValue;
147
+ url: ColorValue;
148
+ variable: ColorValue;
149
+ };
150
+ };
151
+ focusRing: ColorValue;
1170
152
  link: {
1171
- fg: ColorValue
1172
- }
153
+ fg: ColorValue;
154
+ };
1173
155
  shadow: {
1174
- outline: ColorValue
1175
- umbra: ColorValue
1176
- penumbra: ColorValue
1177
- ambient: ColorValue
1178
- }
156
+ outline: ColorValue;
157
+ umbra: ColorValue;
158
+ penumbra: ColorValue;
159
+ ambient: ColorValue;
160
+ };
1179
161
  skeleton: {
1180
- from: ColorValue
1181
- to: ColorValue
1182
- }
1183
- variant: Record<ThemeColorVariantKey, ThemeColorVariant>
162
+ from: ColorValue;
163
+ to: ColorValue;
164
+ };
165
+ variant: Record<ColorVariant, ElementsColorTokens>;
1184
166
  }
1185
-
1186
- /**
1187
- * @public
1188
- * @deprecated Use `ThemeColorState_v2` instead.
1189
- */
1190
- export declare type ThemeColorCardState = ThemeColorGenericState
1191
-
1192
167
  /** @public */
1193
- export declare type ThemeColorCardToneKey = (typeof THEME_COLOR_CARD_TONES)[number]
1194
-
168
+ type Color = Record<CardTone, CardColorTokens>;
1195
169
  /** @public */
1196
- export declare interface ThemeColorElement {
1197
- _hue: Hue
1198
- bg: {
1199
- 0: ColorValue
1200
- 4: ColorValue
1201
- }
170
+ interface Input {
171
+ checkbox: {
172
+ size: number;
173
+ focusRing: FocusRing;
174
+ };
175
+ radio: {
176
+ size: number;
177
+ markSize: number;
178
+ focusRing: FocusRing;
179
+ };
180
+ switch: {
181
+ width: number;
182
+ height: number;
183
+ padding: number;
184
+ transitionDurationMs: number;
185
+ transitionTimingFunction: string;
186
+ focusRing: FocusRing;
187
+ };
1202
188
  border: {
1203
- 0: ColorValue
1204
- 4: ColorValue
1205
- }
1206
- fg: {
1207
- 0: ColorValue
1208
- 4: ColorValue
1209
- }
1210
- }
1211
-
1212
- /**
1213
- * @public
1214
- * @deprecated Use `ThemeColorState_v2` instead.
1215
- */
1216
- export declare interface ThemeColorGenericState {
1217
- /** @internal */
1218
- _blend?: ThemeColorBlendModeKey
1219
- bg: string
1220
- /**
1221
- * @beta
1222
- */
1223
- bg2?: string
1224
- border: string
1225
- fg: string
1226
- icon: string
1227
- muted: {
1228
- fg: string
1229
- }
1230
- accent: {
1231
- fg: string
1232
- }
1233
- link: {
1234
- fg: string
1235
- }
1236
- code: {
1237
- bg: string
1238
- fg: string
1239
- }
1240
- skeleton?: {
1241
- from: string
1242
- to: string
1243
- }
1244
- }
1245
-
1246
- /**
1247
- * @public
1248
- * @deprecated Use `ThemeColorInput_v2` instead.
1249
- */
1250
- export declare interface ThemeColorInput {
1251
- default: ThemeColorInputStates
1252
- invalid: ThemeColorInputStates
1253
- }
1254
-
1255
- /** @public */
1256
- export declare type ThemeColorInput_v2 = Record<ThemeColorInputModeKey, ThemeColorInputMode_v2>
1257
-
1258
- /** @public */
1259
- export declare type ThemeColorInputMode_v2 = Record<
1260
- ThemeColorInputStateKey,
1261
- ThemeColorInputState_v2
1262
- >
1263
-
1264
- /** @public */
1265
- export declare type ThemeColorInputModeKey = (typeof THEME_COLOR_INPUT_MODES)[number]
1266
-
1267
- /**
1268
- * @public
1269
- * @deprecated Use `ThemeColorInputState_v2` instead.
1270
- */
1271
- export declare interface ThemeColorInputState {
1272
- _blend?: ThemeColorBlendModeKey
1273
- bg: string
1274
- bg2: string
1275
- border: string
1276
- fg: string
1277
- placeholder: string
1278
- }
1279
-
1280
- /** @public */
1281
- export declare interface ThemeColorInputState_v2 {
1282
- _blend?: ThemeColorBlendModeKey
1283
- bg: string
1284
- border: string
1285
- fg: string
1286
- muted: {
1287
- bg: string
1288
- }
1289
- placeholder: string
1290
- }
1291
-
1292
- /** @public */
1293
- export declare type ThemeColorInputStateKey = (typeof THEME_COLOR_INPUT_STATES)[number]
1294
-
1295
- /**
1296
- * @public
1297
- * @deprecated Use `ThemeColorInputMode_v2` instead.
1298
- */
1299
- export declare interface ThemeColorInputStates {
1300
- enabled: ThemeColorInputState
1301
- disabled: ThemeColorInputState
1302
- hovered: ThemeColorInputState
1303
- readOnly: ThemeColorInputState
1304
- }
1305
-
1306
- /** @public */
1307
- export declare interface ThemeColorInputStateTokens {
1308
- _blend?: ColorBlendModeTokenValue
1309
- _hue?: Hue_2
1310
- bg?: ThemeColorTokenValue
1311
- border?: ThemeColorTokenValue
1312
- fg?: ThemeColorTokenValue
1313
- muted?: {
1314
- bg?: ThemeColorTokenValue
1315
- }
1316
- placeholder?: ThemeColorTokenValue
1317
- }
1318
-
1319
- /** @public */
1320
- export declare interface ThemeColorInputTokens
1321
- extends Partial<Record<ColorConfigInputState, ThemeColorInputStateTokens>> {
1322
- _hue?: Hue_2
1323
- }
1324
-
1325
- /** @public */
1326
- export declare interface ThemeColorKBD {
1327
- bg: string
1328
- fg: string
1329
- border: string
1330
- }
1331
-
1332
- /**
1333
- * @public
1334
- * @deprecated Use `ThemeColorSelectable_v2` instead.
1335
- */
1336
- export declare interface ThemeColorMuted {
1337
- default: ThemeColorMutedTone
1338
- transparent: ThemeColorMutedTone
1339
- primary: ThemeColorMutedTone
1340
- positive: ThemeColorMutedTone
1341
- caution: ThemeColorMutedTone
1342
- critical: ThemeColorMutedTone
1343
- }
1344
-
1345
- /**
1346
- * @public
1347
- * @deprecated Use `ThemeColorSelectableTone_v2` instead.
1348
- */
1349
- export declare interface ThemeColorMutedTone {
1350
- enabled: ThemeColorGenericState
1351
- disabled: ThemeColorGenericState
1352
- hovered: ThemeColorGenericState
1353
- pressed: ThemeColorGenericState
1354
- selected: ThemeColorGenericState
189
+ width: number;
190
+ };
191
+ select: {
192
+ focusRing: FocusRing;
193
+ };
194
+ text: {
195
+ focusRing: FocusRing;
196
+ };
1355
197
  }
1356
-
1357
- /**
1358
- * @public
1359
- * @deprecated Use `ThemeColorCardToneKey` instead.
1360
- */
1361
- export declare type ThemeColorName =
1362
- | 'transparent'
1363
- | 'default'
1364
- | 'primary'
1365
- | 'positive'
1366
- | 'caution'
1367
- | 'critical'
1368
-
1369
198
  /** @public */
1370
- export declare type ThemeColorPalette = {
1371
- black: string | ColorTint
1372
- white: string | ColorTint
1373
- } & Record<Hue, Record<Tint, string | ColorTint>>
1374
-
1375
- /**
1376
- * @public
1377
- * @deprecated Use `ThemeColorScheme_v2` instead.
1378
- */
1379
- export declare type ThemeColorScheme = Record<ThemeColorName, ThemeColor>
1380
-
199
+ type ColorScheme = (typeof COLOR_SCHEMES)[number];
1381
200
  /** @public */
1382
- export declare type ThemeColorScheme_v2 = Record<ThemeColorCardToneKey, ThemeColorCard_v2>
1383
-
201
+ type CardTone = (typeof CARD_TONES)[number];
1384
202
  /** @public */
1385
- export declare type ThemeColorSchemeKey = (typeof THEME_COLOR_SCHEMES)[number]
1386
-
1387
- /**
1388
- * @public
1389
- * @deprecated Use `ThemeColorSchemes_v2` instead.
1390
- */
1391
- export declare type ThemeColorSchemes = Record<ThemeColorSchemeKey, ThemeColorScheme>
1392
-
203
+ type ElementTone = (typeof ELEMENT_TONES)[number];
1393
204
  /** @public */
1394
- export declare type ThemeColorSchemes_v2 = Record<ThemeColorSchemeKey, ThemeColorScheme_v2>
1395
-
1396
- /**
1397
- * @public
1398
- * @deprecated Use `ThemeColorSelectable_v2` instead.
1399
- */
1400
- export declare interface ThemeColorSelectable {
1401
- default: ThemeColorSelectableStates
1402
- primary: ThemeColorSelectableStates
1403
- positive: ThemeColorSelectableStates
1404
- caution: ThemeColorSelectableStates
1405
- critical: ThemeColorSelectableStates
1406
- }
1407
-
205
+ type ButtonMode = (typeof BUTTON_MODES)[number];
1408
206
  /** @public */
1409
- export declare type ThemeColorSelectable_v2 = Record<
1410
- ThemeColorStateToneKey,
1411
- ThemeColorSelectableTone_v2
1412
- >
1413
-
1414
- /**
1415
- * @public
1416
- * @deprecated Use `ThemeColorState_v2` instead.
1417
- */
1418
- export declare type ThemeColorSelectableState = ThemeColorGenericState
1419
-
1420
- /**
1421
- * @public
1422
- * @deprecated Use `ThemeColorSelectableStates_v2` instead.
1423
- */
1424
- export declare interface ThemeColorSelectableStates {
1425
- enabled: ThemeColorSelectableState
1426
- hovered: ThemeColorSelectableState
1427
- pressed: ThemeColorSelectableState
1428
- selected: ThemeColorSelectableState
1429
- disabled: ThemeColorSelectableState
1430
- }
1431
-
1432
- /** @public */
1433
- export declare type ThemeColorSelectableTone_v2 = Record<ThemeColorStateKey, ThemeColorState_v2>
1434
-
1435
- /** @public */
1436
- export declare interface ThemeColorShadow {
1437
- outline: string
1438
- umbra: string
1439
- penumbra: string
1440
- ambient: string
1441
- }
1442
-
1443
- /**
1444
- * @public
1445
- * @deprecated Use `ThemeColorSelectable_v2` instead.
1446
- */
1447
- export declare interface ThemeColorSolid {
1448
- default: ThemeColorSolidTone
1449
- transparent: ThemeColorSolidTone
1450
- primary: ThemeColorSolidTone
1451
- positive: ThemeColorSolidTone
1452
- caution: ThemeColorSolidTone
1453
- critical: ThemeColorSolidTone
1454
- }
1455
-
1456
- /**
1457
- * @public
1458
- * @deprecated Use `ThemeColorSelectableTone_v2` instead.
1459
- */
1460
- export declare interface ThemeColorSolidTone {
1461
- enabled: ThemeColorGenericState
1462
- disabled: ThemeColorGenericState
1463
- hovered: ThemeColorGenericState
1464
- pressed: ThemeColorGenericState
1465
- selected: ThemeColorGenericState
1466
- }
1467
-
1468
- /**
1469
- * @public
1470
- * @deprecated Use `ThemeColorAvatar_v2` instead
1471
- */
1472
- export declare type ThemeColorSpot = Record<ThemeColorSpotKey, string>
1473
-
1474
- /**
1475
- * @public
1476
- * @deprecated Use `ThemeColorAvatarColorKey` instead
1477
- */
1478
- export declare type ThemeColorSpotKey = ThemeColorAvatarColorKey
1479
-
1480
- /** @public */
1481
- export declare interface ThemeColorState_v2 {
1482
- /** @internal */
1483
- _blend?: ThemeColorBlendModeKey
1484
- accent: {
1485
- fg: string
1486
- }
1487
- /**
1488
- * @internal This may be removed in a future release
1489
- * */
1490
- avatar: ThemeColorAvatar_v2
1491
- /**
1492
- * @internal This may be removed in a future release
1493
- * */
1494
- badge: ThemeColorBadge_v2
1495
- bg: string
1496
- border: string
1497
- code: {
1498
- bg: string
1499
- fg: string
1500
- }
1501
- fg: string
1502
- icon: string
1503
- kbd: ThemeColorKBD
1504
- link: {
1505
- fg: string
1506
- }
1507
- muted: {
1508
- bg: string
1509
- fg: string
1510
- }
1511
- skeleton: {
1512
- from: string
1513
- to: string
1514
- }
207
+ interface ThemeAvatar {
208
+ sizes: {
209
+ /** Spacing between avatars in an <AvatarStack> component (px) */
210
+ distance: number;
211
+ /** Diameter of the avatar (px) */
212
+ size: number;
213
+ }[];
214
+ focusRing: FocusRing;
1515
215
  }
1516
-
1517
216
  /** @public */
1518
- export declare type ThemeColorStateKey = (typeof THEME_COLOR_STATES)[number]
1519
-
217
+ type BoxShadow = [number, number, number, number];
1520
218
  /** @public */
1521
- export declare type ThemeColorStatesTokens = Partial<
1522
- Record<ColorConfigState, ThemeColorStateTokens>
1523
- >
1524
-
1525
- /** @public */
1526
- export declare interface ThemeColorStateTokens {
1527
- _blend?: ColorBlendModeTokenValue
1528
- _hue?: Hue_2
1529
- accent?: {
1530
- fg?: ThemeColorTokenValue
1531
- }
1532
- avatar?: ThemeColorAvatarTokens
1533
- badge?: ThemeColorBadgeTokens
1534
- bg?: ThemeColorTokenValue
1535
- border?: ThemeColorTokenValue
1536
- code?: {
1537
- bg?: ThemeColorTokenValue
1538
- fg?: ThemeColorTokenValue
1539
- }
1540
- fg?: ThemeColorTokenValue
1541
- icon?: ThemeColorTokenValue
1542
- kbd?: {
1543
- bg?: ThemeColorTokenValue
1544
- fg?: ThemeColorTokenValue
1545
- border?: ThemeColorTokenValue
1546
- }
1547
- link?: {
1548
- fg?: ThemeColorTokenValue
1549
- }
1550
- muted?: {
1551
- bg?: ThemeColorTokenValue
1552
- fg?: ThemeColorTokenValue
1553
- }
1554
- skeleton?: {
1555
- from?: ThemeColorTokenValue
1556
- to?: ThemeColorTokenValue
1557
- }
219
+ interface ShadowProperties {
220
+ umbra: BoxShadow;
221
+ penumbra: BoxShadow;
222
+ ambient: BoxShadow;
1558
223
  }
1559
-
1560
- /** @public */
1561
- export declare type ThemeColorStateToneKey = (typeof THEME_COLOR_STATE_TONES)[number]
1562
-
1563
224
  /** @public */
1564
- export declare interface ThemeColorSyntax {
1565
- atrule: string
1566
- attrName: string
1567
- attrValue: string
1568
- attribute: string
1569
- boolean: string
1570
- builtin: string
1571
- cdata: string
1572
- char: string
1573
- class: string
1574
- className: string
1575
- comment: string
1576
- constant: string
1577
- deleted: string
1578
- doctype: string
1579
- entity: string
1580
- function: string
1581
- hexcode: string
1582
- id: string
1583
- important: string
1584
- inserted: string
1585
- keyword: string
1586
- number: string
1587
- operator: string
1588
- prolog: string
1589
- property: string
1590
- pseudoClass: string
1591
- pseudoElement: string
1592
- punctuation: string
1593
- regex: string
1594
- selector: string
1595
- string: string
1596
- symbol: string
1597
- tag: string
1598
- unit: string
1599
- url: string
1600
- variable: string
225
+ interface Layer {
226
+ dialog: {
227
+ zOffset: number;
228
+ };
229
+ popover: {
230
+ zOffset: number;
231
+ };
232
+ tooltip: {
233
+ zOffset: number;
234
+ };
1601
235
  }
1602
-
1603
236
  /** @public */
1604
- export declare interface ThemeColorTokens {
1605
- base?: Partial<Record<ColorConfigCardTone, ThemeColorBaseTokens>>
1606
- button?: Partial<Record<ThemeColorButtonModeKey, ThemeColorButtonTokens>>
1607
- input?: Partial<Record<ColorConfigInputMode, ThemeColorInputTokens>>
1608
- selectable?: Partial<
1609
- Record<
1610
- ColorConfigStateTone,
1611
- {
1612
- _hue?: Hue_2
1613
- } & ThemeColorStatesTokens
1614
- >
1615
- >
1616
- syntax?: Partial<Record<keyof ThemeColorSyntax, ThemeColorTokenValue>>
237
+ interface FontWeights {
238
+ regular: number;
239
+ medium: number;
240
+ semibold: number;
241
+ bold: number;
1617
242
  }
1618
-
1619
- /** @public */
1620
- export declare type ThemeColorTokenValue = [ColorConfigValue, ColorConfigValue]
1621
-
1622
- /**
1623
- * @public
1624
- * @deprecated Use `ThemeColorCardToneKey` instead.
1625
- */
1626
- export declare type ThemeColorToneKey = ThemeColorName
1627
-
1628
- /** @public */
1629
- export declare type ThemeColorVariant = Record<ThemeColorStateToneKey, ThemeColorElement>
1630
-
1631
- /** @public */
1632
- export declare type ThemeColorVariantKey = (typeof COLOR_VARIANTS)[number]
1633
-
1634
243
  /** @public */
1635
- export declare interface ThemeConfig {
1636
- avatar?: ThemeAvatar_v2
1637
- button?: {
1638
- border: {
1639
- width: number
1640
- }
1641
- focusRing: ThemeFocusRing
1642
- textWeight: ThemeFontWeightKey
1643
- }
1644
- card?: {
1645
- border: {
1646
- width: number
1647
- }
1648
- focusRing: ThemeFocusRing
1649
- shadow: {
1650
- outline: number
1651
- }
1652
- }
1653
- color?: ThemeColorTokens
1654
- container?: number[]
1655
- font?: ThemeFonts
1656
- input?: ThemeInput_v2
1657
- layer?: ThemeLayer
1658
- media?: number[]
1659
- palette?: ThemeColorPalette
1660
- radius?: number[]
1661
- shadow?: Array<ThemeShadow | null>
1662
- space?: number[]
1663
- /** @internal */
1664
- style?: ThemeStyles
244
+ interface FocusRing {
245
+ offset: number;
246
+ width: number;
1665
247
  }
1666
-
1667
248
  /** @public */
1668
- export declare type ThemeEntry = [`--${string}`, string]
1669
-
249
+ type AvatarSize = (typeof AVATAR_SIZE)[number];
1670
250
  /** @public */
1671
- export declare interface ThemeFocusRing {
1672
- offset: number
1673
- width: number
1674
- }
1675
-
251
+ type ContainerScale = (typeof CONTAINER_SCALE)[number];
1676
252
  /** @public */
1677
- export declare interface ThemeFont {
1678
- family: string
1679
- weights: ThemeFontWeight
1680
- sizes: ThemeFontSize[]
1681
- /** @deprecated No longer supported. */
1682
- horizontalOffset?: number
1683
- }
1684
-
253
+ type ContainerWidth = (typeof CONTAINER)[number];
1685
254
  /** @public */
1686
- export declare interface ThemeFont_v3 {
1687
- family: string
1688
- featureSettings?: string
1689
- weight: ThemeFontWeight
1690
- scale: ThemeFontSize_v3[]
1691
- }
1692
-
255
+ type Radius = (typeof RADIUS)[number];
1693
256
  /** @public */
1694
- export declare type ThemeFontKey = 'code' | 'heading' | 'label' | 'text'
1695
-
257
+ type Space = (typeof SPACE)[number];
1696
258
  /** @public */
1697
- export declare interface ThemeFonts {
1698
- code: ThemeFont
1699
- heading: ThemeFont
1700
- label: ThemeFont
1701
- text: ThemeFont
1702
- }
1703
-
259
+ type FontWeight = "regular" | "medium" | "semibold" | "bold";
1704
260
  /** @public */
1705
- export declare interface ThemeFonts_v3 {
1706
- code: ThemeFont_v3
1707
- heading: ThemeFont_v3
1708
- label: ThemeFont_v3
1709
- text: ThemeFont_v3
1710
- }
1711
-
261
+ type FontCodeSize = (typeof FONT_CODE_SIZE)[number];
1712
262
  /** @public */
1713
- export declare interface ThemeFontSize {
1714
- ascenderHeight: number
1715
- descenderHeight: number
1716
- fontSize: number
1717
- iconSize: number
1718
- letterSpacing: number
1719
- lineHeight: number
1720
- }
1721
-
263
+ type FontHeadingSize = (typeof FONT_HEADING_SIZE)[number];
1722
264
  /** @public */
1723
- export declare interface ThemeFontSize_v3 {
1724
- ascenderHeight: number
1725
- descenderHeight: number
1726
- fontSize: number
1727
- iconSize: number
1728
- letterSpacing: number
1729
- lineHeight: number
1730
- customIconSize: number
1731
- }
1732
-
265
+ type FontLabelSize = (typeof FONT_LABEL_SIZE)[number];
1733
266
  /** @public */
1734
- export declare interface ThemeFontWeight {
1735
- regular: number
1736
- medium: number
1737
- semibold: number
1738
- bold: number
1739
- }
1740
-
267
+ type FontTextSize = (typeof FONT_TEXT_SIZE)[number];
1741
268
  /** @public */
1742
- export declare type ThemeFontWeightKey = 'regular' | 'medium' | 'semibold' | 'bold'
1743
-
1744
- /**
1745
- * @public
1746
- * @deprecated Use `ThemeInput_v2` instead
1747
- */
1748
- export declare interface ThemeInput {
1749
- checkbox: {
1750
- size: number
1751
- }
1752
- radio: {
1753
- size: number
1754
- markSize: number
1755
- }
1756
- switch: {
1757
- width: number
1758
- height: number
1759
- padding: number
1760
- transitionDurationMs: number
1761
- transitionTimingFunction: string
1762
- }
1763
- border: {
1764
- width: number
1765
- }
1766
- }
1767
-
269
+ type Shadow = (typeof SHADOW)[number];
1768
270
  /** @public */
1769
- export declare interface ThemeInput_v2 {
1770
- checkbox: {
1771
- size: number
1772
- focusRing: ThemeFocusRing
1773
- }
1774
- radio: {
1775
- size: number
1776
- markSize: number
1777
- focusRing: ThemeFocusRing
1778
- }
1779
- switch: {
1780
- width: number
1781
- height: number
1782
- padding: number
1783
- transitionDurationMs: number
1784
- transitionTimingFunction: string
1785
- focusRing: ThemeFocusRing
1786
- }
1787
- border: {
1788
- width: number
1789
- }
1790
- select: {
1791
- focusRing: ThemeFocusRing
1792
- }
1793
- text: {
1794
- focusRing: ThemeFocusRing
1795
- }
271
+ interface Options {
272
+ tokens?: PartialTokens<Tokens>;
1796
273
  }
1797
-
1798
274
  /** @public */
1799
- export declare interface ThemeLayer {
1800
- dialog: {
1801
- zOffset: number
1802
- }
1803
- popover: {
1804
- zOffset: number
1805
- }
1806
- tooltip: {
1807
- zOffset: number
1808
- }
275
+ interface Palette {
276
+ black: ColorTint;
277
+ white: ColorTint;
278
+ hues: ColorHues;
1809
279
  }
1810
-
1811
280
  /** @public */
1812
- export declare interface ThemeOptions {
1813
- v2?: ThemeConfig
1814
- tokens?: PartialTokens<Tokens>
281
+ interface FontSize {
282
+ ascenderHeight: number;
283
+ descenderHeight: number;
284
+ fontSize: number;
285
+ iconSize: number;
286
+ letterSpacing: number;
287
+ lineHeight: number;
288
+ customIconSize: number;
1815
289
  }
1816
-
1817
290
  /** @public */
1818
- export declare interface ThemePalette_v3 {
1819
- black: ColorTint
1820
- white: ColorTint
1821
- hues: ColorHues
291
+ interface Font {
292
+ family: string;
293
+ featureSettings?: string;
294
+ weight: FontWeights;
295
+ scale: FontSize[];
1822
296
  }
1823
-
1824
297
  /** @public */
1825
- export declare interface ThemeShadow {
1826
- umbra: ThemeBoxShadow
1827
- penumbra: ThemeBoxShadow
1828
- ambient: ThemeBoxShadow
1829
- }
1830
-
1831
- /**
1832
- * @internal
1833
- */
1834
- export declare interface ThemeStyles {
1835
- button?: {
1836
- root?: CSSObject
1837
- }
1838
- card?: {
1839
- root?: CSSObject
1840
- }
298
+ interface Fonts {
299
+ code: Font;
300
+ heading: Font;
301
+ label: Font;
302
+ text: Font;
1841
303
  }
1842
-
1843
304
  /** @public */
1844
- export declare type Tint = (typeof TINTS)[number]
1845
-
1846
- /** @public */
1847
- export declare const TINTS: readonly [50, 100, 200, 300, 400, 500, 600, 700, 800, 900, 950]
1848
-
1849
- /** @internal */
1850
- export declare interface TokenBaseKeyNode {
1851
- type: 'base'
1852
- tone: ColorConfigCardTone
1853
- key: ColorConfigCardKey | ColorConfigBlendKey
1854
- }
1855
-
1856
- /** @internal */
1857
- export declare interface TokenBlendModeValueNode {
1858
- type: 'blendMode'
1859
- value?: ThemeColorBlendModeKey
305
+ interface Theme {
306
+ _version: 3;
307
+ _tokens: Tokens;
308
+ avatar: ThemeAvatar;
309
+ button: {
310
+ border: {
311
+ width: number;
312
+ };
313
+ focusRing: FocusRing;
314
+ textWeight: FontWeight;
315
+ };
316
+ card: {
317
+ border: {
318
+ width: number;
319
+ };
320
+ focusRing: FocusRing;
321
+ shadow: {
322
+ outline: number;
323
+ };
324
+ };
325
+ color: Color;
326
+ container: number[];
327
+ font: Fonts;
328
+ input: Input;
329
+ layer: Layer;
330
+ media: number[];
331
+ palette: Palette;
332
+ radius: Record<Radius, number>;
333
+ shadow: Record<Shadow, ShadowProperties | undefined>;
334
+ space: Record<Space, number>;
1860
335
  }
1861
-
1862
336
  /** @internal */
1863
- export declare interface TokenButtonKeyNode {
1864
- type: 'button'
1865
- tone: ColorConfigStateTone
1866
- mode: ThemeColorButtonModeKey
1867
- key: ColorConfigStateKey | ColorConfigBlendKey
337
+ interface ColorNode {
338
+ type: "color";
339
+ name: "black" | "white";
340
+ /** Between 0 and 1 */
341
+ opacity: number;
342
+ /** Between 0 and 1 */
343
+ mix: number;
1868
344
  }
1869
-
1870
345
  /** @internal */
1871
- export declare interface TokenColorValueNode {
1872
- type: 'color'
1873
- key?: 'black' | 'white'
1874
- hue?: ColorHueKey
1875
- mix?: number
1876
- opacity?: number
1877
- tint?: ColorTintKey
346
+ interface ColorTintNode {
347
+ type: "tint";
348
+ hue: Hue;
349
+ tint: Tint;
350
+ /** Between 0 and 1 */
351
+ opacity: number;
352
+ /** Between 0 and 1 */
353
+ mix: number;
1878
354
  }
1879
-
1880
355
  /** @internal */
1881
- export declare interface TokenHueValueNode {
1882
- type: 'hue'
1883
- value?: ColorHueKey
356
+ interface ColorInheritNode {
357
+ type: "inherit";
1884
358
  }
1885
-
1886
359
  /** @internal */
1887
- export declare type TokenizeColorResult = ColorNode | ColorTintNode | ColorInheritNode
1888
-
360
+ type TokenizeColorResult = ColorNode | ColorTintNode | ColorInheritNode;
1889
361
  /** @internal */
1890
- export declare type TokenKeyNode = TokenBaseKeyNode | TokenButtonKeyNode
1891
-
362
+ declare function _parseColorToken(str: ColorToken, options: {
363
+ defaultHue: Hue;
364
+ }): TokenizeColorResult;
1892
365
  /** @public */
1893
- export declare interface Tokens {
1894
- color: ColorTokens
1895
- }
1896
-
366
+ declare function buildTheme(options?: Options): Theme;
1897
367
  /** @internal */
1898
- export declare type TokenValueNode =
1899
- | TokenColorValueNode
1900
- | TokenHueValueNode
1901
- | TokenBlendModeValueNode
1902
-
1903
- export {}
368
+ declare function resolveTokens(tokens?: PartialTokens<Tokens>): Tokens;
369
+ export { AVATAR_COLORS, AVATAR_SIZE, AvatarColor, AvatarColorProperties, AvatarSize, AvatarsColor, BUTTON_MODES, BoxShadow, ButtonMode, CARD_TONES, COLOR_SCHEMES, COLOR_VARIANTS, CONTAINER, CONTAINER_SCALE, CardColorTokens, CardTone, Color, ColorInheritNode, ColorNode, ColorScheme, ColorTintNode, ColorToken, ColorTokenOpacityValue, ColorTokens, ColorValue, ColorVariant, ContainerScale, ContainerWidth, ELEMENT_TONES, ElementColorTokens, ElementTone, ElementsColorTokens, FONT_CODE_SIZE, FONT_HEADING_SIZE, FONT_LABEL_SIZE, FONT_TEXT_SIZE, FocusRing, Font, FontCodeSize, FontHeadingSize, FontLabelSize, FontSize, FontTextSize, FontWeight, FontWeights, Fonts, HUES, Hue, Input, Layer, Options, Palette, PartialTokens, RADIUS, Radius, ResolvedColorToken, SHADOW, SPACE, Shadow, ShadowProperties, Space, TINTS, Theme, ThemeAvatar, Tint, TokenizeColorResult, Tokens, _parseColorToken, buildTheme, resolveTokens };