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.
- package/dist/_virtual/index2.js +5 -2
- package/dist/_virtual/index3.js +2 -5
- package/dist/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +5 -5
- package/dist/_virtual/index6.js +2 -2
- package/dist/_virtual/index7.js +2 -2
- package/dist/components/ui/app-multiple-select-dropdown.js +20 -18
- package/dist/components/ui/app-select.js +54 -34
- package/dist/components/ui/async-select.js +70 -71
- package/dist/components/ui/button.js +34 -34
- package/dist/components/ui/calendar.js +2 -2
- package/dist/components/ui/date-picker.js +7 -7
- package/dist/components/ui/input.js +10 -11
- package/dist/components/ui/multiple-selector.js +54 -52
- package/dist/components/ui/select.js +22 -17
- package/dist/components/ui/switch.js +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/eventemitter3/index2.js +1 -1
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
package/dist/_virtual/index2.js
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
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
|
-
|
|
7
|
+
m as default
|
|
5
8
|
};
|
package/dist/_virtual/index3.js
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
|
|
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
|
-
|
|
4
|
+
e as __module
|
|
8
5
|
};
|
package/dist/_virtual/index4.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __require as
|
|
4
|
-
var t =
|
|
5
|
-
const
|
|
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
|
-
|
|
7
|
+
x as default
|
|
8
8
|
};
|
package/dist/_virtual/index5.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { getDefaultExportFromCjs as
|
|
3
|
-
import { __require as
|
|
4
|
-
var t =
|
|
5
|
-
const
|
|
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
|
-
|
|
7
|
+
a as default
|
|
8
8
|
};
|
package/dist/_virtual/index6.js
CHANGED
package/dist/_virtual/index7.js
CHANGED
|
@@ -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:
|
|
17
|
+
options: i,
|
|
18
18
|
value: n,
|
|
19
|
-
onChange:
|
|
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(), [
|
|
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
|
-
|
|
39
|
+
s(n.filter((d) => d !== e));
|
|
40
40
|
else {
|
|
41
41
|
if (a && n.length >= a)
|
|
42
42
|
return;
|
|
43
|
-
|
|
43
|
+
s([...n, e]);
|
|
44
44
|
}
|
|
45
45
|
},
|
|
46
|
-
[n,
|
|
46
|
+
[n, s, a]
|
|
47
47
|
), x = t.useCallback(() => {
|
|
48
|
-
|
|
49
|
-
}, [
|
|
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
|
-
) :
|
|
51
|
+
) : i, [i, c]), C = t.useMemo(() => a ? n.length >= a : !1, [n, a]);
|
|
52
52
|
return T(() => {
|
|
53
|
-
if (
|
|
53
|
+
if (o && f.current) {
|
|
54
54
|
const e = f.current.getBoundingClientRect();
|
|
55
55
|
W(e.width);
|
|
56
56
|
}
|
|
57
|
-
}, [
|
|
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:
|
|
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":
|
|
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
|
|
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
|
|
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 || !
|
|
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 || !
|
|
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:
|
|
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
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
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:
|
|
8
|
-
children:
|
|
9
|
-
label:
|
|
10
|
-
className:
|
|
11
|
-
labelKey:
|
|
12
|
-
valueKey:
|
|
13
|
-
descriptionKey:
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
/* @__PURE__ */
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
-
] }
|
|
28
|
-
}) })
|
|
47
|
+
] }, e));
|
|
48
|
+
})() })
|
|
29
49
|
] });
|
|
30
50
|
}
|
|
31
51
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
|
2
|
+
import { jsxs as o, jsx as e } from "react/jsx-runtime";
|
|
3
3
|
import * as p from "react";
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useDebounce as
|
|
6
|
-
import { cva as
|
|
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
|
|
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 =
|
|
15
|
-
"flex items-center justify-between whitespace-nowrap rounded-md border border-input bg-d-input px-3 py-2 shadow-sm
|
|
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
|
|
30
|
-
fetcher:
|
|
29
|
+
function Te({
|
|
30
|
+
fetcher: c,
|
|
31
31
|
preload: f,
|
|
32
32
|
filterFn: R,
|
|
33
|
-
renderOption:
|
|
34
|
-
getOptionValue:
|
|
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:
|
|
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 [
|
|
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 (
|
|
56
|
-
|
|
57
|
-
|
|
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
|
|
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
|
-
|
|
67
|
+
v(!1);
|
|
71
68
|
}
|
|
72
69
|
})(), () => {
|
|
73
|
-
d([]),
|
|
74
|
-
}), [
|
|
75
|
-
if (
|
|
70
|
+
d([]), F([]);
|
|
71
|
+
}), [c, r, f]), h(() => {
|
|
72
|
+
if (l)
|
|
76
73
|
if (f)
|
|
77
74
|
if (u) {
|
|
78
|
-
const t =
|
|
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(
|
|
80
|
+
d(P);
|
|
84
81
|
else
|
|
85
82
|
(async () => {
|
|
86
83
|
try {
|
|
87
|
-
|
|
88
|
-
const s = await
|
|
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
|
-
|
|
92
|
+
v(!1);
|
|
96
93
|
}
|
|
97
94
|
})();
|
|
98
95
|
}, [
|
|
99
|
-
|
|
96
|
+
l,
|
|
100
97
|
u,
|
|
101
98
|
f,
|
|
102
99
|
R,
|
|
103
|
-
|
|
100
|
+
P,
|
|
104
101
|
g
|
|
105
102
|
]), h(() => {
|
|
106
|
-
if (
|
|
107
|
-
const t = n.find((s) =>
|
|
103
|
+
if (r && n.length > 0) {
|
|
104
|
+
const t = n.find((s) => i(s) === r);
|
|
108
105
|
C(t || null);
|
|
109
|
-
} else
|
|
110
|
-
}, [
|
|
111
|
-
|
|
112
|
-
}, [
|
|
113
|
-
if (
|
|
114
|
-
const t =
|
|
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
|
-
}, [
|
|
118
|
-
const V =
|
|
114
|
+
}, [l]);
|
|
115
|
+
const V = A(
|
|
119
116
|
(t) => {
|
|
120
|
-
const s = L && t ===
|
|
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
|
-
[
|
|
124
|
-
), ee =
|
|
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__ */
|
|
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__ */
|
|
133
|
-
/* @__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
|
-
|
|
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:
|
|
147
|
-
ref:
|
|
148
|
-
children: /* @__PURE__ */
|
|
149
|
-
|
|
150
|
-
/* @__PURE__ */
|
|
151
|
-
L &&
|
|
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
|
-
|
|
180
|
+
ce,
|
|
182
181
|
{
|
|
183
182
|
className: S("p-0"),
|
|
184
183
|
style: {
|
|
185
|
-
width:
|
|
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__ */
|
|
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
|
-
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
!
|
|
212
|
-
!
|
|
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:
|
|
214
|
+
value: i(t),
|
|
216
215
|
onSelect: V,
|
|
217
216
|
className: "cursor-pointer",
|
|
218
217
|
children: [
|
|
219
|
-
|
|
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
|
-
|
|
224
|
+
r === i(t) ? "opacity-100" : "opacity-0"
|
|
226
225
|
)
|
|
227
226
|
}
|
|
228
227
|
)
|
|
229
228
|
]
|
|
230
229
|
},
|
|
231
|
-
|
|
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((
|
|
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__ */
|
|
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
|
-
] }) },
|
|
248
|
+
] }) }, c)) });
|
|
250
249
|
}
|
|
251
250
|
export {
|
|
252
|
-
|
|
251
|
+
Te as AsyncSelect,
|
|
253
252
|
ge as asyncSelectTriggerVariants
|
|
254
253
|
};
|