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