@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.js CHANGED
@@ -112,6 +112,7 @@ class ErrorBoundary extends react.Component {
112
112
  state = {
113
113
  error: null
114
114
  };
115
+ static displayName = "ErrorBoundary";
115
116
  static getDerivedStateFromError(error) {
116
117
  return {
117
118
  error
@@ -157,6 +158,7 @@ function AutocompleteOption(props) {
157
158
  let t2;
158
159
  return $[5] !== children || $[6] !== handleClick || $[7] !== handleKeyDown || $[8] !== id || $[9] !== selected ? (t2 = /* @__PURE__ */ jsxRuntime.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;
159
160
  }
161
+ AutocompleteOption.displayName = "AutocompleteOption";
160
162
  function autocompleteReducer(state, msg) {
161
163
  return msg.type === "input/change" ? {
162
164
  ...state,
@@ -196,8 +198,10 @@ function autocompleteReducer(state, msg) {
196
198
  value: msg.value
197
199
  } : state;
198
200
  }
199
- 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 = react.forwardRef(function(props, forwardedRef) {
201
+ 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;
202
+ function Autocomplete(props) {
200
203
  const {
204
+ as = DEFAULT_AUTOCOMPLETE_ELEMENT,
201
205
  border = !0,
202
206
  customValidity,
203
207
  disabled,
@@ -220,13 +224,14 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
220
224
  prefix,
221
225
  radius = 2,
222
226
  readOnly,
227
+ ref: forwardedRef,
223
228
  relatedElements,
224
229
  renderOption: renderOptionProp,
225
230
  renderPopover,
226
231
  renderValue = DEFAULT_RENDER_VALUE,
227
232
  suffix,
228
233
  value: valueProp,
229
- ...restProps
234
+ ...rest
230
235
  } = props, [state, dispatch] = react.useReducer(autocompleteReducer, {
231
236
  activeValue: valueProp || null,
232
237
  focused: !1,
@@ -369,7 +374,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
369
374
  };
370
375
  }, [disabled, handleClearButtonFocus, loading, value]), openButtonBoxPadding = react.useMemo(() => padding.map((v_0) => v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2), [padding]), openButtonPadding = react.useMemo(() => padding.map((v_1) => Math.max(v_1 - 1, 0)), [padding]), openButtonProps = react.useMemo(() => typeof openButton == "object" ? openButton : _visualEditing.EMPTY_RECORD, [openButton]), handleOpenClick = react.useCallback((event_4) => {
371
376
  dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
372
- }, [openButtonProps, dispatchOpen]), openButtonNode = react.useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { "aria-label": "Open", disabled: expanded, display: "block", fontSize, icon: icons.ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, [disabled, expanded, fontSize, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]), inputValue = react.useMemo(() => query === null ? value !== null ? renderValue(value, currentOption) : "" : query, [currentOption, query, renderValue, value]), input = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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 && _visualEditing.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 = react.useCallback((event_5) => {
377
+ }, [openButtonProps, dispatchOpen]), openButtonNode = react.useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { "aria-label": "Open", disabled: expanded, display: "block", fontSize, icon: icons.ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, [disabled, expanded, fontSize, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]), inputValue = react.useMemo(() => query === null ? value !== null ? renderValue(value, currentOption) : "" : query, [currentOption, query, renderValue, value]), input = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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 && _visualEditing.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 = react.useCallback((event_5) => {
373
378
  event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
374
379
  }, [listFocused]), content2 = react.useMemo(() => filteredOptions.length === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", id: listBoxId, ref: listBoxElementRef, role: "listbox", space: 1, children: filteredOptions.map((option_0) => {
375
380
  const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
@@ -392,10 +397,12 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
392
397
  results
393
398
  ] })
394
399
  );
395
- });
396
- InnerAutocomplete.displayName = "ForwardRef(Autocomplete)";
397
- const Autocomplete = InnerAutocomplete, Breadcrumbs = react.forwardRef(function(props, ref) {
400
+ }
401
+ Autocomplete.displayName = "Autocomplete";
402
+ const DEFAULT_BREADCRUMBS_ELEMENT = "nav";
403
+ function Breadcrumbs(props) {
398
404
  const {
405
+ as = DEFAULT_BREADCRUMBS_ELEMENT,
399
406
  children,
400
407
  className,
401
408
  expandButton: expandButtonProps,
@@ -407,7 +414,7 @@ const Autocomplete = InnerAutocomplete, Breadcrumbs = react.forwardRef(function(
407
414
  separator,
408
415
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
409
416
  space: _spaceProp,
410
- ...restProps
417
+ ...rest
411
418
  } = props, [open, setOpen] = react.useState(!1), expandElementRef = react.useRef(null), popoverElementRef = react.useRef(null), collapse = react.useCallback(() => setOpen(!1), []), expand = react.useCallback(() => setOpen(!0), []);
412
419
  _visualEditing.useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
413
420
  const rawItems = react.useMemo(() => react.Children.toArray(children).filter(react.isValidElement), [children]), items = react.useMemo(() => {
@@ -418,25 +425,23 @@ const Autocomplete = InnerAutocomplete, Breadcrumbs = react.forwardRef(function(
418
425
  }
419
426
  return rawItems;
420
427
  }, [collapse, expand, expandButtonProps, gapY, maxLength, open, rawItems]);
421
- return /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Flex, { as: "nav", "data-ui": "Breadcrumbs", ...restProps, className: css.composeClassNames(className, css.breadcrumbs()), gapX, gapY, ref, children: items.map((item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
428
+ return /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Flex, { as, "data-ui": "Breadcrumbs", ...rest, className: css.composeClassNames(className, css.breadcrumbs()), gapX, gapY, children: items.map((item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
422
429
  itemIndex > 0 && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": !0, as: "li", children: separator || /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted: !0, children: "/" }) }),
423
430
  /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { as: "li", children: item })
424
431
  ] }, itemIndex)) });
425
- });
426
- Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
427
- const DialogContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/dialog", {
428
- version: 0
429
- });
430
- function useDialog() {
431
- return react.useContext(DialogContext);
432
432
  }
433
+ Breadcrumbs.displayName = "Breadcrumbs";
433
434
  function isTargetWithinScope(boundaryElement, portalElement, target) {
434
435
  return !boundaryElement || !portalElement ? !0 : _visualEditing.containsOrEqualsElement(boundaryElement, target) || _visualEditing.containsOrEqualsElement(portalElement, target);
435
436
  }
436
- const DialogCard = react.forwardRef(function(props, forwardedRef) {
437
- const $ = reactCompilerRuntime.c(43), {
437
+ const DEFAULT_DIALOG_CARD_ELEMENT = "div";
438
+ function DialogCard(props) {
439
+ const $ = reactCompilerRuntime.c(51), t0 = props;
440
+ let autoFocus, children, footer, forwardedContentRef, forwardedRef, header, hideCloseButton, id, onClickOutside, onClose, portalProp, rest, t1;
441
+ $[0] !== t0 ? ({
438
442
  __unstable_autoFocus: autoFocus,
439
443
  __unstable_hideCloseButton: hideCloseButton,
444
+ as: t1,
440
445
  children,
441
446
  contentRef: forwardedContentRef,
442
447
  footer,
@@ -445,73 +450,74 @@ const DialogCard = react.forwardRef(function(props, forwardedRef) {
445
450
  onClickOutside,
446
451
  onClose,
447
452
  portal: portalProp,
448
- radius: radiusProp,
449
- scheme,
450
- shadow: t0,
451
- tone,
452
- width: widthProp
453
- } = props, shadowProp = t0 === void 0 ? 4 : t0, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element, radius = _visualEditing.useArrayProp(radiusProp), shadow = _visualEditing.useArrayProp(shadowProp), width = _visualEditing.useArrayProp(widthProp), ref = react.useRef(null), contentRef = react.useRef(null), layer = _visualEditing.useLayer(), {
453
+ ref: forwardedRef,
454
+ ...rest
455
+ } = 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]);
456
+ const as = t1 === void 0 ? DEFAULT_DIALOG_CARD_ELEMENT : t1, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element, ref = react.useRef(null), contentRef = react.useRef(null), layer = _visualEditing.useLayer(), {
454
457
  isTopLayer
455
458
  } = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton;
456
- let t1;
457
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => ref.current, $[0] = t1) : t1 = $[0], react.useImperativeHandle(forwardedRef, t1);
458
459
  let t2;
459
- $[1] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => contentRef.current, $[1] = t2) : t2 = $[1], react.useImperativeHandle(forwardedContentRef, t2);
460
- let t3, t4;
461
- $[2] !== autoFocus ? (t3 = () => {
460
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[14] = t2) : t2 = $[14], react.useImperativeHandle(forwardedRef, t2);
461
+ let t3;
462
+ $[15] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => contentRef.current, $[15] = t3) : t3 = $[15], react.useImperativeHandle(forwardedContentRef, t3);
463
+ let t4, t5;
464
+ $[16] !== autoFocus ? (t4 = () => {
462
465
  autoFocus && ref.current && focusFirstDescendant(ref.current);
463
- }, t4 = [autoFocus, ref], $[2] = autoFocus, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), react.useEffect(t3, t4);
464
- let t5;
465
- $[5] !== boundaryElement || $[6] !== isTopLayer || $[7] !== onClose || $[8] !== portalElement ? (t5 = (event) => {
466
+ }, t5 = [autoFocus, ref], $[16] = autoFocus, $[17] = t4, $[18] = t5) : (t4 = $[17], t5 = $[18]), react.useEffect(t4, t5);
467
+ let t6;
468
+ $[19] !== boundaryElement || $[20] !== isTopLayer || $[21] !== onClose || $[22] !== portalElement ? (t6 = (event) => {
466
469
  if (!isTopLayer || !onClose)
467
470
  return;
468
471
  const target = document.activeElement;
469
472
  target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
470
- }, $[5] = boundaryElement, $[6] = isTopLayer, $[7] = onClose, $[8] = portalElement, $[9] = t5) : t5 = $[9], _visualEditing.useGlobalKeyDown(t5);
471
- let t6;
472
- $[10] !== boundaryElement || $[11] !== isTopLayer || $[12] !== onClickOutside || $[13] !== portalElement ? (t6 = isTopLayer && onClickOutside && ((event_0) => {
473
+ }, $[19] = boundaryElement, $[20] = isTopLayer, $[21] = onClose, $[22] = portalElement, $[23] = t6) : t6 = $[23], _visualEditing.useGlobalKeyDown(t6);
474
+ let t7;
475
+ $[24] !== boundaryElement || $[25] !== isTopLayer || $[26] !== onClickOutside || $[27] !== portalElement ? (t7 = isTopLayer && onClickOutside && ((event_0) => {
473
476
  const target_0 = event_0.target;
474
477
  target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
475
- }), $[10] = boundaryElement, $[11] = isTopLayer, $[12] = onClickOutside, $[13] = portalElement, $[14] = t6) : t6 = $[14];
476
- let t7;
477
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t7 = () => [ref.current], $[15] = t7) : t7 = $[15], _visualEditing.useClickOutsideEvent(t6, t7);
478
+ }), $[24] = boundaryElement, $[25] = isTopLayer, $[26] = onClickOutside, $[27] = portalElement, $[28] = t7) : t7 = $[28];
478
479
  let t8;
479
- $[16] === Symbol.for("react.memo_cache_sentinel") ? (t8 = css.dialogContainer(), $[16] = t8) : t8 = $[16];
480
+ $[29] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => [ref.current], $[29] = t8) : t8 = $[29], _visualEditing.useClickOutsideEvent(t7, t8);
480
481
  let t9;
481
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t9 = css.dialogCardRoot(), $[17] = t9) : t9 = $[17];
482
+ $[30] === Symbol.for("react.memo_cache_sentinel") ? (t9 = css.dialogCardRoot(), $[30] = t9) : t9 = $[30];
482
483
  let t10;
483
- $[18] === Symbol.for("react.memo_cache_sentinel") ? (t10 = css.dialogLayout(), $[18] = t10) : t10 = $[18];
484
+ $[31] === Symbol.for("react.memo_cache_sentinel") ? (t10 = css.dialogLayout(), $[31] = t10) : t10 = $[31];
484
485
  let t11;
485
- $[19] !== header || $[20] !== labelId || $[21] !== onClose || $[22] !== showCloseButton || $[23] !== showHeader ? (t11 = showHeader && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { className: css.dialogHeader(), position: "relative", children: /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { align: "flex-start", padding: 3, children: [
486
+ $[32] !== header || $[33] !== labelId || $[34] !== onClose || $[35] !== showCloseButton || $[36] !== showHeader ? (t11 = showHeader && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { className: css.dialogHeader(), position: "relative", children: /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { align: "flex-start", padding: 3, children: [
486
487
  /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
487
488
  showCloseButton && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: "none", children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { "aria-label": "Close dialog", disabled: !onClose, icon: icons.CloseIcon, mode: "bleed", onClick: onClose, padding: 2 }) })
488
- ] }) }), $[19] = header, $[20] = labelId, $[21] = onClose, $[22] = showCloseButton, $[23] = showHeader, $[24] = t11) : t11 = $[24];
489
+ ] }) }), $[32] = header, $[33] = labelId, $[34] = onClose, $[35] = showCloseButton, $[36] = showHeader, $[37] = t11) : t11 = $[37];
489
490
  let t12;
490
- $[25] === Symbol.for("react.memo_cache_sentinel") ? (t12 = css.dialogContent(), $[25] = t12) : t12 = $[25];
491
+ $[38] === Symbol.for("react.memo_cache_sentinel") ? (t12 = css.dialogContent(), $[38] = t12) : t12 = $[38];
491
492
  let t13;
492
- $[26] !== children ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { className: t12, flex: 1, overflow: "auto", position: "relative", ref: contentRef, tabIndex: -1, children }), $[26] = children, $[27] = t13) : t13 = $[27];
493
+ $[39] !== children ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { className: t12, flex: 1, overflow: "auto", position: "relative", ref: contentRef, tabIndex: -1, children }), $[39] = children, $[40] = t13) : t13 = $[40];
493
494
  let t14;
494
- $[28] !== footer ? (t14 = footer && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { className: css.dialogFooter(), position: "relative", children: footer }), $[28] = footer, $[29] = t14) : t14 = $[29];
495
+ $[41] !== footer ? (t14 = footer && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { className: css.dialogFooter(), position: "relative", children: footer }), $[41] = footer, $[42] = t14) : t14 = $[42];
495
496
  let t15;
496
- $[30] !== t11 || $[31] !== t13 || $[32] !== t14 ? (t15 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { className: t10, direction: "column", flex: 1, children: [
497
+ $[43] !== t11 || $[44] !== t13 || $[45] !== t14 ? (t15 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { className: t10, direction: "column", flex: 1, children: [
497
498
  t11,
498
499
  t13,
499
500
  t14
500
- ] }), $[30] = t11, $[31] = t13, $[32] = t14, $[33] = t15) : t15 = $[33];
501
+ ] }), $[43] = t11, $[44] = t13, $[45] = t14, $[46] = t15) : t15 = $[46];
501
502
  let t16;
502
- $[34] !== radius || $[35] !== scheme || $[36] !== shadow || $[37] !== t15 || $[38] !== tone ? (t16 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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];
503
- let t17;
504
- return $[40] !== t16 || $[41] !== width ? (t17 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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;
503
+ return $[47] !== as || $[48] !== rest || $[49] !== t15 ? (t16 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Card, { ...rest, as, className: t9, display: "flex", ref, children: t15 }), $[47] = as, $[48] = rest, $[49] = t15, $[50] = t16) : t16 = $[50], t16;
504
+ }
505
+ DialogCard.displayName = "DialogCard";
506
+ const DialogContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/dialog", {
507
+ version: 0
505
508
  });
506
- DialogCard.displayName = "ForwardRef(DialogCard)";
507
- const Dialog = react.forwardRef(function(props, ref) {
508
- const $ = reactCompilerRuntime.c(66), context = useDialog();
509
- let _positionProp, _zOffsetProp, cardShadow, children, className, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5, tone;
510
- $[0] !== props ? ({
511
- __unstable_autoFocus: t0,
512
- __unstable_hideCloseButton: t1,
513
- animate: t2,
514
- cardRadius: t3,
509
+ function useDialog() {
510
+ return react.useContext(DialogContext);
511
+ }
512
+ const DEFAULT_DIALOG_ELEMENT = "div";
513
+ function Dialog(props) {
514
+ const $ = reactCompilerRuntime.c(69), context = useDialog(), t0 = props;
515
+ let _positionProp, _zOffsetProp, children, className, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, rest, scheme, t1, t2, t3, t4, t5, t6, t7, tone;
516
+ $[0] !== t0 ? ({
517
+ __unstable_autoFocus: t1,
518
+ __unstable_hideCloseButton: t2,
519
+ animate: t3,
520
+ cardRadius: t4,
515
521
  children,
516
522
  className,
517
523
  contentRef,
@@ -522,19 +528,19 @@ const Dialog = react.forwardRef(function(props, ref) {
522
528
  onClickOutside,
523
529
  onClose,
524
530
  onFocus,
525
- padding: t4,
531
+ padding: t5,
526
532
  portal: portalProp,
527
533
  position: _positionProp,
528
534
  scheme,
529
- shadow: cardShadow,
530
- width: t5,
535
+ shadow: t6,
536
+ width: t7,
531
537
  zOffset: _zOffsetProp,
532
538
  tone,
533
- ...restProps
534
- } = 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]);
535
- 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 ?? _visualEditing.Z_OFFSETS.dialog, animate = _visualEditing.usePrefersReducedMotion() ? !1 : _animate, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element, cardRadius = _visualEditing.useArrayProp(cardRadiusProp), position = _visualEditing.useArrayProp(positionProp), width = _visualEditing.useArrayProp(widthProp), zOffset = _visualEditing.useArrayProp(zOffsetProp), preDivRef = react.useRef(null), postDivRef = react.useRef(null), cardRef = react.useRef(null), focusedElementRef = react.useRef(null);
536
- let t6;
537
- $[24] !== onFocus ? (t6 = (event) => {
539
+ ...rest
540
+ } = 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]);
541
+ 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 ?? _visualEditing.Z_OFFSETS.dialog, animate = _visualEditing.usePrefersReducedMotion() ? !1 : _animate, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element, cardRadius = _visualEditing.useArrayProp(cardRadiusProp), position = _visualEditing.useArrayProp(positionProp), zOffset = _visualEditing.useArrayProp(zOffsetProp), preDivRef = react.useRef(null), postDivRef = react.useRef(null), cardRef = react.useRef(null), focusedElementRef = react.useRef(null);
542
+ let t8;
543
+ $[24] !== onFocus ? (t8 = (event) => {
538
544
  onFocus?.(event);
539
545
  const target = event.target, cardElement = cardRef.current;
540
546
  if (cardElement && target === preDivRef.current) {
@@ -546,10 +552,10 @@ const Dialog = react.forwardRef(function(props, ref) {
546
552
  return;
547
553
  }
548
554
  _visualEditing.isHTMLElement(event.target) && (focusedElementRef.current = event.target);
549
- }, $[24] = onFocus, $[25] = t6) : t6 = $[25];
550
- const handleFocus = t6, labelId = `${id}_label`, rootClickTimeoutRef = react.useRef(void 0);
551
- let t7;
552
- $[26] !== boundaryElement || $[27] !== portalElement ? (t7 = () => {
555
+ }, $[24] = onFocus, $[25] = t8) : t8 = $[25];
556
+ const handleFocus = t8, labelId = `${id}_label`, rootClickTimeoutRef = react.useRef(void 0);
557
+ let t9;
558
+ $[26] !== boundaryElement || $[27] !== portalElement ? (t9 = () => {
553
559
  rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
554
560
  const activeElement = document.activeElement;
555
561
  if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
@@ -562,27 +568,31 @@ const Dialog = react.forwardRef(function(props, ref) {
562
568
  target_0.focus();
563
569
  }
564
570
  }, 0);
565
- }, $[26] = boundaryElement, $[27] = portalElement, $[28] = t7) : t7 = $[28];
566
- const handleRootClick = t7;
567
- let t8;
568
- $[29] !== className ? (t8 = css.composeClassNames(className, css.dialog()), $[29] = className, $[30] = t8) : t8 = $[30];
569
- const t9 = animate ? "" : void 0;
571
+ }, $[26] = boundaryElement, $[27] = portalElement, $[28] = t9) : t9 = $[28];
572
+ const handleRootClick = t9;
570
573
  let t10;
571
- $[31] === Symbol.for("react.memo_cache_sentinel") ? (t10 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: preDivRef, tabIndex: 0 }), $[31] = t10) : t10 = $[31];
572
- let t11;
573
- $[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__ */ jsxRuntime.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];
574
+ $[29] !== className ? (t10 = css.composeClassNames(className, css.dialog()), $[29] = className, $[30] = t10) : t10 = $[30];
575
+ const t11 = animate ? "" : void 0;
574
576
  let t12;
575
- $[48] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: postDivRef, tabIndex: 0 }), $[48] = t12) : t12 = $[48];
577
+ $[31] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: preDivRef, tabIndex: 0 }), $[31] = t12) : t12 = $[31];
576
578
  let t13;
577
- $[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__ */ jsxRuntime.jsxs(_visualEditing.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: [
578
- t10,
579
- t11,
580
- t12
581
- ] }), $[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];
579
+ $[32] === Symbol.for("react.memo_cache_sentinel") ? (t13 = css.dialogContainer(), $[32] = t13) : t13 = $[32];
582
580
  let t14;
583
- return $[63] !== portalProp || $[64] !== t13 ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Portal, { __unstable_name: portalProp, children: t13 }), $[63] = portalProp, $[64] = t13, $[65] = t14) : t14 = $[65], t14;
584
- });
585
- Dialog.displayName = "ForwardRef(Dialog)";
581
+ $[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__ */ jsxRuntime.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];
582
+ let t15;
583
+ $[49] !== t14 || $[50] !== width ? (t15 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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];
584
+ let t16;
585
+ $[52] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: postDivRef, tabIndex: 0 }), $[52] = t16) : t16 = $[52];
586
+ let t17;
587
+ $[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__ */ jsxRuntime.jsxs(_visualEditing.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: [
588
+ t12,
589
+ t15,
590
+ t16
591
+ ] }), $[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];
592
+ let t18;
593
+ return $[66] !== portalProp || $[67] !== t17 ? (t18 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Portal, { __unstable_name: portalProp, children: t17 }), $[66] = portalProp, $[67] = t17, $[68] = t18) : t18 = $[68], t18;
594
+ }
595
+ Dialog.displayName = "Dialog";
586
596
  function DialogProvider(props) {
587
597
  const $ = reactCompilerRuntime.c(6), {
588
598
  children,
@@ -600,7 +610,7 @@ function DialogProvider(props) {
600
610
  return $[3] !== children || $[4] !== contextValue ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(DialogContext.Provider, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t2) : t2 = $[5], t2;
601
611
  }
602
612
  DialogProvider.displayName = "DialogProvider";
603
- const MenuButton = react.forwardRef(function(props, forwardedRef) {
613
+ function MenuButton(props) {
604
614
  const $ = reactCompilerRuntime.c(63), {
605
615
  __unstable_disableRestoreFocusOnClose: t0,
606
616
  boundaryElement: deprecated_boundaryElement,
@@ -614,7 +624,8 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
614
624
  portal: t1,
615
625
  popover,
616
626
  popoverRadius: deprecated_popoverRadius,
617
- preventOverflow: deprecated_preventOverflow
627
+ preventOverflow: deprecated_preventOverflow,
628
+ ref: forwardedRef
618
629
  } = props, disableRestoreFocusOnClose = t0 === void 0 ? !1 : t0, deprecated_portal = t1 === void 0 ? !0 : t1, [open, setOpen] = react.useState(!1), [shouldFocus, setShouldFocus] = react.useState(null), [buttonElement, setButtonElement] = react.useState(null);
619
630
  let t2;
620
631
  $[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
@@ -741,24 +752,25 @@ const MenuButton = react.forwardRef(function(props, forwardedRef) {
741
752
  $[56] !== button ? (t24 = button || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}), $[56] = button, $[57] = t24) : t24 = $[57];
742
753
  let t25;
743
754
  return $[58] !== menu || $[59] !== open || $[60] !== popoverProps || $[61] !== t24 ? (t25 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: t24 }), $[58] = menu, $[59] = open, $[60] = popoverProps, $[61] = t24, $[62] = t25) : t25 = $[62], t25;
744
- });
745
- MenuButton.displayName = "ForwardRef(MenuButton)";
755
+ }
746
756
  function _temp$3(v) {
747
757
  return !v;
748
758
  }
749
- const Skeleton = react.forwardRef(function(props, ref) {
750
- const $ = reactCompilerRuntime.c(18);
751
- let className, delay, radius, restProps, t0;
752
- $[0] !== props ? ({
753
- animated: t0,
759
+ MenuButton.displayName = "MenuButton";
760
+ const DEFAULT_SKELETON_ELEMENT = "div";
761
+ function Skeleton(props) {
762
+ const $ = reactCompilerRuntime.c(17), t0 = props;
763
+ let className, delay, radius, rest, t1;
764
+ $[0] !== t0 ? ({
765
+ animated: t1,
754
766
  className,
755
767
  delay,
756
768
  radius,
757
- ...restProps
758
- } = props, $[0] = props, $[1] = className, $[2] = delay, $[3] = radius, $[4] = restProps, $[5] = t0) : (className = $[1], delay = $[2], radius = $[3], restProps = $[4], t0 = $[5]);
759
- const animated = t0 === void 0 ? !1 : t0, [visible, setVisible] = react.useState(!delay);
760
- let t1, t2;
761
- $[6] !== delay ? (t1 = () => {
769
+ ...rest
770
+ } = t0, $[0] = t0, $[1] = className, $[2] = delay, $[3] = radius, $[4] = rest, $[5] = t1) : (className = $[1], delay = $[2], radius = $[3], rest = $[4], t1 = $[5]);
771
+ const animated = t1 === void 0 ? !1 : t1, [visible, setVisible] = react.useState(!delay);
772
+ let t2, t3;
773
+ $[6] !== delay ? (t2 = () => {
762
774
  if (!delay)
763
775
  return setVisible(!0);
764
776
  const timeout = setTimeout(() => {
@@ -767,97 +779,102 @@ const Skeleton = react.forwardRef(function(props, ref) {
767
779
  return () => {
768
780
  clearTimeout(timeout);
769
781
  };
770
- }, t2 = [delay], $[6] = delay, $[7] = t1, $[8] = t2) : (t1 = $[7], t2 = $[8]), react.useEffect(t1, t2);
771
- let t3;
772
- $[9] !== className || $[10] !== radius ? (t3 = css.composeClassNames(className, css.skeleton({
782
+ }, t3 = [delay], $[6] = delay, $[7] = t2, $[8] = t3) : (t2 = $[7], t3 = $[8]), react.useEffect(t2, t3);
783
+ let t4;
784
+ $[9] !== className || $[10] !== radius ? (t4 = css.composeClassNames(className, css.skeleton({
773
785
  radius
774
- })), $[9] = className, $[10] = radius, $[11] = t3) : t3 = $[11];
775
- const t4 = animated ? "" : void 0, t5 = visible ? "" : void 0;
776
- let t6;
777
- return $[12] !== ref || $[13] !== restProps || $[14] !== t3 || $[15] !== t4 || $[16] !== t5 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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;
778
- });
779
- Skeleton.displayName = "ForwardRef(Skeleton)";
780
- const TextSkeleton = react.forwardRef(function(props, ref) {
781
- const $ = reactCompilerRuntime.c(11);
782
- let className, restProps, t0;
783
- $[0] !== props ? ({
786
+ })), $[9] = className, $[10] = radius, $[11] = t4) : t4 = $[11];
787
+ const t5 = animated ? "" : void 0, t6 = visible ? "" : void 0;
788
+ let t7;
789
+ return $[12] !== rest || $[13] !== t4 || $[14] !== t5 || $[15] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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;
790
+ }
791
+ Skeleton.displayName = "Skeleton";
792
+ const DEFAULT_CODE_SKELETON_ELEMENT = "div";
793
+ function CodeSkeleton(props) {
794
+ const $ = reactCompilerRuntime.c(10), t0 = props;
795
+ let className, rest, t1;
796
+ $[0] !== t0 ? ({
784
797
  className,
785
- size: t0,
786
- ...restProps
787
- } = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
788
- const size = t0 === void 0 ? 2 : t0;
789
- let t1;
790
- $[4] !== className || $[5] !== size ? (t1 = css.composeClassNames(className, css.textSkeleton({
791
- size
792
- })), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
798
+ size: t1,
799
+ ...rest
800
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
801
+ const size = t1 === void 0 ? 2 : t1;
793
802
  let t2;
794
- return $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { "data-ui": "TextSkeleton", ...restProps, className: t1, ref }), $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
795
- });
796
- TextSkeleton.displayName = "ForwardRef(TextSkeleton)";
797
- const LabelSkeleton = react.forwardRef(function(props, ref) {
798
- const $ = reactCompilerRuntime.c(11);
799
- let className, restProps, t0;
800
- $[0] !== props ? ({
801
- className,
802
- size: t0,
803
- ...restProps
804
- } = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
805
- const size = t0 === void 0 ? 2 : t0;
806
- let t1;
807
- $[4] !== className || $[5] !== size ? (t1 = css.composeClassNames(className, css.labelSkeleton({
803
+ $[4] !== className || $[5] !== size ? (t2 = css.composeClassNames(className, css.codeSkeleton({
808
804
  size
809
- })), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
810
- let t2;
811
- return $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { "data-ui": "LabelSkeleton", ...restProps, className: t1, ref }), $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
812
- });
813
- LabelSkeleton.displayName = "ForwardRef(LabelSkeleton)";
814
- const HeadingSkeleton = react.forwardRef(function(props, ref) {
815
- const $ = reactCompilerRuntime.c(11);
816
- let className, restProps, t0;
817
- $[0] !== props ? ({
805
+ })), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
806
+ let t3;
807
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
808
+ }
809
+ CodeSkeleton.displayName = "CodeSkeleton";
810
+ const DEFAULT_HEADING_SKELETON_ELEMENT = "div";
811
+ function HeadingSkeleton(props) {
812
+ const $ = reactCompilerRuntime.c(10), t0 = props;
813
+ let className, rest, t1;
814
+ $[0] !== t0 ? ({
818
815
  className,
819
- size: t0,
820
- ...restProps
821
- } = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
822
- const size = t0 === void 0 ? 2 : t0;
823
- let t1;
824
- $[4] !== className || $[5] !== size ? (t1 = css.composeClassNames(className, css.headingSkeleton({
825
- size
826
- })), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
816
+ size: t1,
817
+ ...rest
818
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
819
+ const size = t1 === void 0 ? 2 : t1;
827
820
  let t2;
828
- return $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...restProps, className: t1, ref }), $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
829
- });
830
- HeadingSkeleton.displayName = "ForwardRef(HeadingSkeleton)";
831
- const CodeSkeleton = react.forwardRef(function(props, ref) {
832
- const $ = reactCompilerRuntime.c(11);
833
- let className, restProps, t0;
834
- $[0] !== props ? ({
821
+ $[4] !== className || $[5] !== size ? (t2 = css.composeClassNames(className, css.headingSkeleton({
822
+ size
823
+ })), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
824
+ let t3;
825
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
826
+ }
827
+ HeadingSkeleton.displayName = "HeadingSkeleton";
828
+ const DEFAULT_LABEL_SKELETON_ELEMENT = "div";
829
+ function LabelSkeleton(props) {
830
+ const $ = reactCompilerRuntime.c(10), t0 = props;
831
+ let className, rest, t1;
832
+ $[0] !== t0 ? ({
835
833
  className,
836
- size: t0,
837
- ...restProps
838
- } = props, $[0] = props, $[1] = className, $[2] = restProps, $[3] = t0) : (className = $[1], restProps = $[2], t0 = $[3]);
839
- const size = t0 === void 0 ? 2 : t0;
840
- let t1;
841
- $[4] !== className || $[5] !== size ? (t1 = css.composeClassNames(className, css.codeSkeleton({
834
+ size: t1,
835
+ ...rest
836
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
837
+ const size = t1 === void 0 ? 2 : t1;
838
+ let t2;
839
+ $[4] !== className || $[5] !== size ? (t2 = css.composeClassNames(className, css.labelSkeleton({
842
840
  size
843
- })), $[4] = className, $[5] = size, $[6] = t1) : t1 = $[6];
841
+ })), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
842
+ let t3;
843
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
844
+ }
845
+ LabelSkeleton.displayName = "LabelSkeleton";
846
+ const DEFAULT_TEXT_SKELETON_ELEMENT = "div";
847
+ function TextSkeleton(props) {
848
+ const $ = reactCompilerRuntime.c(10), t0 = props;
849
+ let className, rest, t1;
850
+ $[0] !== t0 ? ({
851
+ className,
852
+ size: t1,
853
+ ...rest
854
+ } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
855
+ const size = t1 === void 0 ? 2 : t1;
844
856
  let t2;
845
- return $[7] !== ref || $[8] !== restProps || $[9] !== t1 ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...restProps, className: t1, ref }), $[7] = ref, $[8] = restProps, $[9] = t1, $[10] = t2) : t2 = $[10], t2;
846
- });
847
- CodeSkeleton.displayName = "ForwardRef(CodeSkeleton)";
848
- const TabPanel = react.forwardRef(function(props, ref) {
849
- const $ = reactCompilerRuntime.c(9);
850
- let flex, restProps;
851
- $[0] !== props ? ({
852
- flex,
853
- ...restProps
854
- } = props, $[0] = props, $[1] = flex, $[2] = restProps) : (flex = $[1], restProps = $[2]);
855
- const t0 = props.tabIndex === void 0 ? 0 : props.tabIndex;
856
- let t1;
857
- return $[3] !== flex || $[4] !== props.children || $[5] !== ref || $[6] !== restProps || $[7] !== t0 ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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;
858
- });
859
- TabPanel.displayName = "ForwardRef(TabPanel)";
860
- const ROLES = {
857
+ $[4] !== className || $[5] !== size ? (t2 = css.composeClassNames(className, css.textSkeleton({
858
+ size
859
+ })), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
860
+ let t3;
861
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
862
+ }
863
+ TextSkeleton.displayName = "TextSkeleton";
864
+ const DEFAULT_TAB_PANEL_ELEMENT = "div";
865
+ function TabPanel(props) {
866
+ const $ = reactCompilerRuntime.c(8), t0 = props;
867
+ let rest, t1;
868
+ $[0] !== t0 ? ({
869
+ as: t1,
870
+ ...rest
871
+ } = t0, $[0] = t0, $[1] = rest, $[2] = t1) : (rest = $[1], t1 = $[2]);
872
+ const as = t1 === void 0 ? DEFAULT_TAB_PANEL_ELEMENT : t1, t2 = props.tabIndex === void 0 ? 0 : props.tabIndex;
873
+ let t3;
874
+ return $[3] !== as || $[4] !== props.children || $[5] !== rest || $[6] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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;
875
+ }
876
+ TabPanel.displayName = "TabPanel";
877
+ const DEFAULT_TOAST_ELEMENT = "li", ROLES = {
861
878
  error: "alert",
862
879
  warning: "alert",
863
880
  success: "alert",
@@ -874,61 +891,62 @@ const ROLES = {
874
891
  info: "neutral"
875
892
  }, LONG_ENOUGH_BUT_NOT_TOO_LONG = 1e3 * 60 * 60 * 24 * 24;
876
893
  function Toast(props) {
877
- const $ = reactCompilerRuntime.c(51);
878
- let closable, description, duration, onClose, restProps, status, t0, title, updatedAt;
879
- $[0] !== props ? ({
894
+ const $ = reactCompilerRuntime.c(53), t0 = props;
895
+ let closable, description, duration, onClose, rest, status, t1, t2, title, updatedAt;
896
+ $[0] !== t0 ? ({
897
+ as: t1,
880
898
  closable,
881
899
  description,
882
900
  duration,
883
901
  onClose,
884
- radius: t0,
902
+ radius: t2,
885
903
  title,
886
904
  status,
887
905
  updatedAt,
888
- ...restProps
889
- } = 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]);
890
- 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 = _visualEditing.usePrefersReducedMotion() ? 0 : 0.26;
891
- let t1;
892
- $[10] !== visualDuration ? (t1 = visualDuration ? {
906
+ ...rest
907
+ } = 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]);
908
+ 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 = _visualEditing.usePrefersReducedMotion() ? 0 : 0.26;
909
+ let t3;
910
+ $[11] !== visualDuration ? (t3 = visualDuration ? {
893
911
  type: "spring",
894
912
  visualDuration,
895
913
  bounce: 0.25
896
914
  } : {
897
915
  duration: 0
898
- }, $[10] = visualDuration, $[11] = t1) : t1 = $[11];
899
- const transition = t1, hasDuration = duration && isFinite(duration) && duration < LONG_ENOUGH_BUT_NOT_TOO_LONG;
900
- let t2;
901
- $[12] === Symbol.for("react.memo_cache_sentinel") ? (t2 = ["hidden", "initial"], $[12] = t2) : t2 = $[12];
902
- const initial = t2;
903
- let t3;
904
- $[13] === Symbol.for("react.memo_cache_sentinel") ? (t3 = ["visible", "slideIn"], $[13] = t3) : t3 = $[13];
905
- const animate = t3;
916
+ }, $[11] = visualDuration, $[12] = t3) : t3 = $[12];
917
+ const transition = t3, hasDuration = duration && isFinite(duration) && duration < LONG_ENOUGH_BUT_NOT_TOO_LONG;
906
918
  let t4;
907
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "slideOut"], $[14] = t4) : t4 = $[14];
908
- const exit = t4;
919
+ $[13] === Symbol.for("react.memo_cache_sentinel") ? (t4 = ["hidden", "initial"], $[13] = t4) : t4 = $[13];
920
+ const initial = t4;
909
921
  let t5;
910
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t5 = css.toast(), $[15] = t5) : t5 = $[15];
911
- const t6 = hasDuration ? "" : void 0;
922
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t5 = ["visible", "slideIn"], $[14] = t5) : t5 = $[14];
923
+ const animate = t5;
924
+ let t6;
925
+ $[15] === Symbol.for("react.memo_cache_sentinel") ? (t6 = ["hidden", "slideOut"], $[15] = t6) : t6 = $[15];
926
+ const exit = t6;
912
927
  let t7;
913
- $[16] !== title ? (t7 = title && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: 1, weight: "medium", children: title }), $[16] = title, $[17] = t7) : t7 = $[17];
914
- let t8;
915
- $[18] !== description || $[19] !== transition ? (t8 = description && /* @__PURE__ */ jsxRuntime.jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description }), $[18] = description, $[19] = transition, $[20] = t8) : t8 = $[20];
928
+ $[16] === Symbol.for("react.memo_cache_sentinel") ? (t7 = css.toast(), $[16] = t7) : t7 = $[16];
929
+ const t8 = hasDuration ? "" : void 0;
916
930
  let t9;
917
- $[21] !== t7 || $[22] !== t8 ? (t9 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Flex, { flex: 1, overflowX: "auto", padding: 3, children: /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Stack, { space: 3, children: [
918
- t7,
919
- t8
920
- ] }) }), $[21] = t7, $[22] = t8, $[23] = t9) : t9 = $[23];
931
+ $[17] !== title ? (t9 = title && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: 1, weight: "medium", children: title }), $[17] = title, $[18] = t9) : t9 = $[18];
921
932
  let t10;
922
- $[24] !== buttonTone || $[25] !== closable || $[26] !== onClose ? (t10 = closable && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { padding: 1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { as: "button", icon: icons.CloseIcon, mode: "bleed", padding: 2, tone: buttonTone, onClick: onClose, style: {
923
- verticalAlign: "top"
924
- } }) }), $[24] = buttonTone, $[25] = closable, $[26] = onClose, $[27] = t10) : t10 = $[27];
933
+ $[19] !== description || $[20] !== transition ? (t10 = description && /* @__PURE__ */ jsxRuntime.jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description }), $[19] = description, $[20] = transition, $[21] = t10) : t10 = $[21];
925
934
  let t11;
926
- $[28] !== t10 || $[29] !== t9 || $[30] !== transition ? (t11 = /* @__PURE__ */ jsxRuntime.jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
935
+ $[22] !== t10 || $[23] !== t9 ? (t11 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Flex, { flex: 1, overflowX: "auto", padding: 3, children: /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Stack, { space: 3, children: [
927
936
  t9,
928
937
  t10
929
- ] }), $[28] = t10, $[29] = t9, $[30] = transition, $[31] = t11) : t11 = $[31];
938
+ ] }) }), $[22] = t10, $[23] = t9, $[24] = t11) : t11 = $[24];
930
939
  let t12;
931
- $[32] !== cardTone || $[33] !== duration || $[34] !== hasDuration || $[35] !== onClose || $[36] !== radius || $[37] !== transition || $[38] !== updatedAt || $[39] !== visualDuration ? (t12 = hasDuration && /* @__PURE__ */ jsxRuntime.jsxs(MotionBox, { className: css.toastLoadingBar(), variants: content, transition, children: [
940
+ $[25] !== buttonTone || $[26] !== closable || $[27] !== onClose ? (t12 = closable && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { padding: 1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { as: "button", icon: icons.CloseIcon, mode: "bleed", padding: 2, tone: buttonTone, onClick: onClose, style: {
941
+ verticalAlign: "top"
942
+ } }) }), $[25] = buttonTone, $[26] = closable, $[27] = onClose, $[28] = t12) : t12 = $[28];
943
+ let t13;
944
+ $[29] !== t11 || $[30] !== t12 || $[31] !== transition ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
945
+ t11,
946
+ t12
947
+ ] }), $[29] = t11, $[30] = t12, $[31] = transition, $[32] = t13) : t13 = $[32];
948
+ let t14;
949
+ $[33] !== cardTone || $[34] !== duration || $[35] !== hasDuration || $[36] !== onClose || $[37] !== radius || $[38] !== transition || $[39] !== updatedAt || $[40] !== visualDuration ? (t14 = hasDuration && /* @__PURE__ */ jsxRuntime.jsxs(MotionBox, { className: css.toastLoadingBar(), variants: content, transition, children: [
932
950
  /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Card, { className: css.toastLoadingBarMask(), tone: cardTone, radius }),
933
951
  /* @__PURE__ */ jsxRuntime.jsx(MotionCard, { className: css.toastLoadingBarProgress(), tone: cardTone, initial: {
934
952
  scaleX: 0
@@ -939,12 +957,12 @@ function Toast(props) {
939
957
  duration: duration / 1e3,
940
958
  ease: "linear"
941
959
  }, onAnimationComplete: onClose }, `progress-${updatedAt}`)
942
- ] }), $[32] = cardTone, $[33] = duration, $[34] = hasDuration, $[35] = onClose, $[36] = radius, $[37] = transition, $[38] = updatedAt, $[39] = visualDuration, $[40] = t12) : t12 = $[40];
943
- let t13;
944
- return $[41] !== cardTone || $[42] !== radius || $[43] !== restProps || $[44] !== role || $[45] !== t11 || $[46] !== t12 || $[47] !== t6 || $[48] !== transition || $[49] !== visualDuration ? (t13 = /* @__PURE__ */ jsxRuntime.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: [
945
- t11,
946
- t12
947
- ] }), $[41] = cardTone, $[42] = radius, $[43] = restProps, $[44] = role, $[45] = t11, $[46] = t12, $[47] = t6, $[48] = transition, $[49] = visualDuration, $[50] = t13) : t13 = $[50], t13;
960
+ ] }), $[33] = cardTone, $[34] = duration, $[35] = hasDuration, $[36] = onClose, $[37] = radius, $[38] = transition, $[39] = updatedAt, $[40] = visualDuration, $[41] = t14) : t14 = $[41];
961
+ let t15;
962
+ return $[42] !== as || $[43] !== cardTone || $[44] !== radius || $[45] !== rest || $[46] !== role || $[47] !== t13 || $[48] !== t14 || $[49] !== t8 || $[50] !== transition || $[51] !== visualDuration ? (t15 = /* @__PURE__ */ jsxRuntime.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: [
963
+ t13,
964
+ t14
965
+ ] }), $[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;
948
966
  }
949
967
  Toast.displayName = "Toast";
950
968
  const container = {
@@ -995,25 +1013,26 @@ function _temp$2() {
995
1013
  return !0;
996
1014
  }
997
1015
  const subscribe = () => () => {
998
- }, ToastContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/toast", null);
1016
+ }, ToastContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/toast", null), DEFAULT_TOAST_LAYER_ELEMENT = "ul";
999
1017
  function ToastLayer(props) {
1000
- const $ = reactCompilerRuntime.c(10), {
1018
+ const $ = reactCompilerRuntime.c(11), {
1019
+ as: t0,
1001
1020
  children,
1002
- padding: t0,
1021
+ padding: t1,
1003
1022
  paddingX,
1004
1023
  paddingY,
1005
- gap: t1
1006
- } = props, padding = t0 === void 0 ? 4 : t0, gap = t1 === void 0 ? 3 : t1, {
1024
+ gap: t2
1025
+ } = props, as = t0 === void 0 ? DEFAULT_TOAST_LAYER_ELEMENT : t0, padding = t1 === void 0 ? 4 : t1, gap = t2 === void 0 ? 3 : t2, {
1007
1026
  zIndex
1008
1027
  } = _visualEditing.useLayer();
1009
- let t2;
1010
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = css.toastLayer(), $[0] = t2) : t2 = $[0];
1011
1028
  let t3;
1012
- $[1] !== zIndex ? (t3 = {
1013
- zIndex
1014
- }, $[1] = zIndex, $[2] = t3) : t3 = $[2];
1029
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t3 = css.toastLayer(), $[0] = t3) : t3 = $[0];
1015
1030
  let t4;
1016
- return $[3] !== children || $[4] !== gap || $[5] !== padding || $[6] !== paddingX || $[7] !== paddingY || $[8] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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;
1031
+ $[1] !== zIndex ? (t4 = {
1032
+ zIndex
1033
+ }, $[1] = zIndex, $[2] = t4) : t4 = $[2];
1034
+ let t5;
1035
+ return $[3] !== as || $[4] !== children || $[5] !== gap || $[6] !== padding || $[7] !== paddingX || $[8] !== paddingY || $[9] !== t4 ? (t5 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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;
1017
1036
  }
1018
1037
  ToastLayer.displayName = "ToastLayer";
1019
1038
  let toastId = 0;
@@ -1136,38 +1155,40 @@ function _focusItemElement(el) {
1136
1155
  firstChild && firstChild instanceof HTMLElement && firstChild.focus();
1137
1156
  }
1138
1157
  }
1139
- const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/tree", null), Tree = react.memo(react.forwardRef(function(props, forwardedRef) {
1140
- const $ = reactCompilerRuntime.c(38);
1141
- let children, gap, onFocus, restProps, t0;
1142
- $[0] !== props ? ({
1158
+ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/tree", null), DEFAULT_TREE_ELEMENT = "div";
1159
+ function Tree(props) {
1160
+ const $ = reactCompilerRuntime.c(39), t0 = props;
1161
+ let children, forwardedRef, gap, onFocus, rest, t1;
1162
+ $[0] !== t0 ? ({
1143
1163
  children,
1144
1164
  gap,
1145
- space: t0,
1165
+ space: t1,
1146
1166
  onFocus,
1147
- ...restProps
1148
- } = props, $[0] = props, $[1] = children, $[2] = gap, $[3] = onFocus, $[4] = restProps, $[5] = t0) : (children = $[1], gap = $[2], onFocus = $[3], restProps = $[4], t0 = $[5]);
1149
- const space = t0 === void 0 ? 1 : t0, ref = react.useRef(null), [focusedElement, setFocusedElement] = react.useState(null), focusedElementRef = react.useRef(focusedElement);
1150
- let t1, t2;
1151
- $[6] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[6] = t2) : t2 = $[6], t1 = t2;
1152
- const path = t1;
1153
- let t3;
1154
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[7] = t3) : t3 = $[7];
1155
- const [itemElements, setItemElements] = react.useState(t3);
1167
+ ref: forwardedRef,
1168
+ ...rest
1169
+ } = 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]);
1170
+ const space = t1 === void 0 ? 1 : t1, ref = react.useRef(null), [focusedElement, setFocusedElement] = react.useState(null), focusedElementRef = react.useRef(focusedElement);
1171
+ let t2, t3;
1172
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[7] = t3) : t3 = $[7], t2 = t3;
1173
+ const path = t2;
1156
1174
  let t4;
1157
- $[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = {}, $[8] = t4) : t4 = $[8];
1158
- const [state, setState] = react.useState(t4), stateRef = react.useRef(state);
1175
+ $[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = [], $[8] = t4) : t4 = $[8];
1176
+ const [itemElements, setItemElements] = react.useState(t4);
1159
1177
  let t5;
1160
- $[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => ref.current, $[9] = t5) : t5 = $[9], react.useImperativeHandle(forwardedRef, t5);
1161
- let t6, t7;
1162
- $[10] !== focusedElement ? (t6 = () => {
1178
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 = {}, $[9] = t5) : t5 = $[9];
1179
+ const [state, setState] = react.useState(t5), stateRef = react.useRef(state);
1180
+ let t6;
1181
+ $[10] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[10] = t6) : t6 = $[10], react.useImperativeHandle(forwardedRef, t6);
1182
+ let t7, t8;
1183
+ $[11] !== focusedElement ? (t7 = () => {
1163
1184
  focusedElementRef.current = focusedElement;
1164
- }, t7 = [focusedElement], $[10] = focusedElement, $[11] = t6, $[12] = t7) : (t6 = $[11], t7 = $[12]), react.useEffect(t6, t7);
1165
- let t8, t9;
1166
- $[13] !== state ? (t8 = () => {
1185
+ }, t8 = [focusedElement], $[11] = focusedElement, $[12] = t7, $[13] = t8) : (t7 = $[12], t8 = $[13]), react.useEffect(t7, t8);
1186
+ let t10, t9;
1187
+ $[14] !== state ? (t9 = () => {
1167
1188
  stateRef.current = state;
1168
- }, t9 = [state], $[13] = state, $[14] = t8, $[15] = t9) : (t8 = $[14], t9 = $[15]), react.useEffect(t8, t9);
1169
- let t10;
1170
- $[16] === Symbol.for("react.memo_cache_sentinel") ? (t10 = (element, path_0, expanded, selected) => (setState((s) => ({
1189
+ }, t10 = [state], $[14] = state, $[15] = t10, $[16] = t9) : (t10 = $[15], t9 = $[16]), react.useEffect(t9, t10);
1190
+ let t11;
1191
+ $[17] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (element, path_0, expanded, selected) => (setState((s) => ({
1171
1192
  ...s,
1172
1193
  [path_0]: {
1173
1194
  element,
@@ -1180,10 +1201,10 @@ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context
1180
1201
  };
1181
1202
  return delete newState[path_0], newState;
1182
1203
  });
1183
- }), $[16] = t10) : t10 = $[16];
1184
- const registerItem = t10;
1185
- let t11;
1186
- $[17] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (path_1, expanded_0) => {
1204
+ }), $[17] = t11) : t11 = $[17];
1205
+ const registerItem = t11;
1206
+ let t12;
1207
+ $[18] === Symbol.for("react.memo_cache_sentinel") ? (t12 = (path_1, expanded_0) => {
1187
1208
  setState((s_1) => {
1188
1209
  const itemState = s_1[path_1];
1189
1210
  return itemState ? {
@@ -1194,14 +1215,14 @@ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context
1194
1215
  }
1195
1216
  } : s_1;
1196
1217
  });
1197
- }, $[17] = t11) : t11 = $[17];
1198
- const setExpanded = t11;
1199
- let t12;
1200
- const t13 = focusedElement || itemElements[0] || null;
1201
- let t14;
1202
- $[18] !== space || $[19] !== state || $[20] !== t13 ? (t14 = {
1218
+ }, $[18] = t12) : t12 = $[18];
1219
+ const setExpanded = t12;
1220
+ let t13;
1221
+ const t14 = focusedElement || itemElements[0] || null;
1222
+ let t15;
1223
+ $[19] !== space || $[20] !== state || $[21] !== t14 ? (t15 = {
1203
1224
  version: 0,
1204
- focusedElement: t13,
1225
+ focusedElement: t14,
1205
1226
  level: 0,
1206
1227
  path,
1207
1228
  registerItem,
@@ -1209,10 +1230,10 @@ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context
1209
1230
  setFocusedElement,
1210
1231
  space,
1211
1232
  state
1212
- }, $[18] = space, $[19] = state, $[20] = t13, $[21] = t14) : t14 = $[21], t12 = t14;
1213
- const contextValue = t12;
1214
- let t15;
1215
- $[22] !== itemElements ? (t15 = (event) => {
1233
+ }, $[19] = space, $[20] = state, $[21] = t14, $[22] = t15) : t15 = $[22], t13 = t15;
1234
+ const contextValue = t13;
1235
+ let t16;
1236
+ $[23] !== itemElements ? (t16 = (event) => {
1216
1237
  if (focusedElementRef.current) {
1217
1238
  if (event.key === "ArrowDown") {
1218
1239
  event.preventDefault();
@@ -1271,29 +1292,29 @@ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context
1271
1292
  return;
1272
1293
  }
1273
1294
  }
1274
- }, $[22] = itemElements, $[23] = t15) : t15 = $[23];
1275
- const handleKeyDown = t15;
1276
- let t16;
1277
- $[24] !== onFocus ? (t16 = (event_0) => {
1278
- setFocusedElement(event_0.target), onFocus?.(event_0);
1279
- }, $[24] = onFocus, $[25] = t16) : t16 = $[25];
1280
- const handleFocus = t16;
1295
+ }, $[23] = itemElements, $[24] = t16) : t16 = $[24];
1296
+ const handleKeyDown = t16;
1281
1297
  let t17;
1282
- $[26] === Symbol.for("react.memo_cache_sentinel") ? (t17 = () => {
1298
+ $[25] !== onFocus ? (t17 = (event_0) => {
1299
+ setFocusedElement(event_0.target), onFocus?.(event_0);
1300
+ }, $[25] = onFocus, $[26] = t17) : t17 = $[26];
1301
+ const handleFocus = t17;
1302
+ let t18;
1303
+ $[27] === Symbol.for("react.memo_cache_sentinel") ? (t18 = () => {
1283
1304
  if (!ref.current)
1284
1305
  return;
1285
1306
  const _itemElements = Array.from(ref.current.querySelectorAll('[data-ui="TreeItem"]'));
1286
1307
  setItemElements(_itemElements);
1287
- }, $[26] = t17) : t17 = $[26];
1288
- let t18;
1289
- $[27] !== children ? (t18 = [children], $[27] = children, $[28] = t18) : t18 = $[28], react.useEffect(t17, t18);
1290
- const t19 = gap ?? space;
1291
- let t20;
1292
- $[29] !== children || $[30] !== handleFocus || $[31] !== handleKeyDown || $[32] !== restProps || $[33] !== t19 ? (t20 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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];
1308
+ }, $[27] = t18) : t18 = $[27];
1309
+ let t19;
1310
+ $[28] !== children ? (t19 = [children], $[28] = children, $[29] = t19) : t19 = $[29], react.useEffect(t18, t19);
1311
+ const t20 = gap ?? space;
1293
1312
  let t21;
1294
- return $[35] !== contextValue || $[36] !== t20 ? (t21 = /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: t20 }), $[35] = contextValue, $[36] = t20, $[37] = t21) : t21 = $[37], t21;
1295
- }));
1296
- Tree.displayName = "Memo(ForwardRef(Tree))";
1313
+ $[30] !== children || $[31] !== handleFocus || $[32] !== handleKeyDown || $[33] !== rest || $[34] !== t20 ? (t21 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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];
1314
+ let t22;
1315
+ return $[36] !== contextValue || $[37] !== t21 ? (t22 = /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: t21 }), $[36] = contextValue, $[37] = t21, $[38] = t22) : t22 = $[38], t22;
1316
+ }
1317
+ Tree.displayName = "Tree";
1297
1318
  function useTree() {
1298
1319
  const tree = react.useContext(TreeContext);
1299
1320
  if (!tree)
@@ -1301,17 +1322,20 @@ function useTree() {
1301
1322
  return tree;
1302
1323
  }
1303
1324
  const TreeGroup = react.memo(function(props) {
1304
- const $ = reactCompilerRuntime.c(9);
1305
- let children, restProps, t0;
1306
- $[0] !== props ? ({
1325
+ const $ = reactCompilerRuntime.c(9), t0 = props;
1326
+ let children, rest, t1;
1327
+ $[0] !== t0 ? ({
1307
1328
  children,
1308
- expanded: t0,
1309
- ...restProps
1310
- } = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0) : (children = $[1], restProps = $[2], t0 = $[3]);
1311
- const expanded = t0 === void 0 ? !1 : t0, tree = useTree(), t1 = !expanded;
1312
- let t2;
1313
- return $[4] !== children || $[5] !== restProps || $[6] !== t1 || $[7] !== tree.space ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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;
1314
- }), TreeItem = react.memo(function(props) {
1329
+ expanded: t1,
1330
+ ...rest
1331
+ } = t0, $[0] = t0, $[1] = children, $[2] = rest, $[3] = t1) : (children = $[1], rest = $[2], t1 = $[3]);
1332
+ const expanded = t1 === void 0 ? !1 : t1, tree = useTree(), t2 = !expanded;
1333
+ let t3;
1334
+ return $[4] !== children || $[5] !== rest || $[6] !== t2 || $[7] !== tree.space ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.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;
1335
+ });
1336
+ TreeGroup.displayName = "TreeGroup";
1337
+ const DEFAULT_TREE_ITEM_ELEMENT = "a";
1338
+ function TreeItem(props) {
1315
1339
  const {
1316
1340
  children,
1317
1341
  className,
@@ -1329,7 +1353,7 @@ const TreeGroup = react.memo(function(props) {
1329
1353
  space = 2,
1330
1354
  text,
1331
1355
  weight,
1332
- ...restProps
1356
+ ...rest
1333
1357
  } = props, rootRef = react.useRef(null), treeitemRef = react.useRef(null), tree = useTree(), {
1334
1358
  path,
1335
1359
  registerItem,
@@ -1362,19 +1386,19 @@ const TreeGroup = react.memo(function(props) {
1362
1386
  ] }),
1363
1387
  /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) })
1364
1388
  ] });
1365
- return href ? /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { "data-selected": selected ? "" : void 0, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...restProps, as: "li", className: css.composeClassNames(className, css.treeItem()), onClick: handleClick, ref: rootRef, role: "none", children: [
1389
+ return href ? /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { "data-selected": selected ? "" : void 0, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...rest, as: "li", className: css.composeClassNames(className, css.treeItem()), onClick: handleClick, ref: rootRef, role: "none", children: [
1366
1390
  /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Selectable, { "aria-expanded": expanded, as: linkAs, "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", href, radius, ref: treeitemRef, role: "treeitem", tabIndex, style: {
1367
1391
  paddingLeft: `calc(var(--space-2) * ${tree.level})`
1368
1392
  }, children: content2 }),
1369
1393
  /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { hidden: !expanded, children }) })
1370
- ] }) : /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { "data-selected": selected ? "" : void 0, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...restProps, "aria-expanded": expanded, className: css.composeClassNames(className, css.treeItem()), onClick: handleClick, onKeyDown: handleKeyDown, ref: rootRef, role: "treeitem", tabIndex, children: [
1394
+ ] }) : /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { "data-selected": selected ? "" : void 0, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...rest, "aria-expanded": expanded, className: css.composeClassNames(className, css.treeItem()), onClick: handleClick, onKeyDown: handleKeyDown, ref: rootRef, role: "treeitem", tabIndex, children: [
1371
1395
  /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Selectable, { as: "button", "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", radius, style: {
1372
1396
  paddingLeft: `calc(var(--space-2) * ${tree.level})`
1373
1397
  }, children: content2 }),
1374
1398
  /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { expanded, children }) })
1375
1399
  ] });
1376
- });
1377
- TreeItem.displayName = "Memo(TreeItem)";
1400
+ }
1401
+ TreeItem.displayName = "TreeItem";
1378
1402
  function RootClassNames(props) {
1379
1403
  const $ = reactCompilerRuntime.c(7), {
1380
1404
  element
@@ -1406,6 +1430,7 @@ function _temp2() {
1406
1430
  function _temp(n) {
1407
1431
  return `.${n}`;
1408
1432
  }
1433
+ RootClassNames.displayName = "RootClassNames";
1409
1434
  function StyleTags(props) {
1410
1435
  const $ = reactCompilerRuntime.c(10), {
1411
1436
  theme: themeProp
@@ -1430,6 +1455,7 @@ function StyleTags(props) {
1430
1455
  t4
1431
1456
  ] }), $[8] = t3, $[9] = t5) : t5 = $[9], t5;
1432
1457
  }
1458
+ StyleTags.displayName = "StyleTags";
1433
1459
  exports.Arrow = _visualEditing.Arrow;
1434
1460
  exports.Avatar = _visualEditing.Avatar;
1435
1461
  exports.AvatarCounter = _visualEditing.AvatarCounter;
@@ -1442,8 +1468,45 @@ exports.Card = _visualEditing.Card;
1442
1468
  exports.CardProvider = _visualEditing.CardProvider;
1443
1469
  exports.Checkbox = _visualEditing.Checkbox;
1444
1470
  exports.Code = _visualEditing.Code;
1445
- exports.ConditionalWrapper = _visualEditing.ConditionalWrapper;
1446
1471
  exports.Container = _visualEditing.Container;
1472
+ exports.DEFAULT_ARROW_ELEMENT = _visualEditing.DEFAULT_ARROW_ELEMENT;
1473
+ exports.DEFAULT_AVATAR_COUNTER_ELEMENT = _visualEditing.DEFAULT_AVATAR_COUNTER_ELEMENT;
1474
+ exports.DEFAULT_AVATAR_ELEMENT = _visualEditing.DEFAULT_AVATAR_ELEMENT;
1475
+ exports.DEFAULT_AVATAR_STACK_ELEMENT = _visualEditing.DEFAULT_AVATAR_STACK_ELEMENT;
1476
+ exports.DEFAULT_BADGE_ELEMENT = _visualEditing.DEFAULT_BADGE_ELEMENT;
1477
+ exports.DEFAULT_BOX_ELEMENT = _visualEditing.DEFAULT_BOX_ELEMENT;
1478
+ exports.DEFAULT_BUTTON_ELEMENT = _visualEditing.DEFAULT_BUTTON_ELEMENT;
1479
+ exports.DEFAULT_CARD_ELEMENT = _visualEditing.DEFAULT_CARD_ELEMENT;
1480
+ exports.DEFAULT_CHECKBOX_ELEMENT = _visualEditing.DEFAULT_CHECKBOX_ELEMENT;
1481
+ exports.DEFAULT_CODE_ELEMENT = _visualEditing.DEFAULT_CODE_ELEMENT;
1482
+ exports.DEFAULT_CONTAINER_ELEMENT = _visualEditing.DEFAULT_CONTAINER_ELEMENT;
1483
+ exports.DEFAULT_ELEMENT_QUERY_ELEMENT = _visualEditing.DEFAULT_ELEMENT_QUERY_ELEMENT;
1484
+ exports.DEFAULT_FLEX_ELEMENT = _visualEditing.DEFAULT_FLEX_ELEMENT;
1485
+ exports.DEFAULT_GRID_ELEMENT = _visualEditing.DEFAULT_GRID_ELEMENT;
1486
+ exports.DEFAULT_HEADING_ELEMENT = _visualEditing.DEFAULT_HEADING_ELEMENT;
1487
+ exports.DEFAULT_HOTKEYS_ELEMENT = _visualEditing.DEFAULT_HOTKEYS_ELEMENT;
1488
+ exports.DEFAULT_INLINE_ELEMENT = _visualEditing.DEFAULT_INLINE_ELEMENT;
1489
+ exports.DEFAULT_KBD_ELEMENT = _visualEditing.DEFAULT_KBD_ELEMENT;
1490
+ exports.DEFAULT_LABEL_ELEMENT = _visualEditing.DEFAULT_LABEL_ELEMENT;
1491
+ exports.DEFAULT_LAYER_ELEMENT = _visualEditing.DEFAULT_LAYER_ELEMENT;
1492
+ exports.DEFAULT_MENU_DIVIDER_ELEMENT = _visualEditing.DEFAULT_MENU_DIVIDER_ELEMENT;
1493
+ exports.DEFAULT_MENU_ELEMENT = _visualEditing.DEFAULT_MENU_ELEMENT;
1494
+ exports.DEFAULT_MENU_GROUP_ELEMENT = _visualEditing.DEFAULT_MENU_GROUP_ELEMENT;
1495
+ exports.DEFAULT_MENU_ITEM_ELEMENT = _visualEditing.DEFAULT_MENU_ITEM_ELEMENT;
1496
+ exports.DEFAULT_POPOVER_ELEMENT = _visualEditing.DEFAULT_POPOVER_ELEMENT;
1497
+ exports.DEFAULT_RADIO_ELEMENT = _visualEditing.DEFAULT_RADIO_ELEMENT;
1498
+ exports.DEFAULT_SELECT_ELEMENT = _visualEditing.DEFAULT_SELECT_ELEMENT;
1499
+ exports.DEFAULT_SPINNER_ELEMENT = _visualEditing.DEFAULT_SPINNER_ELEMENT;
1500
+ exports.DEFAULT_SR_ONLY_ELEMENT = _visualEditing.DEFAULT_SR_ONLY_ELEMENT;
1501
+ exports.DEFAULT_STACK_ELEMENT = _visualEditing.DEFAULT_STACK_ELEMENT;
1502
+ exports.DEFAULT_SWITCH_ELEMENT = _visualEditing.DEFAULT_SWITCH_ELEMENT;
1503
+ exports.DEFAULT_TAB_ELEMENT = _visualEditing.DEFAULT_TAB_ELEMENT;
1504
+ exports.DEFAULT_TAB_LIST_ELEMENT = _visualEditing.DEFAULT_TAB_LIST_ELEMENT;
1505
+ exports.DEFAULT_TEXT_AREA_ELEMENT = _visualEditing.DEFAULT_TEXT_AREA_ELEMENT;
1506
+ exports.DEFAULT_TEXT_ELEMENT = _visualEditing.DEFAULT_TEXT_ELEMENT;
1507
+ exports.DEFAULT_TEXT_INPUT_ELEMENT = _visualEditing.DEFAULT_TEXT_INPUT_ELEMENT;
1508
+ exports.DEFAULT_TOOLTIP_ELEMENT = _visualEditing.DEFAULT_TOOLTIP_ELEMENT;
1509
+ exports.DEFAULT_VIRTUAL_LIST_ELEMENT = _visualEditing.DEFAULT_VIRTUAL_LIST_ELEMENT;
1447
1510
  exports.ElementQuery = _visualEditing.ElementQuery;
1448
1511
  exports.Flex = _visualEditing.Flex;
1449
1512
  exports.Grid = _visualEditing.Grid;
@@ -1523,6 +1586,18 @@ Object.defineProperty(exports, "rem", {
1523
1586
  exports.Autocomplete = Autocomplete;
1524
1587
  exports.Breadcrumbs = Breadcrumbs;
1525
1588
  exports.CodeSkeleton = CodeSkeleton;
1589
+ exports.DEFAULT_AUTOCOMPLETE_ELEMENT = DEFAULT_AUTOCOMPLETE_ELEMENT;
1590
+ exports.DEFAULT_BREADCRUMBS_ELEMENT = DEFAULT_BREADCRUMBS_ELEMENT;
1591
+ exports.DEFAULT_CODE_SKELETON_ELEMENT = DEFAULT_CODE_SKELETON_ELEMENT;
1592
+ exports.DEFAULT_DIALOG_ELEMENT = DEFAULT_DIALOG_ELEMENT;
1593
+ exports.DEFAULT_HEADING_SKELETON_ELEMENT = DEFAULT_HEADING_SKELETON_ELEMENT;
1594
+ exports.DEFAULT_LABEL_SKELETON_ELEMENT = DEFAULT_LABEL_SKELETON_ELEMENT;
1595
+ exports.DEFAULT_SKELETON_ELEMENT = DEFAULT_SKELETON_ELEMENT;
1596
+ exports.DEFAULT_TAB_PANEL_ELEMENT = DEFAULT_TAB_PANEL_ELEMENT;
1597
+ exports.DEFAULT_TEXT_SKELETON_ELEMENT = DEFAULT_TEXT_SKELETON_ELEMENT;
1598
+ exports.DEFAULT_TOAST_ELEMENT = DEFAULT_TOAST_ELEMENT;
1599
+ exports.DEFAULT_TREE_ELEMENT = DEFAULT_TREE_ELEMENT;
1600
+ exports.DEFAULT_TREE_ITEM_ELEMENT = DEFAULT_TREE_ITEM_ELEMENT;
1526
1601
  exports.Dialog = Dialog;
1527
1602
  exports.DialogContext = DialogContext;
1528
1603
  exports.DialogProvider = DialogProvider;