laif-ds 0.2.47 → 0.2.48

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 (35) hide show
  1. package/dist/_virtual/index2.js +2 -5
  2. package/dist/_virtual/index3.js +5 -2
  3. package/dist/agent-docs/components/AppForm.md +66 -1
  4. package/dist/agent-docs/components/AsyncSelect.md +94 -103
  5. package/dist/components/kanban.js +540 -0
  6. package/dist/components/ui/app-form.js +76 -44
  7. package/dist/components/ui/app-kanban.js +137 -0
  8. package/dist/components/ui/app-select.js +100 -87
  9. package/dist/components/ui/async-select.js +264 -278
  10. package/dist/index.d.ts +81 -29
  11. package/dist/index.js +77 -75
  12. package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +1 -1
  13. package/dist/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/dist/index.js +12 -0
  14. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +1 -1
  15. package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  16. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +1 -1
  17. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  18. package/dist/node_modules/@radix-ui/react-menu/dist/index.js +1 -1
  19. package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  20. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +1 -1
  21. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  22. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +1 -1
  23. package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  24. package/dist/node_modules/@radix-ui/react-select/dist/index.js +1 -1
  25. package/dist/node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
  26. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +47 -44
  27. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +1 -1
  28. package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.js +12 -0
  29. package/dist/node_modules/eventemitter3/index.js +1 -1
  30. package/dist/node_modules/recharts/es6/util/Events.js +1 -1
  31. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +536 -502
  32. package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
  33. package/dist/styles.css +1 -1
  34. package/dist/styles.v3.css +1 -1
  35. package/package.json +4 -4
@@ -1,18 +1,18 @@
1
1
  "use client";
2
- import { jsxs as d, jsx as e } from "react/jsx-runtime";
3
- import * as A from "react";
4
- import { useState as N, useEffect as j, useCallback as $ } from "react";
5
- import { useDebounce as ae } from "../../hooks/use-debounce.js";
6
- import { cva as ce } from "../../node_modules/class-variance-authority/dist/index.js";
7
- import { cn as L } from "../../lib/utils.js";
8
- import { Label as le } from "./label.js";
9
- import { Popover as ie, PopoverTrigger as de, PopoverContent as fe } from "./popover.js";
10
- import { Command as me, CommandInput as ue, CommandList as he, CommandEmpty as pe, CommandGroup as q, CommandItem as H } from "./command.js";
11
- import { Icon as X } from "./icon.js";
12
- import { Checkbox as ge } from "./checkbox.js";
13
- import xe from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
14
- import we from "../../node_modules/lucide-react/dist/esm/icons/check.js";
15
- const ye = ce(
2
+ import { jsxs as u, jsx as r } from "react/jsx-runtime";
3
+ import { useDebounce as le } from "../../hooks/use-debounce.js";
4
+ import { cva as de } from "../../node_modules/class-variance-authority/dist/index.js";
5
+ import * as S from "react";
6
+ import { useState as p, useEffect as N, useCallback as j } from "react";
7
+ import { cn as v } from "../../lib/utils.js";
8
+ import { Checkbox as ie } from "./checkbox.js";
9
+ import { Command as fe, CommandInput as me, CommandList as ue, CommandEmpty as he, CommandGroup as _, CommandItem as O } from "./command.js";
10
+ import { Icon as Z } from "./icon.js";
11
+ import { Label as ge } from "./label.js";
12
+ import { Popover as pe, PopoverTrigger as xe, PopoverContent as we } from "./popover.js";
13
+ import ye from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
14
+ import Ne from "../../node_modules/lucide-react/dist/esm/icons/check.js";
15
+ const be = de(
16
16
  "flex items-center justify-between whitespace-nowrap rounded-md border border-d-input bg-d-input px-3 py-2 data-[placeholder]:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 ",
17
17
  {
18
18
  variants: {
@@ -27,317 +27,303 @@ const ye = ce(
27
27
  }
28
28
  }
29
29
  );
30
- function De({
31
- fetcher: a,
32
- preload: c,
33
- filterFn: f,
34
- renderOption: k,
35
- getOptionValue: m,
36
- getDisplayValue: s,
37
- notFound: u,
38
- loadingSkeleton: M,
39
- label: h,
40
- labelClassName: p,
41
- placeholder: _ = "Select...",
42
- value: r,
43
- onChange: i,
44
- disabled: T = !1,
45
- width: x = "200px",
46
- triggerClassName: z,
47
- noResultsMessage: D,
48
- clearable: b = !0,
30
+ function Ie({
31
+ fetcher: i,
32
+ initialOptions: t,
33
+ debounce: x = 300,
34
+ renderOptionItem: b,
35
+ resolveOptionValue: a,
36
+ renderSelectedValue: s,
37
+ notFound: h,
38
+ label: y,
39
+ placeholder: f = "Select...",
40
+ value: n,
41
+ onChange: g,
42
+ disabled: C = !1,
43
+ className: D,
44
+ wrpClassName: T,
45
+ noResultsMessage: z,
46
+ clearable: A = !0,
49
47
  multiple: l = !1,
50
- size: J
48
+ size: V
51
49
  }) {
52
- const [g, O] = N(!1), C = x === "auto", P = A.useRef(null), E = A.useRef(null), Q = A.useRef(null), Y = A.useRef(null), [Z, v] = N({ loading: !1, error: null }), [K, V] = N(""), S = ae(K, c ? 0 : 300), [I, F] = N(/* @__PURE__ */ new Map()), [w, R] = N([]), [B, ee] = N(
53
- void 0
54
- ), [G, ne] = N([]), W = A.useMemo(() => l || !r || w.length === 0 ? null : w.find((n) => m(n) === r) || null, [r, w, m, l]);
55
- j(() => {
56
- if (l && Array.isArray(r) && w.length > 0) {
57
- const n = w.filter(
58
- (t) => r.includes(m(t))
59
- );
60
- ne(n);
61
- }
62
- }, [r, w, m, l]), j(() => ((async () => {
63
- try {
64
- v({ loading: !0, error: null });
65
- const t = c ? "__preload__" : "", o = await a("");
66
- F((y) => new Map(y).set(t, o)), R(o);
67
- } catch (t) {
68
- v({
69
- loading: !1,
70
- error: t instanceof Error ? t.message : "Failed to fetch options"
71
- });
72
- } finally {
73
- v((t) => ({ ...t, loading: !1 }));
74
- }
75
- })(), () => {
76
- R([]), F(/* @__PURE__ */ new Map());
77
- }), [a, c]), j(() => {
78
- if (g)
79
- if (c) {
80
- const n = I.get("__preload__") || [];
81
- if (S) {
82
- const t = n.filter(
83
- (o) => f ? f(o, S) : String(s(o)).toLowerCase().includes(S.toLowerCase())
84
- );
85
- R(t);
86
- } else
87
- R(n);
88
- } else {
89
- const n = S || "";
90
- if (I.has(n)) {
91
- const t = I.get(n);
92
- R(t);
93
- } else
94
- (async () => {
95
- try {
96
- v({ loading: !0, error: null });
97
- const o = await a(S);
98
- F((y) => new Map(y).set(n, o)), R(o);
99
- } catch (o) {
100
- v({
101
- loading: !1,
102
- error: o instanceof Error ? o.message : "Failed to fetch options"
103
- });
104
- } finally {
105
- v((o) => ({ ...o, loading: !1 }));
106
- }
107
- })();
50
+ const [m, E] = p(!1), L = S.useRef(null), P = S.useRef(null), ee = S.useRef(null), [re, F] = p({ loading: !1, error: null }), [U, ne] = p(""), I = le(U, x), [W, X] = p(/* @__PURE__ */ new Map()), [B, $] = p([]), [q, te] = p(0), [H, J] = p(() => t?.length ? new Map(
51
+ t.map((e) => [a(e), e])
52
+ ) : /* @__PURE__ */ new Map());
53
+ N(() => {
54
+ t?.length && (X((e) => {
55
+ const o = new Map(e);
56
+ return o.has("") || o.set("", t), o;
57
+ }), $((e) => e.length ? e : t), J((e) => {
58
+ const o = new Map(e);
59
+ return t.forEach((c) => o.set(a(c), c)), o;
60
+ }));
61
+ }, [t, a]);
62
+ const [M, Q] = p([]), R = j(
63
+ (e) => {
64
+ if (!e) {
65
+ Q([]);
66
+ return;
108
67
  }
109
- }, [
110
- g,
111
- S,
112
- c,
113
- f,
114
- I,
115
- s,
116
- a
117
- ]), j(() => {
118
- g && P.current && P.current.focus();
119
- }, [g]), j(() => {
120
- if (g && E.current && C) {
121
- const n = E.current.getBoundingClientRect();
122
- ee(n.width);
68
+ const c = (Array.isArray(e) ? e : [e]).map((d) => {
69
+ const w = H.get(d);
70
+ if (w) return w;
71
+ if (t?.length) {
72
+ const k = t.find(
73
+ (oe) => a(oe) === d
74
+ );
75
+ if (k) return k;
76
+ }
77
+ return B.find(
78
+ (k) => a(k) === d
79
+ ) ?? null;
80
+ }).filter(Boolean);
81
+ Q(c);
82
+ },
83
+ [H, a, t, B]
84
+ );
85
+ N(() => {
86
+ R(n);
87
+ }, [n, R]);
88
+ const G = S.useMemo(() => l ? null : M[0] ?? null, [l, M]);
89
+ N(() => {
90
+ if (!m) return;
91
+ const e = I || "";
92
+ if (W.has(e)) {
93
+ $(W.get(e));
94
+ return;
123
95
  }
124
- }, [g, C]);
125
- const re = $(
126
- (n) => {
127
- i?.(b && n === r ? "" : n), O(!1);
96
+ (async () => {
97
+ try {
98
+ F({ loading: !0, error: null });
99
+ const c = await i(I);
100
+ X((d) => new Map(d).set(e, c)), $(c), J((d) => {
101
+ const w = new Map(d);
102
+ return c.forEach((K) => w.set(a(K), K)), w;
103
+ });
104
+ } catch (c) {
105
+ F({
106
+ loading: !1,
107
+ error: c instanceof Error ? c.message : "Failed to fetch options"
108
+ });
109
+ } finally {
110
+ F((c) => ({ ...c, loading: !1 }));
111
+ }
112
+ })();
113
+ }, [m, I, W, i, a]), N(() => {
114
+ m && R(n);
115
+ }, [m, R, n]), N(() => {
116
+ m && L.current && L.current.focus();
117
+ }, [m]), N(() => {
118
+ if (!m || !P.current) return;
119
+ const e = P.current.getBoundingClientRect();
120
+ te(e.width);
121
+ }, [m]);
122
+ const se = j(
123
+ (e) => {
124
+ g?.(A && e === n ? "" : e), E(!1);
128
125
  },
129
- [r, i, b]
130
- ), te = $(
131
- (n) => {
126
+ [n, g, A]
127
+ ), ce = j(
128
+ (e) => {
132
129
  if (!l) return;
133
- const t = r, o = t.includes(n);
134
- let y;
135
- o ? y = t.filter((oe) => oe !== n) : y = [...t, n], i?.(y);
130
+ const o = Array.isArray(n) ? n : [], c = o.includes(e);
131
+ let d;
132
+ c ? d = o.filter((w) => w !== e) : d = [...o, e], g?.(d);
136
133
  },
137
- [r, i, l]
138
- ), se = $(
139
- (n) => {
140
- n.stopPropagation(), n.preventDefault(), i?.(l ? [] : ""), O(!1);
134
+ [n, g, l]
135
+ ), ae = j(
136
+ (e) => {
137
+ e.stopPropagation(), e.preventDefault(), g?.(l ? [] : ""), E(!1);
141
138
  },
142
- [i]
143
- ), U = A.useId();
144
- return /* @__PURE__ */ d(
145
- "div",
146
- {
147
- className: L("grid grid-cols-1 space-y-1.5", C && "w-full"),
148
- children: [
149
- h && /* @__PURE__ */ e(le, { htmlFor: U, className: L(p, "w-fit"), children: h }),
150
- /* @__PURE__ */ e("div", { ref: Q, className: "relative", "data-slot": "async-select", children: /* @__PURE__ */ d(ie, { open: g, onOpenChange: O, children: [
151
- /* @__PURE__ */ e(de, { asChild: !0, children: /* @__PURE__ */ e(
152
- "button",
153
- {
154
- id: U,
155
- ref: E,
156
- type: "button",
157
- disabled: T,
158
- className: L(
159
- ye({ size: J }),
160
- "!border-d-border/50 border !shadow-none",
161
- T && "cursor-not-allowed opacity-50",
162
- z,
163
- "font-normal",
164
- C && "w-full",
165
- "focus-visible:ring-d-ring focus-visible:ring-1",
166
- g && "ring-d-ring ring-1"
167
- ),
168
- style: C ? void 0 : { width: x },
169
- children: /* @__PURE__ */ d("div", { className: "flex w-full flex-1 items-center justify-between overflow-hidden", children: [
170
- l ? Array.isArray(r) && r.length > 0 ? /* @__PURE__ */ e("div", { className: "min-w-0 flex-1 truncate text-left", children: r.length === 1 ? G[0] && s(G[0]) : `${r.length} elementi selezionati` }) : /* @__PURE__ */ e("span", { className: "text-d-muted-foreground truncate text-left", children: _ }) : W ? /* @__PURE__ */ e("div", { className: "min-w-0 flex-1 truncate text-left", children: s(W) }) : /* @__PURE__ */ e("span", { className: "text-d-muted-foreground truncate text-left", children: _ }),
171
- /* @__PURE__ */ d("div", { className: "flex flex-shrink-0 items-center justify-end gap-1", children: [
172
- b && (l && Array.isArray(r) && r.length > 0 || !l && W) && /* @__PURE__ */ e(
173
- "div",
174
- {
175
- className: "border-d-input bg-d-accent cursor-pointer rounded-full p-1",
176
- onClick: se,
177
- onMouseDown: (n) => n.preventDefault(),
178
- "aria-label": "Clear selection",
179
- children: /* @__PURE__ */ e(
180
- X,
181
- {
182
- name: "X",
183
- size: "xs",
184
- className: "!text-d-foreground opacity-50"
185
- }
186
- )
187
- }
188
- ),
189
- /* @__PURE__ */ e(
190
- X,
139
+ [g]
140
+ ), Y = S.useId();
141
+ return /* @__PURE__ */ u("div", { className: v("flex flex-col gap-2", T), children: [
142
+ y && /* @__PURE__ */ r(ge, { htmlFor: Y, children: y }),
143
+ /* @__PURE__ */ u(pe, { open: m, onOpenChange: E, children: [
144
+ /* @__PURE__ */ r(xe, { asChild: !0, children: /* @__PURE__ */ r(
145
+ "button",
146
+ {
147
+ id: Y,
148
+ ref: P,
149
+ type: "button",
150
+ disabled: C,
151
+ className: v(
152
+ be({ size: V }),
153
+ "!border-d-border/50 border !shadow-none",
154
+ C && "cursor-not-allowed opacity-50",
155
+ "font-normal",
156
+ "w-full",
157
+ "focus-visible:ring-d-ring focus-visible:ring-1",
158
+ m && "ring-d-ring ring-1",
159
+ D
160
+ ),
161
+ children: /* @__PURE__ */ u("div", { className: "flex w-full flex-1 items-center justify-between overflow-hidden", children: [
162
+ l ? Array.isArray(n) && n.length > 0 ? /* @__PURE__ */ r("div", { className: "min-w-0 flex-1 truncate text-left", children: n.length === 1 ? M[0] && s(M[0]) : `${n.length} elementi selezionati` }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground truncate text-left", children: f }) : G ? /* @__PURE__ */ r("div", { className: "min-w-0 flex-1 truncate text-left", children: s(G) }) : /* @__PURE__ */ r("span", { className: "text-d-muted-foreground truncate text-left", children: f }),
163
+ /* @__PURE__ */ u("div", { className: "flex flex-shrink-0 items-center justify-end gap-1", children: [
164
+ A && (l && Array.isArray(n) && n.length > 0 || !l && G) && /* @__PURE__ */ r(
165
+ "div",
166
+ {
167
+ className: "border-d-input bg-d-accent cursor-pointer rounded-full p-1",
168
+ onClick: ae,
169
+ onMouseDown: (e) => e.preventDefault(),
170
+ "aria-label": "Clear selection",
171
+ children: /* @__PURE__ */ r(
172
+ Z,
191
173
  {
192
- name: "ChevronsUpDown",
174
+ name: "X",
193
175
  size: "xs",
194
176
  className: "!text-d-foreground opacity-50"
195
177
  }
196
178
  )
197
- ] })
198
- ] })
199
- }
200
- ) }),
201
- /* @__PURE__ */ e(
202
- fe,
203
- {
204
- className: L("p-0"),
205
- style: {
206
- width: C ? B ? `${B}px` : void 0 : typeof x == "number" ? `${x}px` : x
207
- },
208
- align: "start",
209
- side: "bottom",
210
- sideOffset: 4,
211
- onWheel: (n) => n.stopPropagation(),
212
- avoidCollisions: !1,
213
- children: /* @__PURE__ */ e(
214
- be,
179
+ }
180
+ ),
181
+ /* @__PURE__ */ r(
182
+ Z,
215
183
  {
216
- inputRef: P,
217
- commandListRef: Y,
218
- placeholder: _,
219
- searchTerm: K,
220
- onSearchTermChange: V,
221
- fetchState: Z,
222
- options: w,
223
- loadingSkeleton: M,
224
- notFound: u,
225
- noResultsMessage: D,
226
- multiple: l,
227
- value: r,
228
- getOptionValue: m,
229
- getDisplayValue: s,
230
- renderOption: k,
231
- onSelect: re,
232
- onSelectMultiple: te
184
+ name: "ChevronsUpDown",
185
+ size: "xs",
186
+ className: "!text-d-foreground opacity-50"
233
187
  }
234
188
  )
189
+ ] })
190
+ ] })
191
+ }
192
+ ) }),
193
+ /* @__PURE__ */ r(
194
+ we,
195
+ {
196
+ className: v("p-0"),
197
+ style: { width: q ? `${q}px` : void 0 },
198
+ align: "start",
199
+ side: "bottom",
200
+ sideOffset: 4,
201
+ onWheel: (e) => e.stopPropagation(),
202
+ avoidCollisions: !1,
203
+ children: /* @__PURE__ */ r(
204
+ Ae,
205
+ {
206
+ inputRef: L,
207
+ commandListRef: ee,
208
+ placeholder: f,
209
+ searchTerm: U,
210
+ onSearchTermChange: ne,
211
+ fetchState: re,
212
+ options: B,
213
+ notFound: h,
214
+ noResultsMessage: z,
215
+ multiple: l,
216
+ value: n,
217
+ resolveOptionValue: a,
218
+ renderSelectedValue: s,
219
+ renderOptionItem: b,
220
+ onSelect: se,
221
+ onSelectMultiple: ce
235
222
  }
236
223
  )
237
- ] }) })
238
- ]
239
- }
240
- );
224
+ }
225
+ )
226
+ ] })
227
+ ] });
241
228
  }
242
- function Ne({
243
- option: a,
244
- multiple: c,
245
- value: f,
246
- getOptionValue: k,
247
- getDisplayValue: m,
248
- renderOption: s,
249
- onSelect: u,
250
- onSelectMultiple: M
229
+ function Ce({
230
+ option: i,
231
+ multiple: t,
232
+ value: x,
233
+ resolveOptionValue: b,
234
+ renderSelectedValue: a,
235
+ renderOptionItem: s,
236
+ onSelect: h,
237
+ onSelectMultiple: y
251
238
  }) {
252
- const h = k(a);
253
- let p = !1;
254
- return c ? p = Array.isArray(f) && f.includes(h) : p = f === h, /* @__PURE__ */ e(
255
- H,
239
+ const f = b(i);
240
+ let n = !1;
241
+ return t ? n = Array.isArray(x) && x.includes(f) : n = x === f, /* @__PURE__ */ r(
242
+ O,
256
243
  {
257
- value: h,
258
- onSelect: c ? M : u,
244
+ value: f,
245
+ onSelect: t ? y : h,
259
246
  className: "cursor-pointer",
260
- children: /* @__PURE__ */ d("div", { className: "flex w-full items-center justify-between overflow-hidden", children: [
261
- /* @__PURE__ */ d("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
262
- c && /* @__PURE__ */ e(ge, { checked: p }),
263
- s ? /* @__PURE__ */ e("div", { className: "truncate", children: s(a) }) : /* @__PURE__ */ e("span", { className: "truncate", children: m(a) })
247
+ children: /* @__PURE__ */ u("div", { className: "flex w-full items-center justify-between overflow-hidden", children: [
248
+ /* @__PURE__ */ u("div", { className: "flex min-w-0 flex-1 items-center gap-2", children: [
249
+ t && /* @__PURE__ */ r(ie, { checked: n }),
250
+ s ? /* @__PURE__ */ r("div", { className: "truncate", children: s(i) }) : /* @__PURE__ */ r("span", { className: "truncate", children: a(i) })
264
251
  ] }),
265
- /* @__PURE__ */ e(
266
- we,
252
+ /* @__PURE__ */ r(
253
+ Ne,
267
254
  {
268
- className: L(
255
+ className: v(
269
256
  "ml-2 h-4 w-4 flex-shrink-0",
270
- p ? "opacity-100" : "opacity-0"
257
+ n ? "opacity-100" : "opacity-0"
271
258
  )
272
259
  }
273
260
  )
274
261
  ] })
275
262
  },
276
- h
263
+ f
277
264
  );
278
265
  }
279
- function be({
280
- inputRef: a,
281
- commandListRef: c,
282
- placeholder: f,
283
- searchTerm: k,
284
- onSearchTermChange: m,
266
+ function Ae({
267
+ inputRef: i,
268
+ commandListRef: t,
269
+ placeholder: x,
270
+ searchTerm: b,
271
+ onSearchTermChange: a,
285
272
  fetchState: s,
286
- options: u,
287
- loadingSkeleton: M,
288
- notFound: h,
289
- noResultsMessage: p,
290
- multiple: _,
291
- value: r,
292
- getOptionValue: i,
293
- getDisplayValue: T,
294
- renderOption: x,
273
+ options: h,
274
+ notFound: y,
275
+ noResultsMessage: f,
276
+ multiple: n,
277
+ value: g,
278
+ resolveOptionValue: C,
279
+ renderSelectedValue: D,
280
+ renderOptionItem: T,
295
281
  onSelect: z,
296
- onSelectMultiple: D
282
+ onSelectMultiple: A
297
283
  }) {
298
- return /* @__PURE__ */ d(me, { shouldFilter: !1, className: "w-full border-none shadow-sm", children: [
299
- /* @__PURE__ */ e(
300
- ue,
284
+ return /* @__PURE__ */ u(fe, { shouldFilter: !1, className: "w-full border-none shadow-sm", children: [
285
+ /* @__PURE__ */ r(
286
+ me,
301
287
  {
302
- ref: a,
303
- placeholder: f,
288
+ ref: i,
289
+ placeholder: x,
304
290
  className: "placeholder:text-d-muted-foreground",
305
- value: k,
306
- onValueChange: m
291
+ value: b,
292
+ onValueChange: a
307
293
  }
308
294
  ),
309
- s.loading && u.length > 0 && /* @__PURE__ */ e("div", { className: "flex items-center justify-center p-2", children: /* @__PURE__ */ e(xe, { className: "h-4 w-4 animate-spin" }) }),
310
- /* @__PURE__ */ d(he, { ref: c, children: [
311
- s.error && /* @__PURE__ */ e("div", { className: "text-d-destructive p-3 text-center", children: s.error }),
312
- s.loading && u.length === 0 && (M || /* @__PURE__ */ e(Ce, {})),
313
- !s.loading && !s.error && u.length === 0 && (h || /* @__PURE__ */ e(pe, { children: p || "No results found." })),
314
- !s.loading && !s.error && u.length > 0 && /* @__PURE__ */ e(q, { children: u.map((b) => /* @__PURE__ */ e(
315
- Ne,
295
+ s.loading && h.length > 0 && /* @__PURE__ */ r("div", { className: "flex items-center justify-center p-2", children: /* @__PURE__ */ r(ye, { className: "h-4 w-4 animate-spin" }) }),
296
+ /* @__PURE__ */ u(ue, { ref: t, children: [
297
+ s.error && /* @__PURE__ */ r("div", { className: "text-d-destructive p-3 text-center", children: s.error }),
298
+ s.loading && h.length === 0 && /* @__PURE__ */ r(Se, {}),
299
+ !s.loading && !s.error && h.length === 0 && (y || /* @__PURE__ */ r(he, { children: f || "No results found." })),
300
+ !s.loading && !s.error && h.length > 0 && /* @__PURE__ */ r(_, { children: h.map((l) => /* @__PURE__ */ r(
301
+ Ce,
316
302
  {
317
- option: b,
318
- multiple: _,
319
- value: r,
320
- getOptionValue: i,
321
- getDisplayValue: T,
322
- renderOption: x,
303
+ option: l,
304
+ multiple: n,
305
+ value: g,
306
+ resolveOptionValue: C,
307
+ renderSelectedValue: D,
308
+ renderOptionItem: T,
323
309
  onSelect: z,
324
- onSelectMultiple: D
310
+ onSelectMultiple: A
325
311
  },
326
- i(b)
312
+ C(l)
327
313
  )) })
328
314
  ] })
329
315
  ] });
330
316
  }
331
- function Ce() {
332
- return /* @__PURE__ */ e(q, { children: [1, 2, 3].map((a) => /* @__PURE__ */ e(H, { disabled: !0, children: /* @__PURE__ */ d("div", { className: "flex w-full items-center gap-2", children: [
333
- /* @__PURE__ */ e("div", { className: "bg-d-secondary h-6 w-6 animate-pulse rounded-full" }),
334
- /* @__PURE__ */ d("div", { className: "flex flex-1 flex-col gap-1", children: [
335
- /* @__PURE__ */ e("div", { className: "bg-d-secondary h-4 w-24 animate-pulse rounded" }),
336
- /* @__PURE__ */ e("div", { className: "bg-d-secondary h-3 w-16 animate-pulse rounded" })
317
+ function Se() {
318
+ return /* @__PURE__ */ r(_, { children: [1, 2, 3].map((i) => /* @__PURE__ */ r(O, { disabled: !0, children: /* @__PURE__ */ u("div", { className: "flex w-full items-center gap-2", children: [
319
+ /* @__PURE__ */ r("div", { className: "bg-d-secondary h-6 w-6 animate-pulse rounded-full" }),
320
+ /* @__PURE__ */ u("div", { className: "flex flex-1 flex-col gap-1", children: [
321
+ /* @__PURE__ */ r("div", { className: "bg-d-secondary h-4 w-24 animate-pulse rounded" }),
322
+ /* @__PURE__ */ r("div", { className: "bg-d-secondary h-3 w-16 animate-pulse rounded" })
337
323
  ] })
338
- ] }) }, a)) });
324
+ ] }) }, i)) });
339
325
  }
340
326
  export {
341
- De as AsyncSelect,
342
- ye as selectTriggerVariants
327
+ Ie as AsyncSelect,
328
+ be as selectTriggerVariants
343
329
  };