@krosoft/react 0.0.135 → 0.0.137

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 (61) hide show
  1. package/dist/{AppActions-CX-qVy8i.js → AppActions-DCaejx-3.js} +4 -3
  2. package/dist/{AppSubTitle-BxWwOgry.js → AppSubTitle-BNd5_q0i.js} +1 -1
  3. package/dist/{AppVerticalTabs-DiRvuLpb.js → AppVerticalTabs-NZ02HPGP.js} +11 -11
  4. package/dist/{ConfirmationDialog-DbMHt9aI.js → ConfirmationDialog-DJcxTNTk.js} +7 -6
  5. package/dist/{DataTable-DSIgTHZS.js → DataTable-BVgo8YWR.js} +4 -3
  6. package/dist/{GenericForm-CEnca4jf.js → GenericForm-Cy5ntJxi.js} +20 -19
  7. package/dist/{ImageInput-DLTYJMwr.js → ImageInput-CJ419eqw.js} +7 -6
  8. package/dist/{KpiCardsLayout-C3LmSeL1.js → KpiCardsLayout-DDR49Qqh.js} +5 -4
  9. package/dist/{MetricCard-CPw-fiNS.js → MetricCard-D-qPl6zh.js} +1 -1
  10. package/dist/{MultiSelect-CX051kfk.js → MultiSelect-DblSHEsg.js} +4 -3
  11. package/dist/{SearchInput-D6LmcOjp.js → SearchInput-T9TeORNA.js} +38 -37
  12. package/dist/{SkeletonCards-BIEnyOuZ.js → SkeletonCards-BPIVRCOE.js} +14 -13
  13. package/dist/{TableFilter-Wh_Womy4.js → TableFilter-rjiss-d9.js} +46 -45
  14. package/dist/Topbar-BTrdr7wj.js +199 -0
  15. package/dist/components/core/cards/index.js +2 -2
  16. package/dist/components/core/dialogs/index.js +2 -2
  17. package/dist/components/core/filters/index.js +1 -1
  18. package/dist/components/core/forms/index.js +1 -1
  19. package/dist/components/core/index.js +15 -15
  20. package/dist/components/core/inputs/index.js +3 -3
  21. package/dist/components/core/layouts/index.js +3 -3
  22. package/dist/components/core/navbar/Sidebar.d.ts +4 -5
  23. package/dist/components/core/navbar/Sidebar.d.ts.map +1 -1
  24. package/dist/components/core/navbar/index.js +1 -1
  25. package/dist/components/core/table/index.js +1 -1
  26. package/dist/components/core/tabs/index.js +1 -1
  27. package/dist/components/index.js +205 -203
  28. package/dist/components/ui/index.d.ts +1 -1
  29. package/dist/components/ui/index.d.ts.map +1 -1
  30. package/dist/components/ui/index.js +143 -141
  31. package/dist/contexts/index.d.ts +5 -0
  32. package/dist/contexts/index.d.ts.map +1 -0
  33. package/dist/contexts/index.js +5 -0
  34. package/dist/contexts/page.context.d.ts +9 -0
  35. package/dist/contexts/page.context.d.ts.map +1 -0
  36. package/dist/contexts/sidebar.context.d.ts +8 -0
  37. package/dist/contexts/sidebar.context.d.ts.map +1 -0
  38. package/dist/hooks/behavior/index.d.ts +2 -0
  39. package/dist/hooks/behavior/index.d.ts.map +1 -1
  40. package/dist/hooks/behavior/index.js +7 -4
  41. package/dist/hooks/behavior/usePage.d.ts +3 -0
  42. package/dist/hooks/behavior/usePage.d.ts.map +1 -0
  43. package/dist/hooks/behavior/useSidebar.d.ts +3 -0
  44. package/dist/hooks/behavior/useSidebar.d.ts.map +1 -0
  45. package/dist/hooks/index.js +19 -16
  46. package/dist/providers/SidebarProvider.d.ts +8 -0
  47. package/dist/providers/SidebarProvider.d.ts.map +1 -0
  48. package/dist/providers/index.d.ts +2 -0
  49. package/dist/providers/index.d.ts.map +1 -0
  50. package/dist/providers/index.js +49 -0
  51. package/dist/sheet-Gop1cIaU.js +84 -0
  52. package/dist/sidebar.context-D5nywlmP.js +6 -0
  53. package/dist/skeleton-8o8eJd3P.js +8 -0
  54. package/dist/{toaster-DTC8Duvh.js → toaster-Du2OlHAd.js} +19 -24
  55. package/dist/{toggle-group-CSdAiS44.js → toggle-group-BASGy2mQ.js} +610 -686
  56. package/dist/{useConfirmDeleteDialog-CiBQmRxg.js → usePage-CWu-cjzK.js} +32 -25
  57. package/dist/useSidebar-BJuALHqQ.js +11 -0
  58. package/package.json +2 -2
  59. package/dist/Topbar-DVww-tU8.js +0 -158
  60. package/dist/components/ui/sidebar.d.ts +0 -67
  61. package/dist/components/ui/sidebar.d.ts.map +0 -1
@@ -1,12 +1,13 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as a, jsx as e } from "react/jsx-runtime";
2
2
  import { formatNumber as h } from "@krosoft/core/helpers";
3
3
  import { useTranslation as C } from "react-i18next";
4
4
  import { c as s } from "./tailwind.helper-B6yFEsav.js";
5
- import { J as d, N as l, O as f, K as t } from "./toggle-group-CSdAiS44.js";
5
+ import { J as d, N as l, O as f, K as t } from "./toggle-group-BASGy2mQ.js";
6
6
  import "./alert-B78CiTYe.js";
7
7
  import "@radix-ui/react-aspect-ratio";
8
8
  import "./tooltip-BWyFpIxo.js";
9
9
  import "@radix-ui/react-collapsible";
10
+ import "./sheet-Gop1cIaU.js";
10
11
  import "lucide-react";
11
12
  import "react-resizable-panels";
12
13
  import "./select-MWzbMBAS.js";
@@ -14,7 +15,7 @@ import "next-themes";
14
15
  import "sonner";
15
16
  import "react";
16
17
  const g = ({
17
- titleKey: a,
18
+ titleKey: i,
18
19
  value: r,
19
20
  valueClassName: m,
20
21
  icon: n,
@@ -24,17 +25,17 @@ const g = ({
24
25
  onClick: o
25
26
  }) => {
26
27
  const { t: N } = C();
27
- return /* @__PURE__ */ i(d, { className: s(o !== void 0 ? "hover:border-primary cursor-pointer" : ""), onClick: o, children: [
28
- /* @__PURE__ */ i(l, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
29
- /* @__PURE__ */ e(f, { className: "text-sm font-medium", children: N(a) }),
28
+ return /* @__PURE__ */ a(d, { className: s(o !== void 0 ? "hover:border-primary cursor-pointer" : ""), onClick: o, children: [
29
+ /* @__PURE__ */ a(l, { className: "flex flex-row items-center justify-between space-y-0 pb-2", children: [
30
+ /* @__PURE__ */ e(f, { className: "text-sm font-medium", children: N(i) }),
30
31
  /* @__PURE__ */ e(n, { className: s("size-6 text-muted-foreground", c) })
31
32
  ] }),
32
- /* @__PURE__ */ i(t, { children: [
33
+ /* @__PURE__ */ a(t, { children: [
33
34
  /* @__PURE__ */ e("div", { className: s("text-2xl font-bold", m), children: h(r) }),
34
35
  /* @__PURE__ */ e("p", { className: s("text-xs text-muted-foreground", u), children: p })
35
36
  ] })
36
37
  ] });
37
- }, $ = ({ stats: a }) => /* @__PURE__ */ e("div", { className: "grid gap-6 md:grid-cols-2 lg:grid-cols-4", children: a.map((r) => /* @__PURE__ */ e(
38
+ }, q = ({ stats: i }) => /* @__PURE__ */ e("div", { className: "grid gap-6 md:grid-cols-2 lg:grid-cols-4", children: i.map((r) => /* @__PURE__ */ e(
38
39
  g,
39
40
  {
40
41
  titleKey: r.titleKey,
@@ -47,16 +48,16 @@ const g = ({
47
48
  onClick: r.onClick
48
49
  },
49
50
  r.titleKey
50
- )) }), v = () => /* @__PURE__ */ i(d, { className: "animate-pulse", children: [
51
+ )) }), v = () => /* @__PURE__ */ a(d, { className: "animate-pulse", children: [
51
52
  /* @__PURE__ */ e(l, { children: /* @__PURE__ */ e("div", { className: "h-6 bg-muted rounded w-1/4" }) }),
52
- /* @__PURE__ */ e(t, { children: /* @__PURE__ */ i("div", { className: "space-y-2", children: [
53
+ /* @__PURE__ */ e(t, { children: /* @__PURE__ */ a("div", { className: "space-y-2", children: [
53
54
  /* @__PURE__ */ e("div", { className: "h-4 bg-muted rounded" }),
54
55
  /* @__PURE__ */ e("div", { className: "h-4 bg-muted rounded w-3/4" })
55
56
  ] }) })
56
- ] }), q = ({ count: a = 1 }) => /* @__PURE__ */ e("div", { className: "grid gap-6", style: { gridTemplateColumns: `repeat(${a}, minmax(0, 1fr))` }, children: Array.from({ length: a }).map((r, m) => /* @__PURE__ */ e(v, {}, m)) });
57
+ ] }), B = ({ count: i = 1 }) => /* @__PURE__ */ e("div", { className: "grid gap-6", style: { gridTemplateColumns: `repeat(${i}, minmax(0, 1fr))` }, children: Array.from({ length: i }).map((r, m) => /* @__PURE__ */ e(v, {}, m)) });
57
58
  export {
58
59
  g as K,
59
60
  v as S,
60
- $ as a,
61
- q as b
61
+ q as a,
62
+ B as b
62
63
  };
@@ -1,12 +1,13 @@
1
1
  import { jsxs as u, jsx as r } from "react/jsx-runtime";
2
- import { useState as w, useEffect as D, useMemo as N } from "react";
3
- import { a as $, D as M, b as O, S as I } from "./SearchInput-D6LmcOjp.js";
4
- import { B as k, aX as C, bE as j, bN as R, bG as z, bJ as B, bM as Q, b0 as V, bI as _, bw as X, by as G, bx as H, $ as E } from "./toggle-group-CSdAiS44.js";
2
+ import { useState as w, useEffect as $, useMemo as N } from "react";
3
+ import { a as D, D as O, b as I, S as M } from "./SearchInput-T9TeORNA.js";
4
+ import { B as k, a$ as j, bv as R, bx as z, bw as B, $ as C } from "./toggle-group-BASGy2mQ.js";
5
5
  import "./alert-B78CiTYe.js";
6
6
  import "@radix-ui/react-aspect-ratio";
7
7
  import { B as F } from "./tooltip-BWyFpIxo.js";
8
8
  import "@radix-ui/react-collapsible";
9
- import { XIcon as P, Filter as J, ChevronDown as K, Search as U } from "lucide-react";
9
+ import { I as P, S as Q, i as V, b as _, e as H, h as X, d as G } from "./sheet-Gop1cIaU.js";
10
+ import { XIcon as E, Filter as J, ChevronDown as K, Search as U } from "lucide-react";
10
11
  import "react-resizable-panels";
11
12
  import "clsx";
12
13
  import "tailwind-merge";
@@ -14,7 +15,7 @@ import { S as W, h as Y, i as Z, a as q, c as ee } from "./select-MWzbMBAS.js";
14
15
  import "next-themes";
15
16
  import "sonner";
16
17
  import { c as re } from "./tailwind.helper-B6yFEsav.js";
17
- import { M as te } from "./MultiSelect-CX051kfk.js";
18
+ import { M as te } from "./MultiSelect-DblSHEsg.js";
18
19
  const L = (n, l, s = {}) => {
19
20
  if (l instanceof Date)
20
21
  return l.toLocaleDateString("fr-FR");
@@ -28,8 +29,8 @@ function le({ filters: n, onRemoveFilter: l, onClearAll: s, filterLabels: i = {}
28
29
  c.flatMap(([h, m]) => {
29
30
  const b = i[h] ?? h;
30
31
  if (Array.isArray(m))
31
- return m.map((y) => {
32
- const p = L(h, y, d);
32
+ return m.map((v) => {
33
+ const p = L(h, v, d);
33
34
  return /* @__PURE__ */ u(
34
35
  k,
35
36
  {
@@ -43,15 +44,15 @@ function le({ filters: n, onRemoveFilter: l, onClearAll: s, filterLabels: i = {}
43
44
  "button",
44
45
  {
45
46
  onClick: () => {
46
- l(h, y);
47
+ l(h, v);
47
48
  },
48
49
  className: "ml-1 hover:bg-blue-200 rounded-full p-0.5",
49
- children: /* @__PURE__ */ r(P, { className: "size-4" })
50
+ children: /* @__PURE__ */ r(E, { className: "size-4" })
50
51
  }
51
52
  )
52
53
  ]
53
54
  },
54
- `${h}_${String(y)}`
55
+ `${h}_${String(v)}`
55
56
  );
56
57
  });
57
58
  const x = L(h, m, d);
@@ -66,7 +67,7 @@ function le({ filters: n, onRemoveFilter: l, onClearAll: s, filterLabels: i = {}
66
67
  l(h);
67
68
  },
68
69
  className: "ml-1 hover:bg-blue-200 rounded-full p-0.5",
69
- children: /* @__PURE__ */ r(P, { className: "size-4" })
70
+ children: /* @__PURE__ */ r(E, { className: "size-4" })
70
71
  }
71
72
  )
72
73
  ] }, h);
@@ -84,7 +85,7 @@ const ae = ({
84
85
  switch (n.type) {
85
86
  case "text":
86
87
  return /* @__PURE__ */ r(
87
- C,
88
+ P,
88
89
  {
89
90
  placeholder: n.placeholder,
90
91
  value: l ?? "",
@@ -95,7 +96,7 @@ const ae = ({
95
96
  );
96
97
  case "number":
97
98
  return /* @__PURE__ */ r(
98
- C,
99
+ P,
99
100
  {
100
101
  type: "number",
101
102
  placeholder: n.placeholder,
@@ -109,7 +110,7 @@ const ae = ({
109
110
  );
110
111
  case "select":
111
112
  return n.searchable === !0 ? /* @__PURE__ */ r(
112
- O,
113
+ I,
113
114
  {
114
115
  options: n.options ?? [],
115
116
  value: l,
@@ -122,9 +123,9 @@ const ae = ({
122
123
  /* @__PURE__ */ r(q, { children: (d = n.options) == null ? void 0 : d.map((c) => /* @__PURE__ */ r(ee, { value: c.value, children: c.label }, c.value)) })
123
124
  ] });
124
125
  case "date":
125
- return /* @__PURE__ */ r(M, { date: l, onDateChange: s, placeholder: n.placeholder ?? "Sélectionner une date" });
126
+ return /* @__PURE__ */ r(O, { date: l, onDateChange: s, placeholder: n.placeholder ?? "Sélectionner une date" });
126
127
  case "date-range":
127
- return /* @__PURE__ */ r($, { value: l, onChange: s, placeholder: n.placeholder });
128
+ return /* @__PURE__ */ r(D, { value: l, onChange: s, placeholder: n.placeholder });
128
129
  case "multi-select":
129
130
  return /* @__PURE__ */ r(
130
131
  te,
@@ -153,30 +154,30 @@ function se({
153
154
  sheetTitle: d = "Filtres avancés"
154
155
  }) {
155
156
  const [c, h] = w(!1), [m, b] = w(l);
156
- D(() => {
157
+ $(() => {
157
158
  b(l);
158
159
  }, [l, c]);
159
160
  const x = (f, t) => {
160
161
  b((e) => ({ ...e, [f]: t }));
161
- }, y = (f, t) => {
162
+ }, v = (f, t) => {
162
163
  const e = m[f], a = Array.isArray(e) ? e : [], o = a.includes(t) ? a.filter((g) => g !== t) : [...a, t];
163
164
  x(f, o);
164
165
  }, p = () => {
165
166
  s(m), h(!1);
166
- }, v = () => {
167
+ }, y = () => {
167
168
  b({}), s({}), h(!1);
168
169
  };
169
- return /* @__PURE__ */ u(j, { open: c, onOpenChange: h, children: [
170
- /* @__PURE__ */ r(R, { asChild: !0, children: /* @__PURE__ */ u(F, { variant: "outline", className: "gap-2", children: [
170
+ return /* @__PURE__ */ u(Q, { open: c, onOpenChange: h, children: [
171
+ /* @__PURE__ */ r(V, { asChild: !0, children: /* @__PURE__ */ u(F, { variant: "outline", className: "gap-2", children: [
171
172
  /* @__PURE__ */ r(J, { className: "size-4 shrink-0" }),
172
173
  i
173
174
  ] }) }),
174
- /* @__PURE__ */ u(z, { side: "right", className: "w-[400px] sm:w-[500px] flex flex-col p-0", children: [
175
- /* @__PURE__ */ r(B, { className: "p-6 pb-0", children: /* @__PURE__ */ r(Q, { children: d }) }),
175
+ /* @__PURE__ */ u(_, { side: "right", className: "w-[400px] sm:w-[500px] flex flex-col p-0", children: [
176
+ /* @__PURE__ */ r(H, { className: "p-6 pb-0", children: /* @__PURE__ */ r(X, { children: d }) }),
176
177
  /* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto p-6 pt-6", children: /* @__PURE__ */ r("div", { className: "space-y-6", children: n.map((f, t) => /* @__PURE__ */ u("div", { className: "space-y-4", children: [
177
178
  /* @__PURE__ */ r("h3", { className: "font-semibold text-sm text-gray-900 dark:text-gray-100 border-b pb-2", children: f.title }),
178
179
  f.filters.map((e) => /* @__PURE__ */ u("div", { className: "space-y-2", children: [
179
- /* @__PURE__ */ r(V, { htmlFor: e.key, children: e.label }),
180
+ /* @__PURE__ */ r(j, { htmlFor: e.key, children: e.label }),
180
181
  /* @__PURE__ */ r(
181
182
  ae,
182
183
  {
@@ -186,14 +187,14 @@ function se({
186
187
  x(e.key, a);
187
188
  },
188
189
  onToggleMultiSelect: (a) => {
189
- y(e.key, a);
190
+ v(e.key, a);
190
191
  }
191
192
  }
192
193
  )
193
194
  ] }, e.key))
194
195
  ] }, t)) }) }),
195
- /* @__PURE__ */ u(_, { className: "gap-2 p-6 border-t bg-white dark:bg-gray-950", children: [
196
- /* @__PURE__ */ r(F, { variant: "outline", className: "flex-1", onClick: v, children: "Effacer les filtres" }),
196
+ /* @__PURE__ */ u(G, { className: "gap-2 p-6 border-t bg-white dark:bg-gray-950", children: [
197
+ /* @__PURE__ */ r(F, { variant: "outline", className: "flex-1", onClick: y, children: "Effacer les filtres" }),
197
198
  /* @__PURE__ */ r(F, { className: "flex-1 bg-orange-500 hover:bg-orange-600 text-white", onClick: p, children: "Rechercher" })
198
199
  ] })
199
200
  ] })
@@ -209,8 +210,8 @@ function ne({
209
210
  searchable: h = !1,
210
211
  searchPlaceholder: m = "Rechercher..."
211
212
  }) {
212
- const [b, x] = w(""), y = s.length > 0, p = N(() => b === "" ? l : l.filter((t) => t.label.toLowerCase().includes(b.toLowerCase())), [l, b]), v = N(() => p.length === 0 ? !1 : p.every((t) => s.includes(t.value)), [p, s]), f = () => {
213
- if (v)
213
+ const [b, x] = w(""), v = s.length > 0, p = N(() => b === "" ? l : l.filter((t) => t.label.toLowerCase().includes(b.toLowerCase())), [l, b]), y = N(() => p.length === 0 ? !1 : p.every((t) => s.includes(t.value)), [p, s]), f = () => {
214
+ if (y)
214
215
  if (c !== void 0) {
215
216
  const t = p.map((a) => a.value), e = s.filter((a) => !t.includes(a));
216
217
  c(e);
@@ -228,16 +229,16 @@ function ne({
228
229
  });
229
230
  };
230
231
  return /* @__PURE__ */ u(
231
- X,
232
+ R,
232
233
  {
233
234
  onOpenChange: () => {
234
235
  x("");
235
236
  },
236
237
  children: [
237
- /* @__PURE__ */ r(G, { asChild: !0, children: /* @__PURE__ */ u(
238
+ /* @__PURE__ */ r(z, { asChild: !0, children: /* @__PURE__ */ u(
238
239
  "button",
239
240
  {
240
- className: `inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-sm transition-colors whitespace-nowrap ${y ? "border-primary bg-primary/10 text-primary font-medium" : "border-border bg-card text-card-foreground hover:bg-muted"}`,
241
+ className: `inline-flex items-center gap-1.5 rounded-full border px-3 py-1.5 text-sm transition-colors whitespace-nowrap ${v ? "border-primary bg-primary/10 text-primary font-medium" : "border-border bg-card text-card-foreground hover:bg-muted"}`,
241
242
  children: [
242
243
  n,
243
244
  s.length > 0 && /* @__PURE__ */ r("span", { className: "flex h-4 min-w-[16px] items-center justify-center rounded-full bg-primary px-1 text-[10px] font-bold text-primary-foreground", children: s.length }),
@@ -245,7 +246,7 @@ function ne({
245
246
  ]
246
247
  }
247
248
  ) }),
248
- /* @__PURE__ */ u(H, { className: "w-56 p-0", align: "start", children: [
249
+ /* @__PURE__ */ u(B, { className: "w-56 p-0", align: "start", children: [
249
250
  h ? /* @__PURE__ */ r("div", { className: "border-b border-border p-2", children: /* @__PURE__ */ u("div", { className: "relative", children: [
250
251
  /* @__PURE__ */ r(U, { className: "absolute left-2 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-muted-foreground" }),
251
252
  /* @__PURE__ */ r(
@@ -263,13 +264,13 @@ function ne({
263
264
  ] }) }) : null,
264
265
  /* @__PURE__ */ u("div", { className: "flex flex-col gap-0.5 max-h-56 overflow-y-auto p-1.5", children: [
265
266
  p.length > 0 && /* @__PURE__ */ u("label", { className: "flex items-center gap-2.5 rounded-md px-2 py-2 text-sm hover:bg-muted cursor-pointer transition-colors", children: [
266
- /* @__PURE__ */ r(E, { checked: v, onCheckedChange: f }),
267
+ /* @__PURE__ */ r(C, { checked: y, onCheckedChange: f }),
267
268
  "Tout sélectionner"
268
269
  ] }),
269
270
  p.length === 0 && /* @__PURE__ */ r("p", { className: "px-2 py-3 text-center text-xs text-muted-foreground", children: "Aucun résultat" }),
270
271
  p.map((t) => /* @__PURE__ */ u("label", { className: "flex items-center gap-2.5 rounded-md px-2 py-2 text-sm hover:bg-muted cursor-pointer transition-colors", children: [
271
272
  /* @__PURE__ */ r(
272
- E,
273
+ C,
273
274
  {
274
275
  checked: s.includes(t.value),
275
276
  onCheckedChange: () => {
@@ -297,7 +298,7 @@ function ne({
297
298
  }
298
299
  );
299
300
  }
300
- function Fe({
301
+ function we({
301
302
  searchQuery: n,
302
303
  onSearchChange: l,
303
304
  searchPlaceholder: s = "Rechercher...",
@@ -308,17 +309,17 @@ function Fe({
308
309
  sheetTitle: m = "Filtres avancés"
309
310
  }) {
310
311
  const b = (e, a) => {
311
- const o = i[e], g = Array.isArray(o) ? o : [], A = g.includes(a) ? g.filter((T) => T !== a) : [...g, a], S = { ...i };
312
- A.length === 0 ? delete S[e] : S[e] = A, d(S);
312
+ const o = i[e], g = Array.isArray(o) ? o : [], S = g.includes(a) ? g.filter((T) => T !== a) : [...g, a], A = { ...i };
313
+ S.length === 0 ? delete A[e] : A[e] = S, d(A);
313
314
  }, x = (e) => {
314
315
  const a = { ...i };
315
316
  delete a[e], d(a);
316
- }, y = () => {
317
+ }, v = () => {
317
318
  d({});
318
319
  }, p = (e, a) => {
319
320
  const o = { ...i }, g = o[e];
320
- Array.isArray(g) && a !== void 0 ? (o[e] = g.filter((A) => A !== a), Array.isArray(o[e]) && o[e].length === 0 && delete o[e]) : delete o[e], d(o);
321
- }, v = N(() => {
321
+ Array.isArray(g) && a !== void 0 ? (o[e] = g.filter((S) => S !== a), Array.isArray(o[e]) && o[e].length === 0 && delete o[e]) : delete o[e], d(o);
322
+ }, y = N(() => {
322
323
  const e = [];
323
324
  return c.forEach((a) => {
324
325
  a.filters.forEach((o) => {
@@ -351,7 +352,7 @@ function Fe({
351
352
  return /* @__PURE__ */ u("div", { className: "space-y-4 w-full", children: [
352
353
  /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-3 justify-between", children: /* @__PURE__ */ u("div", { className: "flex flex-wrap items-center gap-3", children: [
353
354
  l !== void 0 ? /* @__PURE__ */ r(
354
- I,
355
+ M,
355
356
  {
356
357
  searchQuery: n,
357
358
  onSearch: l,
@@ -361,7 +362,7 @@ function Fe({
361
362
  placeholder: s
362
363
  }
363
364
  ) : null,
364
- v.map((e) => /* @__PURE__ */ r(
365
+ y.map((e) => /* @__PURE__ */ r(
365
366
  ne,
366
367
  {
367
368
  label: e.label,
@@ -388,7 +389,7 @@ function Fe({
388
389
  {
389
390
  filters: i,
390
391
  onRemoveFilter: p,
391
- onClearAll: y,
392
+ onClearAll: v,
392
393
  filterLabels: f,
393
394
  optionLabels: t
394
395
  }
@@ -399,6 +400,6 @@ export {
399
400
  le as A,
400
401
  ae as F,
401
402
  ne as S,
402
- Fe as T,
403
+ we as T,
403
404
  se as a
404
405
  };
@@ -0,0 +1,199 @@
1
+ import { jsxs as i, jsx as e, Fragment as T } from "react/jsx-runtime";
2
+ import * as O from "react";
3
+ import { ChevronDownIcon as W, SearchIcon as $, MenuIcon as L } from "lucide-react";
4
+ import { T as B, c as M, a as Q, b as R, B as q } from "./tooltip-BWyFpIxo.js";
5
+ import { c as d } from "./tailwind.helper-B6yFEsav.js";
6
+ import "./sidebar.context-D5nywlmP.js";
7
+ import { u as F } from "./useSidebar-BJuALHqQ.js";
8
+ import "react-i18next";
9
+ import "next-themes";
10
+ import { I as G, S as _, b as E, h as H, c as J } from "./sheet-Gop1cIaU.js";
11
+ import { S as D } from "./skeleton-8o8eJd3P.js";
12
+ const K = ({
13
+ path: s,
14
+ // eslint-disable-next-line @typescript-eslint/naming-convention
15
+ icon: m,
16
+ label: h,
17
+ badge: c,
18
+ subItems: a,
19
+ currentPath: n,
20
+ collapsed: o,
21
+ onItemClick: p
22
+ }) => {
23
+ const [x, N] = O.useState((a == null ? void 0 : a.some((r) => n === r.path || n.startsWith(`${r.path}/`))) || !1), y = s ? n === s || s !== "/" && n.startsWith(`${s}/`) : !1, g = a == null ? void 0 : a.some((r) => n === r.path || n.startsWith(`${r.path}/`)), b = /* @__PURE__ */ i(
24
+ "a",
25
+ {
26
+ href: s || "#",
27
+ onClick: (r) => {
28
+ r.preventDefault(), a && a.length > 0 ? o || N(!x) : s && p(s);
29
+ },
30
+ className: d(
31
+ "flex items-center gap-3 rounded-2xl cursor-pointer mb-2 transition-all duration-200 group",
32
+ o ? "justify-center p-3 h-12 w-12 mx-auto" : "px-4 py-3 h-12",
33
+ y || !o && g ? "bg-sidebar-primary text-sidebar-primary-foreground shadow-lg" : "hover:bg-sidebar-accent text-sidebar-foreground hover:text-sidebar-accent-foreground"
34
+ ),
35
+ children: [
36
+ /* @__PURE__ */ e("div", { className: d("flex-shrink-0 transition-transform group-hover:scale-110", o ? "flex items-center justify-center" : ""), children: /* @__PURE__ */ e(m, { className: "size-4" }) }),
37
+ !o && /* @__PURE__ */ i(T, { children: [
38
+ /* @__PURE__ */ e("span", { className: "flex-grow transition-opacity duration-150 font-medium", children: h }),
39
+ c !== void 0 && /* @__PURE__ */ e("span", { className: "bg-red-500 text-white text-xs rounded-full py-1 min-w-[20px] text-center px-2 font-semibold", children: c }),
40
+ a && a.length > 0 && /* @__PURE__ */ e(W, { className: d("size-4 transition-transform duration-200", x ? "rotate-180" : "") })
41
+ ] })
42
+ ]
43
+ }
44
+ );
45
+ return /* @__PURE__ */ i(T, { children: [
46
+ o ? /* @__PURE__ */ i(B, { children: [
47
+ /* @__PURE__ */ e(M, { asChild: !0, children: b }),
48
+ /* @__PURE__ */ e(
49
+ Q,
50
+ {
51
+ side: "right",
52
+ sideOffset: 6,
53
+ className: "rounded-xl z-[99999] flex gap-2 bg-sidebar text-sidebar-foreground border border-sidebar-border py-2 text-sm shadow-lg",
54
+ children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
55
+ /* @__PURE__ */ e("p", { className: "font-semibold", children: h }),
56
+ c !== void 0 && /* @__PURE__ */ i("span", { className: "ml-1 text-xs", children: [
57
+ "(",
58
+ c,
59
+ ")"
60
+ ] })
61
+ ] }) })
62
+ }
63
+ )
64
+ ] }) : b,
65
+ !o && a && a.length > 0 && x && /* @__PURE__ */ e("div", { className: "flex flex-col gap-1 mb-2 ml-4 pl-4 border-l-2 border-sidebar-border/50 animate-in slide-in-from-top-2 fade-in duration-200", children: a.map((r, l) => {
66
+ const C = n === r.path || r.path !== "/" && n.startsWith(`${r.path}/`);
67
+ return /* @__PURE__ */ i(
68
+ "a",
69
+ {
70
+ href: r.path,
71
+ onClick: (S) => {
72
+ S.preventDefault(), p(r.path);
73
+ },
74
+ className: d(
75
+ "flex items-center justify-between px-4 py-2 rounded-xl text-sm transition-all duration-200",
76
+ C ? "bg-sidebar-accent/50 text-sidebar-primary font-semibold" : "text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-foreground"
77
+ ),
78
+ children: [
79
+ /* @__PURE__ */ e("span", { children: r.label }),
80
+ r.badge !== void 0 && /* @__PURE__ */ e("span", { className: "bg-sidebar-primary/20 text-sidebar-primary text-[10px] rounded-full py-0.5 px-2 font-semibold", children: r.badge })
81
+ ]
82
+ },
83
+ l
84
+ );
85
+ }) })
86
+ ] });
87
+ }, te = ({
88
+ groups: s,
89
+ onItemClick: m,
90
+ currentPath: h,
91
+ appName: c = "appname",
92
+ appSubName: a = "appsubname",
93
+ // eslint-disable-next-line @typescript-eslint/naming-convention
94
+ appIcon: n,
95
+ headerNode: o,
96
+ footerNode: p,
97
+ loading: x = !1,
98
+ searchable: N = !1,
99
+ searchPlaceholder: y = "Rechercher..."
100
+ }) => {
101
+ const { collapsed: g, isMobile: v, setCollapsed: w } = F(), [b, r] = O.useState(""), l = v ? !1 : g, C = !g, S = (t) => {
102
+ m(t), v && w(!0);
103
+ }, k = b.trim().toLowerCase(), A = k === "" ? s : s.map((t) => ({
104
+ ...t,
105
+ items: t.items.filter(
106
+ (f) => {
107
+ var u;
108
+ return f.label.toLowerCase().includes(k) || (((u = f.subItems) == null ? void 0 : u.some((z) => z.label.toLowerCase().includes(k))) ?? !1);
109
+ }
110
+ )
111
+ })).filter((t) => t.items.length > 0), j = /* @__PURE__ */ i("div", { className: "flex flex-col h-full bg-sidebar text-sidebar-foreground", children: [
112
+ o ?? /* @__PURE__ */ i("div", { className: d("flex items-center h-16 md:h-20 flex-shrink-0 gap-3 px-4", l ? "justify-center" : ""), children: [
113
+ n !== void 0 && /* @__PURE__ */ e("div", { className: "flex-shrink-0 text-sidebar-foreground", children: /* @__PURE__ */ e(n, { className: "size-6" }) }),
114
+ !l && /* @__PURE__ */ i("div", { className: "flex flex-col", children: [
115
+ /* @__PURE__ */ e("h1", { className: "font-bold text-lg text-sidebar-foreground leading-tight", children: c }),
116
+ /* @__PURE__ */ e("span", { className: "text-xs text-sidebar-muted font-medium", children: a })
117
+ ] })
118
+ ] }),
119
+ N && !l && /* @__PURE__ */ e("div", { className: "px-4 pt-4", children: /* @__PURE__ */ i("div", { className: "relative", children: [
120
+ /* @__PURE__ */ e($, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-sidebar-muted" }),
121
+ /* @__PURE__ */ e(
122
+ G,
123
+ {
124
+ type: "search",
125
+ value: b,
126
+ onChange: (t) => {
127
+ r(t.target.value);
128
+ },
129
+ placeholder: y,
130
+ className: "h-9 bg-sidebar-accent/40 border-sidebar-border pl-9 text-sidebar-foreground placeholder:text-sidebar-muted"
131
+ }
132
+ )
133
+ ] }) }),
134
+ /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto py-4 px-2 scrollbar-modern", children: x ? Array.from({ length: 5 }).map((t, f) => /* @__PURE__ */ i("div", { className: d("flex items-center gap-3 mb-2 h-12", l ? "justify-center px-3" : "px-4"), children: [
135
+ /* @__PURE__ */ e(D, { className: "size-5 flex-shrink-0 rounded-md" }),
136
+ !l && /* @__PURE__ */ e(D, { className: "h-4 flex-1" })
137
+ ] }, f)) : A.map((t, f) => /* @__PURE__ */ i("div", { className: "mb-6", children: [
138
+ !l && t.title !== void 0 && t.title !== "" && /* @__PURE__ */ e("h3", { className: "px-4 mb-2 text-xs uppercase tracking-wider font-semibold text-sidebar-muted", children: t.title }),
139
+ /* @__PURE__ */ e("nav", { className: "flex flex-col gap-1", children: t.items.map((u, z) => /* @__PURE__ */ e(K, { ...u, currentPath: h, collapsed: l, onItemClick: S }, z)) })
140
+ ] }, f)) }),
141
+ p && /* @__PURE__ */ e("div", { className: d("p-4 border-t border-sidebar-border", l ? "flex justify-center" : ""), children: p })
142
+ ] });
143
+ return v ? /* @__PURE__ */ e(
144
+ _,
145
+ {
146
+ open: C,
147
+ onOpenChange: (t) => {
148
+ w(!t);
149
+ },
150
+ children: /* @__PURE__ */ i(E, { side: "left", className: "w-[16rem] p-0 bg-sidebar border-r border-sidebar-border overflow-hidden [&>button]:text-sidebar-foreground", children: [
151
+ /* @__PURE__ */ e(H, { className: "sr-only", children: "Menu de navigation" }),
152
+ /* @__PURE__ */ e(J, { className: "sr-only", children: "Navigation principale de l'application" }),
153
+ j
154
+ ] })
155
+ }
156
+ ) : /* @__PURE__ */ e(R, { delayDuration: 0, children: /* @__PURE__ */ e(
157
+ "aside",
158
+ {
159
+ className: d("flex flex-col bg-sidebar h-screen transition-all duration-300", l ? "w-[--navbar-width-icon]" : "w-[--navbar-width]", "flex"),
160
+ style: {
161
+ "--navbar-width": "16rem",
162
+ "--navbar-width-icon": "5rem"
163
+ },
164
+ children: j
165
+ }
166
+ ) });
167
+ }, ie = ({ collapsed: s, isMobile: m, onToggleSidebar: h, actionsNode: c, userMenuNode: a }) => /* @__PURE__ */ i(
168
+ "header",
169
+ {
170
+ className: d(
171
+ "fixed top-0 right-0 z-[60] h-16 md:h-20 bg-topbar text-topbar-foreground flex items-center justify-between px-4 transition-all duration-300",
172
+ m && "left-0",
173
+ !m && s && "left-[5rem]",
174
+ !m && !s && "left-[16rem]"
175
+ ),
176
+ tabIndex: -1,
177
+ children: [
178
+ /* @__PURE__ */ e("div", { className: "flex items-center min-w-0 flex-1", children: /* @__PURE__ */ e(
179
+ q,
180
+ {
181
+ variant: "ghost",
182
+ size: "icon",
183
+ onClick: h,
184
+ className: "text-topbar-foreground hover:bg-topbar-accent hover:text-topbar-accent-foreground",
185
+ children: /* @__PURE__ */ e(L, { className: "size-4" })
186
+ }
187
+ ) }),
188
+ /* @__PURE__ */ i("div", { className: "flex items-center gap-2 md:gap-4 flex-shrink-0", children: [
189
+ c,
190
+ a
191
+ ] })
192
+ ]
193
+ }
194
+ );
195
+ export {
196
+ te as S,
197
+ ie as T,
198
+ K as a
199
+ };
@@ -1,5 +1,5 @@
1
- import { D as s, M as d } from "../../../MetricCard-CPw-fiNS.js";
2
- import { K as o, a as C, S as t, b as p } from "../../../SkeletonCards-BIEnyOuZ.js";
1
+ import { D as s, M as d } from "../../../MetricCard-D-qPl6zh.js";
2
+ import { K as o, a as C, S as t, b as p } from "../../../SkeletonCards-BPIVRCOE.js";
3
3
  export {
4
4
  s as DashboardCard,
5
5
  o as KpiCard,
@@ -1,5 +1,5 @@
1
- import { A as i, C as s, F as g } from "../../../ConfirmationDialog-DbMHt9aI.js";
2
- import { D as r, a as D, b as e, c as t, d as n, e as p, f, g as m, h as C, i as F, P } from "../../../toggle-group-CSdAiS44.js";
1
+ import { A as i, C as s, F as g } from "../../../ConfirmationDialog-DJcxTNTk.js";
2
+ import { D as r, a as D, b as e, c as t, d as n, e as p, f, g as m, h as C, i as F, P } from "../../../toggle-group-BASGy2mQ.js";
3
3
  export {
4
4
  i as AppDialog,
5
5
  s as ConfirmationDialog,
@@ -1,4 +1,4 @@
1
- import { A as l, a as i, F as r, S as s, T as t } from "../../../TableFilter-Wh_Womy4.js";
1
+ import { A as l, a as i, F as r, S as s, T as t } from "../../../TableFilter-rjiss-d9.js";
2
2
  export {
3
3
  l as ActiveFilters,
4
4
  i as AdvancedFilters,
@@ -1,4 +1,4 @@
1
- import { G as o } from "../../../GenericForm-CEnca4jf.js";
1
+ import { G as o } from "../../../GenericForm-Cy5ntJxi.js";
2
2
  export {
3
3
  o as GenericForm
4
4
  };
@@ -1,22 +1,22 @@
1
- import { D as r, M as o } from "../../MetricCard-CPw-fiNS.js";
2
- import { K as t, a as i, S as l, b as p } from "../../SkeletonCards-BIEnyOuZ.js";
3
- import { A as b, C as f, F as g } from "../../ConfirmationDialog-DbMHt9aI.js";
4
- import { D as T, a as n, b as c, c as d, d as x, e as A, f as S, g as C, h as F, i as P, P as h } from "../../toggle-group-CSdAiS44.js";
5
- import { A as k, a as I, F as K, S as v, T as E } from "../../TableFilter-Wh_Womy4.js";
6
- import { G as y } from "../../GenericForm-CEnca4jf.js";
7
- import { I as L } from "../../ImageInput-DLTYJMwr.js";
8
- import { D as G, a as N, S as O, b as R } from "../../SearchInput-D6LmcOjp.js";
9
- import { M as j } from "../../MultiSelect-CX051kfk.js";
10
- import { A as w } from "../../AppActions-CX-qVy8i.js";
11
- import { A as J } from "../../AppSubTitle-BxWwOgry.js";
1
+ import { D as r, M as o } from "../../MetricCard-D-qPl6zh.js";
2
+ import { K as t, a as i, S as l, b as p } from "../../SkeletonCards-BPIVRCOE.js";
3
+ import { A as b, C as f, F as g } from "../../ConfirmationDialog-DJcxTNTk.js";
4
+ import { D as T, a as n, b as c, c as d, d as x, e as A, f as S, g as C, h as F, i as P, P as h } from "../../toggle-group-BASGy2mQ.js";
5
+ import { A as k, a as I, F as K, S as v, T as E } from "../../TableFilter-rjiss-d9.js";
6
+ import { G as y } from "../../GenericForm-Cy5ntJxi.js";
7
+ import { I as L } from "../../ImageInput-CJ419eqw.js";
8
+ import { D as G, a as N, S as O, b as R } from "../../SearchInput-T9TeORNA.js";
9
+ import { M as j } from "../../MultiSelect-DblSHEsg.js";
10
+ import { A as w } from "../../AppActions-DCaejx-3.js";
11
+ import { A as J } from "../../AppSubTitle-BNd5_q0i.js";
12
12
  import { A as U } from "../../AppTitle-uboDuil4.js";
13
- import { K as X } from "../../KpiCardsLayout-C3LmSeL1.js";
14
- import { S as Z, a as _, T as $ } from "../../Topbar-DVww-tU8.js";
13
+ import { K as X } from "../../KpiCardsLayout-DDR49Qqh.js";
14
+ import { S as Z, a as _, T as $ } from "../../Topbar-BTrdr7wj.js";
15
15
  import { E as ea } from "../../ErrorAlert-DH1onuyt.js";
16
16
  import { E as oa } from "../../ErrorState-vU8d4CwD.js";
17
17
  import { L as ta } from "../../LoadingState-BN0YaPSs.js";
18
- import { D as la, T as pa, a as ma, b as ba, c as fa, d as ga, e as Da } from "../../DataTable-DSIgTHZS.js";
19
- import { A as na, a as ca, b as da, c as xa } from "../../AppVerticalTabs-DiRvuLpb.js";
18
+ import { D as la, T as pa, a as ma, b as ba, c as fa, d as ga, e as Da } from "../../DataTable-BVgo8YWR.js";
19
+ import { A as na, a as ca, b as da, c as xa } from "../../AppVerticalTabs-NZ02HPGP.js";
20
20
  import { T as Sa } from "../../ThemeSelector-Qv8QBlYq.js";
21
21
  export {
22
22
  k as ActiveFilters,
@@ -1,6 +1,6 @@
1
- import { I as r } from "../../../ImageInput-DLTYJMwr.js";
2
- import { D as c, a as o, S as s, b as p } from "../../../SearchInput-D6LmcOjp.js";
3
- import { M as l } from "../../../MultiSelect-CX051kfk.js";
1
+ import { I as r } from "../../../ImageInput-CJ419eqw.js";
2
+ import { D as c, a as o, S as s, b as p } from "../../../SearchInput-T9TeORNA.js";
3
+ import { M as l } from "../../../MultiSelect-DblSHEsg.js";
4
4
  export {
5
5
  c as DatePicker,
6
6
  o as DateRangePicker,
@@ -1,7 +1,7 @@
1
- import { A as r } from "../../../AppActions-CX-qVy8i.js";
2
- import { A } from "../../../AppSubTitle-BxWwOgry.js";
1
+ import { A as r } from "../../../AppActions-DCaejx-3.js";
2
+ import { A } from "../../../AppSubTitle-BNd5_q0i.js";
3
3
  import { A as e } from "../../../AppTitle-uboDuil4.js";
4
- import { K as f } from "../../../KpiCardsLayout-C3LmSeL1.js";
4
+ import { K as f } from "../../../KpiCardsLayout-DDR49Qqh.js";
5
5
  export {
6
6
  r as AppActions,
7
7
  A as AppSubTitle,