@sanity/ui 3.0.11 → 3.0.12-canary.1

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 (53) hide show
  1. package/dist/_chunks-cjs/_visual-editing.js +1124 -628
  2. package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
  3. package/dist/_chunks-es/_visual-editing.mjs +1127 -631
  4. package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
  5. package/dist/_visual-editing.d.mts +3 -7
  6. package/dist/_visual-editing.d.ts +3 -7
  7. package/dist/index.d.mts +11 -12
  8. package/dist/index.d.ts +11 -12
  9. package/dist/index.js +252 -295
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +254 -297
  12. package/dist/index.mjs.map +1 -1
  13. package/package.json +26 -40
  14. package/src/core/components/autocomplete/autocomplete.tsx +2 -2
  15. package/src/core/components/breadcrumbs/breadcrumbs.tsx +70 -40
  16. package/src/core/components/dialog/dialog.tsx +10 -14
  17. package/src/core/components/hotkeys/hotkeys.tsx +2 -2
  18. package/src/core/components/menu/menuGroup.tsx +2 -2
  19. package/src/core/components/menu/menuItem.tsx +4 -4
  20. package/src/core/components/skeleton/skeleton.tsx +2 -2
  21. package/src/core/components/skeleton/textSkeleton.tsx +5 -5
  22. package/src/core/components/tree/tree.tsx +176 -182
  23. package/src/core/components/tree/treeGroup.tsx +2 -4
  24. package/src/core/components/tree/treeItem.tsx +5 -5
  25. package/src/core/hooks/index.ts +1 -1
  26. package/src/core/hooks/useArrayProp.ts +5 -17
  27. package/src/core/primitives/avatar/avatar.tsx +14 -16
  28. package/src/core/primitives/avatar/avatarCounter.tsx +14 -16
  29. package/src/core/primitives/avatar/avatarStack.tsx +2 -2
  30. package/src/core/primitives/badge/badge.tsx +3 -3
  31. package/src/core/primitives/box/box.tsx +26 -26
  32. package/src/core/primitives/button/button.tsx +11 -11
  33. package/src/core/primitives/card/card.tsx +8 -8
  34. package/src/core/primitives/code/code.tsx +2 -2
  35. package/src/core/primitives/container/container.tsx +2 -2
  36. package/src/core/primitives/flex/flex.tsx +6 -6
  37. package/src/core/primitives/grid/grid.tsx +9 -9
  38. package/src/core/primitives/heading/heading.tsx +3 -3
  39. package/src/core/primitives/inline/inline.tsx +2 -2
  40. package/src/core/primitives/kbd/kbd.tsx +2 -2
  41. package/src/core/primitives/label/label.tsx +3 -3
  42. package/src/core/primitives/popover/floating-ui/size.ts +32 -16
  43. package/src/core/primitives/popover/popover.tsx +355 -328
  44. package/src/core/primitives/popover/popoverCard.tsx +123 -125
  45. package/src/core/primitives/select/select.tsx +6 -5
  46. package/src/core/primitives/stack/stack.tsx +2 -2
  47. package/src/core/primitives/text/text.tsx +3 -3
  48. package/src/core/primitives/textArea/textArea.tsx +6 -5
  49. package/src/core/primitives/textInput/textInput.tsx +6 -5
  50. package/src/core/primitives/tooltip/tooltip.tsx +73 -44
  51. package/src/core/primitives/tooltip/tooltipCard.tsx +83 -85
  52. package/src/core/utils/layer/layerProvider.tsx +3 -2
  53. package/src/core/utils/virtualList/virtualList.tsx +48 -23
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: !0 });
3
- var _visualEditing = require("./_chunks-cjs/_visual-editing.js"), jsxRuntime = require("react/jsx-runtime"), reactCompilerRuntime = require("react-compiler-runtime"), icons = require("@sanity/icons"), react = require("react"), styledComponents = require("styled-components"), theme = require("@sanity/ui/theme"), framerMotion = require("framer-motion");
3
+ var _visualEditing = require("./_chunks-cjs/_visual-editing.js"), jsxRuntime = require("react/jsx-runtime"), icons = require("@sanity/icons"), react = require("react"), styledComponents = require("styled-components"), reactCompilerRuntime = require("react-compiler-runtime"), theme = require("@sanity/ui/theme"), framerMotion = require("framer-motion");
4
4
  function _raf(fn) {
5
5
  const frameId = requestAnimationFrame(fn);
6
6
  return () => {
@@ -47,6 +47,11 @@ function focusLastDescendant(element) {
47
47
  }
48
48
  return !1;
49
49
  }
50
+ function useArrayProp(val, defaultVal) {
51
+ const $ = reactCompilerRuntime.c(3);
52
+ let t0;
53
+ return $[0] !== defaultVal || $[1] !== val ? (t0 = _visualEditing._getArrayProp(val, defaultVal), $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2], t0;
54
+ }
50
55
  function _getElements(element, elementsArg) {
51
56
  const ret = [element];
52
57
  for (const el of elementsArg)
@@ -209,17 +214,15 @@ function autocompleteReducer(state, msg) {
209
214
  } : state;
210
215
  }
211
216
  const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "Home", "End", "PageUp", "PageDown", "Meta", "Tab", "CapsLock"], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1, InnerAutocomplete = react.forwardRef(function(props, forwardedRef) {
212
- const $ = reactCompilerRuntime.c(179);
213
- let customValidity, disabled, filterOptionProp, icon, id, loading, onBlur, onChange, onFocus, onQueryChange, onSelect, openButton, openOnFocus, optionsProp, prefix, readOnly, relatedElements, renderOptionProp, renderPopover, restProps, suffix, t0, t1, t2, t3, t4, t5, t6, valueProp;
214
- $[0] !== props ? ({
215
- border: t0,
217
+ const {
218
+ border = !0,
216
219
  customValidity,
217
220
  disabled,
218
221
  filterOption: filterOptionProp,
219
- fontSize: t1,
222
+ fontSize = 2,
220
223
  icon,
221
224
  id,
222
- listBox: t2,
225
+ listBox = _visualEditing.EMPTY_RECORD,
223
226
  loading,
224
227
  onBlur,
225
228
  onChange,
@@ -229,60 +232,35 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
229
232
  openButton,
230
233
  openOnFocus,
231
234
  options: optionsProp,
232
- padding: t3,
233
- popover: t4,
235
+ padding: paddingProp = 3,
236
+ popover = _visualEditing.EMPTY_RECORD,
234
237
  prefix,
235
- radius: t5,
238
+ radius = 2,
236
239
  readOnly,
237
240
  relatedElements,
238
241
  renderOption: renderOptionProp,
239
242
  renderPopover,
240
- renderValue: t6,
243
+ renderValue = DEFAULT_RENDER_VALUE,
241
244
  suffix,
242
245
  value: valueProp,
243
246
  ...restProps
244
- } = props, $[0] = props, $[1] = customValidity, $[2] = disabled, $[3] = filterOptionProp, $[4] = icon, $[5] = id, $[6] = loading, $[7] = onBlur, $[8] = onChange, $[9] = onFocus, $[10] = onQueryChange, $[11] = onSelect, $[12] = openButton, $[13] = openOnFocus, $[14] = optionsProp, $[15] = prefix, $[16] = readOnly, $[17] = relatedElements, $[18] = renderOptionProp, $[19] = renderPopover, $[20] = restProps, $[21] = suffix, $[22] = t0, $[23] = t1, $[24] = t2, $[25] = t3, $[26] = t4, $[27] = t5, $[28] = t6, $[29] = valueProp) : (customValidity = $[1], disabled = $[2], filterOptionProp = $[3], icon = $[4], id = $[5], loading = $[6], onBlur = $[7], onChange = $[8], onFocus = $[9], onQueryChange = $[10], onSelect = $[11], openButton = $[12], openOnFocus = $[13], optionsProp = $[14], prefix = $[15], readOnly = $[16], relatedElements = $[17], renderOptionProp = $[18], renderPopover = $[19], restProps = $[20], suffix = $[21], t0 = $[22], t1 = $[23], t2 = $[24], t3 = $[25], t4 = $[26], t5 = $[27], t6 = $[28], valueProp = $[29]);
245
- const border = t0 === void 0 ? !0 : t0, fontSize = t1 === void 0 ? 2 : t1, listBox = t2 === void 0 ? _visualEditing.EMPTY_RECORD : t2, paddingProp = t3 === void 0 ? 3 : t3, popover = t4 === void 0 ? _visualEditing.EMPTY_RECORD : t4, radius = t5 === void 0 ? 2 : t5, renderValue = t6 === void 0 ? DEFAULT_RENDER_VALUE : t6, t7 = valueProp || null, t8 = valueProp || null;
246
- let t9;
247
- $[30] !== t7 || $[31] !== t8 ? (t9 = {
248
- activeValue: t7,
247
+ } = props, [state, dispatch] = react.useReducer(autocompleteReducer, {
248
+ activeValue: valueProp || null,
249
249
  focused: !1,
250
250
  listFocused: !1,
251
251
  query: null,
252
- value: t8
253
- }, $[30] = t7, $[31] = t8, $[32] = t9) : t9 = $[32];
254
- const [state, dispatch] = react.useReducer(autocompleteReducer, t9), {
252
+ value: valueProp || null
253
+ }), {
255
254
  activeValue,
256
255
  focused,
257
256
  listFocused,
258
257
  query,
259
258
  value
260
- } = state;
261
- let t10;
262
- $[33] !== fontSize || $[34] !== paddingProp ? (t10 = (t112) => {
263
- const {
264
- value: value_0
265
- } = t112;
266
- return /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Card, { "data-as": "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 }) });
267
- }, $[33] = fontSize, $[34] = paddingProp, $[35] = t10) : t10 = $[35];
268
- const renderOption = typeof renderOptionProp == "function" ? renderOptionProp : t10, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = react.useRef(null), resultsPopoverElementRef = react.useRef(null), inputElementRef = react.useRef(null), listBoxElementRef = react.useRef(null), [inputElement, setInputElement] = react.useState(null), listFocusedRef = react.useRef(!1), valueRef = react.useRef(value), valuePropRef = react.useRef(valueProp), popoverMouseWithinRef = react.useRef(!1);
269
- let t11, t12;
270
- $[36] !== inputElement ? (t11 = () => inputElement, t12 = [inputElement], $[36] = inputElement, $[37] = t11, $[38] = t12) : (t11 = $[37], t12 = $[38]), react.useImperativeHandle(inputElementRef, t11, t12);
271
- let t13, t14;
272
- $[39] !== inputElement ? (t13 = () => inputElement, t14 = [inputElement], $[39] = inputElement, $[40] = t13, $[41] = t14) : (t13 = $[40], t14 = $[41]), react.useImperativeHandle(forwardedRef, t13, t14);
273
- const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : _visualEditing.EMPTY_ARRAY, padding = _visualEditing.useArrayProp(paddingProp);
274
- let t15;
275
- $[42] !== options || $[43] !== value ? (t15 = value !== null ? options.find((o) => o.value === value) : void 0, $[42] = options, $[43] = value, $[44] = t15) : t15 = $[44];
276
- const currentOption = t15;
277
- let t16;
278
- if ($[45] !== filterOption || $[46] !== options || $[47] !== query) {
279
- let t172;
280
- $[49] !== filterOption || $[50] !== query ? (t172 = (option) => query ? filterOption(query, option) : !0, $[49] = filterOption, $[50] = query, $[51] = t172) : t172 = $[51], t16 = options.filter(t172), $[45] = filterOption, $[46] = options, $[47] = query, $[48] = t16;
281
- } else
282
- t16 = $[48];
283
- const filteredOptions = t16, filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null;
284
- let t17;
285
- $[52] !== onBlur || $[53] !== onQueryChange || $[54] !== relatedElements ? (t17 = (event) => {
259
+ } = state, defaultRenderOption = react.useCallback(({
260
+ value: value_0
261
+ }) => /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Card, { "data-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), [inputElement, setInputElement] = react.useState(null), listFocusedRef = react.useRef(!1), valueRef = react.useRef(value), valuePropRef = react.useRef(valueProp), popoverMouseWithinRef = react.useRef(!1);
262
+ react.useImperativeHandle(inputElementRef, () => inputElement, [inputElement]), react.useImperativeHandle(forwardedRef, () => inputElement, [inputElement]);
263
+ const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : _visualEditing.EMPTY_ARRAY, padding = _visualEditing._getArrayProp(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) => {
286
264
  setTimeout(() => {
287
265
  if (popoverMouseWithinRef.current)
288
266
  return;
@@ -299,30 +277,20 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
299
277
  type: "root/blur"
300
278
  }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
301
279
  }, 0);
302
- }, $[52] = onBlur, $[53] = onQueryChange, $[54] = relatedElements, $[55] = t17) : t17 = $[55];
303
- const handleRootBlur = t17;
304
- let t18;
305
- $[56] === Symbol.for("react.memo_cache_sentinel") ? (t18 = (event_0) => {
280
+ }, [onBlur, onQueryChange, relatedElements]), handleRootFocus = react.useCallback((event_0) => {
306
281
  const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
307
282
  listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
308
283
  type: "root/setListFocused",
309
284
  listFocused: listFocused_0
310
285
  }));
311
- }, $[56] = t18) : t18 = $[56];
312
- const handleRootFocus = t18;
313
- let t19;
314
- $[57] !== onChange || $[58] !== onQueryChange || $[59] !== onSelect ? (t19 = (v) => {
286
+ }, []), handleOptionSelect = react.useCallback((v) => {
315
287
  dispatch({
316
288
  type: "value/change",
317
289
  value: v
318
290
  }), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
319
- }, $[57] = onChange, $[58] = onQueryChange, $[59] = onSelect, $[60] = t19) : t19 = $[60];
320
- const handleOptionSelect = t19;
321
- let t20;
322
- $[61] !== activeValue || $[62] !== filteredOptions || $[63] !== filteredOptionsLen || $[64] !== onQueryChange ? (t20 = (event_1) => {
291
+ }, [onChange, onSelect, onQueryChange]), handleRootKeyDown = react.useCallback((event_1) => {
323
292
  if (event_1.key === "ArrowDown") {
324
- if (event_1.preventDefault(), !filteredOptionsLen)
325
- return;
293
+ if (event_1.preventDefault(), !filteredOptionsLen) return;
326
294
  const activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
327
295
  nextActiveOption && dispatch({
328
296
  type: "root/setActiveValue",
@@ -332,8 +300,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
332
300
  return;
333
301
  }
334
302
  if (event_1.key === "ArrowUp") {
335
- if (event_1.preventDefault(), !filteredOptionsLen)
336
- return;
303
+ if (event_1.preventDefault(), !filteredOptionsLen) return;
337
304
  const activeOption_0 = filteredOptions.find((o_1) => o_1.value === activeValue), activeIndex_0 = activeOption_0 ? filteredOptions.indexOf(activeOption_0) : -1, nextActiveOption_0 = filteredOptions[activeIndex_0 === -1 ? filteredOptionsLen - 1 : (filteredOptionsLen + activeIndex_0 - 1) % filteredOptionsLen];
338
305
  nextActiveOption_0 && dispatch({
339
306
  type: "root/setActiveValue",
@@ -353,58 +320,35 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
353
320
  inputElementRef.current?.focus();
354
321
  return;
355
322
  }
356
- }, $[61] = activeValue, $[62] = filteredOptions, $[63] = filteredOptionsLen, $[64] = onQueryChange, $[65] = t20) : t20 = $[65];
357
- const handleRootKeyDown = t20;
358
- let t21;
359
- $[66] !== onQueryChange ? (t21 = (event_2) => {
323
+ }, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange = react.useCallback((event_2) => {
360
324
  const nextQuery = event_2.currentTarget.value;
361
325
  dispatch({
362
326
  type: "input/change",
363
327
  query: nextQuery
364
328
  }), onQueryChange && onQueryChange(nextQuery);
365
- }, $[66] = onQueryChange, $[67] = t21) : t21 = $[67];
366
- const handleInputChange = t21;
367
- let t22;
368
- $[68] !== currentOption || $[69] !== renderValue || $[70] !== value ? (t22 = () => {
329
+ }, [onQueryChange]), dispatchOpen = react.useCallback(() => {
369
330
  dispatch({
370
331
  type: "root/open",
371
332
  query: value ? renderValue(value, currentOption) : ""
372
333
  });
373
- }, $[68] = currentOption, $[69] = renderValue, $[70] = value, $[71] = t22) : t22 = $[71];
374
- const dispatchOpen = t22;
375
- let t23;
376
- $[72] !== dispatchOpen || $[73] !== focused || $[74] !== onFocus || $[75] !== openOnFocus ? (t23 = (event_3) => {
334
+ }, [currentOption, renderValue, value]), handleInputFocus = react.useCallback((event_3) => {
377
335
  focused || (dispatch({
378
336
  type: "input/focus"
379
337
  }), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
380
- }, $[72] = dispatchOpen, $[73] = focused, $[74] = onFocus, $[75] = openOnFocus, $[76] = t23) : t23 = $[76];
381
- const handleInputFocus = t23;
382
- let t24;
383
- $[77] === Symbol.for("react.memo_cache_sentinel") ? (t24 = () => {
338
+ }, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter = react.useCallback(() => {
384
339
  popoverMouseWithinRef.current = !0;
385
- }, $[77] = t24) : t24 = $[77];
386
- const handlePopoverMouseEnter = t24;
387
- let t25;
388
- $[78] === Symbol.for("react.memo_cache_sentinel") ? (t25 = () => {
340
+ }, []), handlePopoverMouseLeave = react.useCallback(() => {
389
341
  popoverMouseWithinRef.current = !1;
390
- }, $[78] = t25) : t25 = $[78];
391
- const handlePopoverMouseLeave = t25;
392
- let t26;
393
- $[79] !== onChange || $[80] !== onQueryChange ? (t26 = () => {
342
+ }, []), handleClearButtonClick = react.useCallback(() => {
394
343
  dispatch({
395
344
  type: "root/clear"
396
345
  }), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
397
- }, $[79] = onChange, $[80] = onQueryChange, $[81] = t26) : t26 = $[81];
398
- const handleClearButtonClick = t26;
399
- let t27;
400
- $[82] === Symbol.for("react.memo_cache_sentinel") ? (t27 = () => {
346
+ }, [onChange, onQueryChange]), handleClearButtonFocus = react.useCallback(() => {
401
347
  dispatch({
402
348
  type: "input/focus"
403
349
  });
404
- }, $[82] = t27) : t27 = $[82];
405
- const handleClearButtonFocus = t27;
406
- let t28, t29;
407
- $[83] !== valueProp ? (t28 = () => {
350
+ }, []);
351
+ react.useEffect(() => {
408
352
  if (valueProp !== valuePropRef.current) {
409
353
  valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
410
354
  type: "value/change",
@@ -416,19 +360,14 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
416
360
  type: "value/change",
417
361
  value: valueProp || null
418
362
  }));
419
- }, t29 = [valueProp], $[83] = valueProp, $[84] = t28, $[85] = t29) : (t28 = $[84], t29 = $[85]), react.useEffect(t28, t29);
420
- let t30, t31;
421
- $[86] !== focused ? (t30 = () => {
363
+ }, [valueProp]), react.useEffect(() => {
422
364
  !focused && valueRef.current && dispatch({
423
365
  type: "root/setActiveValue",
424
366
  value: valueRef.current
425
367
  });
426
- }, t31 = [focused], $[86] = focused, $[87] = t30, $[88] = t31) : (t30 = $[87], t31 = $[88]), react.useEffect(t30, t31);
427
- let t32, t33;
428
- $[89] !== activeValue || $[90] !== filteredOptions ? (t32 = () => {
368
+ }, [focused]), react.useEffect(() => {
429
369
  const listElement = listBoxElementRef.current;
430
- if (!listElement)
431
- return;
370
+ if (!listElement) return;
432
371
  const activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
433
372
  if (activeOption_1) {
434
373
  const activeIndex_1 = filteredOptions.indexOf(activeOption_1), activeItemElement = listElement.childNodes[activeIndex_1];
@@ -438,101 +377,29 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
438
377
  focusFirstDescendant(activeItemElement);
439
378
  }
440
379
  }
441
- }, t33 = [activeValue, filteredOptions], $[89] = activeValue, $[90] = filteredOptions, $[91] = t32, $[92] = t33) : (t32 = $[91], t33 = $[92]), react.useEffect(t32, t33);
442
- let t34;
443
- bb0: {
444
- if (!loading && !disabled && value) {
445
- let t352;
446
- $[93] === Symbol.for("react.memo_cache_sentinel") ? (t352 = {
380
+ }, [activeValue, filteredOptions]);
381
+ const clearButton = react.useMemo(() => {
382
+ if (!loading && !disabled && value)
383
+ return {
447
384
  "aria-label": "Clear",
448
385
  onFocus: handleClearButtonFocus
449
- }, $[93] = t352) : t352 = $[93], t34 = t352;
450
- break bb0;
451
- }
452
- t34 = void 0;
453
- }
454
- const clearButton = t34;
455
- let t35;
456
- $[94] !== padding ? (t35 = padding.map(_temp$3), $[94] = padding, $[95] = t35) : t35 = $[95];
457
- const openButtonBoxPadding = t35;
458
- let t36;
459
- $[96] !== padding ? (t36 = padding.map(_temp2$1), $[96] = padding, $[97] = t36) : t36 = $[97];
460
- const openButtonPadding = t36, openButtonProps = typeof openButton == "object" ? openButton : _visualEditing.EMPTY_RECORD;
461
- let t37;
462
- $[98] !== dispatchOpen || $[99] !== openButtonProps ? (t37 = (event_4) => {
386
+ };
387
+ }, [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) => {
463
388
  dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
464
- }, $[98] = dispatchOpen, $[99] = openButtonProps, $[100] = t37) : t37 = $[100];
465
- const handleOpenClick = t37;
466
- let t38;
467
- $[101] !== disabled || $[102] !== expanded || $[103] !== fontSize || $[104] !== handleOpenClick || $[105] !== openButton || $[106] !== openButtonBoxPadding || $[107] !== openButtonPadding || $[108] !== openButtonProps || $[109] !== readOnly ? (t38 = !disabled && !readOnly && openButton ? /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Button, { "aria-label": "Open", disabled: expanded, fontSize, icon: icons.ChevronDownIcon, mode: "bleed", padding: openButtonPadding, ...openButtonProps, onClick: handleOpenClick }) }) : void 0, $[101] = disabled, $[102] = expanded, $[103] = fontSize, $[104] = handleOpenClick, $[105] = openButton, $[106] = openButtonBoxPadding, $[107] = openButtonPadding, $[108] = openButtonProps, $[109] = readOnly, $[110] = t38) : t38 = $[110];
468
- const openButtonNode = t38;
469
- let t39;
470
- bb1: {
471
- if (query === null) {
472
- if (value !== null) {
473
- let t402;
474
- $[111] !== currentOption || $[112] !== renderValue || $[113] !== value ? (t402 = renderValue(value, currentOption), $[111] = currentOption, $[112] = renderValue, $[113] = value, $[114] = t402) : t402 = $[114], t39 = t402;
475
- break bb1;
476
- }
477
- t39 = "";
478
- break bb1;
479
- }
480
- t39 = query;
481
- }
482
- const inputValue = t39;
483
- let t40;
484
- $[115] !== listFocused ? (t40 = (event_5) => {
389
+ }, [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, 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]), handleListBoxKeyDown = react.useCallback((event_5) => {
485
390
  event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
486
- }, $[115] = listFocused, $[116] = t40) : t40 = $[116];
487
- const handleListBoxKeyDown = t40;
488
- let t41;
489
- bb2: {
490
- if (filteredOptions.length === 0) {
491
- t41 = null;
492
- break bb2;
493
- }
494
- let t422;
495
- if ($[117] !== activeValue || $[118] !== currentOption || $[119] !== filteredOptions || $[120] !== handleOptionSelect || $[121] !== id || $[122] !== listFocused || $[123] !== loading || $[124] !== renderOption) {
496
- let t433;
497
- $[126] !== activeValue || $[127] !== currentOption || $[128] !== handleOptionSelect || $[129] !== id || $[130] !== listFocused || $[131] !== loading || $[132] !== renderOption ? (t433 = (option_0) => {
498
- const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
499
- 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), {
500
- disabled: loading,
501
- selected: active,
502
- tabIndex: listFocused && active ? 0 : -1
503
- }) }, option_0.value);
504
- }, $[126] = activeValue, $[127] = currentOption, $[128] = handleOptionSelect, $[129] = id, $[130] = listFocused, $[131] = loading, $[132] = renderOption, $[133] = t433) : t433 = $[133], t422 = filteredOptions.map(t433), $[117] = activeValue, $[118] = currentOption, $[119] = filteredOptions, $[120] = handleOptionSelect, $[121] = id, $[122] = listFocused, $[123] = loading, $[124] = renderOption, $[125] = t422;
505
- } else
506
- t422 = $[125];
507
- let t432;
508
- $[134] !== listBoxId || $[135] !== t422 ? (t432 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", id: listBoxId, ref: listBoxElementRef, role: "listbox", space: 1, children: t422 }), $[134] = listBoxId, $[135] = t422, $[136] = t432) : t432 = $[136];
509
- let t442;
510
- $[137] !== handleListBoxKeyDown || $[138] !== listBox || $[139] !== t432 ? (t442 = /* @__PURE__ */ jsxRuntime.jsx(ListBox, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: t432 }), $[137] = handleListBoxKeyDown, $[138] = listBox, $[139] = t432, $[140] = t442) : t442 = $[140], t41 = t442;
511
- }
512
- const content2 = t41;
513
- let t42;
514
- bb3: {
515
- if (renderPopover) {
516
- const t433 = !expanded;
517
- let t442;
518
- $[141] !== content2 || $[142] !== inputElement || $[143] !== renderPopover || $[144] !== t433 ? (t442 = /* @__PURE__ */ jsxRuntime.jsx(RenderPopover, { content: content2, hidden: t433, inputElement, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, resultsPopoverElementRef, renderPopover }), $[141] = content2, $[142] = inputElement, $[143] = renderPopover, $[144] = t433, $[145] = t442) : t442 = $[145], t42 = t442;
519
- break bb3;
520
- }
521
- if (filteredOptionsLen === 0) {
522
- t42 = null;
523
- break bb3;
524
- }
525
- let t432;
526
- $[146] !== content2 || $[147] !== expanded || $[148] !== inputElement || $[149] !== popover || $[150] !== radius ? (t432 = /* @__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, ref: resultsPopoverElementRef, referenceElement: inputElement, ...popover }), $[146] = content2, $[147] = expanded, $[148] = inputElement, $[149] = popover, $[150] = radius, $[151] = t432) : t432 = $[151], t42 = t432;
527
- }
528
- const results = t42, t43 = loading && AnimatedSpinnerIcon, t44 = suffix || openButtonNode;
529
- let t45;
530
- $[152] !== activeItemId || $[153] !== border || $[154] !== clearButton || $[155] !== customValidity || $[156] !== disabled || $[157] !== expanded || $[158] !== fontSize || $[159] !== handleClearButtonClick || $[160] !== handleInputChange || $[161] !== handleInputFocus || $[162] !== icon || $[163] !== id || $[164] !== inputValue || $[165] !== listBoxId || $[166] !== padding || $[167] !== prefix || $[168] !== radius || $[169] !== readOnly || $[170] !== restProps || $[171] !== t43 || $[172] !== t44 ? (t45 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.TextInput, { ...restProps, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", border, clearButton, customValidity, disabled, fontSize, icon, iconRight: t43, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: setInputElement, role: "combobox", spellCheck: !1, suffix: t44, value: inputValue }), $[152] = activeItemId, $[153] = border, $[154] = clearButton, $[155] = customValidity, $[156] = disabled, $[157] = expanded, $[158] = fontSize, $[159] = handleClearButtonClick, $[160] = handleInputChange, $[161] = handleInputFocus, $[162] = icon, $[163] = id, $[164] = inputValue, $[165] = listBoxId, $[166] = padding, $[167] = prefix, $[168] = radius, $[169] = readOnly, $[170] = restProps, $[171] = t43, $[172] = t44, $[173] = t45) : t45 = $[173];
531
- let t46;
532
- return $[174] !== handleRootBlur || $[175] !== handleRootKeyDown || $[176] !== results || $[177] !== t45 ? (t46 = /* @__PURE__ */ jsxRuntime.jsxs(StyledAutocomplete, { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
533
- t45,
391
+ }, [listFocused]), content2 = react.useMemo(() => filteredOptions.length === 0 ? null : /* @__PURE__ */ jsxRuntime.jsx(ListBox, { "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) => {
392
+ const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
393
+ 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), {
394
+ disabled: loading,
395
+ selected: active,
396
+ tabIndex: listFocused && active ? 0 : -1
397
+ }) }, option_0.value);
398
+ }) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = react.useMemo(() => renderPopover ? /* @__PURE__ */ jsxRuntime.jsx(RenderPopover, { content: content2, hidden: !expanded, inputElement, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, resultsPopoverElementRef, renderPopover }) : 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, ref: resultsPopoverElementRef, referenceElement: inputElement, ...popover }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, inputElement, popover, radius, renderPopover]);
399
+ return /* @__PURE__ */ jsxRuntime.jsxs(StyledAutocomplete, { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
400
+ /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.TextInput, { ...restProps, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", border, clearButton, customValidity, disabled, fontSize, icon, iconRight: loading && AnimatedSpinnerIcon, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: setInputElement, role: "combobox", spellCheck: !1, suffix: suffix || openButtonNode, value: inputValue }),
534
401
  results
535
- ] }), $[174] = handleRootBlur, $[175] = handleRootKeyDown, $[176] = results, $[177] = t45, $[178] = t46) : t46 = $[178], t46;
402
+ ] });
536
403
  });
537
404
  function RenderPopover({
538
405
  renderPopover,
@@ -552,42 +419,93 @@ function RenderPopover({
552
419
  }, resultsPopoverElementRef);
553
420
  }
554
421
  InnerAutocomplete.displayName = "ForwardRef(Autocomplete)";
555
- const Autocomplete = InnerAutocomplete;
556
- function _temp$3(v_0) {
557
- return v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2;
558
- }
559
- function _temp2$1(v_1) {
560
- return Math.max(v_1 - 1, 0);
561
- }
562
- const StyledBreadcrumbs = styledComponents.styled.ol.withConfig({
422
+ const Autocomplete = InnerAutocomplete, StyledBreadcrumbs = styledComponents.styled.ol.withConfig({
563
423
  displayName: "StyledBreadcrumbs",
564
424
  componentId: "sc-1es8h8q-0"
565
425
  })`margin:0;padding:0;display:flex;list-style:none;align-items:center;white-space:nowrap;line-height:0;`, ExpandButton = styledComponents.styled(_visualEditing.Button).withConfig({
566
426
  displayName: "ExpandButton",
567
427
  componentId: "sc-1es8h8q-1"
568
428
  })`appearance:none;margin:-4px;`, Breadcrumbs = react.forwardRef(function(props, ref) {
569
- const {
429
+ const $ = reactCompilerRuntime.c(29);
430
+ let children, maxLength, restProps, separator, t0;
431
+ $[0] !== props ? ({
570
432
  children,
571
433
  maxLength,
572
434
  separator,
573
- space: spaceRaw = 2,
435
+ space: t0,
574
436
  ...restProps
575
- } = props, space = _visualEditing.useArrayProp(spaceRaw), [open, setOpen] = react.useState(!1), expandElementRef = react.useRef(null), popoverElementRef = react.useRef(null), collapse = react.useCallback(() => setOpen(!1), []), expand = react.useCallback(() => setOpen(!0), []);
576
- _visualEditing.useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
577
- const rawItems = react.useMemo(() => react.Children.toArray(children).filter(react.isValidElement), [children]), items = react.useMemo(() => {
578
- const len = rawItems.length;
579
- if (maxLength && len > maxLength) {
580
- const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
581
- return [...rawItems.slice(0, beforeLength - 1), /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { constrainSize: !0, content: /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ol", overflow: "auto", padding: space, space, children: rawItems.slice(beforeLength - 1, len - afterLength) }), open, placement: "top", portal: !0, ref: popoverElementRef, children: /* @__PURE__ */ jsxRuntime.jsx(ExpandButton, { fontSize: 1, mode: "bleed", onClick: open ? collapse : expand, padding: 1, ref: expandElementRef, selected: open, text: "\u2026" }) }, "button"), ...rawItems.slice(len - afterLength)];
582
- }
583
- return rawItems;
584
- }, [collapse, expand, maxLength, open, rawItems, space]);
585
- return /* @__PURE__ */ jsxRuntime.jsx(StyledBreadcrumbs, { "data-ui": "Breadcrumbs", ...restProps, ref, children: items.map((item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
586
- itemIndex > 0 && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": !0, as: "li", paddingX: space, children: separator || /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted: !0, children: "/" }) }),
587
- /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { as: "li", children: item })
588
- ] }, itemIndex)) });
437
+ } = props, $[0] = props, $[1] = children, $[2] = maxLength, $[3] = restProps, $[4] = separator, $[5] = t0) : (children = $[1], maxLength = $[2], restProps = $[3], separator = $[4], t0 = $[5]);
438
+ const spaceRaw = t0 === void 0 ? 2 : t0;
439
+ let t1;
440
+ $[6] !== spaceRaw ? (t1 = _visualEditing._getArrayProp(spaceRaw), $[6] = spaceRaw, $[7] = t1) : t1 = $[7];
441
+ const space = t1, [open, setOpen] = react.useState(!1), expandElementRef = react.useRef(null), popoverElementRef = react.useRef(null);
442
+ let t2;
443
+ $[8] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => setOpen(!1), $[8] = t2) : t2 = $[8];
444
+ const collapse = t2;
445
+ let t3;
446
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => setOpen(!0), $[9] = t3) : t3 = $[9];
447
+ const expand = t3;
448
+ let t4;
449
+ $[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => [expandElementRef.current, popoverElementRef.current], $[10] = t4) : t4 = $[10], _visualEditing.useClickOutsideEvent(collapse, t4);
450
+ let t5;
451
+ $[11] !== children ? (t5 = react.Children.toArray(children).filter(react.isValidElement), $[11] = children, $[12] = t5) : t5 = $[12];
452
+ const rawItems = t5;
453
+ let t6;
454
+ $[13] !== maxLength || $[14] !== open || $[15] !== rawItems || $[16] !== space ? (t6 = {
455
+ collapse,
456
+ expand,
457
+ expandElementRef,
458
+ maxLength,
459
+ open,
460
+ popoverElementRef,
461
+ rawItems,
462
+ space
463
+ }, $[13] = maxLength, $[14] = open, $[15] = rawItems, $[16] = space, $[17] = t6) : t6 = $[17];
464
+ const items = useItems(t6);
465
+ let t7;
466
+ if ($[18] !== items || $[19] !== separator || $[20] !== space) {
467
+ let t82;
468
+ $[22] !== separator || $[23] !== space ? (t82 = (item, itemIndex) => /* @__PURE__ */ jsxRuntime.jsxs(react.Fragment, { children: [
469
+ itemIndex > 0 && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { "aria-hidden": !0, as: "li", paddingX: space, children: separator || /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { muted: !0, children: "/" }) }),
470
+ /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { as: "li", children: item })
471
+ ] }, itemIndex), $[22] = separator, $[23] = space, $[24] = t82) : t82 = $[24], t7 = items.map(t82), $[18] = items, $[19] = separator, $[20] = space, $[21] = t7;
472
+ } else
473
+ t7 = $[21];
474
+ let t8;
475
+ return $[25] !== ref || $[26] !== restProps || $[27] !== t7 ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(StyledBreadcrumbs, { "data-ui": "Breadcrumbs", ...restProps, ref, children: t7 }), $[25] = ref, $[26] = restProps, $[27] = t7, $[28] = t8) : t8 = $[28], t8;
589
476
  });
590
477
  Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
478
+ function useItems(t0) {
479
+ const $ = reactCompilerRuntime.c(28), {
480
+ collapse,
481
+ expand,
482
+ expandElementRef,
483
+ maxLength,
484
+ open,
485
+ popoverElementRef,
486
+ rawItems,
487
+ space
488
+ } = t0, len = rawItems.length;
489
+ if (maxLength && len > maxLength) {
490
+ const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
491
+ let t1;
492
+ if ($[0] !== afterLength || $[1] !== beforeLength || $[2] !== collapse || $[3] !== expand || $[4] !== expandElementRef || $[5] !== len || $[6] !== open || $[7] !== popoverElementRef || $[8] !== rawItems || $[9] !== space) {
493
+ const t2 = rawItems.slice(0, beforeLength - 1);
494
+ let t3;
495
+ $[11] !== afterLength || $[12] !== beforeLength || $[13] !== len || $[14] !== rawItems ? (t3 = rawItems.slice(beforeLength - 1, len - afterLength), $[11] = afterLength, $[12] = beforeLength, $[13] = len, $[14] = rawItems, $[15] = t3) : t3 = $[15];
496
+ let t4;
497
+ $[16] !== space || $[17] !== t3 ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ol", overflow: "auto", padding: space, space, children: t3 }), $[16] = space, $[17] = t3, $[18] = t4) : t4 = $[18];
498
+ const t5 = open ? collapse : expand;
499
+ let t6;
500
+ $[19] !== expandElementRef || $[20] !== open || $[21] !== t5 ? (t6 = /* @__PURE__ */ jsxRuntime.jsx(ExpandButton, { fontSize: 1, mode: "bleed", onClick: t5, padding: 1, ref: expandElementRef, selected: open, text: "\u2026" }), $[19] = expandElementRef, $[20] = open, $[21] = t5, $[22] = t6) : t6 = $[22];
501
+ let t7;
502
+ $[23] !== open || $[24] !== popoverElementRef || $[25] !== t4 || $[26] !== t6 ? (t7 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Popover, { constrainSize: !0, content: t4, open, placement: "top", portal: !0, ref: popoverElementRef, children: t6 }, "button"), $[23] = open, $[24] = popoverElementRef, $[25] = t4, $[26] = t6, $[27] = t7) : t7 = $[27], t1 = [...t2, t7, ...rawItems.slice(len - afterLength)], $[0] = afterLength, $[1] = beforeLength, $[2] = collapse, $[3] = expand, $[4] = expandElementRef, $[5] = len, $[6] = open, $[7] = popoverElementRef, $[8] = rawItems, $[9] = space, $[10] = t1;
503
+ } else
504
+ t1 = $[10];
505
+ return t1;
506
+ }
507
+ return rawItems;
508
+ }
591
509
  function dialogStyle({
592
510
  theme: theme$1
593
511
  }) {
@@ -677,7 +595,7 @@ const StyledDialog = /* @__PURE__ */ styledComponents.styled(_visualEditing.Laye
677
595
  displayName: "DialogFooter",
678
596
  componentId: "sc-4n4xb3-6"
679
597
  })`position:relative;z-index:3;`, DialogCard = react.forwardRef(function(props, forwardedRef) {
680
- const $ = reactCompilerRuntime.c(38), {
598
+ const $ = reactCompilerRuntime.c(44), {
681
599
  __unstable_autoFocus: autoFocus,
682
600
  __unstable_hideCloseButton: hideCloseButton,
683
601
  children,
@@ -692,54 +610,63 @@ const StyledDialog = /* @__PURE__ */ styledComponents.styled(_visualEditing.Laye
692
610
  scheme,
693
611
  shadow: shadowProp,
694
612
  width: widthProp
695
- } = props, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element, radius = _visualEditing.useArrayProp(radiusProp), shadow = _visualEditing.useArrayProp(shadowProp), width = _visualEditing.useArrayProp(widthProp), ref = react.useRef(null), contentRef = react.useRef(null), layer = _visualEditing.useLayer(), {
696
- isTopLayer
697
- } = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton;
613
+ } = props, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element;
698
614
  let t0;
699
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[0] = t0) : t0 = $[0], react.useImperativeHandle(forwardedRef, t0);
615
+ $[0] !== radiusProp ? (t0 = _visualEditing._getArrayProp(radiusProp), $[0] = radiusProp, $[1] = t0) : t0 = $[1];
616
+ const radius = t0;
700
617
  let t1;
701
- $[1] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => contentRef.current, $[1] = t1) : t1 = $[1], react.useImperativeHandle(forwardedContentRef, t1);
702
- let t2, t3;
703
- $[2] !== autoFocus ? (t2 = () => {
704
- autoFocus && ref.current && focusFirstDescendant(ref.current);
705
- }, t3 = [autoFocus, ref], $[2] = autoFocus, $[3] = t2, $[4] = t3) : (t2 = $[3], t3 = $[4]), react.useEffect(t2, t3);
618
+ $[2] !== shadowProp ? (t1 = _visualEditing._getArrayProp(shadowProp), $[2] = shadowProp, $[3] = t1) : t1 = $[3];
619
+ const shadow = t1;
620
+ let t2;
621
+ $[4] !== widthProp ? (t2 = _visualEditing._getArrayProp(widthProp), $[4] = widthProp, $[5] = t2) : t2 = $[5];
622
+ const width = t2, ref = react.useRef(null), contentRef = react.useRef(null), layer = _visualEditing.useLayer(), {
623
+ isTopLayer
624
+ } = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton;
625
+ let t3;
626
+ $[6] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => ref.current, $[6] = t3) : t3 = $[6], react.useImperativeHandle(forwardedRef, t3);
706
627
  let t4;
707
- $[5] !== boundaryElement || $[6] !== isTopLayer || $[7] !== onClose || $[8] !== portalElement ? (t4 = (event) => {
628
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => contentRef.current, $[7] = t4) : t4 = $[7], react.useImperativeHandle(forwardedContentRef, t4);
629
+ let t5, t6;
630
+ $[8] !== autoFocus ? (t5 = () => {
631
+ autoFocus && ref.current && focusFirstDescendant(ref.current);
632
+ }, t6 = [autoFocus, ref], $[8] = autoFocus, $[9] = t5, $[10] = t6) : (t5 = $[9], t6 = $[10]), react.useEffect(t5, t6);
633
+ let t7;
634
+ $[11] !== boundaryElement || $[12] !== isTopLayer || $[13] !== onClose || $[14] !== portalElement ? (t7 = (event) => {
708
635
  if (!isTopLayer || !onClose)
709
636
  return;
710
637
  const target = document.activeElement;
711
638
  target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
712
- }, $[5] = boundaryElement, $[6] = isTopLayer, $[7] = onClose, $[8] = portalElement, $[9] = t4) : t4 = $[9], _visualEditing.useGlobalKeyDown(t4);
713
- let t5;
714
- $[10] !== boundaryElement || $[11] !== isTopLayer || $[12] !== onClickOutside || $[13] !== portalElement ? (t5 = isTopLayer && onClickOutside && ((event_0) => {
639
+ }, $[11] = boundaryElement, $[12] = isTopLayer, $[13] = onClose, $[14] = portalElement, $[15] = t7) : t7 = $[15], _visualEditing.useGlobalKeyDown(t7);
640
+ let t8;
641
+ $[16] !== boundaryElement || $[17] !== isTopLayer || $[18] !== onClickOutside || $[19] !== portalElement ? (t8 = isTopLayer && onClickOutside && ((event_0) => {
715
642
  const target_0 = event_0.target;
716
643
  target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
717
- }), $[10] = boundaryElement, $[11] = isTopLayer, $[12] = onClickOutside, $[13] = portalElement, $[14] = t5) : t5 = $[14];
718
- let t6;
719
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => [ref.current], $[15] = t6) : t6 = $[15], _visualEditing.useClickOutsideEvent(t5, t6);
720
- let t7;
721
- $[16] !== header || $[17] !== labelId || $[18] !== onClose || $[19] !== showCloseButton || $[20] !== showHeader ? (t7 = showHeader && /* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { align: "flex-start", padding: 3, children: [
722
- /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
723
- 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 }) })
724
- ] }) }), $[16] = header, $[17] = labelId, $[18] = onClose, $[19] = showCloseButton, $[20] = showHeader, $[21] = t7) : t7 = $[21];
725
- let t8;
726
- $[22] !== children ? (t8 = /* @__PURE__ */ jsxRuntime.jsx(DialogContent, { flex: 1, ref: contentRef, tabIndex: -1, children }), $[22] = children, $[23] = t8) : t8 = $[23];
644
+ }), $[16] = boundaryElement, $[17] = isTopLayer, $[18] = onClickOutside, $[19] = portalElement, $[20] = t8) : t8 = $[20];
727
645
  let t9;
728
- $[24] !== footer ? (t9 = footer && /* @__PURE__ */ jsxRuntime.jsx(DialogFooter, { children: footer }), $[24] = footer, $[25] = t9) : t9 = $[25];
646
+ $[21] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => [ref.current], $[21] = t9) : t9 = $[21], _visualEditing.useClickOutsideEvent(t8, t9);
729
647
  let t10;
730
- $[26] !== t7 || $[27] !== t8 || $[28] !== t9 ? (t10 = /* @__PURE__ */ jsxRuntime.jsxs(DialogLayout, { direction: "column", children: [
731
- t7,
732
- t8,
733
- t9
734
- ] }), $[26] = t7, $[27] = t8, $[28] = t9, $[29] = t10) : t10 = $[29];
648
+ $[22] !== header || $[23] !== labelId || $[24] !== onClose || $[25] !== showCloseButton || $[26] !== showHeader ? (t10 = showHeader && /* @__PURE__ */ jsxRuntime.jsx(DialogHeader, { children: /* @__PURE__ */ jsxRuntime.jsxs(_visualEditing.Flex, { align: "flex-start", padding: 3, children: [
649
+ /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
650
+ 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 }) })
651
+ ] }) }), $[22] = header, $[23] = labelId, $[24] = onClose, $[25] = showCloseButton, $[26] = showHeader, $[27] = t10) : t10 = $[27];
735
652
  let t11;
736
- $[30] !== radius || $[31] !== scheme || $[32] !== shadow || $[33] !== t10 ? (t11 = /* @__PURE__ */ jsxRuntime.jsx(DialogCardRoot, { radius, ref, scheme, shadow, children: t10 }), $[30] = radius, $[31] = scheme, $[32] = shadow, $[33] = t10, $[34] = t11) : t11 = $[34];
653
+ $[28] !== children ? (t11 = /* @__PURE__ */ jsxRuntime.jsx(DialogContent, { flex: 1, ref: contentRef, tabIndex: -1, children }), $[28] = children, $[29] = t11) : t11 = $[29];
737
654
  let t12;
738
- return $[35] !== t11 || $[36] !== width ? (t12 = /* @__PURE__ */ jsxRuntime.jsx(DialogContainer, { "data-ui": "DialogCard", width, children: t11 }), $[35] = t11, $[36] = width, $[37] = t12) : t12 = $[37], t12;
655
+ $[30] !== footer ? (t12 = footer && /* @__PURE__ */ jsxRuntime.jsx(DialogFooter, { children: footer }), $[30] = footer, $[31] = t12) : t12 = $[31];
656
+ let t13;
657
+ $[32] !== t10 || $[33] !== t11 || $[34] !== t12 ? (t13 = /* @__PURE__ */ jsxRuntime.jsxs(DialogLayout, { direction: "column", children: [
658
+ t10,
659
+ t11,
660
+ t12
661
+ ] }), $[32] = t10, $[33] = t11, $[34] = t12, $[35] = t13) : t13 = $[35];
662
+ let t14;
663
+ $[36] !== radius || $[37] !== scheme || $[38] !== shadow || $[39] !== t13 ? (t14 = /* @__PURE__ */ jsxRuntime.jsx(DialogCardRoot, { radius, ref, scheme, shadow, children: t13 }), $[36] = radius, $[37] = scheme, $[38] = shadow, $[39] = t13, $[40] = t14) : t14 = $[40];
664
+ let t15;
665
+ return $[41] !== t14 || $[42] !== width ? (t15 = /* @__PURE__ */ jsxRuntime.jsx(DialogContainer, { "data-ui": "DialogCard", width, children: t14 }), $[41] = t14, $[42] = width, $[43] = t15) : t15 = $[43], t15;
739
666
  });
740
667
  DialogCard.displayName = "ForwardRef(DialogCard)";
741
668
  const Dialog = react.forwardRef(function(props, ref) {
742
- const $ = reactCompilerRuntime.c(60), dialog = useDialog(), {
669
+ const $ = reactCompilerRuntime.c(70), dialog = useDialog(), {
743
670
  layer
744
671
  } = _visualEditing.useTheme_v2();
745
672
  let _positionProp, _zOffsetProp, children, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5, t6;
@@ -766,9 +693,24 @@ const Dialog = react.forwardRef(function(props, ref) {
766
693
  animate: t6,
767
694
  ...restProps
768
695
  } = props, $[0] = props, $[1] = _positionProp, $[2] = _zOffsetProp, $[3] = children, $[4] = contentRef, $[5] = footer, $[6] = header, $[7] = id, $[8] = onActivate, $[9] = onClickOutside, $[10] = onClose, $[11] = onFocus, $[12] = portalProp, $[13] = restProps, $[14] = scheme, $[15] = t0, $[16] = t1, $[17] = t2, $[18] = t3, $[19] = t4, $[20] = t5, $[21] = t6) : (_positionProp = $[1], _zOffsetProp = $[2], children = $[3], contentRef = $[4], footer = $[5], header = $[6], id = $[7], onActivate = $[8], onClickOutside = $[9], onClose = $[10], onFocus = $[11], portalProp = $[12], restProps = $[13], scheme = $[14], t0 = $[15], t1 = $[16], t2 = $[17], t3 = $[18], t4 = $[19], t5 = $[20], t6 = $[21]);
769
- const autoFocus = t0 === void 0 ? !0 : t0, hideCloseButton = t1 === void 0 ? !1 : t1, cardRadiusProp = t2 === void 0 ? 4 : t2, cardShadow = t3 === void 0 ? 3 : t3, paddingProp = t4 === void 0 ? 3 : t4, widthProp = t5 === void 0 ? 0 : t5, _animate = t6 === void 0 ? !1 : t6, positionProp = _positionProp ?? (dialog.position || "fixed"), zOffsetProp = _zOffsetProp ?? (dialog.zOffset || layer.dialog.zOffset), animate = _visualEditing.usePrefersReducedMotion() ? !1 : _animate, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element, cardRadius = _visualEditing.useArrayProp(cardRadiusProp), padding = _visualEditing.useArrayProp(paddingProp), position = _visualEditing.useArrayProp(positionProp), width = _visualEditing.useArrayProp(widthProp), zOffset = _visualEditing.useArrayProp(zOffsetProp), preDivRef = react.useRef(null), postDivRef = react.useRef(null), cardRef = react.useRef(null), focusedElementRef = react.useRef(null);
696
+ const autoFocus = t0 === void 0 ? !0 : t0, hideCloseButton = t1 === void 0 ? !1 : t1, cardRadiusProp = t2 === void 0 ? 4 : t2, cardShadow = t3 === void 0 ? 3 : t3, paddingProp = t4 === void 0 ? 3 : t4, widthProp = t5 === void 0 ? 0 : t5, _animate = t6 === void 0 ? !1 : t6, positionProp = _positionProp ?? (dialog.position || "fixed"), zOffsetProp = _zOffsetProp ?? (dialog.zOffset || layer.dialog.zOffset), animate = _visualEditing.usePrefersReducedMotion() ? !1 : _animate, portal = _visualEditing.usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = _visualEditing.useBoundaryElement().element;
770
697
  let t7;
771
- $[22] !== onFocus ? (t7 = (event) => {
698
+ $[22] !== cardRadiusProp ? (t7 = _visualEditing._getArrayProp(cardRadiusProp), $[22] = cardRadiusProp, $[23] = t7) : t7 = $[23];
699
+ const cardRadius = t7;
700
+ let t8;
701
+ $[24] !== paddingProp ? (t8 = _visualEditing._getArrayProp(paddingProp), $[24] = paddingProp, $[25] = t8) : t8 = $[25];
702
+ const padding = t8;
703
+ let t9;
704
+ $[26] !== positionProp ? (t9 = _visualEditing._getArrayProp(positionProp), $[26] = positionProp, $[27] = t9) : t9 = $[27];
705
+ const position = t9;
706
+ let t10;
707
+ $[28] !== widthProp ? (t10 = _visualEditing._getArrayProp(widthProp), $[28] = widthProp, $[29] = t10) : t10 = $[29];
708
+ const width = t10;
709
+ let t11;
710
+ $[30] !== zOffsetProp ? (t11 = _visualEditing._getArrayProp(zOffsetProp), $[30] = zOffsetProp, $[31] = t11) : t11 = $[31];
711
+ const zOffset = t11, preDivRef = react.useRef(null), postDivRef = react.useRef(null), cardRef = react.useRef(null), focusedElementRef = react.useRef(null);
712
+ let t12;
713
+ $[32] !== onFocus ? (t12 = (event) => {
772
714
  onFocus?.(event);
773
715
  const target = event.target, cardElement = cardRef.current;
774
716
  if (cardElement && target === preDivRef.current) {
@@ -780,10 +722,10 @@ const Dialog = react.forwardRef(function(props, ref) {
780
722
  return;
781
723
  }
782
724
  _visualEditing.isHTMLElement(event.target) && (focusedElementRef.current = event.target);
783
- }, $[22] = onFocus, $[23] = t7) : t7 = $[23];
784
- const handleFocus = t7, labelId = `${id}_label`, rootClickTimeoutRef = react.useRef(void 0);
785
- let t8;
786
- $[24] !== boundaryElement || $[25] !== portalElement ? (t8 = () => {
725
+ }, $[32] = onFocus, $[33] = t12) : t12 = $[33];
726
+ const handleFocus = t12, labelId = `${id}_label`, rootClickTimeoutRef = react.useRef(void 0);
727
+ let t13;
728
+ $[34] !== boundaryElement || $[35] !== portalElement ? (t13 = () => {
787
729
  rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
788
730
  const activeElement = document.activeElement;
789
731
  if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
@@ -796,22 +738,22 @@ const Dialog = react.forwardRef(function(props, ref) {
796
738
  target_0.focus();
797
739
  }
798
740
  }, 0);
799
- }, $[24] = boundaryElement, $[25] = portalElement, $[26] = t8) : t8 = $[26];
800
- const handleRootClick = t8;
801
- let t9;
802
- $[27] === Symbol.for("react.memo_cache_sentinel") ? (t9 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: preDivRef, tabIndex: 0 }), $[27] = t9) : t9 = $[27];
803
- let t10;
804
- $[28] !== autoFocus || $[29] !== cardRadius || $[30] !== cardShadow || $[31] !== children || $[32] !== contentRef || $[33] !== footer || $[34] !== header || $[35] !== hideCloseButton || $[36] !== id || $[37] !== onClickOutside || $[38] !== onClose || $[39] !== portalProp || $[40] !== scheme || $[41] !== width ? (t10 = /* @__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, width, children }), $[28] = autoFocus, $[29] = cardRadius, $[30] = cardShadow, $[31] = children, $[32] = contentRef, $[33] = footer, $[34] = header, $[35] = hideCloseButton, $[36] = id, $[37] = onClickOutside, $[38] = onClose, $[39] = portalProp, $[40] = scheme, $[41] = width, $[42] = t10) : t10 = $[42];
805
- let t11;
806
- $[43] === Symbol.for("react.memo_cache_sentinel") ? (t11 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: postDivRef, tabIndex: 0 }), $[43] = t11) : t11 = $[43];
807
- let t12;
808
- $[44] !== animate || $[45] !== handleFocus || $[46] !== handleRootClick || $[47] !== id || $[48] !== labelId || $[49] !== onActivate || $[50] !== padding || $[51] !== position || $[52] !== ref || $[53] !== restProps || $[54] !== t10 || $[55] !== zOffset ? (t12 = /* @__PURE__ */ jsxRuntime.jsxs(StyledDialog, { ...restProps, $animate: animate, $padding: padding, $position: position, "aria-labelledby": labelId, "aria-modal": !0, "data-ui": "Dialog", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, ref, role: "dialog", zOffset, children: [
809
- t9,
810
- t10,
811
- t11
812
- ] }), $[44] = animate, $[45] = handleFocus, $[46] = handleRootClick, $[47] = id, $[48] = labelId, $[49] = onActivate, $[50] = padding, $[51] = position, $[52] = ref, $[53] = restProps, $[54] = t10, $[55] = zOffset, $[56] = t12) : t12 = $[56];
813
- let t13;
814
- return $[57] !== portalProp || $[58] !== t12 ? (t13 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Portal, { __unstable_name: portalProp, children: t12 }), $[57] = portalProp, $[58] = t12, $[59] = t13) : t13 = $[59], t13;
741
+ }, $[34] = boundaryElement, $[35] = portalElement, $[36] = t13) : t13 = $[36];
742
+ const handleRootClick = t13;
743
+ let t14;
744
+ $[37] === Symbol.for("react.memo_cache_sentinel") ? (t14 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: preDivRef, tabIndex: 0 }), $[37] = t14) : t14 = $[37];
745
+ let t15;
746
+ $[38] !== autoFocus || $[39] !== cardRadius || $[40] !== cardShadow || $[41] !== children || $[42] !== contentRef || $[43] !== footer || $[44] !== header || $[45] !== hideCloseButton || $[46] !== id || $[47] !== onClickOutside || $[48] !== onClose || $[49] !== portalProp || $[50] !== scheme || $[51] !== width ? (t15 = /* @__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, width, children }), $[38] = autoFocus, $[39] = cardRadius, $[40] = cardShadow, $[41] = children, $[42] = contentRef, $[43] = footer, $[44] = header, $[45] = hideCloseButton, $[46] = id, $[47] = onClickOutside, $[48] = onClose, $[49] = portalProp, $[50] = scheme, $[51] = width, $[52] = t15) : t15 = $[52];
747
+ let t16;
748
+ $[53] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsxRuntime.jsx("div", { ref: postDivRef, tabIndex: 0 }), $[53] = t16) : t16 = $[53];
749
+ let t17;
750
+ $[54] !== animate || $[55] !== handleFocus || $[56] !== handleRootClick || $[57] !== id || $[58] !== labelId || $[59] !== onActivate || $[60] !== padding || $[61] !== position || $[62] !== ref || $[63] !== restProps || $[64] !== t15 || $[65] !== zOffset ? (t17 = /* @__PURE__ */ jsxRuntime.jsxs(StyledDialog, { ...restProps, $animate: animate, $padding: padding, $position: position, "aria-labelledby": labelId, "aria-modal": !0, "data-ui": "Dialog", id, onActivate, onClick: handleRootClick, onFocus: handleFocus, ref, role: "dialog", zOffset, children: [
751
+ t14,
752
+ t15,
753
+ t16
754
+ ] }), $[54] = animate, $[55] = handleFocus, $[56] = handleRootClick, $[57] = id, $[58] = labelId, $[59] = onActivate, $[60] = padding, $[61] = position, $[62] = ref, $[63] = restProps, $[64] = t15, $[65] = zOffset, $[66] = t17) : t17 = $[66];
755
+ let t18;
756
+ return $[67] !== portalProp || $[68] !== t17 ? (t18 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Portal, { __unstable_name: portalProp, children: t17 }), $[67] = portalProp, $[68] = t17, $[69] = t18) : t18 = $[69], t18;
815
757
  });
816
758
  Dialog.displayName = "ForwardRef(Dialog)";
817
759
  function DialogProvider(props) {
@@ -1013,7 +955,7 @@ const keyframe = styledComponents.keyframes`
1013
955
  displayName: "StyledSkeleton",
1014
956
  componentId: "sc-ebtpni-0"
1015
957
  })(_visualEditing.responsiveRadiusStyle, skeletonStyle), Skeleton = react.forwardRef(function(props, ref) {
1016
- const $ = reactCompilerRuntime.c(14);
958
+ const $ = reactCompilerRuntime.c(16);
1017
959
  let delay, radius, restProps, t0;
1018
960
  $[0] !== props ? ({
1019
961
  animated: t0,
@@ -1033,9 +975,10 @@ const keyframe = styledComponents.keyframes`
1033
975
  clearTimeout(timeout);
1034
976
  };
1035
977
  }, t2 = [delay], $[5] = delay, $[6] = t1, $[7] = t2) : (t1 = $[6], t2 = $[7]), react.useEffect(t1, t2);
1036
- const t3 = _visualEditing.useArrayProp(radius);
978
+ let t3;
979
+ $[8] !== radius ? (t3 = _visualEditing._getArrayProp(radius), $[8] = radius, $[9] = t3) : t3 = $[9];
1037
980
  let t4;
1038
- return $[8] !== animated || $[9] !== ref || $[10] !== restProps || $[11] !== t3 || $[12] !== visible ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton$1, { ...restProps, $animated: animated, $radius: t3, $visible: visible, ref }), $[8] = animated, $[9] = ref, $[10] = restProps, $[11] = t3, $[12] = visible, $[13] = t4) : t4 = $[13], t4;
981
+ return $[10] !== animated || $[11] !== ref || $[12] !== restProps || $[13] !== t3 || $[14] !== visible ? (t4 = /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton$1, { ...restProps, $animated: animated, $radius: t3, $visible: visible, ref }), $[10] = animated, $[11] = ref, $[12] = restProps, $[13] = t3, $[14] = visible, $[15] = t4) : t4 = $[15], t4;
1039
982
  });
1040
983
  Skeleton.displayName = "ForwardRef(Skeleton)";
1041
984
  const StyledSkeleton = /* @__PURE__ */ styledComponents.styled(Skeleton).withConfig({
@@ -1056,51 +999,63 @@ const StyledSkeleton = /* @__PURE__ */ styledComponents.styled(Skeleton).withCon
1056
999
  };
1057
1000
  });
1058
1001
  }), TextSkeleton = react.forwardRef(function(props, ref) {
1059
- const $ = reactCompilerRuntime.c(7);
1002
+ const $ = reactCompilerRuntime.c(9);
1060
1003
  let restProps, t0;
1061
1004
  $[0] !== props ? ({
1062
1005
  size: t0,
1063
1006
  ...restProps
1064
1007
  } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
1065
- const $size = _visualEditing.useArrayProp(t0 === void 0 ? 2 : t0);
1008
+ const size = t0 === void 0 ? 2 : t0;
1066
1009
  let t1;
1067
- return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "text" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
1010
+ $[3] !== size ? (t1 = _visualEditing._getArrayProp(size), $[3] = size, $[4] = t1) : t1 = $[4];
1011
+ const $size = t1;
1012
+ let t2;
1013
+ return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "text" }), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
1068
1014
  });
1069
1015
  TextSkeleton.displayName = "ForwardRef(TextSkeleton)";
1070
1016
  const LabelSkeleton = react.forwardRef(function(props, ref) {
1071
- const $ = reactCompilerRuntime.c(7);
1017
+ const $ = reactCompilerRuntime.c(9);
1072
1018
  let restProps, t0;
1073
1019
  $[0] !== props ? ({
1074
1020
  size: t0,
1075
1021
  ...restProps
1076
1022
  } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
1077
- const $size = _visualEditing.useArrayProp(t0 === void 0 ? 2 : t0);
1023
+ const size = t0 === void 0 ? 2 : t0;
1078
1024
  let t1;
1079
- return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "label" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
1025
+ $[3] !== size ? (t1 = _visualEditing._getArrayProp(size), $[3] = size, $[4] = t1) : t1 = $[4];
1026
+ const $size = t1;
1027
+ let t2;
1028
+ return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "label" }), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
1080
1029
  });
1081
1030
  LabelSkeleton.displayName = "ForwardRef(LabelSkeleton)";
1082
1031
  const HeadingSkeleton = react.forwardRef(function(props, ref) {
1083
- const $ = reactCompilerRuntime.c(7);
1032
+ const $ = reactCompilerRuntime.c(9);
1084
1033
  let restProps, t0;
1085
1034
  $[0] !== props ? ({
1086
1035
  size: t0,
1087
1036
  ...restProps
1088
1037
  } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
1089
- const $size = _visualEditing.useArrayProp(t0 === void 0 ? 2 : t0);
1038
+ const size = t0 === void 0 ? 2 : t0;
1090
1039
  let t1;
1091
- return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "heading" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
1040
+ $[3] !== size ? (t1 = _visualEditing._getArrayProp(size), $[3] = size, $[4] = t1) : t1 = $[4];
1041
+ const $size = t1;
1042
+ let t2;
1043
+ return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "heading" }), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
1092
1044
  });
1093
1045
  HeadingSkeleton.displayName = "ForwardRef(HeadingSkeleton)";
1094
1046
  const CodeSkeleton = react.forwardRef(function(props, ref) {
1095
- const $ = reactCompilerRuntime.c(7);
1047
+ const $ = reactCompilerRuntime.c(9);
1096
1048
  let restProps, t0;
1097
1049
  $[0] !== props ? ({
1098
1050
  size: t0,
1099
1051
  ...restProps
1100
1052
  } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
1101
- const $size = _visualEditing.useArrayProp(t0 === void 0 ? 2 : t0);
1053
+ const size = t0 === void 0 ? 2 : t0;
1102
1054
  let t1;
1103
- return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "code" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
1055
+ $[3] !== size ? (t1 = _visualEditing._getArrayProp(size), $[3] = size, $[4] = t1) : t1 = $[4];
1056
+ const $size = t1;
1057
+ let t2;
1058
+ return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "code" }), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
1104
1059
  });
1105
1060
  CodeSkeleton.displayName = "ForwardRef(CodeSkeleton)";
1106
1061
  const TabPanel = react.forwardRef(function(props, ref) {
@@ -1413,7 +1368,7 @@ function _focusItemElement(el) {
1413
1368
  firstChild && firstChild instanceof HTMLElement && firstChild.focus();
1414
1369
  }
1415
1370
  }
1416
- const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/tree", null), Tree = react.memo(react.forwardRef(function(props, forwardedRef) {
1371
+ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context/tree", null), Tree = react.forwardRef(function(props, forwardedRef) {
1417
1372
  const $ = reactCompilerRuntime.c(37);
1418
1373
  let children, onFocus, restProps, t0;
1419
1374
  $[0] !== props ? ({
@@ -1565,8 +1520,8 @@ const TreeContext = _visualEditing.createGlobalScopedContext("@sanity/ui/context
1565
1520
  $[28] !== children || $[29] !== handleFocus || $[30] !== handleKeyDown || $[31] !== restProps || $[32] !== space ? (t17 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "data-ui": "Tree", ...restProps, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", space, children }), $[28] = children, $[29] = handleFocus, $[30] = handleKeyDown, $[31] = restProps, $[32] = space, $[33] = t17) : t17 = $[33];
1566
1521
  let t18;
1567
1522
  return $[34] !== contextValue || $[35] !== t17 ? (t18 = /* @__PURE__ */ jsxRuntime.jsx(TreeContext.Provider, { value: contextValue, children: t17 }), $[34] = contextValue, $[35] = t17, $[36] = t18) : t18 = $[36], t18;
1568
- }));
1569
- Tree.displayName = "Memo(ForwardRef(Tree))";
1523
+ });
1524
+ Tree.displayName = "ForwardRef(Tree)";
1570
1525
  function treeItemRootStyle() {
1571
1526
  return styledComponents.css`
1572
1527
  &[role='none'] > [role='treeitem'] {
@@ -1665,7 +1620,7 @@ function useTree() {
1665
1620
  throw new Error("Tree: missing context value");
1666
1621
  return tree;
1667
1622
  }
1668
- const TreeGroup = react.memo(function(props) {
1623
+ function TreeGroup(props) {
1669
1624
  const $ = reactCompilerRuntime.c(9);
1670
1625
  let children, restProps, t0;
1671
1626
  $[0] !== props ? ({
@@ -1676,10 +1631,11 @@ const TreeGroup = react.memo(function(props) {
1676
1631
  const expanded = t0 === void 0 ? !1 : t0, tree = useTree(), t1 = !expanded;
1677
1632
  let t2;
1678
1633
  return $[4] !== children || $[5] !== restProps || $[6] !== t1 || $[7] !== tree.space ? (t2 = /* @__PURE__ */ jsxRuntime.jsx(_visualEditing.Stack, { as: "ul", "data-ui": "TreeGroup", ...restProps, hidden: t1, marginTop: tree.space, role: "group", space: tree.space, children }), $[4] = children, $[5] = restProps, $[6] = t1, $[7] = tree.space, $[8] = t2) : t2 = $[8], t2;
1679
- }), StyledTreeItem = react.memo(styledComponents.styled.li.withConfig({
1634
+ }
1635
+ const StyledTreeItem = /* @__PURE__ */ styledComponents.styled.li.withConfig({
1680
1636
  displayName: "StyledTreeItem",
1681
1637
  componentId: "sc-iiskig-0"
1682
- })(treeItemRootStyle, treeItemRootColorStyle)), TreeItemBox = /* @__PURE__ */ styledComponents.styled(_visualEditing.Box).attrs({
1638
+ })(treeItemRootStyle, treeItemRootColorStyle), TreeItemBox = /* @__PURE__ */ styledComponents.styled(_visualEditing.Box).attrs({
1683
1639
  forwardedAs: "a"
1684
1640
  }).withConfig({
1685
1641
  displayName: "TreeItemBox",
@@ -1687,7 +1643,8 @@ const TreeGroup = react.memo(function(props) {
1687
1643
  })(treeItemBoxStyle), ToggleArrowText = styledComponents.styled(_visualEditing.Text).withConfig({
1688
1644
  displayName: "ToggleArrowText",
1689
1645
  componentId: "sc-iiskig-2"
1690
- })`& > svg{transition:transform 100ms;}`, TreeItem = react.memo(function(props) {
1646
+ })`& > svg{transition:transform 100ms;}`;
1647
+ function TreeItem(props) {
1691
1648
  const $ = reactCompilerRuntime.c(112);
1692
1649
  let IconComponent, children, href, idProp, linkAs, muted, onClick, restProps, t0, t1, t2, t3, t4, text, weight;
1693
1650
  $[0] !== props ? ({
@@ -1797,8 +1754,8 @@ const TreeGroup = react.memo(function(props) {
1797
1754
  t22,
1798
1755
  t24
1799
1756
  ] }), $[101] = expanded, $[102] = handleClick, $[103] = handleKeyDown, $[104] = id, $[105] = itemKey, $[106] = restProps, $[107] = t21, $[108] = t22, $[109] = t24, $[110] = tabIndex, $[111] = t25) : t25 = $[111], t25;
1800
- });
1801
- TreeItem.displayName = "Memo(TreeItem)";
1757
+ }
1758
+ TreeItem.displayName = "TreeItem";
1802
1759
  exports.Arrow = _visualEditing.Arrow;
1803
1760
  exports.Avatar = _visualEditing.Avatar;
1804
1761
  exports.AvatarCounter = _visualEditing.AvatarCounter;
@@ -1877,7 +1834,6 @@ exports.rgbToHsl = _visualEditing.rgbToHsl;
1877
1834
  exports.rgba = _visualEditing.rgba;
1878
1835
  exports.screen = _visualEditing.screen;
1879
1836
  exports.studioTheme = _visualEditing.studioTheme;
1880
- exports.useArrayProp = _visualEditing.useArrayProp;
1881
1837
  exports.useBoundaryElement = _visualEditing.useBoundaryElement;
1882
1838
  exports.useClickOutsideEvent = _visualEditing.useClickOutsideEvent;
1883
1839
  exports.useCustomValidity = _visualEditing.useCustomValidity;
@@ -1917,6 +1873,7 @@ exports.attemptFocus = attemptFocus;
1917
1873
  exports.focusFirstDescendant = focusFirstDescendant;
1918
1874
  exports.focusLastDescendant = focusLastDescendant;
1919
1875
  exports.isFocusable = isFocusable;
1876
+ exports.useArrayProp = useArrayProp;
1920
1877
  exports.useClickOutside = useClickOutside;
1921
1878
  exports.useDialog = useDialog;
1922
1879
  exports.useElementRect = useElementRect;