@sanity/ui 3.0.0-static.11 → 3.0.0-static.13

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 (251) hide show
  1. package/dist/_chunks-cjs/_visual-editing.js +1293 -1215
  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 +1284 -1202
  6. package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
  7. package/dist/_visual-editing.d.mts +528 -358
  8. package/dist/_visual-editing.d.ts +528 -358
  9. package/dist/cli.js +1 -1
  10. package/dist/css.d.mts +143 -73
  11. package/dist/css.d.ts +143 -73
  12. package/dist/css.js +329 -472
  13. package/dist/css.js.map +1 -1
  14. package/dist/css.mjs +330 -473
  15. package/dist/css.mjs.map +1 -1
  16. package/dist/index.d.mts +1362 -869
  17. package/dist/index.d.ts +1362 -869
  18. package/dist/index.js +383 -308
  19. package/dist/index.js.map +1 -1
  20. package/dist/index.mjs +387 -312
  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 -21946
  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 +9 -9
  31. package/dist/theme.js.map +1 -1
  32. package/dist/theme.mjs +9 -9
  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/{system.style.ts → _system.style.ts} +3 -2
  39. package/src/css/aspects/display/display.ts +1 -0
  40. package/src/css/aspects/display/types.ts +2 -3
  41. package/src/css/aspects/flex/types.ts +4 -12
  42. package/src/css/aspects/flexItem/types.ts +1 -3
  43. package/src/css/aspects/font/types.ts +1 -3
  44. package/src/css/aspects/grid/grid.ts +1 -0
  45. package/src/css/aspects/grid/types.ts +5 -9
  46. package/src/css/aspects/gridItem/gridItem.ts +1 -1
  47. package/src/css/aspects/gridItem/types.ts +7 -18
  48. package/src/css/aspects/height/height.ts +3 -4
  49. package/src/css/aspects/inset/inset.ts +1 -0
  50. package/src/css/aspects/margin/margin.ts +1 -0
  51. package/src/css/aspects/margin/types.ts +1 -0
  52. package/src/css/aspects/maxWidth/maxWidth.ts +1 -0
  53. package/src/css/aspects/maxWidth/types.ts +1 -0
  54. package/src/css/aspects/minWidth/minWidth.ts +1 -0
  55. package/src/css/aspects/minWidth/types.ts +2 -0
  56. package/src/css/aspects/overflow/overflow.ts +1 -0
  57. package/src/css/aspects/padding/padding.ts +1 -0
  58. package/src/css/aspects/pointerEvents/pointerEvents.ts +1 -0
  59. package/src/css/aspects/position/position.ts +1 -0
  60. package/src/css/aspects/shadow/shadow.ts +1 -0
  61. package/src/css/aspects/textOverflow/textOverflow.ts +1 -0
  62. package/src/css/aspects/textOverflow/types.ts +1 -0
  63. package/src/css/aspects/width/types.ts +2 -0
  64. package/src/css/aspects/width/width.ts +1 -0
  65. package/src/css/{compile/compilePalette.ts → compilePalette.ts} +14 -10
  66. package/src/css/compileSystem.ts +7 -0
  67. package/src/css/{compile/compileTheme.ts → compileTheme.ts} +1 -0
  68. package/src/css/{compile/compileTheme_v3.ts → compileTheme_v3.ts} +123 -104
  69. package/src/css/components/breadcrumbs/breadcrumbs.ts +1 -0
  70. package/src/css/components/dialog/dialog.ts +7 -0
  71. package/src/css/components/menu/menu.ts +2 -0
  72. package/src/css/components/skeleton/skeleton.ts +4 -0
  73. package/src/css/components/skeleton/types.ts +4 -0
  74. package/src/css/components/toast/toast.ts +5 -0
  75. package/src/css/components/tree/tree.ts +1 -0
  76. package/src/css/composeClassNames.ts +4 -2
  77. package/src/css/constants.ts +2 -0
  78. package/src/css/index.ts +3 -3
  79. package/src/css/primitives/_arrow/_arrow.ts +3 -0
  80. package/src/css/primitives/_input/input.ts +2 -0
  81. package/src/css/primitives/_selectable/_selectable.style.ts +1 -2
  82. package/src/css/primitives/_selectable/selectable.ts +1 -2
  83. package/src/css/primitives/avatar/avatar.style.ts +5 -8
  84. package/src/css/primitives/avatar/avatar.ts +6 -0
  85. package/src/css/primitives/avatar/types.ts +1 -0
  86. package/src/css/primitives/box/types.ts +1 -3
  87. package/src/css/primitives/button/button.ts +4 -21
  88. package/src/css/primitives/button/index.ts +1 -0
  89. package/src/css/primitives/button/types.ts +18 -0
  90. package/src/css/primitives/card/card.style.ts +3 -6
  91. package/src/css/primitives/card/card.ts +2 -2
  92. package/src/css/primitives/card/types.ts +2 -2
  93. package/src/css/primitives/checkbox/checkbox.ts +2 -0
  94. package/src/css/primitives/container/container.ts +1 -0
  95. package/src/css/primitives/container/types.ts +1 -0
  96. package/src/css/primitives/kbd/kbd.ts +1 -0
  97. package/src/css/primitives/label/types.ts +7 -2
  98. package/src/css/primitives/popover/popover.ts +2 -0
  99. package/src/css/primitives/radio/radio.ts +1 -0
  100. package/src/css/primitives/select/select.ts +2 -0
  101. package/src/css/primitives/spinner/spinner.ts +2 -0
  102. package/src/css/primitives/switch/switch.ts +5 -0
  103. package/src/css/primitives/text/types.ts +4 -0
  104. package/src/css/primitives/textArea/textArea.ts +1 -0
  105. package/src/css/primitives/textInput/textInput.ts +1 -0
  106. package/src/css/primitives/tooltip/tooltip.ts +2 -0
  107. package/src/css/scopeClassName.ts +1 -0
  108. package/src/css/types.ts +9 -12
  109. package/src/css/util.ts +5 -0
  110. package/src/css/utils/srOnly/srOnly.ts +3 -1
  111. package/src/css/varNames.ts +131 -141
  112. package/src/css/vars.ts +1 -6
  113. package/src/theme/palette/constants.ts +2 -0
  114. package/src/theme/palette/types.ts +3 -0
  115. package/src/theme/types.ts +2 -6
  116. package/src/theme/v0/focusRing.ts +1 -3
  117. package/src/theme/v0/font.ts +6 -18
  118. package/src/theme/v0/layer.ts +1 -3
  119. package/src/theme/v0/shadow.ts +2 -6
  120. package/src/theme/v2/avatar.ts +1 -3
  121. package/src/theme/v2/color/_system.ts +1 -3
  122. package/src/theme/v2/color/avatar.ts +2 -6
  123. package/src/theme/v2/color/badge.ts +2 -6
  124. package/src/theme/v2/color/button.ts +3 -9
  125. package/src/theme/v2/color/color.ts +3 -9
  126. package/src/theme/v2/color/input.ts +3 -9
  127. package/src/theme/v2/color/kbd.ts +1 -3
  128. package/src/theme/v2/color/selectable.ts +2 -6
  129. package/src/theme/v2/color/state.ts +1 -3
  130. package/src/theme/v2/color/syntax.ts +1 -3
  131. package/src/theme/v2/input.ts +1 -3
  132. package/src/theme/v2/theme.ts +2 -6
  133. package/src/theme/v3/buildTheme_v3.ts +1 -0
  134. package/src/theme/v3/color/color.ts +6 -4
  135. package/src/theme/v3/color/renderColor.ts +4 -1
  136. package/src/theme/v3/defaultTokens.ts +1 -0
  137. package/src/theme/v3/resolveTokens.ts +9 -9
  138. package/src/ui/RootClassNames.tsx +3 -0
  139. package/src/ui/StyleTags.tsx +3 -1
  140. package/src/ui/_compat/theme/themeColorProvider.tsx +2 -6
  141. package/src/ui/_compat/theme/themeProvider.tsx +2 -6
  142. package/src/ui/_compat/theme/types.ts +1 -3
  143. package/src/ui/_compat/theme/useRootTheme.ts +1 -3
  144. package/src/ui/_compat/theme/useTheme.ts +2 -6
  145. package/src/ui/components/autocomplete/__workshop__/constrainedHeight.tsx +2 -2
  146. package/src/ui/components/autocomplete/autocomplete.tsx +86 -114
  147. package/src/ui/components/autocomplete/autocompleteOption.tsx +2 -0
  148. package/src/ui/components/autocomplete/types.ts +3 -8
  149. package/src/ui/components/breadcrumbs/breadcrumbs.tsx +27 -21
  150. package/src/ui/components/dialog/dialog.tsx +89 -291
  151. package/src/ui/components/dialog/dialogCard.tsx +183 -0
  152. package/src/ui/components/dialog/isTargetWithinScope.ts +14 -0
  153. package/src/ui/components/hotkeys/hotkeys.tsx +33 -15
  154. package/src/ui/components/menu/__workshop__/asComponent.tsx +6 -6
  155. package/src/ui/components/menu/menu.tsx +27 -33
  156. package/src/ui/components/menu/menuButton.tsx +10 -14
  157. package/src/ui/components/menu/menuDivider.tsx +25 -13
  158. package/src/ui/components/menu/menuGroup.tsx +34 -26
  159. package/src/ui/components/menu/menuItem.tsx +51 -40
  160. package/src/ui/components/skeleton/codeSkeleton.tsx +53 -0
  161. package/src/ui/components/skeleton/headingSkeleton.tsx +52 -0
  162. package/src/ui/components/skeleton/index.ts +3 -0
  163. package/src/ui/components/skeleton/labelSkeleton.tsx +51 -0
  164. package/src/ui/components/skeleton/skeleton.tsx +39 -16
  165. package/src/ui/components/skeleton/textSkeleton.tsx +31 -110
  166. package/src/ui/components/tab/tab.tsx +23 -19
  167. package/src/ui/components/tab/tabList.tsx +34 -33
  168. package/src/ui/components/tab/tabPanel.tsx +25 -19
  169. package/src/ui/components/toast/toast.tsx +21 -16
  170. package/src/ui/components/toast/toastLayer.tsx +28 -10
  171. package/src/ui/components/toast/toastProvider.tsx +2 -6
  172. package/src/ui/components/toast/types.ts +2 -6
  173. package/src/ui/components/toast/useToast.ts +1 -3
  174. package/src/ui/components/tree/tree.tsx +194 -187
  175. package/src/ui/components/tree/treeGroup.tsx +25 -5
  176. package/src/ui/components/tree/treeItem.tsx +35 -23
  177. package/src/ui/hooks/useClickOutside.ts +2 -6
  178. package/src/ui/hooks/useClickOutsideEvent.ts +3 -9
  179. package/src/ui/primitives/_selectable/selectable.tsx +33 -20
  180. package/src/ui/primitives/avatar/avatar.tsx +28 -31
  181. package/src/ui/primitives/avatar/avatarCounter.tsx +33 -25
  182. package/src/ui/primitives/avatar/avatarStack.tsx +31 -24
  183. package/src/ui/primitives/avatar/types.ts +2 -0
  184. package/src/ui/primitives/badge/__workshop__/props.tsx +1 -9
  185. package/src/ui/primitives/badge/__workshop__/tones.tsx +1 -6
  186. package/src/ui/primitives/badge/badge.tsx +33 -32
  187. package/src/ui/primitives/badge/types.ts +2 -1
  188. package/src/ui/primitives/box/box.tsx +59 -29
  189. package/src/ui/primitives/button/__workshop__/sanityUploadButton.tsx +3 -3
  190. package/src/ui/primitives/button/__workshop__/uploadButton.tsx +2 -1
  191. package/src/ui/primitives/button/button.test.tsx +1 -15
  192. package/src/ui/primitives/button/button.tsx +64 -70
  193. package/src/ui/primitives/card/__workshop__/asComponent.tsx +3 -3
  194. package/src/ui/primitives/card/card.tsx +22 -22
  195. package/src/ui/primitives/card/cardProvider.tsx +2 -0
  196. package/src/ui/primitives/checkbox/checkbox.tsx +26 -15
  197. package/src/ui/primitives/code/code.tsx +24 -22
  198. package/src/ui/primitives/container/container.tsx +26 -15
  199. package/src/ui/primitives/flex/flex.tsx +21 -19
  200. package/src/ui/primitives/grid/grid.tsx +21 -16
  201. package/src/ui/primitives/heading/heading.tsx +42 -19
  202. package/src/ui/primitives/inline/inline.tsx +26 -23
  203. package/src/ui/primitives/kbd/kbd.tsx +25 -23
  204. package/src/ui/primitives/label/label.tsx +41 -26
  205. package/src/ui/primitives/popover/popover.tsx +281 -277
  206. package/src/ui/primitives/popover/popoverCard.tsx +119 -118
  207. package/src/ui/primitives/radio/radio.tsx +30 -14
  208. package/src/ui/primitives/select/select.tsx +24 -16
  209. package/src/ui/primitives/spinner/animatedSpinnerIcon.tsx +4 -2
  210. package/src/ui/primitives/spinner/spinner.tsx +24 -12
  211. package/src/ui/primitives/stack/stack.tsx +27 -18
  212. package/src/ui/primitives/switch/switch.tsx +31 -14
  213. package/src/ui/primitives/text/text.tsx +42 -24
  214. package/src/ui/primitives/textArea/textArea.tsx +33 -18
  215. package/src/ui/primitives/textInput/textInput.tsx +28 -40
  216. package/src/ui/primitives/tooltip/constants.ts +1 -1
  217. package/src/ui/primitives/tooltip/tooltip.tsx +76 -59
  218. package/src/ui/primitives/tooltip/tooltipCard.tsx +89 -82
  219. package/src/ui/primitives/types.ts +1 -3
  220. package/src/ui/types/avatar.ts +3 -6
  221. package/src/ui/types/badge.ts +1 -3
  222. package/src/ui/types/button.ts +1 -3
  223. package/src/ui/types/card.ts +1 -3
  224. package/src/ui/types/dialog.ts +1 -3
  225. package/src/ui/types/props.ts +20 -10
  226. package/src/ui/utils/arrow/arrow.tsx +40 -14
  227. package/src/ui/utils/boundaryElement/boundaryElementProvider.tsx +2 -6
  228. package/src/ui/utils/boundaryElement/types.ts +1 -3
  229. package/src/ui/utils/boundaryElement/useBoundaryElement.ts +1 -3
  230. package/src/ui/utils/elementQuery/elementQuery.tsx +36 -14
  231. package/src/ui/utils/errorBoundary.tsx +2 -0
  232. package/src/ui/utils/index.ts +0 -1
  233. package/src/ui/utils/layer/layer.tsx +23 -93
  234. package/src/ui/utils/layer/layerCard.tsx +92 -0
  235. package/src/ui/utils/layer/layerProvider.tsx +2 -6
  236. package/src/ui/utils/layer/useLayer.ts +1 -3
  237. package/src/ui/utils/portal/portal.ts +2 -6
  238. package/src/ui/utils/portal/portalProvider.tsx +2 -6
  239. package/src/ui/utils/portal/types.ts +1 -3
  240. package/src/ui/utils/portal/usePortal.ts +1 -3
  241. package/src/ui/utils/srOnly/srOnly.tsx +25 -20
  242. package/src/ui/utils/virtualList/virtualList.tsx +36 -24
  243. package/src/css/compile/compileRule.ts +0 -97
  244. package/src/css/compile/compileRules.test.ts +0 -36
  245. package/src/css/compile/compileRules.ts +0 -43
  246. package/src/css/compile/compileSystem.ts +0 -7
  247. package/src/css/compile/types.ts +0 -6
  248. package/src/css/primitives/_selectable/_contants.ts +0 -11
  249. package/src/css/primitives/card/_constants.ts +0 -13
  250. package/src/ui/utils/conditionalWrapper/conditionalWrapper.tsx +0 -23
  251. package/src/ui/utils/conditionalWrapper/index.ts +0 -1
package/dist/index.mjs CHANGED
@@ -1,11 +1,11 @@
1
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 { 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, useCard } from "./_chunks-es/_visual-editing.mjs";
3
- 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, studioTheme, useCustomValidity, useMatchMedia, useMediaIndex, usePrefersDark, useRootTheme, useTheme, useTheme_v2, useTooltipDelayGroup } from "./_chunks-es/_visual-editing.mjs";
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";
4
4
  import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
5
5
  import { ChevronDownIcon, CloseIcon, ToggleArrowRightIcon } from "@sanity/icons";
6
- 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";
7
7
  import { c } from "react-compiler-runtime";
8
- import { composeClassNames, breadcrumbs, dialogContainer, dialogCardRoot, dialogLayout, dialogHeader, dialogContent, dialogFooter, dialog, skeleton, textSkeleton, labelSkeleton, headingSkeleton, codeSkeleton, toast, toastLoadingBar, toastLoadingBarMask, toastLoadingBarProgress, toastLayer, treeItem, scopeClassName, card, compilePalette, compileTheme, compileSystem } from "@sanity/ui/css";
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
9
  import { px, rem } from "@sanity/ui/css";
10
10
  import { motion, AnimatePresence } from "framer-motion";
11
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;
@@ -119,6 +119,7 @@ class ErrorBoundary extends Component {
119
119
  state = {
120
120
  error: null
121
121
  };
122
+ static displayName = "ErrorBoundary";
122
123
  static getDerivedStateFromError(error) {
123
124
  return {
124
125
  error
@@ -164,6 +165,7 @@ function AutocompleteOption(props) {
164
165
  let t2;
165
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;
166
167
  }
168
+ AutocompleteOption.displayName = "AutocompleteOption";
167
169
  function autocompleteReducer(state, msg) {
168
170
  return msg.type === "input/change" ? {
169
171
  ...state,
@@ -203,8 +205,10 @@ function autocompleteReducer(state, msg) {
203
205
  value: msg.value
204
206
  } : state;
205
207
  }
206
- 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) {
207
210
  const {
211
+ as = DEFAULT_AUTOCOMPLETE_ELEMENT,
208
212
  border = !0,
209
213
  customValidity,
210
214
  disabled,
@@ -227,13 +231,14 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
227
231
  prefix,
228
232
  radius = 2,
229
233
  readOnly,
234
+ ref: forwardedRef,
230
235
  relatedElements,
231
236
  renderOption: renderOptionProp,
232
237
  renderPopover,
233
238
  renderValue = DEFAULT_RENDER_VALUE,
234
239
  suffix,
235
240
  value: valueProp,
236
- ...restProps
241
+ ...rest
237
242
  } = props, [state, dispatch] = useReducer(autocompleteReducer, {
238
243
  activeValue: valueProp || null,
239
244
  focused: !1,
@@ -376,7 +381,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
376
381
  };
377
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) => {
378
383
  dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
379
- }, [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) => {
380
385
  event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
381
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) => {
382
387
  const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
@@ -399,10 +404,12 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
399
404
  results
400
405
  ] })
401
406
  );
402
- });
403
- InnerAutocomplete.displayName = "ForwardRef(Autocomplete)";
404
- const Autocomplete = InnerAutocomplete, Breadcrumbs = forwardRef(function(props, ref) {
407
+ }
408
+ Autocomplete.displayName = "Autocomplete";
409
+ const DEFAULT_BREADCRUMBS_ELEMENT = "nav";
410
+ function Breadcrumbs(props) {
405
411
  const {
412
+ as = DEFAULT_BREADCRUMBS_ELEMENT,
406
413
  children,
407
414
  className,
408
415
  expandButton: expandButtonProps,
@@ -414,7 +421,7 @@ const Autocomplete = InnerAutocomplete, Breadcrumbs = forwardRef(function(props,
414
421
  separator,
415
422
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
416
423
  space: _spaceProp,
417
- ...restProps
424
+ ...rest
418
425
  } = props, [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null), collapse = useCallback(() => setOpen(!1), []), expand = useCallback(() => setOpen(!0), []);
419
426
  useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
420
427
  const rawItems = useMemo(() => Children.toArray(children).filter(isValidElement), [children]), items = useMemo(() => {
@@ -425,25 +432,23 @@ const Autocomplete = InnerAutocomplete, Breadcrumbs = forwardRef(function(props,
425
432
  }
426
433
  return rawItems;
427
434
  }, [collapse, expand, expandButtonProps, gapY, maxLength, open, rawItems]);
428
- 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: [
429
436
  itemIndex > 0 && /* @__PURE__ */ jsx(Box, { "aria-hidden": !0, as: "li", children: separator || /* @__PURE__ */ jsx(Text, { muted: !0, children: "/" }) }),
430
437
  /* @__PURE__ */ jsx(Box, { as: "li", children: item })
431
438
  ] }, itemIndex)) });
432
- });
433
- Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
434
- const DialogContext = createGlobalScopedContext("@sanity/ui/context/dialog", {
435
- version: 0
436
- });
437
- function useDialog() {
438
- return useContext(DialogContext);
439
439
  }
440
+ Breadcrumbs.displayName = "Breadcrumbs";
440
441
  function isTargetWithinScope(boundaryElement, portalElement, target) {
441
442
  return !boundaryElement || !portalElement ? !0 : containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
442
443
  }
443
- const DialogCard = forwardRef(function(props, forwardedRef) {
444
- 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 ? ({
445
449
  __unstable_autoFocus: autoFocus,
446
450
  __unstable_hideCloseButton: hideCloseButton,
451
+ as: t1,
447
452
  children,
448
453
  contentRef: forwardedContentRef,
449
454
  footer,
@@ -452,73 +457,74 @@ const DialogCard = forwardRef(function(props, forwardedRef) {
452
457
  onClickOutside,
453
458
  onClose,
454
459
  portal: portalProp,
455
- radius: radiusProp,
456
- scheme,
457
- shadow: t0,
458
- tone,
459
- width: widthProp
460
- } = 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(), {
461
464
  isTopLayer
462
465
  } = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton;
463
- let t1;
464
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => ref.current, $[0] = t1) : t1 = $[0], useImperativeHandle(forwardedRef, t1);
465
466
  let t2;
466
- $[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => contentRef.current, $[1] = t2) : t2 = $[1], useImperativeHandle(forwardedContentRef, t2);
467
- let t3, t4;
468
- $[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 = () => {
469
472
  autoFocus && ref.current && focusFirstDescendant(ref.current);
470
- }, t4 = [autoFocus, ref], $[2] = autoFocus, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), useEffect(t3, t4);
471
- let t5;
472
- $[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) => {
473
476
  if (!isTopLayer || !onClose)
474
477
  return;
475
478
  const target = document.activeElement;
476
479
  target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
477
- }, $[5] = boundaryElement, $[6] = isTopLayer, $[7] = onClose, $[8] = portalElement, $[9] = t5) : t5 = $[9], useGlobalKeyDown(t5);
478
- let t6;
479
- $[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) => {
480
483
  const target_0 = event_0.target;
481
484
  target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
482
- }), $[10] = boundaryElement, $[11] = isTopLayer, $[12] = onClickOutside, $[13] = portalElement, $[14] = t6) : t6 = $[14];
483
- let t7;
484
- $[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];
485
486
  let t8;
486
- $[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);
487
488
  let t9;
488
- $[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];
489
490
  let t10;
490
- $[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];
491
492
  let t11;
492
- $[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: [
493
494
  /* @__PURE__ */ jsx(Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsx(Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
494
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 }) })
495
- ] }) }), $[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];
496
497
  let t12;
497
- $[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];
498
499
  let t13;
499
- $[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];
500
501
  let t14;
501
- $[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];
502
503
  let t15;
503
- $[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: [
504
505
  t11,
505
506
  t13,
506
507
  t14
507
- ] }), $[30] = t11, $[31] = t13, $[32] = t14, $[33] = t15) : t15 = $[33];
508
+ ] }), $[43] = t11, $[44] = t13, $[45] = t14, $[46] = t15) : t15 = $[46];
508
509
  let t16;
509
- $[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];
510
- let t17;
511
- 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
512
515
  });
513
- DialogCard.displayName = "ForwardRef(DialogCard)";
514
- const Dialog = forwardRef(function(props, ref) {
515
- const $ = c(66), context = useDialog();
516
- let _positionProp, _zOffsetProp, cardShadow, children, className, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5, tone;
517
- $[0] !== props ? ({
518
- __unstable_autoFocus: t0,
519
- __unstable_hideCloseButton: t1,
520
- animate: t2,
521
- 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,
522
528
  children,
523
529
  className,
524
530
  contentRef,
@@ -529,19 +535,19 @@ const Dialog = forwardRef(function(props, ref) {
529
535
  onClickOutside,
530
536
  onClose,
531
537
  onFocus,
532
- padding: t4,
538
+ padding: t5,
533
539
  portal: portalProp,
534
540
  position: _positionProp,
535
541
  scheme,
536
- shadow: cardShadow,
537
- width: t5,
542
+ shadow: t6,
543
+ width: t7,
538
544
  zOffset: _zOffsetProp,
539
545
  tone,
540
- ...restProps
541
- } = 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]);
542
- 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);
543
- let t6;
544
- $[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) => {
545
551
  onFocus?.(event);
546
552
  const target = event.target, cardElement = cardRef.current;
547
553
  if (cardElement && target === preDivRef.current) {
@@ -553,10 +559,10 @@ const Dialog = forwardRef(function(props, ref) {
553
559
  return;
554
560
  }
555
561
  isHTMLElement(event.target) && (focusedElementRef.current = event.target);
556
- }, $[24] = onFocus, $[25] = t6) : t6 = $[25];
557
- const handleFocus = t6, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0);
558
- let t7;
559
- $[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 = () => {
560
566
  rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
561
567
  const activeElement = document.activeElement;
562
568
  if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
@@ -569,27 +575,31 @@ const Dialog = forwardRef(function(props, ref) {
569
575
  target_0.focus();
570
576
  }
571
577
  }, 0);
572
- }, $[26] = boundaryElement, $[27] = portalElement, $[28] = t7) : t7 = $[28];
573
- const handleRootClick = t7;
574
- let t8;
575
- $[29] !== className ? (t8 = composeClassNames(className, dialog()), $[29] = className, $[30] = t8) : t8 = $[30];
576
- const t9 = animate ? "" : void 0;
578
+ }, $[26] = boundaryElement, $[27] = portalElement, $[28] = t9) : t9 = $[28];
579
+ const handleRootClick = t9;
577
580
  let t10;
578
- $[31] === Symbol.for("react.memo_cache_sentinel") ? (t10 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[31] = t10) : t10 = $[31];
579
- let t11;
580
- $[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;
581
583
  let t12;
582
- $[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];
583
585
  let t13;
584
- $[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: [
585
- t10,
586
- t11,
587
- t12
588
- ] }), $[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];
589
587
  let t14;
590
- return $[63] !== portalProp || $[64] !== t13 ? (t14 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t13 }), $[63] = portalProp, $[64] = t13, $[65] = t14) : t14 = $[65], t14;
591
- });
592
- 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";
593
603
  function DialogProvider(props) {
594
604
  const $ = c(6), {
595
605
  children,
@@ -607,7 +617,7 @@ function DialogProvider(props) {
607
617
  return $[3] !== children || $[4] !== contextValue ? (t2 = /* @__PURE__ */ jsx(DialogContext.Provider, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t2) : t2 = $[5], t2;
608
618
  }
609
619
  DialogProvider.displayName = "DialogProvider";
610
- const MenuButton = forwardRef(function(props, forwardedRef) {
620
+ function MenuButton(props) {
611
621
  const $ = c(63), {
612
622
  __unstable_disableRestoreFocusOnClose: t0,
613
623
  boundaryElement: deprecated_boundaryElement,
@@ -621,7 +631,8 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
621
631
  portal: t1,
622
632
  popover,
623
633
  popoverRadius: deprecated_popoverRadius,
624
- preventOverflow: deprecated_preventOverflow
634
+ preventOverflow: deprecated_preventOverflow,
635
+ ref: forwardedRef
625
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);
626
637
  let t2;
627
638
  $[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
@@ -748,24 +759,25 @@ const MenuButton = forwardRef(function(props, forwardedRef) {
748
759
  $[56] !== button ? (t24 = button || /* @__PURE__ */ jsx(Fragment$1, {}), $[56] = button, $[57] = t24) : t24 = $[57];
749
760
  let t25;
750
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;
751
- });
752
- MenuButton.displayName = "ForwardRef(MenuButton)";
762
+ }
753
763
  function _temp$3(v) {
754
764
  return !v;
755
765
  }
756
- const Skeleton = forwardRef(function(props, ref) {
757
- const $ = c(18);
758
- let className, delay, radius, restProps, t0;
759
- $[0] !== props ? ({
760
- 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,
761
773
  className,
762
774
  delay,
763
775
  radius,
764
- ...restProps
765
- } = props, $[0] = props, $[1] = className, $[2] = delay, $[3] = radius, $[4] = restProps, $[5] = t0) : (className = $[1], delay = $[2], radius = $[3], restProps = $[4], t0 = $[5]);
766
- const animated = t0 === void 0 ? !1 : t0, [visible, setVisible] = useState(!delay);
767
- let t1, t2;
768
- $[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 = () => {
769
781
  if (!delay)
770
782
  return setVisible(!0);
771
783
  const timeout = setTimeout(() => {
@@ -774,97 +786,102 @@ const Skeleton = forwardRef(function(props, ref) {
774
786
  return () => {
775
787
  clearTimeout(timeout);
776
788
  };
777
- }, t2 = [delay], $[6] = delay, $[7] = t1, $[8] = t2) : (t1 = $[7], t2 = $[8]), useEffect(t1, t2);
778
- let t3;
779
- $[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({
780
792
  radius
781
- })), $[9] = className, $[10] = radius, $[11] = t3) : t3 = $[11];
782
- const t4 = animated ? "" : void 0, t5 = visible ? "" : void 0;
783
- let t6;
784
- 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;
785
- });
786
- Skeleton.displayName = "ForwardRef(Skeleton)";
787
- const TextSkeleton = forwardRef(function(props, ref) {
788
- const $ = c(11);
789
- let className, restProps, t0;
790
- $[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 ? ({
791
804
  className,
792
- size: t0,
793
- ...restProps
794
- } = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
795
- const size = t0 === void 0 ? 2 : t0;
796
- let t1;
797
- $[4] !== className || $[5] !== size ? (t1 = composeClassNames(className, textSkeleton({
798
- size
799
- })), $[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;
800
809
  let t2;
801
- 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;
802
- });
803
- TextSkeleton.displayName = "ForwardRef(TextSkeleton)";
804
- const LabelSkeleton = forwardRef(function(props, ref) {
805
- const $ = c(11);
806
- let className, restProps, t0;
807
- $[0] !== props ? ({
808
- className,
809
- size: t0,
810
- ...restProps
811
- } = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
812
- const size = t0 === void 0 ? 2 : t0;
813
- let t1;
814
- $[4] !== className || $[5] !== size ? (t1 = composeClassNames(className, labelSkeleton({
810
+ $[4] !== className || $[5] !== size ? (t2 = composeClassNames(className, codeSkeleton({
815
811
  size
816
- })), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
817
- let t2;
818
- 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;
819
- });
820
- LabelSkeleton.displayName = "ForwardRef(LabelSkeleton)";
821
- const HeadingSkeleton = forwardRef(function(props, ref) {
822
- const $ = c(11);
823
- let className, restProps, t0;
824
- $[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 ? ({
825
822
  className,
826
- size: t0,
827
- ...restProps
828
- } = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
829
- const size = t0 === void 0 ? 2 : t0;
830
- let t1;
831
- $[4] !== className || $[5] !== size ? (t1 = composeClassNames(className, headingSkeleton({
832
- size
833
- })), $[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;
834
827
  let t2;
835
- 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;
836
- });
837
- HeadingSkeleton.displayName = "ForwardRef(HeadingSkeleton)";
838
- const CodeSkeleton = forwardRef(function(props, ref) {
839
- const $ = c(11);
840
- let className, restProps, t0;
841
- $[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 ? ({
842
840
  className,
843
- size: t0,
844
- ...restProps
845
- } = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
846
- const size = t0 === void 0 ? 2 : t0;
847
- let t1;
848
- $[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({
849
847
  size
850
- })), $[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;
851
863
  let t2;
852
- 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;
853
- });
854
- CodeSkeleton.displayName = "ForwardRef(CodeSkeleton)";
855
- const TabPanel = forwardRef(function(props, ref) {
856
- const $ = c(9);
857
- let flex, restProps;
858
- $[0] !== props ? ({
859
- flex,
860
- ...restProps
861
- } = props, $[0] = props, $[1] = flex, $[2] = restProps) : (flex = $[1], restProps = $[2]);
862
- const t0 = props.tabIndex === void 0 ? 0 : props.tabIndex;
863
- let t1;
864
- 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;
865
- });
866
- TabPanel.displayName = "ForwardRef(TabPanel)";
867
- 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 = {
868
885
  error: "alert",
869
886
  warning: "alert",
870
887
  success: "alert",
@@ -881,61 +898,62 @@ const ROLES = {
881
898
  info: "neutral"
882
899
  }, LONG_ENOUGH_BUT_NOT_TOO_LONG = 1e3 * 60 * 60 * 24 * 24;
883
900
  function Toast(props) {
884
- const $ = c(51);
885
- let closable, description, duration, onClose, restProps, status, t0, title, updatedAt;
886
- $[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,
887
905
  closable,
888
906
  description,
889
907
  duration,
890
908
  onClose,
891
- radius: t0,
909
+ radius: t2,
892
910
  title,
893
911
  status,
894
912
  updatedAt,
895
- ...restProps
896
- } = 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]);
897
- 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;
898
- let t1;
899
- $[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 ? {
900
918
  type: "spring",
901
919
  visualDuration,
902
920
  bounce: 0.25
903
921
  } : {
904
922
  duration: 0
905
- }, $[10] = visualDuration, $[11] = t1) : t1 = $[11];
906
- const transition = t1, hasDuration = duration && isFinite(duration) && duration < LONG_ENOUGH_BUT_NOT_TOO_LONG;
907
- let t2;
908
- $[12] === Symbol.for("react.memo_cache_sentinel") ? (t2 = ["hidden", "initial"], $[12] = t2) : t2 = $[12];
909
- const initial = t2;
910
- let t3;
911
- $[13] === Symbol.for("react.memo_cache_sentinel") ? (t3 = ["visible", "slideIn"], $[13] = t3) : t3 = $[13];
912
- 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;
913
925
  let t4;
914
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "slideOut"], $[14] = t4) : t4 = $[14];
915
- const exit = t4;
926
+ $[13] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "initial"], $[13] = t4) : t4 = $[13];
927
+ const initial = t4;
916
928
  let t5;
917
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t5 = toast(), $[15] = t5) : t5 = $[15];
918
- 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;
919
934
  let t7;
920
- $[16] !== title ? (t7 = title && /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: title }), $[16] = title, $[17] = t7) : t7 = $[17];
921
- let t8;
922
- $[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;
923
937
  let t9;
924
- $[21] !== t7 || $[22] !== t8 ? (t9 = /* @__PURE__ */ jsx(Flex, { flex: 1, overflowX: "auto", padding: 3, children: /* @__PURE__ */ jsxs(Stack, { space: 3, children: [
925
- t7,
926
- t8
927
- ] }) }), $[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];
928
939
  let t10;
929
- $[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: {
930
- verticalAlign: "top"
931
- } }) }), $[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];
932
941
  let t11;
933
- $[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: [
934
943
  t9,
935
944
  t10
936
- ] }), $[28] = t10, $[29] = t9, $[30] = transition, $[31] = t11) : t11 = $[31];
945
+ ] }) }), $[22] = t10, $[23] = t9, $[24] = t11) : t11 = $[24];
937
946
  let t12;
938
- $[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: [
939
957
  /* @__PURE__ */ jsx(Card, { className: toastLoadingBarMask(), tone: cardTone, radius }),
940
958
  /* @__PURE__ */ jsx(MotionCard, { className: toastLoadingBarProgress(), tone: cardTone, initial: {
941
959
  scaleX: 0
@@ -946,12 +964,12 @@ function Toast(props) {
946
964
  duration: duration / 1e3,
947
965
  ease: "linear"
948
966
  }, onAnimationComplete: onClose }, `progress-${updatedAt}`)
949
- ] }), $[32] = cardTone, $[33] = duration, $[34] = hasDuration, $[35] = onClose, $[36] = radius, $[37] = transition, $[38] = updatedAt, $[39] = visualDuration, $[40] = t12) : t12 = $[40];
950
- let t13;
951
- 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: [
952
- t11,
953
- t12
954
- ] }), $[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;
955
973
  }
956
974
  Toast.displayName = "Toast";
957
975
  const container = {
@@ -1002,25 +1020,26 @@ function _temp$2() {
1002
1020
  return !0;
1003
1021
  }
1004
1022
  const subscribe = () => () => {
1005
- }, ToastContext = createGlobalScopedContext("@sanity/ui/context/toast", null);
1023
+ }, ToastContext = createGlobalScopedContext("@sanity/ui/context/toast", null), DEFAULT_TOAST_LAYER_ELEMENT = "ul";
1006
1024
  function ToastLayer(props) {
1007
- const $ = c(10), {
1025
+ const $ = c(11), {
1026
+ as: t0,
1008
1027
  children,
1009
- padding: t0,
1028
+ padding: t1,
1010
1029
  paddingX,
1011
1030
  paddingY,
1012
- gap: t1
1013
- } = 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, {
1014
1033
  zIndex
1015
1034
  } = useLayer();
1016
- let t2;
1017
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = toastLayer(), $[0] = t2) : t2 = $[0];
1018
1035
  let t3;
1019
- $[1] !== zIndex ? (t3 = {
1020
- zIndex
1021
- }, $[1] = zIndex, $[2] = t3) : t3 = $[2];
1036
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t3 = toastLayer(), $[0] = t3) : t3 = $[0];
1022
1037
  let t4;
1023
- 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;
1024
1043
  }
1025
1044
  ToastLayer.displayName = "ToastLayer";
1026
1045
  let toastId = 0;
@@ -1143,38 +1162,40 @@ function _focusItemElement(el) {
1143
1162
  firstChild && firstChild instanceof HTMLElement && firstChild.focus();
1144
1163
  }
1145
1164
  }
1146
- const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null), Tree = memo(forwardRef(function(props, forwardedRef) {
1147
- const $ = c(38);
1148
- let children, gap, onFocus, restProps, t0;
1149
- $[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 ? ({
1150
1170
  children,
1151
1171
  gap,
1152
- space: t0,
1172
+ space: t1,
1153
1173
  onFocus,
1154
- ...restProps
1155
- } = props, $[0] = props, $[1] = children, $[2] = gap, $[3] = onFocus, $[4] = restProps, $[5] = t0) : (children = $[1], gap = $[2], onFocus = $[3], restProps = $[4], t0 = $[5]);
1156
- const space = t0 === void 0 ? 1 : t0, ref = useRef(null), [focusedElement, setFocusedElement] = useState(null), focusedElementRef = useRef(focusedElement);
1157
- let t1, t2;
1158
- $[6] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[6] = t2) : t2 = $[6], t1 = t2;
1159
- const path = t1;
1160
- let t3;
1161
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[7] = t3) : t3 = $[7];
1162
- 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;
1163
1181
  let t4;
1164
- $[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = {}, $[8] = t4) : t4 = $[8];
1165
- 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);
1166
1184
  let t5;
1167
- $[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[9] = t5) : t5 = $[9], useImperativeHandle(forwardedRef, t5);
1168
- let t6, t7;
1169
- $[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 = () => {
1170
1191
  focusedElementRef.current = focusedElement;
1171
- }, t7 = [focusedElement], $[10] = focusedElement, $[11] = t6, $[12] = t7) : (t6 = $[11], t7 = $[12]), useEffect(t6, t7);
1172
- let t8, t9;
1173
- $[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 = () => {
1174
1195
  stateRef.current = state;
1175
- }, t9 = [state], $[13] = state, $[14] = t8, $[15] = t9) : (t8 = $[14], t9 = $[15]), useEffect(t8, t9);
1176
- let t10;
1177
- $[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) => ({
1178
1199
  ...s,
1179
1200
  [path_0]: {
1180
1201
  element,
@@ -1187,10 +1208,10 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
1187
1208
  };
1188
1209
  return delete newState[path_0], newState;
1189
1210
  });
1190
- }), $[16] = t10) : t10 = $[16];
1191
- const registerItem = t10;
1192
- let t11;
1193
- $[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) => {
1194
1215
  setState((s_1) => {
1195
1216
  const itemState = s_1[path_1];
1196
1217
  return itemState ? {
@@ -1201,14 +1222,14 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
1201
1222
  }
1202
1223
  } : s_1;
1203
1224
  });
1204
- }, $[17] = t11) : t11 = $[17];
1205
- const setExpanded = t11;
1206
- let t12;
1207
- const t13 = focusedElement || itemElements[0] || null;
1208
- let t14;
1209
- $[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 = {
1210
1231
  version: 0,
1211
- focusedElement: t13,
1232
+ focusedElement: t14,
1212
1233
  level: 0,
1213
1234
  path,
1214
1235
  registerItem,
@@ -1216,10 +1237,10 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
1216
1237
  setFocusedElement,
1217
1238
  space,
1218
1239
  state
1219
- }, $[18] = space, $[19] = state, $[20] = t13, $[21] = t14) : t14 = $[21], t12 = t14;
1220
- const contextValue = t12;
1221
- let t15;
1222
- $[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) => {
1223
1244
  if (focusedElementRef.current) {
1224
1245
  if (event.key === "ArrowDown") {
1225
1246
  event.preventDefault();
@@ -1278,29 +1299,29 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
1278
1299
  return;
1279
1300
  }
1280
1301
  }
1281
- }, $[22] = itemElements, $[23] = t15) : t15 = $[23];
1282
- const handleKeyDown = t15;
1283
- let t16;
1284
- $[24] !== onFocus ? (t16 = (event_0) => {
1285
- setFocusedElement(event_0.target), onFocus?.(event_0);
1286
- }, $[24] = onFocus, $[25] = t16) : t16 = $[25];
1287
- const handleFocus = t16;
1302
+ }, $[23] = itemElements, $[24] = t16) : t16 = $[24];
1303
+ const handleKeyDown = t16;
1288
1304
  let t17;
1289
- $[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 = () => {
1290
1311
  if (!ref.current)
1291
1312
  return;
1292
1313
  const _itemElements = Array.from(ref.current.querySelectorAll('[data-ui="TreeItem"]'));
1293
1314
  setItemElements(_itemElements);
1294
- }, $[26] = t17) : t17 = $[26];
1295
- let t18;
1296
- $[27] !== children ? (t18 = [children], $[27] = children, $[28] = t18) : t18 = $[28], useEffect(t17, t18);
1297
- const t19 = gap ?? space;
1298
- let t20;
1299
- $[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;
1300
1319
  let t21;
1301
- return $[35] !== contextValue || $[36] !== t20 ? (t21 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t20 }), $[35] = contextValue, $[36] = t20, $[37] = t21) : t21 = $[37], t21;
1302
- }));
1303
- 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";
1304
1325
  function useTree() {
1305
1326
  const tree = useContext(TreeContext);
1306
1327
  if (!tree)
@@ -1308,17 +1329,20 @@ function useTree() {
1308
1329
  return tree;
1309
1330
  }
1310
1331
  const TreeGroup = memo(function(props) {
1311
- const $ = c(9);
1312
- let children, restProps, t0;
1313
- $[0] !== props ? ({
1332
+ const $ = c(9), t0 = props;
1333
+ let children, rest, t1;
1334
+ $[0] !== t0 ? ({
1314
1335
  children,
1315
- expanded: t0,
1316
- ...restProps
1317
- } = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0) : (children = $[1], restProps = $[2], t0 = $[3]);
1318
- const expanded = t0 === void 0 ? !1 : t0, tree = useTree(), t1 = !expanded;
1319
- let t2;
1320
- 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;
1321
- }), 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) {
1322
1346
  const {
1323
1347
  children,
1324
1348
  className,
@@ -1336,7 +1360,7 @@ const TreeGroup = memo(function(props) {
1336
1360
  space = 2,
1337
1361
  text,
1338
1362
  weight,
1339
- ...restProps
1363
+ ...rest
1340
1364
  } = props, rootRef = useRef(null), treeitemRef = useRef(null), tree = useTree(), {
1341
1365
  path,
1342
1366
  registerItem,
@@ -1369,19 +1393,19 @@ const TreeGroup = memo(function(props) {
1369
1393
  ] }),
1370
1394
  /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) })
1371
1395
  ] });
1372
- 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: [
1373
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: {
1374
1398
  paddingLeft: `calc(var(--space-2) * ${tree.level})`
1375
1399
  }, children: content2 }),
1376
1400
  /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }) })
1377
- ] }) : /* @__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: [
1378
1402
  /* @__PURE__ */ jsx(Selectable, { as: "button", "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", radius, style: {
1379
1403
  paddingLeft: `calc(var(--space-2) * ${tree.level})`
1380
1404
  }, children: content2 }),
1381
1405
  /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }) })
1382
1406
  ] });
1383
- });
1384
- TreeItem.displayName = "Memo(TreeItem)";
1407
+ }
1408
+ TreeItem.displayName = "TreeItem";
1385
1409
  function RootClassNames(props) {
1386
1410
  const $ = c(7), {
1387
1411
  element
@@ -1413,6 +1437,7 @@ function _temp2() {
1413
1437
  function _temp(n) {
1414
1438
  return `.${n}`;
1415
1439
  }
1440
+ RootClassNames.displayName = "RootClassNames";
1416
1441
  function StyleTags(props) {
1417
1442
  const $ = c(10), {
1418
1443
  theme: themeProp
@@ -1437,6 +1462,7 @@ function StyleTags(props) {
1437
1462
  t4
1438
1463
  ] }), $[8] = t3, $[9] = t5) : t5 = $[9], t5;
1439
1464
  }
1465
+ StyleTags.displayName = "StyleTags";
1440
1466
  export {
1441
1467
  Arrow,
1442
1468
  Autocomplete,
@@ -1453,8 +1479,57 @@ export {
1453
1479
  Checkbox,
1454
1480
  Code,
1455
1481
  CodeSkeleton,
1456
- ConditionalWrapper,
1457
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,
1458
1533
  Dialog,
1459
1534
  DialogContext,
1460
1535
  DialogProvider,