@sanity/ui 3.1.13 → 4.0.0-beta.0

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 (957) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +7 -9
  3. package/dist/_chunks-es/Syntax.js +23 -0
  4. package/dist/_chunks-es/Syntax.js.map +1 -0
  5. package/dist/css/index.css +1 -0
  6. package/dist/css.d.ts +11 -0
  7. package/dist/css.js +7 -0
  8. package/dist/css.js.map +1 -0
  9. package/dist/index.d.ts +1352 -1848
  10. package/dist/index.js +4621 -1827
  11. package/dist/index.js.map +1 -1
  12. package/dist/tokens.d.ts +4 -0
  13. package/dist/tokens.js +2 -0
  14. package/dist/tokens.js.map +1 -0
  15. package/exports/css/index.css +1 -0
  16. package/exports/css.ts +2 -0
  17. package/exports/index.ts +117 -1
  18. package/exports/tokens.ts +2 -0
  19. package/package.json +86 -172
  20. package/src/components/autocomplete/Autocomplete.tsx +665 -0
  21. package/src/components/autocomplete/AutocompleteOption.tsx +42 -0
  22. package/src/components/autocomplete/__workshop__/Async.tsx +162 -0
  23. package/src/components/autocomplete/__workshop__/ConstrainedHeight.tsx +121 -0
  24. package/src/components/autocomplete/__workshop__/Custom.tsx +91 -0
  25. package/src/components/autocomplete/__workshop__/Example.tsx +71 -0
  26. package/src/components/autocomplete/__workshop__/FocusAndBlur.tsx +39 -0
  27. package/src/components/autocomplete/__workshop__/Fullscreen.tsx +307 -0
  28. package/src/components/autocomplete/__workshop__/index.ts +41 -0
  29. package/src/components/autocomplete/__workshop__/mock/apiStore.ts +49 -0
  30. package/src/components/autocomplete/__workshop__/mock/countries.ts +245 -0
  31. package/src/components/autocomplete/autocompleteReducer.ts +47 -0
  32. package/src/components/autocomplete/constants.ts +28 -0
  33. package/src/components/autocomplete/types.ts +103 -0
  34. package/src/components/breadcrumbs/Breadcrumbs.tsx +163 -0
  35. package/src/components/breadcrumbs/__workshop__/Example.tsx +49 -0
  36. package/src/components/breadcrumbs/__workshop__/index.ts +16 -0
  37. package/src/components/dialog/Dialog.tsx +230 -0
  38. package/src/components/dialog/DialogCard.tsx +233 -0
  39. package/src/components/dialog/DialogContext.ts +21 -0
  40. package/src/components/dialog/DialogProvider.tsx +34 -0
  41. package/src/components/dialog/__workshop__/Activate.tsx +141 -0
  42. package/src/components/dialog/__workshop__/AutoFocus.tsx +29 -0
  43. package/src/components/dialog/__workshop__/Layering.tsx +41 -0
  44. package/src/components/dialog/__workshop__/Nested.tsx +71 -0
  45. package/src/components/dialog/__workshop__/OnScroll.tsx +51 -0
  46. package/src/components/dialog/__workshop__/Panes.tsx +75 -0
  47. package/src/components/dialog/__workshop__/Position.tsx +30 -0
  48. package/src/components/dialog/__workshop__/Props.tsx +84 -0
  49. package/src/components/dialog/__workshop__/Provider.tsx +11 -0
  50. package/src/components/dialog/__workshop__/Wrapped.tsx +76 -0
  51. package/src/components/dialog/__workshop__/index.ts +21 -0
  52. package/src/components/dialog/isTargetWithinScope.ts +14 -0
  53. package/src/components/dialog/types.ts +2 -0
  54. package/src/components/dialog/useDialog.ts +11 -0
  55. package/src/components/hotkeys/Hotkeys.tsx +70 -0
  56. package/src/components/hotkeys/__workshop__/Plain.tsx +9 -0
  57. package/src/components/hotkeys/__workshop__/index.ts +16 -0
  58. package/src/components/menu/Menu.test.tsx +125 -0
  59. package/src/components/menu/Menu.tsx +174 -0
  60. package/src/components/menu/MenuButton.tsx +231 -0
  61. package/src/components/menu/MenuContext.ts +19 -0
  62. package/src/components/menu/MenuDivider.tsx +32 -0
  63. package/src/components/menu/MenuGroup.tsx +240 -0
  64. package/src/components/menu/MenuItem.tsx +153 -0
  65. package/src/components/menu/__workshop__/AsComponent.tsx +45 -0
  66. package/src/components/menu/__workshop__/AvatarMenu.tsx +36 -0
  67. package/src/components/menu/__workshop__/ClosableMenuButton.tsx +47 -0
  68. package/src/components/menu/__workshop__/ConstrainedInBoundary.tsx +133 -0
  69. package/src/components/menu/__workshop__/CustomMenuItem.tsx +47 -0
  70. package/src/components/menu/__workshop__/CustomSelectedState.tsx +35 -0
  71. package/src/components/menu/__workshop__/DataProps.tsx +28 -0
  72. package/src/components/menu/__workshop__/DisableFocusOnClose.tsx +40 -0
  73. package/src/components/menu/__workshop__/Groups.tsx +164 -0
  74. package/src/components/menu/__workshop__/MenuButton.tsx +79 -0
  75. package/src/components/menu/__workshop__/MenuGroupRight.tsx +73 -0
  76. package/src/components/menu/__workshop__/NestedMenu.tsx +22 -0
  77. package/src/components/menu/__workshop__/OnCloseMenuButton.tsx +50 -0
  78. package/src/components/menu/__workshop__/SelectedItem.tsx +69 -0
  79. package/src/components/menu/__workshop__/ShouldFocus.tsx +42 -0
  80. package/src/components/menu/__workshop__/Tones.tsx +20 -0
  81. package/src/components/menu/__workshop__/index.ts +91 -0
  82. package/src/components/menu/helpers.ts +82 -0
  83. package/src/components/menu/useMenu.ts +21 -0
  84. package/src/components/menu/useMenuController.ts +245 -0
  85. package/src/components/tab/Tab.tsx +135 -0
  86. package/src/components/tab/TabList.tsx +157 -0
  87. package/src/components/tab/TabListContext.ts +10 -0
  88. package/src/components/tab/TabPanel.tsx +94 -0
  89. package/src/components/tab/__workshop__/Example.tsx +135 -0
  90. package/src/components/tab/__workshop__/index.ts +16 -0
  91. package/src/components/tab/types.ts +11 -0
  92. package/src/components/toast/Toast.test.tsx +103 -0
  93. package/src/components/toast/Toast.tsx +191 -0
  94. package/src/components/toast/ToastContext.ts +7 -0
  95. package/src/components/toast/ToastLayer.tsx +54 -0
  96. package/src/components/toast/ToastProvider.tsx +127 -0
  97. package/src/components/toast/__workshop__/Hook.tsx +71 -0
  98. package/src/components/toast/__workshop__/Toast.tsx +26 -0
  99. package/src/components/toast/__workshop__/index.ts +21 -0
  100. package/src/components/toast/types.ts +24 -0
  101. package/src/components/toast/useToast.ts +23 -0
  102. package/src/components/tree/Tree.tsx +248 -0
  103. package/src/components/tree/TreeContext.ts +10 -0
  104. package/src/components/tree/TreeGroup.tsx +46 -0
  105. package/src/components/tree/TreeItem.tsx +236 -0
  106. package/src/components/tree/__workshop__/Basic.tsx +109 -0
  107. package/src/components/tree/__workshop__/TabFromElement.tsx +84 -0
  108. package/src/components/tree/__workshop__/basic.perf.ts +19 -0
  109. package/src/components/tree/__workshop__/index.ts +23 -0
  110. package/src/components/tree/helpers.ts +105 -0
  111. package/src/components/tree/types.ts +24 -0
  112. package/src/components/tree/useTree.ts +17 -0
  113. package/src/components/virtualList/VirtualList.tsx +254 -0
  114. package/src/components/virtualList/__workshop__/ChangingProps.tsx +41 -0
  115. package/src/components/virtualList/__workshop__/ElementScroll.tsx +43 -0
  116. package/src/components/virtualList/__workshop__/InfiniteList.tsx +40 -0
  117. package/src/components/virtualList/__workshop__/WindowScrolll.tsx +23 -0
  118. package/src/components/virtualList/__workshop__/index.ts +31 -0
  119. package/src/core/_keys.ts +26 -0
  120. package/src/core/constants.ts +4 -16
  121. package/src/core/getElementRef.ts +29 -0
  122. package/src/core/helpers/animation.ts +4 -5
  123. package/src/core/helpers/focus.ts +0 -8
  124. package/src/core/helpers/props.ts +51 -0
  125. package/src/core/lib/createGlobalScopedContext.ts +7 -4
  126. package/src/core/lib/globalScope.ts +1 -1
  127. package/src/core/lib/isArray.ts +3 -0
  128. package/src/core/types.ts +57 -0
  129. package/src/hooks/useClickOutsideEvent.test.tsx +114 -0
  130. package/src/hooks/useClickOutsideEvent.ts +66 -0
  131. package/src/hooks/useElementSize.ts +19 -0
  132. package/src/hooks/useGlobalKeyDown.ts +23 -0
  133. package/src/hooks/useMatchMedia.ts +28 -0
  134. package/src/hooks/useMediaIndex/__workshop__/Test.tsx +14 -0
  135. package/src/hooks/useMediaIndex/__workshop__/index.ts +16 -0
  136. package/src/hooks/useMediaIndex/useMediaIndex.test.tsx +21 -0
  137. package/src/hooks/useMediaIndex/useMediaIndex.ts +111 -0
  138. package/src/hooks/usePrefersDark.hydration.test.tsx +56 -0
  139. package/src/hooks/usePrefersDark.test.tsx +20 -0
  140. package/src/hooks/usePrefersDark.ts +16 -0
  141. package/src/hooks/usePrefersReducedMotion.hydration.test.tsx +56 -0
  142. package/src/hooks/usePrefersReducedMotion.test.tsx +20 -0
  143. package/src/hooks/usePrefersReducedMotion.ts +16 -0
  144. package/src/hooks/useResponsiveProp.ts +14 -0
  145. package/src/hooks/useUnique.ts +54 -0
  146. package/src/middleware/origin.ts +47 -0
  147. package/src/observers/elementSize.ts +114 -0
  148. package/src/primitives/_syntax/LazySyntax.tsx +4 -0
  149. package/src/primitives/_syntax/Syntax.tsx +26 -0
  150. package/src/primitives/avatar/Avatar.tsx +145 -0
  151. package/src/primitives/avatar/AvatarCounter.tsx +69 -0
  152. package/src/primitives/avatar/AvatarStack.tsx +77 -0
  153. package/src/primitives/avatar/__workshop__/AsButton.tsx +13 -0
  154. package/src/primitives/avatar/__workshop__/PropsStory.tsx +25 -0
  155. package/src/primitives/avatar/__workshop__/Stack.tsx +28 -0
  156. package/src/primitives/avatar/__workshop__/WithinButton.tsx +51 -0
  157. package/src/primitives/avatar/__workshop__/WithinMenuItem.tsx +52 -0
  158. package/src/primitives/avatar/__workshop__/index.ts +36 -0
  159. package/src/primitives/avatar/types.ts +2 -0
  160. package/src/primitives/badge/Badge.test.tsx +16 -0
  161. package/src/primitives/badge/Badge.tsx +53 -0
  162. package/src/primitives/badge/__workshop__/Props.tsx +28 -0
  163. package/src/primitives/badge/__workshop__/Tones.tsx +16 -0
  164. package/src/primitives/badge/__workshop__/index.ts +26 -0
  165. package/src/primitives/badge/__workshop__/within-button.tsx +36 -0
  166. package/src/primitives/box/Box.tsx +73 -0
  167. package/src/primitives/box/__workshop__/Props.tsx +26 -0
  168. package/src/primitives/box/__workshop__/Responsive.tsx +20 -0
  169. package/src/primitives/box/__workshop__/index.ts +21 -0
  170. package/src/primitives/button/Button.test.tsx +30 -0
  171. package/src/primitives/button/Button.tsx +145 -0
  172. package/src/primitives/button/__workshop__/Custom.tsx +29 -0
  173. package/src/primitives/button/__workshop__/CustomIcons.tsx +38 -0
  174. package/src/primitives/button/__workshop__/DataProps.tsx +19 -0
  175. package/src/primitives/button/__workshop__/Disabled.tsx +43 -0
  176. package/src/primitives/button/__workshop__/MixedChildren.tsx +12 -0
  177. package/src/primitives/button/__workshop__/Props.tsx +60 -0
  178. package/src/primitives/button/__workshop__/Stacked.tsx +51 -0
  179. package/src/primitives/button/__workshop__/Styled1.css.ts +7 -0
  180. package/src/primitives/button/__workshop__/Styled1.tsx +11 -0
  181. package/src/primitives/button/__workshop__/TextOverflow.tsx +17 -0
  182. package/src/primitives/button/__workshop__/UploadButton.tsx +28 -0
  183. package/src/primitives/button/__workshop__/index.ts +61 -0
  184. package/src/primitives/button/types.ts +2 -0
  185. package/src/primitives/card/Card.tsx +124 -0
  186. package/src/primitives/card/CardContext.ts +10 -0
  187. package/src/primitives/card/CardInternalContext.ts +10 -0
  188. package/src/primitives/card/CardInternalProvider.tsx +15 -0
  189. package/src/primitives/card/CardProvider.tsx +16 -0
  190. package/src/primitives/card/__workshop__/AsButton.tsx +104 -0
  191. package/src/primitives/card/__workshop__/AsComponent.tsx +25 -0
  192. package/src/primitives/card/__workshop__/Checkered.tsx +26 -0
  193. package/src/primitives/card/__workshop__/DataProps.tsx +25 -0
  194. package/src/primitives/card/__workshop__/Interactive.tsx +29 -0
  195. package/src/primitives/card/__workshop__/ListNavigation.tsx +78 -0
  196. package/src/primitives/card/__workshop__/Props.tsx +49 -0
  197. package/src/primitives/card/__workshop__/Selected.tsx +62 -0
  198. package/src/primitives/card/__workshop__/Styled.tsx +11 -0
  199. package/src/primitives/card/__workshop__/Tones.tsx +27 -0
  200. package/src/primitives/card/__workshop__/index.ts +21 -0
  201. package/src/primitives/card/types.ts +21 -0
  202. package/src/primitives/card/useCard.ts +20 -0
  203. package/src/primitives/checkbox/Checkbox.tsx +80 -0
  204. package/src/primitives/checkbox/__workshop__/Example.tsx +25 -0
  205. package/src/primitives/checkbox/__workshop__/Props.tsx +35 -0
  206. package/src/primitives/checkbox/__workshop__/ReadOnly.tsx +16 -0
  207. package/src/primitives/checkbox/__workshop__/Tones.tsx +27 -0
  208. package/src/primitives/checkbox/__workshop__/index.ts +15 -0
  209. package/src/primitives/code/Code.tsx +47 -0
  210. package/src/primitives/code/__workshop__/OpticalAlignment.tsx +26 -0
  211. package/src/primitives/code/__workshop__/Props.tsx +19 -0
  212. package/src/primitives/code/__workshop__/index.ts +21 -0
  213. package/src/primitives/container/Container.tsx +43 -0
  214. package/src/primitives/container/__workshop__/Example.tsx +17 -0
  215. package/src/primitives/container/__workshop__/index.ts +16 -0
  216. package/src/primitives/flex/Flex.tsx +38 -0
  217. package/src/primitives/flex/__workshop__/Example.tsx +26 -0
  218. package/src/primitives/flex/__workshop__/Gap.tsx +25 -0
  219. package/src/primitives/flex/__workshop__/index.ts +13 -0
  220. package/src/primitives/flex/__workshop__/styles.css.ts +12 -0
  221. package/src/primitives/grid/Grid.tsx +38 -0
  222. package/src/primitives/grid/__workshop__/Responsive.tsx +54 -0
  223. package/src/primitives/grid/__workshop__/index.ts +12 -0
  224. package/src/primitives/heading/Heading.tsx +68 -0
  225. package/src/primitives/heading/__workshop__/OpticalAlignment.tsx +28 -0
  226. package/src/primitives/heading/__workshop__/Plain.tsx +26 -0
  227. package/src/primitives/heading/__workshop__/index.ts +21 -0
  228. package/src/primitives/inline/Inline.tsx +37 -0
  229. package/src/primitives/inline/__workshop__/Plain.tsx +23 -0
  230. package/src/primitives/inline/__workshop__/index.ts +10 -0
  231. package/src/primitives/kbd/Kbd.tsx +36 -0
  232. package/src/primitives/kbd/__workshop__/Plain.tsx +9 -0
  233. package/src/primitives/kbd/__workshop__/index.ts +10 -0
  234. package/src/primitives/label/Label.tsx +67 -0
  235. package/src/primitives/label/__workshop__/OpticalAlignment.tsx +28 -0
  236. package/src/primitives/label/__workshop__/Plain.tsx +28 -0
  237. package/src/primitives/label/__workshop__/index.ts +21 -0
  238. package/src/primitives/layer/Layer.test.tsx +110 -0
  239. package/src/primitives/layer/Layer.tsx +35 -0
  240. package/src/primitives/layer/LayerCard.tsx +90 -0
  241. package/src/primitives/layer/LayerContext.ts +7 -0
  242. package/src/primitives/layer/LayerProvider.tsx +106 -0
  243. package/src/primitives/layer/__workshop__/MultipleRoots.tsx +49 -0
  244. package/src/primitives/layer/__workshop__/Nested.tsx +107 -0
  245. package/src/primitives/layer/__workshop__/ResponsiveZOffset.tsx +17 -0
  246. package/src/primitives/layer/__workshop__/_debug.tsx +17 -0
  247. package/src/primitives/layer/__workshop__/index.ts +26 -0
  248. package/src/primitives/layer/getLayerContext.test.ts +32 -0
  249. package/src/primitives/layer/getLayerContext.ts +21 -0
  250. package/src/primitives/layer/useLayer.ts +24 -0
  251. package/src/primitives/popover/Popover.tsx +291 -0
  252. package/src/primitives/popover/PopoverLayer.tsx +101 -0
  253. package/src/primitives/popover/__workshop__/AlignedStory.tsx +76 -0
  254. package/src/primitives/popover/__workshop__/MarginsStory.tsx +31 -0
  255. package/src/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +32 -0
  256. package/src/primitives/popover/__workshop__/OpenOnMountStory.tsx +11 -0
  257. package/src/primitives/popover/__workshop__/PlainStory.tsx +68 -0
  258. package/src/primitives/popover/__workshop__/RecursiveStory.tsx +71 -0
  259. package/src/primitives/popover/__workshop__/SidePanelStory.tsx +94 -0
  260. package/src/primitives/popover/__workshop__/TestStory.tsx +97 -0
  261. package/src/primitives/popover/__workshop__/index.ts +56 -0
  262. package/src/primitives/popover/__workshop__/portal-inheritance.tsx +15 -0
  263. package/src/primitives/popover/constants.ts +20 -0
  264. package/src/primitives/popover/floating-ui/size.ts +75 -0
  265. package/src/primitives/popover/types.ts +12 -0
  266. package/src/primitives/popover/useMiddleware.ts +126 -0
  267. package/src/primitives/radio/Radio.tsx +64 -0
  268. package/src/primitives/radio/__workshop__/Example.tsx +63 -0
  269. package/src/primitives/radio/__workshop__/Plain.tsx +28 -0
  270. package/src/primitives/radio/__workshop__/index.ts +13 -0
  271. package/src/primitives/select/Select.tsx +76 -0
  272. package/src/primitives/select/__workshop__/Plain.tsx +38 -0
  273. package/src/primitives/select/__workshop__/ReadOnly.tsx +23 -0
  274. package/src/primitives/select/__workshop__/index.ts +13 -0
  275. package/src/primitives/selectable/Selectable.tsx +48 -0
  276. package/src/primitives/selectable/__workshop__/DataProps.tsx +24 -0
  277. package/src/primitives/selectable/__workshop__/as-link.tsx +13 -0
  278. package/src/primitives/selectable/__workshop__/index.ts +19 -0
  279. package/src/primitives/skeleton/CodeSkeleton.tsx +49 -0
  280. package/src/primitives/skeleton/HeadingSkeleton.tsx +48 -0
  281. package/src/primitives/skeleton/LabelSkeleton.tsx +47 -0
  282. package/src/primitives/skeleton/Skeleton.tsx +70 -0
  283. package/src/primitives/skeleton/TextSkeleton.tsx +49 -0
  284. package/src/primitives/skeleton/__workshop__/Delay.tsx +69 -0
  285. package/src/primitives/skeleton/__workshop__/Skeleton.tsx +63 -0
  286. package/src/primitives/skeleton/__workshop__/index.ts +13 -0
  287. package/src/primitives/spinner/Spinner.tsx +45 -0
  288. package/src/primitives/spinner/SpinnerAnimatedIcon.tsx +14 -0
  289. package/src/primitives/spinner/__workshop__/Props.tsx +14 -0
  290. package/src/primitives/spinner/__workshop__/index.ts +16 -0
  291. package/src/primitives/srOnly/SrOnly.tsx +33 -0
  292. package/src/primitives/stack/Stack.tsx +38 -0
  293. package/src/primitives/stack/__workshop__/Plain.tsx +31 -0
  294. package/src/primitives/stack/__workshop__/index.ts +16 -0
  295. package/src/primitives/switch/Switch.tsx +76 -0
  296. package/src/primitives/switch/__workshop__/Example.tsx +25 -0
  297. package/src/primitives/switch/__workshop__/Props.tsx +23 -0
  298. package/src/primitives/switch/__workshop__/index.ts +13 -0
  299. package/src/primitives/text/InlineCode.tsx +25 -0
  300. package/src/primitives/text/Text.tsx +68 -0
  301. package/src/primitives/text/__workshop__/Example.tsx +27 -0
  302. package/src/primitives/text/__workshop__/OpticalAlignment.tsx +28 -0
  303. package/src/primitives/text/__workshop__/index.ts +26 -0
  304. package/src/primitives/text/__workshop__/inline-code.tsx +13 -0
  305. package/src/primitives/textArea/TextArea.tsx +97 -0
  306. package/src/primitives/textArea/__workshop__/Plain.tsx +47 -0
  307. package/src/primitives/textArea/__workshop__/index.ts +16 -0
  308. package/src/primitives/textInput/TextInput.tsx +279 -0
  309. package/src/primitives/textInput/__workshop__/ClearButton.tsx +32 -0
  310. package/src/primitives/textInput/__workshop__/CustomValidity.tsx +17 -0
  311. package/src/primitives/textInput/__workshop__/Plain.tsx +103 -0
  312. package/src/primitives/textInput/__workshop__/ReadOnly.tsx +14 -0
  313. package/src/primitives/textInput/__workshop__/States.tsx +53 -0
  314. package/src/primitives/textInput/__workshop__/Tones.tsx +41 -0
  315. package/src/primitives/textInput/__workshop__/Typed.tsx +23 -0
  316. package/src/primitives/textInput/__workshop__/index.ts +46 -0
  317. package/src/primitives/tooltip/Tooltip.test.tsx +496 -0
  318. package/src/primitives/tooltip/Tooltip.tsx +546 -0
  319. package/src/primitives/tooltip/TooltipLayer.tsx +72 -0
  320. package/src/primitives/tooltip/__workshop__/CustomPortal.tsx +102 -0
  321. package/src/primitives/tooltip/__workshop__/OverflowingBoundary.tsx +74 -0
  322. package/src/primitives/tooltip/__workshop__/Props.tsx +99 -0
  323. package/src/primitives/tooltip/__workshop__/ResizableBoundary.tsx +91 -0
  324. package/src/primitives/tooltip/__workshop__/index.ts +31 -0
  325. package/src/primitives/tooltip/constants.ts +24 -0
  326. package/src/primitives/tooltip/tooltipDelayGroup/TooltipDelayGroupContext.tsx +13 -0
  327. package/src/primitives/tooltip/tooltipDelayGroup/TooltipDelayGroupProvider.tsx +96 -0
  328. package/src/primitives/tooltip/tooltipDelayGroup/types.ts +7 -0
  329. package/src/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +13 -0
  330. package/src/root/Root.tsx +93 -0
  331. package/src/root/RootProvider.tsx +37 -0
  332. package/src/root/__workshop__/Boundary.tsx +43 -0
  333. package/src/root/__workshop__/index.ts +24 -0
  334. package/src/root/__workshop__/primitives.tsx +49 -0
  335. package/src/root/__workshop__/tone-inheritance.tsx +65 -0
  336. package/src/utils/ErrorBoundary.tsx +50 -0
  337. package/src/utils/boundaryElement/BoundaryElementContext.ts +7 -0
  338. package/src/utils/boundaryElement/BoundaryElementProvider.tsx +16 -0
  339. package/src/utils/boundaryElement/__workshop__/Plain.tsx +49 -0
  340. package/src/utils/boundaryElement/__workshop__/index.ts +16 -0
  341. package/src/utils/boundaryElement/types.ts +2 -0
  342. package/src/utils/boundaryElement/useBoundaryElement.ts +12 -0
  343. package/src/utils/elementQuery/ElementQuery.tsx +75 -0
  344. package/src/utils/elementQuery/__workshop__/CustomMedia.tsx +19 -0
  345. package/src/utils/elementQuery/__workshop__/index.ts +16 -0
  346. package/src/utils/elementQuery/__workshop__/styles.css.ts +31 -0
  347. package/src/utils/portal/Portal.test.tsx +105 -0
  348. package/src/utils/portal/Portal.tsx +42 -0
  349. package/src/utils/portal/PortalContext.ts +37 -0
  350. package/src/utils/portal/PortalProvider.tsx +38 -0
  351. package/src/utils/portal/__workshop__/Named.tsx +69 -0
  352. package/src/utils/portal/__workshop__/index.ts +16 -0
  353. package/src/utils/portal/types.ts +7 -0
  354. package/src/utils/portal/usePortal.ts +30 -0
  355. package/dist/_chunks-cjs/_visual-editing.js +0 -5864
  356. package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
  357. package/dist/_chunks-cjs/refractor.js +0 -23
  358. package/dist/_chunks-cjs/refractor.js.map +0 -1
  359. package/dist/_chunks-es/_visual-editing.mjs +0 -5870
  360. package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
  361. package/dist/_chunks-es/refractor.mjs +0 -26
  362. package/dist/_chunks-es/refractor.mjs.map +0 -1
  363. package/dist/_visual-editing.d.mts +0 -1007
  364. package/dist/_visual-editing.d.ts +0 -1007
  365. package/dist/_visual-editing.js +0 -31
  366. package/dist/_visual-editing.js.map +0 -1
  367. package/dist/_visual-editing.mjs +0 -31
  368. package/dist/_visual-editing.mjs.map +0 -1
  369. package/dist/index.d.mts +0 -2972
  370. package/dist/index.mjs +0 -2041
  371. package/dist/index.mjs.map +0 -1
  372. package/dist/theme.d.mts +0 -1500
  373. package/dist/theme.d.ts +0 -1500
  374. package/dist/theme.js +0 -4127
  375. package/dist/theme.js.map +0 -1
  376. package/dist/theme.mjs +0 -4127
  377. package/dist/theme.mjs.map +0 -1
  378. package/exports/_visual-editing.ts +0 -31
  379. package/exports/theme.ts +0 -1
  380. package/src/core/__workshop__/constants.ts +0 -293
  381. package/src/core/_compat.ts +0 -264
  382. package/src/core/components/autocomplete/__mocks__/apiStore.ts +0 -49
  383. package/src/core/components/autocomplete/__mocks__/countries.ts +0 -245
  384. package/src/core/components/autocomplete/__workshop__/async.tsx +0 -156
  385. package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +0 -137
  386. package/src/core/components/autocomplete/__workshop__/custom.tsx +0 -89
  387. package/src/core/components/autocomplete/__workshop__/example.tsx +0 -79
  388. package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +0 -36
  389. package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +0 -294
  390. package/src/core/components/autocomplete/__workshop__/index.ts +0 -39
  391. package/src/core/components/autocomplete/autocomplete.styles.tsx +0 -39
  392. package/src/core/components/autocomplete/autocomplete.tsx +0 -767
  393. package/src/core/components/autocomplete/autocompleteOption.tsx +0 -45
  394. package/src/core/components/autocomplete/autocompleteReducer.ts +0 -47
  395. package/src/core/components/autocomplete/constants.ts +0 -28
  396. package/src/core/components/autocomplete/index.ts +0 -2
  397. package/src/core/components/autocomplete/types.ts +0 -108
  398. package/src/core/components/breadcrumbs/__workshop__/example.tsx +0 -62
  399. package/src/core/components/breadcrumbs/__workshop__/index.ts +0 -14
  400. package/src/core/components/breadcrumbs/breadcrumbs.styles.ts +0 -18
  401. package/src/core/components/breadcrumbs/breadcrumbs.tsx +0 -129
  402. package/src/core/components/breadcrumbs/index.ts +0 -1
  403. package/src/core/components/dialog/__workshop__/activate.tsx +0 -134
  404. package/src/core/components/dialog/__workshop__/autoFocus.tsx +0 -29
  405. package/src/core/components/dialog/__workshop__/index.ts +0 -19
  406. package/src/core/components/dialog/__workshop__/layering.tsx +0 -41
  407. package/src/core/components/dialog/__workshop__/nested.tsx +0 -72
  408. package/src/core/components/dialog/__workshop__/onScroll.tsx +0 -39
  409. package/src/core/components/dialog/__workshop__/panes.tsx +0 -82
  410. package/src/core/components/dialog/__workshop__/position.tsx +0 -30
  411. package/src/core/components/dialog/__workshop__/props.tsx +0 -75
  412. package/src/core/components/dialog/__workshop__/provider.tsx +0 -11
  413. package/src/core/components/dialog/__workshop__/wrapped.tsx +0 -76
  414. package/src/core/components/dialog/dialog.tsx +0 -430
  415. package/src/core/components/dialog/dialogContext.ts +0 -20
  416. package/src/core/components/dialog/dialogProvider.tsx +0 -35
  417. package/src/core/components/dialog/index.ts +0 -4
  418. package/src/core/components/dialog/styles.ts +0 -77
  419. package/src/core/components/dialog/useDialog.ts +0 -11
  420. package/src/core/components/hotkeys/__workshop__/index.ts +0 -14
  421. package/src/core/components/hotkeys/__workshop__/plain.tsx +0 -9
  422. package/src/core/components/hotkeys/hotkeys.tsx +0 -62
  423. package/src/core/components/hotkeys/index.ts +0 -1
  424. package/src/core/components/index.ts +0 -9
  425. package/src/core/components/menu/__workshop__/asComponent.tsx +0 -45
  426. package/src/core/components/menu/__workshop__/avatarMenu.tsx +0 -51
  427. package/src/core/components/menu/__workshop__/closableMenuButton.tsx +0 -46
  428. package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +0 -134
  429. package/src/core/components/menu/__workshop__/customMenuItem.tsx +0 -45
  430. package/src/core/components/menu/__workshop__/customSelectedState.tsx +0 -39
  431. package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +0 -40
  432. package/src/core/components/menu/__workshop__/groups.tsx +0 -156
  433. package/src/core/components/menu/__workshop__/index.ts +0 -89
  434. package/src/core/components/menu/__workshop__/menuButton.tsx +0 -80
  435. package/src/core/components/menu/__workshop__/menuGroupRight.tsx +0 -65
  436. package/src/core/components/menu/__workshop__/nestedMenu.tsx +0 -22
  437. package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +0 -41
  438. package/src/core/components/menu/__workshop__/selectedItem.tsx +0 -69
  439. package/src/core/components/menu/__workshop__/shouldFocus.tsx +0 -47
  440. package/src/core/components/menu/__workshop__/tones.tsx +0 -25
  441. package/src/core/components/menu/__workshop__/withoutArrow.tsx +0 -32
  442. package/src/core/components/menu/helpers.ts +0 -82
  443. package/src/core/components/menu/index.ts +0 -5
  444. package/src/core/components/menu/menu.test.tsx +0 -125
  445. package/src/core/components/menu/menu.tsx +0 -172
  446. package/src/core/components/menu/menuButton.tsx +0 -268
  447. package/src/core/components/menu/menuContext.ts +0 -18
  448. package/src/core/components/menu/menuDivider.ts +0 -12
  449. package/src/core/components/menu/menuGroup.tsx +0 -219
  450. package/src/core/components/menu/menuItem.tsx +0 -180
  451. package/src/core/components/menu/useMenu.ts +0 -21
  452. package/src/core/components/menu/useMenuController.ts +0 -231
  453. package/src/core/components/skeleton/__workshop__/delay.tsx +0 -70
  454. package/src/core/components/skeleton/__workshop__/index.ts +0 -11
  455. package/src/core/components/skeleton/__workshop__/skeleton.tsx +0 -64
  456. package/src/core/components/skeleton/index.ts +0 -2
  457. package/src/core/components/skeleton/skeleton.tsx +0 -57
  458. package/src/core/components/skeleton/styles.ts +0 -50
  459. package/src/core/components/skeleton/textSkeleton.tsx +0 -122
  460. package/src/core/components/tab/__workshop__/example.tsx +0 -79
  461. package/src/core/components/tab/__workshop__/index.ts +0 -14
  462. package/src/core/components/tab/index.ts +0 -3
  463. package/src/core/components/tab/tab.tsx +0 -101
  464. package/src/core/components/tab/tabList.tsx +0 -70
  465. package/src/core/components/tab/tabPanel.tsx +0 -39
  466. package/src/core/components/toast/__workshop__/hook.tsx +0 -71
  467. package/src/core/components/toast/__workshop__/index.ts +0 -19
  468. package/src/core/components/toast/__workshop__/toast.tsx +0 -26
  469. package/src/core/components/toast/index.ts +0 -4
  470. package/src/core/components/toast/styles.ts +0 -77
  471. package/src/core/components/toast/toast.test.tsx +0 -101
  472. package/src/core/components/toast/toast.tsx +0 -198
  473. package/src/core/components/toast/toastContext.ts +0 -7
  474. package/src/core/components/toast/toastLayer.tsx +0 -51
  475. package/src/core/components/toast/toastProvider.tsx +0 -113
  476. package/src/core/components/toast/types.ts +0 -26
  477. package/src/core/components/toast/useToast.ts +0 -25
  478. package/src/core/components/tree/__workshop__/basic.perf.ts +0 -19
  479. package/src/core/components/tree/__workshop__/basic.tsx +0 -105
  480. package/src/core/components/tree/__workshop__/index.ts +0 -21
  481. package/src/core/components/tree/__workshop__/tabFromElement.tsx +0 -84
  482. package/src/core/components/tree/helpers.ts +0 -105
  483. package/src/core/components/tree/index.ts +0 -4
  484. package/src/core/components/tree/style.ts +0 -105
  485. package/src/core/components/tree/tree.tsx +0 -231
  486. package/src/core/components/tree/treeContext.ts +0 -10
  487. package/src/core/components/tree/treeGroup.tsx +0 -28
  488. package/src/core/components/tree/treeItem.tsx +0 -217
  489. package/src/core/components/tree/types.ts +0 -21
  490. package/src/core/components/tree/useTree.ts +0 -17
  491. package/src/core/helpers/index.ts +0 -4
  492. package/src/core/hooks/index.ts +0 -12
  493. package/src/core/hooks/useArrayProp.ts +0 -17
  494. package/src/core/hooks/useClickOutside.test.tsx +0 -482
  495. package/src/core/hooks/useClickOutside.ts +0 -118
  496. package/src/core/hooks/useClickOutsideEvent.test.tsx +0 -115
  497. package/src/core/hooks/useClickOutsideEvent.ts +0 -73
  498. package/src/core/hooks/useDelayed.test.ts +0 -68
  499. package/src/core/hooks/useDelayedState.ts +0 -28
  500. package/src/core/hooks/useElementRect/__workshop__/example.tsx +0 -32
  501. package/src/core/hooks/useElementRect/__workshop__/index.ts +0 -14
  502. package/src/core/hooks/useElementRect/index.ts +0 -1
  503. package/src/core/hooks/useElementRect/useElementRect.ts +0 -13
  504. package/src/core/hooks/useElementSize.ts +0 -19
  505. package/src/core/hooks/useForwardedRef.ts +0 -19
  506. package/src/core/hooks/useGlobalKeyDown.ts +0 -24
  507. package/src/core/hooks/useIsomorphicEffect.ts +0 -7
  508. package/src/core/hooks/useMatchMedia.ts +0 -28
  509. package/src/core/hooks/useMediaIndex/__workshop__/index.ts +0 -14
  510. package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +0 -14
  511. package/src/core/hooks/useMediaIndex/index.ts +0 -1
  512. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +0 -36
  513. package/src/core/hooks/useMediaIndex/useMediaIndex.ts +0 -102
  514. package/src/core/hooks/usePrefersDark.hydration.test.tsx +0 -56
  515. package/src/core/hooks/usePrefersDark.test.tsx +0 -19
  516. package/src/core/hooks/usePrefersDark.ts +0 -16
  517. package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +0 -56
  518. package/src/core/hooks/usePrefersReducedMotion.test.tsx +0 -19
  519. package/src/core/hooks/usePrefersReducedMotion.ts +0 -16
  520. package/src/core/index.ts +0 -10
  521. package/src/core/middleware/origin.ts +0 -47
  522. package/src/core/observers/elementSizeObserver.ts +0 -116
  523. package/src/core/observers/index.ts +0 -2
  524. package/src/core/observers/resizeObserver.ts +0 -9
  525. package/src/core/primitives/_selectable/index.ts +0 -1
  526. package/src/core/primitives/_selectable/selectable.tsx +0 -15
  527. package/src/core/primitives/_selectable/style.ts +0 -115
  528. package/src/core/primitives/avatar/__workshop__/asButton.tsx +0 -14
  529. package/src/core/primitives/avatar/__workshop__/index.ts +0 -29
  530. package/src/core/primitives/avatar/__workshop__/stack.tsx +0 -25
  531. package/src/core/primitives/avatar/__workshop__/withinButton.tsx +0 -63
  532. package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +0 -70
  533. package/src/core/primitives/avatar/avatar.tsx +0 -192
  534. package/src/core/primitives/avatar/avatarCounter.tsx +0 -91
  535. package/src/core/primitives/avatar/avatarStack.tsx +0 -100
  536. package/src/core/primitives/avatar/index.ts +0 -4
  537. package/src/core/primitives/avatar/styles.ts +0 -167
  538. package/src/core/primitives/avatar/types.ts +0 -17
  539. package/src/core/primitives/badge/__workshop__/index.ts +0 -19
  540. package/src/core/primitives/badge/__workshop__/props.tsx +0 -30
  541. package/src/core/primitives/badge/__workshop__/tones.tsx +0 -21
  542. package/src/core/primitives/badge/badge.test.tsx +0 -16
  543. package/src/core/primitives/badge/badge.tsx +0 -62
  544. package/src/core/primitives/badge/index.ts +0 -1
  545. package/src/core/primitives/badge/styles.ts +0 -20
  546. package/src/core/primitives/badge/types.ts +0 -8
  547. package/src/core/primitives/box/__workshop__/index.ts +0 -19
  548. package/src/core/primitives/box/__workshop__/props.tsx +0 -20
  549. package/src/core/primitives/box/__workshop__/responsive.tsx +0 -20
  550. package/src/core/primitives/box/box.tsx +0 -131
  551. package/src/core/primitives/box/index.ts +0 -1
  552. package/src/core/primitives/button/__workshop__/custom.tsx +0 -51
  553. package/src/core/primitives/button/__workshop__/customIcons.tsx +0 -30
  554. package/src/core/primitives/button/__workshop__/disabled.tsx +0 -74
  555. package/src/core/primitives/button/__workshop__/index.ts +0 -59
  556. package/src/core/primitives/button/__workshop__/mixedChildren.tsx +0 -12
  557. package/src/core/primitives/button/__workshop__/props.tsx +0 -55
  558. package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +0 -36
  559. package/src/core/primitives/button/__workshop__/stacked.tsx +0 -58
  560. package/src/core/primitives/button/__workshop__/styled1.tsx +0 -17
  561. package/src/core/primitives/button/__workshop__/styled2.tsx +0 -19
  562. package/src/core/primitives/button/__workshop__/uploadButton.tsx +0 -28
  563. package/src/core/primitives/button/button.test.tsx +0 -44
  564. package/src/core/primitives/button/button.tsx +0 -186
  565. package/src/core/primitives/button/index.ts +0 -1
  566. package/src/core/primitives/button/styles.ts +0 -117
  567. package/src/core/primitives/card/__workshop__/allTones.tsx +0 -25
  568. package/src/core/primitives/card/__workshop__/asButton.tsx +0 -107
  569. package/src/core/primitives/card/__workshop__/asComponent.tsx +0 -27
  570. package/src/core/primitives/card/__workshop__/checkered.tsx +0 -26
  571. package/src/core/primitives/card/__workshop__/index.ts +0 -18
  572. package/src/core/primitives/card/__workshop__/interactive.tsx +0 -30
  573. package/src/core/primitives/card/__workshop__/listNavigation.tsx +0 -80
  574. package/src/core/primitives/card/__workshop__/props.tsx +0 -53
  575. package/src/core/primitives/card/__workshop__/selected.tsx +0 -94
  576. package/src/core/primitives/card/__workshop__/styled.tsx +0 -14
  577. package/src/core/primitives/card/card.tsx +0 -117
  578. package/src/core/primitives/card/index.ts +0 -2
  579. package/src/core/primitives/card/styles.ts +0 -147
  580. package/src/core/primitives/card/types.ts +0 -11
  581. package/src/core/primitives/checkbox/__workshop__/example.tsx +0 -25
  582. package/src/core/primitives/checkbox/__workshop__/index.ts +0 -13
  583. package/src/core/primitives/checkbox/__workshop__/props.tsx +0 -33
  584. package/src/core/primitives/checkbox/__workshop__/readOnly.tsx +0 -16
  585. package/src/core/primitives/checkbox/__workshop__/tones.tsx +0 -28
  586. package/src/core/primitives/checkbox/checkbox.tsx +0 -73
  587. package/src/core/primitives/checkbox/index.ts +0 -1
  588. package/src/core/primitives/checkbox/styles.ts +0 -128
  589. package/src/core/primitives/code/__workshop__/index.ts +0 -19
  590. package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +0 -48
  591. package/src/core/primitives/code/__workshop__/props.tsx +0 -21
  592. package/src/core/primitives/code/code.tsx +0 -46
  593. package/src/core/primitives/code/index.ts +0 -1
  594. package/src/core/primitives/code/refractor.tsx +0 -20
  595. package/src/core/primitives/code/styles.ts +0 -77
  596. package/src/core/primitives/container/__workshop__/example.tsx +0 -20
  597. package/src/core/primitives/container/__workshop__/index.ts +0 -8
  598. package/src/core/primitives/container/container.tsx +0 -41
  599. package/src/core/primitives/container/index.ts +0 -2
  600. package/src/core/primitives/container/styles.ts +0 -23
  601. package/src/core/primitives/flex/__workshop__/example.tsx +0 -34
  602. package/src/core/primitives/flex/__workshop__/gap.tsx +0 -25
  603. package/src/core/primitives/flex/__workshop__/index.ts +0 -11
  604. package/src/core/primitives/flex/flex.tsx +0 -54
  605. package/src/core/primitives/flex/index.ts +0 -1
  606. package/src/core/primitives/grid/__workshop__/index.ts +0 -10
  607. package/src/core/primitives/grid/__workshop__/responsive.tsx +0 -54
  608. package/src/core/primitives/grid/grid.tsx +0 -48
  609. package/src/core/primitives/grid/index.ts +0 -1
  610. package/src/core/primitives/heading/__workshop__/index.ts +0 -19
  611. package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +0 -54
  612. package/src/core/primitives/heading/__workshop__/plain.tsx +0 -32
  613. package/src/core/primitives/heading/heading.tsx +0 -80
  614. package/src/core/primitives/heading/index.ts +0 -1
  615. package/src/core/primitives/heading/styles.ts +0 -64
  616. package/src/core/primitives/heading/types.ts +0 -7
  617. package/src/core/primitives/index.ts +0 -27
  618. package/src/core/primitives/inline/__workshop__/index.ts +0 -8
  619. package/src/core/primitives/inline/__workshop__/plain.tsx +0 -27
  620. package/src/core/primitives/inline/index.ts +0 -1
  621. package/src/core/primitives/inline/inline.tsx +0 -47
  622. package/src/core/primitives/inline/styles.ts +0 -32
  623. package/src/core/primitives/inline/types.ts +0 -6
  624. package/src/core/primitives/kbd/__workshop__/index.ts +0 -8
  625. package/src/core/primitives/kbd/__workshop__/plain.tsx +0 -9
  626. package/src/core/primitives/kbd/index.ts +0 -1
  627. package/src/core/primitives/kbd/kbd.tsx +0 -61
  628. package/src/core/primitives/label/__workshop__/index.ts +0 -19
  629. package/src/core/primitives/label/__workshop__/opticalAlignment.tsx +0 -48
  630. package/src/core/primitives/label/__workshop__/plain.tsx +0 -24
  631. package/src/core/primitives/label/index.ts +0 -1
  632. package/src/core/primitives/label/label.tsx +0 -79
  633. package/src/core/primitives/label/styles.ts +0 -45
  634. package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +0 -77
  635. package/src/core/primitives/popover/__workshop__/MarginsStory.tsx +0 -31
  636. package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -32
  637. package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +0 -11
  638. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +0 -71
  639. package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +0 -71
  640. package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +0 -89
  641. package/src/core/primitives/popover/__workshop__/TestStory.tsx +0 -97
  642. package/src/core/primitives/popover/__workshop__/index.ts +0 -49
  643. package/src/core/primitives/popover/constants.ts +0 -22
  644. package/src/core/primitives/popover/floating-ui/size.ts +0 -99
  645. package/src/core/primitives/popover/helpers.ts +0 -31
  646. package/src/core/primitives/popover/index.ts +0 -2
  647. package/src/core/primitives/popover/popover.tsx +0 -511
  648. package/src/core/primitives/popover/popoverCard.tsx +0 -166
  649. package/src/core/primitives/popover/types.ts +0 -7
  650. package/src/core/primitives/radio/__workshop__/example.tsx +0 -63
  651. package/src/core/primitives/radio/__workshop__/index.ts +0 -11
  652. package/src/core/primitives/radio/__workshop__/plain.tsx +0 -28
  653. package/src/core/primitives/radio/index.ts +0 -1
  654. package/src/core/primitives/radio/radio.tsx +0 -51
  655. package/src/core/primitives/radio/styles.ts +0 -117
  656. package/src/core/primitives/select/__workshop__/index.ts +0 -11
  657. package/src/core/primitives/select/__workshop__/plain.tsx +0 -27
  658. package/src/core/primitives/select/__workshop__/readOnly.tsx +0 -23
  659. package/src/core/primitives/select/index.ts +0 -1
  660. package/src/core/primitives/select/select.tsx +0 -88
  661. package/src/core/primitives/select/styles.ts +0 -166
  662. package/src/core/primitives/spinner/__workshop__/Props.tsx +0 -15
  663. package/src/core/primitives/spinner/__workshop__/index.ts +0 -14
  664. package/src/core/primitives/spinner/index.ts +0 -1
  665. package/src/core/primitives/spinner/spinner.tsx +0 -46
  666. package/src/core/primitives/stack/__workshop__/index.ts +0 -14
  667. package/src/core/primitives/stack/__workshop__/plain.tsx +0 -32
  668. package/src/core/primitives/stack/index.ts +0 -1
  669. package/src/core/primitives/stack/stack.tsx +0 -43
  670. package/src/core/primitives/stack/styles.ts +0 -32
  671. package/src/core/primitives/switch/__workshop__/example.tsx +0 -23
  672. package/src/core/primitives/switch/__workshop__/index.ts +0 -11
  673. package/src/core/primitives/switch/__workshop__/props.tsx +0 -21
  674. package/src/core/primitives/switch/index.ts +0 -1
  675. package/src/core/primitives/switch/styles.ts +0 -173
  676. package/src/core/primitives/switch/switch.tsx +0 -68
  677. package/src/core/primitives/text/__workshop__/colored.tsx +0 -30
  678. package/src/core/primitives/text/__workshop__/example.tsx +0 -39
  679. package/src/core/primitives/text/__workshop__/index.ts +0 -24
  680. package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +0 -48
  681. package/src/core/primitives/text/index.ts +0 -1
  682. package/src/core/primitives/text/styles.ts +0 -74
  683. package/src/core/primitives/text/text.tsx +0 -81
  684. package/src/core/primitives/textArea/__workshop__/index.ts +0 -14
  685. package/src/core/primitives/textArea/__workshop__/plain.tsx +0 -50
  686. package/src/core/primitives/textArea/index.ts +0 -1
  687. package/src/core/primitives/textArea/textArea.tsx +0 -120
  688. package/src/core/primitives/textInput/__workshop__/clearButton.tsx +0 -30
  689. package/src/core/primitives/textInput/__workshop__/customValidity.tsx +0 -17
  690. package/src/core/primitives/textInput/__workshop__/index.ts +0 -44
  691. package/src/core/primitives/textInput/__workshop__/plain.tsx +0 -98
  692. package/src/core/primitives/textInput/__workshop__/readOnly.tsx +0 -9
  693. package/src/core/primitives/textInput/__workshop__/states.tsx +0 -53
  694. package/src/core/primitives/textInput/__workshop__/tones.tsx +0 -277
  695. package/src/core/primitives/textInput/__workshop__/typed.tsx +0 -23
  696. package/src/core/primitives/textInput/index.ts +0 -1
  697. package/src/core/primitives/textInput/textInput.tsx +0 -390
  698. package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +0 -102
  699. package/src/core/primitives/tooltip/__workshop__/index.ts +0 -29
  700. package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +0 -74
  701. package/src/core/primitives/tooltip/__workshop__/props.tsx +0 -107
  702. package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +0 -86
  703. package/src/core/primitives/tooltip/constants.ts +0 -23
  704. package/src/core/primitives/tooltip/index.ts +0 -2
  705. package/src/core/primitives/tooltip/tooltip.test.tsx +0 -452
  706. package/src/core/primitives/tooltip/tooltip.tsx +0 -495
  707. package/src/core/primitives/tooltip/tooltipCard.tsx +0 -109
  708. package/src/core/primitives/tooltip/tooltipDelayGroup/index.ts +0 -4
  709. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupContext.tsx +0 -11
  710. package/src/core/primitives/tooltip/tooltipDelayGroup/tooltipDelayGroupProvider.tsx +0 -57
  711. package/src/core/primitives/tooltip/tooltipDelayGroup/types.ts +0 -10
  712. package/src/core/primitives/tooltip/tooltipDelayGroup/useTooltipDelayGroup.ts +0 -13
  713. package/src/core/primitives/types.ts +0 -146
  714. package/src/core/styles/border/borderStyle.ts +0 -56
  715. package/src/core/styles/border/index.ts +0 -2
  716. package/src/core/styles/border/types.ts +0 -10
  717. package/src/core/styles/box/boxStyle.ts +0 -69
  718. package/src/core/styles/box/index.ts +0 -2
  719. package/src/core/styles/box/types.ts +0 -11
  720. package/src/core/styles/card/_cardColorStyle.ts +0 -108
  721. package/src/core/styles/card/index.ts +0 -1
  722. package/src/core/styles/flex/flexItemStyle.ts +0 -27
  723. package/src/core/styles/flex/flexStyle.ts +0 -70
  724. package/src/core/styles/flex/index.ts +0 -3
  725. package/src/core/styles/flex/types.ts +0 -25
  726. package/src/core/styles/focusRing/index.ts +0 -25
  727. package/src/core/styles/font/codeFontStyle.ts +0 -13
  728. package/src/core/styles/font/headingFontStyle.ts +0 -13
  729. package/src/core/styles/font/index.ts +0 -6
  730. package/src/core/styles/font/labelFontStyle.ts +0 -13
  731. package/src/core/styles/font/responsiveFont.ts +0 -103
  732. package/src/core/styles/font/textAlignStyle.ts +0 -19
  733. package/src/core/styles/font/textFontStyle.ts +0 -13
  734. package/src/core/styles/font/types.ts +0 -35
  735. package/src/core/styles/grid/gridItemStyle.ts +0 -82
  736. package/src/core/styles/grid/gridStyle.ts +0 -108
  737. package/src/core/styles/grid/index.ts +0 -3
  738. package/src/core/styles/grid/types.ts +0 -37
  739. package/src/core/styles/helpers.ts +0 -72
  740. package/src/core/styles/index.ts +0 -5
  741. package/src/core/styles/input/index.ts +0 -2
  742. package/src/core/styles/input/responsiveInputPaddingStyle.ts +0 -78
  743. package/src/core/styles/input/textInputStyle.ts +0 -263
  744. package/src/core/styles/internal.ts +0 -12
  745. package/src/core/styles/margin/index.ts +0 -2
  746. package/src/core/styles/margin/marginStyle.ts +0 -21
  747. package/src/core/styles/margin/marginsStyle.test.ts +0 -33
  748. package/src/core/styles/margin/types.ts +0 -9
  749. package/src/core/styles/padding/index.ts +0 -2
  750. package/src/core/styles/padding/paddingStyle.test.ts +0 -33
  751. package/src/core/styles/padding/paddingStyle.ts +0 -21
  752. package/src/core/styles/padding/types.ts +0 -12
  753. package/src/core/styles/radius/index.ts +0 -2
  754. package/src/core/styles/radius/radiusStyle.ts +0 -23
  755. package/src/core/styles/radius/types.ts +0 -8
  756. package/src/core/styles/shadow/index.ts +0 -2
  757. package/src/core/styles/shadow/shadowStyle.ts +0 -29
  758. package/src/core/styles/shadow/types.ts +0 -6
  759. package/src/core/styles/types.ts +0 -8
  760. package/src/core/theme/__workshop__/build/Root.tsx +0 -367
  761. package/src/core/theme/__workshop__/build/helpers.ts +0 -46
  762. package/src/core/theme/__workshop__/build/story.tsx +0 -465
  763. package/src/core/theme/__workshop__/canvas.tsx +0 -352
  764. package/src/core/theme/__workshop__/color.tsx +0 -62
  765. package/src/core/theme/__workshop__/debug/story.tsx +0 -408
  766. package/src/core/theme/__workshop__/index.ts +0 -39
  767. package/src/core/theme/__workshop__/layer.tsx +0 -78
  768. package/src/core/theme/__workshop__/nestedProvider.tsx +0 -15
  769. package/src/core/theme/index.ts +0 -5
  770. package/src/core/theme/theme.test.tsx +0 -73
  771. package/src/core/theme/themeColorProvider.tsx +0 -29
  772. package/src/core/theme/themeContext.ts +0 -10
  773. package/src/core/theme/themeProvider.tsx +0 -62
  774. package/src/core/theme/types.ts +0 -12
  775. package/src/core/theme/useRootTheme.ts +0 -17
  776. package/src/core/theme/useTheme.ts +0 -16
  777. package/src/core/types/avatar.ts +0 -14
  778. package/src/core/types/badge.ts +0 -12
  779. package/src/core/types/box.ts +0 -19
  780. package/src/core/types/button.ts +0 -21
  781. package/src/core/types/card.ts +0 -6
  782. package/src/core/types/dialog.ts +0 -4
  783. package/src/core/types/flex.ts +0 -30
  784. package/src/core/types/grid.ts +0 -14
  785. package/src/core/types/gridItem.ts +0 -29
  786. package/src/core/types/index.ts +0 -14
  787. package/src/core/types/placement.ts +0 -18
  788. package/src/core/types/popover.ts +0 -4
  789. package/src/core/types/radius.ts +0 -4
  790. package/src/core/types/selectable.ts +0 -6
  791. package/src/core/types/text.ts +0 -4
  792. package/src/core/utils/arrow/arrow.tsx +0 -123
  793. package/src/core/utils/arrow/cmds.ts +0 -91
  794. package/src/core/utils/arrow/index.ts +0 -1
  795. package/src/core/utils/boundaryElement/__workshop__/index.ts +0 -14
  796. package/src/core/utils/boundaryElement/__workshop__/plain.tsx +0 -19
  797. package/src/core/utils/boundaryElement/boundaryElement.test.tsx +0 -100
  798. package/src/core/utils/boundaryElement/boundaryElementContext.ts +0 -7
  799. package/src/core/utils/boundaryElement/boundaryElementProvider.tsx +0 -24
  800. package/src/core/utils/boundaryElement/index.ts +0 -3
  801. package/src/core/utils/boundaryElement/types.ts +0 -7
  802. package/src/core/utils/boundaryElement/useBoundaryElement.ts +0 -26
  803. package/src/core/utils/conditionalWrapper/conditionalWrapper.tsx +0 -21
  804. package/src/core/utils/conditionalWrapper/index.ts +0 -1
  805. package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +0 -30
  806. package/src/core/utils/elementQuery/__workshop__/index.ts +0 -14
  807. package/src/core/utils/elementQuery/elementQuery.tsx +0 -53
  808. package/src/core/utils/elementQuery/index.ts +0 -1
  809. package/src/core/utils/errorBoundary.tsx +0 -48
  810. package/src/core/utils/getElementRef.ts +0 -26
  811. package/src/core/utils/index.ts +0 -9
  812. package/src/core/utils/layer/__workshop__/_debug.tsx +0 -17
  813. package/src/core/utils/layer/__workshop__/index.ts +0 -24
  814. package/src/core/utils/layer/__workshop__/multipleRoots.tsx +0 -49
  815. package/src/core/utils/layer/__workshop__/nested.tsx +0 -98
  816. package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +0 -13
  817. package/src/core/utils/layer/getLayerContext.test.ts +0 -30
  818. package/src/core/utils/layer/getLayerContext.ts +0 -21
  819. package/src/core/utils/layer/index.ts +0 -4
  820. package/src/core/utils/layer/layer.test.tsx +0 -108
  821. package/src/core/utils/layer/layer.tsx +0 -98
  822. package/src/core/utils/layer/layerContext.ts +0 -7
  823. package/src/core/utils/layer/layerProvider.tsx +0 -111
  824. package/src/core/utils/layer/useLayer.ts +0 -26
  825. package/src/core/utils/portal/__workshop__/index.ts +0 -14
  826. package/src/core/utils/portal/__workshop__/named.tsx +0 -63
  827. package/src/core/utils/portal/index.ts +0 -4
  828. package/src/core/utils/portal/portal.test.tsx +0 -103
  829. package/src/core/utils/portal/portal.ts +0 -32
  830. package/src/core/utils/portal/portalContext.ts +0 -31
  831. package/src/core/utils/portal/portalProvider.tsx +0 -47
  832. package/src/core/utils/portal/types.ts +0 -9
  833. package/src/core/utils/portal/usePortal.ts +0 -25
  834. package/src/core/utils/spanWithTextOverflow.tsx +0 -10
  835. package/src/core/utils/srOnly/index.ts +0 -1
  836. package/src/core/utils/srOnly/srOnly.tsx +0 -36
  837. package/src/core/utils/virtualList/__workshop__/changingProps.tsx +0 -36
  838. package/src/core/utils/virtualList/__workshop__/elementScroll.tsx +0 -24
  839. package/src/core/utils/virtualList/__workshop__/index.ts +0 -29
  840. package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +0 -48
  841. package/src/core/utils/virtualList/__workshop__/windowScrolll.tsx +0 -22
  842. package/src/core/utils/virtualList/index.ts +0 -1
  843. package/src/core/utils/virtualList/virtualList.tsx +0 -200
  844. package/src/theme/build/_deprecated/color/_selectable/createSelectableTones.ts +0 -76
  845. package/src/theme/build/_deprecated/color/_solid/createSolidTones.ts +0 -54
  846. package/src/theme/build/_deprecated/color/button/createButtonModes.ts +0 -22
  847. package/src/theme/build/_deprecated/color/button/createButtonTones.ts +0 -55
  848. package/src/theme/build/_deprecated/color/card/createCardStates.ts +0 -60
  849. package/src/theme/build/_deprecated/color/color.test.ts +0 -63
  850. package/src/theme/build/_deprecated/color/defaults.ts +0 -390
  851. package/src/theme/build/_deprecated/color/factory.ts +0 -142
  852. package/src/theme/build/_deprecated/color/index.ts +0 -1
  853. package/src/theme/build/_deprecated/color/input/createInputModes.ts +0 -81
  854. package/src/theme/build/_deprecated/color/muted/createMuted.ts +0 -54
  855. package/src/theme/build/_deprecated/color/spot/createSpot.ts +0 -20
  856. package/src/theme/build/buildColorTheme.test.ts +0 -183
  857. package/src/theme/build/buildColorTheme.ts +0 -499
  858. package/src/theme/build/buildTheme.test.ts +0 -87
  859. package/src/theme/build/buildTheme.ts +0 -36
  860. package/src/theme/build/colorToken/colorToken.ts +0 -19
  861. package/src/theme/build/colorToken/compileColorToken.ts +0 -21
  862. package/src/theme/build/colorToken/index.ts +0 -2
  863. package/src/theme/build/colorToken/types.ts +0 -6
  864. package/src/theme/build/index.ts +0 -3
  865. package/src/theme/build/lib/color-fns/blend/index.ts +0 -3
  866. package/src/theme/build/lib/color-fns/blend/mix.ts +0 -21
  867. package/src/theme/build/lib/color-fns/blend/multiply.ts +0 -18
  868. package/src/theme/build/lib/color-fns/blend/screen.ts +0 -18
  869. package/src/theme/build/lib/color-fns/color-fns.test.ts +0 -68
  870. package/src/theme/build/lib/color-fns/contrastRatio.ts +0 -31
  871. package/src/theme/build/lib/color-fns/convert.ts +0 -150
  872. package/src/theme/build/lib/color-fns/index.ts +0 -6
  873. package/src/theme/build/lib/color-fns/parse.ts +0 -60
  874. package/src/theme/build/lib/color-fns/rgba.ts +0 -10
  875. package/src/theme/build/lib/color-fns/types.ts +0 -28
  876. package/src/theme/build/lib/isRecord.ts +0 -3
  877. package/src/theme/build/lib/lazy.ts +0 -30
  878. package/src/theme/build/lib/utils.ts +0 -19
  879. package/src/theme/build/merge.ts +0 -26
  880. package/src/theme/build/mixThemeColor.test.ts +0 -21
  881. package/src/theme/build/mixThemeColor.ts +0 -53
  882. package/src/theme/build/renderColorTheme.ts +0 -532
  883. package/src/theme/build/renderColorValue.ts +0 -85
  884. package/src/theme/build/resolveColorTokens.ts +0 -268
  885. package/src/theme/build/theme.test.ts +0 -27
  886. package/src/theme/config/helpers.ts +0 -55
  887. package/src/theme/config/index.ts +0 -4
  888. package/src/theme/config/system.ts +0 -115
  889. package/src/theme/config/tokens/color/index.ts +0 -1
  890. package/src/theme/config/tokens/color/types.ts +0 -133
  891. package/src/theme/config/tokens/index.ts +0 -4
  892. package/src/theme/config/tokens/parseTokenKey.test.ts +0 -64
  893. package/src/theme/config/tokens/parseTokenKey.ts +0 -67
  894. package/src/theme/config/tokens/parseTokenValue.test.ts +0 -42
  895. package/src/theme/config/tokens/parseTokenValue.ts +0 -133
  896. package/src/theme/config/tokens/types.ts +0 -53
  897. package/src/theme/config/types.ts +0 -46
  898. package/src/theme/defaults/colorPalette.ts +0 -5
  899. package/src/theme/defaults/colorTokens.ts +0 -648
  900. package/src/theme/defaults/config.ts +0 -84
  901. package/src/theme/defaults/fonts.ts +0 -227
  902. package/src/theme/getScopedTheme.ts +0 -98
  903. package/src/theme/index.ts +0 -5
  904. package/src/theme/system/avatar.ts +0 -14
  905. package/src/theme/system/color/_constants.ts +0 -45
  906. package/src/theme/system/color/_helpers.ts +0 -24
  907. package/src/theme/system/color/_system.ts +0 -40
  908. package/src/theme/system/color/avatar.ts +0 -15
  909. package/src/theme/system/color/badge.ts +0 -16
  910. package/src/theme/system/color/button.ts +0 -17
  911. package/src/theme/system/color/color.ts +0 -34
  912. package/src/theme/system/color/index.ts +0 -13
  913. package/src/theme/system/color/input.ts +0 -25
  914. package/src/theme/system/color/kbd.ts +0 -8
  915. package/src/theme/system/color/selectable.ts +0 -12
  916. package/src/theme/system/color/shadow.ts +0 -7
  917. package/src/theme/system/color/state.ts +0 -43
  918. package/src/theme/system/color/syntax.ts +0 -41
  919. package/src/theme/system/css.ts +0 -8
  920. package/src/theme/system/focusRing.ts +0 -7
  921. package/src/theme/system/font.ts +0 -52
  922. package/src/theme/system/index.ts +0 -11
  923. package/src/theme/system/input.ts +0 -33
  924. package/src/theme/system/layer.ts +0 -8
  925. package/src/theme/system/shadow.ts +0 -19
  926. package/src/theme/system/styles.ts +0 -13
  927. package/src/theme/system/theme.ts +0 -138
  928. package/src/theme/system/v0/avatar.ts +0 -10
  929. package/src/theme/system/v0/color/_generic.ts +0 -35
  930. package/src/theme/system/v0/color/_system.ts +0 -17
  931. package/src/theme/system/v0/color/base.ts +0 -21
  932. package/src/theme/system/v0/color/button.ts +0 -42
  933. package/src/theme/system/v0/color/card.ts +0 -19
  934. package/src/theme/system/v0/color/color.ts +0 -40
  935. package/src/theme/system/v0/color/index.ts +0 -11
  936. package/src/theme/system/v0/color/input.ts +0 -34
  937. package/src/theme/system/v0/color/muted.ts +0 -26
  938. package/src/theme/system/v0/color/selectable.ts +0 -31
  939. package/src/theme/system/v0/color/solid.ts +0 -26
  940. package/src/theme/system/v0/color/spot.ts +0 -13
  941. package/src/theme/system/v0/index.ts +0 -3
  942. package/src/theme/system/v0/input.ts +0 -23
  943. package/src/theme/versioning/getTheme_v2.ts +0 -57
  944. package/src/theme/versioning/index.ts +0 -5
  945. package/src/theme/versioning/is_v0.ts +0 -6
  946. package/src/theme/versioning/is_v2.ts +0 -6
  947. package/src/theme/versioning/themeColor_v0_v2.ts +0 -243
  948. package/src/theme/versioning/themeColor_v2_v2_9.ts +0 -49
  949. package/src/theme/versioning/v0_v2.ts +0 -94
  950. package/src/theme/versioning/v2_v0.ts +0 -135
  951. /package/src/{core/components → components}/autocomplete/__workshop__/types.ts +0 -0
  952. /package/src/{core/components → components}/toast/toastState.ts +0 -0
  953. /package/src/{core/hooks → hooks}/useCustomValidity.ts +0 -0
  954. /package/src/{core/hooks → hooks}/useMounted.ts +0 -0
  955. /package/src/{core/primitives → primitives}/container/types.ts +0 -0
  956. /package/src/{core/utils → primitives}/layer/types.ts +0 -0
  957. /package/src/{core/utils → utils}/elementQuery/helpers.ts +0 -0
package/dist/index.d.ts CHANGED
@@ -1,93 +1,68 @@
1
- import {BaseTheme as BaseTheme_2} from '@sanity/ui/theme'
1
+ import type {AvatarColor} from '@sanity/ui-tokens'
2
+ import type {AvatarSize} from '@sanity/ui-tokens'
3
+ import {BadgeStyleProps} from '@sanity/ui-css'
4
+ import {BoxStyleProps} from '@sanity/ui-css'
5
+ import {Breakpoint} from '@sanity/ui-css'
6
+ import {ButtonStyleProps} from '@sanity/ui-css'
7
+ import {CardStyleProps} from '@sanity/ui-css'
8
+ import type {CardTone} from '@sanity/ui-tokens'
9
+ import {CodeStyleProps} from '@sanity/ui-css'
10
+ import type {ColorScheme} from '@sanity/ui-tokens'
2
11
  import {Component} from 'react'
3
- import {Context} from 'react'
4
- import {createColorTheme as createColorTheme_2} from '@sanity/ui/theme'
5
- import {CSSObject} from '@sanity/ui/theme'
6
- import {DetailedHTMLProps} from 'react'
7
- import {ElementType} from 'react'
8
- import {FastOmit} from 'styled-components'
9
- import {ForwardRefExoticComponent} from 'react'
10
- import {hexToRgb as hexToRgb_2} from '@sanity/ui/theme'
11
- import {HSL as HSL_2} from '@sanity/ui/theme'
12
- import {hslToRgb as hslToRgb_2} from '@sanity/ui/theme'
13
- import {HTMLAttributes} from 'react'
14
- import {HTMLProps} from 'react'
15
- import {IStyledComponentBase} from 'styled-components/dist/types'
16
- import {multiply as multiply_2} from '@sanity/ui/theme'
17
- import {parseColor as parseColor_2} from '@sanity/ui/theme'
18
- import {PartialThemeColorBuilderOpts} from '@sanity/ui/theme'
12
+ import type {ComponentType as ComponentType_2} from 'react'
13
+ import {ContainerStyleProps} from '@sanity/ui-css'
14
+ import type {ContainerWidth} from '@sanity/ui-tokens'
15
+ import type {Context} from 'react'
16
+ import type {ElementTone} from '@sanity/ui-tokens'
17
+ import {ElementType as ElementType_2} from 'react'
18
+ import {ErrorInfo} from 'react'
19
+ import {FlexStyleProps} from '@sanity/ui-css'
20
+ import type {FontCodeSize} from '@sanity/ui-tokens'
21
+ import type {FontHeadingSize} from '@sanity/ui-tokens'
22
+ import type {FontLabelSize} from '@sanity/ui-tokens'
23
+ import type {FontTextSize} from '@sanity/ui-tokens'
24
+ import type {FontWeight} from '@sanity/ui-tokens'
25
+ import {ForwardedRef} from 'react'
26
+ import {GapStyleProps} from '@sanity/ui-css'
27
+ import {GridStyleProps} from '@sanity/ui-css'
28
+ import {HeadingStyleProps} from '@sanity/ui-css'
29
+ import {HTMLMotionProps} from 'motion/react'
30
+ import {InlineStyleProps} from '@sanity/ui-css'
31
+ import {InputStyleProps} from '@sanity/ui-css'
32
+ import {KBDStyleProps} from '@sanity/ui-css'
33
+ import {LabelStyleProps} from '@sanity/ui-css'
34
+ import {LazyExoticComponent} from 'react'
35
+ import {MaxWidth} from '@sanity/ui-css'
36
+ import {MouseEventHandler} from 'react'
37
+ import {PaddingStyleProps} from '@sanity/ui-css'
19
38
  import {PropsWithChildren} from 'react'
39
+ import type {Radius} from '@sanity/ui-tokens'
40
+ import {RadiusStyleProps} from '@sanity/ui-css'
41
+ import {ReactElement} from 'react'
20
42
  import {ReactNode} from 'react'
43
+ import {ReactPortal} from 'react'
21
44
  import {Ref} from 'react'
22
- import {RefAttributes} from 'react'
23
- import {RGB as RGB_2} from '@sanity/ui/theme'
24
- import {rgba as rgba_2} from '@sanity/ui/theme'
25
- import {rgbToHex as rgbToHex_2} from '@sanity/ui/theme'
26
- import {rgbToHsl as rgbToHsl_2} from '@sanity/ui/theme'
27
- import {RootTheme as RootTheme_2} from '@sanity/ui/theme'
28
- import {screen as screen_3} from '@sanity/ui/theme'
29
- import {Theme as Theme_2} from '@sanity/ui/theme'
30
- import {Theme_v2} from '@sanity/ui/theme'
31
- import {ThemeAvatar} from '@sanity/ui/theme'
32
- import {ThemeBoxShadow} from '@sanity/ui/theme'
33
- import {ThemeColor} from '@sanity/ui/theme'
34
- import {ThemeColorAvatarColorKey} from '@sanity/ui/theme'
35
- import {ThemeColorBase} from '@sanity/ui/theme'
36
- import {ThemeColorBuilderOpts} from '@sanity/ui/theme'
37
- import {ThemeColorButton} from '@sanity/ui/theme'
38
- import {ThemeColorButtonModeKey as ThemeColorButtonModeKey_2} from '@sanity/ui/theme'
39
- import {ThemeColorButtonState} from '@sanity/ui/theme'
40
- import {ThemeColorButtonStates} from '@sanity/ui/theme'
41
- import {ThemeColorButtonTones} from '@sanity/ui/theme'
42
- import {ThemeColorCard} from '@sanity/ui/theme'
43
- import {ThemeColorCardState} from '@sanity/ui/theme'
44
- import {ThemeColorCardToneKey} from '@sanity/ui/theme'
45
- import {ThemeColorGenericState} from '@sanity/ui/theme'
46
- import {ThemeColorInput} from '@sanity/ui/theme'
47
- import {ThemeColorInputState} from '@sanity/ui/theme'
48
- import {ThemeColorInputStates} from '@sanity/ui/theme'
49
- import {ThemeColorMuted} from '@sanity/ui/theme'
50
- import {ThemeColorMutedTone} from '@sanity/ui/theme'
51
- import {ThemeColorName} from '@sanity/ui/theme'
52
- import {ThemeColorScheme} from '@sanity/ui/theme'
53
- import {ThemeColorSchemeKey as ThemeColorSchemeKey_2} from '@sanity/ui/theme'
54
- import {ThemeColorSchemes} from '@sanity/ui/theme'
55
- import {ThemeColorSelectable} from '@sanity/ui/theme'
56
- import {ThemeColorSelectableState} from '@sanity/ui/theme'
57
- import {ThemeColorSelectableStates} from '@sanity/ui/theme'
58
- import {ThemeColorSolid} from '@sanity/ui/theme'
59
- import {ThemeColorSolidTone} from '@sanity/ui/theme'
60
- import {ThemeColorSpot} from '@sanity/ui/theme'
61
- import {ThemeColorSpotKey} from '@sanity/ui/theme'
62
- import {ThemeColorStateToneKey} from '@sanity/ui/theme'
63
- import {ThemeColorSyntax as ThemeColorSyntax_2} from '@sanity/ui/theme'
64
- import {ThemeColorToneKey} from '@sanity/ui/theme'
65
- import {ThemeFont as ThemeFont_2} from '@sanity/ui/theme'
66
- import {ThemeFontKey as ThemeFontKey_2} from '@sanity/ui/theme'
67
- import {ThemeFonts as ThemeFonts_2} from '@sanity/ui/theme'
68
- import {ThemeFontSize as ThemeFontSize_2} from '@sanity/ui/theme'
69
- import {ThemeFontWeight as ThemeFontWeight_2} from '@sanity/ui/theme'
70
- import {ThemeFontWeightKey as ThemeFontWeightKey_2} from '@sanity/ui/theme'
71
- import {ThemeInput} from '@sanity/ui/theme'
72
- import {ThemeLayer as ThemeLayer_2} from '@sanity/ui/theme'
73
- import {ThemeShadow as ThemeShadow_2} from '@sanity/ui/theme'
74
- import {ThemeStyles} from '@sanity/ui/theme'
75
-
76
- /** @beta */
77
- export declare type ArrayPropPrimitive = string | number | boolean | undefined | null
78
-
79
- /** @internal */
80
- export declare const Arrow: ForwardRefExoticComponent<
81
- Omit<
82
- {
83
- width: number
84
- height: number
85
- radius?: number
86
- } & Omit<HTMLProps<HTMLDivElement>, 'height' | 'width'>,
87
- 'ref'
88
- > &
89
- RefAttributes<HTMLDivElement>
90
- >
45
+ import {ResponsiveProp} from '@sanity/ui-css'
46
+ import {ResponsivePropArray} from '@sanity/ui-css'
47
+ import {RootStyleProps} from '@sanity/ui-css'
48
+ import {SelectableStyleProps} from '@sanity/ui-css'
49
+ import {SelectStyleProps} from '@sanity/ui-css'
50
+ import type {Shadow} from '@sanity/ui-tokens'
51
+ import {ShadowStyleProps} from '@sanity/ui-css'
52
+ import {SkeletonStyleProps} from '@sanity/ui-css'
53
+ import type {Space} from '@sanity/ui-tokens'
54
+ import {StackStyleProps} from '@sanity/ui-css'
55
+ import type {Strategy} from '@floating-ui/react-dom'
56
+ import {TextAreaStyleProps} from '@sanity/ui-css'
57
+ import {TextOverflowStyleProps} from '@sanity/ui-css'
58
+ import {TextStyleProps} from '@sanity/ui-css'
59
+
60
+ /**
61
+ * Assign properties from `U` to `T`, excluding properties that already exist in `T`.
62
+ *
63
+ * @public
64
+ */
65
+ export declare type Assign<T extends {}, U extends {}> = Omit<T, keyof U> & U
91
66
 
92
67
  /**
93
68
  * @internal
@@ -100,33 +75,13 @@ export declare function attemptFocus(element: HTMLElement): boolean
100
75
  *
101
76
  * @public
102
77
  */
103
- export declare const Autocomplete: <Option extends BaseAutocompleteOption>(
104
- props: AutocompleteProps<Option> &
105
- Omit<
106
- HTMLProps<HTMLInputElement>,
107
- | 'aria-activedescendant'
108
- | 'aria-autocomplete'
109
- | 'aria-expanded'
110
- | 'aria-owns'
111
- | 'as'
112
- | 'autoCapitalize'
113
- | 'autoComplete'
114
- | 'autoCorrect'
115
- | 'id'
116
- | 'inputMode'
117
- | 'onChange'
118
- | 'onSelect'
119
- | 'popover'
120
- | 'prefix'
121
- | 'ref'
122
- | 'role'
123
- | 'spellCheck'
124
- | 'type'
125
- | 'value'
126
- > & {
127
- ref?: Ref<HTMLInputElement>
128
- },
129
- ) => React.JSX.Element
78
+ export declare function Autocomplete<
79
+ E extends AutocompleteElementType = typeof DEFAULT_AUTOCOMPLETE_ELEMENT,
80
+ Option extends BaseAutocompleteOption = BaseAutocompleteOption,
81
+ >(props: AutocompleteProps<E, Option>): React.JSX.Element
82
+
83
+ /** @public */
84
+ export declare type AutocompleteElementType = 'input' | ComponentType
130
85
 
131
86
  /**
132
87
  * @internal
@@ -157,26 +112,19 @@ export declare type AutocompleteMsg =
157
112
  | AutocompleteInputFoocusMsg
158
113
  | AutocompleteValueChangeMsg
159
114
 
160
- /**
161
- * @public
162
- */
163
- export declare type AutocompleteOpenButtonProps = Omit<ButtonProps, 'as'> &
164
- Omit<React.HTMLProps<HTMLButtonElement>, 'as' | 'ref'>
115
+ /** @public */
116
+ export declare type AutocompleteOpenButtonProps = Omit<ButtonProps<'button'>, 'as'>
165
117
 
166
- /**
167
- * @public
168
- */
169
- export declare interface AutocompleteProps<
118
+ /** @public */
119
+ export declare type AutocompleteOwnProps<
170
120
  Option extends BaseAutocompleteOption = BaseAutocompleteOption,
171
- > {
121
+ > = TextInputOwnProps & {
172
122
  border?: boolean
173
123
  customValidity?: string
174
124
  filterOption?: (query: string, option: Option) => boolean
175
- fontSize?: number | number[]
176
- icon?: ElementType | ReactNode
177
- id: string
125
+ icon?: ElementType_2 | ReactNode
178
126
  /** @beta */
179
- listBox?: BoxProps
127
+ listBox?: BoxOwnProps
180
128
  loading?: boolean
181
129
  onChange?: (value: string) => void
182
130
  onQueryChange?: (query: string | null) => void
@@ -187,9 +135,8 @@ export declare interface AutocompleteProps<
187
135
  openOnFocus?: boolean
188
136
  /** The options to render. */
189
137
  options?: Option[]
190
- padding?: number | number[]
191
- popover?: Omit<PopoverProps, 'content' | 'onMouseEnter' | 'onMouseLeave' | 'open'> &
192
- Omit<HTMLProps<HTMLDivElement>, 'as' | 'children' | 'content' | 'ref' | 'width'>
138
+ padding?: ResponsiveProp<Space>
139
+ popover?: Omit<PopoverProps, 'content' | 'onMouseEnter' | 'onMouseLeave' | 'open'>
193
140
  prefix?: ReactNode
194
141
  radius?: Radius | Radius[]
195
142
  /** @beta */
@@ -205,14 +152,19 @@ export declare interface AutocompleteProps<
205
152
  onMouseEnter: () => void
206
153
  onMouseLeave: () => void
207
154
  },
208
- ref: Ref<HTMLDivElement>,
155
+ ref: ForwardedRef<HTMLDivElement>,
209
156
  ) => ReactNode
210
157
  renderValue?: (value: string, option?: Option) => string
211
158
  suffix?: ReactNode
212
- /** The current value. */
213
159
  value?: string
214
160
  }
215
161
 
162
+ /** @public */
163
+ export declare type AutocompleteProps<
164
+ E extends AutocompleteElementType = AutocompleteElementType,
165
+ Option extends BaseAutocompleteOption = BaseAutocompleteOption,
166
+ > = Props<AutocompleteOwnProps<Option>, E>
167
+
216
168
  /**
217
169
  * @internal
218
170
  */
@@ -283,157 +235,119 @@ export declare interface AutocompleteValueChangeMsg {
283
235
  *
284
236
  * @public
285
237
  */
286
- export declare const Avatar: ForwardRefExoticComponent<
287
- AvatarProps & Omit<HTMLProps<HTMLDivElement>, 'ref' | 'as'> & RefAttributes<HTMLDivElement>
288
- >
238
+ export declare function Avatar<E extends AvatarElementType = typeof DEFAULT_AVATAR_ELEMENT>(
239
+ props: AvatarProps<E>,
240
+ ): React.JSX.Element
289
241
 
290
- /**
291
- * @public
292
- */
293
- export declare const AvatarCounter: ForwardRefExoticComponent<
294
- AvatarCounterProps & RefAttributes<HTMLDivElement>
295
- >
242
+ /** @public */
243
+ export declare function AvatarCounter<
244
+ E extends AvatarCounterElementType = typeof DEFAULT_AVATAR_COUNTER_ELEMENT,
245
+ >(props: AvatarCounterProps<E>): React.JSX.Element
296
246
 
297
- /**
298
- * @public
299
- */
300
- export declare interface AvatarCounterProps {
247
+ /** @public */
248
+ export declare type AvatarCounterElementType = 'button' | 'div' | 'span' | ComponentType
249
+
250
+ /** @public */
251
+ export declare interface AvatarCounterOwnProps {
301
252
  count: number
302
- size?: AvatarSize | AvatarSize[]
303
- /** @deprecated No longer supported. */
304
- tone?: 'navbar'
253
+ size?: ResponsiveProp<AvatarSize>
305
254
  }
306
255
 
307
- /**
308
- * @public
309
- */
310
- export declare type AvatarPosition = 'top' | 'bottom' | 'inside'
256
+ /** @public */
257
+ export declare type AvatarCounterProps<
258
+ E extends AvatarCounterElementType = AvatarCounterElementType,
259
+ > = Props<AvatarCounterOwnProps, E>
311
260
 
312
- /**
313
- * @public
314
- */
315
- export declare interface AvatarProps {
261
+ /** @public */
262
+ export declare type AvatarElementType = 'a' | 'button' | 'div' | 'span' | ComponentType
263
+
264
+ /** @public */
265
+ export declare interface AvatarOwnProps {
316
266
  /** @beta */
317
267
  __unstable_hideInnerStroke?: boolean
318
268
  animateArrowFrom?: AvatarPosition
319
269
  arrowPosition?: AvatarPosition
320
- as?: React.ElementType | keyof React.JSX.IntrinsicElements
321
- color?: ThemeColorAvatarColorKey
270
+ color?: AvatarColor
322
271
  initials?: string
323
272
  onImageLoadError?: (event: Error) => void
324
- size?: AvatarSize | AvatarSize[]
273
+ size?: ResponsiveProp<AvatarSize>
325
274
  src?: string
326
- /**
327
- * The status of the entity this Avatar represents.
328
- * @alpha
329
- */
330
- status?: AvatarStatus
331
275
  title?: string
332
276
  }
333
277
 
334
- /**
335
- * @internal
336
- */
337
- export declare interface AvatarRootStyleProps {
338
- $color: ThemeColorAvatarColorKey
339
- }
340
-
341
- /**
342
- * @public
343
- */
344
- export declare type AvatarSize = 0 | 1 | 2 | 3
278
+ /** @public */
279
+ export declare type AvatarPosition = 'top' | 'bottom' | 'inside'
345
280
 
346
- /**
347
- * @public
348
- */
349
- export declare const AvatarStack: ForwardRefExoticComponent<
350
- AvatarStackProps & Omit<HTMLProps<HTMLDivElement>, 'ref' | 'as'> & RefAttributes<HTMLDivElement>
281
+ /** @public */
282
+ export declare type AvatarProps<E extends AvatarElementType = AvatarElementType> = Props<
283
+ AvatarOwnProps,
284
+ E
351
285
  >
352
286
 
353
- /**
354
- * @public
355
- */
356
- export declare interface AvatarStackProps {
357
- children: React.ReactNode
287
+ /** @public */
288
+ export declare function AvatarStack<
289
+ E extends AvatarStackElementType = typeof DEFAULT_AVATAR_STACK_ELEMENT,
290
+ >(props: AvatarStackProps<E>): React.JSX.Element
291
+
292
+ /** @public */
293
+ export declare type AvatarStackChild = ReactElement<AvatarProps<'div'>> | null | undefined | false
294
+
295
+ /** @public */
296
+ export declare type AvatarStackElementType = 'div' | 'span' | ComponentType
297
+
298
+ /** @public */
299
+ export declare type AvatarStackOwnProps = Omit<
300
+ BoxOwnProps,
301
+ 'align' | 'alignItems' | 'display' | 'justify' | 'justifyContent'
302
+ > & {
303
+ children: AvatarStackChild | AvatarStackChild[]
358
304
  maxLength?: number
359
- size?: AvatarSize | AvatarSize[]
360
- /** @deprecated No longer supported. */
361
- tone?: 'navbar'
305
+ size?: ResponsiveProp<AvatarSize>
362
306
  }
363
307
 
364
- /**
365
- * @public
366
- */
367
- export declare type AvatarStatus = 'online' | 'editing' | 'inactive'
308
+ /** @public */
309
+ export declare type AvatarStackProps<E extends AvatarStackElementType = AvatarStackElementType> =
310
+ Props<AvatarStackOwnProps, E>
368
311
 
369
312
  /**
370
313
  * Badges are used to tag resources.
371
314
  *
372
315
  * @public
373
316
  */
374
- export declare const Badge: ForwardRefExoticComponent<
375
- Omit<BadgeProps & HTMLProps<HTMLDivElement>, 'ref'> & RefAttributes<unknown>
376
- >
317
+ export declare function Badge<E extends BadgeElementType = typeof DEFAULT_BADGE_ELEMENT>(
318
+ props: BadgeProps<E>,
319
+ ): React.JSX.Element
377
320
 
378
- /**
379
- * @public
380
- * @deprecated No longer used
381
- */
382
- export declare type BadgeMode = 'default' | 'outline'
321
+ /** @public */
322
+ export declare type BadgeElementType = 'div' | 'span' | ComponentType
383
323
 
384
- /**
385
- * @public
386
- */
387
- export declare interface BadgeProps extends BoxProps, ResponsiveRadiusProps {
388
- as?: React.ElementType | keyof React.JSX.IntrinsicElements
389
- fontSize?: number | number[]
390
- /** @deprecated No longer used. */
391
- mode?: BadgeMode
392
- tone?: BadgeTone
324
+ /** @public */
325
+ export declare interface BadgeOwnProps extends BadgeStyleProps {
326
+ fontSize?: ResponsiveProp<FontTextSize>
393
327
  }
394
328
 
395
- /**
396
- * @public
397
- */
398
- export declare type BadgeTone = ThemeColorStateToneKey
329
+ /** @public */
330
+ export declare type BadgeProps<E extends BadgeElementType = BadgeElementType> = Props<
331
+ BadgeOwnProps,
332
+ E
333
+ >
399
334
 
400
- /**
401
- * @public
402
- */
335
+ /** @public */
403
336
  export declare interface BaseAutocompleteOption {
404
337
  value: string
405
338
  }
406
339
 
407
- /**
408
- * @public
409
- * @deprecated Use `BaseTheme` from `@sanity/ui/theme` instead.
410
- */
411
- export declare type BaseTheme = BaseTheme_2
412
-
413
- /**
414
- * @public
415
- */
416
- export declare interface BoundaryElementContextValue {
417
- version: 0.0
418
- element: HTMLElement | null
419
- }
340
+ /** @public */
341
+ export declare type BoundaryElementContextValue = HTMLElement | null
420
342
 
421
- /**
422
- * @public
423
- */
343
+ /** @public */
424
344
  export declare function BoundaryElementProvider(
425
345
  props: BoundaryElementProviderProps,
426
346
  ): React.JSX.Element
427
347
 
428
- export declare namespace BoundaryElementProvider {
429
- var displayName: string
430
- }
431
-
432
- /**
433
- * @public
434
- */
348
+ /** @public */
435
349
  export declare interface BoundaryElementProviderProps {
436
- children: React.ReactNode
350
+ children: ReactNode
437
351
  element: HTMLElement | null
438
352
  }
439
353
 
@@ -443,120 +357,108 @@ export declare interface BoundaryElementProviderProps {
443
357
  *
444
358
  * @public
445
359
  */
446
- export declare const Box: ForwardRefExoticComponent<
447
- Omit<BoxProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'as'>, 'ref'> &
448
- RefAttributes<HTMLDivElement>
449
- >
450
-
451
- /**
452
- * @public
453
- */
454
- export declare type BoxDisplay = 'none' | 'block' | 'grid' | 'flex' | 'inline-block'
455
-
456
- /**
457
- * @public
458
- */
459
- export declare type BoxHeight = 'stretch' | 'fill'
360
+ export declare function Box<E extends BoxElementType = typeof DEFAULT_BOX_ELEMENT>(
361
+ props: BoxProps<E>,
362
+ ): React.JSX.Element
460
363
 
461
- /**
462
- * @public
463
- */
464
- export declare type BoxOverflow = 'visible' | 'hidden' | 'auto'
364
+ /** @public */
365
+ export declare type BoxElementType =
366
+ | 'a'
367
+ | 'article'
368
+ | 'aside'
369
+ | 'blockquote'
370
+ | 'body'
371
+ | 'button'
372
+ | 'details'
373
+ | 'div'
374
+ | 'header'
375
+ | 'fieldset'
376
+ | 'figure'
377
+ | 'figcaption'
378
+ | 'footer'
379
+ | 'form'
380
+ | 'html'
381
+ | 'iframe'
382
+ | 'kbd'
383
+ | 'label'
384
+ | 'legend'
385
+ | 'li'
386
+ | 'main'
387
+ | 'nav'
388
+ | 'ol'
389
+ | 'pre'
390
+ | 'section'
391
+ | 'span'
392
+ | 'summary'
393
+ | 'table'
394
+ | 'tbody'
395
+ | 'td'
396
+ | 'tfoot'
397
+ | 'th'
398
+ | 'thead'
399
+ | 'tr'
400
+ | 'ul'
401
+ | ComponentType
465
402
 
466
- /**
467
- * @public
468
- */
469
- export declare interface BoxProps
470
- extends ResponsiveFlexItemProps,
471
- ResponsiveBoxProps,
472
- ResponsiveGridItemProps,
473
- ResponsiveMarginProps,
474
- ResponsivePaddingProps {
475
- as?: React.ElementType | keyof React.JSX.IntrinsicElements
476
- forwardedAs?: React.ElementType | keyof React.JSX.IntrinsicElements
477
- }
403
+ /** @public */
404
+ export declare type BoxOwnProps = BoxStyleProps
478
405
 
479
- /**
480
- * @public
481
- * @deprecated Use `ThemeBoxShadow` from `@sanity/ui/theme` instead.
482
- */
483
- export declare type BoxShadow = ThemeBoxShadow
406
+ /** @public */
407
+ export declare type BoxProps<E extends BoxElementType = BoxElementType> = Props<BoxOwnProps, E>
484
408
 
485
- /**
486
- * @public
487
- */
488
- export declare type BoxSizing = 'content' | 'border'
409
+ /** @beta */
410
+ export declare function Breadcrumbs<
411
+ E extends BreadcrumbsElementType = typeof DEFAULT_BREADCRUMBS_ELEMENT,
412
+ >(props: BreadcrumbsProps<E>): React.JSX.Element
489
413
 
490
- /**
491
- * @beta
492
- */
493
- export declare const Breadcrumbs: ForwardRefExoticComponent<
494
- BreadcrumbsProps &
495
- Omit<HTMLProps<HTMLOListElement>, 'type' | 'ref' | 'as'> &
496
- RefAttributes<HTMLOListElement>
497
- >
414
+ /** @beta */
415
+ export declare type BreadcrumbsElementType = 'div' | 'nav' | ComponentType
498
416
 
499
- /**
500
- * @beta
501
- */
502
- export declare interface BreadcrumbsProps {
417
+ /** @beta */
418
+ export declare type BreadcrumbsOwnProps = GapStyleProps & {
419
+ expandButton?: Omit<ButtonProps, 'as' | 'onClick' | 'selected'>
503
420
  maxLength?: number
504
- separator?: React.ReactNode
505
- space?: number | number[]
421
+ popover?: PopoverProps
422
+ separator?: ReactNode
506
423
  }
507
424
 
508
- /**
509
- * @public
510
- */
511
- export declare const Button: ForwardRefExoticComponent<
512
- Omit<ButtonProps & Omit<HTMLProps<HTMLButtonElement>, 'width' | 'as'>, 'ref'> &
513
- RefAttributes<HTMLButtonElement>
514
- >
425
+ /** @beta */
426
+ export declare type BreadcrumbsProps<E extends BreadcrumbsElementType = BreadcrumbsElementType> =
427
+ Props<BreadcrumbsOwnProps, E>
515
428
 
516
- /**
517
- * @public
518
- */
519
- export declare type ButtonMode = ThemeColorButtonModeKey_2
429
+ /** @public */
430
+ export declare function Button<E extends ButtonElementType = typeof DEFAULT_BUTTON_ELEMENT>(
431
+ props: ButtonProps<E>,
432
+ ): React.JSX.Element
520
433
 
521
- /**
522
- * @public
523
- */
524
- export declare interface ButtonProps extends ResponsivePaddingProps, ResponsiveRadiusProps {
525
- as?: React.ElementType | keyof React.JSX.IntrinsicElements
526
- fontSize?: number | number[]
527
- mode?: ButtonMode
528
- icon?: React.ElementType | React.ReactNode
529
- iconRight?: React.ElementType | React.ReactNode
530
- justify?: FlexJustify | FlexJustify[]
531
- /**
532
- * @beta Do not use in production, as this might change.
533
- */
534
- loading?: boolean
535
- selected?: boolean
536
- space?: number | number[]
537
- muted?: boolean
538
- text?: React.ReactNode
539
- textAlign?: ButtonTextAlign
540
- textWeight?: ThemeFontWeightKey_2
541
- tone?: ButtonTone
542
- type?: 'button' | 'reset' | 'submit'
543
- width?: ButtonWidth
544
- }
434
+ /** @public */
435
+ export declare type ButtonElementType = 'a' | 'button' | 'label' | ComponentType
545
436
 
546
- /**
547
- * @public
548
- */
549
- export declare type ButtonTextAlign = 'left' | 'right' | 'center'
437
+ /** @public */
438
+ export declare interface ButtonOwnProps extends ButtonStyleProps {
439
+ 'data-ui'?: string
440
+ 'fontSize'?: ResponsiveProp<FontTextSize>
441
+ 'icon'?: React.ElementType | React.ReactNode
442
+ 'iconRight'?: React.ElementType | React.ReactNode
443
+ /** @beta Do not use in production, as this might change.*/
444
+ 'loading'?: boolean
445
+ 'muted'?: boolean
446
+ 'selected'?: boolean
447
+ 'textAlign'?: TextOwnProps['align']
448
+ 'text'?: React.ReactNode
449
+ 'textOverflow'?: TextOwnProps['textOverflow']
450
+ 'textWeight'?: TextOwnProps['weight']
451
+ 'tooltip'?: Omit<TooltipProps<'div'>, 'as' | 'children'>
452
+ }
550
453
 
551
- /**
552
- * @public
553
- */
554
- export declare type ButtonTone = ThemeColorStateToneKey
454
+ /** @public */
455
+ export declare type ButtonProps<E extends ButtonElementType = ButtonElementType> = Props<
456
+ ButtonOwnProps,
457
+ E
458
+ >
555
459
 
556
- /**
557
- * @public
558
- */
559
- export declare type ButtonWidth = 'fill'
460
+ /** @public */
461
+ export declare type ButtonTextAlign = 'left' | 'right' | 'center'
560
462
 
561
463
  /**
562
464
  * The `Card` component acts much like a `Box`, but with a background and foreground color.
@@ -564,22 +466,38 @@ export declare type ButtonWidth = 'fill'
564
466
  *
565
467
  * @public
566
468
  */
567
- export declare const Card: ForwardRefExoticComponent<
568
- Omit<CardProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'as'>, 'ref'> &
569
- RefAttributes<HTMLDivElement>
570
- >
469
+ export declare function Card<E extends CardElementType = typeof DEFAULT_CARD_ELEMENT>(
470
+ props: CardProps<E>,
471
+ ): React.JSX.Element
571
472
 
572
- /**
573
- * @public
574
- */
575
- export declare interface CardProps
576
- extends BoxProps,
577
- ResponsiveBorderProps,
578
- ResponsiveRadiusProps,
579
- ResponsiveShadowProps {
473
+ /** @internal */
474
+ export declare type _CardCompatProviderComponent = ComponentType_2<{
475
+ children?: ReactNode
476
+ tone: CardTone | 'inherit'
477
+ scheme: ColorScheme
478
+ }>
479
+
480
+ /** @public */
481
+ export declare interface CardContextValue {
482
+ tone: CardTone
483
+ scheme: ColorScheme
484
+ }
485
+
486
+ /** @public */
487
+ export declare type CardElementType = BoxElementType
488
+
489
+ /** @internal */
490
+ export declare interface _CardInternalContextValue {
491
+ CompatProvider?: _CardCompatProviderComponent
492
+ root: boolean
493
+ }
494
+
495
+ /** @public */
496
+ export declare interface CardOwnProps extends Omit<CardStyleProps, 'tone'> {
580
497
  /**
581
498
  * Do not use in production.
582
499
  * @beta
500
+ * @deprecated Use `__unstable_pattern` instead.
583
501
  */
584
502
  __unstable_checkered?: boolean
585
503
  /**
@@ -587,150 +505,279 @@ export declare interface CardProps
587
505
  * @beta
588
506
  */
589
507
  __unstable_focusRing?: boolean
590
- muted?: boolean
508
+ disabled?: boolean
591
509
  pressed?: boolean
592
- scheme?: ThemeColorSchemeKey_2
593
- tone?: CardTone
510
+ selected?: boolean
511
+ target?: string
512
+ tone?: CardTone | 'inherit'
594
513
  }
595
514
 
596
- /**
597
- * @internal
598
- */
599
- export declare interface CardStyleProps {
600
- $checkered: boolean
601
- $focusRing: boolean
602
- $muted: boolean
603
- $tone: ThemeColorToneKey
604
- }
515
+ /** @public */
516
+ export declare type CardProps<E extends CardElementType = CardElementType> = Props<CardOwnProps, E>
605
517
 
606
- /**
607
- * @public
608
- */
609
- export declare type CardTone = ThemeColorCardToneKey | 'inherit'
518
+ /** @public */
519
+ export declare function CardProvider(props: {
520
+ children?: ReactNode
521
+ tone: CardTone
522
+ scheme: ColorScheme
523
+ }): React.JSX.Element
610
524
 
611
525
  /**
612
526
  * Checkboxes allow the user to select one or more items from a set.
613
527
  *
614
528
  * @public
615
529
  */
616
- export declare const Checkbox: ForwardRefExoticComponent<
617
- Omit<Omit<HTMLProps<HTMLInputElement>, 'type' | 'as'> & CheckboxProps, 'ref'> &
618
- RefAttributes<HTMLInputElement>
619
- >
530
+ export declare function Checkbox<E extends CheckboxElementType = typeof DEFAULT_CHECKBOX_ELEMENT>(
531
+ props: CheckboxProps<E>,
532
+ ): React.JSX.Element
620
533
 
621
- /**
622
- * @public
623
- */
624
- export declare interface CheckboxProps {
534
+ /** @public */
535
+ export declare type CheckboxElementType = 'input' | ComponentType
536
+
537
+ /** @public */
538
+ export declare type CheckboxOwnProps = {
625
539
  indeterminate?: boolean
626
540
  customValidity?: string
627
541
  }
628
542
 
629
- /**
630
- * @public
631
- */
632
- export declare type ClickOutsideElements = (HTMLElement | null | (HTMLElement | null)[])[]
543
+ /** @public */
544
+ export declare type CheckboxProps<E extends CheckboxElementType = CheckboxElementType> = Props<
545
+ CheckboxOwnProps,
546
+ E
547
+ >
633
548
 
634
- /**
635
- * @public
636
- */
549
+ /** @public */
637
550
  export declare type ClickOutsideEventElements = (HTMLElement | null | (HTMLElement | null)[])[]
638
551
 
639
- /**
640
- * @public
641
- */
552
+ /** @public */
642
553
  export declare type ClickOutsideEventListener = (event: MouseEvent) => void
643
554
 
644
- /**
645
- * @public
646
- */
647
- export declare type ClickOutsideListener = (event: MouseEvent) => void
555
+ /** @public */
556
+ export declare function Code<E extends CodeElementType = typeof DEFAULT_CODE_ELEMENT>(
557
+ props: CodeProps<E>,
558
+ ): React.JSX.Element
648
559
 
649
- /**
650
- * @public
651
- */
652
- export declare const Code: ForwardRefExoticComponent<
653
- Omit<CodeProps & Omit<HTMLProps<HTMLElement>, 'size' | 'as'>, 'ref'> & RefAttributes<HTMLElement>
654
- >
560
+ /** @public */
561
+ export declare type CodeElementType = 'div' | 'pre' | ComponentType
655
562
 
656
- /**
657
- * @public
658
- */
659
- export declare interface CodeProps {
660
- as?: React.ElementType | keyof React.JSX.IntrinsicElements
563
+ /** @public */
564
+ export declare type CodeOwnProps = CodeStyleProps & {
661
565
  /** Define the language to use for syntax highlighting. */
662
566
  language?: string
663
- size?: number | number[]
664
- weight?: string
665
567
  }
666
568
 
667
- /**
668
- * This API might change. DO NOT USE IN PRODUCTION.
669
- * @beta
670
- */
671
- export declare const CodeSkeleton: ForwardRefExoticComponent<
672
- Omit<
673
- CodeSkeletonProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'size' | 'children' | 'as'>,
674
- 'ref'
675
- > &
676
- RefAttributes<HTMLDivElement>
677
- >
569
+ /** @public */
570
+ export declare type CodeProps<E extends CodeElementType = CodeElementType> = Props<CodeOwnProps, E>
678
571
 
679
572
  /**
680
573
  * This API might change. DO NOT USE IN PRODUCTION.
681
574
  * @beta
682
575
  */
683
- export declare interface CodeSkeletonProps extends SkeletonProps {
684
- size?: number | number[]
576
+ export declare function CodeSkeleton<
577
+ E extends CodeSkeletonElementType = typeof DEFAULT_CODE_SKELETON_ELEMENT,
578
+ >(props: CodeSkeletonProps<E>): React.JSX.Element
579
+
580
+ /** @beta */
581
+ export declare type CodeSkeletonElementType = SkeletonElementType
582
+
583
+ /** @beta */
584
+ export declare type CodeSkeletonOwnProps = SkeletonOwnProps & {
585
+ size?: ResponsiveProp<FontCodeSize>
685
586
  }
686
587
 
687
588
  /**
688
- * @internal
689
- * @deprecated this component will be removed in the next major release
589
+ * This API might change. DO NOT USE IN PRODUCTION.
590
+ * @beta
690
591
  */
691
- export declare function ConditionalWrapper({
692
- children,
693
- condition,
694
- wrapper,
695
- }: {
696
- children: React.ReactNode
697
- condition: boolean
698
- wrapper: (children: React.ReactNode) => React.ReactNode
699
- }): React.ReactNode
592
+ export declare type CodeSkeletonProps<E extends CodeSkeletonElementType = CodeSkeletonElementType> =
593
+ Props<CodeSkeletonOwnProps, E>
700
594
 
701
- export declare namespace ConditionalWrapper {
702
- var displayName: string
703
- }
595
+ /** @public */
596
+ export declare type ComponentType<P = any> =
597
+ | React.FunctionComponent<P>
598
+ | React.ComponentClass<P>
599
+ | React.ExoticComponent<P>
704
600
 
705
601
  /**
706
602
  * The `Container` component wraps content layout in a defined set of widths.
707
603
  *
708
604
  * @public
709
605
  */
710
- export declare const Container: ForwardRefExoticComponent<
711
- Omit<ContainerProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'width' | 'as'>, 'ref'> &
712
- RefAttributes<HTMLDivElement>
713
- >
606
+ export declare function Container<
607
+ E extends ContainerElementType = typeof DEFAULT_CONTAINER_ELEMENT,
608
+ >(props: ContainerProps<E>): React.JSX.Element
714
609
 
715
- /**
716
- * @public
717
- */
718
- export declare interface ContainerProps extends BoxProps, ResponsiveWidthProps {}
610
+ /** @public */
611
+ export declare type ContainerElementType = BoxElementType
612
+
613
+ /** @public */
614
+ export declare type ContainerOwnProps = ContainerStyleProps
615
+
616
+ /** @public */
617
+ export declare type ContainerProps<E extends ContainerElementType = ContainerElementType> = Props<
618
+ ContainerOwnProps,
619
+ E
620
+ >
719
621
 
720
622
  /**
721
623
  * @internal
722
624
  */
723
625
  export declare function containsOrEqualsElement(element: HTMLElement, node: Node): boolean
724
626
 
725
- /**
726
- * @public
727
- * @deprecated Use `createColorTheme` from `@sanity/ui/theme` instead.
728
- */
729
- export declare const createColorTheme: typeof createColorTheme_2
627
+ /** @public */
628
+ export declare const DEFAULT_AUTOCOMPLETE_ELEMENT = 'input'
730
629
 
731
- /**
732
- * @public
733
- */
630
+ /** @public */
631
+ export declare const DEFAULT_AVATAR_COUNTER_ELEMENT = 'span'
632
+
633
+ /** @public */
634
+ export declare const DEFAULT_AVATAR_ELEMENT = 'span'
635
+
636
+ /** @public */
637
+ export declare const DEFAULT_AVATAR_STACK_ELEMENT = 'span'
638
+
639
+ /** @public */
640
+ export declare const DEFAULT_BADGE_ELEMENT = 'span'
641
+
642
+ /** @public */
643
+ export declare const DEFAULT_BOX_ELEMENT = 'div'
644
+
645
+ /** @beta */
646
+ export declare const DEFAULT_BREADCRUMBS_ELEMENT = 'nav'
647
+
648
+ /** @public */
649
+ export declare const DEFAULT_BUTTON_ELEMENT = 'button'
650
+
651
+ /** @public */
652
+ export declare const DEFAULT_CARD_ELEMENT = 'div'
653
+
654
+ /** @public */
655
+ export declare const DEFAULT_CHECKBOX_ELEMENT = 'input'
656
+
657
+ /** @public */
658
+ export declare const DEFAULT_CODE_ELEMENT = 'pre'
659
+
660
+ /** @beta */
661
+ export declare const DEFAULT_CODE_SKELETON_ELEMENT = 'div'
662
+
663
+ /** @public */
664
+ export declare const DEFAULT_CONTAINER_ELEMENT = 'div'
665
+
666
+ /** @public */
667
+ export declare const DEFAULT_DIALOG_ELEMENT = 'div'
668
+
669
+ /** @beta */
670
+ export declare const DEFAULT_ELEMENT_QUERY_ELEMENT = 'div'
671
+
672
+ /** @public */
673
+ export declare const DEFAULT_FLEX_ELEMENT = 'div'
674
+
675
+ /** @public */
676
+ export declare const DEFAULT_GRID_ELEMENT = 'div'
677
+
678
+ /** @public */
679
+ export declare const DEFAULT_HEADING_ELEMENT = 'div'
680
+
681
+ /** @beta */
682
+ export declare const DEFAULT_HEADING_SKELETON_ELEMENT = 'div'
683
+
684
+ /** @public */
685
+ export declare const DEFAULT_HOTKEYS_ELEMENT = 'kbd'
686
+
687
+ /** @public */
688
+ export declare const DEFAULT_INLINE_CODE_ELEMENT = 'code'
689
+
690
+ /** @public */
691
+ export declare const DEFAULT_INLINE_ELEMENT = 'div'
692
+
693
+ /** @public */
694
+ export declare const DEFAULT_KBD_ELEMENT = 'kbd'
695
+
696
+ /** @public */
697
+ export declare const DEFAULT_LABEL_ELEMENT = 'div'
698
+
699
+ /** @beta */
700
+ export declare const DEFAULT_LABEL_SKELETON_ELEMENT = 'div'
701
+
702
+ /** @public */
703
+ export declare const DEFAULT_LAYER_ELEMENT = 'div'
704
+
705
+ /** @public */
706
+ export declare const DEFAULT_MENU_DIVIDER_ELEMENT = 'hr'
707
+
708
+ /** @public */
709
+ export declare const DEFAULT_MENU_ELEMENT = 'div'
710
+
711
+ /** @public */
712
+ export declare const DEFAULT_MENU_GROUP_ELEMENT = 'button'
713
+
714
+ /** @public */
715
+ export declare const DEFAULT_MENU_ITEM_ELEMENT = 'button'
716
+
717
+ /** @public */
718
+ export declare const DEFAULT_RADIO_ELEMENT = 'input'
719
+
720
+ /** @public */
721
+ export declare const DEFAULT_ROOT_ELEMENT = 'html'
722
+
723
+ /** @public */
724
+ export declare const DEFAULT_SELECT_ELEMENT = 'select'
725
+
726
+ /** @public */
727
+ export declare const DEFAULT_SELECTABLE_ELEMENT = 'button'
728
+
729
+ /** @beta */
730
+ export declare const DEFAULT_SKELETON_ELEMENT = 'div'
731
+
732
+ /** @public */
733
+ export declare const DEFAULT_SPINNER_ELEMENT = 'div'
734
+
735
+ /** @public */
736
+ export declare const DEFAULT_SR_ONLY_ELEMENT = 'span'
737
+
738
+ /** @public */
739
+ export declare const DEFAULT_STACK_ELEMENT = 'div'
740
+
741
+ /** @public */
742
+ export declare const DEFAULT_SWITCH_ELEMENT = 'input'
743
+
744
+ /** @public */
745
+ export declare const DEFAULT_TAB_ELEMENT = 'button'
746
+
747
+ /** @public */
748
+ export declare const DEFAULT_TAB_LIST_ELEMENT = 'div'
749
+
750
+ /** @public */
751
+ export declare const DEFAULT_TAB_PANEL_ELEMENT = 'div'
752
+
753
+ /** @public */
754
+ export declare const DEFAULT_TEXT_AREA_ELEMENT = 'textarea'
755
+
756
+ /** @public */
757
+ export declare const DEFAULT_TEXT_ELEMENT = 'div'
758
+
759
+ /** @public */
760
+ export declare const DEFAULT_TEXT_INPUT_ELEMENT = 'input'
761
+
762
+ /** @beta */
763
+ export declare const DEFAULT_TEXT_SKELETON_ELEMENT = 'div'
764
+
765
+ /** @internal */
766
+ export declare const DEFAULT_TOAST_ELEMENT = 'li'
767
+
768
+ /** @public */
769
+ export declare const DEFAULT_TOOLTIP_ELEMENT = 'div'
770
+
771
+ /** @beta */
772
+ export declare const DEFAULT_TREE_ELEMENT = 'div'
773
+
774
+ /** @beta */
775
+ export declare const DEFAULT_TREE_ITEM_ELEMENT = 'a'
776
+
777
+ /** @beta */
778
+ export declare const DEFAULT_VIRTUAL_LIST_ELEMENT = 'div'
779
+
780
+ /** @public */
734
781
  export declare type Delay =
735
782
  | number
736
783
  | Partial<{
@@ -743,10 +790,9 @@ export declare type Delay =
743
790
  *
744
791
  * @public
745
792
  */
746
- export declare const Dialog: ForwardRefExoticComponent<
747
- Omit<DialogProps & Omit<HTMLProps<HTMLDivElement>, 'id' | 'width' | 'as'>, 'ref'> &
748
- RefAttributes<HTMLDivElement>
749
- >
793
+ export declare function Dialog<E extends DialogElementType = typeof DEFAULT_DIALOG_ELEMENT>(
794
+ props: DialogProps<E>,
795
+ ): React.JSX.Element
750
796
 
751
797
  /**
752
798
  * @internal
@@ -759,19 +805,18 @@ export declare const DialogContext: Context<DialogContextValue>
759
805
  */
760
806
  export declare interface DialogContextValue {
761
807
  version: 0.0
762
- position?: DialogPosition | DialogPosition[]
763
- zOffset?: number | number[]
808
+ position?: ResponsiveProp<DialogPosition>
809
+ zOffset?: ResponsiveProp<number>
764
810
  }
765
811
 
766
- /**
767
- * @public
768
- */
769
- export declare type DialogPosition = 'absolute' | 'fixed'
812
+ /** @public */
813
+ export declare type DialogElementType = 'div' | 'span' | ComponentType
770
814
 
771
- /**
772
- * @public
773
- */
774
- export declare interface DialogProps extends ResponsivePaddingProps, ResponsiveWidthProps {
815
+ /** @public */
816
+ export declare interface DialogOwnProps
817
+ extends
818
+ Omit<ContainerStyleProps, 'id' | 'position' | 'radius' | 'shadow'>,
819
+ Omit<LayerOwnProps, 'id' | 'position' | 'radius' | 'shadow' | 'width'> {
775
820
  /**
776
821
  * @beta
777
822
  */
@@ -780,57 +825,81 @@ export declare interface DialogProps extends ResponsivePaddingProps, ResponsiveW
780
825
  * @beta
781
826
  */
782
827
  __unstable_hideCloseButton?: boolean
783
- cardRadius?: Radius | Radius[]
784
- cardShadow?: number | number[]
785
- contentRef?: React.ForwardedRef<HTMLDivElement>
786
- footer?: React.ReactNode
787
- header?: React.ReactNode
828
+ /**
829
+ * Whether the dialog should animate in on mount.
830
+ *
831
+ * @beta
832
+ * @defaultValue false
833
+ */
834
+ animate?: boolean
835
+ cardRadius?: ResponsiveProp<Radius>
836
+ contentRef?: ForwardedRef<HTMLDivElement>
837
+ footer?: ReactNode
838
+ header?: ReactNode
788
839
  id: string
789
840
  /** A callback that fires when the dialog becomes the top layer when it was not the top layer before. */
790
841
  onActivate?: LayerProps['onActivate']
791
842
  onClickOutside?: () => void
792
843
  onClose?: () => void
844
+ open?: boolean
793
845
  portal?: string
794
- position?: DialogPosition | DialogPosition[]
795
- scheme?: ThemeColorSchemeKey_2
796
- zOffset?: number | number[]
846
+ position?: ResponsiveProp<DialogPosition>
797
847
  /**
798
- * Whether the dialog should animate in on mount.
799
- *
800
- * @beta
801
- * @defaultValue false
848
+ * @deprecated Not in use will be removed in the next major version.
802
849
  */
803
- animate?: boolean
850
+ shadow?: ResponsiveProp<Shadow>
804
851
  }
805
852
 
853
+ /** @public */
854
+ export declare type DialogPosition = 'absolute' | 'fixed'
855
+
856
+ /** @public */
857
+ export declare type DialogProps<E extends DialogElementType = DialogElementType> = Props<
858
+ DialogOwnProps,
859
+ E
860
+ >
861
+
806
862
  /**
807
863
  * This API might change. DO NOT USE IN PRODUCTION.
808
864
  * @beta
809
865
  */
810
866
  export declare function DialogProvider(props: DialogProviderProps): React.JSX.Element
811
867
 
812
- export declare namespace DialogProvider {
813
- var displayName: string
814
- }
815
-
816
868
  /**
817
869
  * This API might change. DO NOT USE IN PRODUCTION.
818
870
  * @beta
819
871
  */
820
872
  export declare interface DialogProviderProps {
821
- children?: React.ReactNode
822
- position?: DialogPosition | DialogPosition[]
823
- zOffset?: number | number[]
873
+ children?: ReactNode
874
+ position?: ResponsiveProp<DialogPosition>
875
+ zOffset?: ResponsiveProp<number>
824
876
  }
825
877
 
826
878
  /**
827
879
  * DO NOT USE IN PRODUCTION.
828
880
  * @beta
829
881
  */
830
- export declare const ElementQuery: ForwardRefExoticComponent<
831
- Omit<MediaQueryProps & Omit<HTMLProps<HTMLDivElement>, 'media' | 'as'>, 'ref'> &
832
- RefAttributes<HTMLDivElement>
833
- >
882
+ export declare function ElementQuery<
883
+ E extends ElementQueryElementType = typeof DEFAULT_ELEMENT_QUERY_ELEMENT,
884
+ >(props: ElementQueryProps<E>): React.JSX.Element
885
+
886
+ /** @beta */
887
+ export declare type ElementQueryElementType = 'div' | ComponentType
888
+
889
+ /**
890
+ * DO NOT USE IN PRODUCTION.
891
+ * @beta
892
+ */
893
+ export declare type ElementQueryOwnProps = {
894
+ media?: number[]
895
+ }
896
+
897
+ /**
898
+ * DO NOT USE IN PRODUCTION.
899
+ * @beta
900
+ */
901
+ export declare type ElementQueryProps<E extends ElementQueryElementType = ElementQueryElementType> =
902
+ Props<ElementQueryOwnProps, E>
834
903
 
835
904
  /**
836
905
  * @beta
@@ -874,15 +943,22 @@ export declare const _elementSizeObserver: _ElementSizeObserver
874
943
  */
875
944
  export declare type _ElementSizeSubscriber = (elementRect: ElementSize) => void
876
945
 
946
+ /** @public */
947
+ export declare type ElementType<P> = TagType | ComponentType<P>
948
+
949
+ /** @public */
950
+ export declare type EmptyProps = {}
951
+
877
952
  /**
878
953
  * DO NOT USE IN PRODUCTION
879
954
  * @beta
880
955
  */
881
956
  export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
882
957
  state: ErrorBoundaryState
958
+ static displayName: string
883
959
  static getDerivedStateFromError(error: Error): ErrorBoundaryState
884
- componentDidCatch(error: Error, info: React.ErrorInfo): void
885
- render(): React.ReactNode
960
+ componentDidCatch(error: Error, info: ErrorInfo): void
961
+ render(): ReactNode
886
962
  }
887
963
 
888
964
  /**
@@ -890,7 +966,7 @@ export declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBo
890
966
  * @beta
891
967
  */
892
968
  export declare type ErrorBoundaryProps = PropsWithChildren<{
893
- onCatch: (params: {error: Error; info: React.ErrorInfo}) => void
969
+ onCatch: (params: {error: Error; info: ErrorInfo}) => void
894
970
  }>
895
971
 
896
972
  /**
@@ -901,64 +977,23 @@ export declare interface ErrorBoundaryState {
901
977
  error: Error | null
902
978
  }
903
979
 
904
- /**
905
- * @internal
906
- */
907
- export declare function _fillCSSObject(
908
- keys: string[],
909
- value: string | number | CSSObject,
910
- ): CSSObject
911
-
912
980
  /**
913
981
  * The `Flex` component is a wrapper component for flexible elements (`Box`, `Card` and `Flex`).
914
982
  *
915
983
  * @public
916
984
  */
917
- export declare const Flex: ForwardRefExoticComponent<
918
- Omit<FlexProps & Omit<HTMLProps<HTMLDivElement>, 'wrap' | 'as'>, 'ref'> &
919
- RefAttributes<HTMLDivElement>
920
- >
921
-
922
- /**
923
- * @public
924
- */
925
- export declare type FlexAlign = 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch'
926
-
927
- /**
928
- * @public
929
- */
930
- export declare type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse'
931
-
932
- /**
933
- * @public
934
- */
935
- export declare type FlexJustify =
936
- | 'flex-start'
937
- | 'flex-end'
938
- | 'center'
939
- | 'space-between'
940
- | 'space-around'
941
- | 'space-evenly'
985
+ export declare function Flex<E extends FlexElementType = typeof DEFAULT_FLEX_ELEMENT>(
986
+ props: FlexProps<E>,
987
+ ): React.JSX.Element
942
988
 
943
- /**
944
- * @public
945
- */
946
- export declare interface FlexProps
947
- extends Omit<BoxProps, 'display'>,
948
- ResponsiveFlexProps,
949
- ResponsiveFlexItemProps {
950
- gap?: number | number[]
951
- }
989
+ /** @public */
990
+ export declare type FlexElementType = BoxElementType
952
991
 
953
- /**
954
- * @public
955
- */
956
- export declare type FlexValue = number | 'none' | 'auto' | 'initial'
992
+ /** @public */
993
+ export declare type FlexOwnProps = FlexStyleProps
957
994
 
958
- /**
959
- * @public
960
- */
961
- export declare type FlexWrap = 'wrap' | 'wrap-reverse' | 'nowrap'
995
+ /** @public */
996
+ export declare type FlexProps<E extends FlexElementType = FlexElementType> = Props<FlexOwnProps, E>
962
997
 
963
998
  /**
964
999
  * @internal
@@ -973,192 +1008,154 @@ export declare function focusLastDescendant(element: HTMLElement): boolean
973
1008
  /**
974
1009
  * @internal
975
1010
  */
976
- export declare interface FontWeightStyleProps {
977
- $weight?: ThemeFontWeightKey_2
978
- }
1011
+ export declare function _getResponsiveProp<T>(
1012
+ val: ResponsiveProp<T> | undefined,
1013
+ defaultVal?: ResponsivePropArray<T>,
1014
+ ): ResponsivePropArray<T>
979
1015
 
980
1016
  /**
981
- * @internal
1017
+ * The `Grid` component is for building 2-dimensional layers (based on CSS grid).
1018
+ *
1019
+ * @public
982
1020
  */
983
- export declare function _getArrayProp<T = number>(val: T | T[] | undefined, defaultVal?: T[]): T[]
1021
+ export declare function Grid<E extends GridElementType = typeof DEFAULT_GRID_ELEMENT>(
1022
+ props: GridProps<E>,
1023
+ ): React.JSX.Element
1024
+
1025
+ /** @public */
1026
+ export declare type GridElementType = BoxElementType
1027
+
1028
+ /** @public */
1029
+ export declare type GridOwnProps = GridStyleProps
1030
+
1031
+ /** @public */
1032
+ export declare type GridProps<E extends GridElementType = GridElementType> = Props<GridOwnProps, E>
984
1033
 
985
1034
  /**
986
1035
  * @internal
987
1036
  */
988
- export declare function _getResponsiveSpace(
989
- theme: Theme_2,
990
- props: string[],
991
- spaceIndexes?: number[],
992
- ): CSSObject[] | null
1037
+ export declare function _hasFocus(element: HTMLElement): boolean
993
1038
 
994
1039
  /**
995
- * The `Grid` component is for building 2-dimensional layers (based on CSS grid).
1040
+ * Typographic headings.
996
1041
  *
997
1042
  * @public
998
1043
  */
999
- export declare const Grid: ForwardRefExoticComponent<
1000
- Omit<GridProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'as' | 'rows'>, 'ref'> &
1001
- RefAttributes<HTMLDivElement>
1044
+ export declare function Heading<E extends HeadingElementType = typeof DEFAULT_HEADING_ELEMENT>(
1045
+ props: HeadingProps<E>,
1046
+ ): React.JSX.Element
1047
+
1048
+ /** @public */
1049
+ export declare type HeadingElementType =
1050
+ | 'div'
1051
+ | 'h1'
1052
+ | 'h2'
1053
+ | 'h3'
1054
+ | 'h4'
1055
+ | 'h5'
1056
+ | 'h6'
1057
+ | 'label'
1058
+ | 'span'
1059
+ | ComponentType
1060
+
1061
+ /** @public */
1062
+ export declare type HeadingOwnProps = HeadingStyleProps & TextOverflowStyleProps
1063
+
1064
+ /** @public */
1065
+ export declare type HeadingProps<E extends HeadingElementType = HeadingElementType> = Props<
1066
+ HeadingOwnProps,
1067
+ E
1002
1068
  >
1003
1069
 
1004
1070
  /**
1005
- * @public
1071
+ * This API might change. DO NOT USE IN PRODUCTION.
1072
+ * @beta
1006
1073
  */
1007
- export declare type GridAutoCols = 'auto' | 'min' | 'max' | 'fr'
1074
+ export declare function HeadingSkeleton<
1075
+ E extends HeadingSkeletonElementType = typeof DEFAULT_HEADING_SKELETON_ELEMENT,
1076
+ >(props: HeadingSkeletonProps<E>): React.JSX.Element
1008
1077
 
1009
- /**
1010
- * @public
1011
- */
1012
- export declare type GridAutoFlow = 'row' | 'column' | 'row dense' | 'column dense'
1078
+ /** @beta */
1079
+ export declare type HeadingSkeletonElementType = SkeletonElementType
1080
+
1081
+ /** @beta */
1082
+ export declare type HeadingSkeletonOwnProps = SkeletonOwnProps & {
1083
+ size?: ResponsiveProp<FontHeadingSize>
1084
+ }
1013
1085
 
1014
1086
  /**
1015
- * @public
1087
+ * This API might change. DO NOT USE IN PRODUCTION.
1088
+ * @beta
1016
1089
  */
1017
- export declare type GridAutoRows = 'auto' | 'min' | 'max' | 'fr'
1090
+ export declare type HeadingSkeletonProps<
1091
+ E extends HeadingSkeletonElementType = HeadingSkeletonElementType,
1092
+ > = Props<HeadingSkeletonOwnProps, E>
1018
1093
 
1019
1094
  /**
1020
- * @public
1021
- */
1022
- export declare type GridItemColumn = 'auto' | 'full' | number
1023
-
1024
- /**
1025
- * @public
1026
- */
1027
- export declare type GridItemColumnEnd = 'auto' | number
1028
-
1029
- /**
1030
- * @public
1031
- */
1032
- export declare type GridItemColumnStart = 'auto' | number
1033
-
1034
- /**
1035
- * @public
1036
- */
1037
- export declare type GridItemRow = 'auto' | 'full' | number
1038
-
1039
- /**
1040
- * @public
1041
- */
1042
- export declare type GridItemRowEnd = 'auto' | number
1043
-
1044
- /**
1045
- * @public
1046
- */
1047
- export declare type GridItemRowStart = 'auto' | number
1048
-
1049
- /**
1050
- * @public
1051
- */
1052
- export declare interface GridProps extends Omit<BoxProps, 'display'>, ResponsiveGridProps {}
1053
-
1054
- /**
1055
- * @internal
1056
- */
1057
- export declare function _hasFocus(element: HTMLElement): boolean
1058
-
1059
- /**
1060
- * Typographic headings.
1095
+ * Represent hotkeys (a keyboard combination) with semantic `<kbd>` elements.
1096
+ *
1097
+ * @example
1098
+ * ```tsx
1099
+ * import {Hotkeys} from '@sanity/ui'
1100
+ *
1101
+ * <Hotkeys keys={['⌘', 'K']} />
1102
+ * ```
1061
1103
  *
1062
1104
  * @public
1063
1105
  */
1064
- export declare const Heading: ForwardRefExoticComponent<
1065
- Omit<HeadingProps & Omit<HTMLProps<HTMLElement>, 'size' | 'as'>, 'ref'> &
1066
- RefAttributes<HTMLElement>
1067
- >
1068
-
1069
- /**
1070
- * @public
1071
- */
1072
- export declare interface HeadingProps {
1073
- accent?: boolean
1074
- align?: TextAlign | TextAlign[]
1075
- as?: React.ElementType | keyof React.JSX.IntrinsicElements
1076
- muted?: boolean
1077
- size?: number | number[]
1078
- /**
1079
- * Controls how overflowing text is treated.
1080
- * Use `textOverflow="ellipsis"` to render text as a single line which is concatenated with a `…` symbol.
1081
- * @beta
1082
- */
1083
- textOverflow?: 'ellipsis'
1084
- weight?: ThemeFontWeightKey_2
1085
- }
1106
+ export declare function Hotkeys<E extends HotkeysElementType = typeof DEFAULT_HOTKEYS_ELEMENT>(
1107
+ props: HotkeysProps<E>,
1108
+ ): React.JSX.Element | undefined
1086
1109
 
1087
- /**
1088
- * This API might change. DO NOT USE IN PRODUCTION.
1089
- * @beta
1090
- */
1091
- export declare const HeadingSkeleton: ForwardRefExoticComponent<
1092
- Omit<
1093
- HeadingSkeletonProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'size' | 'children' | 'as'>,
1094
- 'ref'
1095
- > &
1096
- RefAttributes<HTMLDivElement>
1097
- >
1110
+ /** @public */
1111
+ export declare type HotkeysElementType = 'kbd' | ComponentType
1098
1112
 
1099
- /**
1100
- * This API might change. DO NOT USE IN PRODUCTION.
1101
- * @beta
1102
- */
1103
- export declare interface HeadingSkeletonProps extends SkeletonProps {
1104
- size?: number | number[]
1113
+ /** @public */
1114
+ export declare interface HotkeysOwnProps extends GapStyleProps, RadiusStyleProps {
1115
+ /** @deprecated No longer supported. */
1116
+ fontSize?: never
1117
+ /** @deprecated No longer supported. */
1118
+ padding?: never
1119
+ keys: string[]
1105
1120
  }
1106
1121
 
1107
- /**
1108
- * @public
1109
- * @deprecated Use `hexToRgb` from `@sanity/ui/theme` instead.
1110
- */
1111
- export declare const hexToRgb: typeof hexToRgb_2
1122
+ /** @public */
1123
+ export declare type HotkeysProps<E extends HotkeysElementType = HotkeysElementType> = Props<
1124
+ HotkeysOwnProps,
1125
+ E
1126
+ >
1112
1127
 
1113
1128
  /**
1114
- * Represent hotkeys (a keyboard combination) with semantic `<kbd>` elements.
1129
+ * The `Inline` component is a layout utility for aligning and spacing items horizontally.
1115
1130
  *
1116
1131
  * @public
1117
1132
  */
1118
- export declare const Hotkeys: ForwardRefExoticComponent<
1119
- HotkeysProps & Omit<HTMLProps<HTMLElement>, 'size' | 'ref' | 'as'> & RefAttributes<HTMLElement>
1120
- >
1133
+ export declare function Inline<E extends InlineElementType = typeof DEFAULT_INLINE_ELEMENT>(
1134
+ props: InlineProps<E>,
1135
+ ): React.JSX.Element
1121
1136
 
1122
- /**
1123
- * @public
1124
- */
1125
- export declare interface HotkeysProps {
1126
- fontSize?: number | number[]
1127
- padding?: number | number[]
1128
- radius?: Radius | Radius[]
1129
- space?: number | number[]
1130
- keys?: string[]
1137
+ /** @public */
1138
+ export declare function InlineCode(props: InlineCodeProps): React.JSX.Element
1139
+
1140
+ /** @public */
1141
+ export declare interface InlineCodeProps {
1142
+ children: React.ReactNode
1143
+ /** Language to use for syntax highlighting. */
1144
+ language?: string
1131
1145
  }
1132
1146
 
1133
- /**
1134
- * @public
1135
- * @deprecated Use `HSL` from `@sanity/ui/theme` instead.
1136
- */
1137
- export declare type HSL = HSL_2
1147
+ /** @public */
1148
+ export declare type InlineElementType = BoxElementType
1138
1149
 
1139
- /**
1140
- * @public
1141
- * @deprecated Use `hslToRgb` from `@sanity/ui/theme` instead.
1142
- */
1143
- export declare const hslToRgb: typeof hslToRgb_2
1150
+ /** @public */
1151
+ export declare type InlineOwnProps = InlineStyleProps
1144
1152
 
1145
- /**
1146
- * The `Inline` component is a layout utility for aligning and spacing items horizontally.
1147
- *
1148
- * @public
1149
- */
1150
- export declare const Inline: ForwardRefExoticComponent<
1151
- Omit<InlineProps & HTMLProps<HTMLDivElement>, 'ref'> & RefAttributes<unknown>
1153
+ /** @public */
1154
+ export declare type InlineProps<E extends InlineElementType = InlineElementType> = Props<
1155
+ InlineOwnProps,
1156
+ E
1152
1157
  >
1153
1158
 
1154
- /**
1155
- * @public
1156
- */
1157
- export declare interface InlineProps extends Omit<BoxProps, 'display'> {
1158
- /** The spacing between children. */
1159
- space?: number | number[]
1160
- }
1161
-
1162
1159
  /**
1163
1160
  * @internal
1164
1161
  */
@@ -1209,74 +1206,80 @@ export declare function _isScrollable(el: Node): boolean
1209
1206
  *
1210
1207
  * @public
1211
1208
  */
1212
- export declare const KBD: ForwardRefExoticComponent<
1213
- KBDProps & Omit<HTMLProps<HTMLElement>, 'size' | 'ref' | 'as'> & RefAttributes<HTMLDivElement>
1214
- >
1209
+ export declare function KBD<E extends KBDElementType = typeof DEFAULT_KBD_ELEMENT>(
1210
+ props: KBDProps<E>,
1211
+ ): React.JSX.Element
1215
1212
 
1216
- /**
1217
- * @public
1218
- */
1219
- export declare interface KBDProps {
1220
- as?: React.ElementType | keyof React.JSX.IntrinsicElements
1221
- fontSize?: number | number[]
1222
- padding?: number | number[]
1223
- radius?: Radius | Radius[]
1224
- }
1213
+ /** @public */
1214
+ export declare type KBDElementType = 'kbd' | ComponentType
1215
+
1216
+ /** @public */
1217
+ export declare type KBDOwnProps = KBDStyleProps
1218
+
1219
+ /** @public */
1220
+ export declare type KBDProps<E extends KBDElementType = KBDElementType> = Props<KBDOwnProps, E>
1225
1221
 
1226
1222
  /**
1227
1223
  * Typographic labels.
1228
1224
  *
1229
1225
  * @public
1230
1226
  */
1231
- export declare const Label: ForwardRefExoticComponent<
1232
- Omit<LabelProps & Omit<HTMLProps<HTMLDivElement>, 'size' | 'as'>, 'ref'> &
1233
- RefAttributes<HTMLDivElement>
1234
- >
1227
+ export declare function Label<E extends LabelElementType = typeof DEFAULT_LABEL_ELEMENT>(
1228
+ props: LabelProps<E>,
1229
+ ): React.JSX.Element
1235
1230
 
1236
- /**
1237
- * @public
1238
- */
1239
- export declare interface LabelProps {
1240
- accent?: boolean
1241
- align?: TextAlign | TextAlign[]
1242
- as?: React.ElementType | keyof React.JSX.IntrinsicElements
1243
- muted?: boolean
1244
- size?: number | number[]
1245
- /**
1246
- * Controls how overflowing text is treated.
1247
- * Use `textOverflow="ellipsis"` to render text as a single line which is concatenated with a `…` symbol.
1248
- * @beta
1249
- */
1250
- textOverflow?: 'ellipsis'
1251
- weight?: ThemeFontWeightKey_2
1252
- }
1231
+ /** @public */
1232
+ export declare type LabelElementType =
1233
+ | 'div'
1234
+ | 'h1'
1235
+ | 'h2'
1236
+ | 'h3'
1237
+ | 'h4'
1238
+ | 'h5'
1239
+ | 'h6'
1240
+ | 'label'
1241
+ | 'li'
1242
+ | 'p'
1243
+ | 'span'
1244
+ | ComponentType
1253
1245
 
1254
- /**
1255
- * This API might change. DO NOT USE IN PRODUCTION.
1256
- * @beta
1257
- */
1258
- export declare const LabelSkeleton: ForwardRefExoticComponent<
1259
- Omit<
1260
- LabelSkeletonProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'size' | 'children' | 'as'>,
1261
- 'ref'
1262
- > &
1263
- RefAttributes<HTMLDivElement>
1246
+ /** @public */
1247
+ export declare type LabelOwnProps = LabelStyleProps & TextOverflowStyleProps
1248
+
1249
+ /** @public */
1250
+ export declare type LabelProps<E extends LabelElementType = LabelElementType> = Props<
1251
+ LabelOwnProps,
1252
+ E
1264
1253
  >
1265
1254
 
1266
1255
  /**
1267
1256
  * This API might change. DO NOT USE IN PRODUCTION.
1268
1257
  * @beta
1269
1258
  */
1270
- export declare interface LabelSkeletonProps extends SkeletonProps {
1271
- size?: number | number[]
1259
+ export declare function LabelSkeleton<
1260
+ E extends LabelSkeletonElementType = typeof DEFAULT_LABEL_SKELETON_ELEMENT,
1261
+ >(props: LabelSkeletonProps<E>): React.JSX.Element
1262
+
1263
+ /** @beta */
1264
+ export declare type LabelSkeletonElementType = SkeletonElementType
1265
+
1266
+ /** @beta */
1267
+ export declare type LabelSkeletonOwnProps = SkeletonOwnProps & {
1268
+ size?: ResponsiveProp<FontLabelSize>
1272
1269
  }
1273
1270
 
1274
1271
  /**
1275
- * @public
1272
+ * This API might change. DO NOT USE IN PRODUCTION.
1273
+ * @beta
1276
1274
  */
1277
- export declare const Layer: ForwardRefExoticComponent<
1278
- Omit<LayerProps & Omit<HTMLProps<HTMLDivElement>, 'as'>, 'ref'> & RefAttributes<HTMLDivElement>
1279
- >
1275
+ export declare type LabelSkeletonProps<
1276
+ E extends LabelSkeletonElementType = LabelSkeletonElementType,
1277
+ > = Props<LabelSkeletonOwnProps, E>
1278
+
1279
+ /** @public */
1280
+ export declare function Layer<E extends LayerElementType = typeof DEFAULT_LAYER_ELEMENT>(
1281
+ props: LayerProps<E>,
1282
+ ): React.JSX.Element
1280
1283
 
1281
1284
  /** @public */
1282
1285
  export declare interface LayerContextValue {
@@ -1288,48 +1291,40 @@ export declare interface LayerContextValue {
1288
1291
  zIndex: number
1289
1292
  }
1290
1293
 
1291
- /**
1292
- * @public
1293
- */
1294
- export declare interface LayerProps {
1295
- as?: React.ElementType | keyof React.JSX.IntrinsicElements
1294
+ /** @public */
1295
+ export declare type LayerElementType = CardElementType
1296
+
1297
+ /** @public */
1298
+ export declare interface LayerOwnProps extends CardOwnProps {
1296
1299
  /** A callback that fires when the layer becomes the top layer when it was not the top layer before. */
1297
1300
  onActivate?: (props: {activeElement: HTMLElement | null}) => void
1298
- zOffset?: number | number[]
1301
+ zOffset?: ResponsiveProp<number>
1299
1302
  }
1300
1303
 
1301
- /**
1302
- * @public
1303
- */
1304
- export declare function LayerProvider(props: LayerProviderProps): React.JSX.Element
1304
+ /** @public */
1305
+ export declare type LayerProps<E extends LayerElementType = LayerElementType> = Props<
1306
+ LayerOwnProps,
1307
+ E
1308
+ >
1305
1309
 
1306
- export declare namespace LayerProvider {
1307
- var displayName: string
1308
- }
1310
+ /** @public */
1311
+ export declare function LayerProvider(props: LayerProviderProps): React.JSX.Element
1309
1312
 
1310
- /**
1311
- * @public
1312
- */
1313
+ /** @public */
1313
1314
  export declare interface LayerProviderProps {
1314
- children?: React.ReactNode
1315
- zOffset?: number | number[]
1315
+ children?: ReactNode
1316
+ zOffset?: ResponsiveProp<number>
1316
1317
  }
1317
1318
 
1318
- /**
1319
- * DO NOT USE IN PRODUCTION.
1320
- * @beta
1321
- */
1322
- export declare interface MediaQueryProps {
1323
- as?: React.ElementType | keyof React.JSX.IntrinsicElements
1324
- media?: number[]
1325
- }
1319
+ /** @internal */
1320
+ export declare const LazySyntax: LazyExoticComponent<Syntax>
1326
1321
 
1327
1322
  /**
1328
1323
  * @internal
1329
1324
  */
1330
1325
  export declare interface _MediaStore {
1331
1326
  subscribe: (onStoreChange: () => void) => () => void
1332
- getSnapshot: () => number
1327
+ getSnapshot: () => Breakpoint
1333
1328
  }
1334
1329
 
1335
1330
  /**
@@ -1337,91 +1332,66 @@ export declare interface _MediaStore {
1337
1332
  *
1338
1333
  * @public
1339
1334
  */
1340
- export declare const Menu: ForwardRefExoticComponent<
1341
- Omit<MenuProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'tabIndex' | 'role' | 'as'>, 'ref'> &
1342
- RefAttributes<HTMLDivElement>
1343
- >
1335
+ export declare function Menu<E extends MenuElementType = typeof DEFAULT_MENU_ELEMENT>(
1336
+ props: MenuProps<E>,
1337
+ ): React.JSX.Element
1344
1338
 
1345
1339
  /**
1346
1340
  * The `MenuButton` component follows the WAI-ARIA specification for menu buttons.
1347
1341
  *
1348
1342
  * @public
1349
1343
  */
1350
- export declare const MenuButton: ForwardRefExoticComponent<
1351
- MenuButtonProps & RefAttributes<HTMLButtonElement | null>
1352
- >
1344
+ export declare function MenuButton(props: MenuButtonProps): React.JSX.Element
1353
1345
 
1354
- /**
1355
- * @public
1356
- */
1357
- export declare interface MenuButtonProps {
1346
+ /** @public */
1347
+ export declare type MenuButtonProps = {
1358
1348
  /**
1359
1349
  * @beta Do not use in production.
1360
1350
  */
1361
1351
  __unstable_disableRestoreFocusOnClose?: boolean
1362
- /**
1363
- * @deprecated Use `popover={{boundaryElement: element}}` instead.
1364
- */
1365
- boundaryElement?: HTMLElement
1366
- button: React.JSX.Element
1352
+ button: ReactElement<ButtonProps>
1367
1353
  id: string
1368
- menu?: React.JSX.Element
1354
+ menu?: ReactElement
1369
1355
  onClose?: () => void
1370
1356
  onOpen?: () => void
1371
- /**
1372
- * @deprecated Use `popover={{placement: 'top'}}` instead.
1373
- */
1374
- placement?: Placement
1375
1357
  popover?: Omit<PopoverProps, 'content' | 'open'>
1376
- /**
1377
- * @deprecated Use `popover={{scheme: 'dark'}}` instead.
1378
- */
1379
- popoverScheme?: ThemeColorSchemeKey_2
1380
- /**
1381
- * @deprecated Use `popover={{radius: 2}}` instead.
1382
- */
1383
- popoverRadius?: Radius | Radius[]
1384
- /**
1385
- * @beta Do not use in production.
1386
- * @deprecated Use `popover={{portal: true}}` instead.
1387
- */
1388
- portal?: boolean
1389
- /**
1390
- * @deprecated Use `popover={{preventOverflow: true}}` instead.
1391
- */
1392
- preventOverflow?: boolean
1358
+ ref?: ForwardedRef<HTMLButtonElement | null>
1393
1359
  }
1394
1360
 
1395
- /**
1396
- * @public
1397
- */
1398
- export declare const MenuDivider: IStyledComponentBase<
1399
- 'web',
1400
- FastOmit<DetailedHTMLProps<HTMLAttributes<HTMLHRElement>, HTMLHRElement>, never>
1401
- > &
1402
- string
1361
+ /** @public */
1362
+ export declare function MenuDivider<
1363
+ E extends MenuDividerElementType = typeof DEFAULT_MENU_DIVIDER_ELEMENT,
1364
+ >(props: MenuDividerProps<E>): React.JSX.Element
1403
1365
 
1404
- /**
1405
- * @public
1406
- */
1407
- export declare function MenuGroup(
1408
- props: Omit<React.HTMLProps<HTMLDivElement>, 'as' | 'height' | 'popover' | 'ref' | 'tabIndex'> &
1409
- MenuGroupProps,
1410
- ): React.JSX.Element
1366
+ /** @public */
1367
+ export declare type MenuDividerElementType = 'div' | 'hr' | 'span' | ComponentType
1411
1368
 
1412
- export declare namespace MenuGroup {
1413
- var displayName: string
1414
- }
1369
+ /** @public */
1370
+ export declare type MenuDividerOwnProps = {}
1415
1371
 
1416
- /**
1417
- * @public
1418
- */
1419
- export declare interface MenuGroupProps {
1420
- as?: React.ElementType | keyof React.JSX.IntrinsicElements
1421
- fontSize?: number | number[]
1422
- icon?: React.ElementType | React.ReactNode
1372
+ /** @public */
1373
+ export declare type MenuDividerProps<E extends MenuDividerElementType = MenuDividerElementType> =
1374
+ Props<MenuDividerOwnProps, E>
1375
+
1376
+ /** @public */
1377
+ export declare type MenuElementType = 'div' | 'span' | ComponentType
1378
+
1379
+ /** @public */
1380
+ export declare function MenuGroup<
1381
+ E extends MenuGroupElementType = typeof DEFAULT_MENU_GROUP_ELEMENT,
1382
+ >(props: MenuGroupProps<E>): React.JSX.Element
1383
+
1384
+ /** @public */
1385
+ export declare type MenuGroupElementType = 'button' | ComponentType
1386
+
1387
+ /** @public */
1388
+ export declare type MenuGroupOwnProps = RadiusStyleProps & {
1389
+ disabled?: boolean
1390
+ fontSize?: ResponsiveProp<FontTextSize>
1391
+ gap?: ResponsiveProp<Space>
1392
+ icon?: ElementType_2 | ReactNode
1423
1393
  menu?: Omit<
1424
- MenuProps,
1394
+ MenuProps<typeof DEFAULT_MENU_ELEMENT>,
1425
1395
  | 'onClickOutside'
1426
1396
  | 'onEscape'
1427
1397
  | 'onItemClick'
@@ -1431,76 +1401,62 @@ export declare interface MenuGroupProps {
1431
1401
  | 'shouldFocus'
1432
1402
  | 'onBlurCapture'
1433
1403
  >
1434
- padding?: number | number[]
1404
+ padding?: ResponsiveProp<Space>
1435
1405
  popover?: Omit<PopoverProps, 'content' | 'open'>
1436
- radius?: Radius | Radius[]
1437
- space?: number | number[]
1438
- text: React.ReactNode
1439
- tone?: SelectableTone
1406
+ text?: ReactNode
1407
+ tone?: ElementTone
1440
1408
  }
1441
1409
 
1442
- /**
1443
- * @public
1444
- */
1445
- export declare const MenuItem: ForwardRefExoticComponent<
1446
- MenuItemProps &
1447
- Omit<HTMLProps<HTMLDivElement>, 'selected' | 'height' | 'ref' | 'tabIndex' | 'as'> &
1448
- RefAttributes<HTMLDivElement>
1410
+ /** @public */
1411
+ export declare type MenuGroupProps<E extends MenuGroupElementType = MenuGroupElementType> = Props<
1412
+ MenuGroupOwnProps,
1413
+ E
1449
1414
  >
1450
1415
 
1451
- /**
1452
- * @public
1453
- */
1454
- export declare interface MenuItemProps extends ResponsivePaddingProps, ResponsiveRadiusProps {
1455
- as?: React.ElementType | keyof React.JSX.IntrinsicElements
1456
- fontSize?: number | number[]
1457
- hotkeys?: string[]
1458
- icon?: React.ElementType | React.ReactNode
1459
- iconRight?: React.ElementType | React.ReactNode
1460
- pressed?: boolean
1461
- selected?: boolean
1462
- space?: number | number[]
1463
- text?: React.ReactNode
1464
- tone?: SelectableTone
1465
- }
1416
+ /** @public */
1417
+ export declare function MenuItem<E extends MenuItemElementType = typeof DEFAULT_MENU_ITEM_ELEMENT>(
1418
+ props: MenuItemProps<E>,
1419
+ ): React.JSX.Element
1466
1420
 
1467
- /**
1468
- * @public
1469
- */
1470
- export declare interface MenuProps extends ResponsivePaddingProps {
1471
- /**
1472
- * @deprecated Use `shouldFocus="first"` instead.
1473
- */
1474
- 'focusFirst'?: boolean
1475
- /**
1476
- * @deprecated Use `shouldFocus="last"` instead.
1477
- */
1478
- 'focusLast'?: boolean
1421
+ /** @public */
1422
+ export declare type MenuItemElementType = 'button' | 'a' | ComponentType
1423
+
1424
+ /** @public */
1425
+ export declare type MenuItemOwnProps = GapStyleProps &
1426
+ PaddingStyleProps &
1427
+ RadiusStyleProps & {
1428
+ disabled?: boolean
1429
+ fontSize?: ResponsiveProp<FontTextSize>
1430
+ hotkeys?: string[]
1431
+ icon?: ElementType_2 | ReactNode
1432
+ iconRight?: ElementType_2 | ReactNode
1433
+ pressed?: boolean
1434
+ selected?: boolean
1435
+ text?: ReactNode
1436
+ tone?: ElementTone
1437
+ }
1438
+
1439
+ /** @public */
1440
+ export declare type MenuItemProps<E extends MenuItemElementType = MenuItemElementType> = Props<
1441
+ MenuItemOwnProps,
1442
+ E
1443
+ >
1444
+
1445
+ /** @public */
1446
+ export declare type MenuOwnProps = PaddingStyleProps & {
1447
+ 'gap'?: ResponsiveProp<Space>
1479
1448
  'onClickOutside'?: (event: MouseEvent) => void
1480
1449
  'onEscape'?: () => void
1481
- 'onItemClick'?: () => void
1450
+ 'onItemClick'?: (event: React.MouseEvent<HTMLButtonElement>) => void
1482
1451
  'onItemSelect'?: (index: number) => void
1483
1452
  'originElement'?: HTMLElement | null
1484
1453
  'registerElement'?: (el: HTMLElement) => () => void
1485
1454
  'shouldFocus'?: 'first' | 'last' | null
1486
- 'space'?: number | number[]
1487
1455
  'aria-labelledby'?: string
1488
- 'onBlurCapture'?: (event: FocusEvent) => void
1489
1456
  }
1490
1457
 
1491
- /**
1492
- * @public
1493
- * @deprecated Use `multiply` from `@sanity/ui/theme` instead.
1494
- */
1495
- export declare const multiply: typeof multiply_2
1496
-
1497
- /**
1498
- * @public
1499
- * @deprecated Use `parseColor` from `@sanity/ui/theme` instead.
1500
- */
1501
- export declare const parseColor: typeof parseColor_2
1502
-
1503
- export {PartialThemeColorBuilderOpts}
1458
+ /** @public */
1459
+ export declare type MenuProps<E extends MenuElementType = MenuElementType> = Props<MenuOwnProps, E>
1504
1460
 
1505
1461
  /**
1506
1462
  * Placement of floating UI elements.
@@ -1526,26 +1482,13 @@ export declare type Placement =
1526
1482
  *
1527
1483
  * @public
1528
1484
  */
1529
- export declare const Popover: ForwardRefExoticComponent<
1530
- Omit<
1531
- PopoverProps & Omit<HTMLProps<HTMLDivElement>, 'content' | 'width' | 'children' | 'as'>,
1532
- 'ref'
1533
- > &
1534
- RefAttributes<HTMLDivElement>
1535
- >
1536
-
1537
- /**
1538
- * @beta
1539
- */
1540
- export declare type PopoverMargins = [number, number, number, number]
1485
+ export declare function Popover(props: PopoverProps): React.JSX.Element
1541
1486
 
1542
1487
  /** @public */
1543
- export declare interface PopoverProps
1544
- extends Omit<LayerProps, 'as'>,
1545
- ResponsiveRadiusProps,
1546
- ResponsiveShadowProps {
1547
- /** @beta */
1548
- __unstable_margins?: PopoverMargins
1488
+ export declare type PopoverElementType = 'div'
1489
+
1490
+ /** @internal */
1491
+ declare interface PopoverLayerOwnProps extends LayerOwnProps {
1549
1492
  /**
1550
1493
  * Whether the popover should animate in and out.
1551
1494
  *
@@ -1553,23 +1496,53 @@ export declare interface PopoverProps
1553
1496
  * @defaultValue false
1554
1497
  */
1555
1498
  animate?: boolean
1499
+ children?: React.ReactNode
1500
+ originX?: number
1501
+ originY?: number
1502
+ referenceWidth?: number
1503
+ strategy?: Strategy
1504
+ x?: number
1505
+ y?: number
1506
+ }
1507
+
1508
+ /** @public */
1509
+ declare type PopoverLayerProps = Assign<HTMLMotionProps<'div'>, PopoverLayerOwnProps>
1510
+
1511
+ /**
1512
+ * @beta
1513
+ */
1514
+ export declare type PopoverMargins = [number, number, number, number]
1515
+
1516
+ /** @public */
1517
+ export declare type PopoverOwnProps = Omit<PopoverLayerOwnProps, 'maxWidth'> & {
1518
+ /** @beta */
1519
+ __unstable_distance?: number
1520
+ /**
1521
+ * @beta
1522
+ * @deprecated Will be removed in the next major version */
1523
+ __unstable_margins?: PopoverMargins
1524
+ /** @beta */
1525
+ __unstable_shift?: number
1526
+ /**
1527
+ * @deprecated Will be removed in the next major version
1528
+ */
1556
1529
  arrow?: boolean
1557
- /** @deprecated Use `floatingBoundary` and/or `referenceBoundary` instead */
1558
- boundaryElement?: HTMLElement | null
1559
- children?: React.JSX.Element
1530
+ children?: ReactElement<{
1531
+ ref: ForwardedRef<HTMLElement>
1532
+ }>
1560
1533
  /**
1561
- * When `true`, prevent overflow within the current boundary:
1562
- * - by flipping on its side axis
1563
- * - by resizing
1564
- /*
1565
- * Note that:
1566
- * - setting `preventOverflow` to `true` also prevents overflow on its side axis
1567
- * - setting `matchReferenceWidth` to `true` also causes the popover to resize
1568
- *
1569
- * @defaultValue false
1570
- */
1534
+ * When `true`, prevent overflow within the current boundary:
1535
+ * - by flipping on its side axis
1536
+ * - by resizing
1537
+ *
1538
+ * Note that:
1539
+ * - setting `preventOverflow` to `true` also prevents overflow on its side axis
1540
+ * - setting `matchReferenceWidth` to `true` also causes the popover to resize
1541
+ *
1542
+ * @defaultValue false
1543
+ */
1571
1544
  constrainSize?: boolean
1572
- content?: React.ReactNode
1545
+ content?: ReactNode
1573
1546
  disabled?: boolean
1574
1547
  fallbackPlacements?: Placement[]
1575
1548
  floatingBoundary?: HTMLElement | null
@@ -1590,8 +1563,6 @@ export declare interface PopoverProps
1590
1563
  */
1591
1564
  modal?: boolean
1592
1565
  open?: boolean
1593
- overflow?: BoxOverflow
1594
- padding?: number | number[]
1595
1566
  placement?: Placement
1596
1567
  /**
1597
1568
  * When 'flip' (default), the placement is determined from the initial placement and the
@@ -1612,31 +1583,24 @@ export declare interface PopoverProps
1612
1583
  * The children of the popover won't be rendered.
1613
1584
  */
1614
1585
  referenceElement?: HTMLElement | null
1615
- scheme?: ThemeColorSchemeKey_2
1616
- tone?: CardTone
1617
1586
  /** @beta */
1618
1587
  updateRef?: Ref<PopoverUpdateCallback | undefined>
1619
- width?: PopoverWidth | PopoverWidth[]
1588
+ width?: ResponsiveProp<MaxWidth>
1620
1589
  }
1621
1590
 
1591
+ /** @public */
1592
+ export declare type PopoverProps = Assign<PopoverLayerProps, PopoverOwnProps>
1593
+
1622
1594
  /** @beta */
1623
1595
  export declare type PopoverUpdateCallback = () => void
1624
1596
 
1625
1597
  /** @public */
1626
- export declare type PopoverWidth = number | 'auto'
1627
-
1628
- /**
1629
- * @public
1630
- */
1631
- export declare function Portal(props: PortalProps): React.ReactPortal | null
1598
+ export declare type PopoverWidth = Exclude<ContainerWidth, 'auto'>
1632
1599
 
1633
- export declare namespace Portal {
1634
- var displayName: string
1635
- }
1600
+ /** @public */
1601
+ export declare function Portal(props: PortalProps): ReactPortal | null
1636
1602
 
1637
- /**
1638
- * @public
1639
- */
1603
+ /** @public */
1640
1604
  export declare interface PortalContextValue {
1641
1605
  version: 0.0
1642
1606
  boundaryElement: HTMLElement | null
@@ -1644,35 +1608,21 @@ export declare interface PortalContextValue {
1644
1608
  elements?: Record<string, HTMLElement | null | undefined>
1645
1609
  }
1646
1610
 
1647
- /**
1648
- * @public
1649
- */
1611
+ /** @public */
1650
1612
  export declare interface PortalProps {
1651
- children: React.ReactNode
1613
+ children: ReactNode
1652
1614
  /**
1653
1615
  * @beta This API might change. DO NOT USE IN PRODUCTION.
1654
1616
  */
1655
1617
  __unstable_name?: string
1656
1618
  }
1657
1619
 
1658
- /**
1659
- * @public
1660
- */
1620
+ /** @public */
1661
1621
  export declare function PortalProvider(props: PortalProviderProps): React.JSX.Element
1662
1622
 
1663
- export declare namespace PortalProvider {
1664
- var displayName: string
1665
- }
1666
-
1667
- /**
1668
- * @public
1669
- */
1623
+ /** @public */
1670
1624
  export declare interface PortalProviderProps {
1671
- /**
1672
- * @deprecated Use `<BoundaryElementProvider element={...} />` instead
1673
- */
1674
- boundaryElement?: HTMLElement | null
1675
- children: React.ReactNode
1625
+ children: ReactNode
1676
1626
  element?: HTMLElement | null
1677
1627
  /**
1678
1628
  * @beta
@@ -1680,27 +1630,36 @@ export declare interface PortalProviderProps {
1680
1630
  __unstable_elements?: Record<string, HTMLElement | null | undefined>
1681
1631
  }
1682
1632
 
1633
+ /** @public */
1634
+ export declare type Props<P extends EmptyProps, E extends ElementType<P>> = Assign<
1635
+ E extends TagType ? React.JSX.IntrinsicElements[E] : React.ComponentProps<E>,
1636
+ P & {
1637
+ as?: E
1638
+ }
1639
+ >
1640
+
1683
1641
  /**
1684
1642
  * The `Radio` component allows the user to select one option from a set.
1685
1643
  *
1686
1644
  * @public
1687
1645
  */
1688
- export declare const Radio: ForwardRefExoticComponent<
1689
- Omit<Omit<HTMLProps<HTMLInputElement>, 'type' | 'as'> & RadioProps, 'ref'> &
1690
- RefAttributes<HTMLInputElement>
1691
- >
1646
+ export declare function Radio<E extends RadioElementType = typeof DEFAULT_RADIO_ELEMENT>(
1647
+ props: RadioProps<E>,
1648
+ ): React.JSX.Element
1692
1649
 
1693
- /**
1694
- * @public
1695
- */
1696
- export declare interface RadioProps {
1650
+ /** @public */
1651
+ export declare type RadioElementType = 'input' | ComponentType
1652
+
1653
+ /** @public */
1654
+ export declare type RadioOwnProps = {
1697
1655
  customValidity?: string
1698
1656
  }
1699
1657
 
1700
- /**
1701
- * @public
1702
- */
1703
- export declare type Radius = number | 'full'
1658
+ /** @public */
1659
+ export declare type RadioProps<E extends RadioElementType = RadioElementType> = Props<
1660
+ RadioOwnProps,
1661
+ E
1662
+ >
1704
1663
 
1705
1664
  /**
1706
1665
  * @internal
@@ -1712,361 +1671,171 @@ export declare function _raf(fn: () => void): () => void
1712
1671
  */
1713
1672
  export declare function _raf2(fn: () => void): () => void
1714
1673
 
1715
- /**
1716
- * @public
1717
- */
1718
- export declare function rem(pixelValue: number): string | 0
1719
-
1720
- /**
1721
- * @internal
1722
- */
1723
- export declare const _ResizeObserver: typeof ResizeObserver
1724
-
1725
- /**
1726
- * @internal
1727
- */
1728
- export declare function _responsive<T>(
1729
- media: number[],
1730
- values: T[],
1731
- callback: (value: T, index: number, array: T[]) => CSSObject,
1732
- ): CSSObject[]
1733
-
1734
- /**
1735
- * @internal
1736
- */
1737
- export declare interface ResponsiveAvatarSizeStyleProps {
1738
- $size: AvatarSize[]
1739
- }
1740
-
1741
- /**
1742
- * @public
1743
- */
1744
- export declare interface ResponsiveBorderProps {
1745
- border?: boolean | boolean[]
1746
- borderTop?: boolean | boolean[]
1747
- borderRight?: boolean | boolean[]
1748
- borderBottom?: boolean | boolean[]
1749
- borderLeft?: boolean | boolean[]
1750
- }
1751
-
1752
- /**
1753
- * @public
1754
- */
1755
- export declare interface ResponsiveBoxProps {
1756
- display?: BoxDisplay | BoxDisplay[]
1757
- height?: BoxHeight | BoxHeight[]
1758
- overflow?: BoxOverflow | BoxOverflow[]
1759
- sizing?: BoxSizing | BoxSizing[]
1760
- }
1761
-
1762
- /**
1763
- * Get responsive CSS for the `code` font style.
1764
- * @internal
1765
- */
1766
- export declare function responsiveCodeFontStyle(
1767
- props: ResponsiveFontStyleProps & ThemeProps,
1768
- ): CSSObject[]
1769
-
1770
- /**
1771
- * @public
1772
- */
1773
- export declare interface ResponsiveFlexItemProps {
1774
- /** Sets the flex CSS attribute. The property is responsive. */
1775
- flex?: FlexValue | FlexValue[]
1776
- }
1777
-
1778
- /**
1779
- * @public
1780
- */
1781
- export declare interface ResponsiveFlexProps {
1782
- align?: FlexAlign | FlexAlign[]
1783
- direction?: FlexDirection | FlexDirection[]
1784
- justify?: FlexJustify | FlexJustify[]
1785
- wrap?: FlexWrap | FlexWrap[]
1786
- }
1787
-
1788
1674
  /**
1789
1675
  * @internal
1790
1676
  */
1791
- export declare interface ResponsiveFontSizeStyleProps {
1792
- $size: number[]
1793
- }
1794
-
1795
- /**
1796
- * @internal
1797
- */
1798
- export declare interface ResponsiveFontStyleProps
1799
- extends FontWeightStyleProps,
1800
- ResponsiveFontSizeStyleProps,
1801
- ResponsiveTextAlignStyleProps {
1802
- $accent?: boolean
1803
- $muted?: boolean
1677
+ export declare interface ResponsiveWidthStyleProps {
1678
+ $width: (number | 'auto')[]
1804
1679
  }
1805
1680
 
1806
1681
  /**
1682
+ * The `Root` component.
1683
+ *
1807
1684
  * @public
1808
1685
  */
1809
- export declare interface ResponsiveGridItemProps {
1810
- column?: GridItemColumn | GridItemColumn[]
1811
- columnStart?: GridItemColumnStart | GridItemColumnStart[]
1812
- columnEnd?: GridItemColumnEnd | GridItemColumnEnd[]
1813
- row?: GridItemRow | GridItemRow[]
1814
- rowStart?: GridItemRowStart | GridItemRowStart[]
1815
- rowEnd?: GridItemRowEnd | GridItemRowEnd[]
1816
- }
1686
+ export declare function Root<E extends RootElementType = typeof DEFAULT_ROOT_ELEMENT>(
1687
+ props: RootProps<E>,
1688
+ ): React.JSX.Element
1817
1689
 
1818
- /**
1819
- * @public
1820
- */
1821
- export declare interface ResponsiveGridProps {
1822
- autoRows?: GridAutoRows | GridAutoRows[]
1823
- autoCols?: GridAutoCols | GridAutoCols[]
1824
- autoFlow?: GridAutoFlow | GridAutoFlow[]
1825
- columns?: number | number[]
1826
- gap?: number | number[]
1827
- gapX?: number | number[]
1828
- gapY?: number | number[]
1829
- rows?: number | number[]
1830
- }
1690
+ /** @public */
1691
+ export declare type RootElementType = 'html' | 'div'
1831
1692
 
1832
- /**
1833
- * Get responsive CSS for the `heading` font style.
1834
- * @internal
1835
- */
1836
- export declare function responsiveHeadingFont(
1837
- props: ResponsiveFontStyleProps & ThemeProps,
1838
- ): CSSObject[]
1693
+ /** @public */
1694
+ export declare type RootOwnProps = RootStyleProps
1839
1695
 
1840
- /**
1841
- * Get responsive CSS for the `label` font style.
1842
- * @internal
1843
- */
1844
- export declare function responsiveLabelFont(
1845
- props: ResponsiveFontStyleProps & ThemeProps,
1846
- ): CSSObject[]
1696
+ /** @public */
1697
+ export declare type RootProps<E extends RootElementType = RootElementType> = Props<RootOwnProps, E>
1847
1698
 
1848
- /**
1849
- * @public
1850
- */
1851
- export declare interface ResponsiveMarginProps {
1852
- /** Applies margins to all sides. The property is responsive. */
1853
- margin?: number | number[]
1854
- /** Applies margins to the left and right sides. The property is responsive. */
1855
- marginX?: number | number[]
1856
- /** Applies margins to the top and bottom sides. The property is responsive. */
1857
- marginY?: number | number[]
1858
- marginTop?: number | number[]
1859
- marginRight?: number | number[]
1860
- marginBottom?: number | number[]
1861
- marginLeft?: number | number[]
1862
- }
1699
+ /** @public */
1700
+ export declare function RootProvider(props: RootProviderProps): React.JSX.Element
1863
1701
 
1864
- /**
1865
- * @public
1866
- */
1867
- export declare interface ResponsivePaddingProps {
1868
- padding?: number | number[]
1869
- paddingX?: number | number[]
1870
- paddingY?: number | number[]
1871
- paddingTop?: number | number[]
1872
- paddingRight?: number | number[]
1873
- paddingBottom?: number | number[]
1874
- paddingLeft?: number | number[]
1702
+ /** @public */
1703
+ export declare interface RootProviderProps {
1704
+ boundaryElement: HTMLElement | null
1705
+ children?: ReactNode
1706
+ portalElement: HTMLElement | null
1707
+ scheme: ColorScheme
1708
+ tone: CardTone
1875
1709
  }
1876
1710
 
1877
1711
  /**
1712
+ * The `Select` component provides control of options.
1713
+ *
1878
1714
  * @public
1879
1715
  */
1880
- export declare interface ResponsiveRadiusProps {
1881
- radius?: Radius | Radius[]
1882
- }
1716
+ export declare function Select<E extends SelectElementType = typeof DEFAULT_SELECT_ELEMENT>(
1717
+ props: SelectProps<E>,
1718
+ ): React.JSX.Element
1883
1719
 
1884
- /**
1885
- * @public
1886
- */
1887
- export declare interface ResponsiveShadowProps {
1888
- shadow?: number | number[]
1889
- }
1720
+ /** @public */
1721
+ export declare function Selectable<
1722
+ E extends SelectableElementType = typeof DEFAULT_SELECTABLE_ELEMENT,
1723
+ >(props: SelectableProps<E>): React.JSX.Element
1890
1724
 
1891
- /**
1892
- * Get responsive text align styles.
1893
- * @internal
1894
- */
1895
- export declare function responsiveTextAlignStyle(
1896
- props: ResponsiveTextAlignStyleProps & ThemeProps,
1897
- ): CSSObject[]
1725
+ /** @public */
1726
+ export declare type SelectableElementType = 'a' | 'button' | 'span' | ComponentType
1898
1727
 
1899
- /**
1900
- * @internal
1901
- */
1902
- export declare interface ResponsiveTextAlignStyleProps {
1903
- $align: TextAlign[]
1728
+ /** @public */
1729
+ export declare interface SelectableOwnProps extends SelectableStyleProps {
1730
+ selected?: boolean
1904
1731
  }
1905
1732
 
1906
- /**
1907
- * Get responsive CSS for the `text` font style.
1908
- * @internal
1909
- */
1910
- export declare function responsiveTextFont(
1911
- props: ResponsiveFontStyleProps & ThemeProps,
1912
- ): CSSObject[]
1733
+ /** @public */
1734
+ export declare type SelectableProps<E extends SelectableElementType = SelectableElementType> =
1735
+ Props<SelectableOwnProps, E>
1913
1736
 
1914
- /**
1915
- * @public
1916
- */
1917
- export declare interface ResponsiveWidthProps {
1918
- width?: number | 'auto' | (number | 'auto')[]
1919
- }
1737
+ /** @public */
1738
+ export declare type SelectElementType = 'select' | ComponentType
1920
1739
 
1921
- /**
1922
- * @internal
1923
- */
1924
- export declare interface ResponsiveWidthStyleProps {
1925
- $width: (number | 'auto')[]
1740
+ /** @public */
1741
+ export declare type SelectOwnProps = SelectStyleProps & {
1742
+ customValidity?: string
1743
+ readOnly?: boolean
1926
1744
  }
1927
1745
 
1928
- /**
1929
- * @public
1930
- * @deprecated Use `RGB` from `@sanity/ui/theme` instead.
1931
- */
1932
- export declare type RGB = RGB_2
1933
-
1934
- /**
1935
- * @public
1936
- * @deprecated Use `rgba` from `@sanity/ui/theme` instead.
1937
- */
1938
- export declare const rgba: typeof rgba_2
1939
-
1940
- /**
1941
- * @public
1942
- * @deprecated Use `rgbToHex` from `@sanity/ui/theme` instead.
1943
- */
1944
- export declare const rgbToHex: typeof rgbToHex_2
1945
-
1946
- /**
1947
- * @public
1948
- * @deprecated Use `rgbToHsl` from `@sanity/ui/theme` instead.
1949
- */
1950
- export declare const rgbToHsl: typeof rgbToHsl_2
1951
-
1952
- /**
1953
- * @public
1954
- * @deprecated Use `RootTheme` from `@sanity/ui/theme` instead.
1955
- */
1956
- export declare type RootTheme = RootTheme_2
1957
-
1958
- /**
1959
- * @public
1960
- * @deprecated Use `screen` from `@sanity/ui/theme` instead.
1961
- */
1962
- declare const screen_2: typeof screen_3
1963
- export {screen_2 as screen}
1964
-
1965
- /**
1966
- * The `Select` component provides control of options.
1967
- *
1968
- * @public
1969
- */
1970
- export declare const Select: ForwardRefExoticComponent<
1971
- Omit<SelectProps & Omit<HTMLProps<HTMLSelectElement>, 'as'>, 'ref'> &
1972
- RefAttributes<HTMLSelectElement>
1746
+ /** @public */
1747
+ export declare type SelectProps<E extends SelectElementType = SelectElementType> = Props<
1748
+ SelectOwnProps,
1749
+ E
1973
1750
  >
1974
1751
 
1975
- /**
1976
- * @public
1977
- */
1978
- export declare type SelectableTone = ThemeColorStateToneKey
1979
-
1980
- /**
1981
- * @public
1982
- */
1983
- export declare interface SelectProps {
1984
- fontSize?: number | number[]
1985
- padding?: number | number[]
1986
- radius?: Radius | Radius[]
1987
- space?: number | number[]
1988
- customValidity?: string
1989
- }
1990
-
1991
1752
  /**
1992
1753
  * This API might change. DO NOT USE IN PRODUCTION.
1993
1754
  * @beta
1994
1755
  */
1995
- export declare const Skeleton: ForwardRefExoticComponent<
1996
- Omit<SkeletonProps & HTMLProps<HTMLDivElement>, 'ref'> & RefAttributes<HTMLDivElement>
1997
- >
1756
+ export declare function Skeleton<E extends SkeletonElementType = typeof DEFAULT_SKELETON_ELEMENT>(
1757
+ props: SkeletonProps<E>,
1758
+ ): React.JSX.Element
1759
+
1760
+ /** @beta */
1761
+ export declare type SkeletonElementType = 'div' | 'span' | ComponentType
1998
1762
 
1999
1763
  /**
2000
1764
  * This API might change. DO NOT USE IN PRODUCTION.
2001
1765
  * @beta
2002
1766
  */
2003
- export declare interface SkeletonProps extends ResponsiveRadiusProps, Omit<BoxProps, 'children'> {
1767
+ export declare type SkeletonOwnProps = SkeletonStyleProps & {
2004
1768
  animated?: boolean
2005
1769
  delay?: number
2006
1770
  }
2007
1771
 
1772
+ /** @beta */
1773
+ export declare type SkeletonProps<E extends SkeletonElementType = SkeletonElementType> = Props<
1774
+ SkeletonOwnProps,
1775
+ E
1776
+ >
1777
+
2008
1778
  /**
2009
1779
  * Indicate that something is loading for an indeterminate amount of time.
2010
1780
  *
2011
1781
  * @public
2012
1782
  */
2013
- export declare const Spinner: ForwardRefExoticComponent<
2014
- Omit<SpinnerProps & Omit<HTMLProps<HTMLDivElement>, 'size' | 'as'>, 'ref'> &
2015
- RefAttributes<HTMLDivElement>
2016
- >
1783
+ export declare function Spinner<E extends SpinnerElementType = typeof DEFAULT_SPINNER_ELEMENT>(
1784
+ props: SpinnerProps<E>,
1785
+ ): React.JSX.Element
2017
1786
 
2018
- /**
2019
- * @public
2020
- */
2021
- export declare interface SpinnerProps {
1787
+ /** @public */
1788
+ export declare type SpinnerElementType = 'div' | 'span' | ComponentType
1789
+
1790
+ /** @public */
1791
+ export declare type SpinnerOwnProps = {
2022
1792
  muted?: boolean
2023
- size?: number | number[]
1793
+ size?: ResponsiveProp<FontTextSize>
2024
1794
  }
2025
1795
 
2026
- /**
2027
- * @public
2028
- */
2029
- export declare const SrOnly: ForwardRefExoticComponent<
2030
- Omit<SrOnlyProps & Omit<HTMLProps<HTMLDivElement>, 'aria-hidden' | 'as'>, 'ref'> &
2031
- RefAttributes<HTMLDivElement>
1796
+ /** @public */
1797
+ export declare type SpinnerProps<E extends SpinnerElementType = SpinnerElementType> = Props<
1798
+ SpinnerOwnProps,
1799
+ E
2032
1800
  >
2033
1801
 
2034
- /**
2035
- * @public
2036
- */
2037
- export declare interface SrOnlyProps {
2038
- as?: React.ElementType | keyof React.JSX.IntrinsicElements
2039
- children?: React.ReactNode
2040
- }
1802
+ /** @public */
1803
+ export declare function SrOnly<E extends SrOnlyElementType = typeof DEFAULT_SR_ONLY_ELEMENT>(
1804
+ props: SrOnlyProps<E>,
1805
+ ): React.JSX.Element
1806
+
1807
+ /** @public */
1808
+ export declare type SrOnlyElementType = 'span' | ComponentType
1809
+
1810
+ /** @public */
1811
+ export declare type SrOnlyOwnProps = {}
1812
+
1813
+ /** @public */
1814
+ export declare type SrOnlyProps<E extends SrOnlyElementType = SrOnlyElementType> = Props<
1815
+ SrOnlyOwnProps,
1816
+ E
1817
+ >
2041
1818
 
2042
1819
  /**
2043
1820
  * The `Stack` component is used to place elements on top of each other.
2044
1821
  *
2045
1822
  * @public
2046
1823
  */
2047
- export declare const Stack: ForwardRefExoticComponent<
2048
- StackProps & Omit<HTMLProps<HTMLDivElement>, 'ref' | 'as'> & RefAttributes<HTMLDivElement>
2049
- >
1824
+ export declare function Stack<E extends StackElementType = typeof DEFAULT_STACK_ELEMENT>(
1825
+ props: StackProps<E>,
1826
+ ): React.JSX.Element
2050
1827
 
2051
- /**
2052
- * @public
2053
- */
2054
- export declare interface StackProps extends BoxProps {
2055
- as?: React.ElementType | keyof React.JSX.IntrinsicElements
2056
- space?: number | number[]
2057
- }
1828
+ /** @public */
1829
+ export declare type StackElementType = BoxElementType
2058
1830
 
2059
- /**
2060
- * @public
2061
- * @deprecated Use `buildTheme` from `@sanity/ui/theme` instead.
2062
- */
2063
- export declare const studioTheme: BaseTheme_2
1831
+ /** @public */
1832
+ export declare type StackOwnProps = StackStyleProps
2064
1833
 
2065
- /**
2066
- * @public
2067
- * @deprecated Use `ThemeStyles` from `@sanity/ui/theme` instead.
2068
- */
2069
- export declare type Styles = ThemeStyles
1834
+ /** @public */
1835
+ export declare type StackProps<E extends StackElementType = StackElementType> = Props<
1836
+ StackOwnProps,
1837
+ E
1838
+ >
2070
1839
 
2071
1840
  /**
2072
1841
  * The `Switch` component allows the user to toggle a setting on and off.
@@ -2075,445 +1844,243 @@ export declare type Styles = ThemeStyles
2075
1844
  *
2076
1845
  * @public
2077
1846
  */
2078
- export declare const Switch: ForwardRefExoticComponent<
2079
- Omit<Omit<HTMLProps<HTMLInputElement>, 'type' | 'as'> & SwitchProps, 'ref'> &
2080
- RefAttributes<HTMLInputElement>
2081
- >
2082
-
2083
- /**
2084
- * @public
2085
- */
2086
- export declare interface SwitchProps {
2087
- indeterminate?: boolean
2088
- }
2089
-
2090
- /**
2091
- * @public
2092
- */
2093
- export declare const Tab: ForwardRefExoticComponent<
2094
- Omit<
2095
- TabProps &
2096
- Omit<
2097
- HTMLProps<HTMLButtonElement>,
2098
- 'label' | 'id' | 'type' | 'width' | 'aria-controls' | 'as'
2099
- >,
2100
- 'ref'
2101
- > &
2102
- RefAttributes<HTMLButtonElement>
2103
- >
1847
+ export declare function Switch<E extends SwitchElementType = typeof DEFAULT_SWITCH_ELEMENT>(
1848
+ props: SwitchProps<E>,
1849
+ ): React.JSX.Element
2104
1850
 
2105
- /**
2106
- * @public
2107
- */
2108
- export declare const TabList: ForwardRefExoticComponent<
2109
- Omit<TabListProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'as'>, 'ref'> &
2110
- RefAttributes<unknown>
2111
- >
1851
+ /** @public */
1852
+ export declare type SwitchElementType = 'input' | ComponentType
2112
1853
 
2113
- /**
2114
- * @public
2115
- */
2116
- export declare interface TabListProps extends Omit<InlineProps, 'as' | 'height'> {
2117
- children: Array<React.JSX.Element | null | undefined | false>
1854
+ /** @public */
1855
+ export declare type SwitchOwnProps = {
1856
+ indeterminate?: boolean
2118
1857
  }
2119
1858
 
2120
- /**
2121
- * @public
2122
- */
2123
- export declare const TabPanel: ForwardRefExoticComponent<
2124
- Omit<
2125
- TabPanelProps & Omit<HTMLProps<HTMLDivElement>, 'id' | 'role' | 'aria-labelledby' | 'as'>,
2126
- 'ref'
2127
- > &
2128
- RefAttributes<HTMLDivElement>
1859
+ /** @public */
1860
+ export declare type SwitchProps<E extends SwitchElementType = SwitchElementType> = Props<
1861
+ SwitchOwnProps,
1862
+ E
2129
1863
  >
2130
1864
 
2131
- /**
2132
- * @public
2133
- */
2134
- export declare interface TabPanelProps extends BoxProps {
2135
- /**
2136
- * The `id` of the correlating `Tab` component.
2137
- */
2138
- 'aria-labelledby': string
2139
- 'id': string
2140
- }
1865
+ declare function Syntax(props: SyntaxProps): React.JSX.Element
2141
1866
 
2142
- /**
2143
- * @public
2144
- */
2145
- export declare interface TabProps {
2146
- /**
2147
- * The `id` of the correlating `TabPanel` component.
2148
- */
2149
- 'aria-controls': string
2150
- 'id': string
2151
- 'icon'?: React.ElementType | React.ReactNode
2152
- 'focused'?: boolean
2153
- 'fontSize'?: number | number[]
2154
- 'label'?: React.ReactNode
2155
- 'padding'?: number | number[]
2156
- 'selected'?: boolean
2157
- 'tone'?: ButtonTone
1867
+ declare interface SyntaxProps {
1868
+ language?: string
1869
+ value: React.ReactNode
2158
1870
  }
2159
1871
 
2160
- /**
2161
- * The `Text` component is an agile, themed typographic element.
2162
- *
2163
- * @public
2164
- */
2165
- declare const Text_2: ForwardRefExoticComponent<
2166
- Omit<TextProps & Omit<HTMLProps<HTMLDivElement>, 'size' | 'as'>, 'ref'> &
2167
- RefAttributes<HTMLDivElement>
2168
- >
2169
- export {Text_2 as Text}
1872
+ /** @public */
1873
+ export declare function Tab<E extends TabElementType = typeof DEFAULT_TAB_ELEMENT>(
1874
+ props: TabProps<E>,
1875
+ ): React.JSX.Element
2170
1876
 
2171
- /**
2172
- * @public
2173
- */
2174
- export declare type TextAlign = 'left' | 'right' | 'center' | 'justify' | 'initial'
1877
+ /** @public */
1878
+ export declare type TabElementType = 'button' | ComponentType
2175
1879
 
2176
- /**
2177
- * A multiline text input.
2178
- *
1880
+ /** @public */
1881
+ export declare function TabList<E extends TabListElementType = typeof DEFAULT_TAB_LIST_ELEMENT>(
1882
+ props: TabListProps<E>,
1883
+ ): React.JSX.Element
2179
1884
 
2180
- * @public
2181
- */
2182
- export declare const TextArea: ForwardRefExoticComponent<
2183
- Omit<TextAreaProps & Omit<HTMLProps<HTMLTextAreaElement>, 'as'>, 'ref'> &
2184
- RefAttributes<HTMLTextAreaElement>
2185
- >
1885
+ /** @public */
1886
+ export declare type TabListElementType = 'div' | 'span' | ComponentType
2186
1887
 
2187
- /**
2188
- * @public
2189
- */
2190
- export declare interface TextAreaProps extends ResponsiveRadiusProps {
2191
- /**
2192
- * @beta
2193
- */
2194
- __unstable_disableFocusRing?: boolean
2195
- border?: boolean
2196
- customValidity?: string
2197
- fontSize?: number | number[]
2198
- padding?: number | number[]
2199
- weight?: ThemeFontWeightKey_2
1888
+ /** @public */
1889
+ export declare interface TabListOwnProps extends FlexOwnProps {
1890
+ autoActivate?: boolean
2200
1891
  }
2201
1892
 
2202
- /**
2203
- * Single line text input.
2204
- *
2205
- * @public
2206
- */
2207
- export declare const TextInput: ForwardRefExoticComponent<
2208
- Omit<TextInputProps & Omit<HTMLProps<HTMLInputElement>, 'type' | 'prefix' | 'as'>, 'ref'> &
2209
- RefAttributes<HTMLInputElement>
1893
+ /** @public */
1894
+ export declare type TabListProps<E extends TabListElementType = TabListElementType> = Omit<
1895
+ Props<TabListOwnProps, E>,
1896
+ 'role'
2210
1897
  >
2211
1898
 
2212
- /**
2213
- * @public
2214
- */
2215
- export declare type TextInputClearButtonProps = Omit<ButtonProps, 'as'> &
2216
- Omit<React.HTMLProps<HTMLButtonElement>, 'as' | 'onClick' | 'onMouseDown' | 'ref'>
2217
-
2218
- /**
2219
- * @public
2220
- */
2221
- export declare interface TextInputProps {
2222
- /**
2223
- * @beta
2224
- */
2225
- __unstable_disableFocusRing?: boolean
2226
- border?: boolean
2227
- /**
2228
- * @beta
2229
- */
2230
- clearButton?: boolean | TextInputClearButtonProps
2231
- customValidity?: string
2232
- fontSize?: number | number[]
2233
- icon?: React.ElementType | React.ReactNode
2234
- iconRight?: React.ElementType | React.ReactNode
1899
+ /** @public */
1900
+ export declare interface TabOwnProps extends ButtonOwnProps {
2235
1901
  /**
2236
- * @beta
1902
+ * The `id` of the corresponding `TabPanel` component.
2237
1903
  */
2238
- onClear?: () => void
2239
- padding?: number | number[]
2240
- prefix?: React.ReactNode
2241
- radius?: Radius | Radius[]
2242
- space?: number | number[]
2243
- suffix?: React.ReactNode
2244
- type?: TextInputType
2245
- weight?: ThemeFontWeightKey_2
1904
+ 'aria-controls': string
1905
+ 'id': string
1906
+ 'focused'?: boolean
1907
+ 'label'?: React.ReactNode
1908
+ 'onActivate'?: () => void
2246
1909
  }
2247
1910
 
2248
- /**
2249
- * @public
2250
- */
2251
- export declare type TextInputType =
2252
- | 'search'
2253
- | 'date'
2254
- | 'datetime-local'
2255
- | 'email'
2256
- | 'url'
2257
- | 'month'
2258
- | 'number'
2259
- | 'password'
2260
- | 'tel'
2261
- | 'time'
2262
- | 'text'
2263
- | 'week'
2264
- | 'color'
1911
+ /** @public */
1912
+ export declare function TabPanel<E extends TabPanelElementType = typeof DEFAULT_TAB_PANEL_ELEMENT>(
1913
+ props: TabPanelProps<E>,
1914
+ ): React.JSX.Element
2265
1915
 
2266
- /**
2267
- * @public
2268
- */
2269
- export declare interface TextProps {
2270
- accent?: boolean
2271
- align?: TextAlign | TextAlign[]
2272
- as?: React.ElementType | keyof React.JSX.IntrinsicElements
2273
- /** When `true` the text color will be muted. */
2274
- muted?: boolean
2275
- size?: number | number[]
1916
+ /** @public */
1917
+ export declare type TabPanelElementType = 'div' | 'span' | ComponentType
1918
+
1919
+ /** @public */
1920
+ export declare type TabPanelOwnProps = BoxOwnProps & {
2276
1921
  /**
2277
- * Controls how overflowing text is treated.
2278
- * Use `textOverflow="ellipsis"` to render text as a single line which is concatenated with a `…` symbol.
2279
- * @beta
1922
+ * The `id` of the corresponding `Tab` component.
2280
1923
  */
2281
- textOverflow?: 'ellipsis'
2282
- weight?: ThemeFontWeightKey_2
1924
+ 'aria-labelledby': string
1925
+ 'id': string
2283
1926
  }
2284
1927
 
2285
- /**
2286
- * This API might change. DO NOT USE IN PRODUCTION.
2287
- * @beta
2288
- */
2289
- export declare const TextSkeleton: ForwardRefExoticComponent<
2290
- Omit<
2291
- TextSkeletonProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'size' | 'children' | 'as'>,
2292
- 'ref'
2293
- > &
2294
- RefAttributes<HTMLDivElement>
1928
+ /** @public */
1929
+ export declare type TabPanelProps<E extends TabPanelElementType = TabPanelElementType> = Props<
1930
+ TabPanelOwnProps,
1931
+ E
2295
1932
  >
2296
1933
 
2297
- /**
2298
- * This API might change. DO NOT USE IN PRODUCTION.
2299
- * @beta
2300
- */
2301
- export declare interface TextSkeletonProps extends SkeletonProps {
2302
- size?: number | number[]
2303
- }
2304
-
2305
- /**
2306
- * @public
2307
- * @deprecated Use `Theme` from `@sanity/ui/theme` instead.
2308
- */
2309
- export declare type Theme = Theme_2
2310
-
2311
- export {ThemeAvatar}
2312
-
2313
- export {ThemeColor}
2314
-
2315
- export {ThemeColorBase}
2316
-
2317
- export {ThemeColorBuilderOpts}
2318
-
2319
- export {ThemeColorButton}
2320
-
2321
- /**
2322
- * @public
2323
- * @deprecated Use `ThemeColorButtonModeKey` from `@sanity/ui/theme` instead.
2324
- */
2325
- export declare type ThemeColorButtonModeKey = ThemeColorButtonModeKey_2
2326
-
2327
- export {ThemeColorButtonState}
2328
-
2329
- export {ThemeColorButtonStates}
2330
-
2331
- export {ThemeColorButtonTones}
2332
-
2333
- export {ThemeColorCard}
2334
-
2335
- export {ThemeColorCardState}
2336
-
2337
- export {ThemeColorGenericState}
2338
-
2339
- export {ThemeColorInput}
2340
-
2341
- export {ThemeColorInputState}
2342
-
2343
- export {ThemeColorInputStates}
2344
-
2345
- export {ThemeColorMuted}
2346
-
2347
- export {ThemeColorMutedTone}
2348
-
2349
- export {ThemeColorName}
2350
-
2351
- /**
2352
- * @public
2353
- */
2354
- export declare function ThemeColorProvider(props: ThemeColorProviderProps): React.JSX.Element
2355
-
2356
- export declare namespace ThemeColorProvider {
2357
- var displayName: string
2358
- }
2359
-
2360
- /**
2361
- * @public
2362
- */
2363
- export declare interface ThemeColorProviderProps {
2364
- children?: React.ReactNode
2365
- scheme?: ThemeColorSchemeKey_2
2366
- tone?: ThemeColorCardToneKey
2367
- }
2368
-
2369
- export {ThemeColorScheme}
2370
-
2371
- /**
2372
- * @public
2373
- * @deprecated Use `ThemeColorSchemeKey` from `@sanity/ui/theme` instead.
2374
- */
2375
- export declare type ThemeColorSchemeKey = ThemeColorSchemeKey_2
2376
-
2377
- export {ThemeColorSchemes}
2378
-
2379
- export {ThemeColorSelectable}
2380
-
2381
- export {ThemeColorSelectableState}
2382
-
2383
- export {ThemeColorSelectableStates}
2384
-
2385
- export {ThemeColorSolid}
2386
-
2387
- export {ThemeColorSolidTone}
2388
-
2389
- export {ThemeColorSpot}
2390
-
2391
- export {ThemeColorSpotKey}
2392
-
2393
- /**
2394
- * @public
2395
- * @deprecated Use `ThemeColorSyntax` from `@sanity/ui/theme` instead.
2396
- */
2397
- export declare type ThemeColorSyntax = ThemeColorSyntax_2
2398
-
2399
- export {ThemeColorToneKey}
2400
-
2401
- /**
2402
- * @public
2403
- */
2404
- export declare interface ThemeContextValue {
2405
- /** @deprecated No longer used */
2406
- version: 0.0
2407
- scheme: ThemeColorSchemeKey_2
2408
- theme: RootTheme_2
2409
- tone: ThemeColorCardToneKey
2410
- }
2411
-
2412
- /**
2413
- * @public
2414
- * @deprecated Use `ThemeFont` from `@sanity/ui/theme` instead.
2415
- */
2416
- export declare type ThemeFont = ThemeFont_2
1934
+ /** @public */
1935
+ export declare type TabProps<E extends TabElementType = TabElementType> = Props<TabOwnProps, E>
2417
1936
 
2418
- /**
2419
- * @public
2420
- * @deprecated Use `ThemeFontKey` from `@sanity/ui/theme` instead.
2421
- */
2422
- export declare type ThemeFontKey = ThemeFontKey_2
1937
+ /** @public */
1938
+ export declare type TagType = keyof React.JSX.IntrinsicElements
2423
1939
 
2424
1940
  /**
1941
+ * The `Text` component is an agile, themed typographic element.
1942
+ *
2425
1943
  * @public
2426
- * @deprecated Use `ThemeFonts` from `@sanity/ui/theme` instead.
2427
1944
  */
2428
- export declare type ThemeFonts = ThemeFonts_2
1945
+ declare function Text_2<E extends TextElementType = typeof DEFAULT_TEXT_ELEMENT>(
1946
+ props: TextProps<E>,
1947
+ ): React.JSX.Element
1948
+ export {Text_2 as Text}
2429
1949
 
2430
1950
  /**
1951
+ * A multiline text input.
1952
+ *
2431
1953
  * @public
2432
- * @deprecated Use `ThemeFontSize` from `@sanity/ui/theme` instead.
2433
1954
  */
2434
- export declare type ThemeFontSize = ThemeFontSize_2
1955
+ export declare function TextArea<E extends TextAreaElementType = typeof DEFAULT_TEXT_AREA_ELEMENT>(
1956
+ props: TextAreaProps<E>,
1957
+ ): React.JSX.Element
2435
1958
 
2436
- /**
2437
- * @public
2438
- * @deprecated Use `ThemeFontWeight` from `@sanity/ui/theme` instead.
2439
- */
2440
- export declare type ThemeFontWeight = ThemeFontWeight_2
1959
+ /** @public */
1960
+ export declare type TextAreaElementType = 'textarea' | ComponentType
2441
1961
 
2442
- /**
2443
- * @public
2444
- * @deprecated Use `ThemeFontWeightKey` from `@sanity/ui/theme` instead.
2445
- */
2446
- export declare type ThemeFontWeightKey = ThemeFontWeightKey_2
1962
+ /** @public */
1963
+ export declare type TextAreaOwnProps = TextAreaStyleProps & {
1964
+ /**
1965
+ * @beta
1966
+ */
1967
+ __unstable_disableFocusRing?: boolean
1968
+ customValidity?: string
1969
+ }
1970
+
1971
+ /** @public */
1972
+ export declare type TextAreaProps<E extends TextAreaElementType = TextAreaElementType> = Props<
1973
+ TextAreaOwnProps,
1974
+ E
1975
+ >
2447
1976
 
2448
- export {ThemeInput}
1977
+ /** @public */
1978
+ export declare type TextElementType =
1979
+ | 'div'
1980
+ | 'h1'
1981
+ | 'h2'
1982
+ | 'h3'
1983
+ | 'h4'
1984
+ | 'h5'
1985
+ | 'h6'
1986
+ | 'label'
1987
+ | 'li'
1988
+ | 'p'
1989
+ | 'span'
1990
+ | 'summary'
1991
+ | 'time'
1992
+ | ComponentType
2449
1993
 
2450
1994
  /**
1995
+ * Single line text input.
1996
+ *
2451
1997
  * @public
2452
- * @deprecated Use `ThemeLayer` from `@sanity/ui/theme` instead.
2453
1998
  */
2454
- export declare type ThemeLayer = ThemeLayer_2
1999
+ export declare function TextInput<
2000
+ E extends TextInputElementType = typeof DEFAULT_TEXT_INPUT_ELEMENT,
2001
+ >(props: TextInputProps<E>): React.JSX.Element
2455
2002
 
2456
- /**
2457
- * @internal
2458
- */
2459
- export declare interface ThemeProps {
2460
- theme: Theme_2
2461
- }
2003
+ /** @public */
2004
+ export declare type TextInputClearButtonProps = Omit<
2005
+ ButtonProps<'button'>,
2006
+ 'as' | 'onClick' | 'onMouseDown'
2007
+ >
2462
2008
 
2463
- /**
2464
- * @public
2465
- */
2466
- export declare function ThemeProvider(props: ThemeProviderProps): React.JSX.Element
2009
+ /** @public */
2010
+ export declare type TextInputElementType = 'input' | ComponentType
2467
2011
 
2468
- export declare namespace ThemeProvider {
2469
- var displayName: string
2012
+ /** @public */
2013
+ export declare type TextInputOwnProps = InputStyleProps & {
2014
+ /**
2015
+ * @beta
2016
+ */
2017
+ __unstable_disableFocusRing?: boolean
2018
+ /**
2019
+ * @beta
2020
+ */
2021
+ clearButton?: boolean | TextInputClearButtonProps
2022
+ customValidity?: string
2023
+ icon?: ElementType_2 | ReactNode
2024
+ iconRight?: ElementType_2 | ReactNode
2025
+ /**
2026
+ * @beta
2027
+ */
2028
+ onClear?: () => void
2029
+ prefix?: ReactNode
2030
+ suffix?: ReactNode
2031
+ /**
2032
+ * @deprecated Use `fontWeight` instead
2033
+ */
2034
+ weight?: FontWeight
2470
2035
  }
2471
2036
 
2037
+ /** @public */
2038
+ export declare type TextInputProps<E extends TextInputElementType = TextInputElementType> = Props<
2039
+ TextInputOwnProps,
2040
+ E
2041
+ >
2042
+
2043
+ /** @public */
2044
+ export declare type TextOwnProps = TextStyleProps & TextOverflowStyleProps
2045
+
2046
+ /** @public */
2047
+ export declare type TextProps<E extends TextElementType = TextElementType> = Props<TextOwnProps, E>
2048
+
2472
2049
  /**
2473
- * @public
2050
+ * This API might change. DO NOT USE IN PRODUCTION.
2051
+ * @beta
2474
2052
  */
2475
- export declare interface ThemeProviderProps {
2476
- children?: React.ReactNode
2477
- scheme?: ThemeColorSchemeKey_2
2478
- theme?: RootTheme_2
2479
- tone?: ThemeColorCardToneKey
2053
+ export declare function TextSkeleton<
2054
+ E extends TextSkeletonElementType = typeof DEFAULT_TEXT_SKELETON_ELEMENT,
2055
+ >(props: TextSkeletonProps<E>): React.JSX.Element
2056
+
2057
+ /** @beta */
2058
+ export declare type TextSkeletonElementType = SkeletonElementType
2059
+
2060
+ /** @beta */
2061
+ export declare type TextSkeletonOwnProps = SkeletonOwnProps & {
2062
+ size?: ResponsiveProp<FontTextSize>
2480
2063
  }
2481
2064
 
2482
2065
  /**
2483
- * @public
2484
- * @deprecated Use `ThemeShadow` from `@sanity/ui/theme` instead.
2066
+ * This API might change. DO NOT USE IN PRODUCTION.
2067
+ * @beta
2485
2068
  */
2486
- export declare type ThemeShadow = ThemeShadow_2
2069
+ export declare type TextSkeletonProps<E extends TextSkeletonElementType = TextSkeletonElementType> =
2070
+ Props<TextSkeletonOwnProps, E>
2487
2071
 
2488
2072
  /**
2489
2073
  * The `Toast` component gives feedback to users when an action has taken place.
2490
2074
  *
2491
- * Toasts can be closed with a close button, or auto-dismiss after a certain timeout.
2075
+ * Toasts can be closed with a close button, or auto-dismiss when the duration expires.
2492
2076
  *
2493
- * @public
2077
+ * @internal
2494
2078
  */
2495
- export declare function Toast(
2496
- props: ToastProps &
2497
- Omit<
2498
- React.HTMLProps<HTMLDivElement>,
2499
- | 'as'
2500
- | 'height'
2501
- | 'ref'
2502
- | 'title'
2503
- | 'onAnimationStart'
2504
- | 'onDragStart'
2505
- | 'onDragEnd'
2506
- | 'onDrag'
2507
- >,
2079
+ export declare function Toast<E extends ToastElementType = typeof DEFAULT_TOAST_ELEMENT>(
2080
+ props: ToastProps<E>,
2508
2081
  ): React.JSX.Element
2509
2082
 
2510
- export declare namespace Toast {
2511
- var displayName: string
2512
- }
2513
-
2514
- /**
2515
- * @public
2516
- */
2083
+ /** @public */
2517
2084
  export declare interface ToastContextValue {
2518
2085
  version: 0.0
2519
2086
  /**
@@ -2525,59 +2092,55 @@ export declare interface ToastContextValue {
2525
2092
  push: (params: ToastParams) => string
2526
2093
  }
2527
2094
 
2528
- /**
2529
- * @public
2530
- */
2531
- declare interface ToastLayerProps {
2532
- children: React.ReactNode
2533
- padding?: number | number[]
2534
- paddingX?: number | number[]
2535
- paddingY?: number | number[]
2536
- gap?: number | number[]
2095
+ /** @internal */
2096
+ export declare type ToastElementType = 'li' | ComponentType
2097
+
2098
+ /** @internal */
2099
+ declare type ToastLayerElementType = 'ul' | ComponentType
2100
+
2101
+ /** @internal */
2102
+ declare type ToastLayerOwnProps = GapStyleProps & PaddingStyleProps
2103
+
2104
+ /** @internal */
2105
+ declare type ToastLayerProps<E extends ToastLayerElementType = ToastLayerElementType> = Props<
2106
+ ToastLayerOwnProps,
2107
+ E
2108
+ >
2109
+
2110
+ /** @internal */
2111
+ export declare type ToastOwnProps = RadiusStyleProps & {
2112
+ closable?: boolean
2113
+ description?: ReactNode
2114
+ onClose?: () => void
2115
+ title?: ReactNode
2116
+ status?: 'error' | 'warning' | 'success' | 'info'
2117
+ duration?: number
2537
2118
  }
2538
2119
 
2539
- /**
2540
- * @public
2541
- */
2120
+ /** @public */
2542
2121
  export declare interface ToastParams {
2543
2122
  closable?: boolean
2544
- description?: React.ReactNode
2123
+ description?: ReactNode
2545
2124
  duration?: number
2546
2125
  id?: string
2547
2126
  onClose?: () => void
2548
- title?: React.ReactNode
2127
+ title?: ReactNode
2549
2128
  status?: 'error' | 'warning' | 'success' | 'info'
2550
2129
  }
2551
2130
 
2552
- /**
2553
- * @public
2554
- */
2555
- export declare interface ToastProps {
2556
- closable?: boolean
2557
- description?: React.ReactNode
2558
- onClose: () => void
2559
- radius?: number | number[]
2560
- title?: React.ReactNode
2561
- status?: 'error' | 'warning' | 'success' | 'info'
2562
- duration?: number
2563
- updatedAt?: number
2564
- }
2131
+ /** @internal */
2132
+ export declare type ToastProps<E extends ToastElementType = ToastElementType> = Props<
2133
+ ToastOwnProps,
2134
+ E
2135
+ >
2565
2136
 
2566
- /**
2567
- * @public
2568
- */
2137
+ /** @public */
2569
2138
  export declare function ToastProvider(props: ToastProviderProps): React.JSX.Element
2570
2139
 
2571
- export declare namespace ToastProvider {
2572
- var displayName: string
2573
- }
2574
-
2575
- /**
2576
- * @public
2577
- */
2140
+ /** @public */
2578
2141
  export declare interface ToastProviderProps extends Omit<ToastLayerProps, 'children'> {
2579
2142
  children?: React.ReactNode
2580
- zOffset?: number | number[]
2143
+ zOffset?: ResponsiveProp<number>
2581
2144
  }
2582
2145
 
2583
2146
  /**
@@ -2585,10 +2148,9 @@ export declare interface ToastProviderProps extends Omit<ToastLayerProps, 'child
2585
2148
  *
2586
2149
  * @public
2587
2150
  */
2588
- export declare const Tooltip: ForwardRefExoticComponent<
2589
- Omit<TooltipProps & Omit<HTMLProps<HTMLDivElement>, 'content' | 'children' | 'as'>, 'ref'> &
2590
- RefAttributes<HTMLDivElement>
2591
- >
2151
+ export declare function Tooltip<E extends TooltipElementType = typeof DEFAULT_TOOLTIP_ELEMENT>(
2152
+ props: TooltipProps<E>,
2153
+ ): React.JSX.Element
2592
2154
 
2593
2155
  /**
2594
2156
  * @beta
@@ -2599,31 +2161,24 @@ export declare const TooltipDelayGroupContext: Context<TooltipDelayGroupContextV
2599
2161
  * @beta
2600
2162
  */
2601
2163
  export declare interface TooltipDelayGroupContextValue {
2602
- setIsGroupActive: (nextState: React.SetStateAction<boolean>, delay?: number | undefined) => void
2603
- setOpenTooltipId: (nextId: string | null, delay?: number | undefined) => void
2604
- openDelay: number
2605
- closeDelay: number
2606
- openTooltipId: string | null
2164
+ handleOpenChange: (params: {open: boolean; id: string; immediate?: boolean}) => void
2165
+ visibleTooltipId: string | undefined
2607
2166
  }
2608
2167
 
2609
2168
  /**
2610
2169
  * @public
2611
2170
  * Provides context for a group of tooltip elements that should share a delay
2612
- * which temporarily becomes 1 ms after the first floating element of the group opens.
2171
+ * which temporarily becomes 0ms after the first tooltip of the group opens.
2613
2172
  */
2614
2173
  export declare function TooltipDelayGroupProvider(
2615
2174
  props: TooltipDelayGroupProviderProps,
2616
2175
  ): React.JSX.Element
2617
2176
 
2618
- export declare namespace TooltipDelayGroupProvider {
2619
- var displayName: string
2620
- }
2621
-
2622
2177
  /**
2623
2178
  * @public
2624
2179
  * */
2625
2180
  export declare interface TooltipDelayGroupProviderProps {
2626
- children?: React.ReactNode
2181
+ children?: ReactNode
2627
2182
  /**
2628
2183
  * Handles the delays to open or close a tooltip inside a group
2629
2184
  *
@@ -2633,57 +2188,66 @@ export declare interface TooltipDelayGroupProviderProps {
2633
2188
  *
2634
2189
  * @public
2635
2190
  */
2636
- delay: Delay
2637
- }
2638
-
2639
- /**
2640
- * @public
2641
- */
2642
- export declare interface TooltipProps extends Omit<LayerProps, 'as'> {
2643
- /** @deprecated Use `fallbackPlacements` instead. */
2644
- allowedAutoPlacements?: Placement[]
2645
- arrow?: boolean
2646
- boundaryElement?: HTMLElement | null
2647
- children?: React.JSX.Element
2648
- content?: React.ReactNode
2649
- disabled?: boolean
2650
- fallbackPlacements?: Placement[]
2651
- padding?: number | number[]
2652
- placement?: Placement
2653
- /** Whether or not to render the tooltip in a portal element. */
2654
- portal?: boolean | string
2655
- radius?: number | number[]
2656
- scheme?: ThemeColorSchemeKey_2
2657
- shadow?: number | number[]
2658
- /**
2659
- * Adds a delay to open or close the tooltip.
2660
- *
2661
- * If only a `number` is passed, it will be used for both opening and closing.
2662
- *
2663
- * If an object `{open: number; close:number}` is passed, it can be used to set different delays for each action.
2664
- *
2665
- * @public
2666
- * @defaultValue 0
2667
- */
2668
2191
  delay?: Delay
2669
- /**
2670
- * Whether the tooltip should animate in and out.
2671
- *
2672
- * @beta
2673
- * @defaultValue false
2674
- */
2675
- animate?: boolean
2676
2192
  }
2677
2193
 
2194
+ /** @public */
2195
+ export declare type TooltipElementType = 'div' | 'span' | ComponentType
2196
+
2197
+ /** @public */
2198
+ export declare type TooltipOwnProps = LayerOwnProps &
2199
+ RadiusStyleProps &
2200
+ ShadowStyleProps & {
2201
+ /**
2202
+ * Whether the tooltip should animate in and out.
2203
+ *
2204
+ * @beta
2205
+ * @defaultValue false
2206
+ */
2207
+ animate?: boolean
2208
+ /** @deprecated Will be removed in the next major version */
2209
+ arrow?: boolean
2210
+ boundaryElement?: HTMLElement | null
2211
+ children?: React.ReactElement<
2212
+ React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>
2213
+ >
2214
+ content?: React.ReactNode
2215
+ /**
2216
+ * Adds a delay to open or close the tooltip.
2217
+ *
2218
+ * If only a `number` is passed, it will be used for both opening and closing.
2219
+ *
2220
+ * If an object `{open: number; close:number}` is passed, it can be used to set different delays for each action.
2221
+ *
2222
+ * @public
2223
+ * @defaultValue 0
2224
+ */
2225
+ delay?: Delay
2226
+ disabled?: boolean
2227
+ fallbackPlacements?: Placement[]
2228
+ hotkeys?: string[]
2229
+ placement?: Placement
2230
+ /** Whether or not to render the tooltip in a portal element. */
2231
+ portal?: boolean | string
2232
+ scheme?: ColorScheme
2233
+ text?: React.ReactNode
2234
+ textSize?: ResponsiveProp<FontTextSize>
2235
+ tone?: CardTone
2236
+ }
2237
+
2238
+ /** @public */
2239
+ export declare type TooltipProps<E extends TooltipElementType = TooltipElementType> = Props<
2240
+ TooltipOwnProps,
2241
+ E
2242
+ >
2243
+
2678
2244
  /**
2679
2245
  * This API might change. DO NOT USE IN PRODUCTION.
2680
2246
  * @beta
2681
2247
  */
2682
- export declare const Tree: ForwardRefExoticComponent<
2683
- TreeProps &
2684
- Omit<HTMLProps<HTMLDivElement>, 'height' | 'wrap' | 'ref' | 'role' | 'as' | 'align'> &
2685
- RefAttributes<HTMLDivElement>
2686
- >
2248
+ export declare function Tree<E extends TreeElementType = typeof DEFAULT_TREE_ELEMENT>(
2249
+ props: TreeProps<E>,
2250
+ ): React.JSX.Element
2687
2251
 
2688
2252
  /**
2689
2253
  * @beta
@@ -2691,51 +2255,62 @@ export declare const Tree: ForwardRefExoticComponent<
2691
2255
  export declare interface TreeContextValue {
2692
2256
  version: 0.0
2693
2257
  focusedElement: HTMLElement | null
2258
+ gap: ResponsiveProp<Space>
2694
2259
  level: number
2695
2260
  path: string[]
2696
2261
  registerItem: (element: HTMLElement, path: string, expanded: boolean, selected: boolean) => void
2697
2262
  setExpanded: (path: string, expanded: boolean) => void
2698
2263
  setFocusedElement: (focusedElement: HTMLElement | null) => void
2699
- space: number | number[]
2700
2264
  state: TreeState
2701
2265
  }
2702
2266
 
2267
+ /** @beta */
2268
+ export declare type TreeElementType = 'div' | ComponentType
2269
+
2703
2270
  /**
2704
2271
  * This API might change. DO NOT USE IN PRODUCTION.
2705
2272
  * @beta
2706
2273
  */
2707
- export declare function TreeItem(
2708
- props: TreeItemProps & Omit<React.HTMLProps<HTMLLIElement>, 'as' | 'ref' | 'role'>,
2274
+ export declare function TreeItem<E extends TreeItemElementType = typeof DEFAULT_TREE_ITEM_ELEMENT>(
2275
+ props: TreeItemProps<E>,
2709
2276
  ): React.JSX.Element
2710
2277
 
2711
- export declare namespace TreeItem {
2712
- var displayName: string
2713
- }
2278
+ /** @beta */
2279
+ export declare type TreeItemElementType = 'a' | 'li' | ComponentType
2714
2280
 
2715
- /**
2716
- * @beta
2717
- */
2718
- export declare interface TreeItemProps {
2281
+ /** @beta */
2282
+ export declare type TreeItemOwnProps = SelectableOwnProps & {
2719
2283
  expanded?: boolean
2720
- fontSize?: number | number[]
2721
- icon?: React.ElementType
2284
+ fontSize?: ResponsiveProp<FontTextSize>
2285
+ icon?: ElementType_2
2722
2286
  /**
2723
2287
  * Allows passing a custom element type to the link component
2288
+ * @internal
2724
2289
  */
2725
- linkAs?: BoxProps['as']
2726
- padding?: number | number[]
2727
- space?: number | number[]
2728
- text?: React.ReactNode
2729
- weight?: ThemeFontWeightKey_2
2290
+ linkAs?: SelectableElementType
2291
+ onClick?: MouseEventHandler<HTMLAnchorElement | HTMLLIElement>
2292
+ padding?: ResponsiveProp<Space>
2293
+ gap?: ResponsiveProp<Space>
2294
+ /** @deprecated Use `gap` instead */
2295
+ space?: never
2296
+ text?: ReactNode
2297
+ weight?: FontWeight
2730
2298
  }
2731
2299
 
2300
+ /** @beta */
2301
+ export declare type TreeItemProps<E extends TreeItemElementType = TreeItemElementType> = Props<
2302
+ TreeItemOwnProps,
2303
+ E
2304
+ >
2305
+
2732
2306
  /**
2733
2307
  * This API might change. DO NOT USE IN PRODUCTION.
2734
2308
  * @beta
2735
2309
  */
2736
- export declare interface TreeProps {
2737
- space?: number | number[]
2738
- }
2310
+ export declare type TreeOwnProps = Omit<StackOwnProps, 'position'>
2311
+
2312
+ /** @beta */
2313
+ export declare type TreeProps<E extends TreeElementType = TreeElementType> = Props<TreeOwnProps, E>
2739
2314
 
2740
2315
  /**
2741
2316
  * @beta
@@ -2749,44 +2324,16 @@ export declare interface TreeState {
2749
2324
  | undefined
2750
2325
  }
2751
2326
 
2752
- /**
2753
- * @deprecated instead of `useArrayProp(width)` use `Array.isArray(width) ? width : [width]` instead
2754
- * @beta
2755
- */
2756
- export declare function useArrayProp<T extends ArrayPropPrimitive = ArrayPropPrimitive>(
2757
- val: T | T[] | undefined,
2758
- defaultVal?: T[],
2759
- ): T[]
2760
-
2761
- /**
2762
- * @public
2763
- */
2764
- export declare function useBoundaryElement(): BoundaryElementContextValue
2327
+ /** @public */
2328
+ export declare function useBoundaryElement(): {
2329
+ version: 0.0
2330
+ element: BoundaryElementContextValue
2331
+ }
2765
2332
 
2766
- /**
2767
- * @public
2768
- * @deprecated replaced by the new `useClickOutsideEvent` hook, instead of:
2769
- * ```tsx
2770
- * const [button, setButtonElement] = useState(null)
2771
- * useClickOutside((event) => {}, [button])
2772
- * return <button ref={setButtonElement} />
2773
- * ```
2774
- * do:
2775
- * ```tsx
2776
- * const buttonRef = useRef()
2777
- * useClickOutsideEvent((event) => {}, () => [buttonRef.current])
2778
- * return <button ref={buttonRef} />
2779
- * ```
2780
- */
2781
- export declare function useClickOutside(
2782
- listener: ClickOutsideListener,
2783
- elementsArg?: ClickOutsideElements,
2784
- boundaryElement?: HTMLElement | null,
2785
- ): (el: HTMLElement | null) => void
2333
+ /** @public */
2334
+ export declare function useCard(): CardContextValue
2786
2335
 
2787
- /**
2788
- * @public
2789
- */
2336
+ /** @public */
2790
2337
  export declare function useClickOutsideEvent(
2791
2338
  listener: ClickOutsideEventListener | false | undefined,
2792
2339
  elementsArg?: () => ClickOutsideEventElements,
@@ -2811,34 +2358,12 @@ export declare function useCustomValidity(
2811
2358
  */
2812
2359
  export declare function useDialog(): DialogContextValue
2813
2360
 
2814
- /**
2815
- * Subscribe to the rect of a DOM element.
2816
- * @beta
2817
- *
2818
- * @deprecated Use `useElementSize` instead
2819
- */
2820
- export declare function useElementRect(element: HTMLElement | null): DOMRectReadOnly | null
2821
-
2822
2361
  /**
2823
2362
  * Subscribe to the size of a DOM element.
2824
2363
  * @beta
2825
2364
  */
2826
2365
  export declare function useElementSize(element: HTMLElement | null): ElementSize | null
2827
2366
 
2828
- /**
2829
- * @beta
2830
- * @deprecated use `useImperativeHandle` instead
2831
- * @example
2832
- * ```diff
2833
- * -const ref = useForwardedRef(forwardedRef)
2834
- * +const ref = useRef(null)
2835
- * +useImperativeHandle(forwardedRef, () => ref.current)
2836
- * ```
2837
- */
2838
- export declare function useForwardedRef<T>(
2839
- ref: React.ForwardedRef<T>,
2840
- ): React.MutableRefObject<T | null>
2841
-
2842
2367
  /**
2843
2368
  * Adds global keydown event listener to the window.
2844
2369
  *
@@ -2851,15 +2376,13 @@ export declare function useGlobalKeyDown(
2851
2376
  options?: AddEventListenerOptions,
2852
2377
  ): void
2853
2378
 
2854
- /**
2855
- * @public
2856
- */
2379
+ /** @public */
2857
2380
  export declare function useLayer(): LayerContextValue
2858
2381
 
2859
2382
  /**
2860
2383
  * Efficiently subscribes to `window.matchMedia` queries
2861
2384
  *
2862
- * @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Required if the hook is called during SSR (https://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
2385
+ * @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Required if the hook is called during SSR (https://dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
2863
2386
  *
2864
2387
  * @public
2865
2388
  */
@@ -2872,17 +2395,15 @@ export declare function useMatchMedia(
2872
2395
  * This API might change. DO NOT USE IN PRODUCTION.
2873
2396
  * @beta
2874
2397
  */
2875
- export declare function useMediaIndex(): number
2398
+ export declare function useMediaIndex(): Breakpoint
2876
2399
 
2877
- /**
2878
- * @public
2879
- */
2400
+ /** @public */
2880
2401
  export declare function usePortal(): PortalContextValue
2881
2402
 
2882
2403
  /**
2883
2404
  * Returns true if a dark color scheme is preferred, false if a light color scheme is preferred or the preference is not known.
2884
2405
  *
2885
- * @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query and we assume `(prefers-color-scheme: light)` since it's the most common scheme (https://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
2406
+ * @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query and we assume `(prefers-color-scheme: light)` since it's the most common scheme (https://dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
2886
2407
  *
2887
2408
  * If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
2888
2409
  * Chrome supports reading the `prefers-color-scheme` media query from a header if the server response: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Color-Scheme
@@ -2895,7 +2416,7 @@ export declare function usePrefersDark(getServerSnapshot?: () => boolean): boole
2895
2416
  /**
2896
2417
  * Returns true if motion should be reduced
2897
2418
  *
2898
- * @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query and we assume `(prefers-reduced-motion: no-preference)` since it's the most common scheme (https://react.dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
2419
+ * @param getServerSnapshot - Only called during server-side rendering, and hydration if using hydrateRoot. Since the server environment doesn't have access to the DOM, we can't determine the current value of the media query and we assume `(prefers-reduced-motion: no-preference)` since it's the most common scheme (https://dev/reference/react/useSyncExternalStore#adding-support-for-server-rendering)
2899
2420
  *
2900
2421
  * If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
2901
2422
  * Chrome supports reading the `prefers-reduced-motion` media query from a header if the server response: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Sec-CH-Prefers-Reduced-Motion
@@ -2905,24 +2426,7 @@ export declare function usePrefersDark(getServerSnapshot?: () => boolean): boole
2905
2426
  */
2906
2427
  export declare function usePrefersReducedMotion(getServerSnapshot?: () => boolean): boolean
2907
2428
 
2908
- /**
2909
- * @public
2910
- */
2911
- export declare function useRootTheme(): ThemeContextValue
2912
-
2913
- /**
2914
- * @public
2915
- */
2916
- export declare function useTheme(): Theme_2
2917
-
2918
- /**
2919
- * @public
2920
- */
2921
- export declare function useTheme_v2(): Theme_v2
2922
-
2923
- /**
2924
- * @public
2925
- */
2429
+ /** @public */
2926
2430
  export declare function useToast(): ToastContextValue
2927
2431
 
2928
2432
  /**
@@ -2935,19 +2439,13 @@ export declare function useTooltipDelayGroup(): TooltipDelayGroupContextValue |
2935
2439
  */
2936
2440
  export declare function useTree(): TreeContextValue
2937
2441
 
2938
- /**
2939
- * @beta
2940
- */
2941
- export declare const VirtualList: ForwardRefExoticComponent<
2942
- VirtualListProps<any> &
2943
- StackProps &
2944
- Omit<HTMLProps<HTMLDivElement>, 'children' | 'ref' | 'onChange' | 'as'> &
2945
- RefAttributes<HTMLDivElement>
2946
- >
2442
+ /** @beta */
2443
+ export declare function VirtualList<
2444
+ E extends VirtualListElementType = typeof DEFAULT_VIRTUAL_LIST_ELEMENT,
2445
+ Item = any,
2446
+ >(props: VirtualListProps<E, Item>): React.JSX.Element
2947
2447
 
2948
- /**
2949
- * @beta
2950
- */
2448
+ /** @beta */
2951
2449
  export declare interface VirtualListChangeOpts {
2952
2450
  fromIndex: number
2953
2451
  gap: number
@@ -2957,16 +2455,22 @@ export declare interface VirtualListChangeOpts {
2957
2455
  toIndex: number
2958
2456
  }
2959
2457
 
2960
- /**
2961
- * @beta
2962
- */
2963
- export declare interface VirtualListProps<Item = any> {
2964
- as?: React.ElementType | keyof React.JSX.IntrinsicElements
2965
- gap?: number
2458
+ /** @beta */
2459
+ export declare type VirtualListElementType = 'div' | ComponentType
2460
+
2461
+ /** @beta */
2462
+ export declare interface VirtualListOwnProps<Item = any> {
2463
+ gap?: Space
2966
2464
  getItemKey?: (item: Item, itemIndex: number) => string
2967
2465
  items?: Item[]
2968
2466
  onChange?: (opts: VirtualListChangeOpts) => void
2969
- renderItem?: (item: Item) => React.ReactNode
2467
+ renderItem?: (item: Item) => ReactNode
2970
2468
  }
2971
2469
 
2470
+ /** @beta */
2471
+ export declare type VirtualListProps<
2472
+ E extends VirtualListElementType = VirtualListElementType,
2473
+ Item = any,
2474
+ > = Props<VirtualListOwnProps<Item>, E>
2475
+
2972
2476
  export {}