@dxos/react-ui-list 0.8.4-main.84f28bd → 0.8.4-main.8baae0fced

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