laif-ds 0.1.86 → 0.1.89

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.
@@ -1,12 +1,12 @@
1
1
  "use client";
2
- import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
3
3
  import * as x from "react";
4
4
  import { cva as g } from "../../node_modules/class-variance-authority/dist/index.js";
5
- import { cn as a } from "../../lib/utils.js";
5
+ import { cn as s } from "../../lib/utils.js";
6
6
  import { Label as v } from "./label.js";
7
7
  import { Icon as l } from "./icon.js";
8
8
  const b = g(
9
- "file:text-d-foreground placeholder:text-d-muted-foreground selection:bg-d-primary selection:text-d-primary-foreground border-d-input flex w-full min-w-0 rounded-md border bg-d-input px-3 py-1 text-base shadow-sm transition-colors outline-none file:inline-flex file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
9
+ "file:text-d-foreground placeholder:text-d-muted-foreground selection:bg-d-primary selection:text-d-primary-foreground border-d-input flex w-full min-w-0 rounded-md border bg-d-input px-3 py-1 text-base shadow-sm transition-all duration-200 outline-none file:inline-flex file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:cursor-not-allowed disabled:opacity-50 md:text-sm hover:shadow-md",
10
10
  {
11
11
  variants: {
12
12
  size: {
@@ -27,14 +27,14 @@ const b = g(
27
27
  labelClassName: u,
28
28
  id: p,
29
29
  iconLeft: i,
30
- iconRight: s,
30
+ iconRight: d,
31
31
  size: t,
32
32
  ...f
33
33
  }, c) => {
34
34
  const n = p || (r ? `input-${Math.random().toString(36).substring(2, 9)}` : void 0);
35
- return /* @__PURE__ */ d("div", { className: a("space-y-1.5", o), children: [
35
+ return /* @__PURE__ */ a("div", { className: s("space-y-1.5", o), children: [
36
36
  r && /* @__PURE__ */ e(v, { htmlFor: n, className: u, children: r }),
37
- /* @__PURE__ */ d("div", { className: "relative w-full", children: [
37
+ /* @__PURE__ */ a("div", { className: "relative w-full", children: [
38
38
  i && /* @__PURE__ */ e("div", { className: "text-d-muted-foreground pointer-events-none absolute top-1/2 left-3 -translate-y-1/2", children: /* @__PURE__ */ e(l, { name: i, size: t === "lg" ? "sm" : "xs" }) }),
39
39
  /* @__PURE__ */ e(
40
40
  "input",
@@ -42,19 +42,18 @@ const b = g(
42
42
  id: n,
43
43
  type: m,
44
44
  "data-slot": "input",
45
- className: a(
45
+ className: s(
46
46
  b({ size: t }),
47
- "focus-visible:ring-ring focus-visible:ring-1 focus-visible:outline-none",
47
+ "focus-visible:ring-d-ring focus-visible:ring-1 focus-visible:outline-none",
48
48
  "aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive",
49
- "shadow-sm",
50
49
  i ? t !== "lg" ? "pl-9" : "pl-10" : "",
51
- s ? t !== "lg" ? "pr-9" : "pr-10" : ""
50
+ d ? t !== "lg" ? "pr-9" : "pr-10" : ""
52
51
  ),
53
52
  ref: c,
54
53
  ...f
55
54
  }
56
55
  ),
57
- s && /* @__PURE__ */ e("div", { className: "text-d-muted-foreground pointer-events-none absolute top-1/2 right-3 -translate-y-1/2", children: /* @__PURE__ */ e(l, { name: s, size: t === "lg" ? "sm" : "xs" }) })
56
+ d && /* @__PURE__ */ e("div", { className: "text-d-muted-foreground pointer-events-none absolute top-1/2 right-3 -translate-y-1/2", children: /* @__PURE__ */ e(l, { name: d, size: t === "lg" ? "sm" : "xs" }) })
58
57
  ] })
59
58
  ] });
60
59
  }
@@ -1,366 +1,380 @@
1
1
  "use client";
2
- import { jsx as o, jsxs as L, Fragment as K } from "react/jsx-runtime";
3
- import { Command as ie, useCommandState as de } from "../../node_modules/cmdk/dist/index.js";
4
- import * as d from "react";
5
- import { useEffect as C, forwardRef as ue } from "react";
6
- import { CommandPortal as ae } from "./command-portal.js";
7
- import { Badge as ce } from "./badge.js";
8
- import { CommandItem as V, Command as fe, CommandList as me, CommandGroup as ge } from "./command.js";
9
- import { cn as h } from "../../lib/utils.js";
10
- import { Label as he } from "./label.js";
11
- import q from "../../node_modules/lucide-react/dist/esm/icons/x.js";
12
- function ve(r, s) {
13
- const [l, a] = d.useState(r);
2
+ import { jsx as r, jsxs as L, Fragment as G } from "react/jsx-runtime";
3
+ import { Command as ae, useCommandState as ce } from "../../node_modules/cmdk/dist/index.js";
4
+ import * as o from "react";
5
+ import { useEffect as C, forwardRef as fe } from "react";
6
+ import { Popover as me, PopoverTrigger as ge, PopoverContent as he } from "./popover.js";
7
+ import { Badge as pe } from "./badge.js";
8
+ import { CommandItem as I, Command as q, CommandList as ve, CommandGroup as be } from "./command.js";
9
+ import { cn as p } from "../../lib/utils.js";
10
+ import { Label as we } from "./label.js";
11
+ import { Icon as xe } from "./icon.js";
12
+ import Ne from "../../node_modules/lucide-react/dist/esm/icons/x.js";
13
+ function ye(s, l) {
14
+ const [i, a] = o.useState(s);
14
15
  return C(() => {
15
- const u = setTimeout(() => a(r), s);
16
+ const u = setTimeout(() => a(s), l);
16
17
  return () => {
17
18
  clearTimeout(u);
18
19
  };
19
- }, [r, s]), l;
20
+ }, [s, l]), i;
20
21
  }
21
- function I(r, s) {
22
- if (r.length === 0)
22
+ function T(s, l) {
23
+ if (s.length === 0)
23
24
  return {};
24
- if (!s)
25
+ if (!l)
25
26
  return {
26
- "": r
27
+ "": s
27
28
  };
28
- const l = {};
29
- return r.forEach((a) => {
30
- const u = a[s] || "";
31
- l[u] || (l[u] = []), l[u].push(a);
32
- }), l;
29
+ const i = {};
30
+ return s.forEach((a) => {
31
+ const u = a[l] || "";
32
+ i[u] || (i[u] = []), i[u].push(a);
33
+ }), i;
33
34
  }
34
- function pe(r, s) {
35
- const l = JSON.parse(JSON.stringify(r));
36
- for (const [a, u] of Object.entries(l))
37
- l[a] = u.filter(
38
- (F) => !s.find((c) => c.value === F.value)
35
+ function Ce(s, l) {
36
+ const i = JSON.parse(JSON.stringify(s));
37
+ for (const [a, u] of Object.entries(i))
38
+ i[a] = u.filter(
39
+ (V) => !l.find((c) => c.value === V.value)
39
40
  );
40
- return l;
41
+ return i;
41
42
  }
42
- function be(r, s) {
43
- for (const [, l] of Object.entries(r))
44
- if (l.some((a) => s.find((u) => u.value === a.value)))
43
+ function Ee(s, l) {
44
+ for (const [, i] of Object.entries(s))
45
+ if (i.some((a) => l.find((u) => u.value === a.value)))
45
46
  return !0;
46
47
  return !1;
47
48
  }
48
- const Q = ue(({ className: r, ...s }, l) => de((u) => u.filtered.count === 0) ? /* @__PURE__ */ o(
49
+ const Q = fe(({ className: s, ...l }, i) => ce((u) => u.filtered.count === 0) ? /* @__PURE__ */ r(
49
50
  "div",
50
51
  {
51
- ref: l,
52
- className: h("py-6 text-center text-sm", r),
52
+ ref: i,
53
+ className: p("py-6 text-center text-sm", s),
53
54
  "cmdk-empty": "",
54
55
  role: "presentation",
55
- ...s
56
+ ...l
56
57
  }
57
58
  ) : null);
58
59
  Q.displayName = "CommandEmpty";
59
- const xe = d.forwardRef(
60
+ const Oe = o.forwardRef(
60
61
  ({
61
- value: r,
62
- onChange: s,
63
- placeholder: l,
62
+ value: s,
63
+ onChange: l,
64
+ placeholder: i,
64
65
  defaultOptions: a = [],
65
66
  options: u,
66
- delay: F,
67
+ delay: V,
67
68
  onSearch: c,
68
- onSearchSync: G,
69
+ onSearchSync: X,
69
70
  loadingIndicator: Y,
70
71
  emptyIndicator: D,
71
72
  maxSelected: _ = Number.MAX_SAFE_INTEGER,
72
- onMaxSelected: z,
73
- hidePlaceholderWhenSelected: A,
74
- disabled: v,
75
- groupBy: p,
73
+ onMaxSelected: A,
74
+ hidePlaceholderWhenSelected: U,
75
+ disabled: N,
76
+ groupBy: v,
76
77
  className: Z,
77
- badgeClassName: W,
78
- selectFirstItem: B = !0,
79
- creatable: k = !1,
80
- triggerSearchOnFocus: S = !1,
78
+ badgeClassName: B,
79
+ selectFirstItem: P = !0,
80
+ creatable: E = !1,
81
+ triggerSearchOnFocus: R = !1,
81
82
  commandProps: m,
82
- inputProps: E,
83
- hideClearAllButton: P = !1,
84
- label: U
85
- }, ee) => {
86
- const f = d.useRef(null), [b, M] = d.useState(!1), [te, X] = d.useState(!1), [H, $] = d.useState(!1), R = d.useRef(null), [t, N] = d.useState(r || []), [x, T] = d.useState(
87
- I(a, p)
88
- ), [g, J] = d.useState(""), w = ve(g, F || 500);
89
- d.useImperativeHandle(
90
- ee,
83
+ inputProps: O,
84
+ hideClearAllButton: ee = !1,
85
+ label: W
86
+ }, te) => {
87
+ const g = o.useRef(null), [f, S] = o.useState(!1), [ne, z] = o.useState(!1), [H, $] = o.useState(!1), [re, oe] = o.useState(
88
+ void 0
89
+ ), j = o.useRef(null), F = o.useRef(null), [t, y] = o.useState(s || []), [b, J] = o.useState(
90
+ T(a, v)
91
+ ), [h, K] = o.useState(""), w = ye(h, V || 500);
92
+ o.useImperativeHandle(
93
+ te,
91
94
  () => ({
92
95
  selectedValue: [...t],
93
- input: f.current,
94
- focus: () => f?.current?.focus(),
95
- reset: () => N([])
96
+ input: g.current,
97
+ focus: () => g?.current?.focus(),
98
+ reset: () => y([])
96
99
  }),
97
100
  [t]
98
101
  );
99
- const y = (e) => {
100
- R.current && !R.current.contains(e.target) && f.current && !f.current.contains(e.target) && (M(!1), f.current.blur());
101
- }, j = d.useCallback(
102
+ const x = (e) => {
103
+ j.current && !j.current.contains(e.target) && g.current && !g.current.contains(e.target) && (S(!1), g.current.blur());
104
+ }, M = o.useCallback(
102
105
  (e) => {
103
- const n = t.filter((i) => i.value !== e.value);
104
- N(n), s?.(n);
106
+ const n = t.filter((d) => d.value !== e.value);
107
+ y(n), l?.(n);
105
108
  },
106
- [s, t]
107
- ), ne = d.useCallback(
109
+ [l, t]
110
+ ), se = o.useCallback(
108
111
  (e) => {
109
- const n = f.current;
110
- n && ((e.key === "Delete" || e.key === "Backspace") && n.value === "" && t.length > 0 && (t[t.length - 1].fixed || j(t[t.length - 1])), e.key === "Escape" && n.blur());
112
+ const n = g.current;
113
+ n && ((e.key === "Delete" || e.key === "Backspace") && n.value === "" && t.length > 0 && (t[t.length - 1].fixed || M(t[t.length - 1])), e.key === "Escape" && n.blur());
111
114
  },
112
- [j, t]
115
+ [M, t]
113
116
  );
114
117
  C(() => {
115
118
  if (typeof document < "u")
116
- return b ? (document.addEventListener("mousedown", y), document.addEventListener("touchend", y)) : (document.removeEventListener("mousedown", y), document.removeEventListener("touchend", y)), () => {
117
- document.removeEventListener("mousedown", y), document.removeEventListener("touchend", y);
119
+ return f ? (document.addEventListener("mousedown", x), document.addEventListener("touchend", x)) : (document.removeEventListener("mousedown", x), document.removeEventListener("touchend", x)), () => {
120
+ document.removeEventListener("mousedown", x), document.removeEventListener("touchend", x);
118
121
  };
119
- }, [b, y]), C(() => {
120
- r && N(r);
121
- }, [r]), C(() => {
122
+ }, [f, x]), C(() => {
123
+ s && y(s);
124
+ }, [s]), C(() => {
122
125
  if (!u || c)
123
126
  return;
124
- const e = I(u || [], p);
125
- JSON.stringify(e) !== JSON.stringify(x) && T(e);
126
- }, [a, u, p, c, x]), C(() => {
127
+ const e = T(u || [], v);
128
+ JSON.stringify(e) !== JSON.stringify(b) && J(e);
129
+ }, [a, u, v, c, b]), C(() => {
127
130
  const e = () => {
128
- const i = G?.(w);
129
- T(I(i || [], p));
131
+ const d = X?.(w);
132
+ J(T(d || [], v));
130
133
  };
131
134
  (async () => {
132
- !G || !b || (S && e(), w && e());
135
+ !X || !f || (R && e(), w && e());
133
136
  })();
134
- }, [w, p, b, S]), C(() => {
137
+ }, [w, v, f, R]), C(() => {
135
138
  const e = async () => {
136
139
  $(!0);
137
- const i = await c?.(w);
138
- T(I(i || [], p)), $(!1);
140
+ const d = await c?.(w);
141
+ J(T(d || [], v)), $(!1);
139
142
  };
140
143
  (async () => {
141
- !c || !b || (S && await e(), w && await e());
144
+ !c || !f || (R && await e(), w && await e());
142
145
  })();
143
- }, [w, p, b, S]);
144
- const re = () => {
145
- if (!k || be(x, [{ value: g, label: g }]) || t.find((n) => n.value === g))
146
+ }, [w, v, f, R]), o.useEffect(() => {
147
+ if (f && F.current) {
148
+ const e = F.current.getBoundingClientRect();
149
+ oe(e.width);
150
+ }
151
+ }, [f]);
152
+ const le = () => {
153
+ if (!E || Ee(b, [{ value: h, label: h }]) || t.find((n) => n.value === h))
146
154
  return;
147
- const e = /* @__PURE__ */ o(
148
- V,
155
+ const e = /* @__PURE__ */ r(
156
+ I,
149
157
  {
150
- value: g,
158
+ value: h,
151
159
  className: "cursor-pointer",
152
160
  onMouseDown: (n) => {
153
161
  n.preventDefault(), n.stopPropagation();
154
162
  },
155
163
  onSelect: (n) => {
156
164
  if (t.length >= _) {
157
- z?.(t.length);
165
+ A?.(t.length);
158
166
  return;
159
167
  }
160
- J("");
161
- const i = [...t, { value: n, label: n }];
162
- N(i), s?.(i);
168
+ K("");
169
+ const d = [...t, { value: n, label: n }];
170
+ y(d), l?.(d);
163
171
  },
164
- children: `Create "${g}"`
172
+ children: `Create "${h}"`
165
173
  }
166
174
  );
167
- if (!c && g.length > 0 || c && w.length > 0 && !H)
175
+ if (!c && h.length > 0 || c && w.length > 0 && !H)
168
176
  return e;
169
- }, oe = d.useCallback(() => {
177
+ }, ie = o.useCallback(() => {
170
178
  if (D)
171
- return c && !k && Object.keys(x).length === 0 ? /* @__PURE__ */ o(V, { value: "-", disabled: !0, children: D }) : /* @__PURE__ */ o(Q, { children: D });
172
- }, [k, D, c, x]), se = d.useMemo(
173
- () => pe(x, t),
174
- [x, t]
175
- ), le = d.useCallback(() => {
179
+ return c && !E && Object.keys(b).length === 0 ? /* @__PURE__ */ r(I, { value: "-", disabled: !0, children: D }) : /* @__PURE__ */ r(Q, { children: D });
180
+ }, [E, D, c, b]), de = o.useMemo(
181
+ () => Ce(b, t),
182
+ [b, t]
183
+ ), ue = o.useCallback(() => {
176
184
  if (m?.filter)
177
185
  return m.filter;
178
- if (k)
186
+ if (E)
179
187
  return (e, n) => e.toLowerCase().includes(n.toLowerCase()) ? 1 : -1;
180
- }, [k, m?.filter]);
188
+ }, [E, m?.filter]);
181
189
  return /* @__PURE__ */ L("div", { className: "flex flex-col space-y-1.5", children: [
182
- U && /* @__PURE__ */ o(he, { children: U }),
183
- /* @__PURE__ */ L(
184
- fe,
190
+ W && /* @__PURE__ */ r(we, { children: W }),
191
+ /* @__PURE__ */ r(
192
+ q,
185
193
  {
186
- ref: R,
194
+ ref: j,
187
195
  ...m,
188
196
  onKeyDown: (e) => {
189
- ne(e), m?.onKeyDown?.(e);
197
+ se(e), m?.onKeyDown?.(e);
190
198
  },
191
- className: h(
192
- "bg-d-input h-auto overflow-visible shadow-sm",
199
+ className: p(
200
+ "bg-d-input border-d-border h-auto overflow-visible shadow-sm",
193
201
  m?.className
194
202
  ),
195
203
  shouldFilter: m?.shouldFilter !== void 0 ? m.shouldFilter : !c,
196
- filter: le(),
197
- children: [
198
- /* @__PURE__ */ o(
204
+ filter: ue(),
205
+ children: /* @__PURE__ */ L(me, { open: f, onOpenChange: S, children: [
206
+ /* @__PURE__ */ r(ge, { asChild: !0, children: /* @__PURE__ */ r(
199
207
  "div",
200
208
  {
201
- className: h(
202
- "border-d-input ring-offset-d-background focus-within:ring-d-ring min-h-10 rounded-md border text-base focus-within:ring-1 md:text-sm",
209
+ ref: F,
210
+ className: p(
211
+ "border-d-input ring-offset-d-background min-h-10 rounded-md border text-base md:text-sm",
212
+ "focus-within:outline-none",
213
+ "focus-visible-within:ring-d-ring focus-visible-within:ring-1",
214
+ f && "ring-d-ring ring-1",
203
215
  {
204
216
  "px-3 py-2": t.length !== 0,
205
- "cursor-text": !v && t.length !== 0,
206
- "disabled:cursor-not-allowed disabled:opacity-50": v
217
+ "cursor-text": !N && t.length !== 0,
218
+ "disabled:cursor-not-allowed disabled:opacity-50": N
207
219
  },
208
220
  Z
209
221
  ),
210
- onClick: () => {
211
- v || f?.current?.focus();
212
- },
213
222
  children: /* @__PURE__ */ L("div", { className: "relative flex flex-wrap gap-1", children: [
214
223
  t.map((e) => /* @__PURE__ */ L(
215
- ce,
224
+ pe,
216
225
  {
217
- className: h(
226
+ className: p(
218
227
  "data-[disabled]:bg-d-secondary-foreground data-[disabled]:text-d-secondary data-[disabled]:hover:bg-d-secondary-foreground",
219
228
  "data-[fixed]:bg-d-secondary-foreground data-[fixed]:text-d-secondary data-[fixed]:hover:bg-d-secondary-foreground",
220
- W
229
+ B
221
230
  ),
222
231
  "data-fixed": e.fixed,
223
- "data-disabled": v || void 0,
232
+ "data-disabled": N || void 0,
224
233
  children: [
225
234
  e.label,
226
- /* @__PURE__ */ o(
235
+ /* @__PURE__ */ r(
227
236
  "button",
228
237
  {
229
238
  type: "button",
230
- className: h(
239
+ className: p(
231
240
  "text-d-secondary-foreground ring-offset-d-background focus:ring-d-ring ml-1 rounded-full outline-none focus:ring-1 focus:ring-offset-2",
232
- (v || e.fixed) && "hidden"
241
+ (N || e.fixed) && "hidden"
233
242
  ),
234
243
  onKeyDown: (n) => {
235
- n.key === "Enter" && j(e);
244
+ n.key === "Enter" && M(e);
236
245
  },
237
246
  onMouseDown: (n) => {
238
247
  n.preventDefault(), n.stopPropagation();
239
248
  },
240
- onClick: () => j(e),
241
- children: /* @__PURE__ */ o(q, { className: "text-d-secondary-foreground hover:text-d-foreground h-3 w-3" })
249
+ onClick: () => M(e),
250
+ children: /* @__PURE__ */ r(Ne, { className: "text-d-secondary-foreground hover:text-d-foreground h-3 w-3 cursor-pointer" })
242
251
  }
243
252
  )
244
253
  ]
245
254
  },
246
255
  e.value
247
256
  )),
248
- /* @__PURE__ */ o(
249
- ie.Input,
257
+ /* @__PURE__ */ r(
258
+ ae.Input,
250
259
  {
251
- ...E,
252
- ref: f,
253
- value: g,
254
- disabled: v,
260
+ ...O,
261
+ ref: g,
262
+ value: h,
263
+ disabled: N,
255
264
  onValueChange: (e) => {
256
- J(e), E?.onValueChange?.(e);
265
+ K(e), O?.onValueChange?.(e);
257
266
  },
258
267
  onBlur: (e) => {
259
- te || M(!1), E?.onBlur?.(e);
268
+ ne || S(!1), O?.onBlur?.(e);
260
269
  },
261
270
  onFocus: (e) => {
262
- M(!0), E?.onFocus?.(e);
271
+ S(!0), O?.onFocus?.(e);
263
272
  },
264
- placeholder: A && t.length !== 0 ? "" : l,
265
- className: h(
273
+ placeholder: U && t.length !== 0 ? "" : i,
274
+ className: p(
266
275
  "placeholder:text-d-muted-foreground flex-1 bg-transparent outline-none",
267
276
  {
268
- "w-full": A,
277
+ "w-full": U,
269
278
  "px-3 py-2": t.length === 0,
270
279
  "ml-1": t.length !== 0
271
280
  },
272
- E?.className
281
+ O?.className
273
282
  )
274
283
  }
275
284
  ),
276
- /* @__PURE__ */ o(
285
+ /* @__PURE__ */ r(
277
286
  "div",
278
287
  {
279
- className: h(
280
- "bg-d-secondary/20 hover:bg-d-secondary/30 absolute top-0 right-0 z-20 flex cursor-pointer items-center justify-center rounded-full border p-1",
281
- (P || v || t.length < 1 || t.filter((e) => e.fixed).length === t.length) && "hidden"
288
+ className: p(
289
+ "border-d-input bg-d-accent cursor-pointer rounded-full p-1",
290
+ (ee || N || t.length < 1 || t.filter((e) => e.fixed).length === t.length) && "hidden"
282
291
  ),
283
292
  onClick: () => {
284
- N(t.filter((e) => e.fixed)), s?.(t.filter((e) => e.fixed));
293
+ y(t.filter((e) => e.fixed)), l?.(t.filter((e) => e.fixed));
285
294
  },
286
295
  "aria-label": "Clear selection",
287
- children: /* @__PURE__ */ o(q, { size: 12, className: "text-d-foreground" })
296
+ children: /* @__PURE__ */ r(
297
+ xe,
298
+ {
299
+ name: "X",
300
+ size: "xs",
301
+ className: "!text-d-foreground opacity-50"
302
+ }
303
+ )
288
304
  }
289
305
  )
290
306
  ] })
291
307
  }
292
- ),
293
- /* @__PURE__ */ o(
294
- ae,
308
+ ) }),
309
+ /* @__PURE__ */ r(
310
+ he,
295
311
  {
296
- open: b,
297
- triggerRef: R,
298
- onClose: () => {
299
- M(!1), f.current?.blur();
300
- },
301
- children: /* @__PURE__ */ o(
302
- me,
312
+ className: "border-none p-0 shadow-lg",
313
+ style: { width: re },
314
+ onWheel: (e) => e.stopPropagation(),
315
+ children: /* @__PURE__ */ r(q, { shouldFilter: !1, className: "w-full", children: /* @__PURE__ */ r(
316
+ ve,
303
317
  {
304
318
  className: "bg-d-popover text-d-popover-foreground animate-in border-d-border w-full rounded-md border shadow-md outline-none",
305
319
  onMouseLeave: () => {
306
- X(!1);
320
+ z(!1);
307
321
  },
308
322
  onMouseEnter: () => {
309
- X(!0);
323
+ z(!0);
310
324
  },
311
325
  onMouseUp: () => {
312
- f?.current?.focus();
326
+ g?.current?.focus();
313
327
  },
314
- children: H ? /* @__PURE__ */ o(K, { children: Y }) : /* @__PURE__ */ L(K, { children: [
315
- oe(),
316
- re(),
317
- !B && /* @__PURE__ */ o(V, { value: "-", className: "hidden" }),
318
- Object.entries(se).map(([e, n]) => /* @__PURE__ */ o(
319
- ge,
328
+ children: H ? /* @__PURE__ */ r(G, { children: Y }) : /* @__PURE__ */ L(G, { children: [
329
+ ie(),
330
+ le(),
331
+ !P && /* @__PURE__ */ r(I, { value: "-", className: "hidden" }),
332
+ Object.entries(de).map(([e, n]) => /* @__PURE__ */ r(
333
+ be,
320
334
  {
321
335
  heading: e,
322
336
  className: "h-full overflow-auto",
323
- children: /* @__PURE__ */ o(K, { children: n.map((i) => /* @__PURE__ */ o(
324
- V,
337
+ children: /* @__PURE__ */ r(G, { children: n.map((d) => /* @__PURE__ */ r(
338
+ I,
325
339
  {
326
- value: i.label,
327
- disabled: i.disable,
328
- onMouseDown: (O) => {
329
- O.preventDefault(), O.stopPropagation();
340
+ value: d.label,
341
+ disabled: d.disable,
342
+ onMouseDown: (k) => {
343
+ k.preventDefault(), k.stopPropagation();
330
344
  },
331
345
  onSelect: () => {
332
346
  if (t.length >= _) {
333
- z?.(t.length);
347
+ A?.(t.length);
334
348
  return;
335
349
  }
336
- J("");
337
- const O = [...t, i];
338
- N(O), s?.(O);
350
+ K("");
351
+ const k = [...t, d];
352
+ y(k), l?.(k);
339
353
  },
340
- className: h(
354
+ className: p(
341
355
  "cursor-pointer",
342
- i.disable && "text-d-secondary-foreground cursor-default"
356
+ d.disable && "text-d-secondary-foreground cursor-default"
343
357
  ),
344
- children: i.label
358
+ children: d.label
345
359
  },
346
- i.value
360
+ d.value
347
361
  )) })
348
362
  },
349
363
  e
350
364
  ))
351
365
  ] })
352
366
  }
353
- )
367
+ ) })
354
368
  }
355
369
  )
356
- ]
370
+ ] })
357
371
  }
358
372
  )
359
373
  ] });
360
374
  }
361
375
  );
362
- xe.displayName = "MultipleSelector";
376
+ Oe.displayName = "MultipleSelector";
363
377
  export {
364
- xe as MultipleSelector,
365
- ve as useDebounce
378
+ Oe as MultipleSelector,
379
+ ye as useDebounce
366
380
  };