@sanity/ui 3.1.14 → 3.3.0

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 (78) hide show
  1. package/dist/_chunks-cjs/_visual-editing.js +323 -292
  2. package/dist/_chunks-cjs/_visual-editing.js.map +1 -1
  3. package/dist/_chunks-es/_visual-editing.mjs +323 -292
  4. package/dist/_chunks-es/_visual-editing.mjs.map +1 -1
  5. package/dist/_visual-editing.d.mts +195 -76
  6. package/dist/_visual-editing.d.ts +195 -76
  7. package/dist/index.d.mts +308 -140
  8. package/dist/index.d.ts +308 -140
  9. package/dist/index.js +97 -93
  10. package/dist/index.js.map +1 -1
  11. package/dist/index.mjs +97 -93
  12. package/dist/index.mjs.map +1 -1
  13. package/dist/theme.d.mts +10 -4
  14. package/dist/theme.d.ts +10 -4
  15. package/package.json +1 -1
  16. package/src/core/components/autocomplete/autocomplete.tsx +1 -1
  17. package/src/core/components/autocomplete/types.ts +2 -2
  18. package/src/core/components/breadcrumbs/breadcrumbs.test.tsx +51 -0
  19. package/src/core/components/breadcrumbs/breadcrumbs.tsx +7 -3
  20. package/src/core/components/hotkeys/hotkeys.test.tsx +42 -0
  21. package/src/core/components/hotkeys/hotkeys.tsx +7 -3
  22. package/src/core/components/menu/__workshop__/asComponent.tsx +1 -1
  23. package/src/core/components/menu/menu.spacing.test.tsx +63 -0
  24. package/src/core/components/menu/menu.tsx +8 -2
  25. package/src/core/components/menu/menuDivider.ts +16 -5
  26. package/src/core/components/menu/menuGroup.spacing.test.tsx +63 -0
  27. package/src/core/components/menu/menuGroup.tsx +22 -8
  28. package/src/core/components/menu/menuItem.spacing.test.tsx +59 -0
  29. package/src/core/components/menu/menuItem.tsx +25 -8
  30. package/src/core/components/skeleton/skeleton.tsx +2 -2
  31. package/src/core/components/tab/tabList.test.tsx +48 -0
  32. package/src/core/components/tab/tabList.tsx +2 -2
  33. package/src/core/components/tab/tabPanel.tsx +2 -2
  34. package/src/core/components/toast/styles.ts +2 -2
  35. package/src/core/components/tree/__workshop__/basic.perf.ts +1 -1
  36. package/src/core/components/tree/__workshop__/tabFromElement.tsx +1 -1
  37. package/src/core/components/tree/tree.test.tsx +55 -0
  38. package/src/core/components/tree/tree.tsx +19 -10
  39. package/src/core/components/tree/treeGroup.tsx +3 -3
  40. package/src/core/components/tree/treeItem.test.tsx +65 -0
  41. package/src/core/components/tree/treeItem.tsx +11 -4
  42. package/src/core/components/tree/types.ts +4 -0
  43. package/src/core/primitives/avatar/avatar.tsx +19 -11
  44. package/src/core/primitives/badge/badge.tsx +20 -12
  45. package/src/core/primitives/box/__workshop__/asComponent.tsx +31 -0
  46. package/src/core/primitives/box/__workshop__/index.ts +5 -0
  47. package/src/core/primitives/box/box.test.tsx +142 -0
  48. package/src/core/primitives/box/box.tsx +41 -18
  49. package/src/core/primitives/button/__workshop__/disabled.tsx +2 -2
  50. package/src/core/primitives/button/__workshop__/sanityUploadButton.tsx +1 -1
  51. package/src/core/primitives/button/__workshop__/uploadButton.tsx +1 -1
  52. package/src/core/primitives/button/button.test.tsx +41 -3
  53. package/src/core/primitives/button/button.tsx +36 -12
  54. package/src/core/primitives/card/__workshop__/asComponent.tsx +1 -1
  55. package/src/core/primitives/card/card.tsx +24 -13
  56. package/src/core/primitives/code/code.tsx +16 -7
  57. package/src/core/primitives/container/container.tsx +23 -10
  58. package/src/core/primitives/flex/flex.tsx +21 -11
  59. package/src/core/primitives/grid/grid.test.tsx +80 -0
  60. package/src/core/primitives/grid/grid.tsx +39 -13
  61. package/src/core/primitives/heading/heading.tsx +19 -11
  62. package/src/core/primitives/inline/inline.test.tsx +51 -0
  63. package/src/core/primitives/inline/inline.tsx +28 -12
  64. package/src/core/primitives/kbd/kbd.tsx +19 -11
  65. package/src/core/primitives/label/label.tsx +19 -11
  66. package/src/core/primitives/popover/__workshop__/SidePanelStory.tsx +1 -1
  67. package/src/core/primitives/select/select.test.tsx +52 -0
  68. package/src/core/primitives/select/select.tsx +8 -2
  69. package/src/core/primitives/stack/stack.test.tsx +57 -0
  70. package/src/core/primitives/stack/stack.tsx +27 -13
  71. package/src/core/primitives/text/text.tsx +19 -11
  72. package/src/core/primitives/textInput/textInput.test.tsx +48 -0
  73. package/src/core/primitives/textInput/textInput.tsx +9 -4
  74. package/src/core/primitives/types.ts +33 -0
  75. package/src/core/types/component.ts +32 -0
  76. package/src/core/types/index.ts +1 -0
  77. package/src/core/utils/virtualList/virtualList.tsx +2 -2
  78. package/src/theme/system/css.ts +10 -4
package/dist/index.mjs CHANGED
@@ -576,32 +576,33 @@ const StyledBreadcrumbs = styled.ol.withConfig({
576
576
  displayName: "ExpandButton",
577
577
  componentId: "sc-1es8h8q-1"
578
578
  })`appearance:none;margin:-4px;`, Breadcrumbs = forwardRef(function(props, ref) {
579
- const $ = c(29);
580
- let children, maxLength, restProps, separator, t0;
579
+ const $ = c(30);
580
+ let children, gap, maxLength, restProps, separator, t0;
581
581
  $[0] !== props ? ({
582
582
  children,
583
+ gap,
583
584
  maxLength,
584
585
  separator,
585
586
  space: t0,
586
587
  ...restProps
587
- } = props, $[0] = props, $[1] = children, $[2] = maxLength, $[3] = restProps, $[4] = separator, $[5] = t0) : (children = $[1], maxLength = $[2], restProps = $[3], separator = $[4], t0 = $[5]);
588
- const spaceRaw = t0 === void 0 ? 2 : t0;
589
- let t1;
590
- $[6] !== spaceRaw ? (t1 = _getArrayProp(spaceRaw), $[6] = spaceRaw, $[7] = t1) : t1 = $[7];
591
- const space = t1, [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null);
588
+ } = props, $[0] = props, $[1] = children, $[2] = gap, $[3] = maxLength, $[4] = restProps, $[5] = separator, $[6] = t0) : (children = $[1], gap = $[2], maxLength = $[3], restProps = $[4], separator = $[5], t0 = $[6]);
589
+ const t1 = gap === void 0 ? t0 === void 0 ? 2 : t0 : gap;
592
590
  let t2;
593
- $[8] === Symbol.for("react.memo_cache_sentinel") ? (t2 = () => setOpen(!1), $[8] = t2) : t2 = $[8];
594
- const collapse = t2;
591
+ $[7] !== t1 ? (t2 = _getArrayProp(t1), $[7] = t1, $[8] = t2) : t2 = $[8];
592
+ const space = t2, [open, setOpen] = useState(!1), expandElementRef = useRef(null), popoverElementRef = useRef(null);
595
593
  let t3;
596
- $[9] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => setOpen(!0), $[9] = t3) : t3 = $[9];
597
- const expand = t3;
594
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t3 = () => setOpen(!1), $[9] = t3) : t3 = $[9];
595
+ const collapse = t3;
598
596
  let t4;
599
- $[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => [expandElementRef.current, popoverElementRef.current], $[10] = t4) : t4 = $[10], useClickOutsideEvent(collapse, t4);
597
+ $[10] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => setOpen(!0), $[10] = t4) : t4 = $[10];
598
+ const expand = t4;
600
599
  let t5;
601
- $[11] !== children ? (t5 = Children.toArray(children).filter(isValidElement), $[11] = children, $[12] = t5) : t5 = $[12];
602
- const rawItems = t5;
600
+ $[11] === Symbol.for("react.memo_cache_sentinel") ? (t5 = () => [expandElementRef.current, popoverElementRef.current], $[11] = t5) : t5 = $[11], useClickOutsideEvent(collapse, t5);
603
601
  let t6;
604
- $[13] !== maxLength || $[14] !== open || $[15] !== rawItems || $[16] !== space ? (t6 = {
602
+ $[12] !== children ? (t6 = Children.toArray(children).filter(isValidElement), $[12] = children, $[13] = t6) : t6 = $[13];
603
+ const rawItems = t6;
604
+ let t7;
605
+ $[14] !== maxLength || $[15] !== open || $[16] !== rawItems || $[17] !== space ? (t7 = {
605
606
  collapse,
606
607
  expand,
607
608
  expandElementRef,
@@ -610,19 +611,19 @@ const StyledBreadcrumbs = styled.ol.withConfig({
610
611
  popoverElementRef,
611
612
  rawItems,
612
613
  space
613
- }, $[13] = maxLength, $[14] = open, $[15] = rawItems, $[16] = space, $[17] = t6) : t6 = $[17];
614
- const items = useItems(t6);
615
- let t7;
616
- if ($[18] !== items || $[19] !== separator || $[20] !== space) {
617
- let t82;
618
- $[22] !== separator || $[23] !== space ? (t82 = (item, itemIndex) => /* @__PURE__ */ jsxs(Fragment, { children: [
614
+ }, $[14] = maxLength, $[15] = open, $[16] = rawItems, $[17] = space, $[18] = t7) : t7 = $[18];
615
+ const items = useItems(t7);
616
+ let t8;
617
+ if ($[19] !== items || $[20] !== separator || $[21] !== space) {
618
+ let t92;
619
+ $[23] !== separator || $[24] !== space ? (t92 = (item, itemIndex) => /* @__PURE__ */ jsxs(Fragment, { children: [
619
620
  itemIndex > 0 && /* @__PURE__ */ jsx(Box, { "aria-hidden": !0, as: "li", paddingX: space, children: separator || /* @__PURE__ */ jsx(Text, { muted: !0, children: "/" }) }),
620
621
  /* @__PURE__ */ jsx(Box, { as: "li", children: item })
621
- ] }, itemIndex), $[22] = separator, $[23] = space, $[24] = t82) : t82 = $[24], t7 = items.map(t82), $[18] = items, $[19] = separator, $[20] = space, $[21] = t7;
622
+ ] }, itemIndex), $[23] = separator, $[24] = space, $[25] = t92) : t92 = $[25], t8 = items.map(t92), $[19] = items, $[20] = separator, $[21] = space, $[22] = t8;
622
623
  } else
623
- t7 = $[21];
624
- let t8;
625
- 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;
624
+ t8 = $[22];
625
+ let t9;
626
+ return $[26] !== ref || $[27] !== restProps || $[28] !== t8 ? (t9 = /* @__PURE__ */ jsx(StyledBreadcrumbs, { "data-ui": "Breadcrumbs", ...restProps, ref, children: t8 }), $[26] = ref, $[27] = restProps, $[28] = t8, $[29] = t9) : t9 = $[29], t9;
626
627
  });
627
628
  Breadcrumbs.displayName = "ForwardRef(Breadcrumbs)";
628
629
  function useItems(t0) {
@@ -644,7 +645,7 @@ function useItems(t0) {
644
645
  let t3;
645
646
  $[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];
646
647
  let t4;
647
- $[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];
648
+ $[16] !== space || $[17] !== t3 ? (t4 = /* @__PURE__ */ jsx(Stack, { as: "ol", overflow: "auto", padding: space, gap: space, children: t3 }), $[16] = space, $[17] = t3, $[18] = t4) : t4 = $[18];
648
649
  const t5 = open ? collapse : expand;
649
650
  let t6;
650
651
  $[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];
@@ -1520,36 +1521,37 @@ function _focusItemElement(el) {
1520
1521
  }
1521
1522
  }
1522
1523
  const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null), Tree = forwardRef(function(props, forwardedRef) {
1523
- const $ = c(37);
1524
- let children, onFocus, restProps, t0;
1524
+ const $ = c(38);
1525
+ let children, gap, onFocus, restProps, t0;
1525
1526
  $[0] !== props ? ({
1526
1527
  children,
1528
+ gap,
1527
1529
  space: t0,
1528
1530
  onFocus,
1529
1531
  ...restProps
1530
- } = props, $[0] = props, $[1] = children, $[2] = onFocus, $[3] = restProps, $[4] = t0) : (children = $[1], onFocus = $[2], restProps = $[3], t0 = $[4]);
1531
- const space = t0 === void 0 ? 1 : t0, ref = useRef(null), [focusedElement, setFocusedElement] = useState(null), focusedElementRef = useRef(focusedElement);
1532
+ } = props, $[0] = props, $[1] = children, $[2] = gap, $[3] = onFocus, $[4] = restProps, $[5] = t0) : (children = $[1], gap = $[2], onFocus = $[3], restProps = $[4], t0 = $[5]);
1533
+ const spacing = gap === void 0 ? t0 === void 0 ? 1 : t0 : gap, ref = useRef(null), [focusedElement, setFocusedElement] = useState(null), focusedElementRef = useRef(focusedElement);
1532
1534
  let t1;
1533
- $[5] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[5] = t1) : t1 = $[5];
1535
+ $[6] === Symbol.for("react.memo_cache_sentinel") ? (t1 = [], $[6] = t1) : t1 = $[6];
1534
1536
  const path = t1;
1535
1537
  let t2;
1536
- $[6] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[6] = t2) : t2 = $[6];
1538
+ $[7] === Symbol.for("react.memo_cache_sentinel") ? (t2 = [], $[7] = t2) : t2 = $[7];
1537
1539
  const [itemElements, setItemElements] = useState(t2);
1538
1540
  let t3;
1539
- $[7] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {}, $[7] = t3) : t3 = $[7];
1541
+ $[8] === Symbol.for("react.memo_cache_sentinel") ? (t3 = {}, $[8] = t3) : t3 = $[8];
1540
1542
  const [state, setState] = useState(t3), stateRef = useRef(state);
1541
1543
  let t4;
1542
- $[8] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[8] = t4) : t4 = $[8], useImperativeHandle(forwardedRef, t4);
1544
+ $[9] === Symbol.for("react.memo_cache_sentinel") ? (t4 = () => ref.current, $[9] = t4) : t4 = $[9], useImperativeHandle(forwardedRef, t4);
1543
1545
  let t5, t6;
1544
- $[9] !== focusedElement ? (t5 = () => {
1546
+ $[10] !== focusedElement ? (t5 = () => {
1545
1547
  focusedElementRef.current = focusedElement;
1546
- }, t6 = [focusedElement], $[9] = focusedElement, $[10] = t5, $[11] = t6) : (t5 = $[10], t6 = $[11]), useEffect(t5, t6);
1548
+ }, t6 = [focusedElement], $[10] = focusedElement, $[11] = t5, $[12] = t6) : (t5 = $[11], t6 = $[12]), useEffect(t5, t6);
1547
1549
  let t7, t8;
1548
- $[12] !== state ? (t7 = () => {
1550
+ $[13] !== state ? (t7 = () => {
1549
1551
  stateRef.current = state;
1550
- }, t8 = [state], $[12] = state, $[13] = t7, $[14] = t8) : (t7 = $[13], t8 = $[14]), useEffect(t7, t8);
1552
+ }, t8 = [state], $[13] = state, $[14] = t7, $[15] = t8) : (t7 = $[14], t8 = $[15]), useEffect(t7, t8);
1551
1553
  let t9;
1552
- $[15] === Symbol.for("react.memo_cache_sentinel") ? (t9 = (element, path_0, expanded, selected) => (setState((s) => ({
1554
+ $[16] === Symbol.for("react.memo_cache_sentinel") ? (t9 = (element, path_0, expanded, selected) => (setState((s) => ({
1553
1555
  ...s,
1554
1556
  [path_0]: {
1555
1557
  element,
@@ -1562,10 +1564,10 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
1562
1564
  };
1563
1565
  return delete newState[path_0], newState;
1564
1566
  });
1565
- }), $[15] = t9) : t9 = $[15];
1567
+ }), $[16] = t9) : t9 = $[16];
1566
1568
  const registerItem = t9;
1567
1569
  let t10;
1568
- $[16] === Symbol.for("react.memo_cache_sentinel") ? (t10 = (path_1, expanded_0) => {
1570
+ $[17] === Symbol.for("react.memo_cache_sentinel") ? (t10 = (path_1, expanded_0) => {
1569
1571
  setState((s_1) => {
1570
1572
  const itemState = s_1[path_1];
1571
1573
  return itemState ? {
@@ -1576,10 +1578,10 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
1576
1578
  }
1577
1579
  } : s_1;
1578
1580
  });
1579
- }, $[16] = t10) : t10 = $[16];
1581
+ }, $[17] = t10) : t10 = $[17];
1580
1582
  const setExpanded = t10, t11 = focusedElement || itemElements[0] || null;
1581
1583
  let t12;
1582
- $[17] !== space || $[18] !== state || $[19] !== t11 ? (t12 = {
1584
+ $[18] !== spacing || $[19] !== state || $[20] !== t11 ? (t12 = {
1583
1585
  version: 0,
1584
1586
  focusedElement: t11,
1585
1587
  level: 0,
@@ -1587,12 +1589,13 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
1587
1589
  registerItem,
1588
1590
  setExpanded,
1589
1591
  setFocusedElement,
1590
- space,
1592
+ gap: spacing,
1593
+ space: spacing,
1591
1594
  state
1592
- }, $[17] = space, $[18] = state, $[19] = t11, $[20] = t12) : t12 = $[20];
1595
+ }, $[18] = spacing, $[19] = state, $[20] = t11, $[21] = t12) : t12 = $[21];
1593
1596
  const contextValue = t12;
1594
1597
  let t13;
1595
- $[21] !== itemElements ? (t13 = (event) => {
1598
+ $[22] !== itemElements ? (t13 = (event) => {
1596
1599
  if (focusedElementRef.current) {
1597
1600
  if (event.key === "ArrowDown") {
1598
1601
  event.preventDefault();
@@ -1651,26 +1654,26 @@ const TreeContext = createGlobalScopedContext("@sanity/ui/context/tree", null),
1651
1654
  return;
1652
1655
  }
1653
1656
  }
1654
- }, $[21] = itemElements, $[22] = t13) : t13 = $[22];
1657
+ }, $[22] = itemElements, $[23] = t13) : t13 = $[23];
1655
1658
  const handleKeyDown = t13;
1656
1659
  let t14;
1657
- $[23] !== onFocus ? (t14 = (event_0) => {
1660
+ $[24] !== onFocus ? (t14 = (event_0) => {
1658
1661
  setFocusedElement(event_0.target), onFocus?.(event_0);
1659
- }, $[23] = onFocus, $[24] = t14) : t14 = $[24];
1662
+ }, $[24] = onFocus, $[25] = t14) : t14 = $[25];
1660
1663
  const handleFocus = t14;
1661
1664
  let t15;
1662
- $[25] === Symbol.for("react.memo_cache_sentinel") ? (t15 = () => {
1665
+ $[26] === Symbol.for("react.memo_cache_sentinel") ? (t15 = () => {
1663
1666
  if (!ref.current)
1664
1667
  return;
1665
1668
  const _itemElements = Array.from(ref.current.querySelectorAll('[data-ui="TreeItem"]'));
1666
1669
  setItemElements(_itemElements);
1667
- }, $[25] = t15) : t15 = $[25];
1670
+ }, $[26] = t15) : t15 = $[26];
1668
1671
  let t16;
1669
- $[26] !== children ? (t16 = [children], $[26] = children, $[27] = t16) : t16 = $[27], useEffect(t15, t16);
1672
+ $[27] !== children ? (t16 = [children], $[27] = children, $[28] = t16) : t16 = $[28], useEffect(t15, t16);
1670
1673
  let t17;
1671
- $[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];
1674
+ $[29] !== children || $[30] !== handleFocus || $[31] !== handleKeyDown || $[32] !== restProps || $[33] !== spacing ? (t17 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "Tree", ...restProps, onFocus: handleFocus, onKeyDown: handleKeyDown, ref, role: "tree", gap: spacing, children }), $[29] = children, $[30] = handleFocus, $[31] = handleKeyDown, $[32] = restProps, $[33] = spacing, $[34] = t17) : t17 = $[34];
1672
1675
  let t18;
1673
- return $[34] !== contextValue || $[35] !== t17 ? (t18 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t17 }), $[34] = contextValue, $[35] = t17, $[36] = t18) : t18 = $[36], t18;
1676
+ return $[35] !== contextValue || $[36] !== t17 ? (t18 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t17 }), $[35] = contextValue, $[36] = t17, $[37] = t18) : t18 = $[37], t18;
1674
1677
  });
1675
1678
  Tree.displayName = "ForwardRef(Tree)";
1676
1679
  function treeItemRootStyle() {
@@ -1781,7 +1784,7 @@ function TreeGroup(props) {
1781
1784
  } = props, $[0] = props, $[1] = children, $[2] = restProps, $[3] = t0) : (children = $[1], restProps = $[2], t0 = $[3]);
1782
1785
  const expanded = t0 === void 0 ? !1 : t0, tree = useTree(), t1 = !expanded;
1783
1786
  let t2;
1784
- 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;
1787
+ return $[4] !== children || $[5] !== restProps || $[6] !== t1 || $[7] !== tree.gap ? (t2 = /* @__PURE__ */ jsx(Stack, { as: "ul", "data-ui": "TreeGroup", ...restProps, hidden: t1, marginTop: tree.gap, role: "group", gap: tree.gap, children }), $[4] = children, $[5] = restProps, $[6] = t1, $[7] = tree.gap, $[8] = t2) : t2 = $[8], t2;
1785
1788
  }
1786
1789
  const StyledTreeItem = /* @__PURE__ */ styled.li.withConfig({
1787
1790
  displayName: "StyledTreeItem",
@@ -1796,8 +1799,8 @@ const StyledTreeItem = /* @__PURE__ */ styled.li.withConfig({
1796
1799
  componentId: "sc-iiskig-2"
1797
1800
  })`& > svg{transition:transform 100ms;}`;
1798
1801
  function TreeItem(props) {
1799
- const $ = c(113);
1800
- let IconComponent, children, href, idProp, linkAs, muted, onClick, restProps, t0, t1, t2, t3, t4, text, weight;
1802
+ const $ = c(114);
1803
+ let IconComponent, children, gap, href, idProp, linkAs, muted, onClick, restProps, t0, t1, t2, t3, t4, text, weight;
1801
1804
  $[0] !== props ? ({
1802
1805
  children,
1803
1806
  expanded: t0,
@@ -1810,16 +1813,17 @@ function TreeItem(props) {
1810
1813
  onClick,
1811
1814
  padding: t2,
1812
1815
  selected: t3,
1816
+ gap,
1813
1817
  space: t4,
1814
1818
  text,
1815
1819
  weight,
1816
1820
  ...restProps
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]);
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);
1821
+ } = props, $[0] = props, $[1] = IconComponent, $[2] = children, $[3] = gap, $[4] = href, $[5] = idProp, $[6] = linkAs, $[7] = muted, $[8] = onClick, $[9] = restProps, $[10] = t0, $[11] = t1, $[12] = t2, $[13] = t3, $[14] = t4, $[15] = text, $[16] = weight) : (IconComponent = $[1], children = $[2], gap = $[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 = $[16]);
1822
+ 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, spacing = gap === void 0 ? t4 === void 0 ? 2 : t4 : gap, [rootElement, _setRootElement] = useState(null);
1819
1823
  let t5;
1820
- $[16] === Symbol.for("react.memo_cache_sentinel") ? (t5 = (node) => {
1824
+ $[17] === Symbol.for("react.memo_cache_sentinel") ? (t5 = (node) => {
1821
1825
  startTransition(() => _setRootElement(node));
1822
- }, $[16] = t5) : t5 = $[16];
1826
+ }, $[17] = t5) : t5 = $[17];
1823
1827
  const setRootElement = t5, treeitemRef = useRef(null), tree = useTree(), {
1824
1828
  path,
1825
1829
  registerItem,
@@ -1827,89 +1831,89 @@ function TreeItem(props) {
1827
1831
  setFocusedElement
1828
1832
  } = tree, _id = useId(), id = idProp || _id;
1829
1833
  let t6, t7;
1830
- if ($[17] !== id || $[18] !== path) {
1834
+ if ($[18] !== id || $[19] !== path) {
1831
1835
  const itemPath = path.concat([id || ""]);
1832
- t6 = itemPath, t7 = itemPath.join("/"), $[17] = id, $[18] = path, $[19] = t6, $[20] = t7;
1836
+ t6 = itemPath, t7 = itemPath.join("/"), $[18] = id, $[19] = path, $[20] = t6, $[21] = t7;
1833
1837
  } else
1834
- t6 = $[19], t7 = $[20];
1838
+ t6 = $[20], t7 = $[21];
1835
1839
  let t8;
1836
- $[21] !== t6 || $[22] !== t7 ? (t8 = [t6, t7], $[21] = t6, $[22] = t7, $[23] = t8) : t8 = $[23];
1840
+ $[22] !== t6 || $[23] !== t7 ? (t8 = [t6, t7], $[22] = t6, $[23] = t7, $[24] = t8) : t8 = $[24];
1837
1841
  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
1842
  let t10;
1839
- $[24] !== itemPath_0 || $[25] !== t9 || $[26] !== tree ? (t10 = {
1843
+ $[25] !== itemPath_0 || $[26] !== t9 || $[27] !== tree ? (t10 = {
1840
1844
  ...tree,
1841
1845
  level: t9,
1842
1846
  path: itemPath_0
1843
- }, $[24] = itemPath_0, $[25] = t9, $[26] = tree, $[27] = t10) : t10 = $[27];
1847
+ }, $[25] = itemPath_0, $[26] = t9, $[27] = tree, $[28] = t10) : t10 = $[28];
1844
1848
  const contextValue = t10;
1845
1849
  let t11;
1846
- $[28] !== expanded || $[29] !== itemKey || $[30] !== onClick || $[31] !== rootElement || $[32] !== setExpanded || $[33] !== setFocusedElement ? (t11 = (event) => {
1850
+ $[29] !== expanded || $[30] !== itemKey || $[31] !== onClick || $[32] !== rootElement || $[33] !== setExpanded || $[34] !== setFocusedElement ? (t11 = (event) => {
1847
1851
  onClick && onClick(event);
1848
1852
  const target = event.target;
1849
1853
  target instanceof HTMLElement && (target.getAttribute("data-ui") === "TreeItem" || target.closest('[data-ui="TreeItem__box"]')) && (event.stopPropagation(), setExpanded(itemKey, !expanded), setFocusedElement(rootElement));
1850
- }, $[28] = expanded, $[29] = itemKey, $[30] = onClick, $[31] = rootElement, $[32] = setExpanded, $[33] = setFocusedElement, $[34] = t11) : t11 = $[34];
1854
+ }, $[29] = expanded, $[30] = itemKey, $[31] = onClick, $[32] = rootElement, $[33] = setExpanded, $[34] = setFocusedElement, $[35] = t11) : t11 = $[35];
1851
1855
  const handleClick = t11;
1852
1856
  let t12;
1853
- $[35] !== focused || $[36] !== rootElement ? (t12 = (event_0) => {
1857
+ $[36] !== focused || $[37] !== rootElement ? (t12 = (event_0) => {
1854
1858
  focused && event_0.key === "Enter" && (treeitemRef.current || rootElement)?.click();
1855
- }, $[35] = focused, $[36] = rootElement, $[37] = t12) : t12 = $[37];
1859
+ }, $[36] = focused, $[37] = rootElement, $[38] = t12) : t12 = $[38];
1856
1860
  const handleKeyDown = t12;
1857
1861
  let t13, t14;
1858
- $[38] !== expanded || $[39] !== itemKey || $[40] !== registerItem || $[41] !== rootElement || $[42] !== selected ? (t13 = () => {
1862
+ $[39] !== expanded || $[40] !== itemKey || $[41] !== registerItem || $[42] !== rootElement || $[43] !== selected ? (t13 = () => {
1859
1863
  if (rootElement)
1860
1864
  return registerItem(rootElement, itemKey, expanded, selected);
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);
1865
+ }, t14 = [expanded, itemKey, registerItem, rootElement, selected], $[39] = expanded, $[40] = itemKey, $[41] = registerItem, $[42] = rootElement, $[43] = selected, $[44] = t13, $[45] = t14) : (t13 = $[44], t14 = $[45]), useEffect(t13, t14);
1862
1866
  const t15 = IconComponent || children ? "visible" : "hidden";
1863
1867
  let t16;
1864
- $[45] !== t15 ? (t16 = {
1868
+ $[46] !== t15 ? (t16 = {
1865
1869
  visibility: t15,
1866
1870
  pointerEvents: "none"
1867
- }, $[45] = t15, $[46] = t16) : t16 = $[46];
1871
+ }, $[46] = t15, $[47] = t16) : t16 = $[47];
1868
1872
  let t17;
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];
1873
+ $[48] !== IconComponent || $[49] !== fontSize || $[50] !== muted || $[51] !== weight ? (t17 = IconComponent && /* @__PURE__ */ jsx(Text, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(IconComponent, {}) }), $[48] = IconComponent, $[49] = fontSize, $[50] = muted, $[51] = weight, $[52] = t17) : t17 = $[52];
1870
1874
  let t18;
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: {
1875
+ $[53] !== IconComponent || $[54] !== expanded || $[55] !== fontSize || $[56] !== muted || $[57] !== weight ? (t18 = !IconComponent && /* @__PURE__ */ jsx(ToggleArrowText, { muted, size: fontSize, weight, children: /* @__PURE__ */ jsx(ToggleArrowRightIcon, { style: {
1872
1876
  transform: expanded ? "rotate(90deg)" : void 0
1873
- } }) }), $[52] = IconComponent, $[53] = expanded, $[54] = fontSize, $[55] = muted, $[56] = weight, $[57] = t18) : t18 = $[57];
1877
+ } }) }), $[53] = IconComponent, $[54] = expanded, $[55] = fontSize, $[56] = muted, $[57] = weight, $[58] = t18) : t18 = $[58];
1874
1878
  let t19;
1875
- $[58] !== space || $[59] !== t16 || $[60] !== t17 || $[61] !== t18 ? (t19 = /* @__PURE__ */ jsxs(Box, { marginRight: space, style: t16, children: [
1879
+ $[59] !== spacing || $[60] !== t16 || $[61] !== t17 || $[62] !== t18 ? (t19 = /* @__PURE__ */ jsxs(Box, { marginRight: spacing, style: t16, children: [
1876
1880
  t17,
1877
1881
  t18
1878
- ] }), $[58] = space, $[59] = t16, $[60] = t17, $[61] = t18, $[62] = t19) : t19 = $[62];
1882
+ ] }), $[59] = spacing, $[60] = t16, $[61] = t17, $[62] = t18, $[63] = t19) : t19 = $[63];
1879
1883
  let t20;
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];
1884
+ $[64] !== fontSize || $[65] !== muted || $[66] !== text || $[67] !== weight ? (t20 = /* @__PURE__ */ jsx(Box, { flex: 1, children: /* @__PURE__ */ jsx(Text, { muted, size: fontSize, textOverflow: "ellipsis", weight, children: text }) }), $[64] = fontSize, $[65] = muted, $[66] = text, $[67] = weight, $[68] = t20) : t20 = $[68];
1881
1885
  let t21;
1882
- $[68] !== padding || $[69] !== t19 || $[70] !== t20 ? (t21 = /* @__PURE__ */ jsxs(Flex, { padding, children: [
1886
+ $[69] !== padding || $[70] !== t19 || $[71] !== t20 ? (t21 = /* @__PURE__ */ jsxs(Flex, { padding, children: [
1883
1887
  t19,
1884
1888
  t20
1885
- ] }), $[68] = padding, $[69] = t19, $[70] = t20, $[71] = t21) : t21 = $[71];
1889
+ ] }), $[69] = padding, $[70] = t19, $[71] = t20, $[72] = t21) : t21 = $[72];
1886
1890
  const content2 = t21;
1887
1891
  if (href) {
1888
1892
  const t222 = selected ? "" : void 0;
1889
1893
  let t232;
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];
1894
+ $[73] !== content2 || $[74] !== expanded || $[75] !== href || $[76] !== linkAs || $[77] !== tabIndex || $[78] !== 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 }), $[73] = content2, $[74] = expanded, $[75] = href, $[76] = linkAs, $[77] = tabIndex, $[78] = tree.level, $[79] = t232) : t232 = $[79];
1891
1895
  let t242;
1892
- $[79] !== children || $[80] !== expanded ? (t242 = children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }), $[79] = children, $[80] = expanded, $[81] = t242) : t242 = $[81];
1896
+ $[80] !== children || $[81] !== expanded ? (t242 = children && /* @__PURE__ */ jsx(TreeGroup, { hidden: !expanded, children }), $[80] = children, $[81] = expanded, $[82] = t242) : t242 = $[82];
1893
1897
  let t252;
1894
- $[82] !== contextValue || $[83] !== t242 ? (t252 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t242 }), $[82] = contextValue, $[83] = t242, $[84] = t252) : t252 = $[84];
1898
+ $[83] !== contextValue || $[84] !== t242 ? (t252 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t242 }), $[83] = contextValue, $[84] = t242, $[85] = t252) : t252 = $[85];
1895
1899
  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: [
1900
+ return $[86] !== handleClick || $[87] !== id || $[88] !== itemKey || $[89] !== restProps || $[90] !== t222 || $[91] !== t232 || $[92] !== 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
1901
  t232,
1898
1902
  t252
1899
- ] }), $[85] = handleClick, $[86] = id, $[87] = itemKey, $[88] = restProps, $[89] = t222, $[90] = t232, $[91] = t252, $[92] = t262) : t262 = $[92], t262;
1903
+ ] }), $[86] = handleClick, $[87] = id, $[88] = itemKey, $[89] = restProps, $[90] = t222, $[91] = t232, $[92] = t252, $[93] = t262) : t262 = $[93], t262;
1900
1904
  }
1901
1905
  const t22 = selected ? "" : void 0;
1902
1906
  let t23;
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];
1907
+ $[94] !== content2 || $[95] !== tree.level ? (t23 = /* @__PURE__ */ jsx(TreeItemBox, { $level: tree.level, as: "div", "data-ui": "TreeItem__box", children: content2 }), $[94] = content2, $[95] = tree.level, $[96] = t23) : t23 = $[96];
1904
1908
  let t24;
1905
- $[96] !== children || $[97] !== expanded ? (t24 = children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }), $[96] = children, $[97] = expanded, $[98] = t24) : t24 = $[98];
1909
+ $[97] !== children || $[98] !== expanded ? (t24 = children && /* @__PURE__ */ jsx(TreeGroup, { expanded, children }), $[97] = children, $[98] = expanded, $[99] = t24) : t24 = $[99];
1906
1910
  let t25;
1907
- $[99] !== contextValue || $[100] !== t24 ? (t25 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t24 }), $[99] = contextValue, $[100] = t24, $[101] = t25) : t25 = $[101];
1911
+ $[100] !== contextValue || $[101] !== t24 ? (t25 = /* @__PURE__ */ jsx(TreeContext.Provider, { value: contextValue, children: t24 }), $[100] = contextValue, $[101] = t24, $[102] = t25) : t25 = $[102];
1908
1912
  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: [
1913
+ return $[103] !== expanded || $[104] !== handleClick || $[105] !== handleKeyDown || $[106] !== id || $[107] !== itemKey || $[108] !== restProps || $[109] !== t22 || $[110] !== t23 || $[111] !== t25 || $[112] !== 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
1914
  t23,
1911
1915
  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;
1916
+ ] }), $[103] = expanded, $[104] = handleClick, $[105] = handleKeyDown, $[106] = id, $[107] = itemKey, $[108] = restProps, $[109] = t22, $[110] = t23, $[111] = t25, $[112] = tabIndex, $[113] = t26) : t26 = $[113], t26;
1913
1917
  }
1914
1918
  TreeItem.displayName = "TreeItem";
1915
1919
  export {