@krosoft/react 0.0.92 → 0.0.94

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 (37) hide show
  1. package/dist/{AppSubTitle-CvJlatS9.js → AppSubTitle-ClfoCdaL.js} +1 -1
  2. package/dist/{AppTitle-LIQCjpo5.js → AppTitle-CdIKv3Uc.js} +19 -18
  3. package/dist/{AppVerticalTabs-BHrad7wu.js → AppVerticalTabs-asJym06s.js} +3 -3
  4. package/dist/{ConfirmationDialog-BlRXnFH5.js → ConfirmationDialog-CwM8I84X.js} +55 -54
  5. package/dist/DataTable-BB0h65b3.js +500 -0
  6. package/dist/{MetricCard-BGT2QRn0.js → MetricCard-DhTm-HB1.js} +7 -6
  7. package/dist/{SearchInput-DpOuKSIf.js → SearchInput-Jix7xgVv.js} +19 -18
  8. package/dist/{TableFilter-DFtN_-Bg.js → TableFilter-0SlGbGRV.js} +12 -11
  9. package/dist/{ThemeSelector-D9KTJAWz.js → ThemeSelector-Bzxc7UEq.js} +1 -1
  10. package/dist/components/core/cards/index.js +1 -1
  11. package/dist/components/core/dialogs/index.js +2 -2
  12. package/dist/components/core/filters/index.js +1 -1
  13. package/dist/components/core/index.js +63 -64
  14. package/dist/components/core/inputs/index.js +1 -1
  15. package/dist/components/core/layouts/index.js +2 -2
  16. package/dist/components/core/table/DataTable.d.ts +1 -1
  17. package/dist/components/core/table/DataTable.d.ts.map +1 -1
  18. package/dist/components/core/table/index.js +8 -9
  19. package/dist/components/core/tabs/index.js +1 -1
  20. package/dist/components/core/theme/index.js +1 -1
  21. package/dist/components/index.js +256 -255
  22. package/dist/components/ui/index.d.ts +1 -0
  23. package/dist/components/ui/index.d.ts.map +1 -1
  24. package/dist/components/ui/index.js +54 -52
  25. package/dist/components/ui/select.d.ts +3 -1
  26. package/dist/components/ui/select.d.ts.map +1 -1
  27. package/dist/hooks/index.d.ts +1 -0
  28. package/dist/hooks/index.d.ts.map +1 -1
  29. package/dist/hooks/index.js +4 -2
  30. package/dist/{select-D6_XPD6x.js → select-zzSnHs9S.js} +481 -456
  31. package/dist/toaster-DBg6ZSwC.js +134 -0
  32. package/dist/toggle-group-FWXeh1Cr.js +20235 -0
  33. package/dist/useDataTable-CQpx3zTg.js +91 -0
  34. package/package.json +8 -7
  35. package/dist/TableSettings-m2q3s0wU.js +0 -382
  36. package/dist/toaster-D6ND7OTk.js +0 -113
  37. package/dist/toggle-group-VJoGbVQm.js +0 -19987
@@ -0,0 +1,91 @@
1
+ import { useState as l, useRef as d, useMemo as S, useCallback as O } from "react";
2
+ function ue({
3
+ data: i,
4
+ columns: o,
5
+ getRowId: j,
6
+ defaultPageSize: q,
7
+ actions: R,
8
+ bulkActions: y,
9
+ columnVisibility: G = !0
10
+ }) {
11
+ var F;
12
+ const [u, H] = l(((F = o.find((e) => e.sortable === !0)) == null ? void 0 : F.key) ?? null), [c, P] = l("asc"), [g, f] = l([]), [h, J] = l(new Set(o.filter((e) => e.defaultVisible !== !1).map((e) => e.key))), [b, N] = l(o.map((e) => e.key)), [w, Q] = l(o.reduce((e, t) => ({ ...e, [t.key]: t.minWidth ?? 100 }), {})), [V, A] = l(1), [m, Y] = l(q), Z = d(null), x = d(null), E = d(0), W = d(0), a = d(null), z = d(null), I = R !== void 0 && R.length > 0, L = y !== void 0 && y.length > 0, M = S(() => b.map((e) => o.find((t) => t.key === e)).filter((e) => e !== void 0), [b, o]), T = S(() => M.filter((e) => h.has(e.key)), [M, h]), _ = T.length + (L ? 1 : 0) + (I || G ? 1 : 0), k = Math.max(1, Math.ceil(i.length / m)), X = V > k ? k : V, p = i.length === 0 ? 0 : (X - 1) * m, D = Math.min(p + m, i.length), $ = (e) => {
13
+ const t = o.find((n) => n.key === e);
14
+ (t == null ? void 0 : t.sortable) === !0 && (u === e ? P(c === "asc" ? "desc" : "asc") : (H(e), P("asc")), A(1));
15
+ }, v = O((e) => {
16
+ const t = x.current;
17
+ if (t === null) return;
18
+ const n = e.clientX - E.current, r = Math.max(80, W.current + n);
19
+ Q((s) => ({
20
+ ...s,
21
+ [t]: r
22
+ }));
23
+ }, []), U = O(
24
+ function e() {
25
+ x.current = null, document.removeEventListener("mousemove", v), document.removeEventListener("mouseup", e);
26
+ },
27
+ [v]
28
+ ), K = O(
29
+ (e, t) => {
30
+ e.preventDefault(), e.stopPropagation(), x.current = t, E.current = e.clientX, W.current = w[t], document.addEventListener("mousemove", v), document.addEventListener("mouseup", U);
31
+ },
32
+ [w, v, U]
33
+ ), ee = (e, t) => {
34
+ a.current = t, e.dataTransfer.effectAllowed = "move", e.dataTransfer.setData("text/html", t);
35
+ }, te = (e, t) => {
36
+ e.preventDefault(), e.dataTransfer.dropEffect = "move", z.current = t;
37
+ }, ne = (e, t) => {
38
+ if (e.preventDefault(), a.current === null || a.current === t) return;
39
+ const n = [...b], r = n.indexOf(a.current), s = n.indexOf(t);
40
+ n.splice(r, 1), n.splice(s, 0, a.current), N(n), a.current = null, z.current = null;
41
+ }, B = S(() => [...i].sort((e, t) => {
42
+ if (u === null) return 0;
43
+ const n = o.find((C) => C.key === u), r = (n == null ? void 0 : n.getSortValue) !== void 0 ? n.getSortValue(e) : e[u], s = (n == null ? void 0 : n.getSortValue) !== void 0 ? n.getSortValue(t) : t[u];
44
+ if (typeof r == "string" && typeof s == "string") {
45
+ const C = r.localeCompare(s);
46
+ return c === "asc" ? C : -C;
47
+ }
48
+ return r === s ? 0 : r == null ? 1 : s == null ? -1 : r < s ? c === "asc" ? -1 : 1 : r > s ? c === "asc" ? 1 : -1 : 0;
49
+ }), [i, u, c, o]), re = S(() => B.slice(p, D), [B, p, D]);
50
+ return {
51
+ sortColumn: u,
52
+ sortDirection: c,
53
+ selectedRows: g,
54
+ setSelectedRows: f,
55
+ visibleColumns: h,
56
+ columnWidths: w,
57
+ currentPage: V,
58
+ setCurrentPage: A,
59
+ pageSize: m,
60
+ setPageSize: Y,
61
+ totalPages: k,
62
+ safeCurrentPage: X,
63
+ startIndex: p,
64
+ endIndex: D,
65
+ tableRef: Z,
66
+ hasActions: I,
67
+ hasBulkActions: L,
68
+ orderedColumns: M,
69
+ visibleColumnsArray: T,
70
+ colSpanCount: _,
71
+ paginatedData: re,
72
+ handleSort: $,
73
+ handleMouseDown: K,
74
+ handleDragStart: ee,
75
+ handleDragOver: te,
76
+ handleDrop: ne,
77
+ toggleColumnVisibility: (e) => {
78
+ const t = new Set(h);
79
+ t.has(e) ? t.delete(e) : t.add(e), J(t);
80
+ },
81
+ toggleRowSelection: (e) => {
82
+ g.includes(e) ? f(g.filter((t) => t !== e)) : f([...g, e]);
83
+ },
84
+ toggleSelectAll: () => {
85
+ g.length === i.length ? f([]) : f(i.map((e) => j(e)));
86
+ }
87
+ };
88
+ }
89
+ export {
90
+ ue as u
91
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@krosoft/react",
3
- "version": "0.0.92",
3
+ "version": "0.0.94",
4
4
  "description": "Krosoft shared React package",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -91,10 +91,9 @@
91
91
  "@krosoft/tooling-eslint-react": "^0.0.21",
92
92
  "@krosoft/tooling-prettier": "^0.0.14",
93
93
  "@krosoft/tooling-tsconfig-react": "^0.0.10",
94
- "@storybook/addon-essentials": "^8.6.18",
95
- "@storybook/addon-themes": "^8.6.18",
96
- "@storybook/react": "^8.6.18",
97
- "@storybook/react-vite": "^8.6.18",
94
+ "@storybook/addon-themes": "^10.4.1",
95
+ "@storybook/react": "^10.4.1",
96
+ "@storybook/react-vite": "^10.4.1",
98
97
  "@types/node": "^25.9.1",
99
98
  "@types/react": "^19.2.15",
100
99
  "@types/react-dom": "^19.2.3",
@@ -107,10 +106,12 @@
107
106
  "react-i18next": "^17.0.8",
108
107
  "react-resizable-panels": "^4.11.2",
109
108
  "react-router-dom": "^7.15.1",
110
- "storybook": "^8.6.18",
109
+ "storybook": "^10.4.1",
111
110
  "tailwindcss": "^3.4.19",
112
111
  "typescript": "^5.9.3",
113
112
  "vite": "^6.4.2",
114
- "vitest": "^4.1.7"
113
+ "vitest": "^4.1.7",
114
+ "eslint-plugin-storybook": "10.4.1",
115
+ "@storybook/addon-docs": "^10.4.1"
115
116
  }
116
117
  }
@@ -1,382 +0,0 @@
1
- import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import { ar as M, aF as j, at as D, av as A, U as S, cf as L, cg as B, as as I } from "./toggle-group-VJoGbVQm.js";
3
- import "./card-Bn3Y7DHQ.js";
4
- import { B as x } from "./tooltip-CAu4DEhc.js";
5
- import "./select-D6_XPD6x.js";
6
- import "react";
7
- import { E as V } from "./ellipsis-vertical-BVxSFNOa.js";
8
- import { L as q } from "./loader-circle-GAYBtm3z.js";
9
- import { G as U } from "./grip-vertical-CJ07_87Y.js";
10
- import { c as f } from "./index-DSyPHOLE.js";
11
- /**
12
- * @license lucide-react v1.16.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */
17
- const E = [
18
- ["path", { d: "M12 5v14", key: "s699le" }],
19
- ["path", { d: "m19 12-7 7-7-7", key: "1idqje" }]
20
- ], G = f("arrow-down", E);
21
- /**
22
- * @license lucide-react v1.16.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */
27
- const H = [
28
- ["path", { d: "m21 16-4 4-4-4", key: "f6ql7i" }],
29
- ["path", { d: "M17 20V4", key: "1ejh1v" }],
30
- ["path", { d: "m3 8 4-4 4 4", key: "11wl7u" }],
31
- ["path", { d: "M7 4v16", key: "1glfcx" }]
32
- ], F = f("arrow-up-down", H);
33
- /**
34
- * @license lucide-react v1.16.0 - ISC
35
- *
36
- * This source code is licensed under the ISC license.
37
- * See the LICENSE file in the root directory of this source tree.
38
- */
39
- const O = [
40
- ["path", { d: "m5 12 7-7 7 7", key: "hav0vg" }],
41
- ["path", { d: "M12 19V5", key: "x0mq9r" }]
42
- ], J = f("arrow-up", O);
43
- /**
44
- * @license lucide-react v1.16.0 - ISC
45
- *
46
- * This source code is licensed under the ISC license.
47
- * See the LICENSE file in the root directory of this source tree.
48
- */
49
- const Q = [
50
- [
51
- "path",
52
- {
53
- 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",
54
- key: "1i5ecw"
55
- }
56
- ],
57
- ["circle", { cx: "12", cy: "12", r: "3", key: "1v7zrd" }]
58
- ], W = f("settings", Q);
59
- function X({ actions: l, row: n }) {
60
- return /* @__PURE__ */ t(M, { children: [
61
- /* @__PURE__ */ e(j, { asChild: !0, children: /* @__PURE__ */ e(x, { variant: "ghost", size: "icon", className: "h-8 w-8 text-muted-foreground hover:text-foreground", children: /* @__PURE__ */ e(V, { className: "size-4" }) }) }),
62
- /* @__PURE__ */ e(
63
- D,
64
- {
65
- align: "end",
66
- onClick: (s) => {
67
- s.stopPropagation();
68
- },
69
- children: l.map((s, a) => {
70
- const o = s.icon;
71
- return /* @__PURE__ */ t(
72
- A,
73
- {
74
- onClick: () => {
75
- s.onClick(n);
76
- },
77
- className: s.className,
78
- children: [
79
- o !== void 0 && /* @__PURE__ */ e("span", { className: "mr-2 size-4 flex items-center justify-center", children: /* @__PURE__ */ e(o, { className: "size-4" }) }),
80
- s.label
81
- ]
82
- },
83
- a
84
- );
85
- })
86
- }
87
- )
88
- ] });
89
- }
90
- function ne({
91
- isLoading: l,
92
- colSpanCount: n,
93
- noDataMessage: s,
94
- paginatedData: a,
95
- getRowId: o,
96
- onRowClick: c,
97
- hasBulkActions: u,
98
- selectedRows: b,
99
- toggleRowSelection: g,
100
- visibleColumnsArray: i,
101
- columnWidths: k,
102
- hasActions: N,
103
- actions: v,
104
- columns: w
105
- }) {
106
- const C = (h, m) => {
107
- const d = w.find((r) => r.key === m);
108
- if ((d == null ? void 0 : d.renderCell) !== void 0)
109
- return d.renderCell(h);
110
- const y = h[m];
111
- return /* @__PURE__ */ e("span", { className: "text-sm truncate", children: y != null ? String(y) : "-" });
112
- };
113
- return l ? /* @__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: [
114
- /* @__PURE__ */ e(q, { className: "h-6 w-6 animate-spin text-primary" }),
115
- /* @__PURE__ */ e("span", { className: "text-sm", children: "Chargement..." })
116
- ] }) }) }) }) : 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) => {
117
- const m = o(h);
118
- return /* @__PURE__ */ t(
119
- "tr",
120
- {
121
- className: `group hover:bg-muted/50 dark:hover:bg-gray-900/50 transition-colors ${c !== void 0 ? "cursor-pointer" : ""}`,
122
- onClick: () => c == null ? void 0 : c(h),
123
- children: [
124
- u ? /* @__PURE__ */ e(
125
- "td",
126
- {
127
- className: "px-4 py-2 w-12",
128
- onClick: (d) => {
129
- d.stopPropagation();
130
- },
131
- children: /* @__PURE__ */ e(
132
- S,
133
- {
134
- checked: b.includes(m),
135
- onCheckedChange: () => {
136
- g(m);
137
- }
138
- }
139
- )
140
- }
141
- ) : null,
142
- i.map((d, y) => {
143
- const r = y === i.length - 1;
144
- return /* @__PURE__ */ e(
145
- "td",
146
- {
147
- className: `px-2 py-2 border-r border-gray-100 dark:border-gray-800 relative ${r ? "border-r-0" : ""}`,
148
- style: { width: k[d.key] },
149
- children: /* @__PURE__ */ e("div", { className: "w-full h-full", children: C(h, d.key) })
150
- },
151
- d.key
152
- );
153
- }),
154
- N && v !== void 0 && v.length > 0 ? /* @__PURE__ */ e(
155
- "td",
156
- {
157
- className: "px-2 py-2 w-12 text-end",
158
- onClick: (d) => {
159
- d.stopPropagation();
160
- },
161
- children: /* @__PURE__ */ e(X, { actions: v, row: h })
162
- }
163
- ) : null
164
- ]
165
- },
166
- m
167
- );
168
- }) });
169
- }
170
- function ie({ selectedRows: l, setSelectedRows: n, bulkActions: s }) {
171
- 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: [
172
- /* @__PURE__ */ t("div", { className: "flex items-center gap-4", children: [
173
- /* @__PURE__ */ t("span", { className: "text-sm font-medium text-primary ml-1", children: [
174
- l.length,
175
- " sélectionné(s)"
176
- ] }),
177
- /* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: s.map((a, o) => {
178
- const c = a.icon;
179
- return /* @__PURE__ */ t(
180
- x,
181
- {
182
- variant: "outline",
183
- size: "sm",
184
- onClick: () => {
185
- a.onClick(l, () => {
186
- n([]);
187
- });
188
- },
189
- 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"}`,
190
- children: [
191
- c !== void 0 && /* @__PURE__ */ e("span", { className: "mr-1.5 flex items-center justify-center", children: /* @__PURE__ */ e(c, { className: "h-3.5 w-3.5" }) }),
192
- a.label
193
- ]
194
- },
195
- o
196
- );
197
- }) })
198
- ] }),
199
- /* @__PURE__ */ e(
200
- x,
201
- {
202
- variant: "ghost",
203
- size: "sm",
204
- onClick: () => {
205
- n([]);
206
- },
207
- className: "text-xs text-muted-foreground hover:text-foreground h-7 px-2",
208
- children: "Désélectionner"
209
- }
210
- )
211
- ] });
212
- }
213
- function de({
214
- hasBulkActions: l,
215
- selectedRows: n,
216
- totalItems: s,
217
- toggleSelectAll: a,
218
- visibleColumnsArray: o,
219
- draggableColumns: c,
220
- resizableColumns: u,
221
- columnWidths: b,
222
- sortColumn: g,
223
- sortDirection: i,
224
- handleSort: k,
225
- handleDragStart: N,
226
- handleDragOver: v,
227
- handleDrop: w,
228
- handleMouseDown: C,
229
- hasActions: h,
230
- settingsNode: m
231
- }) {
232
- const d = (r) => r.sortable !== !0 ? null : g === r.key ? i === "asc" ? /* @__PURE__ */ e(J, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ e(G, { className: "size-3.5 text-foreground" }) : /* @__PURE__ */ e(F, { className: "size-3.5 text-muted-foreground/50 group-hover:text-muted-foreground transition-colors" }), y = (r, T) => {
233
- const z = T !== !1, _ = r.sortable === !0, $ = g === r.key;
234
- return /* @__PURE__ */ t(
235
- "th",
236
- {
237
- className: [
238
- "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",
239
- _ ? "cursor-pointer hover:bg-gray-100 dark:hover:bg-gray-800 select-none" : "",
240
- $ ? "bg-gray-100/80 dark:bg-gray-800/80" : ""
241
- ].filter(Boolean).join(" "),
242
- style: { width: b[r.key] },
243
- draggable: z,
244
- onClick: () => {
245
- k(r.key);
246
- },
247
- onDragStart: (p) => {
248
- z ? N(p, r.key) : p.preventDefault();
249
- },
250
- onDragOver: (p) => {
251
- v(p, r.key);
252
- },
253
- onDrop: (p) => {
254
- w(p, r.key);
255
- },
256
- children: [
257
- /* @__PURE__ */ t("div", { className: "flex items-center justify-between pr-2", children: [
258
- /* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: [
259
- z ? /* @__PURE__ */ e(U, { className: "size-4 text-gray-400 cursor-grab dark:text-gray-300 shrink-0" }) : null,
260
- /* @__PURE__ */ e("span", { className: "truncate", children: r.label })
261
- ] }),
262
- /* @__PURE__ */ e("div", { className: "ml-1 shrink-0", children: d(r) })
263
- ] }),
264
- u ? /* @__PURE__ */ e(
265
- "div",
266
- {
267
- 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",
268
- onMouseDown: (p) => {
269
- C(p, r.key);
270
- }
271
- }
272
- ) : null
273
- ]
274
- },
275
- r.key
276
- );
277
- };
278
- 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: [
279
- l ? /* @__PURE__ */ e("th", { className: "px-4 py-2 w-12 flex-shrink-0 text-left", children: /* @__PURE__ */ e(
280
- S,
281
- {
282
- checked: n.length === s && s > 0 ? !0 : n.length > 0 ? "indeterminate" : !1,
283
- onCheckedChange: a
284
- }
285
- ) }) : null,
286
- o.map((r) => y(r, c)),
287
- h || m !== void 0 ? /* @__PURE__ */ e("th", { className: "w-12 px-2 py-2 text-center align-middle", children: m }) : null
288
- ] }) });
289
- }
290
- function le({
291
- totalItems: l,
292
- startIndex: n,
293
- endIndex: s,
294
- pageSize: a,
295
- setPageSize: o,
296
- currentPage: c,
297
- setCurrentPage: u,
298
- pageSizeOptions: b,
299
- totalPages: g
300
- }) {
301
- 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: [
302
- /* @__PURE__ */ t("div", { className: "text-sm text-muted-foreground", children: [
303
- l === 0 ? "0" : `${String(n + 1)} - ${String(s)}`,
304
- " sur ",
305
- l
306
- ] }),
307
- /* @__PURE__ */ t("div", { className: "flex items-center gap-4", children: [
308
- /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
309
- /* @__PURE__ */ e("span", { className: "text-sm text-muted-foreground", children: "Lignes par page :" }),
310
- /* @__PURE__ */ e(
311
- "select",
312
- {
313
- value: a,
314
- onChange: (i) => {
315
- o(Number(i.target.value)), u(1);
316
- },
317
- className: "border border-input bg-background rounded px-2 py-1 text-sm text-foreground",
318
- children: b.map((i) => /* @__PURE__ */ e("option", { value: i, children: i }, i))
319
- }
320
- )
321
- ] }),
322
- /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: [
323
- /* @__PURE__ */ e(
324
- x,
325
- {
326
- variant: "outline",
327
- size: "sm",
328
- className: "h-8 w-8 p-0",
329
- onClick: () => {
330
- u((i) => Math.max(1, i - 1));
331
- },
332
- disabled: c === 1,
333
- children: /* @__PURE__ */ e(L, { className: "size-4" })
334
- }
335
- ),
336
- /* @__PURE__ */ t("span", { className: "text-sm text-muted-foreground", children: [
337
- "Page ",
338
- c,
339
- " sur ",
340
- g
341
- ] }),
342
- /* @__PURE__ */ e(
343
- x,
344
- {
345
- variant: "outline",
346
- size: "sm",
347
- className: "h-8 w-8 p-0",
348
- onClick: () => {
349
- u((i) => Math.min(g, i + 1));
350
- },
351
- disabled: c === g,
352
- children: /* @__PURE__ */ e(B, { className: "size-4" })
353
- }
354
- )
355
- ] })
356
- ] })
357
- ] });
358
- }
359
- function ce({ columns: l, visibleColumns: n, toggleColumnVisibility: s }) {
360
- return /* @__PURE__ */ t(M, { children: [
361
- /* @__PURE__ */ e(j, { 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(W, { className: "size-4 text-gray-600 dark:text-gray-300" }) }) }),
362
- /* @__PURE__ */ e(D, { align: "end", className: "w-56", children: l.map((a) => /* @__PURE__ */ e(
363
- I,
364
- {
365
- checked: n.has(a.key),
366
- onCheckedChange: () => {
367
- s(a.key);
368
- },
369
- children: a.label
370
- },
371
- a.key
372
- )) })
373
- ] });
374
- }
375
- export {
376
- X as T,
377
- ne as a,
378
- ie as b,
379
- de as c,
380
- le as d,
381
- ce as e
382
- };
@@ -1,113 +0,0 @@
1
- import * as c from "react";
2
- import "react-dom";
3
- import { e as m } from "./tooltip-CAu4DEhc.js";
4
- import { jsx as t, jsxs as l } from "react/jsx-runtime";
5
- import { c9 as v, ca as b, cb as g, cc as h, cd as w, ce as x, b_ as R, bW as T, b$ as y, bZ as C, bY as N, c0 as P } from "./toggle-group-VJoGbVQm.js";
6
- import { c as n } from "./index-gWiv5-6R.js";
7
- import { G as $ } from "./grip-vertical-CJ07_87Y.js";
8
- import { u as S } from "./useToast-BFTk4lWz.js";
9
- var A = [
10
- "a",
11
- "button",
12
- "div",
13
- "form",
14
- "h2",
15
- "h3",
16
- "img",
17
- "input",
18
- "label",
19
- "li",
20
- "nav",
21
- "ol",
22
- "p",
23
- "select",
24
- "span",
25
- "svg",
26
- "ul"
27
- ], j = A.reduce((a, e) => {
28
- const r = m(`Primitive.${e}`), i = c.forwardRef((o, s) => {
29
- const { asChild: d, ...f } = o, u = d ? r : e;
30
- return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ t(u, { ...f, ref: s });
31
- });
32
- return i.displayName = `Primitive.${e}`, { ...a, [e]: i };
33
- }, {}), z = "AspectRatio", p = c.forwardRef(
34
- (a, e) => {
35
- const { ratio: r = 1 / 1, style: i, ...o } = a;
36
- return /* @__PURE__ */ t(
37
- "div",
38
- {
39
- style: {
40
- // ensures inner element is contained
41
- position: "relative",
42
- // ensures padding bottom trick maths works
43
- width: "100%",
44
- paddingBottom: `${100 / r}%`
45
- },
46
- "data-radix-aspect-ratio-wrapper": "",
47
- children: /* @__PURE__ */ t(
48
- j.div,
49
- {
50
- ...o,
51
- ref: e,
52
- style: {
53
- ...i,
54
- // ensures children expand in ratio
55
- position: "absolute",
56
- top: 0,
57
- right: 0,
58
- bottom: 0,
59
- left: 0
60
- }
61
- }
62
- )
63
- }
64
- );
65
- }
66
- );
67
- p.displayName = z;
68
- var G = p;
69
- const M = G, O = v, Q = g, U = b, W = ({ className: a, ...e }) => /* @__PURE__ */ t(x, { className: n("flex h-full w-full data-[panel-group-direction=vertical]:flex-col", a), ...e }), Z = h, _ = ({
70
- withHandle: a,
71
- className: e,
72
- ...r
73
- }) => /* @__PURE__ */ t(
74
- w,
75
- {
76
- className: n(
77
- "relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",
78
- e
79
- ),
80
- ...r,
81
- children: a && /* @__PURE__ */ t("div", { className: "z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border", children: /* @__PURE__ */ t($, { className: "h-2.5 w-2.5" }) })
82
- }
83
- );
84
- function q({ className: a, ...e }) {
85
- return /* @__PURE__ */ t("div", { className: n("animate-pulse rounded-md bg-muted", a), ...e });
86
- }
87
- function F() {
88
- const { toasts: a } = S();
89
- return /* @__PURE__ */ l(R, { children: [
90
- a.map(function({ id: e, title: r, description: i, action: o, ...s }) {
91
- return /* @__PURE__ */ l(T, { ...s, children: [
92
- /* @__PURE__ */ l("div", { className: "grid gap-1", children: [
93
- r && /* @__PURE__ */ t(y, { children: r }),
94
- i && /* @__PURE__ */ t(C, { children: i })
95
- ] }),
96
- o,
97
- /* @__PURE__ */ t(N, {})
98
- ] }, e);
99
- }),
100
- /* @__PURE__ */ t(P, {})
101
- ] });
102
- }
103
- export {
104
- M as A,
105
- O as C,
106
- _ as R,
107
- q as S,
108
- F as T,
109
- U as a,
110
- Q as b,
111
- Z as c,
112
- W as d
113
- };