@krosoft/react 0.0.80 → 0.0.82

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 (50) hide show
  1. package/dist/AppTitle-BOhhDNS5.js +76 -0
  2. package/dist/{MetricCard-4VI9Ki0g.js → MetricCard-bpuqueI5.js} +1 -1
  3. package/dist/{SearchInput-Cf5NHhnz.js → SearchInput-Dh-92XhU.js} +7 -7
  4. package/dist/{TableFilter-DgChe4aX.js → TableFilter-BoNsBNbv.js} +2 -2
  5. package/dist/TableSettings-D2qjh0E9.js +394 -0
  6. package/dist/{ThemeSelector-MqD5QvHl.js → ThemeSelector-BCU1tFyR.js} +1 -1
  7. package/dist/components/core/cards/index.js +1 -1
  8. package/dist/components/core/filters/index.js +1 -1
  9. package/dist/components/core/index.d.ts +1 -0
  10. package/dist/components/core/index.d.ts.map +1 -1
  11. package/dist/components/core/index.js +32 -29
  12. package/dist/components/core/inputs/index.js +1 -1
  13. package/dist/components/core/layouts/AppActions.d.ts +7 -0
  14. package/dist/components/core/layouts/AppActions.d.ts.map +1 -0
  15. package/dist/components/core/layouts/AppTitle.d.ts +7 -0
  16. package/dist/components/core/layouts/AppTitle.d.ts.map +1 -0
  17. package/dist/components/core/layouts/index.d.ts +3 -0
  18. package/dist/components/core/layouts/index.d.ts.map +1 -0
  19. package/dist/components/core/layouts/index.js +5 -0
  20. package/dist/components/core/table/index.js +1 -1
  21. package/dist/components/core/tabs/AppTabContainer.d.ts +12 -0
  22. package/dist/components/core/tabs/AppTabContainer.d.ts.map +1 -0
  23. package/dist/components/core/tabs/AppTabHeader.d.ts +9 -0
  24. package/dist/components/core/tabs/AppTabHeader.d.ts.map +1 -0
  25. package/dist/components/core/tabs/AppTabs.d.ts +9 -0
  26. package/dist/components/core/tabs/AppTabs.d.ts.map +1 -0
  27. package/dist/components/core/tabs/AppVerticalTabs.d.ts +7 -0
  28. package/dist/components/core/tabs/AppVerticalTabs.d.ts.map +1 -0
  29. package/dist/components/core/theme/index.js +1 -1
  30. package/dist/components/index.js +81 -78
  31. package/dist/components/ui/index.js +1 -1
  32. package/dist/components/ui/scroll-area.d.ts +6 -0
  33. package/dist/components/ui/scroll-area.d.ts.map +1 -0
  34. package/dist/components/ui/tabs.d.ts +8 -0
  35. package/dist/components/ui/tabs.d.ts.map +1 -0
  36. package/dist/dropdown-menu-D6j1GdTA.js +1685 -0
  37. package/dist/hooks/index.js +7 -19
  38. package/dist/{popover-UjRQmYGN.js → popover-DVVl_ccN.js} +7 -7
  39. package/dist/types/AppAction.d.ts +19 -0
  40. package/dist/types/AppAction.d.ts.map +1 -0
  41. package/dist/types/ButtonVariantType.d.ts +2 -0
  42. package/dist/types/ButtonVariantType.d.ts.map +1 -0
  43. package/dist/types/TabConfig.d.ts +9 -0
  44. package/dist/types/TabConfig.d.ts.map +1 -0
  45. package/dist/types/index.d.ts +1 -0
  46. package/dist/types/index.d.ts.map +1 -1
  47. package/dist/useMobile-DN1_OMDB.js +16 -0
  48. package/dist/{useTheme-DsHPKCDp.js → useTheme-CvNYmhjo.js} +2 -2
  49. package/package.json +12 -4
  50. package/dist/TableSettings-4YLJSh4G.js +0 -2064
@@ -0,0 +1,76 @@
1
+ import { jsxs as n, jsx as l } from "react/jsx-runtime";
2
+ import "./popover-DVVl_ccN.js";
3
+ import { B as u } from "./floating-ui.react-dom-BIcsGc3t.js";
4
+ import "./card-7XPLAra3.js";
5
+ import { c as d } from "./index-gWiv5-6R.js";
6
+ import "./select-CtU681LB.js";
7
+ import { D as c, a as b, E as h, b as f, c as x, d as p } from "./dropdown-menu-D6j1GdTA.js";
8
+ import { u as v } from "./useMobile-DN1_OMDB.js";
9
+ import { useTranslation as N } from "react-i18next";
10
+ function B({ actions: m, className: o }) {
11
+ const { t: i } = N(), t = v();
12
+ return !m || m.length === 0 ? null : t ? /* @__PURE__ */ n(c, { children: [
13
+ /* @__PURE__ */ l(b, { asChild: !0, children: /* @__PURE__ */ l(u, { variant: "outline", size: "icon", children: /* @__PURE__ */ l(h, { className: "size-4" }) }) }),
14
+ /* @__PURE__ */ l(f, { align: "end", className: "min-w-48", children: m.map((r, e) => r ? r.children && r.children.length > 0 ? /* @__PURE__ */ n("div", { children: [
15
+ e > 0 && /* @__PURE__ */ l(x, {}),
16
+ r.children.map((s, a) => s ? /* @__PURE__ */ n(
17
+ p,
18
+ {
19
+ onClick: () => void s.onClick(),
20
+ disabled: s.disabled,
21
+ className: d("gap-2", s.className),
22
+ children: [
23
+ s.icon && /* @__PURE__ */ l(s.icon, { className: "size-4" }),
24
+ s.labelKey && i(s.labelKey)
25
+ ]
26
+ },
27
+ a
28
+ ) : null)
29
+ ] }, e) : /* @__PURE__ */ n(p, { onClick: () => void r.onClick(), disabled: r.disabled, className: d("gap-2", r.className), children: [
30
+ r.icon && /* @__PURE__ */ l(r.icon, { className: "size-4" }),
31
+ r.labelKey && i(r.labelKey)
32
+ ] }, e) : null) })
33
+ ] }) : ((r) => /* @__PURE__ */ l("div", { className: d("flex gap-2", o), children: r.map((e, s) => e ? e.children && e.children.length > 0 ? /* @__PURE__ */ n(c, { children: [
34
+ /* @__PURE__ */ l(b, { asChild: !0, children: /* @__PURE__ */ n(u, { variant: e.variant, disabled: e.disabled, className: d("gap-2", e.className), children: [
35
+ e.icon && /* @__PURE__ */ l(e.icon, { className: "size-4" }),
36
+ e.labelKey && i(e.labelKey)
37
+ ] }) }),
38
+ /* @__PURE__ */ l(f, { align: "end", children: e.children.map((a, g) => a ? /* @__PURE__ */ n(
39
+ p,
40
+ {
41
+ onClick: () => void a.onClick(),
42
+ disabled: a.disabled,
43
+ className: d("gap-2", a.className),
44
+ children: [
45
+ a.icon && /* @__PURE__ */ l(a.icon, { className: "size-4" }),
46
+ a.labelKey && i(a.labelKey)
47
+ ]
48
+ },
49
+ g
50
+ ) : null) })
51
+ ] }, s) : /* @__PURE__ */ n(
52
+ u,
53
+ {
54
+ variant: e.variant,
55
+ onClick: () => void e.onClick(),
56
+ disabled: e.disabled,
57
+ className: d("gap-2", e.className),
58
+ children: [
59
+ e.icon && /* @__PURE__ */ l(e.icon, { className: "size-4" }),
60
+ e.labelKey && i(e.labelKey)
61
+ ]
62
+ },
63
+ s
64
+ ) : null) }))(m);
65
+ }
66
+ function E({ titleKey: m, descriptionKey: o, isSubTitle: i }) {
67
+ const { t } = N();
68
+ return /* @__PURE__ */ n("div", { className: "flex flex-col gap-1", children: [
69
+ /* @__PURE__ */ l("h1", { className: i ? "text-xl md:text-2xl font-semibold" : "text-xl md:text-3xl font-bold", children: t(m) ?? "" }),
70
+ o ? /* @__PURE__ */ l("p", { className: d("text-muted-foreground", i && "text-sm"), children: t(o) }) : null
71
+ ] });
72
+ }
73
+ export {
74
+ B as A,
75
+ E as a
76
+ };
@@ -2,7 +2,7 @@ import { jsxs as s, jsx as e } from "react/jsx-runtime";
2
2
  import { formatNumber as h } from "@krosoft/core/helpers";
3
3
  import { useTranslation as b } from "react-i18next";
4
4
  import { c as d } from "./index-gWiv5-6R.js";
5
- import "./popover-UjRQmYGN.js";
5
+ import "./popover-DVVl_ccN.js";
6
6
  import "./floating-ui.react-dom-BIcsGc3t.js";
7
7
  import { C as x, d as N, e as g, a as f } from "./card-7XPLAra3.js";
8
8
  import "./select-CtU681LB.js";
@@ -1,7 +1,7 @@
1
1
  import { jsxs as d, jsx as n } from "react/jsx-runtime";
2
2
  import * as L from "react";
3
- import { useState as P, useRef as j, useEffect as T, useMemo as z } from "react";
4
- import { u as D, v as C, w as k, x as q, y as S, C as R, P as X, e as _, X as E, d as V, c as O, I } from "./popover-UjRQmYGN.js";
3
+ import { useState as P, useRef as j, useEffect as T, useMemo as W } from "react";
4
+ import { w as D, x as C, y as k, z as q, B as z, C as R, P as X, e as _, X as E, d as V, c as O, I } from "./popover-DVVl_ccN.js";
5
5
  import { B as b, C as A } from "./floating-ui.react-dom-BIcsGc3t.js";
6
6
  import "./card-7XPLAra3.js";
7
7
  import { c as y } from "./index-gWiv5-6R.js";
@@ -349,7 +349,7 @@ const $ = [
349
349
  parsePatterns: Me,
350
350
  defaultParseWidth: "any"
351
351
  })
352
- }, W = {
352
+ }, S = {
353
353
  code: "fr",
354
354
  formatDistance: K,
355
355
  formatLong: ee,
@@ -390,7 +390,7 @@ const $ = [
390
390
  ),
391
391
  children: [
392
392
  /* @__PURE__ */ n(H, { className: "mr-2 h-4 w-4 shrink-0" }),
393
- e !== void 0 ? S(e, "dd/MM/yyyy", { locale: W }) : /* @__PURE__ */ n("span", { children: s })
393
+ e !== void 0 ? z(e, "dd/MM/yyyy", { locale: S }) : /* @__PURE__ */ n("span", { children: s })
394
394
  ]
395
395
  }
396
396
  ),
@@ -409,7 +409,7 @@ const $ = [
409
409
  c(e), l(!1);
410
410
  }, x = () => {
411
411
  c(void 0);
412
- }, w = (h) => h != null && h.from ? !h.to || h.from.getTime() === h.to.getTime() ? S(h.from, "dd MMM yyyy", { locale: W }) : `${S(h.from, "dd MMM yyyy", { locale: W })} - ${S(h.to, "dd MMM yyyy", { locale: W })}` : s;
412
+ }, w = (h) => h != null && h.from ? !h.to || h.from.getTime() === h.to.getTime() ? z(h.from, "dd MMM yyyy", { locale: S }) : `${z(h.from, "dd MMM yyyy", { locale: S })} - ${z(h.to, "dd MMM yyyy", { locale: S })}` : s;
413
413
  return /* @__PURE__ */ n("div", { className: y("grid gap-2", r), children: /* @__PURE__ */ d(X, { open: i, onOpenChange: l, children: [
414
414
  /* @__PURE__ */ n(_, { asChild: !0, children: /* @__PURE__ */ d(b, { id: "date", variant: "outline", className: y("w-[300px] justify-start text-left font-normal", !(e != null && e.from) && "text-muted-foreground"), children: [
415
415
  /* @__PURE__ */ n(H, { className: "mr-2 size-4" }),
@@ -459,7 +459,7 @@ const $ = [
459
459
  searchable: m = !1,
460
460
  searchPlaceholder: c = "Rechercher..."
461
461
  }) => {
462
- const [u, f] = P(""), [p, x] = P(!1), w = j(null), h = j(null), g = z(() => u === "" ? e : e.filter((a) => a.label.toLowerCase().includes(u.toLowerCase())), [e, u]), o = z(() => g.length === 0 ? !1 : g.every((a) => t.includes(a.value)), [g, t]);
462
+ const [u, f] = P(""), [p, x] = P(!1), w = j(null), h = j(null), g = W(() => u === "" ? e : e.filter((a) => a.label.toLowerCase().includes(u.toLowerCase())), [e, u]), o = W(() => g.length === 0 ? !1 : g.every((a) => t.includes(a.value)), [g, t]);
463
463
  T(() => {
464
464
  p && m && requestAnimationFrame(() => {
465
465
  var a;
@@ -576,7 +576,7 @@ const $ = [
576
576
  placeholder: r = "Sélectionner...",
577
577
  searchPlaceholder: i = "Rechercher..."
578
578
  }) => {
579
- const [l, m] = P(""), [c, u] = P(!1), f = j(null), p = j(null), x = z(() => l === "" ? e : e.filter((o) => o.label.toLowerCase().includes(l.toLowerCase())), [e, l]), w = z(() => {
579
+ const [l, m] = P(""), [c, u] = P(!1), f = j(null), p = j(null), x = W(() => l === "" ? e : e.filter((o) => o.label.toLowerCase().includes(l.toLowerCase())), [e, l]), w = W(() => {
580
580
  var o;
581
581
  if (!(t === void 0 || t === ""))
582
582
  return ((o = e.find((M) => M.value === t)) == null ? void 0 : o.label) ?? t;
@@ -1,7 +1,7 @@
1
1
  import { jsxs as m, jsx as r } from "react/jsx-runtime";
2
2
  import { useState as k, useEffect as M, useMemo as A } from "react";
3
- import { M as O, a as $, D as j, b as I, c as _, S as z } from "./SearchInput-Cf5NHhnz.js";
4
- import { X as C, I as P, S as R, n as B, g as Q, j as V, m as H, L as X, i as G, P as J, e as K, d as U, c as E } from "./popover-UjRQmYGN.js";
3
+ import { M as O, a as $, D as j, b as I, c as _, S as z } from "./SearchInput-Dh-92XhU.js";
4
+ import { X as C, I as P, S as R, n as B, g as Q, j as V, m as H, L as X, i as G, P as J, e as K, d as U, c as E } from "./popover-DVVl_ccN.js";
5
5
  import { B as w, C as W } from "./floating-ui.react-dom-BIcsGc3t.js";
6
6
  import "./card-7XPLAra3.js";
7
7
  import { S as Y, h as Z, i as q, a as ee, c as re } from "./select-CtU681LB.js";
@@ -0,0 +1,394 @@
1
+ import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
+ import { c as j, u as A, v as L } from "./popover-DVVl_ccN.js";
3
+ import { B as x } from "./floating-ui.react-dom-BIcsGc3t.js";
4
+ import "./card-7XPLAra3.js";
5
+ import "./select-CtU681LB.js";
6
+ import { D as M, a as D, E as B, b as _, d as I, e as V } from "./dropdown-menu-D6j1GdTA.js";
7
+ import { L as q } from "./loader-circle-BhJXKs31.js";
8
+ import { c as f } from "./createLucideIcon-CRdjzt2A.js";
9
+ /**
10
+ * @license lucide-react v1.16.0 - ISC
11
+ *
12
+ * This source code is licensed under the ISC license.
13
+ * See the LICENSE file in the root directory of this source tree.
14
+ */
15
+ const E = [
16
+ ["path", { d: "M12 5v14", key: "s699le" }],
17
+ ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
18
+ ], H = f("arrow-down", E);
19
+ /**
20
+ * @license lucide-react v1.16.0 - ISC
21
+ *
22
+ * This source code is licensed under the ISC license.
23
+ * See the LICENSE file in the root directory of this source tree.
24
+ */
25
+ const U = [
26
+ ["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
27
+ ["path", { d: "M17 20V4", key: "1ejh1v" }],
28
+ ["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
29
+ ["path", { d: "M7 4v16", key: "1glfcx" }]
30
+ ], G = f("arrow-up-down", U);
31
+ /**
32
+ * @license lucide-react v1.16.0 - ISC
33
+ *
34
+ * This source code is licensed under the ISC license.
35
+ * See the LICENSE file in the root directory of this source tree.
36
+ */
37
+ const O = [
38
+ ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
39
+ ["path", { d: "M12 19V5", key: "x0mq9r" }]
40
+ ], F = f("arrow-up", O);
41
+ /**
42
+ * @license lucide-react v1.16.0 - ISC
43
+ *
44
+ * This source code is licensed under the ISC license.
45
+ * See the LICENSE file in the root directory of this source tree.
46
+ */
47
+ const J = [
48
+ ["circle", { cx: "9", cy: "12", r: "1", key: "1vctgf" }],
49
+ ["circle", { cx: "9", cy: "5", r: "1", key: "hp0tcf" }],
50
+ ["circle", { cx: "9", cy: "19", r: "1", key: "fkjjf6" }],
51
+ ["circle", { cx: "15", cy: "12", r: "1", key: "1tmaij" }],
52
+ ["circle", { cx: "15", cy: "5", r: "1", key: "19l28e" }],
53
+ ["circle", { cx: "15", cy: "19", r: "1", key: "f4zoj3" }]
54
+ ], Q = f("grip-vertical", J);
55
+ /**
56
+ * @license lucide-react v1.16.0 - ISC
57
+ *
58
+ * This source code is licensed under the ISC license.
59
+ * See the LICENSE file in the root directory of this source tree.
60
+ */
61
+ const W = [
62
+ [
63
+ "path",
64
+ {
65
+ d: "M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",
66
+ key: "1i5ecw"
67
+ }
68
+ ],
69
+ ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
70
+ ], X = f("settings", W);
71
+ function Y({ actions: c, row: n }) {
72
+ return /* @__PURE__ */ t(M, { children: [
73
+ /* @__PURE__ */ e(D, { asChild: !0, children: /* @__PURE__ */ e(x, { variant: "ghost", size: "icon", className: "h-8 w-8 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ e(B, { className: "size-4" }) }) }),
74
+ /* @__PURE__ */ e(
75
+ _,
76
+ {
77
+ align: "end",
78
+ onClick: (s) => {
79
+ s.stopPropagation();
80
+ },
81
+ children: c.map((s, a) => {
82
+ const o = s.icon;
83
+ return /* @__PURE__ */ t(
84
+ I,
85
+ {
86
+ onClick: () => {
87
+ s.onClick(n);
88
+ },
89
+ className: s.className,
90
+ children: [
91
+ o !== void 0 && /* @__PURE__ */ e("span", { className: "mr-2 size-4 flex items-center justify-center", children: /* @__PURE__ */ e(o, { className: "size-4" }) }),
92
+ s.label
93
+ ]
94
+ },
95
+ a
96
+ );
97
+ })
98
+ }
99
+ )
100
+ ] });
101
+ }
102
+ function se({
103
+ isLoading: c,
104
+ colSpanCount: n,
105
+ noDataMessage: s,
106
+ paginatedData: a,
107
+ getRowId: o,
108
+ onRowClick: l,
109
+ hasBulkActions: u,
110
+ selectedRows: v,
111
+ toggleRowSelection: g,
112
+ visibleColumnsArray: i,
113
+ columnWidths: k,
114
+ hasActions: N,
115
+ actions: b,
116
+ columns: w
117
+ }) {
118
+ const C = (h, m) => {
119
+ const d = w.find((r) => r.key === m);
120
+ if ((d == null ? void 0 : d.renderCell) !== void 0)
121
+ return d.renderCell(h);
122
+ const y = h[m];
123
+ return /* @__PURE__ */ e("span", { className: "text-sm truncate", children: y != null ? String(y) : "-" });
124
+ };
125
+ return c ? /* @__PURE__ */ e("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-800", children: /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: n, className: "py-8 text-center", children: /* @__PURE__ */ t("div", { className: "flex flex-col items-center justify-center gap-2 text-muted-foreground", children: [
126
+ /* @__PURE__ */ e(q, { className: "h-6 w-6 animate-spin text-primary" }),
127
+ /* @__PURE__ */ e("span", { className: "text-sm", children: "Chargement..." })
128
+ ] }) }) }) }) : a.length === 0 ? /* @__PURE__ */ e("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-800", children: /* @__PURE__ */ e("tr", { children: /* @__PURE__ */ e("td", { colSpan: n, className: "py-8 text-center text-sm text-muted-foreground", children: s }) }) }) : /* @__PURE__ */ e("tbody", { className: "divide-y divide-gray-200 dark:divide-gray-800", children: a.map((h) => {
129
+ const m = o(h);
130
+ return /* @__PURE__ */ t(
131
+ "tr",
132
+ {
133
+ className: `group hover:bg-muted/50 dark:hover:bg-gray-900/50 transition-colors ${l !== void 0 ? "cursor-pointer" : ""}`,
134
+ onClick: () => l == null ? void 0 : l(h),
135
+ children: [
136
+ u ? /* @__PURE__ */ e(
137
+ "td",
138
+ {
139
+ className: "px-4 py-2 w-12",
140
+ onClick: (d) => {
141
+ d.stopPropagation();
142
+ },
143
+ children: /* @__PURE__ */ e(
144
+ j,
145
+ {
146
+ checked: v.includes(m),
147
+ onCheckedChange: () => {
148
+ g(m);
149
+ }
150
+ }
151
+ )
152
+ }
153
+ ) : null,
154
+ i.map((d, y) => {
155
+ const r = y === i.length - 1;
156
+ return /* @__PURE__ */ e(
157
+ "td",
158
+ {
159
+ className: `px-2 py-2 border-r border-gray-100 dark:border-gray-800 relative ${r ? "border-r-0" : ""}`,
160
+ style: { width: k[d.key] },
161
+ children: /* @__PURE__ */ e("div", { className: "w-full h-full", children: C(h, d.key) })
162
+ },
163
+ d.key
164
+ );
165
+ }),
166
+ N && b !== void 0 && b.length > 0 ? /* @__PURE__ */ e(
167
+ "td",
168
+ {
169
+ className: "px-2 py-2 w-12 text-end",
170
+ onClick: (d) => {
171
+ d.stopPropagation();
172
+ },
173
+ children: /* @__PURE__ */ e(Y, { actions: b, row: h })
174
+ }
175
+ ) : null
176
+ ]
177
+ },
178
+ m
179
+ );
180
+ }) });
181
+ }
182
+ function ne({ selectedRows: c, setSelectedRows: n, bulkActions: s }) {
183
+ return /* @__PURE__ */ t("div", { className: "bg-muted/60 dark:bg-gray-900/60 border border-border px-3 py-1.5 flex items-center justify-between rounded-lg", children: [
184
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-4", children: [
185
+ /* @__PURE__ */ t("span", { className: "text-sm font-medium text-primary ml-1", children: [
186
+ c.length,
187
+ " sélectionné(s)"
188
+ ] }),
189
+ /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s.map((a, o) => {
190
+ const l = a.icon;
191
+ return /* @__PURE__ */ t(
192
+ x,
193
+ {
194
+ variant: "outline",
195
+ size: "sm",
196
+ onClick: () => {
197
+ a.onClick(c, () => {
198
+ n([]);
199
+ });
200
+ },
201
+ className: `h-7 bg-background shadow-sm text-xs px-2.5 ${a.variant === "destructive" ? "text-destructive border-destructive/30 hover:bg-destructive/10 hover:text-destructive" : "text-foreground"}`,
202
+ children: [
203
+ l !== void 0 && /* @__PURE__ */ e("span", { className: "mr-1.5 flex items-center justify-center", children: /* @__PURE__ */ e(l, { className: "h-3.5 w-3.5" }) }),
204
+ a.label
205
+ ]
206
+ },
207
+ o
208
+ );
209
+ }) })
210
+ ] }),
211
+ /* @__PURE__ */ e(
212
+ x,
213
+ {
214
+ variant: "ghost",
215
+ size: "sm",
216
+ onClick: () => {
217
+ n([]);
218
+ },
219
+ className: "text-xs text-muted-foreground hover:text-foreground h-7 px-2",
220
+ children: "Désélectionner"
221
+ }
222
+ )
223
+ ] });
224
+ }
225
+ function ie({
226
+ hasBulkActions: c,
227
+ selectedRows: n,
228
+ totalItems: s,
229
+ toggleSelectAll: a,
230
+ visibleColumnsArray: o,
231
+ draggableColumns: l,
232
+ resizableColumns: u,
233
+ columnWidths: v,
234
+ sortColumn: g,
235
+ sortDirection: i,
236
+ handleSort: k,
237
+ handleDragStart: N,
238
+ handleDragOver: b,
239
+ handleDrop: w,
240
+ handleMouseDown: C,
241
+ hasActions: h,
242
+ settingsNode: m
243
+ }) {
244
+ const d = (r) => r.sortable !== !0 ? null : g === r.key ? i === "asc" ? /* @__PURE__ */ e(F, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ e(H, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ e(G, { className: "size-3.5 text-muted-foreground/50 group-hover:text-muted-foreground transition-colors" }), y = (r, S) => {
245
+ const z = S !== !1, $ = r.sortable === !0, T = g === r.key;
246
+ return /* @__PURE__ */ t(
247
+ "th",
248
+ {
249
+ className: [
250
+ "px-2 py-2 text-left text-sm font-medium text-gray-900 dark:text-gray-100 relative group border-r border-gray-200 dark:border-gray-800",
251
+ $ ? "cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800 select-none" : "",
252
+ T ? "bg-gray-100/80 dark:bg-gray-800/80" : ""
253
+ ].filter(Boolean).join(" "),
254
+ style: { width: v[r.key] },
255
+ draggable: z,
256
+ onClick: () => {
257
+ k(r.key);
258
+ },
259
+ onDragStart: (p) => {
260
+ z ? N(p, r.key) : p.preventDefault();
261
+ },
262
+ onDragOver: (p) => {
263
+ b(p, r.key);
264
+ },
265
+ onDrop: (p) => {
266
+ w(p, r.key);
267
+ },
268
+ children: [
269
+ /* @__PURE__ */ t("div", { className: "flex items-center justify-between pr-2", children: [
270
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: [
271
+ z ? /* @__PURE__ */ e(Q, { className: "size-4 text-gray-400 cursor-grab dark:text-gray-300 shrink-0" }) : null,
272
+ /* @__PURE__ */ e("span", { className: "truncate", children: r.label })
273
+ ] }),
274
+ /* @__PURE__ */ e("div", { className: "ml-1 shrink-0", children: d(r) })
275
+ ] }),
276
+ u ? /* @__PURE__ */ e(
277
+ "div",
278
+ {
279
+ className: "absolute right-0 top-0 bottom-0 w-2 cursor-col-resize hover:bg-blue-500 opacity-0 group-hover:opacity-50 transition-opacity",
280
+ onMouseDown: (p) => {
281
+ C(p, r.key);
282
+ }
283
+ }
284
+ ) : null
285
+ ]
286
+ },
287
+ r.key
288
+ );
289
+ };
290
+ return /* @__PURE__ */ e("thead", { className: "bg-muted/50 dark:bg-gray-900/50 border-b border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ t("tr", { children: [
291
+ c ? /* @__PURE__ */ e("th", { className: "px-4 py-2 w-12 flex-shrink-0 text-left", children: /* @__PURE__ */ e(
292
+ j,
293
+ {
294
+ checked: n.length === s && s > 0 ? !0 : n.length > 0 ? "indeterminate" : !1,
295
+ onCheckedChange: a
296
+ }
297
+ ) }) : null,
298
+ o.map((r) => y(r, l)),
299
+ h || m !== void 0 ? /* @__PURE__ */ e("th", { className: "w-12 px-2 py-2 text-center align-middle", children: m }) : null
300
+ ] }) });
301
+ }
302
+ function de({
303
+ totalItems: c,
304
+ startIndex: n,
305
+ endIndex: s,
306
+ pageSize: a,
307
+ setPageSize: o,
308
+ currentPage: l,
309
+ setCurrentPage: u,
310
+ pageSizeOptions: v,
311
+ totalPages: g
312
+ }) {
313
+ return /* @__PURE__ */ t("div", { className: "px-4 py-2 border-t border-border flex items-center justify-between bg-card flex-wrap gap-2", children: [
314
+ /* @__PURE__ */ t("div", { className: "text-sm text-muted-foreground", children: [
315
+ c === 0 ? "0" : `${String(n + 1)} - ${String(s)}`,
316
+ " sur ",
317
+ c
318
+ ] }),
319
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-4", children: [
320
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
321
+ /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Lignes par page :" }),
322
+ /* @__PURE__ */ e(
323
+ "select",
324
+ {
325
+ value: a,
326
+ onChange: (i) => {
327
+ o(Number(i.target.value)), u(1);
328
+ },
329
+ className: "border border-input bg-background rounded px-2 py-1 text-sm text-foreground",
330
+ children: v.map((i) => /* @__PURE__ */ e("option", { value: i, children: i }, i))
331
+ }
332
+ )
333
+ ] }),
334
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
335
+ /* @__PURE__ */ e(
336
+ x,
337
+ {
338
+ variant: "outline",
339
+ size: "sm",
340
+ className: "h-8 w-8 p-0",
341
+ onClick: () => {
342
+ u((i) => Math.max(1, i - 1));
343
+ },
344
+ disabled: l === 1,
345
+ children: /* @__PURE__ */ e(A, { className: "size-4" })
346
+ }
347
+ ),
348
+ /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: [
349
+ "Page ",
350
+ l,
351
+ " sur ",
352
+ g
353
+ ] }),
354
+ /* @__PURE__ */ e(
355
+ x,
356
+ {
357
+ variant: "outline",
358
+ size: "sm",
359
+ className: "h-8 w-8 p-0",
360
+ onClick: () => {
361
+ u((i) => Math.min(g, i + 1));
362
+ },
363
+ disabled: l === g,
364
+ children: /* @__PURE__ */ e(L, { className: "size-4" })
365
+ }
366
+ )
367
+ ] })
368
+ ] })
369
+ ] });
370
+ }
371
+ function ce({ columns: c, visibleColumns: n, toggleColumnVisibility: s }) {
372
+ return /* @__PURE__ */ t(M, { children: [
373
+ /* @__PURE__ */ e(D, { asChild: !0, children: /* @__PURE__ */ e(x, { variant: "outline", size: "sm", className: "size-8 p-0 bg-white hover:bg-gray-100 dark:bg-gray-900 shadow-sm border-gray-200 dark:border-gray-800", children: /* @__PURE__ */ e(X, { className: "size-4 text-gray-600 dark:text-gray-300" }) }) }),
374
+ /* @__PURE__ */ e(_, { align: "end", className: "w-56", children: c.map((a) => /* @__PURE__ */ e(
375
+ V,
376
+ {
377
+ checked: n.has(a.key),
378
+ onCheckedChange: () => {
379
+ s(a.key);
380
+ },
381
+ children: a.label
382
+ },
383
+ a.key
384
+ )) })
385
+ ] });
386
+ }
387
+ export {
388
+ Y as T,
389
+ se as a,
390
+ ne as b,
391
+ ie as c,
392
+ de as d,
393
+ ce as e
394
+ };
@@ -2,7 +2,7 @@ import { jsx as a, jsxs as s } from "react/jsx-runtime";
2
2
  import { B as m } from "./floating-ui.react-dom-BIcsGc3t.js";
3
3
  import { S as h, h as u, i as g, a as f, c as v } from "./select-CtU681LB.js";
4
4
  import { T as b, a as N, b as S, c as x } from "./tooltip-DzQngJZK.js";
5
- import { u as C } from "./useTheme-DsHPKCDp.js";
5
+ import { a as C } from "./useTheme-CvNYmhjo.js";
6
6
  function j({ themeOptions: c, variant: i = "select" }) {
7
7
  const { theme: t, handleThemeChange: n, currentThemeOption: e, nextThemeOption: r, cycleTheme: o } = C(c);
8
8
  if (i === "mini") {
@@ -1,4 +1,4 @@
1
- import { K as s, a as d, M as i } from "../../../MetricCard-4VI9Ki0g.js";
1
+ import { K as s, a as d, M as i } from "../../../MetricCard-bpuqueI5.js";
2
2
  export {
3
3
  s as KpiCard,
4
4
  d as KpiCards,
@@ -1,4 +1,4 @@
1
- import { A as l, a as r, S as i, T as s } from "../../../TableFilter-DgChe4aX.js";
1
+ import { A as l, a as r, S as i, T as s } from "../../../TableFilter-BoNsBNbv.js";
2
2
  export {
3
3
  l as ActiveFilters,
4
4
  r as AdvancedFilters,
@@ -1,5 +1,6 @@
1
1
  export * from "./cards";
2
2
  export * from "./inputs";
3
+ export * from "./layouts";
3
4
  export * from "./states";
4
5
  export * from "./table";
5
6
  export * from "./filters";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/core/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC"}
@@ -1,36 +1,39 @@
1
- import { K as s, a as o, M as l } from "../../MetricCard-4VI9Ki0g.js";
2
- import { D as S, a as c, M as b, S as p, b as T } from "../../SearchInput-Cf5NHhnz.js";
3
- import { C as n, a as m, E as f, L as x } from "../../LoadingState-DQjGcT2l.js";
1
+ import { K as s, a as o, M as i } from "../../MetricCard-bpuqueI5.js";
2
+ import { D as p, a as c, M as S, S as T, b } from "../../SearchInput-Dh-92XhU.js";
3
+ import { A as n, a as m } from "../../AppTitle-BOhhDNS5.js";
4
+ import { C as f, a as x, E as C, L as k } from "../../LoadingState-DQjGcT2l.js";
4
5
  import "react/jsx-runtime";
5
6
  import "react";
6
- import { T as k, a as A, b as g, c as h, d as F, e as M } from "../../TableSettings-4YLJSh4G.js";
7
- import { A as u, a as D, S as K, T as v } from "../../TableFilter-DgChe4aX.js";
8
- import { S as E, T as L } from "../../Topbar-DifQ00kV.js";
9
- import { T as H } from "../../ThemeSelector-MqD5QvHl.js";
7
+ import { T as h, a as F, b as M, c as P, d as u, e as D } from "../../TableSettings-D2qjh0E9.js";
8
+ import { A as v, a as B, S as E, T as L } from "../../TableFilter-BoNsBNbv.js";
9
+ import { S as H, T as I } from "../../Topbar-DifQ00kV.js";
10
+ import { T as j } from "../../ThemeSelector-BCU1tFyR.js";
10
11
  export {
11
- u as ActiveFilters,
12
- D as AdvancedFilters,
13
- n as CardSkeleton,
14
- m as CardsSkeleton,
15
- S as DatePicker,
12
+ v as ActiveFilters,
13
+ B as AdvancedFilters,
14
+ n as AppActions,
15
+ m as AppTitle,
16
+ f as CardSkeleton,
17
+ x as CardsSkeleton,
18
+ p as DatePicker,
16
19
  c as DateRangePicker,
17
- f as ErrorState,
20
+ C as ErrorState,
18
21
  s as KpiCard,
19
22
  o as KpiCards,
20
- x as LoadingState,
21
- l as MetricCard,
22
- b as MultiSelect,
23
- p as SearchInput,
24
- K as SearchableFilterPill,
25
- T as SearchableSelect,
26
- E as Sidebar,
27
- k as TableActions,
28
- A as TableBody,
29
- g as TableBulkActions,
30
- v as TableFilter,
31
- h as TableHeader,
32
- F as TablePagination,
33
- M as TableSettings,
34
- H as ThemeSelector,
35
- L as Topbar
23
+ k as LoadingState,
24
+ i as MetricCard,
25
+ S as MultiSelect,
26
+ T as SearchInput,
27
+ E as SearchableFilterPill,
28
+ b as SearchableSelect,
29
+ H as Sidebar,
30
+ h as TableActions,
31
+ F as TableBody,
32
+ M as TableBulkActions,
33
+ L as TableFilter,
34
+ P as TableHeader,
35
+ u as TablePagination,
36
+ D as TableSettings,
37
+ j as ThemeSelector,
38
+ I as Topbar
36
39
  };
@@ -1,4 +1,4 @@
1
- import { D as t, a as c, M as r, S as s, b as S } from "../../../SearchInput-Cf5NHhnz.js";
1
+ import { D as t, a as c, M as r, S as s, b as S } from "../../../SearchInput-Dh-92XhU.js";
2
2
  export {
3
3
  t as DatePicker,
4
4
  c as DateRangePicker,