laif-ds 0.2.39 → 0.2.41
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/components/ui/app-form.js +273 -0
- package/dist/components/ui/button.js +7 -7
- package/dist/components/ui/date-picker.js +66 -62
- package/dist/components/ui/dialog.js +36 -35
- package/dist/components/ui/input.js +76 -75
- package/dist/components/ui/textarea.js +9 -9
- package/dist/index.d.ts +29 -1
- package/dist/index.js +292 -290
- package/dist/styles.v3.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsxs as l, jsx as a } from "react/jsx-runtime";
|
|
3
|
+
import { cn as o } from "../../lib/utils.js";
|
|
4
|
+
import { Controller as w } from "../../node_modules/react-hook-form/dist/index.esm.js";
|
|
5
|
+
import { AppSelect as m } from "./app-select.js";
|
|
6
|
+
import { Button as V } from "./button.js";
|
|
7
|
+
import { Checkbox as j } from "./checkbox.js";
|
|
8
|
+
import { DatePicker as A } from "./date-picker.js";
|
|
9
|
+
import { Input as F } from "./input.js";
|
|
10
|
+
import { Label as t } from "./label.js";
|
|
11
|
+
import { RadioGroup as I, RadioGroupItem as R } from "./radio-group.js";
|
|
12
|
+
import { Slider as B } from "./slider.js";
|
|
13
|
+
import { Switch as $ } from "./switch.js";
|
|
14
|
+
import { Textarea as D } from "./textarea.js";
|
|
15
|
+
import { Typo as i } from "./typo.js";
|
|
16
|
+
const U = ({
|
|
17
|
+
items: h,
|
|
18
|
+
cols: v = "2",
|
|
19
|
+
form: b,
|
|
20
|
+
submitText: g = "Invia",
|
|
21
|
+
onSubmit: x,
|
|
22
|
+
isSubmitting: p = !1
|
|
23
|
+
}) => {
|
|
24
|
+
const {
|
|
25
|
+
control: C,
|
|
26
|
+
handleSubmit: N,
|
|
27
|
+
formState: { errors: y, isValid: f, isDirty: S }
|
|
28
|
+
} = b, k = (e) => {
|
|
29
|
+
const c = y[e.name]?.message, d = c ? String(c) : void 0;
|
|
30
|
+
return /* @__PURE__ */ a("div", { children: /* @__PURE__ */ a(
|
|
31
|
+
w,
|
|
32
|
+
{
|
|
33
|
+
name: e.name,
|
|
34
|
+
control: C,
|
|
35
|
+
render: ({ field: r }) => {
|
|
36
|
+
const s = /* @__PURE__ */ l("div", { className: "mb-2 flex items-center justify-between", children: [
|
|
37
|
+
/* @__PURE__ */ a(t, { children: e.label }),
|
|
38
|
+
d && /* @__PURE__ */ a("span", { className: "text-d-destructive text-xs", children: d })
|
|
39
|
+
] });
|
|
40
|
+
switch (e.component) {
|
|
41
|
+
case "input":
|
|
42
|
+
return /* @__PURE__ */ l("div", { children: [
|
|
43
|
+
s,
|
|
44
|
+
/* @__PURE__ */ a(
|
|
45
|
+
F,
|
|
46
|
+
{
|
|
47
|
+
...r,
|
|
48
|
+
placeholder: e.placeholder,
|
|
49
|
+
className: o(d && "border-d-destructive"),
|
|
50
|
+
disabled: e.disabled
|
|
51
|
+
}
|
|
52
|
+
)
|
|
53
|
+
] });
|
|
54
|
+
case "textarea":
|
|
55
|
+
return /* @__PURE__ */ l("div", { children: [
|
|
56
|
+
s,
|
|
57
|
+
/* @__PURE__ */ a(
|
|
58
|
+
D,
|
|
59
|
+
{
|
|
60
|
+
...r,
|
|
61
|
+
placeholder: e.placeholder,
|
|
62
|
+
className: o(d && "border-d-destructive"),
|
|
63
|
+
disabled: e.disabled
|
|
64
|
+
}
|
|
65
|
+
)
|
|
66
|
+
] });
|
|
67
|
+
case "radio":
|
|
68
|
+
return /* @__PURE__ */ l("div", { children: [
|
|
69
|
+
s,
|
|
70
|
+
/* @__PURE__ */ a(
|
|
71
|
+
I,
|
|
72
|
+
{
|
|
73
|
+
value: r.value != null ? String(r.value) : "",
|
|
74
|
+
onValueChange: (n) => r.onChange(n),
|
|
75
|
+
className: "space-y-2",
|
|
76
|
+
disabled: e.disabled,
|
|
77
|
+
children: (e.options ?? []).map((n) => {
|
|
78
|
+
const u = `${e.name}-${n.value}`;
|
|
79
|
+
return /* @__PURE__ */ l(
|
|
80
|
+
"div",
|
|
81
|
+
{
|
|
82
|
+
className: "flex items-center gap-2",
|
|
83
|
+
children: [
|
|
84
|
+
/* @__PURE__ */ a(
|
|
85
|
+
R,
|
|
86
|
+
{
|
|
87
|
+
id: u,
|
|
88
|
+
value: String(n.value),
|
|
89
|
+
disabled: e.disabled
|
|
90
|
+
}
|
|
91
|
+
),
|
|
92
|
+
/* @__PURE__ */ a(
|
|
93
|
+
t,
|
|
94
|
+
{
|
|
95
|
+
htmlFor: u,
|
|
96
|
+
className: o(
|
|
97
|
+
"cursor-pointer",
|
|
98
|
+
e.disabled && "cursor-not-allowed opacity-60"
|
|
99
|
+
),
|
|
100
|
+
children: n.label
|
|
101
|
+
}
|
|
102
|
+
)
|
|
103
|
+
]
|
|
104
|
+
},
|
|
105
|
+
n.value
|
|
106
|
+
);
|
|
107
|
+
})
|
|
108
|
+
}
|
|
109
|
+
)
|
|
110
|
+
] });
|
|
111
|
+
case "select":
|
|
112
|
+
return /* @__PURE__ */ l("div", { children: [
|
|
113
|
+
s,
|
|
114
|
+
/* @__PURE__ */ a(
|
|
115
|
+
m,
|
|
116
|
+
{
|
|
117
|
+
...r,
|
|
118
|
+
onValueChange: (n) => r.onChange(n),
|
|
119
|
+
options: e.options ?? [],
|
|
120
|
+
placeholder: e.placeholder,
|
|
121
|
+
disabled: e.disabled
|
|
122
|
+
}
|
|
123
|
+
)
|
|
124
|
+
] });
|
|
125
|
+
case "multiselect":
|
|
126
|
+
return /* @__PURE__ */ l("div", { children: [
|
|
127
|
+
s,
|
|
128
|
+
/* @__PURE__ */ a(
|
|
129
|
+
m,
|
|
130
|
+
{
|
|
131
|
+
...r,
|
|
132
|
+
multiple: !0,
|
|
133
|
+
onValueChange: (n) => r.onChange(n),
|
|
134
|
+
options: e.options ?? [],
|
|
135
|
+
placeholder: e.placeholder,
|
|
136
|
+
disabled: e.disabled
|
|
137
|
+
}
|
|
138
|
+
)
|
|
139
|
+
] });
|
|
140
|
+
case "datepicker":
|
|
141
|
+
return /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
142
|
+
s,
|
|
143
|
+
/* @__PURE__ */ a(
|
|
144
|
+
A,
|
|
145
|
+
{
|
|
146
|
+
value: r.value,
|
|
147
|
+
onChange: e.disabled || e.calendarRange ? void 0 : (n) => r.onChange(n),
|
|
148
|
+
placeholder: e.placeholder,
|
|
149
|
+
disabled: e.disabled,
|
|
150
|
+
customCalendarProps: e.disabled ? {
|
|
151
|
+
disabled: !0,
|
|
152
|
+
mode: "single"
|
|
153
|
+
} : e.calendarRange ? {
|
|
154
|
+
mode: "range",
|
|
155
|
+
selected: r.value,
|
|
156
|
+
onSelect: (n) => r.onChange(n)
|
|
157
|
+
} : void 0
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
] });
|
|
161
|
+
case "checkbox":
|
|
162
|
+
return /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
|
|
163
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-2", children: [
|
|
164
|
+
/* @__PURE__ */ a(
|
|
165
|
+
j,
|
|
166
|
+
{
|
|
167
|
+
...r,
|
|
168
|
+
id: e.name,
|
|
169
|
+
onCheckedChange: (n) => r.onChange(n),
|
|
170
|
+
defaultChecked: !!e.defaultValue,
|
|
171
|
+
disabled: e.disabled
|
|
172
|
+
}
|
|
173
|
+
),
|
|
174
|
+
/* @__PURE__ */ a(
|
|
175
|
+
t,
|
|
176
|
+
{
|
|
177
|
+
htmlFor: e.name,
|
|
178
|
+
className: o(
|
|
179
|
+
"cursor-pointer",
|
|
180
|
+
e.disabled && "cursor-not-allowed opacity-60"
|
|
181
|
+
),
|
|
182
|
+
children: e.label
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
d && /* @__PURE__ */ a("span", { className: "text-d-destructive text-xs", children: d })
|
|
186
|
+
] }),
|
|
187
|
+
e.caption && /* @__PURE__ */ a(
|
|
188
|
+
i,
|
|
189
|
+
{
|
|
190
|
+
variant: "caption",
|
|
191
|
+
className: "text-d-muted-foreground",
|
|
192
|
+
children: e.caption
|
|
193
|
+
}
|
|
194
|
+
)
|
|
195
|
+
] });
|
|
196
|
+
case "switch":
|
|
197
|
+
return /* @__PURE__ */ l("div", { className: "space-y-1.5", children: [
|
|
198
|
+
/* @__PURE__ */ l("div", { className: "flex items-center justify-between", children: [
|
|
199
|
+
/* @__PURE__ */ l("div", { children: [
|
|
200
|
+
/* @__PURE__ */ a(t, { htmlFor: e.name, children: e.label }),
|
|
201
|
+
e.caption && /* @__PURE__ */ a(
|
|
202
|
+
i,
|
|
203
|
+
{
|
|
204
|
+
variant: "caption",
|
|
205
|
+
className: "text-d-muted-foreground mt-0.5",
|
|
206
|
+
children: e.caption
|
|
207
|
+
}
|
|
208
|
+
)
|
|
209
|
+
] }),
|
|
210
|
+
/* @__PURE__ */ a(
|
|
211
|
+
$,
|
|
212
|
+
{
|
|
213
|
+
id: e.name,
|
|
214
|
+
checked: !!r.value,
|
|
215
|
+
onCheckedChange: (n) => r.onChange(n),
|
|
216
|
+
disabled: e.disabled
|
|
217
|
+
}
|
|
218
|
+
)
|
|
219
|
+
] }),
|
|
220
|
+
d && /* @__PURE__ */ a("span", { className: "text-d-destructive text-xs", children: d })
|
|
221
|
+
] });
|
|
222
|
+
case "slider":
|
|
223
|
+
return /* @__PURE__ */ l("div", { children: [
|
|
224
|
+
s,
|
|
225
|
+
/* @__PURE__ */ a(
|
|
226
|
+
B,
|
|
227
|
+
{
|
|
228
|
+
value: Array.isArray(r.value) ? r.value : [r.value || e.min || 0],
|
|
229
|
+
onValueChange: (n) => r.onChange(n[0]),
|
|
230
|
+
min: e.min ?? 0,
|
|
231
|
+
max: e.max ?? 100,
|
|
232
|
+
step: e.step ?? 1,
|
|
233
|
+
disabled: e.disabled,
|
|
234
|
+
showValues: !0
|
|
235
|
+
}
|
|
236
|
+
),
|
|
237
|
+
e.caption && /* @__PURE__ */ a(
|
|
238
|
+
i,
|
|
239
|
+
{
|
|
240
|
+
variant: "caption",
|
|
241
|
+
className: "text-d-muted-foreground mt-1",
|
|
242
|
+
children: e.caption
|
|
243
|
+
}
|
|
244
|
+
)
|
|
245
|
+
] });
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
) });
|
|
250
|
+
};
|
|
251
|
+
return /* @__PURE__ */ l("form", { onSubmit: N((e) => x?.(e)), children: [
|
|
252
|
+
/* @__PURE__ */ a("div", { className: o("grid gap-4", `grid-cols-${v}`), children: h.map((e, c) => /* @__PURE__ */ a(
|
|
253
|
+
"div",
|
|
254
|
+
{
|
|
255
|
+
className: o(c === h.length - 1 && "col-span-full"),
|
|
256
|
+
children: k(e)
|
|
257
|
+
},
|
|
258
|
+
e.name
|
|
259
|
+
)) }),
|
|
260
|
+
/* @__PURE__ */ a("div", { className: "mt-4 flex justify-end", children: /* @__PURE__ */ a(
|
|
261
|
+
V,
|
|
262
|
+
{
|
|
263
|
+
type: "submit",
|
|
264
|
+
disabled: !f || !S || p,
|
|
265
|
+
isLoading: p,
|
|
266
|
+
children: g
|
|
267
|
+
}
|
|
268
|
+
) })
|
|
269
|
+
] });
|
|
270
|
+
};
|
|
271
|
+
export {
|
|
272
|
+
U as AppForm
|
|
273
|
+
};
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { jsx as r, jsxs as u } from "react/jsx-runtime";
|
|
3
3
|
import { Root as f } from "../../node_modules/@radix-ui/react-slot/dist/index.js";
|
|
4
4
|
import { cva as m } from "../../node_modules/class-variance-authority/dist/index.js";
|
|
5
|
-
import { cn as
|
|
6
|
-
import { Icon as
|
|
5
|
+
import { cn as l } from "../../lib/utils.js";
|
|
6
|
+
import { Icon as c } from "./icon.js";
|
|
7
7
|
const v = m(
|
|
8
|
-
"cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all focus-visible:ring-d-ring/50 focus-visible:ring-[3px] aria-invalid:ring-d-destructive/20 aria-invalid:border-d-destructive transition-all duration-200 ease-out transform-gpu active:scale-[0.98] active:shadow-sm overflow-
|
|
8
|
+
"cursor-pointer inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all focus-visible:ring-d-ring/50 focus-visible:ring-[3px] aria-invalid:ring-d-destructive/20 aria-invalid:border-d-destructive transition-all duration-200 ease-out transform-gpu active:scale-[0.98] active:shadow-sm overflow-x-clip overflow-y-visible relative group disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-d-ring",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
@@ -48,14 +48,14 @@ function w({
|
|
|
48
48
|
i,
|
|
49
49
|
{
|
|
50
50
|
"data-slot": "button",
|
|
51
|
-
className:
|
|
51
|
+
className: l(v({ variant: a, size: e, className: o })),
|
|
52
52
|
...t
|
|
53
53
|
}
|
|
54
54
|
) : /* @__PURE__ */ u(
|
|
55
55
|
i,
|
|
56
56
|
{
|
|
57
57
|
"data-slot": "button",
|
|
58
|
-
className:
|
|
58
|
+
className: l(v({ variant: a, size: e, className: o }), "relative"),
|
|
59
59
|
...t,
|
|
60
60
|
children: [
|
|
61
61
|
b ? /* @__PURE__ */ u(
|
|
@@ -90,7 +90,7 @@ function w({
|
|
|
90
90
|
]
|
|
91
91
|
}
|
|
92
92
|
) : s && /* @__PURE__ */ r(
|
|
93
|
-
|
|
93
|
+
c,
|
|
94
94
|
{
|
|
95
95
|
name: s,
|
|
96
96
|
size: e === "default" ? "md" : e === "sm" ? "xs" : "sm"
|
|
@@ -98,7 +98,7 @@ function w({
|
|
|
98
98
|
),
|
|
99
99
|
t.children,
|
|
100
100
|
n && /* @__PURE__ */ r(
|
|
101
|
-
|
|
101
|
+
c,
|
|
102
102
|
{
|
|
103
103
|
name: n,
|
|
104
104
|
size: e === "default" ? "md" : e === "sm" ? "xs" : "sm"
|
|
@@ -1,88 +1,92 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsxs as
|
|
3
|
-
import { buttonVariants as
|
|
4
|
-
import { Calendar as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import { Popover as
|
|
7
|
-
import { cn as
|
|
8
|
-
import * as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
import { jsxs as d, jsx as o } from "react/jsx-runtime";
|
|
3
|
+
import { buttonVariants as N } from "./button.js";
|
|
4
|
+
import { Calendar as k } from "./calendar.js";
|
|
5
|
+
import { Icon as v } from "./icon.js";
|
|
6
|
+
import { Popover as I, PopoverTrigger as E, PopoverContent as R } from "./popover.js";
|
|
7
|
+
import { cn as T } from "../../lib/utils.js";
|
|
8
|
+
import * as x from "react";
|
|
9
|
+
import { useEffect as V } from "react";
|
|
10
|
+
import { formatDate as m } from "../../node_modules/date-fns/format.js";
|
|
11
|
+
import { isSameDay as q } from "../../node_modules/date-fns/isSameDay.js";
|
|
12
|
+
function U({
|
|
13
|
+
value: e,
|
|
14
|
+
onChange: c,
|
|
15
|
+
placeholder: b = "Seleziona data",
|
|
16
|
+
dateFormat: f = "dd/MM/yyyy",
|
|
16
17
|
className: y,
|
|
17
|
-
buttonVariant:
|
|
18
|
-
disabled:
|
|
19
|
-
size:
|
|
20
|
-
firstDate:
|
|
21
|
-
lastDate:
|
|
22
|
-
availableDates:
|
|
23
|
-
locale:
|
|
24
|
-
initialCalendarMonth:
|
|
25
|
-
customCalendarProps:
|
|
18
|
+
buttonVariant: j = "default",
|
|
19
|
+
disabled: t = !1,
|
|
20
|
+
size: i = "default",
|
|
21
|
+
firstDate: a,
|
|
22
|
+
lastDate: p,
|
|
23
|
+
availableDates: l,
|
|
24
|
+
locale: C,
|
|
25
|
+
initialCalendarMonth: u,
|
|
26
|
+
customCalendarProps: P
|
|
26
27
|
}) {
|
|
27
|
-
const [
|
|
28
|
-
|
|
29
|
-
)
|
|
30
|
-
|
|
31
|
-
c(e), l(e || m);
|
|
32
|
-
}, [e]);
|
|
33
|
-
const P = (r) => {
|
|
34
|
-
c(r), r && l(r), d && d(r);
|
|
28
|
+
const [r, h] = x.useState(e), [S, g] = x.useState(
|
|
29
|
+
u
|
|
30
|
+
), w = (n) => {
|
|
31
|
+
h(n), n && g(n), c && c(n);
|
|
35
32
|
};
|
|
36
|
-
let
|
|
37
|
-
return
|
|
38
|
-
(
|
|
39
|
-
(
|
|
33
|
+
let s = [];
|
|
34
|
+
return a && s.push({ before: a }), p && s.push({ after: p }), l?.length && s.push(
|
|
35
|
+
(n) => !l.some(
|
|
36
|
+
(M) => q(M, n)
|
|
40
37
|
)
|
|
41
|
-
),
|
|
42
|
-
|
|
38
|
+
), t && (s = [!0]), V(() => {
|
|
39
|
+
h(r), g(r || u);
|
|
40
|
+
}, [r]), /* @__PURE__ */ d(I, { open: t ? !1 : void 0, children: [
|
|
41
|
+
/* @__PURE__ */ o(E, { asChild: !0, children: /* @__PURE__ */ o(
|
|
43
42
|
"div",
|
|
44
43
|
{
|
|
45
|
-
className:
|
|
46
|
-
|
|
47
|
-
"border-d-
|
|
48
|
-
!
|
|
49
|
-
|
|
44
|
+
className: T(
|
|
45
|
+
N({ variant: j, size: i }),
|
|
46
|
+
"border-d-border/50 text-d-foreground hover:border-d-ring focus-visible:border-d-ring focus-visible:ring-d-ring/50 ring-offset-background data-[placeholder]:text-d-muted-foreground flex items-center justify-between border !bg-transparent px-3 py-2 font-normal whitespace-nowrap focus-visible:outline-none [&>span]:line-clamp-1",
|
|
47
|
+
!r && "text-d-muted-foreground",
|
|
48
|
+
t && "cursor-not-allowed opacity-50",
|
|
50
49
|
y,
|
|
51
|
-
|
|
52
|
-
|
|
50
|
+
i === "sm" && "text-xs",
|
|
51
|
+
i === "lg" && "text-lg"
|
|
53
52
|
),
|
|
54
|
-
"aria-disabled":
|
|
53
|
+
"aria-disabled": t,
|
|
55
54
|
role: "button",
|
|
56
|
-
tabIndex:
|
|
57
|
-
onClick:
|
|
55
|
+
tabIndex: t ? -1 : 0,
|
|
56
|
+
onClick: t ? void 0 : () => {
|
|
58
57
|
},
|
|
59
|
-
children: /* @__PURE__ */
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
-
|
|
58
|
+
children: /* @__PURE__ */ d("div", { className: "flex w-full items-center justify-between gap-2", children: [
|
|
59
|
+
/* @__PURE__ */ o(
|
|
60
|
+
v,
|
|
62
61
|
{
|
|
63
62
|
name: "Calendar",
|
|
64
|
-
size:
|
|
63
|
+
size: i === "default" ? "md" : i === "sm" ? "xs" : "sm"
|
|
65
64
|
}
|
|
66
65
|
),
|
|
67
|
-
e
|
|
66
|
+
e && typeof e == "object" && "from" in e ? /* @__PURE__ */ d("span", { children: [
|
|
67
|
+
e.from && m(e.from, f),
|
|
68
|
+
e.from && e.to && " - ",
|
|
69
|
+
e.to && m(e.to, f)
|
|
70
|
+
] }) : r ? /* @__PURE__ */ o("span", { children: m(r, f) }) : /* @__PURE__ */ o("span", { className: "text-d-muted-foreground", children: b })
|
|
68
71
|
] })
|
|
69
72
|
}
|
|
70
73
|
) }),
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
-
|
|
74
|
+
/* @__PURE__ */ o(R, { className: "w-auto p-0", children: /* @__PURE__ */ o(
|
|
75
|
+
k,
|
|
73
76
|
{
|
|
74
|
-
...
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
77
|
+
...P || {
|
|
78
|
+
mode: "single",
|
|
79
|
+
selected: r,
|
|
80
|
+
onSelect: w
|
|
81
|
+
},
|
|
78
82
|
autoFocus: !0,
|
|
79
|
-
disabled:
|
|
80
|
-
locale:
|
|
81
|
-
defaultMonth:
|
|
83
|
+
disabled: s,
|
|
84
|
+
locale: C,
|
|
85
|
+
defaultMonth: S
|
|
82
86
|
}
|
|
83
87
|
) })
|
|
84
88
|
] });
|
|
85
89
|
}
|
|
86
90
|
export {
|
|
87
|
-
|
|
91
|
+
U as DatePicker
|
|
88
92
|
};
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as a, jsxs as
|
|
3
|
-
import { Root as c, Content as
|
|
2
|
+
import { jsx as a, jsxs as s } from "react/jsx-runtime";
|
|
3
|
+
import { Root as c, Content as u, Close as l, Description as f, Title as m, Trigger as p, Portal as x, Overlay as v } from "../../node_modules/@radix-ui/react-dialog/dist/index.js";
|
|
4
4
|
import { cn as o } from "../../lib/utils.js";
|
|
5
5
|
import D from "../../node_modules/lucide-react/dist/esm/icons/x.js";
|
|
6
|
-
function
|
|
6
|
+
function k({
|
|
7
7
|
...t
|
|
8
8
|
}) {
|
|
9
9
|
return /* @__PURE__ */ a(c, { "data-slot": "dialog", ...t });
|
|
10
10
|
}
|
|
11
|
-
function
|
|
11
|
+
function T({
|
|
12
12
|
...t
|
|
13
13
|
}) {
|
|
14
|
-
return /* @__PURE__ */ a(
|
|
14
|
+
return /* @__PURE__ */ a(p, { "data-slot": "dialog-trigger", ...t });
|
|
15
15
|
}
|
|
16
|
-
function
|
|
16
|
+
function b({
|
|
17
17
|
...t
|
|
18
18
|
}) {
|
|
19
|
-
return /* @__PURE__ */ a(
|
|
19
|
+
return /* @__PURE__ */ a(x, { "data-slot": "dialog-portal", ...t });
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function j({
|
|
22
22
|
...t
|
|
23
23
|
}) {
|
|
24
24
|
return /* @__PURE__ */ a(l, { "data-slot": "dialog-close", ...t });
|
|
25
25
|
}
|
|
26
|
-
function
|
|
26
|
+
function h({
|
|
27
27
|
className: t,
|
|
28
28
|
...e
|
|
29
29
|
}) {
|
|
30
30
|
return /* @__PURE__ */ a(
|
|
31
|
-
|
|
31
|
+
v,
|
|
32
32
|
{
|
|
33
33
|
"data-slot": "dialog-overlay",
|
|
34
34
|
className: o(
|
|
@@ -39,36 +39,37 @@ function b({
|
|
|
39
39
|
}
|
|
40
40
|
);
|
|
41
41
|
}
|
|
42
|
-
function
|
|
42
|
+
function O({
|
|
43
43
|
className: t,
|
|
44
44
|
children: e,
|
|
45
45
|
size: r = "default",
|
|
46
|
+
closeOnOverlay: d = !0,
|
|
46
47
|
...i
|
|
47
48
|
}) {
|
|
48
|
-
const
|
|
49
|
+
const g = {
|
|
49
50
|
sm: "sm:max-w-sm",
|
|
50
51
|
default: "sm:max-w-lg",
|
|
51
52
|
lg: "sm:max-w-2xl",
|
|
52
53
|
xl: "sm:max-w-3xl"
|
|
53
54
|
}[r];
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
/* @__PURE__ */ a(
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
|
|
55
|
+
return /* @__PURE__ */ s(b, { "data-slot": "dialog-portal", children: [
|
|
56
|
+
/* @__PURE__ */ a(h, {}),
|
|
57
|
+
/* @__PURE__ */ s(
|
|
58
|
+
u,
|
|
58
59
|
{
|
|
59
60
|
"data-slot": "dialog-content",
|
|
60
|
-
onPointerDownOutside: (
|
|
61
|
-
|
|
61
|
+
onPointerDownOutside: (n) => {
|
|
62
|
+
n.target?.closest("[data-command-portal]") && n.preventDefault(), d || n.preventDefault();
|
|
62
63
|
},
|
|
63
64
|
className: o(
|
|
64
65
|
"bg-d-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 border-d-border fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200",
|
|
65
|
-
|
|
66
|
+
g,
|
|
66
67
|
t
|
|
67
68
|
),
|
|
68
69
|
...i,
|
|
69
70
|
children: [
|
|
70
71
|
e,
|
|
71
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ s(l, { className: "ring-offset-d-background focus:ring-d-ring data-[state=open]:bg-d-accent data-[state=open]:text-d-secondary-foreground absolute top-4 right-4 rounded-md p-1.5 bg-d-muted/30 hover:bg-d-muted/60 cursor-pointer transition-all hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4", children: [
|
|
72
73
|
/* @__PURE__ */ a(D, {}),
|
|
73
74
|
/* @__PURE__ */ a("span", { className: "sr-only", children: "Close" })
|
|
74
75
|
] })
|
|
@@ -77,7 +78,7 @@ function j({
|
|
|
77
78
|
)
|
|
78
79
|
] });
|
|
79
80
|
}
|
|
80
|
-
function
|
|
81
|
+
function P({ className: t, ...e }) {
|
|
81
82
|
return /* @__PURE__ */ a(
|
|
82
83
|
"div",
|
|
83
84
|
{
|
|
@@ -87,7 +88,7 @@ function O({ className: t, ...e }) {
|
|
|
87
88
|
}
|
|
88
89
|
);
|
|
89
90
|
}
|
|
90
|
-
function
|
|
91
|
+
function _({ className: t, ...e }) {
|
|
91
92
|
return /* @__PURE__ */ a(
|
|
92
93
|
"div",
|
|
93
94
|
{
|
|
@@ -100,12 +101,12 @@ function P({ className: t, ...e }) {
|
|
|
100
101
|
}
|
|
101
102
|
);
|
|
102
103
|
}
|
|
103
|
-
function
|
|
104
|
+
function F({
|
|
104
105
|
className: t,
|
|
105
106
|
...e
|
|
106
107
|
}) {
|
|
107
108
|
return /* @__PURE__ */ a(
|
|
108
|
-
|
|
109
|
+
m,
|
|
109
110
|
{
|
|
110
111
|
"data-slot": "dialog-title",
|
|
111
112
|
className: o("text-lg leading-none font-semibold", t),
|
|
@@ -113,7 +114,7 @@ function _({
|
|
|
113
114
|
}
|
|
114
115
|
);
|
|
115
116
|
}
|
|
116
|
-
function
|
|
117
|
+
function H({
|
|
117
118
|
className: t,
|
|
118
119
|
...e
|
|
119
120
|
}) {
|
|
@@ -127,14 +128,14 @@ function F({
|
|
|
127
128
|
);
|
|
128
129
|
}
|
|
129
130
|
export {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
131
|
+
k as Dialog,
|
|
132
|
+
j as DialogClose,
|
|
133
|
+
O as DialogContent,
|
|
134
|
+
H as DialogDescription,
|
|
135
|
+
_ as DialogFooter,
|
|
136
|
+
P as DialogHeader,
|
|
137
|
+
h as DialogOverlay,
|
|
138
|
+
b as DialogPortal,
|
|
139
|
+
F as DialogTitle,
|
|
140
|
+
T as DialogTrigger
|
|
140
141
|
};
|