@sanity/ui 3.1.2 → 3.1.4
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.js +185 -175
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +186 -176
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
- package/src/core/components/autocomplete/autocomplete.tsx +11 -1
- package/src/core/components/tree/treeItem.tsx +12 -2
package/dist/index.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { Arrow, Avatar, AvatarCounter, AvatarStack, Badge, BoundaryElementProvid
|
|
|
3
3
|
import { jsx, jsxs, Fragment as Fragment$1 } from "react/jsx-runtime";
|
|
4
4
|
import { c } from "react-compiler-runtime";
|
|
5
5
|
import { SpinnerIcon, ChevronDownIcon, CloseIcon, ToggleArrowRightIcon } from "@sanity/icons";
|
|
6
|
-
import { useState, useRef, useEffect, useImperativeHandle, Component, forwardRef, useReducer, cloneElement, Children, isValidElement, Fragment, useContext, useSyncExternalStore,
|
|
6
|
+
import { useState, useRef, useEffect, useImperativeHandle, Component, forwardRef, useReducer, startTransition, cloneElement, Children, isValidElement, Fragment, useContext, useSyncExternalStore, useId } from "react";
|
|
7
7
|
import { styled, keyframes, css } from "styled-components";
|
|
8
8
|
import { getTheme_v2 } from "@sanity/ui/theme";
|
|
9
9
|
import { motion, AnimatePresence } from "framer-motion";
|
|
@@ -220,7 +220,7 @@ function autocompleteReducer(state, msg) {
|
|
|
220
220
|
} : state;
|
|
221
221
|
}
|
|
222
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) {
|
|
223
|
-
const $ = c(
|
|
223
|
+
const $ = c(181);
|
|
224
224
|
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;
|
|
225
225
|
$[0] !== props ? ({
|
|
226
226
|
border: t0,
|
|
@@ -276,24 +276,29 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
276
276
|
} = t112;
|
|
277
277
|
return /* @__PURE__ */ jsx(Card, { "data-as": "button", padding: paddingProp, radius: 2, tone: "inherit", children: /* @__PURE__ */ jsx(Text, { size: fontSize, textOverflow: "ellipsis", children: value_0 }) });
|
|
278
278
|
}, $[33] = fontSize, $[34] = paddingProp, $[35] = t10) : t10 = $[35];
|
|
279
|
-
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,
|
|
280
|
-
let t11
|
|
281
|
-
$[36]
|
|
282
|
-
|
|
283
|
-
|
|
279
|
+
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);
|
|
280
|
+
let t11;
|
|
281
|
+
$[36] === Symbol.for("react.memo_cache_sentinel") ? (t11 = (node) => {
|
|
282
|
+
startTransition(() => _setInputElement(node));
|
|
283
|
+
}, $[36] = t11) : t11 = $[36];
|
|
284
|
+
const setInputElement = t11, listFocusedRef = useRef(!1), valueRef = useRef(value), valuePropRef = useRef(valueProp), popoverMouseWithinRef = useRef(!1);
|
|
285
|
+
let t12, t13;
|
|
286
|
+
$[37] !== inputElement ? (t12 = () => inputElement, t13 = [inputElement], $[37] = inputElement, $[38] = t12, $[39] = t13) : (t12 = $[38], t13 = $[39]), useImperativeHandle(inputElementRef, t12, t13);
|
|
287
|
+
let t14, t15;
|
|
288
|
+
$[40] !== inputElement ? (t14 = () => inputElement, t15 = [inputElement], $[40] = inputElement, $[41] = t14, $[42] = t15) : (t14 = $[41], t15 = $[42]), useImperativeHandle(forwardedRef, t14, t15);
|
|
284
289
|
const listBoxId = `${id}-listbox`, options = Array.isArray(optionsProp) ? optionsProp : EMPTY_ARRAY, padding = _getArrayProp(paddingProp);
|
|
285
|
-
let t15;
|
|
286
|
-
$[42] !== options || $[43] !== value ? (t15 = value !== null ? options.find((o) => o.value === value) : void 0, $[42] = options, $[43] = value, $[44] = t15) : t15 = $[44];
|
|
287
|
-
const currentOption = t15;
|
|
288
290
|
let t16;
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
$[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;
|
|
292
|
-
} else
|
|
293
|
-
t16 = $[48];
|
|
294
|
-
const filteredOptions = t16, filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null;
|
|
291
|
+
$[43] !== options || $[44] !== value ? (t16 = value !== null ? options.find((o) => o.value === value) : void 0, $[43] = options, $[44] = value, $[45] = t16) : t16 = $[45];
|
|
292
|
+
const currentOption = t16;
|
|
295
293
|
let t17;
|
|
296
|
-
$[
|
|
294
|
+
if ($[46] !== filterOption || $[47] !== options || $[48] !== query) {
|
|
295
|
+
let t182;
|
|
296
|
+
$[50] !== filterOption || $[51] !== query ? (t182 = (option) => query ? filterOption(query, option) : !0, $[50] = filterOption, $[51] = query, $[52] = t182) : t182 = $[52], t17 = options.filter(t182), $[46] = filterOption, $[47] = options, $[48] = query, $[49] = t17;
|
|
297
|
+
} else
|
|
298
|
+
t17 = $[49];
|
|
299
|
+
const filteredOptions = t17, filteredOptionsLen = filteredOptions.length, activeItemId = activeValue ? `${id}-option-${activeValue}` : void 0, expanded = query !== null && loading || focused && query !== null;
|
|
300
|
+
let t18;
|
|
301
|
+
$[53] !== onBlur || $[54] !== onQueryChange || $[55] !== relatedElements ? (t18 = (event) => {
|
|
297
302
|
setTimeout(() => {
|
|
298
303
|
if (popoverMouseWithinRef.current)
|
|
299
304
|
return;
|
|
@@ -310,27 +315,27 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
310
315
|
type: "root/blur"
|
|
311
316
|
}), popoverMouseWithinRef.current = !1, onQueryChange && onQueryChange(null), onBlur && onBlur(event));
|
|
312
317
|
}, 0);
|
|
313
|
-
}, $[
|
|
314
|
-
const handleRootBlur =
|
|
315
|
-
let
|
|
316
|
-
$[
|
|
318
|
+
}, $[53] = onBlur, $[54] = onQueryChange, $[55] = relatedElements, $[56] = t18) : t18 = $[56];
|
|
319
|
+
const handleRootBlur = t18;
|
|
320
|
+
let t19;
|
|
321
|
+
$[57] === Symbol.for("react.memo_cache_sentinel") ? (t19 = (event_0) => {
|
|
317
322
|
const listBoxElement = listBoxElementRef.current, focusedElement = event_0.target instanceof HTMLElement ? event_0.target : null, listFocused_0 = listBoxElement?.contains(focusedElement) || !1;
|
|
318
323
|
listFocused_0 !== listFocusedRef.current && (listFocusedRef.current = listFocused_0, dispatch({
|
|
319
324
|
type: "root/setListFocused",
|
|
320
325
|
listFocused: listFocused_0
|
|
321
326
|
}));
|
|
322
|
-
}, $[
|
|
323
|
-
const handleRootFocus =
|
|
324
|
-
let
|
|
325
|
-
$[
|
|
327
|
+
}, $[57] = t19) : t19 = $[57];
|
|
328
|
+
const handleRootFocus = t19;
|
|
329
|
+
let t20;
|
|
330
|
+
$[58] !== onChange || $[59] !== onQueryChange || $[60] !== onSelect ? (t20 = (v) => {
|
|
326
331
|
dispatch({
|
|
327
332
|
type: "value/change",
|
|
328
333
|
value: v
|
|
329
334
|
}), popoverMouseWithinRef.current = !1, onSelect && onSelect(v), valueRef.current = v, onChange && onChange(v), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
330
|
-
}, $[
|
|
331
|
-
const handleOptionSelect =
|
|
332
|
-
let
|
|
333
|
-
$[
|
|
335
|
+
}, $[58] = onChange, $[59] = onQueryChange, $[60] = onSelect, $[61] = t20) : t20 = $[61];
|
|
336
|
+
const handleOptionSelect = t20;
|
|
337
|
+
let t21;
|
|
338
|
+
$[62] !== activeValue || $[63] !== filteredOptions || $[64] !== filteredOptionsLen || $[65] !== onQueryChange ? (t21 = (event_1) => {
|
|
334
339
|
if (event_1.key === "ArrowDown") {
|
|
335
340
|
if (event_1.preventDefault(), !filteredOptionsLen)
|
|
336
341
|
return;
|
|
@@ -364,58 +369,58 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
364
369
|
inputElementRef.current?.focus();
|
|
365
370
|
return;
|
|
366
371
|
}
|
|
367
|
-
}, $[
|
|
368
|
-
const handleRootKeyDown =
|
|
369
|
-
let
|
|
370
|
-
$[
|
|
372
|
+
}, $[62] = activeValue, $[63] = filteredOptions, $[64] = filteredOptionsLen, $[65] = onQueryChange, $[66] = t21) : t21 = $[66];
|
|
373
|
+
const handleRootKeyDown = t21;
|
|
374
|
+
let t22;
|
|
375
|
+
$[67] !== onQueryChange ? (t22 = (event_2) => {
|
|
371
376
|
const nextQuery = event_2.currentTarget.value;
|
|
372
377
|
dispatch({
|
|
373
378
|
type: "input/change",
|
|
374
379
|
query: nextQuery
|
|
375
380
|
}), onQueryChange && onQueryChange(nextQuery);
|
|
376
|
-
}, $[
|
|
377
|
-
const handleInputChange =
|
|
378
|
-
let
|
|
379
|
-
$[
|
|
381
|
+
}, $[67] = onQueryChange, $[68] = t22) : t22 = $[68];
|
|
382
|
+
const handleInputChange = t22;
|
|
383
|
+
let t23;
|
|
384
|
+
$[69] !== currentOption || $[70] !== renderValue || $[71] !== value ? (t23 = () => {
|
|
380
385
|
dispatch({
|
|
381
386
|
type: "root/open",
|
|
382
387
|
query: value ? renderValue(value, currentOption) : ""
|
|
383
388
|
});
|
|
384
|
-
}, $[
|
|
385
|
-
const dispatchOpen =
|
|
386
|
-
let
|
|
387
|
-
$[
|
|
389
|
+
}, $[69] = currentOption, $[70] = renderValue, $[71] = value, $[72] = t23) : t23 = $[72];
|
|
390
|
+
const dispatchOpen = t23;
|
|
391
|
+
let t24;
|
|
392
|
+
$[73] !== dispatchOpen || $[74] !== focused || $[75] !== onFocus || $[76] !== openOnFocus ? (t24 = (event_3) => {
|
|
388
393
|
focused || (dispatch({
|
|
389
394
|
type: "input/focus"
|
|
390
395
|
}), onFocus && onFocus(event_3), openOnFocus && dispatchOpen());
|
|
391
|
-
}, $[
|
|
392
|
-
const handleInputFocus =
|
|
393
|
-
let t24;
|
|
394
|
-
$[77] === Symbol.for("react.memo_cache_sentinel") ? (t24 = () => {
|
|
395
|
-
popoverMouseWithinRef.current = !0;
|
|
396
|
-
}, $[77] = t24) : t24 = $[77];
|
|
397
|
-
const handlePopoverMouseEnter = t24;
|
|
396
|
+
}, $[73] = dispatchOpen, $[74] = focused, $[75] = onFocus, $[76] = openOnFocus, $[77] = t24) : t24 = $[77];
|
|
397
|
+
const handleInputFocus = t24;
|
|
398
398
|
let t25;
|
|
399
399
|
$[78] === Symbol.for("react.memo_cache_sentinel") ? (t25 = () => {
|
|
400
|
-
popoverMouseWithinRef.current = !
|
|
400
|
+
popoverMouseWithinRef.current = !0;
|
|
401
401
|
}, $[78] = t25) : t25 = $[78];
|
|
402
|
-
const
|
|
402
|
+
const handlePopoverMouseEnter = t25;
|
|
403
403
|
let t26;
|
|
404
|
-
$[79]
|
|
404
|
+
$[79] === Symbol.for("react.memo_cache_sentinel") ? (t26 = () => {
|
|
405
|
+
popoverMouseWithinRef.current = !1;
|
|
406
|
+
}, $[79] = t26) : t26 = $[79];
|
|
407
|
+
const handlePopoverMouseLeave = t26;
|
|
408
|
+
let t27;
|
|
409
|
+
$[80] !== onChange || $[81] !== onQueryChange ? (t27 = () => {
|
|
405
410
|
dispatch({
|
|
406
411
|
type: "root/clear"
|
|
407
412
|
}), valueRef.current = "", onChange && onChange(""), onQueryChange && onQueryChange(null), inputElementRef.current?.focus();
|
|
408
|
-
}, $[
|
|
409
|
-
const handleClearButtonClick =
|
|
410
|
-
let
|
|
411
|
-
$[
|
|
413
|
+
}, $[80] = onChange, $[81] = onQueryChange, $[82] = t27) : t27 = $[82];
|
|
414
|
+
const handleClearButtonClick = t27;
|
|
415
|
+
let t28;
|
|
416
|
+
$[83] === Symbol.for("react.memo_cache_sentinel") ? (t28 = () => {
|
|
412
417
|
dispatch({
|
|
413
418
|
type: "input/focus"
|
|
414
419
|
});
|
|
415
|
-
}, $[
|
|
416
|
-
const handleClearButtonFocus =
|
|
417
|
-
let
|
|
418
|
-
$[
|
|
420
|
+
}, $[83] = t28) : t28 = $[83];
|
|
421
|
+
const handleClearButtonFocus = t28;
|
|
422
|
+
let t29, t30;
|
|
423
|
+
$[84] !== valueProp ? (t29 = () => {
|
|
419
424
|
if (valueProp !== valuePropRef.current) {
|
|
420
425
|
valuePropRef.current = valueProp, valueProp !== void 0 && (dispatch({
|
|
421
426
|
type: "value/change",
|
|
@@ -427,16 +432,16 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
427
432
|
type: "value/change",
|
|
428
433
|
value: valueProp || null
|
|
429
434
|
}));
|
|
430
|
-
},
|
|
431
|
-
let
|
|
432
|
-
$[
|
|
435
|
+
}, t30 = [valueProp], $[84] = valueProp, $[85] = t29, $[86] = t30) : (t29 = $[85], t30 = $[86]), useEffect(t29, t30);
|
|
436
|
+
let t31, t32;
|
|
437
|
+
$[87] !== focused ? (t31 = () => {
|
|
433
438
|
!focused && valueRef.current && dispatch({
|
|
434
439
|
type: "root/setActiveValue",
|
|
435
440
|
value: valueRef.current
|
|
436
441
|
});
|
|
437
|
-
},
|
|
438
|
-
let
|
|
439
|
-
$[
|
|
442
|
+
}, t32 = [focused], $[87] = focused, $[88] = t31, $[89] = t32) : (t31 = $[88], t32 = $[89]), useEffect(t31, t32);
|
|
443
|
+
let t33, t34;
|
|
444
|
+
$[90] !== activeValue || $[91] !== filteredOptions ? (t33 = () => {
|
|
440
445
|
const listElement = listBoxElementRef.current;
|
|
441
446
|
if (!listElement)
|
|
442
447
|
return;
|
|
@@ -449,95 +454,95 @@ const AUTOCOMPLETE_LISTBOX_IGNORE_KEYS = ["Control", "Shift", "Alt", "Enter", "H
|
|
|
449
454
|
focusFirstDescendant(activeItemElement);
|
|
450
455
|
}
|
|
451
456
|
}
|
|
452
|
-
},
|
|
453
|
-
let
|
|
457
|
+
}, t34 = [activeValue, filteredOptions], $[90] = activeValue, $[91] = filteredOptions, $[92] = t33, $[93] = t34) : (t33 = $[92], t34 = $[93]), useEffect(t33, t34);
|
|
458
|
+
let t35;
|
|
454
459
|
bb0: {
|
|
455
460
|
if (!loading && !disabled && value) {
|
|
456
|
-
let
|
|
457
|
-
$[
|
|
461
|
+
let t362;
|
|
462
|
+
$[94] === Symbol.for("react.memo_cache_sentinel") ? (t362 = {
|
|
458
463
|
"aria-label": "Clear",
|
|
459
464
|
onFocus: handleClearButtonFocus
|
|
460
|
-
}, $[
|
|
465
|
+
}, $[94] = t362) : t362 = $[94], t35 = t362;
|
|
461
466
|
break bb0;
|
|
462
467
|
}
|
|
463
|
-
|
|
468
|
+
t35 = void 0;
|
|
464
469
|
}
|
|
465
|
-
const clearButton =
|
|
466
|
-
let t35;
|
|
467
|
-
$[94] !== dispatchOpen || $[95] !== openButtonProps ? (t35 = (event_4) => {
|
|
468
|
-
dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
|
|
469
|
-
}, $[94] = dispatchOpen, $[95] = openButtonProps, $[96] = t35) : t35 = $[96];
|
|
470
|
-
const handleOpenClick = t35;
|
|
470
|
+
const clearButton = t35, openButtonBoxPadding = padding.map(_temp$3), openButtonPadding = padding.map(_temp2$1), openButtonProps = typeof openButton == "object" ? openButton : EMPTY_RECORD;
|
|
471
471
|
let t36;
|
|
472
|
-
$[
|
|
473
|
-
|
|
472
|
+
$[95] !== dispatchOpen || $[96] !== openButtonProps ? (t36 = (event_4) => {
|
|
473
|
+
dispatchOpen(), openButtonProps.onClick && openButtonProps.onClick(event_4), _raf(() => inputElementRef.current?.focus());
|
|
474
|
+
}, $[95] = dispatchOpen, $[96] = openButtonProps, $[97] = t36) : t36 = $[97];
|
|
475
|
+
const handleOpenClick = t36;
|
|
474
476
|
let t37;
|
|
477
|
+
$[98] !== disabled || $[99] !== expanded || $[100] !== fontSize || $[101] !== handleOpenClick || $[102] !== openButton || $[103] !== openButtonBoxPadding || $[104] !== openButtonPadding || $[105] !== openButtonProps || $[106] !== readOnly ? (t37 = !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, $[98] = disabled, $[99] = expanded, $[100] = fontSize, $[101] = handleOpenClick, $[102] = openButton, $[103] = openButtonBoxPadding, $[104] = openButtonPadding, $[105] = openButtonProps, $[106] = readOnly, $[107] = t37) : t37 = $[107];
|
|
478
|
+
const openButtonNode = t37;
|
|
479
|
+
let t38;
|
|
475
480
|
bb1: {
|
|
476
481
|
if (query === null) {
|
|
477
482
|
if (value !== null) {
|
|
478
|
-
let
|
|
479
|
-
$[
|
|
483
|
+
let t392;
|
|
484
|
+
$[108] !== currentOption || $[109] !== renderValue || $[110] !== value ? (t392 = renderValue(value, currentOption), $[108] = currentOption, $[109] = renderValue, $[110] = value, $[111] = t392) : t392 = $[111], t38 = t392;
|
|
480
485
|
break bb1;
|
|
481
486
|
}
|
|
482
|
-
|
|
487
|
+
t38 = "";
|
|
483
488
|
break bb1;
|
|
484
489
|
}
|
|
485
|
-
|
|
490
|
+
t38 = query;
|
|
486
491
|
}
|
|
487
|
-
const inputValue =
|
|
488
|
-
let t38;
|
|
489
|
-
$[111] !== listFocused ? (t38 = (event_5) => {
|
|
490
|
-
event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
|
|
491
|
-
}, $[111] = listFocused, $[112] = t38) : t38 = $[112];
|
|
492
|
-
const handleListBoxKeyDown = t38;
|
|
492
|
+
const inputValue = t38;
|
|
493
493
|
let t39;
|
|
494
|
+
$[112] !== listFocused ? (t39 = (event_5) => {
|
|
495
|
+
event_5.key === "Tab" && listFocused && inputElementRef.current?.focus();
|
|
496
|
+
}, $[112] = listFocused, $[113] = t39) : t39 = $[113];
|
|
497
|
+
const handleListBoxKeyDown = t39;
|
|
498
|
+
let t40;
|
|
494
499
|
bb2: {
|
|
495
500
|
if (filteredOptions.length === 0) {
|
|
496
|
-
|
|
501
|
+
t40 = null;
|
|
497
502
|
break bb2;
|
|
498
503
|
}
|
|
499
|
-
let
|
|
500
|
-
if ($[
|
|
501
|
-
let
|
|
502
|
-
$[
|
|
504
|
+
let t412;
|
|
505
|
+
if ($[114] !== activeValue || $[115] !== currentOption || $[116] !== filteredOptions || $[117] !== handleOptionSelect || $[118] !== id || $[119] !== listFocused || $[120] !== loading || $[121] !== renderOption) {
|
|
506
|
+
let t423;
|
|
507
|
+
$[123] !== activeValue || $[124] !== currentOption || $[125] !== handleOptionSelect || $[126] !== id || $[127] !== listFocused || $[128] !== loading || $[129] !== renderOption ? (t423 = (option_0) => {
|
|
503
508
|
const active = activeValue !== null ? option_0.value === activeValue : currentOption === option_0;
|
|
504
509
|
return /* @__PURE__ */ jsx(AutocompleteOption, { id: `${id}-option-${option_0.value}`, onSelect: handleOptionSelect, selected: active, value: option_0.value, children: cloneElement(renderOption(option_0), {
|
|
505
510
|
disabled: loading,
|
|
506
511
|
selected: active,
|
|
507
512
|
tabIndex: listFocused && active ? 0 : -1
|
|
508
513
|
}) }, option_0.value);
|
|
509
|
-
}, $[
|
|
514
|
+
}, $[123] = activeValue, $[124] = currentOption, $[125] = handleOptionSelect, $[126] = id, $[127] = listFocused, $[128] = loading, $[129] = renderOption, $[130] = t423) : t423 = $[130], t412 = filteredOptions.map(t423), $[114] = activeValue, $[115] = currentOption, $[116] = filteredOptions, $[117] = handleOptionSelect, $[118] = id, $[119] = listFocused, $[120] = loading, $[121] = renderOption, $[122] = t412;
|
|
510
515
|
} else
|
|
511
|
-
|
|
512
|
-
let t412;
|
|
513
|
-
$[130] !== listBoxId || $[131] !== t402 ? (t412 = /* @__PURE__ */ jsx(Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", id: listBoxId, ref: listBoxElementRef, role: "listbox", space: 1, children: t402 }), $[130] = listBoxId, $[131] = t402, $[132] = t412) : t412 = $[132];
|
|
516
|
+
t412 = $[122];
|
|
514
517
|
let t422;
|
|
515
|
-
$[
|
|
518
|
+
$[131] !== listBoxId || $[132] !== t412 ? (t422 = /* @__PURE__ */ jsx(Stack, { as: "ul", "aria-multiselectable": !1, "data-ui": "AutoComplete__resultsList", id: listBoxId, ref: listBoxElementRef, role: "listbox", space: 1, children: t412 }), $[131] = listBoxId, $[132] = t412, $[133] = t422) : t422 = $[133];
|
|
519
|
+
let t432;
|
|
520
|
+
$[134] !== handleListBoxKeyDown || $[135] !== listBox || $[136] !== t422 ? (t432 = /* @__PURE__ */ jsx(ListBox, { "data-ui": "AutoComplete__results", onKeyDown: handleListBoxKeyDown, padding: 1, ...listBox, tabIndex: -1, children: t422 }), $[134] = handleListBoxKeyDown, $[135] = listBox, $[136] = t422, $[137] = t432) : t432 = $[137], t40 = t432;
|
|
516
521
|
}
|
|
517
|
-
const content2 =
|
|
518
|
-
let
|
|
522
|
+
const content2 = t40;
|
|
523
|
+
let t41;
|
|
519
524
|
bb3: {
|
|
520
525
|
if (renderPopover) {
|
|
521
|
-
const
|
|
522
|
-
let
|
|
523
|
-
$[
|
|
526
|
+
const t423 = !expanded;
|
|
527
|
+
let t432;
|
|
528
|
+
$[138] !== content2 || $[139] !== handlePopoverMouseEnter || $[140] !== handlePopoverMouseLeave || $[141] !== inputElement || $[142] !== renderPopover || $[143] !== t423 ? (t432 = /* @__PURE__ */ jsx(RenderPopover, { content: content2, hidden: t423, inputElement, onMouseEnter: handlePopoverMouseEnter, onMouseLeave: handlePopoverMouseLeave, resultsPopoverElementRef, renderPopover }), $[138] = content2, $[139] = handlePopoverMouseEnter, $[140] = handlePopoverMouseLeave, $[141] = inputElement, $[142] = renderPopover, $[143] = t423, $[144] = t432) : t432 = $[144], t41 = t432;
|
|
524
529
|
break bb3;
|
|
525
530
|
}
|
|
526
531
|
if (filteredOptionsLen === 0) {
|
|
527
|
-
|
|
532
|
+
t41 = null;
|
|
528
533
|
break bb3;
|
|
529
534
|
}
|
|
530
|
-
let
|
|
531
|
-
$[
|
|
535
|
+
let t422;
|
|
536
|
+
$[145] !== content2 || $[146] !== expanded || $[147] !== handlePopoverMouseEnter || $[148] !== handlePopoverMouseLeave || $[149] !== inputElement || $[150] !== popover || $[151] !== radius ? (t422 = /* @__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 }), $[145] = content2, $[146] = expanded, $[147] = handlePopoverMouseEnter, $[148] = handlePopoverMouseLeave, $[149] = inputElement, $[150] = popover, $[151] = radius, $[152] = t422) : t422 = $[152], t41 = t422;
|
|
532
537
|
}
|
|
533
|
-
const results =
|
|
534
|
-
let t43;
|
|
535
|
-
$[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] !== t41 || $[172] !== t42 ? (t43 = /* @__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: t41, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: setInputElement, role: "combobox", spellCheck: !1, suffix: t42, 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] = t41, $[172] = t42, $[173] = t43) : t43 = $[173];
|
|
538
|
+
const results = t41, t42 = loading && AnimatedSpinnerIcon, t43 = suffix || openButtonNode;
|
|
536
539
|
let t44;
|
|
537
|
-
|
|
538
|
-
|
|
540
|
+
$[153] !== activeItemId || $[154] !== border || $[155] !== clearButton || $[156] !== customValidity || $[157] !== disabled || $[158] !== expanded || $[159] !== fontSize || $[160] !== handleClearButtonClick || $[161] !== handleInputChange || $[162] !== handleInputFocus || $[163] !== icon || $[164] !== id || $[165] !== inputValue || $[166] !== listBoxId || $[167] !== padding || $[168] !== prefix || $[169] !== radius || $[170] !== readOnly || $[171] !== restProps || $[172] !== t42 || $[173] !== t43 ? (t44 = /* @__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: t42, id, inputMode: "search", onChange: handleInputChange, onClear: handleClearButtonClick, onFocus: handleInputFocus, padding, prefix, radius, readOnly, ref: setInputElement, role: "combobox", spellCheck: !1, suffix: t43, value: inputValue }), $[153] = activeItemId, $[154] = border, $[155] = clearButton, $[156] = customValidity, $[157] = disabled, $[158] = expanded, $[159] = fontSize, $[160] = handleClearButtonClick, $[161] = handleInputChange, $[162] = handleInputFocus, $[163] = icon, $[164] = id, $[165] = inputValue, $[166] = listBoxId, $[167] = padding, $[168] = prefix, $[169] = radius, $[170] = readOnly, $[171] = restProps, $[172] = t42, $[173] = t43, $[174] = t44) : t44 = $[174];
|
|
541
|
+
let t45;
|
|
542
|
+
return $[175] !== handleRootBlur || $[176] !== handleRootFocus || $[177] !== handleRootKeyDown || $[178] !== results || $[179] !== t44 ? (t45 = /* @__PURE__ */ jsxs(StyledAutocomplete, { "data-ui": "Autocomplete", onBlur: handleRootBlur, onFocus: handleRootFocus, onKeyDown: handleRootKeyDown, ref: rootElementRef, children: [
|
|
543
|
+
t44,
|
|
539
544
|
results
|
|
540
|
-
] }), $[
|
|
545
|
+
] }), $[175] = handleRootBlur, $[176] = handleRootFocus, $[177] = handleRootKeyDown, $[178] = results, $[179] = t44, $[180] = t45) : t45 = $[180], t45;
|
|
541
546
|
});
|
|
542
547
|
function RenderPopover({
|
|
543
548
|
renderPopover,
|
|
@@ -1791,7 +1796,7 @@ const StyledTreeItem = /* @__PURE__ */ styled.li.withConfig({
|
|
|
1791
1796
|
componentId: "sc-iiskig-2"
|
|
1792
1797
|
})`& > svg{transition:transform 100ms;}`;
|
|
1793
1798
|
function TreeItem(props) {
|
|
1794
|
-
const $ = c(
|
|
1799
|
+
const $ = c(113);
|
|
1795
1800
|
let IconComponent, children, href, idProp, linkAs, muted, onClick, restProps, t0, t1, t2, t3, t4, text, weight;
|
|
1796
1801
|
$[0] !== props ? ({
|
|
1797
1802
|
children,
|
|
@@ -1810,96 +1815,101 @@ function TreeItem(props) {
|
|
|
1810
1815
|
weight,
|
|
1811
1816
|
...restProps
|
|
1812
1817
|
} = 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]);
|
|
1813
|
-
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,
|
|
1818
|
+
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);
|
|
1819
|
+
let t5;
|
|
1820
|
+
$[16] === Symbol.for("react.memo_cache_sentinel") ? (t5 = (node) => {
|
|
1821
|
+
startTransition(() => _setRootElement(node));
|
|
1822
|
+
}, $[16] = t5) : t5 = $[16];
|
|
1823
|
+
const setRootElement = t5, treeitemRef = useRef(null), tree = useTree(), {
|
|
1814
1824
|
path,
|
|
1815
1825
|
registerItem,
|
|
1816
1826
|
setExpanded,
|
|
1817
1827
|
setFocusedElement
|
|
1818
1828
|
} = tree, _id = useId(), id = idProp || _id;
|
|
1819
|
-
let
|
|
1820
|
-
if ($[
|
|
1829
|
+
let t6, t7;
|
|
1830
|
+
if ($[17] !== id || $[18] !== path) {
|
|
1821
1831
|
const itemPath = path.concat([id || ""]);
|
|
1822
|
-
|
|
1832
|
+
t6 = itemPath, t7 = itemPath.join("/"), $[17] = id, $[18] = path, $[19] = t6, $[20] = t7;
|
|
1823
1833
|
} else
|
|
1824
|
-
|
|
1825
|
-
let
|
|
1826
|
-
$[
|
|
1827
|
-
const [itemPath_0, itemKey] =
|
|
1828
|
-
let
|
|
1829
|
-
$[
|
|
1834
|
+
t6 = $[19], t7 = $[20];
|
|
1835
|
+
let t8;
|
|
1836
|
+
$[21] !== t6 || $[22] !== t7 ? (t8 = [t6, t7], $[21] = t6, $[22] = t7, $[23] = t8) : t8 = $[23];
|
|
1837
|
+
const [itemPath_0, itemKey] = t8, 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, t9 = tree.level + 1;
|
|
1838
|
+
let t10;
|
|
1839
|
+
$[24] !== itemPath_0 || $[25] !== t9 || $[26] !== tree ? (t10 = {
|
|
1830
1840
|
...tree,
|
|
1831
|
-
level:
|
|
1841
|
+
level: t9,
|
|
1832
1842
|
path: itemPath_0
|
|
1833
|
-
}, $[
|
|
1834
|
-
const contextValue =
|
|
1835
|
-
let
|
|
1836
|
-
$[
|
|
1843
|
+
}, $[24] = itemPath_0, $[25] = t9, $[26] = tree, $[27] = t10) : t10 = $[27];
|
|
1844
|
+
const contextValue = t10;
|
|
1845
|
+
let t11;
|
|
1846
|
+
$[28] !== expanded || $[29] !== itemKey || $[30] !== onClick || $[31] !== rootElement || $[32] !== setExpanded || $[33] !== setFocusedElement ? (t11 = (event) => {
|
|
1837
1847
|
onClick && onClick(event);
|
|
1838
1848
|
const target = event.target;
|
|
1839
1849
|
target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootElement));
|
|
1840
|
-
}, $[
|
|
1841
|
-
const handleClick =
|
|
1842
|
-
let
|
|
1843
|
-
$[
|
|
1850
|
+
}, $[28] = expanded, $[29] = itemKey, $[30] = onClick, $[31] = rootElement, $[32] = setExpanded, $[33] = setFocusedElement, $[34] = t11) : t11 = $[34];
|
|
1851
|
+
const handleClick = t11;
|
|
1852
|
+
let t12;
|
|
1853
|
+
$[35] !== focused || $[36] !== rootElement ? (t12 = (event_0) => {
|
|
1844
1854
|
focused && event_0.key === "Enter" && (treeitemRef.current || rootElement)?.click();
|
|
1845
|
-
}, $[
|
|
1846
|
-
const handleKeyDown =
|
|
1847
|
-
let
|
|
1848
|
-
$[
|
|
1855
|
+
}, $[35] = focused, $[36] = rootElement, $[37] = t12) : t12 = $[37];
|
|
1856
|
+
const handleKeyDown = t12;
|
|
1857
|
+
let t13, t14;
|
|
1858
|
+
$[38] !== expanded || $[39] !== itemKey || $[40] !== registerItem || $[41] !== rootElement || $[42] !== selected ? (t13 = () => {
|
|
1849
1859
|
if (rootElement)
|
|
1850
1860
|
return registerItem(rootElement, itemKey, expanded, selected);
|
|
1851
|
-
},
|
|
1852
|
-
const
|
|
1853
|
-
let t15;
|
|
1854
|
-
$[44] !== t14 ? (t15 = {
|
|
1855
|
-
visibility: t14,
|
|
1856
|
-
pointerEvents: "none"
|
|
1857
|
-
}, $[44] = t14, $[45] = t15) : t15 = $[45];
|
|
1861
|
+
}, t14 = [expanded, itemKey, registerItem, rootElement, selected], $[38] = expanded, $[39] = itemKey, $[40] = registerItem, $[41] = rootElement, $[42] = selected, $[43] = t13, $[44] = t14) : (t13 = $[43], t14 = $[44]), useEffect(t13, t14);
|
|
1862
|
+
const t15 = IconComponent || children ? "visible" : "hidden";
|
|
1858
1863
|
let t16;
|
|
1859
|
-
$[
|
|
1864
|
+
$[45] !== t15 ? (t16 = {
|
|
1865
|
+
visibility: t15,
|
|
1866
|
+
pointerEvents: "none"
|
|
1867
|
+
}, $[45] = t15, $[46] = t16) : t16 = $[46];
|
|
1860
1868
|
let t17;
|
|
1861
|
-
$[
|
|
1862
|
-
transform: expanded ? "rotate(90deg)" : void 0
|
|
1863
|
-
} }) }), $[51] = IconComponent, $[52] = expanded, $[53] = fontSize, $[54] = muted, $[55] = weight, $[56] = t17) : t17 = $[56];
|
|
1869
|
+
$[47] !== IconComponent || $[48] !== fontSize || $[49] !== muted || $[50] !== weight ? (t17 = IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(IconComponent, {}) }), $[47] = IconComponent, $[48] = fontSize, $[49] = muted, $[50] = weight, $[51] = t17) : t17 = $[51];
|
|
1864
1870
|
let t18;
|
|
1865
|
-
$[
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
] }), $[57] = space, $[58] = t15, $[59] = t16, $[60] = t17, $[61] = t18) : t18 = $[61];
|
|
1871
|
+
$[52] !== IconComponent || $[53] !== expanded || $[54] !== fontSize || $[55] !== muted || $[56] !== weight ? (t18 = !IconComponent && /* @__PURE__ */ jsx(ToggleArrowText, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: {
|
|
1872
|
+
transform: expanded ? "rotate(90deg)" : void 0
|
|
1873
|
+
} }) }), $[52] = IconComponent, $[53] = expanded, $[54] = fontSize, $[55] = muted, $[56] = weight, $[57] = t18) : t18 = $[57];
|
|
1869
1874
|
let t19;
|
|
1870
|
-
$[
|
|
1875
|
+
$[58] !== space || $[59] !== t16 || $[60] !== t17 || $[61] !== t18 ? (t19 = /* @__PURE__ */ jsxs(Box, { marginRight: space, style: t16, children: [
|
|
1876
|
+
t17,
|
|
1877
|
+
t18
|
|
1878
|
+
] }), $[58] = space, $[59] = t16, $[60] = t17, $[61] = t18, $[62] = t19) : t19 = $[62];
|
|
1871
1879
|
let t20;
|
|
1872
|
-
$[
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1880
|
+
$[63] !== fontSize || $[64] !== muted || $[65] !== text || $[66] !== weight ? (t20 = /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) }), $[63] = fontSize, $[64] = muted, $[65] = text, $[66] = weight, $[67] = t20) : t20 = $[67];
|
|
1881
|
+
let t21;
|
|
1882
|
+
$[68] !== padding || $[69] !== t19 || $[70] !== t20 ? (t21 = /* @__PURE__ */ jsxs(Flex, { padding, children: [
|
|
1883
|
+
t19,
|
|
1884
|
+
t20
|
|
1885
|
+
] }), $[68] = padding, $[69] = t19, $[70] = t20, $[71] = t21) : t21 = $[71];
|
|
1886
|
+
const content2 = t21;
|
|
1877
1887
|
if (href) {
|
|
1878
|
-
const
|
|
1879
|
-
let t222;
|
|
1880
|
-
$[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];
|
|
1888
|
+
const t222 = selected ? "" : void 0;
|
|
1881
1889
|
let t232;
|
|
1882
|
-
$[
|
|
1890
|
+
$[72] !== content2 || $[73] !== expanded || $[74] !== href || $[75] !== linkAs || $[76] !== tabIndex || $[77] !== tree.level ? (t232 = /* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, "aria-expanded": expanded, as: linkAs, "data-ui": "TreeItem__box", href, ref: treeitemRef, role: "treeitem", tabIndex, children: content2 }), $[72] = content2, $[73] = expanded, $[74] = href, $[75] = linkAs, $[76] = tabIndex, $[77] = tree.level, $[78] = t232) : t232 = $[78];
|
|
1883
1891
|
let t242;
|
|
1884
|
-
$[
|
|
1892
|
+
$[79] !== children || $[80] !== expanded ? (t242 = children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }), $[79] = children, $[80] = expanded, $[81] = t242) : t242 = $[81];
|
|
1885
1893
|
let t252;
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1894
|
+
$[82] !== contextValue || $[83] !== t242 ? (t252 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t242 }), $[82] = contextValue, $[83] = t242, $[84] = t252) : t252 = $[84];
|
|
1895
|
+
let t262;
|
|
1896
|
+
return $[85] !== handleClick || $[86] !== id || $[87] !== itemKey || $[88] !== restProps || $[89] !== t222 || $[90] !== t232 || $[91] !== t252 ? (t262 = /* @__PURE__ */ jsxs(StyledTreeItem, { "data-selected": t222, "data-tree-id": id, "data-tree-key": itemKey, "data-ui": "TreeItem", ...restProps, onClick: handleClick, ref: setRootElement, role: "none", children: [
|
|
1897
|
+
t232,
|
|
1898
|
+
t252
|
|
1899
|
+
] }), $[85] = handleClick, $[86] = id, $[87] = itemKey, $[88] = restProps, $[89] = t222, $[90] = t232, $[91] = t252, $[92] = t262) : t262 = $[92], t262;
|
|
1890
1900
|
}
|
|
1891
|
-
const
|
|
1892
|
-
let t22;
|
|
1893
|
-
$[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];
|
|
1901
|
+
const t22 = selected ? "" : void 0;
|
|
1894
1902
|
let t23;
|
|
1895
|
-
$[
|
|
1903
|
+
$[93] !== content2 || $[94] !== tree.level ? (t23 = /* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, as: "div", "data-ui": "TreeItem__box", children: content2 }), $[93] = content2, $[94] = tree.level, $[95] = t23) : t23 = $[95];
|
|
1896
1904
|
let t24;
|
|
1897
|
-
$[
|
|
1905
|
+
$[96] !== children || $[97] !== expanded ? (t24 = children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }), $[96] = children, $[97] = expanded, $[98] = t24) : t24 = $[98];
|
|
1898
1906
|
let t25;
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1907
|
+
$[99] !== contextValue || $[100] !== t24 ? (t25 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t24 }), $[99] = contextValue, $[100] = t24, $[101] = t25) : t25 = $[101];
|
|
1908
|
+
let t26;
|
|
1909
|
+
return $[102] !== expanded || $[103] !== handleClick || $[104] !== handleKeyDown || $[105] !== id || $[106] !== itemKey || $[107] !== restProps || $[108] !== t22 || $[109] !== t23 || $[110] !== t25 || $[111] !== tabIndex ? (t26 = /* @__PURE__ */ jsxs(StyledTreeItem, { "data-selected": t22, "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: [
|
|
1910
|
+
t23,
|
|
1911
|
+
t25
|
|
1912
|
+
] }), $[102] = expanded, $[103] = handleClick, $[104] = handleKeyDown, $[105] = id, $[106] = itemKey, $[107] = restProps, $[108] = t22, $[109] = t23, $[110] = t25, $[111] = tabIndex, $[112] = t26) : t26 = $[112], t26;
|
|
1903
1913
|
}
|
|
1904
1914
|
TreeItem.displayName = "TreeItem";
|
|
1905
1915
|
export {
|