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.
- package/dist/_virtual/index2.js +2 -5
- package/dist/_virtual/index3.js +5 -2
- package/dist/agent-docs/components/AppForm.md +66 -1
- package/dist/agent-docs/components/AsyncSelect.md +94 -103
- package/dist/components/kanban.js +540 -0
- package/dist/components/ui/app-form.js +76 -44
- package/dist/components/ui/app-kanban.js +137 -0
- package/dist/components/ui/app-select.js +100 -87
- package/dist/components/ui/async-select.js +264 -278
- package/dist/index.d.ts +81 -29
- package/dist/index.js +77 -75
- package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-alert-dialog/node_modules/@radix-ui/react-slot/dist/index.js +12 -0
- package/dist/node_modules/@radix-ui/react-collection/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-collection/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/node_modules/@radix-ui/react-menu/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-menu/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/node_modules/@radix-ui/react-popover/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-primitive/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-select/node_modules/@radix-ui/react-slot/dist/index.js +50 -0
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +47 -44
- package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-tooltip/node_modules/@radix-ui/react-slot/dist/index.js +12 -0
- package/dist/node_modules/eventemitter3/index.js +1 -1
- package/dist/node_modules/recharts/es6/util/Events.js +1 -1
- package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js +536 -502
- 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 +4 -4
|
@@ -1,35 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as s, jsx as
|
|
2
|
+
import { jsxs as s, jsx as l, Fragment as le } from "react/jsx-runtime";
|
|
3
3
|
import { Badge as re } from "./badge.js";
|
|
4
|
-
import { Command as ne, CommandInput as
|
|
4
|
+
import { Command as ne, CommandInput as ae, CommandList as te, CommandEmpty as se, CommandGroup as j, CommandItem as M } from "./command.js";
|
|
5
5
|
import { Label as ie } from "./label.js";
|
|
6
|
-
import { cn as
|
|
6
|
+
import { cn as w } from "../../lib/utils.js";
|
|
7
7
|
import { useState as h, useRef as oe, useMemo as N, useCallback as de, useEffect as ce } from "react";
|
|
8
|
-
import { Button as D } from "./button.js";
|
|
9
8
|
import { Checkbox as ue } from "./checkbox.js";
|
|
10
|
-
import { Icon as
|
|
11
|
-
import { Popover as
|
|
12
|
-
import
|
|
13
|
-
const
|
|
9
|
+
import { Icon as S } from "./icon.js";
|
|
10
|
+
import { Popover as me, PopoverTrigger as fe, PopoverContent as he } from "./popover.js";
|
|
11
|
+
import pe from "../../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
|
|
12
|
+
const ge = {
|
|
14
13
|
sm: "min-h-8 h-8 text-xs py-1.5",
|
|
15
14
|
default: "min-h-9 h-9 text-sm py-2",
|
|
16
15
|
lg: "min-h-10 h-10 text-base py-2"
|
|
17
16
|
};
|
|
18
|
-
function
|
|
17
|
+
function Oe(P) {
|
|
19
18
|
const {
|
|
20
19
|
multiple: n = !1,
|
|
21
20
|
options: m,
|
|
22
21
|
value: A,
|
|
23
|
-
defaultValue:
|
|
24
|
-
onValueChange:
|
|
22
|
+
defaultValue: B,
|
|
23
|
+
onValueChange: R,
|
|
25
24
|
onClear: p,
|
|
26
|
-
placeholder:
|
|
27
|
-
emptyPlaceholder:
|
|
28
|
-
searchPlaceholder:
|
|
29
|
-
addItemPlaceholder:
|
|
25
|
+
placeholder: X = "Seleziona...",
|
|
26
|
+
emptyPlaceholder: E = "Nessun risultato",
|
|
27
|
+
searchPlaceholder: F = "Cerca...",
|
|
28
|
+
addItemPlaceholder: L = "Aggiungi",
|
|
30
29
|
itemCountMessage: T = (e) => `${e} elementi selezionati`,
|
|
31
30
|
maxSelectedMessage: W = (e) => `Puoi selezionare fino a ${e} elementi`,
|
|
32
|
-
label:
|
|
31
|
+
label: D,
|
|
33
32
|
className: $ = "",
|
|
34
33
|
wrpClassName: G = "",
|
|
35
34
|
searchable: O = !1,
|
|
@@ -37,164 +36,178 @@ function ke(S) {
|
|
|
37
36
|
groupBy: g = "group",
|
|
38
37
|
maxSelected: o,
|
|
39
38
|
showChipsInsteadOfCount: H = !1,
|
|
40
|
-
disabled:
|
|
39
|
+
disabled: b,
|
|
41
40
|
size: J = "default",
|
|
42
41
|
isSingleSelectClearable: K = !1
|
|
43
|
-
} =
|
|
44
|
-
V || Z(e),
|
|
45
|
-
},
|
|
46
|
-
const e = m.filter((
|
|
42
|
+
} = P, [v, x] = h(!1), [d, C] = h(""), y = oe(null), [Q, U] = h(0), V = P.hasOwnProperty("value"), [Y, Z] = h(B), i = V ? A : Y, c = (e) => {
|
|
43
|
+
V || Z(e), R?.(e);
|
|
44
|
+
}, a = N(() => n ? Array.isArray(i) ? i : [] : i != null ? [i] : [], [i, n]), u = N(() => {
|
|
45
|
+
const e = m.filter((t) => a.includes(t.value));
|
|
47
46
|
if (n) {
|
|
48
|
-
const
|
|
49
|
-
return [...e, ...
|
|
50
|
-
} else if (
|
|
51
|
-
return [{ value:
|
|
47
|
+
const t = a.filter((r) => !e.find((f) => f.value === r)).map((r) => ({ value: r, label: r }));
|
|
48
|
+
return [...e, ...t];
|
|
49
|
+
} else if (a.length && !e.length)
|
|
50
|
+
return [{ value: a[0], label: a[0] }];
|
|
52
51
|
return e;
|
|
53
|
-
}, [m,
|
|
52
|
+
}, [m, a, n]), z = (e) => {
|
|
54
53
|
if (!e.disabled)
|
|
55
54
|
if (n) {
|
|
56
|
-
const
|
|
57
|
-
if (!
|
|
55
|
+
const t = a.includes(e.value);
|
|
56
|
+
if (!t && o !== void 0 && a.length >= o)
|
|
58
57
|
return;
|
|
59
58
|
c(
|
|
60
|
-
|
|
59
|
+
t ? a.filter((r) => r !== e.value) : [...a, e.value]
|
|
61
60
|
);
|
|
62
61
|
} else
|
|
63
62
|
c(e.value), x(!1);
|
|
64
63
|
}, k = de(() => {
|
|
65
64
|
c(n ? [] : void 0), C(""), p && p();
|
|
66
65
|
}, [c, p, n]), _ = N(() => g ? m.reduce(
|
|
67
|
-
(e,
|
|
68
|
-
const
|
|
69
|
-
return e[
|
|
66
|
+
(e, t) => {
|
|
67
|
+
const r = t[g] || "";
|
|
68
|
+
return e[r] = e[r] || [], e[r].push(t), e;
|
|
70
69
|
},
|
|
71
70
|
{}
|
|
72
71
|
) : { "": m }, [m, g]);
|
|
73
72
|
return ce(() => {
|
|
74
|
-
|
|
75
|
-
}, [
|
|
76
|
-
|
|
73
|
+
v && y.current && U(y.current.getBoundingClientRect().width);
|
|
74
|
+
}, [v]), /* @__PURE__ */ s("div", { className: w("flex flex-col gap-2", G), children: [
|
|
75
|
+
D && /* @__PURE__ */ l(ie, { children: D }),
|
|
77
76
|
/* @__PURE__ */ s(
|
|
78
|
-
|
|
77
|
+
me,
|
|
79
78
|
{
|
|
80
|
-
open:
|
|
81
|
-
onOpenChange: (e) => !
|
|
79
|
+
open: b ? !1 : v,
|
|
80
|
+
onOpenChange: (e) => !b && x(e),
|
|
82
81
|
modal: !0,
|
|
83
82
|
children: [
|
|
84
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ l(fe, { asChild: !0, children: /* @__PURE__ */ s(
|
|
85
84
|
"div",
|
|
86
85
|
{
|
|
87
|
-
ref:
|
|
88
|
-
className:
|
|
86
|
+
ref: y,
|
|
87
|
+
className: w(
|
|
89
88
|
"bg-d-input border-d-border/50 focus-within:ring-d-ring flex min-h-10 w-full min-w-[100px] cursor-pointer items-center justify-between gap-2 rounded-md border px-3 py-2 text-sm focus-within:ring-1",
|
|
90
|
-
|
|
91
|
-
|
|
89
|
+
ge[J],
|
|
90
|
+
b && "cursor-not-allowed opacity-50",
|
|
92
91
|
$
|
|
93
92
|
),
|
|
94
93
|
children: [
|
|
95
|
-
u.length === 0 ? /* @__PURE__ */
|
|
96
|
-
/* @__PURE__ */
|
|
94
|
+
u.length === 0 ? /* @__PURE__ */ l("span", { className: "text-d-muted-foreground", children: X }) : n ? /* @__PURE__ */ s("div", { className: "flex h-full w-full min-w-0 items-center justify-between gap-2", children: [
|
|
95
|
+
/* @__PURE__ */ l("div", { className: "flex min-w-0 flex-nowrap gap-1 overflow-auto", children: H ? /* @__PURE__ */ l(le, { children: u.map((e) => /* @__PURE__ */ s(
|
|
97
96
|
re,
|
|
98
97
|
{
|
|
99
98
|
variant: "secondary",
|
|
100
99
|
className: "hover:bg-d-secondary/100 bg-d-secondary/50 border-d-border flex cursor-pointer items-center gap-1 border",
|
|
101
|
-
onClick: (
|
|
102
|
-
|
|
100
|
+
onClick: (t) => {
|
|
101
|
+
t.stopPropagation(), z(e);
|
|
103
102
|
},
|
|
104
103
|
children: [
|
|
105
104
|
e.label,
|
|
106
|
-
!e.fixed && /* @__PURE__ */
|
|
105
|
+
!e.fixed && /* @__PURE__ */ l(S, { name: "X", size: "xs" })
|
|
107
106
|
]
|
|
108
107
|
},
|
|
109
108
|
e.value
|
|
110
|
-
)) }) : /* @__PURE__ */
|
|
111
|
-
n && /* @__PURE__ */
|
|
112
|
-
|
|
109
|
+
)) }) : /* @__PURE__ */ l("div", { children: T(u.length) }) }),
|
|
110
|
+
n && /* @__PURE__ */ l(
|
|
111
|
+
"div",
|
|
113
112
|
{
|
|
114
|
-
className: "
|
|
115
|
-
iconLeft: "X",
|
|
116
|
-
variant: "ghost-destructive",
|
|
117
|
-
size: "icon",
|
|
113
|
+
className: "border-d-input bg-d-accent cursor-pointer rounded-full p-1",
|
|
118
114
|
onClick: (e) => {
|
|
119
115
|
e.stopPropagation(), e.preventDefault(), k();
|
|
120
|
-
}
|
|
116
|
+
},
|
|
117
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
118
|
+
"aria-label": "Clear selection",
|
|
119
|
+
children: /* @__PURE__ */ l(
|
|
120
|
+
S,
|
|
121
|
+
{
|
|
122
|
+
name: "X",
|
|
123
|
+
size: "xs",
|
|
124
|
+
className: "!text-d-foreground opacity-50"
|
|
125
|
+
}
|
|
126
|
+
)
|
|
121
127
|
}
|
|
122
128
|
)
|
|
123
129
|
] }) : /* @__PURE__ */ s("div", { className: "flex h-full w-full min-w-0 items-center justify-between gap-2", children: [
|
|
124
|
-
/* @__PURE__ */
|
|
125
|
-
K && i !== void 0 && i !== null && /* @__PURE__ */
|
|
126
|
-
|
|
130
|
+
/* @__PURE__ */ l("div", { className: "min-w-0 flex-1 truncate", children: typeof u[0]?.label == "string" ? /* @__PURE__ */ l("span", { children: u[0]?.label }) : u[0]?.label }),
|
|
131
|
+
K && i !== void 0 && i !== null && /* @__PURE__ */ l(
|
|
132
|
+
"div",
|
|
127
133
|
{
|
|
128
|
-
className: "
|
|
129
|
-
iconLeft: "X",
|
|
130
|
-
variant: "ghost-destructive",
|
|
131
|
-
size: "icon",
|
|
134
|
+
className: "border-d-input bg-d-accent cursor-pointer rounded-full p-1",
|
|
132
135
|
onClick: (e) => {
|
|
133
136
|
e.stopPropagation(), e.preventDefault(), k();
|
|
134
|
-
}
|
|
137
|
+
},
|
|
138
|
+
onMouseDown: (e) => e.preventDefault(),
|
|
139
|
+
"aria-label": "Clear selection",
|
|
140
|
+
children: /* @__PURE__ */ l(
|
|
141
|
+
S,
|
|
142
|
+
{
|
|
143
|
+
name: "X",
|
|
144
|
+
size: "xs",
|
|
145
|
+
className: "!text-d-foreground opacity-50"
|
|
146
|
+
}
|
|
147
|
+
)
|
|
135
148
|
}
|
|
136
149
|
)
|
|
137
150
|
] }),
|
|
138
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ l(pe, { className: "h-4 w-4 opacity-50" })
|
|
139
152
|
]
|
|
140
153
|
}
|
|
141
154
|
) }),
|
|
142
|
-
/* @__PURE__ */
|
|
143
|
-
|
|
155
|
+
/* @__PURE__ */ l(
|
|
156
|
+
he,
|
|
144
157
|
{
|
|
145
158
|
className: "p-0",
|
|
146
159
|
style: { width: Q },
|
|
147
160
|
align: "start",
|
|
148
161
|
sideOffset: 4,
|
|
149
162
|
children: /* @__PURE__ */ s(ne, { shouldFilter: !!O, className: "w-full", children: [
|
|
150
|
-
O && /* @__PURE__ */
|
|
151
|
-
|
|
163
|
+
O && /* @__PURE__ */ l(
|
|
164
|
+
ae,
|
|
152
165
|
{
|
|
153
|
-
placeholder:
|
|
166
|
+
placeholder: F,
|
|
154
167
|
className: "placeholder:text-d-muted-foreground",
|
|
155
168
|
value: d,
|
|
156
169
|
onValueChange: C
|
|
157
170
|
}
|
|
158
171
|
),
|
|
159
|
-
/* @__PURE__ */ s(
|
|
160
|
-
/* @__PURE__ */
|
|
161
|
-
q && d && /* @__PURE__ */
|
|
162
|
-
|
|
172
|
+
/* @__PURE__ */ s(te, { className: "max-h-60 overflow-auto overscroll-contain", children: [
|
|
173
|
+
/* @__PURE__ */ l(se, { children: E }),
|
|
174
|
+
q && d && /* @__PURE__ */ l(j, { children: /* @__PURE__ */ l(
|
|
175
|
+
M,
|
|
163
176
|
{
|
|
164
177
|
className: "cursor-pointer",
|
|
165
178
|
onSelect: () => {
|
|
166
|
-
d && (c(n ? [...
|
|
179
|
+
d && (c(n ? [...a, d] : d), C(""), !n && x(!1));
|
|
167
180
|
},
|
|
168
181
|
children: /* @__PURE__ */ s("div", { className: "text-d-foreground text-xs", children: [
|
|
169
|
-
|
|
182
|
+
L,
|
|
170
183
|
" “",
|
|
171
184
|
d,
|
|
172
185
|
"”"
|
|
173
186
|
] })
|
|
174
187
|
}
|
|
175
188
|
) }),
|
|
176
|
-
Object.entries(_).map(([e,
|
|
177
|
-
const f =
|
|
189
|
+
Object.entries(_).map(([e, t]) => /* @__PURE__ */ l(j, { heading: e || void 0, children: t.map((r) => {
|
|
190
|
+
const f = a.includes(r.value), ee = n && o !== void 0 && !f && a.length >= o, I = r.disabled || ee;
|
|
178
191
|
return /* @__PURE__ */ s(
|
|
179
|
-
|
|
192
|
+
M,
|
|
180
193
|
{
|
|
181
|
-
value: typeof
|
|
182
|
-
onSelect: () => !I && z(
|
|
183
|
-
className:
|
|
194
|
+
value: typeof r.label == "string" ? r.label : String(r.value),
|
|
195
|
+
onSelect: () => !I && z(r),
|
|
196
|
+
className: w(
|
|
184
197
|
"cursor-pointer",
|
|
185
198
|
I && "cursor-not-allowed opacity-50",
|
|
186
199
|
!n && f && "bg-d-accent/75 text-d-accent-foreground"
|
|
187
200
|
),
|
|
188
201
|
children: [
|
|
189
|
-
n && /* @__PURE__ */
|
|
190
|
-
typeof
|
|
202
|
+
n && /* @__PURE__ */ l(ue, { checked: f, className: "mr-1" }),
|
|
203
|
+
typeof r.label == "string" ? /* @__PURE__ */ l("span", { children: r.label }) : r.label
|
|
191
204
|
]
|
|
192
205
|
},
|
|
193
|
-
|
|
206
|
+
r.value
|
|
194
207
|
);
|
|
195
208
|
}) }, e))
|
|
196
209
|
] }),
|
|
197
|
-
n && o !== void 0 &&
|
|
210
|
+
n && o !== void 0 && a.length >= o && /* @__PURE__ */ l("div", { className: "border-d-border text-d-muted-foreground border-t px-2 py-1 text-xs", children: W(o) })
|
|
198
211
|
] })
|
|
199
212
|
}
|
|
200
213
|
)
|
|
@@ -204,5 +217,5 @@ function ke(S) {
|
|
|
204
217
|
] });
|
|
205
218
|
}
|
|
206
219
|
export {
|
|
207
|
-
|
|
220
|
+
Oe as AppSelect
|
|
208
221
|
};
|