@krosoft/react 0.0.123 → 0.0.125

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.
Files changed (62) hide show
  1. package/dist/{AppActions-po4LjUcM.js → AppActions-BbAnhStS.js} +22 -18
  2. package/dist/{AppSubTitle-CWrsJYFJ.js → AppSubTitle-lg3d5NWc.js} +1 -1
  3. package/dist/{AppTitle-CDxWr_0y.js → AppTitle-uboDuil4.js} +1 -1
  4. package/dist/{AppVerticalTabs-CdqoObXx.js → AppVerticalTabs-CBijkDF_.js} +33 -49
  5. package/dist/ConfirmationDialog-Co5yl0yA.js +184 -0
  6. package/dist/{DataTable-CrJoeR_0.js → DataTable-DSIgTHZS.js} +174 -218
  7. package/dist/ErrorAlert-DH1onuyt.js +17 -0
  8. package/dist/GenericForm-QoeireeW.js +339 -0
  9. package/dist/ImageInput-DLTYJMwr.js +65 -0
  10. package/dist/KpiCardsLayout-C3LmSeL1.js +22 -0
  11. package/dist/{LoadingState-PhGi7HXH.js → LoadingState-BN0YaPSs.js} +3 -3
  12. package/dist/{MetricCard-C-ewNR_i.js → MetricCard-CPw-fiNS.js} +6 -6
  13. package/dist/{MultiSelect-BoisW4Kn.js → MultiSelect-CX051kfk.js} +32 -27
  14. package/dist/SearchInput-D6LmcOjp.js +249 -0
  15. package/dist/SkeletonCards-BIEnyOuZ.js +62 -0
  16. package/dist/{TableFilter-CLjQU36k.js → TableFilter-Wh_Womy4.js} +114 -123
  17. package/dist/{ThemeSelector--w3R6Ff3.js → ThemeSelector-Qv8QBlYq.js} +2 -2
  18. package/dist/{Topbar-DFu_OdSs.js → Topbar-DVww-tU8.js} +49 -59
  19. package/dist/{alert-B34E_4uH.js → alert-B78CiTYe.js} +2 -2
  20. package/dist/components/core/cards/index.js +2 -2
  21. package/dist/components/core/dialogs/index.js +2 -2
  22. package/dist/components/core/filters/index.js +1 -1
  23. package/dist/components/core/forms/index.js +1 -1
  24. package/dist/components/core/index.js +19 -19
  25. package/dist/components/core/inputs/index.js +3 -3
  26. package/dist/components/core/layouts/index.js +4 -4
  27. package/dist/components/core/navbar/index.js +1 -1
  28. package/dist/components/core/states/index.js +2 -2
  29. package/dist/components/core/table/index.js +1 -1
  30. package/dist/components/core/tabs/index.js +1 -1
  31. package/dist/components/core/theme/index.js +1 -1
  32. package/dist/components/index.js +270 -270
  33. package/dist/components/ui/index.js +213 -213
  34. package/dist/helpers/index.js +1 -1
  35. package/dist/hooks/behavior/index.js +1 -1
  36. package/dist/hooks/index.js +1 -1
  37. package/dist/select-MWzbMBAS.js +106 -0
  38. package/dist/tailwind.helper-B6yFEsav.js +8 -0
  39. package/dist/toaster-DTC8Duvh.js +75 -0
  40. package/dist/toggle-group-CSdAiS44.js +1694 -0
  41. package/dist/tooltip-BWyFpIxo.js +56 -0
  42. package/dist/useConfirmDeleteDialog-CiBQmRxg.js +65 -0
  43. package/package.json +3 -3
  44. package/dist/ConfirmationDialog-CkMyyh_3.js +0 -221
  45. package/dist/ErrorAlert-C6BbHHRZ.js +0 -33
  46. package/dist/GenericForm-CmwqEXiQ.js +0 -11410
  47. package/dist/ImageInput-C8HcxE8t.js +0 -82
  48. package/dist/KpiCardsLayout-CETMpB7A.js +0 -15
  49. package/dist/SearchInput-DJ_F3emq.js +0 -586
  50. package/dist/SkeletonCards-C5lXTSrB.js +0 -57
  51. package/dist/badge-CfWlt79h.js +0 -26
  52. package/dist/createLucideIcon-MP_wDWjs.js +0 -116
  53. package/dist/ellipsis-vertical-kB5yFb-i.js +0 -15
  54. package/dist/grip-vertical-DGywJXzS.js +0 -18
  55. package/dist/index-Be16PP7H.js +0 -34
  56. package/dist/loader-circle-CKy7u7JW.js +0 -11
  57. package/dist/select-DlQvLtI3.js +0 -1763
  58. package/dist/tailwind.helper-gWiv5-6R.js +0 -2278
  59. package/dist/toaster-CKoOjjKr.js +0 -134
  60. package/dist/toggle-group-wIgXZYDq.js +0 -29086
  61. package/dist/tooltip-YhBPXbcJ.js +0 -2477
  62. package/dist/useConfirmDeleteDialog-BOb3XFpz.js +0 -75
@@ -0,0 +1,17 @@
1
+ import { jsxs as r, jsx as s } from "react/jsx-runtime";
2
+ import { A as n, a as t } from "./alert-B78CiTYe.js";
3
+ import { AlertTriangle as a } from "lucide-react";
4
+ const o = ({ error: e }) => e ? /* @__PURE__ */ r(n, { variant: "destructive", children: [
5
+ /* @__PURE__ */ s(a, { className: "size-4" }),
6
+ /* @__PURE__ */ r(t, { children: [
7
+ /* @__PURE__ */ r("div", { className: "flex items-center space-x-2", children: [
8
+ /* @__PURE__ */ s("span", { className: "font-semibold", children: "Erreur :" }),
9
+ /* @__PURE__ */ s("span", { children: e.code }),
10
+ /* @__PURE__ */ s("span", { children: e.message })
11
+ ] }),
12
+ e.errors && e.errors.length > 0 && /* @__PURE__ */ s("ul", { className: "mt-2 list-disc list-inside", children: e.errors.map((i, l) => /* @__PURE__ */ s("li", { children: i }, l)) })
13
+ ] })
14
+ ] }) : null;
15
+ export {
16
+ o as E
17
+ };
@@ -0,0 +1,339 @@
1
+ import { jsx as r, jsxs as o } from "react/jsx-runtime";
2
+ import { I as J } from "./ImageInput-DLTYJMwr.js";
3
+ import { A as V } from "./AppSubTitle-lg3d5NWc.js";
4
+ import { M as Q } from "./MultiSelect-CX051kfk.js";
5
+ import { aN as W, aQ as X, aR as $, aS as q, aO as A, aT as D, J as L, N as Y, K as F, aX as k, c0 as ee, $ as te } from "./toggle-group-CSdAiS44.js";
6
+ import "./alert-B78CiTYe.js";
7
+ import "@radix-ui/react-aspect-ratio";
8
+ import { B as M } from "./tooltip-BWyFpIxo.js";
9
+ import "@radix-ui/react-collapsible";
10
+ import "lucide-react";
11
+ import "react-resizable-panels";
12
+ import { c as i } from "./tailwind.helper-B6yFEsav.js";
13
+ import { S as ae, h as re, i as se, a as ne, c as le } from "./select-MWzbMBAS.js";
14
+ import "next-themes";
15
+ import "sonner";
16
+ import { u as ce } from "./useToast-BFTk4lWz.js";
17
+ import { zodResolver as oe } from "@hookform/resolvers/zod";
18
+ import { useState as N } from "react";
19
+ import { useForm as ue } from "react-hook-form";
20
+ import { useTranslation as ie } from "react-i18next";
21
+ import { z as b } from "zod";
22
+ const je = ({
23
+ schema: h,
24
+ isLoading: S,
25
+ error: C,
26
+ onSubmit: P,
27
+ onCancel: x,
28
+ initialData: y,
29
+ disabled: f = !1,
30
+ renderActions: j = !0,
31
+ onRegisterSubmit: K,
32
+ defaultCols: z = 4
33
+ }) => {
34
+ const { t: u } = ie(), { toast: E } = ce(), [g, w] = N(!1), [de, I] = N({});
35
+ if (!h) return null;
36
+ const O = (e) => {
37
+ switch (e) {
38
+ case 1:
39
+ return "md:col-span-1 col-span-4";
40
+ case 2:
41
+ return "md:col-span-2 col-span-4";
42
+ case 3:
43
+ return "md:col-span-3 col-span-4";
44
+ case 4:
45
+ default:
46
+ return "md:col-span-4 col-span-4";
47
+ }
48
+ }, R = (() => {
49
+ const e = {};
50
+ return h.sections.forEach((t) => {
51
+ t.fields.forEach((a) => {
52
+ if (a.rules)
53
+ e[a.key] = a.rules(b);
54
+ else
55
+ switch (a.type) {
56
+ case "checkbox":
57
+ e[a.key] = b.boolean().nullable().optional();
58
+ break;
59
+ case "html":
60
+ break;
61
+ case "text":
62
+ case "textarea":
63
+ case "number":
64
+ case "date":
65
+ case "time":
66
+ case "select":
67
+ case "multiSelect":
68
+ case "color":
69
+ case "image":
70
+ e[a.key] = b.string().nullable().optional();
71
+ break;
72
+ }
73
+ });
74
+ }), b.object(e);
75
+ })(), m = ue({
76
+ resolver: oe(R),
77
+ defaultValues: y || Object.fromEntries(h.sections.flatMap((e) => e.fields.map((t) => [t.key, t.defaultValue ?? null])))
78
+ });
79
+ N(() => {
80
+ K && K(() => void m.handleSubmit(T)());
81
+ }), N(() => {
82
+ if (y) {
83
+ const e = {};
84
+ h.sections.forEach((t) => {
85
+ t.fields.forEach((a) => {
86
+ a.type === "image" && y[a.key] && (e[a.key] = y[a.key]);
87
+ });
88
+ }), I(e);
89
+ }
90
+ });
91
+ const T = async (e) => {
92
+ if (g) return;
93
+ if (Object.keys(m.formState.errors).length > 0) {
94
+ E({
95
+ title: "Erreur de validation",
96
+ description: "Veuillez vérifier les champs du formulaire",
97
+ variant: "destructive"
98
+ });
99
+ return;
100
+ }
101
+ w(!0);
102
+ try {
103
+ await Promise.resolve(P(e));
104
+ } catch (a) {
105
+ console.error("Error during form submission:", a), E({
106
+ title: "Erreur",
107
+ description: "Une erreur est survenue lors de l'enregistrement",
108
+ variant: "destructive"
109
+ });
110
+ } finally {
111
+ w(!1);
112
+ }
113
+ }, B = (e, t) => {
114
+ t && I((a) => ({ ...a, [e]: t }));
115
+ }, Z = (e) => {
116
+ if (!e) return !1;
117
+ const t = (a) => {
118
+ if (!a || !a._def) return !1;
119
+ const s = a._def;
120
+ return s.typeName === "ZodNullable" ? !0 : s.innerType ? t(s.innerType) : s.type ? t(s.type) : !1;
121
+ };
122
+ try {
123
+ const a = e(b);
124
+ return t(a);
125
+ } catch {
126
+ return !1;
127
+ }
128
+ }, _ = (e) => {
129
+ var s;
130
+ if (!e) return !1;
131
+ const t = e(b);
132
+ return t.safeParse(void 0).success ? !1 : ((s = t._def.checks) == null ? void 0 : s.some((n) => n.kind === "min")) ?? !1;
133
+ }, G = (e, t) => {
134
+ const a = !!m.formState.errors[e.key], s = f;
135
+ switch (e.type) {
136
+ case "text":
137
+ case "color":
138
+ return /* @__PURE__ */ r(
139
+ k,
140
+ {
141
+ type: e.type,
142
+ ...t,
143
+ placeholder: e.placeholderKey ? u(e.placeholderKey) : "",
144
+ className: i(a && "border-destructive"),
145
+ disabled: s,
146
+ value: t.value ?? ""
147
+ }
148
+ );
149
+ case "image": {
150
+ const n = e, c = n.value !== void 0 ? n.value : t.value;
151
+ return /* @__PURE__ */ r(
152
+ J,
153
+ {
154
+ value: c ?? "",
155
+ onChange: (l) => {
156
+ if (n.onChange && n.onChange(l), t.onChange(l), l) {
157
+ const p = new FileReader();
158
+ p.onloadend = () => {
159
+ B(e.key, p.result);
160
+ }, p.readAsDataURL(l);
161
+ }
162
+ },
163
+ accept: n.accept,
164
+ maxSizeMB: n.maxSizeMB,
165
+ hint: n.hint,
166
+ disabled: s,
167
+ className: i(a && "border-destructive")
168
+ }
169
+ );
170
+ }
171
+ case "date":
172
+ return /* @__PURE__ */ r(
173
+ k,
174
+ {
175
+ type: "date",
176
+ ...t,
177
+ className: i(a && "border-destructive"),
178
+ disabled: s,
179
+ value: t.value ?? ""
180
+ }
181
+ );
182
+ case "time":
183
+ return /* @__PURE__ */ r(
184
+ k,
185
+ {
186
+ type: "time",
187
+ ...t,
188
+ className: i(a && "border-destructive"),
189
+ disabled: s,
190
+ value: t.value ?? ""
191
+ }
192
+ );
193
+ case "checkbox":
194
+ return /* @__PURE__ */ o("div", { className: "flex items-center space-x-2", children: [
195
+ /* @__PURE__ */ r(
196
+ te,
197
+ {
198
+ id: e.key,
199
+ checked: t.value === !0,
200
+ onCheckedChange: (n) => {
201
+ t.onChange(n);
202
+ },
203
+ disabled: s,
204
+ className: i(a && "border-destructive")
205
+ }
206
+ ),
207
+ /* @__PURE__ */ r("label", { htmlFor: e.key, className: "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70", children: u(e.labelKey) })
208
+ ] }, e.key);
209
+ case "textarea":
210
+ return /* @__PURE__ */ r(
211
+ ee,
212
+ {
213
+ ...t,
214
+ placeholder: e.placeholderKey ? u(e.placeholderKey) : "",
215
+ className: i(a && "border-destructive", "min-h-[100px]"),
216
+ disabled: s,
217
+ value: t.value ?? ""
218
+ }
219
+ );
220
+ case "number": {
221
+ const n = e;
222
+ return /* @__PURE__ */ r(
223
+ k,
224
+ {
225
+ type: "number",
226
+ ...t,
227
+ step: n.step,
228
+ min: n.min,
229
+ placeholder: e.placeholderKey ? u(e.placeholderKey) : "",
230
+ className: i(a && "border-destructive"),
231
+ disabled: s,
232
+ value: t.value ?? "",
233
+ onChange: (c) => {
234
+ const l = c.target.value === "" ? "" : Number(c.target.value);
235
+ t.onChange(l);
236
+ }
237
+ }
238
+ );
239
+ }
240
+ case "select": {
241
+ const n = e, c = Z(e.rules), l = t.value === null || t.value === void 0 ? "" : t.value, p = n.options, v = p.find((d) => d.value === l);
242
+ return /* @__PURE__ */ o(ae, { value: l, onValueChange: t.onChange, disabled: s, children: [
243
+ /* @__PURE__ */ r(A, { children: /* @__PURE__ */ r(
244
+ re,
245
+ {
246
+ className: i(a && "border-destructive"),
247
+ onClear: c && l ? (d) => {
248
+ d.preventDefault(), d.stopPropagation(), t.onChange(null);
249
+ } : void 0,
250
+ children: /* @__PURE__ */ r(se, { placeholder: e.placeholderKey ? u(e.placeholderKey) : "", children: v ? /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
251
+ v.color && /* @__PURE__ */ r("div", { className: "w-4 h-4 rounded-full", style: { backgroundColor: v.color } }),
252
+ v.label
253
+ ] }) : void 0 })
254
+ }
255
+ ) }),
256
+ /* @__PURE__ */ r(ne, { children: p.map((d, H) => /* @__PURE__ */ r(le, { value: d.value, children: /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
257
+ d.color && /* @__PURE__ */ r("div", { className: "w-4 h-4 rounded-full", style: { backgroundColor: d.color } }),
258
+ d.label
259
+ ] }) }, H)) })
260
+ ] });
261
+ }
262
+ case "multiSelect": {
263
+ const n = e, c = t.value ?? [];
264
+ return /* @__PURE__ */ r(
265
+ Q,
266
+ {
267
+ options: n.options,
268
+ selected: c,
269
+ onToggle: (l) => {
270
+ const p = c.includes(l) ? c.filter((v) => v !== l) : [...c, l];
271
+ t.onChange(p);
272
+ },
273
+ onClear: () => {
274
+ t.onChange([]);
275
+ },
276
+ onSelectAll: (l) => {
277
+ t.onChange(l);
278
+ },
279
+ placeholder: e.placeholderKey ? u(e.placeholderKey) : "",
280
+ disabled: s
281
+ }
282
+ );
283
+ }
284
+ case "html":
285
+ return e.render(m.getValues(), e);
286
+ default:
287
+ return null;
288
+ }
289
+ }, U = (e, t) => {
290
+ const a = /* @__PURE__ */ r("div", { className: i("grid grid-cols-4 gap-4"), children: e.fields.map((s) => /* @__PURE__ */ r(
291
+ X,
292
+ {
293
+ control: m.control,
294
+ name: s.key,
295
+ render: ({ field: n }) => {
296
+ var c;
297
+ return /* @__PURE__ */ o($, { className: i(O(((c = s.layout) == null ? void 0 : c.cols) ?? z)), children: [
298
+ s.type !== "checkbox" && s.type !== "html" && /* @__PURE__ */ o(q, { children: [
299
+ u(s.labelKey),
300
+ _(s.rules) && /* @__PURE__ */ r("span", { className: "text-destructive ml-1", children: "*" })
301
+ ] }),
302
+ /* @__PURE__ */ r(A, { children: G(s, n) }),
303
+ /* @__PURE__ */ r(D, {})
304
+ ] });
305
+ }
306
+ },
307
+ s.key
308
+ )) });
309
+ return h.useCards === !1 ? /* @__PURE__ */ o("div", { className: "space-y-4 mb-6", children: [
310
+ e.titleKey && /* @__PURE__ */ r(V, { titleKey: e.titleKey }),
311
+ a
312
+ ] }, t) : /* @__PURE__ */ o(L, { className: "mb-6", children: [
313
+ e.titleKey && /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(V, { titleKey: e.titleKey }) }),
314
+ /* @__PURE__ */ r(F, { children: a })
315
+ ] }, t);
316
+ };
317
+ return /* @__PURE__ */ r(W, { ...m, children: /* @__PURE__ */ o(
318
+ "form",
319
+ {
320
+ onSubmit: (e) => {
321
+ m.handleSubmit(T)(e);
322
+ },
323
+ className: "space-y-4 px-0 w-full",
324
+ children: [
325
+ /* @__PURE__ */ o("div", { className: "space-y-4", children: [
326
+ h.sections.map((e, t) => U(e, t)),
327
+ C && /* @__PURE__ */ r("div", { className: "text-sm font-medium text-destructive", children: C.message })
328
+ ] }),
329
+ !f && j && /* @__PURE__ */ o("div", { className: "flex justify-end gap-3 mt-6 border-t pt-4", children: [
330
+ x && /* @__PURE__ */ r(M, { type: "button", variant: "outline", onClick: x, disabled: g || S, children: u("Annuler", "Annuler") }),
331
+ /* @__PURE__ */ r(M, { variant: "default", type: "submit", disabled: g || (S ?? !1) || m.formState.isSubmitting, children: g || S ? u("Enregistrement...", "Enregistrement...") : u("Enregistrer", "Enregistrer") })
332
+ ] })
333
+ ]
334
+ }
335
+ ) });
336
+ };
337
+ export {
338
+ je as G
339
+ };
@@ -0,0 +1,65 @@
1
+ import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
+ import "./toggle-group-CSdAiS44.js";
3
+ import "./alert-B78CiTYe.js";
4
+ import "@radix-ui/react-aspect-ratio";
5
+ import { B as x } from "./tooltip-BWyFpIxo.js";
6
+ import "@radix-ui/react-collapsible";
7
+ import { XIcon as N, ImageIcon as v, UploadIcon as w } from "lucide-react";
8
+ import "react-resizable-panels";
9
+ import { c as u } from "./tailwind.helper-B6yFEsav.js";
10
+ import "./select-MWzbMBAS.js";
11
+ import "next-themes";
12
+ import "sonner";
13
+ import { forwardRef as I, useRef as y } from "react";
14
+ import { u as j } from "./useNotifications-zbUhCvF_.js";
15
+ const R = I(
16
+ ({ value: i, onChange: l, accept: n = "image/jpeg,image/png,image/webp", maxSizeMB: s = 2, disabled: a = !1, className: p = "", hint: c = "JPG, PNG, WEBP" }, f) => {
17
+ const { showError: d } = j(), r = y(null), h = (g) => {
18
+ var m;
19
+ const t = (m = g.target.files) == null ? void 0 : m[0];
20
+ if (!t) return;
21
+ if (!n.split(",").map((b) => b.trim()).includes(t.type)) {
22
+ d("Erreur", `Seuls les fichiers ${c} sont acceptés`), r.current && (r.current.value = "");
23
+ return;
24
+ }
25
+ if (t.size > s * 1024 * 1024) {
26
+ d("Erreur", `Le fichier ne doit pas dépasser ${s}MB`), r.current && (r.current.value = "");
27
+ return;
28
+ }
29
+ l(t), r.current && (r.current.value = "");
30
+ };
31
+ return /* @__PURE__ */ e("div", { ref: f, className: p, children: i ? /* @__PURE__ */ o("div", { className: "relative w-32 h-32 rounded-lg overflow-hidden border-2 border-border", children: [
32
+ /* @__PURE__ */ e("img", { src: i, alt: "Preview", className: "w-full h-full object-cover" }),
33
+ !a && /* @__PURE__ */ e(x, { type: "button", variant: "destructive", size: "sm", className: "absolute top-1 right-1 h-6 w-6 p-0", onClick: () => {
34
+ l(null);
35
+ }, children: /* @__PURE__ */ e(N, { className: "h-4 w-4" }) })
36
+ ] }) : a ? /* @__PURE__ */ o("div", { className: u("flex flex-col items-center justify-center w-full h-32", "border-2 border-dashed border-border rounded-lg", "bg-muted/30"), children: [
37
+ /* @__PURE__ */ e(v, { className: "h-8 w-8 text-muted-foreground/50 mb-2" }),
38
+ /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground/50", children: "Aucune image" })
39
+ ] }) : /* @__PURE__ */ o(
40
+ "label",
41
+ {
42
+ className: u(
43
+ "flex flex-col items-center justify-center w-full h-32",
44
+ "border-2 border-dashed border-border rounded-lg",
45
+ "cursor-pointer hover:bg-muted/50 transition-colors"
46
+ ),
47
+ children: [
48
+ /* @__PURE__ */ e(w, { className: "h-8 w-8 text-muted-foreground mb-2" }),
49
+ /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Cliquer pour uploader" }),
50
+ /* @__PURE__ */ o("span", { className: "text-xs text-muted-foreground mt-1", children: [
51
+ c,
52
+ " (max ",
53
+ s,
54
+ "MB)"
55
+ ] }),
56
+ /* @__PURE__ */ e("input", { ref: r, type: "file", className: "hidden", accept: n, onChange: h })
57
+ ]
58
+ }
59
+ ) });
60
+ }
61
+ );
62
+ R.displayName = "ImageInput";
63
+ export {
64
+ R as I
65
+ };
@@ -0,0 +1,22 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ import "./toggle-group-CSdAiS44.js";
3
+ import "clsx";
4
+ import "tailwind-merge";
5
+ import "react-i18next";
6
+ import "@krosoft/core/helpers";
7
+ import "./alert-B78CiTYe.js";
8
+ import "@radix-ui/react-aspect-ratio";
9
+ import "./tooltip-BWyFpIxo.js";
10
+ import "@radix-ui/react-collapsible";
11
+ import "lucide-react";
12
+ import "react-resizable-panels";
13
+ import "./select-MWzbMBAS.js";
14
+ import "next-themes";
15
+ import "sonner";
16
+ import "react";
17
+ import { b as i, a as p } from "./SkeletonCards-BIEnyOuZ.js";
18
+ import { E as s } from "./ErrorState-vU8d4CwD.js";
19
+ const L = ({ stats: o, isLoading: m, error: t }) => m ? /* @__PURE__ */ r(i, { count: 4 }) : t ? /* @__PURE__ */ r(s, { message: t.message }) : /* @__PURE__ */ r(p, { stats: o });
20
+ export {
21
+ L as K
22
+ };
@@ -1,9 +1,9 @@
1
1
  import { jsxs as i, jsx as t } from "react/jsx-runtime";
2
- import { L as r } from "./loader-circle-CKy7u7JW.js";
3
- const o = ({ message: e }) => /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center p-12 text-muted-foreground animate-fade-in", children: [
2
+ import { Loader2Icon as r } from "lucide-react";
3
+ const a = ({ message: e }) => /* @__PURE__ */ i("div", { className: "flex flex-col items-center justify-center p-12 text-muted-foreground animate-fade-in", children: [
4
4
  /* @__PURE__ */ t(r, { className: "size-8 animate-spin mb-4 text-primary" }),
5
5
  e !== void 0 && e !== "" ? /* @__PURE__ */ t("p", { className: "font-semibold text-sm", children: e }) : null
6
6
  ] });
7
7
  export {
8
- o as L
8
+ a as L
9
9
  };
@@ -1,8 +1,8 @@
1
1
  import { jsxs as r, jsx as e } from "react/jsx-runtime";
2
- import { I as l, M as h, N as m, J as g } from "./toggle-group-wIgXZYDq.js";
3
- import { c as b } from "./tailwind.helper-gWiv5-6R.js";
2
+ import { J as l, N as h, O as m, K as g } from "./toggle-group-CSdAiS44.js";
3
+ import { c as b } from "./tailwind.helper-B6yFEsav.js";
4
4
  import { useTranslation as p } from "react-i18next";
5
- const M = ({ titleKey: t, icon: s, className: n, children: a }) => {
5
+ const k = ({ titleKey: t, icon: s, className: n, children: a }) => {
6
6
  const { t: i } = p();
7
7
  return /* @__PURE__ */ r(l, { className: b("bg-gray-50 dark:bg-gray-950", n), children: [
8
8
  /* @__PURE__ */ e(h, { children: /* @__PURE__ */ r(m, { className: "flex items-center gap-2", children: [
@@ -26,7 +26,7 @@ const M = ({ titleKey: t, icon: s, className: n, children: a }) => {
26
26
  sm: "size-4",
27
27
  md: "size-5",
28
28
  lg: "size-6"
29
- }, v = (t) => t === "up" ? "↑" : t === "down" ? "↓" : "", C = (t) => t === "up" ? "text-green-600" : t === "down" ? "text-red-600" : "text-muted-foreground", k = ({ title: t, value: s, unit: n, subtitle: a, icon: i, iconSize: x = "md", trend: o, trendValue: d, color: u = "blue", children: c }) => {
29
+ }, v = (t) => t === "up" ? "↑" : t === "down" ? "↓" : "", C = (t) => t === "up" ? "text-green-600" : t === "down" ? "text-red-600" : "text-muted-foreground", D = ({ title: t, value: s, unit: n, subtitle: a, icon: i, iconSize: x = "md", trend: o, trendValue: d, color: u = "blue", children: c }) => {
30
30
  const f = i;
31
31
  return /* @__PURE__ */ e(l, { className: "relative overflow-hidden bg-card border shadow-lg hover:shadow-xl transition-all duration-300", children: /* @__PURE__ */ r(g, { className: "pt-6", children: [
32
32
  /* @__PURE__ */ r("div", { className: "flex items-start justify-between", children: [
@@ -48,6 +48,6 @@ const M = ({ titleKey: t, icon: s, className: n, children: a }) => {
48
48
  ] }) });
49
49
  };
50
50
  export {
51
- M as D,
52
- k as M
51
+ k as D,
52
+ D as M
53
53
  };
@@ -1,40 +1,45 @@
1
1
  import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
2
  import { useState as w, useRef as k, useMemo as N, useEffect as y } from "react";
3
- import { ce as R, _ as C } from "./toggle-group-wIgXZYDq.js";
4
- import "./alert-B34E_4uH.js";
5
- import { c as E } from "./tailwind.helper-gWiv5-6R.js";
6
- import { C as T } from "./tooltip-YhBPXbcJ.js";
7
- import { X as D } from "./select-DlQvLtI3.js";
3
+ import { $ as C } from "./toggle-group-CSdAiS44.js";
4
+ import "./alert-B78CiTYe.js";
5
+ import "@radix-ui/react-aspect-ratio";
6
+ import "./tooltip-BWyFpIxo.js";
7
+ import "@radix-ui/react-collapsible";
8
+ import { XIcon as L, ChevronDownIcon as R, SearchIcon as T } from "lucide-react";
9
+ import "react-resizable-panels";
10
+ import { c as E } from "./tailwind.helper-B6yFEsav.js";
11
+ import "./select-MWzbMBAS.js";
8
12
  import "next-themes";
9
- const V = ({
10
- options: i,
13
+ import "sonner";
14
+ const H = ({
15
+ options: s,
11
16
  selected: n,
12
17
  onToggle: h,
13
18
  onClear: d,
14
19
  onSelectAll: u,
15
20
  placeholder: j = "Sélectionner...",
16
- searchable: f = !1,
21
+ searchable: m = !1,
17
22
  searchPlaceholder: z = "Rechercher...",
18
- disabled: m = !1
23
+ disabled: f = !1
19
24
  }) => {
20
- const [c, g] = w(""), [a, b] = w(!1), p = k(null), x = k(null), o = N(() => c === "" ? i : i.filter((e) => e.label.toLowerCase().includes(c.toLowerCase())), [i, c]), v = N(() => o.length === 0 ? !1 : o.every((e) => n.includes(e.value)), [o, n]);
25
+ const [c, p] = w(""), [a, b] = w(!1), g = k(null), x = k(null), o = N(() => c === "" ? s : s.filter((e) => e.label.toLowerCase().includes(c.toLowerCase())), [s, c]), v = N(() => o.length === 0 ? !1 : o.every((e) => n.includes(e.value)), [o, n]);
21
26
  y(() => {
22
- a && f && requestAnimationFrame(() => {
27
+ a && m && requestAnimationFrame(() => {
23
28
  var e;
24
29
  (e = x.current) == null || e.focus();
25
30
  });
26
- }, [a, f]), y(() => {
31
+ }, [a, m]), y(() => {
27
32
  if (!a) return;
28
33
  const e = (r) => {
29
- p.current !== null && !p.current.contains(r.target) && (b(!1), g(""));
34
+ g.current !== null && !g.current.contains(r.target) && (b(!1), p(""));
30
35
  };
31
36
  return document.addEventListener("mousedown", e), () => {
32
37
  document.removeEventListener("mousedown", e);
33
38
  };
34
39
  }, [a]);
35
- const L = () => {
40
+ const I = () => {
36
41
  if (v) {
37
- const e = o.map((s) => s.value), r = n.filter((s) => !e.includes(s));
42
+ const e = o.map((i) => i.value), r = n.filter((i) => !e.includes(i));
38
43
  u !== void 0 ? u(r) : d();
39
44
  } else {
40
45
  const e = [...n];
@@ -45,14 +50,14 @@ const V = ({
45
50
  });
46
51
  }
47
52
  };
48
- return /* @__PURE__ */ l("div", { ref: p, className: "relative w-full", children: [
53
+ return /* @__PURE__ */ l("div", { ref: g, className: "relative w-full", children: [
49
54
  /* @__PURE__ */ l(
50
55
  "button",
51
56
  {
52
57
  type: "button",
53
- disabled: m,
58
+ disabled: f,
54
59
  onClick: () => {
55
- m || b((e) => (e && g(""), !e));
60
+ f || b((e) => (e && p(""), !e));
56
61
  },
57
62
  className: E(
58
63
  "flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",
@@ -62,10 +67,10 @@ const V = ({
62
67
  children: [
63
68
  /* @__PURE__ */ t("span", { className: "truncate", children: n.length === 0 ? j : n.map((e) => {
64
69
  var r;
65
- return ((r = i.find((s) => s.value === e)) == null ? void 0 : r.label) ?? e;
70
+ return ((r = s.find((i) => i.value === e)) == null ? void 0 : r.label) ?? e;
66
71
  }).join(", ") }),
67
72
  /* @__PURE__ */ l("div", { className: "flex shrink-0 items-center gap-1", children: [
68
- n.length > 0 && !m && /* @__PURE__ */ t(
73
+ n.length > 0 && !f && /* @__PURE__ */ t(
69
74
  "span",
70
75
  {
71
76
  role: "button",
@@ -77,17 +82,17 @@ const V = ({
77
82
  e.preventDefault(), e.stopPropagation(), d();
78
83
  },
79
84
  className: "text-muted-foreground hover:text-foreground",
80
- children: /* @__PURE__ */ t(D, { className: "size-4" })
85
+ children: /* @__PURE__ */ t(L, { className: "size-4" })
81
86
  }
82
87
  ),
83
- /* @__PURE__ */ t(T, { className: E("size-4 opacity-50 shrink-0 transition-transform", a && "rotate-180") })
88
+ /* @__PURE__ */ t(R, { className: E("size-4 opacity-50 shrink-0 transition-transform", a && "rotate-180") })
84
89
  ] })
85
90
  ]
86
91
  }
87
92
  ),
88
93
  a ? /* @__PURE__ */ l("div", { className: "absolute left-0 right-0 top-[calc(100%+4px)] z-[100] rounded-md border bg-popover text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 slide-in-from-top-2", children: [
89
- f ? /* @__PURE__ */ t("div", { className: "border-b border-border p-2", children: /* @__PURE__ */ l("div", { className: "relative", children: [
90
- /* @__PURE__ */ t(R, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
94
+ m ? /* @__PURE__ */ t("div", { className: "border-b border-border p-2", children: /* @__PURE__ */ l("div", { className: "relative", children: [
95
+ /* @__PURE__ */ t(T, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
91
96
  /* @__PURE__ */ t(
92
97
  "input",
93
98
  {
@@ -96,14 +101,14 @@ const V = ({
96
101
  placeholder: z,
97
102
  value: c,
98
103
  onChange: (e) => {
99
- g(e.target.value);
104
+ p(e.target.value);
100
105
  }
101
106
  }
102
107
  )
103
108
  ] }) }) : null,
104
109
  /* @__PURE__ */ l("div", { className: "flex flex-col gap-0.5 max-h-56 overflow-y-auto p-1.5 scrollbar-thin scrollbar-thumb-rounded scrollbar-thumb-muted-foreground/20 scrollbar-track-transparent [&::-webkit-scrollbar]:w-1.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-muted-foreground/20 [&::-webkit-scrollbar-track]:bg-transparent", children: [
105
110
  o.length > 0 && /* @__PURE__ */ l("label", { className: "flex items-center gap-2.5 rounded-md px-2 py-2 text-sm hover:bg-muted cursor-pointer transition-colors", children: [
106
- /* @__PURE__ */ t(C, { checked: v, onCheckedChange: L }),
111
+ /* @__PURE__ */ t(C, { checked: v, onCheckedChange: I }),
107
112
  "Tout sélectionner"
108
113
  ] }),
109
114
  o.length === 0 && /* @__PURE__ */ t("p", { className: "px-2 py-3 text-center text-xs text-muted-foreground", children: "Aucun résultat" }),
@@ -133,5 +138,5 @@ const V = ({
133
138
  ] });
134
139
  };
135
140
  export {
136
- V as M
141
+ H as M
137
142
  };