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

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