@sanity/ui 3.0.10 → 3.0.11

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.
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
- import { isHTMLElement, isHTMLAnchorElement, isHTMLInputElement, isHTMLButtonElement, isHTMLSelectElement, isHTMLTextAreaElement, EMPTY_ARRAY, useElementSize, Code, Box, _isEnterToClickElement, Card, Text, useArrayProp, 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";
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
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";
3
3
  import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
4
+ import { c } from "react-compiler-runtime";
4
5
  import { SpinnerIcon, ChevronDownIcon, CloseIcon, ToggleArrowRightIcon } from "@sanity/icons";
5
- import { useState, useRef, useEffect, useImperativeHandle, Component, forwardRef, useReducer, useCallback, useMemo, cloneElement, Children, isValidElement, Fragment, useContext, useSyncExternalStore, startTransition, memo, useId } from "react";
6
+ import { useState, useRef, useEffect, useImperativeHandle, Component, forwardRef, useReducer, cloneElement, useCallback, useMemo, Children, isValidElement, Fragment, useContext, useSyncExternalStore, startTransition, memo, useId } from "react";
6
7
  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) {
@@ -215,15 +215,17 @@ function autocompleteReducer(state, msg) {
215
215
  } : state;
216
216
  }
217
217
  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 {
219
- border = !0,
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,
220
222
  customValidity,
221
223
  disabled,
222
224
  filterOption: filterOptionProp,
223
- fontSize = 2,
225
+ fontSize: t1,
224
226
  icon,
225
227
  id,
226
- listBox = EMPTY_RECORD,
228
+ listBox: t2,
227
229
  loading,
228
230
  onBlur,
229
231
  onChange,
@@ -233,35 +235,60 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
233
235
  openButton,
234
236
  openOnFocus,
235
237
  options: optionsProp,
236
- padding: paddingProp = 3,
237
- popover = EMPTY_RECORD,
238
+ padding: t3,
239
+ popover: t4,
238
240
  prefix,
239
- radius = 2,
241
+ radius: t5,
240
242
  readOnly,
241
243
  relatedElements,
242
244
  renderOption: renderOptionProp,
243
245
  renderPopover,
244
- renderValue = DEFAULT_RENDER_VALUE,
246
+ renderValue: t6,
245
247
  suffix,
246
248
  value: valueProp,
247
249
  ...restProps
248
- } = props, [state, dispatch] = useReducer(autocompleteReducer, {
249
- activeValue: valueProp || null,
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,
250
255
  focused: !1,
251
256
  listFocused: !1,
252
257
  query: null,
253
- value: valueProp || null
254
- }), {
258
+ value: t8
259
+ }, $[30] = t7, $[31] = t8, $[32] = t9) : t9 = $[32];
260
+ const [state, dispatch] = useReducer(autocompleteReducer, t9), {
255
261
  activeValue,
256
262
  focused,
257
263
  listFocused,
258
264
  query,
259
265
  value
260
- } = state, defaultRenderOption = useCallback(({
261
- value: value_0
262
- }) => /* @__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), listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1);
263
- useImperativeHandle(forwardedRef, () => inputElementRef.current);
264
- const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = useArrayProp(paddingProp), currentOption = useMemo(() => value !== null ? options.find((o) => o.value === value) : void 0, [options, value]), filteredOptions = useMemo(() => options.filter((option) => query ? filterOption(query, option) : !0), [filterOption, options, query]), filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null, handleRootBlur = useCallback((event) => {
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
292
  setTimeout(() => {
266
293
  if (popoverMouseWithinRef.current)
267
294
  return;
@@ -278,20 +305,30 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
278
305
  type: "root/blur"
279
306
  }), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
280
307
  }, 0);
281
- }, [onBlur, onQueryChange, relatedElements]), handleRootFocus = useCallback((event_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) => {
282
312
  const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
283
313
  listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
284
314
  type: "root/setListFocused",
285
315
  listFocused: listFocused_0
286
316
  }));
287
- }, []), handleOptionSelect = useCallback((v) => {
317
+ }, $[56] = t18) : t18 = $[56];
318
+ const handleRootFocus = t18;
319
+ let t19;
320
+ $[57] !== onChange || $[58] !== onQueryChange || $[59] !== onSelect ? (t19 = (v) => {
288
321
  dispatch({
289
322
  type: "value/change",
290
323
  value: v
291
324
  }), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
292
- }, [onChange, onSelect, onQueryChange]), handleRootKeyDown = useCallback((event_1) => {
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) => {
293
329
  if (event_1.key === "ArrowDown") {
294
- if (event_1.preventDefault(), !filteredOptionsLen) return;
330
+ if (event_1.preventDefault(), !filteredOptionsLen)
331
+ return;
295
332
  const activeOption = filteredOptions.find((o_0) => o_0.value === activeValue), activeIndex = activeOption ? filteredOptions.indexOf(activeOption) : -1, nextActiveOption = filteredOptions[(activeIndex + 1) % filteredOptionsLen];
296
333
  nextActiveOption && dispatch({
297
334
  type: "root/setActiveValue",
@@ -301,7 +338,8 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
301
338
  return;
302
339
  }
303
340
  if (event_1.key === "ArrowUp") {
304
- if (event_1.preventDefault(), !filteredOptionsLen) return;
341
+ if (event_1.preventDefault(), !filteredOptionsLen)
342
+ return;
305
343
  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];
306
344
  nextActiveOption_0 && dispatch({
307
345
  type: "root/setActiveValue",
@@ -321,35 +359,58 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
321
359
  inputElementRef.current?.focus();
322
360
  return;
323
361
  }
324
- }, [activeValue, filteredOptions, filteredOptionsLen, onQueryChange]), handleInputChange = useCallback((event_2) => {
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) => {
325
366
  const nextQuery = event_2.currentTarget.value;
326
367
  dispatch({
327
368
  type: "input/change",
328
369
  query: nextQuery
329
370
  }), onQueryChange && onQueryChange(nextQuery);
330
- }, [onQueryChange]), dispatchOpen = useCallback(() => {
371
+ }, $[66] = onQueryChange, $[67] = t21) : t21 = $[67];
372
+ const handleInputChange = t21;
373
+ let t22;
374
+ $[68] !== currentOption || $[69] !== renderValue || $[70] !== value ? (t22 = () => {
331
375
  dispatch({
332
376
  type: "root/open",
333
377
  query: value ? renderValue(value, currentOption) : ""
334
378
  });
335
- }, [currentOption, renderValue, value]), handleInputFocus = useCallback((event_3) => {
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) => {
336
383
  focused || (dispatch({
337
384
  type: "input/focus"
338
385
  }), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
339
- }, [focused, onFocus, openOnFocus, dispatchOpen]), handlePopoverMouseEnter = useCallback(() => {
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 = () => {
340
390
  popoverMouseWithinRef.current = !0;
341
- }, []), handlePopoverMouseLeave = useCallback(() => {
391
+ }, $[77] = t24) : t24 = $[77];
392
+ const handlePopoverMouseEnter = t24;
393
+ let t25;
394
+ $[78] === Symbol.for("react.memo_cache_sentinel") ? (t25 = () => {
342
395
  popoverMouseWithinRef.current = !1;
343
- }, []), handleClearButtonClick = useCallback(() => {
396
+ }, $[78] = t25) : t25 = $[78];
397
+ const handlePopoverMouseLeave = t25;
398
+ let t26;
399
+ $[79] !== onChange || $[80] !== onQueryChange ? (t26 = () => {
344
400
  dispatch({
345
401
  type: "root/clear"
346
402
  }), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
347
- }, [onChange, onQueryChange]), handleClearButtonFocus = useCallback(() => {
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 = () => {
348
407
  dispatch({
349
408
  type: "input/focus"
350
409
  });
351
- }, []);
352
- useEffect(() => {
410
+ }, $[82] = t27) : t27 = $[82];
411
+ const handleClearButtonFocus = t27;
412
+ let t28, t29;
413
+ $[83] !== valueProp ? (t28 = () => {
353
414
  if (valueProp !== valuePropRef.current) {
354
415
  valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
355
416
  type: "value/change",
@@ -361,14 +422,19 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
361
422
  type: "value/change",
362
423
  value: valueProp || null
363
424
  }));
364
- }, [valueProp]), useEffect(() => {
425
+ }, t29 = [valueProp], $[83] = valueProp, $[84] = t28, $[85] = t29) : (t28 = $[84], t29 = $[85]), useEffect(t28, t29);
426
+ let t30, t31;
427
+ $[86] !== focused ? (t30 = () => {
365
428
  !focused && valueRef.current && dispatch({
366
429
  type: "root/setActiveValue",
367
430
  value: valueRef.current
368
431
  });
369
- }, [focused]), useEffect(() => {
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 = () => {
370
435
  const listElement = listBoxElementRef.current;
371
- if (!listElement) return;
436
+ if (!listElement)
437
+ return;
372
438
  const activeOption_1 = filteredOptions.find((o_2) => o_2.value === activeValue);
373
439
  if (activeOption_1) {
374
440
  const activeIndex_1 = filteredOptions.indexOf(activeOption_1), activeItemElement = listElement.childNodes[activeIndex_1];
@@ -378,38 +444,128 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
378
444
  focusFirstDescendant(activeItemElement);
379
445
  }
380
446
  }
381
- }, [activeValue, filteredOptions]);
382
- const clearButton = useMemo(() => {
383
- if (!loading && !disabled && value)
384
- return {
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 = {
385
453
  "aria-label": "Clear",
386
454
  onFocus: handleClearButtonFocus
387
- };
388
- }, [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) => {
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) => {
389
469
  dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
390
- }, [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]), input = /* @__PURE__ */ jsx(TextInput, { ...restProps, "aria-activedescendant": activeItemId, "aria-autocomplete": "list", "aria-expanded": expanded, "aria-owns": listBoxId, autoCapitalize: "off", autoComplete: "off", autoCorrect: "off", border, clearButton, customValidity, disabled, fontSize, icon, iconRight: loading && AnimatedSpinnerIcon, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: inputElementRef, role: "combobox", spellCheck: !1, suffix: suffix || openButtonNode, value: inputValue }), handleListBoxKeyDown = useCallback((event_5) => {
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) => {
391
491
  event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
392
- }, [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) => {
393
- const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
394
- return /* @__PURE__ */ jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: cloneElement(renderOption(option_0), {
395
- disabled: loading,
396
- selected: active,
397
- tabIndex: listFocused && active ? 0 : -1
398
- }) }, option_0.value);
399
- }) }) }), [activeValue, currentOption, filteredOptions, handleOptionSelect, handleListBoxKeyDown, id, listBox, listBoxId, listFocused, loading, renderOption]), results = useMemo(() => renderPopover ? renderPopover({
400
- content: content2,
401
- hidden: !expanded,
402
- inputElement: inputElementRef.current,
403
- onMouseEnter: handlePopoverMouseEnter,
404
- onMouseLeave: handlePopoverMouseLeave
405
- }, resultsPopoverElementRef) : filteredOptionsLen === 0 ? null : /* @__PURE__ */ jsx(Popover, { arrow: !1, constrainSize: !0, content: content2, fallbackPlacements: AUTOCOMPLETE_POPOVER_FALLBACK_PLACEMENTS, matchReferenceWidth: !0, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, open: expanded, overflow: "auto", placement: AUTOCOMPLETE_POPOVER_PLACEMENT, portal: !0, radius, ref: resultsPopoverElementRef, referenceElement: inputElementRef.current, ...popover }), [content2, expanded, filteredOptionsLen, handlePopoverMouseEnter, handlePopoverMouseLeave, popover, radius, renderPopover]);
406
- return /* @__PURE__ */ jsxs(StyledAutocomplete, { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
407
- input,
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,
408
540
  results
409
- ] });
541
+ ] }), $[174] = handleRootBlur, $[175] = handleRootKeyDown, $[176] = results, $[177] = t45, $[178] = t46) : t46 = $[178], t46;
410
542
  });
543
+ function RenderPopover({
544
+ renderPopover,
545
+ content: content2,
546
+ hidden,
547
+ inputElement,
548
+ onMouseEnter,
549
+ onMouseLeave,
550
+ resultsPopoverElementRef
551
+ }) {
552
+ return renderPopover({
553
+ content: content2,
554
+ hidden,
555
+ inputElement,
556
+ onMouseEnter,
557
+ onMouseLeave
558
+ }, resultsPopoverElementRef);
559
+ }
411
560
  InnerAutocomplete.displayName = "ForwardRef(Autocomplete)";
412
- const Autocomplete = InnerAutocomplete, StyledBreadcrumbs = styled.ol.withConfig({
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({
413
569
  displayName: "StyledBreadcrumbs",
414
570
  componentId: "sc-1es8h8q-0"
415
571
  })`margin:0;padding:0;display:flex;list-style:none;align-items:center;white-space:nowrap;line-height:0;`, ExpandButton = styled(Button).withConfig({
@@ -1538,61 +1694,115 @@ const TreeGroup = memo(function(props) {
1538
1694
  displayName: "ToggleArrowText",
1539
1695
  componentId: "sc-iiskig-2"
1540
1696
  })`& > svg{transition:transform 100ms;}`, TreeItem = memo(function(props) {
1541
- const {
1697
+ const $ = c(112);
1698
+ let IconComponent, children, href, idProp, linkAs, muted, onClick, restProps, t0, t1, t2, t3, t4, text, weight;
1699
+ $[0] !== props ? ({
1542
1700
  children,
1543
- expanded: expandedProp = !1,
1544
- fontSize = 1,
1701
+ expanded: t0,
1702
+ fontSize: t1,
1545
1703
  href,
1546
1704
  icon: IconComponent,
1547
1705
  id: idProp,
1548
1706
  linkAs,
1549
1707
  muted,
1550
1708
  onClick,
1551
- padding = 2,
1552
- selected = !1,
1553
- space = 2,
1709
+ padding: t2,
1710
+ selected: t3,
1711
+ space: t4,
1554
1712
  text,
1555
1713
  weight,
1556
1714
  ...restProps
1557
- } = props, rootRef = useRef(null), treeitemRef = useRef(null), tree = useTree(), {
1715
+ } = props, $[0] = props, $[1] = IconComponent, $[2] = children, $[3] = href, $[4] = idProp, $[5] = linkAs, $[6] = muted, $[7] = onClick, $[8] = restProps, $[9] = t0, $[10] = t1, $[11] = t2, $[12] = t3, $[13] = t4, $[14] = text, $[15] = weight) : (IconComponent = $[1], children = $[2], href = $[3], idProp = $[4], linkAs = $[5], muted = $[6], onClick = $[7], restProps = $[8], t0 = $[9], t1 = $[10], t2 = $[11], t3 = $[12], t4 = $[13], text = $[14], weight = $[15]);
1716
+ const expandedProp = t0 === void 0 ? !1 : t0, fontSize = t1 === void 0 ? 1 : t1, padding = t2 === void 0 ? 2 : t2, selected = t3 === void 0 ? !1 : t3, space = t4 === void 0 ? 2 : t4, [rootElement, setRootElement] = useState(null), treeitemRef = useRef(null), tree = useTree(), {
1558
1717
  path,
1559
1718
  registerItem,
1560
1719
  setExpanded,
1561
1720
  setFocusedElement
1562
- } = tree, _id = useId(), id = idProp || _id, itemPath = useMemo(() => path.concat([id || ""]), [id, path]), itemKey = itemPath.join("/"), itemState = tree.state[itemKey], focused = tree.focusedElement === rootRef.current, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootRef.current ? 0 : -1, contextValue = useMemo(() => ({
1721
+ } = tree, _id = useId(), id = idProp || _id;
1722
+ let t5, t6;
1723
+ if ($[16] !== id || $[17] !== path) {
1724
+ const itemPath = path.concat([id || ""]);
1725
+ t5 = itemPath, t6 = itemPath.join("/"), $[16] = id, $[17] = path, $[18] = t5, $[19] = t6;
1726
+ } else
1727
+ t5 = $[18], t6 = $[19];
1728
+ let t7;
1729
+ $[20] !== t5 || $[21] !== t6 ? (t7 = [t5, t6], $[20] = t5, $[21] = t6, $[22] = t7) : t7 = $[22];
1730
+ const [itemPath_0, itemKey] = t7, itemState = tree.state[itemKey], focused = tree.focusedElement === rootElement, expanded = itemState?.expanded === void 0 ? expandedProp : itemState?.expanded || !1, tabIndex = tree.focusedElement && tree.focusedElement === rootElement ? 0 : -1, t8 = tree.level + 1;
1731
+ let t9;
1732
+ $[23] !== itemPath_0 || $[24] !== t8 || $[25] !== tree ? (t9 = {
1563
1733
  ...tree,
1564
- level: tree.level + 1,
1565
- path: itemPath
1566
- }), [itemPath, tree]), handleClick = useCallback((event) => {
1734
+ level: t8,
1735
+ path: itemPath_0
1736
+ }, $[23] = itemPath_0, $[24] = t8, $[25] = tree, $[26] = t9) : t9 = $[26];
1737
+ const contextValue = t9;
1738
+ let t10;
1739
+ $[27] !== expanded || $[28] !== itemKey || $[29] !== onClick || $[30] !== rootElement || $[31] !== setExpanded || $[32] !== setFocusedElement ? (t10 = (event) => {
1567
1740
  onClick && onClick(event);
1568
1741
  const target = event.target;
1569
- target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootRef.current));
1570
- }, [expanded, itemKey, onClick, setExpanded, setFocusedElement]), handleKeyDown = useCallback((event_0) => {
1571
- focused && event_0.key === "Enter" && (treeitemRef.current || rootRef.current)?.click();
1572
- }, [focused]);
1573
- useEffect(() => {
1574
- if (rootRef.current)
1575
- return registerItem(rootRef.current, itemPath.join("/"), expanded, selected);
1576
- }, [expanded, itemPath, registerItem, selected]);
1577
- const content2 = /* @__PURE__ */ jsxs(Flex, { padding, children: [
1578
- /* @__PURE__ */ jsxs(Box, { marginRight: space, style: {
1579
- visibility: IconComponent || children ? "visible" : "hidden",
1580
- pointerEvents: "none"
1581
- }, children: [
1582
- IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(IconComponent, {}) }),
1583
- !IconComponent && /* @__PURE__ */ jsx(ToggleArrowText, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: {
1584
- transform: expanded ? "rotate(90deg)" : void 0
1585
- } }) })
1586
- ] }),
1587
- /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) })
1588
- ] });
1589
- return href ? /* @__PURE__ */ jsxs(StyledTreeItem, { "data-selected": selected ? "" : void 0, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...restProps, onClick: handleClick, ref: rootRef, role: "none", children: [
1590
- /* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, "aria-expanded": expanded, as: linkAs, "data-ui": "TreeItem__box", href, ref: treeitemRef, role: "treeitem", tabIndex, children: content2 }),
1591
- /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }) })
1592
- ] }) : /* @__PURE__ */ jsxs(StyledTreeItem, { "data-selected": selected ? "" : void 0, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...restProps, "aria-expanded": expanded, onClick: handleClick, onKeyDown: handleKeyDown, ref: rootRef, role: "treeitem", tabIndex, children: [
1593
- /* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, as: "div", "data-ui": "TreeItem__box", children: content2 }),
1594
- /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }) })
1595
- ] });
1742
+ target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootElement));
1743
+ }, $[27] = expanded, $[28] = itemKey, $[29] = onClick, $[30] = rootElement, $[31] = setExpanded, $[32] = setFocusedElement, $[33] = t10) : t10 = $[33];
1744
+ const handleClick = t10;
1745
+ let t11;
1746
+ $[34] !== focused || $[35] !== rootElement ? (t11 = (event_0) => {
1747
+ focused && event_0.key === "Enter" && (treeitemRef.current || rootElement)?.click();
1748
+ }, $[34] = focused, $[35] = rootElement, $[36] = t11) : t11 = $[36];
1749
+ const handleKeyDown = t11;
1750
+ let t12, t13;
1751
+ $[37] !== expanded || $[38] !== itemKey || $[39] !== registerItem || $[40] !== rootElement || $[41] !== selected ? (t12 = () => {
1752
+ if (rootElement)
1753
+ return registerItem(rootElement, itemKey, expanded, selected);
1754
+ }, t13 = [expanded, itemKey, registerItem, rootElement, selected], $[37] = expanded, $[38] = itemKey, $[39] = registerItem, $[40] = rootElement, $[41] = selected, $[42] = t12, $[43] = t13) : (t12 = $[42], t13 = $[43]), useEffect(t12, t13);
1755
+ const t14 = IconComponent || children ? "visible" : "hidden";
1756
+ let t15;
1757
+ $[44] !== t14 ? (t15 = {
1758
+ visibility: t14,
1759
+ pointerEvents: "none"
1760
+ }, $[44] = t14, $[45] = t15) : t15 = $[45];
1761
+ let t16;
1762
+ $[46] !== IconComponent || $[47] !== fontSize || $[48] !== muted || $[49] !== weight ? (t16 = IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(IconComponent, {}) }), $[46] = IconComponent, $[47] = fontSize, $[48] = muted, $[49] = weight, $[50] = t16) : t16 = $[50];
1763
+ let t17;
1764
+ $[51] !== IconComponent || $[52] !== expanded || $[53] !== fontSize || $[54] !== muted || $[55] !== weight ? (t17 = !IconComponent && /* @__PURE__ */ jsx(ToggleArrowText, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: {
1765
+ transform: expanded ? "rotate(90deg)" : void 0
1766
+ } }) }), $[51] = IconComponent, $[52] = expanded, $[53] = fontSize, $[54] = muted, $[55] = weight, $[56] = t17) : t17 = $[56];
1767
+ let t18;
1768
+ $[57] !== space || $[58] !== t15 || $[59] !== t16 || $[60] !== t17 ? (t18 = /* @__PURE__ */ jsxs(Box, { marginRight: space, style: t15, children: [
1769
+ t16,
1770
+ t17
1771
+ ] }), $[57] = space, $[58] = t15, $[59] = t16, $[60] = t17, $[61] = t18) : t18 = $[61];
1772
+ let t19;
1773
+ $[62] !== fontSize || $[63] !== muted || $[64] !== text || $[65] !== weight ? (t19 = /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) }), $[62] = fontSize, $[63] = muted, $[64] = text, $[65] = weight, $[66] = t19) : t19 = $[66];
1774
+ let t20;
1775
+ $[67] !== padding || $[68] !== t18 || $[69] !== t19 ? (t20 = /* @__PURE__ */ jsxs(Flex, { padding, children: [
1776
+ t18,
1777
+ t19
1778
+ ] }), $[67] = padding, $[68] = t18, $[69] = t19, $[70] = t20) : t20 = $[70];
1779
+ const content2 = t20;
1780
+ if (href) {
1781
+ const t212 = selected ? "" : void 0;
1782
+ let t222;
1783
+ $[71] !== content2 || $[72] !== expanded || $[73] !== href || $[74] !== linkAs || $[75] !== tabIndex || $[76] !== tree.level ? (t222 = /* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, "aria-expanded": expanded, as: linkAs, "data-ui": "TreeItem__box", href, ref: treeitemRef, role: "treeitem", tabIndex, children: content2 }), $[71] = content2, $[72] = expanded, $[73] = href, $[74] = linkAs, $[75] = tabIndex, $[76] = tree.level, $[77] = t222) : t222 = $[77];
1784
+ let t232;
1785
+ $[78] !== children || $[79] !== expanded ? (t232 = children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }), $[78] = children, $[79] = expanded, $[80] = t232) : t232 = $[80];
1786
+ let t242;
1787
+ $[81] !== contextValue || $[82] !== t232 ? (t242 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t232 }), $[81] = contextValue, $[82] = t232, $[83] = t242) : t242 = $[83];
1788
+ let t252;
1789
+ return $[84] !== handleClick || $[85] !== id || $[86] !== itemKey || $[87] !== restProps || $[88] !== t212 || $[89] !== t222 || $[90] !== t242 ? (t252 = /* @__PURE__ */ jsxs(StyledTreeItem, { "data-selected": t212, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...restProps, onClick: handleClick, ref: setRootElement, role: "none", children: [
1790
+ t222,
1791
+ t242
1792
+ ] }), $[84] = handleClick, $[85] = id, $[86] = itemKey, $[87] = restProps, $[88] = t212, $[89] = t222, $[90] = t242, $[91] = t252) : t252 = $[91], t252;
1793
+ }
1794
+ const t21 = selected ? "" : void 0;
1795
+ let t22;
1796
+ $[92] !== content2 || $[93] !== tree.level ? (t22 = /* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, as: "div", "data-ui": "TreeItem__box", children: content2 }), $[92] = content2, $[93] = tree.level, $[94] = t22) : t22 = $[94];
1797
+ let t23;
1798
+ $[95] !== children || $[96] !== expanded ? (t23 = children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }), $[95] = children, $[96] = expanded, $[97] = t23) : t23 = $[97];
1799
+ let t24;
1800
+ $[98] !== contextValue || $[99] !== t23 ? (t24 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t23 }), $[98] = contextValue, $[99] = t23, $[100] = t24) : t24 = $[100];
1801
+ let t25;
1802
+ return $[101] !== expanded || $[102] !== handleClick || $[103] !== handleKeyDown || $[104] !== id || $[105] !== itemKey || $[106] !== restProps || $[107] !== t21 || $[108] !== t22 || $[109] !== t24 || $[110] !== tabIndex ? (t25 = /* @__PURE__ */ jsxs(StyledTreeItem, { "data-selected": t21, "data-ui": "TreeItem", "data-tree-id": id, "data-tree-key": itemKey, ...restProps, "aria-expanded": expanded, onClick: handleClick, onKeyDown: handleKeyDown, ref: setRootElement, role: "treeitem", tabIndex, children: [
1803
+ t22,
1804
+ t24
1805
+ ] }), $[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;
1596
1806
  });
1597
1807
  TreeItem.displayName = "Memo(TreeItem)";
1598
1808
  export {