@sanity/ui 3.0.0-static.16 → 3.0.0-static.17

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 (94) hide show
  1. package/README.md +2 -4
  2. package/bin/{ui.js → sanity-ui.cjs} +1 -1
  3. package/dist/_chunks-cjs/{_visual-editing.js → _visual-editing.cjs} +4 -4
  4. package/dist/_chunks-cjs/_visual-editing.cjs.map +1 -0
  5. package/dist/_chunks-cjs/{buildCommand.js → buildCommand.cjs} +26 -10
  6. package/dist/_chunks-cjs/buildCommand.cjs.map +1 -0
  7. package/dist/_chunks-cjs/{refractor.js → refractor.cjs} +1 -1
  8. package/dist/_chunks-cjs/refractor.cjs.map +1 -0
  9. package/dist/_chunks-es/{_visual-editing.mjs → _visual-editing.js} +4 -4
  10. package/dist/_chunks-es/_visual-editing.js.map +1 -0
  11. package/dist/_chunks-es/{refractor.mjs → refractor.js} +1 -1
  12. package/dist/_chunks-es/refractor.js.map +1 -0
  13. package/dist/_visual-editing.cjs +30 -0
  14. package/dist/_visual-editing.cjs.map +1 -0
  15. package/dist/_visual-editing.js +29 -29
  16. package/dist/_visual-editing.js.map +1 -1
  17. package/dist/{cli.js → cli.cjs} +4 -4
  18. package/dist/cli.cjs.map +1 -0
  19. package/dist/{css.mjs → css.cjs} +490 -499
  20. package/dist/css.cjs.map +1 -0
  21. package/dist/{css.d.mts → css.d.cts} +19 -23
  22. package/dist/css.d.ts +19 -23
  23. package/dist/css.js +490 -497
  24. package/dist/css.js.map +1 -1
  25. package/dist/{index.mjs → index.cjs} +368 -367
  26. package/dist/{index.mjs.map → index.cjs.map} +1 -1
  27. package/dist/index.js +366 -367
  28. package/dist/index.js.map +1 -1
  29. package/dist/{theme.mjs → theme.cjs} +219 -196
  30. package/dist/theme.cjs.map +1 -0
  31. package/dist/{theme.d.mts → theme.d.cts} +2 -0
  32. package/dist/theme.d.ts +2 -0
  33. package/dist/theme.js +218 -195
  34. package/dist/theme.js.map +1 -1
  35. package/dist/{sanity-palette.css → ui-palette.css} +1 -1
  36. package/dist/ui-palette.min.css +1 -0
  37. package/dist/{system.css → ui-system.css} +258 -140
  38. package/dist/ui-system.min.css +1 -0
  39. package/dist/{sanity-theme.css → ui-theme.css} +199 -199
  40. package/dist/ui-theme.min.css +1 -0
  41. package/dist/ui.css +29152 -0
  42. package/dist/ui.min.css +1 -0
  43. package/package.json +20 -20
  44. package/src/cli/buildCommand.ts +55 -20
  45. package/src/cli/index.ts +1 -1
  46. package/src/core/StyleTags.tsx +4 -4
  47. package/src/core/components/autocomplete/__workshop__/async.tsx +2 -2
  48. package/src/core/components/autocomplete/__workshop__/custom.tsx +2 -2
  49. package/src/core/components/autocomplete/__workshop__/focusAndBlur.tsx +3 -3
  50. package/src/core/primitives/button/__workshop__/custom.tsx +18 -41
  51. package/src/core/primitives/button/button.tsx +3 -1
  52. package/src/core/primitives/card/__workshop__/asButton.tsx +0 -9
  53. package/src/core/primitives/card/__workshop__/interactive.tsx +0 -1
  54. package/src/core/primitives/card/__workshop__/props.tsx +0 -3
  55. package/src/core/primitives/card/__workshop__/selected.tsx +6 -37
  56. package/src/core/primitives/heading/__workshop__/opticalAlignment.tsx +1 -1
  57. package/src/core/primitives/heading/__workshop__/plain.tsx +1 -8
  58. package/src/core/primitives/label/__workshop__/plain.tsx +1 -9
  59. package/src/core/primitives/text/__workshop__/example.tsx +1 -9
  60. package/src/css/{compilePalette.ts → _compilePalette.ts} +2 -2
  61. package/src/css/{compileSystem.ts → _compileSystem.ts} +1 -1
  62. package/src/css/{compileTheme.ts → _compileTheme.ts} +3 -3
  63. package/src/css/{compileTheme_v3.ts → _compileTheme_v3.ts} +7 -1
  64. package/src/css/_system.style.ts +1 -0
  65. package/src/css/index.ts +3 -3
  66. package/src/css/primitives/button/button.style.ts +23 -9
  67. package/src/css/primitives/button/button.ts +1 -12
  68. package/src/css/primitives/button/types.ts +1 -6
  69. package/src/css/primitives/card/card.style.ts +12 -21
  70. package/src/css/primitives/kbd/kbd.style.ts +3 -6
  71. package/src/css/types.ts +9 -9
  72. package/src/theme/v3/color/buildColor_v3.ts +53 -25
  73. package/src/theme/v3/color/card.ts +0 -42
  74. package/src/theme/v3/color/renderColor.test.ts +1 -0
  75. package/src/theme/v3/color/renderColor.ts +9 -2
  76. package/src/theme/v3/color/token.ts +1 -0
  77. package/src/theme/v3/defaultTokens.ts +7 -2
  78. package/dist/_chunks-cjs/_visual-editing.js.map +0 -1
  79. package/dist/_chunks-cjs/buildCommand.js.map +0 -1
  80. package/dist/_chunks-cjs/refractor.js.map +0 -1
  81. package/dist/_chunks-es/_visual-editing.mjs.map +0 -1
  82. package/dist/_chunks-es/refractor.mjs.map +0 -1
  83. package/dist/_visual-editing.mjs +0 -30
  84. package/dist/_visual-editing.mjs.map +0 -1
  85. package/dist/cli.js.map +0 -1
  86. package/dist/css.mjs.map +0 -1
  87. package/dist/sanity-palette.min.css +0 -1
  88. package/dist/sanity-theme.min.css +0 -1
  89. package/dist/system.min.css +0 -1
  90. package/dist/theme.mjs.map +0 -1
  91. package/src/css/primitives/button/_constants.ts +0 -17
  92. /package/dist/{_visual-editing.d.mts → _visual-editing.d.cts} +0 -0
  93. /package/dist/{cli.d.ts → cli.d.cts} +0 -0
  94. /package/dist/{index.d.mts → index.d.cts} +0 -0
@@ -1,14 +1,7 @@
1
- import { createColorTheme as createColorTheme$1, hexToRgb as hexToRgb$1, hslToRgb as hslToRgb$1, multiply as multiply$1, parseColor as parseColor$1, rgbToHex as rgbToHex$1, rgbToHsl as rgbToHsl$1, rgba as rgba$1, screen as screen$1, buildTheme_v3 } from "@sanity/ui/theme";
2
- import { isHTMLAnchorElement, isHTMLInputElement, isHTMLButtonElement, isHTMLSelectElement, isHTMLTextAreaElement, isHTMLElement, EMPTY_ARRAY, useElementSize, Code, _isEnterToClickElement, Card, Text, useArrayProp, EMPTY_RECORD, Box, Button, Stack, Popover, TextInput, AnimatedSpinnerIcon, useClickOutsideEvent, Flex, containsOrEqualsElement, usePortal, useBoundaryElement, useLayer, useGlobalKeyDown, createGlobalScopedContext, usePrefersReducedMotion, Portal, Z_OFFSETS, Container, Layer, Grid, LayerProvider, isRecord, Selectable } from "./_chunks-es/_visual-editing.mjs";
3
- import { Arrow, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, CardProvider, Checkbox, DEFAULT_ARROW_ELEMENT, DEFAULT_AVATAR_COUNTER_ELEMENT, DEFAULT_AVATAR_ELEMENT, DEFAULT_AVATAR_STACK_ELEMENT, DEFAULT_BADGE_ELEMENT, DEFAULT_BOX_ELEMENT, DEFAULT_BUTTON_ELEMENT, DEFAULT_CARD_ELEMENT, DEFAULT_CHECKBOX_ELEMENT, DEFAULT_CODE_ELEMENT, DEFAULT_CONTAINER_ELEMENT, DEFAULT_ELEMENT_QUERY_ELEMENT, DEFAULT_FLEX_ELEMENT, DEFAULT_GRID_ELEMENT, DEFAULT_HEADING_ELEMENT, DEFAULT_HOTKEYS_ELEMENT, DEFAULT_INLINE_ELEMENT, DEFAULT_KBD_ELEMENT, DEFAULT_LABEL_ELEMENT, DEFAULT_LAYER_ELEMENT, DEFAULT_MENU_DIVIDER_ELEMENT, DEFAULT_MENU_ELEMENT, DEFAULT_MENU_GROUP_ELEMENT, DEFAULT_MENU_ITEM_ELEMENT, DEFAULT_POPOVER_ELEMENT, DEFAULT_RADIO_ELEMENT, DEFAULT_SELECT_ELEMENT, DEFAULT_SPINNER_ELEMENT, DEFAULT_SR_ONLY_ELEMENT, DEFAULT_STACK_ELEMENT, DEFAULT_SWITCH_ELEMENT, DEFAULT_TAB_ELEMENT, DEFAULT_TAB_LIST_ELEMENT, DEFAULT_TEXT_AREA_ELEMENT, DEFAULT_TEXT_ELEMENT, DEFAULT_TEXT_INPUT_ELEMENT, DEFAULT_TOOLTIP_ELEMENT, DEFAULT_VIRTUAL_LIST_ELEMENT, ElementQuery, Heading, Hotkeys, Inline, KBD, Label, Menu, MenuDivider, MenuGroup, MenuItem, PortalProvider, Radio, Select, Spinner, SrOnly, Switch, Tab, TabList, TextArea, ThemeColorProvider, ThemeProvider, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupProvider, VirtualList, _ResizeObserver, _elementSizeObserver, _getArrayProp, _isScrollable, useCard, useCustomValidity, useMatchMedia, useMediaIndex, usePrefersDark, useRootTheme, useTheme, useTheme_v2, useTooltipDelayGroup } from "./_chunks-es/_visual-editing.mjs";
4
- import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
5
- import { ChevronDownIcon, CloseIcon, ToggleArrowRightIcon } from "@sanity/icons";
6
- import { useState, useRef, useEffect, useImperativeHandle, Component, useReducer, useCallback, useMemo, cloneElement, Children, isValidElement, Fragment, useContext, useSyncExternalStore, startTransition, memo, useId } from "react";
7
- import { c } from "react-compiler-runtime";
8
- import { composeClassNames, breadcrumbs, dialogCardRoot, dialogLayout, dialogHeader, dialogContent, dialogFooter, dialog, dialogContainer, skeleton, codeSkeleton, headingSkeleton, labelSkeleton, textSkeleton, toast, toastLoadingBar, toastLoadingBarMask, toastLoadingBarProgress, toastLayer, treeItem, compilePalette, compileTheme, compileSystem } from "@sanity/ui/css";
9
- import { px, rem } from "@sanity/ui/css";
10
- import { motion, AnimatePresence } from "framer-motion";
11
- const createColorTheme = createColorTheme$1, hexToRgb = hexToRgb$1, hslToRgb = hslToRgb$1, multiply = multiply$1, parseColor = parseColor$1, rgbToHex = rgbToHex$1, rgbToHsl = rgbToHsl$1, rgba = rgba$1, screen = screen$1;
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: !0 });
3
+ var theme = require("@sanity/ui/theme"), _visualEditing = require("./_chunks-cjs/_visual-editing.cjs"), jsxRuntime = require("react/jsx-runtime"), icons = require("@sanity/icons"), react = require("react"), reactCompilerRuntime = require("react-compiler-runtime"), css = require("@sanity/ui/css"), framerMotion = require("framer-motion");
4
+ const createColorTheme = theme.createColorTheme, hexToRgb = theme.hexToRgb, hslToRgb = theme.hslToRgb, multiply = theme.multiply, parseColor = theme.parseColor, rgbToHex = theme.rgbToHex, rgbToHsl = theme.rgbToHsl, rgba = theme.rgba, screen = theme.screen;
12
5
  function _responsive(media, values, callback) {
13
6
  return (values?.map(callback) || []).map((statement, mediaIndex) => mediaIndex === 0 ? statement : {
14
7
  [`@media screen and (min-width: ${media[mediaIndex - 1]}px)`]: statement
@@ -33,7 +26,7 @@ function _hasFocus(element) {
33
26
  return !!document.activeElement && element.contains(document.activeElement);
34
27
  }
35
28
  function isFocusable(element) {
36
- return element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null ? !0 : isHTMLAnchorElement(element) ? !!element.href && element.rel !== "ignore" : isHTMLInputElement(element) ? element.type !== "hidden" && element.type !== "file" && !element.disabled : isHTMLButtonElement(element) || isHTMLSelectElement(element) || isHTMLTextAreaElement(element) ? !element.disabled : !1;
29
+ return element.tabIndex > 0 || element.tabIndex === 0 && element.getAttribute("tabIndex") !== null ? !0 : _visualEditing.isHTMLAnchorElement(element) ? !!element.href && element.rel !== "ignore" : _visualEditing.isHTMLInputElement(element) ? element.type !== "hidden" && element.type !== "file" && !element.disabled : _visualEditing.isHTMLButtonElement(element) || _visualEditing.isHTMLSelectElement(element) || _visualEditing.isHTMLTextAreaElement(element) ? !element.disabled : !1;
37
30
  }
38
31
  function attemptFocus(element) {
39
32
  if (!isFocusable(element))
@@ -47,7 +40,7 @@ function attemptFocus(element) {
47
40
  function focusFirstDescendant(element) {
48
41
  for (let i = 0; i < element.childNodes.length; i++) {
49
42
  const child = element.childNodes[i];
50
- if (isHTMLElement(child) && (attemptFocus(child) || focusFirstDescendant(child)))
43
+ if (_visualEditing.isHTMLElement(child) && (attemptFocus(child) || focusFirstDescendant(child)))
51
44
  return !0;
52
45
  }
53
46
  return !1;
@@ -55,7 +48,7 @@ function focusFirstDescendant(element) {
55
48
  function focusLastDescendant(element) {
56
49
  for (let i = element.childNodes.length - 1; i >= 0; i--) {
57
50
  const child = element.childNodes[i];
58
- if (isHTMLElement(child) && (attemptFocus(child) || focusLastDescendant(child)))
51
+ if (_visualEditing.isHTMLElement(child) && (attemptFocus(child) || focusLastDescendant(child)))
59
52
  return !0;
60
53
  }
61
54
  return !1;
@@ -67,10 +60,10 @@ function _getElements(element, elementsArg) {
67
60
  return ret.filter(Boolean);
68
61
  }
69
62
  function useClickOutside(listener, t0, boundaryElement) {
70
- const $ = c(12), elementsArg = t0 === void 0 ? EMPTY_ARRAY : t0, [element, setElement] = useState(null);
63
+ const $ = reactCompilerRuntime.c(12), elementsArg = t0 === void 0 ? _visualEditing.EMPTY_ARRAY : t0, [element, setElement] = react.useState(null);
71
64
  let t1;
72
65
  $[0] !== element || $[1] !== elementsArg ? (t1 = () => _getElements(element, elementsArg), $[0] = element, $[1] = elementsArg, $[2] = t1) : t1 = $[2];
73
- const [elements, setElements] = useState(t1), elementsRef = useRef(elements);
66
+ const [elements, setElements] = react.useState(t1), elementsRef = react.useRef(elements);
74
67
  let t2, t3;
75
68
  $[3] !== element || $[4] !== elementsArg ? (t2 = () => {
76
69
  const prevElements = elementsRef.current, nextElements = _getElements(element, elementsArg);
@@ -88,7 +81,7 @@ function useClickOutside(listener, t0, boundaryElement) {
88
81
  setElements(nextElements), elementsRef.current = nextElements;
89
82
  return;
90
83
  }
91
- }, t3 = [element, elementsArg], $[3] = element, $[4] = elementsArg, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), useEffect(t2, t3);
84
+ }, t3 = [element, elementsArg], $[3] = element, $[4] = elementsArg, $[5] = t2, $[6] = t3) : (t2 = $[5], t3 = $[6]), react.useEffect(t2, t3);
92
85
  let t4, t5;
93
86
  return $[7] !== boundaryElement || $[8] !== elements || $[9] !== listener ? (t4 = () => {
94
87
  if (!listener)
@@ -105,17 +98,17 @@ function useClickOutside(listener, t0, boundaryElement) {
105
98
  return window.addEventListener("mousedown", handleWindowMouseDown), () => {
106
99
  window.removeEventListener("mousedown", handleWindowMouseDown);
107
100
  };
108
- }, t5 = [boundaryElement, listener, elements], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), useEffect(t4, t5), setElement;
101
+ }, t5 = [boundaryElement, listener, elements], $[7] = boundaryElement, $[8] = elements, $[9] = listener, $[10] = t4, $[11] = t5) : (t4 = $[10], t5 = $[11]), react.useEffect(t4, t5), setElement;
109
102
  }
110
103
  function useElementRect(element) {
111
- return useElementSize(element)?._contentRect || null;
104
+ return _visualEditing.useElementSize(element)?._contentRect || null;
112
105
  }
113
106
  function useForwardedRef(ref) {
114
- const $ = c(1), innerRef = useRef(null);
107
+ const $ = reactCompilerRuntime.c(1), innerRef = react.useRef(null);
115
108
  let t0;
116
- return $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => innerRef.current, $[0] = t0) : t0 = $[0], useImperativeHandle(ref, t0), innerRef;
109
+ return $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => innerRef.current, $[0] = t0) : t0 = $[0], react.useImperativeHandle(ref, t0), innerRef;
117
110
  }
118
- class ErrorBoundary extends Component {
111
+ class ErrorBoundary extends react.Component {
119
112
  state = {
120
113
  error: null
121
114
  };
@@ -137,13 +130,13 @@ class ErrorBoundary extends Component {
137
130
  } = this.state;
138
131
  if (error) {
139
132
  const message = typeof error?.message == "string" ? error.message : "Error";
140
- return /* @__PURE__ */ jsx(Code, { children: message });
133
+ return /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Code, { children: message });
141
134
  }
142
135
  return this.props.children;
143
136
  }
144
137
  }
145
138
  function AutocompleteOption(props) {
146
- const $ = c(11), {
139
+ const $ = reactCompilerRuntime.c(11), {
147
140
  children,
148
141
  id,
149
142
  onSelect,
@@ -159,11 +152,11 @@ function AutocompleteOption(props) {
159
152
  const handleClick = t0;
160
153
  let t1;
161
154
  $[3] !== handleClick ? (t1 = (event) => {
162
- event.key === "Enter" && !_isEnterToClickElement(event.currentTarget) && handleClick();
155
+ event.key === "Enter" && !_visualEditing._isEnterToClickElement(event.currentTarget) && handleClick();
163
156
  }, $[3] = handleClick, $[4] = t1) : t1 = $[4];
164
157
  const handleKeyDown = t1;
165
158
  let t2;
166
- return $[5] !== children || $[6] !== handleClick || $[7] !== handleKeyDown || $[8] !== id || $[9] !== selected ? (t2 = /* @__PURE__ */ jsx("li", { "aria-selected": selected, "data-ui": "AutocompleteOption", id, role: "option", onClick: handleClick, onKeyDown: handleKeyDown, children }), $[5] = children, $[6] = handleClick, $[7] = handleKeyDown, $[8] = id, $[9] = selected, $[10] = t2) : t2 = $[10], t2;
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;
167
160
  }
168
161
  AutocompleteOption.displayName = "AutocompleteOption";
169
162
  function autocompleteReducer(state, msg) {
@@ -216,7 +209,7 @@ function Autocomplete(props) {
216
209
  fontSize = 2,
217
210
  icon,
218
211
  id,
219
- listBox = EMPTY_RECORD,
212
+ listBox = _visualEditing.EMPTY_RECORD,
220
213
  loading,
221
214
  onBlur,
222
215
  onChange,
@@ -227,7 +220,7 @@ function Autocomplete(props) {
227
220
  openOnFocus,
228
221
  options: optionsProp,
229
222
  padding: paddingProp = 3,
230
- popover = EMPTY_RECORD,
223
+ popover = _visualEditing.EMPTY_RECORD,
231
224
  prefix,
232
225
  radius = 2,
233
226
  readOnly,
@@ -239,7 +232,7 @@ function Autocomplete(props) {
239
232
  suffix,
240
233
  value: valueProp,
241
234
  ...rest
242
- } = props, [state, dispatch] = useReducer(autocompleteReducer, {
235
+ } = props, [state, dispatch] = react.useReducer(autocompleteReducer, {
243
236
  activeValue: valueProp || null,
244
237
  focused: !1,
245
238
  listFocused: !1,
@@ -251,11 +244,11 @@ function Autocomplete(props) {
251
244
  listFocused,
252
245
  query,
253
246
  value
254
- } = state, defaultRenderOption = useCallback(({
247
+ } = state, defaultRenderOption = react.useCallback(({
255
248
  value: value_0
256
- }) => /* @__PURE__ */ jsx(Card, { as: "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsx(Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 }) }), [fontSize, paddingProp]), renderOption = typeof renderOptionProp == "function" ? renderOptionProp : defaultRenderOption, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = useRef(null), resultsPopoverElementRef = useRef(null), inputElementRef = useRef(null), listBoxElementRef = useRef(null), listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1);
257
- useImperativeHandle(forwardedRef, () => inputElementRef.current);
258
- const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = useArrayProp(paddingProp), currentOption = useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = useMemo(() => options.filter((option) => query ? filterOption(query, option) : !0), [filterOption, options, query]), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur = useCallback((event) => {
249
+ }) => /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Card, { as: "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 }) }), [fontSize, paddingProp]), renderOption = typeof renderOptionProp == "function" ? renderOptionProp : defaultRenderOption, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = react.useRef(null), resultsPopoverElementRef = react.useRef(null), inputElementRef = react.useRef(null), listBoxElementRef = react.useRef(null), listFocusedRef = react.useRef(!1), valueRef = react.useRef(value), valuePropRef = react.useRef(valueProp), popoverMouseWithinRef = react.useRef(!1);
250
+ react.useImperativeHandle(forwardedRef, () => inputElementRef.current);
251
+ const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : _visualEditing.EMPTY_ARRAY, padding = _visualEditing.useArrayProp(paddingProp), currentOption = react.useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = react.useMemo(() => options.filter((option) => query ? filterOption(query, option) : !0), [filterOption, options, query]), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur = react.useCallback((event) => {
259
252
  setTimeout(() => {
260
253
  if (popoverMouseWithinRef.current)
261
254
  return;
@@ -272,18 +265,18 @@ function Autocomplete(props) {
272
265
  type: "root/blur"
273
266
  }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
274
267
  }, 0);
275
- }, [onBlur, onQueryChange, relatedElements]), handleRootFocus = useCallback((event_0) => {
268
+ }, [onBlur, onQueryChange, relatedElements]), handleRootFocus = react.useCallback((event_0) => {
276
269
  const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
277
270
  listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
278
271
  type: "root/setListFocused",
279
272
  listFocused: listFocused_0
280
273
  }));
281
- }, []), handleOptionSelect = useCallback((v) => {
274
+ }, []), handleOptionSelect = react.useCallback((v) => {
282
275
  dispatch({
283
276
  type: "value/change",
284
277
  value: v
285
278
  }), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
286
- }, [onChange, onSelect, onQueryChange]), handleRootKeyDown = useCallback((event_1) => {
279
+ }, [onChange, onSelect, onQueryChange]), handleRootKeyDown = react.useCallback((event_1) => {
287
280
  if (event_1.key === "ArrowDown") {
288
281
  if (event_1.preventDefault(), !filteredOptionsLen) return;
289
282
  const activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
@@ -315,35 +308,35 @@ function Autocomplete(props) {
315
308
  inputElementRef.current?.focus();
316
309
  return;
317
310
  }
318
- }, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange = useCallback((event_2) => {
311
+ }, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange = react.useCallback((event_2) => {
319
312
  const nextQuery = event_2.currentTarget.value;
320
313
  dispatch({
321
314
  type: "input/change",
322
315
  query: nextQuery
323
316
  }), onQueryChange && onQueryChange(nextQuery);
324
- }, [onQueryChange]), dispatchOpen = useCallback(() => {
317
+ }, [onQueryChange]), dispatchOpen = react.useCallback(() => {
325
318
  dispatch({
326
319
  type: "root/open",
327
320
  query: value ? renderValue(value, currentOption) : ""
328
321
  });
329
- }, [currentOption, renderValue, value]), handleInputFocus = useCallback((event_3) => {
322
+ }, [currentOption, renderValue, value]), handleInputFocus = react.useCallback((event_3) => {
330
323
  focused || (dispatch({
331
324
  type: "input/focus"
332
325
  }), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
333
- }, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter = useCallback(() => {
326
+ }, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter = react.useCallback(() => {
334
327
  popoverMouseWithinRef.current = !0;
335
- }, []), handlePopoverMouseLeave = useCallback(() => {
328
+ }, []), handlePopoverMouseLeave = react.useCallback(() => {
336
329
  popoverMouseWithinRef.current = !1;
337
- }, []), handleClearButtonClick = useCallback(() => {
330
+ }, []), handleClearButtonClick = react.useCallback(() => {
338
331
  dispatch({
339
332
  type: "root/clear"
340
333
  }), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
341
- }, [onChange, onQueryChange]), handleClearButtonFocus = useCallback(() => {
334
+ }, [onChange, onQueryChange]), handleClearButtonFocus = react.useCallback(() => {
342
335
  dispatch({
343
336
  type: "input/focus"
344
337
  });
345
338
  }, []);
346
- useEffect(() => {
339
+ react.useEffect(() => {
347
340
  if (valueProp !== valuePropRef.current) {
348
341
  valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
349
342
  type: "value/change",
@@ -355,12 +348,12 @@ function Autocomplete(props) {
355
348
  type: "value/change",
356
349
  value: valueProp || null
357
350
  }));
358
- }, [valueProp]), useEffect(() => {
351
+ }, [valueProp]), react.useEffect(() => {
359
352
  !focused && valueRef.current && dispatch({
360
353
  type: "root/setActiveValue",
361
354
  value: valueRef.current
362
355
  });
363
- }, [focused]), useEffect(() => {
356
+ }, [focused]), react.useEffect(() => {
364
357
  const listElement = listBoxElementRef.current;
365
358
  if (!listElement) return;
366
359
  const activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
@@ -373,33 +366,33 @@ function Autocomplete(props) {
373
366
  }
374
367
  }
375
368
  }, [activeValue, filteredOptions]);
376
- const clearButton = useMemo(() => {
369
+ const clearButton = react.useMemo(() => {
377
370
  if (!loading && !disabled && value)
378
371
  return {
379
372
  "aria-label": "Clear",
380
373
  onFocus: handleClearButtonFocus
381
374
  };
382
- }, [disabled, handleClearButtonFocus, loading, value]), openButtonBoxPadding = useMemo(() => padding.map((v_0) => v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2), [padding]), openButtonPadding = useMemo(() => padding.map((v_1) => Math.max(v_1 - 1, 0)), [padding]), openButtonProps = useMemo(() => typeof openButton == "object" ? openButton : EMPTY_RECORD, [openButton]), handleOpenClick = useCallback((event_4) => {
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) => {
383
376
  dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
384
- }, [openButtonProps, dispatchOpen]), openButtonNode = useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsx(Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsx(Button, { "aria-label": "Open", disabled: expanded, display: "block", fontSize, icon: ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, [disabled, expanded, fontSize, handleOpenClick, openButton, openButtonBoxPadding, openButtonPadding, openButtonProps, readOnly]), inputValue = useMemo(() => query === null ? value !== null ? renderValue(value, currentOption) : "" : query, [currentOption, query, renderValue, value]), input = /* @__PURE__ */ jsx(TextInput, { ...rest, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", as, border, clearButton, customValidity, disabled, fontSize, icon, iconRight: loading && AnimatedSpinnerIcon, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: inputElementRef, role: "combobox", spellCheck: !1, suffix: suffix || openButtonNode, value: inputValue }), handleListBoxKeyDown = useCallback((event_5) => {
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) => {
385
378
  event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
386
- }, [listFocused]), content2 = useMemo(() => filteredOptions.length === 0 ? null : /* @__PURE__ */ jsx(Box, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: /* @__PURE__ */ jsx(Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", id: listBoxId, ref: listBoxElementRef, role: "listbox", space: 1, children: filteredOptions.map((option_0) => {
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) => {
387
380
  const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
388
- return /* @__PURE__ */ jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: cloneElement(renderOption(option_0), {
381
+ return /* @__PURE__ */ jsxRuntime.jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: react.cloneElement(renderOption(option_0), {
389
382
  disabled: loading,
390
383
  selected: active,
391
384
  tabIndex: listFocused && active ? 0 : -1
392
385
  }) }, option_0.value);
393
- }) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = useMemo(() => renderPopover ? renderPopover({
386
+ }) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = react.useMemo(() => renderPopover ? renderPopover({
394
387
  content: content2,
395
388
  hidden: !expanded,
396
389
  inputElement: inputElementRef.current,
397
390
  onMouseEnter: handlePopoverMouseEnter,
398
391
  onMouseLeave: handlePopoverMouseLeave
399
- }, resultsPopoverElementRef) : filteredOptionsLen === 0 ? null : /* @__PURE__ */ jsx(Popover, { arrow: !1, constrainSize: !0, content: content2, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius: 3, ref: resultsPopoverElementRef, referenceElement: inputElementRef.current, ...popover }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover, renderPopover]);
392
+ }, resultsPopoverElementRef) : filteredOptionsLen === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { arrow: !1, constrainSize: !0, content: content2, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius: 3, ref: resultsPopoverElementRef, referenceElement: inputElementRef.current, ...popover }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover, renderPopover]);
400
393
  return (
401
394
  // eslint-disable-next-line jsx-a11y/no-static-element-interactions
402
- /* @__PURE__ */ jsxs("div", { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
395
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
403
396
  input,
404
397
  results
405
398
  ] })
@@ -422,28 +415,28 @@ function Breadcrumbs(props) {
422
415
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
423
416
  space: _spaceProp,
424
417
  ...rest
425
- } = props, [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null), collapse = useCallback(() => setOpen(!1), []), expand = useCallback(() => setOpen(!0), []);
426
- useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
427
- const rawItems = useMemo(() => Children.toArray(children).filter(isValidElement), [children]), items = useMemo(() => {
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), []);
419
+ _visualEditing.useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
420
+ const rawItems = react.useMemo(() => react.Children.toArray(children).filter(react.isValidElement), [children]), items = react.useMemo(() => {
428
421
  const len = rawItems.length;
429
422
  if (maxLength && len > maxLength) {
430
423
  const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
431
- return [...rawItems.slice(0, beforeLength - 1), /* @__PURE__ */ jsx(Popover, { constrainSize: !0, content: /* @__PURE__ */ jsx(Stack, { as: "ol", overflow: "auto", space: gapY, children: rawItems.slice(beforeLength - 1, len - afterLength) }), open, padding: 2, placement: "top", portal: !0, ref: popoverElementRef, children: /* @__PURE__ */ jsx(Button, { mode: "bleed", padding: 0, text: "\u2026", ...expandButtonProps, onClick: open ? collapse : expand, ref: expandElementRef, selected: open }) }, "button"), ...rawItems.slice(len - afterLength)];
424
+ return [...rawItems.slice(0, beforeLength - 1), /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { constrainSize: !0, content: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ol", overflow: "auto", space: gapY, children: rawItems.slice(beforeLength - 1, len - afterLength) }), open, padding: 2, placement: "top", portal: !0, ref: popoverElementRef, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { mode: "bleed", padding: 0, text: "\u2026", ...expandButtonProps, onClick: open ? collapse : expand, ref: expandElementRef, selected: open }) }, "button"), ...rawItems.slice(len - afterLength)];
432
425
  }
433
426
  return rawItems;
434
427
  }, [collapse, expand, expandButtonProps, gapY, maxLength, open, rawItems]);
435
- return /* @__PURE__ */ jsx(Flex, { as, "data-ui": "Breadcrumbs", ...rest, className: composeClassNames(className, breadcrumbs()), gapX, gapY, children: items.map((item, itemIndex) => /* @__PURE__ */ jsxs(Fragment, { children: [
436
- itemIndex > 0 && /* @__PURE__ */ jsx(Box, { "aria-hidden": !0, as: "li", children: separator || /* @__PURE__ */ jsx(Text, { muted: !0, children: "/" }) }),
437
- /* @__PURE__ */ jsx(Box, { as: "li", children: item })
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: [
429
+ itemIndex > 0 && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": !0, as: "li", children: separator || /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted: !0, children: "/" }) }),
430
+ /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { as: "li", children: item })
438
431
  ] }, itemIndex)) });
439
432
  }
440
433
  Breadcrumbs.displayName = "Breadcrumbs";
441
434
  function isTargetWithinScope(boundaryElement, portalElement, target) {
442
- return !boundaryElement || !portalElement ? !0 : containsOrEqualsElement(boundaryElement, target) || containsOrEqualsElement(portalElement, target);
435
+ return !boundaryElement || !portalElement ? !0 : _visualEditing.containsOrEqualsElement(boundaryElement, target) || _visualEditing.containsOrEqualsElement(portalElement, target);
443
436
  }
444
437
  const DEFAULT_DIALOG_CARD_ELEMENT = "div";
445
438
  function DialogCard(props) {
446
- const $ = c(51), t0 = props;
439
+ const $ = reactCompilerRuntime.c(51), t0 = props;
447
440
  let autoFocus, children, footer, forwardedContentRef, forwardedRef, header, hideCloseButton, id, onClickOutside, onClose, portalProp, rest, t1;
448
441
  $[0] !== t0 ? ({
449
442
  __unstable_autoFocus: autoFocus,
@@ -460,65 +453,65 @@ function DialogCard(props) {
460
453
  ref: forwardedRef,
461
454
  ...rest
462
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]);
463
- const as = t1 === void 0 ? DEFAULT_DIALOG_CARD_ELEMENT : t1, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, ref = useRef(null), contentRef = useRef(null), layer = useLayer(), {
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(), {
464
457
  isTopLayer
465
458
  } = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton;
466
459
  let t2;
467
- $[14] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[14] = t2) : t2 = $[14], useImperativeHandle(forwardedRef, t2);
460
+ $[14] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => ref.current, $[14] = t2) : t2 = $[14], react.useImperativeHandle(forwardedRef, t2);
468
461
  let t3;
469
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => contentRef.current, $[15] = t3) : t3 = $[15], useImperativeHandle(forwardedContentRef, t3);
462
+ $[15] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => contentRef.current, $[15] = t3) : t3 = $[15], react.useImperativeHandle(forwardedContentRef, t3);
470
463
  let t4, t5;
471
464
  $[16] !== autoFocus ? (t4 = () => {
472
465
  autoFocus && ref.current && focusFirstDescendant(ref.current);
473
- }, t5 = [autoFocus, ref], $[16] = autoFocus, $[17] = t4, $[18] = t5) : (t4 = $[17], t5 = $[18]), useEffect(t4, t5);
466
+ }, t5 = [autoFocus, ref], $[16] = autoFocus, $[17] = t4, $[18] = t5) : (t4 = $[17], t5 = $[18]), react.useEffect(t4, t5);
474
467
  let t6;
475
468
  $[19] !== boundaryElement || $[20] !== isTopLayer || $[21] !== onClose || $[22] !== portalElement ? (t6 = (event) => {
476
469
  if (!isTopLayer || !onClose)
477
470
  return;
478
471
  const target = document.activeElement;
479
472
  target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
480
- }, $[19] = boundaryElement, $[20] = isTopLayer, $[21] = onClose, $[22] = portalElement, $[23] = t6) : t6 = $[23], useGlobalKeyDown(t6);
473
+ }, $[19] = boundaryElement, $[20] = isTopLayer, $[21] = onClose, $[22] = portalElement, $[23] = t6) : t6 = $[23], _visualEditing.useGlobalKeyDown(t6);
481
474
  let t7;
482
475
  $[24] !== boundaryElement || $[25] !== isTopLayer || $[26] !== onClickOutside || $[27] !== portalElement ? (t7 = isTopLayer && onClickOutside && ((event_0) => {
483
476
  const target_0 = event_0.target;
484
477
  target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
485
478
  }), $[24] = boundaryElement, $[25] = isTopLayer, $[26] = onClickOutside, $[27] = portalElement, $[28] = t7) : t7 = $[28];
486
479
  let t8;
487
- $[29] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => [ref.current], $[29] = t8) : t8 = $[29], useClickOutsideEvent(t7, t8);
480
+ $[29] === Symbol.for("react.memo_cache_sentinel") ? (t8 = () => [ref.current], $[29] = t8) : t8 = $[29], _visualEditing.useClickOutsideEvent(t7, t8);
488
481
  let t9;
489
- $[30] === Symbol.for("react.memo_cache_sentinel") ? (t9 = dialogCardRoot(), $[30] = t9) : t9 = $[30];
482
+ $[30] === Symbol.for("react.memo_cache_sentinel") ? (t9 = css.dialogCardRoot(), $[30] = t9) : t9 = $[30];
490
483
  let t10;
491
- $[31] === Symbol.for("react.memo_cache_sentinel") ? (t10 = dialogLayout(), $[31] = t10) : t10 = $[31];
484
+ $[31] === Symbol.for("react.memo_cache_sentinel") ? (t10 = css.dialogLayout(), $[31] = t10) : t10 = $[31];
492
485
  let t11;
493
- $[32] !== header || $[33] !== labelId || $[34] !== onClose || $[35] !== showCloseButton || $[36] !== showHeader ? (t11 = showHeader && /* @__PURE__ */ jsx(Box, { className: dialogHeader(), position: "relative", children: /* @__PURE__ */ jsxs(Flex, { align: "flex-start", padding: 3, children: [
494
- /* @__PURE__ */ jsx(Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsx(Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
495
- showCloseButton && /* @__PURE__ */ jsx(Box, { flex: "none", children: /* @__PURE__ */ jsx(Button, { "aria-label": "Close dialog", disabled: !onClose, icon: CloseIcon, mode: "bleed", onClick: onClose, padding: 2 }) })
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: [
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 }) }),
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 }) })
496
489
  ] }) }), $[32] = header, $[33] = labelId, $[34] = onClose, $[35] = showCloseButton, $[36] = showHeader, $[37] = t11) : t11 = $[37];
497
490
  let t12;
498
- $[38] === Symbol.for("react.memo_cache_sentinel") ? (t12 = dialogContent(), $[38] = t12) : t12 = $[38];
491
+ $[38] === Symbol.for("react.memo_cache_sentinel") ? (t12 = css.dialogContent(), $[38] = t12) : t12 = $[38];
499
492
  let t13;
500
- $[39] !== children ? (t13 = /* @__PURE__ */ jsx(Box, { className: t12, flex: 1, overflow: "auto", position: "relative", ref: contentRef, tabIndex: -1, children }), $[39] = children, $[40] = t13) : t13 = $[40];
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];
501
494
  let t14;
502
- $[41] !== footer ? (t14 = footer && /* @__PURE__ */ jsx(Box, { className: dialogFooter(), position: "relative", children: footer }), $[41] = footer, $[42] = t14) : t14 = $[42];
495
+ $[41] !== footer ? (t14 = footer && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { className: css.dialogFooter(), position: "relative", children: footer }), $[41] = footer, $[42] = t14) : t14 = $[42];
503
496
  let t15;
504
- $[43] !== t11 || $[44] !== t13 || $[45] !== t14 ? (t15 = /* @__PURE__ */ jsxs(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: [
505
498
  t11,
506
499
  t13,
507
500
  t14
508
501
  ] }), $[43] = t11, $[44] = t13, $[45] = t14, $[46] = t15) : t15 = $[46];
509
502
  let t16;
510
- return $[47] !== as || $[48] !== rest || $[49] !== t15 ? (t16 = /* @__PURE__ */ jsx(Card, { ...rest, as, className: t9, display: "flex", ref, children: t15 }), $[47] = as, $[48] = rest, $[49] = t15, $[50] = t16) : t16 = $[50], t16;
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;
511
504
  }
512
505
  DialogCard.displayName = "DialogCard";
513
- const DialogContext = createGlobalScopedContext("@sanity/ui/context/dialog", {
506
+ const DialogContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/dialog", {
514
507
  version: 0
515
508
  });
516
509
  function useDialog() {
517
- return useContext(DialogContext);
510
+ return react.useContext(DialogContext);
518
511
  }
519
512
  const DEFAULT_DIALOG_ELEMENT = "div";
520
513
  function Dialog(props) {
521
- const $ = c(69), context = useDialog(), t0 = props;
514
+ const $ = reactCompilerRuntime.c(69), context = useDialog(), t0 = props;
522
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;
523
516
  $[0] !== t0 ? ({
524
517
  __unstable_autoFocus: t1,
@@ -545,7 +538,7 @@ function Dialog(props) {
545
538
  tone,
546
539
  ...rest
547
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]);
548
- const autoFocus = t1 === void 0 ? !0 : t1, hideCloseButton = t2 === void 0 ? !1 : t2, _animate = t3 === void 0 ? !1 : t3, cardRadiusProp = t4 === void 0 ? 4 : t4, padding = t5 === void 0 ? 3 : t5, cardShadow = t6 === void 0 ? 4 : t6, width = t7 === void 0 ? 0 : t7, positionProp = _positionProp ?? context.position ?? "fixed", zOffsetProp = _zOffsetProp ?? context.zOffset ?? Z_OFFSETS.dialog, animate = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = useArrayProp(cardRadiusProp), position = useArrayProp(positionProp), zOffset = useArrayProp(zOffsetProp), preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
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);
549
542
  let t8;
550
543
  $[24] !== onFocus ? (t8 = (event) => {
551
544
  onFocus?.(event);
@@ -558,9 +551,9 @@ function Dialog(props) {
558
551
  focusFirstDescendant(cardElement);
559
552
  return;
560
553
  }
561
- isHTMLElement(event.target) && (focusedElementRef.current = event.target);
554
+ _visualEditing.isHTMLElement(event.target) && (focusedElementRef.current = event.target);
562
555
  }, $[24] = onFocus, $[25] = t8) : t8 = $[25];
563
- const handleFocus = t8, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0);
556
+ const handleFocus = t8, labelId = `${id}_label`, rootClickTimeoutRef = react.useRef(void 0);
564
557
  let t9;
565
558
  $[26] !== boundaryElement || $[27] !== portalElement ? (t9 = () => {
566
559
  rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
@@ -578,30 +571,30 @@ function Dialog(props) {
578
571
  }, $[26] = boundaryElement, $[27] = portalElement, $[28] = t9) : t9 = $[28];
579
572
  const handleRootClick = t9;
580
573
  let t10;
581
- $[29] !== className ? (t10 = composeClassNames(className, dialog()), $[29] = className, $[30] = t10) : t10 = $[30];
574
+ $[29] !== className ? (t10 = css.composeClassNames(className, css.dialog()), $[29] = className, $[30] = t10) : t10 = $[30];
582
575
  const t11 = animate ? "" : void 0;
583
576
  let t12;
584
- $[31] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[31] = t12) : t12 = $[31];
577
+ $[31] === Symbol.for("react.memo_cache_sentinel") ? (t12 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: preDivRef, tabIndex: 0 }), $[31] = t12) : t12 = $[31];
585
578
  let t13;
586
- $[32] === Symbol.for("react.memo_cache_sentinel") ? (t13 = dialogContainer(), $[32] = t13) : t13 = $[32];
579
+ $[32] === Symbol.for("react.memo_cache_sentinel") ? (t13 = css.dialogContainer(), $[32] = t13) : t13 = $[32];
587
580
  let t14;
588
- $[33] !== autoFocus || $[34] !== cardRadius || $[35] !== cardShadow || $[36] !== children || $[37] !== contentRef || $[38] !== footer || $[39] !== header || $[40] !== hideCloseButton || $[41] !== id || $[42] !== onClickOutside || $[43] !== onClose || $[44] !== portalProp || $[45] !== scheme || $[46] !== tone || $[47] !== width ? (t14 = /* @__PURE__ */ jsx(DialogCard, { __unstable_autoFocus: autoFocus, __unstable_hideCloseButton: hideCloseButton, contentRef, footer, header, id, onClickOutside, onClose, portal: portalProp, radius: cardRadius, ref: cardRef, scheme, shadow: cardShadow, tone, width, children }), $[33] = autoFocus, $[34] = cardRadius, $[35] = cardShadow, $[36] = children, $[37] = contentRef, $[38] = footer, $[39] = header, $[40] = hideCloseButton, $[41] = id, $[42] = onClickOutside, $[43] = onClose, $[44] = portalProp, $[45] = scheme, $[46] = tone, $[47] = width, $[48] = t14) : t14 = $[48];
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];
589
582
  let t15;
590
- $[49] !== t14 || $[50] !== width ? (t15 = /* @__PURE__ */ jsx(Container, { align: "center", className: t13, "data-ui": "DialogCard", direction: "column", display: "flex", justify: "center", width, children: t14 }), $[49] = t14, $[50] = width, $[51] = t15) : t15 = $[51];
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];
591
584
  let t16;
592
- $[52] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[52] = t16) : t16 = $[52];
585
+ $[52] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: postDivRef, tabIndex: 0 }), $[52] = t16) : t16 = $[52];
593
586
  let t17;
594
- $[53] !== handleFocus || $[54] !== handleRootClick || $[55] !== id || $[56] !== labelId || $[57] !== onActivate || $[58] !== padding || $[59] !== position || $[60] !== rest || $[61] !== t10 || $[62] !== t11 || $[63] !== t15 || $[64] !== zOffset ? (t17 = /* @__PURE__ */ jsxs(Layer, { ...rest, "aria-labelledby": labelId, "aria-modal": !0, className: t10, "data-animate": t11, "data-ui": "Dialog", display: "flex", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, padding, position, role: "dialog", zOffset, children: [
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: [
595
588
  t12,
596
589
  t15,
597
590
  t16
598
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];
599
592
  let t18;
600
- return $[66] !== portalProp || $[67] !== t17 ? (t18 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t17 }), $[66] = portalProp, $[67] = t17, $[68] = t18) : t18 = $[68], t18;
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;
601
594
  }
602
595
  Dialog.displayName = "Dialog";
603
596
  function DialogProvider(props) {
604
- const $ = c(6), {
597
+ const $ = reactCompilerRuntime.c(6), {
605
598
  children,
606
599
  position,
607
600
  zOffset
@@ -614,11 +607,11 @@ function DialogProvider(props) {
614
607
  }, $[0] = position, $[1] = zOffset, $[2] = t1) : t1 = $[2], t0 = t1;
615
608
  const contextValue = t0;
616
609
  let t2;
617
- return $[3] !== children || $[4] !== contextValue ? (t2 = /* @__PURE__ */ jsx(DialogContext.Provider, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t2) : t2 = $[5], t2;
610
+ return $[3] !== children || $[4] !== contextValue ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(DialogContext.Provider, { value: contextValue, children }), $[3] = children, $[4] = contextValue, $[5] = t2) : t2 = $[5], t2;
618
611
  }
619
612
  DialogProvider.displayName = "DialogProvider";
620
613
  function MenuButton(props) {
621
- const $ = c(63), {
614
+ const $ = reactCompilerRuntime.c(63), {
622
615
  __unstable_disableRestoreFocusOnClose: t0,
623
616
  boundaryElement: deprecated_boundaryElement,
624
617
  button: buttonProp,
@@ -633,22 +626,22 @@ function MenuButton(props) {
633
626
  popoverRadius: deprecated_popoverRadius,
634
627
  preventOverflow: deprecated_preventOverflow,
635
628
  ref: forwardedRef
636
- } = props, disableRestoreFocusOnClose = t0 === void 0 ? !1 : t0, deprecated_portal = t1 === void 0 ? !0 : t1, [open, setOpen] = useState(!1), [shouldFocus, setShouldFocus] = useState(null), [buttonElement, setButtonElement] = useState(null);
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);
637
630
  let t2;
638
631
  $[0] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[0] = t2) : t2 = $[0];
639
- const [menuElements, setChildMenuElements] = useState(t2), openRef = useRef(open);
632
+ const [menuElements, setChildMenuElements] = react.useState(t2), openRef = react.useRef(open);
640
633
  let t3, t4;
641
634
  $[1] !== onOpen || $[2] !== open ? (t3 = () => {
642
635
  onOpen && open && !openRef.current && onOpen();
643
- }, t4 = [onOpen, open], $[1] = onOpen, $[2] = open, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), useEffect(t3, t4);
636
+ }, t4 = [onOpen, open], $[1] = onOpen, $[2] = open, $[3] = t3, $[4] = t4) : (t3 = $[3], t4 = $[4]), react.useEffect(t3, t4);
644
637
  let t5, t6;
645
638
  $[5] !== onClose || $[6] !== open ? (t5 = () => {
646
639
  onClose && !open && openRef.current && onClose();
647
- }, t6 = [onClose, open], $[5] = onClose, $[6] = open, $[7] = t5, $[8] = t6) : (t5 = $[7], t6 = $[8]), useEffect(t5, t6);
640
+ }, t6 = [onClose, open], $[5] = onClose, $[6] = open, $[7] = t5, $[8] = t6) : (t5 = $[7], t6 = $[8]), react.useEffect(t5, t6);
648
641
  let t7, t8;
649
642
  $[9] !== open ? (t7 = () => {
650
643
  openRef.current = open;
651
- }, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), useEffect(t7, t8);
644
+ }, t8 = [open], $[9] = open, $[10] = t7, $[11] = t8) : (t7 = $[10], t8 = $[11]), react.useEffect(t7, t8);
652
645
  let t9;
653
646
  $[12] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => {
654
647
  setOpen(_temp$2), setShouldFocus(null);
@@ -707,7 +700,7 @@ function MenuButton(props) {
707
700
  $[27] === Symbol.for("react.memo_cache_sentinel") ? (t16 = (el_1) => (setChildMenuElements((els) => els.concat([el_1])), () => setChildMenuElements((els_0) => els_0.filter((_el) => _el !== el_1))), $[27] = t16) : t16 = $[27];
708
701
  const registerElement = t16;
709
702
  let t17;
710
- $[28] !== buttonElement || $[29] !== handleBlur || $[30] !== handleItemClick || $[31] !== handleMenuClickOutside || $[32] !== handleMenuEscape || $[33] !== id || $[34] !== menuProp || $[35] !== shouldFocus ? (t17 = menuProp && cloneElement(menuProp, {
703
+ $[28] !== buttonElement || $[29] !== handleBlur || $[30] !== handleItemClick || $[31] !== handleMenuClickOutside || $[32] !== handleMenuEscape || $[33] !== id || $[34] !== menuProp || $[35] !== shouldFocus ? (t17 = menuProp && react.cloneElement(menuProp, {
711
704
  "aria-labelledby": id,
712
705
  onBlurCapture: handleBlur,
713
706
  onClickOutside: handleMenuClickOutside,
@@ -726,7 +719,7 @@ function MenuButton(props) {
726
719
  }
727
720
  const t192 = buttonProp.props.selected ?? open;
728
721
  let t202;
729
- $[37] !== buttonProp || $[38] !== handleMouseDown || $[39] !== id || $[40] !== open || $[41] !== t192 ? (t202 = cloneElement(buttonProp, {
722
+ $[37] !== buttonProp || $[38] !== handleMouseDown || $[39] !== id || $[40] !== open || $[41] !== t192 ? (t202 = react.cloneElement(buttonProp, {
730
723
  "data-ui": "MenuButton",
731
724
  id,
732
725
  onClick: handleButtonClick,
@@ -740,7 +733,7 @@ function MenuButton(props) {
740
733
  }
741
734
  const button = t18;
742
735
  let t19, t20;
743
- $[43] !== buttonElement ? (t19 = () => buttonElement, t20 = [buttonElement], $[43] = buttonElement, $[44] = t19, $[45] = t20) : (t19 = $[44], t20 = $[45]), useImperativeHandle(forwardedRef, t19, t20);
736
+ $[43] !== buttonElement ? (t19 = () => buttonElement, t20 = [buttonElement], $[43] = buttonElement, $[44] = t19, $[45] = t20) : (t19 = $[44], t20 = $[45]), react.useImperativeHandle(forwardedRef, t19, t20);
744
737
  let t21, t22;
745
738
  $[46] !== popover ? (t22 = popover || {}, $[46] = popover, $[47] = t22) : t22 = $[47];
746
739
  let t23;
@@ -756,9 +749,9 @@ function MenuButton(props) {
756
749
  }, $[48] = deprecated_boundaryElement, $[49] = deprecated_placement, $[50] = deprecated_popoverRadius, $[51] = deprecated_popoverScheme, $[52] = deprecated_portal, $[53] = deprecated_preventOverflow, $[54] = t22, $[55] = t23) : t23 = $[55], t21 = t23;
757
750
  const popoverProps = t21;
758
751
  let t24;
759
- $[56] !== button ? (t24 = button || /* @__PURE__ */ jsx(Fragment$1, {}), $[56] = button, $[57] = t24) : t24 = $[57];
752
+ $[56] !== button ? (t24 = button || /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, {}), $[56] = button, $[57] = t24) : t24 = $[57];
760
753
  let t25;
761
- return $[58] !== menu || $[59] !== open || $[60] !== popoverProps || $[61] !== t24 ? (t25 = /* @__PURE__ */ jsx(Popover, { "data-ui": "MenuButton__popover", ...popoverProps, content: menu, open, children: t24 }), $[58] = menu, $[59] = open, $[60] = popoverProps, $[61] = t24, $[62] = t25) : t25 = $[62], t25;
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;
762
755
  }
763
756
  function _temp$2(v) {
764
757
  return !v;
@@ -766,7 +759,7 @@ function _temp$2(v) {
766
759
  MenuButton.displayName = "MenuButton";
767
760
  const DEFAULT_SKELETON_ELEMENT = "div";
768
761
  function Skeleton(props) {
769
- const $ = c(17), t0 = props;
762
+ const $ = reactCompilerRuntime.c(17), t0 = props;
770
763
  let className, delay, radius, rest, t1;
771
764
  $[0] !== t0 ? ({
772
765
  animated: t1,
@@ -775,7 +768,7 @@ function Skeleton(props) {
775
768
  radius,
776
769
  ...rest
777
770
  } = t0, $[0] = t0, $[1] = className, $[2] = delay, $[3] = radius, $[4] = rest, $[5] = t1) : (className = $[1], delay = $[2], radius = $[3], rest = $[4], t1 = $[5]);
778
- const animated = t1 === void 0 ? !1 : t1, [visible, setVisible] = useState(!delay);
771
+ const animated = t1 === void 0 ? !1 : t1, [visible, setVisible] = react.useState(!delay);
779
772
  let t2, t3;
780
773
  $[6] !== delay ? (t2 = () => {
781
774
  if (!delay)
@@ -786,19 +779,19 @@ function Skeleton(props) {
786
779
  return () => {
787
780
  clearTimeout(timeout);
788
781
  };
789
- }, t3 = [delay], $[6] = delay, $[7] = t2, $[8] = t3) : (t2 = $[7], t3 = $[8]), useEffect(t2, t3);
782
+ }, t3 = [delay], $[6] = delay, $[7] = t2, $[8] = t3) : (t2 = $[7], t3 = $[8]), react.useEffect(t2, t3);
790
783
  let t4;
791
- $[9] !== className || $[10] !== radius ? (t4 = composeClassNames(className, skeleton({
784
+ $[9] !== className || $[10] !== radius ? (t4 = css.composeClassNames(className, css.skeleton({
792
785
  radius
793
786
  })), $[9] = className, $[10] = radius, $[11] = t4) : t4 = $[11];
794
787
  const t5 = animated ? "" : void 0, t6 = visible ? "" : void 0;
795
788
  let t7;
796
- return $[12] !== rest || $[13] !== t4 || $[14] !== t5 || $[15] !== t6 ? (t7 = /* @__PURE__ */ jsx(Box, { "data-ui": "Skeleton", ...rest, className: t4, "data-animated": t5, "data-visible": t6 }), $[12] = rest, $[13] = t4, $[14] = t5, $[15] = t6, $[16] = t7) : t7 = $[16], t7;
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;
797
790
  }
798
791
  Skeleton.displayName = "Skeleton";
799
792
  const DEFAULT_CODE_SKELETON_ELEMENT = "div";
800
793
  function CodeSkeleton(props) {
801
- const $ = c(10), t0 = props;
794
+ const $ = reactCompilerRuntime.c(10), t0 = props;
802
795
  let className, rest, t1;
803
796
  $[0] !== t0 ? ({
804
797
  className,
@@ -807,16 +800,16 @@ function CodeSkeleton(props) {
807
800
  } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
808
801
  const size = t1 === void 0 ? 2 : t1;
809
802
  let t2;
810
- $[4] !== className || $[5] !== size ? (t2 = composeClassNames(className, codeSkeleton({
803
+ $[4] !== className || $[5] !== size ? (t2 = css.composeClassNames(className, css.codeSkeleton({
811
804
  size
812
805
  })), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
813
806
  let t3;
814
- return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
807
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
815
808
  }
816
809
  CodeSkeleton.displayName = "CodeSkeleton";
817
810
  const DEFAULT_HEADING_SKELETON_ELEMENT = "div";
818
811
  function HeadingSkeleton(props) {
819
- const $ = c(10), t0 = props;
812
+ const $ = reactCompilerRuntime.c(10), t0 = props;
820
813
  let className, rest, t1;
821
814
  $[0] !== t0 ? ({
822
815
  className,
@@ -825,16 +818,16 @@ function HeadingSkeleton(props) {
825
818
  } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
826
819
  const size = t1 === void 0 ? 2 : t1;
827
820
  let t2;
828
- $[4] !== className || $[5] !== size ? (t2 = composeClassNames(className, headingSkeleton({
821
+ $[4] !== className || $[5] !== size ? (t2 = css.composeClassNames(className, css.headingSkeleton({
829
822
  size
830
823
  })), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
831
824
  let t3;
832
- return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
825
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
833
826
  }
834
827
  HeadingSkeleton.displayName = "HeadingSkeleton";
835
828
  const DEFAULT_LABEL_SKELETON_ELEMENT = "div";
836
829
  function LabelSkeleton(props) {
837
- const $ = c(10), t0 = props;
830
+ const $ = reactCompilerRuntime.c(10), t0 = props;
838
831
  let className, rest, t1;
839
832
  $[0] !== t0 ? ({
840
833
  className,
@@ -843,16 +836,16 @@ function LabelSkeleton(props) {
843
836
  } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
844
837
  const size = t1 === void 0 ? 2 : t1;
845
838
  let t2;
846
- $[4] !== className || $[5] !== size ? (t2 = composeClassNames(className, labelSkeleton({
839
+ $[4] !== className || $[5] !== size ? (t2 = css.composeClassNames(className, css.labelSkeleton({
847
840
  size
848
841
  })), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
849
842
  let t3;
850
- return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
843
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
851
844
  }
852
845
  LabelSkeleton.displayName = "LabelSkeleton";
853
846
  const DEFAULT_TEXT_SKELETON_ELEMENT = "div";
854
847
  function TextSkeleton(props) {
855
- const $ = c(10), t0 = props;
848
+ const $ = reactCompilerRuntime.c(10), t0 = props;
856
849
  let className, rest, t1;
857
850
  $[0] !== t0 ? ({
858
851
  className,
@@ -861,16 +854,16 @@ function TextSkeleton(props) {
861
854
  } = t0, $[0] = t0, $[1] = className, $[2] = rest, $[3] = t1) : (className = $[1], rest = $[2], t1 = $[3]);
862
855
  const size = t1 === void 0 ? 2 : t1;
863
856
  let t2;
864
- $[4] !== className || $[5] !== size ? (t2 = composeClassNames(className, textSkeleton({
857
+ $[4] !== className || $[5] !== size ? (t2 = css.composeClassNames(className, css.textSkeleton({
865
858
  size
866
859
  })), $[4] = className, $[5] = size, $[6] = t2) : t2 = $[6];
867
860
  let t3;
868
- return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
861
+ return $[7] !== rest || $[8] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx(Skeleton, { ...rest, className: t2 }), $[7] = rest, $[8] = t2, $[9] = t3) : t3 = $[9], t3;
869
862
  }
870
863
  TextSkeleton.displayName = "TextSkeleton";
871
864
  const DEFAULT_TAB_PANEL_ELEMENT = "div";
872
865
  function TabPanel(props) {
873
- const $ = c(8), t0 = props;
866
+ const $ = reactCompilerRuntime.c(8), t0 = props;
874
867
  let rest, t1;
875
868
  $[0] !== t0 ? ({
876
869
  as: t1,
@@ -878,7 +871,7 @@ function TabPanel(props) {
878
871
  } = t0, $[0] = t0, $[1] = rest, $[2] = t1) : (rest = $[1], t1 = $[2]);
879
872
  const as = t1 === void 0 ? DEFAULT_TAB_PANEL_ELEMENT : t1, t2 = props.tabIndex === void 0 ? 0 : props.tabIndex;
880
873
  let t3;
881
- return $[3] !== as || $[4] !== props.children || $[5] !== rest || $[6] !== t2 ? (t3 = /* @__PURE__ */ jsx(Box, { "data-ui": "TabPanel", ...rest, as, role: "tabpanel", tabIndex: t2, children: props.children }), $[3] = as, $[4] = props.children, $[5] = rest, $[6] = t2, $[7] = t3) : t3 = $[7], t3;
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;
882
875
  }
883
876
  TabPanel.displayName = "TabPanel";
884
877
  const DEFAULT_TOAST_ELEMENT = "li", ROLES = {
@@ -898,7 +891,7 @@ const DEFAULT_TOAST_ELEMENT = "li", ROLES = {
898
891
  info: "neutral"
899
892
  }, LONG_ENOUGH_BUT_NOT_TOO_LONG = 1e3 * 60 * 60 * 24 * 24;
900
893
  function Toast(props) {
901
- const $ = c(53), t0 = props;
894
+ const $ = reactCompilerRuntime.c(53), t0 = props;
902
895
  let closable, description, duration, onClose, rest, status, t1, t2, title, updatedAt;
903
896
  $[0] !== t0 ? ({
904
897
  as: t1,
@@ -912,7 +905,7 @@ function Toast(props) {
912
905
  updatedAt,
913
906
  ...rest
914
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]);
915
- const as = t1 === void 0 ? DEFAULT_TOAST_ELEMENT : t1, radius = t2 === void 0 ? 3 : t2, cardTone = status ? STATUS_CARD_TONE[status] : "default", buttonTone = status ? BUTTON_TONE[status] : "default", role = status ? ROLES[status] : "status", visualDuration = usePrefersReducedMotion() ? 0 : 0.26;
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;
916
909
  let t3;
917
910
  $[11] !== visualDuration ? (t3 = visualDuration ? {
918
911
  type: "spring",
@@ -932,30 +925,30 @@ function Toast(props) {
932
925
  $[15] === Symbol.for("react.memo_cache_sentinel") ? (t6 = ["hidden", "slideOut"], $[15] = t6) : t6 = $[15];
933
926
  const exit = t6;
934
927
  let t7;
935
- $[16] === Symbol.for("react.memo_cache_sentinel") ? (t7 = toast(), $[16] = t7) : t7 = $[16];
928
+ $[16] === Symbol.for("react.memo_cache_sentinel") ? (t7 = css.toast(), $[16] = t7) : t7 = $[16];
936
929
  const t8 = hasDuration ? "" : void 0;
937
930
  let t9;
938
- $[17] !== title ? (t9 = title && /* @__PURE__ */ jsx(Text, { size: 1, weight: "medium", children: title }), $[17] = title, $[18] = t9) : t9 = $[18];
931
+ $[17] !== title ? (t9 = title && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: 1, weight: "medium", children: title }), $[17] = title, $[18] = t9) : t9 = $[18];
939
932
  let t10;
940
- $[19] !== description || $[20] !== transition ? (t10 = description && /* @__PURE__ */ jsx(MotionText, { muted: !0, size: 1, variants: content, transition, children: description }), $[19] = description, $[20] = transition, $[21] = t10) : t10 = $[21];
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];
941
934
  let t11;
942
- $[22] !== t10 || $[23] !== t9 ? (t11 = /* @__PURE__ */ jsx(Flex, { flex: 1, overflowX: "auto", padding: 3, children: /* @__PURE__ */ jsxs(Stack, { space: 3, 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: [
943
936
  t9,
944
937
  t10
945
938
  ] }) }), $[22] = t10, $[23] = t9, $[24] = t11) : t11 = $[24];
946
939
  let t12;
947
- $[25] !== buttonTone || $[26] !== closable || $[27] !== onClose ? (t12 = closable && /* @__PURE__ */ jsx(Box, { padding: 1, children: /* @__PURE__ */ jsx(Button, { as: "button", icon: CloseIcon, mode: "bleed", padding: 2, tone: buttonTone, onClick: onClose, style: {
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: {
948
941
  verticalAlign: "top"
949
942
  } }) }), $[25] = buttonTone, $[26] = closable, $[27] = onClose, $[28] = t12) : t12 = $[28];
950
943
  let t13;
951
- $[29] !== t11 || $[30] !== t12 || $[31] !== transition ? (t13 = /* @__PURE__ */ jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
944
+ $[29] !== t11 || $[30] !== t12 || $[31] !== transition ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs(MotionFlex, { align: "flex-start", variants: content, transition, children: [
952
945
  t11,
953
946
  t12
954
947
  ] }), $[29] = t11, $[30] = t12, $[31] = transition, $[32] = t13) : t13 = $[32];
955
948
  let t14;
956
- $[33] !== cardTone || $[34] !== duration || $[35] !== hasDuration || $[36] !== onClose || $[37] !== radius || $[38] !== transition || $[39] !== updatedAt || $[40] !== visualDuration ? (t14 = hasDuration && /* @__PURE__ */ jsxs(MotionBox, { className: toastLoadingBar(), variants: content, transition, children: [
957
- /* @__PURE__ */ jsx(Card, { className: toastLoadingBarMask(), tone: cardTone, radius }),
958
- /* @__PURE__ */ jsx(MotionCard, { className: toastLoadingBarProgress(), tone: cardTone, initial: {
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: [
950
+ /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Card, { className: css.toastLoadingBarMask(), tone: cardTone, radius }),
951
+ /* @__PURE__ */ jsxRuntime.jsx(MotionCard, { className: css.toastLoadingBarProgress(), tone: cardTone, initial: {
959
952
  scaleX: 0
960
953
  }, animate: {
961
954
  scaleX: 1
@@ -966,7 +959,7 @@ function Toast(props) {
966
959
  }, onAnimationComplete: onClose }, `progress-${updatedAt}`)
967
960
  ] }), $[33] = cardTone, $[34] = duration, $[35] = hasDuration, $[36] = onClose, $[37] = radius, $[38] = transition, $[39] = updatedAt, $[40] = visualDuration, $[41] = t14) : t14 = $[41];
968
961
  let t15;
969
- return $[42] !== as || $[43] !== cardTone || $[44] !== radius || $[45] !== rest || $[46] !== role || $[47] !== t13 || $[48] !== t14 || $[49] !== t8 || $[50] !== transition || $[51] !== visualDuration ? (t15 = /* @__PURE__ */ jsxs(MotionCard, { as, className: t7, "data-ui": "Toast", role, ...rest, "data-has-duration": t8, custom: visualDuration, radius, shadow: 2, tone: cardTone, layout: "position", variants: container, initial, animate, exit, transition, position: "relative", children: [
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: [
970
963
  t13,
971
964
  t14
972
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;
@@ -1009,9 +1002,9 @@ const container = {
1009
1002
  visible: {
1010
1003
  opacity: 1
1011
1004
  }
1012
- }, MotionCard = motion.create(Card), MotionFlex = motion.create(Flex), MotionText = motion.create(Text), MotionBox = motion.create(Box);
1005
+ }, MotionCard = framerMotion.motion.create(_visualEditing.Card), MotionFlex = framerMotion.motion.create(_visualEditing.Flex), MotionText = framerMotion.motion.create(_visualEditing.Text), MotionBox = framerMotion.motion.create(_visualEditing.Box);
1013
1006
  function useMounted() {
1014
- return useSyncExternalStore(subscribe, _temp$1, _temp2);
1007
+ return react.useSyncExternalStore(subscribe, _temp$1, _temp2);
1015
1008
  }
1016
1009
  function _temp2() {
1017
1010
  return !1;
@@ -1020,9 +1013,9 @@ function _temp$1() {
1020
1013
  return !0;
1021
1014
  }
1022
1015
  const subscribe = () => () => {
1023
- }, ToastContext = createGlobalScopedContext("@sanity/ui/context/toast", null), DEFAULT_TOAST_LAYER_ELEMENT = "ul";
1016
+ }, ToastContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/toast", null), DEFAULT_TOAST_LAYER_ELEMENT = "ul";
1024
1017
  function ToastLayer(props) {
1025
- const $ = c(11), {
1018
+ const $ = reactCompilerRuntime.c(11), {
1026
1019
  as: t0,
1027
1020
  children,
1028
1021
  padding: t1,
@@ -1031,15 +1024,15 @@ function ToastLayer(props) {
1031
1024
  gap: t2
1032
1025
  } = props, as = t0 === void 0 ? DEFAULT_TOAST_LAYER_ELEMENT : t0, padding = t1 === void 0 ? 4 : t1, gap = t2 === void 0 ? 3 : t2, {
1033
1026
  zIndex
1034
- } = useLayer();
1027
+ } = _visualEditing.useLayer();
1035
1028
  let t3;
1036
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t3 = toastLayer(), $[0] = t3) : t3 = $[0];
1029
+ $[0] === Symbol.for("react.memo_cache_sentinel") ? (t3 = css.toastLayer(), $[0] = t3) : t3 = $[0];
1037
1030
  let t4;
1038
1031
  $[1] !== zIndex ? (t4 = {
1039
1032
  zIndex
1040
1033
  }, $[1] = zIndex, $[2] = t4) : t4 = $[2];
1041
1034
  let t5;
1042
- return $[3] !== as || $[4] !== children || $[5] !== gap || $[6] !== padding || $[7] !== paddingX || $[8] !== paddingY || $[9] !== t4 ? (t5 = /* @__PURE__ */ jsx(Grid, { as, className: t3, "data-ui": "ToastProvider", padding, paddingX, paddingY, gap, columns: 1, style: t4, children }), $[3] = as, $[4] = children, $[5] = gap, $[6] = padding, $[7] = paddingX, $[8] = paddingY, $[9] = t4, $[10] = t5) : t5 = $[10], t5;
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;
1043
1036
  }
1044
1037
  ToastLayer.displayName = "ToastLayer";
1045
1038
  let toastId = 0;
@@ -1047,7 +1040,7 @@ function generateToastId() {
1047
1040
  return String(toastId++);
1048
1041
  }
1049
1042
  function ToastProvider(props) {
1050
- const $ = c(13), {
1043
+ const $ = reactCompilerRuntime.c(13), {
1051
1044
  children,
1052
1045
  padding,
1053
1046
  paddingX,
@@ -1057,17 +1050,17 @@ function ToastProvider(props) {
1057
1050
  } = props, zOffset = t0 === void 0 ? 1 : t0;
1058
1051
  let t1;
1059
1052
  $[0] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[0] = t1) : t1 = $[0];
1060
- const [state, setState] = useState(t1), mounted = useMounted();
1053
+ const [state, setState] = react.useState(t1), mounted = useMounted();
1061
1054
  let t2, t3;
1062
1055
  $[1] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {
1063
1056
  version: 0,
1064
1057
  push: (params) => {
1065
1058
  const id = params.id || generateToastId(), duration = params.duration || 5e3;
1066
- return startTransition(() => {
1059
+ return react.startTransition(() => {
1067
1060
  setState((prevState) => {
1068
1061
  if (duration === 0.01)
1069
- return prevState.filter((toast2) => toast2.id !== id);
1070
- const dismiss = () => startTransition(() => setState((currentState) => currentState.filter((toast_0) => toast_0.id !== id)));
1062
+ return prevState.filter((toast) => toast.id !== id);
1063
+ const dismiss = () => react.startTransition(() => setState((currentState) => currentState.filter((toast_0) => toast_0.id !== id)));
1071
1064
  return [...prevState.filter((toast_1) => toast_1.id !== id), {
1072
1065
  dismiss,
1073
1066
  id,
@@ -1083,9 +1076,9 @@ function ToastProvider(props) {
1083
1076
  }, $[1] = t3) : t3 = $[1], t2 = t3;
1084
1077
  const value = t2;
1085
1078
  let t4;
1086
- $[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t4 = mounted && /* @__PURE__ */ jsx(LayerProvider, { zOffset, children: /* @__PURE__ */ jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsx(AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(_temp) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t4) : t4 = $[9];
1079
+ $[2] !== gap || $[3] !== mounted || $[4] !== padding || $[5] !== paddingX || $[6] !== paddingY || $[7] !== state || $[8] !== zOffset ? (t4 = mounted && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.LayerProvider, { zOffset, children: /* @__PURE__ */ jsxRuntime.jsx(ToastLayer, { padding, paddingX, paddingY, gap, children: /* @__PURE__ */ jsxRuntime.jsx(framerMotion.AnimatePresence, { initial: !1, mode: "popLayout", children: state.map(_temp) }) }) }), $[2] = gap, $[3] = mounted, $[4] = padding, $[5] = paddingX, $[6] = paddingY, $[7] = state, $[8] = zOffset, $[9] = t4) : t4 = $[9];
1087
1080
  let t5;
1088
- return $[10] !== children || $[11] !== t4 ? (t5 = /* @__PURE__ */ jsxs(ToastContext.Provider, { value, children: [
1081
+ return $[10] !== children || $[11] !== t4 ? (t5 = /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value, children: [
1089
1082
  children,
1090
1083
  t4
1091
1084
  ] }), $[10] = children, $[11] = t4, $[12] = t5) : t5 = $[12], t5;
@@ -1097,14 +1090,14 @@ function _temp(t0) {
1097
1090
  params: params_0,
1098
1091
  updatedAt
1099
1092
  } = t0;
1100
- return /* @__PURE__ */ jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title, duration: params_0.duration, updatedAt }, id_0);
1093
+ return /* @__PURE__ */ jsxRuntime.jsx(Toast, { closable: params_0.closable, description: params_0.description, onClose: dismiss_0, status: params_0.status, title: params_0.title, duration: params_0.duration, updatedAt }, id_0);
1101
1094
  }
1102
1095
  ToastProvider.displayName = "ToastProvider";
1103
1096
  function useToast() {
1104
- const value = useContext(ToastContext);
1097
+ const value = react.useContext(ToastContext);
1105
1098
  if (!value)
1106
1099
  throw new Error("useToast(): missing context value");
1107
- if (!isRecord(value) || value.version !== 0)
1100
+ if (!_visualEditing.isRecord(value) || value.version !== 0)
1108
1101
  throw new Error("useToast(): the context value is not compatible");
1109
1102
  return value;
1110
1103
  }
@@ -1162,9 +1155,9 @@ function _focusItemElement(el) {
1162
1155
  firstChild && firstChild instanceof HTMLElement && firstChild.focus();
1163
1156
  }
1164
1157
  }
1165
- const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null), DEFAULT_TREE_ELEMENT = "div";
1158
+ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/tree", null), DEFAULT_TREE_ELEMENT = "div";
1166
1159
  function Tree(props) {
1167
- const $ = c(39), t0 = props;
1160
+ const $ = reactCompilerRuntime.c(39), t0 = props;
1168
1161
  let children, forwardedRef, gap, onFocus, rest, t1;
1169
1162
  $[0] !== t0 ? ({
1170
1163
  children,
@@ -1174,26 +1167,26 @@ function Tree(props) {
1174
1167
  ref: forwardedRef,
1175
1168
  ...rest
1176
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]);
1177
- const space = t1 === void 0 ? 1 : t1, ref = useRef(null), [focusedElement, setFocusedElement] = useState(null), focusedElementRef = useRef(focusedElement);
1170
+ const space = t1 === void 0 ? 1 : t1, ref = react.useRef(null), [focusedElement, setFocusedElement] = react.useState(null), focusedElementRef = react.useRef(focusedElement);
1178
1171
  let t2, t3;
1179
1172
  $[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = [], $[7] = t3) : t3 = $[7], t2 = t3;
1180
1173
  const path = t2;
1181
1174
  let t4;
1182
1175
  $[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = [], $[8] = t4) : t4 = $[8];
1183
- const [itemElements, setItemElements] = useState(t4);
1176
+ const [itemElements, setItemElements] = react.useState(t4);
1184
1177
  let t5;
1185
1178
  $[9] === Symbol.for("react.memo_cache_sentinel") ? (t5 = {}, $[9] = t5) : t5 = $[9];
1186
- const [state, setState] = useState(t5), stateRef = useRef(state);
1179
+ const [state, setState] = react.useState(t5), stateRef = react.useRef(state);
1187
1180
  let t6;
1188
- $[10] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[10] = t6) : t6 = $[10], useImperativeHandle(forwardedRef, t6);
1181
+ $[10] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => ref.current, $[10] = t6) : t6 = $[10], react.useImperativeHandle(forwardedRef, t6);
1189
1182
  let t7, t8;
1190
1183
  $[11] !== focusedElement ? (t7 = () => {
1191
1184
  focusedElementRef.current = focusedElement;
1192
- }, t8 = [focusedElement], $[11] = focusedElement, $[12] = t7, $[13] = t8) : (t7 = $[12], t8 = $[13]), useEffect(t7, t8);
1185
+ }, t8 = [focusedElement], $[11] = focusedElement, $[12] = t7, $[13] = t8) : (t7 = $[12], t8 = $[13]), react.useEffect(t7, t8);
1193
1186
  let t10, t9;
1194
1187
  $[14] !== state ? (t9 = () => {
1195
1188
  stateRef.current = state;
1196
- }, t10 = [state], $[14] = state, $[15] = t10, $[16] = t9) : (t10 = $[15], t9 = $[16]), useEffect(t9, t10);
1189
+ }, t10 = [state], $[14] = state, $[15] = t10, $[16] = t9) : (t10 = $[15], t9 = $[16]), react.useEffect(t9, t10);
1197
1190
  let t11;
1198
1191
  $[17] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (element, path_0, expanded, selected) => (setState((s) => ({
1199
1192
  ...s,
@@ -1314,22 +1307,22 @@ function Tree(props) {
1314
1307
  setItemElements(_itemElements);
1315
1308
  }, $[27] = t18) : t18 = $[27];
1316
1309
  let t19;
1317
- $[28] !== children ? (t19 = [children], $[28] = children, $[29] = t19) : t19 = $[29], useEffect(t18, t19);
1310
+ $[28] !== children ? (t19 = [children], $[28] = children, $[29] = t19) : t19 = $[29], react.useEffect(t18, t19);
1318
1311
  const t20 = gap ?? space;
1319
1312
  let t21;
1320
- $[30] !== children || $[31] !== handleFocus || $[32] !== handleKeyDown || $[33] !== rest || $[34] !== t20 ? (t21 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "Tree", ...rest, gap: t20, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", children }), $[30] = children, $[31] = handleFocus, $[32] = handleKeyDown, $[33] = rest, $[34] = t20, $[35] = t21) : t21 = $[35];
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];
1321
1314
  let t22;
1322
- return $[36] !== contextValue || $[37] !== t21 ? (t22 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t21 }), $[36] = contextValue, $[37] = t21, $[38] = t22) : t22 = $[38], t22;
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;
1323
1316
  }
1324
1317
  Tree.displayName = "Tree";
1325
1318
  function useTree() {
1326
- const tree = useContext(TreeContext);
1319
+ const tree = react.useContext(TreeContext);
1327
1320
  if (!tree)
1328
1321
  throw new Error("Tree: missing context value");
1329
1322
  return tree;
1330
1323
  }
1331
- const TreeGroup = memo(function(props) {
1332
- const $ = c(9), t0 = props;
1324
+ const TreeGroup = react.memo(function(props) {
1325
+ const $ = reactCompilerRuntime.c(9), t0 = props;
1333
1326
  let children, rest, t1;
1334
1327
  $[0] !== t0 ? ({
1335
1328
  children,
@@ -1338,7 +1331,7 @@ const TreeGroup = memo(function(props) {
1338
1331
  } = t0, $[0] = t0, $[1] = children, $[2] = rest, $[3] = t1) : (children = $[1], rest = $[2], t1 = $[3]);
1339
1332
  const expanded = t1 === void 0 ? !1 : t1, tree = useTree(), t2 = !expanded;
1340
1333
  let t3;
1341
- return $[4] !== children || $[5] !== rest || $[6] !== t2 || $[7] !== tree.space ? (t3 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "TreeGroup", ...rest, hidden: t2, marginTop: tree.space, role: "group", gap: tree.space, children }), $[4] = children, $[5] = rest, $[6] = t2, $[7] = tree.space, $[8] = t3) : t3 = $[8], t3;
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;
1342
1335
  });
1343
1336
  TreeGroup.displayName = "TreeGroup";
1344
1337
  const DEFAULT_TREE_ITEM_ELEMENT = "a";
@@ -1361,245 +1354,253 @@ function TreeItem(props) {
1361
1354
  text,
1362
1355
  weight,
1363
1356
  ...rest
1364
- } = props, rootRef = useRef(null), treeitemRef = useRef(null), tree = useTree(), {
1357
+ } = props, rootRef = react.useRef(null), treeitemRef = react.useRef(null), tree = useTree(), {
1365
1358
  path,
1366
1359
  registerItem,
1367
1360
  setExpanded,
1368
1361
  setFocusedElement
1369
- } = tree, _id = useId(), id = idProp || _id, itemPath = useMemo(() => path.concat([id || ""]), [id, path]), itemKey = itemPath.join("/"), itemState = tree.state[itemKey], focused = tree.focusedElement === rootRef.current, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootRef.current ? 0 : -1, contextValue = useMemo(() => ({
1362
+ } = tree, _id = react.useId(), id = idProp || _id, itemPath = react.useMemo(() => path.concat([id || ""]), [id, path]), itemKey = itemPath.join("/"), itemState = tree.state[itemKey], focused = tree.focusedElement === rootRef.current, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootRef.current ? 0 : -1, contextValue = react.useMemo(() => ({
1370
1363
  ...tree,
1371
1364
  level: tree.level + 1,
1372
1365
  path: itemPath
1373
- }), [itemPath, tree]), handleClick = useCallback((event) => {
1366
+ }), [itemPath, tree]), handleClick = react.useCallback((event) => {
1374
1367
  onClick && onClick(event);
1375
1368
  const target = event.target;
1376
1369
  target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootRef.current));
1377
- }, [expanded, itemKey, onClick, setExpanded, setFocusedElement]), handleKeyDown = useCallback((event_0) => {
1370
+ }, [expanded, itemKey, onClick, setExpanded, setFocusedElement]), handleKeyDown = react.useCallback((event_0) => {
1378
1371
  focused && event_0.key === "Enter" && (treeitemRef.current || rootRef.current)?.click();
1379
1372
  }, [focused]);
1380
- useEffect(() => {
1373
+ react.useEffect(() => {
1381
1374
  if (rootRef.current)
1382
1375
  return registerItem(rootRef.current, itemPath.join("/"), expanded, selected);
1383
1376
  }, [expanded, itemPath, registerItem, selected]);
1384
- const content2 = /* @__PURE__ */ jsxs(Flex, { gap: space, padding, children: [
1385
- /* @__PURE__ */ jsxs(Box, { style: {
1377
+ const content2 = /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { gap: space, padding, children: [
1378
+ /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Box, { style: {
1386
1379
  visibility: IconComponent || children ? "visible" : "hidden",
1387
1380
  pointerEvents: "none"
1388
1381
  }, children: [
1389
- IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(IconComponent, {}) }),
1390
- !IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: {
1382
+ IconComponent && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent, {}) }),
1383
+ !IconComponent && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsxRuntime.jsx(icons.ToggleArrowRightIcon, { style: {
1391
1384
  transform: expanded ? "rotate(90deg)" : void 0
1392
1385
  } }) })
1393
1386
  ] }),
1394
- /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) })
1387
+ /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: 1, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) })
1395
1388
  ] });
1396
- return href ? /* @__PURE__ */ jsxs(Box, { "data-selected": selected ? "" : void 0, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...rest, as: "li", className: composeClassNames(className, treeItem()), onClick: handleClick, ref: rootRef, role: "none", children: [
1397
- /* @__PURE__ */ jsx(Selectable, { "aria-expanded": expanded, as: linkAs, "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", href, radius, ref: treeitemRef, role: "treeitem", tabIndex, style: {
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: [
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: {
1398
1391
  paddingLeft: `calc(var(--space-2) * ${tree.level})`
1399
1392
  }, children: content2 }),
1400
- /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }) })
1401
- ] }) : /* @__PURE__ */ jsxs(Box, { "data-selected": selected ? "" : void 0, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...rest, "aria-expanded": expanded, className: composeClassNames(className, treeItem()), onClick: handleClick, onKeyDown: handleKeyDown, ref: rootRef, role: "treeitem", tabIndex, children: [
1402
- /* @__PURE__ */ jsx(Selectable, { as: "button", "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", radius, style: {
1393
+ /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { hidden: !expanded, 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: [
1395
+ /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Selectable, { as: "button", "data-pressed": selected ? "" : void 0, "data-ui": "TreeItem__box", radius, style: {
1403
1396
  paddingLeft: `calc(var(--space-2) * ${tree.level})`
1404
1397
  }, children: content2 }),
1405
- /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }) })
1398
+ /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsxRuntime.jsx(TreeGroup, { expanded, children }) })
1406
1399
  ] });
1407
1400
  }
1408
1401
  TreeItem.displayName = "TreeItem";
1409
1402
  function StyleTags(props) {
1410
- const $ = c(10), {
1403
+ const $ = reactCompilerRuntime.c(10), {
1411
1404
  theme: themeProp
1412
1405
  } = props;
1413
1406
  let t0;
1414
- $[0] !== themeProp ? (t0 = themeProp ?? buildTheme_v3(), $[0] = themeProp, $[1] = t0) : t0 = $[1];
1415
- const theme = t0;
1407
+ $[0] !== themeProp ? (t0 = themeProp ?? theme.buildTheme_v3(), $[0] = themeProp, $[1] = t0) : t0 = $[1];
1408
+ const theme$1 = t0;
1416
1409
  let t1;
1417
- $[2] === Symbol.for("react.memo_cache_sentinel") ? (t1 = /* @__PURE__ */ jsx("style", { href: "sanity-palette", precedence: "palette", children: compilePalette() }), $[2] = t1) : t1 = $[2];
1410
+ $[2] === Symbol.for("react.memo_cache_sentinel") ? (t1 = /* @__PURE__ */ jsxRuntime.jsx("style", { href: "sanity-palette", precedence: "palette", children: css._compilePalette() }), $[2] = t1) : t1 = $[2];
1418
1411
  let t2;
1419
- $[3] !== theme ? (t2 = compileTheme({
1420
- v3: theme
1421
- }), $[3] = theme, $[4] = t2) : t2 = $[4];
1412
+ $[3] !== theme$1 ? (t2 = css._compileTheme({
1413
+ v3: theme$1
1414
+ }), $[3] = theme$1, $[4] = t2) : t2 = $[4];
1422
1415
  let t3;
1423
- $[5] !== t2 ? (t3 = /* @__PURE__ */ jsx("style", { href: "sanity-theme", precedence: "theme", children: t2 }), $[5] = t2, $[6] = t3) : t3 = $[6];
1416
+ $[5] !== t2 ? (t3 = /* @__PURE__ */ jsxRuntime.jsx("style", { href: "sanity-theme", precedence: "theme", children: t2 }), $[5] = t2, $[6] = t3) : t3 = $[6];
1424
1417
  let t4;
1425
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = /* @__PURE__ */ jsx("style", { href: "sanity-system", precedence: "system", children: compileSystem() }), $[7] = t4) : t4 = $[7];
1418
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = /* @__PURE__ */ jsxRuntime.jsx("style", { href: "sanity-system", precedence: "system", children: css._compileSystem() }), $[7] = t4) : t4 = $[7];
1426
1419
  let t5;
1427
- return $[8] !== t3 ? (t5 = /* @__PURE__ */ jsxs(Fragment$1, { children: [
1420
+ return $[8] !== t3 ? (t5 = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1428
1421
  t1,
1429
1422
  t3,
1430
1423
  t4
1431
1424
  ] }), $[8] = t3, $[9] = t5) : t5 = $[9], t5;
1432
1425
  }
1433
1426
  StyleTags.displayName = "StyleTags";
1434
- export {
1435
- Arrow,
1436
- Autocomplete,
1437
- Avatar,
1438
- AvatarCounter,
1439
- AvatarStack,
1440
- Badge,
1441
- BoundaryElementProvider,
1442
- Box,
1443
- Breadcrumbs,
1444
- Button,
1445
- Card,
1446
- CardProvider,
1447
- Checkbox,
1448
- Code,
1449
- CodeSkeleton,
1450
- Container,
1451
- DEFAULT_ARROW_ELEMENT,
1452
- DEFAULT_AUTOCOMPLETE_ELEMENT,
1453
- DEFAULT_AVATAR_COUNTER_ELEMENT,
1454
- DEFAULT_AVATAR_ELEMENT,
1455
- DEFAULT_AVATAR_STACK_ELEMENT,
1456
- DEFAULT_BADGE_ELEMENT,
1457
- DEFAULT_BOX_ELEMENT,
1458
- DEFAULT_BREADCRUMBS_ELEMENT,
1459
- DEFAULT_BUTTON_ELEMENT,
1460
- DEFAULT_CARD_ELEMENT,
1461
- DEFAULT_CHECKBOX_ELEMENT,
1462
- DEFAULT_CODE_ELEMENT,
1463
- DEFAULT_CODE_SKELETON_ELEMENT,
1464
- DEFAULT_CONTAINER_ELEMENT,
1465
- DEFAULT_DIALOG_ELEMENT,
1466
- DEFAULT_ELEMENT_QUERY_ELEMENT,
1467
- DEFAULT_FLEX_ELEMENT,
1468
- DEFAULT_GRID_ELEMENT,
1469
- DEFAULT_HEADING_ELEMENT,
1470
- DEFAULT_HEADING_SKELETON_ELEMENT,
1471
- DEFAULT_HOTKEYS_ELEMENT,
1472
- DEFAULT_INLINE_ELEMENT,
1473
- DEFAULT_KBD_ELEMENT,
1474
- DEFAULT_LABEL_ELEMENT,
1475
- DEFAULT_LABEL_SKELETON_ELEMENT,
1476
- DEFAULT_LAYER_ELEMENT,
1477
- DEFAULT_MENU_DIVIDER_ELEMENT,
1478
- DEFAULT_MENU_ELEMENT,
1479
- DEFAULT_MENU_GROUP_ELEMENT,
1480
- DEFAULT_MENU_ITEM_ELEMENT,
1481
- DEFAULT_POPOVER_ELEMENT,
1482
- DEFAULT_RADIO_ELEMENT,
1483
- DEFAULT_SELECT_ELEMENT,
1484
- DEFAULT_SKELETON_ELEMENT,
1485
- DEFAULT_SPINNER_ELEMENT,
1486
- DEFAULT_SR_ONLY_ELEMENT,
1487
- DEFAULT_STACK_ELEMENT,
1488
- DEFAULT_SWITCH_ELEMENT,
1489
- DEFAULT_TAB_ELEMENT,
1490
- DEFAULT_TAB_LIST_ELEMENT,
1491
- DEFAULT_TAB_PANEL_ELEMENT,
1492
- DEFAULT_TEXT_AREA_ELEMENT,
1493
- DEFAULT_TEXT_ELEMENT,
1494
- DEFAULT_TEXT_INPUT_ELEMENT,
1495
- DEFAULT_TEXT_SKELETON_ELEMENT,
1496
- DEFAULT_TOAST_ELEMENT,
1497
- DEFAULT_TOOLTIP_ELEMENT,
1498
- DEFAULT_TREE_ELEMENT,
1499
- DEFAULT_TREE_ITEM_ELEMENT,
1500
- DEFAULT_VIRTUAL_LIST_ELEMENT,
1501
- Dialog,
1502
- DialogContext,
1503
- DialogProvider,
1504
- ElementQuery,
1505
- ErrorBoundary,
1506
- Flex,
1507
- Grid,
1508
- Heading,
1509
- HeadingSkeleton,
1510
- Hotkeys,
1511
- Inline,
1512
- KBD,
1513
- Label,
1514
- LabelSkeleton,
1515
- Layer,
1516
- LayerProvider,
1517
- Menu,
1518
- MenuButton,
1519
- MenuDivider,
1520
- MenuGroup,
1521
- MenuItem,
1522
- Popover,
1523
- Portal,
1524
- PortalProvider,
1525
- Radio,
1526
- Select,
1527
- Skeleton,
1528
- Spinner,
1529
- SrOnly,
1530
- Stack,
1531
- StyleTags,
1532
- Switch,
1533
- Tab,
1534
- TabList,
1535
- TabPanel,
1536
- Text,
1537
- TextArea,
1538
- TextInput,
1539
- TextSkeleton,
1540
- ThemeColorProvider,
1541
- ThemeProvider,
1542
- Toast,
1543
- ToastProvider,
1544
- Tooltip,
1545
- TooltipDelayGroupContext,
1546
- TooltipDelayGroupProvider,
1547
- Tree,
1548
- TreeItem,
1549
- VirtualList,
1550
- _ResizeObserver,
1551
- _elementSizeObserver,
1552
- _getArrayProp,
1553
- _hasFocus,
1554
- _isEnterToClickElement,
1555
- _isScrollable,
1556
- _raf,
1557
- _raf2,
1558
- _responsive,
1559
- attemptFocus,
1560
- containsOrEqualsElement,
1561
- createColorTheme,
1562
- focusFirstDescendant,
1563
- focusLastDescendant,
1564
- hexToRgb,
1565
- hslToRgb,
1566
- isFocusable,
1567
- isHTMLAnchorElement,
1568
- isHTMLButtonElement,
1569
- isHTMLElement,
1570
- isHTMLInputElement,
1571
- isHTMLSelectElement,
1572
- isHTMLTextAreaElement,
1573
- multiply,
1574
- parseColor,
1575
- px,
1576
- rem,
1577
- rgbToHex,
1578
- rgbToHsl,
1579
- rgba,
1580
- screen,
1581
- useArrayProp,
1582
- useBoundaryElement,
1583
- useCard,
1584
- useClickOutside,
1585
- useClickOutsideEvent,
1586
- useCustomValidity,
1587
- useDialog,
1588
- useElementRect,
1589
- useElementSize,
1590
- useForwardedRef,
1591
- useGlobalKeyDown,
1592
- useLayer,
1593
- useMatchMedia,
1594
- useMediaIndex,
1595
- usePortal,
1596
- usePrefersDark,
1597
- usePrefersReducedMotion,
1598
- useRootTheme,
1599
- useTheme,
1600
- useTheme_v2,
1601
- useToast,
1602
- useTooltipDelayGroup,
1603
- useTree
1604
- };
1605
- //# sourceMappingURL=index.mjs.map
1427
+ exports.Arrow = _visualEditing.Arrow;
1428
+ exports.Avatar = _visualEditing.Avatar;
1429
+ exports.AvatarCounter = _visualEditing.AvatarCounter;
1430
+ exports.AvatarStack = _visualEditing.AvatarStack;
1431
+ exports.Badge = _visualEditing.Badge;
1432
+ exports.BoundaryElementProvider = _visualEditing.BoundaryElementProvider;
1433
+ exports.Box = _visualEditing.Box;
1434
+ exports.Button = _visualEditing.Button;
1435
+ exports.Card = _visualEditing.Card;
1436
+ exports.CardProvider = _visualEditing.CardProvider;
1437
+ exports.Checkbox = _visualEditing.Checkbox;
1438
+ exports.Code = _visualEditing.Code;
1439
+ exports.Container = _visualEditing.Container;
1440
+ exports.DEFAULT_ARROW_ELEMENT = _visualEditing.DEFAULT_ARROW_ELEMENT;
1441
+ exports.DEFAULT_AVATAR_COUNTER_ELEMENT = _visualEditing.DEFAULT_AVATAR_COUNTER_ELEMENT;
1442
+ exports.DEFAULT_AVATAR_ELEMENT = _visualEditing.DEFAULT_AVATAR_ELEMENT;
1443
+ exports.DEFAULT_AVATAR_STACK_ELEMENT = _visualEditing.DEFAULT_AVATAR_STACK_ELEMENT;
1444
+ exports.DEFAULT_BADGE_ELEMENT = _visualEditing.DEFAULT_BADGE_ELEMENT;
1445
+ exports.DEFAULT_BOX_ELEMENT = _visualEditing.DEFAULT_BOX_ELEMENT;
1446
+ exports.DEFAULT_BUTTON_ELEMENT = _visualEditing.DEFAULT_BUTTON_ELEMENT;
1447
+ exports.DEFAULT_CARD_ELEMENT = _visualEditing.DEFAULT_CARD_ELEMENT;
1448
+ exports.DEFAULT_CHECKBOX_ELEMENT = _visualEditing.DEFAULT_CHECKBOX_ELEMENT;
1449
+ exports.DEFAULT_CODE_ELEMENT = _visualEditing.DEFAULT_CODE_ELEMENT;
1450
+ exports.DEFAULT_CONTAINER_ELEMENT = _visualEditing.DEFAULT_CONTAINER_ELEMENT;
1451
+ exports.DEFAULT_ELEMENT_QUERY_ELEMENT = _visualEditing.DEFAULT_ELEMENT_QUERY_ELEMENT;
1452
+ exports.DEFAULT_FLEX_ELEMENT = _visualEditing.DEFAULT_FLEX_ELEMENT;
1453
+ exports.DEFAULT_GRID_ELEMENT = _visualEditing.DEFAULT_GRID_ELEMENT;
1454
+ exports.DEFAULT_HEADING_ELEMENT = _visualEditing.DEFAULT_HEADING_ELEMENT;
1455
+ exports.DEFAULT_HOTKEYS_ELEMENT = _visualEditing.DEFAULT_HOTKEYS_ELEMENT;
1456
+ exports.DEFAULT_INLINE_ELEMENT = _visualEditing.DEFAULT_INLINE_ELEMENT;
1457
+ exports.DEFAULT_KBD_ELEMENT = _visualEditing.DEFAULT_KBD_ELEMENT;
1458
+ exports.DEFAULT_LABEL_ELEMENT = _visualEditing.DEFAULT_LABEL_ELEMENT;
1459
+ exports.DEFAULT_LAYER_ELEMENT = _visualEditing.DEFAULT_LAYER_ELEMENT;
1460
+ exports.DEFAULT_MENU_DIVIDER_ELEMENT = _visualEditing.DEFAULT_MENU_DIVIDER_ELEMENT;
1461
+ exports.DEFAULT_MENU_ELEMENT = _visualEditing.DEFAULT_MENU_ELEMENT;
1462
+ exports.DEFAULT_MENU_GROUP_ELEMENT = _visualEditing.DEFAULT_MENU_GROUP_ELEMENT;
1463
+ exports.DEFAULT_MENU_ITEM_ELEMENT = _visualEditing.DEFAULT_MENU_ITEM_ELEMENT;
1464
+ exports.DEFAULT_POPOVER_ELEMENT = _visualEditing.DEFAULT_POPOVER_ELEMENT;
1465
+ exports.DEFAULT_RADIO_ELEMENT = _visualEditing.DEFAULT_RADIO_ELEMENT;
1466
+ exports.DEFAULT_SELECT_ELEMENT = _visualEditing.DEFAULT_SELECT_ELEMENT;
1467
+ exports.DEFAULT_SPINNER_ELEMENT = _visualEditing.DEFAULT_SPINNER_ELEMENT;
1468
+ exports.DEFAULT_SR_ONLY_ELEMENT = _visualEditing.DEFAULT_SR_ONLY_ELEMENT;
1469
+ exports.DEFAULT_STACK_ELEMENT = _visualEditing.DEFAULT_STACK_ELEMENT;
1470
+ exports.DEFAULT_SWITCH_ELEMENT = _visualEditing.DEFAULT_SWITCH_ELEMENT;
1471
+ exports.DEFAULT_TAB_ELEMENT = _visualEditing.DEFAULT_TAB_ELEMENT;
1472
+ exports.DEFAULT_TAB_LIST_ELEMENT = _visualEditing.DEFAULT_TAB_LIST_ELEMENT;
1473
+ exports.DEFAULT_TEXT_AREA_ELEMENT = _visualEditing.DEFAULT_TEXT_AREA_ELEMENT;
1474
+ exports.DEFAULT_TEXT_ELEMENT = _visualEditing.DEFAULT_TEXT_ELEMENT;
1475
+ exports.DEFAULT_TEXT_INPUT_ELEMENT = _visualEditing.DEFAULT_TEXT_INPUT_ELEMENT;
1476
+ exports.DEFAULT_TOOLTIP_ELEMENT = _visualEditing.DEFAULT_TOOLTIP_ELEMENT;
1477
+ exports.DEFAULT_VIRTUAL_LIST_ELEMENT = _visualEditing.DEFAULT_VIRTUAL_LIST_ELEMENT;
1478
+ exports.ElementQuery = _visualEditing.ElementQuery;
1479
+ exports.Flex = _visualEditing.Flex;
1480
+ exports.Grid = _visualEditing.Grid;
1481
+ exports.Heading = _visualEditing.Heading;
1482
+ exports.Hotkeys = _visualEditing.Hotkeys;
1483
+ exports.Inline = _visualEditing.Inline;
1484
+ exports.KBD = _visualEditing.KBD;
1485
+ exports.Label = _visualEditing.Label;
1486
+ exports.Layer = _visualEditing.Layer;
1487
+ exports.LayerProvider = _visualEditing.LayerProvider;
1488
+ exports.Menu = _visualEditing.Menu;
1489
+ exports.MenuDivider = _visualEditing.MenuDivider;
1490
+ exports.MenuGroup = _visualEditing.MenuGroup;
1491
+ exports.MenuItem = _visualEditing.MenuItem;
1492
+ exports.Popover = _visualEditing.Popover;
1493
+ exports.Portal = _visualEditing.Portal;
1494
+ exports.PortalProvider = _visualEditing.PortalProvider;
1495
+ exports.Radio = _visualEditing.Radio;
1496
+ exports.Select = _visualEditing.Select;
1497
+ exports.Spinner = _visualEditing.Spinner;
1498
+ exports.SrOnly = _visualEditing.SrOnly;
1499
+ exports.Stack = _visualEditing.Stack;
1500
+ exports.Switch = _visualEditing.Switch;
1501
+ exports.Tab = _visualEditing.Tab;
1502
+ exports.TabList = _visualEditing.TabList;
1503
+ exports.Text = _visualEditing.Text;
1504
+ exports.TextArea = _visualEditing.TextArea;
1505
+ exports.TextInput = _visualEditing.TextInput;
1506
+ exports.ThemeColorProvider = _visualEditing.ThemeColorProvider;
1507
+ exports.ThemeProvider = _visualEditing.ThemeProvider;
1508
+ exports.Tooltip = _visualEditing.Tooltip;
1509
+ exports.TooltipDelayGroupContext = _visualEditing.TooltipDelayGroupContext;
1510
+ exports.TooltipDelayGroupProvider = _visualEditing.TooltipDelayGroupProvider;
1511
+ exports.VirtualList = _visualEditing.VirtualList;
1512
+ exports._ResizeObserver = _visualEditing._ResizeObserver;
1513
+ exports._elementSizeObserver = _visualEditing._elementSizeObserver;
1514
+ exports._getArrayProp = _visualEditing._getArrayProp;
1515
+ exports._isEnterToClickElement = _visualEditing._isEnterToClickElement;
1516
+ exports._isScrollable = _visualEditing._isScrollable;
1517
+ exports.containsOrEqualsElement = _visualEditing.containsOrEqualsElement;
1518
+ exports.isHTMLAnchorElement = _visualEditing.isHTMLAnchorElement;
1519
+ exports.isHTMLButtonElement = _visualEditing.isHTMLButtonElement;
1520
+ exports.isHTMLElement = _visualEditing.isHTMLElement;
1521
+ exports.isHTMLInputElement = _visualEditing.isHTMLInputElement;
1522
+ exports.isHTMLSelectElement = _visualEditing.isHTMLSelectElement;
1523
+ exports.isHTMLTextAreaElement = _visualEditing.isHTMLTextAreaElement;
1524
+ exports.useArrayProp = _visualEditing.useArrayProp;
1525
+ exports.useBoundaryElement = _visualEditing.useBoundaryElement;
1526
+ exports.useCard = _visualEditing.useCard;
1527
+ exports.useClickOutsideEvent = _visualEditing.useClickOutsideEvent;
1528
+ exports.useCustomValidity = _visualEditing.useCustomValidity;
1529
+ exports.useElementSize = _visualEditing.useElementSize;
1530
+ exports.useGlobalKeyDown = _visualEditing.useGlobalKeyDown;
1531
+ exports.useLayer = _visualEditing.useLayer;
1532
+ exports.useMatchMedia = _visualEditing.useMatchMedia;
1533
+ exports.useMediaIndex = _visualEditing.useMediaIndex;
1534
+ exports.usePortal = _visualEditing.usePortal;
1535
+ exports.usePrefersDark = _visualEditing.usePrefersDark;
1536
+ exports.usePrefersReducedMotion = _visualEditing.usePrefersReducedMotion;
1537
+ exports.useRootTheme = _visualEditing.useRootTheme;
1538
+ exports.useTheme = _visualEditing.useTheme;
1539
+ exports.useTheme_v2 = _visualEditing.useTheme_v2;
1540
+ exports.useTooltipDelayGroup = _visualEditing.useTooltipDelayGroup;
1541
+ Object.defineProperty(exports, "px", {
1542
+ enumerable: !0,
1543
+ get: function() {
1544
+ return css.px;
1545
+ }
1546
+ });
1547
+ Object.defineProperty(exports, "rem", {
1548
+ enumerable: !0,
1549
+ get: function() {
1550
+ return css.rem;
1551
+ }
1552
+ });
1553
+ exports.Autocomplete = Autocomplete;
1554
+ exports.Breadcrumbs = Breadcrumbs;
1555
+ exports.CodeSkeleton = CodeSkeleton;
1556
+ exports.DEFAULT_AUTOCOMPLETE_ELEMENT = DEFAULT_AUTOCOMPLETE_ELEMENT;
1557
+ exports.DEFAULT_BREADCRUMBS_ELEMENT = DEFAULT_BREADCRUMBS_ELEMENT;
1558
+ exports.DEFAULT_CODE_SKELETON_ELEMENT = DEFAULT_CODE_SKELETON_ELEMENT;
1559
+ exports.DEFAULT_DIALOG_ELEMENT = DEFAULT_DIALOG_ELEMENT;
1560
+ exports.DEFAULT_HEADING_SKELETON_ELEMENT = DEFAULT_HEADING_SKELETON_ELEMENT;
1561
+ exports.DEFAULT_LABEL_SKELETON_ELEMENT = DEFAULT_LABEL_SKELETON_ELEMENT;
1562
+ exports.DEFAULT_SKELETON_ELEMENT = DEFAULT_SKELETON_ELEMENT;
1563
+ exports.DEFAULT_TAB_PANEL_ELEMENT = DEFAULT_TAB_PANEL_ELEMENT;
1564
+ exports.DEFAULT_TEXT_SKELETON_ELEMENT = DEFAULT_TEXT_SKELETON_ELEMENT;
1565
+ exports.DEFAULT_TOAST_ELEMENT = DEFAULT_TOAST_ELEMENT;
1566
+ exports.DEFAULT_TREE_ELEMENT = DEFAULT_TREE_ELEMENT;
1567
+ exports.DEFAULT_TREE_ITEM_ELEMENT = DEFAULT_TREE_ITEM_ELEMENT;
1568
+ exports.Dialog = Dialog;
1569
+ exports.DialogContext = DialogContext;
1570
+ exports.DialogProvider = DialogProvider;
1571
+ exports.ErrorBoundary = ErrorBoundary;
1572
+ exports.HeadingSkeleton = HeadingSkeleton;
1573
+ exports.LabelSkeleton = LabelSkeleton;
1574
+ exports.MenuButton = MenuButton;
1575
+ exports.Skeleton = Skeleton;
1576
+ exports.StyleTags = StyleTags;
1577
+ exports.TabPanel = TabPanel;
1578
+ exports.TextSkeleton = TextSkeleton;
1579
+ exports.Toast = Toast;
1580
+ exports.ToastProvider = ToastProvider;
1581
+ exports.Tree = Tree;
1582
+ exports.TreeItem = TreeItem;
1583
+ exports._hasFocus = _hasFocus;
1584
+ exports._raf = _raf;
1585
+ exports._raf2 = _raf2;
1586
+ exports._responsive = _responsive;
1587
+ exports.attemptFocus = attemptFocus;
1588
+ exports.createColorTheme = createColorTheme;
1589
+ exports.focusFirstDescendant = focusFirstDescendant;
1590
+ exports.focusLastDescendant = focusLastDescendant;
1591
+ exports.hexToRgb = hexToRgb;
1592
+ exports.hslToRgb = hslToRgb;
1593
+ exports.isFocusable = isFocusable;
1594
+ exports.multiply = multiply;
1595
+ exports.parseColor = parseColor;
1596
+ exports.rgbToHex = rgbToHex;
1597
+ exports.rgbToHsl = rgbToHsl;
1598
+ exports.rgba = rgba;
1599
+ exports.screen = screen;
1600
+ exports.useClickOutside = useClickOutside;
1601
+ exports.useDialog = useDialog;
1602
+ exports.useElementRect = useElementRect;
1603
+ exports.useForwardedRef = useForwardedRef;
1604
+ exports.useToast = useToast;
1605
+ exports.useTree = useTree;
1606
+ //# sourceMappingURL=index.cjs.map