@sanity/ui 3.0.0-static.10 → 3.0.0-static.12

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 (275) hide show
  1. package/dist/_chunks-cjs/_visual-editing.js +1300 -1269
  2. package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
  3. package/dist/_chunks-cjs/buildCommand.js +28 -10
  4. package/dist/_chunks-cjs/buildCommand.js.map +1 -1
  5. package/dist/_chunks-es/_visual-editing.mjs +1298 -1263
  6. package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
  7. package/dist/_visual-editing.d.mts +516 -360
  8. package/dist/_visual-editing.d.ts +516 -360
  9. package/dist/cli.js +1 -1
  10. package/dist/css.d.mts +258 -75
  11. package/dist/css.d.ts +258 -75
  12. package/dist/css.js +746 -752
  13. package/dist/css.js.map +1 -1
  14. package/dist/css.mjs +748 -754
  15. package/dist/css.mjs.map +1 -1
  16. package/dist/index.d.mts +1342 -871
  17. package/dist/index.d.ts +1342 -871
  18. package/dist/index.js +433 -325
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.mjs +429 -321
  21. package/dist/index.mjs.map +1 -1
  22. package/dist/sanity-palette.css +105 -1
  23. package/dist/sanity-palette.min.css +1 -0
  24. package/dist/sanity-theme.css +4571 -1
  25. package/dist/sanity-theme.min.css +1 -0
  26. package/dist/system.css +22053 -21710
  27. package/dist/system.min.css +1 -0
  28. package/dist/theme.d.mts +51 -106
  29. package/dist/theme.d.ts +51 -106
  30. package/dist/theme.js +19 -20
  31. package/dist/theme.js.map +1 -1
  32. package/dist/theme.mjs +19 -20
  33. package/dist/theme.mjs.map +1 -1
  34. package/package.json +10 -5
  35. package/src/cli/buildCommand.ts +46 -19
  36. package/src/css/_comp.ts +2 -2
  37. package/src/css/{compile/compileStyle.ts → _compileStyle.ts} +7 -7
  38. package/src/css/_resp.ts +0 -1
  39. package/src/css/{system.style.ts → _system.style.ts} +3 -2
  40. package/src/css/aspects/display/display.ts +1 -0
  41. package/src/css/aspects/display/types.ts +2 -3
  42. package/src/css/aspects/flex/types.ts +4 -12
  43. package/src/css/aspects/flexItem/types.ts +1 -3
  44. package/src/css/aspects/font/font.style.ts +7 -66
  45. package/src/css/aspects/font/types.ts +1 -3
  46. package/src/css/aspects/grid/grid.ts +1 -0
  47. package/src/css/aspects/grid/types.ts +5 -9
  48. package/src/css/aspects/gridItem/gridItem.ts +1 -1
  49. package/src/css/aspects/gridItem/types.ts +7 -18
  50. package/src/css/aspects/height/height.ts +3 -4
  51. package/src/css/aspects/inset/inset.ts +1 -0
  52. package/src/css/aspects/margin/margin.ts +1 -0
  53. package/src/css/aspects/margin/types.ts +1 -0
  54. package/src/css/aspects/maxWidth/maxWidth.ts +1 -0
  55. package/src/css/aspects/maxWidth/types.ts +1 -0
  56. package/src/css/aspects/minWidth/minWidth.ts +1 -0
  57. package/src/css/aspects/minWidth/types.ts +2 -0
  58. package/src/css/aspects/overflow/overflow.ts +1 -0
  59. package/src/css/aspects/padding/padding.ts +1 -0
  60. package/src/css/aspects/pointerEvents/pointerEvents.ts +1 -0
  61. package/src/css/aspects/position/position.ts +1 -0
  62. package/src/css/aspects/shadow/shadow.style.ts +16 -41
  63. package/src/css/aspects/shadow/shadow.ts +1 -0
  64. package/src/css/aspects/textOverflow/textOverflow.ts +1 -0
  65. package/src/css/aspects/textOverflow/types.ts +1 -0
  66. package/src/css/aspects/width/types.ts +2 -0
  67. package/src/css/aspects/width/width.ts +1 -0
  68. package/src/css/compilePalette.ts +32 -0
  69. package/src/css/compileSystem.ts +7 -0
  70. package/src/css/{compile/compileTheme.ts → compileTheme.ts} +1 -0
  71. package/src/css/compileTheme_v3.ts +434 -0
  72. package/src/css/components/breadcrumbs/breadcrumbs.ts +1 -0
  73. package/src/css/components/dialog/dialog.ts +7 -0
  74. package/src/css/components/menu/menu.ts +2 -0
  75. package/src/css/components/skeleton/skeleton.style.ts +8 -4
  76. package/src/css/components/skeleton/skeleton.ts +4 -0
  77. package/src/css/components/skeleton/types.ts +4 -0
  78. package/src/css/components/toast/toast.ts +5 -0
  79. package/src/css/components/tree/tree.ts +1 -0
  80. package/src/css/composeClassNames.ts +4 -2
  81. package/src/css/constants.ts +11 -0
  82. package/src/css/index.ts +4 -3
  83. package/src/css/primitives/_arrow/_arrow.style.ts +6 -8
  84. package/src/css/primitives/_arrow/_arrow.ts +7 -0
  85. package/src/css/primitives/_input/input.ts +2 -0
  86. package/src/css/primitives/_selectable/_selectable.style.ts +24 -25
  87. package/src/css/primitives/_selectable/selectable.ts +1 -2
  88. package/src/css/primitives/avatar/avatar.style.ts +5 -8
  89. package/src/css/primitives/avatar/avatar.ts +6 -0
  90. package/src/css/primitives/avatar/types.ts +1 -0
  91. package/src/css/primitives/box/types.ts +1 -3
  92. package/src/css/primitives/button/button.style.ts +48 -15
  93. package/src/css/primitives/button/button.ts +4 -21
  94. package/src/css/primitives/button/index.ts +1 -0
  95. package/src/css/primitives/button/types.ts +18 -0
  96. package/src/css/primitives/card/card.style.ts +4 -7
  97. package/src/css/primitives/card/card.ts +2 -2
  98. package/src/css/primitives/card/types.ts +2 -2
  99. package/src/css/primitives/checkbox/checkbox.ts +2 -0
  100. package/src/css/primitives/container/container.ts +1 -0
  101. package/src/css/primitives/container/types.ts +1 -0
  102. package/src/css/primitives/kbd/kbd.ts +1 -0
  103. package/src/css/primitives/label/types.ts +7 -2
  104. package/src/css/primitives/popover/popover.ts +2 -0
  105. package/src/css/primitives/radio/radio.ts +1 -0
  106. package/src/css/primitives/select/select.ts +2 -0
  107. package/src/css/primitives/spinner/spinner.ts +2 -0
  108. package/src/css/primitives/switch/switch.ts +5 -0
  109. package/src/css/primitives/text/types.ts +4 -0
  110. package/src/css/primitives/textArea/textArea.ts +1 -0
  111. package/src/css/primitives/textInput/textInput.ts +1 -0
  112. package/src/css/primitives/token/token.style.ts +37 -36
  113. package/src/css/primitives/tooltip/tooltip.ts +2 -0
  114. package/src/css/responsiveRules.ts +12 -19
  115. package/src/css/scopeClassName.ts +1 -0
  116. package/src/css/types.ts +115 -15
  117. package/src/css/util.ts +5 -0
  118. package/src/css/utils/srOnly/srOnly.ts +1 -0
  119. package/src/css/varNames.ts +230 -143
  120. package/src/css/vars.ts +53 -22
  121. package/src/theme/palette/constants.ts +2 -0
  122. package/src/theme/palette/types.ts +3 -0
  123. package/src/theme/types.ts +2 -6
  124. package/src/theme/v0/focusRing.ts +1 -3
  125. package/src/theme/v0/font.ts +6 -18
  126. package/src/theme/v0/layer.ts +1 -3
  127. package/src/theme/v0/shadow.ts +2 -6
  128. package/src/theme/v2/avatar.ts +1 -3
  129. package/src/theme/v2/color/_system.ts +1 -3
  130. package/src/theme/v2/color/avatar.ts +2 -6
  131. package/src/theme/v2/color/badge.ts +2 -6
  132. package/src/theme/v2/color/button.ts +3 -9
  133. package/src/theme/v2/color/color.ts +3 -9
  134. package/src/theme/v2/color/input.ts +3 -9
  135. package/src/theme/v2/color/kbd.ts +1 -3
  136. package/src/theme/v2/color/selectable.ts +2 -6
  137. package/src/theme/v2/color/state.ts +1 -3
  138. package/src/theme/v2/color/syntax.ts +1 -3
  139. package/src/theme/v2/input.ts +1 -3
  140. package/src/theme/v2/theme.ts +2 -6
  141. package/src/theme/v3/buildTheme_v3.ts +2 -1
  142. package/src/theme/v3/color/color.ts +6 -4
  143. package/src/theme/v3/color/renderColor.ts +4 -1
  144. package/src/theme/v3/{defaults.ts → defaultTokens.ts} +2 -2
  145. package/src/theme/v3/index.ts +1 -1
  146. package/src/theme/v3/resolveTokens.ts +18 -18
  147. package/src/ui/RootClassNames.tsx +44 -0
  148. package/src/ui/StyleTags.tsx +3 -1
  149. package/src/ui/_compat/helpers.ts +72 -0
  150. package/src/ui/_compat/index.ts +2 -6
  151. package/src/ui/_compat/studioTheme.ts +7 -0
  152. package/src/ui/_compat/theme/themeColorProvider.tsx +2 -6
  153. package/src/ui/_compat/theme/themeProvider.tsx +2 -6
  154. package/src/ui/_compat/theme/types.ts +1 -3
  155. package/src/ui/_compat/theme/useRootTheme.ts +1 -3
  156. package/src/ui/_compat/theme/useTheme.ts +2 -6
  157. package/src/ui/_compat/types.ts +0 -83
  158. package/src/ui/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -2
  159. package/src/ui/components/autocomplete/autocomplete.tsx +86 -114
  160. package/src/ui/components/autocomplete/autocompleteOption.tsx +2 -0
  161. package/src/ui/components/autocomplete/types.ts +3 -8
  162. package/src/ui/components/breadcrumbs/breadcrumbs.tsx +27 -21
  163. package/src/ui/components/dialog/dialog.tsx +89 -291
  164. package/src/ui/components/dialog/dialogCard.tsx +183 -0
  165. package/src/ui/components/dialog/isTargetWithinScope.ts +14 -0
  166. package/src/ui/components/hotkeys/hotkeys.tsx +33 -15
  167. package/src/ui/components/menu/__workshop__/asComponent.tsx +6 -6
  168. package/src/ui/components/menu/menu.tsx +27 -33
  169. package/src/ui/components/menu/menuButton.tsx +10 -14
  170. package/src/ui/components/menu/menuDivider.tsx +25 -13
  171. package/src/ui/components/menu/menuGroup.tsx +34 -26
  172. package/src/ui/components/menu/menuItem.tsx +51 -40
  173. package/src/ui/components/skeleton/codeSkeleton.tsx +53 -0
  174. package/src/ui/components/skeleton/headingSkeleton.tsx +52 -0
  175. package/src/ui/components/skeleton/index.ts +3 -0
  176. package/src/ui/components/skeleton/labelSkeleton.tsx +51 -0
  177. package/src/ui/components/skeleton/skeleton.tsx +39 -16
  178. package/src/ui/components/skeleton/textSkeleton.tsx +31 -110
  179. package/src/ui/components/tab/tab.tsx +23 -19
  180. package/src/ui/components/tab/tabList.tsx +34 -33
  181. package/src/ui/components/tab/tabPanel.tsx +25 -19
  182. package/src/ui/components/toast/toast.tsx +21 -16
  183. package/src/ui/components/toast/toastLayer.tsx +28 -10
  184. package/src/ui/components/toast/toastProvider.tsx +2 -6
  185. package/src/ui/components/toast/types.ts +2 -6
  186. package/src/ui/components/toast/useToast.ts +1 -3
  187. package/src/ui/components/tree/tree.tsx +194 -187
  188. package/src/ui/components/tree/treeGroup.tsx +25 -5
  189. package/src/ui/components/tree/treeItem.tsx +35 -23
  190. package/src/ui/hooks/useClickOutside.ts +2 -6
  191. package/src/ui/hooks/useClickOutsideEvent.ts +3 -9
  192. package/src/ui/index.ts +1 -0
  193. package/src/ui/primitives/_selectable/selectable.tsx +33 -20
  194. package/src/ui/primitives/avatar/avatar.tsx +28 -31
  195. package/src/ui/primitives/avatar/avatarCounter.tsx +33 -25
  196. package/src/ui/primitives/avatar/avatarStack.tsx +31 -24
  197. package/src/ui/primitives/avatar/types.ts +2 -0
  198. package/src/ui/primitives/badge/__workshop__/props.tsx +1 -9
  199. package/src/ui/primitives/badge/__workshop__/tones.tsx +1 -6
  200. package/src/ui/primitives/badge/badge.tsx +33 -32
  201. package/src/ui/primitives/badge/types.ts +2 -1
  202. package/src/ui/primitives/box/box.tsx +59 -29
  203. package/src/ui/primitives/button/__workshop__/sanityUploadButton.tsx +3 -3
  204. package/src/ui/primitives/button/__workshop__/uploadButton.tsx +2 -1
  205. package/src/ui/primitives/button/button.test.tsx +1 -15
  206. package/src/ui/primitives/button/button.tsx +63 -70
  207. package/src/ui/primitives/card/__workshop__/asComponent.tsx +3 -3
  208. package/src/ui/primitives/card/card.tsx +22 -22
  209. package/src/ui/primitives/card/cardProvider.tsx +2 -0
  210. package/src/ui/primitives/checkbox/checkbox.tsx +26 -15
  211. package/src/ui/primitives/code/code.tsx +24 -22
  212. package/src/ui/primitives/container/container.tsx +26 -15
  213. package/src/ui/primitives/flex/flex.tsx +21 -19
  214. package/src/ui/primitives/grid/grid.tsx +21 -16
  215. package/src/ui/primitives/heading/heading.tsx +42 -19
  216. package/src/ui/primitives/inline/inline.tsx +26 -23
  217. package/src/ui/primitives/kbd/kbd.tsx +25 -23
  218. package/src/ui/primitives/label/label.tsx +29 -26
  219. package/src/ui/primitives/popover/popover.tsx +293 -271
  220. package/src/ui/primitives/popover/popoverCard.tsx +122 -120
  221. package/src/ui/primitives/radio/radio.tsx +30 -14
  222. package/src/ui/primitives/select/select.tsx +24 -16
  223. package/src/ui/primitives/spinner/animatedSpinnerIcon.tsx +4 -2
  224. package/src/ui/primitives/spinner/spinner.tsx +24 -12
  225. package/src/ui/primitives/stack/stack.tsx +27 -18
  226. package/src/ui/primitives/switch/switch.tsx +31 -14
  227. package/src/ui/primitives/text/text.tsx +30 -24
  228. package/src/ui/primitives/textArea/textArea.tsx +33 -18
  229. package/src/ui/primitives/textInput/textInput.tsx +28 -40
  230. package/src/ui/primitives/tooltip/constants.ts +1 -1
  231. package/src/ui/primitives/tooltip/tooltip.tsx +85 -61
  232. package/src/ui/primitives/tooltip/tooltipCard.tsx +89 -82
  233. package/src/ui/primitives/types.ts +1 -3
  234. package/src/ui/types/avatar.ts +3 -6
  235. package/src/ui/types/badge.ts +1 -3
  236. package/src/ui/types/button.ts +1 -3
  237. package/src/ui/types/card.ts +1 -3
  238. package/src/ui/types/dialog.ts +1 -3
  239. package/src/ui/types/props.ts +20 -10
  240. package/src/ui/utils/arrow/arrow.tsx +43 -25
  241. package/src/ui/utils/boundaryElement/boundaryElementProvider.tsx +2 -6
  242. package/src/ui/utils/boundaryElement/types.ts +1 -3
  243. package/src/ui/utils/boundaryElement/useBoundaryElement.ts +1 -3
  244. package/src/ui/utils/elementQuery/elementQuery.tsx +43 -19
  245. package/src/ui/utils/errorBoundary.tsx +2 -0
  246. package/src/ui/utils/index.ts +0 -1
  247. package/src/ui/utils/layer/layer.tsx +23 -93
  248. package/src/ui/utils/layer/layerCard.tsx +92 -0
  249. package/src/ui/utils/layer/layerProvider.tsx +2 -6
  250. package/src/ui/utils/layer/useLayer.ts +1 -3
  251. package/src/ui/utils/portal/portal.ts +2 -6
  252. package/src/ui/utils/portal/portalProvider.tsx +2 -6
  253. package/src/ui/utils/portal/types.ts +1 -3
  254. package/src/ui/utils/portal/usePortal.ts +1 -3
  255. package/src/ui/utils/srOnly/srOnly.tsx +25 -20
  256. package/src/ui/utils/virtualList/virtualList.tsx +69 -50
  257. package/src/css/compile/compilePalette.ts +0 -27
  258. package/src/css/compile/compileRule.ts +0 -97
  259. package/src/css/compile/compileRules.test.ts +0 -36
  260. package/src/css/compile/compileRules.ts +0 -43
  261. package/src/css/compile/compileSystem.ts +0 -10
  262. package/src/css/compile/compileTheme_v3.ts +0 -401
  263. package/src/css/compile/types.ts +0 -6
  264. package/src/css/components/breadcrumbs/rules.ts +0 -25
  265. package/src/css/components/dialog/rules.ts +0 -78
  266. package/src/css/components/skeleton/rules.ts +0 -113
  267. package/src/css/components/toast/rules.ts +0 -18
  268. package/src/css/components/tree/rules.ts +0 -168
  269. package/src/css/primitives/_selectable/_contants.ts +0 -11
  270. package/src/css/primitives/card/_constants.ts +0 -13
  271. package/src/css/primitives/popover/rules.ts +0 -5
  272. package/src/css/primitives/spinner/rules.ts +0 -21
  273. package/src/css/primitives/token/rules.ts +0 -45
  274. package/src/ui/utils/conditionalWrapper/conditionalWrapper.tsx +0 -23
  275. package/src/ui/utils/conditionalWrapper/index.ts +0 -1
package/dist/index.mjs CHANGED
@@ -1,13 +1,14 @@
1
- import { isHTMLElement, isHTMLAnchorElement, isHTMLInputElement, isHTMLButtonElement, isHTMLSelectElement, isHTMLTextAreaElement, EMPTY_ARRAY, useElementSize, Code, _isEnterToClickElement, Card, Text, useArrayProp, EMPTY_RECORD, Box, Button, Stack, Popover, TextInput, AnimatedSpinnerIcon, useClickOutsideEvent, Flex, createGlobalScopedContext, usePortal, useBoundaryElement, useLayer, useGlobalKeyDown, Container, usePrefersReducedMotion, Z_OFFSETS, Portal, Layer, containsOrEqualsElement, Grid, LayerProvider, isRecord, Selectable } from "./_chunks-es/_visual-editing.mjs";
2
- import { Arrow, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, CardProvider, Checkbox, ConditionalWrapper, ElementQuery, Heading, Hotkeys, Inline, KBD, Label, Menu, MenuDivider, MenuGroup, MenuItem, PortalProvider, Radio, Select, Spinner, SrOnly, Switch, Tab, TabList, TextArea, ThemeColorProvider, ThemeProvider, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupProvider, VirtualList, _ResizeObserver, _elementSizeObserver, _getArrayProp, _isScrollable, createColorTheme, hexToRgb, hslToRgb, multiply, parseColor, rgbToHex, rgbToHsl, rgba, screen, studioTheme, useCard, useCustomValidity, useMatchMedia, useMediaIndex, usePrefersDark, useRootTheme, useTheme, useTheme_v2, useTooltipDelayGroup } from "./_chunks-es/_visual-editing.mjs";
3
- import { composeClassNames, breadcrumbs, dialogContainer, dialogCardRoot, dialogLayout, dialogHeader, dialogContent, dialogFooter, dialog, skeleton, textSkeleton, labelSkeleton, headingSkeleton, codeSkeleton, toast, toastLoadingBar, toastLoadingBarMask, toastLoadingBarProgress, toastLayer, treeItem, compilePalette, compileTheme, compileSystem } from "@sanity/ui/css";
4
- import { px, rem } from "@sanity/ui/css";
1
+ import { createColorTheme as createColorTheme$1, hexToRgb as hexToRgb$1, hslToRgb as hslToRgb$1, multiply as multiply$1, parseColor as parseColor$1, rgbToHex as rgbToHex$1, rgbToHsl as rgbToHsl$1, rgba as rgba$1, screen as screen$1, buildTheme_v3 } from "@sanity/ui/theme";
2
+ import { isHTMLAnchorElement, isHTMLInputElement, isHTMLButtonElement, isHTMLSelectElement, isHTMLTextAreaElement, isHTMLElement, EMPTY_ARRAY, useElementSize, Code, _isEnterToClickElement, Card, Text, useArrayProp, EMPTY_RECORD, Box, Button, Stack, Popover, TextInput, AnimatedSpinnerIcon, useClickOutsideEvent, Flex, containsOrEqualsElement, usePortal, useBoundaryElement, useLayer, useGlobalKeyDown, createGlobalScopedContext, usePrefersReducedMotion, Portal, Z_OFFSETS, Container, Layer, Grid, LayerProvider, isRecord, Selectable, useCard } from "./_chunks-es/_visual-editing.mjs";
3
+ import { Arrow, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, CardProvider, Checkbox, DEFAULT_ARROW_ELEMENT, DEFAULT_AVATAR_COUNTER_ELEMENT, DEFAULT_AVATAR_ELEMENT, DEFAULT_AVATAR_STACK_ELEMENT, DEFAULT_BADGE_ELEMENT, DEFAULT_BOX_ELEMENT, DEFAULT_BUTTON_ELEMENT, DEFAULT_CARD_ELEMENT, DEFAULT_CHECKBOX_ELEMENT, DEFAULT_CODE_ELEMENT, DEFAULT_CONTAINER_ELEMENT, DEFAULT_ELEMENT_QUERY_ELEMENT, DEFAULT_FLEX_ELEMENT, DEFAULT_GRID_ELEMENT, DEFAULT_HEADING_ELEMENT, DEFAULT_HOTKEYS_ELEMENT, DEFAULT_INLINE_ELEMENT, DEFAULT_KBD_ELEMENT, DEFAULT_LABEL_ELEMENT, DEFAULT_LAYER_ELEMENT, DEFAULT_MENU_DIVIDER_ELEMENT, DEFAULT_MENU_ELEMENT, DEFAULT_MENU_GROUP_ELEMENT, DEFAULT_MENU_ITEM_ELEMENT, DEFAULT_POPOVER_ELEMENT, DEFAULT_RADIO_ELEMENT, DEFAULT_SELECT_ELEMENT, DEFAULT_SPINNER_ELEMENT, DEFAULT_SR_ONLY_ELEMENT, DEFAULT_STACK_ELEMENT, DEFAULT_SWITCH_ELEMENT, DEFAULT_TAB_ELEMENT, DEFAULT_TAB_LIST_ELEMENT, DEFAULT_TEXT_AREA_ELEMENT, DEFAULT_TEXT_ELEMENT, DEFAULT_TEXT_INPUT_ELEMENT, DEFAULT_TOOLTIP_ELEMENT, DEFAULT_VIRTUAL_LIST_ELEMENT, ElementQuery, Heading, Hotkeys, Inline, KBD, Label, Menu, MenuDivider, MenuGroup, MenuItem, PortalProvider, Radio, Select, Spinner, SrOnly, Switch, Tab, TabList, TextArea, ThemeColorProvider, ThemeProvider, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupProvider, VirtualList, _ResizeObserver, _elementSizeObserver, _getArrayProp, _isScrollable, studioTheme, useCustomValidity, useMatchMedia, useMediaIndex, usePrefersDark, useRootTheme, useTheme, useTheme_v2, useTooltipDelayGroup } from "./_chunks-es/_visual-editing.mjs";
5
4
  import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
6
5
  import { ChevronDownIcon, CloseIcon, ToggleArrowRightIcon } from "@sanity/icons";
7
- import { useState, useRef, useEffect, useImperativeHandle, Component, forwardRef, useReducer, useCallback, useMemo, cloneElement, Children, isValidElement, Fragment, useContext, useSyncExternalStore, startTransition, memo, useId } from "react";
6
+ import { useState, useRef, useEffect, useImperativeHandle, Component, useReducer, useCallback, useMemo, cloneElement, Children, isValidElement, Fragment, useContext, useSyncExternalStore, startTransition, memo, useId } from "react";
8
7
  import { c } from "react-compiler-runtime";
8
+ import { composeClassNames, breadcrumbs, dialogCardRoot, dialogLayout, dialogHeader, dialogContent, dialogFooter, dialog, dialogContainer, skeleton, codeSkeleton, headingSkeleton, labelSkeleton, textSkeleton, toast, toastLoadingBar, toastLoadingBarMask, toastLoadingBarProgress, toastLayer, treeItem, scopeClassName, card, compilePalette, compileTheme, compileSystem } from "@sanity/ui/css";
9
+ import { px, rem } from "@sanity/ui/css";
9
10
  import { motion, AnimatePresence } from "framer-motion";
10
- import { buildTheme_v3 } from "@sanity/ui/theme";
11
+ const createColorTheme = createColorTheme$1, hexToRgb = hexToRgb$1, hslToRgb = hslToRgb$1, multiply = multiply$1, parseColor = parseColor$1, rgbToHex = rgbToHex$1, rgbToHsl = rgbToHsl$1, rgba = rgba$1, screen = screen$1;
11
12
  function _responsive(media, values, callback) {
12
13
  return (values?.map(callback) || []).map((statement, mediaIndex) => mediaIndex === 0 ? statement : {
13
14
  [`@media screen and (min-width: ${media[mediaIndex - 1]}px)`]: statement
@@ -118,6 +119,7 @@ class ErrorBoundary extends Component {
118
119
  state = {
119
120
  error: null
120
121
  };
122
+ static displayName = "ErrorBoundary";
121
123
  static getDerivedStateFromError(error) {
122
124
  return {
123
125
  error
@@ -163,6 +165,7 @@ function AutocompleteOption(props) {
163
165
  let t2;
164
166
  return $[5] !== children || $[6] !== handleClick || $[7] !== handleKeyDown || $[8] !== id || $[9] !== selected ? (t2 = /* @__PURE__ */ jsx("li", { "aria-selected": selected, "data-ui": "AutocompleteOption", id, role: "option", onClick: handleClick, onKeyDown: handleKeyDown, children }), $[5] = children, $[6] = handleClick, $[7] = handleKeyDown, $[8] = id, $[9] = selected, $[10] = t2) : t2 = $[10], t2;
165
167
  }
168
+ AutocompleteOption.displayName = "AutocompleteOption";
166
169
  function autocompleteReducer(state, msg) {
167
170
  return msg.type === "input/change" ? {
168
171
  ...state,
@@ -202,8 +205,10 @@ function autocompleteReducer(state, msg) {
202
205
  value: msg.value
203
206
  } : state;
204
207
  }
205
- const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "Home", "End", "PageUp", "PageDown", "Meta", "Tab", "CapsLock"], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1, InnerAutocomplete = forwardRef(function(props, forwardedRef) {
208
+ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "Home", "End", "PageUp", "PageDown", "Meta", "Tab", "CapsLock"], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_AUTOCOMPLETE_ELEMENT = "input", DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1;
209
+ function Autocomplete(props) {
206
210
  const {
211
+ as = DEFAULT_AUTOCOMPLETE_ELEMENT,
207
212
  border = !0,
208
213
  customValidity,
209
214
  disabled,
@@ -226,13 +231,14 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
226
231
  prefix,
227
232
  radius = 2,
228
233
  readOnly,
234
+ ref: forwardedRef,
229
235
  relatedElements,
230
236
  renderOption: renderOptionProp,
231
237
  renderPopover,
232
238
  renderValue = DEFAULT_RENDER_VALUE,
233
239
  suffix,
234
240
  value: valueProp,
235
- ...restProps
241
+ ...rest
236
242
  } = props, [state, dispatch] = useReducer(autocompleteReducer, {
237
243
  activeValue: valueProp || null,
238
244
  focused: !1,
@@ -375,7 +381,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
375
381
  };
376
382
  }, [disabled, handleClearButtonFocus, loading, value]), openButtonBoxPadding = useMemo(() => padding.map((v_0) => v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2), [padding]), openButtonPadding = useMemo(() => padding.map((v_1) => Math.max(v_1 - 1, 0)), [padding]), openButtonProps = useMemo(() => typeof openButton == "object" ? openButton : EMPTY_RECORD, [openButton]), handleOpenClick = useCallback((event_4) => {
377
383
  dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
378
- }, [openButtonProps, dispatchOpen]), openButtonNode = useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsx(Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsx(Button, { "aria-label": "Open", disabled: expanded, display: "block", fontSize, icon: ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, [disabled, expanded, fontSize, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]), inputValue = useMemo(() => query === null ? value !== null ? renderValue(value, currentOption) : "" : query, [currentOption, query, renderValue, value]), input = /* @__PURE__ */ jsx(TextInput, { ...restProps, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", border, clearButton, customValidity, disabled, fontSize, icon, iconRight: loading && AnimatedSpinnerIcon, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: inputElementRef, role: "combobox", spellCheck: !1, suffix: suffix || openButtonNode, value: inputValue }), handleListBoxKeyDown = useCallback((event_5) => {
384
+ }, [openButtonProps, dispatchOpen]), openButtonNode = useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsx(Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsx(Button, { "aria-label": "Open", disabled: expanded, display: "block", fontSize, icon: ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, [disabled, expanded, fontSize, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]), inputValue = useMemo(() => query === null ? value !== null ? renderValue(value, currentOption) : "" : query, [currentOption, query, renderValue, value]), input = /* @__PURE__ */ jsx(TextInput, { ...rest, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", as, border, clearButton, customValidity, disabled, fontSize, icon, iconRight: loading && AnimatedSpinnerIcon, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: inputElementRef, role: "combobox", spellCheck: !1, suffix: suffix || openButtonNode, value: inputValue }), handleListBoxKeyDown = useCallback((event_5) => {
379
385
  event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
380
386
  }, [listFocused]), content2 = useMemo(() => filteredOptions.length === 0 ? null : /* @__PURE__ */ jsx(Box, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: /* @__PURE__ */ jsx(Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", id: listBoxId, ref: listBoxElementRef, role: "listbox", space: 1, children: filteredOptions.map((option_0) => {
381
387
  const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
@@ -398,10 +404,12 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
398
404
  results
399
405
  ] })
400
406
  );
401
- });
402
- InnerAutocomplete.displayName = "ForwardRef(Autocomplete)";
403
- const Autocomplete = InnerAutocomplete, Breadcrumbs = forwardRef(function(props, ref) {
407
+ }
408
+ Autocomplete.displayName = "Autocomplete";
409
+ const DEFAULT_BREADCRUMBS_ELEMENT = "nav";
410
+ function Breadcrumbs(props) {
404
411
  const {
412
+ as = DEFAULT_BREADCRUMBS_ELEMENT,
405
413
  children,
406
414
  className,
407
415
  expandButton: expandButtonProps,
@@ -413,7 +421,7 @@ const Autocomplete = InnerAutocomplete, Breadcrumbs = forwardRef(function(props,
413
421
  separator,
414
422
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
415
423
  space: _spaceProp,
416
- ...restProps
424
+ ...rest
417
425
  } = props, [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null), collapse = useCallback(() => setOpen(!1), []), expand = useCallback(() => setOpen(!0), []);
418
426
  useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
419
427
  const rawItems = useMemo(() => Children.toArray(children).filter(isValidElement), [children]), items = useMemo(() => {
@@ -424,25 +432,23 @@ const Autocomplete = InnerAutocomplete, Breadcrumbs = forwardRef(function(props,
424
432
  }
425
433
  return rawItems;
426
434
  }, [collapse, expand, expandButtonProps, gapY, maxLength, open, rawItems]);
427
- return /* @__PURE__ */ jsx(Flex, { as: "nav", "data-ui": "Breadcrumbs", ...restProps, className: composeClassNames(className, breadcrumbs()), gapX, gapY, ref, children: items.map((item, itemIndex) => /* @__PURE__ */ jsxs(Fragment, { children: [
435
+ return /* @__PURE__ */ jsx(Flex, { as, "data-ui": "Breadcrumbs", ...rest, className: composeClassNames(className, breadcrumbs()), gapX, gapY, children: items.map((item, itemIndex) => /* @__PURE__ */ jsxs(Fragment, { children: [
428
436
  itemIndex > 0 && /* @__PURE__ */ jsx(Box, { "aria-hidden": !0, as: "li", children: separator || /* @__PURE__ */ jsx(Text, { muted: !0, children: "/" }) }),
429
437
  /* @__PURE__ */ jsx(Box, { as: "li", children: item })
430
438
  ] }, itemIndex)) });
431
- });
432
- Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
433
- const DialogContext = createGlobalScopedContext("@sanity/ui/context/dialog", {
434
- version: 0
435
- });
436
- function useDialog() {
437
- return useContext(DialogContext);
438
439
  }
440
+ Breadcrumbs.displayName = "Breadcrumbs";
439
441
  function isTargetWithinScope(boundaryElement, portalElement, target) {
440
442
  return !boundaryElement || !portalElement ? !0 : containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
441
443
  }
442
- const DialogCard = forwardRef(function(props, forwardedRef) {
443
- const $ = c(43), {
444
+ const DEFAULT_DIALOG_CARD_ELEMENT = "div";
445
+ function DialogCard(props) {
446
+ const $ = c(51), t0 = props;
447
+ let autoFocus, children, footer, forwardedContentRef, forwardedRef, header, hideCloseButton, id, onClickOutside, onClose, portalProp, rest, t1;
448
+ $[0] !== t0 ? ({
444
449
  __unstable_autoFocus: autoFocus,
445
450
  __unstable_hideCloseButton: hideCloseButton,
451
+ as: t1,
446
452
  children,
447
453
  contentRef: forwardedContentRef,
448
454
  footer,
@@ -451,73 +457,74 @@ const DialogCard = forwardRef(function(props, forwardedRef) {
451
457
  onClickOutside,
452
458
  onClose,
453
459
  portal: portalProp,
454
- radius: radiusProp,
455
- scheme,
456
- shadow: t0,
457
- tone,
458
- width: widthProp
459
- } = props, shadowProp = t0 === void 0 ? 4 : t0, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, radius = useArrayProp(radiusProp), shadow = useArrayProp(shadowProp), width = useArrayProp(widthProp), ref = useRef(null), contentRef = useRef(null), layer = useLayer(), {
460
+ ref: forwardedRef,
461
+ ...rest
462
+ } = t0, $[0] = t0, $[1] = autoFocus, $[2] = children, $[3] = footer, $[4] = forwardedContentRef, $[5] = forwardedRef, $[6] = header, $[7] = hideCloseButton, $[8] = id, $[9] = onClickOutside, $[10] = onClose, $[11] = portalProp, $[12] = rest, $[13] = t1) : (autoFocus = $[1], children = $[2], footer = $[3], forwardedContentRef = $[4], forwardedRef = $[5], header = $[6], hideCloseButton = $[7], id = $[8], onClickOutside = $[9], onClose = $[10], portalProp = $[11], rest = $[12], t1 = $[13]);
463
+ const as = t1 === void 0 ? DEFAULT_DIALOG_CARD_ELEMENT : t1, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, ref = useRef(null), contentRef = useRef(null), layer = useLayer(), {
460
464
  isTopLayer
461
465
  } = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton;
462
- let t1;
463
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => ref.current, $[0] = t1) : t1 = $[0], useImperativeHandle(forwardedRef, t1);
464
466
  let t2;
465
- $[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => contentRef.current, $[1] = t2) : t2 = $[1], useImperativeHandle(forwardedContentRef, t2);
466
- let t3, t4;
467
- $[2] !== autoFocus ? (t3 = () => {
467
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[14] = t2) : t2 = $[14], useImperativeHandle(forwardedRef, t2);
468
+ let t3;
469
+ $[15] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => contentRef.current, $[15] = t3) : t3 = $[15], useImperativeHandle(forwardedContentRef, t3);
470
+ let t4, t5;
471
+ $[16] !== autoFocus ? (t4 = () => {
468
472
  autoFocus && ref.current && focusFirstDescendant(ref.current);
469
- }, t4 = [autoFocus, ref], $[2] = autoFocus, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), useEffect(t3, t4);
470
- let t5;
471
- $[5] !== boundaryElement || $[6] !== isTopLayer || $[7] !== onClose || $[8] !== portalElement ? (t5 = (event) => {
473
+ }, t5 = [autoFocus, ref], $[16] = autoFocus, $[17] = t4, $[18] = t5) : (t4 = $[17], t5 = $[18]), useEffect(t4, t5);
474
+ let t6;
475
+ $[19] !== boundaryElement || $[20] !== isTopLayer || $[21] !== onClose || $[22] !== portalElement ? (t6 = (event) => {
472
476
  if (!isTopLayer || !onClose)
473
477
  return;
474
478
  const target = document.activeElement;
475
479
  target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
476
- }, $[5] = boundaryElement, $[6] = isTopLayer, $[7] = onClose, $[8] = portalElement, $[9] = t5) : t5 = $[9], useGlobalKeyDown(t5);
477
- let t6;
478
- $[10] !== boundaryElement || $[11] !== isTopLayer || $[12] !== onClickOutside || $[13] !== portalElement ? (t6 = isTopLayer && onClickOutside && ((event_0) => {
480
+ }, $[19] = boundaryElement, $[20] = isTopLayer, $[21] = onClose, $[22] = portalElement, $[23] = t6) : t6 = $[23], useGlobalKeyDown(t6);
481
+ let t7;
482
+ $[24] !== boundaryElement || $[25] !== isTopLayer || $[26] !== onClickOutside || $[27] !== portalElement ? (t7 = isTopLayer && onClickOutside && ((event_0) => {
479
483
  const target_0 = event_0.target;
480
484
  target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
481
- }), $[10] = boundaryElement, $[11] = isTopLayer, $[12] = onClickOutside, $[13] = portalElement, $[14] = t6) : t6 = $[14];
482
- let t7;
483
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => [ref.current], $[15] = t7) : t7 = $[15], useClickOutsideEvent(t6, t7);
485
+ }), $[24] = boundaryElement, $[25] = isTopLayer, $[26] = onClickOutside, $[27] = portalElement, $[28] = t7) : t7 = $[28];
484
486
  let t8;
485
- $[16] === Symbol.for("react.memo_cache_sentinel") ? (t8 = dialogContainer(), $[16] = t8) : t8 = $[16];
487
+ $[29] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => [ref.current], $[29] = t8) : t8 = $[29], useClickOutsideEvent(t7, t8);
486
488
  let t9;
487
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t9 = dialogCardRoot(), $[17] = t9) : t9 = $[17];
489
+ $[30] === Symbol.for("react.memo_cache_sentinel") ? (t9 = dialogCardRoot(), $[30] = t9) : t9 = $[30];
488
490
  let t10;
489
- $[18] === Symbol.for("react.memo_cache_sentinel") ? (t10 = dialogLayout(), $[18] = t10) : t10 = $[18];
491
+ $[31] === Symbol.for("react.memo_cache_sentinel") ? (t10 = dialogLayout(), $[31] = t10) : t10 = $[31];
490
492
  let t11;
491
- $[19] !== header || $[20] !== labelId || $[21] !== onClose || $[22] !== showCloseButton || $[23] !== showHeader ? (t11 = showHeader && /* @__PURE__ */ jsx(Box, { className: dialogHeader(), position: "relative", children: /* @__PURE__ */ jsxs(Flex, { align: "flex-start", padding: 3, children: [
493
+ $[32] !== header || $[33] !== labelId || $[34] !== onClose || $[35] !== showCloseButton || $[36] !== showHeader ? (t11 = showHeader && /* @__PURE__ */ jsx(Box, { className: dialogHeader(), position: "relative", children: /* @__PURE__ */ jsxs(Flex, { align: "flex-start", padding: 3, children: [
492
494
  /* @__PURE__ */ jsx(Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsx(Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
493
495
  showCloseButton && /* @__PURE__ */ jsx(Box, { flex: "none", children: /* @__PURE__ */ jsx(Button, { "aria-label": "Close dialog", disabled: !onClose, icon: CloseIcon, mode: "bleed", onClick: onClose, padding: 2 }) })
494
- ] }) }), $[19] = header, $[20] = labelId, $[21] = onClose, $[22] = showCloseButton, $[23] = showHeader, $[24] = t11) : t11 = $[24];
496
+ ] }) }), $[32] = header, $[33] = labelId, $[34] = onClose, $[35] = showCloseButton, $[36] = showHeader, $[37] = t11) : t11 = $[37];
495
497
  let t12;
496
- $[25] === Symbol.for("react.memo_cache_sentinel") ? (t12 = dialogContent(), $[25] = t12) : t12 = $[25];
498
+ $[38] === Symbol.for("react.memo_cache_sentinel") ? (t12 = dialogContent(), $[38] = t12) : t12 = $[38];
497
499
  let t13;
498
- $[26] !== children ? (t13 = /* @__PURE__ */ jsx(Box, { className: t12, flex: 1, overflow: "auto", position: "relative", ref: contentRef, tabIndex: -1, children }), $[26] = children, $[27] = t13) : t13 = $[27];
500
+ $[39] !== children ? (t13 = /* @__PURE__ */ jsx(Box, { className: t12, flex: 1, overflow: "auto", position: "relative", ref: contentRef, tabIndex: -1, children }), $[39] = children, $[40] = t13) : t13 = $[40];
499
501
  let t14;
500
- $[28] !== footer ? (t14 = footer && /* @__PURE__ */ jsx(Box, { className: dialogFooter(), position: "relative", children: footer }), $[28] = footer, $[29] = t14) : t14 = $[29];
502
+ $[41] !== footer ? (t14 = footer && /* @__PURE__ */ jsx(Box, { className: dialogFooter(), position: "relative", children: footer }), $[41] = footer, $[42] = t14) : t14 = $[42];
501
503
  let t15;
502
- $[30] !== t11 || $[31] !== t13 || $[32] !== t14 ? (t15 = /* @__PURE__ */ jsxs(Flex, { className: t10, direction: "column", flex: 1, children: [
504
+ $[43] !== t11 || $[44] !== t13 || $[45] !== t14 ? (t15 = /* @__PURE__ */ jsxs(Flex, { className: t10, direction: "column", flex: 1, children: [
503
505
  t11,
504
506
  t13,
505
507
  t14
506
- ] }), $[30] = t11, $[31] = t13, $[32] = t14, $[33] = t15) : t15 = $[33];
508
+ ] }), $[43] = t11, $[44] = t13, $[45] = t14, $[46] = t15) : t15 = $[46];
507
509
  let t16;
508
- $[34] !== radius || $[35] !== scheme || $[36] !== shadow || $[37] !== t15 || $[38] !== tone ? (t16 = /* @__PURE__ */ jsx(Card, { className: t9, display: "flex", radius, ref, scheme, shadow, tone, children: t15 }), $[34] = radius, $[35] = scheme, $[36] = shadow, $[37] = t15, $[38] = tone, $[39] = t16) : t16 = $[39];
509
- let t17;
510
- return $[40] !== t16 || $[41] !== width ? (t17 = /* @__PURE__ */ jsx(Container, { align: "center", className: t8, "data-ui": "DialogCard", direction: "column", display: "flex", justify: "center", width, children: t16 }), $[40] = t16, $[41] = width, $[42] = t17) : t17 = $[42], t17;
510
+ return $[47] !== as || $[48] !== rest || $[49] !== t15 ? (t16 = /* @__PURE__ */ jsx(Card, { ...rest, as, className: t9, display: "flex", ref, children: t15 }), $[47] = as, $[48] = rest, $[49] = t15, $[50] = t16) : t16 = $[50], t16;
511
+ }
512
+ DialogCard.displayName = "DialogCard";
513
+ const DialogContext = createGlobalScopedContext("@sanity/ui/context/dialog", {
514
+ version: 0
511
515
  });
512
- DialogCard.displayName = "ForwardRef(DialogCard)";
513
- const Dialog = forwardRef(function(props, ref) {
514
- const $ = c(66), context = useDialog();
515
- let _positionProp, _zOffsetProp, cardShadow, children, className, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5, tone;
516
- $[0] !== props ? ({
517
- __unstable_autoFocus: t0,
518
- __unstable_hideCloseButton: t1,
519
- animate: t2,
520
- cardRadius: t3,
516
+ function useDialog() {
517
+ return useContext(DialogContext);
518
+ }
519
+ const DEFAULT_DIALOG_ELEMENT = "div";
520
+ function Dialog(props) {
521
+ const $ = c(69), context = useDialog(), t0 = props;
522
+ let _positionProp, _zOffsetProp, children, className, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, rest, scheme, t1, t2, t3, t4, t5, t6, t7, tone;
523
+ $[0] !== t0 ? ({
524
+ __unstable_autoFocus: t1,
525
+ __unstable_hideCloseButton: t2,
526
+ animate: t3,
527
+ cardRadius: t4,
521
528
  children,
522
529
  className,
523
530
  contentRef,
@@ -528,19 +535,19 @@ const Dialog = forwardRef(function(props, ref) {
528
535
  onClickOutside,
529
536
  onClose,
530
537
  onFocus,
531
- padding: t4,
538
+ padding: t5,
532
539
  portal: portalProp,
533
540
  position: _positionProp,
534
541
  scheme,
535
- shadow: cardShadow,
536
- width: t5,
542
+ shadow: t6,
543
+ width: t7,
537
544
  zOffset: _zOffsetProp,
538
545
  tone,
539
- ...restProps
540
- } = props, $[0] = props, $[1] = _positionProp, $[2] = _zOffsetProp, $[3] = cardShadow, $[4] = children, $[5] = className, $[6] = contentRef, $[7] = footer, $[8] = header, $[9] = id, $[10] = onActivate, $[11] = onClickOutside, $[12] = onClose, $[13] = onFocus, $[14] = portalProp, $[15] = restProps, $[16] = scheme, $[17] = t0, $[18] = t1, $[19] = t2, $[20] = t3, $[21] = t4, $[22] = t5, $[23] = tone) : (_positionProp = $[1], _zOffsetProp = $[2], cardShadow = $[3], children = $[4], className = $[5], contentRef = $[6], footer = $[7], header = $[8], id = $[9], onActivate = $[10], onClickOutside = $[11], onClose = $[12], onFocus = $[13], portalProp = $[14], restProps = $[15], scheme = $[16], t0 = $[17], t1 = $[18], t2 = $[19], t3 = $[20], t4 = $[21], t5 = $[22], tone = $[23]);
541
- const autoFocus = t0 === void 0 ? !0 : t0, hideCloseButton = t1 === void 0 ? !1 : t1, _animate = t2 === void 0 ? !1 : t2, cardRadiusProp = t3 === void 0 ? 4 : t3, padding = t4 === void 0 ? 3 : t4, widthProp = t5 === void 0 ? 0 : t5, positionProp = _positionProp ?? context.position ?? "fixed", zOffsetProp = _zOffsetProp ?? context.zOffset ?? Z_OFFSETS.dialog, animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = useArrayProp(cardRadiusProp), position = useArrayProp(positionProp), width = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
542
- let t6;
543
- $[24] !== onFocus ? (t6 = (event) => {
546
+ ...rest
547
+ } = t0, $[0] = t0, $[1] = _positionProp, $[2] = _zOffsetProp, $[3] = children, $[4] = className, $[5] = contentRef, $[6] = footer, $[7] = header, $[8] = id, $[9] = onActivate, $[10] = onClickOutside, $[11] = onClose, $[12] = onFocus, $[13] = portalProp, $[14] = rest, $[15] = scheme, $[16] = t1, $[17] = t2, $[18] = t3, $[19] = t4, $[20] = t5, $[21] = t6, $[22] = t7, $[23] = tone) : (_positionProp = $[1], _zOffsetProp = $[2], children = $[3], className = $[4], contentRef = $[5], footer = $[6], header = $[7], id = $[8], onActivate = $[9], onClickOutside = $[10], onClose = $[11], onFocus = $[12], portalProp = $[13], rest = $[14], scheme = $[15], t1 = $[16], t2 = $[17], t3 = $[18], t4 = $[19], t5 = $[20], t6 = $[21], t7 = $[22], tone = $[23]);
548
+ const autoFocus = t1 === void 0 ? !0 : t1, hideCloseButton = t2 === void 0 ? !1 : t2, _animate = t3 === void 0 ? !1 : t3, cardRadiusProp = t4 === void 0 ? 4 : t4, padding = t5 === void 0 ? 3 : t5, cardShadow = t6 === void 0 ? 4 : t6, width = t7 === void 0 ? 0 : t7, positionProp = _positionProp ?? context.position ?? "fixed", zOffsetProp = _zOffsetProp ?? context.zOffset ?? Z_OFFSETS.dialog, animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = useArrayProp(cardRadiusProp), position = useArrayProp(positionProp), zOffset = useArrayProp(zOffsetProp), preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
549
+ let t8;
550
+ $[24] !== onFocus ? (t8 = (event) => {
544
551
  onFocus?.(event);
545
552
  const target = event.target, cardElement = cardRef.current;
546
553
  if (cardElement && target === preDivRef.current) {
@@ -552,10 +559,10 @@ const Dialog = forwardRef(function(props, ref) {
552
559
  return;
553
560
  }
554
561
  isHTMLElement(event.target) && (focusedElementRef.current = event.target);
555
- }, $[24] = onFocus, $[25] = t6) : t6 = $[25];
556
- const handleFocus = t6, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0);
557
- let t7;
558
- $[26] !== boundaryElement || $[27] !== portalElement ? (t7 = () => {
562
+ }, $[24] = onFocus, $[25] = t8) : t8 = $[25];
563
+ const handleFocus = t8, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0);
564
+ let t9;
565
+ $[26] !== boundaryElement || $[27] !== portalElement ? (t9 = () => {
559
566
  rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
560
567
  const activeElement = document.activeElement;
561
568
  if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
@@ -568,27 +575,31 @@ const Dialog = forwardRef(function(props, ref) {
568
575
  target_0.focus();
569
576
  }
570
577
  }, 0);
571
- }, $[26] = boundaryElement, $[27] = portalElement, $[28] = t7) : t7 = $[28];
572
- const handleRootClick = t7;
573
- let t8;
574
- $[29] !== className ? (t8 = composeClassNames(className, dialog()), $[29] = className, $[30] = t8) : t8 = $[30];
575
- const t9 = animate ? "" : void 0;
578
+ }, $[26] = boundaryElement, $[27] = portalElement, $[28] = t9) : t9 = $[28];
579
+ const handleRootClick = t9;
576
580
  let t10;
577
- $[31] === Symbol.for("react.memo_cache_sentinel") ? (t10 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[31] = t10) : t10 = $[31];
578
- let t11;
579
- $[32] !== autoFocus || $[33] !== cardRadius || $[34] !== cardShadow || $[35] !== children || $[36] !== contentRef || $[37] !== footer || $[38] !== header || $[39] !== hideCloseButton || $[40] !== id || $[41] !== onClickOutside || $[42] !== onClose || $[43] !== portalProp || $[44] !== scheme || $[45] !== tone || $[46] !== width ? (t11 = /* @__PURE__ */ jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, tone, width, children }), $[32] = autoFocus, $[33] = cardRadius, $[34] = cardShadow, $[35] = children, $[36] = contentRef, $[37] = footer, $[38] = header, $[39] = hideCloseButton, $[40] = id, $[41] = onClickOutside, $[42] = onClose, $[43] = portalProp, $[44] = scheme, $[45] = tone, $[46] = width, $[47] = t11) : t11 = $[47];
581
+ $[29] !== className ? (t10 = composeClassNames(className, dialog()), $[29] = className, $[30] = t10) : t10 = $[30];
582
+ const t11 = animate ? "" : void 0;
580
583
  let t12;
581
- $[48] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[48] = t12) : t12 = $[48];
584
+ $[31] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[31] = t12) : t12 = $[31];
582
585
  let t13;
583
- $[49] !== handleFocus || $[50] !== handleRootClick || $[51] !== id || $[52] !== labelId || $[53] !== onActivate || $[54] !== padding || $[55] !== position || $[56] !== ref || $[57] !== restProps || $[58] !== t11 || $[59] !== t8 || $[60] !== t9 || $[61] !== zOffset ? (t13 = /* @__PURE__ */ jsxs(Layer, { ...restProps, "aria-labelledby": labelId, "aria-modal": !0, className: t8, "data-animate": t9, "data-ui": "Dialog", display: "flex", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, padding, position, ref, role: "dialog", zOffset, children: [
584
- t10,
585
- t11,
586
- t12
587
- ] }), $[49] = handleFocus, $[50] = handleRootClick, $[51] = id, $[52] = labelId, $[53] = onActivate, $[54] = padding, $[55] = position, $[56] = ref, $[57] = restProps, $[58] = t11, $[59] = t8, $[60] = t9, $[61] = zOffset, $[62] = t13) : t13 = $[62];
586
+ $[32] === Symbol.for("react.memo_cache_sentinel") ? (t13 = dialogContainer(), $[32] = t13) : t13 = $[32];
588
587
  let t14;
589
- return $[63] !== portalProp || $[64] !== t13 ? (t14 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t13 }), $[63] = portalProp, $[64] = t13, $[65] = t14) : t14 = $[65], t14;
590
- });
591
- Dialog.displayName = "ForwardRef(Dialog)";
588
+ $[33] !== autoFocus || $[34] !== cardRadius || $[35] !== cardShadow || $[36] !== children || $[37] !== contentRef || $[38] !== footer || $[39] !== header || $[40] !== hideCloseButton || $[41] !== id || $[42] !== onClickOutside || $[43] !== onClose || $[44] !== portalProp || $[45] !== scheme || $[46] !== tone || $[47] !== width ? (t14 = /* @__PURE__ */ jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, tone, width, children }), $[33] = autoFocus, $[34] = cardRadius, $[35] = cardShadow, $[36] = children, $[37] = contentRef, $[38] = footer, $[39] = header, $[40] = hideCloseButton, $[41] = id, $[42] = onClickOutside, $[43] = onClose, $[44] = portalProp, $[45] = scheme, $[46] = tone, $[47] = width, $[48] = t14) : t14 = $[48];
589
+ let t15;
590
+ $[49] !== t14 || $[50] !== width ? (t15 = /* @__PURE__ */ jsx(Container, { align: "center", className: t13, "data-ui": "DialogCard", direction: "column", display: "flex", justify: "center", width, children: t14 }), $[49] = t14, $[50] = width, $[51] = t15) : t15 = $[51];
591
+ let t16;
592
+ $[52] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[52] = t16) : t16 = $[52];
593
+ let t17;
594
+ $[53] !== handleFocus || $[54] !== handleRootClick || $[55] !== id || $[56] !== labelId || $[57] !== onActivate || $[58] !== padding || $[59] !== position || $[60] !== rest || $[61] !== t10 || $[62] !== t11 || $[63] !== t15 || $[64] !== zOffset ? (t17 = /* @__PURE__ */ jsxs(Layer, { ...rest, "aria-labelledby": labelId, "aria-modal": !0, className: t10, "data-animate": t11, "data-ui": "Dialog", display: "flex", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, padding, position, role: "dialog", zOffset, children: [
595
+ t12,
596
+ t15,
597
+ t16
598
+ ] }), $[53] = handleFocus, $[54] = handleRootClick, $[55] = id, $[56] = labelId, $[57] = onActivate, $[58] = padding, $[59] = position, $[60] = rest, $[61] = t10, $[62] = t11, $[63] = t15, $[64] = zOffset, $[65] = t17) : t17 = $[65];
599
+ let t18;
600
+ return $[66] !== portalProp || $[67] !== t17 ? (t18 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t17 }), $[66] = portalProp, $[67] = t17, $[68] = t18) : t18 = $[68], t18;
601
+ }
602
+ Dialog.displayName = "Dialog";
592
603
  function DialogProvider(props) {
593
604
  const $ = c(6), {
594
605
  children,
@@ -606,7 +617,7 @@ function DialogProvider(props) {
606
617
  return $[3] !== children || $[4] !== contextValue ? (t2 = /* @__PURE__ */ jsx(DialogContext.Provider, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t2) : t2 = $[5], t2;
607
618
  }
608
619
  DialogProvider.displayName = "DialogProvider";
609
- const MenuButton = forwardRef(function(props, forwardedRef) {
620
+ function MenuButton(props) {
610
621
  const $ = c(63), {
611
622
  __unstable_disableRestoreFocusOnClose: t0,
612
623
  boundaryElement: deprecated_boundaryElement,
@@ -620,7 +631,8 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
620
631
  portal: t1,
621
632
  popover,
622
633
  popoverRadius: deprecated_popoverRadius,
623
- preventOverflow: deprecated_preventOverflow
634
+ preventOverflow: deprecated_preventOverflow,
635
+ ref: forwardedRef
624
636
  } = props, disableRestoreFocusOnClose = t0 === void 0 ? !1 : t0, deprecated_portal = t1 === void 0 ? !0 : t1, [open, setOpen] = useState(!1), [shouldFocus, setShouldFocus] = useState(null), [buttonElement, setButtonElement] = useState(null);
625
637
  let t2;
626
638
  $[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
@@ -639,7 +651,7 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
639
651
  }, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), useEffect(t7, t8);
640
652
  let t9;
641
653
  $[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
642
- setOpen(_temp$2), setShouldFocus(null);
654
+ setOpen(_temp$3), setShouldFocus(null);
643
655
  }, $[12] = t9) : t9 = $[12];
644
656
  const handleButtonClick = t9;
645
657
  let t10;
@@ -747,24 +759,25 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
747
759
  $[56] !== button ? (t24 = button || /* @__PURE__ */ jsx(Fragment$1, {}), $[56] = button, $[57] = t24) : t24 = $[57];
748
760
  let t25;
749
761
  return $[58] !== menu || $[59] !== open || $[60] !== popoverProps || $[61] !== t24 ? (t25 = /* @__PURE__ */ jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: t24 }), $[58] = menu, $[59] = open, $[60] = popoverProps, $[61] = t24, $[62] = t25) : t25 = $[62], t25;
750
- });
751
- MenuButton.displayName = "ForwardRef(MenuButton)";
752
- function _temp$2(v) {
762
+ }
763
+ function _temp$3(v) {
753
764
  return !v;
754
765
  }
755
- const Skeleton = forwardRef(function(props, ref) {
756
- const $ = c(18);
757
- let className, delay, radius, restProps, t0;
758
- $[0] !== props ? ({
759
- animated: t0,
766
+ MenuButton.displayName = "MenuButton";
767
+ const DEFAULT_SKELETON_ELEMENT = "div";
768
+ function Skeleton(props) {
769
+ const $ = c(17), t0 = props;
770
+ let className, delay, radius, rest, t1;
771
+ $[0] !== t0 ? ({
772
+ animated: t1,
760
773
  className,
761
774
  delay,
762
775
  radius,
763
- ...restProps
764
- } = props, $[0] = props, $[1] = className, $[2] = delay, $[3] = radius, $[4] = restProps, $[5] = t0) : (className = $[1], delay = $[2], radius = $[3], restProps = $[4], t0 = $[5]);
765
- const animated = t0 === void 0 ? !1 : t0, [visible, setVisible] = useState(!delay);
766
- let t1, t2;
767
- $[6] !== delay ? (t1 = () => {
776
+ ...rest
777
+ } = t0, $[0] = t0, $[1] = className, $[2] = delay, $[3] = radius, $[4] = rest, $[5] = t1) : (className = $[1], delay = $[2], radius = $[3], rest = $[4], t1 = $[5]);
778
+ const animated = t1 === void 0 ? !1 : t1, [visible, setVisible] = useState(!delay);
779
+ let t2, t3;
780
+ $[6] !== delay ? (t2 = () => {
768
781
  if (!delay)
769
782
  return setVisible(!0);
770
783
  const timeout = setTimeout(() => {
@@ -773,97 +786,102 @@ const Skeleton = forwardRef(function(props, ref) {
773
786
  return () => {
774
787
  clearTimeout(timeout);
775
788
  };
776
- }, t2 = [delay], $[6] = delay, $[7] = t1, $[8] = t2) : (t1 = $[7], t2 = $[8]), useEffect(t1, t2);
777
- let t3;
778
- $[9] !== className || $[10] !== radius ? (t3 = composeClassNames(className, skeleton({
789
+ }, t3 = [delay], $[6] = delay, $[7] = t2, $[8] = t3) : (t2 = $[7], t3 = $[8]), useEffect(t2, t3);
790
+ let t4;
791
+ $[9] !== className || $[10] !== radius ? (t4 = composeClassNames(className, skeleton({
779
792
  radius
780
- })), $[9] = className, $[10] = radius, $[11] = t3) : t3 = $[11];
781
- const t4 = animated ? "" : void 0, t5 = visible ? "" : void 0;
782
- let t6;
783
- return $[12] !== ref || $[13] !== restProps || $[14] !== t3 || $[15] !== t4 || $[16] !== t5 ? (t6 = /* @__PURE__ */ jsx(Box, { "data-ui": "Skeleton", ...restProps, className: t3, "data-animated": t4, "data-visible": t5, ref }), $[12] = ref, $[13] = restProps, $[14] = t3, $[15] = t4, $[16] = t5, $[17] = t6) : t6 = $[17], t6;
784
- });
785
- Skeleton.displayName = "ForwardRef(Skeleton)";
786
- const TextSkeleton = forwardRef(function(props, ref) {
787
- const $ = c(11);
788
- let className, restProps, t0;
789
- $[0] !== props ? ({
793
+ })), $[9] = className, $[10] = radius, $[11] = t4) : t4 = $[11];
794
+ const t5 = animated ? "" : void 0, t6 = visible ? "" : void 0;
795
+ let t7;
796
+ return $[12] !== rest || $[13] !== t4 || $[14] !== t5 || $[15] !== t6 ? (t7 = /* @__PURE__ */ jsx(Box, { "data-ui": "Skeleton", ...rest, className: t4, "data-animated": t5, "data-visible": t6 }), $[12] = rest, $[13] = t4, $[14] = t5, $[15] = t6, $[16] = t7) : t7 = $[16], t7;
797
+ }
798
+ Skeleton.displayName = "Skeleton";
799
+ const DEFAULT_CODE_SKELETON_ELEMENT = "div";
800
+ function CodeSkeleton(props) {
801
+ const $ = c(10), t0 = props;
802
+ let className, rest, t1;
803
+ $[0] !== t0 ? ({
790
804
  className,
791
- size: t0,
792
- ...restProps
793
- } = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
794
- const size = t0 === void 0 ? 2 : t0;
795
- let t1;
796
- $[4] !== className || $[5] !== size ? (t1 = composeClassNames(className, textSkeleton({
797
- size
798
- })), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
805
+ size: t1,
806
+ ...rest
807
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
808
+ const size = t1 === void 0 ? 2 : t1;
799
809
  let t2;
800
- return $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsx(Skeleton, { "data-ui": "TextSkeleton", ...restProps, className: t1, ref }), $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
801
- });
802
- TextSkeleton.displayName = "ForwardRef(TextSkeleton)";
803
- const LabelSkeleton = forwardRef(function(props, ref) {
804
- const $ = c(11);
805
- let className, restProps, t0;
806
- $[0] !== props ? ({
807
- className,
808
- size: t0,
809
- ...restProps
810
- } = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
811
- const size = t0 === void 0 ? 2 : t0;
812
- let t1;
813
- $[4] !== className || $[5] !== size ? (t1 = composeClassNames(className, labelSkeleton({
810
+ $[4] !== className || $[5] !== size ? (t2 = composeClassNames(className, codeSkeleton({
814
811
  size
815
- })), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
816
- let t2;
817
- return $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsx(Skeleton, { "data-ui": "LabelSkeleton", ...restProps, className: t1, ref }), $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
818
- });
819
- LabelSkeleton.displayName = "ForwardRef(LabelSkeleton)";
820
- const HeadingSkeleton = forwardRef(function(props, ref) {
821
- const $ = c(11);
822
- let className, restProps, t0;
823
- $[0] !== props ? ({
812
+ })), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
813
+ let t3;
814
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
815
+ }
816
+ CodeSkeleton.displayName = "CodeSkeleton";
817
+ const DEFAULT_HEADING_SKELETON_ELEMENT = "div";
818
+ function HeadingSkeleton(props) {
819
+ const $ = c(10), t0 = props;
820
+ let className, rest, t1;
821
+ $[0] !== t0 ? ({
824
822
  className,
825
- size: t0,
826
- ...restProps
827
- } = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
828
- const size = t0 === void 0 ? 2 : t0;
829
- let t1;
830
- $[4] !== className || $[5] !== size ? (t1 = composeClassNames(className, headingSkeleton({
831
- size
832
- })), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
823
+ size: t1,
824
+ ...rest
825
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
826
+ const size = t1 === void 0 ? 2 : t1;
833
827
  let t2;
834
- return $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsx(Skeleton, { ...restProps, className: t1, ref }), $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
835
- });
836
- HeadingSkeleton.displayName = "ForwardRef(HeadingSkeleton)";
837
- const CodeSkeleton = forwardRef(function(props, ref) {
838
- const $ = c(11);
839
- let className, restProps, t0;
840
- $[0] !== props ? ({
828
+ $[4] !== className || $[5] !== size ? (t2 = composeClassNames(className, headingSkeleton({
829
+ size
830
+ })), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
831
+ let t3;
832
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
833
+ }
834
+ HeadingSkeleton.displayName = "HeadingSkeleton";
835
+ const DEFAULT_LABEL_SKELETON_ELEMENT = "div";
836
+ function LabelSkeleton(props) {
837
+ const $ = c(10), t0 = props;
838
+ let className, rest, t1;
839
+ $[0] !== t0 ? ({
841
840
  className,
842
- size: t0,
843
- ...restProps
844
- } = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
845
- const size = t0 === void 0 ? 2 : t0;
846
- let t1;
847
- $[4] !== className || $[5] !== size ? (t1 = composeClassNames(className, codeSkeleton({
841
+ size: t1,
842
+ ...rest
843
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
844
+ const size = t1 === void 0 ? 2 : t1;
845
+ let t2;
846
+ $[4] !== className || $[5] !== size ? (t2 = composeClassNames(className, labelSkeleton({
848
847
  size
849
- })), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
848
+ })), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
849
+ let t3;
850
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
851
+ }
852
+ LabelSkeleton.displayName = "LabelSkeleton";
853
+ const DEFAULT_TEXT_SKELETON_ELEMENT = "div";
854
+ function TextSkeleton(props) {
855
+ const $ = c(10), t0 = props;
856
+ let className, rest, t1;
857
+ $[0] !== t0 ? ({
858
+ className,
859
+ size: t1,
860
+ ...rest
861
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
862
+ const size = t1 === void 0 ? 2 : t1;
850
863
  let t2;
851
- return $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsx(Skeleton, { ...restProps, className: t1, ref }), $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
852
- });
853
- CodeSkeleton.displayName = "ForwardRef(CodeSkeleton)";
854
- const TabPanel = forwardRef(function(props, ref) {
855
- const $ = c(9);
856
- let flex, restProps;
857
- $[0] !== props ? ({
858
- flex,
859
- ...restProps
860
- } = props, $[0] = props, $[1] = flex, $[2] = restProps) : (flex = $[1], restProps = $[2]);
861
- const t0 = props.tabIndex === void 0 ? 0 : props.tabIndex;
862
- let t1;
863
- return $[3] !== flex || $[4] !== props.children || $[5] !== ref || $[6] !== restProps || $[7] !== t0 ? (t1 = /* @__PURE__ */ jsx(Box, { "data-ui": "TabPanel", ...restProps, flex, ref, role: "tabpanel", tabIndex: t0, children: props.children }), $[3] = flex, $[4] = props.children, $[5] = ref, $[6] = restProps, $[7] = t0, $[8] = t1) : t1 = $[8], t1;
864
- });
865
- TabPanel.displayName = "ForwardRef(TabPanel)";
866
- const ROLES = {
864
+ $[4] !== className || $[5] !== size ? (t2 = composeClassNames(className, textSkeleton({
865
+ size
866
+ })), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
867
+ let t3;
868
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
869
+ }
870
+ TextSkeleton.displayName = "TextSkeleton";
871
+ const DEFAULT_TAB_PANEL_ELEMENT = "div";
872
+ function TabPanel(props) {
873
+ const $ = c(8), t0 = props;
874
+ let rest, t1;
875
+ $[0] !== t0 ? ({
876
+ as: t1,
877
+ ...rest
878
+ } = t0, $[0] = t0, $[1] = rest, $[2] = t1) : (rest = $[1], t1 = $[2]);
879
+ const as = t1 === void 0 ? DEFAULT_TAB_PANEL_ELEMENT : t1, t2 = props.tabIndex === void 0 ? 0 : props.tabIndex;
880
+ let t3;
881
+ return $[3] !== as || $[4] !== props.children || $[5] !== rest || $[6] !== t2 ? (t3 = /* @__PURE__ */ jsx(Box, { "data-ui": "TabPanel", ...rest, as, role: "tabpanel", tabIndex: t2, children: props.children }), $[3] = as, $[4] = props.children, $[5] = rest, $[6] = t2, $[7] = t3) : t3 = $[7], t3;
882
+ }
883
+ TabPanel.displayName = "TabPanel";
884
+ const DEFAULT_TOAST_ELEMENT = "li", ROLES = {
867
885
  error: "alert",
868
886
  warning: "alert",
869
887
  success: "alert",
@@ -880,61 +898,62 @@ const ROLES = {
880
898
  info: "neutral"
881
899
  }, LONG_ENOUGH_BUT_NOT_TOO_LONG = 1e3 * 60 * 60 * 24 * 24;
882
900
  function Toast(props) {
883
- const $ = c(51);
884
- let closable, description, duration, onClose, restProps, status, t0, title, updatedAt;
885
- $[0] !== props ? ({
901
+ const $ = c(53), t0 = props;
902
+ let closable, description, duration, onClose, rest, status, t1, t2, title, updatedAt;
903
+ $[0] !== t0 ? ({
904
+ as: t1,
886
905
  closable,
887
906
  description,
888
907
  duration,
889
908
  onClose,
890
- radius: t0,
909
+ radius: t2,
891
910
  title,
892
911
  status,
893
912
  updatedAt,
894
- ...restProps
895
- } = props, $[0] = props, $[1] = closable, $[2] = description, $[3] = duration, $[4] = onClose, $[5] = restProps, $[6] = status, $[7] = t0, $[8] = title, $[9] = updatedAt) : (closable = $[1], description = $[2], duration = $[3], onClose = $[4], restProps = $[5], status = $[6], t0 = $[7], title = $[8], updatedAt = $[9]);
896
- const radius = t0 === void 0 ? 3 : t0, cardTone = status ? STATUS_CARD_TONE[status] : "default", buttonTone = status ? BUTTON_TONE[status] : "default", role = status ? ROLES[status] : "status", visualDuration = usePrefersReducedMotion() ? 0 : 0.26;
897
- let t1;
898
- $[10] !== visualDuration ? (t1 = visualDuration ? {
913
+ ...rest
914
+ } = t0, $[0] = t0, $[1] = closable, $[2] = description, $[3] = duration, $[4] = onClose, $[5] = rest, $[6] = status, $[7] = t1, $[8] = t2, $[9] = title, $[10] = updatedAt) : (closable = $[1], description = $[2], duration = $[3], onClose = $[4], rest = $[5], status = $[6], t1 = $[7], t2 = $[8], title = $[9], updatedAt = $[10]);
915
+ const as = t1 === void 0 ? DEFAULT_TOAST_ELEMENT : t1, radius = t2 === void 0 ? 3 : t2, cardTone = status ? STATUS_CARD_TONE[status] : "default", buttonTone = status ? BUTTON_TONE[status] : "default", role = status ? ROLES[status] : "status", visualDuration = usePrefersReducedMotion() ? 0 : 0.26;
916
+ let t3;
917
+ $[11] !== visualDuration ? (t3 = visualDuration ? {
899
918
  type: "spring",
900
919
  visualDuration,
901
920
  bounce: 0.25
902
921
  } : {
903
922
  duration: 0
904
- }, $[10] = visualDuration, $[11] = t1) : t1 = $[11];
905
- const transition = t1, hasDuration = duration && isFinite(duration) && duration < LONG_ENOUGH_BUT_NOT_TOO_LONG;
906
- let t2;
907
- $[12] === Symbol.for("react.memo_cache_sentinel") ? (t2 = ["hidden", "initial"], $[12] = t2) : t2 = $[12];
908
- const initial = t2;
909
- let t3;
910
- $[13] === Symbol.for("react.memo_cache_sentinel") ? (t3 = ["visible", "slideIn"], $[13] = t3) : t3 = $[13];
911
- const animate = t3;
923
+ }, $[11] = visualDuration, $[12] = t3) : t3 = $[12];
924
+ const transition = t3, hasDuration = duration && isFinite(duration) && duration < LONG_ENOUGH_BUT_NOT_TOO_LONG;
912
925
  let t4;
913
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "slideOut"], $[14] = t4) : t4 = $[14];
914
- const exit = t4;
926
+ $[13] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "initial"], $[13] = t4) : t4 = $[13];
927
+ const initial = t4;
915
928
  let t5;
916
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t5 = toast(), $[15] = t5) : t5 = $[15];
917
- const t6 = hasDuration ? "" : void 0;
929
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t5 = ["visible", "slideIn"], $[14] = t5) : t5 = $[14];
930
+ const animate = t5;
931
+ let t6;
932
+ $[15] === Symbol.for("react.memo_cache_sentinel") ? (t6 = ["hidden", "slideOut"], $[15] = t6) : t6 = $[15];
933
+ const exit = t6;
918
934
  let t7;
919
- $[16] !== title ? (t7 = title && /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: title }), $[16] = title, $[17] = t7) : t7 = $[17];
920
- let t8;
921
- $[18] !== description || $[19] !== transition ? (t8 = description && /* @__PURE__ */ jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description }), $[18] = description, $[19] = transition, $[20] = t8) : t8 = $[20];
935
+ $[16] === Symbol.for("react.memo_cache_sentinel") ? (t7 = toast(), $[16] = t7) : t7 = $[16];
936
+ const t8 = hasDuration ? "" : void 0;
922
937
  let t9;
923
- $[21] !== t7 || $[22] !== t8 ? (t9 = /* @__PURE__ */ jsx(Flex, { flex: 1, overflowX: "auto", padding: 3, children: /* @__PURE__ */ jsxs(Stack, { space: 3, children: [
924
- t7,
925
- t8
926
- ] }) }), $[21] = t7, $[22] = t8, $[23] = t9) : t9 = $[23];
938
+ $[17] !== title ? (t9 = title && /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: title }), $[17] = title, $[18] = t9) : t9 = $[18];
927
939
  let t10;
928
- $[24] !== buttonTone || $[25] !== closable || $[26] !== onClose ? (t10 = closable && /* @__PURE__ */ jsx(Box, { padding: 1, children: /* @__PURE__ */ jsx(Button, { as: "button", icon: CloseIcon, mode: "bleed", padding: 2, tone: buttonTone, onClick: onClose, style: {
929
- verticalAlign: "top"
930
- } }) }), $[24] = buttonTone, $[25] = closable, $[26] = onClose, $[27] = t10) : t10 = $[27];
940
+ $[19] !== description || $[20] !== transition ? (t10 = description && /* @__PURE__ */ jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description }), $[19] = description, $[20] = transition, $[21] = t10) : t10 = $[21];
931
941
  let t11;
932
- $[28] !== t10 || $[29] !== t9 || $[30] !== transition ? (t11 = /* @__PURE__ */ jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
942
+ $[22] !== t10 || $[23] !== t9 ? (t11 = /* @__PURE__ */ jsx(Flex, { flex: 1, overflowX: "auto", padding: 3, children: /* @__PURE__ */ jsxs(Stack, { space: 3, children: [
933
943
  t9,
934
944
  t10
935
- ] }), $[28] = t10, $[29] = t9, $[30] = transition, $[31] = t11) : t11 = $[31];
945
+ ] }) }), $[22] = t10, $[23] = t9, $[24] = t11) : t11 = $[24];
936
946
  let t12;
937
- $[32] !== cardTone || $[33] !== duration || $[34] !== hasDuration || $[35] !== onClose || $[36] !== radius || $[37] !== transition || $[38] !== updatedAt || $[39] !== visualDuration ? (t12 = hasDuration && /* @__PURE__ */ jsxs(MotionBox, { className: toastLoadingBar(), variants: content, transition, children: [
947
+ $[25] !== buttonTone || $[26] !== closable || $[27] !== onClose ? (t12 = closable && /* @__PURE__ */ jsx(Box, { padding: 1, children: /* @__PURE__ */ jsx(Button, { as: "button", icon: CloseIcon, mode: "bleed", padding: 2, tone: buttonTone, onClick: onClose, style: {
948
+ verticalAlign: "top"
949
+ } }) }), $[25] = buttonTone, $[26] = closable, $[27] = onClose, $[28] = t12) : t12 = $[28];
950
+ let t13;
951
+ $[29] !== t11 || $[30] !== t12 || $[31] !== transition ? (t13 = /* @__PURE__ */ jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
952
+ t11,
953
+ t12
954
+ ] }), $[29] = t11, $[30] = t12, $[31] = transition, $[32] = t13) : t13 = $[32];
955
+ let t14;
956
+ $[33] !== cardTone || $[34] !== duration || $[35] !== hasDuration || $[36] !== onClose || $[37] !== radius || $[38] !== transition || $[39] !== updatedAt || $[40] !== visualDuration ? (t14 = hasDuration && /* @__PURE__ */ jsxs(MotionBox, { className: toastLoadingBar(), variants: content, transition, children: [
938
957
  /* @__PURE__ */ jsx(Card, { className: toastLoadingBarMask(), tone: cardTone, radius }),
939
958
  /* @__PURE__ */ jsx(MotionCard, { className: toastLoadingBarProgress(), tone: cardTone, initial: {
940
959
  scaleX: 0
@@ -945,12 +964,12 @@ function Toast(props) {
945
964
  duration: duration / 1e3,
946
965
  ease: "linear"
947
966
  }, onAnimationComplete: onClose }, `progress-${updatedAt}`)
948
- ] }), $[32] = cardTone, $[33] = duration, $[34] = hasDuration, $[35] = onClose, $[36] = radius, $[37] = transition, $[38] = updatedAt, $[39] = visualDuration, $[40] = t12) : t12 = $[40];
949
- let t13;
950
- return $[41] !== cardTone || $[42] !== radius || $[43] !== restProps || $[44] !== role || $[45] !== t11 || $[46] !== t12 || $[47] !== t6 || $[48] !== transition || $[49] !== visualDuration ? (t13 = /* @__PURE__ */ jsxs(MotionCard, { as: "li", className: t5, "data-ui": "Toast", role, ...restProps, "data-has-duration": t6, custom: visualDuration, radius, shadow: 2, tone: cardTone, layout: "position", variants: container, initial, animate, exit, transition, position: "relative", children: [
951
- t11,
952
- t12
953
- ] }), $[41] = cardTone, $[42] = radius, $[43] = restProps, $[44] = role, $[45] = t11, $[46] = t12, $[47] = t6, $[48] = transition, $[49] = visualDuration, $[50] = t13) : t13 = $[50], t13;
967
+ ] }), $[33] = cardTone, $[34] = duration, $[35] = hasDuration, $[36] = onClose, $[37] = radius, $[38] = transition, $[39] = updatedAt, $[40] = visualDuration, $[41] = t14) : t14 = $[41];
968
+ let t15;
969
+ return $[42] !== as || $[43] !== cardTone || $[44] !== radius || $[45] !== rest || $[46] !== role || $[47] !== t13 || $[48] !== t14 || $[49] !== t8 || $[50] !== transition || $[51] !== visualDuration ? (t15 = /* @__PURE__ */ jsxs(MotionCard, { as, className: t7, "data-ui": "Toast", role, ...rest, "data-has-duration": t8, custom: visualDuration, radius, shadow: 2, tone: cardTone, layout: "position", variants: container, initial, animate, exit, transition, position: "relative", children: [
970
+ t13,
971
+ t14
972
+ ] }), $[42] = as, $[43] = cardTone, $[44] = radius, $[45] = rest, $[46] = role, $[47] = t13, $[48] = t14, $[49] = t8, $[50] = transition, $[51] = visualDuration, $[52] = t15) : t15 = $[52], t15;
954
973
  }
955
974
  Toast.displayName = "Toast";
956
975
  const container = {
@@ -992,34 +1011,35 @@ const container = {
992
1011
  }
993
1012
  }, MotionCard = motion.create(Card), MotionFlex = motion.create(Flex), MotionText = motion.create(Text), MotionBox = motion.create(Box);
994
1013
  function useMounted() {
995
- return useSyncExternalStore(subscribe, _temp$1, _temp2);
1014
+ return useSyncExternalStore(subscribe, _temp$2, _temp2$1);
996
1015
  }
997
- function _temp2() {
1016
+ function _temp2$1() {
998
1017
  return !1;
999
1018
  }
1000
- function _temp$1() {
1019
+ function _temp$2() {
1001
1020
  return !0;
1002
1021
  }
1003
1022
  const subscribe = () => () => {
1004
- }, ToastContext = createGlobalScopedContext("@sanity/ui/context/toast", null);
1023
+ }, ToastContext = createGlobalScopedContext("@sanity/ui/context/toast", null), DEFAULT_TOAST_LAYER_ELEMENT = "ul";
1005
1024
  function ToastLayer(props) {
1006
- const $ = c(10), {
1025
+ const $ = c(11), {
1026
+ as: t0,
1007
1027
  children,
1008
- padding: t0,
1028
+ padding: t1,
1009
1029
  paddingX,
1010
1030
  paddingY,
1011
- gap: t1
1012
- } = props, padding = t0 === void 0 ? 4 : t0, gap = t1 === void 0 ? 3 : t1, {
1031
+ gap: t2
1032
+ } = props, as = t0 === void 0 ? DEFAULT_TOAST_LAYER_ELEMENT : t0, padding = t1 === void 0 ? 4 : t1, gap = t2 === void 0 ? 3 : t2, {
1013
1033
  zIndex
1014
1034
  } = useLayer();
1015
- let t2;
1016
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = toastLayer(), $[0] = t2) : t2 = $[0];
1017
1035
  let t3;
1018
- $[1] !== zIndex ? (t3 = {
1019
- zIndex
1020
- }, $[1] = zIndex, $[2] = t3) : t3 = $[2];
1036
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t3 = toastLayer(), $[0] = t3) : t3 = $[0];
1021
1037
  let t4;
1022
- return $[3] !== children || $[4] !== gap || $[5] !== padding || $[6] !== paddingX || $[7] !== paddingY || $[8] !== t3 ? (t4 = /* @__PURE__ */ jsx(Grid, { as: "ul", className: t2, "data-ui": "ToastProvider", padding, paddingX, paddingY, gap, columns: 1, style: t3, children }), $[3] = children, $[4] = gap, $[5] = padding, $[6] = paddingX, $[7] = paddingY, $[8] = t3, $[9] = t4) : t4 = $[9], t4;
1038
+ $[1] !== zIndex ? (t4 = {
1039
+ zIndex
1040
+ }, $[1] = zIndex, $[2] = t4) : t4 = $[2];
1041
+ let t5;
1042
+ return $[3] !== as || $[4] !== children || $[5] !== gap || $[6] !== padding || $[7] !== paddingX || $[8] !== paddingY || $[9] !== t4 ? (t5 = /* @__PURE__ */ jsx(Grid, { as, className: t3, "data-ui": "ToastProvider", padding, paddingX, paddingY, gap, columns: 1, style: t4, children }), $[3] = as, $[4] = children, $[5] = gap, $[6] = padding, $[7] = paddingX, $[8] = paddingY, $[9] = t4, $[10] = t5) : t5 = $[10], t5;
1023
1043
  }
1024
1044
  ToastLayer.displayName = "ToastLayer";
1025
1045
  let toastId = 0;
@@ -1063,14 +1083,14 @@ function ToastProvider(props) {
1063
1083
  }, $[1] = t3) : t3 = $[1], t2 = t3;
1064
1084
  const value = t2;
1065
1085
  let t4;
1066
- $[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t4 = mounted && /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(_temp) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t4) : t4 = $[9];
1086
+ $[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t4 = mounted && /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(_temp$1) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t4) : t4 = $[9];
1067
1087
  let t5;
1068
1088
  return $[10] !== children || $[11] !== t4 ? (t5 = /* @__PURE__ */ jsxs(ToastContext.Provider, { value, children: [
1069
1089
  children,
1070
1090
  t4
1071
1091
  ] }), $[10] = children, $[11] = t4, $[12] = t5) : t5 = $[12], t5;
1072
1092
  }
1073
- function _temp(t0) {
1093
+ function _temp$1(t0) {
1074
1094
  const {
1075
1095
  dismiss: dismiss_0,
1076
1096
  id: id_0,
@@ -1142,38 +1162,40 @@ function _focusItemElement(el) {
1142
1162
  firstChild && firstChild instanceof HTMLElement && firstChild.focus();
1143
1163
  }
1144
1164
  }
1145
- const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null), Tree = memo(forwardRef(function(props, forwardedRef) {
1146
- const $ = c(38);
1147
- let children, gap, onFocus, restProps, t0;
1148
- $[0] !== props ? ({
1165
+ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null), DEFAULT_TREE_ELEMENT = "div";
1166
+ function Tree(props) {
1167
+ const $ = c(39), t0 = props;
1168
+ let children, forwardedRef, gap, onFocus, rest, t1;
1169
+ $[0] !== t0 ? ({
1149
1170
  children,
1150
1171
  gap,
1151
- space: t0,
1172
+ space: t1,
1152
1173
  onFocus,
1153
- ...restProps
1154
- } = props, $[0] = props, $[1] = children, $[2] = gap, $[3] = onFocus, $[4] = restProps, $[5] = t0) : (children = $[1], gap = $[2], onFocus = $[3], restProps = $[4], t0 = $[5]);
1155
- const space = t0 === void 0 ? 1 : t0, ref = useRef(null), [focusedElement, setFocusedElement] = useState(null), focusedElementRef = useRef(focusedElement);
1156
- let t1, t2;
1157
- $[6] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[6] = t2) : t2 = $[6], t1 = t2;
1158
- const path = t1;
1159
- let t3;
1160
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[7] = t3) : t3 = $[7];
1161
- const [itemElements, setItemElements] = useState(t3);
1174
+ ref: forwardedRef,
1175
+ ...rest
1176
+ } = t0, $[0] = t0, $[1] = children, $[2] = forwardedRef, $[3] = gap, $[4] = onFocus, $[5] = rest, $[6] = t1) : (children = $[1], forwardedRef = $[2], gap = $[3], onFocus = $[4], rest = $[5], t1 = $[6]);
1177
+ const space = t1 === void 0 ? 1 : t1, ref = useRef(null), [focusedElement, setFocusedElement] = useState(null), focusedElementRef = useRef(focusedElement);
1178
+ let t2, t3;
1179
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[7] = t3) : t3 = $[7], t2 = t3;
1180
+ const path = t2;
1162
1181
  let t4;
1163
- $[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = {}, $[8] = t4) : t4 = $[8];
1164
- const [state, setState] = useState(t4), stateRef = useRef(state);
1182
+ $[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = [], $[8] = t4) : t4 = $[8];
1183
+ const [itemElements, setItemElements] = useState(t4);
1165
1184
  let t5;
1166
- $[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[9] = t5) : t5 = $[9], useImperativeHandle(forwardedRef, t5);
1167
- let t6, t7;
1168
- $[10] !== focusedElement ? (t6 = () => {
1185
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 = {}, $[9] = t5) : t5 = $[9];
1186
+ const [state, setState] = useState(t5), stateRef = useRef(state);
1187
+ let t6;
1188
+ $[10] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[10] = t6) : t6 = $[10], useImperativeHandle(forwardedRef, t6);
1189
+ let t7, t8;
1190
+ $[11] !== focusedElement ? (t7 = () => {
1169
1191
  focusedElementRef.current = focusedElement;
1170
- }, t7 = [focusedElement], $[10] = focusedElement, $[11] = t6, $[12] = t7) : (t6 = $[11], t7 = $[12]), useEffect(t6, t7);
1171
- let t8, t9;
1172
- $[13] !== state ? (t8 = () => {
1192
+ }, t8 = [focusedElement], $[11] = focusedElement, $[12] = t7, $[13] = t8) : (t7 = $[12], t8 = $[13]), useEffect(t7, t8);
1193
+ let t10, t9;
1194
+ $[14] !== state ? (t9 = () => {
1173
1195
  stateRef.current = state;
1174
- }, t9 = [state], $[13] = state, $[14] = t8, $[15] = t9) : (t8 = $[14], t9 = $[15]), useEffect(t8, t9);
1175
- let t10;
1176
- $[16] === Symbol.for("react.memo_cache_sentinel") ? (t10 = (element, path_0, expanded, selected) => (setState((s) => ({
1196
+ }, t10 = [state], $[14] = state, $[15] = t10, $[16] = t9) : (t10 = $[15], t9 = $[16]), useEffect(t9, t10);
1197
+ let t11;
1198
+ $[17] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (element, path_0, expanded, selected) => (setState((s) => ({
1177
1199
  ...s,
1178
1200
  [path_0]: {
1179
1201
  element,
@@ -1186,10 +1208,10 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
1186
1208
  };
1187
1209
  return delete newState[path_0], newState;
1188
1210
  });
1189
- }), $[16] = t10) : t10 = $[16];
1190
- const registerItem = t10;
1191
- let t11;
1192
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (path_1, expanded_0) => {
1211
+ }), $[17] = t11) : t11 = $[17];
1212
+ const registerItem = t11;
1213
+ let t12;
1214
+ $[18] === Symbol.for("react.memo_cache_sentinel") ? (t12 = (path_1, expanded_0) => {
1193
1215
  setState((s_1) => {
1194
1216
  const itemState = s_1[path_1];
1195
1217
  return itemState ? {
@@ -1200,14 +1222,14 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
1200
1222
  }
1201
1223
  } : s_1;
1202
1224
  });
1203
- }, $[17] = t11) : t11 = $[17];
1204
- const setExpanded = t11;
1205
- let t12;
1206
- const t13 = focusedElement || itemElements[0] || null;
1207
- let t14;
1208
- $[18] !== space || $[19] !== state || $[20] !== t13 ? (t14 = {
1225
+ }, $[18] = t12) : t12 = $[18];
1226
+ const setExpanded = t12;
1227
+ let t13;
1228
+ const t14 = focusedElement || itemElements[0] || null;
1229
+ let t15;
1230
+ $[19] !== space || $[20] !== state || $[21] !== t14 ? (t15 = {
1209
1231
  version: 0,
1210
- focusedElement: t13,
1232
+ focusedElement: t14,
1211
1233
  level: 0,
1212
1234
  path,
1213
1235
  registerItem,
@@ -1215,10 +1237,10 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
1215
1237
  setFocusedElement,
1216
1238
  space,
1217
1239
  state
1218
- }, $[18] = space, $[19] = state, $[20] = t13, $[21] = t14) : t14 = $[21], t12 = t14;
1219
- const contextValue = t12;
1220
- let t15;
1221
- $[22] !== itemElements ? (t15 = (event) => {
1240
+ }, $[19] = space, $[20] = state, $[21] = t14, $[22] = t15) : t15 = $[22], t13 = t15;
1241
+ const contextValue = t13;
1242
+ let t16;
1243
+ $[23] !== itemElements ? (t16 = (event) => {
1222
1244
  if (focusedElementRef.current) {
1223
1245
  if (event.key === "ArrowDown") {
1224
1246
  event.preventDefault();
@@ -1277,29 +1299,29 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
1277
1299
  return;
1278
1300
  }
1279
1301
  }
1280
- }, $[22] = itemElements, $[23] = t15) : t15 = $[23];
1281
- const handleKeyDown = t15;
1282
- let t16;
1283
- $[24] !== onFocus ? (t16 = (event_0) => {
1284
- setFocusedElement(event_0.target), onFocus?.(event_0);
1285
- }, $[24] = onFocus, $[25] = t16) : t16 = $[25];
1286
- const handleFocus = t16;
1302
+ }, $[23] = itemElements, $[24] = t16) : t16 = $[24];
1303
+ const handleKeyDown = t16;
1287
1304
  let t17;
1288
- $[26] === Symbol.for("react.memo_cache_sentinel") ? (t17 = () => {
1305
+ $[25] !== onFocus ? (t17 = (event_0) => {
1306
+ setFocusedElement(event_0.target), onFocus?.(event_0);
1307
+ }, $[25] = onFocus, $[26] = t17) : t17 = $[26];
1308
+ const handleFocus = t17;
1309
+ let t18;
1310
+ $[27] === Symbol.for("react.memo_cache_sentinel") ? (t18 = () => {
1289
1311
  if (!ref.current)
1290
1312
  return;
1291
1313
  const _itemElements = Array.from(ref.current.querySelectorAll('[data-ui="TreeItem"]'));
1292
1314
  setItemElements(_itemElements);
1293
- }, $[26] = t17) : t17 = $[26];
1294
- let t18;
1295
- $[27] !== children ? (t18 = [children], $[27] = children, $[28] = t18) : t18 = $[28], useEffect(t17, t18);
1296
- const t19 = gap ?? space;
1297
- let t20;
1298
- $[29] !== children || $[30] !== handleFocus || $[31] !== handleKeyDown || $[32] !== restProps || $[33] !== t19 ? (t20 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "Tree", ...restProps, gap: t19, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", children }), $[29] = children, $[30] = handleFocus, $[31] = handleKeyDown, $[32] = restProps, $[33] = t19, $[34] = t20) : t20 = $[34];
1315
+ }, $[27] = t18) : t18 = $[27];
1316
+ let t19;
1317
+ $[28] !== children ? (t19 = [children], $[28] = children, $[29] = t19) : t19 = $[29], useEffect(t18, t19);
1318
+ const t20 = gap ?? space;
1299
1319
  let t21;
1300
- return $[35] !== contextValue || $[36] !== t20 ? (t21 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t20 }), $[35] = contextValue, $[36] = t20, $[37] = t21) : t21 = $[37], t21;
1301
- }));
1302
- Tree.displayName = "Memo(ForwardRef(Tree))";
1320
+ $[30] !== children || $[31] !== handleFocus || $[32] !== handleKeyDown || $[33] !== rest || $[34] !== t20 ? (t21 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "Tree", ...rest, gap: t20, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", children }), $[30] = children, $[31] = handleFocus, $[32] = handleKeyDown, $[33] = rest, $[34] = t20, $[35] = t21) : t21 = $[35];
1321
+ let t22;
1322
+ return $[36] !== contextValue || $[37] !== t21 ? (t22 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t21 }), $[36] = contextValue, $[37] = t21, $[38] = t22) : t22 = $[38], t22;
1323
+ }
1324
+ Tree.displayName = "Tree";
1303
1325
  function useTree() {
1304
1326
  const tree = useContext(TreeContext);
1305
1327
  if (!tree)
@@ -1307,17 +1329,20 @@ function useTree() {
1307
1329
  return tree;
1308
1330
  }
1309
1331
  const TreeGroup = memo(function(props) {
1310
- const $ = c(9);
1311
- let children, restProps, t0;
1312
- $[0] !== props ? ({
1332
+ const $ = c(9), t0 = props;
1333
+ let children, rest, t1;
1334
+ $[0] !== t0 ? ({
1313
1335
  children,
1314
- expanded: t0,
1315
- ...restProps
1316
- } = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0) : (children = $[1], restProps = $[2], t0 = $[3]);
1317
- const expanded = t0 === void 0 ? !1 : t0, tree = useTree(), t1 = !expanded;
1318
- let t2;
1319
- return $[4] !== children || $[5] !== restProps || $[6] !== t1 || $[7] !== tree.space ? (t2 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "TreeGroup", ...restProps, hidden: t1, marginTop: tree.space, role: "group", space: tree.space, children }), $[4] = children, $[5] = restProps, $[6] = t1, $[7] = tree.space, $[8] = t2) : t2 = $[8], t2;
1320
- }), TreeItem = memo(function(props) {
1336
+ expanded: t1,
1337
+ ...rest
1338
+ } = t0, $[0] = t0, $[1] = children, $[2] = rest, $[3] = t1) : (children = $[1], rest = $[2], t1 = $[3]);
1339
+ const expanded = t1 === void 0 ? !1 : t1, tree = useTree(), t2 = !expanded;
1340
+ let t3;
1341
+ return $[4] !== children || $[5] !== rest || $[6] !== t2 || $[7] !== tree.space ? (t3 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "TreeGroup", ...rest, hidden: t2, marginTop: tree.space, role: "group", gap: tree.space, children }), $[4] = children, $[5] = rest, $[6] = t2, $[7] = tree.space, $[8] = t3) : t3 = $[8], t3;
1342
+ });
1343
+ TreeGroup.displayName = "TreeGroup";
1344
+ const DEFAULT_TREE_ITEM_ELEMENT = "a";
1345
+ function TreeItem(props) {
1321
1346
  const {
1322
1347
  children,
1323
1348
  className,
@@ -1335,7 +1360,7 @@ const TreeGroup = memo(function(props) {
1335
1360
  space = 2,
1336
1361
  text,
1337
1362
  weight,
1338
- ...restProps
1363
+ ...rest
1339
1364
  } = props, rootRef = useRef(null), treeitemRef = useRef(null), tree = useTree(), {
1340
1365
  path,
1341
1366
  registerItem,
@@ -1368,19 +1393,51 @@ const TreeGroup = memo(function(props) {
1368
1393
  ] }),
1369
1394
  /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) })
1370
1395
  ] });
1371
- return href ? /* @__PURE__ */ jsxs(Box, { "data-selected": selected ? "" : void 0, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...restProps, as: "li", className: composeClassNames(className, treeItem()), onClick: handleClick, ref: rootRef, role: "none", children: [
1396
+ return href ? /* @__PURE__ */ jsxs(Box, { "data-selected": selected ? "" : void 0, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...rest, as: "li", className: composeClassNames(className, treeItem()), onClick: handleClick, ref: rootRef, role: "none", children: [
1372
1397
  /* @__PURE__ */ jsx(Selectable, { "aria-expanded": expanded, as: linkAs, "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", href, radius, ref: treeitemRef, role: "treeitem", tabIndex, style: {
1373
1398
  paddingLeft: `calc(var(--space-2) * ${tree.level})`
1374
1399
  }, children: content2 }),
1375
1400
  /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }) })
1376
- ] }) : /* @__PURE__ */ jsxs(Box, { "data-selected": selected ? "" : void 0, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...restProps, "aria-expanded": expanded, className: composeClassNames(className, treeItem()), onClick: handleClick, onKeyDown: handleKeyDown, ref: rootRef, role: "treeitem", tabIndex, children: [
1401
+ ] }) : /* @__PURE__ */ jsxs(Box, { "data-selected": selected ? "" : void 0, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...rest, "aria-expanded": expanded, className: composeClassNames(className, treeItem()), onClick: handleClick, onKeyDown: handleKeyDown, ref: rootRef, role: "treeitem", tabIndex, children: [
1377
1402
  /* @__PURE__ */ jsx(Selectable, { as: "button", "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", radius, style: {
1378
1403
  paddingLeft: `calc(var(--space-2) * ${tree.level})`
1379
1404
  }, children: content2 }),
1380
1405
  /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }) })
1381
1406
  ] });
1382
- });
1383
- TreeItem.displayName = "Memo(TreeItem)";
1407
+ }
1408
+ TreeItem.displayName = "TreeItem";
1409
+ function RootClassNames(props) {
1410
+ const $ = c(7), {
1411
+ element
1412
+ } = props, {
1413
+ scheme,
1414
+ tone
1415
+ } = useCard() ?? {};
1416
+ let t0;
1417
+ $[0] !== scheme || $[1] !== tone ? (t0 = () => {
1418
+ const els = document.querySelectorAll([scopeClassName("button"), scopeClassName("card"), scopeClassName("font")].map(_temp).join(", "));
1419
+ for (const el of els)
1420
+ el instanceof HTMLElement && (el.style.transition = "none");
1421
+ return _raf2(() => {
1422
+ document.documentElement.className = card({
1423
+ scheme,
1424
+ tone
1425
+ }) ?? "", _raf2(() => {
1426
+ for (const el_0 of els)
1427
+ el_0 instanceof HTMLElement && (el_0.style.transition = "");
1428
+ });
1429
+ }), _temp2;
1430
+ }, $[0] = scheme, $[1] = tone, $[2] = t0) : t0 = $[2];
1431
+ let t1;
1432
+ return $[3] !== element || $[4] !== scheme || $[5] !== tone ? (t1 = [element, scheme, tone], $[3] = element, $[4] = scheme, $[5] = tone, $[6] = t1) : t1 = $[6], useEffect(t0, t1), null;
1433
+ }
1434
+ function _temp2() {
1435
+ document.documentElement.className = "";
1436
+ }
1437
+ function _temp(n) {
1438
+ return `.${n}`;
1439
+ }
1440
+ RootClassNames.displayName = "RootClassNames";
1384
1441
  function StyleTags(props) {
1385
1442
  const $ = c(10), {
1386
1443
  theme: themeProp
@@ -1405,6 +1462,7 @@ function StyleTags(props) {
1405
1462
  t4
1406
1463
  ] }), $[8] = t3, $[9] = t5) : t5 = $[9], t5;
1407
1464
  }
1465
+ StyleTags.displayName = "StyleTags";
1408
1466
  export {
1409
1467
  Arrow,
1410
1468
  Autocomplete,
@@ -1421,8 +1479,57 @@ export {
1421
1479
  Checkbox,
1422
1480
  Code,
1423
1481
  CodeSkeleton,
1424
- ConditionalWrapper,
1425
1482
  Container,
1483
+ DEFAULT_ARROW_ELEMENT,
1484
+ DEFAULT_AUTOCOMPLETE_ELEMENT,
1485
+ DEFAULT_AVATAR_COUNTER_ELEMENT,
1486
+ DEFAULT_AVATAR_ELEMENT,
1487
+ DEFAULT_AVATAR_STACK_ELEMENT,
1488
+ DEFAULT_BADGE_ELEMENT,
1489
+ DEFAULT_BOX_ELEMENT,
1490
+ DEFAULT_BREADCRUMBS_ELEMENT,
1491
+ DEFAULT_BUTTON_ELEMENT,
1492
+ DEFAULT_CARD_ELEMENT,
1493
+ DEFAULT_CHECKBOX_ELEMENT,
1494
+ DEFAULT_CODE_ELEMENT,
1495
+ DEFAULT_CODE_SKELETON_ELEMENT,
1496
+ DEFAULT_CONTAINER_ELEMENT,
1497
+ DEFAULT_DIALOG_ELEMENT,
1498
+ DEFAULT_ELEMENT_QUERY_ELEMENT,
1499
+ DEFAULT_FLEX_ELEMENT,
1500
+ DEFAULT_GRID_ELEMENT,
1501
+ DEFAULT_HEADING_ELEMENT,
1502
+ DEFAULT_HEADING_SKELETON_ELEMENT,
1503
+ DEFAULT_HOTKEYS_ELEMENT,
1504
+ DEFAULT_INLINE_ELEMENT,
1505
+ DEFAULT_KBD_ELEMENT,
1506
+ DEFAULT_LABEL_ELEMENT,
1507
+ DEFAULT_LABEL_SKELETON_ELEMENT,
1508
+ DEFAULT_LAYER_ELEMENT,
1509
+ DEFAULT_MENU_DIVIDER_ELEMENT,
1510
+ DEFAULT_MENU_ELEMENT,
1511
+ DEFAULT_MENU_GROUP_ELEMENT,
1512
+ DEFAULT_MENU_ITEM_ELEMENT,
1513
+ DEFAULT_POPOVER_ELEMENT,
1514
+ DEFAULT_RADIO_ELEMENT,
1515
+ DEFAULT_SELECT_ELEMENT,
1516
+ DEFAULT_SKELETON_ELEMENT,
1517
+ DEFAULT_SPINNER_ELEMENT,
1518
+ DEFAULT_SR_ONLY_ELEMENT,
1519
+ DEFAULT_STACK_ELEMENT,
1520
+ DEFAULT_SWITCH_ELEMENT,
1521
+ DEFAULT_TAB_ELEMENT,
1522
+ DEFAULT_TAB_LIST_ELEMENT,
1523
+ DEFAULT_TAB_PANEL_ELEMENT,
1524
+ DEFAULT_TEXT_AREA_ELEMENT,
1525
+ DEFAULT_TEXT_ELEMENT,
1526
+ DEFAULT_TEXT_INPUT_ELEMENT,
1527
+ DEFAULT_TEXT_SKELETON_ELEMENT,
1528
+ DEFAULT_TOAST_ELEMENT,
1529
+ DEFAULT_TOOLTIP_ELEMENT,
1530
+ DEFAULT_TREE_ELEMENT,
1531
+ DEFAULT_TREE_ITEM_ELEMENT,
1532
+ DEFAULT_VIRTUAL_LIST_ELEMENT,
1426
1533
  Dialog,
1427
1534
  DialogContext,
1428
1535
  DialogProvider,
@@ -1448,6 +1555,7 @@ export {
1448
1555
  Portal,
1449
1556
  PortalProvider,
1450
1557
  Radio,
1558
+ RootClassNames,
1451
1559
  Select,
1452
1560
  Skeleton,
1453
1561
  Spinner,