@krosoft/react 0.0.134 → 0.0.136
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/{AppActions-CX-qVy8i.js → AppActions-DCaejx-3.js} +4 -3
- package/dist/{AppSubTitle-BxWwOgry.js → AppSubTitle-BNd5_q0i.js} +1 -1
- package/dist/{AppVerticalTabs-DiRvuLpb.js → AppVerticalTabs-NZ02HPGP.js} +11 -11
- package/dist/{ConfirmationDialog-DbMHt9aI.js → ConfirmationDialog-DJcxTNTk.js} +7 -6
- package/dist/{DataTable-DSIgTHZS.js → DataTable-BVgo8YWR.js} +4 -3
- package/dist/{GenericForm-CEnca4jf.js → GenericForm-Cy5ntJxi.js} +20 -19
- package/dist/{ImageInput-DLTYJMwr.js → ImageInput-CJ419eqw.js} +7 -6
- package/dist/{KpiCardsLayout-C3LmSeL1.js → KpiCardsLayout-DDR49Qqh.js} +5 -4
- package/dist/{MetricCard-CPw-fiNS.js → MetricCard-D-qPl6zh.js} +1 -1
- package/dist/{MultiSelect-CX051kfk.js → MultiSelect-DblSHEsg.js} +4 -3
- package/dist/{SearchInput-D6LmcOjp.js → SearchInput-T9TeORNA.js} +38 -37
- package/dist/{SkeletonCards-BIEnyOuZ.js → SkeletonCards-BPIVRCOE.js} +14 -13
- package/dist/{TableFilter-Wh_Womy4.js → TableFilter-rjiss-d9.js} +46 -45
- package/dist/Topbar-BTrdr7wj.js +199 -0
- package/dist/components/core/cards/index.js +2 -2
- package/dist/components/core/dialogs/index.js +2 -2
- package/dist/components/core/filters/index.js +1 -1
- package/dist/components/core/forms/index.js +1 -1
- package/dist/components/core/index.js +15 -15
- package/dist/components/core/inputs/index.js +3 -3
- package/dist/components/core/layouts/index.js +3 -3
- package/dist/components/core/navbar/Sidebar.d.ts +4 -5
- package/dist/components/core/navbar/Sidebar.d.ts.map +1 -1
- package/dist/components/core/navbar/index.js +1 -1
- package/dist/components/core/table/index.js +1 -1
- package/dist/components/core/tabs/index.js +1 -1
- package/dist/components/index.js +205 -203
- package/dist/components/ui/index.d.ts +1 -1
- package/dist/components/ui/index.d.ts.map +1 -1
- package/dist/components/ui/index.js +143 -141
- package/dist/contexts/index.d.ts +5 -0
- package/dist/contexts/index.d.ts.map +1 -0
- package/dist/contexts/index.js +5 -0
- package/dist/contexts/page.context.d.ts +9 -0
- package/dist/contexts/page.context.d.ts.map +1 -0
- package/dist/contexts/sidebar.context.d.ts +8 -0
- package/dist/contexts/sidebar.context.d.ts.map +1 -0
- package/dist/hooks/behavior/index.d.ts +2 -0
- package/dist/hooks/behavior/index.d.ts.map +1 -1
- package/dist/hooks/behavior/index.js +7 -4
- package/dist/hooks/behavior/usePage.d.ts +3 -0
- package/dist/hooks/behavior/usePage.d.ts.map +1 -0
- package/dist/hooks/behavior/useSidebar.d.ts +3 -0
- package/dist/hooks/behavior/useSidebar.d.ts.map +1 -0
- package/dist/hooks/index.js +19 -16
- package/dist/providers/SidebarProvider.d.ts +8 -0
- package/dist/providers/SidebarProvider.d.ts.map +1 -0
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/index.d.ts.map +1 -0
- package/dist/providers/index.js +49 -0
- package/dist/sheet-Gop1cIaU.js +84 -0
- package/dist/sidebar.context-D5nywlmP.js +6 -0
- package/dist/skeleton-8o8eJd3P.js +8 -0
- package/dist/{toaster-DTC8Duvh.js → toaster-Du2OlHAd.js} +19 -24
- package/dist/{toggle-group-CSdAiS44.js → toggle-group-BASGy2mQ.js} +610 -686
- package/dist/{useConfirmDeleteDialog-CiBQmRxg.js → usePage-CWu-cjzK.js} +32 -25
- package/dist/useSidebar-BJuALHqQ.js +11 -0
- package/package.json +2 -2
- package/dist/Topbar-DVww-tU8.js +0 -158
- package/dist/components/ui/sidebar.d.ts +0 -67
- package/dist/components/ui/sidebar.d.ts.map +0 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsxs as n, jsx as l } from "react/jsx-runtime";
|
|
2
|
-
import { ay as u, aM as t, aA as c, aH as g, aC as d } from "./toggle-group-
|
|
2
|
+
import { ay as u, aM as t, aA as c, aH as g, aC as d } from "./toggle-group-BASGy2mQ.js";
|
|
3
3
|
import "./alert-B78CiTYe.js";
|
|
4
4
|
import "@radix-ui/react-aspect-ratio";
|
|
5
5
|
import { B as p } from "./tooltip-BWyFpIxo.js";
|
|
6
6
|
import "@radix-ui/react-collapsible";
|
|
7
|
+
import "./sheet-Gop1cIaU.js";
|
|
7
8
|
import { MoreVerticalIcon as C } from "lucide-react";
|
|
8
9
|
import "react-resizable-panels";
|
|
9
10
|
import { c as i } from "./tailwind.helper-B6yFEsav.js";
|
|
@@ -13,7 +14,7 @@ import "sonner";
|
|
|
13
14
|
import "react";
|
|
14
15
|
import { useTranslation as h } from "react-i18next";
|
|
15
16
|
import { u as v } from "./useMobile-DN1_OMDB.js";
|
|
16
|
-
function
|
|
17
|
+
function E({ actions: o, className: b }) {
|
|
17
18
|
const { t: m } = h(), N = v();
|
|
18
19
|
return !o || o.length === 0 ? null : N ? /* @__PURE__ */ n(u, { children: [
|
|
19
20
|
/* @__PURE__ */ l(t, { asChild: !0, children: /* @__PURE__ */ l(p, { variant: "outline", size: "icon", children: /* @__PURE__ */ l(C, { className: "size-4" }) }) }),
|
|
@@ -70,5 +71,5 @@ function q({ actions: o, className: b }) {
|
|
|
70
71
|
) : null) }))(o);
|
|
71
72
|
}
|
|
72
73
|
export {
|
|
73
|
-
|
|
74
|
+
E as A
|
|
74
75
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as l } from "react-i18next";
|
|
3
|
-
import { A as m } from "./AppActions-
|
|
3
|
+
import { A as m } from "./AppActions-DCaejx-3.js";
|
|
4
4
|
function f({ titleKey: s, actions: t, className: o }) {
|
|
5
5
|
const { t: r } = l();
|
|
6
6
|
return /* @__PURE__ */ i("div", { className: "flex flex-col sm:flex-row sm:items-center justify-between gap-4", children: [
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs as n, jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { J as
|
|
3
|
-
import { A as C } from "./AppActions-
|
|
2
|
+
import { J as N, N as g, K as v, bN as y, bP as T, bQ as b, bO as w, bA as S } from "./toggle-group-BASGy2mQ.js";
|
|
3
|
+
import { A as C } from "./AppActions-DCaejx-3.js";
|
|
4
4
|
import { A } from "./AppTitle-uboDuil4.js";
|
|
5
5
|
import { useTranslation as x } from "react-i18next";
|
|
6
6
|
import { useSearchParams as f } from "react-router-dom";
|
|
@@ -13,13 +13,13 @@ function L({ titleKey: s, descriptionKey: l, actions: c = [], className: t }) {
|
|
|
13
13
|
/* @__PURE__ */ a(C, { actions: c, className: t })
|
|
14
14
|
] });
|
|
15
15
|
}
|
|
16
|
-
function
|
|
17
|
-
return /* @__PURE__ */ n(
|
|
18
|
-
/* @__PURE__ */ a(
|
|
19
|
-
/* @__PURE__ */ a(
|
|
16
|
+
function q({ titleKey: s, descriptionKey: l, actions: c = [], className: t, children: o, isSubTitle: i }) {
|
|
17
|
+
return /* @__PURE__ */ n(N, { children: [
|
|
18
|
+
/* @__PURE__ */ a(g, { children: /* @__PURE__ */ a(L, { titleKey: s, descriptionKey: l, actions: c, className: t }) }),
|
|
19
|
+
/* @__PURE__ */ a(v, { className: "space-y-4", children: o })
|
|
20
20
|
] });
|
|
21
21
|
}
|
|
22
|
-
function
|
|
22
|
+
function B({ tabs: s, itemId: l, item: c, fit: t }) {
|
|
23
23
|
var m;
|
|
24
24
|
const { t: o } = x(), [i, d] = f(), u = i.get("tab") || ((m = s[0]) == null ? void 0 : m.value);
|
|
25
25
|
return /* @__PURE__ */ n(y, { value: u, onValueChange: (e) => {
|
|
@@ -38,7 +38,7 @@ function _({ tabs: s, itemId: l, item: c, fit: t }) {
|
|
|
38
38
|
s.map((e) => /* @__PURE__ */ a(w, { value: e.value, className: "mt-4", children: e.component ? e.component(l) : null }, e.value))
|
|
39
39
|
] });
|
|
40
40
|
}
|
|
41
|
-
const
|
|
41
|
+
const E = ({ tabs: s, item: l }) => {
|
|
42
42
|
var m;
|
|
43
43
|
const { t: c } = x(), [t, o] = f(), i = t.get("tab") || ((m = s[0]) == null ? void 0 : m.value), d = (e) => {
|
|
44
44
|
const r = new URLSearchParams();
|
|
@@ -87,8 +87,8 @@ const q = ({ tabs: s, item: l }) => {
|
|
|
87
87
|
] });
|
|
88
88
|
};
|
|
89
89
|
export {
|
|
90
|
-
|
|
90
|
+
q as A,
|
|
91
91
|
L as a,
|
|
92
|
-
|
|
93
|
-
|
|
92
|
+
B as b,
|
|
93
|
+
E as c
|
|
94
94
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as e, jsxs as r, Fragment as M } from "react/jsx-runtime";
|
|
2
|
-
import { D as q, b as B, P as R, e as W, h as X, c as $, m as J, p as Q, s as F, t as U, q as j, r as V, o as Y } from "./toggle-group-
|
|
2
|
+
import { D as q, b as B, P as R, e as W, h as X, c as $, m as J, p as Q, s as F, t as U, q as j, r as V, o as Y } from "./toggle-group-BASGy2mQ.js";
|
|
3
3
|
import { A as Z, a as _ } from "./alert-B78CiTYe.js";
|
|
4
4
|
import "@radix-ui/react-aspect-ratio";
|
|
5
5
|
import { B as v } from "./tooltip-BWyFpIxo.js";
|
|
6
6
|
import "@radix-ui/react-collapsible";
|
|
7
|
+
import "./sheet-Gop1cIaU.js";
|
|
7
8
|
import { AlertCircleIcon as L, X as S, Save as T, Pen as I } from "lucide-react";
|
|
8
9
|
import "react-resizable-panels";
|
|
9
10
|
import "clsx";
|
|
@@ -13,7 +14,7 @@ import "next-themes";
|
|
|
13
14
|
import "sonner";
|
|
14
15
|
import { useState as y, useEffect as ee } from "react";
|
|
15
16
|
import { useTranslation as O } from "react-i18next";
|
|
16
|
-
import { G as le } from "./GenericForm-
|
|
17
|
+
import { G as le } from "./GenericForm-Cy5ntJxi.js";
|
|
17
18
|
import { E as ie } from "./ErrorAlert-DH1onuyt.js";
|
|
18
19
|
function re({ open: t, onOpenChange: c, config: l, isLoading: u, error: s, children: p }) {
|
|
19
20
|
const { t: i } = O(), { title: b, description: m, icon: f, maxWidth: g = "sm:max-w-xl", actions: n } = l;
|
|
@@ -37,7 +38,7 @@ function re({ open: t, onOpenChange: c, config: l, isLoading: u, error: s, child
|
|
|
37
38
|
] }, k)) }) }) : null
|
|
38
39
|
] }) });
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function De({
|
|
41
42
|
open: t,
|
|
42
43
|
onOpenChange: c,
|
|
43
44
|
data: l,
|
|
@@ -144,7 +145,7 @@ function Ce({
|
|
|
144
145
|
}
|
|
145
146
|
);
|
|
146
147
|
}
|
|
147
|
-
function
|
|
148
|
+
function ke({ isLoading: t, error: c, config: l, destructive: u = !1 }) {
|
|
148
149
|
const { t: s } = O();
|
|
149
150
|
if (!l) return null;
|
|
150
151
|
const p = (i) => {
|
|
@@ -179,6 +180,6 @@ function De({ isLoading: t, error: c, config: l, destructive: u = !1 }) {
|
|
|
179
180
|
}
|
|
180
181
|
export {
|
|
181
182
|
re as A,
|
|
182
|
-
|
|
183
|
-
|
|
183
|
+
ke as C,
|
|
184
|
+
De as F
|
|
184
185
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { u as ae } from "./useDataTable-CxcA5S-s.js";
|
|
3
|
-
import { ay as A, aM as P, aA as B, aC as ne, $, az as se } from "./toggle-group-
|
|
3
|
+
import { ay as A, aM as P, aA as B, aC as ne, $, az as se } from "./toggle-group-BASGy2mQ.js";
|
|
4
4
|
import "./alert-B78CiTYe.js";
|
|
5
5
|
import "@radix-ui/react-aspect-ratio";
|
|
6
6
|
import { B as C } from "./tooltip-BWyFpIxo.js";
|
|
7
7
|
import "@radix-ui/react-collapsible";
|
|
8
|
+
import "./sheet-Gop1cIaU.js";
|
|
8
9
|
import { MoreVerticalIcon as ie, Loader2Icon as le, GripVerticalIcon as de, ArrowUpIcon as oe, ArrowDownIcon as ce, ArrowUpDownIcon as me, ChevronLeftIcon as he, ChevronRightIcon as ge, SettingsIcon as ue } from "lucide-react";
|
|
9
10
|
import "react-resizable-panels";
|
|
10
11
|
import "clsx";
|
|
@@ -330,7 +331,7 @@ function Ne({ columns: l, visibleColumns: n, toggleColumnVisibility: t }) {
|
|
|
330
331
|
)) })
|
|
331
332
|
] });
|
|
332
333
|
}
|
|
333
|
-
function
|
|
334
|
+
function He({
|
|
334
335
|
data: l,
|
|
335
336
|
columns: n,
|
|
336
337
|
getRowId: t,
|
|
@@ -465,7 +466,7 @@ function Le({
|
|
|
465
466
|
] });
|
|
466
467
|
}
|
|
467
468
|
export {
|
|
468
|
-
|
|
469
|
+
He as D,
|
|
469
470
|
xe as T,
|
|
470
471
|
fe as a,
|
|
471
472
|
ye as b,
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsx as r, jsxs as o } from "react/jsx-runtime";
|
|
2
|
-
import { I as J } from "./ImageInput-
|
|
3
|
-
import { A as V } from "./AppSubTitle-
|
|
4
|
-
import { M as Q } from "./MultiSelect-
|
|
5
|
-
import { aN as W, aQ as
|
|
2
|
+
import { I as J } from "./ImageInput-CJ419eqw.js";
|
|
3
|
+
import { A as V } from "./AppSubTitle-BNd5_q0i.js";
|
|
4
|
+
import { M as Q } from "./MultiSelect-DblSHEsg.js";
|
|
5
|
+
import { aN as W, aQ as $, aR as q, aS as D, aO as A, aT as L, J as X, N as Y, K as F, bR as ee, $ as te } from "./toggle-group-BASGy2mQ.js";
|
|
6
6
|
import "./alert-B78CiTYe.js";
|
|
7
7
|
import "@radix-ui/react-aspect-ratio";
|
|
8
8
|
import { B as M } from "./tooltip-BWyFpIxo.js";
|
|
9
9
|
import "@radix-ui/react-collapsible";
|
|
10
|
+
import { I as k } from "./sheet-Gop1cIaU.js";
|
|
10
11
|
import "lucide-react";
|
|
11
12
|
import "react-resizable-panels";
|
|
12
13
|
import { c as i } from "./tailwind.helper-B6yFEsav.js";
|
|
@@ -19,21 +20,21 @@ import { useState as N } from "react";
|
|
|
19
20
|
import { useForm as ue } from "react-hook-form";
|
|
20
21
|
import { useTranslation as ie } from "react-i18next";
|
|
21
22
|
import { z as b } from "zod";
|
|
22
|
-
const
|
|
23
|
+
const ze = ({
|
|
23
24
|
schema: h,
|
|
24
25
|
isLoading: S,
|
|
25
26
|
error: C,
|
|
26
27
|
onSubmit: P,
|
|
27
|
-
onCancel:
|
|
28
|
+
onCancel: f,
|
|
28
29
|
initialData: y,
|
|
29
|
-
disabled:
|
|
30
|
+
disabled: x = !1,
|
|
30
31
|
renderActions: j = !0,
|
|
31
32
|
onRegisterSubmit: K,
|
|
32
33
|
defaultCols: z = 4
|
|
33
34
|
}) => {
|
|
34
35
|
const { t: u } = ie(), { toast: E } = ce(), [g, w] = N(!1), [de, I] = N({});
|
|
35
36
|
if (!h) return null;
|
|
36
|
-
const
|
|
37
|
+
const R = (e) => {
|
|
37
38
|
switch (e) {
|
|
38
39
|
case 1:
|
|
39
40
|
return "md:col-span-1 col-span-4";
|
|
@@ -45,7 +46,7 @@ const je = ({
|
|
|
45
46
|
default:
|
|
46
47
|
return "md:col-span-4 col-span-4";
|
|
47
48
|
}
|
|
48
|
-
},
|
|
49
|
+
}, O = (() => {
|
|
49
50
|
const e = {};
|
|
50
51
|
return h.sections.forEach((t) => {
|
|
51
52
|
t.fields.forEach((a) => {
|
|
@@ -73,7 +74,7 @@ const je = ({
|
|
|
73
74
|
});
|
|
74
75
|
}), b.object(e);
|
|
75
76
|
})(), m = ue({
|
|
76
|
-
resolver: oe(
|
|
77
|
+
resolver: oe(O),
|
|
77
78
|
defaultValues: y || Object.fromEntries(h.sections.flatMap((e) => e.fields.map((t) => [t.key, t.defaultValue ?? null])))
|
|
78
79
|
});
|
|
79
80
|
N(() => {
|
|
@@ -131,7 +132,7 @@ const je = ({
|
|
|
131
132
|
const t = e(b);
|
|
132
133
|
return t.safeParse(void 0).success ? !1 : ((s = t._def.checks) == null ? void 0 : s.some((n) => n.kind === "min")) ?? !1;
|
|
133
134
|
}, G = (e, t) => {
|
|
134
|
-
const a = !!m.formState.errors[e.key], s =
|
|
135
|
+
const a = !!m.formState.errors[e.key], s = x;
|
|
135
136
|
switch (e.type) {
|
|
136
137
|
case "text":
|
|
137
138
|
case "color":
|
|
@@ -288,19 +289,19 @@ const je = ({
|
|
|
288
289
|
}
|
|
289
290
|
}, U = (e, t) => {
|
|
290
291
|
const a = /* @__PURE__ */ r("div", { className: i("grid grid-cols-4 gap-4"), children: e.fields.map((s) => /* @__PURE__ */ r(
|
|
291
|
-
|
|
292
|
+
$,
|
|
292
293
|
{
|
|
293
294
|
control: m.control,
|
|
294
295
|
name: s.key,
|
|
295
296
|
render: ({ field: n }) => {
|
|
296
297
|
var c;
|
|
297
|
-
return /* @__PURE__ */ o(
|
|
298
|
-
s.type !== "checkbox" && s.type !== "html" && /* @__PURE__ */ o(
|
|
298
|
+
return /* @__PURE__ */ o(q, { className: i(R(((c = s.layout) == null ? void 0 : c.cols) ?? z)), children: [
|
|
299
|
+
s.type !== "checkbox" && s.type !== "html" && /* @__PURE__ */ o(D, { children: [
|
|
299
300
|
u(s.labelKey),
|
|
300
301
|
_(s.rules) && /* @__PURE__ */ r("span", { className: "text-destructive ml-1", children: "*" })
|
|
301
302
|
] }),
|
|
302
303
|
/* @__PURE__ */ r(A, { children: G(s, n) }),
|
|
303
|
-
/* @__PURE__ */ r(
|
|
304
|
+
/* @__PURE__ */ r(L, {})
|
|
304
305
|
] });
|
|
305
306
|
}
|
|
306
307
|
},
|
|
@@ -309,7 +310,7 @@ const je = ({
|
|
|
309
310
|
return h.useCards === !1 ? /* @__PURE__ */ o("div", { className: "space-y-4 mb-6", children: [
|
|
310
311
|
e.titleKey && /* @__PURE__ */ r(V, { titleKey: e.titleKey }),
|
|
311
312
|
a
|
|
312
|
-
] }, t) : /* @__PURE__ */ o(
|
|
313
|
+
] }, t) : /* @__PURE__ */ o(X, { className: "mb-6", children: [
|
|
313
314
|
e.titleKey && /* @__PURE__ */ r(Y, { children: /* @__PURE__ */ r(V, { titleKey: e.titleKey }) }),
|
|
314
315
|
/* @__PURE__ */ r(F, { children: a })
|
|
315
316
|
] }, t);
|
|
@@ -326,8 +327,8 @@ const je = ({
|
|
|
326
327
|
h.sections.map((e, t) => U(e, t)),
|
|
327
328
|
C && /* @__PURE__ */ r("div", { className: "text-sm font-medium text-destructive", children: C.message })
|
|
328
329
|
] }),
|
|
329
|
-
!
|
|
330
|
-
|
|
330
|
+
!x && j && /* @__PURE__ */ o("div", { className: "flex justify-end gap-3 mt-6 border-t pt-4", children: [
|
|
331
|
+
f && /* @__PURE__ */ r(M, { type: "button", variant: "outline", onClick: f, disabled: g || S, children: u("Annuler", "Annuler") }),
|
|
331
332
|
/* @__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
|
] })
|
|
333
334
|
]
|
|
@@ -335,5 +336,5 @@ const je = ({
|
|
|
335
336
|
) });
|
|
336
337
|
};
|
|
337
338
|
export {
|
|
338
|
-
|
|
339
|
+
ze as G
|
|
339
340
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as e, jsxs as o } from "react/jsx-runtime";
|
|
2
|
-
import "./toggle-group-
|
|
2
|
+
import "./toggle-group-BASGy2mQ.js";
|
|
3
3
|
import "./alert-B78CiTYe.js";
|
|
4
4
|
import "@radix-ui/react-aspect-ratio";
|
|
5
5
|
import { B as x } from "./tooltip-BWyFpIxo.js";
|
|
6
6
|
import "@radix-ui/react-collapsible";
|
|
7
|
+
import "./sheet-Gop1cIaU.js";
|
|
7
8
|
import { XIcon as N, ImageIcon as v, UploadIcon as w } from "lucide-react";
|
|
8
9
|
import "react-resizable-panels";
|
|
9
10
|
import { c as u } from "./tailwind.helper-B6yFEsav.js";
|
|
@@ -14,16 +15,16 @@ import { forwardRef as I, useRef as y } from "react";
|
|
|
14
15
|
import { u as j } from "./useNotifications-zbUhCvF_.js";
|
|
15
16
|
const R = I(
|
|
16
17
|
({ 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:
|
|
18
|
-
var
|
|
19
|
-
const t = (
|
|
18
|
+
const { showError: m } = j(), r = y(null), h = (g) => {
|
|
19
|
+
var d;
|
|
20
|
+
const t = (d = g.target.files) == null ? void 0 : d[0];
|
|
20
21
|
if (!t) return;
|
|
21
22
|
if (!n.split(",").map((b) => b.trim()).includes(t.type)) {
|
|
22
|
-
|
|
23
|
+
m("Erreur", `Seuls les fichiers ${c} sont acceptés`), r.current && (r.current.value = "");
|
|
23
24
|
return;
|
|
24
25
|
}
|
|
25
26
|
if (t.size > s * 1024 * 1024) {
|
|
26
|
-
|
|
27
|
+
m("Erreur", `Le fichier ne doit pas dépasser ${s}MB`), r.current && (r.current.value = "");
|
|
27
28
|
return;
|
|
28
29
|
}
|
|
29
30
|
l(t), r.current && (r.current.value = "");
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import "./toggle-group-
|
|
2
|
+
import "./toggle-group-BASGy2mQ.js";
|
|
3
3
|
import "clsx";
|
|
4
4
|
import "tailwind-merge";
|
|
5
5
|
import "react-i18next";
|
|
@@ -8,15 +8,16 @@ import "./alert-B78CiTYe.js";
|
|
|
8
8
|
import "@radix-ui/react-aspect-ratio";
|
|
9
9
|
import "./tooltip-BWyFpIxo.js";
|
|
10
10
|
import "@radix-ui/react-collapsible";
|
|
11
|
+
import "./sheet-Gop1cIaU.js";
|
|
11
12
|
import "lucide-react";
|
|
12
13
|
import "react-resizable-panels";
|
|
13
14
|
import "./select-MWzbMBAS.js";
|
|
14
15
|
import "next-themes";
|
|
15
16
|
import "sonner";
|
|
16
17
|
import "react";
|
|
17
|
-
import { b as i, a as p } from "./SkeletonCards-
|
|
18
|
+
import { b as i, a as p } from "./SkeletonCards-BPIVRCOE.js";
|
|
18
19
|
import { E as s } from "./ErrorState-vU8d4CwD.js";
|
|
19
|
-
const
|
|
20
|
+
const h = ({ 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
21
|
export {
|
|
21
|
-
|
|
22
|
+
h as K
|
|
22
23
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { J as l, N as h, O as m, K as g } from "./toggle-group-
|
|
2
|
+
import { J as l, N as h, O as m, K as g } from "./toggle-group-BASGy2mQ.js";
|
|
3
3
|
import { c as b } from "./tailwind.helper-B6yFEsav.js";
|
|
4
4
|
import { useTranslation as p } from "react-i18next";
|
|
5
5
|
const k = ({ titleKey: t, icon: s, className: n, children: a }) => {
|
|
@@ -1,17 +1,18 @@
|
|
|
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 { $ as C } from "./toggle-group-
|
|
3
|
+
import { $ as C } from "./toggle-group-BASGy2mQ.js";
|
|
4
4
|
import "./alert-B78CiTYe.js";
|
|
5
5
|
import "@radix-ui/react-aspect-ratio";
|
|
6
6
|
import "./tooltip-BWyFpIxo.js";
|
|
7
7
|
import "@radix-ui/react-collapsible";
|
|
8
|
+
import "./sheet-Gop1cIaU.js";
|
|
8
9
|
import { XIcon as L, ChevronDownIcon as R, SearchIcon as T } from "lucide-react";
|
|
9
10
|
import "react-resizable-panels";
|
|
10
11
|
import { c as E } from "./tailwind.helper-B6yFEsav.js";
|
|
11
12
|
import "./select-MWzbMBAS.js";
|
|
12
13
|
import "next-themes";
|
|
13
14
|
import "sonner";
|
|
14
|
-
const
|
|
15
|
+
const J = ({
|
|
15
16
|
options: s,
|
|
16
17
|
selected: n,
|
|
17
18
|
onToggle: h,
|
|
@@ -138,5 +139,5 @@ const H = ({
|
|
|
138
139
|
] });
|
|
139
140
|
};
|
|
140
141
|
export {
|
|
141
|
-
|
|
142
|
+
J as M
|
|
142
143
|
};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as l, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import * as N from "react";
|
|
3
3
|
import { useState as k, useRef as C, useEffect as z, useMemo as S } from "react";
|
|
4
|
-
import { I,
|
|
4
|
+
import { I, bv as R, bx as L, bw as T } from "./toggle-group-BASGy2mQ.js";
|
|
5
5
|
import "./alert-B78CiTYe.js";
|
|
6
6
|
import "@radix-ui/react-aspect-ratio";
|
|
7
7
|
import { B as h } from "./tooltip-BWyFpIxo.js";
|
|
8
8
|
import "@radix-ui/react-collapsible";
|
|
9
|
+
import { I as j } from "./sheet-Gop1cIaU.js";
|
|
9
10
|
import { CalendarIcon as O, XIcon as M, ChevronDownIcon as A, SearchIcon as D, CheckIcon as q } from "lucide-react";
|
|
10
11
|
import "react-resizable-panels";
|
|
11
12
|
import { c as m } from "./tailwind.helper-B6yFEsav.js";
|
|
@@ -14,7 +15,7 @@ import "next-themes";
|
|
|
14
15
|
import "sonner";
|
|
15
16
|
import { format as x } from "date-fns";
|
|
16
17
|
import { fr as v } from "date-fns/locale";
|
|
17
|
-
const
|
|
18
|
+
const re = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
18
19
|
const [u, f] = k(!1), c = C(null);
|
|
19
20
|
z(() => {
|
|
20
21
|
if (!u) return;
|
|
@@ -27,11 +28,11 @@ const te = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
27
28
|
}, [u]);
|
|
28
29
|
const d = () => {
|
|
29
30
|
f((s) => !s);
|
|
30
|
-
},
|
|
31
|
+
}, a = (s) => {
|
|
31
32
|
o(s), f(!1);
|
|
32
33
|
};
|
|
33
|
-
return /* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */
|
|
34
|
+
return /* @__PURE__ */ l("div", { ref: c, className: "relative w-full", children: [
|
|
35
|
+
/* @__PURE__ */ l(
|
|
35
36
|
h,
|
|
36
37
|
{
|
|
37
38
|
variant: "outline",
|
|
@@ -48,24 +49,24 @@ const te = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
48
49
|
]
|
|
49
50
|
}
|
|
50
51
|
),
|
|
51
|
-
u ? /* @__PURE__ */ t("div", { className: "absolute left-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: /* @__PURE__ */ t(I, { mode: "single", selected: r, onSelect:
|
|
52
|
+
u ? /* @__PURE__ */ t("div", { className: "absolute left-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: /* @__PURE__ */ t(I, { mode: "single", selected: r, onSelect: a }) }) : null
|
|
52
53
|
] });
|
|
53
|
-
},
|
|
54
|
-
const [f, c] = N.useState(!1), [d,
|
|
54
|
+
}, oe = ({ value: r, onChange: o, placeholder: p = "Selectionner une periode", className: u }) => {
|
|
55
|
+
const [f, c] = N.useState(!1), [d, a] = N.useState(r);
|
|
55
56
|
N.useEffect(() => {
|
|
56
|
-
f &&
|
|
57
|
+
f && a(r);
|
|
57
58
|
}, [f, r]);
|
|
58
59
|
const s = (i) => {
|
|
59
60
|
i.stopPropagation(), o(void 0), c(!1);
|
|
60
61
|
}, n = () => {
|
|
61
62
|
o(d), c(!1);
|
|
62
63
|
}, g = () => {
|
|
63
|
-
|
|
64
|
+
a(r), c(!1);
|
|
64
65
|
}, b = () => {
|
|
65
|
-
|
|
66
|
+
a(void 0);
|
|
66
67
|
}, y = (i) => i != null && i.from ? !i.to || i.from.getTime() === i.to.getTime() ? x(i.from, "dd MMM yyyy", { locale: v }) : `${x(i.from, "dd MMM yyyy", { locale: v })} - ${x(i.to, "dd MMM yyyy", { locale: v })}` : p;
|
|
67
|
-
return /* @__PURE__ */ t("div", { className: m("grid gap-2", u), children: /* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */ t(L, { asChild: !0, children: /* @__PURE__ */
|
|
68
|
+
return /* @__PURE__ */ t("div", { className: m("grid gap-2", u), children: /* @__PURE__ */ l(R, { open: f, onOpenChange: c, children: [
|
|
69
|
+
/* @__PURE__ */ t(L, { asChild: !0, children: /* @__PURE__ */ l(h, { id: "date", variant: "outline", className: m("w-[300px] justify-start text-left font-normal", !(r != null && r.from) && "text-muted-foreground"), children: [
|
|
69
70
|
/* @__PURE__ */ t(O, { className: "mr-2 size-4" }),
|
|
70
71
|
y(r),
|
|
71
72
|
(r == null ? void 0 : r.from) && /* @__PURE__ */ t(
|
|
@@ -81,29 +82,29 @@ const te = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
81
82
|
}
|
|
82
83
|
)
|
|
83
84
|
] }) }),
|
|
84
|
-
/* @__PURE__ */
|
|
85
|
+
/* @__PURE__ */ l(T, { className: "w-auto p-0", align: "start", side: "bottom", sideOffset: 4, children: [
|
|
85
86
|
/* @__PURE__ */ t(
|
|
86
87
|
I,
|
|
87
88
|
{
|
|
88
89
|
mode: "range",
|
|
89
90
|
defaultMonth: d == null ? void 0 : d.from,
|
|
90
91
|
selected: d,
|
|
91
|
-
onSelect:
|
|
92
|
+
onSelect: a,
|
|
92
93
|
numberOfMonths: 2,
|
|
93
94
|
weekStartsOn: 1,
|
|
94
95
|
className: "pointer-events-auto p-3"
|
|
95
96
|
}
|
|
96
97
|
),
|
|
97
|
-
/* @__PURE__ */
|
|
98
|
+
/* @__PURE__ */ l("div", { className: "flex items-center justify-between border-t border-border px-3 py-2", children: [
|
|
98
99
|
/* @__PURE__ */ t(h, { variant: "ghost", size: "sm", onClick: b, children: "Effacer" }),
|
|
99
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ l("div", { className: "flex gap-2", children: [
|
|
100
101
|
/* @__PURE__ */ t(h, { variant: "ghost", size: "sm", onClick: g, children: "Annuler" }),
|
|
101
102
|
/* @__PURE__ */ t(h, { size: "sm", onClick: n, children: "Appliquer" })
|
|
102
103
|
] })
|
|
103
104
|
] })
|
|
104
105
|
] })
|
|
105
106
|
] }) });
|
|
106
|
-
},
|
|
107
|
+
}, ne = ({
|
|
107
108
|
options: r = [],
|
|
108
109
|
value: o,
|
|
109
110
|
onChange: p,
|
|
@@ -112,7 +113,7 @@ const te = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
112
113
|
searchPlaceholder: c = "Rechercher...",
|
|
113
114
|
disabled: d = !1
|
|
114
115
|
}) => {
|
|
115
|
-
const [
|
|
116
|
+
const [a, s] = k(""), [n, g] = k(!1), b = C(null), y = C(null), i = S(() => a === "" ? r : r.filter((e) => e.label.toLowerCase().includes(a.toLowerCase())), [r, a]), E = S(() => {
|
|
116
117
|
var e;
|
|
117
118
|
if (!(o === void 0 || o === ""))
|
|
118
119
|
return ((e = r.find((w) => w.value === o)) == null ? void 0 : e.label) ?? o;
|
|
@@ -134,8 +135,8 @@ const te = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
134
135
|
const P = (e) => {
|
|
135
136
|
p(e), g(!1), s("");
|
|
136
137
|
};
|
|
137
|
-
return /* @__PURE__ */
|
|
138
|
-
/* @__PURE__ */
|
|
138
|
+
return /* @__PURE__ */ l("div", { ref: b, className: "relative w-full", children: [
|
|
139
|
+
/* @__PURE__ */ l(
|
|
139
140
|
"button",
|
|
140
141
|
{
|
|
141
142
|
type: "button",
|
|
@@ -150,7 +151,7 @@ const te = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
150
151
|
),
|
|
151
152
|
children: [
|
|
152
153
|
/* @__PURE__ */ t("span", { className: "truncate", children: E ?? f }),
|
|
153
|
-
/* @__PURE__ */
|
|
154
|
+
/* @__PURE__ */ l("div", { className: "flex items-center gap-1", children: [
|
|
154
155
|
u && o !== void 0 && o !== "" && !d && /* @__PURE__ */ t(
|
|
155
156
|
"span",
|
|
156
157
|
{
|
|
@@ -171,8 +172,8 @@ const te = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
171
172
|
]
|
|
172
173
|
}
|
|
173
174
|
),
|
|
174
|
-
n ? /* @__PURE__ */
|
|
175
|
-
/* @__PURE__ */ t("div", { className: "border-b border-border p-2", children: /* @__PURE__ */
|
|
175
|
+
n ? /* @__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: [
|
|
176
|
+
/* @__PURE__ */ t("div", { className: "border-b border-border p-2", children: /* @__PURE__ */ l("div", { className: "relative", children: [
|
|
176
177
|
/* @__PURE__ */ t(D, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
|
|
177
178
|
/* @__PURE__ */ t(
|
|
178
179
|
"input",
|
|
@@ -180,16 +181,16 @@ const te = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
180
181
|
ref: y,
|
|
181
182
|
className: "w-full rounded-md bg-muted/50 py-1.5 pl-7 pr-2 text-sm text-foreground placeholder:text-muted-foreground outline-none focus:ring-1 focus:ring-ring",
|
|
182
183
|
placeholder: c,
|
|
183
|
-
value:
|
|
184
|
+
value: a,
|
|
184
185
|
onChange: (e) => {
|
|
185
186
|
s(e.target.value);
|
|
186
187
|
}
|
|
187
188
|
}
|
|
188
189
|
)
|
|
189
190
|
] }) }),
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__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: [
|
|
191
192
|
i.length === 0 && /* @__PURE__ */ t("p", { className: "px-2 py-3 text-center text-xs text-muted-foreground", children: "Aucun résultat" }),
|
|
192
|
-
i.map((e) => /* @__PURE__ */
|
|
193
|
+
i.map((e) => /* @__PURE__ */ l(
|
|
193
194
|
"button",
|
|
194
195
|
{
|
|
195
196
|
type: "button",
|
|
@@ -210,7 +211,7 @@ const te = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
210
211
|
] })
|
|
211
212
|
] }) : null
|
|
212
213
|
] });
|
|
213
|
-
},
|
|
214
|
+
}, se = ({
|
|
214
215
|
searchQuery: r,
|
|
215
216
|
search: o,
|
|
216
217
|
placeholder: p = "Rechercher...",
|
|
@@ -219,16 +220,16 @@ const te = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
219
220
|
onClear: c,
|
|
220
221
|
className: d
|
|
221
222
|
}) => {
|
|
222
|
-
const
|
|
223
|
+
const a = r ?? o ?? "", s = () => {
|
|
223
224
|
u(""), c !== void 0 && c();
|
|
224
225
|
};
|
|
225
|
-
return /* @__PURE__ */
|
|
226
|
+
return /* @__PURE__ */ l("div", { className: m("relative h-fit w-full md:w-64", d), children: [
|
|
226
227
|
/* @__PURE__ */ t(D, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 text-muted-foreground w-4 h-4" }),
|
|
227
228
|
/* @__PURE__ */ t(
|
|
228
229
|
j,
|
|
229
230
|
{
|
|
230
231
|
placeholder: p,
|
|
231
|
-
value:
|
|
232
|
+
value: a,
|
|
232
233
|
onChange: (n) => {
|
|
233
234
|
u(n.target.value);
|
|
234
235
|
},
|
|
@@ -238,12 +239,12 @@ const te = ({ date: r, onDateChange: o, placeholder: p }) => {
|
|
|
238
239
|
}
|
|
239
240
|
}
|
|
240
241
|
),
|
|
241
|
-
|
|
242
|
+
a !== "" ? /* @__PURE__ */ t("button", { onClick: s, className: "absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700", type: "button", children: /* @__PURE__ */ t(M, { className: "size-4" }) }) : null
|
|
242
243
|
] });
|
|
243
244
|
};
|
|
244
245
|
export {
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
246
|
+
re as D,
|
|
247
|
+
se as S,
|
|
248
|
+
oe as a,
|
|
249
|
+
ne as b
|
|
249
250
|
};
|