laif-ds 0.1.85 → 0.1.88
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/index3.js +5 -5
- package/dist/_virtual/index4.js +5 -5
- package/dist/_virtual/index5.js +4 -4
- package/dist/components/ui/app-editor.js +58 -58
- package/dist/components/ui/app-multiple-select-dropdown.js +111 -88
- package/dist/components/ui/async-select.js +182 -151
- package/dist/components/ui/button.js +1 -1
- package/dist/components/ui/checkbox.js +5 -5
- package/dist/components/ui/multiple-selector.js +202 -190
- package/dist/components/ui/navigation-menu.js +2 -2
- package/dist/components/ui/select.js +1 -1
- package/dist/components/ui/switch.js +5 -5
- package/dist/components/ui/weekly-calendar/appointment-card.js +39 -39
- package/dist/components/ui/weekly-calendar/calendar-header.js +2 -2
- package/dist/components/ui/weekly-calendar/day-column.js +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/node_modules/eventemitter3/index.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/unified/lib/index.js +1 -1
- package/dist/styles.css +1 -1
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
- package/dist/components/ui/command-portal.js +0 -67
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import * as
|
|
4
|
-
import { useState as
|
|
5
|
-
import { useDebounce as
|
|
6
|
-
import { cva as
|
|
7
|
-
import { cn as
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { Command as
|
|
11
|
-
import {
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
|
|
15
|
-
import me from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
16
|
-
const fe = _(
|
|
2
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
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";
|
|
7
|
+
import { cn as S } from "../../lib/utils.js";
|
|
8
|
+
import { Label as le } from "./label.js";
|
|
9
|
+
import { Popover as ae, PopoverTrigger as ce, PopoverContent as ie } from "./popover.js";
|
|
10
|
+
import { Command as de, CommandInput as fe, CommandList as me, CommandEmpty as ue, CommandGroup as G, CommandItem as M } from "./command.js";
|
|
11
|
+
import { Icon as B } from "./icon.js";
|
|
12
|
+
import pe from "../../node_modules/lucide-react/dist/esm/icons/loader-circle.js";
|
|
13
|
+
import he from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
14
|
+
const ge = re(
|
|
17
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",
|
|
18
16
|
{
|
|
19
17
|
variants: {
|
|
@@ -28,132 +26,153 @@ const fe = _(
|
|
|
28
26
|
}
|
|
29
27
|
}
|
|
30
28
|
);
|
|
31
|
-
function
|
|
32
|
-
fetcher:
|
|
33
|
-
preload:
|
|
34
|
-
filterFn:
|
|
35
|
-
renderOption:
|
|
29
|
+
function Pe({
|
|
30
|
+
fetcher: i,
|
|
31
|
+
preload: f,
|
|
32
|
+
filterFn: R,
|
|
33
|
+
renderOption: E,
|
|
36
34
|
getOptionValue: a,
|
|
37
|
-
getDisplayValue:
|
|
38
|
-
notFound:
|
|
39
|
-
loadingSkeleton:
|
|
40
|
-
label:
|
|
41
|
-
labelClassName:
|
|
42
|
-
placeholder:
|
|
43
|
-
value:
|
|
44
|
-
onChange:
|
|
45
|
-
disabled:
|
|
46
|
-
width:
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
size: q
|
|
35
|
+
getDisplayValue: g,
|
|
36
|
+
notFound: U,
|
|
37
|
+
loadingSkeleton: X,
|
|
38
|
+
label: z,
|
|
39
|
+
labelClassName: $,
|
|
40
|
+
placeholder: O = "Select...",
|
|
41
|
+
value: o = "",
|
|
42
|
+
onChange: x,
|
|
43
|
+
disabled: W = !1,
|
|
44
|
+
width: m = "200px",
|
|
45
|
+
triggerClassName: q,
|
|
46
|
+
noResultsMessage: H,
|
|
47
|
+
clearable: L = !0,
|
|
48
|
+
size: J
|
|
52
49
|
}) {
|
|
53
|
-
const [
|
|
54
|
-
|
|
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(
|
|
51
|
+
void 0
|
|
52
|
+
);
|
|
53
|
+
h(() => ((async () => {
|
|
55
54
|
try {
|
|
56
|
-
if (
|
|
55
|
+
if (N(!0), b(null), f) {
|
|
57
56
|
console.log(
|
|
58
57
|
"[AsyncSelect] Preload attivo: caricamento completo dei dati"
|
|
59
58
|
);
|
|
60
|
-
const
|
|
61
|
-
|
|
59
|
+
const s = await i("");
|
|
60
|
+
A(s), d(s);
|
|
62
61
|
} else {
|
|
63
|
-
const
|
|
64
|
-
d(
|
|
62
|
+
const s = await i(o);
|
|
63
|
+
d(s);
|
|
65
64
|
}
|
|
66
|
-
} catch (
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
} catch (s) {
|
|
66
|
+
b(
|
|
67
|
+
s instanceof Error ? s.message : "Failed to fetch options"
|
|
69
68
|
);
|
|
70
69
|
} finally {
|
|
71
|
-
|
|
70
|
+
N(!1);
|
|
72
71
|
}
|
|
73
72
|
})(), () => {
|
|
74
|
-
d([]),
|
|
75
|
-
}), [
|
|
76
|
-
if (
|
|
77
|
-
if (
|
|
78
|
-
if (
|
|
79
|
-
const t =
|
|
80
|
-
(
|
|
73
|
+
d([]), A([]);
|
|
74
|
+
}), [i, o, f]), h(() => {
|
|
75
|
+
if (c)
|
|
76
|
+
if (f)
|
|
77
|
+
if (u) {
|
|
78
|
+
const t = k.filter(
|
|
79
|
+
(s) => R ? R(s, u) : String(g(s)).toLowerCase().includes(u.toLowerCase())
|
|
81
80
|
);
|
|
82
81
|
d(t);
|
|
83
82
|
} else
|
|
84
|
-
d(
|
|
83
|
+
d(k);
|
|
85
84
|
else
|
|
86
85
|
(async () => {
|
|
87
86
|
try {
|
|
88
|
-
|
|
89
|
-
const
|
|
90
|
-
d(
|
|
91
|
-
} catch (
|
|
92
|
-
|
|
93
|
-
|
|
87
|
+
N(!0), b(null);
|
|
88
|
+
const s = await i(u);
|
|
89
|
+
d(s);
|
|
90
|
+
} catch (s) {
|
|
91
|
+
b(
|
|
92
|
+
s instanceof Error ? s.message : "Failed to fetch options"
|
|
94
93
|
);
|
|
95
94
|
} finally {
|
|
96
|
-
|
|
95
|
+
N(!1);
|
|
97
96
|
}
|
|
98
97
|
})();
|
|
99
98
|
}, [
|
|
100
|
-
|
|
99
|
+
c,
|
|
100
|
+
u,
|
|
101
101
|
f,
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
102
|
+
R,
|
|
103
|
+
k,
|
|
104
|
+
g
|
|
105
|
+
]), h(() => {
|
|
106
|
+
if (o && n.length > 0) {
|
|
107
|
+
const t = n.find((s) => a(s) === o);
|
|
108
|
+
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();
|
|
115
|
+
_(t.width);
|
|
116
|
+
}
|
|
117
|
+
}, [c]);
|
|
118
|
+
const V = F(
|
|
113
119
|
(t) => {
|
|
114
|
-
const
|
|
115
|
-
|
|
120
|
+
const s = L && t === o ? "" : t, se = n.find((ne) => a(ne) === s) || null;
|
|
121
|
+
C(se), x(s), j(!1);
|
|
116
122
|
},
|
|
117
|
-
[
|
|
118
|
-
),
|
|
123
|
+
[o, x, L, n, a]
|
|
124
|
+
), ee = F(
|
|
119
125
|
(t) => {
|
|
120
|
-
t.stopPropagation(), t.preventDefault(),
|
|
126
|
+
t.stopPropagation(), t.preventDefault(), C(null), x(""), j(!1);
|
|
121
127
|
},
|
|
122
|
-
[
|
|
123
|
-
),
|
|
124
|
-
return /* @__PURE__ */
|
|
125
|
-
|
|
126
|
-
/* @__PURE__ */
|
|
127
|
-
/* @__PURE__ */ e(
|
|
128
|
-
|
|
128
|
+
[x]
|
|
129
|
+
), te = p.useId();
|
|
130
|
+
return /* @__PURE__ */ r("div", { className: S("space-y-1.5", y && "w-full"), children: [
|
|
131
|
+
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(
|
|
134
|
+
"button",
|
|
129
135
|
{
|
|
130
|
-
id:
|
|
136
|
+
id: te,
|
|
131
137
|
type: "button",
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
"font-normal"
|
|
138
|
+
disabled: W,
|
|
139
|
+
className: S(
|
|
140
|
+
ge({ size: J }),
|
|
141
|
+
W && "cursor-not-allowed opacity-50",
|
|
142
|
+
q,
|
|
143
|
+
"font-normal",
|
|
144
|
+
y && "w-full"
|
|
140
145
|
),
|
|
141
|
-
style: { width:
|
|
142
|
-
|
|
143
|
-
children: /* @__PURE__ */
|
|
144
|
-
|
|
145
|
-
/* @__PURE__ */
|
|
146
|
-
|
|
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(
|
|
147
152
|
"div",
|
|
148
153
|
{
|
|
149
|
-
className: "
|
|
150
|
-
onClick:
|
|
154
|
+
className: "border-d-input bg-d-accent cursor-pointer rounded-full p-1",
|
|
155
|
+
onClick: ee,
|
|
151
156
|
onMouseDown: (t) => t.preventDefault(),
|
|
152
157
|
"aria-label": "Clear selection",
|
|
153
|
-
children: /* @__PURE__ */ e(
|
|
158
|
+
children: /* @__PURE__ */ e(
|
|
159
|
+
B,
|
|
160
|
+
{
|
|
161
|
+
name: "X",
|
|
162
|
+
size: "xs",
|
|
163
|
+
className: "!text-d-foreground opacity-50"
|
|
164
|
+
}
|
|
165
|
+
)
|
|
154
166
|
}
|
|
155
167
|
),
|
|
156
|
-
/* @__PURE__ */ e(
|
|
168
|
+
/* @__PURE__ */ e(
|
|
169
|
+
B,
|
|
170
|
+
{
|
|
171
|
+
name: "ChevronsUpDown",
|
|
172
|
+
size: "xs",
|
|
173
|
+
className: "!text-d-foreground opacity-50"
|
|
174
|
+
}
|
|
175
|
+
)
|
|
157
176
|
] })
|
|
158
177
|
] })
|
|
159
178
|
}
|
|
@@ -161,63 +180,75 @@ function ke({
|
|
|
161
180
|
/* @__PURE__ */ e(
|
|
162
181
|
ie,
|
|
163
182
|
{
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
183
|
+
className: S("p-0"),
|
|
184
|
+
style: {
|
|
185
|
+
width: y ? Z : typeof m == "number" ? `${m}px` : m
|
|
186
|
+
},
|
|
187
|
+
align: "start",
|
|
188
|
+
side: "bottom",
|
|
189
|
+
sideOffset: 4,
|
|
190
|
+
onWheel: (t) => t.stopPropagation(),
|
|
191
|
+
avoidCollisions: !1,
|
|
192
|
+
children: /* @__PURE__ */ r(
|
|
193
|
+
de,
|
|
194
|
+
{
|
|
195
|
+
shouldFilter: !1,
|
|
196
|
+
className: "w-full border-none shadow-lg",
|
|
197
|
+
children: [
|
|
198
|
+
/* @__PURE__ */ e(
|
|
199
|
+
fe,
|
|
200
|
+
{
|
|
201
|
+
ref: I,
|
|
202
|
+
placeholder: O,
|
|
203
|
+
value: D,
|
|
204
|
+
onValueChange: Y
|
|
176
205
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
206
|
+
),
|
|
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(
|
|
213
|
+
M,
|
|
214
|
+
{
|
|
215
|
+
value: a(t),
|
|
216
|
+
onSelect: V,
|
|
217
|
+
className: "cursor-pointer",
|
|
218
|
+
children: [
|
|
219
|
+
E ? E(t) : /* @__PURE__ */ e("span", { children: g(t) }),
|
|
220
|
+
/* @__PURE__ */ e(
|
|
221
|
+
he,
|
|
222
|
+
{
|
|
223
|
+
className: S(
|
|
224
|
+
"ml-auto h-4 w-4",
|
|
225
|
+
o === a(t) ? "opacity-100" : "opacity-0"
|
|
226
|
+
)
|
|
227
|
+
}
|
|
198
228
|
)
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
229
|
+
]
|
|
230
|
+
},
|
|
231
|
+
a(t)
|
|
232
|
+
)) })
|
|
233
|
+
] })
|
|
234
|
+
]
|
|
235
|
+
}
|
|
236
|
+
)
|
|
207
237
|
}
|
|
208
238
|
)
|
|
209
|
-
] })
|
|
239
|
+
] }) })
|
|
210
240
|
] });
|
|
211
241
|
}
|
|
212
|
-
function
|
|
213
|
-
return /* @__PURE__ */ e(
|
|
242
|
+
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: [
|
|
214
244
|
/* @__PURE__ */ e("div", { className: "bg-d-secondary h-6 w-6 animate-pulse rounded-full" }),
|
|
215
|
-
/* @__PURE__ */
|
|
245
|
+
/* @__PURE__ */ r("div", { className: "flex flex-1 flex-col gap-1", children: [
|
|
216
246
|
/* @__PURE__ */ e("div", { className: "bg-d-secondary h-4 w-24 animate-pulse rounded" }),
|
|
217
247
|
/* @__PURE__ */ e("div", { className: "bg-d-secondary h-3 w-16 animate-pulse rounded" })
|
|
218
248
|
] })
|
|
219
|
-
] }) },
|
|
249
|
+
] }) }, i)) });
|
|
220
250
|
}
|
|
221
251
|
export {
|
|
222
|
-
|
|
252
|
+
Pe as AsyncSelect,
|
|
253
|
+
ge as asyncSelectTriggerVariants
|
|
223
254
|
};
|
|
@@ -14,7 +14,7 @@ const m = h(
|
|
|
14
14
|
outline: "border bg-d-background shadow-xs hover:bg-d-accent hover:text-d-accent-foreground dark:bg-d-input/30 dark:border-d-input dark:hover:bg-d-input/50",
|
|
15
15
|
"outline-primary": "border !border-d-primary bg-d-background shadow-xs text-d-primary/80 hover:!text-d-primary",
|
|
16
16
|
secondary: "bg-d-secondary text-d-secondary-foreground shadow-xs hover:bg-d-secondary/80 hover:text-d-secondary-foreground",
|
|
17
|
-
ghost: "hover:bg-d-accent hover:text-d-accent-foreground dark:hover:bg-d-accent
|
|
17
|
+
ghost: "hover:bg-d-accent hover:text-d-accent-foreground dark:hover:bg-d-accent",
|
|
18
18
|
link: "text-d-primary underline-offset-4 hover:underline"
|
|
19
19
|
},
|
|
20
20
|
size: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx as e } from "react/jsx-runtime";
|
|
3
|
-
import { Checkbox as t, CheckboxIndicator as
|
|
4
|
-
import { cn as
|
|
3
|
+
import { Checkbox as t, CheckboxIndicator as d } from "../../node_modules/@radix-ui/react-checkbox/dist/index.js";
|
|
4
|
+
import { cn as a } from "../../lib/utils.js";
|
|
5
5
|
import o from "../../node_modules/lucide-react/dist/esm/icons/check.js";
|
|
6
6
|
function b({
|
|
7
7
|
className: r,
|
|
@@ -11,13 +11,13 @@ function b({
|
|
|
11
11
|
t,
|
|
12
12
|
{
|
|
13
13
|
"data-slot": "checkbox",
|
|
14
|
-
className:
|
|
15
|
-
"peer
|
|
14
|
+
className: a(
|
|
15
|
+
"peer bg-d-input border-d-border data-[state=checked]:bg-d-primary data-[state=checked]:border-d-primary data-[state=checked]:text-d-primary-foreground focus-visible:border-d-ring focus-visible:ring-d-ring/50 aria-invalid:border-d-destructive aria-invalid:ring-d-destructive/20 dark:aria-invalid:ring-d-destructive/40 size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
|
|
16
16
|
r
|
|
17
17
|
),
|
|
18
18
|
...i,
|
|
19
19
|
children: /* @__PURE__ */ e(
|
|
20
|
-
|
|
20
|
+
d,
|
|
21
21
|
{
|
|
22
22
|
"data-slot": "checkbox-indicator",
|
|
23
23
|
className: "flex items-center justify-center text-current transition-none",
|