@sanity/ui 3.3.0 → 3.3.2

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 (379) hide show
  1. package/README.md +12 -0
  2. package/dist/_visual-editing.d.mts +2 -1126
  3. package/dist/_visual-editing.d.ts +2 -1126
  4. package/dist/_visual-editing.js +3 -31
  5. package/dist/_visual-editing.mjs +2 -31
  6. package/dist/index.d.mts +555 -2769
  7. package/dist/index.d.mts.map +1 -0
  8. package/dist/index.d.ts +555 -2769
  9. package/dist/index.d.ts.map +1 -0
  10. package/dist/index.js +2982 -1934
  11. package/dist/index.mjs +2950 -1903
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/refractor.js +16 -0
  14. package/dist/refractor.mjs +21 -0
  15. package/dist/refractor.mjs.map +1 -0
  16. package/dist/tabList.js +3804 -0
  17. package/dist/tabList.mjs +3355 -0
  18. package/dist/tabList.mjs.map +1 -0
  19. package/dist/theme.d.mts +927 -1227
  20. package/dist/theme.d.mts.map +1 -0
  21. package/dist/theme.d.ts +927 -1227
  22. package/dist/theme.d.ts.map +1 -0
  23. package/dist/theme.js +3 -4127
  24. package/dist/theme.mjs +2 -4127
  25. package/dist/theme2.d.mts +2 -0
  26. package/dist/theme2.d.ts +2 -0
  27. package/dist/theme2.js +4104 -0
  28. package/dist/theme2.mjs +3851 -0
  29. package/dist/theme2.mjs.map +1 -0
  30. package/dist/useTheme.d.mts +1451 -0
  31. package/dist/useTheme.d.mts.map +1 -0
  32. package/dist/useTheme.d.ts +1451 -0
  33. package/dist/useTheme.d.ts.map +1 -0
  34. package/exports/_visual-editing.ts +1 -0
  35. package/package.json +52 -168
  36. package/src/core/_compat.ts +30 -0
  37. package/src/core/components/autocomplete/autocomplete.tsx +8 -0
  38. package/src/core/components/autocomplete/autocompleteOption.tsx +1 -0
  39. package/src/core/components/breadcrumbs/breadcrumbs.test.tsx +8 -5
  40. package/src/core/components/breadcrumbs/breadcrumbs.tsx +3 -0
  41. package/src/core/components/dialog/dialog.tsx +5 -2
  42. package/src/core/components/hotkeys/hotkeys.test.tsx +10 -5
  43. package/src/core/components/hotkeys/hotkeys.tsx +2 -0
  44. package/src/core/components/menu/menu.spacing.test.tsx +12 -7
  45. package/src/core/components/menu/menu.test.tsx +9 -6
  46. package/src/core/components/menu/menu.tsx +4 -2
  47. package/src/core/components/menu/menuButton.tsx +8 -0
  48. package/src/core/components/menu/menuDivider.ts +1 -0
  49. package/src/core/components/menu/menuGroup.spacing.test.tsx +9 -6
  50. package/src/core/components/menu/menuGroup.tsx +6 -2
  51. package/src/core/components/menu/menuItem.spacing.test.tsx +8 -5
  52. package/src/core/components/menu/menuItem.tsx +4 -0
  53. package/src/core/components/menu/useMenuController.ts +2 -0
  54. package/src/core/components/skeleton/skeleton.tsx +1 -0
  55. package/src/core/components/tab/tab.tsx +1 -0
  56. package/src/core/components/tab/tabList.test.tsx +7 -5
  57. package/src/core/components/tab/tabList.tsx +1 -0
  58. package/src/core/components/toast/toast.test.tsx +9 -4
  59. package/src/core/components/toast/toast.tsx +1 -0
  60. package/src/core/components/toast/toastLayer.tsx +1 -0
  61. package/src/core/components/tree/tree.test.tsx +10 -5
  62. package/src/core/components/tree/tree.tsx +2 -0
  63. package/src/core/components/tree/treeGroup.tsx +1 -0
  64. package/src/core/components/tree/treeItem.test.tsx +10 -5
  65. package/src/core/components/tree/treeItem.tsx +1 -0
  66. package/src/core/hooks/index.ts +1 -0
  67. package/src/core/hooks/useClickOutside.test.tsx +43 -15
  68. package/src/core/hooks/useClickOutside.ts +1 -1
  69. package/src/core/hooks/useClickOutsideEvent.test.tsx +8 -4
  70. package/src/core/hooks/useDelayed.test.ts +9 -8
  71. package/src/core/hooks/useElementRect/useElementRect.ts +1 -0
  72. package/src/core/hooks/useForwardedRef.ts +1 -0
  73. package/src/core/hooks/useMediaIndex/useMediaIndex.test.tsx +2 -1
  74. package/src/core/hooks/usePrefersDark.hydration.test.tsx +7 -5
  75. package/src/core/hooks/usePrefersDark.test.tsx +3 -1
  76. package/src/core/hooks/usePrefersReducedMotion.hydration.test.tsx +7 -5
  77. package/src/core/hooks/usePrefersReducedMotion.test.tsx +3 -1
  78. package/src/core/lib/createGlobalScopedContext.ts +1 -0
  79. package/src/core/lib/globalScope.ts +1 -0
  80. package/src/core/observers/elementSizeObserver.ts +1 -0
  81. package/src/core/primitives/avatar/avatar.tsx +2 -2
  82. package/src/core/primitives/avatar/avatarStack.tsx +1 -0
  83. package/src/core/primitives/badge/badge.test.tsx +3 -2
  84. package/src/core/primitives/badge/badge.tsx +3 -1
  85. package/src/core/primitives/box/box.test.tsx +18 -5
  86. package/src/core/primitives/box/box.tsx +9 -1
  87. package/src/core/primitives/button/button.test.tsx +10 -6
  88. package/src/core/primitives/button/button.tsx +4 -0
  89. package/src/core/primitives/button/styles.ts +1 -0
  90. package/src/core/primitives/card/card.tsx +2 -5
  91. package/src/core/primitives/card/types.ts +1 -0
  92. package/src/core/primitives/code/code.tsx +1 -0
  93. package/src/core/primitives/code/refractor.tsx +2 -0
  94. package/src/core/primitives/container/container.tsx +1 -0
  95. package/src/core/primitives/flex/flex.tsx +2 -3
  96. package/src/core/primitives/grid/grid.test.tsx +11 -5
  97. package/src/core/primitives/grid/grid.tsx +3 -0
  98. package/src/core/primitives/heading/heading.tsx +1 -0
  99. package/src/core/primitives/inline/inline.test.tsx +9 -5
  100. package/src/core/primitives/inline/inline.tsx +3 -0
  101. package/src/core/primitives/kbd/kbd.tsx +5 -1
  102. package/src/core/primitives/label/label.tsx +1 -0
  103. package/src/core/primitives/popover/popover.tsx +5 -4
  104. package/src/core/primitives/popover/popoverCard.tsx +1 -0
  105. package/src/core/primitives/popover/types.ts +0 -1
  106. package/src/core/primitives/select/select.test.tsx +9 -5
  107. package/src/core/primitives/select/select.tsx +1 -0
  108. package/src/core/primitives/stack/stack.test.tsx +9 -5
  109. package/src/core/primitives/stack/stack.tsx +2 -0
  110. package/src/core/primitives/stack/styles.ts +1 -0
  111. package/src/core/primitives/text/text.tsx +1 -0
  112. package/src/core/primitives/textInput/textInput.test.tsx +9 -5
  113. package/src/core/primitives/textInput/textInput.tsx +3 -0
  114. package/src/core/primitives/tooltip/tooltip.test.tsx +82 -49
  115. package/src/core/primitives/tooltip/tooltip.tsx +3 -1
  116. package/src/core/primitives/tooltip/tooltipCard.tsx +1 -0
  117. package/src/core/primitives/tooltip/tooltipDelayGroup/types.ts +2 -0
  118. package/src/core/styles/flex/types.ts +0 -1
  119. package/src/core/styles/font/responsiveFont.ts +0 -3
  120. package/src/core/styles/font/types.ts +1 -3
  121. package/src/core/styles/grid/gridStyle.ts +1 -0
  122. package/src/core/styles/margin/marginStyle.ts +1 -0
  123. package/src/core/styles/margin/marginsStyle.test.ts +2 -1
  124. package/src/core/styles/padding/paddingStyle.test.ts +2 -1
  125. package/src/core/styles/padding/paddingStyle.ts +1 -0
  126. package/src/core/theme/theme.test.tsx +7 -3
  127. package/src/core/theme/useRootTheme.ts +1 -0
  128. package/src/core/theme/useTheme.ts +2 -0
  129. package/src/core/utils/arrow/arrow.tsx +1 -0
  130. package/src/core/utils/boundaryElement/boundaryElement.test.tsx +9 -4
  131. package/src/core/utils/conditionalWrapper/conditionalWrapper.tsx +1 -0
  132. package/src/core/utils/getElementRef.ts +5 -0
  133. package/src/core/utils/layer/getLayerContext.test.ts +2 -0
  134. package/src/core/utils/layer/layer.test.tsx +9 -4
  135. package/src/core/utils/layer/layer.tsx +1 -0
  136. package/src/core/utils/layer/useLayer.ts +2 -0
  137. package/src/core/utils/portal/portal.test.tsx +9 -4
  138. package/src/core/utils/portal/portalProvider.tsx +1 -0
  139. package/src/core/utils/virtualList/virtualList.tsx +2 -1
  140. package/src/theme/build/_deprecated/color/_selectable/createSelectableTones.ts +10 -0
  141. package/src/theme/build/_deprecated/color/_solid/createSolidTones.ts +4 -0
  142. package/src/theme/build/_deprecated/color/button/createButtonModes.ts +5 -0
  143. package/src/theme/build/_deprecated/color/button/createButtonTones.ts +5 -0
  144. package/src/theme/build/_deprecated/color/card/createCardStates.ts +6 -0
  145. package/src/theme/build/_deprecated/color/color.test.ts +5 -1
  146. package/src/theme/build/_deprecated/color/defaults.ts +1 -0
  147. package/src/theme/build/_deprecated/color/factory.ts +36 -0
  148. package/src/theme/build/_deprecated/color/input/createInputModes.ts +5 -0
  149. package/src/theme/build/_deprecated/color/muted/createMuted.ts +4 -0
  150. package/src/theme/build/_deprecated/color/spot/createSpot.ts +3 -0
  151. package/src/theme/build/buildColorTheme.test.ts +2 -0
  152. package/src/theme/build/buildColorTheme.ts +8 -0
  153. package/src/theme/build/buildTheme.test.ts +2 -0
  154. package/src/theme/build/lib/color-fns/color-fns.test.ts +3 -1
  155. package/src/theme/build/merge.ts +5 -0
  156. package/src/theme/build/mixThemeColor.test.ts +2 -0
  157. package/src/theme/build/renderColorTheme.ts +6 -0
  158. package/src/theme/build/renderColorValue.ts +0 -2
  159. package/src/theme/build/resolveColorTokens.ts +6 -0
  160. package/src/theme/build/theme.test.ts +2 -0
  161. package/src/theme/config/helpers.ts +5 -0
  162. package/src/theme/config/system.ts +2 -0
  163. package/src/theme/config/tokens/color/types.ts +6 -4
  164. package/src/theme/config/tokens/parseTokenKey.test.ts +2 -0
  165. package/src/theme/config/tokens/parseTokenValue.test.ts +2 -0
  166. package/src/theme/config/tokens/parseTokenValue.ts +1 -0
  167. package/src/theme/getScopedTheme.ts +6 -1
  168. package/src/theme/system/color/_helpers.ts +4 -0
  169. package/src/theme/system/theme.ts +4 -0
  170. package/src/theme/system/v0/color/_system.ts +1 -0
  171. package/src/theme/system/v0/color/button.ts +14 -0
  172. package/src/theme/system/v0/color/card.ts +6 -0
  173. package/src/theme/system/v0/color/color.ts +11 -0
  174. package/src/theme/system/v0/color/input.ts +6 -0
  175. package/src/theme/system/v0/color/muted.ts +11 -0
  176. package/src/theme/system/v0/color/selectable.ts +11 -0
  177. package/src/theme/system/v0/color/solid.ts +11 -0
  178. package/src/theme/system/v0/color/spot.ts +1 -0
  179. package/src/theme/versioning/getTheme_v2.ts +15 -0
  180. package/src/theme/versioning/themeColor_v0_v2.ts +7 -0
  181. package/src/theme/versioning/themeColor_v2_v2_9.ts +1 -0
  182. package/src/theme/versioning/v0_v2.ts +13 -1
  183. package/src/theme/versioning/v2_v0.ts +18 -0
  184. package/dist/_chunks-cjs/_visual-editing.js +0 -5899
  185. package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
  186. package/dist/_chunks-cjs/refractor.js +0 -23
  187. package/dist/_chunks-cjs/refractor.js.map +0 -1
  188. package/dist/_chunks-es/_visual-editing.mjs +0 -5905
  189. package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
  190. package/dist/_chunks-es/refractor.mjs +0 -26
  191. package/dist/_chunks-es/refractor.mjs.map +0 -1
  192. package/dist/_visual-editing.js.map +0 -1
  193. package/dist/_visual-editing.mjs.map +0 -1
  194. package/dist/index.js.map +0 -1
  195. package/dist/theme.js.map +0 -1
  196. package/dist/theme.mjs.map +0 -1
  197. package/src/core/__workshop__/constants.ts +0 -293
  198. package/src/core/components/autocomplete/__mocks__/apiStore.ts +0 -49
  199. package/src/core/components/autocomplete/__mocks__/countries.ts +0 -245
  200. package/src/core/components/autocomplete/__workshop__/async.tsx +0 -156
  201. package/src/core/components/autocomplete/__workshop__/constrainedHeight.tsx +0 -137
  202. package/src/core/components/autocomplete/__workshop__/custom.tsx +0 -89
  203. package/src/core/components/autocomplete/__workshop__/example.tsx +0 -79
  204. package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +0 -36
  205. package/src/core/components/autocomplete/__workshop__/fullscreen.tsx +0 -294
  206. package/src/core/components/autocomplete/__workshop__/index.ts +0 -39
  207. package/src/core/components/autocomplete/__workshop__/types.ts +0 -4
  208. package/src/core/components/breadcrumbs/__workshop__/example.tsx +0 -62
  209. package/src/core/components/breadcrumbs/__workshop__/index.ts +0 -14
  210. package/src/core/components/dialog/__workshop__/activate.tsx +0 -134
  211. package/src/core/components/dialog/__workshop__/autoFocus.tsx +0 -29
  212. package/src/core/components/dialog/__workshop__/index.ts +0 -19
  213. package/src/core/components/dialog/__workshop__/layering.tsx +0 -41
  214. package/src/core/components/dialog/__workshop__/nested.tsx +0 -72
  215. package/src/core/components/dialog/__workshop__/onScroll.tsx +0 -39
  216. package/src/core/components/dialog/__workshop__/panes.tsx +0 -82
  217. package/src/core/components/dialog/__workshop__/position.tsx +0 -30
  218. package/src/core/components/dialog/__workshop__/props.tsx +0 -75
  219. package/src/core/components/dialog/__workshop__/provider.tsx +0 -11
  220. package/src/core/components/dialog/__workshop__/wrapped.tsx +0 -76
  221. package/src/core/components/hotkeys/__workshop__/index.ts +0 -14
  222. package/src/core/components/hotkeys/__workshop__/plain.tsx +0 -9
  223. package/src/core/components/menu/__workshop__/asComponent.tsx +0 -45
  224. package/src/core/components/menu/__workshop__/avatarMenu.tsx +0 -51
  225. package/src/core/components/menu/__workshop__/closableMenuButton.tsx +0 -46
  226. package/src/core/components/menu/__workshop__/constrainedInBoundary.tsx +0 -134
  227. package/src/core/components/menu/__workshop__/customMenuItem.tsx +0 -45
  228. package/src/core/components/menu/__workshop__/customSelectedState.tsx +0 -39
  229. package/src/core/components/menu/__workshop__/disableFocusOnClose.tsx +0 -40
  230. package/src/core/components/menu/__workshop__/groups.tsx +0 -156
  231. package/src/core/components/menu/__workshop__/index.ts +0 -89
  232. package/src/core/components/menu/__workshop__/menuButton.tsx +0 -80
  233. package/src/core/components/menu/__workshop__/menuGroupRight.tsx +0 -65
  234. package/src/core/components/menu/__workshop__/nestedMenu.tsx +0 -22
  235. package/src/core/components/menu/__workshop__/onCloseMenuButton.tsx +0 -41
  236. package/src/core/components/menu/__workshop__/selectedItem.tsx +0 -69
  237. package/src/core/components/menu/__workshop__/shouldFocus.tsx +0 -47
  238. package/src/core/components/menu/__workshop__/tones.tsx +0 -25
  239. package/src/core/components/menu/__workshop__/withoutArrow.tsx +0 -32
  240. package/src/core/components/skeleton/__workshop__/delay.tsx +0 -70
  241. package/src/core/components/skeleton/__workshop__/index.ts +0 -11
  242. package/src/core/components/skeleton/__workshop__/skeleton.tsx +0 -64
  243. package/src/core/components/tab/__workshop__/example.tsx +0 -79
  244. package/src/core/components/tab/__workshop__/index.ts +0 -14
  245. package/src/core/components/toast/__workshop__/hook.tsx +0 -71
  246. package/src/core/components/toast/__workshop__/index.ts +0 -19
  247. package/src/core/components/toast/__workshop__/toast.tsx +0 -26
  248. package/src/core/components/tree/__workshop__/basic.perf.ts +0 -19
  249. package/src/core/components/tree/__workshop__/basic.tsx +0 -105
  250. package/src/core/components/tree/__workshop__/index.ts +0 -21
  251. package/src/core/components/tree/__workshop__/tabFromElement.tsx +0 -84
  252. package/src/core/hooks/useElementRect/__workshop__/example.tsx +0 -32
  253. package/src/core/hooks/useElementRect/__workshop__/index.ts +0 -14
  254. package/src/core/hooks/useMediaIndex/__workshop__/index.ts +0 -14
  255. package/src/core/hooks/useMediaIndex/__workshop__/test.tsx +0 -14
  256. package/src/core/primitives/avatar/__workshop__/asButton.tsx +0 -14
  257. package/src/core/primitives/avatar/__workshop__/index.ts +0 -29
  258. package/src/core/primitives/avatar/__workshop__/stack.tsx +0 -25
  259. package/src/core/primitives/avatar/__workshop__/withinButton.tsx +0 -63
  260. package/src/core/primitives/avatar/__workshop__/withinMenuItem.tsx +0 -70
  261. package/src/core/primitives/badge/__workshop__/index.ts +0 -19
  262. package/src/core/primitives/badge/__workshop__/props.tsx +0 -30
  263. package/src/core/primitives/badge/__workshop__/tones.tsx +0 -21
  264. package/src/core/primitives/box/__workshop__/asComponent.tsx +0 -31
  265. package/src/core/primitives/box/__workshop__/index.ts +0 -24
  266. package/src/core/primitives/box/__workshop__/props.tsx +0 -20
  267. package/src/core/primitives/box/__workshop__/responsive.tsx +0 -20
  268. package/src/core/primitives/button/__workshop__/custom.tsx +0 -51
  269. package/src/core/primitives/button/__workshop__/customIcons.tsx +0 -30
  270. package/src/core/primitives/button/__workshop__/disabled.tsx +0 -74
  271. package/src/core/primitives/button/__workshop__/index.ts +0 -59
  272. package/src/core/primitives/button/__workshop__/mixedChildren.tsx +0 -12
  273. package/src/core/primitives/button/__workshop__/props.tsx +0 -55
  274. package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +0 -36
  275. package/src/core/primitives/button/__workshop__/stacked.tsx +0 -58
  276. package/src/core/primitives/button/__workshop__/styled1.tsx +0 -17
  277. package/src/core/primitives/button/__workshop__/styled2.tsx +0 -19
  278. package/src/core/primitives/button/__workshop__/uploadButton.tsx +0 -28
  279. package/src/core/primitives/card/__workshop__/allTones.tsx +0 -25
  280. package/src/core/primitives/card/__workshop__/asButton.tsx +0 -107
  281. package/src/core/primitives/card/__workshop__/asComponent.tsx +0 -27
  282. package/src/core/primitives/card/__workshop__/checkered.tsx +0 -26
  283. package/src/core/primitives/card/__workshop__/index.ts +0 -18
  284. package/src/core/primitives/card/__workshop__/interactive.tsx +0 -30
  285. package/src/core/primitives/card/__workshop__/listNavigation.tsx +0 -80
  286. package/src/core/primitives/card/__workshop__/props.tsx +0 -53
  287. package/src/core/primitives/card/__workshop__/selected.tsx +0 -94
  288. package/src/core/primitives/card/__workshop__/styled.tsx +0 -14
  289. package/src/core/primitives/checkbox/__workshop__/example.tsx +0 -25
  290. package/src/core/primitives/checkbox/__workshop__/index.ts +0 -13
  291. package/src/core/primitives/checkbox/__workshop__/props.tsx +0 -33
  292. package/src/core/primitives/checkbox/__workshop__/readOnly.tsx +0 -16
  293. package/src/core/primitives/checkbox/__workshop__/tones.tsx +0 -28
  294. package/src/core/primitives/code/__workshop__/index.ts +0 -19
  295. package/src/core/primitives/code/__workshop__/opticalAlignment.tsx +0 -48
  296. package/src/core/primitives/code/__workshop__/props.tsx +0 -21
  297. package/src/core/primitives/container/__workshop__/example.tsx +0 -20
  298. package/src/core/primitives/container/__workshop__/index.ts +0 -8
  299. package/src/core/primitives/flex/__workshop__/example.tsx +0 -34
  300. package/src/core/primitives/flex/__workshop__/gap.tsx +0 -25
  301. package/src/core/primitives/flex/__workshop__/index.ts +0 -11
  302. package/src/core/primitives/grid/__workshop__/index.ts +0 -10
  303. package/src/core/primitives/grid/__workshop__/responsive.tsx +0 -54
  304. package/src/core/primitives/heading/__workshop__/index.ts +0 -19
  305. package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +0 -54
  306. package/src/core/primitives/heading/__workshop__/plain.tsx +0 -32
  307. package/src/core/primitives/inline/__workshop__/index.ts +0 -8
  308. package/src/core/primitives/inline/__workshop__/plain.tsx +0 -27
  309. package/src/core/primitives/kbd/__workshop__/index.ts +0 -8
  310. package/src/core/primitives/kbd/__workshop__/plain.tsx +0 -9
  311. package/src/core/primitives/label/__workshop__/index.ts +0 -19
  312. package/src/core/primitives/label/__workshop__/opticalAlignment.tsx +0 -48
  313. package/src/core/primitives/label/__workshop__/plain.tsx +0 -24
  314. package/src/core/primitives/popover/__workshop__/AlignedStory.tsx +0 -77
  315. package/src/core/primitives/popover/__workshop__/MarginsStory.tsx +0 -31
  316. package/src/core/primitives/popover/__workshop__/MatchReferenceWidthStory.tsx +0 -32
  317. package/src/core/primitives/popover/__workshop__/OpenOnMountStory.tsx +0 -11
  318. package/src/core/primitives/popover/__workshop__/PlainStory.tsx +0 -71
  319. package/src/core/primitives/popover/__workshop__/RecursiveStory.tsx +0 -71
  320. package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +0 -89
  321. package/src/core/primitives/popover/__workshop__/TestStory.tsx +0 -97
  322. package/src/core/primitives/popover/__workshop__/index.ts +0 -49
  323. package/src/core/primitives/radio/__workshop__/example.tsx +0 -63
  324. package/src/core/primitives/radio/__workshop__/index.ts +0 -11
  325. package/src/core/primitives/radio/__workshop__/plain.tsx +0 -28
  326. package/src/core/primitives/select/__workshop__/index.ts +0 -11
  327. package/src/core/primitives/select/__workshop__/plain.tsx +0 -27
  328. package/src/core/primitives/select/__workshop__/readOnly.tsx +0 -23
  329. package/src/core/primitives/spinner/__workshop__/Props.tsx +0 -15
  330. package/src/core/primitives/spinner/__workshop__/index.ts +0 -14
  331. package/src/core/primitives/stack/__workshop__/index.ts +0 -14
  332. package/src/core/primitives/stack/__workshop__/plain.tsx +0 -32
  333. package/src/core/primitives/switch/__workshop__/example.tsx +0 -23
  334. package/src/core/primitives/switch/__workshop__/index.ts +0 -11
  335. package/src/core/primitives/switch/__workshop__/props.tsx +0 -21
  336. package/src/core/primitives/text/__workshop__/colored.tsx +0 -30
  337. package/src/core/primitives/text/__workshop__/example.tsx +0 -39
  338. package/src/core/primitives/text/__workshop__/index.ts +0 -24
  339. package/src/core/primitives/text/__workshop__/opticalAlignment.tsx +0 -48
  340. package/src/core/primitives/textArea/__workshop__/index.ts +0 -14
  341. package/src/core/primitives/textArea/__workshop__/plain.tsx +0 -50
  342. package/src/core/primitives/textInput/__workshop__/clearButton.tsx +0 -30
  343. package/src/core/primitives/textInput/__workshop__/customValidity.tsx +0 -17
  344. package/src/core/primitives/textInput/__workshop__/index.ts +0 -44
  345. package/src/core/primitives/textInput/__workshop__/plain.tsx +0 -98
  346. package/src/core/primitives/textInput/__workshop__/readOnly.tsx +0 -9
  347. package/src/core/primitives/textInput/__workshop__/states.tsx +0 -53
  348. package/src/core/primitives/textInput/__workshop__/tones.tsx +0 -277
  349. package/src/core/primitives/textInput/__workshop__/typed.tsx +0 -23
  350. package/src/core/primitives/tooltip/__workshop__/customPortal.tsx +0 -102
  351. package/src/core/primitives/tooltip/__workshop__/index.ts +0 -29
  352. package/src/core/primitives/tooltip/__workshop__/overflowingBoundary.tsx +0 -74
  353. package/src/core/primitives/tooltip/__workshop__/props.tsx +0 -107
  354. package/src/core/primitives/tooltip/__workshop__/resizableBoundary.tsx +0 -86
  355. package/src/core/theme/__workshop__/build/Root.tsx +0 -367
  356. package/src/core/theme/__workshop__/build/helpers.ts +0 -46
  357. package/src/core/theme/__workshop__/build/story.tsx +0 -465
  358. package/src/core/theme/__workshop__/canvas.tsx +0 -352
  359. package/src/core/theme/__workshop__/color.tsx +0 -62
  360. package/src/core/theme/__workshop__/debug/story.tsx +0 -408
  361. package/src/core/theme/__workshop__/index.ts +0 -39
  362. package/src/core/theme/__workshop__/layer.tsx +0 -78
  363. package/src/core/theme/__workshop__/nestedProvider.tsx +0 -15
  364. package/src/core/utils/boundaryElement/__workshop__/index.ts +0 -14
  365. package/src/core/utils/boundaryElement/__workshop__/plain.tsx +0 -19
  366. package/src/core/utils/elementQuery/__workshop__/customMedia.tsx +0 -30
  367. package/src/core/utils/elementQuery/__workshop__/index.ts +0 -14
  368. package/src/core/utils/layer/__workshop__/_debug.tsx +0 -17
  369. package/src/core/utils/layer/__workshop__/index.ts +0 -24
  370. package/src/core/utils/layer/__workshop__/multipleRoots.tsx +0 -49
  371. package/src/core/utils/layer/__workshop__/nested.tsx +0 -98
  372. package/src/core/utils/layer/__workshop__/responsiveZOffset.tsx +0 -13
  373. package/src/core/utils/portal/__workshop__/index.ts +0 -14
  374. package/src/core/utils/portal/__workshop__/named.tsx +0 -63
  375. package/src/core/utils/virtualList/__workshop__/changingProps.tsx +0 -36
  376. package/src/core/utils/virtualList/__workshop__/elementScroll.tsx +0 -24
  377. package/src/core/utils/virtualList/__workshop__/index.ts +0 -29
  378. package/src/core/utils/virtualList/__workshop__/infiniteList.tsx +0 -48
  379. package/src/core/utils/virtualList/__workshop__/windowScrolll.tsx +0 -22
@@ -1,1126 +1,2 @@
1
- import {BaseTheme} from '@sanity/ui/theme'
2
- import {ForwardRefExoticComponent} from 'react'
3
- import {HTMLProps} from 'react'
4
- import {Ref} from 'react'
5
- import {RefAttributes} from 'react'
6
- import {RootTheme} from '@sanity/ui/theme'
7
- import {Theme_v2} from '@sanity/ui/theme'
8
- import {ThemeColorButtonModeKey} from '@sanity/ui/theme'
9
- import {ThemeColorCardToneKey} from '@sanity/ui/theme'
10
- import {ThemeColorSchemeKey} from '@sanity/ui/theme'
11
- import {ThemeColorStateToneKey} from '@sanity/ui/theme'
12
- import {ThemeFontWeightKey} from '@sanity/ui/theme'
13
-
14
- /**
15
- * Assign properties from `U` to `T`, excluding properties that already exist in `T`.
16
- *
17
- * @public
18
- */
19
- declare type Assign<T extends object, U extends object> = Omit<T, keyof U> & U
20
-
21
- /**
22
- * The `Box` component is a basic layout wrapper component which provides utility properties
23
- * for flex, margins and padding.
24
- *
25
- * @public
26
- */
27
- export declare const Box: <E extends ElementType = 'div'>(props: BoxProps<E>) => React.JSX.Element
28
-
29
- /**
30
- * @public
31
- */
32
- declare type BoxDisplay = 'none' | 'block' | 'grid' | 'flex' | 'inline-block'
33
-
34
- /**
35
- * @public
36
- */
37
- declare type BoxHeight = 'stretch' | 'fill'
38
-
39
- /**
40
- * @public
41
- */
42
- declare type BoxOverflow = 'visible' | 'hidden' | 'auto'
43
-
44
- /**
45
- * The props that `Box` adds on top of the element it renders as.
46
- *
47
- * @public
48
- */
49
- declare interface BoxOwnProps
50
- extends ResponsiveFlexItemProps,
51
- ResponsiveBoxProps,
52
- ResponsiveGridItemProps,
53
- ResponsiveMarginProps,
54
- ResponsivePaddingProps {
55
- forwardedAs?: ElementType
56
- }
57
-
58
- /**
59
- * @public
60
- */
61
- declare type BoxProps<E extends ElementType = 'div'> = Props<BoxOwnProps, E>
62
-
63
- /**
64
- * @public
65
- */
66
- declare type BoxSizing = 'content' | 'border'
67
-
68
- /**
69
- * @public
70
- */
71
- export declare const Button: <E extends ElementType = 'button'>(
72
- props: ButtonProps<E>,
73
- ) => React.JSX.Element
74
-
75
- /**
76
- * @public
77
- */
78
- declare type ButtonMode = ThemeColorButtonModeKey
79
-
80
- /**
81
- * @public
82
- */
83
- declare interface ButtonOwnProps extends ResponsivePaddingProps, ResponsiveRadiusProps {
84
- fontSize?: number | number[]
85
- mode?: ButtonMode
86
- icon?: React.ElementType | React.ReactNode
87
- iconRight?: React.ElementType | React.ReactNode
88
- justify?: FlexJustify | FlexJustify[]
89
- /**
90
- * @beta Do not use in production, as this might change.
91
- */
92
- loading?: boolean
93
- selected?: boolean
94
- /**
95
- * @deprecated Use `gap` instead. `space` will be removed in v4.
96
- */
97
- space?: number | number[]
98
- gap?: number | number[]
99
- muted?: boolean
100
- text?: React.ReactNode
101
- textAlign?: ButtonTextAlign
102
- textWeight?: ThemeFontWeightKey
103
- tone?: ButtonTone
104
- type?: 'button' | 'reset' | 'submit'
105
- width?: ButtonWidth
106
- }
107
-
108
- /**
109
- * @public
110
- */
111
- declare type ButtonProps<E extends ElementType = 'button'> = Props<ButtonOwnProps, E>
112
-
113
- /**
114
- * @public
115
- */
116
- declare type ButtonTextAlign = 'left' | 'right' | 'center'
117
-
118
- /**
119
- * @public
120
- */
121
- declare type ButtonTone = ThemeColorStateToneKey
122
-
123
- /**
124
- * @public
125
- */
126
- declare type ButtonWidth = 'fill'
127
-
128
- /**
129
- * The `Card` component acts much like a `Box`, but with a background and foreground color.
130
- * Components within a `Card` inherit its colors.
131
- *
132
- * @public
133
- */
134
- export declare const Card: <E extends ElementType = 'div'>(props: CardProps<E>) => React.JSX.Element
135
-
136
- /**
137
- * @public
138
- */
139
- declare interface CardOwnProps
140
- extends BoxOwnProps,
141
- ResponsiveBorderProps,
142
- ResponsiveRadiusProps,
143
- ResponsiveShadowProps {
144
- /**
145
- * Do not use in production.
146
- * @beta
147
- */
148
- __unstable_checkered?: boolean
149
- /**
150
- * Do not use in production.
151
- * @beta
152
- */
153
- __unstable_focusRing?: boolean
154
- disabled?: boolean
155
- muted?: boolean
156
- pressed?: boolean
157
- scheme?: ThemeColorSchemeKey
158
- selected?: boolean
159
- tone?: CardTone
160
- }
161
-
162
- /**
163
- * @public
164
- */
165
- declare type CardProps<E extends ElementType = 'div'> = Props<CardOwnProps, E>
166
-
167
- /**
168
- * @public
169
- */
170
- declare type CardTone = ThemeColorCardToneKey | 'inherit'
171
-
172
- /** @public */
173
- declare type ComponentType<P = any> =
174
- | React.FunctionComponent<P>
175
- | React.ComponentClass<P>
176
- | React.ExoticComponent<P>
177
-
178
- /**
179
- * @public
180
- */
181
- declare type Delay =
182
- | number
183
- | Partial<{
184
- open: number
185
- close: number
186
- }>
187
-
188
- /** @public */
189
- declare type ElementType<P = any> = TagType | ComponentType<P>
190
-
191
- /** @public */
192
- declare type EmptyProps = object
193
-
194
- /**
195
- * The `Flex` component is a wrapper component for flexible elements (`Box`, `Card` and `Flex`).
196
- *
197
- * @public
198
- */
199
- export declare const Flex: <E extends ElementType = 'div'>(props: FlexProps<E>) => React.JSX.Element
200
-
201
- /**
202
- * @public
203
- */
204
- declare type FlexAlign = 'flex-start' | 'flex-end' | 'center' | 'baseline' | 'stretch'
205
-
206
- /**
207
- * @public
208
- */
209
- declare type FlexDirection = 'row' | 'row-reverse' | 'column' | 'column-reverse'
210
-
211
- /**
212
- * @public
213
- */
214
- declare type FlexJustify =
215
- | 'flex-start'
216
- | 'flex-end'
217
- | 'center'
218
- | 'space-between'
219
- | 'space-around'
220
- | 'space-evenly'
221
-
222
- /**
223
- * @public
224
- */
225
- declare interface FlexOwnProps
226
- extends Omit<BoxOwnProps, 'display'>,
227
- ResponsiveFlexProps,
228
- ResponsiveFlexItemProps {
229
- gap?: number | number[]
230
- }
231
-
232
- /**
233
- * @public
234
- */
235
- declare type FlexProps<E extends ElementType = 'div'> = Props<FlexOwnProps, E>
236
-
237
- /**
238
- * @public
239
- */
240
- declare type FlexValue = number | 'none' | 'auto' | 'initial'
241
-
242
- /**
243
- * @public
244
- */
245
- declare type FlexWrap = 'wrap' | 'wrap-reverse' | 'nowrap'
246
-
247
- /**
248
- * The `Grid` component is for building 2-dimensional layers (based on CSS grid).
249
- *
250
- * @public
251
- */
252
- export declare const Grid: <E extends ElementType = 'div'>(props: GridProps<E>) => React.JSX.Element
253
-
254
- /**
255
- * @public
256
- */
257
- declare type GridAutoCols = 'auto' | 'min' | 'max' | 'fr'
258
-
259
- /**
260
- * @public
261
- */
262
- declare type GridAutoFlow = 'row' | 'column' | 'row dense' | 'column dense'
263
-
264
- /**
265
- * @public
266
- */
267
- declare type GridAutoRows = 'auto' | 'min' | 'max' | 'fr'
268
-
269
- /**
270
- * @public
271
- */
272
- declare type GridItemColumn = 'auto' | 'full' | number
273
-
274
- /**
275
- * @public
276
- */
277
- declare type GridItemColumnEnd = 'auto' | number
278
-
279
- /**
280
- * @public
281
- */
282
- declare type GridItemColumnStart = 'auto' | number
283
-
284
- /**
285
- * @public
286
- */
287
- declare type GridItemRow = 'auto' | 'full' | number
288
-
289
- /**
290
- * @public
291
- */
292
- declare type GridItemRowEnd = 'auto' | number
293
-
294
- /**
295
- * @public
296
- */
297
- declare type GridItemRowStart = 'auto' | number
298
-
299
- /**
300
- * @public
301
- */
302
- declare interface GridOwnProps extends Omit<BoxOwnProps, 'display'>, ResponsiveGridProps {}
303
-
304
- /**
305
- * @public
306
- */
307
- declare type GridProps<E extends ElementType = 'div'> = Props<GridOwnProps, E>
308
-
309
- /**
310
- * Represent hotkeys (a keyboard combination) with semantic `<kbd>` elements.
311
- *
312
- * @public
313
- */
314
- export declare const Hotkeys: ForwardRefExoticComponent<
315
- HotkeysProps & Omit<HTMLProps<HTMLElement>, 'size' | 'as' | 'ref'> & RefAttributes<HTMLElement>
316
- >
317
-
318
- /**
319
- * @public
320
- */
321
- declare interface HotkeysProps {
322
- fontSize?: number | number[]
323
- gap?: number | number[]
324
- padding?: number | number[]
325
- radius?: Radius | Radius[]
326
- /**
327
- * @deprecated Use `gap` instead. `space` will be removed in v4.
328
- */
329
- space?: number | number[]
330
- keys?: string[]
331
- }
332
-
333
- /**
334
- * @public
335
- */
336
- declare interface InlineOwnProps extends Omit<BoxOwnProps, 'display'> {
337
- /**
338
- * The spacing between children.
339
- * @deprecated Use `gap` instead. `space` will be removed in v4.
340
- */
341
- space?: number | number[]
342
- /** The spacing between children. */
343
- gap?: number | number[]
344
- }
345
-
346
- /**
347
- * @internal
348
- */
349
- export declare function isHTMLAnchorElement(element: unknown): element is HTMLAnchorElement
350
-
351
- /**
352
- * @internal
353
- */
354
- export declare function isHTMLElement(node: unknown): node is HTMLElement
355
-
356
- /**
357
- * @public
358
- */
359
- declare interface LayerProps {
360
- as?: React.ElementType | keyof React.JSX.IntrinsicElements
361
- /** A callback that fires when the layer becomes the top layer when it was not the top layer before. */
362
- onActivate?: (props: {activeElement: HTMLElement | null}) => void
363
- zOffset?: number | number[]
364
- }
365
-
366
- /**
367
- * @public
368
- */
369
- export declare function LayerProvider(props: LayerProviderProps): React.JSX.Element
370
-
371
- export declare namespace LayerProvider {
372
- var displayName: string
373
- }
374
-
375
- /**
376
- * @public
377
- */
378
- declare interface LayerProviderProps {
379
- children?: React.ReactNode
380
- zOffset?: number | number[]
381
- }
382
-
383
- /**
384
- * The `Menu` component is a building block for application menus.
385
- *
386
- * @public
387
- */
388
- export declare const Menu: ForwardRefExoticComponent<
389
- Omit<MenuProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'as' | 'tabIndex' | 'role'>, 'ref'> &
390
- RefAttributes<HTMLDivElement>
391
- >
392
-
393
- /**
394
- * @public
395
- */
396
- export declare const MenuDivider: <E extends ElementType = 'hr'>(
397
- props: MenuDividerProps<E>,
398
- ) => React.JSX.Element
399
-
400
- /**
401
- * @public
402
- */
403
- declare type MenuDividerProps<E extends ElementType = 'hr'> = Props<EmptyProps, E>
404
-
405
- /**
406
- * @public
407
- */
408
- export declare const MenuGroup: <E extends ElementType = 'button'>(
409
- props: MenuGroupProps<E>,
410
- ) => React.JSX.Element
411
-
412
- /**
413
- * @public
414
- */
415
- declare interface MenuGroupOwnProps {
416
- fontSize?: number | number[]
417
- icon?: React.ElementType | React.ReactNode
418
- menu?: Omit<
419
- MenuProps,
420
- | 'onClickOutside'
421
- | 'onEscape'
422
- | 'onItemClick'
423
- | 'onKeyDown'
424
- | 'onMouseEnter'
425
- | 'registerElement'
426
- | 'shouldFocus'
427
- | 'onBlurCapture'
428
- >
429
- padding?: number | number[]
430
- popover?: Omit<PopoverProps, 'content' | 'open'>
431
- radius?: Radius | Radius[]
432
- gap?: number | number[]
433
- /**
434
- * @deprecated Use `gap` instead. `space` will be removed in v4.
435
- */
436
- space?: number | number[]
437
- text: React.ReactNode
438
- tone?: SelectableTone
439
- }
440
-
441
- /**
442
- * @public
443
- */
444
- declare type MenuGroupProps<E extends ElementType = 'button'> = Props<MenuGroupOwnProps, E>
445
-
446
- /**
447
- * @public
448
- */
449
- export declare const MenuItem: <E extends ElementType = 'button'>(
450
- props: MenuItemProps<E>,
451
- ) => React.JSX.Element
452
-
453
- /**
454
- * @public
455
- */
456
- declare interface MenuItemOwnProps extends ResponsivePaddingProps, ResponsiveRadiusProps {
457
- fontSize?: number | number[]
458
- hotkeys?: string[]
459
- icon?: React.ElementType | React.ReactNode
460
- iconRight?: React.ElementType | React.ReactNode
461
- pressed?: boolean
462
- selected?: boolean
463
- gap?: number | number[]
464
- /**
465
- * @deprecated Use `gap` instead. `space` will be removed in v4.
466
- */
467
- space?: number | number[]
468
- text?: React.ReactNode
469
- tone?: SelectableTone
470
- }
471
-
472
- /**
473
- * @public
474
- */
475
- export declare type MenuItemProps<E extends ElementType = 'button'> = Props<MenuItemOwnProps, E>
476
-
477
- /**
478
- * @public
479
- */
480
- declare interface MenuProps extends ResponsivePaddingProps {
481
- /**
482
- * @deprecated Use `shouldFocus="first"` instead.
483
- */
484
- 'focusFirst'?: boolean
485
- /**
486
- * @deprecated Use `shouldFocus="last"` instead.
487
- */
488
- 'focusLast'?: boolean
489
- 'onClickOutside'?: (event: MouseEvent) => void
490
- 'onEscape'?: () => void
491
- 'onItemClick'?: () => void
492
- 'onItemSelect'?: (index: number) => void
493
- 'originElement'?: HTMLElement | null
494
- 'registerElement'?: (el: HTMLElement) => () => void
495
- 'shouldFocus'?: 'first' | 'last' | null
496
- 'gap'?: number | number[]
497
- /**
498
- * @deprecated Use `gap` instead. `space` will be removed in v4.
499
- */
500
- 'space'?: number | number[]
501
- 'aria-labelledby'?: string
502
- 'onBlurCapture'?: (event: FocusEvent) => void
503
- }
504
-
505
- /**
506
- * Placement of floating UI elements.
507
- *
508
- * @public
509
- */
510
- declare type Placement =
511
- | 'top'
512
- | 'top-start'
513
- | 'top-end'
514
- | 'right'
515
- | 'right-start'
516
- | 'right-end'
517
- | 'bottom'
518
- | 'bottom-start'
519
- | 'bottom-end'
520
- | 'left'
521
- | 'left-start'
522
- | 'left-end'
523
-
524
- /**
525
- * The `Popover` component is used to display some content on top of another.
526
- *
527
- * @public
528
- */
529
- export declare const Popover: ForwardRefExoticComponent<
530
- Omit<
531
- PopoverProps & Omit<HTMLProps<HTMLDivElement>, 'content' | 'width' | 'as' | 'children'>,
532
- 'ref'
533
- > &
534
- RefAttributes<HTMLDivElement>
535
- >
536
-
537
- /**
538
- * @beta
539
- */
540
- export declare type PopoverMargins = [number, number, number, number]
541
-
542
- /** @public */
543
- declare interface PopoverProps
544
- extends Omit<LayerProps, 'as'>,
545
- ResponsiveRadiusProps,
546
- ResponsiveShadowProps {
547
- /** @beta */
548
- __unstable_margins?: PopoverMargins
549
- /**
550
- * Whether the popover should animate in and out.
551
- *
552
- * @beta
553
- * @defaultValue false
554
- */
555
- animate?: boolean
556
- arrow?: boolean
557
- /** @deprecated Use `floatingBoundary` and/or `referenceBoundary` instead */
558
- boundaryElement?: HTMLElement | null
559
- children?: React.JSX.Element
560
- /**
561
- * When `true`, prevent overflow within the current boundary:
562
- * - by flipping on its side axis
563
- * - by resizing
564
- /*
565
- * Note that:
566
- * - setting `preventOverflow` to `true` also prevents overflow on its side axis
567
- * - setting `matchReferenceWidth` to `true` also causes the popover to resize
568
- *
569
- * @defaultValue false
570
- */
571
- constrainSize?: boolean
572
- content?: React.ReactNode
573
- disabled?: boolean
574
- fallbackPlacements?: Placement[]
575
- floatingBoundary?: HTMLElement | null
576
- /**
577
- * When `true`, set the maximum width to match the reference element, and also prevent overflow within
578
- * the current boundary by resizing.
579
- *
580
- * Note that setting `constrainSize` to `true` also causes the popover to resize
581
- *
582
- * @defaultValue false
583
- */
584
- matchReferenceWidth?: boolean
585
- /**
586
- * When true, blocks all pointer interaction with elements beneath the popover until closed.
587
- *
588
- * @beta
589
- * @defaultValue false
590
- */
591
- modal?: boolean
592
- open?: boolean
593
- overflow?: BoxOverflow
594
- padding?: number | number[]
595
- placement?: Placement
596
- /**
597
- * When 'flip' (default), the placement is determined from the initial placement and the
598
- * fallback placements in order. Whichever fits in the viewport first.
599
- *
600
- * When 'autoPlacement', the initial placement and all fallback placements are evaluated
601
- * and the placement with the most viewport space available.
602
- *
603
- * Option is only relevant if either `constrainSize` or `preventOverflow` is `true`
604
- */
605
- placementStrategy?: 'flip' | 'autoPlacement'
606
- /** Whether or not to render the popover in a portal element. */
607
- portal?: boolean | string
608
- preventOverflow?: boolean
609
- referenceBoundary?: HTMLElement | null
610
- /**
611
- * When defined, the popover will be positioned relative to this element.
612
- * The children of the popover won't be rendered.
613
- */
614
- referenceElement?: HTMLElement | null
615
- scheme?: ThemeColorSchemeKey
616
- tone?: CardTone
617
- /** @beta */
618
- updateRef?: Ref<PopoverUpdateCallback | undefined>
619
- width?: PopoverWidth | PopoverWidth[]
620
- }
621
-
622
- /** @beta */
623
- declare type PopoverUpdateCallback = () => void
624
-
625
- /** @public */
626
- declare type PopoverWidth = number | 'auto'
627
-
628
- /**
629
- * @public
630
- */
631
- export declare function Portal(props: PortalProps): React.ReactPortal | null
632
-
633
- export declare namespace Portal {
634
- var displayName: string
635
- }
636
-
637
- /**
638
- * @public
639
- */
640
- declare interface PortalProps {
641
- children: React.ReactNode
642
- /**
643
- * @beta This API might change. DO NOT USE IN PRODUCTION.
644
- */
645
- __unstable_name?: string
646
- }
647
-
648
- /**
649
- * @public
650
- */
651
- export declare function PortalProvider(props: PortalProviderProps): React.JSX.Element
652
-
653
- export declare namespace PortalProvider {
654
- var displayName: string
655
- }
656
-
657
- /**
658
- * @public
659
- */
660
- declare interface PortalProviderProps {
661
- /**
662
- * @deprecated Use `<BoundaryElementProvider element={...} />` instead
663
- */
664
- boundaryElement?: HTMLElement | null
665
- children: React.ReactNode
666
- element?: HTMLElement | null
667
- /**
668
- * @beta
669
- */
670
- __unstable_elements?: Record<string, HTMLElement | null | undefined>
671
- }
672
-
673
- /**
674
- * Resolves the props of a polymorphic component: the props of the element/component passed to `as`
675
- * (defaulting to the component's own element), with the component's own props assigned on top.
676
- *
677
- * @public
678
- */
679
- declare type Props<P extends EmptyProps, E extends ElementType<P>> = Assign<
680
- E extends TagType ? React.JSX.IntrinsicElements[E] : React.ComponentProps<E>,
681
- P & {
682
- as?: E
683
- }
684
- >
685
-
686
- /**
687
- * @public
688
- */
689
- declare type Radius = number | 'full'
690
-
691
- /**
692
- * @public
693
- */
694
- declare interface ResponsiveBorderProps {
695
- border?: boolean | boolean[]
696
- borderTop?: boolean | boolean[]
697
- borderRight?: boolean | boolean[]
698
- borderBottom?: boolean | boolean[]
699
- borderLeft?: boolean | boolean[]
700
- }
701
-
702
- /**
703
- * @public
704
- */
705
- declare interface ResponsiveBoxProps {
706
- display?: BoxDisplay | BoxDisplay[]
707
- height?: BoxHeight | BoxHeight[]
708
- overflow?: BoxOverflow | BoxOverflow[]
709
- sizing?: BoxSizing | BoxSizing[]
710
- }
711
-
712
- /**
713
- * @public
714
- */
715
- declare interface ResponsiveFlexItemProps {
716
- /** Sets the flex CSS attribute. The property is responsive. */
717
- flex?: FlexValue | FlexValue[]
718
- }
719
-
720
- /**
721
- * @public
722
- */
723
- declare interface ResponsiveFlexProps {
724
- align?: FlexAlign | FlexAlign[]
725
- direction?: FlexDirection | FlexDirection[]
726
- justify?: FlexJustify | FlexJustify[]
727
- wrap?: FlexWrap | FlexWrap[]
728
- }
729
-
730
- /**
731
- * @public
732
- */
733
- declare interface ResponsiveGridItemProps {
734
- gridColumn?: GridItemColumn | GridItemColumn[]
735
- /**
736
- * @deprecated Use `gridColumn` instead. `column` will be removed in v4.
737
- */
738
- column?: GridItemColumn | GridItemColumn[]
739
- gridColumnStart?: GridItemColumnStart | GridItemColumnStart[]
740
- /**
741
- * @deprecated Use `gridColumnStart` instead. `columnStart` will be removed in v4.
742
- */
743
- columnStart?: GridItemColumnStart | GridItemColumnStart[]
744
- gridColumnEnd?: GridItemColumnEnd | GridItemColumnEnd[]
745
- /**
746
- * @deprecated Use `gridColumnEnd` instead. `columnEnd` will be removed in v4.
747
- */
748
- columnEnd?: GridItemColumnEnd | GridItemColumnEnd[]
749
- gridRow?: GridItemRow | GridItemRow[]
750
- /**
751
- * @deprecated Use `gridRow` instead. `row` will be removed in v4.
752
- */
753
- row?: GridItemRow | GridItemRow[]
754
- gridRowStart?: GridItemRowStart | GridItemRowStart[]
755
- /**
756
- * @deprecated Use `gridRowStart` instead. `rowStart` will be removed in v4.
757
- */
758
- rowStart?: GridItemRowStart | GridItemRowStart[]
759
- gridRowEnd?: GridItemRowEnd | GridItemRowEnd[]
760
- /**
761
- * @deprecated Use `gridRowEnd` instead. `rowEnd` will be removed in v4.
762
- */
763
- rowEnd?: GridItemRowEnd | GridItemRowEnd[]
764
- }
765
-
766
- /**
767
- * @public
768
- */
769
- declare interface ResponsiveGridProps {
770
- autoRows?: GridAutoRows | GridAutoRows[]
771
- autoCols?: GridAutoCols | GridAutoCols[]
772
- autoFlow?: GridAutoFlow | GridAutoFlow[]
773
- /**
774
- * @deprecated Use `gridTemplateColumns` instead. `columns` will be removed in v4.
775
- */
776
- columns?: number | number[]
777
- gridTemplateColumns?: number | number[]
778
- gap?: number | number[]
779
- gapX?: number | number[]
780
- gapY?: number | number[]
781
- /**
782
- * @deprecated Use `gridTemplateRows` instead. `rows` will be removed in v4.
783
- */
784
- rows?: number | number[]
785
- gridTemplateRows?: number | number[]
786
- }
787
-
788
- /**
789
- * @public
790
- */
791
- declare interface ResponsiveMarginProps {
792
- /** Applies margins to all sides. The property is responsive. */
793
- margin?: number | number[]
794
- /** Applies margins to the left and right sides. The property is responsive. */
795
- marginX?: number | number[]
796
- /** Applies margins to the top and bottom sides. The property is responsive. */
797
- marginY?: number | number[]
798
- marginTop?: number | number[]
799
- marginRight?: number | number[]
800
- marginBottom?: number | number[]
801
- marginLeft?: number | number[]
802
- }
803
-
804
- /**
805
- * @public
806
- */
807
- declare interface ResponsivePaddingProps {
808
- padding?: number | number[]
809
- paddingX?: number | number[]
810
- paddingY?: number | number[]
811
- paddingTop?: number | number[]
812
- paddingRight?: number | number[]
813
- paddingBottom?: number | number[]
814
- paddingLeft?: number | number[]
815
- }
816
-
817
- /**
818
- * @public
819
- */
820
- declare interface ResponsiveRadiusProps {
821
- radius?: Radius | Radius[]
822
- }
823
-
824
- /**
825
- * @public
826
- */
827
- declare interface ResponsiveShadowProps {
828
- shadow?: number | number[]
829
- }
830
-
831
- /**
832
- * @public
833
- */
834
- declare type SelectableTone = ThemeColorStateToneKey
835
-
836
- /**
837
- * Indicate that something is loading for an indeterminate amount of time.
838
- *
839
- * @public
840
- */
841
- export declare const Spinner: ForwardRefExoticComponent<
842
- Omit<SpinnerProps & Omit<HTMLProps<HTMLDivElement>, 'size' | 'as'>, 'ref'> &
843
- RefAttributes<HTMLDivElement>
844
- >
845
-
846
- /**
847
- * @public
848
- */
849
- declare interface SpinnerProps {
850
- muted?: boolean
851
- size?: number | number[]
852
- }
853
-
854
- /**
855
- * The `Stack` component is used to place elements on top of each other.
856
- *
857
- * @public
858
- */
859
- export declare const Stack: <E extends ElementType = 'div'>(
860
- props: StackProps<E>,
861
- ) => React.JSX.Element
862
-
863
- /**
864
- * @public
865
- */
866
- declare interface StackOwnProps extends BoxOwnProps {
867
- gap?: number | number[]
868
- /**
869
- * @deprecated Use `gap` instead. `space` will be removed in v4.
870
- */
871
- space?: number | number[]
872
- }
873
-
874
- /**
875
- * @public
876
- */
877
- declare type StackProps<E extends ElementType = 'div'> = Props<StackOwnProps, E>
878
-
879
- /**
880
- * @public
881
- * @deprecated Use `buildTheme` from `@sanity/ui/theme` instead.
882
- */
883
- export declare const studioTheme: BaseTheme
884
-
885
- /**
886
- * @public
887
- */
888
- export declare const Tab: ForwardRefExoticComponent<
889
- Omit<
890
- TabProps &
891
- Omit<
892
- HTMLProps<HTMLButtonElement>,
893
- 'width' | 'label' | 'id' | 'type' | 'as' | 'aria-controls'
894
- >,
895
- 'ref'
896
- > &
897
- RefAttributes<HTMLButtonElement>
898
- >
899
-
900
- /**
901
- * @public
902
- */
903
- export declare const TabList: ForwardRefExoticComponent<
904
- Omit<TabListProps & Omit<HTMLProps<HTMLDivElement>, 'height' | 'as'>, 'ref'> &
905
- RefAttributes<unknown>
906
- >
907
-
908
- /**
909
- * @public
910
- */
911
- declare interface TabListProps extends Omit<InlineOwnProps, 'height'> {
912
- children: Array<React.JSX.Element | null | undefined | false>
913
- }
914
-
915
- /**
916
- * @public
917
- */
918
- declare interface TabProps {
919
- /**
920
- * The `id` of the correlating `TabPanel` component.
921
- */
922
- 'aria-controls': string
923
- 'id': string
924
- 'icon'?: React.ElementType | React.ReactNode
925
- 'focused'?: boolean
926
- 'fontSize'?: number | number[]
927
- 'label'?: React.ReactNode
928
- 'padding'?: number | number[]
929
- 'selected'?: boolean
930
- 'tone'?: ButtonTone
931
- }
932
-
933
- /** @public */
934
- declare type TagType = keyof React.JSX.IntrinsicElements
935
-
936
- /**
937
- * The `Text` component is an agile, themed typographic element.
938
- *
939
- * @public
940
- */
941
- declare const Text_2: <E extends ElementType = 'div'>(props: TextProps<E>) => React.JSX.Element
942
- export {Text_2 as Text}
943
-
944
- /**
945
- * @public
946
- */
947
- declare type TextAlign = 'left' | 'right' | 'center' | 'justify' | 'initial'
948
-
949
- /**
950
- * Single line text input.
951
- *
952
- * @public
953
- */
954
- export declare const TextInput: ForwardRefExoticComponent<
955
- Omit<TextInputProps & Omit<HTMLProps<HTMLInputElement>, 'type' | 'as' | 'prefix'>, 'ref'> &
956
- RefAttributes<HTMLInputElement>
957
- >
958
-
959
- /**
960
- * @public
961
- */
962
- declare type TextInputClearButtonProps = ButtonOwnProps &
963
- Omit<React.HTMLProps<HTMLButtonElement>, 'as' | 'onClick' | 'onMouseDown' | 'ref'>
964
-
965
- /**
966
- * @public
967
- */
968
- declare interface TextInputProps {
969
- /**
970
- * @beta
971
- */
972
- __unstable_disableFocusRing?: boolean
973
- border?: boolean
974
- /**
975
- * @beta
976
- */
977
- clearButton?: boolean | TextInputClearButtonProps
978
- customValidity?: string
979
- fontSize?: number | number[]
980
- icon?: React.ElementType | React.ReactNode
981
- iconRight?: React.ElementType | React.ReactNode
982
- /**
983
- * @beta
984
- */
985
- onClear?: () => void
986
- padding?: number | number[]
987
- prefix?: React.ReactNode
988
- radius?: Radius | Radius[]
989
- /**
990
- * @deprecated Use `gap` instead. `space` will be removed in v4.
991
- */
992
- space?: number | number[]
993
- gap?: number | number[]
994
- suffix?: React.ReactNode
995
- type?: TextInputType
996
- weight?: ThemeFontWeightKey
997
- }
998
-
999
- /**
1000
- * @public
1001
- */
1002
- declare type TextInputType =
1003
- | 'search'
1004
- | 'date'
1005
- | 'datetime-local'
1006
- | 'email'
1007
- | 'url'
1008
- | 'month'
1009
- | 'number'
1010
- | 'password'
1011
- | 'tel'
1012
- | 'time'
1013
- | 'text'
1014
- | 'week'
1015
- | 'color'
1016
-
1017
- /**
1018
- * @public
1019
- */
1020
- declare interface TextOwnProps {
1021
- accent?: boolean
1022
- align?: TextAlign | TextAlign[]
1023
- /** When `true` the text color will be muted. */
1024
- muted?: boolean
1025
- size?: number | number[]
1026
- /**
1027
- * Controls how overflowing text is treated.
1028
- * Use `textOverflow="ellipsis"` to render text as a single line which is concatenated with a `…` symbol.
1029
- * @beta
1030
- */
1031
- textOverflow?: 'ellipsis'
1032
- weight?: ThemeFontWeightKey
1033
- }
1034
-
1035
- /**
1036
- * @public
1037
- */
1038
- declare type TextProps<E extends ElementType = 'div'> = Props<TextOwnProps, E>
1039
-
1040
- /**
1041
- * @public
1042
- */
1043
- export declare function ThemeProvider(props: ThemeProviderProps): React.JSX.Element
1044
-
1045
- export declare namespace ThemeProvider {
1046
- var displayName: string
1047
- }
1048
-
1049
- /**
1050
- * @public
1051
- */
1052
- declare interface ThemeProviderProps {
1053
- children?: React.ReactNode
1054
- scheme?: ThemeColorSchemeKey
1055
- theme?: RootTheme
1056
- tone?: ThemeColorCardToneKey
1057
- }
1058
-
1059
- /**
1060
- * Tooltips display information when hovering, focusing or tapping.
1061
- *
1062
- * @public
1063
- */
1064
- export declare const Tooltip: ForwardRefExoticComponent<
1065
- Omit<TooltipProps & Omit<HTMLProps<HTMLDivElement>, 'content' | 'as' | 'children'>, 'ref'> &
1066
- RefAttributes<HTMLDivElement>
1067
- >
1068
-
1069
- /**
1070
- * @public
1071
- */
1072
- declare interface TooltipProps extends Omit<LayerProps, 'as'> {
1073
- /** @deprecated Use `fallbackPlacements` instead. */
1074
- allowedAutoPlacements?: Placement[]
1075
- arrow?: boolean
1076
- boundaryElement?: HTMLElement | null
1077
- children?: React.JSX.Element
1078
- content?: React.ReactNode
1079
- disabled?: boolean
1080
- fallbackPlacements?: Placement[]
1081
- padding?: number | number[]
1082
- placement?: Placement
1083
- /** Whether or not to render the tooltip in a portal element. */
1084
- portal?: boolean | string
1085
- radius?: number | number[]
1086
- scheme?: ThemeColorSchemeKey
1087
- shadow?: number | number[]
1088
- /**
1089
- * Adds a delay to open or close the tooltip.
1090
- *
1091
- * If only a `number` is passed, it will be used for both opening and closing.
1092
- *
1093
- * If an object `{open: number; close:number}` is passed, it can be used to set different delays for each action.
1094
- *
1095
- * @public
1096
- * @defaultValue 0
1097
- */
1098
- delay?: Delay
1099
- /**
1100
- * Whether the tooltip should animate in and out.
1101
- *
1102
- * @beta
1103
- * @defaultValue false
1104
- */
1105
- animate?: boolean
1106
- }
1107
-
1108
- /**
1109
- * Returns true if a dark color scheme is preferred, false if a light color scheme is preferred or the preference is not known.
1110
- *
1111
- * @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)
1112
- *
1113
- * If you persist the detected preference in a cookie or a header then you may implement your own server snapshot to read it.
1114
- * 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
1115
- * @example https://gist.github.com/stipsan/13c0cccf8dfc34f4b44bb1b984baf7df
1116
- *
1117
- * @public
1118
- */
1119
- export declare function usePrefersDark(getServerSnapshot?: () => boolean): boolean
1120
-
1121
- /**
1122
- * @public
1123
- */
1124
- export declare function useTheme_v2(): Theme_v2
1125
-
1126
- export {}
1
+ import { B as Stack, Dt as Flex, En as PopoverMargins, Ir as studioTheme, L as Text, Rt as Card, U as Spinner, Vt as Button, a as usePrefersDark, an as MenuDivider, b as MenuItemProps, c as isHTMLAnchorElement, et as PortalProvider, g as Tab, it as LayerProvider, j as TextInput, k as Tooltip, m as TabList, n as useTheme_v2, nt as Portal, q as Popover, qt as Box, r as ThemeProvider, sn as Menu, u as isHTMLElement, v as MenuItem, wt as Grid, x as MenuGroup, xn as Hotkeys } from "./useTheme.js";
2
+ export { Box, Button, Card, Flex, Grid, Hotkeys, LayerProvider, Menu, MenuDivider, MenuGroup, MenuItem, type MenuItemProps, Popover, type PopoverMargins, Portal, PortalProvider, Spinner, Stack, Tab, TabList, Text, TextInput, ThemeProvider, Tooltip, isHTMLAnchorElement, isHTMLElement, studioTheme, usePrefersDark, useTheme_v2 };