@dxos/react-ui-list 0.8.4-main.fffef41 → 0.9.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 (99) hide show
  1. package/LICENSE +102 -5
  2. package/dist/lib/browser/index.mjs +1360 -730
  3. package/dist/lib/browser/index.mjs.map +4 -4
  4. package/dist/lib/browser/meta.json +1 -1
  5. package/dist/lib/node-esm/index.mjs +1360 -730
  6. package/dist/lib/node-esm/index.mjs.map +4 -4
  7. package/dist/lib/node-esm/meta.json +1 -1
  8. package/dist/types/src/components/Accordion/Accordion.d.ts +1 -1
  9. package/dist/types/src/components/Accordion/Accordion.d.ts.map +1 -1
  10. package/dist/types/src/components/Accordion/Accordion.stories.d.ts.map +1 -1
  11. package/dist/types/src/components/Accordion/AccordionItem.d.ts.map +1 -1
  12. package/dist/types/src/components/Accordion/AccordionRoot.d.ts +1 -1
  13. package/dist/types/src/components/Accordion/AccordionRoot.d.ts.map +1 -1
  14. package/dist/types/src/components/Combobox/Combobox.d.ts +105 -0
  15. package/dist/types/src/components/Combobox/Combobox.d.ts.map +1 -0
  16. package/dist/types/src/components/Combobox/Combobox.stories.d.ts +12 -0
  17. package/dist/types/src/components/Combobox/Combobox.stories.d.ts.map +1 -0
  18. package/dist/types/src/components/Combobox/index.d.ts +2 -0
  19. package/dist/types/src/components/Combobox/index.d.ts.map +1 -0
  20. package/dist/types/src/components/List/List.d.ts +19 -8
  21. package/dist/types/src/components/List/List.d.ts.map +1 -1
  22. package/dist/types/src/components/List/List.stories.d.ts +2 -2
  23. package/dist/types/src/components/List/List.stories.d.ts.map +1 -1
  24. package/dist/types/src/components/List/ListItem.d.ts +10 -8
  25. package/dist/types/src/components/List/ListItem.d.ts.map +1 -1
  26. package/dist/types/src/components/List/ListRoot.d.ts +2 -2
  27. package/dist/types/src/components/List/ListRoot.d.ts.map +1 -1
  28. package/dist/types/src/components/List/testing.d.ts +2 -2
  29. package/dist/types/src/components/List/testing.d.ts.map +1 -1
  30. package/dist/types/src/components/Listbox/Listbox.d.ts +27 -0
  31. package/dist/types/src/components/Listbox/Listbox.d.ts.map +1 -0
  32. package/dist/types/src/components/Listbox/Listbox.stories.d.ts +12 -0
  33. package/dist/types/src/components/Listbox/Listbox.stories.d.ts.map +1 -0
  34. package/dist/types/src/components/Listbox/index.d.ts +2 -0
  35. package/dist/types/src/components/Listbox/index.d.ts.map +1 -0
  36. package/dist/types/src/components/Picker/Picker.d.ts +49 -0
  37. package/dist/types/src/components/Picker/Picker.d.ts.map +1 -0
  38. package/dist/types/src/components/Picker/Picker.stories.d.ts +28 -0
  39. package/dist/types/src/components/Picker/Picker.stories.d.ts.map +1 -0
  40. package/dist/types/src/components/Picker/context.d.ts +29 -0
  41. package/dist/types/src/components/Picker/context.d.ts.map +1 -0
  42. package/dist/types/src/components/Picker/index.d.ts +3 -0
  43. package/dist/types/src/components/Picker/index.d.ts.map +1 -0
  44. package/dist/types/src/components/RowList/RowList.d.ts +61 -0
  45. package/dist/types/src/components/RowList/RowList.d.ts.map +1 -0
  46. package/dist/types/src/components/RowList/RowList.stories.d.ts +35 -0
  47. package/dist/types/src/components/RowList/RowList.stories.d.ts.map +1 -0
  48. package/dist/types/src/components/RowList/index.d.ts +3 -0
  49. package/dist/types/src/components/RowList/index.d.ts.map +1 -0
  50. package/dist/types/src/components/Tree/Tree.d.ts +10 -6
  51. package/dist/types/src/components/Tree/Tree.d.ts.map +1 -1
  52. package/dist/types/src/components/Tree/Tree.stories.d.ts +9 -28
  53. package/dist/types/src/components/Tree/Tree.stories.d.ts.map +1 -1
  54. package/dist/types/src/components/Tree/TreeContext.d.ts +25 -8
  55. package/dist/types/src/components/Tree/TreeContext.d.ts.map +1 -1
  56. package/dist/types/src/components/Tree/TreeItem.d.ts +20 -3
  57. package/dist/types/src/components/Tree/TreeItem.d.ts.map +1 -1
  58. package/dist/types/src/components/Tree/TreeItemHeading.d.ts +4 -0
  59. package/dist/types/src/components/Tree/TreeItemHeading.d.ts.map +1 -1
  60. package/dist/types/src/components/Tree/helpers.d.ts.map +1 -1
  61. package/dist/types/src/components/Tree/index.d.ts +2 -0
  62. package/dist/types/src/components/Tree/index.d.ts.map +1 -1
  63. package/dist/types/src/components/Tree/testing.d.ts +3 -3
  64. package/dist/types/src/components/Tree/testing.d.ts.map +1 -1
  65. package/dist/types/src/components/index.d.ts +4 -0
  66. package/dist/types/src/components/index.d.ts.map +1 -1
  67. package/dist/types/src/util/path.d.ts.map +1 -1
  68. package/dist/types/tsconfig.tsbuildinfo +1 -1
  69. package/package.json +35 -32
  70. package/src/components/Accordion/Accordion.stories.tsx +6 -6
  71. package/src/components/Accordion/AccordionItem.tsx +4 -7
  72. package/src/components/Accordion/AccordionRoot.tsx +1 -1
  73. package/src/components/Combobox/Combobox.stories.tsx +60 -0
  74. package/src/components/Combobox/Combobox.tsx +388 -0
  75. package/src/components/Combobox/index.ts +5 -0
  76. package/src/components/List/List.stories.tsx +36 -24
  77. package/src/components/List/List.tsx +14 -10
  78. package/src/components/List/ListItem.tsx +57 -39
  79. package/src/components/List/ListRoot.tsx +3 -3
  80. package/src/components/List/testing.ts +6 -6
  81. package/src/components/Listbox/Listbox.stories.tsx +48 -0
  82. package/src/components/Listbox/Listbox.tsx +201 -0
  83. package/src/components/Listbox/index.ts +5 -0
  84. package/src/components/Picker/Picker.stories.tsx +131 -0
  85. package/src/components/Picker/Picker.tsx +369 -0
  86. package/src/components/Picker/context.ts +43 -0
  87. package/src/components/Picker/index.ts +6 -0
  88. package/src/components/RowList/RowList.stories.tsx +163 -0
  89. package/src/components/RowList/RowList.tsx +350 -0
  90. package/src/components/RowList/index.ts +6 -0
  91. package/src/components/Tree/Tree.stories.tsx +156 -64
  92. package/src/components/Tree/Tree.tsx +41 -43
  93. package/src/components/Tree/TreeContext.tsx +22 -7
  94. package/src/components/Tree/TreeItem.tsx +189 -108
  95. package/src/components/Tree/TreeItemHeading.tsx +35 -7
  96. package/src/components/Tree/TreeItemToggle.tsx +5 -5
  97. package/src/components/Tree/index.ts +2 -0
  98. package/src/components/Tree/testing.ts +9 -8
  99. package/src/components/index.ts +4 -0
@@ -1,85 +1,62 @@
1
1
  // src/components/Accordion/AccordionItem.tsx
2
- import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
3
2
  import * as AccordionPrimitive2 from "@radix-ui/react-accordion";
4
3
  import { createContext as createContext2 } from "@radix-ui/react-context";
5
4
  import React2 from "react";
6
5
  import { Icon } from "@dxos/react-ui";
7
- import { mx as mx2 } from "@dxos/react-ui-theme";
6
+ import { mx as mx2 } from "@dxos/ui-theme";
8
7
 
9
8
  // src/components/Accordion/AccordionRoot.tsx
10
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
11
9
  import * as AccordionPrimitive from "@radix-ui/react-accordion";
12
10
  import { createContext } from "@radix-ui/react-context";
13
11
  import React from "react";
14
- import { mx } from "@dxos/react-ui-theme";
12
+ import { mx } from "@dxos/ui-theme";
15
13
  var ACCORDION_NAME = "Accordion";
16
14
  var [AccordionProvider, useAccordionContext] = createContext(ACCORDION_NAME);
17
15
  var defaultGetId = (item) => item?.id;
18
16
  var AccordionRoot = ({ classNames, items, getId = defaultGetId, children, value, defaultValue, onValueChange }) => {
19
- var _effect = _useSignals();
20
- try {
21
- return /* @__PURE__ */ React.createElement(AccordionProvider, {
22
- getId
23
- }, /* @__PURE__ */ React.createElement(AccordionPrimitive.Root, {
24
- type: "multiple",
25
- value,
26
- defaultValue,
27
- onValueChange,
28
- className: mx(classNames)
29
- }, children?.({
30
- items: items ?? []
31
- })));
32
- } finally {
33
- _effect.f();
34
- }
17
+ return /* @__PURE__ */ React.createElement(AccordionProvider, {
18
+ getId
19
+ }, /* @__PURE__ */ React.createElement(AccordionPrimitive.Root, {
20
+ type: "multiple",
21
+ value,
22
+ defaultValue,
23
+ onValueChange,
24
+ className: mx(classNames)
25
+ }, children?.({
26
+ items: items ?? []
27
+ })));
35
28
  };
36
29
 
37
30
  // src/components/Accordion/AccordionItem.tsx
38
31
  var ACCORDION_ITEM_NAME = "AccordionItem";
39
32
  var [AccordionItemProvider, useDxAccordionItemContext] = createContext2(ACCORDION_ITEM_NAME);
40
33
  var AccordionItem = ({ children, classNames, item }) => {
41
- var _effect = _useSignals2();
42
- try {
43
- const { getId } = useAccordionContext(ACCORDION_ITEM_NAME);
44
- return /* @__PURE__ */ React2.createElement(AccordionItemProvider, {
45
- item
46
- }, /* @__PURE__ */ React2.createElement(AccordionPrimitive2.Item, {
47
- value: getId(item),
48
- className: mx2("overflow-hidden", classNames)
49
- }, children));
50
- } finally {
51
- _effect.f();
52
- }
34
+ const { getId } = useAccordionContext(ACCORDION_ITEM_NAME);
35
+ return /* @__PURE__ */ React2.createElement(AccordionItemProvider, {
36
+ item
37
+ }, /* @__PURE__ */ React2.createElement(AccordionPrimitive2.Item, {
38
+ value: getId(item),
39
+ className: mx2("overflow-hidden", classNames)
40
+ }, children));
53
41
  };
54
42
  var AccordionItemHeader = ({ classNames, children, ...props }) => {
55
- var _effect = _useSignals2();
56
- try {
57
- return /* @__PURE__ */ React2.createElement(AccordionPrimitive2.Header, {
58
- ...props,
59
- className: mx2(classNames)
60
- }, /* @__PURE__ */ React2.createElement(AccordionPrimitive2.Trigger, {
61
- className: "group flex items-center p-2 dx-focus-ring-inset is-full text-start"
62
- }, children, /* @__PURE__ */ React2.createElement(Icon, {
63
- icon: "ph--caret-right--regular",
64
- size: 4,
65
- classNames: "transition-transform duration-200 group-data-[state=open]:rotate-90"
66
- })));
67
- } finally {
68
- _effect.f();
69
- }
43
+ return /* @__PURE__ */ React2.createElement(AccordionPrimitive2.Header, {
44
+ ...props,
45
+ className: mx2(classNames)
46
+ }, /* @__PURE__ */ React2.createElement(AccordionPrimitive2.Trigger, {
47
+ className: "group flex items-center p-2 dx-focus-ring-inset w-full text-start"
48
+ }, children, /* @__PURE__ */ React2.createElement(Icon, {
49
+ icon: "ph--caret-right--regular",
50
+ size: 4,
51
+ classNames: "transition-transform duration-200 group-data-[state=open]:rotate-90"
52
+ })));
70
53
  };
71
54
  var AccordionItemBody = ({ children, classNames }) => {
72
- var _effect = _useSignals2();
73
- try {
74
- return /* @__PURE__ */ React2.createElement(AccordionPrimitive2.Content, {
75
- className: "overflow-hidden data-[state=closed]:animate-slideUp data-[state=open]:animate-slideDown"
76
- }, /* @__PURE__ */ React2.createElement("div", {
77
- role: "none",
78
- className: mx2("p-2", classNames)
79
- }, children));
80
- } finally {
81
- _effect.f();
82
- }
55
+ return /* @__PURE__ */ React2.createElement(AccordionPrimitive2.Content, {
56
+ className: "overflow-hidden data-[state=closed]:animate-slide-up data-[state=open]:animate-slide-down"
57
+ }, /* @__PURE__ */ React2.createElement("div", {
58
+ className: mx2("p-2", classNames)
59
+ }, children));
83
60
  };
84
61
 
85
62
  // src/components/Accordion/Accordion.tsx
@@ -90,92 +67,523 @@ var Accordion = {
90
67
  ItemBody: AccordionItemBody
91
68
  };
92
69
 
70
+ // src/components/Combobox/Combobox.tsx
71
+ import { createContext as createContext4 } from "@radix-ui/react-context";
72
+ import { useControllableState } from "@radix-ui/react-use-controllable-state";
73
+ import React4, { forwardRef as forwardRef2, useCallback as useCallback2 } from "react";
74
+ import { Button, Icon as Icon2, Popover, ScrollArea, useId } from "@dxos/react-ui";
75
+ import { composable, composableProps } from "@dxos/react-ui";
76
+ import { mx as mx4 } from "@dxos/ui-theme";
77
+
78
+ // src/components/Picker/Picker.tsx
79
+ import { Slot } from "@radix-ui/react-slot";
80
+ import React3, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from "react";
81
+ import { Input, useThemeContext } from "@dxos/react-ui";
82
+ import { mx as mx3 } from "@dxos/ui-theme";
83
+
84
+ // src/components/Picker/context.ts
85
+ import { createContext as createContext3 } from "@radix-ui/react-context";
86
+ var [PickerItemContextProvider, usePickerItemContext] = createContext3("PickerItem");
87
+ var [PickerInputContextProvider, usePickerInputContext] = createContext3("PickerInput");
88
+
89
+ // src/components/Picker/Picker.tsx
90
+ var PickerRoot = ({ children }) => {
91
+ const [selectedValue, setSelectedValue] = useState(void 0);
92
+ const itemsRef = useRef(/* @__PURE__ */ new Map());
93
+ const [itemVersion, setItemVersion] = useState(0);
94
+ useEffect(() => {
95
+ const current = selectedValue !== void 0 ? itemsRef.current.get(selectedValue) : void 0;
96
+ const isValid = current !== void 0 && !current.disabled;
97
+ if (!isValid && itemsRef.current.size > 0) {
98
+ const entries = Array.from(itemsRef.current.entries()).filter(([, data]) => !data.disabled);
99
+ if (entries.length > 0) {
100
+ entries.sort(([, a], [, b]) => {
101
+ const position = a.element.compareDocumentPosition(b.element);
102
+ if (position & Node.DOCUMENT_POSITION_FOLLOWING) {
103
+ return -1;
104
+ }
105
+ if (position & Node.DOCUMENT_POSITION_PRECEDING) {
106
+ return 1;
107
+ }
108
+ return 0;
109
+ });
110
+ const firstValue = entries[0]?.[0];
111
+ if (firstValue !== void 0 && firstValue !== selectedValue) {
112
+ setSelectedValue(firstValue);
113
+ }
114
+ } else if (selectedValue !== void 0) {
115
+ setSelectedValue(void 0);
116
+ }
117
+ }
118
+ }, [
119
+ itemVersion,
120
+ selectedValue
121
+ ]);
122
+ const registerItem = useCallback((value, element, onSelect, disabled) => {
123
+ if (element) {
124
+ itemsRef.current.set(value, {
125
+ element,
126
+ onSelect,
127
+ disabled
128
+ });
129
+ setItemVersion((v) => v + 1);
130
+ }
131
+ }, []);
132
+ const unregisterItem = useCallback((value) => {
133
+ itemsRef.current.delete(value);
134
+ setItemVersion((v) => v + 1);
135
+ }, []);
136
+ const getItemValues = useCallback(() => {
137
+ return Array.from(itemsRef.current.entries()).filter(([, data]) => !data.disabled).sort(([, a], [, b]) => {
138
+ const position = a.element.compareDocumentPosition(b.element);
139
+ return position & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : position & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
140
+ }).map(([value]) => value);
141
+ }, []);
142
+ const triggerSelect = useCallback(() => {
143
+ if (selectedValue !== void 0) {
144
+ const item = itemsRef.current.get(selectedValue);
145
+ item?.onSelect?.();
146
+ }
147
+ }, [
148
+ selectedValue
149
+ ]);
150
+ const itemContextValue = useMemo(() => ({
151
+ selectedValue,
152
+ onSelectedValueChange: setSelectedValue,
153
+ registerItem,
154
+ unregisterItem
155
+ }), [
156
+ selectedValue,
157
+ registerItem,
158
+ unregisterItem
159
+ ]);
160
+ const inputContextValue = useMemo(() => ({
161
+ selectedValue,
162
+ onSelectedValueChange: setSelectedValue,
163
+ getItemValues,
164
+ triggerSelect
165
+ }), [
166
+ selectedValue,
167
+ getItemValues,
168
+ triggerSelect
169
+ ]);
170
+ return /* @__PURE__ */ React3.createElement(PickerInputContextProvider, inputContextValue, /* @__PURE__ */ React3.createElement(PickerItemContextProvider, itemContextValue, children));
171
+ };
172
+ PickerRoot.displayName = "Picker.Root";
173
+ var PickerInput = /* @__PURE__ */ forwardRef(({ value, onValueChange, onChange, onKeyDown, autoFocus, ...props }, forwardedRef) => {
174
+ const { hasIosKeyboard } = useThemeContext();
175
+ const { selectedValue, onSelectedValueChange, getItemValues, triggerSelect } = usePickerInputContext("Picker.Input");
176
+ const handleChange = useCallback((event) => {
177
+ onValueChange?.(event.target.value);
178
+ onChange?.(event);
179
+ }, [
180
+ onValueChange,
181
+ onChange
182
+ ]);
183
+ const handleKeyDown = useCallback((event) => {
184
+ onKeyDown?.(event);
185
+ if (event.defaultPrevented) {
186
+ return;
187
+ }
188
+ const values = getItemValues();
189
+ if (values.length === 0) {
190
+ if (event.key === "Escape") {
191
+ onValueChange?.("");
192
+ }
193
+ return;
194
+ }
195
+ const currentIndex = selectedValue !== void 0 ? values.indexOf(selectedValue) : -1;
196
+ switch (event.key) {
197
+ case "ArrowDown": {
198
+ event.preventDefault();
199
+ const nextIndex = currentIndex === -1 ? 0 : Math.min(currentIndex + 1, values.length - 1);
200
+ const nextValue = values[nextIndex];
201
+ if (nextValue !== void 0) {
202
+ onSelectedValueChange(nextValue);
203
+ }
204
+ break;
205
+ }
206
+ case "ArrowUp": {
207
+ event.preventDefault();
208
+ const prevIndex = currentIndex === -1 ? values.length - 1 : Math.max(currentIndex - 1, 0);
209
+ const prevValue = values[prevIndex];
210
+ if (prevValue !== void 0) {
211
+ onSelectedValueChange(prevValue);
212
+ }
213
+ break;
214
+ }
215
+ case "Enter": {
216
+ if (selectedValue !== void 0) {
217
+ event.preventDefault();
218
+ triggerSelect();
219
+ }
220
+ break;
221
+ }
222
+ case "Home": {
223
+ event.preventDefault();
224
+ const firstValue = values[0];
225
+ if (firstValue !== void 0) {
226
+ onSelectedValueChange(firstValue);
227
+ }
228
+ break;
229
+ }
230
+ case "End": {
231
+ event.preventDefault();
232
+ const lastValue = values[values.length - 1];
233
+ if (lastValue !== void 0) {
234
+ onSelectedValueChange(lastValue);
235
+ }
236
+ break;
237
+ }
238
+ case "Escape": {
239
+ event.preventDefault();
240
+ if (selectedValue !== void 0) {
241
+ onSelectedValueChange(void 0);
242
+ } else {
243
+ onValueChange?.("");
244
+ }
245
+ break;
246
+ }
247
+ }
248
+ }, [
249
+ selectedValue,
250
+ onSelectedValueChange,
251
+ getItemValues,
252
+ triggerSelect,
253
+ onValueChange,
254
+ onKeyDown
255
+ ]);
256
+ return /* @__PURE__ */ React3.createElement(Input.Root, null, /* @__PURE__ */ React3.createElement(Input.TextInput, {
257
+ ...props,
258
+ autoFocus: autoFocus && !hasIosKeyboard,
259
+ ...value !== void 0 && {
260
+ value
261
+ },
262
+ onChange: handleChange,
263
+ onKeyDown: handleKeyDown,
264
+ ref: forwardedRef
265
+ }));
266
+ });
267
+ PickerInput.displayName = "Picker.Input";
268
+ var PickerItem = /* @__PURE__ */ forwardRef(({ classNames, value, onSelect, disabled, asChild, children, ...props }, forwardedRef) => {
269
+ const { selectedValue, onSelectedValueChange, registerItem, unregisterItem } = usePickerItemContext("Picker.Item");
270
+ const internalRef = useRef(null);
271
+ const isSelected = selectedValue === value && !disabled;
272
+ useEffect(() => {
273
+ const element = internalRef.current;
274
+ if (element) {
275
+ registerItem(value, element, onSelect, disabled);
276
+ }
277
+ return () => unregisterItem(value);
278
+ }, [
279
+ value,
280
+ onSelect,
281
+ disabled,
282
+ registerItem,
283
+ unregisterItem
284
+ ]);
285
+ useEffect(() => {
286
+ if (isSelected && internalRef.current) {
287
+ internalRef.current.scrollIntoView({
288
+ block: "nearest",
289
+ behavior: "smooth"
290
+ });
291
+ }
292
+ }, [
293
+ isSelected
294
+ ]);
295
+ const handleClick = useCallback(() => {
296
+ if (disabled) {
297
+ return;
298
+ }
299
+ onSelectedValueChange(value);
300
+ onSelect?.();
301
+ }, [
302
+ disabled,
303
+ value,
304
+ onSelectedValueChange,
305
+ onSelect
306
+ ]);
307
+ const handleMouseDown = useCallback((event) => {
308
+ event.preventDefault();
309
+ }, []);
310
+ const Comp = asChild ? Slot : "div";
311
+ return /* @__PURE__ */ React3.createElement(Comp, {
312
+ ...props,
313
+ ref: (node) => {
314
+ internalRef.current = node;
315
+ if (typeof forwardedRef === "function") {
316
+ forwardedRef(node);
317
+ } else if (forwardedRef) {
318
+ forwardedRef.current = node;
319
+ }
320
+ },
321
+ role: "option",
322
+ "aria-selected": isSelected,
323
+ "aria-disabled": disabled,
324
+ "data-selected": isSelected,
325
+ "data-disabled": disabled,
326
+ "data-value": value,
327
+ // Browser focus stays on the input; highlight is via `aria-selected`.
328
+ tabIndex: -1,
329
+ className: mx3("dx-hover dx-selected px-[var(--gutter,0.75rem)] py-1 cursor-pointer select-none", disabled && "opacity-50 cursor-not-allowed", classNames),
330
+ onMouseDown: handleMouseDown,
331
+ onClick: handleClick
332
+ }, children);
333
+ });
334
+ PickerItem.displayName = "Picker.Item";
335
+ var Picker = {
336
+ Root: PickerRoot,
337
+ Input: PickerInput,
338
+ Item: PickerItem
339
+ };
340
+
341
+ // src/components/Combobox/Combobox.tsx
342
+ var COMBOBOX_NAME = "Combobox";
343
+ var COMBOBOX_CONTENT_NAME = "ComboboxContent";
344
+ var COMBOBOX_ITEM_NAME = "ComboboxItem";
345
+ var COMBOBOX_TRIGGER_NAME = "ComboboxTrigger";
346
+ var [ComboboxProvider, useComboboxContext] = createContext4(COMBOBOX_NAME, {});
347
+ var ComboboxRoot = ({ children, modal, modalId: modalIdProp, open: openProp, defaultOpen, onOpenChange: propsOnOpenChange, value: valueProp, defaultValue, onValueChange: propsOnValueChange, placeholder }) => {
348
+ const modalId = useId(COMBOBOX_NAME, modalIdProp);
349
+ const [open = false, onOpenChange] = useControllableState({
350
+ prop: openProp,
351
+ defaultProp: defaultOpen,
352
+ onChange: propsOnOpenChange
353
+ });
354
+ const [value = "", onValueChange] = useControllableState({
355
+ prop: valueProp,
356
+ defaultProp: defaultValue,
357
+ onChange: propsOnValueChange
358
+ });
359
+ return /* @__PURE__ */ React4.createElement(Popover.Root, {
360
+ open,
361
+ onOpenChange,
362
+ modal
363
+ }, /* @__PURE__ */ React4.createElement(ComboboxProvider, {
364
+ isCombobox: true,
365
+ modalId,
366
+ placeholder,
367
+ open,
368
+ onOpenChange,
369
+ value,
370
+ onValueChange
371
+ }, children));
372
+ };
373
+ var ComboboxContent = composable(({ children, ...props }, forwardedRef) => {
374
+ const { modalId } = useComboboxContext(COMBOBOX_CONTENT_NAME);
375
+ return /* @__PURE__ */ React4.createElement(Popover.Content, {
376
+ ...composableProps(props, {
377
+ id: modalId
378
+ }),
379
+ ref: forwardedRef
380
+ }, /* @__PURE__ */ React4.createElement(Popover.Viewport, {
381
+ classNames: "w-(--radix-popover-trigger-width)"
382
+ }, /* @__PURE__ */ React4.createElement(Picker.Root, null, children)));
383
+ });
384
+ ComboboxContent.displayName = COMBOBOX_CONTENT_NAME;
385
+ var ComboboxTrigger = /* @__PURE__ */ forwardRef2(({ children, onClick, ...props }, forwardedRef) => {
386
+ const { modalId, open, onOpenChange, placeholder, value } = useComboboxContext(COMBOBOX_TRIGGER_NAME);
387
+ const handleClick = useCallback2((event) => {
388
+ onClick?.(event);
389
+ onOpenChange?.(true);
390
+ }, [
391
+ onClick,
392
+ onOpenChange
393
+ ]);
394
+ return /* @__PURE__ */ React4.createElement(Popover.Trigger, {
395
+ asChild: true
396
+ }, /* @__PURE__ */ React4.createElement(Button, {
397
+ ...props,
398
+ role: "combobox",
399
+ "aria-expanded": open,
400
+ "aria-controls": modalId,
401
+ "aria-haspopup": "dialog",
402
+ onClick: handleClick,
403
+ ref: forwardedRef
404
+ }, children ?? /* @__PURE__ */ React4.createElement(React4.Fragment, null, /* @__PURE__ */ React4.createElement("span", {
405
+ className: mx4("font-normal text-start flex-1 min-w-0 truncate me-2", !value && "text-subdued")
406
+ }, value || placeholder), /* @__PURE__ */ React4.createElement(Icon2, {
407
+ icon: "ph--caret-down--bold",
408
+ size: 3
409
+ }))));
410
+ });
411
+ ComboboxTrigger.displayName = COMBOBOX_TRIGGER_NAME;
412
+ var ComboboxVirtualTrigger = Popover.VirtualTrigger;
413
+ var ComboboxInput = /* @__PURE__ */ forwardRef2(({ classNames, ...props }, forwardedRef) => {
414
+ return /* @__PURE__ */ React4.createElement(Picker.Input, {
415
+ ...props,
416
+ classNames: [
417
+ "m-form-chrome mb-0 w-[calc(100%-2*var(--spacing-form-chrome))]",
418
+ classNames
419
+ ],
420
+ ref: forwardedRef
421
+ });
422
+ });
423
+ ComboboxInput.displayName = "Combobox.Input";
424
+ var ComboboxList = /* @__PURE__ */ forwardRef2(({ classNames, children, ...props }, forwardedRef) => {
425
+ return /* @__PURE__ */ React4.createElement(ScrollArea.Root, {
426
+ ...composableProps(props, {
427
+ classNames: [
428
+ "py-form-chrome",
429
+ classNames
430
+ ]
431
+ }),
432
+ role: "listbox",
433
+ centered: true,
434
+ padding: true,
435
+ thin: true,
436
+ ref: forwardedRef
437
+ }, /* @__PURE__ */ React4.createElement(ScrollArea.Viewport, null, children));
438
+ });
439
+ ComboboxList.displayName = "Combobox.List";
440
+ var ComboboxItem = /* @__PURE__ */ forwardRef2(({ classNames, onSelect, value, label, icon, iconClassNames, checked, suffix, disabled, closeOnSelect = true, children }, forwardedRef) => {
441
+ const { onValueChange, onOpenChange } = useComboboxContext(COMBOBOX_ITEM_NAME);
442
+ const handleSelect = useCallback2(() => {
443
+ onSelect?.();
444
+ if (value !== void 0) {
445
+ onValueChange?.(value);
446
+ }
447
+ if (closeOnSelect) {
448
+ onOpenChange?.(false);
449
+ }
450
+ }, [
451
+ onSelect,
452
+ onValueChange,
453
+ onOpenChange,
454
+ value,
455
+ closeOnSelect
456
+ ]);
457
+ return /* @__PURE__ */ React4.createElement(Picker.Item, {
458
+ value,
459
+ disabled,
460
+ onSelect: handleSelect,
461
+ ref: forwardedRef,
462
+ classNames: [
463
+ // Full width inside the viewport (no horizontal margin).
464
+ // `px-3 py-1`, `cursor-pointer`, `select-none` and the
465
+ // `dx-hover` / `dx-selected` pairing come from `Picker.Item`'s
466
+ // defaults; we only add the row-shape (flex / icons + label)
467
+ // and the disabled overrides on top.
468
+ "flex w-full gap-2 items-center",
469
+ disabled && "hover:bg-transparent data-[selected=true]:bg-transparent",
470
+ classNames
471
+ ]
472
+ }, children ?? /* @__PURE__ */ React4.createElement(React4.Fragment, null, icon && /* @__PURE__ */ React4.createElement(Icon2, {
473
+ icon,
474
+ classNames: iconClassNames
475
+ }), /* @__PURE__ */ React4.createElement("span", {
476
+ className: "w-0 grow truncate"
477
+ }, label), suffix && /* @__PURE__ */ React4.createElement("span", {
478
+ className: "shrink-0 text-description"
479
+ }, suffix), checked && /* @__PURE__ */ React4.createElement(Icon2, {
480
+ icon: "ph--check--regular"
481
+ })));
482
+ });
483
+ ComboboxItem.displayName = COMBOBOX_ITEM_NAME;
484
+ var ComboboxArrow = Popover.Arrow;
485
+ var ComboboxEmpty = /* @__PURE__ */ forwardRef2(({ classNames, children }, forwardedRef) => {
486
+ return /* @__PURE__ */ React4.createElement("div", {
487
+ ref: forwardedRef,
488
+ role: "status",
489
+ className: mx4(classNames)
490
+ }, children);
491
+ });
492
+ ComboboxEmpty.displayName = "Combobox.Empty";
493
+ var ComboboxPortal = Popover.Portal;
494
+ var Combobox = {
495
+ Root: ComboboxRoot,
496
+ Portal: ComboboxPortal,
497
+ Content: ComboboxContent,
498
+ Trigger: ComboboxTrigger,
499
+ VirtualTrigger: ComboboxVirtualTrigger,
500
+ Input: ComboboxInput,
501
+ List: ComboboxList,
502
+ Item: ComboboxItem,
503
+ Arrow: ComboboxArrow,
504
+ Empty: ComboboxEmpty
505
+ };
506
+
93
507
  // src/components/List/ListItem.tsx
94
- import { useSignals as _useSignals4 } from "@preact-signals/safe-react/tracking";
508
+ import { attachClosestEdge, extractClosestEdge as extractClosestEdge2 } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
95
509
  import { combine } from "@atlaskit/pragmatic-drag-and-drop/combine";
96
510
  import { draggable, dropTargetForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
97
511
  import { setCustomNativeDragPreview } from "@atlaskit/pragmatic-drag-and-drop/element/set-custom-native-drag-preview";
98
- import { attachClosestEdge, extractClosestEdge as extractClosestEdge2 } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
99
- import { createContext as createContext4 } from "@radix-ui/react-context";
100
- import React4, { useEffect as useEffect2, useRef, useState as useState2 } from "react";
512
+ import { createContext as createContext6 } from "@radix-ui/react-context";
513
+ import { Slot as Slot2 } from "@radix-ui/react-slot";
514
+ import React6, { useEffect as useEffect3, useRef as useRef2, useState as useState3 } from "react";
101
515
  import { createPortal } from "react-dom";
102
516
  import { invariant } from "@dxos/invariant";
103
517
  import { IconButton, ListItem as NaturalListItem, useTranslation } from "@dxos/react-ui";
104
- import { mx as mx3 } from "@dxos/react-ui-theme";
518
+ import { mx as mx5, osTranslations } from "@dxos/ui-theme";
105
519
 
106
520
  // src/components/List/ListRoot.tsx
107
- import { useSignals as _useSignals3 } from "@preact-signals/safe-react/tracking";
108
- import { monitorForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
109
521
  import { extractClosestEdge } from "@atlaskit/pragmatic-drag-and-drop-hitbox/closest-edge";
110
522
  import { getReorderDestinationIndex } from "@atlaskit/pragmatic-drag-and-drop-hitbox/util/get-reorder-destination-index";
111
- import { createContext as createContext3 } from "@radix-ui/react-context";
112
- import React3, { useCallback, useEffect, useState } from "react";
523
+ import { monitorForElements } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
524
+ import { createContext as createContext5 } from "@radix-ui/react-context";
525
+ import React5, { useCallback as useCallback3, useEffect as useEffect2, useState as useState2 } from "react";
113
526
  var LIST_NAME = "List";
114
- var [ListProvider, useListContext] = createContext3(LIST_NAME);
527
+ var [ListProvider, useListContext] = createContext5(LIST_NAME);
115
528
  var defaultGetId2 = (item) => item?.id;
116
529
  var ListRoot = ({ children, items, isItem, getId = defaultGetId2, onMove, ...props }) => {
117
- var _effect = _useSignals3();
118
- try {
119
- const isEqual = useCallback((a, b) => {
120
- const idA = getId?.(a);
121
- const idB = getId?.(b);
122
- if (idA !== void 0 && idB !== void 0) {
123
- return idA === idB;
124
- } else {
125
- return a === b;
126
- }
127
- }, [
128
- getId
129
- ]);
130
- const [state, setState] = useState(idle);
131
- useEffect(() => {
132
- if (!items) {
133
- return;
134
- }
135
- return monitorForElements({
136
- canMonitor: ({ source }) => isItem?.(source.data) ?? false,
137
- onDrop: ({ location, source }) => {
138
- const target = location.current.dropTargets[0];
139
- if (!target) {
140
- return;
141
- }
142
- const sourceData = source.data;
143
- const targetData = target.data;
144
- if (!isItem?.(sourceData) || !isItem?.(targetData)) {
145
- return;
146
- }
147
- const sourceIdx = items.findIndex((item) => isEqual(item, sourceData));
148
- const targetIdx = items.findIndex((item) => isEqual(item, targetData));
149
- if (targetIdx < 0 || sourceIdx < 0) {
150
- return;
151
- }
152
- const closestEdgeOfTarget = extractClosestEdge(targetData);
153
- const destinationIndex = getReorderDestinationIndex({
154
- closestEdgeOfTarget,
155
- startIndex: sourceIdx,
156
- indexOfTarget: targetIdx,
157
- axis: "vertical"
158
- });
159
- onMove?.(sourceIdx, destinationIndex);
530
+ const isEqual = useCallback3((a, b) => {
531
+ const idA = getId?.(a);
532
+ const idB = getId?.(b);
533
+ if (idA !== void 0 && idB !== void 0) {
534
+ return idA === idB;
535
+ } else {
536
+ return a === b;
537
+ }
538
+ }, [
539
+ getId
540
+ ]);
541
+ const [state, setState] = useState2(idle);
542
+ useEffect2(() => {
543
+ if (!items) {
544
+ return;
545
+ }
546
+ return monitorForElements({
547
+ canMonitor: ({ source }) => isItem?.(source.data) ?? false,
548
+ onDrop: ({ location, source }) => {
549
+ const target = location.current.dropTargets[0];
550
+ if (!target) {
551
+ return;
160
552
  }
161
- });
162
- }, [
163
- items,
164
- isEqual,
165
- onMove
166
- ]);
167
- return /* @__PURE__ */ React3.createElement(ListProvider, {
168
- state,
169
- setState,
170
- isItem,
171
- ...props
172
- }, children?.({
173
- state,
174
- items: items ?? []
175
- }));
176
- } finally {
177
- _effect.f();
178
- }
553
+ const sourceData = source.data;
554
+ const targetData = target.data;
555
+ if (!isItem?.(sourceData) || !isItem?.(targetData)) {
556
+ return;
557
+ }
558
+ const sourceIdx = items.findIndex((item) => isEqual(item, sourceData));
559
+ const targetIdx = items.findIndex((item) => isEqual(item, targetData));
560
+ if (targetIdx < 0 || sourceIdx < 0) {
561
+ return;
562
+ }
563
+ const closestEdgeOfTarget = extractClosestEdge(targetData);
564
+ const destinationIndex = getReorderDestinationIndex({
565
+ closestEdgeOfTarget,
566
+ startIndex: sourceIdx,
567
+ indexOfTarget: targetIdx,
568
+ axis: "vertical"
569
+ });
570
+ onMove?.(sourceIdx, destinationIndex);
571
+ }
572
+ });
573
+ }, [
574
+ items,
575
+ isEqual,
576
+ onMove
577
+ ]);
578
+ return /* @__PURE__ */ React5.createElement(ListProvider, {
579
+ state,
580
+ setState,
581
+ isItem,
582
+ ...props
583
+ }, children?.({
584
+ state,
585
+ items: items ?? []
586
+ }));
179
587
  };
180
588
 
181
589
  // src/components/List/ListItem.tsx
@@ -188,196 +596,170 @@ var stateStyles = {
188
596
  };
189
597
  var defaultContext = {};
190
598
  var LIST_ITEM_NAME = "ListItem";
191
- var [ListItemProvider, useListItemContext] = createContext4(LIST_ITEM_NAME, defaultContext);
192
- var ListItem = ({ children, classNames, item, ...props }) => {
193
- var _effect = _useSignals4();
194
- try {
195
- const { isItem, readonly, dragPreview, setState: setRootState } = useListContext(LIST_ITEM_NAME);
196
- const ref = useRef(null);
197
- const dragHandleRef = useRef(null);
198
- const [state, setState] = useState2(idle);
199
- useEffect2(() => {
200
- const element = ref.current;
201
- invariant(element, void 0, {
202
- F: __dxlog_file,
203
- L: 98,
204
- S: void 0,
205
- A: [
206
- "element",
207
- ""
208
- ]
209
- });
210
- return combine(
211
- //
212
- // https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about#draggable
213
- //
214
- draggable({
215
- element,
216
- dragHandle: dragHandleRef.current,
217
- canDrag: () => !readonly,
218
- getInitialData: () => item,
219
- onGenerateDragPreview: dragPreview ? ({ nativeSetDragImage, source }) => {
220
- const rect = source.element.getBoundingClientRect();
221
- setCustomNativeDragPreview({
222
- nativeSetDragImage,
223
- getOffset: ({ container }) => {
224
- const { height } = container.getBoundingClientRect();
225
- return {
226
- x: 20,
227
- y: height / 2
228
- };
229
- },
230
- render: ({ container }) => {
231
- container.style.width = rect.width + "px";
232
- setState({
233
- type: "preview",
234
- container
235
- });
236
- setRootState({
237
- type: "preview",
238
- container,
239
- item
240
- });
241
- return () => {
242
- };
243
- }
244
- });
245
- } : void 0,
246
- onDragStart: () => {
247
- setState({
248
- type: "is-dragging"
249
- });
250
- setRootState({
251
- type: "is-dragging",
252
- item
253
- });
254
- },
255
- onDrop: () => {
256
- setState(idle);
257
- setRootState(idle);
258
- }
259
- }),
260
- //
261
- // https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about#drop-target-for-elements
262
- //
263
- dropTargetForElements({
264
- element,
265
- canDrop: ({ source }) => {
266
- return (source.element !== element && isItem?.(source.data)) ?? false;
267
- },
268
- getData: ({ input }) => {
269
- return attachClosestEdge(item, {
270
- element,
271
- input,
272
- allowedEdges: [
273
- "top",
274
- "bottom"
275
- ]
276
- });
277
- },
278
- getIsSticky: () => true,
279
- onDragEnter: ({ self }) => {
280
- const closestEdge = extractClosestEdge2(self.data);
281
- setState({
282
- type: "is-dragging-over",
283
- closestEdge
284
- });
285
- },
286
- onDragLeave: () => {
287
- setState(idle);
288
- },
289
- onDrag: ({ self }) => {
290
- const closestEdge = extractClosestEdge2(self.data);
291
- setState((current) => {
292
- if (current.type === "is-dragging-over" && current.closestEdge === closestEdge) {
293
- return current;
294
- }
599
+ var [ListItemProvider, useListItemContext] = createContext6(LIST_ITEM_NAME, defaultContext);
600
+ var ListItem = ({ children, classNames, item, asChild, selected, ...props }) => {
601
+ const Comp = asChild ? Slot2 : "div";
602
+ const { isItem, readonly, dragPreview, setState: setRootState } = useListContext(LIST_ITEM_NAME);
603
+ const rootRef = useRef2(null);
604
+ const dragHandleRef = useRef2(null);
605
+ const [state, setState] = useState3(idle);
606
+ useEffect3(() => {
607
+ const element = rootRef.current;
608
+ invariant(element, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 37, S: void 0, A: ["element", ""] });
609
+ return combine(
610
+ //
611
+ // https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about#draggable
612
+ //
613
+ draggable({
614
+ element,
615
+ dragHandle: dragHandleRef.current,
616
+ canDrag: () => !readonly,
617
+ getInitialData: () => item,
618
+ onGenerateDragPreview: dragPreview ? ({ nativeSetDragImage, source }) => {
619
+ const rect = source.element.getBoundingClientRect();
620
+ setCustomNativeDragPreview({
621
+ nativeSetDragImage,
622
+ getOffset: ({ container }) => {
623
+ const { height } = container.getBoundingClientRect();
295
624
  return {
296
- type: "is-dragging-over",
297
- closestEdge
625
+ x: 20,
626
+ y: height / 2
298
627
  };
299
- });
300
- },
301
- onDrop: () => {
302
- setState(idle);
303
- }
304
- })
305
- );
306
- }, [
307
- item
308
- ]);
309
- return /* @__PURE__ */ React4.createElement(ListItemProvider, {
310
- item,
311
- dragHandleRef
312
- }, /* @__PURE__ */ React4.createElement("div", {
313
- ref,
314
- role: "listitem",
315
- className: mx3("flex relative", classNames, stateStyles[state.type]),
316
- ...props
317
- }, children, state.type === "is-dragging-over" && state.closestEdge && /* @__PURE__ */ React4.createElement(NaturalListItem.DropIndicator, {
318
- edge: state.closestEdge
319
- })));
320
- } finally {
321
- _effect.f();
322
- }
628
+ },
629
+ render: ({ container }) => {
630
+ container.style.width = rect.width + "px";
631
+ setState({
632
+ type: "preview",
633
+ container
634
+ });
635
+ setRootState({
636
+ type: "preview",
637
+ container,
638
+ item
639
+ });
640
+ return () => {
641
+ };
642
+ }
643
+ });
644
+ } : void 0,
645
+ onDragStart: () => {
646
+ setState({
647
+ type: "is-dragging"
648
+ });
649
+ setRootState({
650
+ type: "is-dragging",
651
+ item
652
+ });
653
+ },
654
+ onDrop: () => {
655
+ setState(idle);
656
+ setRootState(idle);
657
+ }
658
+ }),
659
+ //
660
+ // https://atlassian.design/components/pragmatic-drag-and-drop/core-package/adapters/element/about#drop-target-for-elements
661
+ //
662
+ dropTargetForElements({
663
+ element,
664
+ canDrop: ({ source }) => {
665
+ return (source.element !== element && isItem?.(source.data)) ?? false;
666
+ },
667
+ getData: ({ input }) => {
668
+ return attachClosestEdge(item, {
669
+ element,
670
+ input,
671
+ allowedEdges: [
672
+ "top",
673
+ "bottom"
674
+ ]
675
+ });
676
+ },
677
+ getIsSticky: () => true,
678
+ onDragEnter: ({ self }) => {
679
+ const closestEdge = extractClosestEdge2(self.data);
680
+ setState({
681
+ type: "is-dragging-over",
682
+ closestEdge
683
+ });
684
+ },
685
+ onDragLeave: () => {
686
+ setState(idle);
687
+ },
688
+ onDrag: ({ self }) => {
689
+ const closestEdge = extractClosestEdge2(self.data);
690
+ setState((current) => {
691
+ if (current.type === "is-dragging-over" && current.closestEdge === closestEdge) {
692
+ return current;
693
+ }
694
+ return {
695
+ type: "is-dragging-over",
696
+ closestEdge
697
+ };
698
+ });
699
+ },
700
+ onDrop: () => {
701
+ setState(idle);
702
+ }
703
+ })
704
+ );
705
+ }, [
706
+ item
707
+ ]);
708
+ return /* @__PURE__ */ React6.createElement(ListItemProvider, {
709
+ item,
710
+ dragHandleRef
711
+ }, /* @__PURE__ */ React6.createElement(Comp, {
712
+ ...props,
713
+ role: "listitem",
714
+ "aria-selected": selected,
715
+ className: mx5("relative p-1 dx-selected dx-hover", classNames, stateStyles[state.type]),
716
+ ref: rootRef
717
+ }, children), state.type === "is-dragging-over" && state.closestEdge && /* @__PURE__ */ React6.createElement(NaturalListItem.DropIndicator, {
718
+ edge: state.closestEdge
719
+ }));
323
720
  };
324
- var ListItemDeleteButton = ({ autoHide = true, classNames, disabled, icon = "ph--x--regular", label, ...props }) => {
325
- var _effect = _useSignals4();
326
- try {
327
- const { state } = useListContext("DELETE_BUTTON");
328
- const isDisabled = state.type !== "idle" || disabled;
329
- const { t } = useTranslation("os");
330
- return /* @__PURE__ */ React4.createElement(IconButton, {
331
- iconOnly: true,
332
- variant: "ghost",
333
- ...props,
334
- icon,
335
- disabled: isDisabled,
336
- label: label ?? t("delete label"),
337
- classNames: [
338
- classNames,
339
- autoHide && disabled && "hidden"
340
- ]
341
- });
342
- } finally {
343
- _effect.f();
344
- }
721
+ var ListItemIconButton = ({ autoHide = true, iconOnly = true, variant = "ghost", classNames, disabled, ...props }) => {
722
+ const { state } = useListContext("ITEM_BUTTON");
723
+ const isDisabled = state.type !== "idle" || disabled;
724
+ return /* @__PURE__ */ React6.createElement(IconButton, {
725
+ ...props,
726
+ disabled: isDisabled,
727
+ iconOnly,
728
+ variant,
729
+ classNames: [
730
+ classNames,
731
+ autoHide && disabled && "hidden"
732
+ ]
733
+ });
345
734
  };
346
- var ListItemButton = ({ autoHide = true, iconOnly = true, variant = "ghost", classNames, disabled, ...props }) => {
347
- var _effect = _useSignals4();
348
- try {
349
- const { state } = useListContext("ITEM_BUTTON");
350
- const isDisabled = state.type !== "idle" || disabled;
351
- return /* @__PURE__ */ React4.createElement(IconButton, {
352
- ...props,
353
- disabled: isDisabled,
354
- iconOnly,
355
- variant,
356
- classNames: [
357
- classNames,
358
- autoHide && disabled && "hidden"
359
- ]
360
- });
361
- } finally {
362
- _effect.f();
363
- }
735
+ var ListItemDeleteButton = ({ autoHide = true, classNames, disabled, icon = "ph--x--regular", label, ...props }) => {
736
+ const { state } = useListContext("DELETE_BUTTON");
737
+ const isDisabled = state.type !== "idle" || disabled;
738
+ const { t } = useTranslation(osTranslations);
739
+ return /* @__PURE__ */ React6.createElement(IconButton, {
740
+ ...props,
741
+ variant: "ghost",
742
+ disabled: isDisabled,
743
+ icon,
744
+ iconOnly: true,
745
+ label: label ?? t("delete.label"),
746
+ classNames: [
747
+ classNames,
748
+ autoHide && disabled && "hidden"
749
+ ]
750
+ });
364
751
  };
365
752
  var ListItemDragHandle = ({ disabled }) => {
366
- var _effect = _useSignals4();
367
- try {
368
- const { dragHandleRef } = useListItemContext("DRAG_HANDLE");
369
- const { t } = useTranslation("os");
370
- return /* @__PURE__ */ React4.createElement(IconButton, {
371
- iconOnly: true,
372
- variant: "ghost",
373
- label: t("drag handle label"),
374
- ref: dragHandleRef,
375
- icon: "ph--dots-six-vertical--regular",
376
- disabled
377
- });
378
- } finally {
379
- _effect.f();
380
- }
753
+ const { dragHandleRef } = useListItemContext("DRAG_HANDLE");
754
+ const { t } = useTranslation(osTranslations);
755
+ return /* @__PURE__ */ React6.createElement(IconButton, {
756
+ variant: "ghost",
757
+ disabled,
758
+ icon: "ph--dots-six-vertical--regular",
759
+ iconOnly: true,
760
+ label: t("drag-handle.label"),
761
+ ref: dragHandleRef
762
+ });
381
763
  };
382
764
  var ListItemDragPreview = ({ children }) => {
383
765
  const { state } = useListContext("DRAG_PREVIEW");
@@ -385,27 +767,13 @@ var ListItemDragPreview = ({ children }) => {
385
767
  item: state.item
386
768
  }), state.container) : null;
387
769
  };
388
- var ListItemWrapper = ({ classNames, children }) => {
389
- var _effect = _useSignals4();
390
- try {
391
- return /* @__PURE__ */ React4.createElement("div", {
392
- className: mx3("flex is-full gap-2", classNames)
393
- }, children);
394
- } finally {
395
- _effect.f();
396
- }
397
- };
398
- var ListItemTitle = ({ classNames, children, ...props }) => {
399
- var _effect = _useSignals4();
400
- try {
401
- return /* @__PURE__ */ React4.createElement("div", {
402
- className: mx3("flex grow items-center truncate", classNames),
403
- ...props
404
- }, children);
405
- } finally {
406
- _effect.f();
407
- }
408
- };
770
+ var ListItemWrapper = ({ classNames, children }) => /* @__PURE__ */ React6.createElement("div", {
771
+ className: mx5("flex w-full gap-2", classNames)
772
+ }, children);
773
+ var ListItemTitle = ({ classNames, children, ...props }) => /* @__PURE__ */ React6.createElement("div", {
774
+ className: mx5("flex grow items-center truncate", classNames),
775
+ ...props
776
+ }, children);
409
777
 
410
778
  // src/components/List/List.tsx
411
779
  var List = {
@@ -414,33 +782,251 @@ var List = {
414
782
  ItemDragPreview: ListItemDragPreview,
415
783
  ItemWrapper: ListItemWrapper,
416
784
  ItemDragHandle: ListItemDragHandle,
785
+ ItemIconButton: ListItemIconButton,
417
786
  ItemDeleteButton: ListItemDeleteButton,
418
- ItemButton: ListItemButton,
419
787
  ItemTitle: ListItemTitle
420
788
  };
421
789
 
790
+ // src/components/Listbox/Listbox.tsx
791
+ import { createContextScope as createContextScope2 } from "@radix-ui/react-context";
792
+ import React8, { forwardRef as forwardRef3 } from "react";
793
+ import { Icon as Icon3 } from "@dxos/react-ui";
794
+ import { mx as mx6 } from "@dxos/ui-theme";
795
+
796
+ // src/components/RowList/RowList.tsx
797
+ import { useArrowNavigationGroup } from "@fluentui/react-tabster";
798
+ import { createContextScope } from "@radix-ui/react-context";
799
+ import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
800
+ import React7, { useCallback as useCallback4 } from "react";
801
+ import { List as List2, ListItem as ListItem2 } from "@dxos/react-list";
802
+ import { ScrollArea as ScrollArea2 } from "@dxos/react-ui";
803
+ import { composable as composable2, composableProps as composableProps2 } from "@dxos/react-ui";
804
+ var ROW_LIST_NAME = "RowList";
805
+ var ROW_LIST_ROOT_NAME = "RowList.Root";
806
+ var ROW_LIST_VIEWPORT_NAME = "RowList.Viewport";
807
+ var ROW_LIST_CONTENT_NAME = "RowList.Content";
808
+ var ROW_NAME = "List.Row";
809
+ var [createRowListContext, createRowListScope] = createContextScope(ROW_LIST_NAME, []);
810
+ var [RowListProvider, useRowListContext] = createRowListContext(ROW_LIST_NAME);
811
+ var Root2 = ({ selectedId, defaultSelectedId, onSelectChange, children }) => {
812
+ const [resolved, setResolved] = useControllableState2({
813
+ prop: selectedId,
814
+ defaultProp: defaultSelectedId,
815
+ onChange: (next) => {
816
+ if (next !== void 0) {
817
+ onSelectChange?.(next);
818
+ }
819
+ }
820
+ });
821
+ const setSelected = useCallback4((id) => setResolved(id), [
822
+ setResolved
823
+ ]);
824
+ return /* @__PURE__ */ React7.createElement(RowListProvider, {
825
+ scope: void 0,
826
+ selectedId: resolved,
827
+ setSelected
828
+ }, children);
829
+ };
830
+ Root2.displayName = ROW_LIST_ROOT_NAME;
831
+ var Viewport = composable2((props, forwardedRef) => {
832
+ const { thin, padding, centered, children, ...rest } = props;
833
+ return /* @__PURE__ */ React7.createElement(ScrollArea2.Root, {
834
+ ...composableProps2(rest, {
835
+ classNames: "dx-container"
836
+ }),
837
+ thin,
838
+ padding,
839
+ centered,
840
+ orientation: "vertical",
841
+ ref: forwardedRef
842
+ }, /* @__PURE__ */ React7.createElement(ScrollArea2.Viewport, null, children));
843
+ });
844
+ Viewport.displayName = ROW_LIST_VIEWPORT_NAME;
845
+ var firstEnabledOption = (ul) => {
846
+ if (!ul) {
847
+ return null;
848
+ }
849
+ return ul.querySelector('[role="option"]:not([aria-disabled="true"])');
850
+ };
851
+ var Content2 = composable2((props, forwardedRef) => {
852
+ useRowListContext(ROW_LIST_CONTENT_NAME, void 0);
853
+ const arrowGroup = useArrowNavigationGroup({
854
+ axis: "vertical",
855
+ memorizeCurrent: true
856
+ });
857
+ const { children, ...rest } = props;
858
+ const handleFocus = useCallback4((event) => {
859
+ if (event.target !== event.currentTarget) {
860
+ return;
861
+ }
862
+ const ul = event.currentTarget;
863
+ const selected = ul.querySelector('[role="option"][aria-selected="true"]:not([aria-disabled="true"])');
864
+ const target = selected ?? firstEnabledOption(ul);
865
+ target?.focus();
866
+ }, []);
867
+ const composed = composableProps2(rest, {
868
+ classNames: "flex flex-col"
869
+ });
870
+ return /* @__PURE__ */ React7.createElement(List2, {
871
+ variant: "unordered",
872
+ ...composed,
873
+ ...arrowGroup,
874
+ role: "listbox",
875
+ onFocus: handleFocus,
876
+ ref: forwardedRef
877
+ }, children);
878
+ });
879
+ Content2.displayName = ROW_LIST_CONTENT_NAME;
880
+ var ROW_BASE = "dx-hover dx-selected px-3 py-2 cursor-pointer outline-none";
881
+ var Row = composable2((props, forwardedRef) => {
882
+ const { id, disabled, onClick, onFocus, children, ...rest } = props;
883
+ const { selectedId, setSelected } = useRowListContext(ROW_NAME, void 0);
884
+ const isSelected = selectedId === id;
885
+ const handleClick = useCallback4((event) => {
886
+ if (disabled) {
887
+ return;
888
+ }
889
+ setSelected(id);
890
+ onClick?.(event);
891
+ }, [
892
+ disabled,
893
+ id,
894
+ setSelected,
895
+ onClick
896
+ ]);
897
+ const handleFocus = useCallback4((event) => {
898
+ if (!disabled && selectedId !== id) {
899
+ setSelected(id);
900
+ }
901
+ onFocus?.(event);
902
+ }, [
903
+ disabled,
904
+ selectedId,
905
+ id,
906
+ setSelected,
907
+ onFocus
908
+ ]);
909
+ const composed = composableProps2(rest, {
910
+ classNames: [
911
+ ROW_BASE,
912
+ disabled && "opacity-50 cursor-not-allowed"
913
+ ]
914
+ });
915
+ return /* @__PURE__ */ React7.createElement(ListItem2, {
916
+ ...composed,
917
+ role: "option",
918
+ tabIndex: 0,
919
+ "aria-selected": isSelected,
920
+ "aria-disabled": disabled || void 0,
921
+ onClick: handleClick,
922
+ onFocus: handleFocus,
923
+ ref: forwardedRef
924
+ }, children);
925
+ });
926
+ Row.displayName = ROW_NAME;
927
+ var useRowListSelection = (id) => {
928
+ const { selectedId } = useRowListContext("useRowListSelection", void 0);
929
+ return selectedId === id;
930
+ };
931
+ var RowList = {
932
+ Root: Root2,
933
+ Viewport,
934
+ Content: Content2
935
+ };
936
+
937
+ // src/components/Listbox/Listbox.tsx
938
+ var commandItem = "flex items-center overflow-hidden";
939
+ var LISTBOX_NAME = "Listbox";
940
+ var LISTBOX_OPTION_NAME = "ListboxOption";
941
+ var LISTBOX_OPTION_INDICATOR_NAME = "ListboxOptionIndicator";
942
+ var [createListboxContext, createListboxScope] = createContextScope2(LISTBOX_NAME, [
943
+ createRowListScope
944
+ ]);
945
+ var [createListboxOptionContext, createListboxOptionScope] = createContextScope2(LISTBOX_OPTION_NAME, [
946
+ createListboxScope
947
+ ]);
948
+ var [ListboxOptionProvider, useListboxOptionContext] = createListboxOptionContext(LISTBOX_OPTION_NAME);
949
+ var ListboxRoot = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
950
+ const { __listboxScope: _scope, children, classNames, value, defaultValue, onValueChange, autoFocus: _autoFocus, ...rootProps } = props;
951
+ return /* @__PURE__ */ React8.createElement(RowList.Root, {
952
+ selectedId: value,
953
+ defaultSelectedId: defaultValue,
954
+ onSelectChange: onValueChange
955
+ }, /* @__PURE__ */ React8.createElement(RowList.Content, {
956
+ ...rootProps,
957
+ classNames: mx6("w-full", classNames),
958
+ ref: forwardedRef
959
+ }, children));
960
+ });
961
+ ListboxRoot.displayName = "Listbox.Root";
962
+ var ListboxOption = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
963
+ const { __listboxScope, children, classNames, value, ...rootProps } = props;
964
+ return /* @__PURE__ */ React8.createElement(Row, {
965
+ id: value,
966
+ ...rootProps,
967
+ classNames: mx6("dx-focus-ring rounded-xs", commandItem, classNames),
968
+ ref: forwardedRef
969
+ }, /* @__PURE__ */ React8.createElement(ListboxOptionProviderHost, {
970
+ value
971
+ }, children));
972
+ });
973
+ ListboxOption.displayName = "Listbox.Option";
974
+ var ListboxOptionProviderHost = ({ value, children }) => {
975
+ const isSelected = useRowListSelection(value);
976
+ return /* @__PURE__ */ React8.createElement(ListboxOptionProvider, {
977
+ scope: void 0,
978
+ value,
979
+ isSelected
980
+ }, children);
981
+ };
982
+ var ListboxOptionLabel = /* @__PURE__ */ forwardRef3(({ children, classNames, ...rootProps }, forwardedRef) => {
983
+ return /* @__PURE__ */ React8.createElement("span", {
984
+ ...rootProps,
985
+ className: mx6("grow truncate", classNames),
986
+ ref: forwardedRef
987
+ }, children);
988
+ });
989
+ ListboxOptionLabel.displayName = "Listbox.OptionLabel";
990
+ var ListboxOptionIndicator = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
991
+ const { __listboxOptionScope, classNames, ...rootProps } = props;
992
+ const { isSelected } = useListboxOptionContext(LISTBOX_OPTION_INDICATOR_NAME, __listboxOptionScope);
993
+ return /* @__PURE__ */ React8.createElement(Icon3, {
994
+ icon: "ph--check--regular",
995
+ ...rootProps,
996
+ classNames: mx6(!isSelected && "invisible", classNames),
997
+ ref: forwardedRef
998
+ });
999
+ });
1000
+ ListboxOptionIndicator.displayName = "Listbox.OptionIndicator";
1001
+ var Listbox = {
1002
+ Root: ListboxRoot,
1003
+ Option: ListboxOption,
1004
+ OptionLabel: ListboxOptionLabel,
1005
+ OptionIndicator: ListboxOptionIndicator
1006
+ };
1007
+
422
1008
  // src/components/Tree/Tree.tsx
423
- import { useSignals as _useSignals8 } from "@preact-signals/safe-react/tracking";
424
- import React8, { useMemo as useMemo2 } from "react";
1009
+ import { useAtomValue as useAtomValue2 } from "@effect-atom/atom-react";
1010
+ import React12, { useMemo as useMemo3 } from "react";
425
1011
  import { Treegrid as Treegrid2 } from "@dxos/react-ui";
426
1012
 
427
1013
  // src/components/Tree/TreeContext.tsx
428
- import { createContext as createContext5, useContext } from "react";
1014
+ import { createContext as createContext7, useContext } from "react";
429
1015
  import { raise } from "@dxos/debug";
430
- var TreeContext = /* @__PURE__ */ createContext5(null);
1016
+ var TreeContext = /* @__PURE__ */ createContext7(null);
431
1017
  var TreeProvider = TreeContext.Provider;
432
1018
  var useTree = () => useContext(TreeContext) ?? raise(new Error("TreeContext not found"));
433
1019
 
434
1020
  // src/components/Tree/TreeItem.tsx
435
- import { useSignals as _useSignals7 } from "@preact-signals/safe-react/tracking";
1021
+ import { attachInstruction, extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";
436
1022
  import { combine as combine2 } from "@atlaskit/pragmatic-drag-and-drop/combine";
437
1023
  import { draggable as draggable2, dropTargetForElements as dropTargetForElements2 } from "@atlaskit/pragmatic-drag-and-drop/element/adapter";
438
- import { attachInstruction, extractInstruction } from "@atlaskit/pragmatic-drag-and-drop-hitbox/tree-item";
1024
+ import { useAtomValue } from "@effect-atom/atom-react";
439
1025
  import * as Schema from "effect/Schema";
440
- import React7, { memo as memo3, useCallback as useCallback3, useEffect as useEffect3, useMemo, useRef as useRef2, useState as useState3 } from "react";
1026
+ import React11, { memo as memo3, useCallback as useCallback6, useEffect as useEffect4, useMemo as useMemo2, useRef as useRef3, useState as useState4 } from "react";
441
1027
  import { invariant as invariant2 } from "@dxos/invariant";
442
- import { TreeItem as NaturalTreeItem, Treegrid } from "@dxos/react-ui";
443
- import { ghostFocusWithin, ghostHover, hoverableControls, hoverableFocusedKeyboardControls, hoverableFocusedWithinControls } from "@dxos/react-ui-theme";
1028
+ import { TreeItem as NaturalTreeItem, Treegrid, TREEGRID_PARENT_OF_SEPARATOR } from "@dxos/react-ui";
1029
+ import { ghostFocusWithin, ghostHover, hoverableControls, hoverableFocusedKeyboardControls, hoverableFocusedWithinControls, mx as mx7 } from "@dxos/ui-theme";
444
1030
 
445
1031
  // src/components/Tree/helpers.ts
446
1032
  var DEFAULT_INDENTATION = 8;
@@ -449,99 +1035,104 @@ var paddingIndentation = (level, indentation = DEFAULT_INDENTATION) => ({
449
1035
  });
450
1036
 
451
1037
  // src/components/Tree/TreeItemHeading.tsx
452
- import { useSignals as _useSignals5 } from "@preact-signals/safe-react/tracking";
453
- import React5, { forwardRef, memo, useCallback as useCallback2 } from "react";
454
- import { Button, Icon as Icon2, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
1038
+ import React9, { forwardRef as forwardRef4, memo, useCallback as useCallback5 } from "react";
1039
+ import { Button as Button2, Icon as Icon4, Tag, toLocalizedString, useTranslation as useTranslation2 } from "@dxos/react-ui";
455
1040
  import { TextTooltip } from "@dxos/react-ui-text-tooltip";
456
- import { getStyles } from "@dxos/react-ui-theme";
457
- var TreeItemHeading = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef(({ label, className, icon, iconHue, disabled, current, onSelect }, forwardedRef) => {
458
- var _effect = _useSignals5();
459
- try {
460
- const { t } = useTranslation2();
461
- const styles = iconHue ? getStyles(iconHue) : void 0;
462
- const handleSelect = useCallback2((event) => {
1041
+ import { getStyles } from "@dxos/ui-theme";
1042
+ var TreeItemHeading = /* @__PURE__ */ memo(/* @__PURE__ */ forwardRef4(({ label, className, icon, iconHue, disabled, current, count, modifiedCount, onSelect }, forwardedRef) => {
1043
+ const { t } = useTranslation2();
1044
+ const styles = iconHue ? getStyles(iconHue) : void 0;
1045
+ const handleSelect = useCallback5((event) => {
1046
+ onSelect?.(event.altKey);
1047
+ }, [
1048
+ onSelect
1049
+ ]);
1050
+ const handleButtonKeydown = useCallback5((event) => {
1051
+ if (event.key === " " || event.key === "Enter") {
1052
+ event.preventDefault();
1053
+ event.stopPropagation();
463
1054
  onSelect?.(event.altKey);
464
- }, [
465
- onSelect
466
- ]);
467
- const handleButtonKeydown = useCallback2((event) => {
468
- if (event.key === " " || event.key === "Enter") {
469
- event.preventDefault();
470
- event.stopPropagation();
471
- onSelect?.(event.altKey);
472
- }
473
- }, [
474
- onSelect
475
- ]);
476
- return /* @__PURE__ */ React5.createElement(TextTooltip, {
477
- text: toLocalizedString(label, t),
478
- side: "bottom",
479
- truncateQuery: "span[data-tooltip]",
480
- onlyWhenTruncating: true,
481
- asChild: true,
482
- ref: forwardedRef
483
- }, /* @__PURE__ */ React5.createElement(Button, {
484
- "data-testid": "treeItem.heading",
485
- variant: "ghost",
486
- density: "fine",
487
- classNames: [
488
- "grow gap-2 pis-0.5 hover:bg-transparent dark:hover:bg-transparent",
489
- "disabled:cursor-default disabled:opacity-100",
490
- className
491
- ],
492
- disabled,
493
- onClick: handleSelect,
494
- onKeyDown: handleButtonKeydown,
495
- ...current && {
496
- "aria-current": "location"
497
- }
498
- }, icon && /* @__PURE__ */ React5.createElement(Icon2, {
499
- icon: icon ?? "ph--placeholder--regular",
500
- size: 5,
501
- classNames: [
502
- "mlb-1",
503
- styles?.icon
504
- ]
505
- }), /* @__PURE__ */ React5.createElement("span", {
506
- className: "flex-1 is-0 truncate text-start text-sm font-normal",
507
- "data-tooltip": true
508
- }, toLocalizedString(label, t))));
509
- } finally {
510
- _effect.f();
511
- }
1055
+ }
1056
+ }, [
1057
+ onSelect
1058
+ ]);
1059
+ return /* @__PURE__ */ React9.createElement(TextTooltip, {
1060
+ text: toLocalizedString(label, t),
1061
+ side: "bottom",
1062
+ truncateQuery: "span[data-tooltip]",
1063
+ onlyWhenTruncating: true,
1064
+ asChild: true,
1065
+ ref: forwardedRef
1066
+ }, /* @__PURE__ */ React9.createElement(Button2, {
1067
+ "data-testid": "treeItem.heading",
1068
+ variant: "ghost",
1069
+ classNames: [
1070
+ "grow shrink min-w-0 justify-start gap-2 ps-0.5 hover:bg-transparent dark:hover:bg-transparent",
1071
+ "disabled:cursor-default disabled:opacity-100",
1072
+ className
1073
+ ],
1074
+ disabled,
1075
+ onClick: handleSelect,
1076
+ onKeyDown: handleButtonKeydown,
1077
+ ...current && {
1078
+ "aria-current": "location"
1079
+ }
1080
+ }, icon && /* @__PURE__ */ React9.createElement(Icon4, {
1081
+ size: 5,
1082
+ icon: icon ?? "ph--circle-dashed--regular",
1083
+ classNames: [
1084
+ "my-1",
1085
+ styles?.text
1086
+ ]
1087
+ }), /* @__PURE__ */ React9.createElement("span", {
1088
+ className: "min-w-0 truncate text-start font-normal",
1089
+ "data-tooltip": true
1090
+ }, toLocalizedString(label, t)), /* @__PURE__ */ React9.createElement(CountBadge, {
1091
+ count,
1092
+ modifiedCount
1093
+ })));
512
1094
  }));
1095
+ var CountBadge = ({ count, modifiedCount }) => {
1096
+ if (typeof modifiedCount === "number" && modifiedCount > 0) {
1097
+ return /* @__PURE__ */ React9.createElement(Tag, {
1098
+ palette: "rose",
1099
+ classNames: "shrink-0 text-center [min-inline-size:1.5rem] tabular-nums"
1100
+ }, modifiedCount);
1101
+ }
1102
+ if (typeof count === "number") {
1103
+ return /* @__PURE__ */ React9.createElement(Tag, {
1104
+ palette: "neutral",
1105
+ classNames: "shrink-0 text-center [min-inline-size:1.5rem] tabular-nums"
1106
+ }, count);
1107
+ }
1108
+ return null;
1109
+ };
513
1110
 
514
1111
  // src/components/Tree/TreeItemToggle.tsx
515
- import { useSignals as _useSignals6 } from "@preact-signals/safe-react/tracking";
516
- import React6, { forwardRef as forwardRef2, memo as memo2 } from "react";
1112
+ import React10, { forwardRef as forwardRef5, memo as memo2 } from "react";
517
1113
  import { IconButton as IconButton2 } from "@dxos/react-ui";
518
- var TreeItemToggle = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef2(({ open, isBranch, hidden, classNames, ...props }, forwardedRef) => {
519
- var _effect = _useSignals6();
520
- try {
521
- return /* @__PURE__ */ React6.createElement(IconButton2, {
522
- ref: forwardedRef,
523
- "data-testid": "treeItem.toggle",
524
- "aria-expanded": open,
525
- variant: "ghost",
526
- density: "fine",
527
- classNames: [
528
- "bs-full is-6 pli-0",
529
- "[&_svg]:transition-[transform] [&_svg]:duration-200",
530
- open && "[&_svg]:rotate-90",
531
- hidden ? "hidden" : !isBranch && "invisible",
532
- classNames
533
- ],
534
- size: 3,
535
- icon: "ph--caret-right--bold",
536
- iconOnly: true,
537
- noTooltip: true,
538
- label: open ? "Click to close" : "Click to open",
539
- tabIndex: -1,
540
- ...props
541
- });
542
- } finally {
543
- _effect.f();
544
- }
1114
+ var TreeItemToggle = /* @__PURE__ */ memo2(/* @__PURE__ */ forwardRef5(({ classNames, open, isBranch, hidden, ...props }, forwardedRef) => {
1115
+ return /* @__PURE__ */ React10.createElement(IconButton2, {
1116
+ ref: forwardedRef,
1117
+ "data-testid": "treeItem.toggle",
1118
+ "aria-expanded": open,
1119
+ variant: "ghost",
1120
+ density: "md",
1121
+ classNames: [
1122
+ "h-full w-6 px-0",
1123
+ "[&_svg]:transition-transform [&_svg]:duration-200",
1124
+ open ? "[&_svg]:rotate-90" : "[&_svg]:rotate-0",
1125
+ hidden ? "hidden" : !isBranch && "invisible",
1126
+ classNames
1127
+ ],
1128
+ size: 3,
1129
+ icon: "ph--caret-right--bold",
1130
+ iconOnly: true,
1131
+ noTooltip: true,
1132
+ label: open ? "Click to close" : "Click to open",
1133
+ tabIndex: -1,
1134
+ ...props
1135
+ });
545
1136
  }));
546
1137
 
547
1138
  // src/components/Tree/TreeItem.tsx
@@ -553,319 +1144,344 @@ var TreeDataSchema = Schema.Struct({
553
1144
  item: Schema.Any
554
1145
  });
555
1146
  var isTreeData = (data) => Schema.is(TreeDataSchema)(data);
556
- var RawTreeItem = ({ item, path: _path, levelOffset = 2, last, draggable: _draggable, renderColumns: Columns, canDrop, canSelect, onOpenChange, onSelect }) => {
557
- var _effect = _useSignals7();
558
- try {
559
- const rowRef = useRef2(null);
560
- const buttonRef = useRef2(null);
561
- const openRef = useRef2(false);
562
- const cancelExpandRef = useRef2(null);
563
- const [_state, setState] = useState3("idle");
564
- const [instruction, setInstruction] = useState3(null);
565
- const [menuOpen, setMenuOpen] = useState3(false);
566
- const { useItems, getProps, isOpen, isCurrent } = useTree();
567
- const items = useItems(item);
568
- const { id, parentOf, label, className, headingClassName, icon, iconHue, disabled, testId } = getProps(item, _path);
569
- const path = useMemo(() => [
570
- ..._path,
571
- id
572
- ], [
573
- _path,
574
- id
575
- ]);
576
- const open = isOpen(path, item);
577
- const current = isCurrent(path, item);
578
- const level = path.length - levelOffset;
579
- const isBranch = !!parentOf;
580
- const mode = last ? "last-in-group" : open ? "expanded" : "standard";
581
- const canSelectItem = canSelect?.({
582
- item,
583
- path
584
- }) ?? true;
585
- const cancelExpand = useCallback3(() => {
586
- if (cancelExpandRef.current) {
587
- clearTimeout(cancelExpandRef.current);
588
- cancelExpandRef.current = null;
589
- }
590
- }, []);
591
- useEffect3(() => {
592
- if (!_draggable) {
593
- return;
1147
+ var RawTreeItem = ({ item, path: pathProp, levelOffset = 2, last, draggable: draggableProp, renderColumns: Columns, blockInstruction, canDrop, canSelect, onOpenChange, onSelect, onItemHover }) => {
1148
+ const rowRef = useRef3(null);
1149
+ const buttonRef = useRef3(null);
1150
+ const openRef = useRef3(false);
1151
+ const cancelExpandRef = useRef3(null);
1152
+ const [_state, setState] = useState4("idle");
1153
+ const [instruction, setInstruction] = useState4(null);
1154
+ const [menuOpen, setMenuOpen] = useState4(false);
1155
+ const { itemProps: itemPropsAtom, childIds: childIdsAtom, itemOpen: itemOpenAtom, itemCurrent: itemCurrentAtom } = useTree();
1156
+ const path = useMemo2(() => [
1157
+ ...pathProp,
1158
+ item.id
1159
+ ], [
1160
+ pathProp,
1161
+ item.id
1162
+ ]);
1163
+ const { id, parentOf, draggable: itemDraggable, droppable: itemDroppable, label, className, headingClassName, icon, iconHue, disabled, testId, count, modifiedCount } = useAtomValue(itemPropsAtom(path));
1164
+ const childIds = useAtomValue(childIdsAtom(item.id));
1165
+ const open = useAtomValue(itemOpenAtom(path));
1166
+ const current = useAtomValue(itemCurrentAtom(path));
1167
+ const level = path.length - levelOffset;
1168
+ const isBranch = !!parentOf;
1169
+ const mode = last ? "last-in-group" : open ? "expanded" : "standard";
1170
+ const canSelectItem = canSelect?.({
1171
+ item,
1172
+ path
1173
+ }) ?? true;
1174
+ const data = {
1175
+ id,
1176
+ path,
1177
+ item
1178
+ };
1179
+ const shouldSeedNativeDragData = typeof document !== "undefined" && document.body.hasAttribute("data-platform");
1180
+ const cancelExpand = useCallback6(() => {
1181
+ if (cancelExpandRef.current) {
1182
+ clearTimeout(cancelExpandRef.current);
1183
+ cancelExpandRef.current = null;
1184
+ }
1185
+ }, []);
1186
+ const isItemDraggable = draggableProp && itemDraggable !== false;
1187
+ const isItemDroppable = itemDroppable !== false;
1188
+ const nativeDragText = id;
1189
+ useEffect4(() => {
1190
+ if (!draggableProp) {
1191
+ return;
1192
+ }
1193
+ invariant2(buttonRef.current, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 70, S: void 0, A: ["buttonRef.current", ""] });
1194
+ const makeDraggable = () => draggable2({
1195
+ element: buttonRef.current,
1196
+ getInitialData: () => data,
1197
+ getInitialDataForExternal: () => {
1198
+ if (!shouldSeedNativeDragData) {
1199
+ return {};
1200
+ }
1201
+ return {
1202
+ "text/plain": nativeDragText
1203
+ };
1204
+ },
1205
+ onDragStart: () => {
1206
+ setState("dragging");
1207
+ if (open) {
1208
+ openRef.current = true;
1209
+ onOpenChange?.({
1210
+ item,
1211
+ path,
1212
+ open: false
1213
+ });
1214
+ }
1215
+ },
1216
+ onDrop: () => {
1217
+ setState("idle");
1218
+ if (openRef.current) {
1219
+ onOpenChange?.({
1220
+ item,
1221
+ path,
1222
+ open: true
1223
+ });
1224
+ }
594
1225
  }
595
- invariant2(buttonRef.current, void 0, {
596
- F: __dxlog_file2,
597
- L: 110,
598
- S: void 0,
599
- A: [
600
- "buttonRef.current",
601
- ""
602
- ]
603
- });
604
- const data = {
605
- id,
606
- path,
607
- item
608
- };
609
- return combine2(
610
- draggable2({
611
- element: buttonRef.current,
612
- getInitialData: () => data,
613
- onDragStart: () => {
614
- setState("dragging");
615
- if (open) {
616
- openRef.current = true;
617
- onOpenChange?.({
618
- item,
619
- path,
620
- open: false
621
- });
622
- }
623
- },
624
- onDrop: () => {
625
- setState("idle");
626
- if (openRef.current) {
1226
+ });
1227
+ if (!isItemDroppable) {
1228
+ return isItemDraggable ? makeDraggable() : void 0;
1229
+ }
1230
+ const dropTarget = dropTargetForElements2({
1231
+ element: buttonRef.current,
1232
+ getData: ({ input, element }) => {
1233
+ return attachInstruction(data, {
1234
+ input,
1235
+ element,
1236
+ indentPerLevel: DEFAULT_INDENTATION,
1237
+ currentLevel: level,
1238
+ mode,
1239
+ block: isBranch ? [] : [
1240
+ "make-child"
1241
+ ]
1242
+ });
1243
+ },
1244
+ canDrop: ({ source }) => {
1245
+ const _canDrop = canDrop ?? (() => true);
1246
+ return source.element !== buttonRef.current && _canDrop({
1247
+ source: source.data,
1248
+ target: data
1249
+ });
1250
+ },
1251
+ getIsSticky: () => true,
1252
+ onDrag: ({ self, source }) => {
1253
+ const desired = extractInstruction(self.data);
1254
+ const block = desired && blockInstruction?.({
1255
+ instruction: desired,
1256
+ source: source.data,
1257
+ target: data
1258
+ });
1259
+ const instruction2 = block && desired.type !== "instruction-blocked" ? {
1260
+ type: "instruction-blocked",
1261
+ desired
1262
+ } : desired;
1263
+ if (source.data.id !== id) {
1264
+ if (instruction2?.type === "make-child" && isBranch && !open && !cancelExpandRef.current) {
1265
+ cancelExpandRef.current = setTimeout(() => {
627
1266
  onOpenChange?.({
628
1267
  item,
629
1268
  path,
630
1269
  open: true
631
1270
  });
632
- }
1271
+ }, 500);
633
1272
  }
634
- }),
635
- // https://github.com/atlassian/pragmatic-drag-and-drop/blob/main/packages/hitbox/constellation/index/about.mdx
636
- dropTargetForElements2({
637
- element: buttonRef.current,
638
- getData: ({ input, element }) => {
639
- return attachInstruction(data, {
640
- input,
641
- element,
642
- indentPerLevel: DEFAULT_INDENTATION,
643
- currentLevel: level,
644
- mode,
645
- block: isBranch ? [] : [
646
- "make-child"
647
- ]
648
- });
649
- },
650
- canDrop: ({ source }) => {
651
- const _canDrop = canDrop ?? (() => true);
652
- return source.element !== buttonRef.current && _canDrop({
653
- source: source.data,
654
- target: data
655
- });
656
- },
657
- getIsSticky: () => true,
658
- onDrag: ({ self, source }) => {
659
- const instruction2 = extractInstruction(self.data);
660
- if (source.data.id !== id) {
661
- if (instruction2?.type === "make-child" && isBranch && !open && !cancelExpandRef.current) {
662
- cancelExpandRef.current = setTimeout(() => {
663
- onOpenChange?.({
664
- item,
665
- path,
666
- open: true
667
- });
668
- }, 500);
669
- }
670
- if (instruction2?.type !== "make-child") {
671
- cancelExpand();
672
- }
673
- setInstruction(instruction2);
674
- } else if (instruction2?.type === "reparent") {
675
- setInstruction(instruction2);
676
- } else {
677
- setInstruction(null);
678
- }
679
- },
680
- onDragLeave: () => {
681
- cancelExpand();
682
- setInstruction(null);
683
- },
684
- onDrop: () => {
1273
+ if (instruction2?.type !== "make-child") {
685
1274
  cancelExpand();
686
- setInstruction(null);
687
1275
  }
688
- })
689
- );
690
- }, [
691
- _draggable,
692
- item,
693
- id,
694
- mode,
695
- path,
696
- open,
697
- canDrop
698
- ]);
699
- useEffect3(() => () => cancelExpand(), [
700
- cancelExpand
701
- ]);
702
- const handleOpenToggle = useCallback3(() => onOpenChange?.({
703
- item,
704
- path,
705
- open: !open
706
- }), [
707
- onOpenChange,
708
- item,
709
- path,
710
- open
711
- ]);
712
- const handleSelect = useCallback3((option = false) => {
713
- if (isBranch && (option || current)) {
714
- handleOpenToggle();
715
- } else if (canSelectItem) {
716
- canSelect?.({
717
- item,
718
- path
719
- });
720
- rowRef.current?.focus();
721
- onSelect?.({
722
- item,
723
- path,
724
- current: !current,
725
- option
726
- });
727
- }
728
- }, [
729
- item,
730
- path,
731
- current,
732
- isBranch,
733
- canSelectItem,
734
- handleOpenToggle,
735
- onSelect
736
- ]);
737
- const handleKeyDown = useCallback3((event) => {
738
- switch (event.key) {
739
- case "ArrowRight":
740
- case "ArrowLeft":
741
- isBranch && handleOpenToggle();
742
- break;
743
- }
744
- }, [
745
- isBranch,
746
- open,
747
- handleOpenToggle,
748
- handleSelect
749
- ]);
750
- return /* @__PURE__ */ React7.createElement(React7.Fragment, null, /* @__PURE__ */ React7.createElement(Treegrid.Row, {
751
- ref: rowRef,
752
- key: id,
753
- id,
754
- "aria-labelledby": `${id}__label`,
755
- parentOf: parentOf?.join(Treegrid.PARENT_OF_SEPARATOR),
756
- classNames: [
757
- "grid grid-cols-subgrid col-[tree-row] mbs-0.5 aria-[current]:bg-activeSurface",
758
- hoverableControls,
759
- hoverableFocusedKeyboardControls,
760
- hoverableFocusedWithinControls,
761
- hoverableDescriptionIcons,
762
- ghostHover,
763
- ghostFocusWithin,
764
- className
765
- ],
766
- "data-object-id": id,
767
- "data-testid": testId,
768
- // NOTE(thure): This is intentionally an empty string to for descendents to select by in the CSS
769
- // without alerting the user (except for in the correct link element). See also:
770
- // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current#description
771
- "aria-current": current ? "" : void 0,
772
- onKeyDown: handleKeyDown,
773
- onContextMenu: (event) => {
774
- event.preventDefault();
775
- setMenuOpen(true);
1276
+ setInstruction(instruction2);
1277
+ } else if (instruction2?.type === "reparent") {
1278
+ setInstruction(instruction2);
1279
+ } else {
1280
+ setInstruction(null);
1281
+ }
1282
+ },
1283
+ onDragLeave: () => {
1284
+ cancelExpand();
1285
+ setInstruction(null);
1286
+ },
1287
+ onDrop: () => {
1288
+ cancelExpand();
1289
+ setInstruction(null);
776
1290
  }
777
- }, /* @__PURE__ */ React7.createElement("div", {
778
- role: "none",
779
- className: "indent relative grid grid-cols-subgrid col-[tree-row]",
780
- style: paddingIndentation(level)
781
- }, /* @__PURE__ */ React7.createElement(Treegrid.Cell, {
782
- classNames: "flex items-center"
783
- }, /* @__PURE__ */ React7.createElement(TreeItemToggle, {
784
- isBranch,
785
- open,
786
- onClick: handleOpenToggle
787
- }), /* @__PURE__ */ React7.createElement(TreeItemHeading, {
788
- disabled,
789
- current,
790
- label,
791
- className: headingClassName,
792
- icon,
793
- iconHue,
794
- onSelect: handleSelect,
795
- ref: buttonRef
796
- })), Columns && /* @__PURE__ */ React7.createElement(Columns, {
797
- item,
798
- path,
799
- open,
800
- menuOpen,
801
- setMenuOpen
802
- }), instruction && /* @__PURE__ */ React7.createElement(NaturalTreeItem.DropIndicator, {
803
- instruction,
804
- gap: 2
805
- }))), open && items.map((item2, index) => /* @__PURE__ */ React7.createElement(TreeItem, {
806
- key: item2.id,
807
- item: item2,
808
- path,
809
- last: index === items.length - 1,
810
- draggable: _draggable,
811
- renderColumns: Columns,
812
- canDrop,
813
- canSelect,
814
- onOpenChange,
815
- onSelect
816
- })));
817
- } finally {
818
- _effect.f();
819
- }
1291
+ });
1292
+ if (!isItemDraggable) {
1293
+ return dropTarget;
1294
+ }
1295
+ return combine2(makeDraggable(), dropTarget);
1296
+ }, [
1297
+ draggableProp,
1298
+ isItemDraggable,
1299
+ isItemDroppable,
1300
+ item,
1301
+ id,
1302
+ mode,
1303
+ path,
1304
+ open,
1305
+ blockInstruction,
1306
+ canDrop
1307
+ ]);
1308
+ useEffect4(() => () => cancelExpand(), [
1309
+ cancelExpand
1310
+ ]);
1311
+ const handleOpenToggle = useCallback6(() => onOpenChange?.({
1312
+ item,
1313
+ path,
1314
+ open: !open
1315
+ }), [
1316
+ onOpenChange,
1317
+ item,
1318
+ path,
1319
+ open
1320
+ ]);
1321
+ const handleSelect = useCallback6((option = false) => {
1322
+ if (isBranch && (option || current)) {
1323
+ handleOpenToggle();
1324
+ } else if (canSelectItem) {
1325
+ canSelect?.({
1326
+ item,
1327
+ path
1328
+ });
1329
+ rowRef.current?.focus();
1330
+ onSelect?.({
1331
+ item,
1332
+ path,
1333
+ current: !current,
1334
+ option
1335
+ });
1336
+ }
1337
+ }, [
1338
+ item,
1339
+ path,
1340
+ current,
1341
+ isBranch,
1342
+ canSelectItem,
1343
+ handleOpenToggle,
1344
+ onSelect
1345
+ ]);
1346
+ const handleKeyDown = useCallback6((event) => {
1347
+ switch (event.key) {
1348
+ case "ArrowRight":
1349
+ case "ArrowLeft":
1350
+ isBranch && handleOpenToggle();
1351
+ break;
1352
+ }
1353
+ }, [
1354
+ isBranch,
1355
+ open,
1356
+ handleOpenToggle,
1357
+ handleSelect
1358
+ ]);
1359
+ const handleItemHover = useCallback6(() => {
1360
+ onItemHover?.({
1361
+ item
1362
+ });
1363
+ }, [
1364
+ onItemHover,
1365
+ item
1366
+ ]);
1367
+ const handleContextMenu = useCallback6((event) => {
1368
+ event.preventDefault();
1369
+ setMenuOpen(true);
1370
+ }, [
1371
+ setMenuOpen
1372
+ ]);
1373
+ const childProps = {
1374
+ draggable: draggableProp,
1375
+ renderColumns: Columns,
1376
+ blockInstruction,
1377
+ canDrop,
1378
+ canSelect,
1379
+ onItemHover,
1380
+ onOpenChange,
1381
+ onSelect
1382
+ };
1383
+ return /* @__PURE__ */ React11.createElement(React11.Fragment, null, /* @__PURE__ */ React11.createElement(Treegrid.Row, {
1384
+ ref: rowRef,
1385
+ key: id,
1386
+ id,
1387
+ "aria-labelledby": `${id}__label`,
1388
+ parentOf: parentOf?.join(TREEGRID_PARENT_OF_SEPARATOR),
1389
+ "data-object-id": id,
1390
+ "data-testid": testId,
1391
+ // NOTE(thure): This is intentionally an empty string to for descendents to select by in the CSS
1392
+ // without alerting the user (except for in the correct link element). See also:
1393
+ // https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-current#description
1394
+ "aria-current": current ? "" : void 0,
1395
+ classNames: mx7("grid grid-cols-subgrid col-[tree-row] mt-0.5 is-current:bg-current-surface", hoverableControls, hoverableFocusedKeyboardControls, hoverableFocusedWithinControls, hoverableDescriptionIcons, ghostFocusWithin, ghostHover, className),
1396
+ onKeyDown: handleKeyDown,
1397
+ onMouseEnter: handleItemHover,
1398
+ onContextMenu: handleContextMenu
1399
+ }, /* @__PURE__ */ React11.createElement("div", {
1400
+ className: "indent relative grid grid-cols-subgrid col-[tree-row]",
1401
+ style: paddingIndentation(level)
1402
+ }, /* @__PURE__ */ React11.createElement(Treegrid.Cell, {
1403
+ classNames: "flex items-center"
1404
+ }, /* @__PURE__ */ React11.createElement(TreeItemToggle, {
1405
+ isBranch,
1406
+ open,
1407
+ onClick: handleOpenToggle
1408
+ }), /* @__PURE__ */ React11.createElement(TreeItemHeading, {
1409
+ disabled,
1410
+ current,
1411
+ label,
1412
+ className: headingClassName,
1413
+ icon,
1414
+ iconHue,
1415
+ count,
1416
+ modifiedCount,
1417
+ onSelect: handleSelect,
1418
+ ref: buttonRef
1419
+ })), Columns && /* @__PURE__ */ React11.createElement(Columns, {
1420
+ item,
1421
+ path,
1422
+ open,
1423
+ menuOpen,
1424
+ setMenuOpen
1425
+ }), instruction && /* @__PURE__ */ React11.createElement(NaturalTreeItem.DropIndicator, {
1426
+ instruction,
1427
+ gap: 2
1428
+ }))), open && childIds.map((childId, index) => /* @__PURE__ */ React11.createElement(TreeItemById, {
1429
+ key: childId,
1430
+ id: childId,
1431
+ path,
1432
+ last: index === childIds.length - 1,
1433
+ ...childProps
1434
+ })));
820
1435
  };
821
1436
  var TreeItem = /* @__PURE__ */ memo3(RawTreeItem);
1437
+ var RawTreeItemById = ({ id, ...props }) => {
1438
+ const { item: itemAtom } = useTree();
1439
+ const item = useAtomValue(itemAtom(id));
1440
+ if (!item) {
1441
+ return null;
1442
+ }
1443
+ return /* @__PURE__ */ React11.createElement(TreeItem, {
1444
+ item,
1445
+ ...props
1446
+ });
1447
+ };
1448
+ var TreeItemById = /* @__PURE__ */ memo3(RawTreeItemById);
822
1449
 
823
1450
  // src/components/Tree/Tree.tsx
824
- var Tree = ({ root, path, id, useItems, getProps, isOpen, isCurrent, draggable: draggable3 = false, gridTemplateColumns = "[tree-row-start] 1fr min-content [tree-row-end]", classNames, levelOffset, renderColumns, canDrop, canSelect, onOpenChange, onSelect }) => {
825
- var _effect = _useSignals8();
826
- try {
827
- const context = useMemo2(() => ({
828
- useItems,
829
- getProps,
830
- isOpen,
831
- isCurrent
832
- }), [
833
- useItems,
834
- getProps,
835
- isOpen,
836
- isCurrent
837
- ]);
838
- const items = useItems(root);
839
- const treePath = useMemo2(() => path ? [
840
- ...path,
841
- id
842
- ] : [
843
- id
844
- ], [
845
- id,
846
- path
847
- ]);
848
- return /* @__PURE__ */ React8.createElement(Treegrid2.Root, {
849
- gridTemplateColumns,
850
- classNames
851
- }, /* @__PURE__ */ React8.createElement(TreeProvider, {
852
- value: context
853
- }, items.map((item, index) => /* @__PURE__ */ React8.createElement(TreeItem, {
854
- key: item.id,
855
- item,
856
- last: index === items.length - 1,
857
- path: treePath,
858
- levelOffset,
859
- draggable: draggable3,
860
- renderColumns,
861
- canDrop,
862
- canSelect,
863
- onOpenChange,
864
- onSelect
865
- }))));
866
- } finally {
867
- _effect.f();
868
- }
1451
+ var Tree = ({ classNames, model, rootId, path, id, draggable: draggable3 = false, gridTemplateColumns = "[tree-row-start] minmax(0, 1fr) min-content [tree-row-end]", levelOffset, renderColumns, blockInstruction, canDrop, canSelect, onOpenChange, onSelect, onItemHover }) => {
1452
+ const childIds = useAtomValue2(model.childIds(rootId));
1453
+ const treePath = useMemo3(() => path ? [
1454
+ ...path,
1455
+ id
1456
+ ] : [
1457
+ id
1458
+ ], [
1459
+ id,
1460
+ path
1461
+ ]);
1462
+ const childProps = {
1463
+ path: treePath,
1464
+ levelOffset,
1465
+ draggable: draggable3,
1466
+ renderColumns,
1467
+ blockInstruction,
1468
+ canDrop,
1469
+ canSelect,
1470
+ onOpenChange,
1471
+ onSelect,
1472
+ onItemHover
1473
+ };
1474
+ return /* @__PURE__ */ React12.createElement(Treegrid2.Root, {
1475
+ gridTemplateColumns,
1476
+ classNames
1477
+ }, /* @__PURE__ */ React12.createElement(TreeProvider, {
1478
+ value: model
1479
+ }, childIds.map((childId, index) => /* @__PURE__ */ React12.createElement(TreeItemById, {
1480
+ key: childId,
1481
+ id: childId,
1482
+ last: index === childIds.length - 1,
1483
+ ...childProps
1484
+ }))));
869
1485
  };
870
1486
 
871
1487
  // src/util/path.ts
@@ -885,13 +1501,27 @@ var Path = {
885
1501
  };
886
1502
  export {
887
1503
  Accordion,
1504
+ Combobox,
1505
+ DEFAULT_INDENTATION,
888
1506
  List,
1507
+ Listbox,
889
1508
  Path,
1509
+ Picker,
1510
+ Row,
1511
+ RowList,
890
1512
  Tree,
891
1513
  TreeDataSchema,
892
1514
  TreeItem,
1515
+ TreeItemById,
1516
+ TreeItemToggle,
893
1517
  TreeProvider,
1518
+ createListboxScope,
1519
+ createRowListScope,
894
1520
  isTreeData,
1521
+ paddingIndentation,
1522
+ usePickerInputContext,
1523
+ usePickerItemContext,
1524
+ useRowListSelection,
895
1525
  useTree
896
1526
  };
897
1527
  //# sourceMappingURL=index.mjs.map