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

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