laif-ds 0.1.88 → 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,5 +1,8 @@
1
1
  "use client";
2
- var e = { exports: {} };
2
+ import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
3
+ import { __require as t } from "../node_modules/eventemitter3/index2.js";
4
+ var r = t();
5
+ const m = /* @__PURE__ */ e(r);
3
6
  export {
4
- e as __module
7
+ m as default
5
8
  };
@@ -1,8 +1,5 @@
1
1
  "use client";
2
- import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
3
- import { __require as t } from "../node_modules/eventemitter3/index2.js";
4
- var r = t();
5
- const m = /* @__PURE__ */ e(r);
2
+ var e = { exports: {} };
6
3
  export {
7
- m as default
4
+ e as __module
8
5
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
- import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
4
- var t = e();
5
- const a = /* @__PURE__ */ r(t);
2
+ import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
3
+ import { __require as r } from "../node_modules/extend/index.js";
4
+ var t = r();
5
+ const x = /* @__PURE__ */ e(t);
6
6
  export {
7
- a as default
7
+ x as default
8
8
  };
@@ -1,8 +1,8 @@
1
1
  "use client";
2
- import { getDefaultExportFromCjs as e } from "./_commonjsHelpers.js";
3
- import { __require as r } from "../node_modules/extend/index.js";
4
- var t = r();
5
- const x = /* @__PURE__ */ e(t);
2
+ import { getDefaultExportFromCjs as r } from "./_commonjsHelpers.js";
3
+ import { __require as e } from "../node_modules/style-to-js/cjs/index.js";
4
+ var t = e();
5
+ const a = /* @__PURE__ */ r(t);
6
6
  export {
7
- x as default
7
+ a as default
8
8
  };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- var e = {};
2
+ var e = { exports: {} };
3
3
  export {
4
- e as __exports
4
+ e as __module
5
5
  };
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- var e = { exports: {} };
2
+ var e = {};
3
3
  export {
4
- e as __module
4
+ e as __exports
5
5
  };
@@ -14,9 +14,9 @@ import { Icon as y } from "./icon.js";
14
14
  import Z from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
15
15
  const _ = t.createContext({ size: "default" });
16
16
  function me({
17
- options: s,
17
+ options: i,
18
18
  value: n,
19
- onChange: o,
19
+ onChange: s,
20
20
  onClear: h,
21
21
  placeholder: k = "Seleziona...",
22
22
  disabled: z = !1,
@@ -31,30 +31,30 @@ function me({
31
31
  cancelButtonLabel: S = "Cancella",
32
32
  maxSelectedItems: a
33
33
  }) {
34
- const m = t.useId(), [d, L] = t.useState(!1), [c, v] = t.useState(""), [B, W] = t.useState(
34
+ const m = t.useId(), [o, L] = t.useState(!1), [c, v] = t.useState(""), [B, W] = t.useState(
35
35
  void 0
36
36
  ), A = t.useRef(null), f = t.useRef(null), w = t.useCallback(
37
37
  (e) => {
38
38
  if (n.includes(e))
39
- o(n.filter((i) => i !== e));
39
+ s(n.filter((d) => d !== e));
40
40
  else {
41
41
  if (a && n.length >= a)
42
42
  return;
43
- o([...n, e]);
43
+ s([...n, e]);
44
44
  }
45
45
  },
46
- [n, o, a]
46
+ [n, s, a]
47
47
  ), x = t.useCallback(() => {
48
- o([]), v(""), h && h();
49
- }, [o]), u = t.useMemo(() => s.filter((e) => n.includes(e.value)), [s, n]), E = t.useMemo(() => c ? s.filter(
48
+ s([]), v(""), h && h();
49
+ }, [s]), u = t.useMemo(() => i.filter((e) => n.includes(e.value)), [i, n]), E = t.useMemo(() => c ? i.filter(
50
50
  (e) => e.label.toLowerCase().includes(c.toLowerCase())
51
- ) : s, [s, c]), C = t.useMemo(() => a ? n.length >= a : !1, [n, a]);
51
+ ) : i, [i, c]), C = t.useMemo(() => a ? n.length >= a : !1, [n, a]);
52
52
  return T(() => {
53
- if (d && f.current) {
53
+ if (o && f.current) {
54
54
  const e = f.current.getBoundingClientRect();
55
55
  W(e.width);
56
56
  }
57
- }, [d]), /* @__PURE__ */ r(_.Provider, { value: { size: g, id: m }, children: /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
57
+ }, [o]), /* @__PURE__ */ r(_.Provider, { value: { size: g, id: m }, children: /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
58
58
  b && /* @__PURE__ */ r(G, { htmlFor: m, className: M, children: b }),
59
59
  /* @__PURE__ */ r(
60
60
  "div",
@@ -62,7 +62,7 @@ function me({
62
62
  ref: A,
63
63
  className: "relative w-full",
64
64
  "data-slot": "app-multiple-select-dropdown",
65
- children: /* @__PURE__ */ l(X, { open: d, onOpenChange: L, children: [
65
+ children: /* @__PURE__ */ l(X, { open: o, onOpenChange: L, children: [
66
66
  /* @__PURE__ */ r($, { asChild: !0, children: /* @__PURE__ */ l(
67
67
  N,
68
68
  {
@@ -70,13 +70,15 @@ function me({
70
70
  type: "button",
71
71
  variant: "outline",
72
72
  role: "combobox",
73
- "aria-expanded": d,
73
+ "aria-expanded": o,
74
74
  disabled: z,
75
75
  ref: f,
76
76
  className: p(
77
77
  "!bg-d-input relative w-full justify-between border font-normal",
78
- "border-d-input ring-offset-background focus:ring-ring flex items-center rounded-md border whitespace-nowrap shadow-sm focus:ring-1 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",
78
+ "border-d-input ring-offset-background flex items-center rounded-md border whitespace-nowrap shadow-sm focus:outline-none disabled:cursor-not-allowed disabled:opacity-50",
79
79
  "aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 aria-invalid:border-d-destructive",
80
+ "focus-visible:ring-d-ring focus-visible:ring-1",
81
+ o && "ring-d-ring ring-1",
80
82
  R
81
83
  ),
82
84
  children: [
@@ -162,22 +164,22 @@ function me({
162
164
  /* @__PURE__ */ l(I, { className: "max-h-60 w-full", children: [
163
165
  /* @__PURE__ */ r(J, { children: P }),
164
166
  /* @__PURE__ */ r(K, { children: E.map((e) => {
165
- const i = n.includes(e.value);
167
+ const d = n.includes(e.value);
166
168
  return /* @__PURE__ */ l(
167
169
  Q,
168
170
  {
169
171
  value: e.value,
170
- disabled: e.disabled || !i && C,
172
+ disabled: e.disabled || !d && C,
171
173
  onSelect: () => w(e.value),
172
174
  className: p(
173
175
  "aria-selected:!bg-d-accent aria-selected:text-d-accent-foreground flex cursor-pointer items-center gap-2 px-2 py-1.5",
174
- (e.disabled || !i && C) && "cursor-not-allowed opacity-50"
176
+ (e.disabled || !d && C) && "cursor-not-allowed opacity-50"
175
177
  ),
176
178
  children: [
177
179
  /* @__PURE__ */ r(
178
180
  Y,
179
181
  {
180
- checked: i,
182
+ checked: d,
181
183
  className: "z-10 mr-2 flex-shrink-0",
182
184
  onCheckedChange: () => {
183
185
  console.log("checkbox change for:", e.value), w(e.value);
@@ -1,42 +1,62 @@
1
1
  "use client";
2
- import { jsxs as c, jsx as t } from "react/jsx-runtime";
3
- import { Select as g, SelectTrigger as h, SelectValue as b, SelectContent as C, SelectItem as B } from "./select.js";
4
- import { SelectGroup as I, SelectLabel as L, SelectScrollDownButton as T, SelectScrollUpButton as U, SelectSeparator as V } from "./select.js";
5
- function j({
2
+ import { jsxs as s, jsx as n } from "react/jsx-runtime";
3
+ import * as b from "react";
4
+ import { Select as C, SelectTrigger as O, SelectValue as B, SelectContent as G, SelectSeparator as N, SelectGroup as j, SelectLabel as w, SelectItem as D } from "./select.js";
5
+ import { SelectScrollDownButton as F, SelectScrollUpButton as R } from "./select.js";
6
+ function U({
6
7
  options: p,
7
- placeholder: o,
8
- children: u,
9
- label: i,
10
- className: d,
11
- labelKey: r,
12
- valueKey: n,
13
- descriptionKey: a,
14
- isOptionDisabled: m,
15
- ...x
8
+ placeholder: d,
9
+ children: m,
10
+ label: g,
11
+ className: h,
12
+ labelKey: S,
13
+ valueKey: o,
14
+ descriptionKey: u,
15
+ groupNameKey: a,
16
+ isOptionDisabled: f,
17
+ ...A
16
18
  }) {
17
- return /* @__PURE__ */ c(g, { ...x, label: i, className: d, children: [
18
- u || /* @__PURE__ */ t(h, { className: "w-full", children: /* @__PURE__ */ t(b, { placeholder: o }) }),
19
- /* @__PURE__ */ t(C, { children: p.map((e) => {
20
- const l = r && n, s = String(l ? e[n] : e.value), A = l ? String(e[r]) : e.label, S = l && a ? String(e[a]) : null, f = l ? m?.(e) ?? !1 : e.disabled;
21
- return /* @__PURE__ */ t(B, { value: s, disabled: f, children: /* @__PURE__ */ c("span", { className: "flex flex-col", children: [
22
- /* @__PURE__ */ t("span", { children: A }),
23
- S && /* @__PURE__ */ c("span", { className: "text-muted-foreground text-d-tertiary text-xs", children: [
24
- "- ",
25
- S
19
+ const i = (t) => {
20
+ const c = S && o, e = String(c ? t[o] : t.value), r = c ? String(t[S]) : t.label, l = c && u ? String(t[u]) : null, x = c ? f?.(t) ?? !1 : t.disabled;
21
+ return /* @__PURE__ */ n(D, { value: e, disabled: x, children: /* @__PURE__ */ s("span", { className: "flex flex-col", children: [
22
+ /* @__PURE__ */ n("span", { children: r }),
23
+ l && /* @__PURE__ */ s("span", { className: "text-muted-foreground text-d-tertiary text-xs", children: [
24
+ "- ",
25
+ l
26
+ ] })
27
+ ] }) }, e);
28
+ };
29
+ return /* @__PURE__ */ s(C, { ...A, label: g, className: h, children: [
30
+ m || /* @__PURE__ */ n(O, { className: "w-full", children: /* @__PURE__ */ n(B, { placeholder: d }) }),
31
+ /* @__PURE__ */ n(G, { children: (() => {
32
+ if (!p.some((e) => a ? String(e[a]) : e.groupName))
33
+ return p.map(i);
34
+ const c = p.reduce(
35
+ (e, r) => {
36
+ const l = a ? String(r[a]) : r.groupName || "Altro";
37
+ return e[l] || (e[l] = []), e[l].push(r), e;
38
+ },
39
+ {}
40
+ );
41
+ return Object.entries(c).map(([e, r], l) => /* @__PURE__ */ s(b.Fragment, { children: [
42
+ l > 0 && /* @__PURE__ */ n(N, {}),
43
+ /* @__PURE__ */ s(j, { children: [
44
+ /* @__PURE__ */ n(w, { children: e }),
45
+ r.map(i)
26
46
  ] })
27
- ] }) }, s);
28
- }) })
47
+ ] }, e));
48
+ })() })
29
49
  ] });
30
50
  }
31
51
  export {
32
- j as AppSelect,
33
- C as AppSelectContent,
34
- I as AppSelectGroup,
35
- B as AppSelectItem,
36
- L as AppSelectLabel,
37
- T as AppSelectScrollDownButton,
38
- U as AppSelectScrollUpButton,
39
- V as AppSelectSeparator,
40
- h as AppSelectTrigger,
41
- b as AppSelectValue
52
+ U as AppSelect,
53
+ G as AppSelectContent,
54
+ j as AppSelectGroup,
55
+ D as AppSelectItem,
56
+ w as AppSelectLabel,
57
+ F as AppSelectScrollDownButton,
58
+ R as AppSelectScrollUpButton,
59
+ N as AppSelectSeparator,
60
+ O as AppSelectTrigger,
61
+ B as AppSelectValue
42
62
  };
@@ -1,18 +1,18 @@
1
1
  "use client";
2
- import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
+ import { jsxs as o, jsx as e } from "react/jsx-runtime";
3
3
  import * as p from "react";
4
- import { useState as l, useEffect as h, useCallback as F } from "react";
5
- import { useDebounce as oe } from "../../hooks/use-debounce.js";
6
- import { cva as re } from "../../node_modules/class-variance-authority/dist/index.js";
4
+ import { useState as a, useEffect as h, useCallback as A } from "react";
5
+ import { useDebounce as re } from "../../hooks/use-debounce.js";
6
+ import { cva as oe } from "../../node_modules/class-variance-authority/dist/index.js";
7
7
  import { cn as S } from "../../lib/utils.js";
8
8
  import { Label as le } from "./label.js";
9
- import { Popover as ae, PopoverTrigger as ce, PopoverContent as ie } from "./popover.js";
9
+ import { Popover as ae, PopoverTrigger as ie, PopoverContent as ce } from "./popover.js";
10
10
  import { Command as de, CommandInput as fe, CommandList as me, CommandEmpty as ue, CommandGroup as G, CommandItem as M } from "./command.js";
11
11
  import { Icon as B } from "./icon.js";
12
12
  import pe from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
13
13
  import he from "../../node_modules/lucide-react/dist/esm/icons/check.js";
14
- const ge = re(
15
- "flex items-center justify-between whitespace-nowrap rounded-md border border-input bg-d-input px-3 py-2 shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
14
+ const ge = oe(
15
+ "flex items-center justify-between whitespace-nowrap rounded-md border border-d-input bg-d-input px-3 py-2 shadow-sm data-[placeholder]:text-muted-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 ",
16
16
  {
17
17
  variants: {
18
18
  size: {
@@ -26,19 +26,19 @@ const ge = re(
26
26
  }
27
27
  }
28
28
  );
29
- function Pe({
30
- fetcher: i,
29
+ function Te({
30
+ fetcher: c,
31
31
  preload: f,
32
32
  filterFn: R,
33
- renderOption: E,
34
- getOptionValue: a,
33
+ renderOption: k,
34
+ getOptionValue: i,
35
35
  getDisplayValue: g,
36
36
  notFound: U,
37
37
  loadingSkeleton: X,
38
38
  label: z,
39
39
  labelClassName: $,
40
40
  placeholder: O = "Select...",
41
- value: o = "",
41
+ value: r = "",
42
42
  onChange: x,
43
43
  disabled: W = !1,
44
44
  width: m = "200px",
@@ -47,19 +47,16 @@ function Pe({
47
47
  clearable: L = !0,
48
48
  size: J
49
49
  }) {
50
- const [c, j] = l(!1), y = m === "auto", I = p.useRef(null), P = p.useRef(null), K = p.useRef(null), Q = p.useRef(null), [w, N] = l(!1), [v, b] = l(null), [T, C] = l(null), [D, Y] = l(""), u = oe(D, f ? 0 : 300), [k, A] = l([]), [n, d] = l([]), [Z, _] = l(
50
+ const [l, j] = a(!1), w = m === "auto", I = p.useRef(null), T = p.useRef(null), K = p.useRef(null), Q = p.useRef(null), [y, v] = a(!1), [N, b] = a(null), [E, C] = a(null), [D, Y] = a(""), u = re(D, f ? 0 : 300), [P, F] = a([]), [n, d] = a([]), [Z, _] = a(
51
51
  void 0
52
52
  );
53
53
  h(() => ((async () => {
54
54
  try {
55
- if (N(!0), b(null), f) {
56
- console.log(
57
- "[AsyncSelect] Preload attivo: caricamento completo dei dati"
58
- );
59
- const s = await i("");
60
- A(s), d(s);
55
+ if (v(!0), b(null), f) {
56
+ const s = await c("");
57
+ F(s), d(s);
61
58
  } else {
62
- const s = await i(o);
59
+ const s = await c(r);
63
60
  d(s);
64
61
  }
65
62
  } catch (s) {
@@ -67,70 +64,70 @@ function Pe({
67
64
  s instanceof Error ? s.message : "Failed to fetch options"
68
65
  );
69
66
  } finally {
70
- N(!1);
67
+ v(!1);
71
68
  }
72
69
  })(), () => {
73
- d([]), A([]);
74
- }), [i, o, f]), h(() => {
75
- if (c)
70
+ d([]), F([]);
71
+ }), [c, r, f]), h(() => {
72
+ if (l)
76
73
  if (f)
77
74
  if (u) {
78
- const t = k.filter(
75
+ const t = P.filter(
79
76
  (s) => R ? R(s, u) : String(g(s)).toLowerCase().includes(u.toLowerCase())
80
77
  );
81
78
  d(t);
82
79
  } else
83
- d(k);
80
+ d(P);
84
81
  else
85
82
  (async () => {
86
83
  try {
87
- N(!0), b(null);
88
- const s = await i(u);
84
+ v(!0), b(null);
85
+ const s = await c(u);
89
86
  d(s);
90
87
  } catch (s) {
91
88
  b(
92
89
  s instanceof Error ? s.message : "Failed to fetch options"
93
90
  );
94
91
  } finally {
95
- N(!1);
92
+ v(!1);
96
93
  }
97
94
  })();
98
95
  }, [
99
- c,
96
+ l,
100
97
  u,
101
98
  f,
102
99
  R,
103
- k,
100
+ P,
104
101
  g
105
102
  ]), h(() => {
106
- if (o && n.length > 0) {
107
- const t = n.find((s) => a(s) === o);
103
+ if (r && n.length > 0) {
104
+ const t = n.find((s) => i(s) === r);
108
105
  C(t || null);
109
- } else o || C(null);
110
- }, [o, n, a]), h(() => {
111
- c && I.current && I.current.focus();
112
- }, [c]), h(() => {
113
- if (c && P.current) {
114
- const t = P.current.getBoundingClientRect();
106
+ } else r || C(null);
107
+ }, [r, n, i]), h(() => {
108
+ l && I.current && I.current.focus();
109
+ }, [l]), h(() => {
110
+ if (l && T.current) {
111
+ const t = T.current.getBoundingClientRect();
115
112
  _(t.width);
116
113
  }
117
- }, [c]);
118
- const V = F(
114
+ }, [l]);
115
+ const V = A(
119
116
  (t) => {
120
- const s = L && t === o ? "" : t, se = n.find((ne) => a(ne) === s) || null;
117
+ const s = L && t === r ? "" : t, se = n.find((ne) => i(ne) === s) || null;
121
118
  C(se), x(s), j(!1);
122
119
  },
123
- [o, x, L, n, a]
124
- ), ee = F(
120
+ [r, x, L, n, i]
121
+ ), ee = A(
125
122
  (t) => {
126
123
  t.stopPropagation(), t.preventDefault(), C(null), x(""), j(!1);
127
124
  },
128
125
  [x]
129
126
  ), te = p.useId();
130
- return /* @__PURE__ */ r("div", { className: S("space-y-1.5", y && "w-full"), children: [
127
+ return /* @__PURE__ */ o("div", { className: S("space-y-1.5", w && "w-full"), children: [
131
128
  z && /* @__PURE__ */ e(le, { className: $, children: z }),
132
- /* @__PURE__ */ e("div", { ref: K, className: "relative", "data-slot": "async-select", children: /* @__PURE__ */ r(ae, { open: c, onOpenChange: j, children: [
133
- /* @__PURE__ */ e(ce, { asChild: !0, children: /* @__PURE__ */ e(
129
+ /* @__PURE__ */ e("div", { ref: K, className: "relative", "data-slot": "async-select", children: /* @__PURE__ */ o(ae, { open: l, onOpenChange: j, children: [
130
+ /* @__PURE__ */ e(ie, { asChild: !0, children: /* @__PURE__ */ e(
134
131
  "button",
135
132
  {
136
133
  id: te,
@@ -141,14 +138,16 @@ function Pe({
141
138
  W && "cursor-not-allowed opacity-50",
142
139
  q,
143
140
  "font-normal",
144
- y && "w-full"
141
+ w && "w-full",
142
+ "focus-visible:ring-d-ring focus-visible:ring-1",
143
+ l && "ring-d-ring ring-1"
145
144
  ),
146
- style: y ? void 0 : { width: m },
147
- ref: P,
148
- children: /* @__PURE__ */ r("div", { className: "flex w-full flex-1 items-center justify-between overflow-hidden", children: [
149
- T ? /* @__PURE__ */ e("div", { className: "truncate", children: g(T) }) : /* @__PURE__ */ e("span", { className: "text-d-muted-foreground hover:text-d-foreground", children: O }),
150
- /* @__PURE__ */ r("div", { className: "flex w-full items-center justify-end gap-1", children: [
151
- L && T && /* @__PURE__ */ e(
145
+ style: w ? void 0 : { width: m },
146
+ ref: T,
147
+ children: /* @__PURE__ */ o("div", { className: "flex w-full flex-1 items-center justify-between overflow-hidden", children: [
148
+ E ? /* @__PURE__ */ e("div", { className: "truncate", children: g(E) }) : /* @__PURE__ */ e("span", { className: "text-d-muted-foreground hover:text-d-foreground", children: O }),
149
+ /* @__PURE__ */ o("div", { className: "flex w-full items-center justify-end gap-1", children: [
150
+ L && E && /* @__PURE__ */ e(
152
151
  "div",
153
152
  {
154
153
  className: "border-d-input bg-d-accent cursor-pointer rounded-full p-1",
@@ -178,18 +177,18 @@ function Pe({
178
177
  }
179
178
  ) }),
180
179
  /* @__PURE__ */ e(
181
- ie,
180
+ ce,
182
181
  {
183
182
  className: S("p-0"),
184
183
  style: {
185
- width: y ? Z : typeof m == "number" ? `${m}px` : m
184
+ width: w ? Z : typeof m == "number" ? `${m}px` : m
186
185
  },
187
186
  align: "start",
188
187
  side: "bottom",
189
188
  sideOffset: 4,
190
189
  onWheel: (t) => t.stopPropagation(),
191
190
  avoidCollisions: !1,
192
- children: /* @__PURE__ */ r(
191
+ children: /* @__PURE__ */ o(
193
192
  de,
194
193
  {
195
194
  shouldFilter: !1,
@@ -204,31 +203,31 @@ function Pe({
204
203
  onValueChange: Y
205
204
  }
206
205
  ),
207
- w && n.length > 0 && /* @__PURE__ */ e("div", { className: "flex items-center justify-center p-2", children: /* @__PURE__ */ e(pe, { className: "h-4 w-4 animate-spin" }) }),
208
- /* @__PURE__ */ r(me, { ref: Q, children: [
209
- v && /* @__PURE__ */ e("div", { className: "text-d-destructive p-3 text-center", children: v }),
210
- w && n.length === 0 && (X || /* @__PURE__ */ e(xe, {})),
211
- !w && !v && n.length === 0 && (U || /* @__PURE__ */ e(ue, { children: H || "No results found." })),
212
- !w && !v && n.length > 0 && /* @__PURE__ */ e(G, { children: n.map((t) => /* @__PURE__ */ r(
206
+ y && n.length > 0 && /* @__PURE__ */ e("div", { className: "flex items-center justify-center p-2", children: /* @__PURE__ */ e(pe, { className: "h-4 w-4 animate-spin" }) }),
207
+ /* @__PURE__ */ o(me, { ref: Q, children: [
208
+ N && /* @__PURE__ */ e("div", { className: "text-d-destructive p-3 text-center", children: N }),
209
+ y && n.length === 0 && (X || /* @__PURE__ */ e(xe, {})),
210
+ !y && !N && n.length === 0 && (U || /* @__PURE__ */ e(ue, { children: H || "No results found." })),
211
+ !y && !N && n.length > 0 && /* @__PURE__ */ e(G, { children: n.map((t) => /* @__PURE__ */ o(
213
212
  M,
214
213
  {
215
- value: a(t),
214
+ value: i(t),
216
215
  onSelect: V,
217
216
  className: "cursor-pointer",
218
217
  children: [
219
- E ? E(t) : /* @__PURE__ */ e("span", { children: g(t) }),
218
+ k ? k(t) : /* @__PURE__ */ e("span", { children: g(t) }),
220
219
  /* @__PURE__ */ e(
221
220
  he,
222
221
  {
223
222
  className: S(
224
223
  "ml-auto h-4 w-4",
225
- o === a(t) ? "opacity-100" : "opacity-0"
224
+ r === i(t) ? "opacity-100" : "opacity-0"
226
225
  )
227
226
  }
228
227
  )
229
228
  ]
230
229
  },
231
- a(t)
230
+ i(t)
232
231
  )) })
233
232
  ] })
234
233
  ]
@@ -240,15 +239,15 @@ function Pe({
240
239
  ] });
241
240
  }
242
241
  function xe() {
243
- return /* @__PURE__ */ e(G, { children: [1, 2, 3].map((i) => /* @__PURE__ */ e(M, { disabled: !0, children: /* @__PURE__ */ r("div", { className: "flex w-full items-center gap-2", children: [
242
+ return /* @__PURE__ */ e(G, { children: [1, 2, 3].map((c) => /* @__PURE__ */ e(M, { disabled: !0, children: /* @__PURE__ */ o("div", { className: "flex w-full items-center gap-2", children: [
244
243
  /* @__PURE__ */ e("div", { className: "bg-d-secondary h-6 w-6 animate-pulse rounded-full" }),
245
- /* @__PURE__ */ r("div", { className: "flex flex-1 flex-col gap-1", children: [
244
+ /* @__PURE__ */ o("div", { className: "flex flex-1 flex-col gap-1", children: [
246
245
  /* @__PURE__ */ e("div", { className: "bg-d-secondary h-4 w-24 animate-pulse rounded" }),
247
246
  /* @__PURE__ */ e("div", { className: "bg-d-secondary h-3 w-16 animate-pulse rounded" })
248
247
  ] })
249
- ] }) }, i)) });
248
+ ] }) }, c)) });
250
249
  }
251
250
  export {
252
- Pe as AsyncSelect,
251
+ Te as AsyncSelect,
253
252
  ge as asyncSelectTriggerVariants
254
253
  };