@sanity/ui 3.0.0-static.2 → 3.0.0-static.21

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 (829) hide show
  1. package/README.md +7 -6
  2. package/bin/{ui.js → sanity-ui.cjs} +1 -1
  3. package/dist/_chunks-cjs/_visual-editing.cjs +2488 -0
  4. package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -0
  5. package/dist/_chunks-cjs/{refractor.js → refractor.cjs} +1 -2
  6. package/dist/_chunks-cjs/refractor.cjs.map +1 -0
  7. package/dist/_chunks-es/_visual-editing.js +2500 -0
  8. package/dist/_chunks-es/_visual-editing.js.map +1 -0
  9. package/dist/_chunks-es/{refractor.mjs → refractor.js} +1 -2
  10. package/dist/_chunks-es/refractor.js.map +1 -0
  11. package/dist/_visual-editing.cjs +30 -0
  12. package/dist/_visual-editing.cjs.map +1 -0
  13. package/dist/_visual-editing.d.cts +893 -0
  14. package/dist/_visual-editing.d.ts +503 -416
  15. package/dist/_visual-editing.js +29 -30
  16. package/dist/_visual-editing.js.map +1 -1
  17. package/dist/css.cjs +598 -0
  18. package/dist/css.cjs.map +1 -0
  19. package/dist/css.d.cts +14884 -0
  20. package/dist/css.d.ts +14379 -1630
  21. package/dist/css.js +480 -4594
  22. package/dist/css.js.map +1 -1
  23. package/dist/index.cjs +2222 -0
  24. package/dist/index.cjs.map +1 -0
  25. package/dist/{index.d.mts → index.d.cts} +1284 -961
  26. package/dist/index.d.ts +1284 -961
  27. package/dist/index.js +1270 -592
  28. package/dist/index.js.map +1 -1
  29. package/dist/{theme.mjs → theme.cjs} +2843 -2571
  30. package/dist/theme.cjs.map +1 -0
  31. package/dist/{theme.d.mts → theme.d.cts} +331 -311
  32. package/dist/theme.d.ts +331 -311
  33. package/dist/theme.js +2843 -2569
  34. package/dist/theme.js.map +1 -1
  35. package/dist/ui.css +22564 -0
  36. package/exports/_visual-editing.ts +0 -1
  37. package/package.json +84 -79
  38. package/src/cli/buildCommand.ts +3 -41
  39. package/src/cli/index.ts +2 -14
  40. package/src/core/_compat/helpers.ts +72 -0
  41. package/src/core/_compat/index.ts +1 -6
  42. package/src/core/_compat/styles/_responsive.ts +1 -1
  43. package/src/core/_compat/theme/theme.test.tsx +4 -5
  44. package/src/core/_compat/theme/themeColorProvider.tsx +4 -10
  45. package/src/core/_compat/theme/themeContext.ts +5 -5
  46. package/src/core/_compat/theme/themeProvider.tsx +19 -13
  47. package/src/core/_compat/theme/types.ts +2 -4
  48. package/src/core/_compat/theme/useRootTheme.ts +2 -4
  49. package/src/core/_compat/theme/useTheme.ts +3 -7
  50. package/src/core/_compat/types.ts +0 -73
  51. package/src/core/components/autocomplete/__workshop__/async.tsx +6 -6
  52. package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +11 -18
  53. package/src/core/components/autocomplete/__workshop__/custom.tsx +21 -20
  54. package/src/core/components/autocomplete/__workshop__/example.tsx +17 -17
  55. package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +5 -5
  56. package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +57 -59
  57. package/src/core/components/autocomplete/autocomplete.tsx +106 -140
  58. package/src/core/components/autocomplete/autocompleteOption.tsx +1 -1
  59. package/src/core/components/autocomplete/autocompleteReducer.ts +1 -1
  60. package/src/core/components/autocomplete/constants.ts +1 -1
  61. package/src/core/components/autocomplete/types.ts +4 -9
  62. package/src/core/components/breadcrumbs/__workshop__/example.tsx +2 -3
  63. package/src/core/components/breadcrumbs/breadcrumbs.tsx +32 -28
  64. package/src/core/components/dialog/__workshop__/activate.tsx +4 -4
  65. package/src/core/components/dialog/__workshop__/autoFocus.tsx +2 -2
  66. package/src/core/components/dialog/__workshop__/onScroll.tsx +16 -4
  67. package/src/core/components/dialog/__workshop__/position.tsx +4 -4
  68. package/src/core/components/dialog/__workshop__/props.tsx +7 -7
  69. package/src/core/components/dialog/__workshop__/wrapped.tsx +2 -2
  70. package/src/core/components/dialog/dialog.tsx +104 -304
  71. package/src/core/components/dialog/dialogCard.tsx +190 -0
  72. package/src/core/components/dialog/dialogContext.ts +5 -3
  73. package/src/core/components/dialog/dialogProvider.tsx +6 -7
  74. package/src/core/components/dialog/isTargetWithinScope.ts +14 -0
  75. package/src/core/components/dialog/useDialog.ts +1 -1
  76. package/src/core/components/hotkeys/hotkeys.tsx +41 -27
  77. package/src/core/components/menu/__workshop__/asComponent.tsx +6 -6
  78. package/src/core/components/menu/__workshop__/closableMenuButton.tsx +5 -4
  79. package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +2 -2
  80. package/src/core/components/menu/__workshop__/customMenuItem.tsx +3 -3
  81. package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +1 -1
  82. package/src/core/components/menu/__workshop__/groups.tsx +2 -2
  83. package/src/core/components/menu/__workshop__/menuButton.tsx +4 -4
  84. package/src/core/components/menu/__workshop__/menuGroupRight.tsx +1 -1
  85. package/src/core/components/menu/__workshop__/nestedMenu.tsx +1 -1
  86. package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +13 -4
  87. package/src/core/components/menu/__workshop__/selectedItem.tsx +2 -2
  88. package/src/core/components/menu/__workshop__/tones.tsx +3 -3
  89. package/src/core/components/menu/__workshop__/withoutArrow.tsx +1 -1
  90. package/src/core/components/menu/menu.test.tsx +6 -7
  91. package/src/core/components/menu/menu.tsx +27 -35
  92. package/src/core/components/menu/menuButton.tsx +18 -24
  93. package/src/core/components/menu/menuContext.ts +1 -1
  94. package/src/core/components/menu/menuDivider.tsx +25 -15
  95. package/src/core/components/menu/menuGroup.tsx +39 -33
  96. package/src/core/components/menu/menuItem.tsx +58 -46
  97. package/src/core/components/menu/useMenu.ts +1 -1
  98. package/src/core/components/menu/useMenuController.ts +4 -4
  99. package/src/core/components/skeleton/__workshop__/delay.tsx +3 -3
  100. package/src/core/components/skeleton/__workshop__/skeleton.tsx +4 -4
  101. package/src/core/components/skeleton/codeSkeleton.tsx +49 -0
  102. package/src/core/components/skeleton/headingSkeleton.tsx +48 -0
  103. package/src/core/components/skeleton/index.ts +3 -0
  104. package/src/core/components/skeleton/labelSkeleton.tsx +47 -0
  105. package/src/core/components/skeleton/skeleton.tsx +37 -18
  106. package/src/core/components/skeleton/textSkeleton.tsx +29 -112
  107. package/src/core/components/tab/__workshop__/example.tsx +2 -2
  108. package/src/core/components/tab/tab.tsx +28 -26
  109. package/src/core/components/tab/tabList.tsx +49 -28
  110. package/src/core/components/tab/tabPanel.tsx +29 -22
  111. package/src/core/components/toast/__workshop__/hook.tsx +1 -1
  112. package/src/core/components/toast/__workshop__/toast.tsx +5 -5
  113. package/src/core/components/toast/toast.test.tsx +5 -5
  114. package/src/core/components/toast/toast.tsx +30 -57
  115. package/src/core/components/toast/toastContext.ts +1 -1
  116. package/src/core/components/toast/toastLayer.tsx +29 -13
  117. package/src/core/components/toast/toastProvider.tsx +5 -10
  118. package/src/core/components/toast/types.ts +3 -7
  119. package/src/core/components/toast/useToast.ts +2 -4
  120. package/src/core/components/tree/__workshop__/basic.perf.ts +1 -1
  121. package/src/core/components/tree/__workshop__/basic.tsx +1 -1
  122. package/src/core/components/tree/__workshop__/tabFromElement.tsx +1 -1
  123. package/src/core/components/tree/helpers.ts +1 -1
  124. package/src/core/components/tree/tree.tsx +196 -191
  125. package/src/core/components/tree/treeContext.ts +1 -1
  126. package/src/core/components/tree/treeGroup.tsx +24 -6
  127. package/src/core/components/tree/treeItem.tsx +44 -34
  128. package/src/core/components/tree/types.ts +2 -2
  129. package/src/core/components/tree/useTree.ts +1 -1
  130. package/src/core/constants.ts +6 -0
  131. package/src/core/helpers/props.ts +18 -0
  132. package/src/core/hooks/index.ts +1 -0
  133. package/src/core/hooks/useArrayProp.ts +1 -4
  134. package/src/core/hooks/useClickOutside.test.tsx +15 -16
  135. package/src/core/hooks/useClickOutside.ts +2 -6
  136. package/src/core/hooks/useClickOutsideEvent.test.tsx +4 -5
  137. package/src/core/hooks/useClickOutsideEvent.ts +3 -9
  138. package/src/core/hooks/useDelayed.test.ts +6 -7
  139. package/src/core/hooks/useDelayedState.ts +1 -1
  140. package/src/core/hooks/useElementRect/__workshop__/example.tsx +1 -1
  141. package/src/core/hooks/useElementSize.ts +1 -1
  142. package/src/core/hooks/useForwardedRef.ts +1 -1
  143. package/src/core/hooks/useMatchMedia.ts +13 -31
  144. package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +1 -1
  145. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +3 -18
  146. package/src/core/hooks/useMediaIndex/useMediaIndex.ts +12 -12
  147. package/src/core/hooks/usePrefersDark.hydration.test.tsx +4 -4
  148. package/src/core/hooks/usePrefersDark.test.tsx +1 -0
  149. package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +4 -4
  150. package/src/core/hooks/usePrefersReducedMotion.test.tsx +1 -0
  151. package/src/core/hooks/useResponsiveProp.ts +28 -0
  152. package/src/core/index.ts +0 -1
  153. package/src/core/lib/isArray.ts +3 -0
  154. package/src/core/middleware/origin.ts +1 -1
  155. package/src/core/primitives/_selectable/selectable.tsx +33 -24
  156. package/src/core/primitives/avatar/__workshop__/asButton.tsx +2 -2
  157. package/src/core/primitives/avatar/__workshop__/stack.tsx +2 -2
  158. package/src/core/primitives/avatar/__workshop__/withinButton.tsx +2 -2
  159. package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +1 -1
  160. package/src/core/primitives/avatar/avatar.tsx +43 -48
  161. package/src/core/primitives/avatar/avatarCounter.tsx +46 -39
  162. package/src/core/primitives/avatar/avatarStack.tsx +44 -45
  163. package/src/core/primitives/avatar/types.ts +3 -3
  164. package/src/core/primitives/badge/__workshop__/props.tsx +6 -17
  165. package/src/core/primitives/badge/__workshop__/tones.tsx +1 -6
  166. package/src/core/primitives/badge/badge.test.tsx +2 -3
  167. package/src/core/primitives/badge/badge.tsx +34 -40
  168. package/src/core/primitives/badge/types.ts +2 -1
  169. package/src/core/primitives/box/__workshop__/props.tsx +2 -2
  170. package/src/core/primitives/box/__workshop__/responsive.tsx +2 -1
  171. package/src/core/primitives/box/box.tsx +153 -88
  172. package/src/core/primitives/button/__workshop__/custom.tsx +19 -42
  173. package/src/core/primitives/button/__workshop__/customIcons.tsx +3 -3
  174. package/src/core/primitives/button/__workshop__/disabled.tsx +9 -9
  175. package/src/core/primitives/button/__workshop__/props.tsx +19 -22
  176. package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +3 -3
  177. package/src/core/primitives/button/__workshop__/stacked.tsx +15 -16
  178. package/src/core/primitives/button/__workshop__/uploadButton.tsx +2 -1
  179. package/src/core/primitives/button/button.test.tsx +3 -18
  180. package/src/core/primitives/button/button.tsx +67 -76
  181. package/src/core/primitives/card/__workshop__/asButton.tsx +14 -14
  182. package/src/core/primitives/card/__workshop__/asComponent.tsx +3 -3
  183. package/src/core/primitives/card/__workshop__/checkered.tsx +1 -1
  184. package/src/core/primitives/card/__workshop__/index.ts +1 -1
  185. package/src/core/primitives/card/__workshop__/interactive.tsx +3 -4
  186. package/src/core/primitives/card/__workshop__/listNavigation.tsx +3 -3
  187. package/src/core/primitives/card/__workshop__/props.tsx +14 -17
  188. package/src/core/primitives/card/__workshop__/selected.tsx +10 -41
  189. package/src/core/primitives/card/__workshop__/{allTones.tsx → tones.tsx} +3 -3
  190. package/src/core/primitives/card/card.tsx +52 -48
  191. package/src/core/primitives/card/cardContext.ts +10 -0
  192. package/src/core/primitives/card/cardProvider.tsx +27 -0
  193. package/src/core/primitives/card/index.ts +2 -0
  194. package/src/core/primitives/card/types.ts +19 -3
  195. package/src/core/primitives/card/useCard.ts +9 -0
  196. package/src/core/primitives/checkbox/__workshop__/props.tsx +6 -4
  197. package/src/core/primitives/checkbox/__workshop__/tones.tsx +11 -20
  198. package/src/core/primitives/checkbox/checkbox.tsx +30 -23
  199. package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +1 -1
  200. package/src/core/primitives/code/__workshop__/props.tsx +4 -7
  201. package/src/core/primitives/code/code.tsx +27 -30
  202. package/src/core/primitives/code/refractor.tsx +0 -2
  203. package/src/core/primitives/container/__workshop__/example.tsx +2 -2
  204. package/src/core/primitives/container/container.tsx +27 -25
  205. package/src/core/primitives/flex/__workshop__/example.tsx +2 -2
  206. package/src/core/primitives/flex/flex.tsx +44 -17
  207. package/src/core/primitives/grid/grid.tsx +20 -17
  208. package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +2 -2
  209. package/src/core/primitives/heading/__workshop__/plain.tsx +12 -15
  210. package/src/core/primitives/heading/heading.tsx +51 -33
  211. package/src/core/primitives/inline/__workshop__/plain.tsx +2 -5
  212. package/src/core/primitives/inline/inline.tsx +46 -27
  213. package/src/core/primitives/inline/types.ts +1 -0
  214. package/src/core/primitives/kbd/kbd.tsx +28 -28
  215. package/src/core/primitives/label/__workshop__/plain.tsx +8 -17
  216. package/src/core/primitives/label/label.tsx +49 -39
  217. package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +6 -6
  218. package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +3 -3
  219. package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +1 -1
  220. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +3 -3
  221. package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +3 -4
  222. package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +10 -6
  223. package/src/core/primitives/popover/__workshop__/TestStory.tsx +5 -4
  224. package/src/core/primitives/popover/constants.ts +1 -1
  225. package/src/core/primitives/popover/floating-ui/size.ts +2 -2
  226. package/src/core/primitives/popover/helpers.ts +1 -1
  227. package/src/core/primitives/popover/popover.tsx +299 -335
  228. package/src/core/primitives/popover/popoverLayer.tsx +147 -0
  229. package/src/core/primitives/popover/types.ts +3 -2
  230. package/src/core/primitives/radio/__workshop__/example.tsx +3 -3
  231. package/src/core/primitives/radio/__workshop__/plain.tsx +3 -3
  232. package/src/core/primitives/radio/radio.tsx +34 -19
  233. package/src/core/primitives/select/__workshop__/plain.tsx +15 -6
  234. package/src/core/primitives/select/__workshop__/readOnly.tsx +1 -1
  235. package/src/core/primitives/select/select.tsx +28 -28
  236. package/src/core/primitives/spinner/__workshop__/Props.tsx +4 -5
  237. package/src/core/primitives/spinner/animatedSpinnerIcon.tsx +7 -9
  238. package/src/core/primitives/spinner/spinner.tsx +27 -15
  239. package/src/core/primitives/stack/__workshop__/plain.tsx +2 -2
  240. package/src/core/primitives/stack/stack.tsx +44 -20
  241. package/src/core/primitives/switch/switch.tsx +31 -17
  242. package/src/core/primitives/text/__workshop__/colored.tsx +6 -6
  243. package/src/core/primitives/text/__workshop__/example.tsx +9 -20
  244. package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +1 -1
  245. package/src/core/primitives/text/text.tsx +52 -44
  246. package/src/core/primitives/textArea/__workshop__/plain.tsx +44 -33
  247. package/src/core/primitives/textArea/textArea.tsx +47 -22
  248. package/src/core/primitives/textInput/__workshop__/customValidity.tsx +2 -2
  249. package/src/core/primitives/textInput/__workshop__/plain.tsx +36 -30
  250. package/src/core/primitives/textInput/__workshop__/states.tsx +5 -5
  251. package/src/core/primitives/textInput/__workshop__/tones.tsx +2 -2
  252. package/src/core/primitives/textInput/__workshop__/typed.tsx +2 -2
  253. package/src/core/primitives/textInput/textInput.tsx +80 -106
  254. package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +5 -5
  255. package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +2 -2
  256. package/src/core/primitives/tooltip/__workshop__/props.tsx +9 -8
  257. package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +1 -1
  258. package/src/core/primitives/tooltip/constants.ts +1 -1
  259. package/src/core/primitives/tooltip/tooltip.test.tsx +61 -60
  260. package/src/core/primitives/tooltip/tooltip.tsx +107 -90
  261. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +1 -1
  262. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +3 -5
  263. package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +1 -1
  264. package/src/core/primitives/tooltip/tooltipLayer.tsx +105 -0
  265. package/src/core/primitives/types.ts +19 -30
  266. package/src/core/types/avatar.ts +3 -6
  267. package/src/core/types/badge.ts +2 -4
  268. package/src/core/types/button.ts +2 -4
  269. package/src/core/types/card.ts +2 -4
  270. package/src/core/types/dialog.ts +1 -3
  271. package/src/core/types/flex.ts +3 -3
  272. package/src/core/types/props.ts +20 -10
  273. package/src/core/types/selectable.ts +1 -1
  274. package/src/core/utils/arrow/arrow.tsx +43 -28
  275. package/src/core/utils/boundaryElement/boundaryElement.test.tsx +5 -5
  276. package/src/core/utils/boundaryElement/boundaryElementContext.ts +1 -1
  277. package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +4 -10
  278. package/src/core/utils/boundaryElement/types.ts +1 -3
  279. package/src/core/utils/boundaryElement/useBoundaryElement.ts +2 -4
  280. package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +15 -8
  281. package/src/core/utils/elementQuery/elementQuery.tsx +41 -19
  282. package/src/core/utils/errorBoundary.tsx +6 -4
  283. package/src/core/utils/index.ts +0 -1
  284. package/src/core/utils/layer/__workshop__/multipleRoots.tsx +5 -5
  285. package/src/core/utils/layer/__workshop__/nested.tsx +3 -3
  286. package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +9 -5
  287. package/src/core/utils/layer/getLayerContext.test.ts +3 -1
  288. package/src/core/utils/layer/getLayerContext.ts +1 -1
  289. package/src/core/utils/layer/layer.test.tsx +5 -5
  290. package/src/core/utils/layer/layer.tsx +25 -95
  291. package/src/core/utils/layer/layerCard.tsx +90 -0
  292. package/src/core/utils/layer/layerContext.ts +1 -1
  293. package/src/core/utils/layer/layerProvider.tsx +20 -17
  294. package/src/core/utils/layer/useLayer.ts +2 -4
  295. package/src/core/utils/portal/__workshop__/named.tsx +3 -3
  296. package/src/core/utils/portal/portal.test.tsx +5 -5
  297. package/src/core/utils/portal/{portal.ts → portal.tsx} +17 -11
  298. package/src/core/utils/portal/portalContext.ts +1 -1
  299. package/src/core/utils/portal/portalProvider.tsx +4 -10
  300. package/src/core/utils/portal/types.ts +1 -3
  301. package/src/core/utils/portal/usePortal.ts +2 -4
  302. package/src/core/utils/srOnly/srOnly.tsx +25 -27
  303. package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +1 -1
  304. package/src/core/utils/virtualList/virtualList.tsx +71 -55
  305. package/src/css/__theme/index.ts +16 -0
  306. package/src/css/__theme/lib/contract/buildVarContract.ts +78 -0
  307. package/src/css/__theme/lib/contract/index.ts +4 -0
  308. package/src/css/__theme/lib/contract/types.ts +17 -0
  309. package/src/css/__theme/resolveTheme.ts +865 -0
  310. package/src/css/_assign.ts +3 -0
  311. package/src/css/_composeClassNames.ts +12 -0
  312. package/src/css/_fromEntries.ts +3 -0
  313. package/src/css/_getClassNames.ts +9 -0
  314. package/src/css/_responsiveClassName.ts +45 -0
  315. package/src/css/_responsiveStyle.css.ts +34 -0
  316. package/src/css/_style.css.ts +9 -0
  317. package/src/css/components/breadcrumbs/breadcrumbs.css.ts +6 -0
  318. package/src/css/components/breadcrumbs/breadcrumbs.ts +5 -3
  319. package/src/css/components/dialog/dialog.css.ts +81 -0
  320. package/src/css/components/dialog/dialog.ts +20 -11
  321. package/src/css/components/index.ts +6 -0
  322. package/src/css/components/menu/menu.css.ts +14 -0
  323. package/src/css/components/menu/menu.ts +8 -5
  324. package/src/css/components/skeleton/skeleton.css.ts +132 -0
  325. package/src/css/components/skeleton/skeleton.ts +14 -9
  326. package/src/css/components/skeleton/types.ts +13 -5
  327. package/src/css/components/toast/toast.css.ts +16 -0
  328. package/src/css/components/toast/toast.ts +5 -15
  329. package/src/css/components/tree/tree.css.ts +65 -0
  330. package/src/css/components/tree/tree.ts +5 -3
  331. package/src/css/constants.ts +10 -0
  332. package/src/css/defaultTheme.css.ts +468 -0
  333. package/src/css/index.ts +12 -38
  334. package/src/css/layers.css.ts +9 -0
  335. package/src/css/primitives/_arrow/_arrow.css.ts +68 -0
  336. package/src/css/primitives/_arrow/_arrow.ts +18 -6
  337. package/src/css/primitives/_input/_input.css.ts +258 -0
  338. package/src/css/primitives/_input/input.ts +17 -14
  339. package/src/css/primitives/_input/types.ts +3 -3
  340. package/src/css/primitives/_selectable/_selectable.css.ts +121 -0
  341. package/src/css/primitives/_selectable/selectable.ts +5 -5
  342. package/src/css/primitives/_selectable/types.ts +3 -2
  343. package/src/css/primitives/avatar/avatar.css.ts +175 -0
  344. package/src/css/primitives/avatar/avatar.ts +52 -11
  345. package/src/css/primitives/avatar/types.ts +5 -3
  346. package/src/css/primitives/badge/badge.css.ts +26 -0
  347. package/src/css/primitives/badge/badge.ts +4 -4
  348. package/src/css/primitives/badge/types.ts +5 -4
  349. package/src/css/primitives/box/box.css.ts +19 -0
  350. package/src/css/primitives/box/box.ts +52 -16
  351. package/src/css/primitives/box/types.ts +46 -22
  352. package/src/css/primitives/button/button.css.ts +285 -0
  353. package/src/css/primitives/button/button.ts +15 -33
  354. package/src/css/primitives/button/index.ts +1 -0
  355. package/src/css/primitives/button/types.ts +19 -0
  356. package/src/css/primitives/card/card.css.ts +365 -0
  357. package/src/css/primitives/card/card.ts +9 -12
  358. package/src/css/primitives/card/types.ts +4 -6
  359. package/src/css/primitives/checkbox/checkbox.css.ts +193 -0
  360. package/src/css/primitives/checkbox/checkbox.ts +13 -5
  361. package/src/css/primitives/code/code.css.ts +271 -0
  362. package/src/css/primitives/code/code.ts +13 -5
  363. package/src/css/primitives/code/types.ts +4 -3
  364. package/src/css/primitives/container/container.css.ts +4 -0
  365. package/src/css/primitives/container/container.ts +12 -4
  366. package/src/css/primitives/container/types.ts +4 -2
  367. package/src/css/primitives/heading/heading.css.ts +85 -0
  368. package/src/css/primitives/heading/heading.ts +13 -11
  369. package/src/css/primitives/heading/types.ts +6 -3
  370. package/src/css/primitives/index.ts +24 -0
  371. package/src/css/primitives/kbd/kbd.css.ts +16 -0
  372. package/src/css/primitives/kbd/kbd.ts +6 -4
  373. package/src/css/primitives/kbd/types.ts +2 -3
  374. package/src/css/primitives/label/label.css.ts +85 -0
  375. package/src/css/primitives/label/label.ts +13 -10
  376. package/src/css/primitives/label/types.ts +13 -5
  377. package/src/css/primitives/popover/popover.css.ts +6 -0
  378. package/src/css/primitives/popover/popover.ts +10 -3
  379. package/src/css/primitives/radio/radio.css.ts +78 -0
  380. package/src/css/primitives/radio/radio.ts +15 -3
  381. package/src/css/primitives/select/select.css.ts +24 -0
  382. package/src/css/primitives/select/select.ts +7 -4
  383. package/src/css/primitives/select/types.ts +1 -1
  384. package/src/css/primitives/spinner/index.ts +1 -0
  385. package/src/css/primitives/spinner/spinner.css.ts +23 -0
  386. package/src/css/primitives/spinner/spinner.ts +9 -5
  387. package/src/css/primitives/spinner/types.ts +4 -0
  388. package/src/css/primitives/stack/index.ts +1 -0
  389. package/src/css/primitives/stack/stack.css.ts +6 -0
  390. package/src/css/primitives/stack/stack.ts +7 -0
  391. package/src/css/primitives/switch/switch.css.ts +98 -0
  392. package/src/css/primitives/switch/switch.ts +13 -7
  393. package/src/css/primitives/text/text.css.ts +85 -0
  394. package/src/css/primitives/text/text.ts +13 -11
  395. package/src/css/primitives/text/types.ts +9 -3
  396. package/src/css/primitives/textArea/textArea.css.ts +4 -0
  397. package/src/css/primitives/textArea/textArea.ts +5 -3
  398. package/src/css/primitives/textArea/types.ts +5 -3
  399. package/src/css/primitives/textInput/textInput.css.ts +41 -0
  400. package/src/css/primitives/textInput/textInput.ts +20 -4
  401. package/src/css/primitives/textInput/types.ts +3 -7
  402. package/src/css/primitives/tooltip/index.ts +1 -0
  403. package/src/css/primitives/tooltip/tooltip.css.ts +6 -0
  404. package/src/css/primitives/tooltip/tooltip.ts +8 -7
  405. package/src/css/primitives/tooltip/types.ts +4 -0
  406. package/src/css/props/alignItems/alignItems.css.ts +22 -0
  407. package/src/css/props/alignItems/alignItems.ts +8 -0
  408. package/src/css/props/alignItems/index.ts +2 -0
  409. package/src/css/props/alignItems/types.ts +9 -0
  410. package/src/css/props/border/border.css.ts +65 -0
  411. package/src/css/props/border/border.ts +36 -0
  412. package/src/css/props/border/types.ts +13 -0
  413. package/src/css/props/boxSizing/boxSizing.css.ts +11 -0
  414. package/src/css/props/boxSizing/boxSizing.ts +10 -0
  415. package/src/css/props/boxSizing/index.ts +2 -0
  416. package/src/css/props/boxSizing/types.ts +7 -0
  417. package/src/css/props/display/display.css.ts +56 -0
  418. package/src/css/props/display/display.ts +17 -0
  419. package/src/css/{styles → props}/display/types.ts +3 -4
  420. package/src/css/props/flex/flex.css.ts +52 -0
  421. package/src/css/props/flex/flex.ts +8 -0
  422. package/src/css/props/flex/types.ts +9 -0
  423. package/src/css/props/flexDirection/flexDirection.css.ts +19 -0
  424. package/src/css/props/flexDirection/flexDirection.ts +8 -0
  425. package/src/css/props/flexDirection/index.ts +2 -0
  426. package/src/css/props/flexDirection/types.ts +9 -0
  427. package/src/css/props/flexWrap/flexWrap.css.ts +16 -0
  428. package/src/css/props/flexWrap/flexWrap.ts +8 -0
  429. package/src/css/props/flexWrap/index.ts +2 -0
  430. package/src/css/props/flexWrap/types.ts +9 -0
  431. package/src/css/props/font/font.css.ts +93 -0
  432. package/src/css/props/font/font.ts +8 -0
  433. package/src/css/props/font/types.ts +6 -0
  434. package/src/css/props/gap/gap.css.ts +40 -0
  435. package/src/css/props/gap/gap.ts +13 -0
  436. package/src/css/{styles → props}/gap/types.ts +2 -2
  437. package/src/css/props/gridAutoColumns/gridAutoColumns.css.ts +19 -0
  438. package/src/css/props/gridAutoColumns/gridAutoColumns.ts +8 -0
  439. package/src/css/props/gridAutoColumns/index.ts +2 -0
  440. package/src/css/props/gridAutoColumns/types.ts +19 -0
  441. package/src/css/props/gridAutoFlow/gridAutoFlow.css.ts +19 -0
  442. package/src/css/props/gridAutoFlow/gridAutoFlow.ts +8 -0
  443. package/src/css/props/gridAutoFlow/index.ts +2 -0
  444. package/src/css/props/gridAutoFlow/types.ts +13 -0
  445. package/src/css/props/gridAutoRows/gridAutoRows.css.ts +19 -0
  446. package/src/css/props/gridAutoRows/gridAutoRows.ts +8 -0
  447. package/src/css/props/gridAutoRows/index.ts +2 -0
  448. package/src/css/props/gridAutoRows/types.ts +13 -0
  449. package/src/css/props/gridColumn/gridColumn.css.ts +49 -0
  450. package/src/css/props/gridColumn/gridColumn.ts +8 -0
  451. package/src/css/props/gridColumn/index.ts +2 -0
  452. package/src/css/props/gridColumn/types.ts +19 -0
  453. package/src/css/props/gridColumnEnd/gridColumnEnd.css.ts +46 -0
  454. package/src/css/props/gridColumnEnd/gridColumnEnd.ts +8 -0
  455. package/src/css/props/gridColumnEnd/index.ts +2 -0
  456. package/src/css/props/gridColumnEnd/types.ts +19 -0
  457. package/src/css/props/gridColumnStart/gridColumnStart.css.ts +46 -0
  458. package/src/css/props/gridColumnStart/gridColumnStart.ts +11 -0
  459. package/src/css/props/gridColumnStart/index.ts +2 -0
  460. package/src/css/props/gridColumnStart/types.ts +19 -0
  461. package/src/css/props/gridRow/gridRow.css.ts +49 -0
  462. package/src/css/props/gridRow/gridRow.ts +8 -0
  463. package/src/css/props/gridRow/index.ts +2 -0
  464. package/src/css/props/gridRow/types.ts +19 -0
  465. package/src/css/props/gridRowEnd/gridRowEnd.css.ts +46 -0
  466. package/src/css/props/gridRowEnd/gridRowEnd.ts +8 -0
  467. package/src/css/props/gridRowEnd/index.ts +2 -0
  468. package/src/css/props/gridRowEnd/types.ts +19 -0
  469. package/src/css/props/gridRowStart/gridRowStart.css.ts +46 -0
  470. package/src/css/props/gridRowStart/gridRowStart.ts +8 -0
  471. package/src/css/props/gridRowStart/index.ts +2 -0
  472. package/src/css/props/gridRowStart/types.ts +19 -0
  473. package/src/css/props/gridTemplateColumns/gridTemplateColumns.css.ts +43 -0
  474. package/src/css/props/gridTemplateColumns/gridTemplateColumns.ts +8 -0
  475. package/src/css/props/gridTemplateColumns/index.ts +2 -0
  476. package/src/css/props/gridTemplateColumns/types.ts +19 -0
  477. package/src/css/props/gridTemplateRows/gridTemplateRows.css.ts +43 -0
  478. package/src/css/props/gridTemplateRows/gridTemplateRows.ts +8 -0
  479. package/src/css/props/gridTemplateRows/index.ts +2 -0
  480. package/src/css/props/gridTemplateRows/types.ts +19 -0
  481. package/src/css/props/height/height.css.ts +25 -0
  482. package/src/css/props/height/height.ts +8 -0
  483. package/src/css/props/height/index.ts +2 -0
  484. package/src/css/props/height/types.ts +15 -0
  485. package/src/css/props/index.ts +37 -0
  486. package/src/css/props/inset/inset.css.ts +37 -0
  487. package/src/css/props/inset/inset.ts +21 -0
  488. package/src/css/{styles → props}/inset/types.ts +1 -1
  489. package/src/css/props/justifyContent/index.ts +2 -0
  490. package/src/css/props/justifyContent/justifyContent.css.ts +25 -0
  491. package/src/css/props/justifyContent/justifyContent.ts +8 -0
  492. package/src/css/props/justifyContent/types.ts +15 -0
  493. package/src/css/props/margin/margin.css.ts +117 -0
  494. package/src/css/props/margin/margin.ts +25 -0
  495. package/src/css/props/margin/types.ts +17 -0
  496. package/src/css/props/maxWidth/maxWidth.css.ts +32 -0
  497. package/src/css/props/maxWidth/maxWidth.ts +8 -0
  498. package/src/css/props/maxWidth/types.ts +11 -0
  499. package/src/css/props/minHeight/index.ts +2 -0
  500. package/src/css/props/minHeight/minHeight.css.ts +13 -0
  501. package/src/css/props/minHeight/minHeight.ts +8 -0
  502. package/src/css/props/minHeight/types.ts +9 -0
  503. package/src/css/props/minWidth/index.ts +2 -0
  504. package/src/css/props/minWidth/minWidth.css.ts +25 -0
  505. package/src/css/props/minWidth/minWidth.ts +8 -0
  506. package/src/css/props/minWidth/types.ts +9 -0
  507. package/src/css/props/outline/index.ts +2 -0
  508. package/src/css/props/outline/outline.css.ts +10 -0
  509. package/src/css/props/outline/outline.ts +8 -0
  510. package/src/css/props/outline/types.ts +7 -0
  511. package/src/css/props/overflow/overflow.css.ts +16 -0
  512. package/src/css/props/overflow/overflow.ts +8 -0
  513. package/src/css/props/overflow/types.ts +17 -0
  514. package/src/css/props/padding/padding.css.ts +87 -0
  515. package/src/css/props/padding/padding.ts +25 -0
  516. package/src/css/props/padding/types.ts +17 -0
  517. package/src/css/props/pointerEvents/pointerEvents.css.ts +13 -0
  518. package/src/css/props/pointerEvents/pointerEvents.ts +8 -0
  519. package/src/css/props/position/position.css.ts +22 -0
  520. package/src/css/props/position/position.ts +8 -0
  521. package/src/css/{styles → props}/position/types.ts +1 -1
  522. package/src/css/props/radius/radius.css.ts +21 -0
  523. package/src/css/props/radius/radius.ts +8 -0
  524. package/src/css/props/radius/types.ts +8 -0
  525. package/src/css/props/shadow/shadow.css.ts +23 -0
  526. package/src/css/props/shadow/shadow.ts +8 -0
  527. package/src/css/props/shadow/types.ts +8 -0
  528. package/src/css/props/textAlign/index.ts +2 -0
  529. package/src/css/props/textAlign/textAlign.css.ts +22 -0
  530. package/src/css/props/textAlign/textAlign.ts +8 -0
  531. package/src/css/props/textAlign/types.ts +7 -0
  532. package/src/css/props/textOverflow/textOverflow.css.ts +13 -0
  533. package/src/css/props/textOverflow/textOverflow.ts +8 -0
  534. package/src/css/{styles → props}/textOverflow/types.ts +5 -1
  535. package/src/css/props/width/types.ts +11 -0
  536. package/src/css/props/width/width.css.ts +28 -0
  537. package/src/css/props/width/width.ts +8 -0
  538. package/src/css/types.ts +221 -766
  539. package/src/css/util.ts +3 -8
  540. package/src/css/utils/index.ts +1 -0
  541. package/src/css/utils/srOnly/srOnly.css.ts +10 -0
  542. package/src/css/utils/srOnly/srOnly.ts +5 -3
  543. package/src/css/vars.css.ts +676 -0
  544. package/src/theme/getScopedTheme.ts +4 -4
  545. package/src/theme/index.ts +0 -5
  546. package/src/theme/types.ts +6 -10
  547. package/src/theme/v0/color/_generic.ts +1 -1
  548. package/src/theme/v0/color/button.ts +1 -1
  549. package/src/theme/v0/color/card.ts +1 -1
  550. package/src/theme/v0/color/color.ts +11 -11
  551. package/src/theme/v0/color/input.ts +1 -1
  552. package/src/theme/v0/color/muted.ts +1 -1
  553. package/src/theme/v0/color/selectable.ts +1 -1
  554. package/src/theme/v0/color/solid.ts +1 -1
  555. package/src/theme/v0/color/spot.ts +1 -1
  556. package/src/theme/v0/focusRing.ts +1 -3
  557. package/src/theme/v0/font.ts +6 -19
  558. package/src/theme/v0/layer.ts +1 -3
  559. package/src/theme/v0/shadow.ts +2 -6
  560. package/src/theme/v0/styles.ts +1 -1
  561. package/src/theme/v0/theme.ts +7 -7
  562. package/src/theme/v2/avatar.ts +2 -4
  563. package/src/theme/{build → v2/build}/_deprecated/color/_selectable/createSelectableTones.ts +3 -3
  564. package/src/theme/{build → v2/build}/_deprecated/color/_solid/createSolidTones.ts +2 -2
  565. package/src/theme/{build → v2/build}/_deprecated/color/button/createButtonModes.ts +7 -2
  566. package/src/theme/{build → v2/build}/_deprecated/color/button/createButtonTones.ts +4 -4
  567. package/src/theme/{build → v2/build}/_deprecated/color/card/createCardStates.ts +3 -3
  568. package/src/theme/{build → v2/build}/_deprecated/color/color.test.ts +1 -1
  569. package/src/theme/{build → v2/build}/_deprecated/color/defaults.ts +1 -1
  570. package/src/theme/{build → v2/build}/_deprecated/color/factory.ts +3 -3
  571. package/src/theme/{build → v2/build}/_deprecated/color/input/createInputModes.ts +7 -2
  572. package/src/theme/{build → v2/build}/_deprecated/color/muted/createMuted.ts +2 -2
  573. package/src/theme/{build → v2/build}/_deprecated/color/spot/createSpot.ts +2 -2
  574. package/src/theme/{build → v2/build}/buildColorTheme.test.ts +3 -1
  575. package/src/theme/{build → v2/build}/buildColorTheme.ts +24 -24
  576. package/src/theme/{build → v2/build}/buildTheme.test.ts +10 -8
  577. package/src/theme/v2/build/buildTheme.ts +12 -0
  578. package/src/theme/{build → v2/build}/colorToken/colorToken.ts +2 -2
  579. package/src/theme/{build → v2/build}/colorToken/compileColorToken.ts +1 -1
  580. package/src/theme/{build → v2/build}/colorToken/types.ts +2 -2
  581. package/src/theme/{build → v2/build}/lib/color-fns/blend/mix.ts +1 -1
  582. package/src/theme/{build → v2/build}/lib/color-fns/blend/multiply.ts +1 -1
  583. package/src/theme/{build → v2/build}/lib/color-fns/blend/screen.ts +1 -1
  584. package/src/theme/{build → v2/build}/lib/color-fns/color-fns.test.ts +1 -1
  585. package/src/theme/{build → v2/build}/lib/color-fns/contrastRatio.ts +5 -2
  586. package/src/theme/{build → v2/build}/lib/color-fns/convert.ts +1 -1
  587. package/src/theme/{build → v2/build}/lib/color-fns/parse.ts +1 -1
  588. package/src/theme/{build → v2/build}/mixThemeColor.test.ts +2 -0
  589. package/src/theme/{build → v2/build}/mixThemeColor.ts +1 -1
  590. package/src/theme/{build → v2/build}/renderColorTheme.ts +27 -27
  591. package/src/theme/{build → v2/build}/renderColorValue.ts +3 -3
  592. package/src/theme/{build → v2/build}/resolveColorTokens.ts +13 -13
  593. package/src/theme/v2/color/_helpers.ts +2 -2
  594. package/src/theme/v2/color/_system.ts +2 -4
  595. package/src/theme/v2/color/avatar.ts +3 -7
  596. package/src/theme/v2/color/badge.ts +3 -7
  597. package/src/theme/v2/color/button.ts +5 -11
  598. package/src/theme/v2/color/color.ts +10 -16
  599. package/src/theme/v2/color/input.ts +8 -10
  600. package/src/theme/v2/color/kbd.ts +1 -3
  601. package/src/theme/v2/color/selectable.ts +4 -8
  602. package/src/theme/v2/color/state.ts +5 -7
  603. package/src/theme/v2/color/syntax.ts +1 -3
  604. package/src/theme/{config → v2/config}/helpers.ts +6 -13
  605. package/src/theme/{config → v2/config}/system.ts +11 -12
  606. package/src/theme/{config → v2/config}/tokens/color/types.ts +14 -10
  607. package/src/theme/{config → v2/config}/tokens/index.ts +0 -1
  608. package/src/theme/{config → v2/config}/tokens/parseTokenValue.test.ts +2 -0
  609. package/src/theme/{config → v2/config}/tokens/parseTokenValue.ts +2 -2
  610. package/src/theme/{config → v2/config}/tokens/types.ts +3 -3
  611. package/src/theme/{config → v2/config}/types.ts +8 -6
  612. package/src/theme/{defaults → v2/defaults}/colorPalette.ts +1 -1
  613. package/src/theme/{defaults → v2/defaults}/colorTokens.ts +3 -3
  614. package/src/theme/{defaults → v2/defaults}/config.ts +2 -2
  615. package/src/theme/{defaults → v2/defaults}/fonts.ts +5 -6
  616. package/src/theme/v2/index.ts +2 -0
  617. package/src/theme/v2/input.ts +2 -4
  618. package/src/theme/v2/theme.ts +10 -14
  619. package/src/theme/{_constants.ts → v3/_constants.ts} +6 -3
  620. package/src/theme/v3/{color/parseColor.ts → _parseColorToken.ts} +59 -46
  621. package/src/theme/v3/buildTheme_v3.ts +20 -11
  622. package/src/theme/v3/color/_constants.ts +15 -0
  623. package/src/theme/v3/color/avatar.ts +14 -0
  624. package/src/theme/v3/color/card.ts +58 -95
  625. package/src/theme/v3/color/color.ts +75 -71
  626. package/src/theme/v3/color/element.ts +8 -8
  627. package/src/theme/v3/color/index.ts +2 -2
  628. package/src/theme/v3/color/token.ts +19 -4
  629. package/src/theme/v3/color/tokens.ts +2 -2
  630. package/src/theme/v3/defaultFonts.ts +250 -0
  631. package/src/theme/v3/defaultTokens.ts +199 -0
  632. package/src/theme/v3/index.ts +4 -1
  633. package/src/theme/{palette → v3/palette}/constants.ts +3 -3
  634. package/src/theme/v3/palette/types.ts +7 -0
  635. package/src/theme/v3/resolveTokens.ts +70 -65
  636. package/src/theme/v3/tokens.ts +2 -2
  637. package/src/theme/v3/types.ts +97 -12
  638. package/src/theme/versioning/getTheme_v2.ts +3 -3
  639. package/src/theme/versioning/is_v0.ts +2 -2
  640. package/src/theme/versioning/is_v2.ts +2 -2
  641. package/src/theme/versioning/themeColor_v0_v2.ts +2 -2
  642. package/src/theme/versioning/themeColor_v2_v2_9.ts +1 -1
  643. package/src/theme/versioning/themeColor_v3_v2.ts +229 -52
  644. package/src/theme/versioning/v0_v2.ts +3 -3
  645. package/src/theme/versioning/v2_v0.ts +4 -4
  646. package/src/theme/versioning/v3_v2.ts +62 -40
  647. package/dist/_chunks-cjs/_visual-editing.js +0 -3059
  648. package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
  649. package/dist/_chunks-cjs/buildCommand.js +0 -32
  650. package/dist/_chunks-cjs/buildCommand.js.map +0 -1
  651. package/dist/_chunks-cjs/refractor.js.map +0 -1
  652. package/dist/_chunks-cjs/v3_v2.js +0 -251
  653. package/dist/_chunks-cjs/v3_v2.js.map +0 -1
  654. package/dist/_chunks-es/_visual-editing.mjs +0 -3066
  655. package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
  656. package/dist/_chunks-es/refractor.mjs.map +0 -1
  657. package/dist/_chunks-es/v3_v2.mjs +0 -252
  658. package/dist/_chunks-es/v3_v2.mjs.map +0 -1
  659. package/dist/_visual-editing.d.mts +0 -806
  660. package/dist/_visual-editing.mjs +0 -31
  661. package/dist/_visual-editing.mjs.map +0 -1
  662. package/dist/cli.d.ts +0 -1
  663. package/dist/cli.js +0 -357
  664. package/dist/cli.js.map +0 -1
  665. package/dist/css.d.mts +0 -2135
  666. package/dist/css.mjs +0 -4713
  667. package/dist/css.mjs.map +0 -1
  668. package/dist/index.mjs +0 -1542
  669. package/dist/index.mjs.map +0 -1
  670. package/dist/sanity-palette.css +0 -9
  671. package/dist/sanity-theme.css +0 -1
  672. package/dist/system.css +0 -3577
  673. package/dist/theme.mjs.map +0 -1
  674. package/src/core/StyleTags.tsx +0 -24
  675. package/src/core/primitives/popover/popoverCard.tsx +0 -148
  676. package/src/core/primitives/tooltip/tooltipCard.tsx +0 -115
  677. package/src/core/utils/conditionalWrapper/conditionalWrapper.tsx +0 -23
  678. package/src/core/utils/conditionalWrapper/index.ts +0 -1
  679. package/src/css/_resp.ts +0 -31
  680. package/src/css/compile/compilePalette.ts +0 -60
  681. package/src/css/compile/compileRule.ts +0 -90
  682. package/src/css/compile/compileRules.test.ts +0 -35
  683. package/src/css/compile/compileRules.ts +0 -40
  684. package/src/css/compile/compileSystem.ts +0 -7
  685. package/src/css/compile/compileTheme.ts +0 -15
  686. package/src/css/compile/compileTheme_v3.ts +0 -410
  687. package/src/css/compile/types.ts +0 -6
  688. package/src/css/components/breadcrumbs/rules.ts +0 -25
  689. package/src/css/components/dialog/rules.ts +0 -76
  690. package/src/css/components/menu/rules.ts +0 -15
  691. package/src/css/components/skeleton/rules.ts +0 -112
  692. package/src/css/components/toast/rules.ts +0 -17
  693. package/src/css/components/tree/rules.ts +0 -168
  694. package/src/css/composeClassNames.ts +0 -13
  695. package/src/css/primitives/_arrow/rules.ts +0 -71
  696. package/src/css/primitives/_input/rules.ts +0 -163
  697. package/src/css/primitives/_selectable/__style.ts +0 -117
  698. package/src/css/primitives/_selectable/_contants.ts +0 -11
  699. package/src/css/primitives/_selectable/rules.ts +0 -129
  700. package/src/css/primitives/avatar/rules.ts +0 -176
  701. package/src/css/primitives/badge/rules.ts +0 -22
  702. package/src/css/primitives/box/rules.ts +0 -28
  703. package/src/css/primitives/button/_constants.ts +0 -17
  704. package/src/css/primitives/button/rules.ts +0 -293
  705. package/src/css/primitives/card/_constants.ts +0 -13
  706. package/src/css/primitives/card/rules.ts +0 -471
  707. package/src/css/primitives/checkbox/__styles.ts +0 -129
  708. package/src/css/primitives/checkbox/rules.ts +0 -152
  709. package/src/css/primitives/code/rules.ts +0 -96
  710. package/src/css/primitives/container/rules.ts +0 -8
  711. package/src/css/primitives/heading/rules.ts +0 -155
  712. package/src/css/primitives/kbd/rules.ts +0 -20
  713. package/src/css/primitives/label/rules.ts +0 -137
  714. package/src/css/primitives/popover/rules.ts +0 -5
  715. package/src/css/primitives/radio/rules.ts +0 -121
  716. package/src/css/primitives/select/rules.ts +0 -22
  717. package/src/css/primitives/spinner/rules.ts +0 -20
  718. package/src/css/primitives/switch/rules.ts +0 -340
  719. package/src/css/primitives/text/rules.ts +0 -164
  720. package/src/css/primitives/textArea/rules.ts +0 -7
  721. package/src/css/primitives/textInput/rules.ts +0 -224
  722. package/src/css/primitives/token/rules.ts +0 -45
  723. package/src/css/primitives/tooltip/rules.ts +0 -19
  724. package/src/css/responsiveRules.ts +0 -25
  725. package/src/css/rules.ts +0 -113
  726. package/src/css/styles/border/border.ts +0 -22
  727. package/src/css/styles/border/rules.ts +0 -24
  728. package/src/css/styles/border/types.ts +0 -10
  729. package/src/css/styles/display/display.ts +0 -7
  730. package/src/css/styles/display/rules.ts +0 -62
  731. package/src/css/styles/flex/flex.ts +0 -20
  732. package/src/css/styles/flex/rules.ts +0 -28
  733. package/src/css/styles/flex/types.ts +0 -35
  734. package/src/css/styles/flexItem/flexItem.ts +0 -8
  735. package/src/css/styles/flexItem/index.ts +0 -2
  736. package/src/css/styles/flexItem/rules.ts +0 -12
  737. package/src/css/styles/flexItem/types.ts +0 -11
  738. package/src/css/styles/font/font.ts +0 -17
  739. package/src/css/styles/font/rules.ts +0 -148
  740. package/src/css/styles/font/types.ts +0 -12
  741. package/src/css/styles/gap/gap.ts +0 -8
  742. package/src/css/styles/gap/rules.ts +0 -34
  743. package/src/css/styles/grid/grid.ts +0 -13
  744. package/src/css/styles/grid/index.ts +0 -2
  745. package/src/css/styles/grid/rules.ts +0 -146
  746. package/src/css/styles/grid/types.ts +0 -29
  747. package/src/css/styles/gridItem/gridItem.ts +0 -15
  748. package/src/css/styles/gridItem/index.ts +0 -2
  749. package/src/css/styles/gridItem/rules.ts +0 -96
  750. package/src/css/styles/gridItem/types.ts +0 -41
  751. package/src/css/styles/height/rules.ts +0 -7
  752. package/src/css/styles/index.ts +0 -19
  753. package/src/css/styles/inset/inset.ts +0 -13
  754. package/src/css/styles/inset/rules.ts +0 -16
  755. package/src/css/styles/margin/margin.ts +0 -15
  756. package/src/css/styles/margin/rules.ts +0 -64
  757. package/src/css/styles/margin/types.ts +0 -11
  758. package/src/css/styles/maxWidth/maxWidth.ts +0 -6
  759. package/src/css/styles/maxWidth/rules.ts +0 -13
  760. package/src/css/styles/maxWidth/types.ts +0 -7
  761. package/src/css/styles/outline/rules.ts +0 -7
  762. package/src/css/styles/overflow/overflow.ts +0 -11
  763. package/src/css/styles/overflow/rules.ts +0 -9
  764. package/src/css/styles/overflow/types.ts +0 -11
  765. package/src/css/styles/padding/padding.ts +0 -15
  766. package/src/css/styles/padding/rules.ts +0 -62
  767. package/src/css/styles/padding/types.ts +0 -14
  768. package/src/css/styles/pointerEvents/pointerEvents.ts +0 -6
  769. package/src/css/styles/pointerEvents/rules.ts +0 -11
  770. package/src/css/styles/position/position.ts +0 -7
  771. package/src/css/styles/position/rules.ts +0 -24
  772. package/src/css/styles/radius/radius.ts +0 -8
  773. package/src/css/styles/radius/rules.ts +0 -13
  774. package/src/css/styles/radius/types.ts +0 -8
  775. package/src/css/styles/shadow/rules.ts +0 -53
  776. package/src/css/styles/shadow/shadow.ts +0 -7
  777. package/src/css/styles/shadow/types.ts +0 -8
  778. package/src/css/styles/textOverflow/rules.ts +0 -17
  779. package/src/css/styles/textOverflow/textOverflow.ts +0 -6
  780. package/src/css/styles/width/rules.ts +0 -7
  781. package/src/css/styles/width/types.ts +0 -9
  782. package/src/css/styles/width/width.ts +0 -6
  783. package/src/css/utils/srOnly/rules.ts +0 -11
  784. package/src/css/varNames.ts +0 -473
  785. package/src/css/vars.ts +0 -443
  786. package/src/theme/_types.ts +0 -41
  787. package/src/theme/build/buildTheme.ts +0 -12
  788. package/src/theme/build/theme.test.ts +0 -27
  789. package/src/theme/config/tokens/parseTokenKey.test.ts +0 -64
  790. package/src/theme/config/tokens/parseTokenKey.ts +0 -67
  791. package/src/theme/palette/types.ts +0 -16
  792. package/src/theme/v3/buildTheme_v3.test.ts +0 -40
  793. package/src/theme/v3/color/buildColor_v3.ts +0 -193
  794. package/src/theme/v3/color/parseColor.test.ts +0 -79
  795. package/src/theme/v3/color/renderColor.test.ts +0 -19
  796. package/src/theme/v3/color/renderColor.ts +0 -33
  797. package/src/theme/v3/defaults.ts +0 -205
  798. /package/src/core/components/autocomplete/{__mocks__ → __workshop__/mock}/apiStore.ts +0 -0
  799. /package/src/core/components/autocomplete/{__mocks__ → __workshop__/mock}/countries.ts +0 -0
  800. /package/src/css/{styles → props}/border/index.ts +0 -0
  801. /package/src/css/{styles → props}/display/index.ts +0 -0
  802. /package/src/css/{styles → props}/flex/index.ts +0 -0
  803. /package/src/css/{styles → props}/font/index.ts +0 -0
  804. /package/src/css/{styles → props}/gap/index.ts +0 -0
  805. /package/src/css/{styles → props}/inset/index.ts +0 -0
  806. /package/src/css/{styles → props}/margin/index.ts +0 -0
  807. /package/src/css/{styles → props}/maxWidth/index.ts +0 -0
  808. /package/src/css/{styles → props}/overflow/index.ts +0 -0
  809. /package/src/css/{styles → props}/padding/index.ts +0 -0
  810. /package/src/css/{styles → props}/pointerEvents/index.ts +0 -0
  811. /package/src/css/{styles → props}/pointerEvents/types.ts +0 -0
  812. /package/src/css/{styles → props}/position/index.ts +0 -0
  813. /package/src/css/{styles → props}/radius/index.ts +0 -0
  814. /package/src/css/{styles → props}/shadow/index.ts +0 -0
  815. /package/src/css/{styles → props}/textOverflow/index.ts +0 -0
  816. /package/src/css/{styles → props}/width/index.ts +0 -0
  817. /package/src/theme/{build → v2/build}/_deprecated/color/index.ts +0 -0
  818. /package/src/theme/{build → v2/build}/colorToken/index.ts +0 -0
  819. /package/src/theme/{build → v2/build}/index.ts +0 -0
  820. /package/src/theme/{build → v2/build}/lib/color-fns/blend/index.ts +0 -0
  821. /package/src/theme/{build → v2/build}/lib/color-fns/index.ts +0 -0
  822. /package/src/theme/{build → v2/build}/lib/color-fns/rgba.ts +0 -0
  823. /package/src/theme/{build → v2/build}/lib/color-fns/types.ts +0 -0
  824. /package/src/theme/{build → v2/build}/lib/isRecord.ts +0 -0
  825. /package/src/theme/{build → v2/build}/lib/utils.ts +0 -0
  826. /package/src/theme/{build → v2/build}/merge.ts +0 -0
  827. /package/src/theme/{config → v2/config}/index.ts +0 -0
  828. /package/src/theme/{config → v2/config}/tokens/color/index.ts +0 -0
  829. /package/src/theme/{palette → v3/palette}/index.ts +0 -0
package/dist/index.d.ts CHANGED
@@ -1,35 +1,39 @@
1
+ import type {AvatarColor} from '@sanity/ui/theme'
1
2
  import {AvatarSize} from '@sanity/ui/theme'
2
3
  import {BaseTheme as BaseTheme_2} from '@sanity/ui/theme'
3
4
  import {Display as BoxDisplay} from '@sanity/ui/css'
4
5
  import {BoxHeight} from '@sanity/ui/css'
5
6
  import {BoxOverflow} from '@sanity/ui/css'
6
7
  import {BoxSizing} from '@sanity/ui/css'
7
- import {BoxStyleProps} from '@sanity/ui/css'
8
- import {ButtonStyleProps} from '@sanity/ui/css'
8
+ import type {BoxStyleProps} from '@sanity/ui/css'
9
+ import {Breakpoint} from '@sanity/ui/css'
10
+ import type {ButtonStyleProps} from '@sanity/ui/css'
9
11
  import {CardStyleProps as CardStyleProps_2} from '@sanity/ui/css'
12
+ import {CodeStyleProps} from '@sanity/ui/css'
10
13
  import {Component} from 'react'
14
+ import type {ComponentClass} from 'react'
11
15
  import type {ComponentProps} from 'react'
16
+ import type {ComponentType as ComponentType_2} from 'react'
12
17
  import {ContainerStyleProps} from '@sanity/ui/css'
18
+ import type {ContainerWidth} from '@sanity/ui/theme'
13
19
  import {Context} from 'react'
14
20
  import {createColorTheme as createColorTheme_2} from '@sanity/ui/theme'
15
- import {CSSObject} from '@sanity/ui/theme'
16
- import {DisplayStyleProps} from '@sanity/ui/css'
17
- import {ElementProps as ElementProps_2} from '../..'
18
- import {ElementType} from 'react'
21
+ import type {CSSObject} from '@sanity/ui/theme'
22
+ import type {DisplayStyleProps} from '@sanity/ui/css'
23
+ import {ElementType as ElementType_2} from 'react'
19
24
  import {ErrorInfo} from 'react'
20
- import {FlexAlign} from '@sanity/ui/css'
25
+ import type {ExoticComponent} from 'react'
26
+ import {AlignItems as FlexAlign} from '@sanity/ui/css'
21
27
  import {FlexDirection} from '@sanity/ui/css'
22
- import {FlexJustify} from '@sanity/ui/css'
23
- import {FlexStyleProps} from '@sanity/ui/css'
24
- import {FlexValue} from '@sanity/ui/css'
28
+ import {JustifyContent as FlexJustify} from '@sanity/ui/css'
29
+ import {Flex as FlexValue} from '@sanity/ui/css'
25
30
  import {FlexWrap} from '@sanity/ui/css'
26
- import {FontCodeSize} from '@sanity/ui/theme'
27
- import {FontHeadingSize} from '@sanity/ui/theme'
28
- import {FontLabelSize} from '@sanity/ui/theme'
29
- import {FontStyleProps} from '@sanity/ui/css'
30
- import {FontTextSize} from '@sanity/ui/theme'
31
+ import type {FontCodeSize} from '@sanity/ui/theme'
32
+ import type {FontHeadingSize} from '@sanity/ui/theme'
33
+ import type {FontLabelSize} from '@sanity/ui/theme'
34
+ import type {FontTextSize} from '@sanity/ui/theme'
31
35
  import {ForwardedRef} from 'react'
32
- import {ForwardRefExoticComponent} from 'react'
36
+ import type {FunctionComponent} from 'react'
33
37
  import {GapStyleProps} from '@sanity/ui/css'
34
38
  import {GridAutoCols} from '@sanity/ui/css'
35
39
  import {GridAutoFlow} from '@sanity/ui/css'
@@ -44,26 +48,28 @@ import {HeadingStyleProps} from '@sanity/ui/css'
44
48
  import {hexToRgb as hexToRgb_2} from '@sanity/ui/theme'
45
49
  import {HSL as HSL_2} from '@sanity/ui/theme'
46
50
  import {hslToRgb as hslToRgb_2} from '@sanity/ui/theme'
51
+ import {HTMLAttributes} from 'react'
47
52
  import {InputStyleProps} from '@sanity/ui/css'
48
- import {InsetStyleProps} from '@sanity/ui/css'
49
- import {LabelSize} from '@sanity/ui/css'
53
+ import type {InsetStyleProps} from '@sanity/ui/css'
54
+ import {JSX} from 'react'
55
+ import {LabelStyleProps} from '@sanity/ui/css'
56
+ import {MaxWidth} from '@sanity/ui/css'
57
+ import {MouseEventHandler} from 'react'
50
58
  import {multiply as multiply_2} from '@sanity/ui/theme'
51
59
  import {MutableRefObject} from 'react'
52
- import {NamedExoticComponent} from 'react'
53
60
  import {PaddingStyleProps} from '@sanity/ui/css'
54
61
  import {parseColor as parseColor_2} from '@sanity/ui/theme'
55
62
  import {PartialThemeColorBuilderOpts} from '@sanity/ui/theme'
56
- import {PolymorphicProps as PolymorphicProps_2} from '../..'
57
- import {PositionStyleProps} from '@sanity/ui/css'
63
+ import type {PositionStyleProps} from '@sanity/ui/css'
58
64
  import {PropsWithChildren} from 'react'
59
65
  import {px} from '@sanity/ui/css'
60
66
  import {Radius} from '@sanity/ui/theme'
61
67
  import {RadiusStyleProps} from '@sanity/ui/css'
62
68
  import {ReactElement} from 'react'
63
69
  import {ReactNode} from 'react'
64
- import {ReactPortal} from 'react'
70
+ import type {ReactPortal} from 'react'
71
+ import {Ref} from 'react'
65
72
  import {RefAttributes} from 'react'
66
- import {RefCallback} from 'react'
67
73
  import {rem} from '@sanity/ui/css'
68
74
  import {ResponsiveProp} from '@sanity/ui/css'
69
75
  import {RGB as RGB_2} from '@sanity/ui/theme'
@@ -75,18 +81,17 @@ import {screen as screen_3} from '@sanity/ui/theme'
75
81
  import {SelectStyleProps} from '@sanity/ui/css'
76
82
  import {ShadowStyleProps} from '@sanity/ui/css'
77
83
  import {SkeletonStyleProps} from '@sanity/ui/css'
78
- import {Space} from '@sanity/ui/theme'
84
+ import type {Space} from '@sanity/ui/theme'
79
85
  import {TextAlign} from '@sanity/ui/css'
80
86
  import {TextAreaStyleProps} from '@sanity/ui/css'
81
87
  import {TextOverflowStyleProps} from '@sanity/ui/css'
82
88
  import {TextStyleProps} from '@sanity/ui/css'
83
89
  import {Theme as Theme_2} from '@sanity/ui/theme'
84
90
  import {Theme_v2} from '@sanity/ui/theme'
85
- import {Theme_v3} from '@sanity/ui/theme'
86
91
  import {ThemeAvatar} from '@sanity/ui/theme'
87
92
  import {ThemeBoxShadow} from '@sanity/ui/theme'
88
93
  import {ThemeColor} from '@sanity/ui/theme'
89
- import {ThemeColorAvatarColorKey} from '@sanity/ui/theme'
94
+ import type {ThemeColorAvatarColorKey} from '@sanity/ui/theme'
90
95
  import {ThemeColorBase} from '@sanity/ui/theme'
91
96
  import {ThemeColorBuilderOpts} from '@sanity/ui/theme'
92
97
  import {ThemeColorButton} from '@sanity/ui/theme'
@@ -114,7 +119,7 @@ import {ThemeColorSolid} from '@sanity/ui/theme'
114
119
  import {ThemeColorSolidTone} from '@sanity/ui/theme'
115
120
  import {ThemeColorSpot} from '@sanity/ui/theme'
116
121
  import {ThemeColorSpotKey} from '@sanity/ui/theme'
117
- import {ThemeColorStateToneKey} from '@sanity/ui/theme'
122
+ import type {ThemeColorStateToneKey} from '@sanity/ui/theme'
118
123
  import {ThemeColorSyntax as ThemeColorSyntax_2} from '@sanity/ui/theme'
119
124
  import {ThemeColorToneKey} from '@sanity/ui/theme'
120
125
  import {ThemeFont as ThemeFont_2} from '@sanity/ui/theme'
@@ -127,19 +132,35 @@ import {ThemeInput} from '@sanity/ui/theme'
127
132
  import {ThemeLayer as ThemeLayer_2} from '@sanity/ui/theme'
128
133
  import {ThemeShadow as ThemeShadow_2} from '@sanity/ui/theme'
129
134
  import {ThemeStyles} from '@sanity/ui/theme'
130
- import {Width} from '@sanity/ui/css'
135
+ import type {Width} from '@sanity/ui/css'
131
136
 
132
137
  /** @internal */
133
- export declare const Arrow: ForwardRefExoticComponent<
134
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, 'radius' | 'height' | 'width'> & {
135
- width: number
136
- height: number
137
- radius?: number
138
- } & RefAttributes<HTMLDivElement>
138
+ export declare function Arrow<E extends ArrowElementType = typeof DEFAULT_ARROW_ELEMENT>(
139
+ props: ArrowProps<E>,
140
+ ): JSX.Element
141
+
142
+ /** @internal */
143
+ export declare type ArrowElementType = 'div' | 'span' | ComponentType
144
+
145
+ /** @internal */
146
+ export declare type ArrowOwnProps = {
147
+ width: number
148
+ height: number
149
+ radius?: number
150
+ }
151
+
152
+ /** @internal */
153
+ export declare type ArrowProps<E extends ArrowElementType = ArrowElementType> = Props<
154
+ ArrowOwnProps,
155
+ E
139
156
  >
140
157
 
141
- /** @public */
142
- export declare type Assign<T, U> = Omit<T, keyof U> & U
158
+ /**
159
+ * Assign properties from `U` to `T`, excluding properties that already exist in `T`.
160
+ *
161
+ * @public
162
+ */
163
+ export declare type Assign<T extends {}, U extends {}> = Omit<T, keyof U> & U
143
164
 
144
165
  /**
145
166
  * @internal
@@ -152,22 +173,13 @@ export declare function attemptFocus(element: HTMLElement): boolean
152
173
  *
153
174
  * @public
154
175
  */
155
- export declare const Autocomplete: <Option extends BaseAutocompleteOption>(
156
- props: Omit<
157
- Props<AutocompleteProps<Option>, 'input'>,
158
- | 'aria-activedescendant'
159
- | 'aria-autocomplete'
160
- | 'aria-expanded'
161
- | 'aria-owns'
162
- | 'autoCapitalize'
163
- | 'autoComplete'
164
- | 'autoCorrect'
165
- | 'inputMode'
166
- | 'role'
167
- | 'spellCheck'
168
- | 'type'
169
- >,
170
- ) => ReactElement
176
+ export declare function Autocomplete<
177
+ E extends AutocompleteElementType = typeof DEFAULT_AUTOCOMPLETE_ELEMENT,
178
+ O extends BaseAutocompleteOption = BaseAutocompleteOption,
179
+ >(props: AutocompleteProps<E, O>): JSX.Element
180
+
181
+ /** @public */
182
+ export declare type AutocompleteElementType = 'input' | ComponentType
171
183
 
172
184
  /**
173
185
  * @internal
@@ -198,24 +210,17 @@ export declare type AutocompleteMsg =
198
210
  | AutocompleteInputFoocusMsg
199
211
  | AutocompleteValueChangeMsg
200
212
 
201
- /**
202
- * @public
203
- */
204
- export declare type AutocompleteOpenButtonProps = Omit<Props<ButtonProps, 'button'>, 'as'>
213
+ /** @public */
214
+ export declare type AutocompleteOpenButtonProps = Omit<ButtonProps<'button'>, 'as'>
205
215
 
206
- /**
207
- * @public
208
- */
209
- export declare interface AutocompleteProps<
210
- Option extends BaseAutocompleteOption = BaseAutocompleteOption,
211
- > {
216
+ /** @public */
217
+ export declare type AutocompleteOwnProps<
218
+ O extends BaseAutocompleteOption = BaseAutocompleteOption,
219
+ > = TextInputOwnProps & {
212
220
  border?: boolean
213
221
  customValidity?: string
214
- disabled?: boolean
215
- filterOption?: (query: string, option: Option) => boolean
216
- fontSize?: ResponsiveProp<FontTextSize>
217
- icon?: ElementType | ReactNode
218
- id: string
222
+ filterOption?: (query: string, option: O) => boolean
223
+ icon?: ElementType_2 | ReactNode
219
224
  /** @beta */
220
225
  listBox?: BoxProps
221
226
  loading?: boolean
@@ -227,17 +232,15 @@ export declare interface AutocompleteProps<
227
232
  /** @beta */
228
233
  openOnFocus?: boolean
229
234
  /** The options to render. */
230
- options?: Option[]
235
+ options?: O[]
231
236
  padding?: ResponsiveProp<Space>
232
237
  popover?: Omit<Props<PopoverProps, 'div'>, 'content' | 'onMouseEnter' | 'onMouseLeave' | 'open'>
233
238
  prefix?: ReactNode
234
239
  radius?: Radius | Radius[]
235
- readOnly?: boolean
236
- ref?: ForwardedRef<HTMLInputElement>
237
240
  /** @beta */
238
241
  relatedElements?: HTMLElement[]
239
242
  /** The callback function for rendering each option. */
240
- renderOption?: (option: Option) => React.JSX.Element
243
+ renderOption?: (option: O) => React.JSX.Element
241
244
  /** @beta */
242
245
  renderPopover?: (
243
246
  props: {
@@ -249,12 +252,17 @@ export declare interface AutocompleteProps<
249
252
  },
250
253
  ref: ForwardedRef<HTMLDivElement>,
251
254
  ) => ReactNode
252
- renderValue?: (value: string, option?: Option) => string
255
+ renderValue?: (value: string, option?: O) => string
253
256
  suffix?: ReactNode
254
- /** The current value. */
255
257
  value?: string
256
258
  }
257
259
 
260
+ /** @public */
261
+ export declare type AutocompleteProps<
262
+ E extends AutocompleteElementType = AutocompleteElementType,
263
+ O extends BaseAutocompleteOption = BaseAutocompleteOption,
264
+ > = Props<AutocompleteOwnProps<O>, E>
265
+
258
266
  /**
259
267
  * @internal
260
268
  */
@@ -325,60 +333,63 @@ export declare interface AutocompleteValueChangeMsg {
325
333
  *
326
334
  * @public
327
335
  */
328
- export declare const Avatar: ForwardRefExoticComponent<
329
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof AvatarProps> &
330
- AvatarProps &
331
- RefAttributes<HTMLDivElement>
332
- >
336
+ export declare function Avatar<E extends AvatarElementType = typeof DEFAULT_AVATAR_ELEMENT>(
337
+ props: AvatarProps<E>,
338
+ ): JSX.Element
333
339
 
334
- /**
335
- * @public
336
- */
337
- export declare const AvatarCounter: ForwardRefExoticComponent<
338
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof AvatarCounterProps> &
339
- AvatarCounterProps &
340
- RefAttributes<HTMLDivElement>
341
- >
340
+ /** @public */
341
+ export declare function AvatarCounter<
342
+ E extends AvatarCounterElementType = typeof DEFAULT_AVATAR_COUNTER_ELEMENT,
343
+ >(props: AvatarCounterProps<E>): JSX.Element
342
344
 
343
- /**
344
- * @public
345
- */
346
- export declare interface AvatarCounterProps
347
- extends Omit<BoxProps, 'align' | 'className' | 'display' | 'justify' | 'paddingX' | 'sizing'> {
345
+ /** @public */
346
+ export declare type AvatarCounterElementType = 'button' | 'div' | 'span' | ComponentType
347
+
348
+ /** @public */
349
+ export declare interface AvatarCounterOwnProps {
348
350
  count: number
349
351
  size?: ResponsiveProp<AvatarSize>
350
- /** @deprecated No longer supported. */
351
- tone?: 'navbar'
352
352
  }
353
353
 
354
- /**
355
- * @public
356
- */
357
- export declare type AvatarPosition = 'top' | 'bottom' | 'inside'
354
+ /** @public */
355
+ export declare type AvatarCounterProps<
356
+ E extends AvatarCounterElementType = AvatarCounterElementType,
357
+ > = Props<AvatarCounterOwnProps, E>
358
358
 
359
- /**
360
- * @public
361
- */
362
- export declare interface AvatarProps {
359
+ /** @public */
360
+ export declare type AvatarElementType = 'a' | 'button' | 'div' | 'span' | ComponentType
361
+
362
+ /** @public */
363
+ export declare interface AvatarOwnProps {
363
364
  /** @beta */
364
365
  __unstable_hideInnerStroke?: boolean
365
366
  animateArrowFrom?: AvatarPosition
366
367
  arrowPosition?: AvatarPosition
367
- color?: ThemeColorAvatarColorKey
368
+ color?: AvatarColor
368
369
  initials?: string
369
370
  onImageLoadError?: (event: Error) => void
370
371
  size?: ResponsiveProp<AvatarSize>
371
372
  src?: string
372
373
  /**
373
374
  * The status of the entity this Avatar represents.
374
- * @alpha
375
+ * @deprecated Will be removed in next major version.
375
376
  */
376
377
  status?: AvatarStatus
377
378
  title?: string
378
379
  }
379
380
 
381
+ /** @public */
382
+ export declare type AvatarPosition = 'top' | 'bottom' | 'inside'
383
+
384
+ /** @public */
385
+ export declare type AvatarProps<E extends AvatarElementType = AvatarElementType> = Props<
386
+ AvatarOwnProps,
387
+ E
388
+ >
389
+
380
390
  /**
381
391
  * @internal
392
+ * @deprecated This will be removed in next major version.
382
393
  */
383
394
  export declare interface AvatarRootStyleProps {
384
395
  $color: ThemeColorAvatarColorKey
@@ -386,29 +397,22 @@ export declare interface AvatarRootStyleProps {
386
397
 
387
398
  export {AvatarSize}
388
399
 
389
- /**
390
- * @public
391
- */
392
- export declare const AvatarStack: ForwardRefExoticComponent<
393
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof AvatarStackProps> &
394
- AvatarStackProps &
395
- RefAttributes<HTMLDivElement>
396
- >
400
+ /** @public */
401
+ export declare function AvatarStack<
402
+ E extends AvatarStackElementType = typeof DEFAULT_AVATAR_STACK_ELEMENT,
403
+ >(props: AvatarStackProps<E>): JSX.Element
397
404
 
398
- /**
399
- * @public
400
- */
401
- export declare type AvatarStackChild =
402
- | ReactElement<Props<AvatarProps, 'div'>>
403
- | null
404
- | undefined
405
- | false
405
+ /** @public */
406
+ export declare type AvatarStackChild = ReactElement<AvatarProps<'div'>> | null | undefined | false
406
407
 
407
- /**
408
- * @public
409
- */
410
- export declare interface AvatarStackProps
411
- extends Omit<BoxProps, 'align' | 'className' | 'display'> {
408
+ /** @public */
409
+ export declare type AvatarStackElementType = 'div' | 'span' | ComponentType
410
+
411
+ /** @public */
412
+ export declare type AvatarStackOwnProps = Omit<
413
+ BoxOwnProps,
414
+ 'align' | 'alignItems' | 'display' | 'justify' | 'justifyContent'
415
+ > & {
412
416
  children: AvatarStackChild | AvatarStackChild[]
413
417
  maxLength?: number
414
418
  size?: ResponsiveProp<AvatarSize>
@@ -416,11 +420,14 @@ export declare interface AvatarStackProps
416
420
  tone?: 'navbar'
417
421
  }
418
422
 
423
+ /** @public */
424
+ export declare type AvatarStackProps<E extends AvatarStackElementType = AvatarStackElementType> =
425
+ Props<AvatarStackOwnProps, E>
426
+
427
+ /** @public */
419
428
  /**
420
429
  * @public
421
- */
422
- /**
423
- * @public
430
+ * @deprecated Will be removed in next major version.
424
431
  */
425
432
  export declare type AvatarStatus = 'online' | 'editing' | 'inactive'
426
433
 
@@ -429,11 +436,12 @@ export declare type AvatarStatus = 'online' | 'editing' | 'inactive'
429
436
  *
430
437
  * @public
431
438
  */
432
- export declare const Badge: ForwardRefExoticComponent<
433
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof BadgeProps> &
434
- BadgeProps &
435
- RefAttributes<HTMLDivElement>
436
- >
439
+ export declare function Badge<E extends BadgeElementType = typeof DEFAULT_BADGE_ELEMENT>(
440
+ props: BadgeProps<E>,
441
+ ): JSX.Element
442
+
443
+ /** @public */
444
+ export declare type BadgeElementType = 'div' | 'span' | ComponentType
437
445
 
438
446
  /**
439
447
  * @public
@@ -441,25 +449,23 @@ export declare const Badge: ForwardRefExoticComponent<
441
449
  */
442
450
  export declare type BadgeMode = 'default' | 'outline'
443
451
 
444
- /**
445
- * @public
446
- */
447
- export declare interface BadgeProps extends BoxProps, RadiusStyleProps {
448
- fontSize?: number | number[]
449
- /** @deprecated No longer used. */
450
- mode?: BadgeMode
451
- textAlign?: TextProps['align']
452
- tone?: BadgeTone
453
- }
452
+ /** @public */
453
+ export declare type BadgeOwnProps = PaddingStyleProps &
454
+ RadiusStyleProps & {
455
+ fontSize?: ResponsiveProp<FontTextSize>
456
+ tone?: BadgeTone
457
+ }
454
458
 
455
- /**
456
- * @public
457
- */
459
+ /** @public */
460
+ export declare type BadgeProps<E extends BadgeElementType = BadgeElementType> = Props<
461
+ BadgeOwnProps,
462
+ E
463
+ >
464
+
465
+ /** @public */
458
466
  export declare type BadgeTone = ThemeColorStateToneKey
459
467
 
460
- /**
461
- * @public
462
- */
468
+ /** @public */
463
469
  export declare interface BaseAutocompleteOption {
464
470
  value: string
465
471
  }
@@ -470,26 +476,16 @@ export declare interface BaseAutocompleteOption {
470
476
  */
471
477
  export declare type BaseTheme = BaseTheme_2
472
478
 
473
- /**
474
- * @public
475
- */
479
+ /** @public */
476
480
  export declare interface BoundaryElementContextValue {
477
481
  version: 0.0
478
482
  element: HTMLElement | null
479
483
  }
480
484
 
481
- /**
482
- * @public
483
- */
485
+ /** @public */
484
486
  export declare function BoundaryElementProvider(props: BoundaryElementProviderProps): ReactElement
485
487
 
486
- export declare namespace BoundaryElementProvider {
487
- var displayName: string
488
- }
489
-
490
- /**
491
- * @public
492
- */
488
+ /** @public */
493
489
  export declare interface BoundaryElementProviderProps {
494
490
  children: ReactNode
495
491
  element: HTMLElement | null
@@ -501,26 +497,56 @@ export declare interface BoundaryElementProviderProps {
501
497
  *
502
498
  * @public
503
499
  */
504
- export declare const Box: ForwardRefExoticComponent<
505
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof BoxProps> &
506
- BoxProps &
507
- RefAttributes<HTMLDivElement>
508
- >
500
+ export declare function Box<E extends BoxElementType = typeof DEFAULT_BOX_ELEMENT>(
501
+ props: BoxProps<E>,
502
+ ): JSX.Element
509
503
 
510
504
  export {BoxDisplay}
511
505
 
506
+ /** @public */
507
+ export declare type BoxElementType =
508
+ | 'a'
509
+ | 'article'
510
+ | 'aside'
511
+ | 'blockquote'
512
+ | 'body'
513
+ | 'button'
514
+ | 'details'
515
+ | 'div'
516
+ | 'header'
517
+ | 'fieldset'
518
+ | 'figure'
519
+ | 'figcaption'
520
+ | 'footer'
521
+ | 'form'
522
+ | 'html'
523
+ | 'iframe'
524
+ | 'kbd'
525
+ | 'label'
526
+ | 'legend'
527
+ | 'li'
528
+ | 'main'
529
+ | 'nav'
530
+ | 'ol'
531
+ | 'pre'
532
+ | 'section'
533
+ | 'span'
534
+ | 'summary'
535
+ | 'ul'
536
+ | ComponentType
537
+
512
538
  export {BoxHeight}
513
539
 
514
540
  export {BoxOverflow}
515
541
 
516
- /**
517
- * @public
518
- */
519
- export declare interface BoxProps
520
- extends BoxStyleProps,
521
- GapStyleProps,
522
- InsetStyleProps,
523
- PositionStyleProps {}
542
+ /** @public */
543
+ export declare type BoxOwnProps = BoxStyleProps &
544
+ GapStyleProps &
545
+ InsetStyleProps &
546
+ PositionStyleProps
547
+
548
+ /** @public */
549
+ export declare type BoxProps<E extends BoxElementType = BoxElementType> = Props<BoxOwnProps, E>
524
550
 
525
551
  /**
526
552
  * @public
@@ -530,34 +556,34 @@ export declare type BoxShadow = ThemeBoxShadow
530
556
 
531
557
  export {BoxSizing}
532
558
 
533
- /**
534
- * @beta
535
- */
536
- export declare const Breadcrumbs: ForwardRefExoticComponent<
537
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof BreadcrumbsProps> &
538
- BreadcrumbsProps &
539
- RefAttributes<HTMLDivElement>
540
- >
559
+ /** @beta */
560
+ export declare function Breadcrumbs<
561
+ E extends BreadcrumbsElementType = typeof DEFAULT_BREADCRUMBS_ELEMENT,
562
+ >(props: BreadcrumbsProps<E>): JSX.Element
541
563
 
542
- /**
543
- * @beta
544
- */
545
- export declare interface BreadcrumbsProps extends GapStyleProps {
546
- expandButton?: Omit<ButtonProps, 'onClick' | 'selected'>
564
+ /** @beta */
565
+ export declare type BreadcrumbsElementType = 'div' | 'nav' | ComponentType
566
+
567
+ /** @beta */
568
+ export declare type BreadcrumbsOwnProps = GapStyleProps & {
569
+ expandButton?: Omit<ButtonProps<'button'>, 'as' | 'onClick' | 'selected'>
547
570
  maxLength?: number
548
571
  separator?: ReactNode
549
572
  /** @deprecated - Use `gap`, `gapX`, `gapY` instead */
550
573
  space?: number | number[]
551
574
  }
552
575
 
553
- /**
554
- * @public
555
- */
556
- export declare const Button: ForwardRefExoticComponent<
557
- Omit<ElementProps_2<'button'> & PolymorphicProps_2, keyof ButtonProps> &
558
- ButtonProps &
559
- RefAttributes<HTMLButtonElement>
560
- >
576
+ /** @beta */
577
+ export declare type BreadcrumbsProps<E extends BreadcrumbsElementType = BreadcrumbsElementType> =
578
+ Props<BreadcrumbsOwnProps, E>
579
+
580
+ /** @public */
581
+ export declare function Button<E extends ButtonElementType = typeof DEFAULT_BUTTON_ELEMENT>(
582
+ props: ButtonProps<E>,
583
+ ): JSX.Element
584
+
585
+ /** @public */
586
+ export declare type ButtonElementType = 'a' | 'button' | 'label' | ComponentType
561
587
 
562
588
  /**
563
589
  * @public
@@ -565,40 +591,39 @@ export declare const Button: ForwardRefExoticComponent<
565
591
  */
566
592
  export declare type ButtonMode = ThemeColorButtonModeKey_2
567
593
 
568
- /**
569
- * @public
570
- */
571
- export declare interface ButtonProps
572
- extends ButtonStyleProps,
573
- DisplayStyleProps,
574
- FlexStyleProps,
575
- GapStyleProps,
576
- PaddingStyleProps {
577
- 'data-ui'?: string
578
- 'fontSize'?: ResponsiveProp<FontTextSize>
579
- 'href'?: string
580
- 'mode'?: ButtonMode
581
- 'icon'?: ElementType | ReactNode
582
- 'iconRight'?: ElementType | ReactNode
583
- /** @beta Do not use in production, as this might change.*/
584
- 'loading'?: boolean
585
- 'selected'?: boolean
586
- /** @deprecated Use `gap` instead. */
587
- 'space'?: ResponsiveProp<Space>
588
- 'textAlign'?: ButtonTextAlign
589
- 'muted'?: boolean
590
- 'target'?: string
591
- 'text'?: ReactNode
592
- 'textOverflow'?: TextProps['textOverflow']
593
- 'textWeight'?: TextProps['weight']
594
- 'tone'?: ButtonTone
595
- 'type'?: 'button' | 'reset' | 'submit'
596
- 'width'?: ResponsiveProp<Width>
597
- }
594
+ /** @public */
595
+ export declare type ButtonOwnProps = ButtonStyleProps &
596
+ DisplayStyleProps &
597
+ GapStyleProps &
598
+ PaddingStyleProps & {
599
+ 'align'?: BoxStyleProps['alignItems']
600
+ 'data-ui'?: string
601
+ 'disabled'?: boolean
602
+ 'fontSize'?: ResponsiveProp<FontTextSize>
603
+ 'icon'?: ElementType_2 | ReactNode
604
+ 'iconRight'?: ElementType_2 | ReactNode
605
+ 'justify'?: BoxStyleProps['justifyContent']
606
+ /** @beta Do not use in production, as this might change.*/
607
+ 'loading'?: boolean
608
+ 'selected'?: boolean
609
+ /** @deprecated Use `gap` instead. */
610
+ 'space'?: ResponsiveProp<Space>
611
+ 'textAlign'?: ButtonTextAlign
612
+ 'muted'?: boolean
613
+ 'target'?: string
614
+ 'text'?: ReactNode
615
+ 'textOverflow'?: TextOwnProps['textOverflow']
616
+ 'textWeight'?: TextOwnProps['weight']
617
+ 'width'?: ResponsiveProp<Width>
618
+ }
598
619
 
599
- /**
600
- * @public
601
- */
620
+ /** @public */
621
+ export declare type ButtonProps<E extends ButtonElementType = ButtonElementType> = Props<
622
+ ButtonOwnProps,
623
+ E
624
+ >
625
+
626
+ /** @public */
602
627
  export declare type ButtonTextAlign = 'left' | 'right' | 'center'
603
628
 
604
629
  /**
@@ -619,16 +644,30 @@ export declare type ButtonWidth = 'fill'
619
644
  *
620
645
  * @public
621
646
  */
622
- export declare const Card: ForwardRefExoticComponent<
623
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof CardProps> &
624
- CardProps &
625
- RefAttributes<HTMLDivElement>
626
- >
647
+ export declare function Card<E extends CardElementType = typeof DEFAULT_CARD_ELEMENT>(
648
+ props: CardProps<E>,
649
+ ): JSX.Element
627
650
 
628
- /**
629
- * @public
630
- */
631
- export declare interface CardProps extends BoxProps, CardStyleProps_2 {
651
+ /** @internal */
652
+ export declare type _CardCompatProviderComponent = ComponentType_2<{
653
+ children?: ReactNode
654
+ tone: ThemeColorCardToneKey
655
+ scheme: ThemeColorSchemeKey_2
656
+ }>
657
+
658
+ /** @public */
659
+ export declare interface CardContextValue {
660
+ tone: ThemeColorCardToneKey
661
+ scheme: ThemeColorSchemeKey_2
662
+ /** @internal */
663
+ unstable_CompatProvider?: _CardCompatProviderComponent
664
+ }
665
+
666
+ /** @public */
667
+ export declare type CardElementType = BoxElementType
668
+
669
+ /** @public */
670
+ export declare interface CardOwnProps extends BoxOwnProps, CardStyleProps_2 {
632
671
  /**
633
672
  * Do not use in production.
634
673
  * @beta
@@ -640,26 +679,35 @@ export declare interface CardProps extends BoxProps, CardStyleProps_2 {
640
679
  */
641
680
  __unstable_focusRing?: boolean
642
681
  disabled?: boolean
643
- href?: string
644
682
  pressed?: boolean
645
683
  selected?: boolean
646
684
  target?: string
647
685
  }
648
686
 
687
+ /** @public */
688
+ export declare type CardProps<E extends CardElementType = CardElementType> = Props<CardOwnProps, E>
689
+
690
+ /** @public */
691
+ export declare function CardProvider(props: {
692
+ children?: ReactNode
693
+ tone: ThemeColorCardToneKey
694
+ scheme: ThemeColorSchemeKey_2
695
+ /** @internal */
696
+ unstable_CompatProvider?: _CardCompatProviderComponent
697
+ }): JSX.Element
698
+
649
699
  /**
650
700
  * @internal
651
- * @deprecated
701
+ * @deprecated Use `CardStyleProps` from `@sanity/ui/css` instead.
652
702
  */
653
703
  export declare interface CardStyleProps {
654
704
  $checkered: boolean
655
705
  $focusRing: boolean
656
706
  $muted: boolean
657
- $tone: ThemeColorToneKey
707
+ $tone: ThemeColorCardToneKey
658
708
  }
659
709
 
660
- /**
661
- * @public
662
- */
710
+ /** @public */
663
711
  export declare type CardTone = ThemeColorCardToneKey | 'inherit'
664
712
 
665
713
  /**
@@ -667,109 +715,104 @@ export declare type CardTone = ThemeColorCardToneKey | 'inherit'
667
715
  *
668
716
  * @public
669
717
  */
670
- export declare const Checkbox: ForwardRefExoticComponent<
671
- Omit<ElementProps_2<'input'> & PolymorphicProps_2, keyof CheckboxProps> &
672
- CheckboxProps &
673
- RefAttributes<HTMLInputElement>
674
- >
718
+ export declare function Checkbox<E extends CheckboxElementType = typeof DEFAULT_CHECKBOX_ELEMENT>(
719
+ props: CheckboxProps<E>,
720
+ ): JSX.Element
675
721
 
676
- /**
677
- * @public
678
- */
679
- export declare interface CheckboxProps {
722
+ /** @public */
723
+ export declare type CheckboxElementType = 'input' | ComponentType
724
+
725
+ /** @public */
726
+ export declare type CheckboxOwnProps = {
680
727
  indeterminate?: boolean
681
728
  customValidity?: string
682
729
  }
683
730
 
684
- /**
685
- * @public
686
- */
731
+ /** @public */
732
+ export declare type CheckboxProps<E extends CheckboxElementType = CheckboxElementType> = Props<
733
+ CheckboxOwnProps,
734
+ E
735
+ >
736
+
737
+ /** @public */
687
738
  export declare type ClickOutsideElements = (HTMLElement | null | (HTMLElement | null)[])[]
688
739
 
689
- /**
690
- * @public
691
- */
740
+ /** @public */
692
741
  export declare type ClickOutsideEventElements = (HTMLElement | null | (HTMLElement | null)[])[]
693
742
 
694
- /**
695
- * @public
696
- */
743
+ /** @public */
697
744
  export declare type ClickOutsideEventListener = (event: MouseEvent) => void
698
745
 
699
- /**
700
- * @public
701
- */
746
+ /** @public */
702
747
  export declare type ClickOutsideListener = (event: MouseEvent) => void
703
748
 
704
- /**
705
- * @public
706
- */
707
- export declare const Code: ForwardRefExoticComponent<
708
- Omit<ElementProps_2<'pre'> & PolymorphicProps_2, keyof CodeProps> &
709
- CodeProps &
710
- RefAttributes<HTMLPreElement>
711
- >
749
+ /** @public */
750
+ export declare function Code<E extends CodeElementType = typeof DEFAULT_CODE_ELEMENT>(
751
+ props: CodeProps<E>,
752
+ ): JSX.Element
712
753
 
713
- /**
714
- * @public
715
- */
716
- export declare interface CodeProps extends Omit<FontStyleProps, 'align'> {
754
+ /** @public */
755
+ export declare type CodeElementType = 'div' | 'pre' | ComponentType
756
+
757
+ /** @public */
758
+ export declare type CodeOwnProps = CodeStyleProps & {
717
759
  /** Define the language to use for syntax highlighting. */
718
760
  language?: string
719
- size?: number | number[]
761
+ size?: ResponsiveProp<FontCodeSize>
720
762
  }
721
763
 
722
- /**
723
- * This API might change. DO NOT USE IN PRODUCTION.
724
- * @beta
725
- */
726
- export declare const CodeSkeleton: ForwardRefExoticComponent<
727
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof CodeSkeletonProps> &
728
- CodeSkeletonProps &
729
- RefAttributes<HTMLDivElement>
730
- >
764
+ /** @public */
765
+ export declare type CodeProps<E extends CodeElementType = CodeElementType> = Props<CodeOwnProps, E>
731
766
 
732
767
  /**
733
768
  * This API might change. DO NOT USE IN PRODUCTION.
734
769
  * @beta
735
770
  */
736
- export declare interface CodeSkeletonProps extends SkeletonProps {
771
+ export declare function CodeSkeleton<
772
+ E extends CodeSkeletonElementType = typeof DEFAULT_CODE_SKELETON_ELEMENT,
773
+ >(props: CodeSkeletonProps<E>): JSX.Element
774
+
775
+ /** @beta */
776
+ export declare type CodeSkeletonElementType = SkeletonElementType
777
+
778
+ /** @beta */
779
+ export declare type CodeSkeletonOwnProps = SkeletonOwnProps & {
737
780
  size?: ResponsiveProp<FontCodeSize>
738
781
  }
739
782
 
740
783
  /**
741
- * @internal
742
- * @deprecated this component will be removed in the next major release
784
+ * This API might change. DO NOT USE IN PRODUCTION.
785
+ * @beta
743
786
  */
744
- export declare function ConditionalWrapper({
745
- children,
746
- condition,
747
- wrapper,
748
- }: {
749
- children: ReactNode
750
- condition: boolean
751
- wrapper: (children: ReactNode) => ReactNode
752
- }): ReactNode
787
+ export declare type CodeSkeletonProps<E extends CodeSkeletonElementType = CodeSkeletonElementType> =
788
+ Props<CodeSkeletonOwnProps, E>
753
789
 
754
- export declare namespace ConditionalWrapper {
755
- var displayName: string
756
- }
790
+ /** @public */
791
+ export declare type ComponentType<P = any> =
792
+ | FunctionComponent<P>
793
+ | ComponentClass<P>
794
+ | ExoticComponent<P>
757
795
 
758
796
  /**
759
797
  * The `Container` component wraps content layout in a defined set of widths.
760
798
  *
761
799
  * @public
762
800
  */
763
- export declare const Container: ForwardRefExoticComponent<
764
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof ContainerProps> &
765
- ContainerProps &
766
- RefAttributes<HTMLDivElement>
767
- >
801
+ export declare function Container<
802
+ E extends ContainerElementType = typeof DEFAULT_CONTAINER_ELEMENT,
803
+ >(props: ContainerProps<E>): JSX.Element
768
804
 
769
- /**
770
- * @public
771
- */
772
- export declare interface ContainerProps extends Omit<BoxProps, 'width'>, ContainerStyleProps {}
805
+ /** @public */
806
+ export declare type ContainerElementType = BoxElementType
807
+
808
+ /** @public */
809
+ export declare type ContainerOwnProps = Omit<BoxOwnProps, 'width'> & ContainerStyleProps
810
+
811
+ /** @public */
812
+ export declare type ContainerProps<E extends ContainerElementType = ContainerElementType> = Props<
813
+ ContainerOwnProps,
814
+ E
815
+ >
773
816
 
774
817
  /**
775
818
  * @internal
@@ -782,9 +825,157 @@ export declare function containsOrEqualsElement(element: HTMLElement, node: Node
782
825
  */
783
826
  export declare const createColorTheme: typeof createColorTheme_2
784
827
 
785
- /**
786
- * @public
787
- */
828
+ /** @internal */
829
+ export declare const DEFAULT_ARROW_ELEMENT = 'div'
830
+
831
+ /** @public */
832
+ export declare const DEFAULT_AUTOCOMPLETE_ELEMENT = 'input'
833
+
834
+ /** @public */
835
+ export declare const DEFAULT_AVATAR_COUNTER_ELEMENT = 'div'
836
+
837
+ /** @public */
838
+ export declare const DEFAULT_AVATAR_ELEMENT = 'span'
839
+
840
+ /** @public */
841
+ export declare const DEFAULT_AVATAR_STACK_ELEMENT = 'div'
842
+
843
+ /** @public */
844
+ export declare const DEFAULT_BADGE_ELEMENT = 'span'
845
+
846
+ /** @public */
847
+ export declare const DEFAULT_BOX_ELEMENT = 'div'
848
+
849
+ /** @beta */
850
+ export declare const DEFAULT_BREADCRUMBS_ELEMENT = 'nav'
851
+
852
+ /** @public */
853
+ export declare const DEFAULT_BUTTON_ELEMENT = 'button'
854
+
855
+ /** @public */
856
+ export declare const DEFAULT_CARD_ELEMENT = 'div'
857
+
858
+ /** @public */
859
+ export declare const DEFAULT_CHECKBOX_ELEMENT = 'input'
860
+
861
+ /** @public */
862
+ export declare const DEFAULT_CODE_ELEMENT = 'pre'
863
+
864
+ /** @beta */
865
+ export declare const DEFAULT_CODE_SKELETON_ELEMENT = 'div'
866
+
867
+ /** @public */
868
+ export declare const DEFAULT_CONTAINER_ELEMENT = 'div'
869
+
870
+ /** @public */
871
+ export declare const DEFAULT_DIALOG_ELEMENT = 'div'
872
+
873
+ /** @beta */
874
+ export declare const DEFAULT_ELEMENT_QUERY_ELEMENT = 'div'
875
+
876
+ /** @public */
877
+ export declare const DEFAULT_FLEX_ELEMENT = 'div'
878
+
879
+ /** @public */
880
+ export declare const DEFAULT_GRID_ELEMENT = 'div'
881
+
882
+ /** @public */
883
+ export declare const DEFAULT_HEADING_ELEMENT = 'div'
884
+
885
+ /** @beta */
886
+ export declare const DEFAULT_HEADING_SKELETON_ELEMENT = 'div'
887
+
888
+ /** @public */
889
+ export declare const DEFAULT_HOTKEYS_ELEMENT = 'kbd'
890
+
891
+ /** @public */
892
+ export declare const DEFAULT_INLINE_ELEMENT = 'div'
893
+
894
+ /** @public */
895
+ export declare const DEFAULT_KBD_ELEMENT = 'kbd'
896
+
897
+ /** @public */
898
+ export declare const DEFAULT_LABEL_ELEMENT = 'div'
899
+
900
+ /** @beta */
901
+ export declare const DEFAULT_LABEL_SKELETON_ELEMENT = 'div'
902
+
903
+ /** @public */
904
+ export declare const DEFAULT_LAYER_ELEMENT = 'div'
905
+
906
+ /** @public */
907
+ export declare const DEFAULT_MENU_DIVIDER_ELEMENT = 'hr'
908
+
909
+ /** @public */
910
+ export declare const DEFAULT_MENU_ELEMENT = 'div'
911
+
912
+ /** @public */
913
+ export declare const DEFAULT_MENU_GROUP_ELEMENT = 'button'
914
+
915
+ /** @public */
916
+ export declare const DEFAULT_MENU_ITEM_ELEMENT = 'button'
917
+
918
+ /** @public */
919
+ export declare const DEFAULT_POPOVER_ELEMENT = 'div'
920
+
921
+ /** @public */
922
+ export declare const DEFAULT_RADIO_ELEMENT = 'input'
923
+
924
+ /** @public */
925
+ export declare const DEFAULT_SELECT_ELEMENT = 'select'
926
+
927
+ /** @beta */
928
+ export declare const DEFAULT_SKELETON_ELEMENT = 'div'
929
+
930
+ /** @public */
931
+ export declare const DEFAULT_SPINNER_ELEMENT = 'div'
932
+
933
+ /** @public */
934
+ export declare const DEFAULT_SR_ONLY_ELEMENT = 'span'
935
+
936
+ /** @public */
937
+ export declare const DEFAULT_STACK_ELEMENT = 'div'
938
+
939
+ /** @public */
940
+ export declare const DEFAULT_SWITCH_ELEMENT = 'input'
941
+
942
+ /** @public */
943
+ export declare const DEFAULT_TAB_ELEMENT = 'button'
944
+
945
+ /** @public */
946
+ export declare const DEFAULT_TAB_LIST_ELEMENT = 'div'
947
+
948
+ /** @public */
949
+ export declare const DEFAULT_TAB_PANEL_ELEMENT = 'div'
950
+
951
+ /** @public */
952
+ export declare const DEFAULT_TEXT_AREA_ELEMENT = 'textarea'
953
+
954
+ /** @public */
955
+ export declare const DEFAULT_TEXT_ELEMENT = 'div'
956
+
957
+ /** @public */
958
+ export declare const DEFAULT_TEXT_INPUT_ELEMENT = 'input'
959
+
960
+ /** @beta */
961
+ export declare const DEFAULT_TEXT_SKELETON_ELEMENT = 'div'
962
+
963
+ /** @public */
964
+ export declare const DEFAULT_TOAST_ELEMENT = 'li'
965
+
966
+ /** @public */
967
+ export declare const DEFAULT_TOOLTIP_ELEMENT = 'div'
968
+
969
+ /** @beta */
970
+ export declare const DEFAULT_TREE_ELEMENT = 'div'
971
+
972
+ /** @beta */
973
+ export declare const DEFAULT_TREE_ITEM_ELEMENT = 'a'
974
+
975
+ /** @beta */
976
+ export declare const DEFAULT_VIRTUAL_LIST_ELEMENT = 'div'
977
+
978
+ /** @public */
788
979
  export declare type Delay =
789
980
  | number
790
981
  | Partial<{
@@ -797,11 +988,9 @@ export declare type Delay =
797
988
  *
798
989
  * @public
799
990
  */
800
- export declare const Dialog: ForwardRefExoticComponent<
801
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof DialogProps> &
802
- DialogProps &
803
- RefAttributes<HTMLDivElement>
804
- >
991
+ export declare function Dialog<E extends DialogElementType = typeof DEFAULT_DIALOG_ELEMENT>(
992
+ props: DialogProps<E>,
993
+ ): JSX.Element
805
994
 
806
995
  /**
807
996
  * @internal
@@ -814,53 +1003,56 @@ export declare const DialogContext: Context<DialogContextValue>
814
1003
  */
815
1004
  export declare interface DialogContextValue {
816
1005
  version: 0.0
817
- position?: DialogPosition | DialogPosition[]
818
- zOffset?: number | number[]
1006
+ position?: ResponsiveProp<DialogPosition>
1007
+ zOffset?: ResponsiveProp<number>
819
1008
  }
820
1009
 
821
- /**
822
- * @public
823
- */
1010
+ /** @public */
1011
+ export declare type DialogElementType = 'div' | 'span' | ComponentType
1012
+
1013
+ /** @public */
1014
+ export declare type DialogOwnProps = ContainerStyleProps &
1015
+ Omit<LayerOwnProps, 'width'> & {
1016
+ /**
1017
+ * @beta
1018
+ */
1019
+ __unstable_autoFocus?: boolean
1020
+ /**
1021
+ * @beta
1022
+ */
1023
+ __unstable_hideCloseButton?: boolean
1024
+ /**
1025
+ * Whether the dialog should animate in on mount.
1026
+ *
1027
+ * @beta
1028
+ * @defaultValue false
1029
+ */
1030
+ animate?: boolean
1031
+ cardRadius?: ResponsiveProp<Radius>
1032
+ contentRef?: ForwardedRef<HTMLDivElement>
1033
+ footer?: ReactNode
1034
+ header?: ReactNode
1035
+ id: string
1036
+ /** A callback that fires when the dialog becomes the top layer when it was not the top layer before. */
1037
+ onActivate?: LayerProps['onActivate']
1038
+ onClickOutside?: () => void
1039
+ onClose?: () => void
1040
+ open?: boolean
1041
+ portal?: string
1042
+ position?: ResponsiveProp<DialogPosition>
1043
+ scheme?: ThemeColorSchemeKey_2
1044
+ tone?: CardTone
1045
+ zOffset?: number | number[]
1046
+ }
1047
+
1048
+ /** @public */
824
1049
  export declare type DialogPosition = 'absolute' | 'fixed'
825
1050
 
826
- /**
827
- * @public
828
- */
829
- export declare interface DialogProps
830
- extends ContainerStyleProps,
831
- PaddingStyleProps,
832
- ShadowStyleProps {
833
- /**
834
- * @beta
835
- */
836
- __unstable_autoFocus?: boolean
837
- /**
838
- * @beta
839
- */
840
- __unstable_hideCloseButton?: boolean
841
- /**
842
- * Whether the dialog should animate in on mount.
843
- *
844
- * @beta
845
- * @defaultValue false
846
- */
847
- animate?: boolean
848
- cardRadius?: ResponsiveProp<Radius>
849
- contentRef?: ForwardedRef<HTMLDivElement>
850
- footer?: ReactNode
851
- header?: ReactNode
852
- id: string
853
- /** A callback that fires when the dialog becomes the top layer when it was not the top layer before. */
854
- onActivate?: LayerProps['onActivate']
855
- onClickOutside?: () => void
856
- onClose?: () => void
857
- open?: boolean
858
- portal?: string
859
- position?: DialogPosition | DialogPosition[]
860
- scheme?: ThemeColorSchemeKey_2
861
- tone?: CardTone
862
- zOffset?: number | number[]
863
- }
1051
+ /** @public */
1052
+ export declare type DialogProps<E extends DialogElementType = DialogElementType> = Props<
1053
+ DialogOwnProps,
1054
+ E
1055
+ >
864
1056
 
865
1057
  /**
866
1058
  * This API might change. DO NOT USE IN PRODUCTION.
@@ -868,32 +1060,41 @@ export declare interface DialogProps
868
1060
  */
869
1061
  export declare function DialogProvider(props: DialogProviderProps): ReactElement
870
1062
 
871
- export declare namespace DialogProvider {
872
- var displayName: string
873
- }
874
-
875
1063
  /**
876
1064
  * This API might change. DO NOT USE IN PRODUCTION.
877
1065
  * @beta
878
1066
  */
879
1067
  export declare interface DialogProviderProps {
880
1068
  children?: ReactNode
881
- position?: DialogPosition | DialogPosition[]
882
- zOffset?: number | number[]
1069
+ position?: ResponsiveProp<DialogPosition>
1070
+ zOffset?: ResponsiveProp<number>
883
1071
  }
884
1072
 
885
- /** @public */
886
- export declare type ElementProps<E extends ElementType> = Omit<ComponentProps<E>, 'as' | 'ref'>
1073
+ /**
1074
+ * DO NOT USE IN PRODUCTION.
1075
+ * @beta
1076
+ */
1077
+ export declare function ElementQuery<
1078
+ E extends ElementQueryElementType = typeof DEFAULT_ELEMENT_QUERY_ELEMENT,
1079
+ >(props: ElementQueryProps<E>): JSX.Element
1080
+
1081
+ /** @beta */
1082
+ export declare type ElementQueryElementType = 'div' | ComponentType
887
1083
 
888
1084
  /**
889
1085
  * DO NOT USE IN PRODUCTION.
890
1086
  * @beta
891
1087
  */
892
- export declare const ElementQuery: ForwardRefExoticComponent<
893
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, 'media'> &
894
- MediaQueryProps &
895
- RefAttributes<HTMLDivElement>
896
- >
1088
+ export declare type ElementQueryOwnProps = {
1089
+ media?: number[]
1090
+ }
1091
+
1092
+ /**
1093
+ * DO NOT USE IN PRODUCTION.
1094
+ * @beta
1095
+ */
1096
+ export declare type ElementQueryProps<E extends ElementQueryElementType = ElementQueryElementType> =
1097
+ Props<ElementQueryOwnProps, E>
897
1098
 
898
1099
  /**
899
1100
  * @beta
@@ -937,12 +1138,19 @@ export declare const _elementSizeObserver: _ElementSizeObserver
937
1138
  */
938
1139
  export declare type _ElementSizeSubscriber = (elementRect: ElementSize) => void
939
1140
 
1141
+ /** @public */
1142
+ export declare type ElementType<P> = TagType | ComponentType<P>
1143
+
1144
+ /** @public */
1145
+ export declare type EmptyProps = {}
1146
+
940
1147
  /**
941
1148
  * DO NOT USE IN PRODUCTION
942
1149
  * @beta
943
1150
  */
944
1151
  export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
945
1152
  state: ErrorBoundaryState
1153
+ static displayName: string
946
1154
  static getDerivedStateFromError(error: Error): ErrorBoundaryState
947
1155
  componentDidCatch(error: Error, info: ErrorInfo): void
948
1156
  render(): ReactNode
@@ -969,25 +1177,33 @@ export declare interface ErrorBoundaryState {
969
1177
  *
970
1178
  * @public
971
1179
  */
972
- export declare const Flex: ForwardRefExoticComponent<
973
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof FlexProps> &
974
- FlexProps &
975
- RefAttributes<HTMLDivElement>
976
- >
1180
+ export declare function Flex<E extends FlexElementType = typeof DEFAULT_FLEX_ELEMENT>(
1181
+ props: FlexProps<E>,
1182
+ ): JSX.Element
977
1183
 
978
1184
  export {FlexAlign}
979
1185
 
980
1186
  export {FlexDirection}
981
1187
 
1188
+ /** @public */
1189
+ export declare type FlexElementType = BoxElementType
1190
+
982
1191
  export {FlexJustify}
983
1192
 
984
- /**
985
- * @public
986
- */
987
- export declare interface FlexProps extends Omit<BoxProps, 'display'> {
988
- htmlFor?: string
1193
+ /** @public */
1194
+ export declare type FlexOwnProps = Omit<
1195
+ BoxOwnProps,
1196
+ 'align' | 'display' | 'flexDirection' | 'flexWrap'
1197
+ > & {
1198
+ align?: ResponsiveProp<FlexAlign>
1199
+ direction?: ResponsiveProp<FlexDirection>
1200
+ justify?: ResponsiveProp<FlexJustify>
1201
+ wrap?: ResponsiveProp<FlexWrap>
989
1202
  }
990
1203
 
1204
+ /** @public */
1205
+ export declare type FlexProps<E extends FlexElementType = FlexElementType> = Props<FlexOwnProps, E>
1206
+
991
1207
  export {FlexValue}
992
1208
 
993
1209
  export {FlexWrap}
@@ -1007,16 +1223,22 @@ export declare function focusLastDescendant(element: HTMLElement): boolean
1007
1223
  */
1008
1224
  export declare function _getArrayProp<T>(val: T | T[] | undefined, defaultVal?: T[]): T[]
1009
1225
 
1226
+ /**
1227
+ * @internal
1228
+ */
1229
+ export declare function _getResponsiveProp<T>(
1230
+ val: ResponsiveProp<T> | undefined,
1231
+ defaultVal?: Partial<Record<Breakpoint, T>>,
1232
+ ): Partial<Record<Breakpoint, T>>
1233
+
1010
1234
  /**
1011
1235
  * The `Grid` component is for building 2-dimensional layers (based on CSS grid).
1012
1236
  *
1013
1237
  * @public
1014
1238
  */
1015
- export declare const Grid: ForwardRefExoticComponent<
1016
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof GridProps> &
1017
- GridProps &
1018
- RefAttributes<HTMLDivElement>
1019
- >
1239
+ export declare function Grid<E extends GridElementType = typeof DEFAULT_GRID_ELEMENT>(
1240
+ props: GridProps<E>,
1241
+ ): JSX.Element
1020
1242
 
1021
1243
  export {GridAutoCols}
1022
1244
 
@@ -1024,6 +1246,9 @@ export {GridAutoFlow}
1024
1246
 
1025
1247
  export {GridAutoRows}
1026
1248
 
1249
+ /** @public */
1250
+ export declare type GridElementType = BoxElementType
1251
+
1027
1252
  export {GridItemColumn}
1028
1253
 
1029
1254
  export {GridItemColumnEnd}
@@ -1036,10 +1261,11 @@ export {GridItemRowEnd}
1036
1261
 
1037
1262
  export {GridItemRowStart}
1038
1263
 
1039
- /**
1040
- * @public
1041
- */
1042
- export declare interface GridProps extends Omit<BoxProps, 'display'> {}
1264
+ /** @public */
1265
+ export declare type GridOwnProps = Omit<BoxOwnProps, 'display'>
1266
+
1267
+ /** @public */
1268
+ export declare type GridProps<E extends GridElementType = GridElementType> = Props<GridOwnProps, E>
1043
1269
 
1044
1270
  /**
1045
1271
  * @internal
@@ -1051,34 +1277,55 @@ export declare function _hasFocus(element: HTMLElement): boolean
1051
1277
  *
1052
1278
  * @public
1053
1279
  */
1054
- export declare const Heading: ForwardRefExoticComponent<
1055
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof HeadingProps> &
1056
- HeadingProps &
1057
- RefAttributes<HTMLElement>
1058
- >
1280
+ export declare function Heading<E extends HeadingElementType = typeof DEFAULT_HEADING_ELEMENT>(
1281
+ props: HeadingProps<E>,
1282
+ ): JSX.Element
1059
1283
 
1060
- /**
1061
- * @public
1062
- */
1063
- export declare interface HeadingProps extends HeadingStyleProps, TextOverflowStyleProps {}
1284
+ /** @public */
1285
+ export declare type HeadingElementType =
1286
+ | 'div'
1287
+ | 'h1'
1288
+ | 'h2'
1289
+ | 'h3'
1290
+ | 'h4'
1291
+ | 'h5'
1292
+ | 'h6'
1293
+ | 'label'
1294
+ | 'span'
1295
+ | ComponentType
1296
+
1297
+ /** @public */
1298
+ export declare type HeadingOwnProps = HeadingStyleProps & TextOverflowStyleProps
1299
+
1300
+ /** @public */
1301
+ export declare type HeadingProps<E extends HeadingElementType = HeadingElementType> = Props<
1302
+ HeadingOwnProps,
1303
+ E
1304
+ >
1064
1305
 
1065
1306
  /**
1066
1307
  * This API might change. DO NOT USE IN PRODUCTION.
1067
1308
  * @beta
1068
1309
  */
1069
- export declare const HeadingSkeleton: ForwardRefExoticComponent<
1070
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof HeadingSkeletonProps> &
1071
- HeadingSkeletonProps &
1072
- RefAttributes<HTMLDivElement>
1073
- >
1310
+ export declare function HeadingSkeleton<
1311
+ E extends HeadingSkeletonElementType = typeof DEFAULT_HEADING_SKELETON_ELEMENT,
1312
+ >(props: HeadingSkeletonProps<E>): JSX.Element
1313
+
1314
+ /** @beta */
1315
+ export declare type HeadingSkeletonElementType = SkeletonElementType
1316
+
1317
+ /** @beta */
1318
+ export declare type HeadingSkeletonOwnProps = SkeletonOwnProps & {
1319
+ size?: ResponsiveProp<FontHeadingSize>
1320
+ }
1074
1321
 
1075
1322
  /**
1076
1323
  * This API might change. DO NOT USE IN PRODUCTION.
1077
1324
  * @beta
1078
1325
  */
1079
- export declare interface HeadingSkeletonProps extends SkeletonProps {
1080
- size?: ResponsiveProp<FontHeadingSize>
1081
- }
1326
+ export declare type HeadingSkeletonProps<
1327
+ E extends HeadingSkeletonElementType = HeadingSkeletonElementType,
1328
+ > = Props<HeadingSkeletonOwnProps, E>
1082
1329
 
1083
1330
  /**
1084
1331
  * @public
@@ -1091,16 +1338,15 @@ export declare const hexToRgb: typeof hexToRgb_2
1091
1338
  *
1092
1339
  * @public
1093
1340
  */
1094
- export declare const Hotkeys: ForwardRefExoticComponent<
1095
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof HotkeysProps> &
1096
- HotkeysProps &
1097
- RefAttributes<HTMLDivElement>
1098
- >
1341
+ export declare function Hotkeys<E extends HotkeysElementType = typeof DEFAULT_HOTKEYS_ELEMENT>(
1342
+ props: HotkeysProps<E>,
1343
+ ): JSX.Element | undefined
1099
1344
 
1100
- /**
1101
- * @public
1102
- */
1103
- export declare interface HotkeysProps extends GapStyleProps, RadiusStyleProps {
1345
+ /** @public */
1346
+ export declare type HotkeysElementType = 'kbd' | ComponentType
1347
+
1348
+ /** @public */
1349
+ export declare interface HotkeysOwnProps extends GapStyleProps, RadiusStyleProps {
1104
1350
  fontSize?: ResponsiveProp<FontTextSize>
1105
1351
  padding?: ResponsiveProp<Space>
1106
1352
  /** @deprecated Use `gap` instead. */
@@ -1108,6 +1354,12 @@ export declare interface HotkeysProps extends GapStyleProps, RadiusStyleProps {
1108
1354
  keys?: string[]
1109
1355
  }
1110
1356
 
1357
+ /** @public */
1358
+ export declare type HotkeysProps<E extends HotkeysElementType = HotkeysElementType> = Props<
1359
+ HotkeysOwnProps,
1360
+ E
1361
+ >
1362
+
1111
1363
  /**
1112
1364
  * @public
1113
1365
  * @deprecated Use `HSL` from `@sanity/ui/theme` instead.
@@ -1125,20 +1377,42 @@ export declare const hslToRgb: typeof hslToRgb_2
1125
1377
  *
1126
1378
  * @public
1127
1379
  */
1128
- export declare const Inline: ForwardRefExoticComponent<
1129
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof InlineProps> &
1130
- InlineProps &
1131
- RefAttributes<HTMLDivElement>
1132
- >
1380
+ export declare function Inline<E extends InlineElementType = typeof DEFAULT_INLINE_ELEMENT>(
1381
+ props: InlineProps<E>,
1382
+ ): JSX.Element
1133
1383
 
1134
- /**
1135
- * @public
1136
- */
1137
- export declare interface InlineProps extends Omit<BoxProps, 'align' | 'display' | 'justify'> {
1384
+ /** @public */
1385
+ export declare type InlineElementType = BoxElementType
1386
+
1387
+ /** @public */
1388
+ export declare type InlineOwnProps = Omit<
1389
+ BoxOwnProps,
1390
+ | 'alignItems'
1391
+ | 'flexDirection'
1392
+ | 'flexWrap'
1393
+ | 'justifyContent'
1394
+ | 'gridAutoColumns'
1395
+ | 'gridAutoFlow'
1396
+ | 'gridAutoRows'
1397
+ | 'gridColumnEnd'
1398
+ | 'gridColumnStart'
1399
+ | 'gridColumn'
1400
+ | 'gridRowEnd'
1401
+ | 'gridRowStart'
1402
+ | 'gridRow'
1403
+ | 'gridTemplateColumns'
1404
+ | 'gridTemplateRows'
1405
+ > & {
1138
1406
  /** @deprecated Use `gap` instead. */
1139
1407
  space?: ResponsiveProp<Space>
1140
1408
  }
1141
1409
 
1410
+ /** @public */
1411
+ export declare type InlineProps<E extends InlineElementType = InlineElementType> = Props<
1412
+ InlineOwnProps,
1413
+ E
1414
+ >
1415
+
1142
1416
  /**
1143
1417
  * @internal
1144
1418
  */
@@ -1189,67 +1463,83 @@ export declare function _isScrollable(el: Node): boolean
1189
1463
  *
1190
1464
  * @public
1191
1465
  */
1192
- export declare const KBD: ForwardRefExoticComponent<
1193
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof KBDProps> &
1194
- KBDProps &
1195
- RefAttributes<HTMLDivElement>
1196
- >
1466
+ export declare function KBD<E extends KBDElementType = typeof DEFAULT_KBD_ELEMENT>(
1467
+ props: KBDProps<E>,
1468
+ ): JSX.Element
1197
1469
 
1198
- /**
1199
- * @public
1200
- */
1201
- export declare interface KBDProps extends BoxProps, RadiusStyleProps {
1202
- fontSize?: ResponsiveProp<FontTextSize>
1203
- padding?: ResponsiveProp<Space>
1204
- }
1470
+ /** @public */
1471
+ export declare type KBDElementType = 'kbd' | ComponentType
1205
1472
 
1206
- /**
1207
- * Typographic labels.
1208
- *
1209
- * @public
1210
- */
1211
- export declare const Label: ForwardRefExoticComponent<
1212
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof LabelProps> &
1213
- LabelProps &
1214
- RefAttributes<HTMLDivElement>
1215
- >
1473
+ /** @public */
1474
+ export declare type KBDOwnProps = BoxOwnProps &
1475
+ RadiusStyleProps & {
1476
+ fontSize?: ResponsiveProp<FontTextSize>
1477
+ }
1478
+
1479
+ /** @public */
1480
+ export declare type KBDProps<E extends KBDElementType = KBDElementType> = Props<KBDOwnProps, E>
1216
1481
 
1217
1482
  /**
1483
+ * Typographic labels.
1484
+ *
1218
1485
  * @public
1219
1486
  */
1220
- export declare interface LabelProps extends FontStyleProps, TextOverflowStyleProps {
1221
- accent?: boolean
1222
- htmlFor?: string
1223
- muted?: boolean
1224
- size?: ResponsiveProp<LabelSize>
1225
- }
1487
+ export declare function Label<E extends LabelElementType = typeof DEFAULT_LABEL_ELEMENT>(
1488
+ props: LabelProps<E>,
1489
+ ): JSX.Element
1226
1490
 
1227
- /**
1228
- * This API might change. DO NOT USE IN PRODUCTION.
1229
- * @beta
1230
- */
1231
- export declare const LabelSkeleton: ForwardRefExoticComponent<
1232
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof LabelSkeletonProps> &
1233
- LabelSkeletonProps &
1234
- RefAttributes<HTMLDivElement>
1491
+ /** @public */
1492
+ export declare type LabelElementType =
1493
+ | 'div'
1494
+ | 'h1'
1495
+ | 'h2'
1496
+ | 'h3'
1497
+ | 'h4'
1498
+ | 'h5'
1499
+ | 'h6'
1500
+ | 'label'
1501
+ | 'li'
1502
+ | 'p'
1503
+ | 'span'
1504
+ | ComponentType
1505
+
1506
+ /** @public */
1507
+ export declare type LabelOwnProps = LabelStyleProps & TextOverflowStyleProps
1508
+
1509
+ /** @public */
1510
+ export declare type LabelProps<E extends LabelElementType = LabelElementType> = Props<
1511
+ LabelOwnProps,
1512
+ E
1235
1513
  >
1236
1514
 
1237
1515
  /**
1238
1516
  * This API might change. DO NOT USE IN PRODUCTION.
1239
1517
  * @beta
1240
1518
  */
1241
- export declare interface LabelSkeletonProps extends SkeletonProps {
1519
+ export declare function LabelSkeleton<
1520
+ E extends LabelSkeletonElementType = typeof DEFAULT_LABEL_SKELETON_ELEMENT,
1521
+ >(props: LabelSkeletonProps<E>): JSX.Element
1522
+
1523
+ /** @beta */
1524
+ export declare type LabelSkeletonElementType = SkeletonElementType
1525
+
1526
+ /** @beta */
1527
+ export declare type LabelSkeletonOwnProps = SkeletonOwnProps & {
1242
1528
  size?: ResponsiveProp<FontLabelSize>
1243
1529
  }
1244
1530
 
1245
1531
  /**
1246
- * @public
1532
+ * This API might change. DO NOT USE IN PRODUCTION.
1533
+ * @beta
1247
1534
  */
1248
- export declare const Layer: ForwardRefExoticComponent<
1249
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof LayerProps> &
1250
- LayerProps &
1251
- RefAttributes<HTMLDivElement>
1252
- >
1535
+ export declare type LabelSkeletonProps<
1536
+ E extends LabelSkeletonElementType = LabelSkeletonElementType,
1537
+ > = Props<LabelSkeletonOwnProps, E>
1538
+
1539
+ /** @public */
1540
+ export declare function Layer<E extends LayerElementType = typeof DEFAULT_LAYER_ELEMENT>(
1541
+ props: LayerProps<E>,
1542
+ ): JSX.Element
1253
1543
 
1254
1544
  /** @public */
1255
1545
  export declare interface LayerContextValue {
@@ -1261,38 +1551,29 @@ export declare interface LayerContextValue {
1261
1551
  zIndex: number
1262
1552
  }
1263
1553
 
1264
- /**
1265
- * @public
1266
- */
1267
- export declare interface LayerProps extends BoxProps {
1554
+ /** @public */
1555
+ export declare type LayerElementType = CardElementType
1556
+
1557
+ /** @public */
1558
+ export declare type LayerOwnProps = CardOwnProps & {
1268
1559
  /** A callback that fires when the layer becomes the top layer when it was not the top layer before. */
1269
1560
  onActivate?: (props: {activeElement: HTMLElement | null}) => void
1270
- zOffset?: number | number[]
1561
+ zOffset?: ResponsiveProp<number>
1271
1562
  }
1272
1563
 
1273
- /**
1274
- * @public
1275
- */
1276
- export declare function LayerProvider(props: LayerProviderProps): ReactElement
1564
+ /** @public */
1565
+ export declare type LayerProps<E extends LayerElementType = LayerElementType> = Props<
1566
+ LayerOwnProps,
1567
+ E
1568
+ >
1277
1569
 
1278
- export declare namespace LayerProvider {
1279
- var displayName: string
1280
- }
1570
+ /** @public */
1571
+ export declare function LayerProvider(props: LayerProviderProps): ReactElement
1281
1572
 
1282
- /**
1283
- * @public
1284
- */
1573
+ /** @public */
1285
1574
  export declare interface LayerProviderProps {
1286
1575
  children?: ReactNode
1287
- zOffset?: number | number[]
1288
- }
1289
-
1290
- /**
1291
- * DO NOT USE IN PRODUCTION.
1292
- * @beta
1293
- */
1294
- export declare interface MediaQueryProps {
1295
- media?: number[]
1576
+ zOffset?: ResponsiveProp<number>
1296
1577
  }
1297
1578
 
1298
1579
  /**
@@ -1300,7 +1581,7 @@ export declare interface MediaQueryProps {
1300
1581
  */
1301
1582
  export declare interface _MediaStore {
1302
1583
  subscribe: (onStoreChange: () => void) => () => void
1303
- getSnapshot: () => number
1584
+ getSnapshot: () => Breakpoint
1304
1585
  }
1305
1586
 
1306
1587
  /**
@@ -1308,25 +1589,19 @@ export declare interface _MediaStore {
1308
1589
  *
1309
1590
  * @public
1310
1591
  */
1311
- export declare const Menu: ForwardRefExoticComponent<
1312
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof MenuProps> &
1313
- MenuProps &
1314
- RefAttributes<HTMLDivElement>
1315
- >
1592
+ export declare function Menu<E extends MenuElementType = typeof DEFAULT_MENU_ELEMENT>(
1593
+ props: MenuProps<E>,
1594
+ ): JSX.Element
1316
1595
 
1317
1596
  /**
1318
1597
  * The `MenuButton` component follows the WAI-ARIA specification for menu buttons.
1319
1598
  *
1320
1599
  * @public
1321
1600
  */
1322
- export declare const MenuButton: ForwardRefExoticComponent<
1323
- MenuButtonProps & RefAttributes<HTMLButtonElement | null>
1324
- >
1601
+ export declare function MenuButton(props: MenuButtonProps): JSX.Element
1325
1602
 
1326
- /**
1327
- * @public
1328
- */
1329
- export declare interface MenuButtonProps {
1603
+ /** @public */
1604
+ export declare type MenuButtonProps = {
1330
1605
  /**
1331
1606
  * @beta Do not use in production.
1332
1607
  */
@@ -1335,7 +1610,7 @@ export declare interface MenuButtonProps {
1335
1610
  * @deprecated Use `popover={{boundaryElement: element}}` instead.
1336
1611
  */
1337
1612
  boundaryElement?: HTMLElement
1338
- button: ReactElement<Props<ButtonProps, 'button'>>
1613
+ button: ReactElement<ButtonProps>
1339
1614
  id: string
1340
1615
  menu?: ReactElement
1341
1616
  onClose?: () => void
@@ -1362,38 +1637,43 @@ export declare interface MenuButtonProps {
1362
1637
  * @deprecated Use `popover={{preventOverflow: true}}` instead.
1363
1638
  */
1364
1639
  preventOverflow?: boolean
1640
+ ref?: ForwardedRef<HTMLButtonElement | null>
1365
1641
  }
1366
1642
 
1367
- /**
1368
- * @public
1369
- */
1370
- export declare const MenuDivider: ForwardRefExoticComponent<
1371
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, never> &
1372
- MenuDividerProps &
1373
- RefAttributes<HTMLHRElement>
1374
- >
1643
+ /** @public */
1644
+ export declare function MenuDivider<
1645
+ E extends MenuDividerElementType = typeof DEFAULT_MENU_DIVIDER_ELEMENT,
1646
+ >(props: MenuDividerProps<E>): JSX.Element
1375
1647
 
1376
1648
  /** @public */
1377
- export declare interface MenuDividerProps {}
1649
+ export declare type MenuDividerElementType = 'div' | 'hr' | 'span' | ComponentType
1378
1650
 
1379
- /**
1380
- * @public
1381
- */
1382
- export declare function MenuGroup(props: Props<MenuGroupProps, 'div'>): ReactElement
1651
+ /** @public */
1652
+ export declare type MenuDividerOwnProps = {}
1383
1653
 
1384
- export declare namespace MenuGroup {
1385
- var displayName: string
1386
- }
1654
+ /** @public */
1655
+ export declare type MenuDividerProps<E extends MenuDividerElementType = MenuDividerElementType> =
1656
+ Props<MenuDividerOwnProps, E>
1387
1657
 
1388
- /**
1389
- * @public
1390
- */
1391
- export declare interface MenuGroupProps extends GapStyleProps {
1658
+ /** @public */
1659
+ export declare type MenuElementType = 'div' | 'span' | ComponentType
1660
+
1661
+ /** @public */
1662
+ export declare function MenuGroup<
1663
+ E extends MenuGroupElementType = typeof DEFAULT_MENU_GROUP_ELEMENT,
1664
+ >(props: MenuGroupProps<E>): JSX.Element
1665
+
1666
+ /** @public */
1667
+ export declare type MenuGroupElementType = 'button' | ComponentType
1668
+
1669
+ /** @public */
1670
+ export declare type MenuGroupOwnProps = RadiusStyleProps & {
1392
1671
  disabled?: boolean
1393
1672
  fontSize?: ResponsiveProp<FontTextSize>
1394
- icon?: ElementType | ReactNode
1673
+ gap?: ResponsiveProp<Space>
1674
+ icon?: ElementType_2 | ReactNode
1395
1675
  menu?: Omit<
1396
- MenuProps,
1676
+ MenuProps<typeof DEFAULT_MENU_ELEMENT>,
1397
1677
  | 'onClickOutside'
1398
1678
  | 'onEscape'
1399
1679
  | 'onItemClick'
@@ -1405,43 +1685,51 @@ export declare interface MenuGroupProps extends GapStyleProps {
1405
1685
  >
1406
1686
  padding?: ResponsiveProp<Space>
1407
1687
  popover?: Omit<PopoverProps, 'content' | 'open'>
1408
- radius?: Radius | Radius[]
1409
1688
  /** @deprecated Use `gap` instead. */
1410
1689
  space?: ResponsiveProp<Space>
1411
- text: ReactNode
1412
- tone?: SelectableTone
1690
+ text?: ReactNode
1691
+ tone?: ThemeColorStateToneKey
1413
1692
  }
1414
1693
 
1415
- /**
1416
- * @public
1417
- */
1418
- export declare const MenuItem: ForwardRefExoticComponent<
1419
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof MenuItemProps> &
1420
- MenuItemProps &
1421
- RefAttributes<HTMLDivElement>
1694
+ /** @public */
1695
+ export declare type MenuGroupProps<E extends MenuGroupElementType = MenuGroupElementType> = Props<
1696
+ MenuGroupOwnProps,
1697
+ E
1422
1698
  >
1423
1699
 
1424
- /**
1425
- * @public
1426
- */
1427
- export declare interface MenuItemProps extends GapStyleProps, PaddingStyleProps, RadiusStyleProps {
1428
- disabled?: boolean
1429
- fontSize?: number | number[]
1430
- hotkeys?: string[]
1431
- icon?: ElementType | ReactNode
1432
- iconRight?: ElementType | ReactNode
1433
- pressed?: boolean
1434
- selected?: boolean
1435
- /** @deprecated Use `gap` instead. */
1436
- space?: ResponsiveProp<Space>
1437
- text?: ReactNode
1438
- tone?: SelectableTone
1439
- }
1700
+ /** @public */
1701
+ export declare function MenuItem<E extends MenuItemElementType = typeof DEFAULT_MENU_ITEM_ELEMENT>(
1702
+ props: MenuItemProps<E>,
1703
+ ): JSX.Element
1440
1704
 
1441
- /**
1442
- * @public
1443
- */
1444
- export declare interface MenuProps extends PaddingStyleProps, Pick<GapStyleProps, 'gap'> {
1705
+ /** @public */
1706
+ export declare type MenuItemElementType = 'button' | 'a' | ComponentType
1707
+
1708
+ /** @public */
1709
+ export declare type MenuItemOwnProps = GapStyleProps &
1710
+ PaddingStyleProps &
1711
+ RadiusStyleProps & {
1712
+ disabled?: boolean
1713
+ fontSize?: ResponsiveProp<FontTextSize>
1714
+ hotkeys?: string[]
1715
+ icon?: ElementType_2 | ReactNode
1716
+ iconRight?: ElementType_2 | ReactNode
1717
+ pressed?: boolean
1718
+ selected?: boolean
1719
+ /** @deprecated Use `gap` instead. */
1720
+ space?: ResponsiveProp<Space>
1721
+ text?: ReactNode
1722
+ tone?: ThemeColorStateToneKey
1723
+ }
1724
+
1725
+ /** @public */
1726
+ export declare type MenuItemProps<E extends MenuItemElementType = MenuItemElementType> = Omit<
1727
+ Props<MenuItemOwnProps, E>,
1728
+ 'role'
1729
+ >
1730
+
1731
+ /** @public */
1732
+ export declare type MenuOwnProps = PaddingStyleProps & {
1445
1733
  /**
1446
1734
  * @deprecated Use `shouldFocus="first"` instead.
1447
1735
  */
@@ -1450,6 +1738,7 @@ export declare interface MenuProps extends PaddingStyleProps, Pick<GapStyleProps
1450
1738
  * @deprecated Use `shouldFocus="last"` instead.
1451
1739
  */
1452
1740
  'focusLast'?: boolean
1741
+ 'gap'?: ResponsiveProp<Space>
1453
1742
  'onClickOutside'?: (event: MouseEvent) => void
1454
1743
  'onEscape'?: () => void
1455
1744
  'onItemClick'?: () => void
@@ -1462,6 +1751,9 @@ export declare interface MenuProps extends PaddingStyleProps, Pick<GapStyleProps
1462
1751
  'aria-labelledby'?: string
1463
1752
  }
1464
1753
 
1754
+ /** @public */
1755
+ export declare type MenuProps<E extends MenuElementType = MenuElementType> = Props<MenuOwnProps, E>
1756
+
1465
1757
  /**
1466
1758
  * @public
1467
1759
  * @deprecated Use `multiply` from `@sanity/ui/theme` instead.
@@ -1495,20 +1787,17 @@ export declare type Placement =
1495
1787
  | 'left-start'
1496
1788
  | 'left-end'
1497
1789
 
1498
- export declare interface PolymorphicProps {
1499
- as?: ElementType
1500
- }
1501
-
1502
1790
  /**
1503
1791
  * The `Popover` component is used to display some content on top of another.
1504
1792
  *
1505
1793
  * @public
1506
1794
  */
1507
- export declare const Popover: NamedExoticComponent<
1508
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof PopoverProps> &
1509
- PopoverProps &
1510
- RefAttributes<HTMLDivElement>
1511
- >
1795
+ export declare function Popover<E extends PopoverElementType = typeof DEFAULT_POPOVER_ELEMENT>(
1796
+ props: PopoverProps<E>,
1797
+ ): JSX.Element
1798
+
1799
+ /** @public */
1800
+ export declare type PopoverElementType = 'div' | ComponentType
1512
1801
 
1513
1802
  /**
1514
1803
  * @beta
@@ -1516,7 +1805,7 @@ export declare const Popover: NamedExoticComponent<
1516
1805
  export declare type PopoverMargins = [number, number, number, number]
1517
1806
 
1518
1807
  /** @public */
1519
- export declare interface PopoverProps extends CardProps, LayerProps {
1808
+ export declare type PopoverOwnProps = Omit<LayerOwnProps, 'maxWidth'> & {
1520
1809
  /** @beta */
1521
1810
  __unstable_margins?: PopoverMargins
1522
1811
  /**
@@ -1533,16 +1822,16 @@ export declare interface PopoverProps extends CardProps, LayerProps {
1533
1822
  ref: ForwardedRef<HTMLElement>
1534
1823
  }>
1535
1824
  /**
1536
- * When `true`, prevent overflow within the current boundary:
1537
- * - by flipping on its side axis
1538
- * - by resizing
1539
- /*
1540
- * Note that:
1541
- * - setting `preventOverflow` to `true` also prevents overflow on its side axis
1542
- * - setting `matchReferenceWidth` to `true` also causes the popover to resize
1543
- *
1544
- * @defaultValue false
1545
- */
1825
+ * When `true`, prevent overflow within the current boundary:
1826
+ * - by flipping on its side axis
1827
+ * - by resizing
1828
+ *
1829
+ * Note that:
1830
+ * - setting `preventOverflow` to `true` also prevents overflow on its side axis
1831
+ * - setting `matchReferenceWidth` to `true` also causes the popover to resize
1832
+ *
1833
+ * @defaultValue false
1834
+ */
1546
1835
  constrainSize?: boolean
1547
1836
  content?: ReactNode
1548
1837
  disabled?: boolean
@@ -1576,29 +1865,26 @@ export declare interface PopoverProps extends CardProps, LayerProps {
1576
1865
  */
1577
1866
  referenceElement?: HTMLElement | null
1578
1867
  /** @beta */
1579
- updateRef?:
1580
- | MutableRefObject<PopoverUpdateCallback | undefined>
1581
- | RefCallback<PopoverUpdateCallback | undefined>
1868
+ updateRef?: Ref<PopoverUpdateCallback | undefined>
1869
+ width?: ResponsiveProp<MaxWidth>
1582
1870
  }
1583
1871
 
1872
+ /** @public */
1873
+ export declare type PopoverProps<E extends PopoverElementType = PopoverElementType> = Props<
1874
+ PopoverOwnProps,
1875
+ E
1876
+ >
1877
+
1584
1878
  /** @beta */
1585
1879
  export declare type PopoverUpdateCallback = () => void
1586
1880
 
1587
1881
  /** @public */
1588
- export declare type PopoverWidth = number | 'auto'
1882
+ export declare type PopoverWidth = Exclude<ContainerWidth, 'auto'>
1589
1883
 
1590
- /**
1591
- * @public
1592
- */
1884
+ /** @public */
1593
1885
  export declare function Portal(props: PortalProps): ReactPortal | null
1594
1886
 
1595
- export declare namespace Portal {
1596
- var displayName: string
1597
- }
1598
-
1599
- /**
1600
- * @public
1601
- */
1887
+ /** @public */
1602
1888
  export declare interface PortalContextValue {
1603
1889
  version: 0.0
1604
1890
  boundaryElement: HTMLElement | null
@@ -1606,9 +1892,7 @@ export declare interface PortalContextValue {
1606
1892
  elements?: Record<string, HTMLElement | null | undefined>
1607
1893
  }
1608
1894
 
1609
- /**
1610
- * @public
1611
- */
1895
+ /** @public */
1612
1896
  export declare interface PortalProps {
1613
1897
  children: ReactNode
1614
1898
  /**
@@ -1617,18 +1901,10 @@ export declare interface PortalProps {
1617
1901
  __unstable_name?: string
1618
1902
  }
1619
1903
 
1620
- /**
1621
- * @public
1622
- */
1904
+ /** @public */
1623
1905
  export declare function PortalProvider(props: PortalProviderProps): ReactElement
1624
1906
 
1625
- export declare namespace PortalProvider {
1626
- var displayName: string
1627
- }
1628
-
1629
- /**
1630
- * @public
1631
- */
1907
+ /** @public */
1632
1908
  export declare interface PortalProviderProps {
1633
1909
  /**
1634
1910
  * @deprecated Use `<BoundaryElementProvider element={...} />` instead
@@ -1643,9 +1919,11 @@ export declare interface PortalProviderProps {
1643
1919
  }
1644
1920
 
1645
1921
  /** @public */
1646
- export declare type Props<P extends {} = {}, E extends ElementType = ElementType> = Assign<
1647
- ElementProps<E> & PolymorphicProps,
1648
- P
1922
+ export declare type Props<P extends EmptyProps, E extends ElementType<P>> = Assign<
1923
+ E extends TagType ? JSX.IntrinsicElements[E] : ComponentProps<E>,
1924
+ P & {
1925
+ as?: E
1926
+ }
1649
1927
  >
1650
1928
 
1651
1929
  export {px}
@@ -1655,19 +1933,24 @@ export {px}
1655
1933
  *
1656
1934
  * @public
1657
1935
  */
1658
- export declare const Radio: ForwardRefExoticComponent<
1659
- Omit<ElementProps_2<'input'> & PolymorphicProps_2, 'customValidity'> &
1660
- RadioProps &
1661
- RefAttributes<HTMLInputElement>
1662
- >
1936
+ export declare function Radio<E extends RadioElementType = typeof DEFAULT_RADIO_ELEMENT>(
1937
+ props: RadioProps<E>,
1938
+ ): JSX.Element
1663
1939
 
1664
- /**
1665
- * @public
1666
- */
1667
- export declare interface RadioProps {
1940
+ /** @public */
1941
+ export declare type RadioElementType = 'input' | ComponentType
1942
+
1943
+ /** @public */
1944
+ export declare type RadioOwnProps = {
1668
1945
  customValidity?: string
1669
1946
  }
1670
1947
 
1948
+ /** @public */
1949
+ export declare type RadioProps<E extends RadioElementType = RadioElementType> = Props<
1950
+ RadioOwnProps,
1951
+ E
1952
+ >
1953
+
1671
1954
  export {Radius}
1672
1955
 
1673
1956
  /**
@@ -1699,6 +1982,7 @@ export declare function _responsive<T>(
1699
1982
 
1700
1983
  /**
1701
1984
  * @internal
1985
+ * @deprecated This will be removed in next major version.
1702
1986
  */
1703
1987
  export declare interface ResponsiveAvatarSizeStyleProps {
1704
1988
  $size: AvatarSize[]
@@ -1876,11 +2160,12 @@ export {screen_2 as screen}
1876
2160
  *
1877
2161
  * @public
1878
2162
  */
1879
- export declare const Select: ForwardRefExoticComponent<
1880
- Omit<ElementProps_2<'select'> & PolymorphicProps_2, keyof SelectProps> &
1881
- SelectProps &
1882
- RefAttributes<HTMLSelectElement>
1883
- >
2163
+ export declare function Select<E extends SelectElementType = typeof DEFAULT_SELECT_ELEMENT>(
2164
+ props: SelectProps<E>,
2165
+ ): JSX.Element
2166
+
2167
+ /** @internal */
2168
+ declare type SelectableElementType = 'button' | 'a' | ComponentType
1884
2169
 
1885
2170
  /**
1886
2171
  * @public
@@ -1888,95 +2173,129 @@ export declare const Select: ForwardRefExoticComponent<
1888
2173
  */
1889
2174
  export declare type SelectableTone = ThemeColorStateToneKey
1890
2175
 
1891
- /**
1892
- * @public
1893
- */
1894
- export declare interface SelectProps extends SelectStyleProps {
2176
+ /** @public */
2177
+ export declare type SelectElementType = 'select' | ComponentType
2178
+
2179
+ /** @public */
2180
+ export declare type SelectOwnProps = SelectStyleProps & {
1895
2181
  customValidity?: string
1896
2182
  readOnly?: boolean
1897
2183
  /** @deprecated Use `gap` instead. */
1898
2184
  space?: ResponsiveProp<Space>
1899
2185
  }
1900
2186
 
2187
+ /** @public */
2188
+ export declare type SelectProps<E extends SelectElementType = SelectElementType> = Props<
2189
+ SelectOwnProps,
2190
+ E
2191
+ >
2192
+
1901
2193
  /**
1902
2194
  * This API might change. DO NOT USE IN PRODUCTION.
1903
2195
  * @beta
1904
2196
  */
1905
- export declare const Skeleton: ForwardRefExoticComponent<
1906
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof SkeletonProps> &
1907
- SkeletonProps &
1908
- RefAttributes<HTMLDivElement>
1909
- >
2197
+ export declare function Skeleton<E extends SkeletonElementType = typeof DEFAULT_SKELETON_ELEMENT>(
2198
+ props: SkeletonProps<E>,
2199
+ ): JSX.Element
2200
+
2201
+ /** @beta */
2202
+ export declare type SkeletonElementType = 'div' | 'span' | ComponentType
1910
2203
 
1911
2204
  /**
1912
2205
  * This API might change. DO NOT USE IN PRODUCTION.
1913
2206
  * @beta
1914
2207
  */
1915
- export declare interface SkeletonProps extends SkeletonStyleProps, Omit<BoxProps, 'children'> {
1916
- animated?: boolean
1917
- delay?: number
1918
- }
2208
+ export declare type SkeletonOwnProps = BoxOwnProps &
2209
+ SkeletonStyleProps & {
2210
+ animated?: boolean
2211
+ delay?: number
2212
+ }
2213
+
2214
+ /** @beta */
2215
+ export declare type SkeletonProps<E extends SkeletonElementType = SkeletonElementType> = Props<
2216
+ SkeletonOwnProps,
2217
+ E
2218
+ >
1919
2219
 
1920
2220
  /**
1921
2221
  * Indicate that something is loading for an indeterminate amount of time.
1922
2222
  *
1923
2223
  * @public
1924
2224
  */
1925
- export declare const Spinner: ForwardRefExoticComponent<
1926
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof SpinnerProps> &
1927
- SpinnerProps &
1928
- RefAttributes<HTMLDivElement>
1929
- >
2225
+ export declare function Spinner<E extends SpinnerElementType = typeof DEFAULT_SPINNER_ELEMENT>(
2226
+ props: SpinnerProps<E>,
2227
+ ): JSX.Element
1930
2228
 
1931
- /**
1932
- * @public
1933
- */
1934
- export declare interface SpinnerProps {
2229
+ /** @public */
2230
+ export declare type SpinnerElementType = 'div' | 'span' | ComponentType
2231
+
2232
+ /** @public */
2233
+ export declare type SpinnerOwnProps = {
1935
2234
  muted?: boolean
1936
2235
  size?: ResponsiveProp<FontTextSize>
1937
2236
  }
1938
2237
 
1939
- /**
1940
- * @public
1941
- */
1942
- export declare const SrOnly: ForwardRefExoticComponent<
1943
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, 'children'> &
1944
- SrOnlyProps &
1945
- RefAttributes<HTMLDivElement>
2238
+ /** @public */
2239
+ export declare type SpinnerProps<E extends SpinnerElementType = SpinnerElementType> = Props<
2240
+ SpinnerOwnProps,
2241
+ E
1946
2242
  >
1947
2243
 
1948
- /**
1949
- * @public
1950
- */
1951
- export declare interface SrOnlyProps {
1952
- children?: ReactNode
1953
- }
2244
+ /** @public */
2245
+ export declare function SrOnly<E extends SrOnlyElementType = typeof DEFAULT_SR_ONLY_ELEMENT>(
2246
+ props: SrOnlyProps<E>,
2247
+ ): JSX.Element
2248
+
2249
+ /** @public */
2250
+ export declare type SrOnlyElementType = 'span' | ComponentType
2251
+
2252
+ /** @public */
2253
+ export declare type SrOnlyOwnProps = {}
2254
+
2255
+ /** @public */
2256
+ export declare type SrOnlyProps<E extends SrOnlyElementType = SrOnlyElementType> = Props<
2257
+ SrOnlyOwnProps,
2258
+ E
2259
+ >
1954
2260
 
1955
2261
  /**
1956
2262
  * The `Stack` component is used to place elements on top of each other.
1957
2263
  *
1958
2264
  * @public
1959
2265
  */
1960
- export declare const Stack: ForwardRefExoticComponent<
1961
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof StackProps> &
1962
- StackProps &
1963
- RefAttributes<HTMLDivElement>
1964
- >
2266
+ export declare function Stack<E extends StackElementType = typeof DEFAULT_STACK_ELEMENT>(
2267
+ props: StackProps<E>,
2268
+ ): JSX.Element
1965
2269
 
1966
- /**
1967
- * @public
1968
- */
1969
- export declare interface StackProps
1970
- extends Omit<BoxProps, 'direction' | 'display' | 'gapX' | 'gapY'> {
2270
+ /** @public */
2271
+ export declare type StackElementType = BoxElementType
2272
+
2273
+ /** @public */
2274
+ export declare type StackOwnProps = Omit<
2275
+ BoxOwnProps,
2276
+ | 'align'
2277
+ | 'alignItems'
2278
+ | 'columns'
2279
+ | 'gridTemplateColumns'
2280
+ | 'direction'
2281
+ | 'display'
2282
+ | 'flexDirection'
2283
+ | 'gapX'
2284
+ | 'gapY'
2285
+ | 'justify'
2286
+ | 'justifyContent'
2287
+ | 'rows'
2288
+ | 'gridTemplateRows'
2289
+ > & {
1971
2290
  /** @deprecated Use `gap` instead. */
1972
2291
  space?: ResponsiveProp<Space>
1973
2292
  }
1974
2293
 
1975
- /**
1976
- * @public
1977
- * @deprecated Use `buildTheme` from `@sanity/ui/theme` instead.
1978
- */
1979
- export declare const studioTheme: RootTheme_2
2294
+ /** @public */
2295
+ export declare type StackProps<E extends StackElementType = StackElementType> = Props<
2296
+ StackOwnProps,
2297
+ E
2298
+ >
1980
2299
 
1981
2300
  /**
1982
2301
  * @public
@@ -1984,8 +2303,6 @@ export declare const studioTheme: RootTheme_2
1984
2303
  */
1985
2304
  export declare type Styles = ThemeStyles
1986
2305
 
1987
- export declare function StyleTags(props: {theme?: Theme_v3}): ReactNode
1988
-
1989
2306
  /**
1990
2307
  * The `Switch` component allows the user to toggle a setting on and off.
1991
2308
  *
@@ -1993,101 +2310,113 @@ export declare function StyleTags(props: {theme?: Theme_v3}): ReactNode
1993
2310
  *
1994
2311
  * @public
1995
2312
  */
1996
- export declare const Switch: ForwardRefExoticComponent<
1997
- Omit<ElementProps_2<'input'> & PolymorphicProps_2, 'indeterminate'> &
1998
- SwitchProps &
1999
- RefAttributes<HTMLInputElement>
2000
- >
2313
+ export declare function Switch<E extends SwitchElementType = typeof DEFAULT_SWITCH_ELEMENT>(
2314
+ props: SwitchProps<E>,
2315
+ ): JSX.Element
2001
2316
 
2002
- /**
2003
- * @public
2004
- */
2005
- export declare interface SwitchProps {
2317
+ /** @public */
2318
+ export declare type SwitchElementType = 'input' | ComponentType
2319
+
2320
+ /** @public */
2321
+ export declare type SwitchOwnProps = {
2006
2322
  indeterminate?: boolean
2007
2323
  }
2008
2324
 
2009
- /**
2010
- * @public
2011
- */
2012
- export declare const Tab: ForwardRefExoticComponent<
2013
- Omit<ElementProps_2<'button'> & PolymorphicProps_2, keyof TabProps> &
2014
- TabProps &
2015
- RefAttributes<HTMLButtonElement>
2325
+ /** @public */
2326
+ export declare type SwitchProps<E extends SwitchElementType = SwitchElementType> = Props<
2327
+ SwitchOwnProps,
2328
+ E
2016
2329
  >
2017
2330
 
2018
- /**
2019
- * @public
2020
- */
2021
- export declare const TabList: ForwardRefExoticComponent<
2022
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof TabListProps> &
2023
- TabListProps &
2024
- RefAttributes<HTMLDivElement>
2025
- >
2331
+ /** @public */
2332
+ export declare function Tab<E extends TabElementType = typeof DEFAULT_TAB_ELEMENT>(
2333
+ props: TabProps<E>,
2334
+ ): JSX.Element
2026
2335
 
2027
- /**
2028
- * @public
2029
- */
2336
+ /** @public */
2337
+ export declare type TabElementType = 'button' | ComponentType
2338
+
2339
+ /** @public */
2340
+ export declare function TabList<E extends TabListElementType = typeof DEFAULT_TAB_LIST_ELEMENT>(
2341
+ props: TabListProps<E>,
2342
+ ): JSX.Element
2343
+
2344
+ /** @public */
2030
2345
  export declare type TabListChild =
2031
2346
  | ReactElement<Props<TabProps, 'button'>>
2032
2347
  | null
2033
2348
  | undefined
2034
2349
  | false
2035
2350
 
2036
- /**
2037
- * @public
2038
- */
2039
- export declare interface TabListProps extends Omit<InlineProps, 'as' | 'height'> {
2351
+ /** @public */
2352
+ export declare type TabListElementType = 'div' | 'span' | ComponentType
2353
+
2354
+ /** @public */
2355
+ export declare type TabListOwnProps = Omit<FlexOwnProps, 'as' | 'height'> & {
2040
2356
  children: TabListChild[]
2357
+ /** @deprecated Use `gap` instead */
2358
+ space?: ResponsiveProp<Space>
2041
2359
  }
2042
2360
 
2043
- /**
2044
- * @public
2045
- */
2046
- export declare const TabPanel: ForwardRefExoticComponent<
2047
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof TabPanelProps> &
2048
- TabPanelProps &
2049
- RefAttributes<HTMLDivElement>
2050
- >
2051
-
2052
- /**
2053
- * @public
2054
- */
2055
- export declare interface TabPanelProps extends BoxProps {
2056
- /**
2057
- * The `id` of the correlating `Tab` component.
2058
- */
2059
- 'aria-labelledby': string
2060
- 'id': string
2061
- }
2361
+ /** @public */
2362
+ export declare type TabListProps<E extends TabListElementType = TabListElementType> = Props<
2363
+ TabListOwnProps,
2364
+ E
2365
+ >
2062
2366
 
2063
- /**
2064
- * @public
2065
- */
2066
- export declare interface TabProps {
2367
+ /** @public */
2368
+ export declare type TabOwnProps = {
2067
2369
  /**
2068
2370
  * The `id` of the corresponding `TabPanel` component.
2069
2371
  */
2070
2372
  'aria-controls': string
2071
2373
  'id': string
2072
- 'icon'?: ElementType | ReactNode
2374
+ 'icon'?: ElementType_2 | ReactNode
2073
2375
  'focused'?: boolean
2074
2376
  'fontSize'?: ResponsiveProp<FontTextSize>
2075
2377
  'label'?: ReactNode
2076
2378
  'padding'?: ResponsiveProp<Space>
2077
2379
  'selected'?: boolean
2078
- 'tone'?: ButtonTone
2380
+ 'tone'?: ThemeColorStateToneKey
2381
+ }
2382
+
2383
+ /** @public */
2384
+ export declare function TabPanel<E extends TabPanelElementType = typeof DEFAULT_TAB_PANEL_ELEMENT>(
2385
+ props: TabPanelProps<E>,
2386
+ ): JSX.Element
2387
+
2388
+ /** @public */
2389
+ export declare type TabPanelElementType = 'div' | 'span' | ComponentType
2390
+
2391
+ /** @public */
2392
+ export declare type TabPanelOwnProps = BoxOwnProps & {
2393
+ /**
2394
+ * The `id` of the correlating `Tab` component.
2395
+ */
2396
+ 'aria-labelledby': string
2397
+ 'id': string
2079
2398
  }
2080
2399
 
2400
+ /** @public */
2401
+ export declare type TabPanelProps<E extends TabPanelElementType = TabPanelElementType> = Props<
2402
+ TabPanelOwnProps,
2403
+ E
2404
+ >
2405
+
2406
+ /** @public */
2407
+ export declare type TabProps<E extends TabElementType = TabElementType> = Props<TabOwnProps, E>
2408
+
2409
+ /** @public */
2410
+ export declare type TagType = keyof JSX.IntrinsicElements
2411
+
2081
2412
  /**
2082
2413
  * The `Text` component is an agile, themed typographic element.
2083
2414
  *
2084
2415
  * @public
2085
2416
  */
2086
- declare const Text_2: ForwardRefExoticComponent<
2087
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof TextProps> &
2088
- TextProps &
2089
- RefAttributes<HTMLDivElement>
2090
- >
2417
+ declare function Text_2<E extends TextElementType = typeof DEFAULT_TEXT_ELEMENT>(
2418
+ props: TextProps<E>,
2419
+ ): JSX.Element
2091
2420
  export {Text_2 as Text}
2092
2421
 
2093
2422
  export {TextAlign}
@@ -2097,16 +2426,15 @@ export {TextAlign}
2097
2426
  *
2098
2427
  * @public
2099
2428
  */
2100
- export declare const TextArea: ForwardRefExoticComponent<
2101
- Omit<ElementProps_2<'textarea'> & PolymorphicProps_2, keyof TextAreaProps> &
2102
- TextAreaProps &
2103
- RefAttributes<HTMLTextAreaElement>
2104
- >
2429
+ export declare function TextArea<E extends TextAreaElementType = typeof DEFAULT_TEXT_AREA_ELEMENT>(
2430
+ props: TextAreaProps<E>,
2431
+ ): JSX.Element
2105
2432
 
2106
- /**
2107
- * @public
2108
- */
2109
- export declare interface TextAreaProps extends TextAreaStyleProps {
2433
+ /** @public */
2434
+ export declare type TextAreaElementType = 'textarea' | ComponentType
2435
+
2436
+ /** @public */
2437
+ export declare type TextAreaOwnProps = TextAreaStyleProps & {
2110
2438
  /**
2111
2439
  * @beta
2112
2440
  */
@@ -2114,32 +2442,49 @@ export declare interface TextAreaProps extends TextAreaStyleProps {
2114
2442
  customValidity?: string
2115
2443
  /** @deprecated Use `gap` instead. */
2116
2444
  space?: ResponsiveProp<Space>
2117
- weight?: ThemeFontWeightKey_2
2118
2445
  }
2119
2446
 
2447
+ /** @public */
2448
+ export declare type TextAreaProps<E extends TextAreaElementType = TextAreaElementType> = Props<
2449
+ TextAreaOwnProps,
2450
+ E
2451
+ >
2452
+
2453
+ /** @public */
2454
+ export declare type TextElementType =
2455
+ | 'div'
2456
+ | 'h1'
2457
+ | 'h2'
2458
+ | 'h3'
2459
+ | 'h4'
2460
+ | 'h5'
2461
+ | 'h6'
2462
+ | 'label'
2463
+ | 'li'
2464
+ | 'p'
2465
+ | 'span'
2466
+ | ComponentType
2467
+
2120
2468
  /**
2121
2469
  * Single line text input.
2122
2470
  *
2123
2471
  * @public
2124
2472
  */
2125
- export declare const TextInput: ForwardRefExoticComponent<
2126
- Omit<ElementProps_2<'input'> & PolymorphicProps_2, keyof TextInputProps> &
2127
- TextInputProps &
2128
- RefAttributes<HTMLInputElement>
2129
- >
2473
+ export declare function TextInput<
2474
+ E extends TextInputElementType = typeof DEFAULT_TEXT_INPUT_ELEMENT,
2475
+ >(props: TextInputProps<E>): JSX.Element
2130
2476
 
2131
- /**
2132
- * @public
2133
- */
2477
+ /** @public */
2134
2478
  export declare type TextInputClearButtonProps = Omit<
2135
- Props<ButtonProps, 'button'>,
2479
+ ButtonProps<'button'>,
2136
2480
  'as' | 'onClick' | 'onMouseDown'
2137
2481
  >
2138
2482
 
2139
- /**
2140
- * @public
2141
- */
2142
- export declare interface TextInputProps extends InputStyleProps {
2483
+ /** @public */
2484
+ export declare type TextInputElementType = 'input' | ComponentType
2485
+
2486
+ /** @public */
2487
+ export declare type TextInputOwnProps = InputStyleProps & {
2143
2488
  /**
2144
2489
  * @beta
2145
2490
  */
@@ -2149,8 +2494,8 @@ export declare interface TextInputProps extends InputStyleProps {
2149
2494
  */
2150
2495
  clearButton?: boolean | TextInputClearButtonProps
2151
2496
  customValidity?: string
2152
- icon?: ElementType | ReactNode
2153
- iconRight?: ElementType | ReactNode
2497
+ icon?: ElementType_2 | ReactNode
2498
+ iconRight?: ElementType_2 | ReactNode
2154
2499
  /**
2155
2500
  * @beta
2156
2501
  */
@@ -2159,52 +2504,43 @@ export declare interface TextInputProps extends InputStyleProps {
2159
2504
  /** @deprecated Use `gap` instead. */
2160
2505
  space?: ResponsiveProp<Space>
2161
2506
  suffix?: ReactNode
2162
- type?: TextInputType
2163
2507
  weight?: ThemeFontWeightKey_2
2164
2508
  }
2165
2509
 
2166
- /**
2167
- * @public
2168
- */
2169
- export declare type TextInputType =
2170
- | 'search'
2171
- | 'date'
2172
- | 'datetime-local'
2173
- | 'email'
2174
- | 'url'
2175
- | 'month'
2176
- | 'number'
2177
- | 'password'
2178
- | 'tel'
2179
- | 'time'
2180
- | 'text'
2181
- | 'week'
2182
- | 'color'
2510
+ /** @public */
2511
+ export declare type TextInputProps<E extends TextInputElementType = TextInputElementType> = Props<
2512
+ TextInputOwnProps,
2513
+ E
2514
+ >
2183
2515
 
2184
- /**
2185
- * @public
2186
- */
2187
- export declare interface TextProps extends TextStyleProps, TextOverflowStyleProps {
2188
- htmlFor?: string
2189
- }
2516
+ /** @public */
2517
+ export declare type TextOwnProps = TextStyleProps & TextOverflowStyleProps
2518
+
2519
+ /** @public */
2520
+ export declare type TextProps<E extends TextElementType = TextElementType> = Props<TextOwnProps, E>
2190
2521
 
2191
2522
  /**
2192
2523
  * This API might change. DO NOT USE IN PRODUCTION.
2193
2524
  * @beta
2194
2525
  */
2195
- export declare const TextSkeleton: ForwardRefExoticComponent<
2196
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof TextSkeletonProps> &
2197
- TextSkeletonProps &
2198
- RefAttributes<HTMLDivElement>
2199
- >
2526
+ export declare function TextSkeleton<
2527
+ E extends TextSkeletonElementType = typeof DEFAULT_TEXT_SKELETON_ELEMENT,
2528
+ >(props: TextSkeletonProps<E>): JSX.Element
2529
+
2530
+ /** @beta */
2531
+ export declare type TextSkeletonElementType = SkeletonElementType
2532
+
2533
+ /** @beta */
2534
+ export declare type TextSkeletonOwnProps = SkeletonOwnProps & {
2535
+ size?: ResponsiveProp<FontTextSize>
2536
+ }
2200
2537
 
2201
2538
  /**
2202
2539
  * This API might change. DO NOT USE IN PRODUCTION.
2203
2540
  * @beta
2204
2541
  */
2205
- export declare interface TextSkeletonProps extends SkeletonProps {
2206
- size?: ResponsiveProp<FontTextSize>
2207
- }
2542
+ export declare type TextSkeletonProps<E extends TextSkeletonElementType = TextSkeletonElementType> =
2543
+ Props<TextSkeletonOwnProps, E>
2208
2544
 
2209
2545
  /**
2210
2546
  * @public
@@ -2252,18 +2588,10 @@ export {ThemeColorMutedTone}
2252
2588
 
2253
2589
  export {ThemeColorName}
2254
2590
 
2255
- /**
2256
- * @public
2257
- */
2591
+ /** @public */
2258
2592
  export declare function ThemeColorProvider(props: ThemeColorProviderProps): ReactElement
2259
2593
 
2260
- export declare namespace ThemeColorProvider {
2261
- var displayName: string
2262
- }
2263
-
2264
- /**
2265
- * @public
2266
- */
2594
+ /** @public */
2267
2595
  export declare interface ThemeColorProviderProps {
2268
2596
  children?: ReactNode
2269
2597
  scheme?: ThemeColorSchemeKey_2
@@ -2302,9 +2630,7 @@ export declare type ThemeColorSyntax = ThemeColorSyntax_2
2302
2630
 
2303
2631
  export {ThemeColorToneKey}
2304
2632
 
2305
- /**
2306
- * @public
2307
- */
2633
+ /** @public */
2308
2634
  export declare interface ThemeContextValue {
2309
2635
  /** @deprecated No longer used */
2310
2636
  version: 0.0
@@ -2357,18 +2683,10 @@ export {ThemeInput}
2357
2683
  */
2358
2684
  export declare type ThemeLayer = ThemeLayer_2
2359
2685
 
2360
- /**
2361
- * @public
2362
- */
2686
+ /** @public */
2363
2687
  export declare function ThemeProvider(props: ThemeProviderProps): ReactElement
2364
2688
 
2365
- export declare namespace ThemeProvider {
2366
- var displayName: string
2367
- }
2368
-
2369
- /**
2370
- * @public
2371
- */
2689
+ /** @public */
2372
2690
  export declare interface ThemeProviderProps {
2373
2691
  children?: ReactNode
2374
2692
  scheme?: ThemeColorSchemeKey_2
@@ -2389,20 +2707,11 @@ export declare type ThemeShadow = ThemeShadow_2
2389
2707
  *
2390
2708
  * @public
2391
2709
  */
2392
- export declare function Toast(
2393
- props: Omit<
2394
- Props<ToastProps, 'div'>,
2395
- 'onDrag' | 'onDragEnd' | 'onDragStart' | 'onAnimationStart'
2396
- >,
2397
- ): ReactElement
2710
+ export declare function Toast<E extends ToastElementType = typeof DEFAULT_TOAST_ELEMENT>(
2711
+ props: ToastProps<E>,
2712
+ ): JSX.Element
2398
2713
 
2399
- export declare namespace Toast {
2400
- var displayName: string
2401
- }
2402
-
2403
- /**
2404
- * @public
2405
- */
2714
+ /** @public */
2406
2715
  export declare interface ToastContextValue {
2407
2716
  version: 0.0
2408
2717
  /**
@@ -2414,54 +2723,58 @@ export declare interface ToastContextValue {
2414
2723
  push: (params: ToastParams) => string
2415
2724
  }
2416
2725
 
2417
- /**
2418
- * @public
2419
- */
2420
- declare interface ToastLayerProps extends GapStyleProps, PaddingStyleProps {
2421
- children: ReactNode
2422
- }
2726
+ /** @public */
2727
+ export declare type ToastElementType = 'li' | ComponentType
2423
2728
 
2424
- /**
2425
- * @public
2426
- */
2427
- export declare interface ToastParams {
2729
+ /** @internal */
2730
+ declare type ToastLayerElementType = 'ul' | ComponentType
2731
+
2732
+ /** @internal */
2733
+ declare type ToastLayerOwnProps = GapStyleProps & PaddingStyleProps
2734
+
2735
+ /** @internal */
2736
+ declare type ToastLayerProps<E extends ToastLayerElementType = ToastLayerElementType> = Props<
2737
+ ToastLayerOwnProps,
2738
+ E
2739
+ >
2740
+
2741
+ /** @public */
2742
+ export declare type ToastOwnProps = RadiusStyleProps & {
2428
2743
  closable?: boolean
2429
2744
  description?: ReactNode
2430
- duration?: number
2431
- id?: string
2432
2745
  onClose?: () => void
2433
2746
  title?: ReactNode
2434
2747
  status?: 'error' | 'warning' | 'success' | 'info'
2748
+ /** @deprecated */
2749
+ duration?: number
2750
+ /** @deprecated */
2751
+ updatedAt?: number
2435
2752
  }
2436
2753
 
2437
- /**
2438
- * @public
2439
- */
2440
- export declare interface ToastProps extends RadiusStyleProps {
2754
+ /** @public */
2755
+ export declare interface ToastParams {
2441
2756
  closable?: boolean
2442
2757
  description?: ReactNode
2758
+ duration?: number
2759
+ id?: string
2443
2760
  onClose?: () => void
2444
2761
  title?: ReactNode
2445
2762
  status?: 'error' | 'warning' | 'success' | 'info'
2446
- duration?: number
2447
- updatedAt?: number
2448
2763
  }
2449
2764
 
2450
- /**
2451
- * @public
2452
- */
2453
- export declare function ToastProvider(props: ToastProviderProps): React.JSX.Element
2765
+ /** @public */
2766
+ export declare type ToastProps<E extends ToastElementType = ToastElementType> = Props<
2767
+ ToastOwnProps,
2768
+ E
2769
+ >
2454
2770
 
2455
- export declare namespace ToastProvider {
2456
- var displayName: string
2457
- }
2771
+ /** @public */
2772
+ export declare function ToastProvider(props: ToastProviderProps): React.JSX.Element
2458
2773
 
2459
- /**
2460
- * @public
2461
- */
2774
+ /** @public */
2462
2775
  export declare interface ToastProviderProps extends Omit<ToastLayerProps, 'children'> {
2463
2776
  children?: React.ReactNode
2464
- zOffset?: number | number[]
2777
+ zOffset?: ResponsiveProp<number>
2465
2778
  }
2466
2779
 
2467
2780
  /**
@@ -2469,11 +2782,9 @@ export declare interface ToastProviderProps extends Omit<ToastLayerProps, 'child
2469
2782
  *
2470
2783
  * @public
2471
2784
  */
2472
- export declare const Tooltip: ForwardRefExoticComponent<
2473
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof TooltipProps> &
2474
- TooltipProps &
2475
- RefAttributes<HTMLDivElement>
2476
- >
2785
+ export declare function Tooltip<E extends TooltipElementType = typeof DEFAULT_TOOLTIP_ELEMENT>(
2786
+ props: TooltipProps<E>,
2787
+ ): JSX.Element
2477
2788
 
2478
2789
  /**
2479
2790
  * @beta
@@ -2500,10 +2811,6 @@ export declare function TooltipDelayGroupProvider(
2500
2811
  props: TooltipDelayGroupProviderProps,
2501
2812
  ): ReactElement
2502
2813
 
2503
- export declare namespace TooltipDelayGroupProvider {
2504
- var displayName: string
2505
- }
2506
-
2507
2814
  /**
2508
2815
  * @public
2509
2816
  * */
@@ -2521,55 +2828,59 @@ export declare interface TooltipDelayGroupProviderProps {
2521
2828
  delay: Delay
2522
2829
  }
2523
2830
 
2524
- /**
2525
- * @public
2526
- */
2527
- export declare interface TooltipProps
2528
- extends Omit<LayerProps, 'as'>,
2529
- RadiusStyleProps,
2530
- ShadowStyleProps {
2531
- /** @deprecated Use `fallbackPlacements` instead. */
2532
- allowedAutoPlacements?: Placement[]
2533
- /**
2534
- * Whether the tooltip should animate in and out.
2535
- *
2536
- * @beta
2537
- * @defaultValue false
2538
- */
2539
- animate?: boolean
2540
- arrow?: boolean
2541
- boundaryElement?: HTMLElement | null
2542
- children?: ReactElement<Props>
2543
- content?: ReactNode
2544
- /**
2545
- * Adds a delay to open or close the tooltip.
2546
- *
2547
- * If only a `number` is passed, it will be used for both opening and closing.
2548
- *
2549
- * If an object `{open: number; close:number}` is passed, it can be used to set different delays for each action.
2550
- *
2551
- * @public
2552
- * @defaultValue 0
2553
- */
2554
- delay?: Delay
2555
- disabled?: boolean
2556
- fallbackPlacements?: Placement[]
2557
- placement?: Placement
2558
- /** Whether or not to render the tooltip in a portal element. */
2559
- portal?: boolean | string
2560
- scheme?: ThemeColorSchemeKey_2
2561
- tone?: ThemeColorCardToneKey
2562
- }
2831
+ /** @public */
2832
+ export declare type TooltipElementType = 'div' | 'span' | ComponentType
2833
+
2834
+ /** @public */
2835
+ export declare type TooltipOwnProps = LayerOwnProps &
2836
+ RadiusStyleProps &
2837
+ ShadowStyleProps & {
2838
+ /** @deprecated Use `fallbackPlacements` instead. */
2839
+ allowedAutoPlacements?: Placement[]
2840
+ /**
2841
+ * Whether the tooltip should animate in and out.
2842
+ *
2843
+ * @beta
2844
+ * @defaultValue false
2845
+ */
2846
+ animate?: boolean
2847
+ arrow?: boolean
2848
+ boundaryElement?: HTMLElement | null
2849
+ children?: ReactElement<HTMLAttributes<HTMLElement> & RefAttributes<HTMLElement>>
2850
+ content?: ReactNode
2851
+ /**
2852
+ * Adds a delay to open or close the tooltip.
2853
+ *
2854
+ * If only a `number` is passed, it will be used for both opening and closing.
2855
+ *
2856
+ * If an object `{open: number; close:number}` is passed, it can be used to set different delays for each action.
2857
+ *
2858
+ * @public
2859
+ * @defaultValue 0
2860
+ */
2861
+ delay?: Delay
2862
+ disabled?: boolean
2863
+ fallbackPlacements?: Placement[]
2864
+ placement?: Placement
2865
+ /** Whether or not to render the tooltip in a portal element. */
2866
+ portal?: boolean | string
2867
+ scheme?: ThemeColorSchemeKey_2
2868
+ tone?: ThemeColorCardToneKey
2869
+ }
2870
+
2871
+ /** @public */
2872
+ export declare type TooltipProps<E extends TooltipElementType = TooltipElementType> = Props<
2873
+ TooltipOwnProps,
2874
+ E
2875
+ >
2563
2876
 
2564
2877
  /**
2565
2878
  * This API might change. DO NOT USE IN PRODUCTION.
2566
2879
  * @beta
2567
2880
  */
2568
- export declare const Tree: NamedExoticComponent<
2569
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof TreeProps> &
2570
- TreeProps &
2571
- RefAttributes<HTMLDivElement>
2572
- >
2881
+ export declare function Tree<E extends TreeElementType = typeof DEFAULT_TREE_ELEMENT>(
2882
+ props: TreeProps<E>,
2883
+ ): JSX.Element
2573
2884
 
2574
2885
  /**
2575
2886
  * @beta
@@ -2586,38 +2897,55 @@ export declare interface TreeContextValue {
2586
2897
  state: TreeState
2587
2898
  }
2588
2899
 
2900
+ /** @beta */
2901
+ export declare type TreeElementType = 'div' | ComponentType
2902
+
2589
2903
  /**
2590
2904
  * This API might change. DO NOT USE IN PRODUCTION.
2591
2905
  * @beta
2592
2906
  */
2593
- export declare const TreeItem: NamedExoticComponent<Omit<Props<TreeItemProps, 'div'>, 'as'>>
2907
+ export declare function TreeItem<E extends TreeItemElementType = typeof DEFAULT_TREE_ITEM_ELEMENT>(
2908
+ props: TreeItemProps<E>,
2909
+ ): JSX.Element
2594
2910
 
2595
- /**
2596
- * @beta
2597
- */
2598
- export declare interface TreeItemProps extends CardProps {
2911
+ /** @beta */
2912
+ export declare type TreeItemElementType = 'a' | 'li' | ComponentType
2913
+
2914
+ /** @beta */
2915
+ export declare type TreeItemOwnProps = CardOwnProps & {
2599
2916
  expanded?: boolean
2600
2917
  fontSize?: ResponsiveProp<FontTextSize>
2601
- icon?: ElementType
2918
+ icon?: ElementType_2
2602
2919
  /**
2603
2920
  * Allows passing a custom element type to the link component
2604
2921
  */
2605
- linkAs?: ElementType
2922
+ linkAs?: SelectableElementType
2923
+ onClick?: MouseEventHandler<HTMLAnchorElement | HTMLLIElement>
2606
2924
  padding?: ResponsiveProp<Space>
2607
2925
  space?: ResponsiveProp<Space>
2608
2926
  text?: ReactNode
2609
2927
  weight?: ThemeFontWeightKey_2
2610
2928
  }
2611
2929
 
2930
+ /** @beta */
2931
+ export declare type TreeItemProps<E extends TreeItemElementType = TreeItemElementType> = Props<
2932
+ TreeItemOwnProps,
2933
+ E
2934
+ >
2935
+
2612
2936
  /**
2613
2937
  * This API might change. DO NOT USE IN PRODUCTION.
2614
2938
  * @beta
2615
2939
  */
2616
- export declare interface TreeProps extends Pick<GapStyleProps, 'gap'> {
2940
+ export declare type TreeOwnProps = {
2941
+ gap?: ResponsiveProp<Space>
2617
2942
  /** @deprecated Use `gap` instead. */
2618
2943
  space?: ResponsiveProp<Space>
2619
2944
  }
2620
2945
 
2946
+ /** @beta */
2947
+ export declare type TreeProps<E extends TreeElementType = TreeElementType> = Props<TreeOwnProps, E>
2948
+
2621
2949
  /**
2622
2950
  * @beta
2623
2951
  */
@@ -2630,18 +2958,19 @@ export declare interface TreeState {
2630
2958
  | undefined
2631
2959
  }
2632
2960
 
2633
- /** @beta */
2634
2961
  /**
2635
2962
  * This API might change. DO NOT USE IN PRODUCTION.
2636
2963
  * @beta
2964
+ * @deprecated Use `useResponsiveProp` instead.
2637
2965
  */
2638
2966
  export declare function useArrayProp<T>(val: T | T[] | undefined, defaultVal?: T[]): T[]
2639
2967
 
2640
- /**
2641
- * @public
2642
- */
2968
+ /** @public */
2643
2969
  export declare function useBoundaryElement(): BoundaryElementContextValue
2644
2970
 
2971
+ /** @public */
2972
+ export declare function useCard(): CardContextValue | null
2973
+
2645
2974
  /**
2646
2975
  * @public
2647
2976
  * @deprecated replaced by the new `useClickOutsideEvent` hook, instead of:
@@ -2663,9 +2992,7 @@ export declare function useClickOutside(
2663
2992
  boundaryElement?: HTMLElement | null,
2664
2993
  ): (el: HTMLElement | null) => void
2665
2994
 
2666
- /**
2667
- * @public
2668
- */
2995
+ /** @public */
2669
2996
  export declare function useClickOutsideEvent(
2670
2997
  listener: ClickOutsideEventListener | false | undefined,
2671
2998
  elementsArg?: () => ClickOutsideEventElements,
@@ -2721,9 +3048,7 @@ export declare function useForwardedRef<T>(ref: ForwardedRef<T>): MutableRefObje
2721
3048
  */
2722
3049
  export declare function useGlobalKeyDown(onKeyDown: (event: KeyboardEvent) => void): void
2723
3050
 
2724
- /**
2725
- * @public
2726
- */
3051
+ /** @public */
2727
3052
  export declare function useLayer(): LayerContextValue
2728
3053
 
2729
3054
  /**
@@ -2742,11 +3067,9 @@ export declare function useMatchMedia(
2742
3067
  * This API might change. DO NOT USE IN PRODUCTION.
2743
3068
  * @beta
2744
3069
  */
2745
- export declare function useMediaIndex(): number
3070
+ export declare function useMediaIndex(): Breakpoint
2746
3071
 
2747
- /**
2748
- * @public
2749
- */
3072
+ /** @public */
2750
3073
  export declare function usePortal(): PortalContextValue
2751
3074
 
2752
3075
  /**
@@ -2776,23 +3099,24 @@ export declare function usePrefersDark(getServerSnapshot?: () => boolean): boole
2776
3099
  export declare function usePrefersReducedMotion(getServerSnapshot?: () => boolean): boolean
2777
3100
 
2778
3101
  /**
2779
- * @public
3102
+ * This API might change. DO NOT USE IN PRODUCTION.
3103
+ * @beta
2780
3104
  */
3105
+ export declare function useResponsiveProp<T>(
3106
+ val: ResponsiveProp<T> | undefined,
3107
+ defaultVal?: Partial<Record<Breakpoint, T>>,
3108
+ ): Partial<Record<Breakpoint, T>>
3109
+
3110
+ /** @public */
2781
3111
  export declare function useRootTheme(): ThemeContextValue
2782
3112
 
2783
- /**
2784
- * @public
2785
- */
3113
+ /** @public */
2786
3114
  export declare function useTheme(): Theme_2
2787
3115
 
2788
- /**
2789
- * @public
2790
- */
3116
+ /** @public */
2791
3117
  export declare function useTheme_v2(): Theme_v2
2792
3118
 
2793
- /**
2794
- * @public
2795
- */
3119
+ /** @public */
2796
3120
  export declare function useToast(): ToastContextValue
2797
3121
 
2798
3122
  /**
@@ -2805,18 +3129,12 @@ export declare function useTooltipDelayGroup(): TooltipDelayGroupContextValue |
2805
3129
  */
2806
3130
  export declare function useTree(): TreeContextValue
2807
3131
 
2808
- /**
2809
- * @beta
2810
- */
2811
- export declare const VirtualList: ForwardRefExoticComponent<
2812
- Omit<ElementProps_2<'div'> & PolymorphicProps_2, keyof VirtualListProps<any>> &
2813
- VirtualListProps<any> &
2814
- RefAttributes<HTMLDivElement>
2815
- >
3132
+ /** @beta */
3133
+ export declare function VirtualList<
3134
+ E extends VirtualListElementType = typeof DEFAULT_VIRTUAL_LIST_ELEMENT,
3135
+ >(props: VirtualListProps<E>): JSX.Element
2816
3136
 
2817
- /**
2818
- * @beta
2819
- */
3137
+ /** @beta */
2820
3138
  export declare interface VirtualListChangeOpts {
2821
3139
  fromIndex: number
2822
3140
  gap: number
@@ -2826,15 +3144,20 @@ export declare interface VirtualListChangeOpts {
2826
3144
  toIndex: number
2827
3145
  }
2828
3146
 
2829
- /**
2830
- * @beta
2831
- */
2832
- export declare interface VirtualListProps<Item = any> extends Omit<StackProps, 'gap'> {
2833
- gap?: number
3147
+ /** @beta */
3148
+ export declare type VirtualListElementType = 'div' | ComponentType
3149
+
3150
+ /** @beta */
3151
+ export declare type VirtualListOwnProps<Item = any> = {
3152
+ gap?: Space
2834
3153
  getItemKey?: (item: Item, itemIndex: number) => string
2835
3154
  items?: Item[]
2836
3155
  onChange?: (opts: VirtualListChangeOpts) => void
2837
3156
  renderItem?: (item: Item) => ReactNode
2838
3157
  }
2839
3158
 
3159
+ /** @beta */
3160
+ export declare type VirtualListProps<E extends VirtualListElementType = VirtualListElementType> =
3161
+ Props<VirtualListOwnProps, E>
3162
+
2840
3163
  export {}