@sanity/ui 3.1.13 → 4.0.0-beta.0

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