@dxos/react-ui-list 0.8.4-main.69d29f4 → 0.8.4-main.6fa680abb7

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 (33) hide show
  1. package/dist/lib/browser/index.mjs +192 -166
  2. package/dist/lib/browser/index.mjs.map +3 -3
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node-esm/index.mjs +192 -166
  5. package/dist/lib/node-esm/index.mjs.map +3 -3
  6. package/dist/lib/node-esm/meta.json +1 -1
  7. package/dist/types/src/components/List/List.d.ts.map +1 -1
  8. package/dist/types/src/components/List/ListItem.d.ts +2 -2
  9. package/dist/types/src/components/List/ListItem.d.ts.map +1 -1
  10. package/dist/types/src/components/Tree/Tree.d.ts +6 -5
  11. package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
  12. package/dist/types/src/components/Tree/Tree.stories.d.ts +1 -1
  13. package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
  14. package/dist/types/src/components/Tree/TreeContext.d.ts +21 -10
  15. package/dist/types/src/components/Tree/TreeContext.d.ts.map +1 -1
  16. package/dist/types/src/components/Tree/TreeItem.d.ts +8 -0
  17. package/dist/types/src/components/Tree/TreeItem.d.ts.map +1 -1
  18. package/dist/types/src/components/Tree/TreeItemHeading.d.ts.map +1 -1
  19. package/dist/types/src/components/Tree/index.d.ts +2 -0
  20. package/dist/types/src/components/Tree/index.d.ts.map +1 -1
  21. package/dist/types/tsconfig.tsbuildinfo +1 -1
  22. package/package.json +18 -18
  23. package/src/components/Accordion/Accordion.stories.tsx +3 -3
  24. package/src/components/Accordion/AccordionItem.tsx +1 -1
  25. package/src/components/List/List.stories.tsx +7 -7
  26. package/src/components/List/ListItem.tsx +10 -10
  27. package/src/components/Tree/Tree.stories.tsx +102 -26
  28. package/src/components/Tree/Tree.tsx +30 -40
  29. package/src/components/Tree/TreeContext.tsx +18 -9
  30. package/src/components/Tree/TreeItem.tsx +166 -99
  31. package/src/components/Tree/TreeItemHeading.tsx +5 -3
  32. package/src/components/Tree/TreeItemToggle.tsx +1 -1
  33. package/src/components/Tree/index.ts +2 -0
@@ -46,7 +46,7 @@ var AccordionItemHeader = ({ classNames, children, ...props }) => {
46
46
  ...props,
47
47
  className: mx2(classNames)
48
48
  }, /* @__PURE__ */ React2.createElement(AccordionPrimitive2.Trigger, {
49
- className: "group flex items-center p-2 dx-focus-ring-inset is-full text-start"
49
+ className: "group flex items-center p-2 dx-focus-ring-inset w-full text-start"
50
50
  }, children, /* @__PURE__ */ React2.createElement(Icon, {
51
51
  icon: "ph--caret-right--regular",
52
52
  size: 4,
@@ -157,7 +157,7 @@ var idle = {
157
157
  type: "idle"
158
158
  };
159
159
  var stateStyles = {
160
- "is-dragging": "opacity-50"
160
+ "w-dragging": "opacity-50"
161
161
  };
162
162
  var defaultContext = {};
163
163
  var LIST_ITEM_NAME = "ListItem";
@@ -216,10 +216,10 @@ var ListItem = ({ children, classNames, item, ...props }) => {
216
216
  } : void 0,
217
217
  onDragStart: () => {
218
218
  setState({
219
- type: "is-dragging"
219
+ type: "w-dragging"
220
220
  });
221
221
  setRootState({
222
- type: "is-dragging",
222
+ type: "w-dragging",
223
223
  item
224
224
  });
225
225
  },
@@ -250,7 +250,7 @@ var ListItem = ({ children, classNames, item, ...props }) => {
250
250
  onDragEnter: ({ self }) => {
251
251
  const closestEdge = extractClosestEdge2(self.data);
252
252
  setState({
253
- type: "is-dragging-over",
253
+ type: "w-dragging-over",
254
254
  closestEdge
255
255
  });
256
256
  },
@@ -260,11 +260,11 @@ var ListItem = ({ children, classNames, item, ...props }) => {
260
260
  onDrag: ({ self }) => {
261
261
  const closestEdge = extractClosestEdge2(self.data);
262
262
  setState((current) => {
263
- if (current.type === "is-dragging-over" && current.closestEdge === closestEdge) {
263
+ if (current.type === "w-dragging-over" && current.closestEdge === closestEdge) {
264
264
  return current;
265
265
  }
266
266
  return {
267
- type: "is-dragging-over",
267
+ type: "w-dragging-over",
268
268
  closestEdge
269
269
  };
270
270
  });
@@ -285,7 +285,7 @@ var ListItem = ({ children, classNames, item, ...props }) => {
285
285
  role: "listitem",
286
286
  className: mx3("flex relative", classNames, stateStyles[state.type]),
287
287
  ...props
288
- }, children, state.type === "is-dragging-over" && state.closestEdge && /* @__PURE__ */ React4.createElement(NaturalListItem.DropIndicator, {
288
+ }, children, state.type === "w-dragging-over" && state.closestEdge && /* @__PURE__ */ React4.createElement(NaturalListItem.DropIndicator, {
289
289
  edge: state.closestEdge
290
290
  })));
291
291
  };
@@ -339,7 +339,7 @@ var ListItemDragPreview = ({ children }) => {
339
339
  }), state.container) : null;
340
340
  };
341
341
  var ListItemWrapper = ({ classNames, children }) => /* @__PURE__ */ React4.createElement("div", {
342
- className: mx3("flex is-full gap-2", classNames)
342
+ className: mx3("flex w-full gap-2", classNames)
343
343
  }, children);
344
344
  var ListItemTitle = ({ classNames, children, ...props }) => /* @__PURE__ */ React4.createElement("div", {
345
345
  className: mx3("flex grow items-center truncate", classNames),
@@ -359,6 +359,7 @@ var List = {
359
359
  };
360
360
 
361
361
  // src/components/Tree/Tree.tsx
362
+ import { useAtomValue as useAtomValue2 } from "@effect-atom/atom-react";
362
363
  import React8, { useMemo as useMemo2 } from "react";
363
364
  import { Treegrid as Treegrid2 } from "@dxos/react-ui";
364
365
 
@@ -373,11 +374,12 @@ var useTree = () => useContext(TreeContext) ?? raise(new Error("TreeContext not
373
374
  import { combine as combine2 } from "@atlaskit/pragmatic-drag-and-drop/combine";
374
375
  import { draggable as draggable2, dropTargetForElements as dropTargetForElements2 } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
375
376
  import { attachInstruction, extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";
377
+ import { useAtomValue } from "@effect-atom/atom-react";
376
378
  import * as Schema from "effect/Schema";
377
379
  import React7, { memo as memo3, useCallback as useCallback3, useEffect as useEffect3, useMemo, useRef as useRef2, useState as useState3 } from "react";
378
380
  import { invariant as invariant2 } from "@dxos/invariant";
379
381
  import { TreeItem as NaturalTreeItem, Treegrid } from "@dxos/react-ui";
380
- import { ghostFocusWithin, ghostHover, hoverableControls, hoverableFocusedKeyboardControls, hoverableFocusedWithinControls } from "@dxos/ui-theme";
382
+ import { ghostFocusWithin, ghostHover, hoverableControls, hoverableFocusedKeyboardControls, hoverableFocusedWithinControls, mx as mx4 } from "@dxos/ui-theme";
381
383
 
382
384
  // src/components/Tree/helpers.ts
383
385
  var DEFAULT_INDENTATION = 8;
@@ -419,7 +421,7 @@ var TreeItemHeading = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(({ label,
419
421
  variant: "ghost",
420
422
  density: "fine",
421
423
  classNames: [
422
- "grow gap-2 pis-0.5 hover:bg-transparent dark:hover:bg-transparent",
424
+ "grow gap-2 ps-0.5 hover:bg-transparent dark:hover:bg-transparent",
423
425
  "disabled:cursor-default disabled:opacity-100",
424
426
  className
425
427
  ],
@@ -433,11 +435,11 @@ var TreeItemHeading = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(({ label,
433
435
  icon: icon ?? "ph--placeholder--regular",
434
436
  size: 5,
435
437
  classNames: [
436
- "mlb-1",
437
- styles?.icon
438
+ "my-1",
439
+ styles?.surfaceText
438
440
  ]
439
441
  }), /* @__PURE__ */ React5.createElement("span", {
440
- className: "flex-1 is-0 truncate text-start text-sm font-normal",
442
+ className: "flex-1 w-0 truncate text-start font-normal",
441
443
  "data-tooltip": true
442
444
  }, toLocalizedString(label, t))));
443
445
  }));
@@ -453,7 +455,7 @@ var TreeItemToggle = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef2(({ open,
453
455
  variant: "ghost",
454
456
  density: "fine",
455
457
  classNames: [
456
- "bs-full is-6 pli-0",
458
+ "h-full w-6 px-0",
457
459
  "[&_svg]:transition-[transform] [&_svg]:duration-200",
458
460
  open && "[&_svg]:rotate-90",
459
461
  hidden ? "hidden" : !isBranch && "invisible",
@@ -478,7 +480,7 @@ var TreeDataSchema = Schema.Struct({
478
480
  item: Schema.Any
479
481
  });
480
482
  var isTreeData = (data) => Schema.is(TreeDataSchema)(data);
481
- var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _draggable, renderColumns: Columns, blockInstruction, canDrop, canSelect, onOpenChange, onSelect }) => {
483
+ var RawTreeItem = ({ item, path: pathProp, levelOffset = 2, last, draggable: draggableProp, renderColumns: Columns, blockInstruction, canDrop, canSelect, onOpenChange, onSelect, onItemHover }) => {
482
484
  const rowRef = useRef2(null);
483
485
  const buttonRef = useRef2(null);
484
486
  const openRef = useRef2(false);
@@ -486,18 +488,18 @@ var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _dragg
486
488
  const [_state, setState] = useState3("idle");
487
489
  const [instruction, setInstruction] = useState3(null);
488
490
  const [menuOpen, setMenuOpen] = useState3(false);
489
- const { useItems, getProps, useIsOpen, useIsCurrent } = useTree();
490
- const items = useItems(item);
491
- const { id, parentOf, label, className, headingClassName, icon, iconHue, disabled, testId } = getProps(item, _path);
491
+ const { itemProps: itemPropsAtom, childIds: childIdsAtom, itemOpen: itemOpenAtom, itemCurrent: itemCurrentAtom } = useTree();
492
492
  const path = useMemo(() => [
493
- ..._path,
494
- id
493
+ ...pathProp,
494
+ item.id
495
495
  ], [
496
- _path,
497
- id
496
+ pathProp,
497
+ item.id
498
498
  ]);
499
- const open = useIsOpen(path, item);
500
- const current = useIsCurrent(path, item);
499
+ const { id, parentOf, draggable: itemDraggable, droppable: itemDroppable, label, className, headingClassName, icon, iconHue, disabled, testId } = useAtomValue(itemPropsAtom(path));
500
+ const childIds = useAtomValue(childIdsAtom(item.id));
501
+ const open = useAtomValue(itemOpenAtom(path));
502
+ const current = useAtomValue(itemCurrentAtom(path));
501
503
  const level = path.length - levelOffset;
502
504
  const isBranch = !!parentOf;
503
505
  const mode = last ? "last-in-group" : open ? "expanded" : "standard";
@@ -505,122 +507,130 @@ var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _dragg
505
507
  item,
506
508
  path
507
509
  }) ?? true;
510
+ const data = {
511
+ id,
512
+ path,
513
+ item
514
+ };
508
515
  const cancelExpand = useCallback3(() => {
509
516
  if (cancelExpandRef.current) {
510
517
  clearTimeout(cancelExpandRef.current);
511
518
  cancelExpandRef.current = null;
512
519
  }
513
520
  }, []);
521
+ const isItemDraggable = draggableProp && itemDraggable !== false;
522
+ const isItemDroppable = itemDroppable !== false;
514
523
  useEffect3(() => {
515
- if (!_draggable) {
524
+ if (!draggableProp) {
516
525
  return;
517
526
  }
518
527
  invariant2(buttonRef.current, void 0, {
519
528
  F: __dxlog_file2,
520
- L: 111,
529
+ L: 148,
521
530
  S: void 0,
522
531
  A: [
523
532
  "buttonRef.current",
524
533
  ""
525
534
  ]
526
535
  });
527
- const data = {
528
- id,
529
- path,
530
- item
531
- };
532
- return combine2(
533
- draggable2({
534
- element: buttonRef.current,
535
- getInitialData: () => data,
536
- onDragStart: () => {
537
- setState("dragging");
538
- if (open) {
539
- openRef.current = true;
540
- onOpenChange?.({
541
- item,
542
- path,
543
- open: false
544
- });
545
- }
546
- },
547
- onDrop: () => {
548
- setState("idle");
549
- if (openRef.current) {
550
- onOpenChange?.({
551
- item,
552
- path,
553
- open: true
554
- });
555
- }
556
- }
557
- }),
558
- // https://github.com/atlassian/pragmatic-drag-and-drop/blob/main/packages/hitbox/constellation/index/about.mdx
559
- dropTargetForElements2({
560
- element: buttonRef.current,
561
- getData: ({ input, element }) => {
562
- return attachInstruction(data, {
563
- input,
564
- element,
565
- indentPerLevel: DEFAULT_INDENTATION,
566
- currentLevel: level,
567
- mode,
568
- block: isBranch ? [] : [
569
- "make-child"
570
- ]
536
+ const makeDraggable = () => draggable2({
537
+ element: buttonRef.current,
538
+ getInitialData: () => data,
539
+ onDragStart: () => {
540
+ setState("dragging");
541
+ if (open) {
542
+ openRef.current = true;
543
+ onOpenChange?.({
544
+ item,
545
+ path,
546
+ open: false
571
547
  });
572
- },
573
- canDrop: ({ source }) => {
574
- const _canDrop = canDrop ?? (() => true);
575
- return source.element !== buttonRef.current && _canDrop({
576
- source: source.data,
577
- target: data
578
- });
579
- },
580
- getIsSticky: () => true,
581
- onDrag: ({ self, source }) => {
582
- const desired = extractInstruction(self.data);
583
- const block = desired && blockInstruction?.({
584
- instruction: desired,
585
- source: source.data,
586
- target: data
548
+ }
549
+ },
550
+ onDrop: () => {
551
+ setState("idle");
552
+ if (openRef.current) {
553
+ onOpenChange?.({
554
+ item,
555
+ path,
556
+ open: true
587
557
  });
588
- const instruction2 = block && desired.type !== "instruction-blocked" ? {
589
- type: "instruction-blocked",
590
- desired
591
- } : desired;
592
- if (source.data.id !== id) {
593
- if (instruction2?.type === "make-child" && isBranch && !open && !cancelExpandRef.current) {
594
- cancelExpandRef.current = setTimeout(() => {
595
- onOpenChange?.({
596
- item,
597
- path,
598
- open: true
599
- });
600
- }, 500);
601
- }
602
- if (instruction2?.type !== "make-child") {
603
- cancelExpand();
604
- }
605
- setInstruction(instruction2);
606
- } else if (instruction2?.type === "reparent") {
607
- setInstruction(instruction2);
608
- } else {
609
- setInstruction(null);
558
+ }
559
+ }
560
+ });
561
+ if (!isItemDroppable) {
562
+ return isItemDraggable ? makeDraggable() : void 0;
563
+ }
564
+ const dropTarget = dropTargetForElements2({
565
+ element: buttonRef.current,
566
+ getData: ({ input, element }) => {
567
+ return attachInstruction(data, {
568
+ input,
569
+ element,
570
+ indentPerLevel: DEFAULT_INDENTATION,
571
+ currentLevel: level,
572
+ mode,
573
+ block: isBranch ? [] : [
574
+ "make-child"
575
+ ]
576
+ });
577
+ },
578
+ canDrop: ({ source }) => {
579
+ const _canDrop = canDrop ?? (() => true);
580
+ return source.element !== buttonRef.current && _canDrop({
581
+ source: source.data,
582
+ target: data
583
+ });
584
+ },
585
+ getIsSticky: () => true,
586
+ onDrag: ({ self, source }) => {
587
+ const desired = extractInstruction(self.data);
588
+ const block = desired && blockInstruction?.({
589
+ instruction: desired,
590
+ source: source.data,
591
+ target: data
592
+ });
593
+ const instruction2 = block && desired.type !== "instruction-blocked" ? {
594
+ type: "instruction-blocked",
595
+ desired
596
+ } : desired;
597
+ if (source.data.id !== id) {
598
+ if (instruction2?.type === "make-child" && isBranch && !open && !cancelExpandRef.current) {
599
+ cancelExpandRef.current = setTimeout(() => {
600
+ onOpenChange?.({
601
+ item,
602
+ path,
603
+ open: true
604
+ });
605
+ }, 500);
610
606
  }
611
- },
612
- onDragLeave: () => {
613
- cancelExpand();
614
- setInstruction(null);
615
- },
616
- onDrop: () => {
617
- cancelExpand();
607
+ if (instruction2?.type !== "make-child") {
608
+ cancelExpand();
609
+ }
610
+ setInstruction(instruction2);
611
+ } else if (instruction2?.type === "reparent") {
612
+ setInstruction(instruction2);
613
+ } else {
618
614
  setInstruction(null);
619
615
  }
620
- })
621
- );
616
+ },
617
+ onDragLeave: () => {
618
+ cancelExpand();
619
+ setInstruction(null);
620
+ },
621
+ onDrop: () => {
622
+ cancelExpand();
623
+ setInstruction(null);
624
+ }
625
+ });
626
+ if (!isItemDraggable) {
627
+ return dropTarget;
628
+ }
629
+ return combine2(makeDraggable(), dropTarget);
622
630
  }, [
623
- _draggable,
631
+ draggableProp,
632
+ isItemDraggable,
633
+ isItemDroppable,
624
634
  item,
625
635
  id,
626
636
  mode,
@@ -680,33 +690,46 @@ var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _dragg
680
690
  handleOpenToggle,
681
691
  handleSelect
682
692
  ]);
693
+ const handleItemHover = useCallback3(() => {
694
+ onItemHover?.({
695
+ item
696
+ });
697
+ }, [
698
+ onItemHover,
699
+ item
700
+ ]);
701
+ const handleContextMenu = useCallback3((event) => {
702
+ event.preventDefault();
703
+ setMenuOpen(true);
704
+ }, [
705
+ setMenuOpen
706
+ ]);
707
+ const childProps = {
708
+ draggable: draggableProp,
709
+ renderColumns: Columns,
710
+ blockInstruction,
711
+ canDrop,
712
+ canSelect,
713
+ onItemHover,
714
+ onOpenChange,
715
+ onSelect
716
+ };
683
717
  return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(Treegrid.Row, {
684
718
  ref: rowRef,
685
719
  key: id,
686
720
  id,
687
721
  "aria-labelledby": `${id}__label`,
688
722
  parentOf: parentOf?.join(Treegrid.PARENT_OF_SEPARATOR),
689
- classNames: [
690
- "grid grid-cols-subgrid col-[tree-row] mbs-0.5 aria-[current]:bg-activeSurface",
691
- hoverableControls,
692
- hoverableFocusedKeyboardControls,
693
- hoverableFocusedWithinControls,
694
- hoverableDescriptionIcons,
695
- ghostHover,
696
- ghostFocusWithin,
697
- className
698
- ],
699
723
  "data-object-id": id,
700
724
  "data-testid": testId,
701
725
  // NOTE(thure): This is intentionally an empty string to for descendents to select by in the CSS
702
726
  // without alerting the user (except for in the correct link element). See also:
703
727
  // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current#description
704
728
  "aria-current": current ? "" : void 0,
729
+ classNames: mx4("grid grid-cols-subgrid col-[tree-row] mt-0.5 is-current:bg-active-surface", hoverableControls, hoverableFocusedKeyboardControls, hoverableFocusedWithinControls, hoverableDescriptionIcons, ghostFocusWithin, ghostHover, className),
705
730
  onKeyDown: handleKeyDown,
706
- onContextMenu: (event) => {
707
- event.preventDefault();
708
- setMenuOpen(true);
709
- }
731
+ onMouseEnter: handleItemHover,
732
+ onContextMenu: handleContextMenu
710
733
  }, /* @__PURE__ */ React7.createElement("div", {
711
734
  role: "none",
712
735
  className: "indent relative grid grid-cols-subgrid col-[tree-row]",
@@ -735,36 +758,31 @@ var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _dragg
735
758
  }), instruction && /* @__PURE__ */ React7.createElement(NaturalTreeItem.DropIndicator, {
736
759
  instruction,
737
760
  gap: 2
738
- }))), open && items.map((item2, index) => /* @__PURE__ */ React7.createElement(TreeItem, {
739
- key: item2.id,
740
- item: item2,
761
+ }))), open && childIds.map((childId, index) => /* @__PURE__ */ React7.createElement(TreeItemById, {
762
+ key: childId,
763
+ id: childId,
741
764
  path,
742
- last: index === items.length - 1,
743
- draggable: _draggable,
744
- renderColumns: Columns,
745
- blockInstruction,
746
- canDrop,
747
- canSelect,
748
- onOpenChange,
749
- onSelect
765
+ last: index === childIds.length - 1,
766
+ ...childProps
750
767
  })));
751
768
  };
752
769
  var TreeItem = /* @__PURE__ */ memo3(RawTreeItem);
770
+ var RawTreeItemById = ({ id, ...props }) => {
771
+ const { item: itemAtom } = useTree();
772
+ const item = useAtomValue(itemAtom(id));
773
+ if (!item) {
774
+ return null;
775
+ }
776
+ return /* @__PURE__ */ React7.createElement(TreeItem, {
777
+ item,
778
+ ...props
779
+ });
780
+ };
781
+ var TreeItemById = /* @__PURE__ */ memo3(RawTreeItemById);
753
782
 
754
783
  // src/components/Tree/Tree.tsx
755
- var Tree = ({ root, path, id, useItems, getProps, useIsOpen, useIsCurrent, draggable: draggable3 = false, gridTemplateColumns = "[tree-row-start] 1fr min-content [tree-row-end]", classNames, levelOffset, renderColumns, blockInstruction, canDrop, canSelect, onOpenChange, onSelect }) => {
756
- const context = useMemo2(() => ({
757
- useItems,
758
- getProps,
759
- useIsOpen,
760
- useIsCurrent
761
- }), [
762
- useItems,
763
- getProps,
764
- useIsOpen,
765
- useIsCurrent
766
- ]);
767
- const items = useItems(root);
784
+ var Tree = ({ model, rootId, path, id, draggable: draggable3 = false, gridTemplateColumns = "[tree-row-start] 1fr min-content [tree-row-end]", classNames, levelOffset, renderColumns, blockInstruction, canDrop, canSelect, onOpenChange, onSelect, onItemHover }) => {
785
+ const childIds = useAtomValue2(model.childIds(rootId));
768
786
  const treePath = useMemo2(() => path ? [
769
787
  ...path,
770
788
  id
@@ -774,15 +792,7 @@ var Tree = ({ root, path, id, useItems, getProps, useIsOpen, useIsCurrent, dragg
774
792
  id,
775
793
  path
776
794
  ]);
777
- return /* @__PURE__ */ React8.createElement(Treegrid2.Root, {
778
- gridTemplateColumns,
779
- classNames
780
- }, /* @__PURE__ */ React8.createElement(TreeProvider, {
781
- value: context
782
- }, items.map((item, index) => /* @__PURE__ */ React8.createElement(TreeItem, {
783
- key: item.id,
784
- item,
785
- last: index === items.length - 1,
795
+ const childProps = {
786
796
  path: treePath,
787
797
  levelOffset,
788
798
  draggable: draggable3,
@@ -791,7 +801,19 @@ var Tree = ({ root, path, id, useItems, getProps, useIsOpen, useIsCurrent, dragg
791
801
  canDrop,
792
802
  canSelect,
793
803
  onOpenChange,
794
- onSelect
804
+ onSelect,
805
+ onItemHover
806
+ };
807
+ return /* @__PURE__ */ React8.createElement(Treegrid2.Root, {
808
+ gridTemplateColumns,
809
+ classNames
810
+ }, /* @__PURE__ */ React8.createElement(TreeProvider, {
811
+ value: model
812
+ }, childIds.map((childId, index) => /* @__PURE__ */ React8.createElement(TreeItemById, {
813
+ key: childId,
814
+ id: childId,
815
+ last: index === childIds.length - 1,
816
+ ...childProps
795
817
  }))));
796
818
  };
797
819
 
@@ -812,13 +834,17 @@ var Path = {
812
834
  };
813
835
  export {
814
836
  Accordion,
837
+ DEFAULT_INDENTATION,
815
838
  List,
816
839
  Path,
817
840
  Tree,
818
841
  TreeDataSchema,
819
842
  TreeItem,
843
+ TreeItemById,
844
+ TreeItemToggle,
820
845
  TreeProvider,
821
846
  isTreeData,
847
+ paddingIndentation,
822
848
  useTree
823
849
  };
824
850
  //# sourceMappingURL=index.mjs.map