@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.mjs CHANGED
@@ -1,10 +1,10 @@
1
- import { isHTMLElement, isHTMLAnchorElement, isHTMLInputElement, isHTMLButtonElement, isHTMLSelectElement, isHTMLTextAreaElement, EMPTY_ARRAY, useElementSize, Code, Box, _isEnterToClickElement, useArrayProp, EMPTY_RECORD, Card, Text, Button, Stack, Popover, TextInput, useClickOutsideEvent, _responsive, createGlobalScopedContext, Container, Flex, usePortal, useBoundaryElement, useLayer, useGlobalKeyDown, useTheme_v2, usePrefersReducedMotion, Portal, containsOrEqualsElement, Layer, responsivePaddingStyle, responsiveRadiusStyle, Grid, LayerProvider, isRecord, _cardColorStyle, rem } from "./_chunks-es/_visual-editing.mjs";
2
- import { Arrow, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, Checkbox, ConditionalWrapper, ElementQuery, Heading, Hotkeys, Inline, KBD, Label, Menu, MenuDivider, MenuGroup, MenuItem, PortalProvider, Radio, Select, Spinner, SrOnly, Switch, Tab, TabList, TextArea, ThemeColorProvider, ThemeProvider, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupProvider, VirtualList, _ResizeObserver, _elementSizeObserver, _fillCSSObject, _getArrayProp, _getResponsiveSpace, _isScrollable, createColorTheme, hexToRgb, hslToRgb, multiply, parseColor, responsiveCodeFontStyle, responsiveHeadingFont, responsiveLabelFont, responsiveTextAlignStyle, responsiveTextFont, rgbToHex, rgbToHsl, rgba, screen, studioTheme, useCustomValidity, useMatchMedia, useMediaIndex, usePrefersDark, useRootTheme, useTheme, useTooltipDelayGroup } from "./_chunks-es/_visual-editing.mjs";
1
+ import { isHTMLElement, isHTMLAnchorElement, isHTMLInputElement, isHTMLButtonElement, isHTMLSelectElement, isHTMLTextAreaElement, _getArrayProp, EMPTY_ARRAY, useElementSize, Code, Box, _isEnterToClickElement, Card, Text, EMPTY_RECORD, Button, Stack, Popover, TextInput, useClickOutsideEvent, _responsive, createGlobalScopedContext, Container, Flex, usePortal, useBoundaryElement, useLayer, useGlobalKeyDown, useTheme_v2, usePrefersReducedMotion, Portal, containsOrEqualsElement, Layer, responsivePaddingStyle, responsiveRadiusStyle, Grid, LayerProvider, isRecord, _cardColorStyle, rem } from "./_chunks-es/_visual-editing.mjs";
2
+ import { Arrow, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvider, Checkbox, ConditionalWrapper, ElementQuery, Heading, Hotkeys, Inline, KBD, Label, Menu, MenuDivider, MenuGroup, MenuItem, PortalProvider, Radio, Select, Spinner, SrOnly, Switch, Tab, TabList, TextArea, ThemeColorProvider, ThemeProvider, Tooltip, TooltipDelayGroupContext, TooltipDelayGroupProvider, VirtualList, _ResizeObserver, _elementSizeObserver, _fillCSSObject, _getResponsiveSpace, _isScrollable, createColorTheme, hexToRgb, hslToRgb, multiply, parseColor, responsiveCodeFontStyle, responsiveHeadingFont, responsiveLabelFont, responsiveTextAlignStyle, responsiveTextFont, rgbToHex, rgbToHsl, rgba, screen, studioTheme, useCustomValidity, useMatchMedia, useMediaIndex, usePrefersDark, useRootTheme, useTheme, useTooltipDelayGroup } from "./_chunks-es/_visual-editing.mjs";
3
3
  import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
4
- import { c } from "react-compiler-runtime";
5
4
  import { SpinnerIcon, ChevronDownIcon, CloseIcon, ToggleArrowRightIcon } from "@sanity/icons";
6
- import { useState, useRef, useEffect, useImperativeHandle, Component, forwardRef, useReducer, cloneElement, useCallback, useMemo, Children, isValidElement, Fragment, useContext, useSyncExternalStore, startTransition, memo, useId } from "react";
5
+ import { useState, useRef, useEffect, useImperativeHandle, Component, forwardRef, useReducer, useCallback, useMemo, cloneElement, Children, isValidElement, Fragment, useContext, useSyncExternalStore, startTransition, useId } from "react";
7
6
  import { styled, keyframes, css } from "styled-components";
7
+ import { c } from "react-compiler-runtime";
8
8
  import { getTheme_v2 } from "@sanity/ui/theme";
9
9
  import { motion, AnimatePresence } from "framer-motion";
10
10
  function _raf(fn) {
@@ -53,6 +53,11 @@ function focusLastDescendant(element) {
53
53
  }
54
54
  return !1;
55
55
  }
56
+ function useArrayProp(val, defaultVal) {
57
+ const $ = c(3);
58
+ let t0;
59
+ return $[0] !== defaultVal || $[1] !== val ? (t0 = _getArrayProp(val, defaultVal), $[0] = defaultVal, $[1] = val, $[2] = t0) : t0 = $[2], t0;
60
+ }
56
61
  function _getElements(element, elementsArg) {
57
62
  const ret = [element];
58
63
  for (const el of elementsArg)
@@ -215,17 +220,15 @@ function autocompleteReducer(state, msg) {
215
220
  } : state;
216
221
  }
217
222
  const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "Home", "End", "PageUp", "PageDown", "Meta", "Tab", "CapsLock"], AUTOCOMPLETE_POPOVER_PLACEMENT = "bottom-start", AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS = ["bottom-start", "top-start"], DEFAULT_RENDER_VALUE = (value, option) => option ? option.value : value, DEFAULT_FILTER_OPTION = (query, option) => option.value.toLowerCase().indexOf(query.toLowerCase()) > -1, InnerAutocomplete = forwardRef(function(props, forwardedRef) {
218
- const $ = c(179);
219
- 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;
220
- $[0] !== props ? ({
221
- border: t0,
223
+ const {
224
+ border = !0,
222
225
  customValidity,
223
226
  disabled,
224
227
  filterOption: filterOptionProp,
225
- fontSize: t1,
228
+ fontSize = 2,
226
229
  icon,
227
230
  id,
228
- listBox: t2,
231
+ listBox = EMPTY_RECORD,
229
232
  loading,
230
233
  onBlur,
231
234
  onChange,
@@ -235,60 +238,35 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
235
238
  openButton,
236
239
  openOnFocus,
237
240
  options: optionsProp,
238
- padding: t3,
239
- popover: t4,
241
+ padding: paddingProp = 3,
242
+ popover = EMPTY_RECORD,
240
243
  prefix,
241
- radius: t5,
244
+ radius = 2,
242
245
  readOnly,
243
246
  relatedElements,
244
247
  renderOption: renderOptionProp,
245
248
  renderPopover,
246
- renderValue: t6,
249
+ renderValue = DEFAULT_RENDER_VALUE,
247
250
  suffix,
248
251
  value: valueProp,
249
252
  ...restProps
250
- } = 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]);
251
- const border = t0 === void 0 ? !0 : t0, fontSize = t1 === void 0 ? 2 : t1, listBox = t2 === void 0 ? EMPTY_RECORD : t2, paddingProp = t3 === void 0 ? 3 : t3, popover = t4 === void 0 ? EMPTY_RECORD : t4, radius = t5 === void 0 ? 2 : t5, renderValue = t6 === void 0 ? DEFAULT_RENDER_VALUE : t6, t7 = valueProp || null, t8 = valueProp || null;
252
- let t9;
253
- $[30] !== t7 || $[31] !== t8 ? (t9 = {
254
- activeValue: t7,
253
+ } = props, [state, dispatch] = useReducer(autocompleteReducer, {
254
+ activeValue: valueProp || null,
255
255
  focused: !1,
256
256
  listFocused: !1,
257
257
  query: null,
258
- value: t8
259
- }, $[30] = t7, $[31] = t8, $[32] = t9) : t9 = $[32];
260
- const [state, dispatch] = useReducer(autocompleteReducer, t9), {
258
+ value: valueProp || null
259
+ }), {
261
260
  activeValue,
262
261
  focused,
263
262
  listFocused,
264
263
  query,
265
264
  value
266
- } = state;
267
- let t10;
268
- $[33] !== fontSize || $[34] !== paddingProp ? (t10 = (t112) => {
269
- const {
270
- value: value_0
271
- } = t112;
272
- return /* @__PURE__ */ jsx(Card, { "data-as": "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsx(Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 }) });
273
- }, $[33] = fontSize, $[34] = paddingProp, $[35] = t10) : t10 = $[35];
274
- const renderOption = typeof renderOptionProp == "function" ? renderOptionProp : t10, filterOption = typeof filterOptionProp == "function" ? filterOptionProp : DEFAULT_FILTER_OPTION, rootElementRef = useRef(null), resultsPopoverElementRef = useRef(null), inputElementRef = useRef(null), listBoxElementRef = useRef(null), [inputElement, setInputElement] = useState(null), listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1);
275
- let t11, t12;
276
- $[36] !== inputElement ? (t11 = () => inputElement, t12 = [inputElement], $[36] = inputElement, $[37] = t11, $[38] = t12) : (t11 = $[37], t12 = $[38]), useImperativeHandle(inputElementRef, t11, t12);
277
- let t13, t14;
278
- $[39] !== inputElement ? (t13 = () => inputElement, t14 = [inputElement], $[39] = inputElement, $[40] = t13, $[41] = t14) : (t13 = $[40], t14 = $[41]), useImperativeHandle(forwardedRef, t13, t14);
279
- const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = useArrayProp(paddingProp);
280
- let t15;
281
- $[42] !== options || $[43] !== value ? (t15 = value !== null ? options.find((o) => o.value === value) : void 0, $[42] = options, $[43] = value, $[44] = t15) : t15 = $[44];
282
- const currentOption = t15;
283
- let t16;
284
- if ($[45] !== filterOption || $[46] !== options || $[47] !== query) {
285
- let t172;
286
- $[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;
287
- } else
288
- t16 = $[48];
289
- const filteredOptions = t16, filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null;
290
- let t17;
291
- $[52] !== onBlur || $[53] !== onQueryChange || $[54] !== relatedElements ? (t17 = (event) => {
265
+ } = state, defaultRenderOption = useCallback(({
266
+ value: value_0
267
+ }) => /* @__PURE__ */ jsx(Card, { "data-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), [inputElement, setInputElement] = useState(null), listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1);
268
+ useImperativeHandle(inputElementRef, () => inputElement, [inputElement]), useImperativeHandle(forwardedRef, () => inputElement, [inputElement]);
269
+ const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = _getArrayProp(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) => {
292
270
  setTimeout(() => {
293
271
  if (popoverMouseWithinRef.current)
294
272
  return;
@@ -305,30 +283,20 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
305
283
  type: "root/blur"
306
284
  }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
307
285
  }, 0);
308
- }, $[52] = onBlur, $[53] = onQueryChange, $[54] = relatedElements, $[55] = t17) : t17 = $[55];
309
- const handleRootBlur = t17;
310
- let t18;
311
- $[56] === Symbol.for("react.memo_cache_sentinel") ? (t18 = (event_0) => {
286
+ }, [onBlur, onQueryChange, relatedElements]), handleRootFocus = useCallback((event_0) => {
312
287
  const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
313
288
  listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
314
289
  type: "root/setListFocused",
315
290
  listFocused: listFocused_0
316
291
  }));
317
- }, $[56] = t18) : t18 = $[56];
318
- const handleRootFocus = t18;
319
- let t19;
320
- $[57] !== onChange || $[58] !== onQueryChange || $[59] !== onSelect ? (t19 = (v) => {
292
+ }, []), handleOptionSelect = useCallback((v) => {
321
293
  dispatch({
322
294
  type: "value/change",
323
295
  value: v
324
296
  }), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
325
- }, $[57] = onChange, $[58] = onQueryChange, $[59] = onSelect, $[60] = t19) : t19 = $[60];
326
- const handleOptionSelect = t19;
327
- let t20;
328
- $[61] !== activeValue || $[62] !== filteredOptions || $[63] !== filteredOptionsLen || $[64] !== onQueryChange ? (t20 = (event_1) => {
297
+ }, [onChange, onSelect, onQueryChange]), handleRootKeyDown = useCallback((event_1) => {
329
298
  if (event_1.key === "ArrowDown") {
330
- if (event_1.preventDefault(), !filteredOptionsLen)
331
- return;
299
+ if (event_1.preventDefault(), !filteredOptionsLen) return;
332
300
  const activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
333
301
  nextActiveOption && dispatch({
334
302
  type: "root/setActiveValue",
@@ -338,8 +306,7 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
338
306
  return;
339
307
  }
340
308
  if (event_1.key === "ArrowUp") {
341
- if (event_1.preventDefault(), !filteredOptionsLen)
342
- return;
309
+ if (event_1.preventDefault(), !filteredOptionsLen) return;
343
310
  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];
344
311
  nextActiveOption_0 && dispatch({
345
312
  type: "root/setActiveValue",
@@ -359,58 +326,35 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
359
326
  inputElementRef.current?.focus();
360
327
  return;
361
328
  }
362
- }, $[61] = activeValue, $[62] = filteredOptions, $[63] = filteredOptionsLen, $[64] = onQueryChange, $[65] = t20) : t20 = $[65];
363
- const handleRootKeyDown = t20;
364
- let t21;
365
- $[66] !== onQueryChange ? (t21 = (event_2) => {
329
+ }, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange = useCallback((event_2) => {
366
330
  const nextQuery = event_2.currentTarget.value;
367
331
  dispatch({
368
332
  type: "input/change",
369
333
  query: nextQuery
370
334
  }), onQueryChange && onQueryChange(nextQuery);
371
- }, $[66] = onQueryChange, $[67] = t21) : t21 = $[67];
372
- const handleInputChange = t21;
373
- let t22;
374
- $[68] !== currentOption || $[69] !== renderValue || $[70] !== value ? (t22 = () => {
335
+ }, [onQueryChange]), dispatchOpen = useCallback(() => {
375
336
  dispatch({
376
337
  type: "root/open",
377
338
  query: value ? renderValue(value, currentOption) : ""
378
339
  });
379
- }, $[68] = currentOption, $[69] = renderValue, $[70] = value, $[71] = t22) : t22 = $[71];
380
- const dispatchOpen = t22;
381
- let t23;
382
- $[72] !== dispatchOpen || $[73] !== focused || $[74] !== onFocus || $[75] !== openOnFocus ? (t23 = (event_3) => {
340
+ }, [currentOption, renderValue, value]), handleInputFocus = useCallback((event_3) => {
383
341
  focused || (dispatch({
384
342
  type: "input/focus"
385
343
  }), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
386
- }, $[72] = dispatchOpen, $[73] = focused, $[74] = onFocus, $[75] = openOnFocus, $[76] = t23) : t23 = $[76];
387
- const handleInputFocus = t23;
388
- let t24;
389
- $[77] === Symbol.for("react.memo_cache_sentinel") ? (t24 = () => {
344
+ }, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter = useCallback(() => {
390
345
  popoverMouseWithinRef.current = !0;
391
- }, $[77] = t24) : t24 = $[77];
392
- const handlePopoverMouseEnter = t24;
393
- let t25;
394
- $[78] === Symbol.for("react.memo_cache_sentinel") ? (t25 = () => {
346
+ }, []), handlePopoverMouseLeave = useCallback(() => {
395
347
  popoverMouseWithinRef.current = !1;
396
- }, $[78] = t25) : t25 = $[78];
397
- const handlePopoverMouseLeave = t25;
398
- let t26;
399
- $[79] !== onChange || $[80] !== onQueryChange ? (t26 = () => {
348
+ }, []), handleClearButtonClick = useCallback(() => {
400
349
  dispatch({
401
350
  type: "root/clear"
402
351
  }), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
403
- }, $[79] = onChange, $[80] = onQueryChange, $[81] = t26) : t26 = $[81];
404
- const handleClearButtonClick = t26;
405
- let t27;
406
- $[82] === Symbol.for("react.memo_cache_sentinel") ? (t27 = () => {
352
+ }, [onChange, onQueryChange]), handleClearButtonFocus = useCallback(() => {
407
353
  dispatch({
408
354
  type: "input/focus"
409
355
  });
410
- }, $[82] = t27) : t27 = $[82];
411
- const handleClearButtonFocus = t27;
412
- let t28, t29;
413
- $[83] !== valueProp ? (t28 = () => {
356
+ }, []);
357
+ useEffect(() => {
414
358
  if (valueProp !== valuePropRef.current) {
415
359
  valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
416
360
  type: "value/change",
@@ -422,19 +366,14 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
422
366
  type: "value/change",
423
367
  value: valueProp || null
424
368
  }));
425
- }, t29 = [valueProp], $[83] = valueProp, $[84] = t28, $[85] = t29) : (t28 = $[84], t29 = $[85]), useEffect(t28, t29);
426
- let t30, t31;
427
- $[86] !== focused ? (t30 = () => {
369
+ }, [valueProp]), useEffect(() => {
428
370
  !focused && valueRef.current && dispatch({
429
371
  type: "root/setActiveValue",
430
372
  value: valueRef.current
431
373
  });
432
- }, t31 = [focused], $[86] = focused, $[87] = t30, $[88] = t31) : (t30 = $[87], t31 = $[88]), useEffect(t30, t31);
433
- let t32, t33;
434
- $[89] !== activeValue || $[90] !== filteredOptions ? (t32 = () => {
374
+ }, [focused]), useEffect(() => {
435
375
  const listElement = listBoxElementRef.current;
436
- if (!listElement)
437
- return;
376
+ if (!listElement) return;
438
377
  const activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
439
378
  if (activeOption_1) {
440
379
  const activeIndex_1 = filteredOptions.indexOf(activeOption_1), activeItemElement = listElement.childNodes[activeIndex_1];
@@ -444,101 +383,29 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
444
383
  focusFirstDescendant(activeItemElement);
445
384
  }
446
385
  }
447
- }, t33 = [activeValue, filteredOptions], $[89] = activeValue, $[90] = filteredOptions, $[91] = t32, $[92] = t33) : (t32 = $[91], t33 = $[92]), useEffect(t32, t33);
448
- let t34;
449
- bb0: {
450
- if (!loading && !disabled && value) {
451
- let t352;
452
- $[93] === Symbol.for("react.memo_cache_sentinel") ? (t352 = {
386
+ }, [activeValue, filteredOptions]);
387
+ const clearButton = useMemo(() => {
388
+ if (!loading && !disabled && value)
389
+ return {
453
390
  "aria-label": "Clear",
454
391
  onFocus: handleClearButtonFocus
455
- }, $[93] = t352) : t352 = $[93], t34 = t352;
456
- break bb0;
457
- }
458
- t34 = void 0;
459
- }
460
- const clearButton = t34;
461
- let t35;
462
- $[94] !== padding ? (t35 = padding.map(_temp$3), $[94] = padding, $[95] = t35) : t35 = $[95];
463
- const openButtonBoxPadding = t35;
464
- let t36;
465
- $[96] !== padding ? (t36 = padding.map(_temp2$1), $[96] = padding, $[97] = t36) : t36 = $[97];
466
- const openButtonPadding = t36, openButtonProps = typeof openButton == "object" ? openButton : EMPTY_RECORD;
467
- let t37;
468
- $[98] !== dispatchOpen || $[99] !== openButtonProps ? (t37 = (event_4) => {
392
+ };
393
+ }, [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) => {
469
394
  dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
470
- }, $[98] = dispatchOpen, $[99] = openButtonProps, $[100] = t37) : t37 = $[100];
471
- const handleOpenClick = t37;
472
- let t38;
473
- $[101] !== disabled || $[102] !== expanded || $[103] !== fontSize || $[104] !== handleOpenClick || $[105] !== openButton || $[106] !== openButtonBoxPadding || $[107] !== openButtonPadding || $[108] !== openButtonProps || $[109] !== readOnly ? (t38 = !disabled && !readOnly && openButton ? /* @__PURE__ */ jsx(Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsx(Button, { "aria-label": "Open", disabled: expanded, fontSize, icon: 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];
474
- const openButtonNode = t38;
475
- let t39;
476
- bb1: {
477
- if (query === null) {
478
- if (value !== null) {
479
- let t402;
480
- $[111] !== currentOption || $[112] !== renderValue || $[113] !== value ? (t402 = renderValue(value, currentOption), $[111] = currentOption, $[112] = renderValue, $[113] = value, $[114] = t402) : t402 = $[114], t39 = t402;
481
- break bb1;
482
- }
483
- t39 = "";
484
- break bb1;
485
- }
486
- t39 = query;
487
- }
488
- const inputValue = t39;
489
- let t40;
490
- $[115] !== listFocused ? (t40 = (event_5) => {
395
+ }, [openButtonProps, dispatchOpen]), openButtonNode = useMemo(() => !disabled && !readOnly && openButton ? /* @__PURE__ */ jsx(Box, { "aria-hidden": expanded, padding: openButtonBoxPadding, children: /* @__PURE__ */ jsx(Button, { "aria-label": "Open", disabled: expanded, 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]), handleListBoxKeyDown = useCallback((event_5) => {
491
396
  event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
492
- }, $[115] = listFocused, $[116] = t40) : t40 = $[116];
493
- const handleListBoxKeyDown = t40;
494
- let t41;
495
- bb2: {
496
- if (filteredOptions.length === 0) {
497
- t41 = null;
498
- break bb2;
499
- }
500
- let t422;
501
- if ($[117] !== activeValue || $[118] !== currentOption || $[119] !== filteredOptions || $[120] !== handleOptionSelect || $[121] !== id || $[122] !== listFocused || $[123] !== loading || $[124] !== renderOption) {
502
- let t433;
503
- $[126] !== activeValue || $[127] !== currentOption || $[128] !== handleOptionSelect || $[129] !== id || $[130] !== listFocused || $[131] !== loading || $[132] !== renderOption ? (t433 = (option_0) => {
504
- const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
505
- return /* @__PURE__ */ jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: cloneElement(renderOption(option_0), {
506
- disabled: loading,
507
- selected: active,
508
- tabIndex: listFocused && active ? 0 : -1
509
- }) }, option_0.value);
510
- }, $[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;
511
- } else
512
- t422 = $[125];
513
- let t432;
514
- $[134] !== listBoxId || $[135] !== t422 ? (t432 = /* @__PURE__ */ jsx(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];
515
- let t442;
516
- $[137] !== handleListBoxKeyDown || $[138] !== listBox || $[139] !== t432 ? (t442 = /* @__PURE__ */ 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;
517
- }
518
- const content2 = t41;
519
- let t42;
520
- bb3: {
521
- if (renderPopover) {
522
- const t433 = !expanded;
523
- let t442;
524
- $[141] !== content2 || $[142] !== inputElement || $[143] !== renderPopover || $[144] !== t433 ? (t442 = /* @__PURE__ */ 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;
525
- break bb3;
526
- }
527
- if (filteredOptionsLen === 0) {
528
- t42 = null;
529
- break bb3;
530
- }
531
- let t432;
532
- $[146] !== content2 || $[147] !== expanded || $[148] !== inputElement || $[149] !== popover || $[150] !== radius ? (t432 = /* @__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, ref: resultsPopoverElementRef, referenceElement: inputElement, ...popover }), $[146] = content2, $[147] = expanded, $[148] = inputElement, $[149] = popover, $[150] = radius, $[151] = t432) : t432 = $[151], t42 = t432;
533
- }
534
- const results = t42, t43 = loading && AnimatedSpinnerIcon, t44 = suffix || openButtonNode;
535
- let t45;
536
- $[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__ */ jsx(TextInput, { ...restProps, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", border, clearButton, customValidity, disabled, fontSize, icon, iconRight: 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];
537
- let t46;
538
- return $[174] !== handleRootBlur || $[175] !== handleRootKeyDown || $[176] !== results || $[177] !== t45 ? (t46 = /* @__PURE__ */ jsxs(StyledAutocomplete, { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
539
- t45,
397
+ }, [listFocused]), content2 = useMemo(() => filteredOptions.length === 0 ? null : /* @__PURE__ */ jsx(ListBox, { "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) => {
398
+ const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
399
+ return /* @__PURE__ */ jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: cloneElement(renderOption(option_0), {
400
+ disabled: loading,
401
+ selected: active,
402
+ tabIndex: listFocused && active ? 0 : -1
403
+ }) }, option_0.value);
404
+ }) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = useMemo(() => renderPopover ? /* @__PURE__ */ jsx(RenderPopover, { content: content2, hidden: !expanded, inputElement, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, resultsPopoverElementRef, renderPopover }) : 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, ref: resultsPopoverElementRef, referenceElement: inputElement, ...popover }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, inputElement, popover, radius, renderPopover]);
405
+ return /* @__PURE__ */ jsxs(StyledAutocomplete, { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
406
+ /* @__PURE__ */ jsx(TextInput, { ...restProps, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", border, clearButton, customValidity, disabled, fontSize, icon, iconRight: loading && AnimatedSpinnerIcon, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: setInputElement, role: "combobox", spellCheck: !1, suffix: suffix || openButtonNode, value: inputValue }),
540
407
  results
541
- ] }), $[174] = handleRootBlur, $[175] = handleRootKeyDown, $[176] = results, $[177] = t45, $[178] = t46) : t46 = $[178], t46;
408
+ ] });
542
409
  });
543
410
  function RenderPopover({
544
411
  renderPopover,
@@ -558,42 +425,93 @@ function RenderPopover({
558
425
  }, resultsPopoverElementRef);
559
426
  }
560
427
  InnerAutocomplete.displayName = "ForwardRef(Autocomplete)";
561
- const Autocomplete = InnerAutocomplete;
562
- function _temp$3(v_0) {
563
- return v_0 === 0 ? 0 : v_0 === 1 || v_0 === 2 ? 1 : v_0 - 2;
564
- }
565
- function _temp2$1(v_1) {
566
- return Math.max(v_1 - 1, 0);
567
- }
568
- const StyledBreadcrumbs = styled.ol.withConfig({
428
+ const Autocomplete = InnerAutocomplete, StyledBreadcrumbs = styled.ol.withConfig({
569
429
  displayName: "StyledBreadcrumbs",
570
430
  componentId: "sc-1es8h8q-0"
571
431
  })`margin:0;padding:0;display:flex;list-style:none;align-items:center;white-space:nowrap;line-height:0;`, ExpandButton = styled(Button).withConfig({
572
432
  displayName: "ExpandButton",
573
433
  componentId: "sc-1es8h8q-1"
574
434
  })`appearance:none;margin:-4px;`, Breadcrumbs = forwardRef(function(props, ref) {
575
- const {
435
+ const $ = c(29);
436
+ let children, maxLength, restProps, separator, t0;
437
+ $[0] !== props ? ({
576
438
  children,
577
439
  maxLength,
578
440
  separator,
579
- space: spaceRaw = 2,
441
+ space: t0,
580
442
  ...restProps
581
- } = props, space = useArrayProp(spaceRaw), [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null), collapse = useCallback(() => setOpen(!1), []), expand = useCallback(() => setOpen(!0), []);
582
- useClickOutsideEvent(collapse, () => [expandElementRef.current, popoverElementRef.current]);
583
- const rawItems = useMemo(() => Children.toArray(children).filter(isValidElement), [children]), items = useMemo(() => {
584
- const len = rawItems.length;
585
- if (maxLength && len > maxLength) {
586
- const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
587
- return [...rawItems.slice(0, beforeLength - 1), /* @__PURE__ */ jsx(Popover, { constrainSize: !0, content: /* @__PURE__ */ jsx(Stack, { as: "ol", overflow: "auto", padding: space, space, children: rawItems.slice(beforeLength - 1, len - afterLength) }), open, placement: "top", portal: !0, ref: popoverElementRef, children: /* @__PURE__ */ jsx(ExpandButton, { fontSize: 1, mode: "bleed", onClick: open ? collapse : expand, padding: 1, ref: expandElementRef, selected: open, text: "\u2026" }) }, "button"), ...rawItems.slice(len - afterLength)];
588
- }
589
- return rawItems;
590
- }, [collapse, expand, maxLength, open, rawItems, space]);
591
- return /* @__PURE__ */ jsx(StyledBreadcrumbs, { "data-ui": "Breadcrumbs", ...restProps, ref, children: items.map((item, itemIndex) => /* @__PURE__ */ jsxs(Fragment, { children: [
592
- itemIndex > 0 && /* @__PURE__ */ jsx(Box, { "aria-hidden": !0, as: "li", paddingX: space, children: separator || /* @__PURE__ */ jsx(Text, { muted: !0, children: "/" }) }),
593
- /* @__PURE__ */ jsx(Box, { as: "li", children: item })
594
- ] }, itemIndex)) });
443
+ } = props, $[0] = props, $[1] = children, $[2] = maxLength, $[3] = restProps, $[4] = separator, $[5] = t0) : (children = $[1], maxLength = $[2], restProps = $[3], separator = $[4], t0 = $[5]);
444
+ const spaceRaw = t0 === void 0 ? 2 : t0;
445
+ let t1;
446
+ $[6] !== spaceRaw ? (t1 = _getArrayProp(spaceRaw), $[6] = spaceRaw, $[7] = t1) : t1 = $[7];
447
+ const space = t1, [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null);
448
+ let t2;
449
+ $[8] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => setOpen(!1), $[8] = t2) : t2 = $[8];
450
+ const collapse = t2;
451
+ let t3;
452
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => setOpen(!0), $[9] = t3) : t3 = $[9];
453
+ const expand = t3;
454
+ let t4;
455
+ $[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => [expandElementRef.current, popoverElementRef.current], $[10] = t4) : t4 = $[10], useClickOutsideEvent(collapse, t4);
456
+ let t5;
457
+ $[11] !== children ? (t5 = Children.toArray(children).filter(isValidElement), $[11] = children, $[12] = t5) : t5 = $[12];
458
+ const rawItems = t5;
459
+ let t6;
460
+ $[13] !== maxLength || $[14] !== open || $[15] !== rawItems || $[16] !== space ? (t6 = {
461
+ collapse,
462
+ expand,
463
+ expandElementRef,
464
+ maxLength,
465
+ open,
466
+ popoverElementRef,
467
+ rawItems,
468
+ space
469
+ }, $[13] = maxLength, $[14] = open, $[15] = rawItems, $[16] = space, $[17] = t6) : t6 = $[17];
470
+ const items = useItems(t6);
471
+ let t7;
472
+ if ($[18] !== items || $[19] !== separator || $[20] !== space) {
473
+ let t82;
474
+ $[22] !== separator || $[23] !== space ? (t82 = (item, itemIndex) => /* @__PURE__ */ jsxs(Fragment, { children: [
475
+ itemIndex > 0 && /* @__PURE__ */ jsx(Box, { "aria-hidden": !0, as: "li", paddingX: space, children: separator || /* @__PURE__ */ jsx(Text, { muted: !0, children: "/" }) }),
476
+ /* @__PURE__ */ jsx(Box, { as: "li", children: item })
477
+ ] }, itemIndex), $[22] = separator, $[23] = space, $[24] = t82) : t82 = $[24], t7 = items.map(t82), $[18] = items, $[19] = separator, $[20] = space, $[21] = t7;
478
+ } else
479
+ t7 = $[21];
480
+ let t8;
481
+ return $[25] !== ref || $[26] !== restProps || $[27] !== t7 ? (t8 = /* @__PURE__ */ jsx(StyledBreadcrumbs, { "data-ui": "Breadcrumbs", ...restProps, ref, children: t7 }), $[25] = ref, $[26] = restProps, $[27] = t7, $[28] = t8) : t8 = $[28], t8;
595
482
  });
596
483
  Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
484
+ function useItems(t0) {
485
+ const $ = c(28), {
486
+ collapse,
487
+ expand,
488
+ expandElementRef,
489
+ maxLength,
490
+ open,
491
+ popoverElementRef,
492
+ rawItems,
493
+ space
494
+ } = t0, len = rawItems.length;
495
+ if (maxLength && len > maxLength) {
496
+ const beforeLength = Math.ceil(maxLength / 2), afterLength = Math.floor(maxLength / 2);
497
+ let t1;
498
+ if ($[0] !== afterLength || $[1] !== beforeLength || $[2] !== collapse || $[3] !== expand || $[4] !== expandElementRef || $[5] !== len || $[6] !== open || $[7] !== popoverElementRef || $[8] !== rawItems || $[9] !== space) {
499
+ const t2 = rawItems.slice(0, beforeLength - 1);
500
+ let t3;
501
+ $[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];
502
+ let t4;
503
+ $[16] !== space || $[17] !== t3 ? (t4 = /* @__PURE__ */ jsx(Stack, { as: "ol", overflow: "auto", padding: space, space, children: t3 }), $[16] = space, $[17] = t3, $[18] = t4) : t4 = $[18];
504
+ const t5 = open ? collapse : expand;
505
+ let t6;
506
+ $[19] !== expandElementRef || $[20] !== open || $[21] !== t5 ? (t6 = /* @__PURE__ */ 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];
507
+ let t7;
508
+ $[23] !== open || $[24] !== popoverElementRef || $[25] !== t4 || $[26] !== t6 ? (t7 = /* @__PURE__ */ jsx(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;
509
+ } else
510
+ t1 = $[10];
511
+ return t1;
512
+ }
513
+ return rawItems;
514
+ }
597
515
  function dialogStyle({
598
516
  theme
599
517
  }) {
@@ -683,7 +601,7 @@ const StyledDialog = /* @__PURE__ */ styled(Layer).withConfig({
683
601
  displayName: "DialogFooter",
684
602
  componentId: "sc-4n4xb3-6"
685
603
  })`position:relative;z-index:3;`, DialogCard = forwardRef(function(props, forwardedRef) {
686
- const $ = c(38), {
604
+ const $ = c(44), {
687
605
  __unstable_autoFocus: autoFocus,
688
606
  __unstable_hideCloseButton: hideCloseButton,
689
607
  children,
@@ -698,54 +616,63 @@ const StyledDialog = /* @__PURE__ */ styled(Layer).withConfig({
698
616
  scheme,
699
617
  shadow: shadowProp,
700
618
  width: widthProp
701
- } = props, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, radius = useArrayProp(radiusProp), shadow = useArrayProp(shadowProp), width = useArrayProp(widthProp), ref = useRef(null), contentRef = useRef(null), layer = useLayer(), {
702
- isTopLayer
703
- } = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton;
619
+ } = props, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element;
704
620
  let t0;
705
- $[0] === Symbol.for("react.memo_cache_sentinel") ? (t0 = () => ref.current, $[0] = t0) : t0 = $[0], useImperativeHandle(forwardedRef, t0);
621
+ $[0] !== radiusProp ? (t0 = _getArrayProp(radiusProp), $[0] = radiusProp, $[1] = t0) : t0 = $[1];
622
+ const radius = t0;
706
623
  let t1;
707
- $[1] === Symbol.for("react.memo_cache_sentinel") ? (t1 = () => contentRef.current, $[1] = t1) : t1 = $[1], useImperativeHandle(forwardedContentRef, t1);
708
- let t2, t3;
709
- $[2] !== autoFocus ? (t2 = () => {
710
- autoFocus && ref.current && focusFirstDescendant(ref.current);
711
- }, t3 = [autoFocus, ref], $[2] = autoFocus, $[3] = t2, $[4] = t3) : (t2 = $[3], t3 = $[4]), useEffect(t2, t3);
624
+ $[2] !== shadowProp ? (t1 = _getArrayProp(shadowProp), $[2] = shadowProp, $[3] = t1) : t1 = $[3];
625
+ const shadow = t1;
626
+ let t2;
627
+ $[4] !== widthProp ? (t2 = _getArrayProp(widthProp), $[4] = widthProp, $[5] = t2) : t2 = $[5];
628
+ const width = t2, ref = useRef(null), contentRef = useRef(null), layer = useLayer(), {
629
+ isTopLayer
630
+ } = layer, labelId = `${id}_label`, showCloseButton = !!onClose && hideCloseButton === !1, showHeader = !!header || showCloseButton;
631
+ let t3;
632
+ $[6] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => ref.current, $[6] = t3) : t3 = $[6], useImperativeHandle(forwardedRef, t3);
712
633
  let t4;
713
- $[5] !== boundaryElement || $[6] !== isTopLayer || $[7] !== onClose || $[8] !== portalElement ? (t4 = (event) => {
634
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => contentRef.current, $[7] = t4) : t4 = $[7], useImperativeHandle(forwardedContentRef, t4);
635
+ let t5, t6;
636
+ $[8] !== autoFocus ? (t5 = () => {
637
+ autoFocus && ref.current && focusFirstDescendant(ref.current);
638
+ }, t6 = [autoFocus, ref], $[8] = autoFocus, $[9] = t5, $[10] = t6) : (t5 = $[9], t6 = $[10]), useEffect(t5, t6);
639
+ let t7;
640
+ $[11] !== boundaryElement || $[12] !== isTopLayer || $[13] !== onClose || $[14] !== portalElement ? (t7 = (event) => {
714
641
  if (!isTopLayer || !onClose)
715
642
  return;
716
643
  const target = document.activeElement;
717
644
  target && !isTargetWithinScope(boundaryElement, portalElement, target) || event.key === "Escape" && (event.preventDefault(), event.stopPropagation(), onClose());
718
- }, $[5] = boundaryElement, $[6] = isTopLayer, $[7] = onClose, $[8] = portalElement, $[9] = t4) : t4 = $[9], useGlobalKeyDown(t4);
719
- let t5;
720
- $[10] !== boundaryElement || $[11] !== isTopLayer || $[12] !== onClickOutside || $[13] !== portalElement ? (t5 = isTopLayer && onClickOutside && ((event_0) => {
645
+ }, $[11] = boundaryElement, $[12] = isTopLayer, $[13] = onClose, $[14] = portalElement, $[15] = t7) : t7 = $[15], useGlobalKeyDown(t7);
646
+ let t8;
647
+ $[16] !== boundaryElement || $[17] !== isTopLayer || $[18] !== onClickOutside || $[19] !== portalElement ? (t8 = isTopLayer && onClickOutside && ((event_0) => {
721
648
  const target_0 = event_0.target;
722
649
  target_0 && !isTargetWithinScope(boundaryElement, portalElement, target_0) || onClickOutside();
723
- }), $[10] = boundaryElement, $[11] = isTopLayer, $[12] = onClickOutside, $[13] = portalElement, $[14] = t5) : t5 = $[14];
724
- let t6;
725
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t6 = () => [ref.current], $[15] = t6) : t6 = $[15], useClickOutsideEvent(t5, t6);
726
- let t7;
727
- $[16] !== header || $[17] !== labelId || $[18] !== onClose || $[19] !== showCloseButton || $[20] !== showHeader ? (t7 = showHeader && /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsxs(Flex, { align: "flex-start", padding: 3, children: [
728
- /* @__PURE__ */ jsx(Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsx(Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
729
- showCloseButton && /* @__PURE__ */ jsx(Box, { flex: "none", children: /* @__PURE__ */ jsx(Button, { "aria-label": "Close dialog", disabled: !onClose, icon: CloseIcon, mode: "bleed", onClick: onClose, padding: 2 }) })
730
- ] }) }), $[16] = header, $[17] = labelId, $[18] = onClose, $[19] = showCloseButton, $[20] = showHeader, $[21] = t7) : t7 = $[21];
731
- let t8;
732
- $[22] !== children ? (t8 = /* @__PURE__ */ jsx(DialogContent, { flex: 1, ref: contentRef, tabIndex: -1, children }), $[22] = children, $[23] = t8) : t8 = $[23];
650
+ }), $[16] = boundaryElement, $[17] = isTopLayer, $[18] = onClickOutside, $[19] = portalElement, $[20] = t8) : t8 = $[20];
733
651
  let t9;
734
- $[24] !== footer ? (t9 = footer && /* @__PURE__ */ jsx(DialogFooter, { children: footer }), $[24] = footer, $[25] = t9) : t9 = $[25];
652
+ $[21] === Symbol.for("react.memo_cache_sentinel") ? (t9 = () => [ref.current], $[21] = t9) : t9 = $[21], useClickOutsideEvent(t8, t9);
735
653
  let t10;
736
- $[26] !== t7 || $[27] !== t8 || $[28] !== t9 ? (t10 = /* @__PURE__ */ jsxs(DialogLayout, { direction: "column", children: [
737
- t7,
738
- t8,
739
- t9
740
- ] }), $[26] = t7, $[27] = t8, $[28] = t9, $[29] = t10) : t10 = $[29];
654
+ $[22] !== header || $[23] !== labelId || $[24] !== onClose || $[25] !== showCloseButton || $[26] !== showHeader ? (t10 = showHeader && /* @__PURE__ */ jsx(DialogHeader, { children: /* @__PURE__ */ jsxs(Flex, { align: "flex-start", padding: 3, children: [
655
+ /* @__PURE__ */ jsx(Box, { flex: 1, padding: 2, children: header && /* @__PURE__ */ jsx(Text, { id: labelId, size: 1, weight: "semibold", children: header }) }),
656
+ showCloseButton && /* @__PURE__ */ jsx(Box, { flex: "none", children: /* @__PURE__ */ jsx(Button, { "aria-label": "Close dialog", disabled: !onClose, icon: CloseIcon, mode: "bleed", onClick: onClose, padding: 2 }) })
657
+ ] }) }), $[22] = header, $[23] = labelId, $[24] = onClose, $[25] = showCloseButton, $[26] = showHeader, $[27] = t10) : t10 = $[27];
741
658
  let t11;
742
- $[30] !== radius || $[31] !== scheme || $[32] !== shadow || $[33] !== t10 ? (t11 = /* @__PURE__ */ jsx(DialogCardRoot, { radius, ref, scheme, shadow, children: t10 }), $[30] = radius, $[31] = scheme, $[32] = shadow, $[33] = t10, $[34] = t11) : t11 = $[34];
659
+ $[28] !== children ? (t11 = /* @__PURE__ */ jsx(DialogContent, { flex: 1, ref: contentRef, tabIndex: -1, children }), $[28] = children, $[29] = t11) : t11 = $[29];
743
660
  let t12;
744
- return $[35] !== t11 || $[36] !== width ? (t12 = /* @__PURE__ */ jsx(DialogContainer, { "data-ui": "DialogCard", width, children: t11 }), $[35] = t11, $[36] = width, $[37] = t12) : t12 = $[37], t12;
661
+ $[30] !== footer ? (t12 = footer && /* @__PURE__ */ jsx(DialogFooter, { children: footer }), $[30] = footer, $[31] = t12) : t12 = $[31];
662
+ let t13;
663
+ $[32] !== t10 || $[33] !== t11 || $[34] !== t12 ? (t13 = /* @__PURE__ */ jsxs(DialogLayout, { direction: "column", children: [
664
+ t10,
665
+ t11,
666
+ t12
667
+ ] }), $[32] = t10, $[33] = t11, $[34] = t12, $[35] = t13) : t13 = $[35];
668
+ let t14;
669
+ $[36] !== radius || $[37] !== scheme || $[38] !== shadow || $[39] !== t13 ? (t14 = /* @__PURE__ */ jsx(DialogCardRoot, { radius, ref, scheme, shadow, children: t13 }), $[36] = radius, $[37] = scheme, $[38] = shadow, $[39] = t13, $[40] = t14) : t14 = $[40];
670
+ let t15;
671
+ return $[41] !== t14 || $[42] !== width ? (t15 = /* @__PURE__ */ jsx(DialogContainer, { "data-ui": "DialogCard", width, children: t14 }), $[41] = t14, $[42] = width, $[43] = t15) : t15 = $[43], t15;
745
672
  });
746
673
  DialogCard.displayName = "ForwardRef(DialogCard)";
747
674
  const Dialog = forwardRef(function(props, ref) {
748
- const $ = c(60), dialog = useDialog(), {
675
+ const $ = c(70), dialog = useDialog(), {
749
676
  layer
750
677
  } = useTheme_v2();
751
678
  let _positionProp, _zOffsetProp, children, contentRef, footer, header, id, onActivate, onClickOutside, onClose, onFocus, portalProp, restProps, scheme, t0, t1, t2, t3, t4, t5, t6;
@@ -772,9 +699,24 @@ const Dialog = forwardRef(function(props, ref) {
772
699
  animate: t6,
773
700
  ...restProps
774
701
  } = 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]);
775
- 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 = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element, cardRadius = useArrayProp(cardRadiusProp), padding = useArrayProp(paddingProp), position = useArrayProp(positionProp), width = useArrayProp(widthProp), zOffset = useArrayProp(zOffsetProp), preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
702
+ 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 = usePrefersReducedMotion() ? !1 : _animate, portal = usePortal(), portalElement = portalProp ? portal.elements?.[portalProp] || null : portal.element, boundaryElement = useBoundaryElement().element;
776
703
  let t7;
777
- $[22] !== onFocus ? (t7 = (event) => {
704
+ $[22] !== cardRadiusProp ? (t7 = _getArrayProp(cardRadiusProp), $[22] = cardRadiusProp, $[23] = t7) : t7 = $[23];
705
+ const cardRadius = t7;
706
+ let t8;
707
+ $[24] !== paddingProp ? (t8 = _getArrayProp(paddingProp), $[24] = paddingProp, $[25] = t8) : t8 = $[25];
708
+ const padding = t8;
709
+ let t9;
710
+ $[26] !== positionProp ? (t9 = _getArrayProp(positionProp), $[26] = positionProp, $[27] = t9) : t9 = $[27];
711
+ const position = t9;
712
+ let t10;
713
+ $[28] !== widthProp ? (t10 = _getArrayProp(widthProp), $[28] = widthProp, $[29] = t10) : t10 = $[29];
714
+ const width = t10;
715
+ let t11;
716
+ $[30] !== zOffsetProp ? (t11 = _getArrayProp(zOffsetProp), $[30] = zOffsetProp, $[31] = t11) : t11 = $[31];
717
+ const zOffset = t11, preDivRef = useRef(null), postDivRef = useRef(null), cardRef = useRef(null), focusedElementRef = useRef(null);
718
+ let t12;
719
+ $[32] !== onFocus ? (t12 = (event) => {
778
720
  onFocus?.(event);
779
721
  const target = event.target, cardElement = cardRef.current;
780
722
  if (cardElement && target === preDivRef.current) {
@@ -786,10 +728,10 @@ const Dialog = forwardRef(function(props, ref) {
786
728
  return;
787
729
  }
788
730
  isHTMLElement(event.target) && (focusedElementRef.current = event.target);
789
- }, $[22] = onFocus, $[23] = t7) : t7 = $[23];
790
- const handleFocus = t7, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0);
791
- let t8;
792
- $[24] !== boundaryElement || $[25] !== portalElement ? (t8 = () => {
731
+ }, $[32] = onFocus, $[33] = t12) : t12 = $[33];
732
+ const handleFocus = t12, labelId = `${id}_label`, rootClickTimeoutRef = useRef(void 0);
733
+ let t13;
734
+ $[34] !== boundaryElement || $[35] !== portalElement ? (t13 = () => {
793
735
  rootClickTimeoutRef.current && clearTimeout(rootClickTimeoutRef.current), rootClickTimeoutRef.current = setTimeout(() => {
794
736
  const activeElement = document.activeElement;
795
737
  if (activeElement && !isTargetWithinScope(boundaryElement, portalElement, activeElement)) {
@@ -802,22 +744,22 @@ const Dialog = forwardRef(function(props, ref) {
802
744
  target_0.focus();
803
745
  }
804
746
  }, 0);
805
- }, $[24] = boundaryElement, $[25] = portalElement, $[26] = t8) : t8 = $[26];
806
- const handleRootClick = t8;
807
- let t9;
808
- $[27] === Symbol.for("react.memo_cache_sentinel") ? (t9 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[27] = t9) : t9 = $[27];
809
- let t10;
810
- $[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__ */ 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];
811
- let t11;
812
- $[43] === Symbol.for("react.memo_cache_sentinel") ? (t11 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[43] = t11) : t11 = $[43];
813
- let t12;
814
- $[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__ */ 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: [
815
- t9,
816
- t10,
817
- t11
818
- ] }), $[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];
819
- let t13;
820
- return $[57] !== portalProp || $[58] !== t12 ? (t13 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t12 }), $[57] = portalProp, $[58] = t12, $[59] = t13) : t13 = $[59], t13;
747
+ }, $[34] = boundaryElement, $[35] = portalElement, $[36] = t13) : t13 = $[36];
748
+ const handleRootClick = t13;
749
+ let t14;
750
+ $[37] === Symbol.for("react.memo_cache_sentinel") ? (t14 = /* @__PURE__ */ jsx("div", { ref: preDivRef, tabIndex: 0 }), $[37] = t14) : t14 = $[37];
751
+ let t15;
752
+ $[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__ */ 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];
753
+ let t16;
754
+ $[53] === Symbol.for("react.memo_cache_sentinel") ? (t16 = /* @__PURE__ */ jsx("div", { ref: postDivRef, tabIndex: 0 }), $[53] = t16) : t16 = $[53];
755
+ let t17;
756
+ $[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__ */ 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: [
757
+ t14,
758
+ t15,
759
+ t16
760
+ ] }), $[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];
761
+ let t18;
762
+ return $[67] !== portalProp || $[68] !== t17 ? (t18 = /* @__PURE__ */ jsx(Portal, { __unstable_name: portalProp, children: t17 }), $[67] = portalProp, $[68] = t17, $[69] = t18) : t18 = $[69], t18;
821
763
  });
822
764
  Dialog.displayName = "ForwardRef(Dialog)";
823
765
  function DialogProvider(props) {
@@ -1019,7 +961,7 @@ const keyframe = keyframes`
1019
961
  displayName: "StyledSkeleton",
1020
962
  componentId: "sc-ebtpni-0"
1021
963
  })(responsiveRadiusStyle, skeletonStyle), Skeleton = forwardRef(function(props, ref) {
1022
- const $ = c(14);
964
+ const $ = c(16);
1023
965
  let delay, radius, restProps, t0;
1024
966
  $[0] !== props ? ({
1025
967
  animated: t0,
@@ -1039,9 +981,10 @@ const keyframe = keyframes`
1039
981
  clearTimeout(timeout);
1040
982
  };
1041
983
  }, t2 = [delay], $[5] = delay, $[6] = t1, $[7] = t2) : (t1 = $[6], t2 = $[7]), useEffect(t1, t2);
1042
- const t3 = useArrayProp(radius);
984
+ let t3;
985
+ $[8] !== radius ? (t3 = _getArrayProp(radius), $[8] = radius, $[9] = t3) : t3 = $[9];
1043
986
  let t4;
1044
- return $[8] !== animated || $[9] !== ref || $[10] !== restProps || $[11] !== t3 || $[12] !== visible ? (t4 = /* @__PURE__ */ 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;
987
+ return $[10] !== animated || $[11] !== ref || $[12] !== restProps || $[13] !== t3 || $[14] !== visible ? (t4 = /* @__PURE__ */ 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;
1045
988
  });
1046
989
  Skeleton.displayName = "ForwardRef(Skeleton)";
1047
990
  const StyledSkeleton = /* @__PURE__ */ styled(Skeleton).withConfig({
@@ -1062,51 +1005,63 @@ const StyledSkeleton = /* @__PURE__ */ styled(Skeleton).withConfig({
1062
1005
  };
1063
1006
  });
1064
1007
  }), TextSkeleton = forwardRef(function(props, ref) {
1065
- const $ = c(7);
1008
+ const $ = c(9);
1066
1009
  let restProps, t0;
1067
1010
  $[0] !== props ? ({
1068
1011
  size: t0,
1069
1012
  ...restProps
1070
1013
  } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
1071
- const $size = useArrayProp(t0 === void 0 ? 2 : t0);
1014
+ const size = t0 === void 0 ? 2 : t0;
1072
1015
  let t1;
1073
- return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "text" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
1016
+ $[3] !== size ? (t1 = _getArrayProp(size), $[3] = size, $[4] = t1) : t1 = $[4];
1017
+ const $size = t1;
1018
+ let t2;
1019
+ return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "text" }), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
1074
1020
  });
1075
1021
  TextSkeleton.displayName = "ForwardRef(TextSkeleton)";
1076
1022
  const LabelSkeleton = forwardRef(function(props, ref) {
1077
- const $ = c(7);
1023
+ const $ = c(9);
1078
1024
  let restProps, t0;
1079
1025
  $[0] !== props ? ({
1080
1026
  size: t0,
1081
1027
  ...restProps
1082
1028
  } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
1083
- const $size = useArrayProp(t0 === void 0 ? 2 : t0);
1029
+ const size = t0 === void 0 ? 2 : t0;
1084
1030
  let t1;
1085
- return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "label" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
1031
+ $[3] !== size ? (t1 = _getArrayProp(size), $[3] = size, $[4] = t1) : t1 = $[4];
1032
+ const $size = t1;
1033
+ let t2;
1034
+ return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "label" }), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
1086
1035
  });
1087
1036
  LabelSkeleton.displayName = "ForwardRef(LabelSkeleton)";
1088
1037
  const HeadingSkeleton = forwardRef(function(props, ref) {
1089
- const $ = c(7);
1038
+ const $ = c(9);
1090
1039
  let restProps, t0;
1091
1040
  $[0] !== props ? ({
1092
1041
  size: t0,
1093
1042
  ...restProps
1094
1043
  } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
1095
- const $size = useArrayProp(t0 === void 0 ? 2 : t0);
1044
+ const size = t0 === void 0 ? 2 : t0;
1096
1045
  let t1;
1097
- return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "heading" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
1046
+ $[3] !== size ? (t1 = _getArrayProp(size), $[3] = size, $[4] = t1) : t1 = $[4];
1047
+ const $size = t1;
1048
+ let t2;
1049
+ return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "heading" }), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
1098
1050
  });
1099
1051
  HeadingSkeleton.displayName = "ForwardRef(HeadingSkeleton)";
1100
1052
  const CodeSkeleton = forwardRef(function(props, ref) {
1101
- const $ = c(7);
1053
+ const $ = c(9);
1102
1054
  let restProps, t0;
1103
1055
  $[0] !== props ? ({
1104
1056
  size: t0,
1105
1057
  ...restProps
1106
1058
  } = props, $[0] = props, $[1] = restProps, $[2] = t0) : (restProps = $[1], t0 = $[2]);
1107
- const $size = useArrayProp(t0 === void 0 ? 2 : t0);
1059
+ const size = t0 === void 0 ? 2 : t0;
1108
1060
  let t1;
1109
- return $[3] !== $size || $[4] !== ref || $[5] !== restProps ? (t1 = /* @__PURE__ */ jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "code" }), $[3] = $size, $[4] = ref, $[5] = restProps, $[6] = t1) : t1 = $[6], t1;
1061
+ $[3] !== size ? (t1 = _getArrayProp(size), $[3] = size, $[4] = t1) : t1 = $[4];
1062
+ const $size = t1;
1063
+ let t2;
1064
+ return $[5] !== $size || $[6] !== ref || $[7] !== restProps ? (t2 = /* @__PURE__ */ jsx(StyledSkeleton, { ...restProps, $size, ref, $style: "code" }), $[5] = $size, $[6] = ref, $[7] = restProps, $[8] = t2) : t2 = $[8], t2;
1110
1065
  });
1111
1066
  CodeSkeleton.displayName = "ForwardRef(CodeSkeleton)";
1112
1067
  const TabPanel = forwardRef(function(props, ref) {
@@ -1419,7 +1374,7 @@ function _focusItemElement(el) {
1419
1374
  firstChild && firstChild instanceof HTMLElement && firstChild.focus();
1420
1375
  }
1421
1376
  }
1422
- const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null), Tree = memo(forwardRef(function(props, forwardedRef) {
1377
+ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null), Tree = forwardRef(function(props, forwardedRef) {
1423
1378
  const $ = c(37);
1424
1379
  let children, onFocus, restProps, t0;
1425
1380
  $[0] !== props ? ({
@@ -1571,8 +1526,8 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
1571
1526
  $[28] !== children || $[29] !== handleFocus || $[30] !== handleKeyDown || $[31] !== restProps || $[32] !== space ? (t17 = /* @__PURE__ */ jsx(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];
1572
1527
  let t18;
1573
1528
  return $[34] !== contextValue || $[35] !== t17 ? (t18 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t17 }), $[34] = contextValue, $[35] = t17, $[36] = t18) : t18 = $[36], t18;
1574
- }));
1575
- Tree.displayName = "Memo(ForwardRef(Tree))";
1529
+ });
1530
+ Tree.displayName = "ForwardRef(Tree)";
1576
1531
  function treeItemRootStyle() {
1577
1532
  return css`
1578
1533
  &[role='none'] > [role='treeitem'] {
@@ -1671,7 +1626,7 @@ function useTree() {
1671
1626
  throw new Error("Tree: missing context value");
1672
1627
  return tree;
1673
1628
  }
1674
- const TreeGroup = memo(function(props) {
1629
+ function TreeGroup(props) {
1675
1630
  const $ = c(9);
1676
1631
  let children, restProps, t0;
1677
1632
  $[0] !== props ? ({
@@ -1682,10 +1637,11 @@ const TreeGroup = memo(function(props) {
1682
1637
  const expanded = t0 === void 0 ? !1 : t0, tree = useTree(), t1 = !expanded;
1683
1638
  let t2;
1684
1639
  return $[4] !== children || $[5] !== restProps || $[6] !== t1 || $[7] !== tree.space ? (t2 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "TreeGroup", ...restProps, hidden: t1, marginTop: tree.space, role: "group", space: tree.space, children }), $[4] = children, $[5] = restProps, $[6] = t1, $[7] = tree.space, $[8] = t2) : t2 = $[8], t2;
1685
- }), StyledTreeItem = memo(styled.li.withConfig({
1640
+ }
1641
+ const StyledTreeItem = /* @__PURE__ */ styled.li.withConfig({
1686
1642
  displayName: "StyledTreeItem",
1687
1643
  componentId: "sc-iiskig-0"
1688
- })(treeItemRootStyle, treeItemRootColorStyle)), TreeItemBox = /* @__PURE__ */ styled(Box).attrs({
1644
+ })(treeItemRootStyle, treeItemRootColorStyle), TreeItemBox = /* @__PURE__ */ styled(Box).attrs({
1689
1645
  forwardedAs: "a"
1690
1646
  }).withConfig({
1691
1647
  displayName: "TreeItemBox",
@@ -1693,7 +1649,8 @@ const TreeGroup = memo(function(props) {
1693
1649
  })(treeItemBoxStyle), ToggleArrowText = styled(Text).withConfig({
1694
1650
  displayName: "ToggleArrowText",
1695
1651
  componentId: "sc-iiskig-2"
1696
- })`& > svg{transition:transform 100ms;}`, TreeItem = memo(function(props) {
1652
+ })`& > svg{transition:transform 100ms;}`;
1653
+ function TreeItem(props) {
1697
1654
  const $ = c(112);
1698
1655
  let IconComponent, children, href, idProp, linkAs, muted, onClick, restProps, t0, t1, t2, t3, t4, text, weight;
1699
1656
  $[0] !== props ? ({
@@ -1803,8 +1760,8 @@ const TreeGroup = memo(function(props) {
1803
1760
  t22,
1804
1761
  t24
1805
1762
  ] }), $[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;
1806
- });
1807
- TreeItem.displayName = "Memo(TreeItem)";
1763
+ }
1764
+ TreeItem.displayName = "TreeItem";
1808
1765
  export {
1809
1766
  Arrow,
1810
1767
  Autocomplete,