@krosoft/react 0.0.200 → 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 +1 -1
  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
@@ -0,0 +1,301 @@
1
+ import { jsxs as s, Fragment as R, jsx as e } from "react/jsx-runtime";
2
+ import * as z from "react";
3
+ import { SearchIcon as $, LoaderCircleIcon as G, ChevronDownIcon as W, MenuIcon as M } from "lucide-react";
4
+ import { B as O, T as B, c as F, a as Q, b as q } from "./tooltip-DVeqVwqV.js";
5
+ import { j as H, m as U, o as V, k as _, l as J, n as X, I as Y, S as Z, s as P, y as I, t as ee } from "./sheet-C-QvdRNi.js";
6
+ import { c } from "./tailwind.helper-B6yFEsav.js";
7
+ import "./sidebar.context-D5nywlmP.js";
8
+ import { u as E } from "./useSidebar-BJuALHqQ.js";
9
+ import "react-i18next";
10
+ import "next-themes";
11
+ import { S as L } from "./skeleton-BX4RcsiK.js";
12
+ const fe = ({
13
+ groups: a,
14
+ search: f,
15
+ onSearch: h,
16
+ onSelect: i,
17
+ loading: r = !1,
18
+ open: l,
19
+ onOpenChange: d,
20
+ trigger: x = !0,
21
+ triggerLabel: y = "Rechercher",
22
+ shortcut: g = !0,
23
+ shortcutLabel: N = "Ctrl+K",
24
+ placeholder: w = "Rechercher...",
25
+ emptyLabel: C = "Aucun résultat.",
26
+ loadingLabel: k = "Recherche...",
27
+ title: S = "Recherche globale",
28
+ description: j = "Rechercher une page ou une donnée dans l'application.",
29
+ className: b
30
+ }) => {
31
+ const [T, D] = z.useState(!1), u = l !== void 0, t = u ? l : T, v = z.useCallback(
32
+ (o) => {
33
+ u || D(o), d == null || d(o);
34
+ },
35
+ [u, d]
36
+ );
37
+ z.useEffect(() => {
38
+ if (!g) return;
39
+ const o = (m) => {
40
+ m.key.toLowerCase() !== "k" || !(m.metaKey || m.ctrlKey) || (m.preventDefault(), v(!t));
41
+ };
42
+ return window.addEventListener("keydown", o), () => {
43
+ window.removeEventListener("keydown", o);
44
+ };
45
+ }, [g, t, v]);
46
+ const n = (o) => {
47
+ v(!1), h(""), i(o);
48
+ }, p = a.some((o) => o.items.length > 0);
49
+ return /* @__PURE__ */ s(R, { children: [
50
+ x && /* @__PURE__ */ e(
51
+ O,
52
+ {
53
+ variant: "ghost",
54
+ size: "icon",
55
+ "aria-label": y,
56
+ title: g ? `${y} (${N})` : y,
57
+ className: "rounded-full",
58
+ onClick: () => {
59
+ v(!0);
60
+ },
61
+ children: /* @__PURE__ */ e($, { className: "size-4" })
62
+ }
63
+ ),
64
+ /* @__PURE__ */ s(H, { open: t, onOpenChange: v, title: S, description: j, shouldFilter: !1, className: b, children: [
65
+ /* @__PURE__ */ e(U, { value: f, onValueChange: h, placeholder: w }),
66
+ /* @__PURE__ */ s(V, { children: [
67
+ r && /* @__PURE__ */ s("div", { className: "flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground", children: [
68
+ /* @__PURE__ */ e(G, { className: "size-4 animate-spin" }),
69
+ k
70
+ ] }),
71
+ !p && !r && /* @__PURE__ */ e(_, { children: C }),
72
+ a.map(
73
+ (o) => o.items.length === 0 ? null : /* @__PURE__ */ e(J, { heading: o.heading, children: o.items.map((m) => {
74
+ const A = m.icon;
75
+ return /* @__PURE__ */ s(
76
+ X,
77
+ {
78
+ value: m.key,
79
+ onSelect: () => {
80
+ n(m);
81
+ },
82
+ children: [
83
+ A && /* @__PURE__ */ e(A, { className: "mr-2 size-4 shrink-0" }),
84
+ /* @__PURE__ */ e("span", { className: "truncate", children: m.label }),
85
+ m.description !== void 0 && m.description !== "" && /* @__PURE__ */ e("span", { className: "ml-2 truncate text-xs text-muted-foreground", children: m.description })
86
+ ]
87
+ },
88
+ m.key
89
+ );
90
+ }) }, o.heading)
91
+ )
92
+ ] })
93
+ ] })
94
+ ] });
95
+ }, K = (a, f, h) => f === a ? !0 : a === "/" || !f.startsWith(`${a}/`) ? !1 : !h.some(
96
+ (i) => i !== a && i.startsWith(`${a}/`) && (f === i || f.startsWith(`${i}/`))
97
+ ), re = ({
98
+ path: a,
99
+ // eslint-disable-next-line @typescript-eslint/naming-convention
100
+ icon: f,
101
+ label: h,
102
+ badge: i,
103
+ subItems: r,
104
+ currentPath: l,
105
+ collapsed: d,
106
+ dense: x = !1,
107
+ onItemClick: y
108
+ }) => {
109
+ const g = (r == null ? void 0 : r.map((t) => t.path)) ?? [], [N, w] = z.useState((r == null ? void 0 : r.some((t) => K(t.path, l, g))) ?? !1), C = a ? l === a || a !== "/" && l.startsWith(`${a}/`) : !1, k = r == null ? void 0 : r.some((t) => K(t.path, l, g)), u = /* @__PURE__ */ s(
110
+ "a",
111
+ {
112
+ href: a ?? "#",
113
+ onClick: (t) => {
114
+ t.ctrlKey || t.metaKey || t.button === 1 || (t.preventDefault(), r && r.length > 0 ? d || w(!N) : a && y(a));
115
+ },
116
+ className: c(
117
+ "flex items-center cursor-pointer transition-all duration-200 group rounded-control",
118
+ x ? "gap-2.5 mb-0.5" : "gap-3 mb-1",
119
+ d ? x ? "justify-center p-2 h-9 w-9 mx-auto" : "justify-center p-3 h-12 w-12 mx-auto" : x ? "px-3 py-1.5 h-9" : "px-4 py-3 h-12",
120
+ C || !d && k ? x ? "bg-sidebar-primary text-sidebar-primary-foreground" : "bg-sidebar-primary text-sidebar-primary-foreground shadow-lg" : "hover:bg-sidebar-accent text-sidebar-foreground hover:text-sidebar-accent-foreground"
121
+ ),
122
+ children: [
123
+ /* @__PURE__ */ e("div", { className: c("flex-shrink-0 transition-transform group-hover:scale-110", d ? "flex items-center justify-center" : ""), children: /* @__PURE__ */ e(f, { className: "size-4" }) }),
124
+ !d && /* @__PURE__ */ s(R, { children: [
125
+ /* @__PURE__ */ e("span", { className: c("flex-grow transition-opacity duration-150 font-medium", x ? "text-sm" : ""), children: h }),
126
+ i !== 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: i }),
127
+ r && r.length > 0 && /* @__PURE__ */ e(W, { className: c("size-4 transition-transform duration-200", N ? "rotate-180" : "") })
128
+ ] })
129
+ ]
130
+ }
131
+ );
132
+ return /* @__PURE__ */ s(R, { children: [
133
+ d ? /* @__PURE__ */ s(B, { children: [
134
+ /* @__PURE__ */ e(F, { asChild: !0, children: u }),
135
+ /* @__PURE__ */ e(
136
+ Q,
137
+ {
138
+ side: "right",
139
+ sideOffset: 6,
140
+ className: "rounded-surface z-[99999] flex gap-2 bg-sidebar text-sidebar-foreground border border-sidebar-border py-2 text-sm shadow-lg",
141
+ children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-2", children: /* @__PURE__ */ s("div", { className: "flex items-center gap-2", children: [
142
+ /* @__PURE__ */ e("p", { className: "font-semibold", children: h }),
143
+ i !== void 0 && /* @__PURE__ */ s("span", { className: "ml-1 text-xs", children: [
144
+ "(",
145
+ i,
146
+ ")"
147
+ ] })
148
+ ] }) })
149
+ }
150
+ )
151
+ ] }) : u,
152
+ !d && r && r.length > 0 && N && /* @__PURE__ */ e(
153
+ "div",
154
+ {
155
+ className: c(
156
+ "flex flex-col ml-4 pl-4 border-l-2 border-sidebar-border/50 animate-in slide-in-from-top-2 fade-in duration-200",
157
+ x ? "gap-0.5 mb-0.5" : "gap-1 mb-2"
158
+ ),
159
+ children: r.map((t, v) => {
160
+ const n = K(t.path, l, g);
161
+ return /* @__PURE__ */ s(
162
+ "a",
163
+ {
164
+ href: t.path,
165
+ onClick: (p) => {
166
+ p.ctrlKey || p.metaKey || p.button === 1 || (p.preventDefault(), y(t.path));
167
+ },
168
+ className: c(
169
+ "flex items-center justify-between rounded-control text-sm transition-all duration-200",
170
+ x ? "px-3 py-1" : "px-4 py-2",
171
+ n ? "bg-sidebar-accent/50 text-sidebar-primary font-semibold" : "text-sidebar-muted hover:bg-sidebar-accent hover:text-sidebar-foreground"
172
+ ),
173
+ children: [
174
+ /* @__PURE__ */ e("span", { children: t.label }),
175
+ t.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: t.badge })
176
+ ]
177
+ },
178
+ v
179
+ );
180
+ })
181
+ }
182
+ )
183
+ ] });
184
+ }, he = ({ groups: a, currentPath: f, onItemClick: h, slots: i, search: r, dense: l = !1, loading: d = !1 }) => {
185
+ const { enabled: x = !1, placeholder: y = "Rechercher..." } = r ?? {}, { header: g, footer: N } = i ?? {}, { collapsed: w, isMobile: C, setCollapsed: k } = E(), [S, j] = z.useState(""), b = C ? !1 : w, T = !w, D = (n) => {
186
+ h(n), C && k(!0);
187
+ }, u = S.trim().toLowerCase(), t = u === "" ? a : a.map((n) => ({
188
+ ...n,
189
+ items: n.items.filter(
190
+ (p) => {
191
+ var o;
192
+ return p.label.toLowerCase().includes(u) || (((o = p.subItems) == null ? void 0 : o.some((m) => m.label.toLowerCase().includes(u))) ?? !1);
193
+ }
194
+ )
195
+ })).filter((n) => n.items.length > 0), v = /* @__PURE__ */ s("div", { className: "flex flex-col h-full bg-sidebar text-sidebar-foreground", children: [
196
+ g,
197
+ x && !b && /* @__PURE__ */ e("div", { className: c("px-4", l ? "pt-2" : "pt-4"), children: /* @__PURE__ */ s("div", { className: "relative", children: [
198
+ /* @__PURE__ */ e($, { className: "absolute left-3 top-1/2 size-4 -translate-y-1/2 text-sidebar-muted" }),
199
+ /* @__PURE__ */ e(
200
+ Y,
201
+ {
202
+ type: "search",
203
+ value: S,
204
+ onChange: (n) => {
205
+ j(n.target.value);
206
+ },
207
+ placeholder: y,
208
+ className: c(
209
+ "bg-sidebar-accent/40 border-sidebar-border pl-9 text-sidebar-foreground placeholder:text-sidebar-muted",
210
+ l ? "h-8 text-sm" : "h-9"
211
+ )
212
+ }
213
+ )
214
+ ] }) }),
215
+ /* @__PURE__ */ e("div", { className: c("flex-1 overflow-y-auto scrollbar-modern", b ? "px-0" : "px-2", l ? "py-2" : "py-4"), children: d ? Array.from({ length: 5 }).map((n, p) => /* @__PURE__ */ s("div", { className: c("flex items-center gap-3", l ? "mb-1 h-9" : "mb-2 h-12", b ? "justify-center px-3" : "px-4"), children: [
216
+ /* @__PURE__ */ e(L, { className: "size-5 flex-shrink-0 rounded-control" }),
217
+ !b && /* @__PURE__ */ e(L, { className: "h-4 flex-1" })
218
+ ] }, p)) : t.map((n, p) => /* @__PURE__ */ s("div", { className: l ? "mb-3" : "mb-6", children: [
219
+ !b && n.title !== void 0 && n.title !== "" && /* @__PURE__ */ e("h3", { className: c("px-4 text-xs uppercase tracking-wider font-semibold text-sidebar-muted", l ? "mb-1" : "mb-2"), children: n.title }),
220
+ /* @__PURE__ */ e("nav", { className: c("flex flex-col", l ? "gap-0.5" : "gap-1"), children: n.items.map((o, m) => /* @__PURE__ */ e(re, { ...o, currentPath: f, collapsed: b, dense: l, onItemClick: D }, m)) })
221
+ ] }, p)) }),
222
+ N && /* @__PURE__ */ e("div", { className: c("border-t border-sidebar-border", l ? "p-2" : "p-4", b ? "flex justify-center" : ""), children: N })
223
+ ] });
224
+ return C ? /* @__PURE__ */ e(
225
+ Z,
226
+ {
227
+ open: T,
228
+ onOpenChange: (n) => {
229
+ k(!n);
230
+ },
231
+ children: /* @__PURE__ */ s(P, { side: "left", className: "w-[16rem] p-0 bg-sidebar border-r border-sidebar-border overflow-hidden [&>button]:text-sidebar-foreground", children: [
232
+ /* @__PURE__ */ e(I, { className: "sr-only", children: "Menu de navigation" }),
233
+ /* @__PURE__ */ e(ee, { className: "sr-only", children: "Navigation principale de l'application" }),
234
+ v
235
+ ] })
236
+ }
237
+ ) : /* @__PURE__ */ e(q, { delayDuration: 0, children: /* @__PURE__ */ e(
238
+ "aside",
239
+ {
240
+ className: c(
241
+ "flex flex-col bg-sidebar h-screen border-r border-sidebar-border transition-all duration-300",
242
+ b ? "w-[--navbar-width-icon]" : "w-[--navbar-width]",
243
+ "flex"
244
+ ),
245
+ style: {
246
+ "--navbar-width": "16rem",
247
+ "--navbar-width-icon": "4rem"
248
+ },
249
+ children: v
250
+ }
251
+ ) });
252
+ }, pe = ({
253
+ name: a = "appname",
254
+ subName: f = "appsubname",
255
+ // eslint-disable-next-line @typescript-eslint/naming-convention
256
+ icon: h,
257
+ dense: i = !1
258
+ }) => {
259
+ const { collapsed: r, isMobile: l } = E(), d = l ? !1 : r;
260
+ return /* @__PURE__ */ s("div", { className: c("flex items-center flex-shrink-0 gap-3 px-4", i ? "h-14" : "h-16 md:h-20", d ? "justify-center" : ""), children: [
261
+ h !== void 0 && /* @__PURE__ */ e("div", { className: "flex-shrink-0 text-sidebar-foreground", children: /* @__PURE__ */ e(h, { className: i ? "size-5" : "size-6" }) }),
262
+ !d && /* @__PURE__ */ s("div", { className: "flex flex-col", children: [
263
+ /* @__PURE__ */ e("h1", { className: c("font-bold text-sidebar-foreground leading-tight", i ? "text-base" : "text-lg"), children: a }),
264
+ /* @__PURE__ */ e("span", { className: c("text-sidebar-muted font-medium", i ? "text-[11px]" : "text-xs"), children: f })
265
+ ] })
266
+ ] });
267
+ }, xe = ({ collapsed: a, isMobile: f, onToggleSidebar: h, actionsNode: i, userMenuNode: r }) => /* @__PURE__ */ s(
268
+ "header",
269
+ {
270
+ className: c(
271
+ "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",
272
+ f && "left-0",
273
+ !f && a && "left-[5rem]",
274
+ !f && !a && "left-[16rem]"
275
+ ),
276
+ tabIndex: -1,
277
+ children: [
278
+ /* @__PURE__ */ e("div", { className: "flex items-center min-w-0 flex-1", children: /* @__PURE__ */ e(
279
+ O,
280
+ {
281
+ variant: "ghost",
282
+ size: "icon",
283
+ onClick: h,
284
+ className: "text-topbar-foreground hover:bg-topbar-accent hover:text-topbar-accent-foreground",
285
+ children: /* @__PURE__ */ e(M, { className: "size-4" })
286
+ }
287
+ ) }),
288
+ /* @__PURE__ */ s("div", { className: "flex items-center gap-2 md:gap-4 flex-shrink-0", children: [
289
+ i,
290
+ r
291
+ ] })
292
+ ]
293
+ }
294
+ );
295
+ export {
296
+ fe as G,
297
+ he as S,
298
+ xe as T,
299
+ pe as a,
300
+ re as b
301
+ };
@@ -1,5 +1,5 @@
1
1
  import { D as s, M as d } from "../../../MetricCard-B0xnFyim.js";
2
- import { K as o, a as C, S as t, b as p } from "../../../SkeletonCards-CyP7ZysR.js";
2
+ import { K as o, a as C, S as t, b as p } from "../../../SkeletonCards-63vDljXy.js";
3
3
  export {
4
4
  s as DashboardCard,
5
5
  o as KpiCard,
@@ -1,5 +1,6 @@
1
- import { A as i, C as s, F as g } from "../../../ConfirmationDialog-DZ6tvSwP.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-CKCJXGta.js";
1
+ import { A as i, C as s, F as g } from "../../../ConfirmationDialog-BoajNW2s.js";
2
+ import { D as r, a as D, b as e, c as t, d as p, e as f, f as m, g as n, h as C, i as x } from "../../../sheet-C-QvdRNi.js";
3
+ import { P } from "../../../toggle-group-DLLrEwv2.js";
3
4
  export {
4
5
  i as AppDialog,
5
6
  s as ConfirmationDialog,
@@ -7,12 +8,12 @@ export {
7
8
  D as DialogClose,
8
9
  e as DialogContent,
9
10
  t as DialogDescription,
10
- n as DialogFooter,
11
- p as DialogHeader,
12
- f as DialogOverlay,
13
- m as DialogPortal,
11
+ p as DialogFooter,
12
+ f as DialogHeader,
13
+ m as DialogOverlay,
14
+ n as DialogPortal,
14
15
  C as DialogTitle,
15
- F as DialogTrigger,
16
+ x as DialogTrigger,
16
17
  g as FormDialog,
17
18
  P as Progress
18
19
  };
@@ -1,4 +1,4 @@
1
- import { A as l, a as i, F as r, S as s, T as t } from "../../../TableFilter-BXf-oSjf.js";
1
+ import { A as l, a as i, F as r, S as s, T as t } from "../../../TableFilter-DP7cq0PU.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-DFTUIw-X.js";
1
+ import { G as o } from "../../../GenericForm-BPY5O-B6.js";
2
2
  export {
3
3
  o as GenericForm
4
4
  };
@@ -1,46 +1,47 @@
1
1
  import { D as e, M as o } from "../../MetricCard-B0xnFyim.js";
2
- import { K as t, a as i, S as l, b as p } from "../../SkeletonCards-CyP7ZysR.js";
3
- import { B as m, a as g, C as d, b as C, c, L as f, P as n, g as A } from "../../PieChart-D6y5EQnh.js";
4
- import { A as D, C as x, F as S } from "../../ConfirmationDialog-DZ6tvSwP.js";
5
- import { D as F, a as P, b as u, c as H, d as L, e as k, f as B, g as I, h as K, i as v, P as E } from "../../toggle-group-CKCJXGta.js";
6
- import { A as y, a as G, F as O, S as R, T as V } from "../../TableFilter-BXf-oSjf.js";
7
- import { G as N } from "../../GenericForm-DFTUIw-X.js";
8
- import { I as j } from "../../ImageInput-MzY2W495.js";
9
- import { D as w, a as J, S as Q, b as U } from "../../SearchInput-tz8UERbu.js";
10
- import { M as X } from "../../MultiSelect-V-RantiK.js";
11
- import { A as Z } from "../../AppActions-DeBcK3cv.js";
12
- import { A as aa, K as ra } from "../../KpiCardsLayout-fcfJK4ts.js";
13
- import { A as oa } from "../../AppSubTitle-CdIM6aXB.js";
14
- import { A as ta } from "../../AppTitle-D15YXeMx.js";
15
- import { S as la, a as pa, b as ba, T as ma } from "../../Topbar-CFmKB_S2.js";
16
- import { E as da } from "../../ErrorAlert-SrIcU1mM.js";
17
- import { E as ca } from "../../ErrorState-CmaxuJyW.js";
18
- import { L as na } from "../../LoadingState-BN0YaPSs.js";
19
- import { D as Ta, T as Da, a as xa, b as Sa, c as ha, d as Fa, e as Pa } from "../../DataTable-BDW0AEsH.js";
20
- import { A as Ha, a as La, b as ka, c as Ba } from "../../AppVerticalTabs-BlgIZ0mf.js";
21
- import { T as Ka } from "../../ThemeSelector-BFC37dSl.js";
2
+ import { K as t, a as i, S as l, b as p } from "../../SkeletonCards-63vDljXy.js";
3
+ import { B as m, a as g, C as c, b as d, c as f, L as C, P as n, g as A } from "../../PieChart-D6y5EQnh.js";
4
+ import { A as x, C as D, F as S } from "../../ConfirmationDialog-BoajNW2s.js";
5
+ import { D as F, a as P, b as u, c as H, d as L, e as k, f as B, g as G, h as I, i as K } from "../../sheet-C-QvdRNi.js";
6
+ import { P as E } from "../../toggle-group-DLLrEwv2.js";
7
+ import { A as y, a as O, F as R, S as V, T as z } from "../../TableFilter-DP7cq0PU.js";
8
+ import { G as _ } from "../../GenericForm-BPY5O-B6.js";
9
+ import { I as q } from "../../ImageInput-DOIglcpv.js";
10
+ import { D as J, a as Q, S as U, b as W } from "../../SearchInput-C-jCOSoi.js";
11
+ import { M as Y } from "../../MultiSelect-B60y82TF.js";
12
+ import { A as $ } from "../../AppActions-ViFjSupi.js";
13
+ import { A as ra, K as ea } from "../../KpiCardsLayout-D9NSC5Fb.js";
14
+ import { A as sa } from "../../AppSubTitle-ClHzadQW.js";
15
+ import { A as ia } from "../../AppTitle-D15YXeMx.js";
16
+ import { G as pa, S as ba, a as ma, b as ga, T as ca } from "../../Topbar-0EBMHLwG.js";
17
+ import { E as fa } from "../../ErrorAlert-SrIcU1mM.js";
18
+ import { E as na } from "../../ErrorState-CmaxuJyW.js";
19
+ import { L as Ta } from "../../LoadingState-BN0YaPSs.js";
20
+ import { D as Da, T as Sa, a as ha, b as Fa, c as Pa, d as ua, e as Ha } from "../../DataTable-BUcnJCi6.js";
21
+ import { A as ka, a as Ba, b as Ga, c as Ia } from "../../AppVerticalTabs-Cj66X8_R.js";
22
+ import { T as va } from "../../ThemeSelector-BFC37dSl.js";
22
23
  export {
23
24
  y as ActiveFilters,
24
- G as AdvancedFilters,
25
- Z as AppActions,
26
- D as AppDialog,
27
- aa as AppPageHeader,
28
- oa as AppSubTitle,
29
- Ha as AppTabContainer,
30
- La as AppTabHeader,
31
- ka as AppTabs,
32
- ta as AppTitle,
33
- Ba as AppVerticalTabs,
25
+ O as AdvancedFilters,
26
+ $ as AppActions,
27
+ x as AppDialog,
28
+ ra as AppPageHeader,
29
+ sa as AppSubTitle,
30
+ ka as AppTabContainer,
31
+ Ba as AppTabHeader,
32
+ Ga as AppTabs,
33
+ ia as AppTitle,
34
+ Ia as AppVerticalTabs,
34
35
  m as BarChartHorizontal,
35
36
  g as BarChartVertical,
36
- d as CHART_COLORS,
37
- C as ChartCard,
38
- c as CircularGauge,
39
- x as ConfirmationDialog,
37
+ c as CHART_COLORS,
38
+ d as ChartCard,
39
+ f as CircularGauge,
40
+ D as ConfirmationDialog,
40
41
  e as DashboardCard,
41
- Ta as DataTable,
42
- w as DatePicker,
43
- J as DateRangePicker,
42
+ Da as DataTable,
43
+ J as DatePicker,
44
+ Q as DateRangePicker,
44
45
  F as Dialog,
45
46
  P as DialogClose,
46
47
  u as DialogContent,
@@ -48,40 +49,41 @@ export {
48
49
  L as DialogFooter,
49
50
  k as DialogHeader,
50
51
  B as DialogOverlay,
51
- I as DialogPortal,
52
- K as DialogTitle,
53
- v as DialogTrigger,
54
- da as ErrorAlert,
55
- ca as ErrorState,
56
- O as FilterField,
52
+ G as DialogPortal,
53
+ I as DialogTitle,
54
+ K as DialogTrigger,
55
+ fa as ErrorAlert,
56
+ na as ErrorState,
57
+ R as FilterField,
57
58
  S as FormDialog,
58
- N as GenericForm,
59
- j as ImageInput,
59
+ _ as GenericForm,
60
+ pa as GlobalSearch,
61
+ q as ImageInput,
60
62
  t as KpiCard,
61
63
  i as KpiCards,
62
- ra as KpiCardsLayout,
63
- f as LineChart,
64
- na as LoadingState,
64
+ ea as KpiCardsLayout,
65
+ C as LineChart,
66
+ Ta as LoadingState,
65
67
  o as MetricCard,
66
- X as MultiSelect,
68
+ Y as MultiSelect,
67
69
  n as PieChart,
68
70
  E as Progress,
69
- Q as SearchInput,
70
- R as SearchableFilterPill,
71
- U as SearchableSelect,
72
- la as Sidebar,
73
- pa as SidebarHeader,
74
- ba as SidebarNavItem,
71
+ U as SearchInput,
72
+ V as SearchableFilterPill,
73
+ W as SearchableSelect,
74
+ ba as Sidebar,
75
+ ma as SidebarHeader,
76
+ ga as SidebarNavItem,
75
77
  l as SkeletonCard,
76
78
  p as SkeletonCards,
77
- Da as TableActions,
78
- xa as TableBody,
79
- Sa as TableBulkActions,
80
- V as TableFilter,
81
- ha as TableHeader,
82
- Fa as TablePagination,
83
- Pa as TableSettings,
84
- Ka as ThemeSelector,
85
- ma as Topbar,
79
+ Sa as TableActions,
80
+ ha as TableBody,
81
+ Fa as TableBulkActions,
82
+ z as TableFilter,
83
+ Pa as TableHeader,
84
+ ua as TablePagination,
85
+ Ha as TableSettings,
86
+ va as ThemeSelector,
87
+ ca as Topbar,
86
88
  A as getChartColor
87
89
  };
@@ -1,6 +1,6 @@
1
- import { I as r } from "../../../ImageInput-MzY2W495.js";
2
- import { D as c, a as o, S as s, b as p } from "../../../SearchInput-tz8UERbu.js";
3
- import { M as l } from "../../../MultiSelect-V-RantiK.js";
1
+ import { I as r } from "../../../ImageInput-DOIglcpv.js";
2
+ import { D as c, a as o, S as s, b as p } from "../../../SearchInput-C-jCOSoi.js";
3
+ import { M as l } from "../../../MultiSelect-B60y82TF.js";
4
4
  export {
5
5
  c as DatePicker,
6
6
  o as DateRangePicker,
@@ -1,6 +1,6 @@
1
- import { A as r } from "../../../AppActions-DeBcK3cv.js";
2
- import { A as e, K as A } from "../../../KpiCardsLayout-fcfJK4ts.js";
3
- import { A as s } from "../../../AppSubTitle-CdIM6aXB.js";
1
+ import { A as r } from "../../../AppActions-ViFjSupi.js";
2
+ import { A as e, K as A } from "../../../KpiCardsLayout-D9NSC5Fb.js";
3
+ import { A as s } from "../../../AppSubTitle-ClHzadQW.js";
4
4
  import { A as i } from "../../../AppTitle-D15YXeMx.js";
5
5
  export {
6
6
  r as AppActions,
@@ -0,0 +1,52 @@
1
+ import * as React from "react";
2
+ export interface GlobalSearchItem {
3
+ /** Identifiant stable de l'entrée : sert de clé React et de `value` cmdk. */
4
+ key: string;
5
+ label: string;
6
+ /** Seconde ligne, en plus discret : module parent, référence, date… */
7
+ description?: string;
8
+ icon?: React.ElementType;
9
+ /** Chemin de destination, laissé à la charge de l'appelant dans `onSelect`. */
10
+ path?: string;
11
+ }
12
+ export interface GlobalSearchGroup {
13
+ heading: string;
14
+ items: GlobalSearchItem[];
15
+ }
16
+ export interface GlobalSearchProps {
17
+ /** Résultats déjà filtrés et ordonnés par l'appelant, groupés par section. */
18
+ groups: GlobalSearchGroup[];
19
+ search: string;
20
+ onSearch: (value: string) => void;
21
+ onSelect: (item: GlobalSearchItem) => void;
22
+ loading?: boolean;
23
+ /** Mode contrôlé : sans ces props, la palette gère son ouverture elle-même. */
24
+ open?: boolean;
25
+ onOpenChange?: (open: boolean) => void;
26
+ /** Bouton loupe intégré. `false` quand l'application fournit son propre déclencheur. */
27
+ trigger?: boolean;
28
+ triggerLabel?: string;
29
+ /** Raccourci ⌘K / Ctrl+K. */
30
+ shortcut?: boolean;
31
+ shortcutLabel?: string;
32
+ placeholder?: string;
33
+ emptyLabel?: string;
34
+ loadingLabel?: string;
35
+ title?: string;
36
+ description?: string;
37
+ className?: string;
38
+ }
39
+ /**
40
+ * Recherche globale : un bouton loupe qui ouvre une palette de commande
41
+ * (⌘K / Ctrl+K) listant des résultats groupés.
42
+ *
43
+ * Le composant ne sait rien des données : il affiche les `groups` qu'on lui donne,
44
+ * remonte la saisie via `onSearch` et la sélection via `onSelect`. Les requêtes,
45
+ * le filtrage (pages, droits) et la navigation restent dans l'application.
46
+ *
47
+ * Le filtrage interne de cmdk est désactivé (`shouldFilter={false}`) : les résultats
48
+ * arrivent déjà filtrés en amont — côté serveur pour les données, sans accents pour
49
+ * les pages — et cmdk en masquerait une partie en refiltrant sur la saisie brute.
50
+ */
51
+ export declare const GlobalSearch: ({ groups, search, onSearch, onSelect, loading, open, onOpenChange, trigger, triggerLabel, shortcut, shortcutLabel, placeholder, emptyLabel, loadingLabel, title, description, className, }: GlobalSearchProps) => React.ReactElement;
52
+ //# sourceMappingURL=GlobalSearch.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"GlobalSearch.d.ts","sourceRoot":"","sources":["../../../../src/components/core/navbar/GlobalSearch.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,MAAM,WAAW,gBAAgB;IAC/B,6EAA6E;IAC7E,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,uEAAuE;IACvE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACzB,+EAA+E;IAC/E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,gBAAgB,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,iBAAiB;IAChC,8EAA8E;IAC9E,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,QAAQ,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;IAE3C,OAAO,CAAC,EAAE,OAAO,CAAC;IAElB,+EAA+E;IAC/E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IAEvC,wFAAwF;IACxF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,6BAA6B;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,YAAY,GAAI,4LAkB1B,iBAAiB,KAAG,KAAK,CAAC,YAiG5B,CAAC"}
@@ -1,3 +1,5 @@
1
+ export { GlobalSearch } from "./GlobalSearch";
2
+ export type { GlobalSearchProps, GlobalSearchItem, GlobalSearchGroup } from "./GlobalSearch";
1
3
  export { Sidebar } from "./Sidebar";
2
4
  export type { SidebarProps, SidebarItem, SidebarGroup, SidebarSubItem, SidebarSlots, SidebarSearch } from "./Sidebar";
3
5
  export { SidebarHeader } from "./SidebarHeader";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/core/navbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACtH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/core/navbar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,YAAY,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AACtH,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC"}
@@ -1,7 +1,8 @@
1
- import { S as r, a as b, b as d, T as s } from "../../../Topbar-CFmKB_S2.js";
1
+ import { G as r, S as b, a as s, b as S, T as d } from "../../../Topbar-0EBMHLwG.js";
2
2
  export {
3
- r as Sidebar,
4
- b as SidebarHeader,
5
- d as SidebarNavItem,
6
- s as Topbar
3
+ r as GlobalSearch,
4
+ b as Sidebar,
5
+ s as SidebarHeader,
6
+ S as SidebarNavItem,
7
+ d as Topbar
7
8
  };
@@ -1,4 +1,4 @@
1
- import { D as s, T as b, a as l, b as T, c as t, d as o, e as i } from "../../../DataTable-BDW0AEsH.js";
1
+ import { D as s, T as b, a as l, b as T, c as t, d as o, e as i } from "../../../DataTable-BUcnJCi6.js";
2
2
  export {
3
3
  s as DataTable,
4
4
  b as TableActions,
@@ -1,4 +1,4 @@
1
- import { A as s, a as b, b as e, c as r } from "../../../AppVerticalTabs-BlgIZ0mf.js";
1
+ import { A as s, a as b, b as e, c as r } from "../../../AppVerticalTabs-Cj66X8_R.js";
2
2
  export {
3
3
  s as AppTabContainer,
4
4
  b as AppTabHeader,