@brightlocal/ui-components 2.9.1 → 2.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/component-meta.json +1 -1
- package/dist/browser-entry.d.ts +17 -0
- package/dist/browser-entry.d.ts.map +1 -0
- package/dist/combobox.cjs +3 -3
- package/dist/combobox.d.ts +3 -3
- package/dist/combobox.d.ts.map +1 -1
- package/dist/combobox.js +480 -440
- package/dist/global-layout.cjs +1 -1
- package/dist/global-layout.d.ts.map +1 -1
- package/dist/global-layout.js +17 -16
- package/package.json +6 -3
- package/src/browser-entry.ts +89 -0
- package/src/browser-tokens.css +1 -0
- package/src/components/combobox.tsx +106 -28
- package/src/components/global-layout.tsx +7 -6
package/dist/combobox.js
CHANGED
|
@@ -1,114 +1,114 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { Check as Y, ChevronsUpDown as
|
|
4
|
-
import { useVirtualizer as
|
|
5
|
-
import { cva as
|
|
6
|
-
import { defaultFilter as
|
|
7
|
-
import { cn as
|
|
8
|
-
import { useDevWarning as
|
|
9
|
-
import { Popover as
|
|
10
|
-
import { Command as
|
|
11
|
-
const
|
|
12
|
-
function
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
1
|
+
import { jsx as u, jsxs as B, Fragment as Z } from "react/jsx-runtime";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
import { Check as Y, ChevronsUpDown as ee } from "@brightlocal/icons";
|
|
4
|
+
import { useVirtualizer as te } from "@tanstack/react-virtual";
|
|
5
|
+
import { cva as oe } from "class-variance-authority";
|
|
6
|
+
import { defaultFilter as K } from "cmdk";
|
|
7
|
+
import { cn as A } from "@brightlocal/ui-components/lib/utils";
|
|
8
|
+
import { useDevWarning as G } from "@brightlocal/ui-components/lib/use-dev-warning";
|
|
9
|
+
import { Popover as re, PopoverContent as ne, PopoverTrigger as ae } from "@brightlocal/ui-components/popover";
|
|
10
|
+
import { Command as se, CommandEmpty as ie, CommandGroup as le, CommandInput as ue, CommandItem as ce, CommandList as de, CommandSeparator as fe } from "@brightlocal/ui-components/command";
|
|
11
|
+
const J = t.createContext(null), Q = t.createContext(null);
|
|
12
|
+
function _() {
|
|
13
|
+
const e = t.useContext(J);
|
|
14
|
+
if (!e)
|
|
15
15
|
throw new Error("Combobox components must be used within a <Combobox>");
|
|
16
|
-
return
|
|
16
|
+
return e;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
value:
|
|
20
|
-
onValueChange:
|
|
21
|
-
open:
|
|
22
|
-
onOpenChange:
|
|
23
|
-
shouldFilter:
|
|
24
|
-
disabled:
|
|
25
|
-
itemToStringValue:
|
|
26
|
-
children:
|
|
18
|
+
function Fe({
|
|
19
|
+
value: e,
|
|
20
|
+
onValueChange: r,
|
|
21
|
+
open: n,
|
|
22
|
+
onOpenChange: o,
|
|
23
|
+
shouldFilter: i = !0,
|
|
24
|
+
disabled: c = !1,
|
|
25
|
+
itemToStringValue: s,
|
|
26
|
+
children: p
|
|
27
27
|
}) {
|
|
28
|
-
const [
|
|
28
|
+
const [d, w] = t.useState(""), [D, h] = t.useState(!1), [f, y] = t.useState(
|
|
29
29
|
() => /* @__PURE__ */ new Map()
|
|
30
|
-
), [
|
|
31
|
-
(
|
|
32
|
-
|
|
30
|
+
), [v, C] = t.useState(""), [P, k] = t.useState(void 0), S = e !== void 0, I = n !== void 0, R = S ? e : d, L = I ? n : D, M = t.useCallback(
|
|
31
|
+
(x) => {
|
|
32
|
+
x || C(""), I || h(x), o?.(x);
|
|
33
33
|
},
|
|
34
|
-
[
|
|
35
|
-
),
|
|
36
|
-
(
|
|
37
|
-
S ||
|
|
34
|
+
[I, o]
|
|
35
|
+
), N = t.useCallback(
|
|
36
|
+
(x) => {
|
|
37
|
+
S || w(x), r?.(x);
|
|
38
38
|
},
|
|
39
|
-
[S,
|
|
40
|
-
),
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
[S, r]
|
|
40
|
+
), l = t.useRef(/* @__PURE__ */ new Map()), E = t.useRef(!1), z = t.useRef(!0);
|
|
41
|
+
t.useEffect(() => () => {
|
|
42
|
+
z.current = !1;
|
|
43
43
|
}, []);
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
44
|
+
const b = t.useCallback(() => {
|
|
45
|
+
E.current || (E.current = !0, queueMicrotask(() => {
|
|
46
|
+
E.current = !1, z.current && y(new Map(l.current));
|
|
47
47
|
}));
|
|
48
|
-
}, []),
|
|
49
|
-
(
|
|
50
|
-
|
|
48
|
+
}, []), F = t.useCallback(
|
|
49
|
+
(x, $) => {
|
|
50
|
+
l.current.get(x) !== $ && (l.current.set(x, $), b());
|
|
51
51
|
},
|
|
52
|
-
[
|
|
53
|
-
),
|
|
54
|
-
(
|
|
55
|
-
for (const [
|
|
56
|
-
|
|
57
|
-
y(new Map(
|
|
52
|
+
[b]
|
|
53
|
+
), j = t.useCallback(
|
|
54
|
+
(x) => {
|
|
55
|
+
for (const [$, U] of x)
|
|
56
|
+
l.current.set($, U);
|
|
57
|
+
y(new Map(l.current));
|
|
58
58
|
},
|
|
59
59
|
[]
|
|
60
|
-
),
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}, [
|
|
64
|
-
const
|
|
65
|
-
(
|
|
66
|
-
|
|
60
|
+
), q = t.useRef(R);
|
|
61
|
+
t.useLayoutEffect(() => {
|
|
62
|
+
q.current = R;
|
|
63
|
+
}, [R]);
|
|
64
|
+
const T = t.useCallback(
|
|
65
|
+
(x) => {
|
|
66
|
+
x !== q.current && l.current.has(x) && (l.current.delete(x), b());
|
|
67
67
|
},
|
|
68
|
-
[
|
|
69
|
-
),
|
|
70
|
-
() =>
|
|
71
|
-
[
|
|
72
|
-
),
|
|
68
|
+
[b]
|
|
69
|
+
), O = t.useMemo(
|
|
70
|
+
() => s ? (x, $, U) => K(s(x), $, U) : K,
|
|
71
|
+
[s]
|
|
72
|
+
), H = t.useMemo(
|
|
73
73
|
() => ({
|
|
74
|
-
open:
|
|
75
|
-
setOpen:
|
|
76
|
-
value:
|
|
77
|
-
onValueChange:
|
|
78
|
-
shouldFilter:
|
|
79
|
-
disabled:
|
|
80
|
-
itemLabels:
|
|
81
|
-
registerItem:
|
|
82
|
-
registerItemsSync:
|
|
83
|
-
unregisterItem:
|
|
84
|
-
itemToStringValue:
|
|
85
|
-
filterFn:
|
|
86
|
-
searchValue:
|
|
87
|
-
setSearchValue:
|
|
88
|
-
activeDescendantId:
|
|
89
|
-
setActiveDescendantId:
|
|
74
|
+
open: L,
|
|
75
|
+
setOpen: M,
|
|
76
|
+
value: R,
|
|
77
|
+
onValueChange: N,
|
|
78
|
+
shouldFilter: i,
|
|
79
|
+
disabled: c,
|
|
80
|
+
itemLabels: f,
|
|
81
|
+
registerItem: F,
|
|
82
|
+
registerItemsSync: j,
|
|
83
|
+
unregisterItem: T,
|
|
84
|
+
itemToStringValue: s,
|
|
85
|
+
filterFn: O,
|
|
86
|
+
searchValue: v,
|
|
87
|
+
setSearchValue: C,
|
|
88
|
+
activeDescendantId: P,
|
|
89
|
+
setActiveDescendantId: k
|
|
90
90
|
}),
|
|
91
91
|
[
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
P,
|
|
96
|
-
c,
|
|
97
|
-
b,
|
|
92
|
+
L,
|
|
93
|
+
M,
|
|
94
|
+
R,
|
|
98
95
|
N,
|
|
96
|
+
i,
|
|
97
|
+
c,
|
|
98
|
+
f,
|
|
99
|
+
F,
|
|
100
|
+
j,
|
|
99
101
|
T,
|
|
102
|
+
s,
|
|
100
103
|
O,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
k,
|
|
105
|
-
w,
|
|
106
|
-
h
|
|
104
|
+
v,
|
|
105
|
+
P,
|
|
106
|
+
k
|
|
107
107
|
]
|
|
108
108
|
);
|
|
109
|
-
return /* @__PURE__ */
|
|
109
|
+
return /* @__PURE__ */ u(J.Provider, { value: H, children: /* @__PURE__ */ u(re, { open: L, onOpenChange: M, children: p }) });
|
|
110
110
|
}
|
|
111
|
-
const
|
|
111
|
+
const be = oe([
|
|
112
112
|
// Base layout
|
|
113
113
|
"relative flex w-full items-center justify-between gap-2",
|
|
114
114
|
"px-4 py-2 h-9",
|
|
@@ -131,44 +131,44 @@ const le = Z([
|
|
|
131
131
|
"transition-[background-color,border-color,box-shadow] duration-200 ease-out",
|
|
132
132
|
// Icon styles
|
|
133
133
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0"
|
|
134
|
-
]),
|
|
134
|
+
]), me = t.forwardRef(
|
|
135
135
|
({
|
|
136
|
-
className:
|
|
137
|
-
dataHook:
|
|
138
|
-
error:
|
|
139
|
-
trackingEl:
|
|
140
|
-
trackingLabel:
|
|
141
|
-
children:
|
|
142
|
-
...
|
|
143
|
-
},
|
|
144
|
-
const { open:
|
|
145
|
-
return /* @__PURE__ */
|
|
136
|
+
className: e,
|
|
137
|
+
dataHook: r,
|
|
138
|
+
error: n,
|
|
139
|
+
trackingEl: o,
|
|
140
|
+
trackingLabel: i,
|
|
141
|
+
children: c,
|
|
142
|
+
...s
|
|
143
|
+
}, p) => {
|
|
144
|
+
const { open: d, disabled: w, value: D } = _(), h = t.useId(), f = !D, y = n || s["aria-invalid"] === !0 || s["aria-invalid"] === "true";
|
|
145
|
+
return /* @__PURE__ */ u(ae, { asChild: !0, children: /* @__PURE__ */ B(
|
|
146
146
|
"button",
|
|
147
147
|
{
|
|
148
|
-
ref:
|
|
149
|
-
"aria-controls":
|
|
150
|
-
"aria-expanded":
|
|
148
|
+
ref: p,
|
|
149
|
+
"aria-controls": d ? h : void 0,
|
|
150
|
+
"aria-expanded": d,
|
|
151
151
|
"aria-haspopup": "listbox",
|
|
152
152
|
"aria-invalid": y ? "true" : void 0,
|
|
153
|
-
className:
|
|
154
|
-
|
|
153
|
+
className: A(
|
|
154
|
+
be(),
|
|
155
155
|
y && "border-destructive-40 dark:border-destructive-40 focus-visible:border-destructive-40 dark:focus-visible:border-destructive-40 focus-visible:shadow-destructive data-[state=open]:border-destructive-40 dark:data-[state=open]:border-destructive-40 data-[state=open]:shadow-destructive",
|
|
156
|
-
|
|
156
|
+
e
|
|
157
157
|
),
|
|
158
|
-
"data-hook":
|
|
159
|
-
"data-placeholder":
|
|
158
|
+
"data-hook": r,
|
|
159
|
+
"data-placeholder": f,
|
|
160
160
|
"data-slot": "combobox-trigger",
|
|
161
|
-
"data-state":
|
|
162
|
-
"data-tracking-el":
|
|
163
|
-
"data-tracking-label":
|
|
164
|
-
disabled:
|
|
161
|
+
"data-state": d ? "open" : "closed",
|
|
162
|
+
"data-tracking-el": o || "combobox-trigger",
|
|
163
|
+
"data-tracking-label": i,
|
|
164
|
+
disabled: w || s.disabled,
|
|
165
165
|
role: "combobox",
|
|
166
166
|
type: "button",
|
|
167
|
-
...
|
|
167
|
+
...s,
|
|
168
168
|
children: [
|
|
169
|
-
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
|
|
169
|
+
c,
|
|
170
|
+
/* @__PURE__ */ u(
|
|
171
|
+
ee,
|
|
172
172
|
{
|
|
173
173
|
"aria-hidden": "true",
|
|
174
174
|
className: "text-muted-foreground ml-auto shrink-0"
|
|
@@ -179,428 +179,468 @@ const le = Z([
|
|
|
179
179
|
) });
|
|
180
180
|
}
|
|
181
181
|
);
|
|
182
|
-
|
|
183
|
-
function
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
182
|
+
me.displayName = "ComboboxTrigger";
|
|
183
|
+
function pe(e) {
|
|
184
|
+
return e != null && typeof e == "object" && "value" in e && typeof e.value == "string";
|
|
185
|
+
}
|
|
186
|
+
function X(e, r, n) {
|
|
187
|
+
if (r)
|
|
188
|
+
return {
|
|
189
|
+
getValue: r,
|
|
190
|
+
getLabel: n ?? r,
|
|
191
|
+
hasDistinctLabel: !!n
|
|
192
|
+
};
|
|
193
|
+
const o = e[0];
|
|
194
|
+
if (!pe(o)) return null;
|
|
195
|
+
const i = (p) => p.value, c = "label" in o && typeof o.label == "string";
|
|
196
|
+
return {
|
|
197
|
+
getValue: i,
|
|
198
|
+
getLabel: n ?? (c ? (p) => String(p.label) : i),
|
|
199
|
+
hasDistinctLabel: c || !!n
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
function Ae({
|
|
203
|
+
placeholder: e,
|
|
204
|
+
className: r,
|
|
205
|
+
displayValue: n,
|
|
206
|
+
items: o,
|
|
207
|
+
getItemValue: i,
|
|
208
|
+
getItemLabel: c
|
|
190
209
|
}) {
|
|
191
|
-
const { value:
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
"ComboboxValue: `items` was provided without `getItemValue`. Pass `getItemValue` (and optionally `getItemLabel`) to enable item-based label resolution.",
|
|
195
|
-
[r, c]
|
|
210
|
+
const { value: s, itemLabels: p } = _(), d = t.useMemo(
|
|
211
|
+
() => o ? X(o, i, c) : null,
|
|
212
|
+
[o, i, c]
|
|
196
213
|
);
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
214
|
+
G(
|
|
215
|
+
() => !!o && o.length > 0 && !d,
|
|
216
|
+
"ComboboxValue: could not infer `getItemValue` from item shape. Pass `getItemValue` explicitly, or use items with a `value` string property.",
|
|
217
|
+
[o, d]
|
|
218
|
+
);
|
|
219
|
+
const w = t.useMemo(() => !o || !d ? null : new Map(
|
|
220
|
+
o.map((h) => [d.getValue(h), d.getLabel(h)])
|
|
221
|
+
), [o, d]), D = s ? w?.get(s) || p.get(s) || n?.(s) || s : e;
|
|
222
|
+
return /* @__PURE__ */ u(
|
|
205
223
|
"span",
|
|
206
224
|
{
|
|
207
|
-
className:
|
|
225
|
+
className: A(
|
|
208
226
|
"text-foreground overflow-hidden text-base leading-normal font-medium text-ellipsis whitespace-nowrap",
|
|
209
|
-
|
|
227
|
+
r
|
|
210
228
|
),
|
|
211
229
|
"data-slot": "combobox-value",
|
|
212
|
-
children:
|
|
230
|
+
children: D
|
|
213
231
|
}
|
|
214
232
|
);
|
|
215
233
|
}
|
|
216
|
-
function
|
|
217
|
-
dataHook:
|
|
218
|
-
className:
|
|
219
|
-
children:
|
|
220
|
-
align:
|
|
221
|
-
side:
|
|
222
|
-
sideOffset:
|
|
223
|
-
avoidCollisions:
|
|
224
|
-
hideList:
|
|
234
|
+
function Te({
|
|
235
|
+
dataHook: e,
|
|
236
|
+
className: r,
|
|
237
|
+
children: n,
|
|
238
|
+
align: o = "start",
|
|
239
|
+
side: i = "bottom",
|
|
240
|
+
sideOffset: c,
|
|
241
|
+
avoidCollisions: s,
|
|
242
|
+
hideList: p = !1
|
|
225
243
|
}) {
|
|
226
|
-
const { open:
|
|
244
|
+
const { open: d, shouldFilter: w, filterFn: D, itemToStringValue: h } = _(), [f, y] = t.useState(
|
|
227
245
|
null
|
|
228
|
-
),
|
|
229
|
-
if (
|
|
246
|
+
), v = t.useRef(null), C = t.useCallback((k) => {
|
|
247
|
+
if (v.current?.(), v.current = null, !k) return;
|
|
230
248
|
let S = !1;
|
|
231
|
-
const
|
|
232
|
-
S || (
|
|
233
|
-
},
|
|
234
|
-
|
|
249
|
+
const I = (N) => {
|
|
250
|
+
S || (N === "top" || N === "bottom") && (S = !0, R.disconnect(), y(N));
|
|
251
|
+
}, R = new MutationObserver(() => {
|
|
252
|
+
I(k.getAttribute("data-side"));
|
|
235
253
|
});
|
|
236
|
-
|
|
254
|
+
R.observe(k, {
|
|
237
255
|
attributes: !0,
|
|
238
256
|
attributeFilter: ["data-side"]
|
|
239
257
|
});
|
|
240
|
-
let
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
258
|
+
let L = 0, M = 0;
|
|
259
|
+
L = requestAnimationFrame(() => {
|
|
260
|
+
M = requestAnimationFrame(() => {
|
|
261
|
+
I(k.getAttribute("data-side"));
|
|
244
262
|
});
|
|
245
|
-
}),
|
|
246
|
-
S = !0,
|
|
263
|
+
}), v.current = () => {
|
|
264
|
+
S = !0, R.disconnect(), cancelAnimationFrame(L), cancelAnimationFrame(M);
|
|
247
265
|
};
|
|
248
266
|
}, []);
|
|
249
|
-
|
|
250
|
-
if (!
|
|
251
|
-
|
|
252
|
-
const
|
|
253
|
-
return () => clearTimeout(
|
|
267
|
+
t.useEffect(() => {
|
|
268
|
+
if (!d) {
|
|
269
|
+
v.current?.(), v.current = null;
|
|
270
|
+
const k = setTimeout(() => y(null), 150);
|
|
271
|
+
return () => clearTimeout(k);
|
|
254
272
|
}
|
|
255
|
-
}, [
|
|
256
|
-
const
|
|
257
|
-
return /* @__PURE__ */
|
|
258
|
-
|
|
273
|
+
}, [d]);
|
|
274
|
+
const P = h ? D : void 0;
|
|
275
|
+
return /* @__PURE__ */ u(
|
|
276
|
+
ne,
|
|
259
277
|
{
|
|
260
|
-
ref:
|
|
261
|
-
align:
|
|
278
|
+
ref: C,
|
|
279
|
+
align: o,
|
|
262
280
|
"aria-label": "Options",
|
|
263
|
-
avoidCollisions:
|
|
264
|
-
className:
|
|
281
|
+
avoidCollisions: s,
|
|
282
|
+
className: A(
|
|
265
283
|
"flex max-h-[var(--radix-popover-content-available-height)] w-[var(--radix-popover-trigger-width)] flex-col overflow-hidden p-0",
|
|
266
|
-
|
|
284
|
+
r
|
|
267
285
|
),
|
|
268
286
|
collisionPadding: 4,
|
|
269
287
|
"data-slot": "combobox-popover",
|
|
270
|
-
side:
|
|
271
|
-
sideOffset:
|
|
272
|
-
children: /* @__PURE__ */
|
|
273
|
-
|
|
288
|
+
side: f ?? i,
|
|
289
|
+
sideOffset: c,
|
|
290
|
+
children: /* @__PURE__ */ u(
|
|
291
|
+
se,
|
|
274
292
|
{
|
|
275
|
-
className:
|
|
293
|
+
className: A(
|
|
276
294
|
"min-h-0 flex-1 border-0 shadow-none",
|
|
277
295
|
"[&_[data-slot='command-input-wrapper']]:shrink-0",
|
|
278
|
-
|
|
296
|
+
p && "[&_[data-slot='command-input-wrapper']]:border-b-0"
|
|
279
297
|
),
|
|
280
298
|
"data-slot": "combobox-command",
|
|
281
|
-
dataHook:
|
|
282
|
-
filter:
|
|
283
|
-
shouldFilter:
|
|
284
|
-
children:
|
|
299
|
+
dataHook: e || "combobox-command",
|
|
300
|
+
filter: P,
|
|
301
|
+
shouldFilter: w,
|
|
302
|
+
children: n
|
|
285
303
|
}
|
|
286
304
|
)
|
|
287
305
|
}
|
|
288
306
|
);
|
|
289
307
|
}
|
|
290
|
-
const
|
|
291
|
-
const { setSearchValue:
|
|
308
|
+
const xe = t.forwardRef(({ debounceMs: e, onValueChange: r, ...n }, o) => {
|
|
309
|
+
const { setSearchValue: i, shouldFilter: c, activeDescendantId: s } = _(), p = t.useRef(
|
|
292
310
|
void 0
|
|
293
311
|
);
|
|
294
|
-
|
|
295
|
-
() => !!(
|
|
312
|
+
G(
|
|
313
|
+
() => !!(e && e > 0 && c),
|
|
296
314
|
`debounceMs is set on <ComboboxInput> but shouldFilter is true (default).
|
|
297
315
|
Debounce is designed for async/server-driven search where the consumer controls the items list.
|
|
298
316
|
Set shouldFilter={false} on <Combobox> for async search, or remove debounceMs for client-side filtering.`,
|
|
299
|
-
[
|
|
300
|
-
),
|
|
301
|
-
() => !!(
|
|
317
|
+
[e, c]
|
|
318
|
+
), G(
|
|
319
|
+
() => !!(e && e > 0 && n.value !== void 0),
|
|
302
320
|
"debounceMs is set on <ComboboxInput> together with a controlled `value` prop.\nThe debounced onValueChange callback cannot update the controlled value synchronously, so the input will appear to lag behind typing.\nRemove `value` to let the input manage its own display, or remove debounceMs if you need a controlled input.",
|
|
303
|
-
[
|
|
304
|
-
),
|
|
305
|
-
|
|
321
|
+
[e, n.value]
|
|
322
|
+
), t.useEffect(() => () => {
|
|
323
|
+
p.current && clearTimeout(p.current);
|
|
306
324
|
}, []);
|
|
307
|
-
const
|
|
308
|
-
(
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
},
|
|
325
|
+
const d = t.useCallback(
|
|
326
|
+
(w) => {
|
|
327
|
+
i(w), e && e > 0 ? (clearTimeout(p.current), p.current = setTimeout(() => {
|
|
328
|
+
r?.(w);
|
|
329
|
+
}, e)) : r?.(w);
|
|
312
330
|
},
|
|
313
|
-
[
|
|
331
|
+
[e, r, i]
|
|
314
332
|
);
|
|
315
|
-
return /* @__PURE__ */
|
|
316
|
-
|
|
333
|
+
return /* @__PURE__ */ u(
|
|
334
|
+
ue,
|
|
317
335
|
{
|
|
318
|
-
ref:
|
|
319
|
-
"aria-activedescendant":
|
|
336
|
+
ref: o,
|
|
337
|
+
"aria-activedescendant": s,
|
|
320
338
|
"data-slot": "combobox-input",
|
|
321
|
-
onValueChange:
|
|
322
|
-
...
|
|
339
|
+
onValueChange: d,
|
|
340
|
+
...n
|
|
323
341
|
}
|
|
324
342
|
);
|
|
325
343
|
});
|
|
326
|
-
|
|
327
|
-
const
|
|
328
|
-
|
|
344
|
+
xe.displayName = "ComboboxInput";
|
|
345
|
+
const ge = t.forwardRef(({ className: e, ...r }, n) => /* @__PURE__ */ u(
|
|
346
|
+
de,
|
|
329
347
|
{
|
|
330
|
-
ref:
|
|
331
|
-
className:
|
|
348
|
+
ref: n,
|
|
349
|
+
className: A("scrollbar min-h-0 flex-1", e),
|
|
332
350
|
"data-slot": "combobox-list",
|
|
333
|
-
...
|
|
351
|
+
...r
|
|
334
352
|
}
|
|
335
353
|
));
|
|
336
|
-
|
|
337
|
-
function
|
|
338
|
-
items:
|
|
339
|
-
getItemValue:
|
|
340
|
-
getItemLabel:
|
|
341
|
-
getItemKeywords:
|
|
342
|
-
estimateSize:
|
|
343
|
-
overscan:
|
|
344
|
-
children:
|
|
345
|
-
renderEmpty:
|
|
346
|
-
className:
|
|
347
|
-
dataHook:
|
|
348
|
-
},
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
|
|
354
|
+
ge.displayName = "ComboboxList";
|
|
355
|
+
function he({
|
|
356
|
+
items: e,
|
|
357
|
+
getItemValue: r,
|
|
358
|
+
getItemLabel: n,
|
|
359
|
+
getItemKeywords: o,
|
|
360
|
+
estimateSize: i = 36,
|
|
361
|
+
overscan: c = 5,
|
|
362
|
+
children: s,
|
|
363
|
+
renderEmpty: p,
|
|
364
|
+
className: d,
|
|
365
|
+
dataHook: w
|
|
366
|
+
}, D) {
|
|
367
|
+
const h = t.useMemo(
|
|
368
|
+
() => X(e, r, n),
|
|
369
|
+
[e, r, n]
|
|
370
|
+
), f = t.useMemo(
|
|
371
|
+
() => h?.getValue ?? ((a) => {
|
|
372
|
+
if (typeof a == "string" || typeof a == "number")
|
|
373
|
+
return String(a);
|
|
374
|
+
throw new Error(
|
|
375
|
+
"[BrightLocal DS] ComboboxVirtualList: `getItemValue` is required for non-primitive items without a `value` property."
|
|
376
|
+
);
|
|
377
|
+
}),
|
|
378
|
+
[h]
|
|
379
|
+
), y = t.useMemo(
|
|
380
|
+
() => h?.getLabel ?? f,
|
|
381
|
+
[h, f]
|
|
382
|
+
);
|
|
383
|
+
G(
|
|
384
|
+
() => !h && e.length > 0,
|
|
385
|
+
"ComboboxVirtualList: could not infer `getItemValue` from item shape. Pass `getItemValue` explicitly, or use items with a `value` string property.",
|
|
386
|
+
[h, e.length]
|
|
387
|
+
);
|
|
388
|
+
const v = t.useRef(null), {
|
|
389
|
+
value: C,
|
|
390
|
+
onValueChange: P,
|
|
352
391
|
setOpen: k,
|
|
353
|
-
shouldFilter:
|
|
354
|
-
searchValue:
|
|
355
|
-
filterFn:
|
|
356
|
-
setActiveDescendantId:
|
|
357
|
-
registerItemsSync:
|
|
358
|
-
unregisterItem:
|
|
359
|
-
} =
|
|
360
|
-
|
|
361
|
-
const
|
|
362
|
-
|
|
363
|
-
|
|
392
|
+
shouldFilter: S,
|
|
393
|
+
searchValue: I,
|
|
394
|
+
filterFn: R,
|
|
395
|
+
setActiveDescendantId: L,
|
|
396
|
+
registerItemsSync: M,
|
|
397
|
+
unregisterItem: N
|
|
398
|
+
} = _(), [l, E] = t.useState(0), z = t.useId();
|
|
399
|
+
t.useImperativeHandle(D, () => v.current, []), t.useLayoutEffect(() => {
|
|
400
|
+
const a = e.map((m) => [
|
|
401
|
+
f(m),
|
|
402
|
+
y(m)
|
|
364
403
|
]);
|
|
365
|
-
return
|
|
366
|
-
for (const
|
|
367
|
-
|
|
404
|
+
return M(a), () => {
|
|
405
|
+
for (const m of e)
|
|
406
|
+
N(f(m));
|
|
368
407
|
};
|
|
369
|
-
}, [
|
|
370
|
-
const
|
|
371
|
-
if (!
|
|
372
|
-
const
|
|
373
|
-
for (const
|
|
374
|
-
let
|
|
375
|
-
if (
|
|
376
|
-
for (const
|
|
377
|
-
|
|
378
|
-
|
|
408
|
+
}, [e, f, y, M, N]);
|
|
409
|
+
const b = t.useMemo(() => {
|
|
410
|
+
if (!S || !I.trim()) return e;
|
|
411
|
+
const a = [];
|
|
412
|
+
for (const m of e) {
|
|
413
|
+
let g = h?.hasDistinctLabel ? K(y(m), I) : R(f(m), I);
|
|
414
|
+
if (o)
|
|
415
|
+
for (const V of o(m))
|
|
416
|
+
g = Math.max(g, K(V, I));
|
|
417
|
+
g > 0 && a.push({ item: m, score: g });
|
|
379
418
|
}
|
|
380
|
-
return
|
|
419
|
+
return a.sort((m, g) => g.score - m.score), a.map((m) => m.item);
|
|
381
420
|
}, [
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
421
|
+
e,
|
|
422
|
+
S,
|
|
423
|
+
I,
|
|
424
|
+
f,
|
|
425
|
+
y,
|
|
385
426
|
o,
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
const n = C.current?.closest(
|
|
427
|
+
R,
|
|
428
|
+
h?.hasDistinctLabel
|
|
429
|
+
]), F = te({
|
|
430
|
+
count: b.length,
|
|
431
|
+
getScrollElement: () => v.current,
|
|
432
|
+
estimateSize: () => i,
|
|
433
|
+
overscan: c
|
|
434
|
+
}), j = l >= 0 && l < b.length ? f(b[l]) : null;
|
|
435
|
+
t.useEffect(() => {
|
|
436
|
+
E(0);
|
|
437
|
+
}, [I, b.length]);
|
|
438
|
+
const q = t.useRef(!1);
|
|
439
|
+
t.useEffect(() => {
|
|
440
|
+
if (q.current || !C) return;
|
|
441
|
+
const a = b.findIndex((m) => f(m) === C);
|
|
442
|
+
a >= 0 && (E(a), F.scrollToIndex(a, { align: "center" }), q.current = !0);
|
|
443
|
+
}, [C, b, f, F]);
|
|
444
|
+
const T = t.useRef(!1);
|
|
445
|
+
t.useEffect(() => {
|
|
446
|
+
T.current && l >= 0 && l < b.length && F.scrollToIndex(l, { align: "auto" }), T.current = !1;
|
|
447
|
+
}, [l, b.length, F]), t.useEffect(() => {
|
|
448
|
+
const a = v.current?.closest(
|
|
409
449
|
'[data-slot="combobox-command"]'
|
|
410
450
|
);
|
|
411
|
-
if (!
|
|
412
|
-
const
|
|
413
|
-
switch (
|
|
451
|
+
if (!a) return;
|
|
452
|
+
const m = (g) => {
|
|
453
|
+
switch (g.key) {
|
|
414
454
|
case "ArrowDown":
|
|
415
|
-
|
|
416
|
-
(
|
|
455
|
+
g.preventDefault(), g.stopPropagation(), T.current = !0, E(
|
|
456
|
+
(V) => V < b.length - 1 ? V + 1 : V
|
|
417
457
|
);
|
|
418
458
|
break;
|
|
419
459
|
case "ArrowUp":
|
|
420
|
-
|
|
460
|
+
g.preventDefault(), g.stopPropagation(), T.current = !0, E((V) => V > 0 ? V - 1 : V);
|
|
421
461
|
break;
|
|
422
462
|
case "Enter":
|
|
423
|
-
if (
|
|
424
|
-
const
|
|
425
|
-
|
|
463
|
+
if (g.preventDefault(), g.stopPropagation(), l >= 0 && l < b.length) {
|
|
464
|
+
const V = f(b[l]);
|
|
465
|
+
P(V === C ? "" : V), k(!1);
|
|
426
466
|
}
|
|
427
467
|
break;
|
|
428
468
|
case "Home":
|
|
429
|
-
|
|
469
|
+
g.preventDefault(), g.stopPropagation(), T.current = !0, E(0);
|
|
430
470
|
break;
|
|
431
471
|
case "End":
|
|
432
|
-
|
|
472
|
+
g.preventDefault(), g.stopPropagation(), T.current = !0, E(b.length - 1);
|
|
433
473
|
break;
|
|
434
474
|
}
|
|
435
475
|
};
|
|
436
|
-
return
|
|
437
|
-
}, [
|
|
438
|
-
const O =
|
|
439
|
-
const
|
|
440
|
-
return
|
|
441
|
-
|
|
442
|
-
}),
|
|
443
|
-
}, [
|
|
444
|
-
(
|
|
445
|
-
const
|
|
446
|
-
|
|
476
|
+
return a.addEventListener("keydown", m, { capture: !0 }), () => a.removeEventListener("keydown", m, { capture: !0 });
|
|
477
|
+
}, [b, l, C, P, k, f]);
|
|
478
|
+
const O = t.useMemo(() => {
|
|
479
|
+
const a = /* @__PURE__ */ new Map();
|
|
480
|
+
return b.forEach((m, g) => {
|
|
481
|
+
a.set(f(m), g);
|
|
482
|
+
}), a;
|
|
483
|
+
}, [b, f]), H = t.useCallback(
|
|
484
|
+
(a) => {
|
|
485
|
+
const m = O.get(a);
|
|
486
|
+
m !== void 0 && E(m);
|
|
447
487
|
},
|
|
448
488
|
[O]
|
|
449
|
-
),
|
|
450
|
-
(
|
|
489
|
+
), x = t.useCallback(
|
|
490
|
+
(a) => (O.get(a) ?? 0) + 1,
|
|
451
491
|
[O]
|
|
452
|
-
),
|
|
492
|
+
), $ = b.length, U = t.useMemo(
|
|
453
493
|
() => ({
|
|
454
|
-
activeValue:
|
|
455
|
-
onItemPointerMove:
|
|
456
|
-
idPrefix:
|
|
457
|
-
filteredCount:
|
|
458
|
-
getItemPosition:
|
|
494
|
+
activeValue: j,
|
|
495
|
+
onItemPointerMove: H,
|
|
496
|
+
idPrefix: z,
|
|
497
|
+
filteredCount: $,
|
|
498
|
+
getItemPosition: x
|
|
459
499
|
}),
|
|
460
|
-
[
|
|
461
|
-
),
|
|
462
|
-
return
|
|
500
|
+
[j, H, z, $, x]
|
|
501
|
+
), W = j != null ? `${z}item-${j}` : void 0;
|
|
502
|
+
return t.useEffect(() => (L(W), () => L(void 0)), [W, L]), b.length === 0 ? /* @__PURE__ */ u(
|
|
463
503
|
"div",
|
|
464
504
|
{
|
|
465
|
-
ref:
|
|
466
|
-
className:
|
|
467
|
-
"max-h-[300px] min-h-0 flex-1 scroll-py-1 overflow-x-hidden overflow-y-auto py-1",
|
|
468
|
-
|
|
505
|
+
ref: v,
|
|
506
|
+
className: A(
|
|
507
|
+
"scrollbar max-h-[300px] min-h-0 flex-1 scroll-py-1 overflow-x-hidden overflow-y-auto py-1",
|
|
508
|
+
d
|
|
469
509
|
),
|
|
470
|
-
"data-hook":
|
|
510
|
+
"data-hook": w,
|
|
471
511
|
"data-slot": "combobox-virtual-list",
|
|
472
512
|
role: "listbox",
|
|
473
|
-
children:
|
|
513
|
+
children: p
|
|
474
514
|
}
|
|
475
|
-
) : /* @__PURE__ */
|
|
515
|
+
) : /* @__PURE__ */ u(Q.Provider, { value: U, children: /* @__PURE__ */ u(
|
|
476
516
|
"div",
|
|
477
517
|
{
|
|
478
|
-
ref:
|
|
479
|
-
className:
|
|
480
|
-
"max-h-[300px] min-h-0 flex-1 scroll-py-1 overflow-x-hidden overflow-y-auto py-1",
|
|
481
|
-
|
|
518
|
+
ref: v,
|
|
519
|
+
className: A(
|
|
520
|
+
"scrollbar max-h-[300px] min-h-0 flex-1 scroll-py-1 overflow-x-hidden overflow-y-auto py-1",
|
|
521
|
+
d
|
|
482
522
|
),
|
|
483
|
-
"data-hook":
|
|
523
|
+
"data-hook": w,
|
|
484
524
|
"data-slot": "combobox-virtual-list",
|
|
485
525
|
role: "listbox",
|
|
486
|
-
children: /* @__PURE__ */
|
|
526
|
+
children: /* @__PURE__ */ u(
|
|
487
527
|
"div",
|
|
488
528
|
{
|
|
489
529
|
className: "relative w-full",
|
|
490
|
-
style: { height: `${
|
|
491
|
-
children:
|
|
530
|
+
style: { height: `${F.getTotalSize()}px` },
|
|
531
|
+
children: F.getVirtualItems().map((a) => /* @__PURE__ */ u(
|
|
492
532
|
"div",
|
|
493
533
|
{
|
|
494
|
-
ref:
|
|
534
|
+
ref: F.measureElement,
|
|
495
535
|
className: "absolute top-0 left-0 w-full px-2",
|
|
496
|
-
"data-index":
|
|
536
|
+
"data-index": a.index,
|
|
497
537
|
style: {
|
|
498
|
-
transform: `translateY(${
|
|
538
|
+
transform: `translateY(${a.start}px)`
|
|
499
539
|
},
|
|
500
|
-
children:
|
|
501
|
-
a
|
|
502
|
-
|
|
503
|
-
|
|
540
|
+
children: s(
|
|
541
|
+
b[a.index],
|
|
542
|
+
a.index,
|
|
543
|
+
I
|
|
504
544
|
)
|
|
505
545
|
},
|
|
506
|
-
|
|
546
|
+
a.key
|
|
507
547
|
))
|
|
508
548
|
}
|
|
509
549
|
)
|
|
510
550
|
}
|
|
511
551
|
) });
|
|
512
552
|
}
|
|
513
|
-
const
|
|
514
|
-
|
|
515
|
-
const
|
|
516
|
-
const
|
|
517
|
-
return
|
|
518
|
-
() =>
|
|
553
|
+
const $e = t.forwardRef(he), ve = t.forwardRef((e, r) => /* @__PURE__ */ u(ie, { ref: r, "data-slot": "combobox-empty", ...e }));
|
|
554
|
+
ve.displayName = "ComboboxEmpty";
|
|
555
|
+
const Ce = t.forwardRef(({ children: e, ...r }, n) => {
|
|
556
|
+
const o = t.useRef(null);
|
|
557
|
+
return G(
|
|
558
|
+
() => o.current ? o.current.querySelectorAll('[data-slot="combobox-item"]').length >= 100 : !1,
|
|
519
559
|
`ComboboxGroup contains 100+ items. Use <ComboboxVirtualList> for large datasets to avoid DOM bloat and slow renders.
|
|
520
560
|
Import: import { ComboboxVirtualList } from "@brightlocal/ui-components/combobox"`,
|
|
521
|
-
[
|
|
522
|
-
), /* @__PURE__ */
|
|
523
|
-
|
|
561
|
+
[e]
|
|
562
|
+
), /* @__PURE__ */ u(
|
|
563
|
+
le,
|
|
524
564
|
{
|
|
525
|
-
ref: (
|
|
526
|
-
|
|
565
|
+
ref: (i) => {
|
|
566
|
+
o.current = i, typeof n == "function" ? n(i) : n && (n.current = i);
|
|
527
567
|
},
|
|
528
568
|
"data-slot": "combobox-group",
|
|
529
|
-
...
|
|
530
|
-
children:
|
|
569
|
+
...r,
|
|
570
|
+
children: e
|
|
531
571
|
}
|
|
532
572
|
);
|
|
533
573
|
});
|
|
534
|
-
|
|
535
|
-
function
|
|
536
|
-
if (!
|
|
537
|
-
return
|
|
538
|
-
const
|
|
539
|
-
`(${
|
|
574
|
+
Ce.displayName = "ComboboxGroup";
|
|
575
|
+
function we(e, r, n) {
|
|
576
|
+
if (!r || !r.trim())
|
|
577
|
+
return e;
|
|
578
|
+
const o = new RegExp(
|
|
579
|
+
`(${r.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")})`,
|
|
540
580
|
"gi"
|
|
541
|
-
),
|
|
542
|
-
return /* @__PURE__ */
|
|
543
|
-
(
|
|
581
|
+
), i = e.split(o);
|
|
582
|
+
return /* @__PURE__ */ u("span", { children: i.map(
|
|
583
|
+
(c, s) => s % 2 === 1 ? /* @__PURE__ */ u("span", { className: n, children: c }, s) : /* @__PURE__ */ u(t.Fragment, { children: c }, s)
|
|
544
584
|
) });
|
|
545
585
|
}
|
|
546
|
-
const
|
|
586
|
+
const ye = t.forwardRef(
|
|
547
587
|
({
|
|
548
|
-
value:
|
|
549
|
-
label:
|
|
550
|
-
dataHook:
|
|
551
|
-
children:
|
|
552
|
-
className:
|
|
553
|
-
highlight:
|
|
554
|
-
highlightClassName:
|
|
555
|
-
keywords:
|
|
556
|
-
...
|
|
557
|
-
},
|
|
558
|
-
const { value:
|
|
559
|
-
|
|
560
|
-
S.current = y,
|
|
561
|
-
}, [y,
|
|
562
|
-
const
|
|
563
|
-
|
|
564
|
-
if (!
|
|
565
|
-
return S.current(
|
|
566
|
-
}, [
|
|
567
|
-
const
|
|
568
|
-
|
|
569
|
-
},
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
) :
|
|
574
|
-
if (
|
|
575
|
-
const
|
|
576
|
-
return /* @__PURE__ */
|
|
588
|
+
value: e,
|
|
589
|
+
label: r,
|
|
590
|
+
dataHook: n,
|
|
591
|
+
children: o,
|
|
592
|
+
className: i,
|
|
593
|
+
highlight: c,
|
|
594
|
+
highlightClassName: s,
|
|
595
|
+
keywords: p,
|
|
596
|
+
...d
|
|
597
|
+
}, w) => {
|
|
598
|
+
const { value: D, onValueChange: h, setOpen: f, registerItem: y, unregisterItem: v } = _(), C = t.useContext(Q), P = D === e, k = t.useMemo(() => r || (typeof o == "string" ? o : typeof o == "number" ? String(o) : e), [r, o, e]), S = t.useRef(y), I = t.useRef(v);
|
|
599
|
+
t.useEffect(() => {
|
|
600
|
+
S.current = y, I.current = v;
|
|
601
|
+
}, [y, v]);
|
|
602
|
+
const R = !!C;
|
|
603
|
+
t.useEffect(() => {
|
|
604
|
+
if (!R)
|
|
605
|
+
return S.current(e, k), () => I.current(e);
|
|
606
|
+
}, [e, k, R]);
|
|
607
|
+
const L = () => {
|
|
608
|
+
h(e === D ? "" : e), f(!1);
|
|
609
|
+
}, M = () => c && typeof o == "string" ? we(
|
|
610
|
+
o,
|
|
611
|
+
c,
|
|
612
|
+
s || "text-sm leading-normal font-semibold"
|
|
613
|
+
) : o;
|
|
614
|
+
if (C) {
|
|
615
|
+
const N = C.activeValue === e, l = !!d.disabled;
|
|
616
|
+
return /* @__PURE__ */ B(
|
|
577
617
|
"div",
|
|
578
618
|
{
|
|
579
|
-
ref:
|
|
580
|
-
"aria-disabled":
|
|
581
|
-
"aria-posinset":
|
|
582
|
-
"aria-selected":
|
|
583
|
-
"aria-setsize":
|
|
584
|
-
className:
|
|
619
|
+
ref: w,
|
|
620
|
+
"aria-disabled": l || void 0,
|
|
621
|
+
"aria-posinset": C.getItemPosition(e),
|
|
622
|
+
"aria-selected": P,
|
|
623
|
+
"aria-setsize": C.filteredCount,
|
|
624
|
+
className: A(
|
|
585
625
|
"data-[highlighted=true]:bg-accent data-[highlighted=true]:text-accent-foreground relative flex cursor-default items-center justify-between gap-2 rounded-sm px-2 py-3 text-sm outline-hidden select-none",
|
|
586
626
|
"[&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
587
|
-
|
|
588
|
-
|
|
627
|
+
l && "pointer-events-none opacity-50",
|
|
628
|
+
i
|
|
589
629
|
),
|
|
590
|
-
"data-highlighted":
|
|
591
|
-
"data-hook":
|
|
630
|
+
"data-highlighted": N || void 0,
|
|
631
|
+
"data-hook": n,
|
|
592
632
|
"data-slot": "combobox-item",
|
|
593
|
-
id: `${
|
|
633
|
+
id: `${C.idPrefix}item-${e}`,
|
|
594
634
|
role: "option",
|
|
595
635
|
tabIndex: -1,
|
|
596
|
-
onClick:
|
|
597
|
-
onKeyDown:
|
|
598
|
-
(
|
|
636
|
+
onClick: l ? void 0 : L,
|
|
637
|
+
onKeyDown: l ? void 0 : (E) => {
|
|
638
|
+
(E.key === "Enter" || E.key === " ") && L();
|
|
599
639
|
},
|
|
600
|
-
onPointerMove:
|
|
640
|
+
onPointerMove: l ? void 0 : () => C.onItemPointerMove(e),
|
|
601
641
|
children: [
|
|
602
|
-
|
|
603
|
-
|
|
642
|
+
M(),
|
|
643
|
+
P && /* @__PURE__ */ u(
|
|
604
644
|
Y,
|
|
605
645
|
{
|
|
606
646
|
"aria-hidden": "true",
|
|
@@ -611,20 +651,20 @@ const ve = e.forwardRef(
|
|
|
611
651
|
}
|
|
612
652
|
);
|
|
613
653
|
}
|
|
614
|
-
return /* @__PURE__ */
|
|
615
|
-
|
|
654
|
+
return /* @__PURE__ */ B(
|
|
655
|
+
ce,
|
|
616
656
|
{
|
|
617
|
-
ref:
|
|
618
|
-
className:
|
|
657
|
+
ref: w,
|
|
658
|
+
className: A("justify-between", i),
|
|
619
659
|
"data-slot": "combobox-item",
|
|
620
|
-
dataHook:
|
|
621
|
-
keywords:
|
|
622
|
-
value:
|
|
623
|
-
onSelect:
|
|
624
|
-
...
|
|
660
|
+
dataHook: n,
|
|
661
|
+
keywords: p ? [k, ...p] : [k],
|
|
662
|
+
value: e,
|
|
663
|
+
onSelect: L,
|
|
664
|
+
...d,
|
|
625
665
|
children: [
|
|
626
|
-
|
|
627
|
-
|
|
666
|
+
M(),
|
|
667
|
+
P && /* @__PURE__ */ u(
|
|
628
668
|
Y,
|
|
629
669
|
{
|
|
630
670
|
"aria-hidden": "true",
|
|
@@ -636,22 +676,22 @@ const ve = e.forwardRef(
|
|
|
636
676
|
);
|
|
637
677
|
}
|
|
638
678
|
);
|
|
639
|
-
|
|
640
|
-
const
|
|
641
|
-
|
|
642
|
-
function
|
|
643
|
-
return /* @__PURE__ */
|
|
679
|
+
ye.displayName = "ComboboxItem";
|
|
680
|
+
const ke = t.forwardRef((e, r) => /* @__PURE__ */ u(fe, { ref: r, "data-slot": "combobox-separator", ...e }));
|
|
681
|
+
ke.displayName = "ComboboxSeparator";
|
|
682
|
+
function je({ className: e, children: r }) {
|
|
683
|
+
return /* @__PURE__ */ u(
|
|
644
684
|
"div",
|
|
645
685
|
{
|
|
646
686
|
"aria-live": "polite",
|
|
647
|
-
className:
|
|
687
|
+
className: A(
|
|
648
688
|
"text-muted-foreground flex items-center justify-center gap-2 py-6 text-sm",
|
|
649
|
-
|
|
689
|
+
e
|
|
650
690
|
),
|
|
651
691
|
"data-slot": "combobox-loading",
|
|
652
692
|
role: "status",
|
|
653
|
-
children:
|
|
654
|
-
/* @__PURE__ */
|
|
693
|
+
children: r || /* @__PURE__ */ B(Z, { children: [
|
|
694
|
+
/* @__PURE__ */ u(
|
|
655
695
|
"div",
|
|
656
696
|
{
|
|
657
697
|
"aria-hidden": "true",
|
|
@@ -664,16 +704,16 @@ function Le({ className: t, children: o }) {
|
|
|
664
704
|
);
|
|
665
705
|
}
|
|
666
706
|
export {
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
707
|
+
Fe as Combobox,
|
|
708
|
+
Te as ComboboxContent,
|
|
709
|
+
ve as ComboboxEmpty,
|
|
710
|
+
Ce as ComboboxGroup,
|
|
711
|
+
xe as ComboboxInput,
|
|
712
|
+
ye as ComboboxItem,
|
|
713
|
+
ge as ComboboxList,
|
|
714
|
+
je as ComboboxLoading,
|
|
715
|
+
ke as ComboboxSeparator,
|
|
716
|
+
me as ComboboxTrigger,
|
|
717
|
+
Ae as ComboboxValue,
|
|
718
|
+
$e as ComboboxVirtualList
|
|
679
719
|
};
|