@krosoft/react 0.0.199 → 0.0.201

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 (47) hide show
  1. package/dist/{AppActions-DeBcK3cv.js → AppActions-ViFjSupi.js} +6 -6
  2. package/dist/{AppSubTitle-CdIM6aXB.js → AppSubTitle-ClHzadQW.js} +1 -1
  3. package/dist/{AppVerticalTabs-BlgIZ0mf.js → AppVerticalTabs-Cj66X8_R.js} +7 -7
  4. package/dist/{ConfirmationDialog-DZ6tvSwP.js → ConfirmationDialog-BoajNW2s.js} +15 -15
  5. package/dist/{DataTable-BDW0AEsH.js → DataTable-BUcnJCi6.js} +22 -22
  6. package/dist/{GenericForm-DFTUIw-X.js → GenericForm-BPY5O-B6.js} +43 -43
  7. package/dist/{ImageInput-MzY2W495.js → ImageInput-DOIglcpv.js} +2 -2
  8. package/dist/{KpiCardsLayout-fcfJK4ts.js → KpiCardsLayout-D9NSC5Fb.js} +4 -4
  9. package/dist/{MultiSelect-V-RantiK.js → MultiSelect-B60y82TF.js} +16 -16
  10. package/dist/{SearchInput-tz8UERbu.js → SearchInput-C-jCOSoi.js} +49 -49
  11. package/dist/{SkeletonCards-CyP7ZysR.js → SkeletonCards-63vDljXy.js} +2 -2
  12. package/dist/{TableFilter-BXf-oSjf.js → TableFilter-DP7cq0PU.js} +26 -26
  13. package/dist/Topbar-0EBMHLwG.js +301 -0
  14. package/dist/components/core/cards/index.js +1 -1
  15. package/dist/components/core/dialogs/index.js +8 -7
  16. package/dist/components/core/filters/index.js +1 -1
  17. package/dist/components/core/forms/index.js +1 -1
  18. package/dist/components/core/index.js +66 -64
  19. package/dist/components/core/inputs/index.js +3 -3
  20. package/dist/components/core/layouts/index.js +3 -3
  21. package/dist/components/core/navbar/GlobalSearch.d.ts +52 -0
  22. package/dist/components/core/navbar/GlobalSearch.d.ts.map +1 -0
  23. package/dist/components/core/navbar/index.d.ts +2 -0
  24. package/dist/components/core/navbar/index.d.ts.map +1 -1
  25. package/dist/components/core/navbar/index.js +6 -5
  26. package/dist/components/core/table/index.js +1 -1
  27. package/dist/components/core/tabs/index.js +1 -1
  28. package/dist/components/index.js +293 -292
  29. package/dist/components/ui/command.d.ts +20 -2
  30. package/dist/components/ui/command.d.ts.map +1 -1
  31. package/dist/components/ui/index.d.ts +1 -0
  32. package/dist/components/ui/index.d.ts.map +1 -1
  33. package/dist/components/ui/index.js +187 -187
  34. package/dist/hooks/behavior/index.d.ts +1 -0
  35. package/dist/hooks/behavior/index.d.ts.map +1 -1
  36. package/dist/hooks/behavior/index.js +6 -5
  37. package/dist/hooks/behavior/useDebouncedValue.d.ts +6 -0
  38. package/dist/hooks/behavior/useDebouncedValue.d.ts.map +1 -0
  39. package/dist/hooks/index.js +20 -19
  40. package/dist/sheet-C-QvdRNi.js +245 -0
  41. package/dist/{toaster-DG7IvN3o.js → toaster-D6OHn49K.js} +9 -9
  42. package/dist/{toggle-group-CKCJXGta.js → toggle-group-DLLrEwv2.js} +576 -714
  43. package/dist/usePage-BFE9lxI1.js +84 -0
  44. package/package.json +2 -2
  45. package/dist/Topbar-CFmKB_S2.js +0 -217
  46. package/dist/sheet-B_uq6-K_.js +0 -87
  47. package/dist/usePage-u2gRhvQ0.js +0 -72
@@ -1,24 +1,24 @@
1
1
  import { jsxs as n, jsx as l } from "react/jsx-runtime";
2
- import { am as u, aA as t, ao as c, av as g, aq as d } from "./toggle-group-CKCJXGta.js";
2
+ import { a3 as u, ah as t, a5 as c, ac as g, a7 as d } from "./toggle-group-DLLrEwv2.js";
3
3
  import "./alert-B9F1N9Qk.js";
4
4
  import "@radix-ui/react-aspect-ratio";
5
5
  import { B as p } from "./tooltip-DVeqVwqV.js";
6
6
  import "./chart-DntJZGxB.js";
7
7
  import "@radix-ui/react-collapsible";
8
- import "./sheet-B_uq6-K_.js";
9
- import { MoreVerticalIcon as v } from "lucide-react";
8
+ import "./sheet-C-QvdRNi.js";
9
+ import { MoreVerticalIcon as h } from "lucide-react";
10
10
  import "react-resizable-panels";
11
11
  import { c as i } from "./tailwind.helper-B6yFEsav.js";
12
12
  import "./select-BpjFWqAY.js";
13
13
  import "next-themes";
14
14
  import "sonner";
15
15
  import "react";
16
- import { useTranslation as h } from "react-i18next";
16
+ import { useTranslation as v } from "react-i18next";
17
17
  import { u as C } from "./useMobile-DN1_OMDB.js";
18
18
  function G({ actions: o, className: b }) {
19
- const { t: m } = h(), N = C();
19
+ const { t: m } = v(), N = C();
20
20
  return !o || o.length === 0 ? null : N ? /* @__PURE__ */ n(u, { children: [
21
- /* @__PURE__ */ l(t, { asChild: !0, children: /* @__PURE__ */ l(p, { variant: "outline", size: "icon", children: /* @__PURE__ */ l(v, { className: "size-4" }) }) }),
21
+ /* @__PURE__ */ l(t, { asChild: !0, children: /* @__PURE__ */ l(p, { variant: "outline", size: "icon", children: /* @__PURE__ */ l(h, { className: "size-4" }) }) }),
22
22
  /* @__PURE__ */ l(c, { align: "end", className: "min-w-48", children: o.map((r, e) => r ? r.children && r.children.length > 0 ? /* @__PURE__ */ n("div", { children: [
23
23
  e > 0 && /* @__PURE__ */ l(g, {}),
24
24
  r.children.map((s, a) => s ? /* @__PURE__ */ n(
@@ -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-DeBcK3cv.js";
3
+ import { A as m } from "./AppActions-ViFjSupi.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,15 +1,15 @@
1
1
  import { jsxs as r, jsx as s } from "react/jsx-runtime";
2
2
  import { C as b, d as w, a as S } from "./chart-DntJZGxB.js";
3
- import { A as C } from "./AppActions-DeBcK3cv.js";
3
+ import { A as C } from "./AppActions-ViFjSupi.js";
4
4
  import { A as T } from "./AppTitle-D15YXeMx.js";
5
- import { bB as A, bD as P, bE as k, bC as j, bo as z } from "./toggle-group-CKCJXGta.js";
5
+ import { bi as A, bk as P, bl as k, bj as j, b5 as z } from "./toggle-group-DLLrEwv2.js";
6
6
  import { useRef as V, useEffect as R } from "react";
7
7
  import { useTranslation as g } from "react-i18next";
8
8
  import { useSearchParams as y } from "react-router-dom";
9
9
  import { c as q } from "./tailwind.helper-B6yFEsav.js";
10
- import { S as I, h as K, i as L, a as D, c as E } from "./select-BpjFWqAY.js";
10
+ import { S as I, h as K, i as L, a as H, c as U } from "./select-BpjFWqAY.js";
11
11
  import { ConstructionIcon as v } from "lucide-react";
12
- function H({ titleKey: n, descriptionKey: l, actions: t = [], className: c }) {
12
+ function D({ titleKey: n, descriptionKey: l, actions: t = [], className: c }) {
13
13
  return /* @__PURE__ */ r("div", { className: "flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between", children: [
14
14
  /* @__PURE__ */ s(T, { titleKey: n, descriptionKey: l, isSubTitle: !0 }),
15
15
  /* @__PURE__ */ s(C, { actions: t, className: c })
@@ -17,7 +17,7 @@ function H({ titleKey: n, descriptionKey: l, actions: t = [], className: c }) {
17
17
  }
18
18
  function Y({ titleKey: n, descriptionKey: l, actions: t = [], className: c, children: o, isSubTitle: p }) {
19
19
  return /* @__PURE__ */ r(b, { children: [
20
- /* @__PURE__ */ s(w, { children: /* @__PURE__ */ s(H, { titleKey: n, descriptionKey: l, actions: t, className: c }) }),
20
+ /* @__PURE__ */ s(w, { children: /* @__PURE__ */ s(D, { titleKey: n, descriptionKey: l, actions: t, className: c }) }),
21
21
  /* @__PURE__ */ s(S, { className: "space-y-4", children: o })
22
22
  ] });
23
23
  }
@@ -78,7 +78,7 @@ const _ = ({ tabs: n, item: l }) => {
78
78
  )) }) }) }),
79
79
  /* @__PURE__ */ s("div", { className: "md:hidden w-full border-b pb-4 mb-4", children: /* @__PURE__ */ r(I, { value: i, onValueChange: h, children: [
80
80
  /* @__PURE__ */ s(K, { className: "w-full", children: /* @__PURE__ */ s(L, { placeholder: "Sélectionner une section" }) }),
81
- /* @__PURE__ */ s(D, { children: n.map((a, e) => /* @__PURE__ */ s(E, { value: a.value, disabled: a.disabled, children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
81
+ /* @__PURE__ */ s(H, { children: n.map((a, e) => /* @__PURE__ */ s(U, { value: a.value, disabled: a.disabled, children: /* @__PURE__ */ r("div", { className: "flex items-center gap-2", children: [
82
82
  a.icon && /* @__PURE__ */ s(a.icon, { className: "size-4" }),
83
83
  /* @__PURE__ */ s("span", { children: t(a.titleKey) }),
84
84
  a.count && /* @__PURE__ */ r("span", { className: "text-xs text-gray-500", children: [
@@ -94,7 +94,7 @@ const _ = ({ tabs: n, item: l }) => {
94
94
  };
95
95
  export {
96
96
  Y as A,
97
- H as a,
97
+ D as a,
98
98
  Z as b,
99
99
  _ as c
100
100
  };
@@ -1,11 +1,11 @@
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-CKCJXGta.js";
3
- import { A as Z, a as _ } from "./alert-B9F1N9Qk.js";
2
+ import { P as B, d as R, g as W, j as F, k as X, h as j, i as $, f as q } from "./toggle-group-DLLrEwv2.js";
3
+ import { A as J, a as Q } from "./alert-B9F1N9Qk.js";
4
4
  import "@radix-ui/react-aspect-ratio";
5
5
  import { B as v } from "./tooltip-DVeqVwqV.js";
6
6
  import "./chart-DntJZGxB.js";
7
7
  import "@radix-ui/react-collapsible";
8
- import "./sheet-B_uq6-K_.js";
8
+ import { D as U, b as V, e as Y, h as Z, c as _ } from "./sheet-C-QvdRNi.js";
9
9
  import { AlertCircleIcon as L, X as S, Save as T, Pen as I } from "lucide-react";
10
10
  import "react-resizable-panels";
11
11
  import "clsx";
@@ -15,22 +15,22 @@ import "next-themes";
15
15
  import "sonner";
16
16
  import { useState as y, useEffect as ee } from "react";
17
17
  import { useTranslation as O } from "react-i18next";
18
- import { G as le } from "./GenericForm-DFTUIw-X.js";
18
+ import { G as le } from "./GenericForm-BPY5O-B6.js";
19
19
  import { E as ie } from "./ErrorAlert-SrIcU1mM.js";
20
20
  function re({ open: t, onOpenChange: c, config: l, isLoading: u, error: s, children: p }) {
21
21
  const { t: i } = O(), { title: b, description: d, icon: f, maxWidth: g = "sm:max-w-xl", actions: n } = l;
22
- return /* @__PURE__ */ e(q, { open: t, onOpenChange: c, children: /* @__PURE__ */ r(B, { className: `${g} max-h-[100dvh] sm:max-h-[90vh] border-0 shadow-2xl p-0 flex flex-col overflow-hidden`, children: [
23
- u === !0 ? /* @__PURE__ */ e("div", { className: "absolute top-0 left-0 right-0 z-10", children: /* @__PURE__ */ e(R, { indeterminate: !0, className: "h-1 rounded-none" }) }) : null,
24
- /* @__PURE__ */ r(W, { className: "bg-gradient-to-r from-slate-900 to-purple-700 p-4 sm:p-6 sm:rounded-t-surface shrink-0", children: [
25
- /* @__PURE__ */ r(X, { className: "text-xl sm:text-2xl font-bold flex items-center gap-2 text-white", children: [
22
+ return /* @__PURE__ */ e(U, { open: t, onOpenChange: c, children: /* @__PURE__ */ r(V, { className: `${g} max-h-[100dvh] sm:max-h-[90vh] border-0 shadow-2xl p-0 flex flex-col overflow-hidden`, children: [
23
+ u === !0 ? /* @__PURE__ */ e("div", { className: "absolute top-0 left-0 right-0 z-10", children: /* @__PURE__ */ e(B, { indeterminate: !0, className: "h-1 rounded-none" }) }) : null,
24
+ /* @__PURE__ */ r(Y, { className: "bg-gradient-to-r from-slate-900 to-purple-700 p-4 sm:p-6 sm:rounded-t-surface shrink-0", children: [
25
+ /* @__PURE__ */ r(Z, { className: "text-xl sm:text-2xl font-bold flex items-center gap-2 text-white", children: [
26
26
  f !== void 0 ? /* @__PURE__ */ e("div", { className: "p-2 bg-white/20 rounded-control", children: /* @__PURE__ */ e(f, { className: "size-4 text-white" }) }) : null,
27
27
  i(b)
28
28
  ] }),
29
- d !== void 0 && d !== "" ? /* @__PURE__ */ e($, { className: "text-indigo-100 text-base", children: i(d) }) : null
29
+ d !== void 0 && d !== "" ? /* @__PURE__ */ e(_, { className: "text-indigo-100 text-base", children: i(d) }) : null
30
30
  ] }),
31
- s != null ? /* @__PURE__ */ e("div", { className: "px-6 ", children: /* @__PURE__ */ r(Z, { variant: "destructive", className: "max-w-full", children: [
31
+ s != null ? /* @__PURE__ */ e("div", { className: "px-6 ", children: /* @__PURE__ */ r(J, { variant: "destructive", className: "max-w-full", children: [
32
32
  /* @__PURE__ */ e(L, { className: "size-4" }),
33
- /* @__PURE__ */ e(_, { className: "break-words overflow-wrap-anywhere max-w-full", children: s.message })
33
+ /* @__PURE__ */ e(Q, { className: "break-words overflow-wrap-anywhere max-w-full", children: s.message })
34
34
  ] }) }) : null,
35
35
  /* @__PURE__ */ e("div", { className: "flex-1 overflow-y-auto px-4 sm:px-6 py-4", children: p }),
36
36
  n !== void 0 && n.length > 0 ? /* @__PURE__ */ e("div", { className: "sm:rounded-b-surface border-t border-gray-200 dark:border-gray-700 shrink-0 p-4 sm:p-6 light:bg-gradient-to-r light:from-gray-50 light:to-gray-100 dark:bg-gray-950", children: /* @__PURE__ */ e("div", { className: "flex justify-end gap-3", children: n.map((a, k) => /* @__PURE__ */ r(v, { variant: a.variant ?? "default", onClick: a.onClick, disabled: a.disabled === !0 || u === !0, children: [
@@ -152,9 +152,9 @@ function we({ isLoading: t, error: c, config: l, destructive: u = !1 }) {
152
152
  const p = (i) => {
153
153
  !i && !t && l.onClose();
154
154
  };
155
- return /* @__PURE__ */ e(J, { open: l.isOpen, onOpenChange: p, children: /* @__PURE__ */ r(Q, { children: [
155
+ return /* @__PURE__ */ e(R, { open: l.isOpen, onOpenChange: p, children: /* @__PURE__ */ r(W, { children: [
156
156
  /* @__PURE__ */ r(F, { children: [
157
- /* @__PURE__ */ r(U, { className: l.titleClassName, children: [
157
+ /* @__PURE__ */ r(X, { className: l.titleClassName, children: [
158
158
  l.icon && /* @__PURE__ */ e(l.icon, { className: "size-4" }),
159
159
  s(l.title)
160
160
  ] }),
@@ -163,8 +163,8 @@ function we({ isLoading: t, error: c, config: l, destructive: u = !1 }) {
163
163
  l.itemName && /* @__PURE__ */ e(j, { children: /* @__PURE__ */ e("span", { className: "font-semibold block my-2", children: l.itemName }) })
164
164
  ] }),
165
165
  /* @__PURE__ */ e(ie, { error: c instanceof Error ? null : c }),
166
- /* @__PURE__ */ r(V, { children: [
167
- /* @__PURE__ */ e(Y, { disabled: t, children: s("common.buttons.cancel") }),
166
+ /* @__PURE__ */ r($, { children: [
167
+ /* @__PURE__ */ e(q, { disabled: t, children: s("common.buttons.cancel") }),
168
168
  /* @__PURE__ */ e(
169
169
  v,
170
170
  {
@@ -1,12 +1,12 @@
1
1
  import { jsxs as i, jsx as e, Fragment as ne } from "react/jsx-runtime";
2
2
  import { u as le } from "./useDataTable-CxcA5S-s.js";
3
- import { am as B, aA as L, ao as O, aq as de, O as V, an as ce } from "./toggle-group-CKCJXGta.js";
3
+ import { a3 as B, ah as L, a5 as V, a7 as de, E as O, a4 as ce } from "./toggle-group-DLLrEwv2.js";
4
4
  import "./alert-B9F1N9Qk.js";
5
5
  import "@radix-ui/react-aspect-ratio";
6
6
  import { B as y } from "./tooltip-DVeqVwqV.js";
7
7
  import "./chart-DntJZGxB.js";
8
8
  import "@radix-ui/react-collapsible";
9
- import "./sheet-B_uq6-K_.js";
9
+ import "./sheet-C-QvdRNi.js";
10
10
  import { MoreVerticalIcon as oe, Loader2Icon as he, AlertTriangleIcon as me, GripVerticalIcon as ge, ArrowUpIcon as ue, ArrowDownIcon as fe, ArrowUpDownIcon as pe, ChevronLeftIcon as xe, ChevronRightIcon as ve, SettingsIcon as ye } from "lucide-react";
11
11
  import "react-resizable-panels";
12
12
  import "clsx";
@@ -46,7 +46,7 @@ function ze({ actions: n, row: t }) {
46
46
  g.length > 0 && /* @__PURE__ */ i(B, { children: [
47
47
  /* @__PURE__ */ e(L, { asChild: !0, children: /* @__PURE__ */ e(y, { variant: "ghost", size: "icon", className: "h-7 w-7 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ e(oe, { className: "size-3.5" }) }) }),
48
48
  /* @__PURE__ */ e(
49
- O,
49
+ V,
50
50
  {
51
51
  align: "end",
52
52
  onClick: (r) => {
@@ -125,7 +125,7 @@ function De({
125
125
  h.stopPropagation();
126
126
  },
127
127
  children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ e(
128
- V,
128
+ O,
129
129
  {
130
130
  checked: o.includes(p),
131
131
  onCheckedChange: () => {
@@ -230,14 +230,14 @@ function je({
230
230
  let u = !1;
231
231
  t.length === a && a > 0 ? u = !0 : t.length > 0 && (u = "indeterminate");
232
232
  const p = (s) => s.sortable !== !0 ? null : o === s.key ? x === "asc" ? /* @__PURE__ */ e(ue, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ e(fe, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ e(pe, { className: "size-3.5 text-muted-foreground/50 group-hover:text-muted-foreground transition-colors" }), h = (s, N) => {
233
- const I = N !== !1, A = s.sortable === !0;
233
+ const I = N !== !1, T = s.sortable === !0;
234
234
  return /* @__PURE__ */ i(
235
235
  "th",
236
236
  {
237
237
  className: [
238
238
  "px-2 py-2 text-left text-sm font-medium text-gray-900 dark:text-gray-100 relative group",
239
239
  D ? "border-r border-gray-200 dark:border-gray-800" : "",
240
- A ? "cursor-pointer select-none" : "",
240
+ T ? "cursor-pointer select-none" : "",
241
241
  s.className ?? ""
242
242
  ].filter(Boolean).join(" "),
243
243
  style: c ? { width: m[s.key] } : { minWidth: m[s.key] },
@@ -277,7 +277,7 @@ function je({
277
277
  );
278
278
  };
279
279
  return /* @__PURE__ */ e("thead", { className: "bg-muted/50 dark:bg-gray-900/50 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ i("tr", { children: [
280
- n ? /* @__PURE__ */ e("th", { className: "p-1 flex-shrink-0 text-center align-middle", style: { width: "32px", minWidth: "32px", maxWidth: "32px" }, children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ e(V, { checked: u, onCheckedChange: d }) }) }) : null,
280
+ n ? /* @__PURE__ */ e("th", { className: "p-1 flex-shrink-0 text-center align-middle", style: { width: "32px", minWidth: "32px", maxWidth: "32px" }, children: /* @__PURE__ */ e("div", { className: "flex items-center justify-center", children: /* @__PURE__ */ e(O, { checked: u, onCheckedChange: d }) }) }) : null,
281
281
  g.map((s) => h(s, r)),
282
282
  k || S !== void 0 ? /* @__PURE__ */ e("th", { className: "p-1 text-center align-middle", style: { minWidth: "32px" }, children: S }) : null
283
283
  ] }) });
@@ -286,7 +286,7 @@ const w = "…";
286
286
  function j(n, t) {
287
287
  return Array.from({ length: t - n + 1 }, (a, d) => n + d);
288
288
  }
289
- function Ae(n, t, a = 1) {
289
+ function Te(n, t, a = 1) {
290
290
  if (a * 2 + 5 >= t)
291
291
  return j(1, t);
292
292
  const g = Math.max(n - a, 1), r = Math.min(n + a, t), c = g > 2, m = r < t - 1;
@@ -298,7 +298,7 @@ function Ae(n, t, a = 1) {
298
298
  }
299
299
  return [1, w, ...j(g, r), w, t];
300
300
  }
301
- function Te({
301
+ function Ae({
302
302
  totalItems: n,
303
303
  startIndex: t,
304
304
  endIndex: a,
@@ -309,7 +309,7 @@ function Te({
309
309
  pageSizeOptions: m,
310
310
  totalPages: o
311
311
  }) {
312
- const x = Ae(r, o);
312
+ const x = Te(r, o);
313
313
  return /* @__PURE__ */ i("div", { className: "px-4 py-2 border-t border-gray-200 dark:border-gray-800 flex flex-col sm:grid sm:grid-cols-3 items-center gap-2 bg-muted/50 dark:bg-gray-900/50", children: [
314
314
  /* @__PURE__ */ i("div", { className: "text-sm text-muted-foreground justify-self-start", children: [
315
315
  n === 0 ? "0" : `${String(t + 1)} - ${String(a)}`,
@@ -383,7 +383,7 @@ function Te({
383
383
  function Me({ columns: n, visibleColumns: t, toggleColumnVisibility: a }) {
384
384
  return /* @__PURE__ */ i(B, { children: [
385
385
  /* @__PURE__ */ e(L, { asChild: !0, children: /* @__PURE__ */ e(y, { variant: "outline", size: "sm", className: "size-7 p-0 bg-white hover:bg-gray-100 dark:bg-gray-900 shadow-sm border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ e(ye, { className: "size-3.5 text-gray-600 dark:text-gray-300" }) }) }),
386
- /* @__PURE__ */ e(O, { align: "end", className: "w-56", children: n.map((d) => /* @__PURE__ */ e(
386
+ /* @__PURE__ */ e(V, { align: "end", className: "w-56", children: n.map((d) => /* @__PURE__ */ e(
387
387
  ce,
388
388
  {
389
389
  checked: t.has(d.key),
@@ -423,16 +423,16 @@ function Xe({
423
423
  }) {
424
424
  const {
425
425
  sortColumn: I,
426
- sortDirection: A,
426
+ sortDirection: T,
427
427
  selectedRows: f,
428
428
  setSelectedRows: U,
429
- visibleColumns: q,
430
- columnWidths: T,
429
+ visibleColumns: E,
430
+ columnWidths: A,
431
431
  safeCurrentPage: F,
432
432
  totalPages: G,
433
433
  startIndex: R,
434
434
  endIndex: _,
435
- tableRef: E,
435
+ tableRef: q,
436
436
  hasActions: M,
437
437
  hasBulkActions: $,
438
438
  visibleColumnsArray: W,
@@ -474,7 +474,7 @@ function Xe({
474
474
  /* @__PURE__ */ i("div", { className: "space-y-4 [--k-radius-control:var(--k-radius-control-dense,0.5rem)] [--k-radius-surface:var(--k-radius-surface-dense,0.75rem)]", children: [
475
475
  f.length > 0 && r !== void 0 && r.length > 0 && /* @__PURE__ */ e(Ie, { selectedRows: f, setSelectedRows: U, bulkActions: r }),
476
476
  /* @__PURE__ */ i("div", { className: "w-full bg-card dark:bg-gray-950 rounded-surface border border-gray-200 dark:border-gray-800 overflow-hidden", children: [
477
- /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ i("table", { ref: E, className: "w-full", children: [
477
+ /* @__PURE__ */ e("div", { className: "overflow-x-auto", children: /* @__PURE__ */ i("table", { ref: q, className: "w-full", children: [
478
478
  /* @__PURE__ */ e(
479
479
  je,
480
480
  {
@@ -485,9 +485,9 @@ function Xe({
485
485
  visibleColumnsArray: W,
486
486
  draggableColumns: c,
487
487
  resizableColumns: m,
488
- columnWidths: T,
488
+ columnWidths: A,
489
489
  sortColumn: I,
490
- sortDirection: A,
490
+ sortDirection: T,
491
491
  handleSort: Q,
492
492
  handleDragStart: Y,
493
493
  handleDragOver: Z,
@@ -495,7 +495,7 @@ function Xe({
495
495
  handleMouseDown: X,
496
496
  hasActions: M,
497
497
  bordered: v,
498
- settingsNode: o ? /* @__PURE__ */ e(Me, { columns: t, visibleColumns: q, toggleColumnVisibility: ee }) : void 0
498
+ settingsNode: o ? /* @__PURE__ */ e(Me, { columns: t, visibleColumns: E, toggleColumnVisibility: ee }) : void 0
499
499
  }
500
500
  ),
501
501
  /* @__PURE__ */ e(
@@ -513,7 +513,7 @@ function Xe({
513
513
  selectedRows: f,
514
514
  toggleRowSelection: re,
515
515
  visibleColumnsArray: W,
516
- columnWidths: T,
516
+ columnWidths: A,
517
517
  hasActions: M || o,
518
518
  actions: g,
519
519
  columns: t,
@@ -522,7 +522,7 @@ function Xe({
522
522
  )
523
523
  ] }) }),
524
524
  /* @__PURE__ */ e(
525
- Te,
525
+ Ae,
526
526
  {
527
527
  totalItems: k ?? n.length,
528
528
  startIndex: R,
@@ -545,6 +545,6 @@ export {
545
545
  De as a,
546
546
  Ie as b,
547
547
  je as c,
548
- Te as d,
548
+ Ae as d,
549
549
  Me as e
550
550
  };
@@ -1,14 +1,14 @@
1
1
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
2
- import { I as W } from "./ImageInput-MzY2W495.js";
3
- import { A as T } from "./AppSubTitle-CdIM6aXB.js";
4
- import { M as q } from "./MultiSelect-V-RantiK.js";
5
- import { aB as D, aE as J, aF as L, aG as Q, aC as A, aH as X, bF as Y, O as $ } from "./toggle-group-CKCJXGta.js";
2
+ import { I as W } from "./ImageInput-DOIglcpv.js";
3
+ import { A as T } from "./AppSubTitle-ClHzadQW.js";
4
+ import { M as q } from "./MultiSelect-B60y82TF.js";
5
+ import { ai as D, al as J, am as L, an as Q, aj as j, ao as X, bm as Y, E as $ } from "./toggle-group-DLLrEwv2.js";
6
6
  import "./alert-B9F1N9Qk.js";
7
7
  import "@radix-ui/react-aspect-ratio";
8
- import { B as M } from "./tooltip-DVeqVwqV.js";
8
+ import { B as A } from "./tooltip-DVeqVwqV.js";
9
9
  import { C as F, d as ee, a as te } from "./chart-DntJZGxB.js";
10
10
  import "@radix-ui/react-collapsible";
11
- import { I as C } from "./sheet-B_uq6-K_.js";
11
+ import { I as k } from "./sheet-C-QvdRNi.js";
12
12
  import "lucide-react";
13
13
  import "react-resizable-panels";
14
14
  import { c as i } from "./tailwind.helper-B6yFEsav.js";
@@ -17,7 +17,7 @@ import "next-themes";
17
17
  import "sonner";
18
18
  import { u as ce } from "./useToast-BFTk4lWz.js";
19
19
  import { zodResolver as oe } from "@hookform/resolvers/zod";
20
- import { useState as k } from "react";
20
+ import { useState as C } from "react";
21
21
  import { useForm as ue } from "react-hook-form";
22
22
  import { useTranslation as ie } from "react-i18next";
23
23
  import { z as b } from "zod";
@@ -25,15 +25,15 @@ const Be = ({
25
25
  schema: h,
26
26
  isLoading: S,
27
27
  error: N,
28
- onSubmit: P,
28
+ onSubmit: M,
29
29
  onCancel: f,
30
30
  initialData: y,
31
31
  disabled: x = !1,
32
- renderActions: j = !0,
32
+ renderActions: P = !0,
33
33
  onRegisterSubmit: K,
34
34
  defaultCols: z = 4
35
35
  }) => {
36
- const { t: u } = ie(), { toast: E } = ce(), [g, w] = k(!1), [de, I] = k({});
36
+ const { t: u } = ie(), { toast: E } = ce(), [g, w] = C(!1), [me, I] = C({});
37
37
  if (!h) return null;
38
38
  const B = (e) => {
39
39
  switch (e) {
@@ -74,13 +74,13 @@ const Be = ({
74
74
  }
75
75
  });
76
76
  }), b.object(e);
77
- })(), m = ue({
77
+ })(), d = ue({
78
78
  resolver: oe(O),
79
79
  defaultValues: y || Object.fromEntries(h.sections.flatMap((e) => e.fields.map((t) => [t.key, t.defaultValue ?? null])))
80
80
  });
81
- k(() => {
82
- K && K(() => void m.handleSubmit(V)());
83
- }), k(() => {
81
+ C(() => {
82
+ K && K(() => void d.handleSubmit(V)());
83
+ }), C(() => {
84
84
  if (y) {
85
85
  const e = {};
86
86
  h.sections.forEach((t) => {
@@ -92,7 +92,7 @@ const Be = ({
92
92
  });
93
93
  const V = async (e) => {
94
94
  if (g) return;
95
- if (Object.keys(m.formState.errors).length > 0) {
95
+ if (Object.keys(d.formState.errors).length > 0) {
96
96
  E({
97
97
  title: "Erreur de validation",
98
98
  description: "Veuillez vérifier les champs du formulaire",
@@ -102,7 +102,7 @@ const Be = ({
102
102
  }
103
103
  w(!0);
104
104
  try {
105
- await Promise.resolve(P(e));
105
+ await Promise.resolve(M(e));
106
106
  } catch (r) {
107
107
  console.error("Error during form submission:", r), E({
108
108
  title: "Erreur",
@@ -114,7 +114,7 @@ const Be = ({
114
114
  }
115
115
  }, R = (e, t) => {
116
116
  t && I((r) => ({ ...r, [e]: t }));
117
- }, G = (e) => {
117
+ }, Z = (e) => {
118
118
  if (!e) return !1;
119
119
  const t = (r) => {
120
120
  if (!r || !r._def) return !1;
@@ -127,18 +127,18 @@ const Be = ({
127
127
  } catch {
128
128
  return !1;
129
129
  }
130
- }, Z = (e) => {
130
+ }, _ = (e) => {
131
131
  var s;
132
132
  if (!e) return !1;
133
133
  const t = e(b);
134
134
  return t.safeParse(void 0).success ? !1 : ((s = t._def.checks) == null ? void 0 : s.some((n) => n.kind === "min")) ?? !1;
135
- }, _ = (e, t) => {
136
- const r = !!m.formState.errors[e.key], s = x;
135
+ }, G = (e, t) => {
136
+ const r = !!d.formState.errors[e.key], s = x;
137
137
  switch (e.type) {
138
138
  case "text":
139
139
  case "color":
140
140
  return /* @__PURE__ */ a(
141
- C,
141
+ k,
142
142
  {
143
143
  type: e.type,
144
144
  ...t,
@@ -172,7 +172,7 @@ const Be = ({
172
172
  }
173
173
  case "date":
174
174
  return /* @__PURE__ */ a(
175
- C,
175
+ k,
176
176
  {
177
177
  type: "date",
178
178
  ...t,
@@ -183,7 +183,7 @@ const Be = ({
183
183
  );
184
184
  case "time":
185
185
  return /* @__PURE__ */ a(
186
- C,
186
+ k,
187
187
  {
188
188
  type: "time",
189
189
  ...t,
@@ -222,7 +222,7 @@ const Be = ({
222
222
  case "number": {
223
223
  const n = e;
224
224
  return /* @__PURE__ */ a(
225
- C,
225
+ k,
226
226
  {
227
227
  type: "number",
228
228
  ...t,
@@ -240,14 +240,14 @@ const Be = ({
240
240
  );
241
241
  }
242
242
  case "select": {
243
- const n = e, c = G(e.rules), l = t.value === null || t.value === void 0 ? "" : t.value, p = n.options, v = p.find((d) => d.value === l);
243
+ const n = e, c = Z(e.rules), l = t.value === null || t.value === void 0 ? "" : t.value, p = n.options, v = p.find((m) => m.value === l);
244
244
  return /* @__PURE__ */ o(re, { value: l, onValueChange: t.onChange, disabled: s, children: [
245
- /* @__PURE__ */ a(A, { children: /* @__PURE__ */ a(
245
+ /* @__PURE__ */ a(j, { children: /* @__PURE__ */ a(
246
246
  ae,
247
247
  {
248
248
  className: i(r && "border-destructive"),
249
- onClear: c && l ? (d) => {
250
- d.preventDefault(), d.stopPropagation(), t.onChange(null);
249
+ onClear: c && l ? (m) => {
250
+ m.preventDefault(), m.stopPropagation(), t.onChange(null);
251
251
  } : void 0,
252
252
  children: /* @__PURE__ */ a(se, { placeholder: e.placeholderKey ? u(e.placeholderKey) : "", children: v ? /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
253
253
  v.color && /* @__PURE__ */ a("div", { className: "w-4 h-4 rounded-full", style: { backgroundColor: v.color } }),
@@ -255,10 +255,10 @@ const Be = ({
255
255
  ] }) : void 0 })
256
256
  }
257
257
  ) }),
258
- /* @__PURE__ */ a(ne, { children: p.map((d, U) => /* @__PURE__ */ a(le, { value: d.value, children: /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
259
- d.color && /* @__PURE__ */ a("div", { className: "w-4 h-4 rounded-full", style: { backgroundColor: d.color } }),
260
- d.label
261
- ] }) }, U)) })
258
+ /* @__PURE__ */ a(ne, { children: p.map((m, H) => /* @__PURE__ */ a(le, { value: m.value, children: /* @__PURE__ */ o("div", { className: "flex items-center gap-2", children: [
259
+ m.color && /* @__PURE__ */ a("div", { className: "w-4 h-4 rounded-full", style: { backgroundColor: m.color } }),
260
+ m.label
261
+ ] }) }, H)) })
262
262
  ] });
263
263
  }
264
264
  case "multiSelect": {
@@ -284,24 +284,24 @@ const Be = ({
284
284
  );
285
285
  }
286
286
  case "html":
287
- return e.render(m.getValues(), e);
287
+ return e.render(d.getValues(), e);
288
288
  default:
289
289
  return null;
290
290
  }
291
- }, H = (e, t) => {
291
+ }, U = (e, t) => {
292
292
  const r = /* @__PURE__ */ a("div", { className: i("grid grid-cols-4 gap-4"), children: e.fields.map((s) => /* @__PURE__ */ a(
293
293
  J,
294
294
  {
295
- control: m.control,
295
+ control: d.control,
296
296
  name: s.key,
297
297
  render: ({ field: n }) => {
298
298
  var c;
299
299
  return /* @__PURE__ */ o(L, { className: i(B(((c = s.layout) == null ? void 0 : c.cols) ?? z)), children: [
300
300
  s.type !== "checkbox" && s.type !== "html" && /* @__PURE__ */ o(Q, { children: [
301
301
  u(s.labelKey),
302
- Z(s.rules) && /* @__PURE__ */ a("span", { className: "text-destructive ml-1", children: "*" })
302
+ _(s.rules) && /* @__PURE__ */ a("span", { className: "text-destructive ml-1", children: "*" })
303
303
  ] }),
304
- /* @__PURE__ */ a(A, { children: _(s, n) }),
304
+ /* @__PURE__ */ a(j, { children: G(s, n) }),
305
305
  /* @__PURE__ */ a(X, {})
306
306
  ] });
307
307
  }
@@ -316,21 +316,21 @@ const Be = ({
316
316
  /* @__PURE__ */ a(te, { children: r })
317
317
  ] }, t);
318
318
  };
319
- return /* @__PURE__ */ a(D, { ...m, children: /* @__PURE__ */ o(
319
+ return /* @__PURE__ */ a(D, { ...d, children: /* @__PURE__ */ o(
320
320
  "form",
321
321
  {
322
322
  onSubmit: (e) => {
323
- m.handleSubmit(V)(e);
323
+ d.handleSubmit(V)(e);
324
324
  },
325
325
  className: "space-y-4 px-0 w-full",
326
326
  children: [
327
327
  /* @__PURE__ */ o("div", { className: "space-y-4", children: [
328
- h.sections.map((e, t) => H(e, t)),
328
+ h.sections.map((e, t) => U(e, t)),
329
329
  N && /* @__PURE__ */ a("div", { className: "text-sm font-medium text-destructive", children: N.message })
330
330
  ] }),
331
- !x && j && /* @__PURE__ */ o("div", { className: "flex justify-end gap-3 mt-6 border-t pt-4", children: [
332
- f && /* @__PURE__ */ a(M, { type: "button", variant: "outline", onClick: f, disabled: g || S, children: u("Annuler", "Annuler") }),
333
- /* @__PURE__ */ a(M, { variant: "default", type: "submit", disabled: g || (S ?? !1) || m.formState.isSubmitting, children: g || S ? u("Enregistrement...", "Enregistrement...") : u("Enregistrer", "Enregistrer") })
331
+ !x && P && /* @__PURE__ */ o("div", { className: "flex justify-end gap-3 mt-6 border-t pt-4", children: [
332
+ f && /* @__PURE__ */ a(A, { type: "button", variant: "outline", onClick: f, disabled: g || S, children: u("Annuler", "Annuler") }),
333
+ /* @__PURE__ */ a(A, { variant: "default", type: "submit", disabled: g || (S ?? !1) || d.formState.isSubmitting, children: g || S ? u("Enregistrement...", "Enregistrement...") : u("Enregistrer", "Enregistrer") })
334
334
  ] })
335
335
  ]
336
336
  }
@@ -1,11 +1,11 @@
1
1
  import { jsx as e, jsxs as o } from "react/jsx-runtime";
2
- import "./toggle-group-CKCJXGta.js";
2
+ import "./toggle-group-DLLrEwv2.js";
3
3
  import "./alert-B9F1N9Qk.js";
4
4
  import "@radix-ui/react-aspect-ratio";
5
5
  import { B as x } from "./tooltip-DVeqVwqV.js";
6
6
  import "./chart-DntJZGxB.js";
7
7
  import "@radix-ui/react-collapsible";
8
- import "./sheet-B_uq6-K_.js";
8
+ import "./sheet-C-QvdRNi.js";
9
9
  import { XIcon as N, ImageIcon as v, UploadIcon as w } from "lucide-react";
10
10
  import "react-resizable-panels";
11
11
  import { c as u } from "./tailwind.helper-B6yFEsav.js";
@@ -1,11 +1,11 @@
1
1
  import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
- import "./toggle-group-CKCJXGta.js";
2
+ import "./toggle-group-DLLrEwv2.js";
3
3
  import "./alert-B9F1N9Qk.js";
4
4
  import "@radix-ui/react-aspect-ratio";
5
5
  import { B as c } from "./tooltip-DVeqVwqV.js";
6
6
  import "./chart-DntJZGxB.js";
7
7
  import "@radix-ui/react-collapsible";
8
- import "./sheet-B_uq6-K_.js";
8
+ import "./sheet-C-QvdRNi.js";
9
9
  import { ArrowLeftIcon as l } from "lucide-react";
10
10
  import "react-resizable-panels";
11
11
  import "clsx";
@@ -14,12 +14,12 @@ import "./select-BpjFWqAY.js";
14
14
  import "next-themes";
15
15
  import "sonner";
16
16
  import "react";
17
- import { A as f } from "./AppActions-DeBcK3cv.js";
17
+ import { A as f } from "./AppActions-ViFjSupi.js";
18
18
  import { A as d } from "./AppTitle-D15YXeMx.js";
19
19
  import { u } from "./useDocumentTitle-WNwdPz-I.js";
20
20
  import { useTranslation as g } from "react-i18next";
21
21
  import "@krosoft/core/helpers";
22
- import { b as h, a as x } from "./SkeletonCards-CyP7ZysR.js";
22
+ import { b as h, a as x } from "./SkeletonCards-63vDljXy.js";
23
23
  import { E as A } from "./ErrorState-CmaxuJyW.js";
24
24
  function O({
25
25
  icon: t,