@bertimatteodev/astra-ui 0.5.0 → 0.6.0
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/astra-ui.cjs +1 -1
- package/dist/astra-ui.js +373 -285
- package/dist/index.css +1 -1
- package/dist/types/components/MonthCarousel/MonthCarousel.d.ts +15 -0
- package/dist/types/components/MonthCarousel/MonthCarousel.d.ts.map +1 -0
- package/dist/types/components/MonthCarousel/index.d.ts +3 -0
- package/dist/types/components/MonthCarousel/index.d.ts.map +1 -0
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/astra-ui.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createContext as e, createElement as t, forwardRef as n,
|
|
2
|
-
import { jsx as
|
|
3
|
-
import './index.css';var
|
|
1
|
+
import { createContext as e, createElement as t, forwardRef as n, useCallback as r, useContext as i, useEffect as a, useId as o, useMemo as s, useRef as c, useState as l } from "react";
|
|
2
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
3
|
+
import './index.css';var f = {
|
|
4
4
|
button: "_button_gjxjz_1",
|
|
5
5
|
sizeSm: "_sizeSm_gjxjz_31",
|
|
6
6
|
sizeMd: "_sizeMd_gjxjz_37",
|
|
@@ -15,52 +15,52 @@ import './index.css';var d = {
|
|
|
15
15
|
label: "_label_gjxjz_106",
|
|
16
16
|
spinner: "_spinner_gjxjz_111",
|
|
17
17
|
spin: "_spin_gjxjz_111"
|
|
18
|
-
}, f = {
|
|
19
|
-
primary: d.variantPrimary,
|
|
20
|
-
secondary: d.variantSecondary,
|
|
21
|
-
ghost: d.variantGhost,
|
|
22
|
-
danger: d.variantDanger
|
|
23
18
|
}, p = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
primary: f.variantPrimary,
|
|
20
|
+
secondary: f.variantSecondary,
|
|
21
|
+
ghost: f.variantGhost,
|
|
22
|
+
danger: f.variantDanger
|
|
23
|
+
}, m = {
|
|
24
|
+
sm: f.sizeSm,
|
|
25
|
+
md: f.sizeMd,
|
|
26
|
+
lg: f.sizeLg
|
|
27
27
|
};
|
|
28
|
-
function
|
|
28
|
+
function h(...e) {
|
|
29
29
|
return e.filter(Boolean).join(" ");
|
|
30
30
|
}
|
|
31
|
-
var
|
|
31
|
+
var g = n(function({ children: e, className: t, variant: n = "primary", size: r = "md", fullWidth: i = !1, isLoading: a = !1, startIcon: o, endIcon: s, disabled: c, type: l = "button", ...g }, _) {
|
|
32
32
|
let v = c || a;
|
|
33
|
-
return /* @__PURE__ */
|
|
33
|
+
return /* @__PURE__ */ d("button", {
|
|
34
34
|
ref: _,
|
|
35
|
-
type:
|
|
36
|
-
className:
|
|
35
|
+
type: l,
|
|
36
|
+
className: h(f.button, p[n], m[r], i && f.fullWidth, a && f.loading, t),
|
|
37
37
|
disabled: v,
|
|
38
38
|
"aria-busy": a || void 0,
|
|
39
39
|
...g,
|
|
40
40
|
children: [
|
|
41
|
-
a ? /* @__PURE__ */
|
|
42
|
-
className:
|
|
41
|
+
a ? /* @__PURE__ */ u("span", {
|
|
42
|
+
className: f.spinner,
|
|
43
43
|
"aria-hidden": "true"
|
|
44
44
|
}) : null,
|
|
45
|
-
!a && o ? /* @__PURE__ */
|
|
46
|
-
className:
|
|
45
|
+
!a && o ? /* @__PURE__ */ u("span", {
|
|
46
|
+
className: f.icon,
|
|
47
47
|
"aria-hidden": "true",
|
|
48
48
|
children: o
|
|
49
49
|
}) : null,
|
|
50
|
-
/* @__PURE__ */
|
|
51
|
-
className:
|
|
50
|
+
/* @__PURE__ */ u("span", {
|
|
51
|
+
className: f.label,
|
|
52
52
|
children: e
|
|
53
53
|
}),
|
|
54
|
-
!a && s ? /* @__PURE__ */
|
|
55
|
-
className:
|
|
54
|
+
!a && s ? /* @__PURE__ */ u("span", {
|
|
55
|
+
className: f.icon,
|
|
56
56
|
"aria-hidden": "true",
|
|
57
57
|
children: s
|
|
58
58
|
}) : null
|
|
59
59
|
]
|
|
60
60
|
});
|
|
61
61
|
});
|
|
62
|
-
|
|
63
|
-
var
|
|
62
|
+
g.displayName = "Button";
|
|
63
|
+
var _ = {
|
|
64
64
|
card: "_card_1ex3y_1",
|
|
65
65
|
paddingNone: "_paddingNone_1ex3y_9",
|
|
66
66
|
paddingSm: "_paddingSm_1ex3y_13",
|
|
@@ -69,34 +69,34 @@ var g = {
|
|
|
69
69
|
elevationNone: "_elevationNone_1ex3y_26",
|
|
70
70
|
elevationSm: "_elevationSm_1ex3y_30",
|
|
71
71
|
elevationMd: "_elevationMd_1ex3y_34"
|
|
72
|
-
}, _ = {
|
|
73
|
-
none: g.paddingNone,
|
|
74
|
-
sm: g.paddingSm,
|
|
75
|
-
md: g.paddingMd,
|
|
76
|
-
lg: g.paddingLg
|
|
77
72
|
}, v = {
|
|
78
|
-
none:
|
|
79
|
-
sm:
|
|
80
|
-
md:
|
|
73
|
+
none: _.paddingNone,
|
|
74
|
+
sm: _.paddingSm,
|
|
75
|
+
md: _.paddingMd,
|
|
76
|
+
lg: _.paddingLg
|
|
77
|
+
}, y = {
|
|
78
|
+
none: _.elevationNone,
|
|
79
|
+
sm: _.elevationSm,
|
|
80
|
+
md: _.elevationMd
|
|
81
81
|
};
|
|
82
|
-
function
|
|
82
|
+
function b(...e) {
|
|
83
83
|
return e.filter(Boolean).join(" ");
|
|
84
84
|
}
|
|
85
|
-
var
|
|
86
|
-
return /* @__PURE__ */
|
|
85
|
+
var x = n(function({ children: e, className: t, padding: n = "md", elevation: r = "sm", ...i }, a) {
|
|
86
|
+
return /* @__PURE__ */ u("div", {
|
|
87
87
|
ref: a,
|
|
88
|
-
className:
|
|
88
|
+
className: b(_.card, v[n], y[r], t),
|
|
89
89
|
...i,
|
|
90
90
|
children: e
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
|
-
|
|
93
|
+
x.displayName = "Card";
|
|
94
94
|
//#endregion
|
|
95
95
|
//#region node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs
|
|
96
|
-
var
|
|
97
|
-
let t =
|
|
96
|
+
var S = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), C = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), w = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), T = (e) => {
|
|
97
|
+
let t = w(e);
|
|
98
98
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
99
|
-
},
|
|
99
|
+
}, E = {
|
|
100
100
|
xmlns: "http://www.w3.org/2000/svg",
|
|
101
101
|
width: 24,
|
|
102
102
|
height: 24,
|
|
@@ -106,31 +106,31 @@ var x = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
106
106
|
strokeWidth: 2,
|
|
107
107
|
strokeLinecap: "round",
|
|
108
108
|
strokeLinejoin: "round"
|
|
109
|
-
},
|
|
109
|
+
}, D = (e) => {
|
|
110
110
|
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
111
111
|
return !1;
|
|
112
|
-
},
|
|
113
|
-
let { size: u = 24, strokeWidth: d = 2, absoluteStrokeWidth: f = !1, color: p = "currentColor", className: m = "" } =
|
|
112
|
+
}, O = e({}), k = () => i(O), A = n(({ color: e, size: n, strokeWidth: r, absoluteStrokeWidth: i, className: a = "", children: o, iconNode: s, ...c }, l) => {
|
|
113
|
+
let { size: u = 24, strokeWidth: d = 2, absoluteStrokeWidth: f = !1, color: p = "currentColor", className: m = "" } = k() ?? {}, h = i ?? f ? Number(r ?? d) * 24 / Number(n ?? u) : r ?? d;
|
|
114
114
|
return t("svg", {
|
|
115
115
|
ref: l,
|
|
116
|
-
...
|
|
117
|
-
width: n ?? u ??
|
|
118
|
-
height: n ?? u ??
|
|
116
|
+
...E,
|
|
117
|
+
width: n ?? u ?? E.width,
|
|
118
|
+
height: n ?? u ?? E.height,
|
|
119
119
|
stroke: e ?? p,
|
|
120
120
|
strokeWidth: h,
|
|
121
|
-
className:
|
|
122
|
-
...!o && !
|
|
121
|
+
className: S("lucide", m, a),
|
|
122
|
+
...!o && !D(c) && { "aria-hidden": "true" },
|
|
123
123
|
...c
|
|
124
124
|
}, [...s.map(([e, n]) => t(e, n)), ...Array.isArray(o) ? o : [o]]);
|
|
125
|
-
}),
|
|
126
|
-
let i = n(({ className: n, ...i }, a) => t(
|
|
125
|
+
}), j = (e, r) => {
|
|
126
|
+
let i = n(({ className: n, ...i }, a) => t(A, {
|
|
127
127
|
ref: a,
|
|
128
128
|
iconNode: r,
|
|
129
|
-
className:
|
|
129
|
+
className: S(`lucide-${C(T(e))}`, `lucide-${e}`, n),
|
|
130
130
|
...i
|
|
131
131
|
}));
|
|
132
|
-
return i.displayName =
|
|
133
|
-
}, ee =
|
|
132
|
+
return i.displayName = T(e), i;
|
|
133
|
+
}, ee = j("calendar-days", [
|
|
134
134
|
["path", {
|
|
135
135
|
d: "M8 2v3",
|
|
136
136
|
key: "1ioesn"
|
|
@@ -175,25 +175,25 @@ var x = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
175
175
|
d: "M16 17h.01",
|
|
176
176
|
key: "ql8jdd"
|
|
177
177
|
}]
|
|
178
|
-
]),
|
|
178
|
+
]), M = j("chevron-down", [["path", {
|
|
179
179
|
d: "m6 9 6 6 6-6",
|
|
180
180
|
key: "qrunsl"
|
|
181
|
-
}]]),
|
|
181
|
+
}]]), N = j("chevron-left", [["path", {
|
|
182
182
|
d: "m15 18-6-6 6-6",
|
|
183
183
|
key: "1wnfg3"
|
|
184
|
-
}]]),
|
|
184
|
+
}]]), P = j("chevron-right", [["path", {
|
|
185
185
|
d: "m9 18 6-6-6-6",
|
|
186
186
|
key: "mthhwq"
|
|
187
|
-
}]]),
|
|
187
|
+
}]]), F = j("chevron-up", [["path", {
|
|
188
188
|
d: "m18 15-6-6-6 6",
|
|
189
189
|
key: "153udz"
|
|
190
|
-
}]]),
|
|
190
|
+
}]]), I = j("chevrons-up-down", [["path", {
|
|
191
191
|
d: "m7 15 5 5 5-5",
|
|
192
192
|
key: "1hf1tw"
|
|
193
193
|
}], ["path", {
|
|
194
194
|
d: "m7 9 5-5 5 5",
|
|
195
195
|
key: "sgt6xg"
|
|
196
|
-
}]]),
|
|
196
|
+
}]]), L = {
|
|
197
197
|
field: "_field_t3jjk_1",
|
|
198
198
|
label: "_label_t3jjk_8",
|
|
199
199
|
trigger: "_trigger_t3jjk_15",
|
|
@@ -215,7 +215,7 @@ var x = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
215
215
|
today: "_today_t3jjk_195",
|
|
216
216
|
footer: "_footer_t3jjk_210",
|
|
217
217
|
textButton: "_textButton_t3jjk_218"
|
|
218
|
-
},
|
|
218
|
+
}, R = [
|
|
219
219
|
"Lun",
|
|
220
220
|
"Mar",
|
|
221
221
|
"Mer",
|
|
@@ -224,48 +224,48 @@ var x = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) =
|
|
|
224
224
|
"Sab",
|
|
225
225
|
"Dom"
|
|
226
226
|
];
|
|
227
|
-
function
|
|
227
|
+
function z(e) {
|
|
228
228
|
return new Date(e.getFullYear(), e.getMonth(), e.getDate());
|
|
229
229
|
}
|
|
230
|
-
function
|
|
230
|
+
function B(e) {
|
|
231
231
|
return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
|
|
232
232
|
}
|
|
233
|
-
function
|
|
233
|
+
function V(e, t) {
|
|
234
234
|
return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
|
|
235
235
|
}
|
|
236
|
-
function
|
|
236
|
+
function te(e, t) {
|
|
237
237
|
return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth();
|
|
238
238
|
}
|
|
239
|
-
function
|
|
240
|
-
let r =
|
|
241
|
-
return !!(t && r <
|
|
239
|
+
function ne(e, t, n) {
|
|
240
|
+
let r = z(e);
|
|
241
|
+
return !!(t && r < z(t) || n && r > z(n));
|
|
242
242
|
}
|
|
243
|
-
function
|
|
243
|
+
function re(e) {
|
|
244
244
|
let t = e.getFullYear(), n = e.getMonth(), r = new Date(t, n, 1), i = new Date(t, n + 1, 0), a = (r.getDay() + 6) % 7, o = Math.ceil((a + i.getDate()) / 7) * 7, s = new Date(t, n, 1 - a);
|
|
245
245
|
return Array.from({ length: o }, (e, t) => new Date(s.getFullYear(), s.getMonth(), s.getDate() + t));
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function ie(e, t) {
|
|
248
248
|
let n = new Intl.DateTimeFormat(t, {
|
|
249
249
|
month: "long",
|
|
250
250
|
year: "numeric"
|
|
251
251
|
}).format(e);
|
|
252
252
|
return n.charAt(0).toUpperCase() + n.slice(1);
|
|
253
253
|
}
|
|
254
|
-
function
|
|
254
|
+
function ae(e, t) {
|
|
255
255
|
return e ? new Intl.DateTimeFormat(t, {
|
|
256
256
|
day: "2-digit",
|
|
257
257
|
month: "short",
|
|
258
258
|
year: "numeric"
|
|
259
259
|
}).format(e) : "";
|
|
260
260
|
}
|
|
261
|
-
function
|
|
261
|
+
function H(...e) {
|
|
262
262
|
return e.filter(Boolean).join(" ");
|
|
263
263
|
}
|
|
264
|
-
function
|
|
265
|
-
let y =
|
|
266
|
-
|
|
267
|
-
e && O(
|
|
268
|
-
}, [e]),
|
|
264
|
+
function oe({ value: e, onChange: t, label: n, placeholder: r = "Seleziona una data", locale: i = "it-IT", disabled: f = !1, minDate: p, maxDate: m, clearable: h = !1, name: g, id: _, error: v }) {
|
|
265
|
+
let y = o(), b = _ ?? `date-picker-${y}`, x = `${b}-dialog`, S = `${b}-error`, C = c(null), w = c(null), [T, E] = l(!1), [D, O] = l(() => z(e ?? /* @__PURE__ */ new Date())), k = s(() => re(D), [D]), A = z(/* @__PURE__ */ new Date());
|
|
266
|
+
a(() => {
|
|
267
|
+
e && O(z(e));
|
|
268
|
+
}, [e]), a(() => {
|
|
269
269
|
function e(e) {
|
|
270
270
|
C.current && !C.current.contains(e.target) && E(!1);
|
|
271
271
|
}
|
|
@@ -277,15 +277,15 @@ function ie({ value: e, onChange: t, label: n, placeholder: r = "Seleziona una d
|
|
|
277
277
|
};
|
|
278
278
|
}, []);
|
|
279
279
|
function j() {
|
|
280
|
-
f || (O(
|
|
280
|
+
f || (O(z(e ?? /* @__PURE__ */ new Date())), E(!0));
|
|
281
281
|
}
|
|
282
|
-
function
|
|
283
|
-
|
|
282
|
+
function M(e) {
|
|
283
|
+
ne(e, p, m) || (t(z(e)), E(!1), w.current?.focus());
|
|
284
284
|
}
|
|
285
285
|
function F(e) {
|
|
286
286
|
O((t) => new Date(t.getFullYear(), t.getMonth() + e, 1));
|
|
287
287
|
}
|
|
288
|
-
function
|
|
288
|
+
function I(e, t) {
|
|
289
289
|
let n = new Date(t);
|
|
290
290
|
if (e.key === "ArrowLeft") n.setDate(t.getDate() - 1);
|
|
291
291
|
else if (e.key === "ArrowRight") n.setDate(t.getDate() + 1);
|
|
@@ -295,130 +295,130 @@ function ie({ value: e, onChange: t, label: n, placeholder: r = "Seleziona una d
|
|
|
295
295
|
else if (e.key === "End") n.setDate(t.getDate() + (6 - (t.getDay() + 6) % 7));
|
|
296
296
|
else return;
|
|
297
297
|
e.preventDefault();
|
|
298
|
-
let r = `${b}-${
|
|
298
|
+
let r = `${b}-${B(n)}`, i = document.getElementById(r);
|
|
299
299
|
if (i) {
|
|
300
300
|
i.focus();
|
|
301
301
|
return;
|
|
302
302
|
}
|
|
303
303
|
O(new Date(n.getFullYear(), n.getMonth(), 1));
|
|
304
304
|
}
|
|
305
|
-
let
|
|
306
|
-
return /* @__PURE__ */
|
|
305
|
+
let oe = ae(e, i);
|
|
306
|
+
return /* @__PURE__ */ d("div", {
|
|
307
307
|
ref: C,
|
|
308
|
-
className:
|
|
308
|
+
className: L.field,
|
|
309
309
|
children: [
|
|
310
|
-
n ? /* @__PURE__ */
|
|
311
|
-
className:
|
|
310
|
+
n ? /* @__PURE__ */ u("label", {
|
|
311
|
+
className: L.label,
|
|
312
312
|
htmlFor: b,
|
|
313
313
|
children: n
|
|
314
314
|
}) : null,
|
|
315
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ u("input", {
|
|
316
316
|
id: b,
|
|
317
317
|
type: "hidden",
|
|
318
318
|
name: g,
|
|
319
|
-
value: e ?
|
|
319
|
+
value: e ? B(e) : ""
|
|
320
320
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ d("button", {
|
|
322
322
|
ref: w,
|
|
323
323
|
type: "button",
|
|
324
|
-
className:
|
|
324
|
+
className: H(L.trigger, v && L.hasError, f && L.isDisabled),
|
|
325
325
|
disabled: f,
|
|
326
326
|
"aria-haspopup": "dialog",
|
|
327
327
|
"aria-expanded": T,
|
|
328
328
|
"aria-controls": T ? x : void 0,
|
|
329
329
|
onClick: () => T ? E(!1) : j(),
|
|
330
|
-
children: [/* @__PURE__ */
|
|
331
|
-
className:
|
|
330
|
+
children: [/* @__PURE__ */ u(ee, {
|
|
331
|
+
className: L.triggerIcon,
|
|
332
332
|
size: 18,
|
|
333
333
|
"aria-hidden": "true"
|
|
334
|
-
}), /* @__PURE__ */
|
|
335
|
-
className:
|
|
336
|
-
children:
|
|
334
|
+
}), /* @__PURE__ */ u("span", {
|
|
335
|
+
className: H(L.triggerValue, !e && L.placeholder),
|
|
336
|
+
children: oe || r
|
|
337
337
|
})]
|
|
338
338
|
}),
|
|
339
|
-
v ? /* @__PURE__ */
|
|
339
|
+
v ? /* @__PURE__ */ u("p", {
|
|
340
340
|
id: S,
|
|
341
|
-
className:
|
|
341
|
+
className: L.error,
|
|
342
342
|
role: "alert",
|
|
343
343
|
children: v
|
|
344
344
|
}) : null,
|
|
345
|
-
T ? /* @__PURE__ */
|
|
345
|
+
T ? /* @__PURE__ */ d("div", {
|
|
346
346
|
id: x,
|
|
347
|
-
className:
|
|
347
|
+
className: L.popover,
|
|
348
348
|
role: "dialog",
|
|
349
349
|
"aria-label": "Seleziona una data",
|
|
350
350
|
children: [
|
|
351
|
-
/* @__PURE__ */
|
|
352
|
-
className:
|
|
351
|
+
/* @__PURE__ */ d("header", {
|
|
352
|
+
className: L.calendarHeader,
|
|
353
353
|
children: [
|
|
354
|
-
/* @__PURE__ */
|
|
354
|
+
/* @__PURE__ */ u("button", {
|
|
355
355
|
type: "button",
|
|
356
|
-
className:
|
|
356
|
+
className: L.navigationButton,
|
|
357
357
|
"aria-label": "Mese precedente",
|
|
358
358
|
onClick: () => F(-1),
|
|
359
|
-
children: /* @__PURE__ */
|
|
359
|
+
children: /* @__PURE__ */ u(N, {
|
|
360
360
|
size: 18,
|
|
361
361
|
"aria-hidden": "true"
|
|
362
362
|
})
|
|
363
363
|
}),
|
|
364
|
-
/* @__PURE__ */
|
|
365
|
-
className:
|
|
366
|
-
children:
|
|
364
|
+
/* @__PURE__ */ u("span", {
|
|
365
|
+
className: L.monthLabel,
|
|
366
|
+
children: ie(D, i)
|
|
367
367
|
}),
|
|
368
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ u("button", {
|
|
369
369
|
type: "button",
|
|
370
|
-
className:
|
|
370
|
+
className: L.navigationButton,
|
|
371
371
|
"aria-label": "Mese successivo",
|
|
372
372
|
onClick: () => F(1),
|
|
373
|
-
children: /* @__PURE__ */
|
|
373
|
+
children: /* @__PURE__ */ u(P, {
|
|
374
374
|
size: 18,
|
|
375
375
|
"aria-hidden": "true"
|
|
376
376
|
})
|
|
377
377
|
})
|
|
378
378
|
]
|
|
379
379
|
}),
|
|
380
|
-
/* @__PURE__ */
|
|
381
|
-
className:
|
|
380
|
+
/* @__PURE__ */ d("div", {
|
|
381
|
+
className: L.calendarGrid,
|
|
382
382
|
role: "grid",
|
|
383
|
-
"aria-label":
|
|
384
|
-
children: [
|
|
385
|
-
className:
|
|
383
|
+
"aria-label": ie(D, i),
|
|
384
|
+
children: [R.map((e) => /* @__PURE__ */ u("span", {
|
|
385
|
+
className: L.weekDay,
|
|
386
386
|
role: "columnheader",
|
|
387
387
|
children: e
|
|
388
388
|
}, e)), k.map((t) => {
|
|
389
|
-
let n =
|
|
390
|
-
return /* @__PURE__ */
|
|
391
|
-
id:
|
|
389
|
+
let n = te(t, D), r = e ? V(t, e) : !1, a = V(t, A), o = ne(t, p, m), s = `${b}-${B(t)}`;
|
|
390
|
+
return /* @__PURE__ */ u("button", {
|
|
391
|
+
id: s,
|
|
392
392
|
type: "button",
|
|
393
393
|
role: "gridcell",
|
|
394
|
-
className:
|
|
395
|
-
disabled:
|
|
396
|
-
"aria-label": new Intl.DateTimeFormat(
|
|
394
|
+
className: H(L.day, !n && L.outsideMonth, r && L.selectedDay, a && L.today),
|
|
395
|
+
disabled: o,
|
|
396
|
+
"aria-label": new Intl.DateTimeFormat(i, {
|
|
397
397
|
weekday: "long",
|
|
398
398
|
day: "numeric",
|
|
399
399
|
month: "long",
|
|
400
400
|
year: "numeric"
|
|
401
401
|
}).format(t),
|
|
402
402
|
"aria-selected": r,
|
|
403
|
-
tabIndex: r || !e &&
|
|
404
|
-
onClick: () =>
|
|
405
|
-
onKeyDown: (e) =>
|
|
403
|
+
tabIndex: r || !e && a ? 0 : -1,
|
|
404
|
+
onClick: () => M(t),
|
|
405
|
+
onKeyDown: (e) => I(e, t),
|
|
406
406
|
children: t.getDate()
|
|
407
|
-
},
|
|
407
|
+
}, s);
|
|
408
408
|
})]
|
|
409
409
|
}),
|
|
410
|
-
/* @__PURE__ */
|
|
411
|
-
className:
|
|
412
|
-
children: [/* @__PURE__ */
|
|
410
|
+
/* @__PURE__ */ d("footer", {
|
|
411
|
+
className: L.footer,
|
|
412
|
+
children: [/* @__PURE__ */ u("button", {
|
|
413
413
|
type: "button",
|
|
414
|
-
className:
|
|
414
|
+
className: L.textButton,
|
|
415
415
|
onClick: () => {
|
|
416
|
-
O(A),
|
|
416
|
+
O(A), M(A);
|
|
417
417
|
},
|
|
418
418
|
children: "Oggi"
|
|
419
|
-
}), h && e ? /* @__PURE__ */
|
|
419
|
+
}), h && e ? /* @__PURE__ */ u("button", {
|
|
420
420
|
type: "button",
|
|
421
|
-
className:
|
|
421
|
+
className: L.textButton,
|
|
422
422
|
onClick: () => {
|
|
423
423
|
t(null), E(!1), w.current?.focus();
|
|
424
424
|
},
|
|
@@ -430,7 +430,7 @@ function ie({ value: e, onChange: t, label: n, placeholder: r = "Seleziona una d
|
|
|
430
430
|
]
|
|
431
431
|
});
|
|
432
432
|
}
|
|
433
|
-
var
|
|
433
|
+
var U = {
|
|
434
434
|
button: "_button_2kydv_1",
|
|
435
435
|
sizeSm: "_sizeSm_2kydv_27",
|
|
436
436
|
sizeMd: "_sizeMd_2kydv_32",
|
|
@@ -444,45 +444,45 @@ var W = {
|
|
|
444
444
|
spinner: "_spinner_2kydv_94",
|
|
445
445
|
spin: "_spin_2kydv_94",
|
|
446
446
|
loading: "_loading_2kydv_103"
|
|
447
|
-
},
|
|
448
|
-
primary:
|
|
449
|
-
secondary:
|
|
450
|
-
ghost:
|
|
451
|
-
danger:
|
|
452
|
-
},
|
|
453
|
-
sm:
|
|
454
|
-
md:
|
|
455
|
-
lg:
|
|
447
|
+
}, se = {
|
|
448
|
+
primary: U.variantPrimary,
|
|
449
|
+
secondary: U.variantSecondary,
|
|
450
|
+
ghost: U.variantGhost,
|
|
451
|
+
danger: U.variantDanger
|
|
452
|
+
}, ce = {
|
|
453
|
+
sm: U.sizeSm,
|
|
454
|
+
md: U.sizeMd,
|
|
455
|
+
lg: U.sizeLg
|
|
456
456
|
};
|
|
457
|
-
function
|
|
457
|
+
function le(...e) {
|
|
458
458
|
return e.filter(Boolean).join(" ");
|
|
459
459
|
}
|
|
460
|
-
var
|
|
460
|
+
var ue = n(function({ icon: e, label: t, className: n, variant: r = "secondary", size: i = "md", isLoading: a = !1, borderless: o = !1, backgroundColor: s, disabled: c, type: l = "button", style: d, ...f }, p) {
|
|
461
461
|
let m = c || a, h = s ? {
|
|
462
462
|
...d,
|
|
463
463
|
backgroundColor: s
|
|
464
464
|
} : d;
|
|
465
|
-
return /* @__PURE__ */
|
|
465
|
+
return /* @__PURE__ */ u("button", {
|
|
466
466
|
ref: p,
|
|
467
|
-
type:
|
|
468
|
-
className:
|
|
467
|
+
type: l,
|
|
468
|
+
className: le(U.button, se[r], ce[i], a && U.loading, o && U.borderless, n),
|
|
469
469
|
style: h,
|
|
470
470
|
disabled: m,
|
|
471
471
|
"aria-label": t,
|
|
472
472
|
"aria-busy": a || void 0,
|
|
473
473
|
...f,
|
|
474
|
-
children: a ? /* @__PURE__ */
|
|
475
|
-
className:
|
|
474
|
+
children: a ? /* @__PURE__ */ u("span", {
|
|
475
|
+
className: U.spinner,
|
|
476
476
|
"aria-hidden": "true"
|
|
477
|
-
}) : /* @__PURE__ */
|
|
478
|
-
className:
|
|
477
|
+
}) : /* @__PURE__ */ u("span", {
|
|
478
|
+
className: U.icon,
|
|
479
479
|
"aria-hidden": "true",
|
|
480
480
|
children: e
|
|
481
481
|
})
|
|
482
482
|
});
|
|
483
483
|
});
|
|
484
|
-
|
|
485
|
-
var
|
|
484
|
+
ue.displayName = "IconButton";
|
|
485
|
+
var W = {
|
|
486
486
|
field: "_field_1pq0j_1",
|
|
487
487
|
label: "_label_1pq0j_7",
|
|
488
488
|
required: "_required_1pq0j_14",
|
|
@@ -496,68 +496,68 @@ var G = {
|
|
|
496
496
|
};
|
|
497
497
|
//#endregion
|
|
498
498
|
//#region src/components/TextField/TextField.tsx
|
|
499
|
-
function
|
|
499
|
+
function G(...e) {
|
|
500
500
|
return e.filter(Boolean).join(" ");
|
|
501
501
|
}
|
|
502
|
-
var
|
|
503
|
-
let g =
|
|
502
|
+
var de = n(function({ id: e, label: t, hint: n, error: r, startAdornment: i, endAdornment: a, className: s, containerClassName: c, disabled: l, required: f, "aria-describedby": p, ...m }, h) {
|
|
503
|
+
let g = o(), _ = e ?? `text-field-${g}`, v = `${_}-hint`, y = `${_}-error`, b = [
|
|
504
504
|
p,
|
|
505
505
|
n ? v : null,
|
|
506
506
|
r ? y : null
|
|
507
507
|
].filter(Boolean).join(" ");
|
|
508
|
-
return /* @__PURE__ */
|
|
509
|
-
className:
|
|
508
|
+
return /* @__PURE__ */ d("div", {
|
|
509
|
+
className: G(W.field, c),
|
|
510
510
|
children: [
|
|
511
|
-
t ? /* @__PURE__ */
|
|
512
|
-
className:
|
|
511
|
+
t ? /* @__PURE__ */ d("label", {
|
|
512
|
+
className: W.label,
|
|
513
513
|
htmlFor: _,
|
|
514
|
-
children: [t, f ? /* @__PURE__ */
|
|
515
|
-
className:
|
|
514
|
+
children: [t, f ? /* @__PURE__ */ d("span", {
|
|
515
|
+
className: W.required,
|
|
516
516
|
"aria-hidden": "true",
|
|
517
517
|
children: [" ", "*"]
|
|
518
518
|
}) : null]
|
|
519
519
|
}) : null,
|
|
520
|
-
/* @__PURE__ */
|
|
521
|
-
className:
|
|
520
|
+
/* @__PURE__ */ d("div", {
|
|
521
|
+
className: G(W.control, r && W.hasError, l && W.isDisabled),
|
|
522
522
|
children: [
|
|
523
|
-
i ? /* @__PURE__ */
|
|
524
|
-
className:
|
|
523
|
+
i ? /* @__PURE__ */ u("span", {
|
|
524
|
+
className: W.adornment,
|
|
525
525
|
"aria-hidden": "true",
|
|
526
526
|
children: i
|
|
527
527
|
}) : null,
|
|
528
|
-
/* @__PURE__ */
|
|
528
|
+
/* @__PURE__ */ u("input", {
|
|
529
529
|
ref: h,
|
|
530
530
|
id: _,
|
|
531
|
-
className:
|
|
532
|
-
disabled:
|
|
531
|
+
className: G(W.input, s),
|
|
532
|
+
disabled: l,
|
|
533
533
|
required: f,
|
|
534
534
|
"aria-invalid": r ? !0 : void 0,
|
|
535
535
|
"aria-describedby": b || void 0,
|
|
536
536
|
...m
|
|
537
537
|
}),
|
|
538
|
-
|
|
539
|
-
className:
|
|
538
|
+
a ? /* @__PURE__ */ u("span", {
|
|
539
|
+
className: W.adornment,
|
|
540
540
|
"aria-hidden": "true",
|
|
541
|
-
children:
|
|
541
|
+
children: a
|
|
542
542
|
}) : null
|
|
543
543
|
]
|
|
544
544
|
}),
|
|
545
|
-
r ? /* @__PURE__ */
|
|
545
|
+
r ? /* @__PURE__ */ u("p", {
|
|
546
546
|
id: y,
|
|
547
|
-
className:
|
|
547
|
+
className: W.error,
|
|
548
548
|
role: "alert",
|
|
549
549
|
children: r
|
|
550
550
|
}) : null,
|
|
551
|
-
!r && n ? /* @__PURE__ */
|
|
551
|
+
!r && n ? /* @__PURE__ */ u("p", {
|
|
552
552
|
id: v,
|
|
553
|
-
className:
|
|
553
|
+
className: W.hint,
|
|
554
554
|
children: n
|
|
555
555
|
}) : null
|
|
556
556
|
]
|
|
557
557
|
});
|
|
558
558
|
});
|
|
559
|
-
|
|
560
|
-
var
|
|
559
|
+
de.displayName = "TextField";
|
|
560
|
+
var K = {
|
|
561
561
|
field: "_field_3nnjq_1",
|
|
562
562
|
label: "_label_3nnjq_7",
|
|
563
563
|
required: "_required_3nnjq_14",
|
|
@@ -578,16 +578,16 @@ var q = {
|
|
|
578
578
|
};
|
|
579
579
|
//#endregion
|
|
580
580
|
//#region src/components/Dropdown/Dropdown.tsx
|
|
581
|
-
function
|
|
581
|
+
function q(...e) {
|
|
582
582
|
return e.filter(Boolean).join(" ");
|
|
583
583
|
}
|
|
584
|
-
var
|
|
585
|
-
let C =
|
|
584
|
+
var fe = n(function({ id: e, options: t, label: n, hint: r, error: i, placeholder: s, className: f, containerClassName: p, disabled: m, required: h, value: g, defaultValue: _, onChange: v, onValueChange: y, "aria-describedby": b, ...x }, S) {
|
|
585
|
+
let C = o(), w = e ?? `dropdown-${C}`, T = `${w}-hint`, E = `${w}-error`, D = `${w}-label`, O = `${w}-listbox`, k = [
|
|
586
586
|
b,
|
|
587
587
|
r ? T : null,
|
|
588
|
-
|
|
589
|
-
].filter(Boolean).join(" "), A = typeof g == "string" ? g : void 0, [
|
|
590
|
-
|
|
588
|
+
i ? E : null
|
|
589
|
+
].filter(Boolean).join(" "), A = typeof g == "string" ? g : void 0, [j, ee] = l(typeof _ == "string" ? _ : ""), [M, N] = l(!1), [P, F] = l(0), I = c(null), L = A ?? j, R = t.find((e) => e.value === L), z = t.reduce((e, t, n) => (t.disabled || e.push(n), e), []);
|
|
590
|
+
a(() => {
|
|
591
591
|
function e(e) {
|
|
592
592
|
I.current?.contains(e.target) || N(!1);
|
|
593
593
|
}
|
|
@@ -597,9 +597,9 @@ var ue = n(function({ id: e, options: t, label: n, hint: r, error: o, placeholde
|
|
|
597
597
|
v?.(e), y?.(e.target.value);
|
|
598
598
|
}
|
|
599
599
|
function V(e) {
|
|
600
|
-
A === void 0 &&
|
|
600
|
+
A === void 0 && ee(e), y?.(e), N(!1);
|
|
601
601
|
}
|
|
602
|
-
function
|
|
602
|
+
function te(e) {
|
|
603
603
|
if (!m) {
|
|
604
604
|
if (e.key === "ArrowDown" || e.key === "ArrowUp") {
|
|
605
605
|
e.preventDefault(), N(!0);
|
|
@@ -615,78 +615,78 @@ var ue = n(function({ id: e, options: t, label: n, hint: r, error: o, placeholde
|
|
|
615
615
|
e.key === "Escape" && N(!1);
|
|
616
616
|
}
|
|
617
617
|
}
|
|
618
|
-
return /* @__PURE__ */
|
|
619
|
-
className:
|
|
618
|
+
return /* @__PURE__ */ d("div", {
|
|
619
|
+
className: q(K.field, p),
|
|
620
620
|
children: [
|
|
621
|
-
n ? /* @__PURE__ */
|
|
621
|
+
n ? /* @__PURE__ */ d("label", {
|
|
622
622
|
id: D,
|
|
623
|
-
className:
|
|
623
|
+
className: K.label,
|
|
624
624
|
htmlFor: w,
|
|
625
|
-
children: [n, h ? /* @__PURE__ */
|
|
626
|
-
className:
|
|
625
|
+
children: [n, h ? /* @__PURE__ */ d("span", {
|
|
626
|
+
className: K.required,
|
|
627
627
|
"aria-hidden": "true",
|
|
628
628
|
children: [" ", "*"]
|
|
629
629
|
}) : null]
|
|
630
630
|
}) : null,
|
|
631
|
-
/* @__PURE__ */
|
|
631
|
+
/* @__PURE__ */ d("div", {
|
|
632
632
|
ref: I,
|
|
633
|
-
className:
|
|
633
|
+
className: q(K.control, i && K.hasError, m && K.isDisabled, M && K.isOpen),
|
|
634
634
|
children: [
|
|
635
|
-
/* @__PURE__ */
|
|
635
|
+
/* @__PURE__ */ d("select", {
|
|
636
636
|
ref: S,
|
|
637
637
|
id: w,
|
|
638
|
-
className:
|
|
638
|
+
className: K.nativeSelect,
|
|
639
639
|
disabled: m,
|
|
640
640
|
required: h,
|
|
641
641
|
value: L,
|
|
642
|
-
"aria-invalid":
|
|
642
|
+
"aria-invalid": i ? !0 : void 0,
|
|
643
643
|
"aria-describedby": k || void 0,
|
|
644
644
|
onChange: B,
|
|
645
645
|
...x,
|
|
646
|
-
children: [
|
|
646
|
+
children: [s ? /* @__PURE__ */ u("option", {
|
|
647
647
|
value: "",
|
|
648
648
|
disabled: !0,
|
|
649
|
-
children:
|
|
650
|
-
}) : null, t.map((e) => /* @__PURE__ */
|
|
649
|
+
children: s
|
|
650
|
+
}) : null, t.map((e) => /* @__PURE__ */ u("option", {
|
|
651
651
|
value: e.value,
|
|
652
652
|
disabled: e.disabled,
|
|
653
653
|
children: e.label
|
|
654
654
|
}, e.value))]
|
|
655
655
|
}),
|
|
656
|
-
/* @__PURE__ */
|
|
656
|
+
/* @__PURE__ */ d("button", {
|
|
657
657
|
type: "button",
|
|
658
|
-
className:
|
|
658
|
+
className: q(K.trigger, f),
|
|
659
659
|
disabled: m,
|
|
660
660
|
"aria-haspopup": "listbox",
|
|
661
661
|
"aria-expanded": M,
|
|
662
662
|
"aria-controls": O,
|
|
663
663
|
"aria-labelledby": n ? D : void 0,
|
|
664
664
|
"aria-describedby": k || void 0,
|
|
665
|
-
"aria-invalid":
|
|
665
|
+
"aria-invalid": i ? !0 : void 0,
|
|
666
666
|
onClick: () => N((e) => !e),
|
|
667
|
-
onKeyDown:
|
|
668
|
-
children: [/* @__PURE__ */
|
|
669
|
-
className: R ? void 0 :
|
|
670
|
-
children: R?.label ??
|
|
671
|
-
}), /* @__PURE__ */
|
|
672
|
-
className:
|
|
667
|
+
onKeyDown: te,
|
|
668
|
+
children: [/* @__PURE__ */ u("span", {
|
|
669
|
+
className: R ? void 0 : K.placeholder,
|
|
670
|
+
children: R?.label ?? s
|
|
671
|
+
}), /* @__PURE__ */ u("span", {
|
|
672
|
+
className: K.indicator,
|
|
673
673
|
"aria-hidden": "true"
|
|
674
674
|
})]
|
|
675
675
|
}),
|
|
676
|
-
M ? /* @__PURE__ */
|
|
676
|
+
M ? /* @__PURE__ */ d("div", {
|
|
677
677
|
id: O,
|
|
678
|
-
className:
|
|
678
|
+
className: K.menu,
|
|
679
679
|
role: "listbox",
|
|
680
|
-
children: [
|
|
680
|
+
children: [s ? /* @__PURE__ */ u("button", {
|
|
681
681
|
type: "button",
|
|
682
|
-
className:
|
|
682
|
+
className: q(K.option, !L && K.selectedOption),
|
|
683
683
|
role: "option",
|
|
684
684
|
"aria-selected": !L,
|
|
685
685
|
onClick: () => V(""),
|
|
686
|
-
children:
|
|
687
|
-
}) : null, t.map((e, t) => /* @__PURE__ */
|
|
686
|
+
children: s
|
|
687
|
+
}) : null, t.map((e, t) => /* @__PURE__ */ u("button", {
|
|
688
688
|
type: "button",
|
|
689
|
-
className:
|
|
689
|
+
className: q(K.option, e.value === L && K.selectedOption, t === P && K.activeOption),
|
|
690
690
|
role: "option",
|
|
691
691
|
"aria-selected": e.value === L,
|
|
692
692
|
disabled: e.disabled,
|
|
@@ -697,22 +697,22 @@ var ue = n(function({ id: e, options: t, label: n, hint: r, error: o, placeholde
|
|
|
697
697
|
}) : null
|
|
698
698
|
]
|
|
699
699
|
}),
|
|
700
|
-
|
|
700
|
+
i ? /* @__PURE__ */ u("p", {
|
|
701
701
|
id: E,
|
|
702
|
-
className:
|
|
702
|
+
className: K.error,
|
|
703
703
|
role: "alert",
|
|
704
|
-
children:
|
|
704
|
+
children: i
|
|
705
705
|
}) : null,
|
|
706
|
-
!
|
|
706
|
+
!i && r ? /* @__PURE__ */ u("p", {
|
|
707
707
|
id: T,
|
|
708
|
-
className:
|
|
708
|
+
className: K.hint,
|
|
709
709
|
children: r
|
|
710
710
|
}) : null
|
|
711
711
|
]
|
|
712
712
|
});
|
|
713
713
|
});
|
|
714
|
-
|
|
715
|
-
var
|
|
714
|
+
fe.displayName = "Dropdown";
|
|
715
|
+
var J = {
|
|
716
716
|
group: "_group_1fqa2_1",
|
|
717
717
|
option: "_option_1fqa2_8",
|
|
718
718
|
selected: "_selected_1fqa2_41",
|
|
@@ -720,64 +720,152 @@ var Y = {
|
|
|
720
720
|
};
|
|
721
721
|
//#endregion
|
|
722
722
|
//#region src/components/MultiSelect/MultiSelect.tsx
|
|
723
|
-
function
|
|
723
|
+
function pe(...e) {
|
|
724
724
|
return e.filter(Boolean).join(" ");
|
|
725
725
|
}
|
|
726
|
-
var
|
|
727
|
-
let [p, m] =
|
|
726
|
+
var me = n(function({ options: e, value: t, defaultValue: n = [], multiple: r = !1, disabled: i = !1, className: a, onValueChange: o, "aria-label": s = r ? "Selezione multipla" : "Selezione singola", ...c }, f) {
|
|
727
|
+
let [p, m] = l(n), h = t ?? p, g = r ? h : h.slice(0, 1);
|
|
728
728
|
function _(e) {
|
|
729
729
|
let n = g.includes(e), i = r ? n ? g.filter((t) => t !== e) : [...g, e] : n ? [] : [e];
|
|
730
730
|
t === void 0 && m(i), o?.(i);
|
|
731
731
|
}
|
|
732
|
-
return /* @__PURE__ */
|
|
732
|
+
return /* @__PURE__ */ u("div", {
|
|
733
733
|
ref: f,
|
|
734
734
|
role: "group",
|
|
735
735
|
"aria-label": s,
|
|
736
|
-
className:
|
|
737
|
-
...
|
|
736
|
+
className: pe(J.group, a),
|
|
737
|
+
...c,
|
|
738
738
|
children: e.map((e) => {
|
|
739
739
|
let t = g.includes(e.value), n = i || e.disabled, r = e.selectedColor ? {
|
|
740
740
|
"--multi-select-selected-color": e.selectedColor,
|
|
741
741
|
"--multi-select-selected-background": `color-mix(in srgb, ${e.selectedColor} 14%, transparent)`
|
|
742
742
|
} : void 0;
|
|
743
|
-
return /* @__PURE__ */
|
|
743
|
+
return /* @__PURE__ */ d("button", {
|
|
744
744
|
type: "button",
|
|
745
|
-
className:
|
|
745
|
+
className: pe(J.option, t && J.selected),
|
|
746
746
|
disabled: n,
|
|
747
747
|
"aria-pressed": t,
|
|
748
748
|
style: r,
|
|
749
749
|
onClick: () => _(e.value),
|
|
750
|
-
children: [e.count === void 0 ? null : /* @__PURE__ */
|
|
751
|
-
className:
|
|
750
|
+
children: [e.count === void 0 ? null : /* @__PURE__ */ u("span", {
|
|
751
|
+
className: J.count,
|
|
752
752
|
children: e.count
|
|
753
|
-
}), /* @__PURE__ */
|
|
753
|
+
}), /* @__PURE__ */ u("span", { children: e.label })]
|
|
754
754
|
}, e.value);
|
|
755
755
|
})
|
|
756
756
|
});
|
|
757
757
|
});
|
|
758
|
-
|
|
759
|
-
var
|
|
758
|
+
me.displayName = "MultiSelect";
|
|
759
|
+
var Y = {
|
|
760
|
+
carousel: "_carousel_ziwqy_1",
|
|
761
|
+
navigationButton: "_navigationButton_ziwqy_11",
|
|
762
|
+
track: "_track_ziwqy_39",
|
|
763
|
+
label: "_label_ziwqy_46",
|
|
764
|
+
"month-fade-in": "_month-fade-in_ziwqy_1",
|
|
765
|
+
srOnly: "_srOnly_ziwqy_71"
|
|
766
|
+
};
|
|
767
|
+
//#endregion
|
|
768
|
+
//#region src/components/MonthCarousel/MonthCarousel.tsx
|
|
769
|
+
function X(e) {
|
|
770
|
+
return e.year * 12 + e.month - 1;
|
|
771
|
+
}
|
|
772
|
+
function he(e, t) {
|
|
773
|
+
let n = e.year * 12 + e.month - 1 + t;
|
|
774
|
+
return {
|
|
775
|
+
year: Math.floor(n / 12),
|
|
776
|
+
month: (n % 12 + 12) % 12 + 1
|
|
777
|
+
};
|
|
778
|
+
}
|
|
779
|
+
function ge(e, t) {
|
|
780
|
+
let n = new Date(e.year, e.month - 1, 1), r = new Intl.DateTimeFormat(t, {
|
|
781
|
+
month: "long",
|
|
782
|
+
year: "numeric"
|
|
783
|
+
}).format(n);
|
|
784
|
+
return r.charAt(0).toUpperCase() + r.slice(1);
|
|
785
|
+
}
|
|
786
|
+
function _e(e, t, n, r) {
|
|
787
|
+
let i = he(t, e);
|
|
788
|
+
return e === -1 && n ? X(i) < X(n) : e === 1 && r ? X(i) > X(r) : !1;
|
|
789
|
+
}
|
|
790
|
+
function ve({ value: e, onChange: t, locale: n = "it-IT", minMonth: i, maxMonth: a, disabled: o = !1, ariaLabel: f = "Seleziona il mese" }) {
|
|
791
|
+
let [p, m] = l(0), h = c(null), g = s(() => ge(e, n), [e, n]), _ = o || _e(-1, e, i, a), v = o || _e(1, e, i, a), y = r((n) => {
|
|
792
|
+
n === -1 && _ || n === 1 && v || (m(n), t(he(e, n)));
|
|
793
|
+
}, [
|
|
794
|
+
v,
|
|
795
|
+
_,
|
|
796
|
+
t,
|
|
797
|
+
e
|
|
798
|
+
]);
|
|
799
|
+
function b(e) {
|
|
800
|
+
e.key === "ArrowLeft" ? (e.preventDefault(), y(-1)) : e.key === "ArrowRight" && (e.preventDefault(), y(1));
|
|
801
|
+
}
|
|
802
|
+
return /* @__PURE__ */ d("div", {
|
|
803
|
+
className: Y.carousel,
|
|
804
|
+
role: "group",
|
|
805
|
+
"aria-label": f,
|
|
806
|
+
onKeyDown: b,
|
|
807
|
+
children: [
|
|
808
|
+
/* @__PURE__ */ u("button", {
|
|
809
|
+
type: "button",
|
|
810
|
+
className: Y.navigationButton,
|
|
811
|
+
"aria-label": "Mese precedente",
|
|
812
|
+
disabled: _,
|
|
813
|
+
onClick: () => y(-1),
|
|
814
|
+
children: /* @__PURE__ */ u(N, {
|
|
815
|
+
size: 18,
|
|
816
|
+
"aria-hidden": "true"
|
|
817
|
+
})
|
|
818
|
+
}),
|
|
819
|
+
/* @__PURE__ */ u("div", {
|
|
820
|
+
className: Y.track,
|
|
821
|
+
children: /* @__PURE__ */ u("span", {
|
|
822
|
+
className: Y.label,
|
|
823
|
+
"data-direction": p,
|
|
824
|
+
children: g
|
|
825
|
+
}, `${e.year}-${e.month}`)
|
|
826
|
+
}),
|
|
827
|
+
/* @__PURE__ */ u("button", {
|
|
828
|
+
type: "button",
|
|
829
|
+
className: Y.navigationButton,
|
|
830
|
+
"aria-label": "Mese successivo",
|
|
831
|
+
disabled: v,
|
|
832
|
+
onClick: () => y(1),
|
|
833
|
+
children: /* @__PURE__ */ u(P, {
|
|
834
|
+
size: 18,
|
|
835
|
+
"aria-hidden": "true"
|
|
836
|
+
})
|
|
837
|
+
}),
|
|
838
|
+
/* @__PURE__ */ u("span", {
|
|
839
|
+
ref: h,
|
|
840
|
+
className: Y.srOnly,
|
|
841
|
+
"aria-live": "polite",
|
|
842
|
+
children: g
|
|
843
|
+
})
|
|
844
|
+
]
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
var ye = { badge: "_badge_3xnd3_1" };
|
|
760
848
|
//#endregion
|
|
761
849
|
//#region src/components/Badge/Badge.tsx
|
|
762
|
-
function
|
|
850
|
+
function be(...e) {
|
|
763
851
|
return e.filter(Boolean).join(" ");
|
|
764
852
|
}
|
|
765
|
-
var
|
|
853
|
+
var xe = n(function({ text: e, color: t, className: n, style: r, ...i }, a) {
|
|
766
854
|
let o = t ? {
|
|
767
855
|
...r,
|
|
768
856
|
"--badge-color": t,
|
|
769
857
|
"--badge-background": `color-mix(in srgb, ${t} 14%, transparent)`
|
|
770
858
|
} : r;
|
|
771
|
-
return /* @__PURE__ */
|
|
859
|
+
return /* @__PURE__ */ u("span", {
|
|
772
860
|
ref: a,
|
|
773
|
-
className:
|
|
861
|
+
className: be(ye.badge, n),
|
|
774
862
|
style: o,
|
|
775
863
|
...i,
|
|
776
864
|
children: e
|
|
777
865
|
});
|
|
778
866
|
});
|
|
779
|
-
|
|
780
|
-
var
|
|
867
|
+
xe.displayName = "Badge";
|
|
868
|
+
var Z = {
|
|
781
869
|
switch: "_switch_1u3md_1",
|
|
782
870
|
input: "_input_1u3md_14",
|
|
783
871
|
track: "_track_1u3md_24",
|
|
@@ -789,10 +877,10 @@ var X = {
|
|
|
789
877
|
};
|
|
790
878
|
//#endregion
|
|
791
879
|
//#region src/components/Switch/Switch.tsx
|
|
792
|
-
function
|
|
880
|
+
function Se(...e) {
|
|
793
881
|
return e.filter(Boolean).join(" ");
|
|
794
882
|
}
|
|
795
|
-
var
|
|
883
|
+
var Ce = n(function({ label: e, className: t, color: n, size: r = "md", disabled: i = !1, onChange: a, onCheckedChange: o, "aria-label": s = "Interruttore", style: c, ...l }, f) {
|
|
796
884
|
function p(e) {
|
|
797
885
|
a?.(e), o?.(e.target.checked);
|
|
798
886
|
}
|
|
@@ -800,32 +888,32 @@ var Z = n(function({ label: e, className: t, color: n, size: r = "md", disabled:
|
|
|
800
888
|
...c,
|
|
801
889
|
"--switch-color": n
|
|
802
890
|
} : c;
|
|
803
|
-
return /* @__PURE__ */
|
|
804
|
-
className:
|
|
891
|
+
return /* @__PURE__ */ d("label", {
|
|
892
|
+
className: Se(Z.switch, Z[`size${r[0].toUpperCase()}${r.slice(1)}`], i && Z.disabled, t),
|
|
805
893
|
style: m,
|
|
806
894
|
children: [
|
|
807
|
-
/* @__PURE__ */
|
|
895
|
+
/* @__PURE__ */ u("input", {
|
|
808
896
|
ref: f,
|
|
809
897
|
type: "checkbox",
|
|
810
|
-
className:
|
|
898
|
+
className: Z.input,
|
|
811
899
|
disabled: i,
|
|
812
900
|
"aria-label": s,
|
|
813
901
|
onChange: p,
|
|
814
|
-
...
|
|
902
|
+
...l
|
|
815
903
|
}),
|
|
816
|
-
/* @__PURE__ */
|
|
817
|
-
className:
|
|
904
|
+
/* @__PURE__ */ u("span", {
|
|
905
|
+
className: Z.track,
|
|
818
906
|
"aria-hidden": "true",
|
|
819
|
-
children: /* @__PURE__ */
|
|
907
|
+
children: /* @__PURE__ */ u("span", { className: Z.thumb })
|
|
820
908
|
}),
|
|
821
|
-
e ? /* @__PURE__ */
|
|
822
|
-
className:
|
|
909
|
+
e ? /* @__PURE__ */ u("span", {
|
|
910
|
+
className: Z.label,
|
|
823
911
|
children: e
|
|
824
912
|
}) : null
|
|
825
913
|
]
|
|
826
914
|
});
|
|
827
915
|
});
|
|
828
|
-
|
|
916
|
+
Ce.displayName = "Switch";
|
|
829
917
|
var Q = {
|
|
830
918
|
wrapper: "_wrapper_1ly5u_1",
|
|
831
919
|
table: "_table_1ly5u_11",
|
|
@@ -850,20 +938,20 @@ var Q = {
|
|
|
850
938
|
function $(...e) {
|
|
851
939
|
return e.filter(Boolean).join(" ");
|
|
852
940
|
}
|
|
853
|
-
function
|
|
941
|
+
function we(e, t) {
|
|
854
942
|
return e == null ? 1 : t == null ? -1 : e instanceof Date && t instanceof Date ? e.getTime() - t.getTime() : typeof e == "number" && typeof t == "number" ? e - t : String(e).localeCompare(String(t), "it-IT", {
|
|
855
943
|
numeric: !0,
|
|
856
944
|
sensitivity: "base"
|
|
857
945
|
});
|
|
858
946
|
}
|
|
859
|
-
function
|
|
860
|
-
let [g, _] =
|
|
947
|
+
function Te({ columns: e, data: t, getRowId: n, caption: r, emptyMessage: i = "Non sono disponibili dati da visualizzare.", isLoading: a = !1, sortable: o = !0, onRowClick: c, rowAriaLabel: f, className: p, containerClassName: m, ...h }) {
|
|
948
|
+
let [g, _] = l(null), v = s(() => {
|
|
861
949
|
if (!g?.column.sortValue) return t;
|
|
862
950
|
let { column: e, direction: n } = g, r = n === "ascending" ? 1 : -1;
|
|
863
|
-
return [...t].sort((t, n) =>
|
|
951
|
+
return [...t].sort((t, n) => we(e.sortValue?.(t), e.sortValue?.(n)) * r);
|
|
864
952
|
}, [t, g]);
|
|
865
953
|
function y(e) {
|
|
866
|
-
!
|
|
954
|
+
!o || !e.sortable || !e.sortValue || _((t) => t?.column.id === e.id ? t.direction === "ascending" ? {
|
|
867
955
|
column: e,
|
|
868
956
|
direction: "descending"
|
|
869
957
|
} : null : {
|
|
@@ -875,41 +963,41 @@ function ve({ columns: e, data: t, getRowId: n, caption: r, emptyMessage: i = "N
|
|
|
875
963
|
return g?.column.id === e.id ? g.direction : "none";
|
|
876
964
|
}
|
|
877
965
|
function x(e) {
|
|
878
|
-
return g?.column.id === e.id ? g.direction === "ascending" ? /* @__PURE__ */
|
|
966
|
+
return g?.column.id === e.id ? g.direction === "ascending" ? /* @__PURE__ */ u(F, {
|
|
879
967
|
size: 15,
|
|
880
968
|
"aria-hidden": "true"
|
|
881
|
-
}) : /* @__PURE__ */
|
|
969
|
+
}) : /* @__PURE__ */ u(M, {
|
|
882
970
|
size: 15,
|
|
883
971
|
"aria-hidden": "true"
|
|
884
|
-
}) : /* @__PURE__ */
|
|
972
|
+
}) : /* @__PURE__ */ u(I, {
|
|
885
973
|
size: 15,
|
|
886
974
|
"aria-hidden": "true"
|
|
887
975
|
});
|
|
888
976
|
}
|
|
889
|
-
return /* @__PURE__ */
|
|
977
|
+
return /* @__PURE__ */ u("div", {
|
|
890
978
|
className: $(Q.wrapper, m),
|
|
891
|
-
children: /* @__PURE__ */
|
|
979
|
+
children: /* @__PURE__ */ d("table", {
|
|
892
980
|
className: $(Q.table, p),
|
|
893
981
|
...h,
|
|
894
982
|
children: [
|
|
895
|
-
r ? /* @__PURE__ */
|
|
983
|
+
r ? /* @__PURE__ */ u("caption", {
|
|
896
984
|
className: Q.caption,
|
|
897
985
|
children: r
|
|
898
986
|
}) : null,
|
|
899
|
-
/* @__PURE__ */
|
|
900
|
-
/* @__PURE__ */
|
|
987
|
+
/* @__PURE__ */ u("colgroup", { children: e.map((e) => /* @__PURE__ */ u("col", { style: e.width ? { width: e.width } : void 0 }, e.id)) }),
|
|
988
|
+
/* @__PURE__ */ u("thead", {
|
|
901
989
|
className: Q.head,
|
|
902
|
-
children: /* @__PURE__ */
|
|
903
|
-
let t =
|
|
904
|
-
return /* @__PURE__ */
|
|
990
|
+
children: /* @__PURE__ */ u("tr", { children: e.map((e) => {
|
|
991
|
+
let t = o && e.sortable && !!e.sortValue;
|
|
992
|
+
return /* @__PURE__ */ u("th", {
|
|
905
993
|
scope: "col",
|
|
906
994
|
"aria-sort": t ? b(e) : void 0,
|
|
907
|
-
className: $(Q.headerCell, Q[`align${
|
|
908
|
-
children: t ? /* @__PURE__ */
|
|
995
|
+
className: $(Q.headerCell, Q[`align${Ee(e.align ?? "left")}`], e.hideOnMobile && Q.hideOnMobile),
|
|
996
|
+
children: t ? /* @__PURE__ */ d("button", {
|
|
909
997
|
type: "button",
|
|
910
998
|
className: Q.sortButton,
|
|
911
999
|
onClick: () => y(e),
|
|
912
|
-
children: [/* @__PURE__ */
|
|
1000
|
+
children: [/* @__PURE__ */ u("span", { children: e.header }), /* @__PURE__ */ u("span", {
|
|
913
1001
|
className: Q.sortIcon,
|
|
914
1002
|
children: x(e)
|
|
915
1003
|
})]
|
|
@@ -917,24 +1005,24 @@ function ve({ columns: e, data: t, getRowId: n, caption: r, emptyMessage: i = "N
|
|
|
917
1005
|
}, e.id);
|
|
918
1006
|
}) })
|
|
919
1007
|
}),
|
|
920
|
-
/* @__PURE__ */
|
|
1008
|
+
/* @__PURE__ */ d("tbody", {
|
|
921
1009
|
className: Q.body,
|
|
922
1010
|
children: [
|
|
923
|
-
a ? /* @__PURE__ */
|
|
1011
|
+
a ? /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
924
1012
|
className: Q.statusCell,
|
|
925
1013
|
colSpan: e.length,
|
|
926
1014
|
children: "Caricamento dati…"
|
|
927
1015
|
}) }) : null,
|
|
928
|
-
!a && v.length === 0 ? /* @__PURE__ */
|
|
1016
|
+
!a && v.length === 0 ? /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
|
|
929
1017
|
className: Q.statusCell,
|
|
930
1018
|
colSpan: e.length,
|
|
931
1019
|
children: i
|
|
932
1020
|
}) }) : null,
|
|
933
1021
|
a ? null : v.map((t, r) => {
|
|
934
|
-
let i = n(t, r), a =
|
|
1022
|
+
let i = n(t, r), a = c, o = !!a, s = () => {
|
|
935
1023
|
a?.(t, r);
|
|
936
1024
|
};
|
|
937
|
-
return /* @__PURE__ */
|
|
1025
|
+
return /* @__PURE__ */ u("tr", {
|
|
938
1026
|
className: $(Q.row, o && Q.interactiveRow),
|
|
939
1027
|
tabIndex: o ? 0 : void 0,
|
|
940
1028
|
"aria-label": o ? f?.(t, r) : void 0,
|
|
@@ -942,8 +1030,8 @@ function ve({ columns: e, data: t, getRowId: n, caption: r, emptyMessage: i = "N
|
|
|
942
1030
|
onKeyDown: o ? (e) => {
|
|
943
1031
|
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), s());
|
|
944
1032
|
} : void 0,
|
|
945
|
-
children: e.map((e) => /* @__PURE__ */
|
|
946
|
-
className: $(Q.cell, Q[`align${
|
|
1033
|
+
children: e.map((e) => /* @__PURE__ */ u("td", {
|
|
1034
|
+
className: $(Q.cell, Q[`align${Ee(e.align ?? "left")}`], e.numeric && Q.numeric, e.hideOnMobile && Q.hideOnMobile),
|
|
947
1035
|
children: e.cell(t, r)
|
|
948
1036
|
}, e.id))
|
|
949
1037
|
}, i);
|
|
@@ -954,8 +1042,8 @@ function ve({ columns: e, data: t, getRowId: n, caption: r, emptyMessage: i = "N
|
|
|
954
1042
|
})
|
|
955
1043
|
});
|
|
956
1044
|
}
|
|
957
|
-
function
|
|
1045
|
+
function Ee(e) {
|
|
958
1046
|
return `${e.charAt(0).toUpperCase()}${e.slice(1)}`;
|
|
959
1047
|
}
|
|
960
1048
|
//#endregion
|
|
961
|
-
export {
|
|
1049
|
+
export { xe as Badge, g as Button, x as Card, Te as DataTable, oe as DatePicker, fe as Dropdown, ue as IconButton, ve as MonthCarousel, me as MultiSelect, Ce as Switch, de as TextField };
|