@bertimatteodev/astra-ui 0.4.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.js CHANGED
@@ -1,6 +1,6 @@
1
- import { forwardRef as e, useId as t, useState as n } from "react";
2
- import { jsx as r, jsxs as i } from "react/jsx-runtime";
3
- import './index.css';var a = {
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 a = {
15
15
  label: "_label_gjxjz_106",
16
16
  spinner: "_spinner_gjxjz_111",
17
17
  spin: "_spin_gjxjz_111"
18
- }, o = {
19
- primary: a.variantPrimary,
20
- secondary: a.variantSecondary,
21
- ghost: a.variantGhost,
22
- danger: a.variantDanger
23
- }, s = {
24
- sm: a.sizeSm,
25
- md: a.sizeMd,
26
- lg: a.sizeLg
18
+ }, p = {
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 c(...e) {
28
+ function h(...e) {
29
29
  return e.filter(Boolean).join(" ");
30
30
  }
31
- var l = e(function({ children: e, className: t, variant: n = "primary", size: l = "md", fullWidth: u = !1, isLoading: d = !1, startIcon: f, endIcon: p, disabled: m, type: h = "button", ...g }, _) {
32
- let v = m || d;
33
- return /* @__PURE__ */ i("button", {
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
+ let v = c || a;
33
+ return /* @__PURE__ */ d("button", {
34
34
  ref: _,
35
- type: h,
36
- className: c(a.button, o[n], s[l], u && a.fullWidth, d && a.loading, t),
35
+ type: l,
36
+ className: h(f.button, p[n], m[r], i && f.fullWidth, a && f.loading, t),
37
37
  disabled: v,
38
- "aria-busy": d || void 0,
38
+ "aria-busy": a || void 0,
39
39
  ...g,
40
40
  children: [
41
- d ? /* @__PURE__ */ r("span", {
42
- className: a.spinner,
41
+ a ? /* @__PURE__ */ u("span", {
42
+ className: f.spinner,
43
43
  "aria-hidden": "true"
44
44
  }) : null,
45
- !d && f ? /* @__PURE__ */ r("span", {
46
- className: a.icon,
45
+ !a && o ? /* @__PURE__ */ u("span", {
46
+ className: f.icon,
47
47
  "aria-hidden": "true",
48
- children: f
48
+ children: o
49
49
  }) : null,
50
- /* @__PURE__ */ r("span", {
51
- className: a.label,
50
+ /* @__PURE__ */ u("span", {
51
+ className: f.label,
52
52
  children: e
53
53
  }),
54
- !d && p ? /* @__PURE__ */ r("span", {
55
- className: a.icon,
54
+ !a && s ? /* @__PURE__ */ u("span", {
55
+ className: f.icon,
56
56
  "aria-hidden": "true",
57
- children: p
57
+ children: s
58
58
  }) : null
59
59
  ]
60
60
  });
61
61
  });
62
- l.displayName = "Button";
63
- var u = {
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,29 +69,368 @@ var u = {
69
69
  elevationNone: "_elevationNone_1ex3y_26",
70
70
  elevationSm: "_elevationSm_1ex3y_30",
71
71
  elevationMd: "_elevationMd_1ex3y_34"
72
- }, d = {
73
- none: u.paddingNone,
74
- sm: u.paddingSm,
75
- md: u.paddingMd,
76
- lg: u.paddingLg
77
- }, f = {
78
- none: u.elevationNone,
79
- sm: u.elevationSm,
80
- md: u.elevationMd
72
+ }, v = {
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 p(...e) {
82
+ function b(...e) {
83
83
  return e.filter(Boolean).join(" ");
84
84
  }
85
- var m = e(function({ children: e, className: t, padding: n = "md", elevation: i = "sm", ...a }, o) {
86
- return /* @__PURE__ */ r("div", {
87
- ref: o,
88
- className: p(u.card, d[n], f[i], t),
89
- ...a,
85
+ var x = n(function({ children: e, className: t, padding: n = "md", elevation: r = "sm", ...i }, a) {
86
+ return /* @__PURE__ */ u("div", {
87
+ ref: a,
88
+ className: b(_.card, v[n], y[r], t),
89
+ ...i,
90
90
  children: e
91
91
  });
92
92
  });
93
- m.displayName = "Card";
94
- var h = {
93
+ x.displayName = "Card";
94
+ //#endregion
95
+ //#region node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.mjs
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
+ return t.charAt(0).toUpperCase() + t.slice(1);
99
+ }, E = {
100
+ xmlns: "http://www.w3.org/2000/svg",
101
+ width: 24,
102
+ height: 24,
103
+ viewBox: "0 0 24 24",
104
+ fill: "none",
105
+ stroke: "currentColor",
106
+ strokeWidth: 2,
107
+ strokeLinecap: "round",
108
+ strokeLinejoin: "round"
109
+ }, D = (e) => {
110
+ for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
111
+ return !1;
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
+ return t("svg", {
115
+ ref: l,
116
+ ...E,
117
+ width: n ?? u ?? E.width,
118
+ height: n ?? u ?? E.height,
119
+ stroke: e ?? p,
120
+ strokeWidth: h,
121
+ className: S("lucide", m, a),
122
+ ...!o && !D(c) && { "aria-hidden": "true" },
123
+ ...c
124
+ }, [...s.map(([e, n]) => t(e, n)), ...Array.isArray(o) ? o : [o]]);
125
+ }), j = (e, r) => {
126
+ let i = n(({ className: n, ...i }, a) => t(A, {
127
+ ref: a,
128
+ iconNode: r,
129
+ className: S(`lucide-${C(T(e))}`, `lucide-${e}`, n),
130
+ ...i
131
+ }));
132
+ return i.displayName = T(e), i;
133
+ }, ee = j("calendar-days", [
134
+ ["path", {
135
+ d: "M8 2v3",
136
+ key: "1ioesn"
137
+ }],
138
+ ["path", {
139
+ d: "M16 2v3",
140
+ key: "otl347"
141
+ }],
142
+ ["rect", {
143
+ x: "3",
144
+ y: "3",
145
+ width: "18",
146
+ height: "18",
147
+ rx: "2",
148
+ key: "h1oib"
149
+ }],
150
+ ["path", {
151
+ d: "M3 9h18",
152
+ key: "1pudct"
153
+ }],
154
+ ["path", {
155
+ d: "M8 13h.01",
156
+ key: "1sbv64"
157
+ }],
158
+ ["path", {
159
+ d: "M12 13h.01",
160
+ key: "y0uutt"
161
+ }],
162
+ ["path", {
163
+ d: "M16 13h.01",
164
+ key: "wip0gl"
165
+ }],
166
+ ["path", {
167
+ d: "M8 17h.01",
168
+ key: "p3bg7i"
169
+ }],
170
+ ["path", {
171
+ d: "M12 17h.01",
172
+ key: "p32p05"
173
+ }],
174
+ ["path", {
175
+ d: "M16 17h.01",
176
+ key: "ql8jdd"
177
+ }]
178
+ ]), M = j("chevron-down", [["path", {
179
+ d: "m6 9 6 6 6-6",
180
+ key: "qrunsl"
181
+ }]]), N = j("chevron-left", [["path", {
182
+ d: "m15 18-6-6 6-6",
183
+ key: "1wnfg3"
184
+ }]]), P = j("chevron-right", [["path", {
185
+ d: "m9 18 6-6-6-6",
186
+ key: "mthhwq"
187
+ }]]), F = j("chevron-up", [["path", {
188
+ d: "m18 15-6-6-6 6",
189
+ key: "153udz"
190
+ }]]), I = j("chevrons-up-down", [["path", {
191
+ d: "m7 15 5 5 5-5",
192
+ key: "1hf1tw"
193
+ }], ["path", {
194
+ d: "m7 9 5-5 5 5",
195
+ key: "sgt6xg"
196
+ }]]), L = {
197
+ field: "_field_t3jjk_1",
198
+ label: "_label_t3jjk_8",
199
+ trigger: "_trigger_t3jjk_15",
200
+ triggerIcon: "_triggerIcon_t3jjk_44",
201
+ triggerValue: "_triggerValue_t3jjk_50",
202
+ placeholder: "_placeholder_t3jjk_57",
203
+ isDisabled: "_isDisabled_t3jjk_61",
204
+ hasError: "_hasError_t3jjk_68",
205
+ error: "_error_t3jjk_76",
206
+ popover: "_popover_t3jjk_83",
207
+ calendarHeader: "_calendarHeader_t3jjk_98",
208
+ monthLabel: "_monthLabel_t3jjk_105",
209
+ navigationButton: "_navigationButton_t3jjk_116",
210
+ calendarGrid: "_calendarGrid_t3jjk_139",
211
+ weekDay: "_weekDay_t3jjk_145",
212
+ day: "_day_t3jjk_156",
213
+ selectedDay: "_selectedDay_t3jjk_173",
214
+ outsideMonth: "_outsideMonth_t3jjk_190",
215
+ today: "_today_t3jjk_195",
216
+ footer: "_footer_t3jjk_210",
217
+ textButton: "_textButton_t3jjk_218"
218
+ }, R = [
219
+ "Lun",
220
+ "Mar",
221
+ "Mer",
222
+ "Gio",
223
+ "Ven",
224
+ "Sab",
225
+ "Dom"
226
+ ];
227
+ function z(e) {
228
+ return new Date(e.getFullYear(), e.getMonth(), e.getDate());
229
+ }
230
+ function B(e) {
231
+ return `${e.getFullYear()}-${String(e.getMonth() + 1).padStart(2, "0")}-${String(e.getDate()).padStart(2, "0")}`;
232
+ }
233
+ function V(e, t) {
234
+ return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate();
235
+ }
236
+ function te(e, t) {
237
+ return e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth();
238
+ }
239
+ function ne(e, t, n) {
240
+ let r = z(e);
241
+ return !!(t && r < z(t) || n && r > z(n));
242
+ }
243
+ function re(e) {
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
+ return Array.from({ length: o }, (e, t) => new Date(s.getFullYear(), s.getMonth(), s.getDate() + t));
246
+ }
247
+ function ie(e, t) {
248
+ let n = new Intl.DateTimeFormat(t, {
249
+ month: "long",
250
+ year: "numeric"
251
+ }).format(e);
252
+ return n.charAt(0).toUpperCase() + n.slice(1);
253
+ }
254
+ function ae(e, t) {
255
+ return e ? new Intl.DateTimeFormat(t, {
256
+ day: "2-digit",
257
+ month: "short",
258
+ year: "numeric"
259
+ }).format(e) : "";
260
+ }
261
+ function H(...e) {
262
+ return e.filter(Boolean).join(" ");
263
+ }
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
+ function e(e) {
270
+ C.current && !C.current.contains(e.target) && E(!1);
271
+ }
272
+ function t(e) {
273
+ e.key === "Escape" && (E(!1), w.current?.focus());
274
+ }
275
+ return document.addEventListener("pointerdown", e), document.addEventListener("keydown", t), () => {
276
+ document.removeEventListener("pointerdown", e), document.removeEventListener("keydown", t);
277
+ };
278
+ }, []);
279
+ function j() {
280
+ f || (O(z(e ?? /* @__PURE__ */ new Date())), E(!0));
281
+ }
282
+ function M(e) {
283
+ ne(e, p, m) || (t(z(e)), E(!1), w.current?.focus());
284
+ }
285
+ function F(e) {
286
+ O((t) => new Date(t.getFullYear(), t.getMonth() + e, 1));
287
+ }
288
+ function I(e, t) {
289
+ let n = new Date(t);
290
+ if (e.key === "ArrowLeft") n.setDate(t.getDate() - 1);
291
+ else if (e.key === "ArrowRight") n.setDate(t.getDate() + 1);
292
+ else if (e.key === "ArrowUp") n.setDate(t.getDate() - 7);
293
+ else if (e.key === "ArrowDown") n.setDate(t.getDate() + 7);
294
+ else if (e.key === "Home") n.setDate(t.getDate() - (t.getDay() + 6) % 7);
295
+ else if (e.key === "End") n.setDate(t.getDate() + (6 - (t.getDay() + 6) % 7));
296
+ else return;
297
+ e.preventDefault();
298
+ let r = `${b}-${B(n)}`, i = document.getElementById(r);
299
+ if (i) {
300
+ i.focus();
301
+ return;
302
+ }
303
+ O(new Date(n.getFullYear(), n.getMonth(), 1));
304
+ }
305
+ let oe = ae(e, i);
306
+ return /* @__PURE__ */ d("div", {
307
+ ref: C,
308
+ className: L.field,
309
+ children: [
310
+ n ? /* @__PURE__ */ u("label", {
311
+ className: L.label,
312
+ htmlFor: b,
313
+ children: n
314
+ }) : null,
315
+ /* @__PURE__ */ u("input", {
316
+ id: b,
317
+ type: "hidden",
318
+ name: g,
319
+ value: e ? B(e) : ""
320
+ }),
321
+ /* @__PURE__ */ d("button", {
322
+ ref: w,
323
+ type: "button",
324
+ className: H(L.trigger, v && L.hasError, f && L.isDisabled),
325
+ disabled: f,
326
+ "aria-haspopup": "dialog",
327
+ "aria-expanded": T,
328
+ "aria-controls": T ? x : void 0,
329
+ onClick: () => T ? E(!1) : j(),
330
+ children: [/* @__PURE__ */ u(ee, {
331
+ className: L.triggerIcon,
332
+ size: 18,
333
+ "aria-hidden": "true"
334
+ }), /* @__PURE__ */ u("span", {
335
+ className: H(L.triggerValue, !e && L.placeholder),
336
+ children: oe || r
337
+ })]
338
+ }),
339
+ v ? /* @__PURE__ */ u("p", {
340
+ id: S,
341
+ className: L.error,
342
+ role: "alert",
343
+ children: v
344
+ }) : null,
345
+ T ? /* @__PURE__ */ d("div", {
346
+ id: x,
347
+ className: L.popover,
348
+ role: "dialog",
349
+ "aria-label": "Seleziona una data",
350
+ children: [
351
+ /* @__PURE__ */ d("header", {
352
+ className: L.calendarHeader,
353
+ children: [
354
+ /* @__PURE__ */ u("button", {
355
+ type: "button",
356
+ className: L.navigationButton,
357
+ "aria-label": "Mese precedente",
358
+ onClick: () => F(-1),
359
+ children: /* @__PURE__ */ u(N, {
360
+ size: 18,
361
+ "aria-hidden": "true"
362
+ })
363
+ }),
364
+ /* @__PURE__ */ u("span", {
365
+ className: L.monthLabel,
366
+ children: ie(D, i)
367
+ }),
368
+ /* @__PURE__ */ u("button", {
369
+ type: "button",
370
+ className: L.navigationButton,
371
+ "aria-label": "Mese successivo",
372
+ onClick: () => F(1),
373
+ children: /* @__PURE__ */ u(P, {
374
+ size: 18,
375
+ "aria-hidden": "true"
376
+ })
377
+ })
378
+ ]
379
+ }),
380
+ /* @__PURE__ */ d("div", {
381
+ className: L.calendarGrid,
382
+ role: "grid",
383
+ "aria-label": ie(D, i),
384
+ children: [R.map((e) => /* @__PURE__ */ u("span", {
385
+ className: L.weekDay,
386
+ role: "columnheader",
387
+ children: e
388
+ }, e)), k.map((t) => {
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
+ type: "button",
393
+ role: "gridcell",
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
+ weekday: "long",
398
+ day: "numeric",
399
+ month: "long",
400
+ year: "numeric"
401
+ }).format(t),
402
+ "aria-selected": r,
403
+ tabIndex: r || !e && a ? 0 : -1,
404
+ onClick: () => M(t),
405
+ onKeyDown: (e) => I(e, t),
406
+ children: t.getDate()
407
+ }, s);
408
+ })]
409
+ }),
410
+ /* @__PURE__ */ d("footer", {
411
+ className: L.footer,
412
+ children: [/* @__PURE__ */ u("button", {
413
+ type: "button",
414
+ className: L.textButton,
415
+ onClick: () => {
416
+ O(A), M(A);
417
+ },
418
+ children: "Oggi"
419
+ }), h && e ? /* @__PURE__ */ u("button", {
420
+ type: "button",
421
+ className: L.textButton,
422
+ onClick: () => {
423
+ t(null), E(!1), w.current?.focus();
424
+ },
425
+ children: "Cancella"
426
+ }) : null]
427
+ })
428
+ ]
429
+ }) : null
430
+ ]
431
+ });
432
+ }
433
+ var U = {
95
434
  button: "_button_2kydv_1",
96
435
  sizeSm: "_sizeSm_2kydv_27",
97
436
  sizeMd: "_sizeMd_2kydv_32",
@@ -105,45 +444,45 @@ var h = {
105
444
  spinner: "_spinner_2kydv_94",
106
445
  spin: "_spin_2kydv_94",
107
446
  loading: "_loading_2kydv_103"
108
- }, g = {
109
- primary: h.variantPrimary,
110
- secondary: h.variantSecondary,
111
- ghost: h.variantGhost,
112
- danger: h.variantDanger
113
- }, _ = {
114
- sm: h.sizeSm,
115
- md: h.sizeMd,
116
- lg: h.sizeLg
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
117
456
  };
118
- function v(...e) {
457
+ function le(...e) {
119
458
  return e.filter(Boolean).join(" ");
120
459
  }
121
- var y = e(function({ icon: e, label: t, className: n, variant: i = "secondary", size: a = "md", isLoading: o = !1, borderless: s = !1, backgroundColor: c, disabled: l, type: u = "button", style: d, ...f }, p) {
122
- let m = l || o, y = c ? {
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
+ let m = c || a, h = s ? {
123
462
  ...d,
124
- backgroundColor: c
463
+ backgroundColor: s
125
464
  } : d;
126
- return /* @__PURE__ */ r("button", {
465
+ return /* @__PURE__ */ u("button", {
127
466
  ref: p,
128
- type: u,
129
- className: v(h.button, g[i], _[a], o && h.loading, s && h.borderless, n),
130
- style: y,
467
+ type: l,
468
+ className: le(U.button, se[r], ce[i], a && U.loading, o && U.borderless, n),
469
+ style: h,
131
470
  disabled: m,
132
471
  "aria-label": t,
133
- "aria-busy": o || void 0,
472
+ "aria-busy": a || void 0,
134
473
  ...f,
135
- children: o ? /* @__PURE__ */ r("span", {
136
- className: h.spinner,
474
+ children: a ? /* @__PURE__ */ u("span", {
475
+ className: U.spinner,
137
476
  "aria-hidden": "true"
138
- }) : /* @__PURE__ */ r("span", {
139
- className: h.icon,
477
+ }) : /* @__PURE__ */ u("span", {
478
+ className: U.icon,
140
479
  "aria-hidden": "true",
141
480
  children: e
142
481
  })
143
482
  });
144
483
  });
145
- y.displayName = "IconButton";
146
- var b = {
484
+ ue.displayName = "IconButton";
485
+ var W = {
147
486
  field: "_field_1pq0j_1",
148
487
  label: "_label_1pq0j_7",
149
488
  required: "_required_1pq0j_14",
@@ -157,147 +496,223 @@ var b = {
157
496
  };
158
497
  //#endregion
159
498
  //#region src/components/TextField/TextField.tsx
160
- function x(...e) {
499
+ function G(...e) {
161
500
  return e.filter(Boolean).join(" ");
162
501
  }
163
- var S = e(function({ id: e, label: n, hint: a, error: o, startAdornment: s, endAdornment: c, className: l, containerClassName: u, disabled: d, required: f, "aria-describedby": p, ...m }, h) {
164
- let g = t(), _ = e ?? `text-field-${g}`, v = `${_}-hint`, y = `${_}-error`, S = [
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 = [
165
504
  p,
166
- a ? v : null,
167
- o ? y : null
505
+ n ? v : null,
506
+ r ? y : null
168
507
  ].filter(Boolean).join(" ");
169
- return /* @__PURE__ */ i("div", {
170
- className: x(b.field, u),
508
+ return /* @__PURE__ */ d("div", {
509
+ className: G(W.field, c),
171
510
  children: [
172
- n ? /* @__PURE__ */ i("label", {
173
- className: b.label,
511
+ t ? /* @__PURE__ */ d("label", {
512
+ className: W.label,
174
513
  htmlFor: _,
175
- children: [n, f ? /* @__PURE__ */ i("span", {
176
- className: b.required,
514
+ children: [t, f ? /* @__PURE__ */ d("span", {
515
+ className: W.required,
177
516
  "aria-hidden": "true",
178
517
  children: [" ", "*"]
179
518
  }) : null]
180
519
  }) : null,
181
- /* @__PURE__ */ i("div", {
182
- className: x(b.control, o && b.hasError, d && b.isDisabled),
520
+ /* @__PURE__ */ d("div", {
521
+ className: G(W.control, r && W.hasError, l && W.isDisabled),
183
522
  children: [
184
- s ? /* @__PURE__ */ r("span", {
185
- className: b.adornment,
523
+ i ? /* @__PURE__ */ u("span", {
524
+ className: W.adornment,
186
525
  "aria-hidden": "true",
187
- children: s
526
+ children: i
188
527
  }) : null,
189
- /* @__PURE__ */ r("input", {
528
+ /* @__PURE__ */ u("input", {
190
529
  ref: h,
191
530
  id: _,
192
- className: x(b.input, l),
193
- disabled: d,
531
+ className: G(W.input, s),
532
+ disabled: l,
194
533
  required: f,
195
- "aria-invalid": o ? !0 : void 0,
196
- "aria-describedby": S || void 0,
534
+ "aria-invalid": r ? !0 : void 0,
535
+ "aria-describedby": b || void 0,
197
536
  ...m
198
537
  }),
199
- c ? /* @__PURE__ */ r("span", {
200
- className: b.adornment,
538
+ a ? /* @__PURE__ */ u("span", {
539
+ className: W.adornment,
201
540
  "aria-hidden": "true",
202
- children: c
541
+ children: a
203
542
  }) : null
204
543
  ]
205
544
  }),
206
- o ? /* @__PURE__ */ r("p", {
545
+ r ? /* @__PURE__ */ u("p", {
207
546
  id: y,
208
- className: b.error,
547
+ className: W.error,
209
548
  role: "alert",
210
- children: o
549
+ children: r
211
550
  }) : null,
212
- !o && a ? /* @__PURE__ */ r("p", {
551
+ !r && n ? /* @__PURE__ */ u("p", {
213
552
  id: v,
214
- className: b.hint,
215
- children: a
553
+ className: W.hint,
554
+ children: n
216
555
  }) : null
217
556
  ]
218
557
  });
219
558
  });
220
- S.displayName = "TextField";
221
- var C = {
222
- field: "_field_1na7j_1",
223
- label: "_label_1na7j_7",
224
- required: "_required_1na7j_14",
225
- control: "_control_1na7j_18",
226
- select: "_select_1na7j_34",
227
- indicator: "_indicator_1na7j_57",
228
- hint: "_hint_1na7j_69",
229
- error: "_error_1na7j_70",
230
- hasError: "_hasError_1na7j_84",
231
- isDisabled: "_isDisabled_1na7j_92"
559
+ de.displayName = "TextField";
560
+ var K = {
561
+ field: "_field_3nnjq_1",
562
+ label: "_label_3nnjq_7",
563
+ required: "_required_3nnjq_14",
564
+ control: "_control_3nnjq_18",
565
+ nativeSelect: "_nativeSelect_3nnjq_34",
566
+ trigger: "_trigger_3nnjq_45",
567
+ indicator: "_indicator_3nnjq_66",
568
+ placeholder: "_placeholder_3nnjq_78",
569
+ menu: "_menu_3nnjq_82",
570
+ option: "_option_3nnjq_98",
571
+ activeOption: "_activeOption_3nnjq_110",
572
+ selectedOption: "_selectedOption_3nnjq_114",
573
+ isOpen: "_isOpen_3nnjq_124",
574
+ hint: "_hint_3nnjq_129",
575
+ error: "_error_3nnjq_130",
576
+ hasError: "_hasError_3nnjq_144",
577
+ isDisabled: "_isDisabled_3nnjq_152"
232
578
  };
233
579
  //#endregion
234
580
  //#region src/components/Dropdown/Dropdown.tsx
235
- function w(...e) {
581
+ function q(...e) {
236
582
  return e.filter(Boolean).join(" ");
237
583
  }
238
- var T = e(function({ id: e, options: n, label: a, hint: o, error: s, placeholder: c, className: l, containerClassName: u, disabled: d, required: f, onChange: p, onValueChange: m, "aria-describedby": h, ...g }, _) {
239
- let v = t(), y = e ?? `dropdown-${v}`, b = `${y}-hint`, x = `${y}-error`, S = [
240
- h,
241
- o ? b : null,
242
- s ? x : null
243
- ].filter(Boolean).join(" ");
244
- function T(e) {
245
- p?.(e), m?.(e.target.value);
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
+ b,
587
+ r ? T : null,
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
+ function e(e) {
592
+ I.current?.contains(e.target) || N(!1);
593
+ }
594
+ return document.addEventListener("mousedown", e), () => document.removeEventListener("mousedown", e);
595
+ }, []);
596
+ function B(e) {
597
+ v?.(e), y?.(e.target.value);
246
598
  }
247
- return /* @__PURE__ */ i("div", {
248
- className: w(C.field, u),
599
+ function V(e) {
600
+ A === void 0 && ee(e), y?.(e), N(!1);
601
+ }
602
+ function te(e) {
603
+ if (!m) {
604
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") {
605
+ e.preventDefault(), N(!0);
606
+ let t = (z.indexOf(P) + (e.key === "ArrowDown" ? 1 : -1) + z.length) % z.length;
607
+ F(z[t] ?? 0);
608
+ }
609
+ if (e.key === "Enter" || e.key === " ") {
610
+ if (e.preventDefault(), M) {
611
+ let e = t[P];
612
+ e && !e.disabled && V(e.value);
613
+ } else N(!0);
614
+ }
615
+ e.key === "Escape" && N(!1);
616
+ }
617
+ }
618
+ return /* @__PURE__ */ d("div", {
619
+ className: q(K.field, p),
249
620
  children: [
250
- a ? /* @__PURE__ */ i("label", {
251
- className: C.label,
252
- htmlFor: y,
253
- children: [a, f ? /* @__PURE__ */ i("span", {
254
- className: C.required,
621
+ n ? /* @__PURE__ */ d("label", {
622
+ id: D,
623
+ className: K.label,
624
+ htmlFor: w,
625
+ children: [n, h ? /* @__PURE__ */ d("span", {
626
+ className: K.required,
255
627
  "aria-hidden": "true",
256
628
  children: [" ", "*"]
257
629
  }) : null]
258
630
  }) : null,
259
- /* @__PURE__ */ i("div", {
260
- className: w(C.control, s && C.hasError, d && C.isDisabled),
261
- children: [/* @__PURE__ */ i("select", {
262
- ref: _,
263
- id: y,
264
- className: w(C.select, l),
265
- disabled: d,
266
- required: f,
267
- "aria-invalid": s ? !0 : void 0,
268
- "aria-describedby": S || void 0,
269
- onChange: T,
270
- ...g,
271
- children: [c ? /* @__PURE__ */ r("option", {
272
- value: "",
273
- disabled: !0,
274
- children: c
275
- }) : null, n.map((e) => /* @__PURE__ */ r("option", {
276
- value: e.value,
277
- disabled: e.disabled,
278
- children: e.label
279
- }, e.value))]
280
- }), /* @__PURE__ */ r("span", {
281
- className: C.indicator,
282
- "aria-hidden": "true"
283
- })]
631
+ /* @__PURE__ */ d("div", {
632
+ ref: I,
633
+ className: q(K.control, i && K.hasError, m && K.isDisabled, M && K.isOpen),
634
+ children: [
635
+ /* @__PURE__ */ d("select", {
636
+ ref: S,
637
+ id: w,
638
+ className: K.nativeSelect,
639
+ disabled: m,
640
+ required: h,
641
+ value: L,
642
+ "aria-invalid": i ? !0 : void 0,
643
+ "aria-describedby": k || void 0,
644
+ onChange: B,
645
+ ...x,
646
+ children: [s ? /* @__PURE__ */ u("option", {
647
+ value: "",
648
+ disabled: !0,
649
+ children: s
650
+ }) : null, t.map((e) => /* @__PURE__ */ u("option", {
651
+ value: e.value,
652
+ disabled: e.disabled,
653
+ children: e.label
654
+ }, e.value))]
655
+ }),
656
+ /* @__PURE__ */ d("button", {
657
+ type: "button",
658
+ className: q(K.trigger, f),
659
+ disabled: m,
660
+ "aria-haspopup": "listbox",
661
+ "aria-expanded": M,
662
+ "aria-controls": O,
663
+ "aria-labelledby": n ? D : void 0,
664
+ "aria-describedby": k || void 0,
665
+ "aria-invalid": i ? !0 : void 0,
666
+ onClick: () => N((e) => !e),
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
+ "aria-hidden": "true"
674
+ })]
675
+ }),
676
+ M ? /* @__PURE__ */ d("div", {
677
+ id: O,
678
+ className: K.menu,
679
+ role: "listbox",
680
+ children: [s ? /* @__PURE__ */ u("button", {
681
+ type: "button",
682
+ className: q(K.option, !L && K.selectedOption),
683
+ role: "option",
684
+ "aria-selected": !L,
685
+ onClick: () => V(""),
686
+ children: s
687
+ }) : null, t.map((e, t) => /* @__PURE__ */ u("button", {
688
+ type: "button",
689
+ className: q(K.option, e.value === L && K.selectedOption, t === P && K.activeOption),
690
+ role: "option",
691
+ "aria-selected": e.value === L,
692
+ disabled: e.disabled,
693
+ onMouseEnter: () => F(t),
694
+ onClick: () => V(e.value),
695
+ children: e.label
696
+ }, e.value))]
697
+ }) : null
698
+ ]
284
699
  }),
285
- s ? /* @__PURE__ */ r("p", {
286
- id: x,
287
- className: C.error,
700
+ i ? /* @__PURE__ */ u("p", {
701
+ id: E,
702
+ className: K.error,
288
703
  role: "alert",
289
- children: s
704
+ children: i
290
705
  }) : null,
291
- !s && o ? /* @__PURE__ */ r("p", {
292
- id: b,
293
- className: C.hint,
294
- children: o
706
+ !i && r ? /* @__PURE__ */ u("p", {
707
+ id: T,
708
+ className: K.hint,
709
+ children: r
295
710
  }) : null
296
711
  ]
297
712
  });
298
713
  });
299
- T.displayName = "Dropdown";
300
- var E = {
714
+ fe.displayName = "Dropdown";
715
+ var J = {
301
716
  group: "_group_1fqa2_1",
302
717
  option: "_option_1fqa2_8",
303
718
  selected: "_selected_1fqa2_41",
@@ -305,62 +720,330 @@ var E = {
305
720
  };
306
721
  //#endregion
307
722
  //#region src/components/MultiSelect/MultiSelect.tsx
308
- function D(...e) {
723
+ function pe(...e) {
309
724
  return e.filter(Boolean).join(" ");
310
725
  }
311
- var O = e(function({ options: e, value: t, defaultValue: a = [], multiple: o = !1, disabled: s = !1, className: c, onValueChange: l, "aria-label": u = o ? "Selezione multipla" : "Selezione singola", ...d }, f) {
312
- let [p, m] = n(a), h = t ?? p, g = o ? h : h.slice(0, 1);
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);
313
728
  function _(e) {
314
- let n = g.includes(e), r = o ? n ? g.filter((t) => t !== e) : [...g, e] : n ? [] : [e];
315
- t === void 0 && m(r), l?.(r);
729
+ let n = g.includes(e), i = r ? n ? g.filter((t) => t !== e) : [...g, e] : n ? [] : [e];
730
+ t === void 0 && m(i), o?.(i);
316
731
  }
317
- return /* @__PURE__ */ r("div", {
732
+ return /* @__PURE__ */ u("div", {
318
733
  ref: f,
319
734
  role: "group",
320
- "aria-label": u,
321
- className: D(E.group, c),
322
- ...d,
735
+ "aria-label": s,
736
+ className: pe(J.group, a),
737
+ ...c,
323
738
  children: e.map((e) => {
324
- let t = g.includes(e.value), n = s || e.disabled, a = e.selectedColor ? {
739
+ let t = g.includes(e.value), n = i || e.disabled, r = e.selectedColor ? {
325
740
  "--multi-select-selected-color": e.selectedColor,
326
741
  "--multi-select-selected-background": `color-mix(in srgb, ${e.selectedColor} 14%, transparent)`
327
742
  } : void 0;
328
- return /* @__PURE__ */ i("button", {
743
+ return /* @__PURE__ */ d("button", {
329
744
  type: "button",
330
- className: D(E.option, t && E.selected),
745
+ className: pe(J.option, t && J.selected),
331
746
  disabled: n,
332
747
  "aria-pressed": t,
333
- style: a,
748
+ style: r,
334
749
  onClick: () => _(e.value),
335
- children: [e.count === void 0 ? null : /* @__PURE__ */ r("span", {
336
- className: E.count,
750
+ children: [e.count === void 0 ? null : /* @__PURE__ */ u("span", {
751
+ className: J.count,
337
752
  children: e.count
338
- }), /* @__PURE__ */ r("span", { children: e.label })]
753
+ }), /* @__PURE__ */ u("span", { children: e.label })]
339
754
  }, e.value);
340
755
  })
341
756
  });
342
757
  });
343
- O.displayName = "MultiSelect";
344
- var k = { badge: "_badge_3xnd3_1" };
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" };
345
848
  //#endregion
346
849
  //#region src/components/Badge/Badge.tsx
347
- function A(...e) {
850
+ function be(...e) {
348
851
  return e.filter(Boolean).join(" ");
349
852
  }
350
- var j = e(function({ text: e, color: t, className: n, style: i, ...a }, o) {
351
- let s = t ? {
352
- ...i,
853
+ var xe = n(function({ text: e, color: t, className: n, style: r, ...i }, a) {
854
+ let o = t ? {
855
+ ...r,
353
856
  "--badge-color": t,
354
857
  "--badge-background": `color-mix(in srgb, ${t} 14%, transparent)`
355
- } : i;
356
- return /* @__PURE__ */ r("span", {
357
- ref: o,
358
- className: A(k.badge, n),
359
- style: s,
360
- ...a,
858
+ } : r;
859
+ return /* @__PURE__ */ u("span", {
860
+ ref: a,
861
+ className: be(ye.badge, n),
862
+ style: o,
863
+ ...i,
361
864
  children: e
362
865
  });
363
866
  });
364
- j.displayName = "Badge";
867
+ xe.displayName = "Badge";
868
+ var Z = {
869
+ switch: "_switch_1u3md_1",
870
+ input: "_input_1u3md_14",
871
+ track: "_track_1u3md_24",
872
+ thumb: "_thumb_1u3md_31",
873
+ sizeSm: "_sizeSm_1u3md_57",
874
+ sizeMd: "_sizeMd_1u3md_64",
875
+ sizeLg: "_sizeLg_1u3md_71",
876
+ disabled: "_disabled_1u3md_78"
877
+ };
878
+ //#endregion
879
+ //#region src/components/Switch/Switch.tsx
880
+ function Se(...e) {
881
+ return e.filter(Boolean).join(" ");
882
+ }
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) {
884
+ function p(e) {
885
+ a?.(e), o?.(e.target.checked);
886
+ }
887
+ let m = n ? {
888
+ ...c,
889
+ "--switch-color": n
890
+ } : c;
891
+ return /* @__PURE__ */ d("label", {
892
+ className: Se(Z.switch, Z[`size${r[0].toUpperCase()}${r.slice(1)}`], i && Z.disabled, t),
893
+ style: m,
894
+ children: [
895
+ /* @__PURE__ */ u("input", {
896
+ ref: f,
897
+ type: "checkbox",
898
+ className: Z.input,
899
+ disabled: i,
900
+ "aria-label": s,
901
+ onChange: p,
902
+ ...l
903
+ }),
904
+ /* @__PURE__ */ u("span", {
905
+ className: Z.track,
906
+ "aria-hidden": "true",
907
+ children: /* @__PURE__ */ u("span", { className: Z.thumb })
908
+ }),
909
+ e ? /* @__PURE__ */ u("span", {
910
+ className: Z.label,
911
+ children: e
912
+ }) : null
913
+ ]
914
+ });
915
+ });
916
+ Ce.displayName = "Switch";
917
+ var Q = {
918
+ wrapper: "_wrapper_1ly5u_1",
919
+ table: "_table_1ly5u_11",
920
+ caption: "_caption_1ly5u_19",
921
+ head: "_head_1ly5u_31",
922
+ headerCell: "_headerCell_1ly5u_35",
923
+ cell: "_cell_1ly5u_47",
924
+ body: "_body_1ly5u_56",
925
+ row: "_row_1ly5u_56",
926
+ interactiveRow: "_interactiveRow_1ly5u_65",
927
+ alignLeft: "_alignLeft_1ly5u_78",
928
+ alignCenter: "_alignCenter_1ly5u_82",
929
+ alignRight: "_alignRight_1ly5u_86",
930
+ numeric: "_numeric_1ly5u_90",
931
+ sortButton: "_sortButton_1ly5u_96",
932
+ sortIcon: "_sortIcon_1ly5u_119",
933
+ statusCell: "_statusCell_1ly5u_128",
934
+ hideOnMobile: "_hideOnMobile_1ly5u_137"
935
+ };
936
+ //#endregion
937
+ //#region src/components/DataTable/DataTable.tsx
938
+ function $(...e) {
939
+ return e.filter(Boolean).join(" ");
940
+ }
941
+ function we(e, t) {
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", {
943
+ numeric: !0,
944
+ sensitivity: "base"
945
+ });
946
+ }
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(() => {
949
+ if (!g?.column.sortValue) return t;
950
+ let { column: e, direction: n } = g, r = n === "ascending" ? 1 : -1;
951
+ return [...t].sort((t, n) => we(e.sortValue?.(t), e.sortValue?.(n)) * r);
952
+ }, [t, g]);
953
+ function y(e) {
954
+ !o || !e.sortable || !e.sortValue || _((t) => t?.column.id === e.id ? t.direction === "ascending" ? {
955
+ column: e,
956
+ direction: "descending"
957
+ } : null : {
958
+ column: e,
959
+ direction: "ascending"
960
+ });
961
+ }
962
+ function b(e) {
963
+ return g?.column.id === e.id ? g.direction : "none";
964
+ }
965
+ function x(e) {
966
+ return g?.column.id === e.id ? g.direction === "ascending" ? /* @__PURE__ */ u(F, {
967
+ size: 15,
968
+ "aria-hidden": "true"
969
+ }) : /* @__PURE__ */ u(M, {
970
+ size: 15,
971
+ "aria-hidden": "true"
972
+ }) : /* @__PURE__ */ u(I, {
973
+ size: 15,
974
+ "aria-hidden": "true"
975
+ });
976
+ }
977
+ return /* @__PURE__ */ u("div", {
978
+ className: $(Q.wrapper, m),
979
+ children: /* @__PURE__ */ d("table", {
980
+ className: $(Q.table, p),
981
+ ...h,
982
+ children: [
983
+ r ? /* @__PURE__ */ u("caption", {
984
+ className: Q.caption,
985
+ children: r
986
+ }) : null,
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", {
989
+ className: Q.head,
990
+ children: /* @__PURE__ */ u("tr", { children: e.map((e) => {
991
+ let t = o && e.sortable && !!e.sortValue;
992
+ return /* @__PURE__ */ u("th", {
993
+ scope: "col",
994
+ "aria-sort": t ? b(e) : void 0,
995
+ className: $(Q.headerCell, Q[`align${Ee(e.align ?? "left")}`], e.hideOnMobile && Q.hideOnMobile),
996
+ children: t ? /* @__PURE__ */ d("button", {
997
+ type: "button",
998
+ className: Q.sortButton,
999
+ onClick: () => y(e),
1000
+ children: [/* @__PURE__ */ u("span", { children: e.header }), /* @__PURE__ */ u("span", {
1001
+ className: Q.sortIcon,
1002
+ children: x(e)
1003
+ })]
1004
+ }) : e.header
1005
+ }, e.id);
1006
+ }) })
1007
+ }),
1008
+ /* @__PURE__ */ d("tbody", {
1009
+ className: Q.body,
1010
+ children: [
1011
+ a ? /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
1012
+ className: Q.statusCell,
1013
+ colSpan: e.length,
1014
+ children: "Caricamento dati…"
1015
+ }) }) : null,
1016
+ !a && v.length === 0 ? /* @__PURE__ */ u("tr", { children: /* @__PURE__ */ u("td", {
1017
+ className: Q.statusCell,
1018
+ colSpan: e.length,
1019
+ children: i
1020
+ }) }) : null,
1021
+ a ? null : v.map((t, r) => {
1022
+ let i = n(t, r), a = c, o = !!a, s = () => {
1023
+ a?.(t, r);
1024
+ };
1025
+ return /* @__PURE__ */ u("tr", {
1026
+ className: $(Q.row, o && Q.interactiveRow),
1027
+ tabIndex: o ? 0 : void 0,
1028
+ "aria-label": o ? f?.(t, r) : void 0,
1029
+ onClick: o ? s : void 0,
1030
+ onKeyDown: o ? (e) => {
1031
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), s());
1032
+ } : void 0,
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),
1035
+ children: e.cell(t, r)
1036
+ }, e.id))
1037
+ }, i);
1038
+ })
1039
+ ]
1040
+ })
1041
+ ]
1042
+ })
1043
+ });
1044
+ }
1045
+ function Ee(e) {
1046
+ return `${e.charAt(0).toUpperCase()}${e.slice(1)}`;
1047
+ }
365
1048
  //#endregion
366
- export { j as Badge, l as Button, m as Card, T as Dropdown, y as IconButton, O as MultiSelect, S as TextField };
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 };