@brightlocal/ui-components 2.9.2 → 2.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/README.md +3 -1
  2. package/component-meta.json +41 -9
  3. package/dist/badge.cjs +1 -1
  4. package/dist/badge.d.ts.map +1 -1
  5. package/dist/badge.js +42 -25
  6. package/dist/blocks/sidebar.cjs +1 -1
  7. package/dist/blocks/sidebar.d.ts +1 -3
  8. package/dist/blocks/sidebar.d.ts.map +1 -1
  9. package/dist/blocks/sidebar.js +46 -49
  10. package/dist/browser-entry.d.ts +17 -0
  11. package/dist/browser-entry.d.ts.map +1 -0
  12. package/dist/button.cjs +1 -1
  13. package/dist/button.js +25 -25
  14. package/dist/card.cjs +1 -1
  15. package/dist/card.d.ts +10 -1
  16. package/dist/card.d.ts.map +1 -1
  17. package/dist/card.js +85 -82
  18. package/dist/carousel.cjs +1 -1
  19. package/dist/carousel.d.ts +13 -1
  20. package/dist/carousel.d.ts.map +1 -1
  21. package/dist/carousel.js +196 -150
  22. package/dist/combobox.cjs +3 -3
  23. package/dist/combobox.d.ts +3 -3
  24. package/dist/combobox.d.ts.map +1 -1
  25. package/dist/combobox.js +480 -440
  26. package/dist/command.cjs +1 -1
  27. package/dist/command.d.ts +101 -1
  28. package/dist/command.d.ts.map +1 -1
  29. package/dist/command.js +383 -119
  30. package/dist/hooks/use-breakpoint.cjs +1 -1
  31. package/dist/hooks/use-breakpoint.d.ts.map +1 -1
  32. package/dist/hooks/use-breakpoint.js +10 -10
  33. package/dist/index.cjs +1 -1
  34. package/dist/index.d.ts +1 -0
  35. package/dist/index.d.ts.map +1 -1
  36. package/dist/index.js +402 -391
  37. package/dist/input-chip.cjs +1 -1
  38. package/dist/input-chip.d.ts +1 -4
  39. package/dist/input-chip.d.ts.map +1 -1
  40. package/dist/input-chip.js +163 -170
  41. package/dist/map.cjs +1 -0
  42. package/dist/map.d.ts +192 -0
  43. package/dist/map.d.ts.map +1 -0
  44. package/dist/map.js +250 -0
  45. package/dist/sonner.cjs +1 -1
  46. package/dist/sonner.d.ts.map +1 -1
  47. package/dist/sonner.js +32 -30
  48. package/dist/tabs.cjs +1 -1
  49. package/dist/tabs.d.ts +4 -0
  50. package/dist/tabs.d.ts.map +1 -1
  51. package/dist/tabs.js +101 -52
  52. package/package.json +4 -1
  53. package/src/blocks/sidebar.tsx +21 -26
  54. package/src/browser-entry.ts +89 -0
  55. package/src/browser-tokens.css +1 -0
  56. package/src/components/badge.tsx +22 -5
  57. package/src/components/button.tsx +13 -13
  58. package/src/components/card.tsx +35 -19
  59. package/src/components/carousel.tsx +101 -9
  60. package/src/components/combobox.tsx +106 -28
  61. package/src/components/command.tsx +637 -16
  62. package/src/components/input-chip.tsx +102 -65
  63. package/src/components/map.tsx +574 -0
  64. package/src/components/sonner.tsx +9 -3
  65. package/src/components/tabs.tsx +118 -22
  66. package/src/hooks/use-breakpoint.ts +2 -3
  67. package/src/index.ts +1 -0
package/dist/carousel.js CHANGED
@@ -1,254 +1,300 @@
1
- import { jsx as n, jsxs as S } from "react/jsx-runtime";
1
+ import { jsx as p, jsxs as R } from "react/jsx-runtime";
2
2
  import * as o from "react";
3
- import E from "embla-carousel-react";
4
- import { ArrowRight as A, ArrowLeft as K } from "@brightlocal/icons";
5
- import { cn as p } from "@brightlocal/ui-components/lib/utils";
6
- import { Button as N } from "@brightlocal/ui-components/button";
7
- const w = o.createContext(null);
8
- function C() {
9
- const t = o.useContext(w);
10
- if (!t)
3
+ import $ from "embla-carousel-react";
4
+ import { ArrowRight as q, ArrowLeft as F } from "@brightlocal/icons";
5
+ import { cn as C } from "@brightlocal/ui-components/lib/utils";
6
+ import { Button as E } from "@brightlocal/ui-components/button";
7
+ const D = o.createContext(null);
8
+ function v() {
9
+ const r = o.useContext(D);
10
+ if (!r)
11
11
  throw new Error("useCarousel must be used within a <Carousel />");
12
- return t;
12
+ return r;
13
13
  }
14
- const L = o.forwardRef(
14
+ const H = o.forwardRef(
15
15
  ({
16
- orientation: t = "horizontal",
16
+ orientation: r = "horizontal",
17
17
  opts: l,
18
- setApi: a,
19
- plugins: s,
20
- className: i,
21
- children: e,
22
- dataHook: f,
23
- trackingEl: d,
24
- trackingLabel: c,
25
- ...g
26
- }, b) => {
27
- const [u, r] = E(
18
+ setApi: n,
19
+ plugins: d,
20
+ className: f,
21
+ children: t,
22
+ dataHook: c,
23
+ trackingEl: i,
24
+ trackingLabel: s,
25
+ lazyLoad: m = !1,
26
+ overscan: h = 1,
27
+ ...u
28
+ }, M) => {
29
+ const [K, e] = $(
28
30
  {
29
31
  ...l,
30
- axis: t === "horizontal" ? "x" : "y"
32
+ axis: r === "horizontal" ? "x" : "y"
31
33
  },
32
- s
33
- ), [y, k] = o.useState(!1), [P, z] = o.useState(!1), h = o.useCallback((m) => {
34
- m && (k(m.canScrollPrev()), z(m.canScrollNext()));
35
- }, []), v = o.useCallback(() => {
36
- r?.scrollPrev();
37
- }, [r]), x = o.useCallback(() => {
38
- r?.scrollNext();
39
- }, [r]), I = o.useCallback(
40
- (m) => {
41
- const R = t === "horizontal" ? "ArrowLeft" : "ArrowUp", D = t === "horizontal" ? "ArrowRight" : "ArrowDown";
42
- m.key === R ? (m.preventDefault(), v()) : m.key === D && (m.preventDefault(), x());
34
+ d
35
+ ), [L, j] = o.useState(!1), [O, A] = o.useState(!1), g = Math.max(0, Math.floor(h)), [B, G] = o.useState(() => {
36
+ if (!m) return /* @__PURE__ */ new Set();
37
+ const a = l?.startIndex ?? 0, b = /* @__PURE__ */ new Set();
38
+ for (let S = Math.max(0, a - g); S <= a + g; S++)
39
+ b.add(S);
40
+ return b;
41
+ }), w = o.useCallback((a) => {
42
+ a && (j(a.canScrollPrev()), A(a.canScrollNext()));
43
+ }, []), N = o.useCallback(() => {
44
+ e?.scrollPrev();
45
+ }, [e]), k = o.useCallback(() => {
46
+ e?.scrollNext();
47
+ }, [e]), T = o.useCallback(
48
+ (a) => {
49
+ const b = r === "horizontal" ? "ArrowLeft" : "ArrowUp", S = r === "horizontal" ? "ArrowRight" : "ArrowDown";
50
+ a.key === b ? (a.preventDefault(), N()) : a.key === S && (a.preventDefault(), k());
43
51
  },
44
- [t, v, x]
52
+ [r, N, k]
53
+ );
54
+ o.useEffect(() => {
55
+ !e || !n || n(e);
56
+ }, [e, n]), o.useEffect(() => {
57
+ if (e)
58
+ return w(e), e.on("reInit", w), e.on("select", w), () => {
59
+ e?.off("reInit", w), e?.off("select", w);
60
+ };
61
+ }, [e, w]);
62
+ const x = o.useCallback(
63
+ (a) => {
64
+ if (!a || !m) return;
65
+ const b = a.slidesInView(), S = a.slideNodes().length;
66
+ G((y) => {
67
+ const I = new Set(y);
68
+ for (const z of b) {
69
+ const U = Math.max(0, z - g), _ = Math.min(S - 1, z + g);
70
+ for (let P = U; P <= _; P++)
71
+ I.add(P);
72
+ }
73
+ return I.size === y.size ? y : I;
74
+ });
75
+ },
76
+ [m, g]
45
77
  );
46
78
  return o.useEffect(() => {
47
- !r || !a || a(r);
48
- }, [r, a]), o.useEffect(() => {
49
- if (r)
50
- return h(r), r.on("reInit", h), r.on("select", h), () => {
51
- r?.off("reInit", h), r?.off("select", h);
79
+ if (!(!e || !m))
80
+ return x(e), e.on("slidesInView", x), e.on("select", x), e.on("reInit", x), () => {
81
+ e.off("slidesInView", x), e.off("select", x), e.off("reInit", x);
52
82
  };
53
- }, [r, h]), /* @__PURE__ */ n(
54
- w.Provider,
83
+ }, [e, m, x]), /* @__PURE__ */ p(
84
+ D.Provider,
55
85
  {
56
86
  value: {
57
- carouselRef: u,
58
- api: r,
87
+ carouselRef: K,
88
+ api: e,
59
89
  opts: l,
60
- orientation: t || (l?.axis === "y" ? "vertical" : "horizontal"),
61
- scrollPrev: v,
62
- scrollNext: x,
63
- canScrollPrev: y,
64
- canScrollNext: P
90
+ orientation: r || (l?.axis === "y" ? "vertical" : "horizontal"),
91
+ scrollPrev: N,
92
+ scrollNext: k,
93
+ canScrollPrev: L,
94
+ canScrollNext: O,
95
+ lazyLoad: m,
96
+ loadedSlides: B
65
97
  },
66
- children: /* @__PURE__ */ n(
98
+ children: /* @__PURE__ */ p(
67
99
  "div",
68
100
  {
69
- ref: b,
101
+ ref: M,
70
102
  "aria-roledescription": "carousel",
71
- className: p("relative", i),
72
- "data-hook": f,
103
+ className: C("relative", f),
104
+ "data-hook": c,
73
105
  "data-slot": "carousel",
74
- "data-tracking-el": d,
75
- "data-tracking-label": c,
106
+ "data-tracking-el": i,
107
+ "data-tracking-label": s,
76
108
  role: "region",
77
- onKeyDownCapture: I,
78
- ...g,
79
- children: e
109
+ onKeyDownCapture: T,
110
+ ...u,
111
+ children: t
80
112
  }
81
113
  )
82
114
  }
83
115
  );
84
116
  }
85
117
  );
86
- L.displayName = "Carousel";
87
- const j = o.forwardRef(({ className: t, ...l }, a) => {
88
- const { carouselRef: s, orientation: i } = C(), e = i === "vertical";
89
- return /* @__PURE__ */ n(
118
+ H.displayName = "Carousel";
119
+ const J = o.forwardRef(({ className: r, children: l, ...n }, d) => {
120
+ const { carouselRef: f, orientation: t, lazyLoad: c } = v(), i = t === "vertical";
121
+ let s = 0;
122
+ const m = c ? o.Children.map(l, (h) => {
123
+ if (o.isValidElement(h) && h.type === V) {
124
+ const u = s++;
125
+ return o.cloneElement(
126
+ h,
127
+ { _lazyIndex: u }
128
+ );
129
+ }
130
+ return h;
131
+ }) : l;
132
+ return /* @__PURE__ */ p(
90
133
  "div",
91
134
  {
92
- ref: s,
93
- className: p("overflow-hidden", e && "w-full", t),
135
+ ref: f,
136
+ className: C("overflow-hidden", i && "w-full", r),
94
137
  "data-slot": "carousel-content",
95
- children: /* @__PURE__ */ n(
138
+ children: /* @__PURE__ */ p(
96
139
  "div",
97
140
  {
98
- ref: a,
99
- className: p(
141
+ ref: d,
142
+ className: C(
100
143
  "flex",
101
- e ? "-mt-4 h-full w-full flex-col" : "-ml-4"
144
+ i ? "-mt-4 h-full w-full flex-col" : "-ml-4"
102
145
  ),
103
- ...l
146
+ ...n,
147
+ children: m
104
148
  }
105
149
  )
106
150
  }
107
151
  );
108
152
  });
109
- j.displayName = "CarouselContent";
110
- const O = o.forwardRef(({ className: t, ...l }, a) => {
111
- const { orientation: s } = C();
112
- return /* @__PURE__ */ n(
153
+ J.displayName = "CarouselContent";
154
+ const V = o.forwardRef(({ className: r, children: l, _lazyIndex: n, ...d }, f) => {
155
+ const { orientation: t, lazyLoad: c, loadedSlides: i } = v(), s = !c || n === void 0 || i.has(n);
156
+ return /* @__PURE__ */ p(
113
157
  "div",
114
158
  {
115
- ref: a,
159
+ ref: f,
116
160
  "aria-roledescription": "slide",
117
- className: p(
161
+ className: C(
118
162
  "min-w-0 shrink-0 grow-0 basis-full",
119
- s === "horizontal" ? "pl-4" : "w-full pt-4",
120
- t
163
+ t === "horizontal" ? "pl-4" : "w-full pt-4",
164
+ r
121
165
  ),
166
+ "data-lazy-loaded": c ? String(s) : void 0,
122
167
  "data-slot": "carousel-item",
123
168
  role: "group",
124
- ...l
169
+ ...d,
170
+ children: s ? l : null
125
171
  }
126
172
  );
127
173
  });
128
- O.displayName = "CarouselItem";
129
- function B({
130
- className: t,
174
+ V.displayName = "CarouselItem";
175
+ function Q({
176
+ className: r,
131
177
  variant: l = "outline",
132
- size: a = "default",
133
- dataHook: s = "carousel-previous",
134
- hideWhenDisabled: i = !1,
135
- ...e
178
+ size: n = "default",
179
+ dataHook: d = "carousel-previous",
180
+ hideWhenDisabled: f = !1,
181
+ ...t
136
182
  }) {
137
- const { orientation: f, scrollPrev: d, canScrollPrev: c } = C();
138
- return i && !c ? null : /* @__PURE__ */ S(
139
- N,
183
+ const { orientation: c, scrollPrev: i, canScrollPrev: s } = v();
184
+ return f && !s ? null : /* @__PURE__ */ R(
185
+ E,
140
186
  {
141
187
  iconOnly: !0,
142
- className: p(
188
+ className: C(
143
189
  "absolute",
144
- f === "horizontal" ? "top-1/2 left-1 -translate-y-1/2 sm:-left-12" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
145
- t
190
+ c === "horizontal" ? "top-1/2 left-1 -translate-y-1/2 sm:-left-12" : "-top-12 left-1/2 -translate-x-1/2 rotate-90",
191
+ r
146
192
  ),
147
193
  "data-slot": "carousel-previous",
148
- dataHook: s,
149
- disabled: !c,
150
- size: a,
194
+ dataHook: d,
195
+ disabled: !s,
196
+ size: n,
151
197
  variant: l,
152
- onClick: d,
153
- ...e,
198
+ onClick: i,
199
+ ...t,
154
200
  children: [
155
- /* @__PURE__ */ n(K, {}),
156
- /* @__PURE__ */ n("span", { className: "sr-only", children: "Previous slide" })
201
+ /* @__PURE__ */ p(F, {}),
202
+ /* @__PURE__ */ p("span", { className: "sr-only", children: "Previous slide" })
157
203
  ]
158
204
  }
159
205
  );
160
206
  }
161
- B.displayName = "CarouselPrevious";
162
- function G({
163
- className: t,
207
+ Q.displayName = "CarouselPrevious";
208
+ function W({
209
+ className: r,
164
210
  variant: l = "outline",
165
- size: a = "default",
166
- dataHook: s = "carousel-next",
167
- hideWhenDisabled: i = !1,
168
- ...e
211
+ size: n = "default",
212
+ dataHook: d = "carousel-next",
213
+ hideWhenDisabled: f = !1,
214
+ ...t
169
215
  }) {
170
- const { orientation: f, scrollNext: d, canScrollNext: c } = C();
171
- return i && !c ? null : /* @__PURE__ */ S(
172
- N,
216
+ const { orientation: c, scrollNext: i, canScrollNext: s } = v();
217
+ return f && !s ? null : /* @__PURE__ */ R(
218
+ E,
173
219
  {
174
220
  iconOnly: !0,
175
- className: p(
221
+ className: C(
176
222
  "absolute",
177
- f === "horizontal" ? "top-1/2 right-1 -translate-y-1/2 sm:-right-12" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
178
- t
223
+ c === "horizontal" ? "top-1/2 right-1 -translate-y-1/2 sm:-right-12" : "-bottom-12 left-1/2 -translate-x-1/2 rotate-90",
224
+ r
179
225
  ),
180
226
  "data-slot": "carousel-next",
181
- dataHook: s,
182
- disabled: !c,
183
- size: a,
227
+ dataHook: d,
228
+ disabled: !s,
229
+ size: n,
184
230
  variant: l,
185
- onClick: d,
186
- ...e,
231
+ onClick: i,
232
+ ...t,
187
233
  children: [
188
- /* @__PURE__ */ n(A, {}),
189
- /* @__PURE__ */ n("span", { className: "sr-only", children: "Next slide" })
234
+ /* @__PURE__ */ p(q, {}),
235
+ /* @__PURE__ */ p("span", { className: "sr-only", children: "Next slide" })
190
236
  ]
191
237
  }
192
238
  );
193
239
  }
194
- G.displayName = "CarouselNext";
195
- function T({
196
- className: t,
240
+ W.displayName = "CarouselNext";
241
+ function X({
242
+ className: r,
197
243
  dataHook: l = "carousel-dots",
198
- trackingEl: a,
199
- trackingLabel: s,
200
- ...i
244
+ trackingEl: n,
245
+ trackingLabel: d,
246
+ ...f
201
247
  }) {
202
- const { api: e } = C(), [f, d] = o.useState(0), [c, g] = o.useState([]);
248
+ const { api: t } = v(), [c, i] = o.useState(0), [s, m] = o.useState([]);
203
249
  return o.useEffect(() => {
204
- if (!e) return;
205
- g(e.scrollSnapList()), d(e.selectedScrollSnap());
206
- const b = () => {
207
- d(e.selectedScrollSnap());
250
+ if (!t) return;
251
+ m(t.scrollSnapList()), i(t.selectedScrollSnap());
252
+ const h = () => {
253
+ i(t.selectedScrollSnap());
208
254
  }, u = () => {
209
- g(e.scrollSnapList()), d(e.selectedScrollSnap());
255
+ m(t.scrollSnapList()), i(t.selectedScrollSnap());
210
256
  };
211
- return e.on("select", b), e.on("reInit", u), () => {
212
- e.off("select", b), e.off("reInit", u);
257
+ return t.on("select", h), t.on("reInit", u), () => {
258
+ t.off("select", h), t.off("reInit", u);
213
259
  };
214
- }, [e]), c.length === 0 ? null : /* @__PURE__ */ n(
260
+ }, [t]), s.length === 0 ? null : /* @__PURE__ */ p(
215
261
  "div",
216
262
  {
217
263
  "aria-label": "Slide navigation",
218
- className: p(
264
+ className: C(
219
265
  "border-border dark:border-input dark:bg-input/30 inline-flex items-center justify-center gap-2 rounded-full border bg-white px-2.5 py-2",
220
- t
266
+ r
221
267
  ),
222
268
  "data-hook": l,
223
269
  "data-slot": "carousel-dots",
224
- "data-tracking-el": a,
225
- "data-tracking-label": s,
270
+ "data-tracking-el": n,
271
+ "data-tracking-label": d,
226
272
  role: "group",
227
- ...i,
228
- children: c.map((b, u) => /* @__PURE__ */ n(
273
+ ...f,
274
+ children: s.map((h, u) => /* @__PURE__ */ p(
229
275
  "button",
230
276
  {
231
- "aria-current": u === f ? "step" : void 0,
277
+ "aria-current": u === c ? "step" : void 0,
232
278
  "aria-label": `Go to slide ${u + 1}`,
233
- className: p(
279
+ className: C(
234
280
  "focus-visible:shadow-default size-3 rounded-full transition-[width,background-color] duration-200 ease-out outline-none",
235
- u === f ? "bg-muted-foreground/50 dark:bg-muted-foreground/70 w-9" : "bg-input hover:bg-muted-foreground/30 dark:bg-input/80 dark:hover:bg-muted-foreground/50"
281
+ u === c ? "bg-muted-foreground/50 dark:bg-muted-foreground/70 w-9" : "bg-input hover:bg-muted-foreground/30 dark:bg-input/80 dark:hover:bg-muted-foreground/50"
236
282
  ),
237
283
  "data-slot": "carousel-dot",
238
284
  type: "button",
239
- onClick: () => e?.scrollTo(u)
285
+ onClick: () => t?.scrollTo(u)
240
286
  },
241
287
  u
242
288
  ))
243
289
  }
244
290
  );
245
291
  }
246
- T.displayName = "CarouselDots";
292
+ X.displayName = "CarouselDots";
247
293
  export {
248
- L as Carousel,
249
- j as CarouselContent,
250
- T as CarouselDots,
251
- O as CarouselItem,
252
- G as CarouselNext,
253
- B as CarouselPrevious
294
+ H as Carousel,
295
+ J as CarouselContent,
296
+ X as CarouselDots,
297
+ V as CarouselItem,
298
+ W as CarouselNext,
299
+ Q as CarouselPrevious
254
300
  };
package/dist/combobox.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),re=require("react"),Y=require("@brightlocal/icons"),ne=require("@tanstack/react-virtual"),se=require("class-variance-authority"),U=require("cmdk"),M=require("@brightlocal/ui-components/lib/utils"),W=require("@brightlocal/ui-components/lib/use-dev-warning"),B=require("@brightlocal/ui-components/popover"),O=require("@brightlocal/ui-components/command");function ae(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(o,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return o.default=t,Object.freeze(o)}const e=ae(re),J=e.createContext(null),K=e.createContext(null);function _(){const t=e.useContext(J);if(!t)throw new Error("Combobox components must be used within a <Combobox>");return t}function ie({value:t,onValueChange:o,open:n,onOpenChange:r,shouldFilter:u=!0,disabled:f=!1,itemToStringValue:c,children:p}){const[x,v]=e.useState(""),[P,C]=e.useState(!1),[S,y]=e.useState(()=>new Map),[k,j]=e.useState(""),[w,h]=e.useState(void 0),E=t!==void 0,I=n!==void 0,R=E?t:x,b=I?n:P,g=e.useCallback(m=>{m||j(""),I||C(m),r?.(m)},[I,r]),N=e.useCallback(m=>{E||v(m),o?.(m)},[E,o]),a=e.useRef(new Map),D=e.useRef(!1),T=e.useRef(!0);e.useEffect(()=>()=>{T.current=!1},[]);const q=e.useCallback(()=>{D.current||(D.current=!0,queueMicrotask(()=>{D.current=!1,T.current&&y(new Map(a.current))}))},[]),L=e.useCallback((m,s)=>{a.current.get(m)!==s&&(a.current.set(m,s),q())},[q]),A=e.useCallback(m=>{for(const[s,d]of m)a.current.set(s,d);y(new Map(a.current))},[]),$=e.useRef(R);e.useLayoutEffect(()=>{$.current=R},[R]);const z=e.useCallback(m=>{m!==$.current&&a.current.has(m)&&(a.current.delete(m),q())},[q]),G=e.useMemo(()=>c?(m,s,d)=>U.defaultFilter(c(m),s,d):U.defaultFilter,[c]),H=e.useMemo(()=>({open:b,setOpen:g,value:R,onValueChange:N,shouldFilter:u,disabled:f,itemLabels:S,registerItem:L,registerItemsSync:A,unregisterItem:z,itemToStringValue:c,filterFn:G,searchValue:k,setSearchValue:j,activeDescendantId:w,setActiveDescendantId:h}),[b,g,R,N,u,f,S,L,A,z,c,G,k,w,h]);return i.jsx(J.Provider,{value:H,children:i.jsx(B.Popover,{open:b,onOpenChange:g,children:p})})}const ce=se.cva(["relative flex w-full items-center justify-between gap-2","px-4 py-2 h-9","border border-input rounded-md outline-none","bg-neutral-50 shadow-xs","dark:bg-white/5 dark:border-white/15","text-base font-normal font-sans text-foreground","data-[placeholder=true]:text-muted-foreground","focus-visible:outline-none focus-visible:border-ring dark:focus-visible:border-neutral-500 focus-visible:bg-background","focus-visible:shadow-default","data-[state=open]:border-ring","disabled:cursor-not-allowed disabled:opacity-50","transition-[background-color,border-color,box-shadow] duration-200 ease-out","[&_svg]:pointer-events-none [&_svg]:shrink-0"]),Q=e.forwardRef(({className:t,dataHook:o,error:n,trackingEl:r,trackingLabel:u,children:f,...c},p)=>{const{open:x,disabled:v,value:P}=_(),C=e.useId(),S=!P,y=n||c["aria-invalid"]===!0||c["aria-invalid"]==="true";return i.jsx(B.PopoverTrigger,{asChild:!0,children:i.jsxs("button",{ref:p,"aria-controls":x?C:void 0,"aria-expanded":x,"aria-haspopup":"listbox","aria-invalid":y?"true":void 0,className:M.cn(ce(),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",t),"data-hook":o,"data-placeholder":S,"data-slot":"combobox-trigger","data-state":x?"open":"closed","data-tracking-el":r||"combobox-trigger","data-tracking-label":u,disabled:v||c.disabled,role:"combobox",type:"button",...c,children:[f,i.jsx(Y.ChevronsUpDown,{"aria-hidden":"true",className:"text-muted-foreground ml-auto shrink-0"})]})})});Q.displayName="ComboboxTrigger";function ue({placeholder:t,className:o,displayValue:n,items:r,getItemValue:u,getItemLabel:f}){const{value:c,itemLabels:p}=_();W.useDevWarning(()=>!!r&&!u,"ComboboxValue: `items` was provided without `getItemValue`. Pass `getItemValue` (and optionally `getItemLabel`) to enable item-based label resolution.",[r,u]);const x=e.useMemo(()=>{if(!r||!u)return null;const P=f??u;return new Map(r.map(C=>[u(C),P(C)]))},[r,u,f]),v=c?x?.get(c)||p.get(c)||n?.(c)||c:t;return i.jsx("span",{className:M.cn("text-foreground overflow-hidden text-base leading-normal font-medium text-ellipsis whitespace-nowrap",o),"data-slot":"combobox-value",children:v})}function le({dataHook:t,className:o,children:n,align:r="start",side:u="bottom",sideOffset:f,avoidCollisions:c,hideList:p=!1}){const{open:x,shouldFilter:v,filterFn:P,itemToStringValue:C}=_(),[S,y]=e.useState(null),k=e.useRef(null),j=e.useCallback(h=>{if(k.current?.(),k.current=null,!h)return;let E=!1;const I=N=>{E||(N==="top"||N==="bottom")&&(E=!0,R.disconnect(),y(N))},R=new MutationObserver(()=>{I(h.getAttribute("data-side"))});R.observe(h,{attributes:!0,attributeFilter:["data-side"]});let b=0,g=0;b=requestAnimationFrame(()=>{g=requestAnimationFrame(()=>{I(h.getAttribute("data-side"))})}),k.current=()=>{E=!0,R.disconnect(),cancelAnimationFrame(b),cancelAnimationFrame(g)}},[]);e.useEffect(()=>{if(!x){k.current?.(),k.current=null;const h=setTimeout(()=>y(null),150);return()=>clearTimeout(h)}},[x]);const w=C?P:void 0;return i.jsx(B.PopoverContent,{ref:j,align:r,"aria-label":"Options",avoidCollisions:c,className:M.cn("flex max-h-[var(--radix-popover-content-available-height)] w-[var(--radix-popover-trigger-width)] flex-col overflow-hidden p-0",o),collisionPadding:4,"data-slot":"combobox-popover",side:S??u,sideOffset:f,children:i.jsx(O.Command,{className:M.cn("min-h-0 flex-1 border-0 shadow-none","[&_[data-slot='command-input-wrapper']]:shrink-0",p&&"[&_[data-slot='command-input-wrapper']]:border-b-0"),"data-slot":"combobox-command",dataHook:t||"combobox-command",filter:w,shouldFilter:v,children:n})})}const X=e.forwardRef(({debounceMs:t,onValueChange:o,...n},r)=>{const{setSearchValue:u,shouldFilter:f,activeDescendantId:c}=_(),p=e.useRef(void 0);W.useDevWarning(()=>!!(t&&t>0&&f),`debounceMs is set on <ComboboxInput> but shouldFilter is true (default).
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("react/jsx-runtime"),ie=require("react"),K=require("@brightlocal/icons"),le=require("@tanstack/react-virtual"),ue=require("class-variance-authority"),B=require("cmdk"),F=require("@brightlocal/ui-components/lib/utils"),U=require("@brightlocal/ui-components/lib/use-dev-warning"),Y=require("@brightlocal/ui-components/popover"),_=require("@brightlocal/ui-components/command");function ce(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return r.default=e,Object.freeze(r)}const t=ce(ie),Q=t.createContext(null),X=t.createContext(null);function z(){const e=t.useContext(Q);if(!e)throw new Error("Combobox components must be used within a <Combobox>");return e}function de({value:e,onValueChange:r,open:n,onOpenChange:o,shouldFilter:l=!0,disabled:c=!1,itemToStringValue:a,children:x}){const[d,y]=t.useState(""),[D,h]=t.useState(!1),[b,w]=t.useState(()=>new Map),[v,C]=t.useState(""),[V,k]=t.useState(void 0),S=e!==void 0,I=n!==void 0,j=S?e:d,R=I?n:D,E=t.useCallback(p=>{p||C(""),I||h(p),o?.(p)},[I,o]),M=t.useCallback(p=>{S||y(p),r?.(p)},[S,r]),u=t.useRef(new Map),L=t.useRef(!1),$=t.useRef(!0);t.useEffect(()=>()=>{$.current=!1},[]);const f=t.useCallback(()=>{L.current||(L.current=!0,queueMicrotask(()=>{L.current=!1,$.current&&w(new Map(u.current))}))},[]),P=t.useCallback((p,q)=>{u.current.get(p)!==q&&(u.current.set(p,q),f())},[f]),A=t.useCallback(p=>{for(const[q,G]of p)u.current.set(q,G);w(new Map(u.current))},[]),W=t.useRef(j);t.useLayoutEffect(()=>{W.current=j},[j]);const T=t.useCallback(p=>{p!==W.current&&u.current.has(p)&&(u.current.delete(p),f())},[f]),O=t.useMemo(()=>a?(p,q,G)=>B.defaultFilter(a(p),q,G):B.defaultFilter,[a]),H=t.useMemo(()=>({open:R,setOpen:E,value:j,onValueChange:M,shouldFilter:l,disabled:c,itemLabels:b,registerItem:P,registerItemsSync:A,unregisterItem:T,itemToStringValue:a,filterFn:O,searchValue:v,setSearchValue:C,activeDescendantId:V,setActiveDescendantId:k}),[R,E,j,M,l,c,b,P,A,T,a,O,v,V,k]);return i.jsx(Q.Provider,{value:H,children:i.jsx(Y.Popover,{open:R,onOpenChange:E,children:x})})}const be=ue.cva(["relative flex w-full items-center justify-between gap-2","px-4 py-2 h-9","border border-input rounded-md outline-none","bg-neutral-50 shadow-xs","dark:bg-white/5 dark:border-white/15","text-base font-normal font-sans text-foreground","data-[placeholder=true]:text-muted-foreground","focus-visible:outline-none focus-visible:border-ring dark:focus-visible:border-neutral-500 focus-visible:bg-background","focus-visible:shadow-default","data-[state=open]:border-ring","disabled:cursor-not-allowed disabled:opacity-50","transition-[background-color,border-color,box-shadow] duration-200 ease-out","[&_svg]:pointer-events-none [&_svg]:shrink-0"]),Z=t.forwardRef(({className:e,dataHook:r,error:n,trackingEl:o,trackingLabel:l,children:c,...a},x)=>{const{open:d,disabled:y,value:D}=z(),h=t.useId(),b=!D,w=n||a["aria-invalid"]===!0||a["aria-invalid"]==="true";return i.jsx(Y.PopoverTrigger,{asChild:!0,children:i.jsxs("button",{ref:x,"aria-controls":d?h:void 0,"aria-expanded":d,"aria-haspopup":"listbox","aria-invalid":w?"true":void 0,className:F.cn(be(),w&&"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",e),"data-hook":r,"data-placeholder":b,"data-slot":"combobox-trigger","data-state":d?"open":"closed","data-tracking-el":o||"combobox-trigger","data-tracking-label":l,disabled:y||a.disabled,role:"combobox",type:"button",...a,children:[c,i.jsx(K.ChevronsUpDown,{"aria-hidden":"true",className:"text-muted-foreground ml-auto shrink-0"})]})})});Z.displayName="ComboboxTrigger";function fe(e){return e!=null&&typeof e=="object"&&"value"in e&&typeof e.value=="string"}function ee(e,r,n){if(r)return{getValue:r,getLabel:n??r,hasDistinctLabel:!!n};const o=e[0];if(!fe(o))return null;const l=x=>x.value,c="label"in o&&typeof o.label=="string";return{getValue:l,getLabel:n??(c?x=>String(x.label):l),hasDistinctLabel:c||!!n}}function me({placeholder:e,className:r,displayValue:n,items:o,getItemValue:l,getItemLabel:c}){const{value:a,itemLabels:x}=z(),d=t.useMemo(()=>o?ee(o,l,c):null,[o,l,c]);U.useDevWarning(()=>!!o&&o.length>0&&!d,"ComboboxValue: could not infer `getItemValue` from item shape. Pass `getItemValue` explicitly, or use items with a `value` string property.",[o,d]);const y=t.useMemo(()=>!o||!d?null:new Map(o.map(h=>[d.getValue(h),d.getLabel(h)])),[o,d]),D=a?y?.get(a)||x.get(a)||n?.(a)||a:e;return i.jsx("span",{className:F.cn("text-foreground overflow-hidden text-base leading-normal font-medium text-ellipsis whitespace-nowrap",r),"data-slot":"combobox-value",children:D})}function xe({dataHook:e,className:r,children:n,align:o="start",side:l="bottom",sideOffset:c,avoidCollisions:a,hideList:x=!1}){const{open:d,shouldFilter:y,filterFn:D,itemToStringValue:h}=z(),[b,w]=t.useState(null),v=t.useRef(null),C=t.useCallback(k=>{if(v.current?.(),v.current=null,!k)return;let S=!1;const I=M=>{S||(M==="top"||M==="bottom")&&(S=!0,j.disconnect(),w(M))},j=new MutationObserver(()=>{I(k.getAttribute("data-side"))});j.observe(k,{attributes:!0,attributeFilter:["data-side"]});let R=0,E=0;R=requestAnimationFrame(()=>{E=requestAnimationFrame(()=>{I(k.getAttribute("data-side"))})}),v.current=()=>{S=!0,j.disconnect(),cancelAnimationFrame(R),cancelAnimationFrame(E)}},[]);t.useEffect(()=>{if(!d){v.current?.(),v.current=null;const k=setTimeout(()=>w(null),150);return()=>clearTimeout(k)}},[d]);const V=h?D:void 0;return i.jsx(Y.PopoverContent,{ref:C,align:o,"aria-label":"Options",avoidCollisions:a,className:F.cn("flex max-h-[var(--radix-popover-content-available-height)] w-[var(--radix-popover-trigger-width)] flex-col overflow-hidden p-0",r),collisionPadding:4,"data-slot":"combobox-popover",side:b??l,sideOffset:c,children:i.jsx(_.Command,{className:F.cn("min-h-0 flex-1 border-0 shadow-none","[&_[data-slot='command-input-wrapper']]:shrink-0",x&&"[&_[data-slot='command-input-wrapper']]:border-b-0"),"data-slot":"combobox-command",dataHook:e||"combobox-command",filter:V,shouldFilter:y,children:n})})}const te=t.forwardRef(({debounceMs:e,onValueChange:r,...n},o)=>{const{setSearchValue:l,shouldFilter:c,activeDescendantId:a}=z(),x=t.useRef(void 0);U.useDevWarning(()=>!!(e&&e>0&&c),`debounceMs is set on <ComboboxInput> but shouldFilter is true (default).
2
2
  Debounce is designed for async/server-driven search where the consumer controls the items list.
3
- Set shouldFilter={false} on <Combobox> for async search, or remove debounceMs for client-side filtering.`,[t,f]),W.useDevWarning(()=>!!(t&&t>0&&n.value!==void 0),"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.",[t,n.value]),e.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]);const x=e.useCallback(v=>{u(v),t&&t>0?(clearTimeout(p.current),p.current=setTimeout(()=>{o?.(v)},t)):o?.(v)},[t,o,u]);return i.jsx(O.CommandInput,{ref:r,"aria-activedescendant":c,"data-slot":"combobox-input",onValueChange:x,...n})});X.displayName="ComboboxInput";const Z=e.forwardRef(({className:t,...o},n)=>i.jsx(O.CommandList,{ref:n,className:M.cn("min-h-0 flex-1",t),"data-slot":"combobox-list",...o}));Z.displayName="ComboboxList";function de({items:t,getItemValue:o,getItemLabel:n,getItemKeywords:r,estimateSize:u=36,overscan:f=5,children:c,renderEmpty:p,className:x,dataHook:v},P){const C=e.useRef(null),{value:S,onValueChange:y,setOpen:k,shouldFilter:j,searchValue:w,filterFn:h,setActiveDescendantId:E,registerItemsSync:I,unregisterItem:R}=_(),[b,g]=e.useState(0),N=e.useId();e.useImperativeHandle(P,()=>C.current,[]),e.useLayoutEffect(()=>{const s=n??o,d=t.map(l=>[o(l),s(l)]);return I(d),()=>{for(const l of t)R(o(l))}},[t,o,n,I,R]);const a=e.useMemo(()=>{if(!j||!w.trim())return t;const s=[];for(const d of t){let l=n?U.defaultFilter(n(d),w):h(o(d),w);if(r)for(const F of r(d))l=Math.max(l,U.defaultFilter(F,w));l>0&&s.push({item:d,score:l})}return s.sort((d,l)=>l.score-d.score),s.map(d=>d.item)},[t,j,w,o,n,r,h]),D=ne.useVirtualizer({count:a.length,getScrollElement:()=>C.current,estimateSize:()=>u,overscan:f}),T=b>=0&&b<a.length?o(a[b]):null;e.useEffect(()=>{g(0)},[w,a.length]);const q=e.useRef(!1);e.useEffect(()=>{if(q.current||!S)return;const s=a.findIndex(d=>o(d)===S);s>=0&&(g(s),D.scrollToIndex(s,{align:"center"}),q.current=!0)},[S,a,o,D]);const L=e.useRef(!1);e.useEffect(()=>{L.current&&b>=0&&b<a.length&&D.scrollToIndex(b,{align:"auto"}),L.current=!1},[b,a.length,D]),e.useEffect(()=>{const s=C.current?.closest('[data-slot="combobox-command"]');if(!s)return;const d=l=>{switch(l.key){case"ArrowDown":l.preventDefault(),l.stopPropagation(),L.current=!0,g(F=>F<a.length-1?F+1:F);break;case"ArrowUp":l.preventDefault(),l.stopPropagation(),L.current=!0,g(F=>F>0?F-1:F);break;case"Enter":if(l.preventDefault(),l.stopPropagation(),b>=0&&b<a.length){const F=o(a[b]);y(F===S?"":F),k(!1)}break;case"Home":l.preventDefault(),l.stopPropagation(),L.current=!0,g(0);break;case"End":l.preventDefault(),l.stopPropagation(),L.current=!0,g(a.length-1);break}};return s.addEventListener("keydown",d,{capture:!0}),()=>s.removeEventListener("keydown",d,{capture:!0})},[a,b,S,y,k,o]);const A=e.useMemo(()=>{const s=new Map;return a.forEach((d,l)=>{s.set(o(d),l)}),s},[a,o]),$=e.useCallback(s=>{const d=A.get(s);d!==void 0&&g(d)},[A]),z=e.useCallback(s=>(A.get(s)??0)+1,[A]),G=a.length,H=e.useMemo(()=>({activeValue:T,onItemPointerMove:$,idPrefix:N,filteredCount:G,getItemPosition:z}),[T,$,N,G,z]),m=T!=null?`${N}item-${T}`:void 0;return e.useEffect(()=>(E(m),()=>E(void 0)),[m,E]),a.length===0?i.jsx("div",{ref:C,className:M.cn("max-h-[300px] min-h-0 flex-1 scroll-py-1 overflow-x-hidden overflow-y-auto py-1",x),"data-hook":v,"data-slot":"combobox-virtual-list",role:"listbox",children:p}):i.jsx(K.Provider,{value:H,children:i.jsx("div",{ref:C,className:M.cn("max-h-[300px] min-h-0 flex-1 scroll-py-1 overflow-x-hidden overflow-y-auto py-1",x),"data-hook":v,"data-slot":"combobox-virtual-list",role:"listbox",children:i.jsx("div",{className:"relative w-full",style:{height:`${D.getTotalSize()}px`},children:D.getVirtualItems().map(s=>i.jsx("div",{ref:D.measureElement,className:"absolute top-0 left-0 w-full px-2","data-index":s.index,style:{transform:`translateY(${s.start}px)`},children:c(a[s.index],s.index,w)},s.key))})})})}const be=e.forwardRef(de),V=e.forwardRef((t,o)=>i.jsx(O.CommandEmpty,{ref:o,"data-slot":"combobox-empty",...t}));V.displayName="ComboboxEmpty";const ee=e.forwardRef(({children:t,...o},n)=>{const r=e.useRef(null);return W.useDevWarning(()=>r.current?r.current.querySelectorAll('[data-slot="combobox-item"]').length>=100:!1,`ComboboxGroup contains 100+ items. Use <ComboboxVirtualList> for large datasets to avoid DOM bloat and slow renders.
4
- Import: import { ComboboxVirtualList } from "@brightlocal/ui-components/combobox"`,[t]),i.jsx(O.CommandGroup,{ref:u=>{r.current=u,typeof n=="function"?n(u):n&&(n.current=u)},"data-slot":"combobox-group",...o,children:t})});ee.displayName="ComboboxGroup";function fe(t,o,n){if(!o||!o.trim())return t;const r=new RegExp(`(${o.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),u=t.split(r);return i.jsx("span",{children:u.map((f,c)=>c%2===1?i.jsx("span",{className:n,children:f},c):i.jsx(e.Fragment,{children:f},c))})}const te=e.forwardRef(({value:t,label:o,dataHook:n,children:r,className:u,highlight:f,highlightClassName:c,keywords:p,...x},v)=>{const{value:P,onValueChange:C,setOpen:S,registerItem:y,unregisterItem:k}=_(),j=e.useContext(K),w=P===t,h=e.useMemo(()=>o||(typeof r=="string"?r:typeof r=="number"?String(r):t),[o,r,t]),E=e.useRef(y),I=e.useRef(k);e.useEffect(()=>{E.current=y,I.current=k},[y,k]);const R=!!j;e.useEffect(()=>{if(!R)return E.current(t,h),()=>I.current(t)},[t,h,R]);const b=()=>{C(t===P?"":t),S(!1)},g=()=>f&&typeof r=="string"?fe(r,f,c||"text-sm leading-normal font-semibold"):r;if(j){const N=j.activeValue===t,a=!!x.disabled;return i.jsxs("div",{ref:v,"aria-disabled":a||void 0,"aria-posinset":j.getItemPosition(t),"aria-selected":w,"aria-setsize":j.filteredCount,className:M.cn("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","[&_svg]:pointer-events-none [&_svg]:shrink-0",a&&"pointer-events-none opacity-50",u),"data-highlighted":N||void 0,"data-hook":n,"data-slot":"combobox-item",id:`${j.idPrefix}item-${t}`,role:"option",tabIndex:-1,onClick:a?void 0:b,onKeyDown:a?void 0:D=>{(D.key==="Enter"||D.key===" ")&&b()},onPointerMove:a?void 0:()=>j.onItemPointerMove(t),children:[g(),w&&i.jsx(Y.Check,{"aria-hidden":"true",className:"text-muted-foreground shrink-0"})]})}return i.jsxs(O.CommandItem,{ref:v,className:M.cn("justify-between",u),"data-slot":"combobox-item",dataHook:n,keywords:p?[h,...p]:[h],value:t,onSelect:b,...x,children:[g(),w&&i.jsx(Y.Check,{"aria-hidden":"true",className:"text-muted-foreground shrink-0"})]})});te.displayName="ComboboxItem";const oe=e.forwardRef((t,o)=>i.jsx(O.CommandSeparator,{ref:o,"data-slot":"combobox-separator",...t}));oe.displayName="ComboboxSeparator";function me({className:t,children:o}){return i.jsx("div",{"aria-live":"polite",className:M.cn("text-muted-foreground flex items-center justify-center gap-2 py-6 text-sm",t),"data-slot":"combobox-loading",role:"status",children:o||i.jsxs(i.Fragment,{children:[i.jsx("div",{"aria-hidden":"true",className:"size-4 animate-spin rounded-full border-2 border-current border-t-transparent [animation-duration:0.6s]"}),"Loading..."]})})}exports.Combobox=ie;exports.ComboboxContent=le;exports.ComboboxEmpty=V;exports.ComboboxGroup=ee;exports.ComboboxInput=X;exports.ComboboxItem=te;exports.ComboboxList=Z;exports.ComboboxLoading=me;exports.ComboboxSeparator=oe;exports.ComboboxTrigger=Q;exports.ComboboxValue=ue;exports.ComboboxVirtualList=be;
3
+ Set shouldFilter={false} on <Combobox> for async search, or remove debounceMs for client-side filtering.`,[e,c]),U.useDevWarning(()=>!!(e&&e>0&&n.value!==void 0),"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.",[e,n.value]),t.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]);const d=t.useCallback(y=>{l(y),e&&e>0?(clearTimeout(x.current),x.current=setTimeout(()=>{r?.(y)},e)):r?.(y)},[e,r,l]);return i.jsx(_.CommandInput,{ref:o,"aria-activedescendant":a,"data-slot":"combobox-input",onValueChange:d,...n})});te.displayName="ComboboxInput";const oe=t.forwardRef(({className:e,...r},n)=>i.jsx(_.CommandList,{ref:n,className:F.cn("scrollbar min-h-0 flex-1",e),"data-slot":"combobox-list",...r}));oe.displayName="ComboboxList";function pe({items:e,getItemValue:r,getItemLabel:n,getItemKeywords:o,estimateSize:l=36,overscan:c=5,children:a,renderEmpty:x,className:d,dataHook:y},D){const h=t.useMemo(()=>ee(e,r,n),[e,r,n]),b=t.useMemo(()=>h?.getValue??(s=>{if(typeof s=="string"||typeof s=="number")return String(s);throw new Error("[BrightLocal DS] ComboboxVirtualList: `getItemValue` is required for non-primitive items without a `value` property.")}),[h]),w=t.useMemo(()=>h?.getLabel??b,[h,b]);U.useDevWarning(()=>!h&&e.length>0,"ComboboxVirtualList: could not infer `getItemValue` from item shape. Pass `getItemValue` explicitly, or use items with a `value` string property.",[h,e.length]);const v=t.useRef(null),{value:C,onValueChange:V,setOpen:k,shouldFilter:S,searchValue:I,filterFn:j,setActiveDescendantId:R,registerItemsSync:E,unregisterItem:M}=z(),[u,L]=t.useState(0),$=t.useId();t.useImperativeHandle(D,()=>v.current,[]),t.useLayoutEffect(()=>{const s=e.map(m=>[b(m),w(m)]);return E(s),()=>{for(const m of e)M(b(m))}},[e,b,w,E,M]);const f=t.useMemo(()=>{if(!S||!I.trim())return e;const s=[];for(const m of e){let g=h?.hasDistinctLabel?B.defaultFilter(w(m),I):j(b(m),I);if(o)for(const N of o(m))g=Math.max(g,B.defaultFilter(N,I));g>0&&s.push({item:m,score:g})}return s.sort((m,g)=>g.score-m.score),s.map(m=>m.item)},[e,S,I,b,w,o,j,h?.hasDistinctLabel]),P=le.useVirtualizer({count:f.length,getScrollElement:()=>v.current,estimateSize:()=>l,overscan:c}),A=u>=0&&u<f.length?b(f[u]):null;t.useEffect(()=>{L(0)},[I,f.length]);const W=t.useRef(!1);t.useEffect(()=>{if(W.current||!C)return;const s=f.findIndex(m=>b(m)===C);s>=0&&(L(s),P.scrollToIndex(s,{align:"center"}),W.current=!0)},[C,f,b,P]);const T=t.useRef(!1);t.useEffect(()=>{T.current&&u>=0&&u<f.length&&P.scrollToIndex(u,{align:"auto"}),T.current=!1},[u,f.length,P]),t.useEffect(()=>{const s=v.current?.closest('[data-slot="combobox-command"]');if(!s)return;const m=g=>{switch(g.key){case"ArrowDown":g.preventDefault(),g.stopPropagation(),T.current=!0,L(N=>N<f.length-1?N+1:N);break;case"ArrowUp":g.preventDefault(),g.stopPropagation(),T.current=!0,L(N=>N>0?N-1:N);break;case"Enter":if(g.preventDefault(),g.stopPropagation(),u>=0&&u<f.length){const N=b(f[u]);V(N===C?"":N),k(!1)}break;case"Home":g.preventDefault(),g.stopPropagation(),T.current=!0,L(0);break;case"End":g.preventDefault(),g.stopPropagation(),T.current=!0,L(f.length-1);break}};return s.addEventListener("keydown",m,{capture:!0}),()=>s.removeEventListener("keydown",m,{capture:!0})},[f,u,C,V,k,b]);const O=t.useMemo(()=>{const s=new Map;return f.forEach((m,g)=>{s.set(b(m),g)}),s},[f,b]),H=t.useCallback(s=>{const m=O.get(s);m!==void 0&&L(m)},[O]),p=t.useCallback(s=>(O.get(s)??0)+1,[O]),q=f.length,G=t.useMemo(()=>({activeValue:A,onItemPointerMove:H,idPrefix:$,filteredCount:q,getItemPosition:p}),[A,H,$,q,p]),J=A!=null?`${$}item-${A}`:void 0;return t.useEffect(()=>(R(J),()=>R(void 0)),[J,R]),f.length===0?i.jsx("div",{ref:v,className:F.cn("scrollbar max-h-[300px] min-h-0 flex-1 scroll-py-1 overflow-x-hidden overflow-y-auto py-1",d),"data-hook":y,"data-slot":"combobox-virtual-list",role:"listbox",children:x}):i.jsx(X.Provider,{value:G,children:i.jsx("div",{ref:v,className:F.cn("scrollbar max-h-[300px] min-h-0 flex-1 scroll-py-1 overflow-x-hidden overflow-y-auto py-1",d),"data-hook":y,"data-slot":"combobox-virtual-list",role:"listbox",children:i.jsx("div",{className:"relative w-full",style:{height:`${P.getTotalSize()}px`},children:P.getVirtualItems().map(s=>i.jsx("div",{ref:P.measureElement,className:"absolute top-0 left-0 w-full px-2","data-index":s.index,style:{transform:`translateY(${s.start}px)`},children:a(f[s.index],s.index,I)},s.key))})})})}const ge=t.forwardRef(pe),re=t.forwardRef((e,r)=>i.jsx(_.CommandEmpty,{ref:r,"data-slot":"combobox-empty",...e}));re.displayName="ComboboxEmpty";const ne=t.forwardRef(({children:e,...r},n)=>{const o=t.useRef(null);return U.useDevWarning(()=>o.current?o.current.querySelectorAll('[data-slot="combobox-item"]').length>=100:!1,`ComboboxGroup contains 100+ items. Use <ComboboxVirtualList> for large datasets to avoid DOM bloat and slow renders.
4
+ Import: import { ComboboxVirtualList } from "@brightlocal/ui-components/combobox"`,[e]),i.jsx(_.CommandGroup,{ref:l=>{o.current=l,typeof n=="function"?n(l):n&&(n.current=l)},"data-slot":"combobox-group",...r,children:e})});ne.displayName="ComboboxGroup";function he(e,r,n){if(!r||!r.trim())return e;const o=new RegExp(`(${r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")})`,"gi"),l=e.split(o);return i.jsx("span",{children:l.map((c,a)=>a%2===1?i.jsx("span",{className:n,children:c},a):i.jsx(t.Fragment,{children:c},a))})}const se=t.forwardRef(({value:e,label:r,dataHook:n,children:o,className:l,highlight:c,highlightClassName:a,keywords:x,...d},y)=>{const{value:D,onValueChange:h,setOpen:b,registerItem:w,unregisterItem:v}=z(),C=t.useContext(X),V=D===e,k=t.useMemo(()=>r||(typeof o=="string"?o:typeof o=="number"?String(o):e),[r,o,e]),S=t.useRef(w),I=t.useRef(v);t.useEffect(()=>{S.current=w,I.current=v},[w,v]);const j=!!C;t.useEffect(()=>{if(!j)return S.current(e,k),()=>I.current(e)},[e,k,j]);const R=()=>{h(e===D?"":e),b(!1)},E=()=>c&&typeof o=="string"?he(o,c,a||"text-sm leading-normal font-semibold"):o;if(C){const M=C.activeValue===e,u=!!d.disabled;return i.jsxs("div",{ref:y,"aria-disabled":u||void 0,"aria-posinset":C.getItemPosition(e),"aria-selected":V,"aria-setsize":C.filteredCount,className:F.cn("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","[&_svg]:pointer-events-none [&_svg]:shrink-0",u&&"pointer-events-none opacity-50",l),"data-highlighted":M||void 0,"data-hook":n,"data-slot":"combobox-item",id:`${C.idPrefix}item-${e}`,role:"option",tabIndex:-1,onClick:u?void 0:R,onKeyDown:u?void 0:L=>{(L.key==="Enter"||L.key===" ")&&R()},onPointerMove:u?void 0:()=>C.onItemPointerMove(e),children:[E(),V&&i.jsx(K.Check,{"aria-hidden":"true",className:"text-muted-foreground shrink-0"})]})}return i.jsxs(_.CommandItem,{ref:y,className:F.cn("justify-between",l),"data-slot":"combobox-item",dataHook:n,keywords:x?[k,...x]:[k],value:e,onSelect:R,...d,children:[E(),V&&i.jsx(K.Check,{"aria-hidden":"true",className:"text-muted-foreground shrink-0"})]})});se.displayName="ComboboxItem";const ae=t.forwardRef((e,r)=>i.jsx(_.CommandSeparator,{ref:r,"data-slot":"combobox-separator",...e}));ae.displayName="ComboboxSeparator";function ve({className:e,children:r}){return i.jsx("div",{"aria-live":"polite",className:F.cn("text-muted-foreground flex items-center justify-center gap-2 py-6 text-sm",e),"data-slot":"combobox-loading",role:"status",children:r||i.jsxs(i.Fragment,{children:[i.jsx("div",{"aria-hidden":"true",className:"size-4 animate-spin rounded-full border-2 border-current border-t-transparent [animation-duration:0.6s]"}),"Loading..."]})})}exports.Combobox=de;exports.ComboboxContent=xe;exports.ComboboxEmpty=re;exports.ComboboxGroup=ne;exports.ComboboxInput=te;exports.ComboboxItem=se;exports.ComboboxList=oe;exports.ComboboxLoading=ve;exports.ComboboxSeparator=ae;exports.ComboboxTrigger=Z;exports.ComboboxValue=me;exports.ComboboxVirtualList=ge;
@@ -109,7 +109,7 @@ export interface ComboboxValueProps<T = unknown> {
109
109
  * ```
110
110
  */
111
111
  items?: readonly T[];
112
- /** Extract the value string from an item. Required when `items` is provided. */
112
+ /** Extract the value string from an item. Auto-inferred for items with a `value` string property. */
113
113
  getItemValue?: (item: T) => string;
114
114
  /** Extract the display label from an item. Falls back to `getItemValue` when not provided. */
115
115
  getItemLabel?: (item: T) => string;
@@ -161,8 +161,8 @@ declare const ComboboxList: React.ForwardRefExoticComponent<Omit<Omit<import('@b
161
161
  export interface ComboboxVirtualListProps<T> {
162
162
  /** Array of items to virtualise. Memoize with useMemo to avoid re-registering labels on every render. */
163
163
  items: readonly T[];
164
- /** Extract the string value for each item (used for selection and keyboard navigation) */
165
- getItemValue: (item: T) => string;
164
+ /** Extract the string value for each item (used for selection and keyboard navigation). Auto-inferred for items with a `value` string property. */
165
+ getItemValue?: (item: T) => string;
166
166
  /**
167
167
  * Extract a display label for filtering and trigger display. Defaults to `getItemValue`.
168
168
  * Only used when `shouldFilter` is true on the parent Combobox.
@@ -1 +1 @@
1
- {"version":3,"file":"combobox.d.ts","sourceRoot":"","sources":["../../src/components/combobox.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAa/B,OAAO,EAEL,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,WAAW,EACX,WAAW,EACX,gBAAgB,EACjB,MAAM,oCAAoC,CAAC;AA0E5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,MAAM,WAAW,aAAa;IAC5B,gCAAgC;IAChC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,kCAAkC;IAClC,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,4BAA4B;IAC5B,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,uCAAuC;IACvC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,qBAAqB;IACrB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,kHAAkH;IAClH,iBAAiB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9C,eAAe;IACf,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,iBAAS,QAAQ,CAAC,EAChB,KAAK,EAAE,eAAe,EACtB,aAAa,EAAE,uBAAuB,EACtC,IAA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