@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
@@ -2,7 +2,7 @@ import {_style} from '../../_style.css'
2
2
  import {layers} from '../../layers.css'
3
3
  import {vars} from '../../vars.css'
4
4
 
5
- export const root = _style(layers.primitives, {
5
+ export const root: string = _style(layers.primitives, {
6
6
  position: 'absolute',
7
7
  width: vars.arrow.size,
8
8
  height: vars.arrow.size,
@@ -30,7 +30,7 @@ export const root = _style(layers.primitives, {
30
30
  },
31
31
  })
32
32
 
33
- export const svg = _style(layers.primitives, {
33
+ export const svg: string = _style(layers.primitives, {
34
34
  display: 'block',
35
35
  transformOrigin: `calc(${vars.arrow.size} / 2) calc(${vars.arrow.size} / 2)`,
36
36
 
@@ -53,16 +53,16 @@ export const svg = _style(layers.primitives, {
53
53
  },
54
54
  })
55
55
 
56
- export const strokeMask = _style(layers.primitives, {
56
+ export const strokeMask: string = _style(layers.primitives, {
57
57
  // @ts-expect-error `y` is not a valid property in 'csstype'
58
58
  y: vars.shadow.outline,
59
59
  })
60
60
 
61
- export const stroke = _style(layers.primitives, {
61
+ export const stroke: string = _style(layers.primitives, {
62
62
  stroke: vars.color.shadow.outline,
63
63
  strokeWidth: `calc(${vars.card.shadow.outline} * 2)`,
64
64
  })
65
65
 
66
- export const fill = _style(layers.primitives, {
66
+ export const fill: string = _style(layers.primitives, {
67
67
  fill: vars.color.bg,
68
68
  })
@@ -7,13 +7,13 @@ import {layers} from '../../layers.css'
7
7
  import type {ResponsiveRuleOptions} from '../../types'
8
8
  import {vars} from '../../vars.css'
9
9
 
10
- export const root = _style(layers.primitives, {
10
+ export const root: string = _style(layers.primitives, {
11
11
  position: 'relative',
12
12
  })
13
13
 
14
- export const border = _style(layers.primitives, {})
14
+ export const border: string = _style(layers.primitives, {})
15
15
 
16
- export const element = _style(layers.primitives, {
16
+ export const element: string = _style(layers.primitives, {
17
17
  WebkitFontSmoothing: 'inherit',
18
18
  appearance: 'none',
19
19
  border: 0,
@@ -108,7 +108,7 @@ export const element = _style(layers.primitives, {
108
108
  },
109
109
  })
110
110
 
111
- export const presentation = _style(layers.primitives, {
111
+ export const presentation: string = _style(layers.primitives, {
112
112
  backgroundColor: vars.color.input.text.bg,
113
113
  borderRadius: 'inherit',
114
114
  boxShadow: `inset 0 0 0 ${vars.input.border.width} ${vars.color.input.text.border}`,
@@ -1,11 +1,11 @@
1
- import {THEME_COLOR_STATE_TONES} from '@sanity/ui/theme'
1
+ import {ELEMENT_TONES, type ElementTone} from '@sanity/ui/theme'
2
2
 
3
3
  import {_fromEntries} from '../../_fromEntries'
4
4
  import {_style} from '../../_style.css'
5
5
  import {layers} from '../../layers.css'
6
6
  import {vars} from '../../vars.css'
7
7
 
8
- export const root = _style(layers.primitives, {
8
+ export const root: string = _style(layers.primitives, {
9
9
  backgroundColor: vars.color.bg,
10
10
  color: vars.color.fg,
11
11
 
@@ -28,9 +28,9 @@ export const root = _style(layers.primitives, {
28
28
  },
29
29
  })
30
30
 
31
- export const tones = {
31
+ export const tones: Record<ElementTone, string> = {
32
32
  ..._fromEntries(
33
- THEME_COLOR_STATE_TONES.map((t) => {
33
+ ELEMENT_TONES.map((t) => {
34
34
  const tinted = vars.color.tinted[t]
35
35
  const focused = vars.color.solid.primary
36
36
  const disabled = vars.color.tinted.default
@@ -1,9 +1,9 @@
1
- import type {ThemeColorStateToneKey} from '@sanity/ui/theme'
1
+ import type {ElementTone} from '@sanity/ui/theme'
2
2
 
3
3
  import type {RadiusStyleProps} from '../../props/radius/types'
4
4
 
5
5
  /** @internal */
6
6
  export interface SelectableStyleProps extends RadiusStyleProps {
7
7
  className?: string
8
- tone?: ThemeColorStateToneKey
8
+ tone?: ElementTone
9
9
  }
@@ -1,4 +1,4 @@
1
- import {AVATAR_COLORS, AVATAR_SIZE, type AvatarSize} from '@sanity/ui/theme'
1
+ import {AVATAR_COLORS, AVATAR_SIZE, type AvatarColor, type AvatarSize} from '@sanity/ui/theme'
2
2
  import {globalStyle} from '@vanilla-extract/css'
3
3
 
4
4
  import {_fromEntries} from '../../_fromEntries'
@@ -8,7 +8,7 @@ import {layers} from '../../layers.css'
8
8
  import type {ResponsiveRuleOptions} from '../../types'
9
9
  import {vars} from '../../vars.css'
10
10
 
11
- export const stack = _style(layers.primitives, {})
11
+ export const stack: string = _style(layers.primitives, {})
12
12
 
13
13
  globalStyle(`${stack} > * + *`, {
14
14
  '@layer': {
@@ -18,7 +18,7 @@ globalStyle(`${stack} > * + *`, {
18
18
  },
19
19
  })
20
20
 
21
- export const root = _style(layers.primitives, {
21
+ export const root: string = _style(layers.primitives, {
22
22
  // display: 'block',
23
23
  backgroundColor: vars.color.avatar.bg,
24
24
  position: 'relative',
@@ -68,7 +68,7 @@ export const root = _style(layers.primitives, {
68
68
  },
69
69
  })
70
70
 
71
- export const colors = {
71
+ export const colors: Record<AvatarColor, string> = {
72
72
  ..._fromEntries(
73
73
  AVATAR_COLORS.map((c) => [
74
74
  c,
@@ -82,7 +82,7 @@ export const colors = {
82
82
  ),
83
83
  }
84
84
 
85
- export const arrow = _style(layers.primitives, {
85
+ export const arrow: string = _style(layers.primitives, {
86
86
  position: 'absolute',
87
87
  boxSizing: 'border-box',
88
88
  zIndex: 0,
@@ -112,7 +112,7 @@ export const arrow = _style(layers.primitives, {
112
112
  },
113
113
  })
114
114
 
115
- export const arrowSvg = _style(layers.primitives, {
115
+ export const arrowSvg: string = _style(layers.primitives, {
116
116
  display: 'block',
117
117
  width: '11px',
118
118
  height: '7px',
@@ -122,7 +122,7 @@ export const arrowSvg = _style(layers.primitives, {
122
122
  transform: 'translateX(-6px)',
123
123
  })
124
124
 
125
- export const image = _style(layers.primitives, {
125
+ export const image: string = _style(layers.primitives, {
126
126
  position: 'absolute',
127
127
  top: 0,
128
128
  left: 0,
@@ -145,7 +145,7 @@ globalStyle(`${image} img`, {
145
145
  borderRadius: 'inherit',
146
146
  })
147
147
 
148
- export const imageOutline = _style(layers.primitives, {
148
+ export const imageOutline: string = _style(layers.primitives, {
149
149
  display: 'block',
150
150
  position: 'absolute',
151
151
  top: 0,
@@ -159,12 +159,12 @@ export const imageOutline = _style(layers.primitives, {
159
159
  ].join(', '),
160
160
  })
161
161
 
162
- export const initials = _style(layers.primitives, {
162
+ export const initials: string = _style(layers.primitives, {
163
163
  color: vars.color.avatar.fg,
164
164
  borderRadius: 'inherit',
165
165
  })
166
166
 
167
- export const counter = _style(layers.primitives, {
167
+ export const counter: string = _style(layers.primitives, {
168
168
  color: vars.color.fg,
169
169
  backgroundColor: vars.color.bg,
170
170
  boxShadow: [`0 0 0 1px ${vars.color.bg}`, `inset 0 0 0 1px ${vars.color.border}`].join(', '),
@@ -1,19 +1,19 @@
1
- import {THEME_COLOR_STATE_TONES} from '@sanity/ui/theme'
1
+ import {ELEMENT_TONES, type ElementTone} from '@sanity/ui/theme'
2
2
 
3
3
  import {_fromEntries} from '../../_fromEntries'
4
4
  import {_style} from '../../_style.css'
5
5
  import {layers} from '../../layers.css'
6
6
  import {vars} from '../../vars.css'
7
7
 
8
- export const root = _style(layers.primitives, {
8
+ export const root: string = _style(layers.primitives, {
9
9
  backgroundColor: vars.color.bg,
10
10
  color: vars.color.fg,
11
11
  whiteSpace: 'nowrap',
12
12
  })
13
13
 
14
- export const tones = {
14
+ export const tones: Record<ElementTone, string> = {
15
15
  ..._fromEntries(
16
- THEME_COLOR_STATE_TONES.map((t) => [
16
+ ELEMENT_TONES.map((t) => [
17
17
  t,
18
18
  _style(layers.primitives, {
19
19
  vars: {
@@ -1,7 +1,13 @@
1
- import type {ThemeColorStateToneKey} from '@sanity/ui/theme'
1
+ import type {FontTextSize, ElementTone} from '@sanity/ui/theme'
2
+
3
+ import type {ResponsiveProp} from '../../types'
4
+
5
+ /** @public */
6
+ export type BadgeTone = ElementTone
2
7
 
3
8
  /** @public */
4
9
  export interface BadgeStyleProps {
5
10
  className?: string
6
- tone?: ThemeColorStateToneKey
11
+ fontSize?: ResponsiveProp<FontTextSize>
12
+ tone?: BadgeTone
7
13
  }
@@ -2,7 +2,7 @@ import {_style} from '../../_style.css'
2
2
  import {layers} from '../../layers.css'
3
3
  import {vars} from '../../vars.css'
4
4
 
5
- export const root = _style(layers.primitives, {
5
+ export const root: string = _style(layers.primitives, {
6
6
  selectors: {
7
7
  'iframe.&': {
8
8
  border: 'none',
@@ -14,6 +14,6 @@ export const root = _style(layers.primitives, {
14
14
  },
15
15
  })
16
16
 
17
- export const muted = _style(layers.primitives, {
17
+ export const muted: string = _style(layers.primitives, {
18
18
  backgroundColor: vars.color.muted.bg,
19
19
  })
@@ -1,11 +1,11 @@
1
- import {AVATAR_COLORS, THEME_COLOR_STATE_TONES} from '@sanity/ui/theme'
1
+ import {AVATAR_COLORS, type ButtonMode, ELEMENT_TONES, type ElementTone} from '@sanity/ui/theme'
2
2
 
3
3
  import {_fromEntries} from '../../_fromEntries'
4
4
  import {_style} from '../../_style.css'
5
5
  import {layers} from '../../layers.css'
6
6
  import {vars} from '../../vars.css'
7
7
 
8
- export const root = _style(layers.primitives, {
8
+ export const root: string = _style(layers.primitives, {
9
9
  WebkitFontSmoothing: 'inherit',
10
10
  alignItems: 'center',
11
11
  appearance: 'none',
@@ -45,13 +45,13 @@ export const root = _style(layers.primitives, {
45
45
  },
46
46
  })
47
47
 
48
- export const modes = {
48
+ export const modes: Record<ButtonMode, string> = {
49
49
  default: _style(layers.primitives, {}),
50
50
  ghost: _style(layers.primitives, {boxShadow: vars.button.boxShadow}),
51
51
  bleed: _style(layers.primitives, {}),
52
52
  }
53
53
 
54
- export const loadingBox = _style(layers.primitives, {
54
+ export const loadingBox: string = _style(layers.primitives, {
55
55
  position: 'absolute',
56
56
  top: 0,
57
57
  left: 0,
@@ -63,9 +63,9 @@ export const loadingBox = _style(layers.primitives, {
63
63
  opacity: 0.8,
64
64
  })
65
65
 
66
- export const tones = {
66
+ export const tones: Record<ElementTone, string> = {
67
67
  ..._fromEntries(
68
- THEME_COLOR_STATE_TONES.map((t) => {
68
+ ELEMENT_TONES.map((t) => {
69
69
  const solid = vars.color.solid[t]
70
70
  const tinted = vars.color.tinted[t]
71
71
 
@@ -7,7 +7,7 @@ import {loadingBox, modes, root, tones} from './button.css'
7
7
  import type {ButtonStyleProps} from './types'
8
8
 
9
9
  /** @public */
10
- export function button(props: ButtonStyleProps) {
10
+ export function button(props: ButtonStyleProps): string | undefined {
11
11
  return _composeClassNames(
12
12
  props.className,
13
13
  root,
@@ -21,6 +21,6 @@ export function button(props: ButtonStyleProps) {
21
21
  }
22
22
 
23
23
  /** @public */
24
- export function buttonLoadingBox() {
24
+ export function buttonLoadingBox(): string {
25
25
  return loadingBox
26
26
  }
@@ -1,4 +1,4 @@
1
- import type {ThemeColorButtonModeKey, ThemeColorStateToneKey} from '@sanity/ui/theme'
1
+ import type {ButtonMode, ElementTone} from '@sanity/ui/theme'
2
2
 
3
3
  import type {FlexStyleProps} from '../../props/flex/types'
4
4
  import type {RadiusStyleProps} from '../../props/radius/types'
@@ -7,6 +7,6 @@ import type {WidthStyleProps} from '../../props/width/types'
7
7
  /** @public */
8
8
  export interface ButtonStyleProps extends FlexStyleProps, RadiusStyleProps, WidthStyleProps {
9
9
  className?: string
10
- mode?: ThemeColorButtonModeKey
11
- tone?: ThemeColorStateToneKey
10
+ mode?: ButtonMode
11
+ tone?: ElementTone
12
12
  }
@@ -3,12 +3,12 @@
3
3
  import {Box, Card, Code} from '@sanity/ui'
4
4
  import {vars} from '@sanity/ui/css'
5
5
  import {
6
+ CARD_TONES,
7
+ type CardTone,
8
+ COLOR_SCHEMES,
6
9
  COLOR_VARIANTS,
7
- THEME_COLOR_CARD_TONES,
8
- THEME_COLOR_SCHEMES,
9
- type ThemeColorCardToneKey,
10
- type ThemeColorSchemeKey,
11
- type ThemeColorVariantKey,
10
+ type ColorScheme,
11
+ type ColorVariant,
12
12
  } from '@sanity/ui/theme'
13
13
  import {useSelect} from '@sanity/ui-workshop'
14
14
  import {useState} from 'react'
@@ -19,7 +19,7 @@ interface ColorRecordNode extends Record<string, ColorNode> {}
19
19
 
20
20
  type ColorNode = string | ColorRecordNode
21
21
 
22
- export default function ColorStory() {
22
+ export default function ColorStory(): React.JSX.Element {
23
23
  const tone = useSelect('Tone', WORKSHOP_CARD_TONE_OPTIONS, 'default')
24
24
 
25
25
  return (
@@ -29,15 +29,15 @@ export default function ColorStory() {
29
29
  return null
30
30
  }
31
31
 
32
- if (THEME_COLOR_SCHEMES.includes(key as ThemeColorSchemeKey)) {
32
+ if (COLOR_SCHEMES.includes(key as ColorScheme)) {
33
33
  return null
34
34
  }
35
35
 
36
- if (THEME_COLOR_CARD_TONES.includes(key as ThemeColorCardToneKey)) {
36
+ if (CARD_TONES.includes(key as CardTone)) {
37
37
  return null
38
38
  }
39
39
 
40
- if (COLOR_VARIANTS.includes(key as ThemeColorVariantKey)) {
40
+ if (COLOR_VARIANTS.includes(key as ColorVariant)) {
41
41
  // return null
42
42
  }
43
43
 
@@ -1,7 +1,7 @@
1
- import {defineScope} from '@sanity/ui-workshop'
1
+ import type {WorkshopScope} from '@sanity/ui-workshop'
2
2
  import {lazy} from 'react'
3
3
 
4
- export default defineScope({
4
+ const scope: WorkshopScope = {
5
5
  name: 'css/card',
6
6
  title: 'Card',
7
7
  stories: [
@@ -11,4 +11,6 @@ export default defineScope({
11
11
  component: lazy(() => import('./color')),
12
12
  },
13
13
  ],
14
- })
14
+ }
15
+
16
+ export default scope
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  AVATAR_COLORS,
3
+ CARD_TONES,
4
+ type CardTone,
5
+ COLOR_SCHEMES,
3
6
  COLOR_VARIANTS,
4
- THEME_COLOR_CARD_TONES as CARD_TONES,
5
- THEME_COLOR_SCHEMES as COLOR_SCHEMES,
6
- THEME_COLOR_STATE_TONES as STATE_TONES,
7
- type ThemeColorCardToneKey as CardTone,
8
- type ThemeColorSchemeKey as ColorScheme,
7
+ type ColorScheme,
8
+ ELEMENT_TONES,
9
9
  } from '@sanity/ui/theme'
10
10
  import {type StyleRule} from '@vanilla-extract/css'
11
11
 
@@ -15,7 +15,7 @@ import {_style} from '../../_style.css'
15
15
  import {layers} from '../../layers.css'
16
16
  import {vars} from '../../vars.css'
17
17
 
18
- export const root = _style(layers.primitives, {
18
+ export const root: string = _style(layers.primitives, {
19
19
  backgroundColor: vars.color.bg,
20
20
  color: vars.color.fg,
21
21
 
@@ -137,7 +137,7 @@ export const root = _style(layers.primitives, {
137
137
  },
138
138
  })
139
139
 
140
- export const schemes = _fromEntries(
140
+ export const schemes: Record<ColorScheme, string> = _fromEntries(
141
141
  COLOR_SCHEMES.map((s) => [
142
142
  s,
143
143
  _style(layers.primitives, {
@@ -161,8 +161,8 @@ function buildSchemeVars(scheme: ColorScheme) {
161
161
 
162
162
  _assign(schemeVars, {
163
163
  [target.backdrop]: source.backdrop,
164
- [target.bg]: source.tinted.default.bg[0],
165
- [target.border]: source.tinted.default.border[0],
164
+ // [target.bg]: source.tinted.default.bg[0],
165
+ // [target.border]: source.tinted.default.border[0],
166
166
 
167
167
  [target.code.fg]: source.code.fg,
168
168
  [target.code.bg]: source.code.bg,
@@ -204,15 +204,9 @@ function buildSchemeVars(scheme: ColorScheme) {
204
204
  [target.code.token.url]: source.code.token.url,
205
205
  [target.code.token.variable]: source.code.token.variable,
206
206
 
207
- [target.fg]: source.tinted.default.fg[0],
208
-
209
207
  [target.focusRing]: source.focusRing,
210
208
  [target.link.fg]: source.link.fg,
211
209
 
212
- [target.muted.bg]: source.tinted.default.bg[4],
213
- [target.muted.border]: source.tinted.default.border[4],
214
- [target.muted.fg]: source.tinted.default.fg[4],
215
-
216
210
  [target.shadow.outline]: source.shadow.outline,
217
211
  [target.shadow.umbra]: source.shadow.umbra,
218
212
  [target.shadow.penumbra]: source.shadow.penumbra,
@@ -223,7 +217,7 @@ function buildSchemeVars(scheme: ColorScheme) {
223
217
  })
224
218
 
225
219
  for (const variant of COLOR_VARIANTS) {
226
- for (const elementTone of STATE_TONES) {
220
+ for (const elementTone of ELEMENT_TONES) {
227
221
  const _target = vars.color[tone][variant][elementTone]
228
222
  const _source = vars.color[scheme][tone][variant][elementTone]
229
223
 
@@ -242,7 +236,7 @@ function buildSchemeVars(scheme: ColorScheme) {
242
236
  return schemeVars
243
237
  }
244
238
 
245
- export const tones = _fromEntries(
239
+ export const tones: Record<CardTone, string> = _fromEntries(
246
240
  CARD_TONES.map((t) => [t, _style(layers.primitives, buildToneRule(t))]),
247
241
  )
248
242
 
@@ -338,7 +332,7 @@ function buildToneRule(tone: CardTone): StyleRule {
338
332
  })
339
333
 
340
334
  for (const variant of COLOR_VARIANTS) {
341
- for (const elementTone of STATE_TONES) {
335
+ for (const elementTone of ELEMENT_TONES) {
342
336
  const _target = vars.color[variant][elementTone]
343
337
  const _source = vars.color[tone][variant][elementTone]
344
338
 
@@ -1,9 +1,9 @@
1
- import type {ThemeColorCardToneKey, ThemeColorSchemeKey} from '@sanity/ui/theme'
1
+ import type {CardTone, ColorScheme} from '@sanity/ui/theme'
2
2
 
3
3
  /** @public */
4
4
  export interface CardStyleProps {
5
5
  className?: string
6
6
  checkered?: boolean
7
- scheme?: ThemeColorSchemeKey
8
- tone?: ThemeColorCardToneKey | 'inherit'
7
+ scheme?: ColorScheme
8
+ tone?: CardTone | 'inherit'
9
9
  }
@@ -4,7 +4,7 @@ import {_style} from '../../_style.css'
4
4
  import {layers} from '../../layers.css'
5
5
  import {vars} from '../../vars.css'
6
6
 
7
- export const root = _style(layers.primitives, {
7
+ export const root: string = _style(layers.primitives, {
8
8
  position: 'relative',
9
9
 
10
10
  selectors: {
@@ -14,7 +14,7 @@ export const root = _style(layers.primitives, {
14
14
  },
15
15
  })
16
16
 
17
- export const input = _style(layers.primitives, {
17
+ export const input: string = _style(layers.primitives, {
18
18
  position: 'absolute',
19
19
  top: 0,
20
20
  left: 0,
@@ -27,7 +27,7 @@ export const input = _style(layers.primitives, {
27
27
  margin: 0,
28
28
  })
29
29
 
30
- export const presentation = _style(layers.primitives, {
30
+ export const presentation: string = _style(layers.primitives, {
31
31
  position: 'relative',
32
32
  display: 'block',
33
33
  width: vars.input.checkbox.size,
@@ -2,16 +2,16 @@ import {_composeClassNames} from '../../_composeClassNames'
2
2
  import {input, presentation, root} from './checkbox.css'
3
3
 
4
4
  /** @public */
5
- export function checkbox(props: {className?: string}) {
5
+ export function checkbox(props: {className?: string}): string | undefined {
6
6
  return _composeClassNames(props.className, root)
7
7
  }
8
8
 
9
9
  /** @public */
10
- export function checkboxInput() {
10
+ export function checkboxInput(): string {
11
11
  return input
12
12
  }
13
13
 
14
14
  /** @public */
15
- export function checkboxPresentation() {
15
+ export function checkboxPresentation(): string {
16
16
  return presentation
17
17
  }
@@ -1,13 +1,14 @@
1
- import {FONT_CODE_SIZE} from '@sanity/ui/theme'
1
+ import {FONT_CODE_SIZE, type FontCodeSize} from '@sanity/ui/theme'
2
2
  import {globalStyle} from '@vanilla-extract/css'
3
3
 
4
4
  import {_fromEntries} from '../../_fromEntries'
5
5
  import {_responsiveStyle} from '../../_responsiveStyle.css'
6
6
  import {_style} from '../../_style.css'
7
7
  import {layers} from '../../layers.css'
8
+ import type {ResponsiveRuleOptions} from '../../types'
8
9
  import {vars} from '../../vars.css'
9
10
 
10
- export const root = _style(layers.primitives, {
11
+ export const root: string = _style(layers.primitives, {
11
12
  vars: {
12
13
  [vars.font.family]: vars.font.code.family,
13
14
  [vars.font.featureSettings]: vars.font.code.featureSettings,
@@ -247,7 +248,7 @@ globalStyle(`${root} .token.variable`, {
247
248
  },
248
249
  })
249
250
 
250
- export const scale = {
251
+ export const scale: ResponsiveRuleOptions<FontCodeSize> = {
251
252
  ..._fromEntries(
252
253
  FONT_CODE_SIZE.map((s) => {
253
254
  const v = vars.font.code.scale[s]
@@ -1,12 +1,11 @@
1
+ import type {FontCodeSize} from '@sanity/ui/theme'
2
+
1
3
  import type {FlexStyleProps} from '../../props/flex/types'
2
4
  import type {FontStyleProps} from '../../props/font/types'
3
5
  import type {ResponsiveProp} from '../../types'
4
6
 
5
- /** @public */
6
- export type CodeSize = number
7
-
8
7
  /** @public */
9
8
  export interface CodeStyleProps extends FlexStyleProps, Omit<FontStyleProps, 'align'> {
10
9
  className?: string
11
- size?: ResponsiveProp<CodeSize>
10
+ size?: ResponsiveProp<FontCodeSize>
12
11
  }
@@ -1,4 +1,4 @@
1
1
  import {_style} from '../../_style.css'
2
2
  import {layers} from '../../layers.css'
3
3
 
4
- export const root = _style(layers.primitives, {})
4
+ export const root: string = _style(layers.primitives, {})
@@ -1,13 +1,14 @@
1
- import {FONT_HEADING_SIZE} from '@sanity/ui/theme'
1
+ import {FONT_HEADING_SIZE, type FontHeadingSize} from '@sanity/ui/theme'
2
2
  import {globalStyle} from '@vanilla-extract/css'
3
3
 
4
4
  import {_fromEntries} from '../../_fromEntries'
5
5
  import {_responsiveStyle} from '../../_responsiveStyle.css'
6
6
  import {_style} from '../../_style.css'
7
7
  import {layers} from '../../layers.css'
8
+ import type {ResponsiveRuleOptions} from '../../types'
8
9
  import {vars} from '../../vars.css'
9
10
 
10
- export const root = _style(layers.primitives, {
11
+ export const root: string = _style(layers.primitives, {
11
12
  vars: {
12
13
  [vars.font.family]: vars.font.heading.family,
13
14
  [vars.font.featureSettings]: vars.font.heading.featureSettings,
@@ -57,11 +58,11 @@ globalStyle(`${root} svg`, {
57
58
  },
58
59
  })
59
60
 
60
- export const muted = _style(layers.primitives, {
61
+ export const muted: string = _style(layers.primitives, {
61
62
  color: vars.color.muted.fg,
62
63
  })
63
64
 
64
- export const sizes = {
65
+ export const sizes: ResponsiveRuleOptions<FontHeadingSize> = {
65
66
  ..._fromEntries(
66
67
  FONT_HEADING_SIZE.map((s) => {
67
68
  const v = vars.font.heading.scale[s]
@@ -1,17 +1,14 @@
1
+ import type {FontHeadingSize} from '@sanity/ui/theme'
2
+
1
3
  import type {FlexStyleProps} from '../../props/flex/types'
2
4
  import type {FontStyleProps} from '../../props/font/types'
3
5
  import type {TextAlignStyleProps} from '../../props/textAlign/types'
4
6
  import type {ResponsiveProp} from '../../types'
5
7
 
6
- /** @public */
7
- export type HeadingSize = number
8
-
9
8
  /** @public */
10
9
  export interface HeadingStyleProps extends FontStyleProps, FlexStyleProps {
11
- /** @deprecated No longer in use */
12
- accent?: boolean
13
10
  align?: TextAlignStyleProps['textAlign']
14
11
  className?: string
15
12
  muted?: boolean
16
- size?: ResponsiveProp<HeadingSize>
13
+ size?: ResponsiveProp<FontHeadingSize>
17
14
  }
@@ -2,7 +2,7 @@ import {_style} from '../../_style.css'
2
2
  import {layers} from '../../layers.css'
3
3
  import {vars} from '../../vars.css'
4
4
 
5
- export const root = _style(layers.primitives, {
5
+ export const root: string = _style(layers.primitives, {
6
6
  boxShadow: `inset 0 0 0 0.5px ${vars.color.border}`,
7
7
  backgroundColor: vars.color.muted.bg,
8
8
  font: 'inherit',