@dxos/react-ui-searchlist 0.8.4-main.84f28bd → 0.8.4-main.937b3ca

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 (78) hide show
  1. package/dist/lib/browser/index.mjs +744 -266
  2. package/dist/lib/browser/index.mjs.map +4 -4
  3. package/dist/lib/browser/meta.json +1 -1
  4. package/dist/lib/node-esm/index.mjs +744 -266
  5. package/dist/lib/node-esm/index.mjs.map +4 -4
  6. package/dist/lib/node-esm/meta.json +1 -1
  7. package/dist/types/src/components/Combobox/Combobox.d.ts +84 -0
  8. package/dist/types/src/components/Combobox/Combobox.d.ts.map +1 -0
  9. package/dist/types/src/components/Combobox/Combobox.stories.d.ts +21 -0
  10. package/dist/types/src/components/Combobox/Combobox.stories.d.ts.map +1 -0
  11. package/dist/types/src/components/Combobox/index.d.ts +2 -0
  12. package/dist/types/src/components/Combobox/index.d.ts.map +1 -0
  13. package/dist/types/src/components/Listbox/Listbox.d.ts +31 -0
  14. package/dist/types/src/components/Listbox/Listbox.d.ts.map +1 -0
  15. package/dist/types/src/components/Listbox/Listbox.stories.d.ts +21 -0
  16. package/dist/types/src/components/Listbox/Listbox.stories.d.ts.map +1 -0
  17. package/dist/types/src/components/Listbox/index.d.ts +2 -0
  18. package/dist/types/src/components/Listbox/index.d.ts.map +1 -0
  19. package/dist/types/src/components/SearchList/SearchList.d.ts +87 -0
  20. package/dist/types/src/components/SearchList/SearchList.d.ts.map +1 -0
  21. package/dist/types/src/components/SearchList/SearchList.stories.d.ts +28 -0
  22. package/dist/types/src/components/SearchList/SearchList.stories.d.ts.map +1 -0
  23. package/dist/types/src/components/SearchList/context.d.ts +33 -0
  24. package/dist/types/src/components/SearchList/context.d.ts.map +1 -0
  25. package/dist/types/src/components/SearchList/hooks/index.d.ts +5 -0
  26. package/dist/types/src/components/SearchList/hooks/index.d.ts.map +1 -0
  27. package/dist/types/src/components/SearchList/hooks/useGlobalFilter.d.ts +34 -0
  28. package/dist/types/src/components/SearchList/hooks/useGlobalFilter.d.ts.map +1 -0
  29. package/dist/types/src/components/SearchList/hooks/useSearchListInput.d.ts +12 -0
  30. package/dist/types/src/components/SearchList/hooks/useSearchListInput.d.ts.map +1 -0
  31. package/dist/types/src/components/SearchList/hooks/useSearchListItem.d.ts +10 -0
  32. package/dist/types/src/components/SearchList/hooks/useSearchListItem.d.ts.map +1 -0
  33. package/dist/types/src/components/SearchList/hooks/useSearchListResults.d.ts +36 -0
  34. package/dist/types/src/components/SearchList/hooks/useSearchListResults.d.ts.map +1 -0
  35. package/dist/types/src/components/SearchList/index.d.ts +3 -0
  36. package/dist/types/src/components/SearchList/index.d.ts.map +1 -0
  37. package/dist/types/src/components/index.d.ts +2 -0
  38. package/dist/types/src/components/index.d.ts.map +1 -1
  39. package/dist/types/src/index.d.ts +0 -1
  40. package/dist/types/src/index.d.ts.map +1 -1
  41. package/dist/types/src/translations.d.ts +4 -2
  42. package/dist/types/src/translations.d.ts.map +1 -1
  43. package/dist/types/tsconfig.tsbuildinfo +1 -1
  44. package/package.json +23 -19
  45. package/src/components/Combobox/Combobox.stories.tsx +62 -0
  46. package/src/components/Combobox/Combobox.tsx +356 -0
  47. package/src/components/Combobox/index.ts +5 -0
  48. package/src/components/Listbox/Listbox.stories.tsx +53 -0
  49. package/src/components/Listbox/Listbox.tsx +214 -0
  50. package/src/components/Listbox/index.ts +5 -0
  51. package/src/components/SearchList/SearchList.stories.tsx +534 -0
  52. package/src/components/SearchList/SearchList.tsx +559 -0
  53. package/src/components/SearchList/context.ts +43 -0
  54. package/src/components/SearchList/hooks/index.ts +8 -0
  55. package/src/components/SearchList/hooks/useGlobalFilter.tsx +61 -0
  56. package/src/components/SearchList/hooks/useSearchListInput.ts +14 -0
  57. package/src/components/SearchList/hooks/useSearchListItem.ts +14 -0
  58. package/src/components/SearchList/hooks/useSearchListResults.ts +104 -0
  59. package/src/components/SearchList/index.ts +6 -0
  60. package/src/components/index.ts +2 -0
  61. package/src/index.ts +0 -1
  62. package/src/translations.ts +4 -2
  63. package/src/types/command-score.d.ts +16 -0
  64. package/dist/types/src/components/SearchList.d.ts +0 -44
  65. package/dist/types/src/components/SearchList.d.ts.map +0 -1
  66. package/dist/types/src/components/SearchList.stories.d.ts +0 -15
  67. package/dist/types/src/components/SearchList.stories.d.ts.map +0 -1
  68. package/dist/types/src/composites/PopoverCombobox.d.ts +0 -32
  69. package/dist/types/src/composites/PopoverCombobox.d.ts.map +0 -1
  70. package/dist/types/src/composites/PopoverCombobox.stories.d.ts +0 -28
  71. package/dist/types/src/composites/PopoverCombobox.stories.d.ts.map +0 -1
  72. package/dist/types/src/composites/index.d.ts +0 -2
  73. package/dist/types/src/composites/index.d.ts.map +0 -1
  74. package/src/components/SearchList.stories.tsx +0 -47
  75. package/src/components/SearchList.tsx +0 -250
  76. package/src/composites/PopoverCombobox.stories.tsx +0 -44
  77. package/src/composites/PopoverCombobox.tsx +0 -186
  78. package/src/composites/index.ts +0 -5
@@ -1,293 +1,771 @@
1
- // src/components/SearchList.tsx
2
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
3
- import { CaretDown } from "@phosphor-icons/react";
4
- import { createContext } from "@radix-ui/react-context";
1
+ // src/components/Combobox/Combobox.tsx
2
+ import { createContext as createContext3 } from "@radix-ui/react-context";
3
+ import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
4
+ import React3, { forwardRef as forwardRef2, useCallback as useCallback3 } from "react";
5
+ import { Button, Icon as Icon2, Popover } from "@dxos/react-ui";
6
+ import { useId } from "@dxos/react-ui";
7
+ import { mx as mx2, staticPlaceholderText } from "@dxos/ui-theme";
8
+
9
+ // src/components/SearchList/SearchList.tsx
5
10
  import { useControllableState } from "@radix-ui/react-use-controllable-state";
6
- import { CommandEmpty, CommandInput, CommandItem, CommandList, CommandRoot } from "cmdk";
7
- import React, { forwardRef, useCallback } from "react";
8
- import { Button, useDensityContext, useElevationContext, useId, useThemeContext } from "@dxos/react-ui";
9
- import { getSize, mx, staticPlaceholderText } from "@dxos/react-ui-theme";
10
- var COMBOBOX_NAME = "Combobox";
11
- var COMBOBOX_TRIGGER_NAME = "ComboboxTrigger";
12
- var SEARCHLIST_NAME = "SearchList";
13
- var SEARCHLIST_ITEM_NAME = "SearchListItem";
14
- var [ComboboxProvider, useComboboxContext] = createContext(COMBOBOX_NAME, {});
15
- var SearchListRoot = /* @__PURE__ */ forwardRef(({ children, classNames, ...props }, forwardedRef) => {
16
- var _effect = _useSignals();
17
- try {
18
- return /* @__PURE__ */ React.createElement(CommandRoot, {
19
- ...props,
20
- className: mx("", classNames),
21
- ref: forwardedRef
22
- }, children);
23
- } finally {
24
- _effect.f();
25
- }
26
- });
27
- SearchListRoot.displayName = SEARCHLIST_NAME;
28
- var SearchListInput = /* @__PURE__ */ forwardRef(({ children, classNames, density: propsDensity, elevation: propsElevation, variant, ...props }, forwardedRef) => {
29
- var _effect = _useSignals();
30
- try {
31
- const { hasIosKeyboard } = useThemeContext();
32
- const { tx } = useThemeContext();
33
- const density = useDensityContext(propsDensity);
34
- const elevation = useElevationContext(propsElevation);
35
- return /* @__PURE__ */ React.createElement(CommandInput, {
36
- ...props,
37
- className: tx("input.input", "input", {
38
- variant,
39
- disabled: props.disabled,
40
- density,
41
- elevation
42
- }, "mbe-cardSpacingBlock", classNames),
43
- ...props.autoFocus && !hasIosKeyboard && {
44
- autoFocus: true
45
- },
46
- ref: forwardedRef
47
- });
48
- } finally {
49
- _effect.f();
50
- }
51
- });
52
- var SearchListContent = /* @__PURE__ */ forwardRef(({ children, classNames, ...props }, forwardedRef) => {
53
- var _effect = _useSignals();
54
- try {
55
- return /* @__PURE__ */ React.createElement(CommandList, {
56
- ...props,
57
- className: mx(classNames),
58
- ref: forwardedRef
59
- }, children);
60
- } finally {
61
- _effect.f();
11
+ import React, { forwardRef, useCallback, useEffect, useMemo, useRef, useState } from "react";
12
+ import { Icon, useDensityContext, useElevationContext, useThemeContext, useTranslation } from "@dxos/react-ui";
13
+ import { descriptionText, mx } from "@dxos/ui-theme";
14
+
15
+ // src/translations.ts
16
+ var translationKey = "@dxos/react-ui-searchlist";
17
+ var translations = [
18
+ {
19
+ "en-US": {
20
+ [translationKey]: {
21
+ "search.placeholder": "Search..."
22
+ }
23
+ }
62
24
  }
25
+ ];
26
+
27
+ // src/components/SearchList/context.ts
28
+ import { createContext } from "@radix-ui/react-context";
29
+ var [SearchListItemContextProvider, useSearchListItemContext] = createContext("SearchListItem");
30
+ var [SearchListInputContextProvider, useSearchListInputContext] = createContext("SearchListInput");
31
+
32
+ // src/components/SearchList/SearchList.tsx
33
+ var SearchListRoot = ({ children, value: valueProp, defaultValue = "", debounceMs = 200, onSearch }) => {
34
+ const [query = "", setQuery] = useControllableState({
35
+ prop: valueProp,
36
+ defaultProp: defaultValue,
37
+ onChange: void 0
38
+ });
39
+ const [selectedValue, setSelectedValue] = useState(void 0);
40
+ const itemsRef = useRef(/* @__PURE__ */ new Map());
41
+ const debounceRef = useRef(null);
42
+ const handleQueryChange = useCallback((newQuery) => {
43
+ setQuery(newQuery);
44
+ if (debounceRef.current) {
45
+ clearTimeout(debounceRef.current);
46
+ }
47
+ debounceRef.current = setTimeout(() => {
48
+ onSearch?.(newQuery);
49
+ }, debounceMs);
50
+ }, [
51
+ setQuery,
52
+ onSearch,
53
+ debounceMs
54
+ ]);
55
+ const [itemVersion, setItemVersion] = useState(0);
56
+ useEffect(() => {
57
+ return () => {
58
+ if (debounceRef.current) {
59
+ clearTimeout(debounceRef.current);
60
+ }
61
+ };
62
+ }, []);
63
+ useEffect(() => {
64
+ const currentItem = selectedValue !== void 0 ? itemsRef.current.get(selectedValue) : void 0;
65
+ const isSelectionValid = currentItem !== void 0 && !currentItem.disabled;
66
+ if (!isSelectionValid && itemsRef.current.size > 0) {
67
+ const entries = Array.from(itemsRef.current.entries()).filter(([, data]) => !data.disabled);
68
+ if (entries.length > 0) {
69
+ entries.sort(([, a], [, b]) => {
70
+ const position = a.element.compareDocumentPosition(b.element);
71
+ if (position & Node.DOCUMENT_POSITION_FOLLOWING) {
72
+ return -1;
73
+ }
74
+ if (position & Node.DOCUMENT_POSITION_PRECEDING) {
75
+ return 1;
76
+ }
77
+ return 0;
78
+ });
79
+ const firstValue = entries[0]?.[0];
80
+ if (firstValue !== void 0 && firstValue !== selectedValue) {
81
+ setSelectedValue(firstValue);
82
+ }
83
+ } else if (selectedValue !== void 0) {
84
+ setSelectedValue(void 0);
85
+ }
86
+ }
87
+ }, [
88
+ itemVersion,
89
+ selectedValue
90
+ ]);
91
+ const registerItem = useCallback((value, element, onSelect, disabled) => {
92
+ if (element) {
93
+ itemsRef.current.set(value, {
94
+ element,
95
+ onSelect,
96
+ disabled
97
+ });
98
+ setItemVersion((v) => v + 1);
99
+ }
100
+ }, []);
101
+ const unregisterItem = useCallback((value) => {
102
+ itemsRef.current.delete(value);
103
+ setItemVersion((v) => v + 1);
104
+ }, []);
105
+ const getItemValues = useCallback(() => {
106
+ return Array.from(itemsRef.current.entries()).filter(([, data]) => !data.disabled).sort(([, a], [, b]) => {
107
+ const position = a.element.compareDocumentPosition(b.element);
108
+ return position & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : position & Node.DOCUMENT_POSITION_PRECEDING ? 1 : 0;
109
+ }).map(([value]) => value);
110
+ }, []);
111
+ const triggerSelect = useCallback(() => {
112
+ if (selectedValue !== void 0) {
113
+ const item = itemsRef.current.get(selectedValue);
114
+ item?.onSelect?.();
115
+ }
116
+ }, [
117
+ selectedValue
118
+ ]);
119
+ const itemContextValue = useMemo(() => ({
120
+ selectedValue,
121
+ onSelectedValueChange: setSelectedValue,
122
+ registerItem,
123
+ unregisterItem
124
+ }), [
125
+ selectedValue,
126
+ registerItem,
127
+ unregisterItem
128
+ ]);
129
+ const inputContextValue = useMemo(() => ({
130
+ query,
131
+ onQueryChange: handleQueryChange,
132
+ selectedValue,
133
+ onSelectedValueChange: setSelectedValue,
134
+ getItemValues,
135
+ triggerSelect
136
+ }), [
137
+ query,
138
+ handleQueryChange,
139
+ selectedValue,
140
+ getItemValues,
141
+ triggerSelect
142
+ ]);
143
+ return /* @__PURE__ */ React.createElement(SearchListInputContextProvider, {
144
+ query: inputContextValue.query,
145
+ onQueryChange: inputContextValue.onQueryChange,
146
+ selectedValue: inputContextValue.selectedValue,
147
+ onSelectedValueChange: inputContextValue.onSelectedValueChange,
148
+ getItemValues: inputContextValue.getItemValues,
149
+ triggerSelect: inputContextValue.triggerSelect
150
+ }, /* @__PURE__ */ React.createElement(SearchListItemContextProvider, {
151
+ selectedValue: itemContextValue.selectedValue,
152
+ onSelectedValueChange: itemContextValue.onSelectedValueChange,
153
+ registerItem: itemContextValue.registerItem,
154
+ unregisterItem: itemContextValue.unregisterItem
155
+ }, children));
156
+ };
157
+ SearchListRoot.displayName = "SearchList.Root";
158
+ var SearchListViewport = ({ classNames, children }) => {
159
+ return /* @__PURE__ */ React.createElement("div", {
160
+ role: "none",
161
+ className: mx("is-full min-bs-0 grow overflow-y-auto", classNames)
162
+ }, children);
163
+ };
164
+ SearchListViewport.displayName = "SearchList.Viewport";
165
+ var SearchListContent = /* @__PURE__ */ forwardRef(({ classNames, children }, forwardedRef) => {
166
+ return /* @__PURE__ */ React.createElement("div", {
167
+ ref: forwardedRef,
168
+ role: "listbox",
169
+ className: mx("flex flex-col is-full min-bs-0 grow overflow-hidden", classNames)
170
+ }, children);
63
171
  });
64
- var SearchListEmpty = /* @__PURE__ */ forwardRef(({ children, classNames, ...props }, forwardedRef) => {
65
- var _effect = _useSignals();
66
- try {
67
- return /* @__PURE__ */ React.createElement(CommandEmpty, {
68
- ...props,
69
- className: mx(classNames),
70
- ref: forwardedRef
71
- }, children);
72
- } finally {
73
- _effect.f();
74
- }
172
+ SearchListContent.displayName = "SearchList.Content";
173
+ var SearchListInput = /* @__PURE__ */ forwardRef(({ classNames, density: propsDensity, elevation: propsElevation, variant, placeholder, onChange, ...props }, forwardedRef) => {
174
+ const { query, onQueryChange, selectedValue, onSelectedValueChange, getItemValues, triggerSelect } = useSearchListInputContext("SearchList.Input");
175
+ const { t } = useTranslation(translationKey);
176
+ const { hasIosKeyboard, tx } = useThemeContext();
177
+ const density = useDensityContext(propsDensity);
178
+ const elevation = useElevationContext(propsElevation);
179
+ const defaultPlaceholder = t("search.placeholder");
180
+ const handleChange = useCallback((event) => {
181
+ onQueryChange(event.target.value);
182
+ onChange?.(event);
183
+ }, [
184
+ onQueryChange,
185
+ onChange
186
+ ]);
187
+ const handleKeyDown = useCallback((event) => {
188
+ const values = getItemValues();
189
+ if (values.length === 0) {
190
+ if (event.key === "Escape") {
191
+ onQueryChange("");
192
+ }
193
+ return;
194
+ }
195
+ const currentIndex = selectedValue !== void 0 ? values.indexOf(selectedValue) : -1;
196
+ switch (event.key) {
197
+ case "ArrowDown": {
198
+ event.preventDefault();
199
+ const nextIndex = currentIndex === -1 ? 0 : Math.min(currentIndex + 1, values.length - 1);
200
+ const nextValue = values[nextIndex];
201
+ if (nextValue !== void 0) {
202
+ onSelectedValueChange(nextValue);
203
+ }
204
+ break;
205
+ }
206
+ case "ArrowUp": {
207
+ event.preventDefault();
208
+ const prevIndex = currentIndex === -1 ? values.length - 1 : Math.max(currentIndex - 1, 0);
209
+ const prevValue = values[prevIndex];
210
+ if (prevValue !== void 0) {
211
+ onSelectedValueChange(prevValue);
212
+ }
213
+ break;
214
+ }
215
+ case "Enter": {
216
+ if (selectedValue !== void 0) {
217
+ event.preventDefault();
218
+ triggerSelect();
219
+ }
220
+ break;
221
+ }
222
+ case "Home": {
223
+ event.preventDefault();
224
+ const firstValue = values[0];
225
+ if (firstValue !== void 0) {
226
+ onSelectedValueChange(firstValue);
227
+ }
228
+ break;
229
+ }
230
+ case "End": {
231
+ event.preventDefault();
232
+ const lastValue = values[values.length - 1];
233
+ if (lastValue !== void 0) {
234
+ onSelectedValueChange(lastValue);
235
+ }
236
+ break;
237
+ }
238
+ case "Escape": {
239
+ event.preventDefault();
240
+ if (selectedValue !== void 0) {
241
+ onSelectedValueChange(void 0);
242
+ } else {
243
+ onQueryChange("");
244
+ }
245
+ break;
246
+ }
247
+ }
248
+ }, [
249
+ selectedValue,
250
+ onSelectedValueChange,
251
+ getItemValues,
252
+ triggerSelect,
253
+ onQueryChange
254
+ ]);
255
+ return /* @__PURE__ */ React.createElement("input", {
256
+ ...props,
257
+ ...props.autoFocus && !hasIosKeyboard && {
258
+ autoFocus: true
259
+ },
260
+ type: "text",
261
+ value: query,
262
+ placeholder: placeholder ?? defaultPlaceholder,
263
+ className: tx("input.input", "input", {
264
+ variant,
265
+ disabled: props.disabled,
266
+ density,
267
+ elevation
268
+ }, classNames),
269
+ onChange: handleChange,
270
+ onKeyDown: handleKeyDown,
271
+ ref: forwardedRef
272
+ });
75
273
  });
76
- var SearchListItem = /* @__PURE__ */ forwardRef(({ children, classNames, onSelect, ...props }, forwardedRef) => {
77
- var _effect = _useSignals();
78
- try {
79
- const { onValueChange, onOpenChange } = useComboboxContext(SEARCHLIST_ITEM_NAME);
80
- const handleSelect = useCallback((nextValue) => {
81
- onValueChange?.(nextValue);
82
- onOpenChange?.(false);
83
- onSelect?.(nextValue);
84
- }, [
85
- onValueChange,
86
- onOpenChange,
87
- onSelect
88
- ]);
89
- return /* @__PURE__ */ React.createElement(CommandItem, {
90
- ...props,
91
- onSelect: handleSelect,
92
- className: mx("p-1 rounded select-none cursor-pointer data-[selected]:bg-hoverOverlay", classNames),
93
- ref: forwardedRef
94
- }, children);
95
- } finally {
96
- _effect.f();
97
- }
274
+ SearchListInput.displayName = "SearchList.Input";
275
+ var SearchListItem = /* @__PURE__ */ forwardRef(({ classNames, value, label, icon, checked, suffix, onSelect, disabled }, forwardedRef) => {
276
+ const { selectedValue, registerItem, unregisterItem } = useSearchListItemContext("SearchList.Item");
277
+ const internalRef = useRef(null);
278
+ const isSelected = selectedValue === value && !disabled;
279
+ useEffect(() => {
280
+ const element = internalRef.current;
281
+ if (element) {
282
+ registerItem(value, element, onSelect, disabled);
283
+ }
284
+ return () => unregisterItem(value);
285
+ }, [
286
+ value,
287
+ onSelect,
288
+ disabled,
289
+ registerItem,
290
+ unregisterItem
291
+ ]);
292
+ useEffect(() => {
293
+ if (isSelected && internalRef.current) {
294
+ internalRef.current.scrollIntoView({
295
+ block: "nearest",
296
+ behavior: "smooth"
297
+ });
298
+ }
299
+ }, [
300
+ isSelected
301
+ ]);
302
+ const handleClick = useCallback(() => {
303
+ if (!disabled) {
304
+ onSelect?.();
305
+ }
306
+ }, [
307
+ onSelect,
308
+ disabled
309
+ ]);
310
+ return /* @__PURE__ */ React.createElement("div", {
311
+ ref: (node) => {
312
+ internalRef.current = node;
313
+ if (typeof forwardedRef === "function") {
314
+ forwardedRef(node);
315
+ } else if (forwardedRef) {
316
+ forwardedRef.current = node;
317
+ }
318
+ },
319
+ role: "option",
320
+ "aria-selected": isSelected,
321
+ "aria-disabled": disabled,
322
+ "data-selected": isSelected,
323
+ "data-disabled": disabled,
324
+ "data-value": value,
325
+ tabIndex: -1,
326
+ className: mx("flex gap-2 items-center", "plb-1 pli-2 rounded-sm select-none cursor-pointer data-[selected=true]:bg-hoverOverlay hover:bg-hoverOverlay", disabled && "opacity-50 cursor-not-allowed hover:bg-transparent data-[selected=true]:bg-transparent", classNames),
327
+ onClick: handleClick
328
+ }, icon && /* @__PURE__ */ React.createElement(Icon, {
329
+ icon,
330
+ size: 5
331
+ }), /* @__PURE__ */ React.createElement("span", {
332
+ className: "is-0 grow truncate"
333
+ }, label), suffix && /* @__PURE__ */ React.createElement("span", {
334
+ className: mx("shrink-0", descriptionText)
335
+ }, suffix), checked && /* @__PURE__ */ React.createElement(Icon, {
336
+ icon: "ph--check--regular",
337
+ size: 5
338
+ }));
98
339
  });
99
- SearchListItem.displayName = SEARCHLIST_ITEM_NAME;
100
- var ComboboxRoot = ({ modalId: propsModalId, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, value: propsValue, defaultValue, onValueChange: propsOnValueChange, placeholder, children }) => {
101
- var _effect = _useSignals();
102
- try {
103
- const modalId = useId(COMBOBOX_NAME, propsModalId);
104
- const [open = false, onOpenChange] = useControllableState({
105
- prop: propsOpen,
106
- onChange: propsOnOpenChange,
107
- defaultProp: defaultOpen
108
- });
109
- const [value = "", onValueChange] = useControllableState({
110
- prop: propsValue,
111
- onChange: propsOnValueChange,
112
- defaultProp: defaultValue
113
- });
114
- return /* @__PURE__ */ React.createElement(ComboboxProvider, {
115
- isCombobox: true,
116
- modalId,
117
- open,
118
- onOpenChange,
119
- value,
120
- onValueChange,
121
- placeholder
122
- }, children);
123
- } finally {
124
- _effect.f();
125
- }
340
+ SearchListItem.displayName = "SearchList.Item";
341
+ var SearchListEmpty = ({ classNames, children }) => {
342
+ return /* @__PURE__ */ React.createElement("div", {
343
+ role: "status",
344
+ className: mx("flex flex-col is-full pli-2 plb-1", classNames)
345
+ }, children);
126
346
  };
127
- ComboboxRoot.displayName = COMBOBOX_NAME;
128
- var ComboboxTrigger = /* @__PURE__ */ forwardRef(({ children, onClick, ...props }, forwardedRef) => {
129
- var _effect = _useSignals();
130
- try {
131
- const { modalId, open, onOpenChange, placeholder, value } = useComboboxContext(COMBOBOX_TRIGGER_NAME);
132
- const handleClick = useCallback((event) => {
133
- onClick?.(event);
134
- onOpenChange?.(true);
135
- }, [
136
- onClick,
137
- onOpenChange
138
- ]);
139
- return /* @__PURE__ */ React.createElement(Button, {
140
- ...props,
141
- role: "combobox",
142
- "aria-expanded": open,
143
- "aria-controls": modalId,
144
- "aria-haspopup": "dialog",
145
- onClick: handleClick,
146
- ref: forwardedRef
147
- }, children ?? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("span", {
148
- className: mx("font-normal text-start flex-1 min-is-0 truncate mie-2", !value && staticPlaceholderText)
149
- }, value || placeholder), /* @__PURE__ */ React.createElement(CaretDown, {
150
- weight: "bold",
151
- className: getSize(3)
152
- })));
153
- } finally {
154
- _effect.f();
155
- }
347
+ SearchListEmpty.displayName = "SearchList.Empty";
348
+ var SearchListGroup = /* @__PURE__ */ forwardRef(({ classNames, heading, children }, forwardedRef) => {
349
+ return /* @__PURE__ */ React.createElement("div", {
350
+ ref: forwardedRef,
351
+ role: "group",
352
+ className: mx("flex flex-col", classNames)
353
+ }, heading && /* @__PURE__ */ React.createElement("div", {
354
+ role: "presentation",
355
+ className: "pli-2 plb-1 text-xs font-medium text-description"
356
+ }, heading), children);
156
357
  });
157
- ComboboxTrigger.displayName = COMBOBOX_TRIGGER_NAME;
358
+ SearchListGroup.displayName = "SearchList.Group";
158
359
  var SearchList = {
159
360
  Root: SearchListRoot,
160
- Input: SearchListInput,
361
+ Viewport: SearchListViewport,
161
362
  Content: SearchListContent,
363
+ Input: SearchListInput,
364
+ Item: SearchListItem,
162
365
  Empty: SearchListEmpty,
163
- Item: SearchListItem
366
+ Group: SearchListGroup
367
+ };
368
+
369
+ // src/components/SearchList/hooks/useGlobalFilter.tsx
370
+ import React2, { createContext as createContext2, useContext, useMemo as useMemo2 } from "react";
371
+ var GlobalFilterContext = /* @__PURE__ */ createContext2({});
372
+ var GlobalFilterProvider = ({ children, filter }) => {
373
+ const value = useMemo2(() => ({
374
+ filter
375
+ }), [
376
+ filter
377
+ ]);
378
+ return /* @__PURE__ */ React2.createElement(GlobalFilterContext.Provider, {
379
+ value
380
+ }, children);
381
+ };
382
+ var useGlobalFilter = () => {
383
+ return useContext(GlobalFilterContext);
164
384
  };
385
+ var useGlobalFilteredObjects = (objects) => {
386
+ const { filter } = useGlobalFilter();
387
+ return useMemo2(() => {
388
+ if (!objects) {
389
+ return [];
390
+ }
391
+ if (!filter) {
392
+ return objects;
393
+ }
394
+ return filter(objects);
395
+ }, [
396
+ objects,
397
+ filter
398
+ ]);
399
+ };
400
+
401
+ // src/components/SearchList/hooks/useSearchListInput.ts
402
+ var useSearchListInput = () => {
403
+ const { query, onQueryChange, selectedValue, onSelectedValueChange, getItemValues, triggerSelect } = useSearchListInputContext("useSearchListInput");
404
+ return {
405
+ query,
406
+ onQueryChange,
407
+ selectedValue,
408
+ onSelectedValueChange,
409
+ getItemValues,
410
+ triggerSelect
411
+ };
412
+ };
413
+
414
+ // src/components/SearchList/hooks/useSearchListItem.ts
415
+ var useSearchListItem = () => {
416
+ const { selectedValue, registerItem, unregisterItem } = useSearchListItemContext("useSearchListItem");
417
+ return {
418
+ selectedValue,
419
+ registerItem,
420
+ unregisterItem
421
+ };
422
+ };
423
+
424
+ // src/components/SearchList/hooks/useSearchListResults.ts
425
+ import commandScore from "command-score";
426
+ import { useCallback as useCallback2, useEffect as useEffect2, useMemo as useMemo3, useRef as useRef2, useState as useState2 } from "react";
427
+ var useSearchListResults = ({ items, filter, fuzzy = true, extract, minScore = 0 }) => {
428
+ const [query, setQuery] = useState2("");
429
+ const queryRef = useRef2("");
430
+ useEffect2(() => {
431
+ queryRef.current = "";
432
+ setQuery("");
433
+ }, [
434
+ items
435
+ ]);
436
+ const defaultExtract = useCallback2((item) => {
437
+ if (typeof item === "string") {
438
+ return item;
439
+ }
440
+ return item?.label ?? "";
441
+ }, []);
442
+ const extractFn = extract ?? defaultExtract;
443
+ const defaultFilter = useCallback2((item, query2) => {
444
+ const searchable = extractFn(item);
445
+ return searchable.toLowerCase().includes(query2.toLowerCase());
446
+ }, [
447
+ extractFn
448
+ ]);
449
+ const filterFn = filter ?? defaultFilter;
450
+ const handleSearch = useCallback2((searchQuery) => {
451
+ queryRef.current = searchQuery;
452
+ setQuery(searchQuery);
453
+ }, []);
454
+ const results = useMemo3(() => {
455
+ const currentQuery = queryRef.current;
456
+ if (!currentQuery) {
457
+ return items;
458
+ }
459
+ if (fuzzy) {
460
+ const scored = items.map((item) => ({
461
+ item,
462
+ score: commandScore(extractFn(item), currentQuery)
463
+ })).filter(({ score }) => score > minScore).sort((a, b) => b.score - a.score);
464
+ return scored.map(({ item }) => item);
465
+ } else {
466
+ return items.filter((item) => filterFn(item, currentQuery));
467
+ }
468
+ }, [
469
+ items,
470
+ query,
471
+ filterFn,
472
+ fuzzy,
473
+ extractFn,
474
+ minScore
475
+ ]);
476
+ return {
477
+ results,
478
+ handleSearch
479
+ };
480
+ };
481
+
482
+ // src/components/Combobox/Combobox.tsx
483
+ var COMBOBOX_NAME = "Combobox";
484
+ var COMBOBOX_CONTENT_NAME = "ComboboxContent";
485
+ var COMBOBOX_ITEM_NAME = "ComboboxItem";
486
+ var COMBOBOX_TRIGGER_NAME = "ComboboxTrigger";
487
+ var [ComboboxProvider, useComboboxContext] = createContext3(COMBOBOX_NAME, {});
488
+ var ComboboxRoot = ({ modal, modalId: propsModalId, open: propsOpen, defaultOpen, onOpenChange: propsOnOpenChange, value: propsValue, defaultValue, onValueChange: propsOnValueChange, placeholder, children }) => {
489
+ const modalId = useId(COMBOBOX_NAME, propsModalId);
490
+ const [open = false, onOpenChange] = useControllableState2({
491
+ prop: propsOpen,
492
+ onChange: propsOnOpenChange,
493
+ defaultProp: defaultOpen
494
+ });
495
+ const [value = "", onValueChange] = useControllableState2({
496
+ prop: propsValue,
497
+ onChange: propsOnValueChange,
498
+ defaultProp: defaultValue
499
+ });
500
+ return /* @__PURE__ */ React3.createElement(Popover.Root, {
501
+ open,
502
+ onOpenChange,
503
+ modal
504
+ }, /* @__PURE__ */ React3.createElement(ComboboxProvider, {
505
+ isCombobox: true,
506
+ modalId,
507
+ placeholder,
508
+ open,
509
+ onOpenChange,
510
+ value,
511
+ onValueChange
512
+ }, children));
513
+ };
514
+ var ComboboxContent = /* @__PURE__ */ forwardRef2(({ side = "bottom", collisionPadding = 48, sideOffset, align, alignOffset, avoidCollisions, collisionBoundary, arrowPadding, sticky, hideWhenDetached, onOpenAutoFocus, onCloseAutoFocus, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, forceMount, children, classNames, onSearch, value, defaultValue, debounceMs, label }, forwardedRef) => {
515
+ const { modalId } = useComboboxContext(COMBOBOX_CONTENT_NAME);
516
+ return /* @__PURE__ */ React3.createElement(Popover.Content, {
517
+ side,
518
+ sideOffset,
519
+ align,
520
+ alignOffset,
521
+ avoidCollisions,
522
+ collisionBoundary,
523
+ collisionPadding,
524
+ arrowPadding,
525
+ sticky,
526
+ hideWhenDetached,
527
+ onOpenAutoFocus,
528
+ onCloseAutoFocus,
529
+ onEscapeKeyDown,
530
+ onPointerDownOutside,
531
+ onFocusOutside,
532
+ onInteractOutside,
533
+ forceMount,
534
+ classNames: [
535
+ "is-[--radix-popover-trigger-width] max-bs-[--radix-popover-content-available-height] grid grid-rows-[min-content_1fr]",
536
+ classNames
537
+ ],
538
+ id: modalId,
539
+ ref: forwardedRef
540
+ }, /* @__PURE__ */ React3.createElement(SearchList.Root, {
541
+ onSearch,
542
+ value,
543
+ defaultValue,
544
+ debounceMs
545
+ }, /* @__PURE__ */ React3.createElement("div", {
546
+ className: "contents density-fine",
547
+ "aria-label": label,
548
+ role: "combobox",
549
+ "aria-expanded": "true"
550
+ }, children)));
551
+ });
552
+ ComboboxContent.displayName = COMBOBOX_CONTENT_NAME;
553
+ var ComboboxTrigger = /* @__PURE__ */ forwardRef2(({ children, onClick, ...props }, forwardedRef) => {
554
+ const { modalId, open, onOpenChange, placeholder, value } = useComboboxContext(COMBOBOX_TRIGGER_NAME);
555
+ const handleClick = useCallback3((event) => {
556
+ onClick?.(event);
557
+ onOpenChange?.(true);
558
+ }, [
559
+ onClick,
560
+ onOpenChange
561
+ ]);
562
+ return /* @__PURE__ */ React3.createElement(Popover.Trigger, {
563
+ asChild: true
564
+ }, /* @__PURE__ */ React3.createElement(Button, {
565
+ ...props,
566
+ role: "combobox",
567
+ "aria-expanded": open,
568
+ "aria-controls": modalId,
569
+ "aria-haspopup": "dialog",
570
+ onClick: handleClick,
571
+ ref: forwardedRef
572
+ }, children ?? /* @__PURE__ */ React3.createElement(React3.Fragment, null, /* @__PURE__ */ React3.createElement("span", {
573
+ className: mx2("font-normal text-start flex-1 min-is-0 truncate mie-2", !value && staticPlaceholderText)
574
+ }, value || placeholder), /* @__PURE__ */ React3.createElement(Icon2, {
575
+ icon: "ph--caret-down--bold",
576
+ size: 3
577
+ }))));
578
+ });
579
+ ComboboxTrigger.displayName = COMBOBOX_TRIGGER_NAME;
580
+ var ComboboxVirtualTrigger = Popover.VirtualTrigger;
581
+ var ComboboxInput = /* @__PURE__ */ forwardRef2(({ classNames, ...props }, forwardedRef) => {
582
+ return /* @__PURE__ */ React3.createElement(SearchList.Input, {
583
+ ...props,
584
+ classNames: [
585
+ "mli-cardSpacingChrome mbs-cardSpacingChrome mbe-0 is-[calc(100%-2*var(--dx-cardSpacingChrome))]",
586
+ classNames
587
+ ],
588
+ ref: forwardedRef
589
+ });
590
+ });
591
+ var ComboboxList = /* @__PURE__ */ forwardRef2(({ classNames, ...props }, forwardedRef) => {
592
+ return /* @__PURE__ */ React3.createElement(SearchList.Content, {
593
+ ...props,
594
+ classNames: [
595
+ "min-bs-0 overflow-y-auto plb-cardSpacingChrome",
596
+ classNames
597
+ ],
598
+ ref: forwardedRef
599
+ });
600
+ });
601
+ var ComboboxItem = /* @__PURE__ */ forwardRef2(({ classNames, onSelect, value, closeOnSelect = true, ...props }, forwardedRef) => {
602
+ const { onValueChange, onOpenChange } = useComboboxContext(COMBOBOX_ITEM_NAME);
603
+ const handleSelect = useCallback3(() => {
604
+ onSelect?.();
605
+ if (value !== void 0) {
606
+ onValueChange?.(value);
607
+ }
608
+ if (closeOnSelect) {
609
+ onOpenChange?.(false);
610
+ }
611
+ }, [
612
+ onSelect,
613
+ onValueChange,
614
+ onOpenChange,
615
+ value,
616
+ closeOnSelect
617
+ ]);
618
+ return /* @__PURE__ */ React3.createElement(SearchList.Item, {
619
+ ...props,
620
+ value,
621
+ classNames: [
622
+ "mli-cardSpacingChrome pli-cardSpacingChrome",
623
+ classNames
624
+ ],
625
+ onSelect: handleSelect,
626
+ ref: forwardedRef
627
+ });
628
+ });
629
+ ComboboxItem.displayName = COMBOBOX_ITEM_NAME;
630
+ var ComboboxArrow = Popover.Arrow;
631
+ var ComboboxEmpty = SearchList.Empty;
632
+ var ComboboxPortal = Popover.Portal;
165
633
  var Combobox = {
166
634
  Root: ComboboxRoot,
635
+ Portal: ComboboxPortal,
636
+ Content: ComboboxContent,
167
637
  Trigger: ComboboxTrigger,
168
- useComboboxContext
638
+ VirtualTrigger: ComboboxVirtualTrigger,
639
+ Input: ComboboxInput,
640
+ List: ComboboxList,
641
+ Item: ComboboxItem,
642
+ Arrow: ComboboxArrow,
643
+ Empty: ComboboxEmpty
169
644
  };
170
645
 
171
- // src/composites/PopoverCombobox.tsx
172
- import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
173
- import { useControllableState as useControllableState2 } from "@radix-ui/react-use-controllable-state";
174
- import React2, { forwardRef as forwardRef2 } from "react";
175
- import { Popover } from "@dxos/react-ui";
176
- var PopoverComboboxRoot = ({ modal, children, open: propsOpen, onOpenChange: propsOnOpenChange, defaultOpen, ...props }) => {
177
- var _effect = _useSignals2();
178
- try {
179
- const [open, onOpenChange] = useControllableState2({
180
- prop: propsOpen,
181
- onChange: propsOnOpenChange,
182
- defaultProp: defaultOpen
183
- });
184
- return /* @__PURE__ */ React2.createElement(Combobox.Root, {
185
- open,
186
- onOpenChange,
187
- ...props
188
- }, /* @__PURE__ */ React2.createElement(Popover.Root, {
189
- open,
190
- onOpenChange,
191
- modal
192
- }, children));
193
- } finally {
194
- _effect.f();
195
- }
196
- };
197
- var POPOVER_COMBOBOX_CONTENT_NAME = "PopoverComboboxContent";
198
- var PopoverComboboxContent = /* @__PURE__ */ forwardRef2(({ side = "bottom", collisionPadding = 48, sideOffset, align, alignOffset, avoidCollisions, collisionBoundary, arrowPadding, sticky, hideWhenDetached, onOpenAutoFocus, onCloseAutoFocus, onEscapeKeyDown, onPointerDownOutside, onFocusOutside, onInteractOutside, forceMount, children, classNames, ...props }, forwardedRef) => {
199
- var _effect = _useSignals2();
200
- try {
201
- const { modalId } = Combobox.useComboboxContext(POPOVER_COMBOBOX_CONTENT_NAME);
202
- return /* @__PURE__ */ React2.createElement(Popover.Content, {
203
- side,
204
- sideOffset,
205
- align,
206
- alignOffset,
207
- avoidCollisions,
208
- collisionBoundary,
209
- collisionPadding,
210
- arrowPadding,
211
- sticky,
212
- hideWhenDetached,
213
- onOpenAutoFocus,
214
- onCloseAutoFocus,
215
- onEscapeKeyDown,
216
- onPointerDownOutside,
217
- onFocusOutside,
218
- onInteractOutside,
219
- forceMount,
220
- classNames,
221
- id: modalId,
222
- ref: forwardedRef
223
- }, /* @__PURE__ */ React2.createElement(Popover.Viewport, null, /* @__PURE__ */ React2.createElement(SearchList.Root, {
224
- ...props,
225
- classNames: "contents",
226
- role: "none"
227
- }, children)));
228
- } finally {
229
- _effect.f();
230
- }
646
+ // src/components/Listbox/Listbox.tsx
647
+ import { useArrowNavigationGroup } from "@fluentui/react-tabster";
648
+ import { useComposedRefs } from "@radix-ui/react-compose-refs";
649
+ import { createContextScope } from "@radix-ui/react-context";
650
+ import { useControllableState as useControllableState3 } from "@radix-ui/react-use-controllable-state";
651
+ import React4, { forwardRef as forwardRef3, useCallback as useCallback4, useEffect as useEffect3, useRef as useRef3 } from "react";
652
+ import { Icon as Icon3 } from "@dxos/react-ui";
653
+ import { mx as mx3 } from "@dxos/ui-theme";
654
+ var commandItem = "flex items-center overflow-hidden";
655
+ var LISTBOX_NAME = "Listbox";
656
+ var LISTBOX_OPTION_NAME = "ListboxOption";
657
+ var LISTBOX_OPTION_LABEL_NAME = "ListboxOptionLabel";
658
+ var LISTBOX_OPTION_INDICATOR_NAME = "ListboxOptionIndicator";
659
+ var [createListboxContext, createListboxScope] = createContextScope(LISTBOX_NAME, []);
660
+ var [createListboxOptionContext, createListboxOptionScope] = createContextScope(LISTBOX_OPTION_NAME, [
661
+ createListboxScope
662
+ ]);
663
+ var [ListboxProvider, useListboxContext] = createListboxContext(LISTBOX_NAME);
664
+ var [ListboxOptionProvider, useListboxOptionContext] = createListboxOptionContext(LISTBOX_OPTION_NAME);
665
+ var ListboxRoot = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
666
+ const { __listboxScope, children, classNames, value: propsValue, defaultValue, onValueChange, autoFocus, ...rootProps } = props;
667
+ const arrowGroup = useArrowNavigationGroup({
668
+ axis: "vertical"
669
+ });
670
+ const ref = useRef3(null);
671
+ const rootRef = useComposedRefs(ref, forwardedRef);
672
+ const [selectedValue, setSelectedValue] = useControllableState3({
673
+ prop: propsValue,
674
+ defaultProp: defaultValue,
675
+ onChange: onValueChange
676
+ });
677
+ const handleValueChange = (value) => {
678
+ setSelectedValue(value);
679
+ };
680
+ useEffect3(() => {
681
+ ref.current?.querySelector('[aria-selected="true"]')?.focus();
682
+ }, [
683
+ autoFocus
684
+ ]);
685
+ return /* @__PURE__ */ React4.createElement(ListboxProvider, {
686
+ scope: __listboxScope,
687
+ selectedValue,
688
+ onValueChange: handleValueChange
689
+ }, /* @__PURE__ */ React4.createElement("ul", {
690
+ role: "listbox",
691
+ ...rootProps,
692
+ className: mx3("is-full p-cardSpacingChrome", classNames),
693
+ ref: rootRef,
694
+ ...arrowGroup
695
+ }, children));
231
696
  });
232
- PopoverComboboxContent.displayName = POPOVER_COMBOBOX_CONTENT_NAME;
233
- var PopoverComboboxTrigger = /* @__PURE__ */ forwardRef2((props, forwardedRef) => {
234
- var _effect = _useSignals2();
235
- try {
236
- return /* @__PURE__ */ React2.createElement(Popover.Trigger, {
237
- asChild: true
238
- }, /* @__PURE__ */ React2.createElement(Combobox.Trigger, {
239
- ...props,
240
- ref: forwardedRef
241
- }));
242
- } finally {
243
- _effect.f();
244
- }
697
+ ListboxRoot.displayName = LISTBOX_NAME;
698
+ var ListboxOption = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
699
+ const { __listboxScope, children, classNames, value, ...rootProps } = props;
700
+ const { selectedValue, onValueChange } = useListboxContext(LISTBOX_OPTION_NAME, __listboxScope);
701
+ const isSelected = selectedValue === value;
702
+ const handleSelect = useCallback4(() => {
703
+ onValueChange(value);
704
+ }, [
705
+ value,
706
+ onValueChange
707
+ ]);
708
+ return /* @__PURE__ */ React4.createElement(ListboxOptionProvider, {
709
+ scope: __listboxScope,
710
+ value,
711
+ isSelected
712
+ }, /* @__PURE__ */ React4.createElement("li", {
713
+ role: "option",
714
+ ...rootProps,
715
+ "aria-selected": isSelected,
716
+ tabIndex: 0,
717
+ className: mx3("dx-focus-ring", "plb-1 pli-2 rounded-sm select-none cursor-pointer data-[selected=true]:bg-hoverOverlay hover:bg-hoverOverlay", commandItem, classNames),
718
+ onClick: handleSelect,
719
+ onKeyDown: ({ key }) => {
720
+ if ([
721
+ "Enter",
722
+ " "
723
+ ].includes(key)) {
724
+ handleSelect();
725
+ }
726
+ },
727
+ ref: forwardedRef
728
+ }, children));
245
729
  });
246
- var PopoverComboboxVirtualTrigger = Popover.VirtualTrigger;
247
- var PopoverComboboxInput = SearchList.Input;
248
- var PopoverComboboxList = /* @__PURE__ */ forwardRef2(({ constrainInline, constrainBlock, ...props }, forwardedRef) => {
249
- var _effect = _useSignals2();
250
- try {
251
- return /* @__PURE__ */ React2.createElement(Popover.Viewport, {
252
- constrainInline,
253
- constrainBlock
254
- }, /* @__PURE__ */ React2.createElement(SearchList.Content, {
255
- ...props,
256
- ref: forwardedRef
257
- }));
258
- } finally {
259
- _effect.f();
260
- }
730
+ ListboxOption.displayName = LISTBOX_OPTION_NAME;
731
+ var ListboxOptionLabel = /* @__PURE__ */ forwardRef3(({ children, classNames, ...rootProps }, forwardedRef) => {
732
+ return /* @__PURE__ */ React4.createElement("span", {
733
+ ...rootProps,
734
+ className: mx3("grow truncate", classNames),
735
+ ref: forwardedRef
736
+ }, children);
737
+ });
738
+ ListboxOptionLabel.displayName = LISTBOX_OPTION_LABEL_NAME;
739
+ var ListboxOptionIndicator = /* @__PURE__ */ forwardRef3((props, forwardedRef) => {
740
+ const { __listboxOptionScope, classNames, ...rootProps } = props;
741
+ const { isSelected } = useListboxOptionContext(LISTBOX_OPTION_INDICATOR_NAME, __listboxOptionScope);
742
+ return /* @__PURE__ */ React4.createElement(Icon3, {
743
+ icon: "ph--check--regular",
744
+ ...rootProps,
745
+ classNames: mx3(!isSelected && "invisible", classNames),
746
+ ref: forwardedRef
747
+ });
261
748
  });
262
- var PopoverComboboxItem = SearchList.Item;
263
- var PopoverComboboxArrow = Popover.Arrow;
264
- var PopoverComboboxEmpty = SearchList.Empty;
265
- var PopoverCombobox = {
266
- Root: PopoverComboboxRoot,
267
- Content: PopoverComboboxContent,
268
- Trigger: PopoverComboboxTrigger,
269
- VirtualTrigger: PopoverComboboxVirtualTrigger,
270
- Input: PopoverComboboxInput,
271
- List: PopoverComboboxList,
272
- Item: PopoverComboboxItem,
273
- Arrow: PopoverComboboxArrow,
274
- Empty: PopoverComboboxEmpty
749
+ ListboxOptionIndicator.displayName = LISTBOX_OPTION_INDICATOR_NAME;
750
+ var Listbox = {
751
+ Root: ListboxRoot,
752
+ Option: ListboxOption,
753
+ OptionLabel: ListboxOptionLabel,
754
+ OptionIndicator: ListboxOptionIndicator
275
755
  };
276
-
277
- // src/translations.ts
278
- var translationKey = "react-ui-searchlist";
279
- var translations = [
280
- {
281
- "en-US": {
282
- [translationKey]: {}
283
- }
284
- }
285
- ];
286
756
  export {
287
757
  Combobox,
288
- PopoverCombobox,
758
+ GlobalFilterProvider,
759
+ Listbox,
289
760
  SearchList,
761
+ createListboxScope,
290
762
  translationKey,
291
- translations
763
+ translations,
764
+ useGlobalFilter,
765
+ useGlobalFilteredObjects,
766
+ useListboxContext,
767
+ useSearchListInput,
768
+ useSearchListItem,
769
+ useSearchListResults
292
770
  };
293
771
  //# sourceMappingURL=index.mjs.map