@neo4j-ndl/react 4.12.4 → 4.13.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 (90) hide show
  1. package/lib/cjs/data-grid/DataGrid.js +1 -0
  2. package/lib/cjs/data-grid/DataGrid.js.map +1 -1
  3. package/lib/cjs/icons/generated/custom/Appearance.js +30 -0
  4. package/lib/cjs/icons/generated/custom/Appearance.js.map +1 -0
  5. package/lib/cjs/icons/generated/custom/index.js +5 -3
  6. package/lib/cjs/icons/generated/custom/index.js.map +1 -1
  7. package/lib/cjs/next/index.js +16 -0
  8. package/lib/cjs/next/index.js.map +1 -1
  9. package/lib/cjs/next/tree-view/TreeView.js +460 -0
  10. package/lib/cjs/next/tree-view/TreeView.js.map +1 -0
  11. package/lib/cjs/next/tree-view/index.js +26 -0
  12. package/lib/cjs/next/tree-view/index.js.map +1 -0
  13. package/lib/cjs/next/tree-view/stories/index.js +60 -0
  14. package/lib/cjs/next/tree-view/stories/index.js.map +1 -0
  15. package/lib/cjs/next/tree-view/stories/tree-view-actions.story.js +36 -0
  16. package/lib/cjs/next/tree-view/stories/tree-view-actions.story.js.map +1 -0
  17. package/lib/cjs/next/tree-view/stories/tree-view-lazy.story.js +149 -0
  18. package/lib/cjs/next/tree-view/stories/tree-view-lazy.story.js.map +1 -0
  19. package/lib/cjs/next/tree-view/stories/tree-view-multi.story.js +73 -0
  20. package/lib/cjs/next/tree-view/stories/tree-view-multi.story.js.map +1 -0
  21. package/lib/cjs/next/tree-view/stories/tree-view-non-selectable-folders.story.js +35 -0
  22. package/lib/cjs/next/tree-view/stories/tree-view-non-selectable-folders.story.js.map +1 -0
  23. package/lib/cjs/next/tree-view/stories/tree-view-single.story.js +35 -0
  24. package/lib/cjs/next/tree-view/stories/tree-view-single.story.js.map +1 -0
  25. package/lib/cjs/next/tree-view/stories/tree-view-tooltip.story.js +34 -0
  26. package/lib/cjs/next/tree-view/stories/tree-view-tooltip.story.js.map +1 -0
  27. package/lib/cjs/next/tree-view/stories/tree-view-trailing.story.js +34 -0
  28. package/lib/cjs/next/tree-view/stories/tree-view-trailing.story.js.map +1 -0
  29. package/lib/cjs/next/tree-view/stories/tree-view-uncontrolled.story.js +33 -0
  30. package/lib/cjs/next/tree-view/stories/tree-view-uncontrolled.story.js.map +1 -0
  31. package/lib/esm/data-grid/DataGrid.js +1 -0
  32. package/lib/esm/data-grid/DataGrid.js.map +1 -1
  33. package/lib/esm/icons/generated/custom/Appearance.js +28 -0
  34. package/lib/esm/icons/generated/custom/Appearance.js.map +1 -0
  35. package/lib/esm/icons/generated/custom/index.js +1 -0
  36. package/lib/esm/icons/generated/custom/index.js.map +1 -1
  37. package/lib/esm/next/index.js +1 -1
  38. package/lib/esm/next/index.js.map +1 -1
  39. package/lib/esm/next/tree-view/TreeView.js +454 -0
  40. package/lib/esm/next/tree-view/TreeView.js.map +1 -0
  41. package/lib/esm/next/tree-view/index.js +22 -0
  42. package/lib/esm/next/tree-view/index.js.map +1 -0
  43. package/lib/esm/next/tree-view/stories/index.js +46 -0
  44. package/lib/esm/next/tree-view/stories/index.js.map +1 -0
  45. package/lib/esm/next/tree-view/stories/tree-view-actions.story.js +34 -0
  46. package/lib/esm/next/tree-view/stories/tree-view-actions.story.js.map +1 -0
  47. package/lib/esm/next/tree-view/stories/tree-view-lazy.story.js +147 -0
  48. package/lib/esm/next/tree-view/stories/tree-view-lazy.story.js.map +1 -0
  49. package/lib/esm/next/tree-view/stories/tree-view-multi.story.js +71 -0
  50. package/lib/esm/next/tree-view/stories/tree-view-multi.story.js.map +1 -0
  51. package/lib/esm/next/tree-view/stories/tree-view-non-selectable-folders.story.js +33 -0
  52. package/lib/esm/next/tree-view/stories/tree-view-non-selectable-folders.story.js.map +1 -0
  53. package/lib/esm/next/tree-view/stories/tree-view-single.story.js +33 -0
  54. package/lib/esm/next/tree-view/stories/tree-view-single.story.js.map +1 -0
  55. package/lib/esm/next/tree-view/stories/tree-view-tooltip.story.js +32 -0
  56. package/lib/esm/next/tree-view/stories/tree-view-tooltip.story.js.map +1 -0
  57. package/lib/esm/next/tree-view/stories/tree-view-trailing.story.js +32 -0
  58. package/lib/esm/next/tree-view/stories/tree-view-trailing.story.js.map +1 -0
  59. package/lib/esm/next/tree-view/stories/tree-view-uncontrolled.story.js +31 -0
  60. package/lib/esm/next/tree-view/stories/tree-view-uncontrolled.story.js.map +1 -0
  61. package/lib/types/data-grid/DataGrid.d.ts.map +1 -1
  62. package/lib/types/icons/generated/custom/Appearance.d.ts +29 -0
  63. package/lib/types/icons/generated/custom/Appearance.d.ts.map +1 -0
  64. package/lib/types/icons/generated/custom/index.d.ts +1 -0
  65. package/lib/types/icons/generated/custom/index.d.ts.map +1 -1
  66. package/lib/types/next/index.d.ts +1 -0
  67. package/lib/types/next/index.d.ts.map +1 -1
  68. package/lib/types/next/tree-view/TreeView.d.ts +79 -0
  69. package/lib/types/next/tree-view/TreeView.d.ts.map +1 -0
  70. package/lib/types/next/tree-view/index.d.ts +22 -0
  71. package/lib/types/next/tree-view/index.d.ts.map +1 -0
  72. package/lib/types/next/tree-view/stories/index.d.ts +37 -0
  73. package/lib/types/next/tree-view/stories/index.d.ts.map +1 -0
  74. package/lib/types/next/tree-view/stories/tree-view-actions.story.d.ts +24 -0
  75. package/lib/types/next/tree-view/stories/tree-view-actions.story.d.ts.map +1 -0
  76. package/lib/types/next/tree-view/stories/tree-view-lazy.story.d.ts +24 -0
  77. package/lib/types/next/tree-view/stories/tree-view-lazy.story.d.ts.map +1 -0
  78. package/lib/types/next/tree-view/stories/tree-view-multi.story.d.ts +24 -0
  79. package/lib/types/next/tree-view/stories/tree-view-multi.story.d.ts.map +1 -0
  80. package/lib/types/next/tree-view/stories/tree-view-non-selectable-folders.story.d.ts +24 -0
  81. package/lib/types/next/tree-view/stories/tree-view-non-selectable-folders.story.d.ts.map +1 -0
  82. package/lib/types/next/tree-view/stories/tree-view-single.story.d.ts +24 -0
  83. package/lib/types/next/tree-view/stories/tree-view-single.story.d.ts.map +1 -0
  84. package/lib/types/next/tree-view/stories/tree-view-tooltip.story.d.ts +24 -0
  85. package/lib/types/next/tree-view/stories/tree-view-tooltip.story.d.ts.map +1 -0
  86. package/lib/types/next/tree-view/stories/tree-view-trailing.story.d.ts +24 -0
  87. package/lib/types/next/tree-view/stories/tree-view-trailing.story.d.ts.map +1 -0
  88. package/lib/types/next/tree-view/stories/tree-view-uncontrolled.story.d.ts +24 -0
  89. package/lib/types/next/tree-view/stories/tree-view-uncontrolled.story.d.ts.map +1 -0
  90. package/package.json +2 -2
@@ -0,0 +1,454 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
13
+ /**
14
+ *
15
+ * Copyright (c) "Neo4j"
16
+ * Neo4j Sweden AB [http://neo4j.com]
17
+ *
18
+ * This file is part of Neo4j.
19
+ *
20
+ * Neo4j is free software: you can redistribute it and/or modify
21
+ * it under the terms of the GNU General Public License as published by
22
+ * the Free Software Foundation, either version 3 of the License, or
23
+ * (at your option) any later version.
24
+ *
25
+ * This program is distributed in the hope that it will be useful,
26
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
27
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
28
+ * GNU General Public License for more details.
29
+ *
30
+ * You should have received a copy of the GNU General Public License
31
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
32
+ */
33
+ import { useMergeRefs } from '@floating-ui/react';
34
+ import classNames from 'classnames';
35
+ import { Children, cloneElement, createContext, isValidElement, useCallback, useContext, useId, useRef, useState, } from 'react';
36
+ import { useSemicontrolledState } from '../../_common/use-semi-controlled-state';
37
+ import { Checkbox } from '../../checkbox';
38
+ import { CleanIconButton } from '../../clean-icon-button';
39
+ import { ConditionalWrap } from '../../conditional-wrap';
40
+ import { ChevronRightIconOutline, EllipsisHorizontalIconOutline, } from '../../icons';
41
+ import { Menu } from '../../menu';
42
+ import { Skeleton } from '../../skeleton';
43
+ import { Tooltip } from '../../tooltip';
44
+ const noop = () => undefined;
45
+ const TREE_EVENTS = {
46
+ action: 'treeitem-action',
47
+ collapse: 'treeitem-collapse',
48
+ expand: 'treeitem-expand',
49
+ select: 'treeitem-select',
50
+ };
51
+ const TreeViewContext = createContext({
52
+ focusedId: null,
53
+ level: 1,
54
+ selectionMode: 'single',
55
+ setFocusedId: noop,
56
+ });
57
+ function getVisibleTreeItems(root) {
58
+ return Array.from(root.querySelectorAll('[role="treeitem"]:not([role="group"][hidden] [role="treeitem"])')).filter((el) => {
59
+ let parent = el.parentElement;
60
+ while (parent && parent !== root) {
61
+ if (parent.getAttribute('role') === 'group' && parent.hidden) {
62
+ return false;
63
+ }
64
+ parent = parent.parentElement;
65
+ }
66
+ return true;
67
+ });
68
+ }
69
+ function annotateTreeItems(children) {
70
+ const items = Children.toArray(children);
71
+ const treeItemCount = items.filter((child) => isValidElement(child) && child.type === Item).length;
72
+ let posInSet = 0;
73
+ return Children.map(children, (child) => {
74
+ if (isValidElement(child) && child.type === Item) {
75
+ posInSet++;
76
+ return cloneElement(child, {
77
+ 'aria-posinset': posInSet,
78
+ 'aria-setsize': treeItemCount,
79
+ });
80
+ }
81
+ return child;
82
+ });
83
+ }
84
+ /**
85
+ * Root container for a tree view. Renders a `role="tree"` element with full
86
+ * keyboard navigation (arrow keys, Home/End, Enter/Space) following the
87
+ * WAI-ARIA TreeView pattern.
88
+ *
89
+ * Direct children should be `TreeView.Item` or `TreeView.SkeletonItem`.
90
+ *
91
+ * @example
92
+ * ```tsx
93
+ * <TreeView ariaLabel="Files">
94
+ * <TreeView.Item title="README.md" onSelectedChange={setSelected} isSelected={selected} />
95
+ * </TreeView>
96
+ * ```
97
+ *
98
+ * @alpha - this component is still in development and may change in the future. It might not have feature parity with the old tree view yet.
99
+ */
100
+ const Root = (_a) => {
101
+ var { children, selectionMode = 'single', ariaLabel, ariaLabelledby, className, style, htmlAttributes, ref } = _a, restProps = __rest(_a, ["children", "selectionMode", "ariaLabel", "ariaLabelledby", "className", "style", "htmlAttributes", "ref"]);
102
+ const treeRef = useRef(null);
103
+ const mergedRef = useMergeRefs([treeRef, ref]);
104
+ const [focusedId, setFocusedId] = useState(null);
105
+ const handleKeyDown = useCallback((e) => {
106
+ const root = treeRef.current;
107
+ if (!root) {
108
+ return;
109
+ }
110
+ const items = getVisibleTreeItems(root);
111
+ if (items.length === 0) {
112
+ return;
113
+ }
114
+ const currentIndex = items.findIndex((el) => el.id === focusedId);
115
+ let isHandled = true;
116
+ switch (e.key) {
117
+ case 'ArrowDown': {
118
+ const nextIndex = currentIndex < items.length - 1 ? currentIndex + 1 : currentIndex;
119
+ const nextItem = items[nextIndex];
120
+ if (nextItem) {
121
+ setFocusedId(nextItem.id);
122
+ nextItem.focus();
123
+ }
124
+ break;
125
+ }
126
+ case 'ArrowUp': {
127
+ const prevIndex = currentIndex > 0 ? currentIndex - 1 : 0;
128
+ const prevItem = items[prevIndex];
129
+ if (prevItem) {
130
+ setFocusedId(prevItem.id);
131
+ prevItem.focus();
132
+ }
133
+ break;
134
+ }
135
+ case 'ArrowRight': {
136
+ const current = currentIndex >= 0 ? items[currentIndex] : null;
137
+ if (!current) {
138
+ break;
139
+ }
140
+ const isExpanded = current.getAttribute('aria-expanded');
141
+ if (isExpanded === 'false') {
142
+ current.dispatchEvent(new CustomEvent(TREE_EVENTS.expand));
143
+ }
144
+ else if (isExpanded === 'true') {
145
+ const nextIndex = currentIndex + 1;
146
+ if (nextIndex < items.length) {
147
+ const nextItem = items[nextIndex];
148
+ setFocusedId(nextItem.id);
149
+ nextItem.focus();
150
+ }
151
+ }
152
+ break;
153
+ }
154
+ case 'ArrowLeft': {
155
+ const current = currentIndex >= 0 ? items[currentIndex] : null;
156
+ if (!current) {
157
+ break;
158
+ }
159
+ const isExpanded = current.getAttribute('aria-expanded');
160
+ if (isExpanded === 'true') {
161
+ current.dispatchEvent(new CustomEvent(TREE_EVENTS.collapse));
162
+ }
163
+ else {
164
+ const parentGroup = current.closest('[role="group"]');
165
+ if (parentGroup === null || parentGroup === void 0 ? void 0 : parentGroup.id) {
166
+ const parentItem = root.querySelector(`[aria-owns="${parentGroup.id}"]`);
167
+ if (parentItem) {
168
+ setFocusedId(parentItem.id);
169
+ parentItem.focus();
170
+ }
171
+ }
172
+ }
173
+ break;
174
+ }
175
+ case 'Home': {
176
+ const first = items[0];
177
+ if (first) {
178
+ setFocusedId(first.id);
179
+ first.focus();
180
+ }
181
+ break;
182
+ }
183
+ case 'End': {
184
+ const last = items[items.length - 1];
185
+ if (last) {
186
+ setFocusedId(last.id);
187
+ last.focus();
188
+ }
189
+ break;
190
+ }
191
+ case 'Enter':
192
+ case ' ': {
193
+ const current = currentIndex >= 0 ? items[currentIndex] : null;
194
+ if (current) {
195
+ current.dispatchEvent(new CustomEvent(TREE_EVENTS.select));
196
+ }
197
+ break;
198
+ }
199
+ case 'F10': {
200
+ if (e.shiftKey) {
201
+ const current = currentIndex >= 0 ? items[currentIndex] : null;
202
+ if (current) {
203
+ current.dispatchEvent(new CustomEvent(TREE_EVENTS.action));
204
+ }
205
+ }
206
+ else {
207
+ isHandled = false;
208
+ }
209
+ break;
210
+ }
211
+ default:
212
+ isHandled = false;
213
+ }
214
+ if (isHandled) {
215
+ e.preventDefault();
216
+ e.stopPropagation();
217
+ }
218
+ }, [focusedId]);
219
+ const handleFocus = useCallback((e) => {
220
+ const root = treeRef.current;
221
+ if (!root) {
222
+ return;
223
+ }
224
+ if (e.target === root) {
225
+ const items = getVisibleTreeItems(root);
226
+ const alreadyFocused = focusedId
227
+ ? items.find((el) => el.id === focusedId)
228
+ : null;
229
+ const target = alreadyFocused !== null && alreadyFocused !== void 0 ? alreadyFocused : items[0];
230
+ if (target) {
231
+ setFocusedId(target.id);
232
+ target.focus();
233
+ }
234
+ }
235
+ }, [focusedId]);
236
+ const classes = classNames(className, 'ndl-tree-view-new');
237
+ return (_jsx(TreeViewContext.Provider, { value: { focusedId, level: 1, selectionMode, setFocusedId }, children: _jsx("div", Object.assign({ ref: mergedRef, role: "tree", "aria-multiselectable": selectionMode === 'multiple' || undefined, tabIndex: 0, className: classes, onKeyDown: handleKeyDown, onFocus: handleFocus, "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : undefined, "aria-labelledby": ariaLabelledby, style: style }, htmlAttributes, restProps, { children: annotateTreeItems(children) })) }));
238
+ };
239
+ /**
240
+ * A single item within a `TreeView`. Renders a `role="treeitem"` element that
241
+ * supports selection, expansion, leading/trailing visuals, and an action menu.
242
+ *
243
+ * The `title` prop provides the item's label content. Nesting `TreeView.Item`
244
+ * elements as `children` creates a hierarchical tree structure.
245
+ *
246
+ * Supports both controlled (`isExpanded`) and uncontrolled (`defaultExpanded`)
247
+ * expansion, as well as lazy loading via `hasChildren` + `isLoading`.
248
+ *
249
+ * @example
250
+ * ```tsx
251
+ * <TreeView.Item
252
+ * title="src"
253
+ * leadingVisual={<FolderIcon />}
254
+ * isSelected={selected}
255
+ * onSelectedChange={setSelected}
256
+ * >
257
+ * <TreeView.Item title="index.ts" />
258
+ * </TreeView.Item>
259
+ * ```
260
+ */
261
+ const Item = (_a) => {
262
+ var { actionMenuItems, children, defaultExpanded = false, hasChildren: hasChildrenProp, isDisabled, isExpanded: isExpandedProp, isIndeterminate, isLoading, isSelected, leadingVisual, title, tooltipContent, tooltipProps, trailingContent, onExpandedChange, onSelectedChange, actionMenuProps, className, style, htmlAttributes, ref } = _a, restProps = __rest(_a, ["actionMenuItems", "children", "defaultExpanded", "hasChildren", "isDisabled", "isExpanded", "isIndeterminate", "isLoading", "isSelected", "leadingVisual", "title", "tooltipContent", "tooltipProps", "trailingContent", "onExpandedChange", "onSelectedChange", "actionMenuProps", "className", "style", "htmlAttributes", "ref"]);
263
+ const generatedId = useId();
264
+ const itemId = `ndl-treeitem-${generatedId}`;
265
+ const titleId = `ndl-treeitem-title-${generatedId}`;
266
+ const groupId = `ndl-treegroup-${generatedId}`;
267
+ const itemRef = useRef(null);
268
+ const actionButtonRef = useRef(null);
269
+ const didOpenViaKeyboard = useRef(false);
270
+ const [isMenuOpen, setIsMenuOpen] = useState(false);
271
+ const { focusedId, level, selectionMode, setFocusedId } = useContext(TreeViewContext);
272
+ const isControlledExpansion = isExpandedProp !== undefined;
273
+ const [isExpanded, setIsExpanded] = useSemicontrolledState({
274
+ isControlled: isControlledExpansion,
275
+ onChange: onExpandedChange,
276
+ state: isExpandedProp !== null && isExpandedProp !== void 0 ? isExpandedProp : defaultExpanded,
277
+ });
278
+ const hasChildren = hasChildrenProp !== null && hasChildrenProp !== void 0 ? hasChildrenProp : Children.count(children) > 0;
279
+ const isSelectable = onSelectedChange !== undefined;
280
+ const isMultiple = selectionMode === 'multiple';
281
+ const toggleExpanded = useCallback(() => {
282
+ if (isDisabled) {
283
+ return;
284
+ }
285
+ if (hasChildren) {
286
+ setIsExpanded(!isExpanded);
287
+ }
288
+ }, [isDisabled, hasChildren, setIsExpanded, isExpanded]);
289
+ const handleSelect = useCallback(() => {
290
+ if (isDisabled) {
291
+ return;
292
+ }
293
+ onSelectedChange === null || onSelectedChange === void 0 ? void 0 : onSelectedChange(!isSelected);
294
+ }, [isDisabled, isSelected, onSelectedChange]);
295
+ const handleClick = useCallback(() => {
296
+ if (isDisabled) {
297
+ return;
298
+ }
299
+ setFocusedId(itemId);
300
+ if (isSelectable) {
301
+ handleSelect();
302
+ }
303
+ else {
304
+ toggleExpanded();
305
+ }
306
+ }, [
307
+ isDisabled,
308
+ setFocusedId,
309
+ itemId,
310
+ isSelectable,
311
+ handleSelect,
312
+ toggleExpanded,
313
+ ]);
314
+ const handleChevronClick = useCallback((e) => {
315
+ e.stopPropagation();
316
+ if (isDisabled) {
317
+ return;
318
+ }
319
+ setFocusedId(itemId);
320
+ toggleExpanded();
321
+ }, [isDisabled, setFocusedId, itemId, toggleExpanded]);
322
+ const handleMenuClose = useCallback(() => {
323
+ var _a;
324
+ setIsMenuOpen(false);
325
+ if (didOpenViaKeyboard.current) {
326
+ (_a = itemRef.current) === null || _a === void 0 ? void 0 : _a.focus();
327
+ didOpenViaKeyboard.current = false;
328
+ }
329
+ }, []);
330
+ const handleCustomEvents = useCallback((e) => {
331
+ if (e.type === TREE_EVENTS.expand) {
332
+ e.stopPropagation();
333
+ if (hasChildren && !isExpanded && !isDisabled) {
334
+ setIsExpanded(true);
335
+ }
336
+ }
337
+ else if (e.type === TREE_EVENTS.collapse) {
338
+ e.stopPropagation();
339
+ if (hasChildren && isExpanded && !isDisabled) {
340
+ setIsExpanded(false);
341
+ }
342
+ }
343
+ else if (e.type === TREE_EVENTS.select) {
344
+ e.stopPropagation();
345
+ if (isSelectable) {
346
+ handleSelect();
347
+ }
348
+ else {
349
+ toggleExpanded();
350
+ }
351
+ }
352
+ else if (e.type === TREE_EVENTS.action) {
353
+ e.stopPropagation();
354
+ if (actionMenuItems && !isDisabled) {
355
+ didOpenViaKeyboard.current = true;
356
+ setIsMenuOpen(true);
357
+ }
358
+ }
359
+ }, [
360
+ actionMenuItems,
361
+ hasChildren,
362
+ isExpanded,
363
+ isDisabled,
364
+ isSelectable,
365
+ setIsExpanded,
366
+ handleSelect,
367
+ toggleExpanded,
368
+ ]);
369
+ const callbackRef = useCallback((node) => {
370
+ const prev = itemRef.current;
371
+ if (prev) {
372
+ prev.removeEventListener(TREE_EVENTS.expand, handleCustomEvents);
373
+ prev.removeEventListener(TREE_EVENTS.collapse, handleCustomEvents);
374
+ prev.removeEventListener(TREE_EVENTS.select, handleCustomEvents);
375
+ prev.removeEventListener(TREE_EVENTS.action, handleCustomEvents);
376
+ }
377
+ itemRef.current = node;
378
+ if (node) {
379
+ node.addEventListener(TREE_EVENTS.expand, handleCustomEvents);
380
+ node.addEventListener(TREE_EVENTS.collapse, handleCustomEvents);
381
+ node.addEventListener(TREE_EVENTS.select, handleCustomEvents);
382
+ node.addEventListener(TREE_EVENTS.action, handleCustomEvents);
383
+ }
384
+ }, [handleCustomEvents]);
385
+ const mergedRef = useMergeRefs([callbackRef, ref]);
386
+ const isFocused = focusedId === itemId;
387
+ const selectionAriaProps = (() => {
388
+ if (!isSelectable) {
389
+ return {};
390
+ }
391
+ if (isMultiple) {
392
+ return {
393
+ 'aria-checked': isIndeterminate
394
+ ? 'mixed'
395
+ : (isSelected !== null && isSelected !== void 0 ? isSelected : false),
396
+ };
397
+ }
398
+ return { 'aria-selected': isSelected !== null && isSelected !== void 0 ? isSelected : false };
399
+ })();
400
+ const itemElement = (
401
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events -- keyboard handled on tree root; aria-selected/aria-checked applied via spread
402
+ _jsx("div", Object.assign({ ref: mergedRef, id: itemId,
403
+ // eslint-disable-next-line jsx-a11y/role-has-required-aria-props -- aria-selected/aria-checked applied conditionally via spread
404
+ role: "treeitem" }, selectionAriaProps, { "aria-expanded": hasChildren ? isExpanded : undefined, "aria-owns": hasChildren ? groupId : undefined, "aria-disabled": isDisabled || undefined, "aria-busy": isLoading || undefined, "aria-keyshortcuts": actionMenuItems ? 'Shift+F10' : undefined, "aria-labelledby": titleId, "aria-level": level, tabIndex: isFocused ? 0 : -1, className: classNames('ndl-tree-view-new-item', className, {
405
+ 'ndl-tree-view-new-item--disabled': isDisabled,
406
+ 'ndl-tree-view-new-item--parent': hasChildren,
407
+ 'ndl-tree-view-new-item--selected': isSelected && isSelectable,
408
+ }), style: Object.assign({ '--tree-level': level - 1 }, style), onClick: (e) => {
409
+ e.stopPropagation();
410
+ handleClick();
411
+ } }, htmlAttributes, restProps, { children: _jsxs("div", { className: classNames('ndl-tree-view-new-item-content', {
412
+ 'ndl-tree-view-new-item-content--parent': hasChildren,
413
+ }), children: [hasChildren && (
414
+ // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions -- keyboard handled on tree root
415
+ _jsx("span", { className: "ndl-tree-view-new-chevron", "aria-disabled": isDisabled, onClick: handleChevronClick, children: _jsx(ChevronRightIconOutline, { className: classNames('ndl-tree-view-new-chevron-icon', {
416
+ 'ndl-tree-view-new-chevron-icon--open': isExpanded,
417
+ }) }) })), leadingVisual && (_jsx("div", { className: "ndl-tree-view-new-item-content-leading-visual", children: leadingVisual })), isMultiple && isSelectable && (_jsx("div", { className: "ndl-tree-view-new-checkbox", inert: true, children: _jsx(Checkbox, { style: { borderWidth: '1.5px' }, ariaLabel: "Select", isChecked: isSelected, isIndeterminate: isIndeterminate, isDisabled: isDisabled, onChange: noop }) })), _jsx("div", { id: titleId, className: "ndl-tree-view-new-item-content-title", children: title }), trailingContent && (_jsx("div", { className: "ndl-tree-view-new-item-content-trailing-content", children: trailingContent })), actionMenuItems && (_jsxs("div", { className: classNames('ndl-tree-view-new-action', {
418
+ 'ndl-tree-view-new-action--visible': isMenuOpen,
419
+ }), children: [_jsx(CleanIconButton, { ref: actionButtonRef, size: "small", description: null, isDisabled: isDisabled, style: { height: '24px', width: '24px' }, htmlAttributes: {
420
+ 'aria-expanded': isMenuOpen || undefined,
421
+ 'aria-haspopup': 'menu',
422
+ 'aria-label': 'Actions',
423
+ onClick: (e) => {
424
+ e.stopPropagation();
425
+ didOpenViaKeyboard.current = false;
426
+ setIsMenuOpen((prev) => !prev);
427
+ },
428
+ tabIndex: -1,
429
+ }, children: _jsx(EllipsisHorizontalIconOutline, {}) }), _jsx(Menu, Object.assign({ isOpen: isMenuOpen, anchorRef: actionButtonRef, onClose: handleMenuClose }, actionMenuProps, { children: actionMenuItems }))] }))] }) })));
430
+ return (_jsxs(_Fragment, { children: [_jsx(ConditionalWrap, { shouldWrap: tooltipContent !== undefined && tooltipContent !== null, wrap: (children) => (_jsxs(Tooltip, Object.assign({ type: "simple", hoverDelay: { close: 0, open: 500 }, isDisabled: isMenuOpen, followCursor: true }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.root, { children: [_jsx(Tooltip.Trigger, Object.assign({ hasButtonWrapper: true }, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.trigger, { children: children })), _jsx(Tooltip.Content, Object.assign({}, tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.content, { children: tooltipContent }))] }))), children: itemElement }), hasChildren && (_jsx(TreeViewContext.Provider, { value: { focusedId, level: level + 1, selectionMode, setFocusedId }, children: _jsx("div", { role: "group", id: groupId, hidden: !isExpanded, style: { '--tree-level': level - 1 }, children: annotateTreeItems(children) }) }))] }));
431
+ };
432
+ /**
433
+ * A skeleton placeholder for tree items that are being loaded. Renders one or
434
+ * more `Skeleton` rows at the current nesting depth. The element is
435
+ * `aria-hidden` since it is purely a visual indicator and not interactive.
436
+ *
437
+ * Typically used inside a `TreeView.Item` that has `isLoading` set, to give
438
+ * the user a visual hint that child items are being fetched.
439
+ *
440
+ * @example
441
+ * ```tsx
442
+ * <TreeView.Item title="Lazy folder" hasChildren isLoading={isLoading} isExpanded>
443
+ * {isLoading && <TreeView.SkeletonItem rows={3} />}
444
+ * </TreeView.Item>
445
+ * ```
446
+ */
447
+ const SkeletonItem = (_a) => {
448
+ var { rows = 1, className, style, htmlAttributes, ref } = _a, restProps = __rest(_a, ["rows", "className", "style", "htmlAttributes", "ref"]);
449
+ const { level } = useContext(TreeViewContext);
450
+ return (_jsx("div", Object.assign({ ref: ref, "aria-hidden": "true", className: classNames('ndl-tree-view-new-skeleton', className), style: Object.assign({ '--tree-level': level - 1 }, style) }, htmlAttributes, restProps, { children: Array.from({ length: rows }, (_, i) => (_jsx(Skeleton, { height: "18px", width: "100%" }, i))) })));
451
+ };
452
+ const TreeView = Object.assign(Root, { Item, SkeletonItem });
453
+ export { TreeView };
454
+ //# sourceMappingURL=TreeView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TreeView.js","sourceRoot":"","sources":["../../../../src/next/tree-view/TreeView.tsx"],"names":[],"mappings":";;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,aAAa,EACb,cAAc,EACd,WAAW,EACX,UAAU,EACV,KAAK,EACL,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AACjF,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EACL,uBAAuB,EACvB,6BAA6B,GAC9B,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAWxC,MAAM,IAAI,GAAG,GAAG,EAAE,CAAC,SAAS,CAAC;AAE7B,MAAM,WAAW,GAAG;IAClB,MAAM,EAAE,iBAAiB;IACzB,QAAQ,EAAE,mBAAmB;IAC7B,MAAM,EAAE,iBAAiB;IACzB,MAAM,EAAE,iBAAiB;CACjB,CAAC;AAEX,MAAM,eAAe,GAAG,aAAa,CAAuB;IAC1D,SAAS,EAAE,IAAI;IACf,KAAK,EAAE,CAAC;IACR,aAAa,EAAE,QAAQ;IACvB,YAAY,EAAE,IAAI;CACnB,CAAC,CAAC;AAEH,SAAS,mBAAmB,CAAC,IAAiB;IAC5C,OAAO,KAAK,CAAC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AAC,QAAQ,CAAC,GACxB,GACmB,CAC5B,IACA,CACJ,CAAC;AACJ,CAAC,CAAC;AAOF;;;;;;;;;;;;;;GAcG;AACH,MAAM,YAAY,GAAG,CAAC,EAOkB,EAAE,EAAE;QAPtB,EACpB,IAAI,GAAG,CAAC,EACR,SAAS,EACT,KAAK,EACL,cAAc,EACd,GAAG,OAEmC,EADnC,SAAS,cANQ,uDAOrB,CADa;IAEZ,MAAM,EAAE,KAAK,EAAE,GAAG,UAAU,CAAC,eAAe,CAAC,CAAC;IAC9C,OAAO,CACL,4BACE,GAAG,EAAE,GAAG,iBACI,MAAM,EAClB,SAAS,EAAE,UAAU,CAAC,4BAA4B,EAAE,SAAS,CAAC,EAC9D,KAAK,EAAE,gBAAE,cAAc,EAAE,KAAK,GAAG,CAAC,IAAK,KAAK,CAAyB,IACjE,cAAc,EACd,SAAS,cAEZ,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CACtC,KAAC,QAAQ,IAAS,MAAM,EAAC,MAAM,EAAC,KAAK,EAAC,MAAM,IAA7B,CAAC,CAA+B,CAChD,CAAC,IACE,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,CAAC,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport { useMergeRefs } from '@floating-ui/react';\nimport classNames from 'classnames';\nimport {\n Children,\n cloneElement,\n createContext,\n isValidElement,\n useCallback,\n useContext,\n useId,\n useRef,\n useState,\n} from 'react';\n\nimport { type CommonProps, type TooltipObjectProps } from '../../_common/types';\nimport { useSemicontrolledState } from '../../_common/use-semi-controlled-state';\nimport { Checkbox } from '../../checkbox';\nimport { CleanIconButton } from '../../clean-icon-button';\nimport { ConditionalWrap } from '../../conditional-wrap';\nimport {\n ChevronRightIconOutline,\n EllipsisHorizontalIconOutline,\n} from '../../icons';\nimport { Menu } from '../../menu';\nimport { Skeleton } from '../../skeleton';\nimport { Tooltip } from '../../tooltip';\n\ntype SelectionMode = 'single' | 'multiple';\n\ntype TreeViewContextValue = {\n focusedId: string | null;\n level: number;\n selectionMode: SelectionMode;\n setFocusedId: (id: string | null) => void;\n};\n\nconst noop = () => undefined;\n\nconst TREE_EVENTS = {\n action: 'treeitem-action',\n collapse: 'treeitem-collapse',\n expand: 'treeitem-expand',\n select: 'treeitem-select',\n} as const;\n\nconst TreeViewContext = createContext<TreeViewContextValue>({\n focusedId: null,\n level: 1,\n selectionMode: 'single',\n setFocusedId: noop,\n});\n\nfunction getVisibleTreeItems(root: HTMLElement): HTMLElement[] {\n return Array.from(\n root.querySelectorAll<HTMLElement>(\n '[role=\"treeitem\"]:not([role=\"group\"][hidden] [role=\"treeitem\"])',\n ),\n ).filter((el) => {\n let parent = el.parentElement;\n while (parent && parent !== root) {\n if (parent.getAttribute('role') === 'group' && parent.hidden) {\n return false;\n }\n parent = parent.parentElement;\n }\n return true;\n });\n}\n\nfunction annotateTreeItems(children: React.ReactNode): React.ReactNode {\n const items = Children.toArray(children);\n const treeItemCount = items.filter(\n (child): child is React.ReactElement =>\n isValidElement(child) && child.type === Item,\n ).length;\n\n let posInSet = 0;\n return Children.map(children, (child) => {\n if (isValidElement(child) && child.type === Item) {\n posInSet++;\n return cloneElement(\n child as React.ReactElement<React.HTMLAttributes<HTMLElement>>,\n {\n 'aria-posinset': posInSet,\n 'aria-setsize': treeItemCount,\n },\n );\n }\n return child;\n });\n}\n\ntype RootProps = {\n /** The aria-label for the tree. Required for accessibility, unless using ariaLabelledby. Pass null to omit. */\n ariaLabel: string | null;\n /** The aria-labelledby for the tree. Pass a string of space-separated IDs of elements that label the tree. */\n ariaLabelledby?: string;\n /** The children of the tree. Should be TreeView.Item components or TreeView.SkeletonItem components only. */\n children?: React.ReactNode;\n /** Selection mode for the tree. Defaults to \"single\". */\n selectionMode?: SelectionMode;\n};\n\n/**\n * Root container for a tree view. Renders a `role=\"tree\"` element with full\n * keyboard navigation (arrow keys, Home/End, Enter/Space) following the\n * WAI-ARIA TreeView pattern.\n *\n * Direct children should be `TreeView.Item` or `TreeView.SkeletonItem`.\n *\n * @example\n * ```tsx\n * <TreeView ariaLabel=\"Files\">\n * <TreeView.Item title=\"README.md\" onSelectedChange={setSelected} isSelected={selected} />\n * </TreeView>\n * ```\n *\n * @alpha - this component is still in development and may change in the future. It might not have feature parity with the old tree view yet.\n */\nconst Root = ({\n children,\n selectionMode = 'single',\n ariaLabel,\n ariaLabelledby,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', RootProps>) => {\n const treeRef = useRef<HTMLDivElement>(null);\n const mergedRef = useMergeRefs([treeRef, ref]);\n const [focusedId, setFocusedId] = useState<string | null>(null);\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLDivElement>) => {\n const root = treeRef.current;\n if (!root) {\n return;\n }\n\n const items = getVisibleTreeItems(root);\n if (items.length === 0) {\n return;\n }\n\n const currentIndex = items.findIndex((el) => el.id === focusedId);\n let isHandled = true;\n\n switch (e.key) {\n case 'ArrowDown': {\n const nextIndex =\n currentIndex < items.length - 1 ? currentIndex + 1 : currentIndex;\n const nextItem = items[nextIndex];\n if (nextItem) {\n setFocusedId(nextItem.id);\n nextItem.focus();\n }\n break;\n }\n case 'ArrowUp': {\n const prevIndex = currentIndex > 0 ? currentIndex - 1 : 0;\n const prevItem = items[prevIndex];\n if (prevItem) {\n setFocusedId(prevItem.id);\n prevItem.focus();\n }\n break;\n }\n case 'ArrowRight': {\n const current = currentIndex >= 0 ? items[currentIndex] : null;\n if (!current) {\n break;\n }\n const isExpanded = current.getAttribute('aria-expanded');\n if (isExpanded === 'false') {\n current.dispatchEvent(new CustomEvent(TREE_EVENTS.expand));\n } else if (isExpanded === 'true') {\n const nextIndex = currentIndex + 1;\n if (nextIndex < items.length) {\n const nextItem = items[nextIndex];\n setFocusedId(nextItem.id);\n nextItem.focus();\n }\n }\n break;\n }\n case 'ArrowLeft': {\n const current = currentIndex >= 0 ? items[currentIndex] : null;\n if (!current) {\n break;\n }\n const isExpanded = current.getAttribute('aria-expanded');\n if (isExpanded === 'true') {\n current.dispatchEvent(new CustomEvent(TREE_EVENTS.collapse));\n } else {\n const parentGroup = current.closest('[role=\"group\"]');\n if (parentGroup?.id) {\n const parentItem = root.querySelector<HTMLElement>(\n `[aria-owns=\"${parentGroup.id}\"]`,\n );\n if (parentItem) {\n setFocusedId(parentItem.id);\n parentItem.focus();\n }\n }\n }\n break;\n }\n case 'Home': {\n const first = items[0];\n if (first) {\n setFocusedId(first.id);\n first.focus();\n }\n break;\n }\n case 'End': {\n const last = items[items.length - 1];\n if (last) {\n setFocusedId(last.id);\n last.focus();\n }\n break;\n }\n case 'Enter':\n case ' ': {\n const current = currentIndex >= 0 ? items[currentIndex] : null;\n if (current) {\n current.dispatchEvent(new CustomEvent(TREE_EVENTS.select));\n }\n break;\n }\n case 'F10': {\n if (e.shiftKey) {\n const current = currentIndex >= 0 ? items[currentIndex] : null;\n if (current) {\n current.dispatchEvent(new CustomEvent(TREE_EVENTS.action));\n }\n } else {\n isHandled = false;\n }\n break;\n }\n default:\n isHandled = false;\n }\n\n if (isHandled) {\n e.preventDefault();\n e.stopPropagation();\n }\n },\n [focusedId],\n );\n\n const handleFocus = useCallback(\n (e: React.FocusEvent<HTMLDivElement>) => {\n const root = treeRef.current;\n if (!root) {\n return;\n }\n\n if (e.target === root) {\n const items = getVisibleTreeItems(root);\n const alreadyFocused = focusedId\n ? items.find((el) => el.id === focusedId)\n : null;\n const target = alreadyFocused ?? items[0];\n if (target) {\n setFocusedId(target.id);\n target.focus();\n }\n }\n },\n [focusedId],\n );\n\n const classes = classNames(className, 'ndl-tree-view-new');\n\n return (\n <TreeViewContext.Provider\n value={{ focusedId, level: 1, selectionMode, setFocusedId }}\n >\n <div\n ref={mergedRef}\n role=\"tree\"\n aria-multiselectable={selectionMode === 'multiple' || undefined}\n tabIndex={0}\n className={classes}\n onKeyDown={handleKeyDown}\n onFocus={handleFocus}\n aria-label={ariaLabel ?? undefined}\n aria-labelledby={ariaLabelledby}\n style={style}\n {...htmlAttributes}\n {...restProps}\n >\n {annotateTreeItems(children)}\n </div>\n </TreeViewContext.Provider>\n );\n};\n\ntype ItemProps = {\n /** Nested TreeView.Item or TreeView.SkeletonItem elements rendered as sub-items in a collapsible group. */\n children?: React.ReactNode;\n /** The label content displayed in the item row. */\n title?: React.ReactNode;\n /** Default expansion for uncontrolled items */\n defaultExpanded?: boolean;\n /** Whether the item has children. Decides if the item should render a chevron for expansion. Needed for lazy loading. */\n hasChildren?: boolean;\n /** Whether the item is disabled */\n isDisabled?: boolean;\n /** Whether the item is expanded. Makes the item controlled. */\n isExpanded?: boolean;\n /** Whether the item is in an indeterminate state. Only meaningful in multi-select mode for parent nodes. */\n isIndeterminate?: boolean;\n /** Whether the item is loading. Applies aria-busy=\"true\" to the item. */\n isLoading?: boolean;\n /** Whether the item is selected */\n isSelected?: boolean;\n /** Leading visual for the item. */\n leadingVisual?: React.ReactNode;\n /** Trailing content for the item. Shown after the children but before the action menu. */\n trailingContent?: React.ReactNode;\n /** ReactNode containing Menu.Item elements to render in an action menu. When provided, an action button is rendered. */\n actionMenuItems?: React.ReactNode;\n /** Props forwarded to the Menu sub-components (anchorRef, onClose). */\n actionMenuProps?: React.ComponentProps<typeof Menu>;\n /** Content rendered inside the tooltip. When provided, the item is wrapped in a Tooltip. */\n tooltipContent?: React.ReactNode;\n /** Props forwarded to the Tooltip sub-components (root, trigger, content). */\n tooltipProps?: TooltipObjectProps;\n /** Callback called when the item is expanded/collapsed. */\n onExpandedChange?: (isExpanded: boolean) => void;\n /** Callback called when the item is selected/deselected. */\n onSelectedChange?: (isSelected: boolean) => void;\n};\n\n/**\n * A single item within a `TreeView`. Renders a `role=\"treeitem\"` element that\n * supports selection, expansion, leading/trailing visuals, and an action menu.\n *\n * The `title` prop provides the item's label content. Nesting `TreeView.Item`\n * elements as `children` creates a hierarchical tree structure.\n *\n * Supports both controlled (`isExpanded`) and uncontrolled (`defaultExpanded`)\n * expansion, as well as lazy loading via `hasChildren` + `isLoading`.\n *\n * @example\n * ```tsx\n * <TreeView.Item\n * title=\"src\"\n * leadingVisual={<FolderIcon />}\n * isSelected={selected}\n * onSelectedChange={setSelected}\n * >\n * <TreeView.Item title=\"index.ts\" />\n * </TreeView.Item>\n * ```\n */\nconst Item = ({\n actionMenuItems,\n children,\n defaultExpanded = false,\n hasChildren: hasChildrenProp,\n isDisabled,\n isExpanded: isExpandedProp,\n isIndeterminate,\n isLoading,\n isSelected,\n leadingVisual,\n title,\n tooltipContent,\n tooltipProps,\n trailingContent,\n onExpandedChange,\n onSelectedChange,\n actionMenuProps,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', ItemProps>) => {\n const generatedId = useId();\n const itemId = `ndl-treeitem-${generatedId}`;\n const titleId = `ndl-treeitem-title-${generatedId}`;\n const groupId = `ndl-treegroup-${generatedId}`;\n const itemRef = useRef<HTMLDivElement>(null);\n const actionButtonRef = useRef<HTMLButtonElement>(null);\n const didOpenViaKeyboard = useRef(false);\n const [isMenuOpen, setIsMenuOpen] = useState(false);\n const { focusedId, level, selectionMode, setFocusedId } =\n useContext(TreeViewContext);\n\n const isControlledExpansion = isExpandedProp !== undefined;\n const [isExpanded, setIsExpanded] = useSemicontrolledState({\n isControlled: isControlledExpansion,\n onChange: onExpandedChange,\n state: isExpandedProp ?? defaultExpanded,\n });\n\n const hasChildren = hasChildrenProp ?? Children.count(children) > 0;\n const isSelectable = onSelectedChange !== undefined;\n const isMultiple = selectionMode === 'multiple';\n\n const toggleExpanded = useCallback(() => {\n if (isDisabled) {\n return;\n }\n if (hasChildren) {\n setIsExpanded(!isExpanded);\n }\n }, [isDisabled, hasChildren, setIsExpanded, isExpanded]);\n\n const handleSelect = useCallback(() => {\n if (isDisabled) {\n return;\n }\n onSelectedChange?.(!isSelected);\n }, [isDisabled, isSelected, onSelectedChange]);\n\n const handleClick = useCallback(() => {\n if (isDisabled) {\n return;\n }\n setFocusedId(itemId);\n if (isSelectable) {\n handleSelect();\n } else {\n toggleExpanded();\n }\n }, [\n isDisabled,\n setFocusedId,\n itemId,\n isSelectable,\n handleSelect,\n toggleExpanded,\n ]);\n\n const handleChevronClick = useCallback(\n (e: React.MouseEvent) => {\n e.stopPropagation();\n if (isDisabled) {\n return;\n }\n setFocusedId(itemId);\n toggleExpanded();\n },\n [isDisabled, setFocusedId, itemId, toggleExpanded],\n );\n\n const handleMenuClose = useCallback(() => {\n setIsMenuOpen(false);\n if (didOpenViaKeyboard.current) {\n itemRef.current?.focus();\n didOpenViaKeyboard.current = false;\n }\n }, []);\n\n const handleCustomEvents = useCallback(\n (e: Event) => {\n if (e.type === TREE_EVENTS.expand) {\n e.stopPropagation();\n if (hasChildren && !isExpanded && !isDisabled) {\n setIsExpanded(true);\n }\n } else if (e.type === TREE_EVENTS.collapse) {\n e.stopPropagation();\n if (hasChildren && isExpanded && !isDisabled) {\n setIsExpanded(false);\n }\n } else if (e.type === TREE_EVENTS.select) {\n e.stopPropagation();\n if (isSelectable) {\n handleSelect();\n } else {\n toggleExpanded();\n }\n } else if (e.type === TREE_EVENTS.action) {\n e.stopPropagation();\n if (actionMenuItems && !isDisabled) {\n didOpenViaKeyboard.current = true;\n setIsMenuOpen(true);\n }\n }\n },\n [\n actionMenuItems,\n hasChildren,\n isExpanded,\n isDisabled,\n isSelectable,\n setIsExpanded,\n handleSelect,\n toggleExpanded,\n ],\n );\n\n const callbackRef = useCallback(\n (node: HTMLDivElement | null) => {\n const prev = itemRef.current;\n if (prev) {\n prev.removeEventListener(TREE_EVENTS.expand, handleCustomEvents);\n prev.removeEventListener(TREE_EVENTS.collapse, handleCustomEvents);\n prev.removeEventListener(TREE_EVENTS.select, handleCustomEvents);\n prev.removeEventListener(TREE_EVENTS.action, handleCustomEvents);\n }\n (itemRef as React.MutableRefObject<HTMLDivElement | null>).current = node;\n if (node) {\n node.addEventListener(TREE_EVENTS.expand, handleCustomEvents);\n node.addEventListener(TREE_EVENTS.collapse, handleCustomEvents);\n node.addEventListener(TREE_EVENTS.select, handleCustomEvents);\n node.addEventListener(TREE_EVENTS.action, handleCustomEvents);\n }\n },\n [handleCustomEvents],\n );\n\n const mergedRef = useMergeRefs([callbackRef, ref]);\n\n const isFocused = focusedId === itemId;\n\n const selectionAriaProps = (() => {\n if (!isSelectable) {\n return {};\n }\n if (isMultiple) {\n return {\n 'aria-checked': isIndeterminate\n ? ('mixed' as const)\n : (isSelected ?? false),\n };\n }\n return { 'aria-selected': isSelected ?? false };\n })();\n\n const itemElement = (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events -- keyboard handled on tree root; aria-selected/aria-checked applied via spread\n <div\n ref={mergedRef}\n id={itemId}\n // eslint-disable-next-line jsx-a11y/role-has-required-aria-props -- aria-selected/aria-checked applied conditionally via spread\n role=\"treeitem\"\n {...selectionAriaProps}\n aria-expanded={hasChildren ? isExpanded : undefined}\n aria-owns={hasChildren ? groupId : undefined}\n aria-disabled={isDisabled || undefined}\n aria-busy={isLoading || undefined}\n aria-keyshortcuts={actionMenuItems ? 'Shift+F10' : undefined}\n aria-labelledby={titleId}\n aria-level={level}\n tabIndex={isFocused ? 0 : -1}\n className={classNames('ndl-tree-view-new-item', className, {\n 'ndl-tree-view-new-item--disabled': isDisabled,\n 'ndl-tree-view-new-item--parent': hasChildren,\n 'ndl-tree-view-new-item--selected': isSelected && isSelectable,\n })}\n style={{ '--tree-level': level - 1, ...style } as React.CSSProperties}\n onClick={(e) => {\n e.stopPropagation();\n handleClick();\n }}\n {...htmlAttributes}\n {...restProps}\n >\n <div\n className={classNames('ndl-tree-view-new-item-content', {\n 'ndl-tree-view-new-item-content--parent': hasChildren,\n })}\n >\n {hasChildren && (\n // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions -- keyboard handled on tree root\n <span\n className=\"ndl-tree-view-new-chevron\"\n aria-disabled={isDisabled}\n onClick={handleChevronClick}\n >\n <ChevronRightIconOutline\n className={classNames('ndl-tree-view-new-chevron-icon', {\n 'ndl-tree-view-new-chevron-icon--open': isExpanded,\n })}\n />\n </span>\n )}\n {leadingVisual && (\n <div className=\"ndl-tree-view-new-item-content-leading-visual\">\n {leadingVisual}\n </div>\n )}\n {isMultiple && isSelectable && (\n <div className=\"ndl-tree-view-new-checkbox\" inert>\n <Checkbox\n style={{ borderWidth: '1.5px' }}\n ariaLabel=\"Select\"\n isChecked={isSelected}\n isIndeterminate={isIndeterminate}\n isDisabled={isDisabled}\n onChange={noop}\n />\n </div>\n )}\n <div id={titleId} className=\"ndl-tree-view-new-item-content-title\">\n {title}\n </div>\n {trailingContent && (\n <div className=\"ndl-tree-view-new-item-content-trailing-content\">\n {trailingContent}\n </div>\n )}\n {actionMenuItems && (\n <div\n className={classNames('ndl-tree-view-new-action', {\n 'ndl-tree-view-new-action--visible': isMenuOpen,\n })}\n >\n <CleanIconButton\n ref={actionButtonRef}\n size=\"small\"\n description={null}\n isDisabled={isDisabled}\n style={{ height: '24px', width: '24px' }}\n htmlAttributes={{\n 'aria-expanded': isMenuOpen || undefined,\n 'aria-haspopup': 'menu',\n 'aria-label': 'Actions',\n onClick: (e: React.MouseEvent) => {\n e.stopPropagation();\n didOpenViaKeyboard.current = false;\n setIsMenuOpen((prev) => !prev);\n },\n tabIndex: -1,\n }}\n >\n <EllipsisHorizontalIconOutline />\n </CleanIconButton>\n <Menu\n isOpen={isMenuOpen}\n anchorRef={actionButtonRef}\n onClose={handleMenuClose}\n {...actionMenuProps}\n >\n {actionMenuItems}\n </Menu>\n </div>\n )}\n </div>\n </div>\n );\n\n return (\n <>\n <ConditionalWrap\n shouldWrap={tooltipContent !== undefined && tooltipContent !== null}\n wrap={(children) => (\n <Tooltip\n type=\"simple\"\n hoverDelay={{ close: 0, open: 500 }}\n isDisabled={isMenuOpen}\n followCursor={true}\n {...tooltipProps?.root}\n >\n <Tooltip.Trigger hasButtonWrapper {...tooltipProps?.trigger}>\n {children}\n </Tooltip.Trigger>\n <Tooltip.Content {...tooltipProps?.content}>\n {tooltipContent}\n </Tooltip.Content>\n </Tooltip>\n )}\n >\n {itemElement}\n </ConditionalWrap>\n {hasChildren && (\n <TreeViewContext.Provider\n value={{ focusedId, level: level + 1, selectionMode, setFocusedId }}\n >\n <div\n role=\"group\"\n id={groupId}\n hidden={!isExpanded}\n style={{ '--tree-level': level - 1 } as React.CSSProperties}\n >\n {annotateTreeItems(children)}\n </div>\n </TreeViewContext.Provider>\n )}\n </>\n );\n};\n\ntype SkeletonItemProps = {\n /** The number of rows to render. */\n rows?: number;\n};\n\n/**\n * A skeleton placeholder for tree items that are being loaded. Renders one or\n * more `Skeleton` rows at the current nesting depth. The element is\n * `aria-hidden` since it is purely a visual indicator and not interactive.\n *\n * Typically used inside a `TreeView.Item` that has `isLoading` set, to give\n * the user a visual hint that child items are being fetched.\n *\n * @example\n * ```tsx\n * <TreeView.Item title=\"Lazy folder\" hasChildren isLoading={isLoading} isExpanded>\n * {isLoading && <TreeView.SkeletonItem rows={3} />}\n * </TreeView.Item>\n * ```\n */\nconst SkeletonItem = ({\n rows = 1,\n className,\n style,\n htmlAttributes,\n ref,\n ...restProps\n}: CommonProps<'div', SkeletonItemProps>) => {\n const { level } = useContext(TreeViewContext);\n return (\n <div\n ref={ref}\n aria-hidden=\"true\"\n className={classNames('ndl-tree-view-new-skeleton', className)}\n style={{ '--tree-level': level - 1, ...style } as React.CSSProperties}\n {...htmlAttributes}\n {...restProps}\n >\n {Array.from({ length: rows }, (_, i) => (\n <Skeleton key={i} height=\"18px\" width=\"100%\" />\n ))}\n </div>\n );\n};\n\nconst TreeView = Object.assign(Root, { Item, SkeletonItem });\nexport { TreeView };\n"]}
@@ -0,0 +1,22 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ export { TreeView } from './TreeView';
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/next/tree-view/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { TreeView } from './TreeView';\n"]}
@@ -0,0 +1,46 @@
1
+ /**
2
+ *
3
+ * Copyright (c) "Neo4j"
4
+ * Neo4j Sweden AB [http://neo4j.com]
5
+ *
6
+ * This file is part of Neo4j.
7
+ *
8
+ * Neo4j is free software: you can redistribute it and/or modify
9
+ * it under the terms of the GNU General Public License as published by
10
+ * the Free Software Foundation, either version 3 of the License, or
11
+ * (at your option) any later version.
12
+ *
13
+ * This program is distributed in the hope that it will be useful,
14
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
15
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
+ * GNU General Public License for more details.
17
+ *
18
+ * You should have received a copy of the GNU General Public License
19
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
20
+ */
21
+ export { default as TreeViewLazyLoading } from './tree-view-lazy.story';
22
+ export { default as TreeViewMultiSelect } from './tree-view-multi.story';
23
+ export { default as TreeViewNonSelectableFolders } from './tree-view-non-selectable-folders.story';
24
+ export { default as TreeViewSingleSelect } from './tree-view-single.story';
25
+ export { default as TreeViewWithActions } from './tree-view-actions.story';
26
+ export { default as TreeViewUncontrolledExpansion } from './tree-view-uncontrolled.story';
27
+ export { default as TreeViewWithTrailingContent } from './tree-view-trailing.story';
28
+ export { default as TreeViewWithTooltip } from './tree-view-tooltip.story';
29
+ import { removeLicenseHeader } from '../../../_common/export-stories-utils';
30
+ import TreeViewActionsSrcRaw from './tree-view-actions.story?raw';
31
+ import TreeViewLazyLoadingSrcRaw from './tree-view-lazy.story?raw';
32
+ import TreeViewMultiSelectSrcRaw from './tree-view-multi.story?raw';
33
+ import TreeViewNonSelectableFoldersSrcRaw from './tree-view-non-selectable-folders.story?raw';
34
+ import TreeViewSingleSelectSrcRaw from './tree-view-single.story?raw';
35
+ import TreeViewTooltipSrcRaw from './tree-view-tooltip.story?raw';
36
+ import TreeViewTrailingContentSrcRaw from './tree-view-trailing.story?raw';
37
+ import TreeViewUncontrolledExpansionSrcRaw from './tree-view-uncontrolled.story?raw';
38
+ export const TreeViewActionsSrc = removeLicenseHeader(TreeViewActionsSrcRaw);
39
+ export const TreeViewLazyLoadingSrc = removeLicenseHeader(TreeViewLazyLoadingSrcRaw);
40
+ export const TreeViewMultiSelectSrc = removeLicenseHeader(TreeViewMultiSelectSrcRaw);
41
+ export const TreeViewNonSelectableFoldersSrc = removeLicenseHeader(TreeViewNonSelectableFoldersSrcRaw);
42
+ export const TreeViewSingleSelectSrc = removeLicenseHeader(TreeViewSingleSelectSrcRaw);
43
+ export const TreeViewTrailingContentSrc = removeLicenseHeader(TreeViewTrailingContentSrcRaw);
44
+ export const TreeViewTooltipSrc = removeLicenseHeader(TreeViewTooltipSrcRaw);
45
+ export const TreeViewUncontrolledExpansionSrc = removeLicenseHeader(TreeViewUncontrolledExpansionSrcRaw);
46
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/next/tree-view/stories/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AACzE,OAAO,EAAE,OAAO,IAAI,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AACnG,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAC3E,OAAO,EAAE,OAAO,IAAI,6BAA6B,EAAE,MAAM,gCAAgC,CAAC;AAC1F,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAE3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,qBAAqB,MAAM,+BAA+B,CAAC;AAClE,OAAO,yBAAyB,MAAM,4BAA4B,CAAC;AACnE,OAAO,yBAAyB,MAAM,6BAA6B,CAAC;AACpE,OAAO,kCAAkC,MAAM,8CAA8C,CAAC;AAC9F,OAAO,0BAA0B,MAAM,8BAA8B,CAAC;AACtE,OAAO,qBAAqB,MAAM,+BAA+B,CAAC;AAClE,OAAO,6BAA6B,MAAM,gCAAgC,CAAC;AAC3E,OAAO,mCAAmC,MAAM,oCAAoC,CAAC;AAErF,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CACvD,yBAAyB,CAC1B,CAAC;AACF,MAAM,CAAC,MAAM,sBAAsB,GAAG,mBAAmB,CACvD,yBAAyB,CAC1B,CAAC;AACF,MAAM,CAAC,MAAM,+BAA+B,GAAG,mBAAmB,CAChE,kCAAkC,CACnC,CAAC;AACF,MAAM,CAAC,MAAM,uBAAuB,GAAG,mBAAmB,CACxD,0BAA0B,CAC3B,CAAC;AACF,MAAM,CAAC,MAAM,0BAA0B,GAAG,mBAAmB,CAC3D,6BAA6B,CAC9B,CAAC;AACF,MAAM,CAAC,MAAM,kBAAkB,GAAG,mBAAmB,CAAC,qBAAqB,CAAC,CAAC;AAC7E,MAAM,CAAC,MAAM,gCAAgC,GAAG,mBAAmB,CACjE,mCAAmC,CACpC,CAAC","sourcesContent":["/**\n *\n * Copyright (c) \"Neo4j\"\n * Neo4j Sweden AB [http://neo4j.com]\n *\n * This file is part of Neo4j.\n *\n * Neo4j is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport { default as TreeViewLazyLoading } from './tree-view-lazy.story';\nexport { default as TreeViewMultiSelect } from './tree-view-multi.story';\nexport { default as TreeViewNonSelectableFolders } from './tree-view-non-selectable-folders.story';\nexport { default as TreeViewSingleSelect } from './tree-view-single.story';\nexport { default as TreeViewWithActions } from './tree-view-actions.story';\nexport { default as TreeViewUncontrolledExpansion } from './tree-view-uncontrolled.story';\nexport { default as TreeViewWithTrailingContent } from './tree-view-trailing.story';\nexport { default as TreeViewWithTooltip } from './tree-view-tooltip.story';\n\nimport { removeLicenseHeader } from '../../../_common/export-stories-utils';\nimport TreeViewActionsSrcRaw from './tree-view-actions.story?raw';\nimport TreeViewLazyLoadingSrcRaw from './tree-view-lazy.story?raw';\nimport TreeViewMultiSelectSrcRaw from './tree-view-multi.story?raw';\nimport TreeViewNonSelectableFoldersSrcRaw from './tree-view-non-selectable-folders.story?raw';\nimport TreeViewSingleSelectSrcRaw from './tree-view-single.story?raw';\nimport TreeViewTooltipSrcRaw from './tree-view-tooltip.story?raw';\nimport TreeViewTrailingContentSrcRaw from './tree-view-trailing.story?raw';\nimport TreeViewUncontrolledExpansionSrcRaw from './tree-view-uncontrolled.story?raw';\n\nexport const TreeViewActionsSrc = removeLicenseHeader(TreeViewActionsSrcRaw);\nexport const TreeViewLazyLoadingSrc = removeLicenseHeader(\n TreeViewLazyLoadingSrcRaw,\n);\nexport const TreeViewMultiSelectSrc = removeLicenseHeader(\n TreeViewMultiSelectSrcRaw,\n);\nexport const TreeViewNonSelectableFoldersSrc = removeLicenseHeader(\n TreeViewNonSelectableFoldersSrcRaw,\n);\nexport const TreeViewSingleSelectSrc = removeLicenseHeader(\n TreeViewSingleSelectSrcRaw,\n);\nexport const TreeViewTrailingContentSrc = removeLicenseHeader(\n TreeViewTrailingContentSrcRaw,\n);\nexport const TreeViewTooltipSrc = removeLicenseHeader(TreeViewTooltipSrcRaw);\nexport const TreeViewUncontrolledExpansionSrc = removeLicenseHeader(\n TreeViewUncontrolledExpansionSrcRaw,\n);\n"]}