@etic-insa/ui 0.3.0 → 0.4.0

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 (46) hide show
  1. package/README.md +110 -73
  2. package/dist/components/etic/app-shell.d.ts +4 -1
  3. package/dist/components/etic/app-shell.js +150 -113
  4. package/dist/components/etic/app-shell.js.map +1 -1
  5. package/dist/components/etic/data-table-bulk-actions.d.ts +15 -2
  6. package/dist/components/etic/data-table-bulk-actions.js +100 -53
  7. package/dist/components/etic/data-table-bulk-actions.js.map +1 -1
  8. package/dist/components/etic/data-table-focus.d.ts +1 -1
  9. package/dist/components/etic/data-table-focus.js.map +1 -1
  10. package/dist/components/etic/data-table.d.ts +12 -4
  11. package/dist/components/etic/data-table.js +199 -223
  12. package/dist/components/etic/data-table.js.map +1 -1
  13. package/dist/components/etic/delete-button.d.ts +2 -2
  14. package/dist/components/etic/delete-button.js.map +1 -1
  15. package/dist/components/etic/detail-list.d.ts +3 -1
  16. package/dist/components/etic/detail-list.js +1 -1
  17. package/dist/components/etic/detail-list.js.map +1 -1
  18. package/dist/components/etic/disclosure.js +1 -0
  19. package/dist/components/etic/disclosure.js.map +1 -1
  20. package/dist/components/etic/icon-toggle.js +1 -1
  21. package/dist/components/etic/icon-toggle.js.map +1 -1
  22. package/dist/components/etic/page-header.d.ts +12 -4
  23. package/dist/components/etic/page-header.js +27 -16
  24. package/dist/components/etic/page-header.js.map +1 -1
  25. package/dist/components/etic/removable-badge.js +26 -18
  26. package/dist/components/etic/removable-badge.js.map +1 -1
  27. package/dist/components/etic/save-bar.d.ts +4 -3
  28. package/dist/components/etic/save-bar.js +2 -2
  29. package/dist/components/etic/save-bar.js.map +1 -1
  30. package/dist/components/etic/stat-tile.d.ts +9 -2
  31. package/dist/components/etic/stat-tile.js +32 -18
  32. package/dist/components/etic/stat-tile.js.map +1 -1
  33. package/dist/components/etic/theme-menu.d.ts +28 -0
  34. package/dist/components/etic/theme-menu.js +62 -35
  35. package/dist/components/etic/theme-menu.js.map +1 -1
  36. package/dist/components/etic/toggletip.js +3 -3
  37. package/dist/components/etic/toggletip.js.map +1 -1
  38. package/dist/components/etic/tooltip-button.d.ts +7 -3
  39. package/dist/components/etic/tooltip-button.js +2 -2
  40. package/dist/components/etic/tooltip-button.js.map +1 -1
  41. package/dist/components/ui/button.js +2 -2
  42. package/dist/components/ui/button.js.map +1 -1
  43. package/dist/components/ui/select.js +3 -3
  44. package/dist/components/ui/select.js.map +1 -1
  45. package/dist/styles.css +107 -69
  46. package/package.json +1 -1
@@ -1,20 +1,20 @@
1
1
  import { AlertDialog as e, AlertDialogAction as t, AlertDialogCancel as n, AlertDialogContent as r, AlertDialogDescription as i, AlertDialogFooter as a, AlertDialogHeader as o, AlertDialogTitle as s } from "../ui/alert-dialog.js";
2
- import { Avatar as c, AvatarFallback as l, AvatarImage as u } from "../ui/avatar.js";
3
- import { DropdownMenu as d, DropdownMenuContent as f, DropdownMenuGroup as p, DropdownMenuItem as m, DropdownMenuSeparator as h, DropdownMenuTrigger as g } from "../ui/dropdown-menu.js";
4
- import { Sidebar as _, SidebarContent as v, SidebarFooter as y, SidebarGroup as b, SidebarGroupContent as x, SidebarGroupLabel as S, SidebarHeader as C, SidebarInset as w, SidebarMenu as T, SidebarMenuButton as E, SidebarMenuItem as D, SidebarProvider as O, SidebarRail as k, SidebarTrigger as A, useSidebar as j } from "../ui/sidebar.js";
5
- import { TooltipProvider as M } from "../ui/tooltip.js";
6
- import { GOUTTIERES_PAGE as N } from "./page-container.js";
7
- import { ThemeMenu as P } from "./theme-menu.js";
8
- import { TooltipButton as F } from "./tooltip-button.js";
9
- import { useLien as I } from "./lien.js";
10
- import { cn as L } from "cn";
11
- import { useId as R, useState as z } from "react";
12
- import { Fragment as B, jsx as V, jsxs as H } from "react/jsx-runtime";
13
- import { ChevronsUpDownIcon as U, LogOutIcon as W, PanelLeftIcon as G } from "lucide-react";
2
+ import { Avatar as c, AvatarFallback as ee, AvatarImage as l } from "../ui/avatar.js";
3
+ import { DropdownMenu as u, DropdownMenuContent as te, DropdownMenuGroup as d, DropdownMenuItem as f, DropdownMenuLabel as p, DropdownMenuSeparator as m, DropdownMenuSub as h, DropdownMenuSubContent as g, DropdownMenuSubTrigger as _, DropdownMenuTrigger as v } from "../ui/dropdown-menu.js";
4
+ import { Sidebar as y, SidebarContent as b, SidebarFooter as x, SidebarGroup as S, SidebarGroupContent as C, SidebarGroupLabel as w, SidebarHeader as T, SidebarInset as E, SidebarMenu as D, SidebarMenuButton as O, SidebarMenuItem as k, SidebarProvider as ne, SidebarRail as A, SidebarTrigger as j, useSidebar as M } from "../ui/sidebar.js";
5
+ import { TooltipProvider as N } from "../ui/tooltip.js";
6
+ import { GOUTTIERES_PAGE as P } from "./page-container.js";
7
+ import { EchecTheme as F, ThemeMenu as I, ThemeRadioGroup as L, themeActuel as R, useChoixTheme as z } from "./theme-menu.js";
8
+ import { TooltipButton as B } from "./tooltip-button.js";
9
+ import { useLien as V } from "./lien.js";
10
+ import { cn as H } from "cn";
11
+ import { useId as U, useState as W } from "react";
12
+ import { Fragment as G, jsx as K, jsxs as q } from "react/jsx-runtime";
13
+ import { ChevronsUpDownIcon as J, LogOutIcon as Y, PanelLeftIcon as X } from "lucide-react";
14
14
  // src/components/etic/app-shell.tsx
15
- function K({ application: e, sections: t, compte: n, theme: r, lien: i, bandeau: a, children: o }) {
16
- let s = I(i), c = R();
17
- return /* @__PURE__ */ H(M, { children: [/* @__PURE__ */ V("a", {
15
+ function re({ application: e, sections: t, compte: n, theme: r, lien: i, bandeau: a, children: o }) {
16
+ let s = V(i), c = U();
17
+ return /* @__PURE__ */ q(N, { children: [/* @__PURE__ */ K("a", {
18
18
  href: `#${c}`,
19
19
  "data-slot": "app-shell-skip-link",
20
20
  onClick: (e) => {
@@ -22,43 +22,44 @@ function K({ application: e, sections: t, compte: n, theme: r, lien: i, bandeau:
22
22
  },
23
23
  className: "sr-only rounded-md bg-background px-3 py-2 text-sm font-medium shadow-md ring-3 ring-ring/50 outline-none focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-50",
24
24
  children: "Aller au contenu"
25
- }), /* @__PURE__ */ H(O, {
26
- defaultOpen: !q(),
27
- children: [/* @__PURE__ */ H(X, { children: [
28
- /* @__PURE__ */ H(C, {
25
+ }), /* @__PURE__ */ q(ne, {
26
+ defaultOpen: !ie(),
27
+ children: [/* @__PURE__ */ q(oe, { children: [
28
+ /* @__PURE__ */ q(T, {
29
29
  className: "flex-row items-center group-data-[collapsible=icon]:flex-col",
30
- children: [/* @__PURE__ */ V(Q, {
30
+ children: [/* @__PURE__ */ K(se, {
31
31
  application: e,
32
32
  Lien: s
33
- }), /* @__PURE__ */ V(Y, {})]
33
+ }), /* @__PURE__ */ K(ae, {})]
34
34
  }),
35
- /* @__PURE__ */ V(v, { children: /* @__PURE__ */ V($, {
35
+ /* @__PURE__ */ K(b, { children: /* @__PURE__ */ K(ce, {
36
36
  sections: t,
37
37
  Lien: s
38
38
  }) }),
39
- n || r ? /* @__PURE__ */ H(y, {
39
+ n || r ? /* @__PURE__ */ K(x, {
40
40
  className: "flex-row items-center gap-2 group-data-[collapsible=icon]:flex-col",
41
- children: [n ? /* @__PURE__ */ V(ee, {
41
+ children: n ? /* @__PURE__ */ K($, {
42
42
  compte: n,
43
+ theme: r,
43
44
  Lien: s
44
- }) : null, r ? /* @__PURE__ */ V(P, {
45
+ }) : r ? /* @__PURE__ */ K(I, {
45
46
  ...r,
46
47
  side: "top",
47
- className: "size-12 shrink-0 bg-sidebar group-data-[collapsible=icon]:size-8"
48
- }) : null]
48
+ className: "size-12 shrink-0 bg-sidebar group-data-[collapsible=icon]:size-8 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground aria-expanded:bg-sidebar-accent aria-expanded:text-sidebar-accent-foreground dark:bg-sidebar dark:hover:bg-sidebar-accent"
49
+ }) : null
49
50
  }) : null
50
- ] }), /* @__PURE__ */ H(w, {
51
+ ] }), /* @__PURE__ */ q(E, {
51
52
  id: c,
52
53
  tabIndex: -1,
53
54
  className: "min-w-0 bg-page outline-none",
54
55
  children: [
55
- /* @__PURE__ */ V(te, {
56
+ /* @__PURE__ */ K(ue, {
56
57
  application: e,
57
58
  Lien: s
58
59
  }),
59
- /* @__PURE__ */ V("div", {
60
+ /* @__PURE__ */ K("div", {
60
61
  "data-slot": "app-shell-bandeau",
61
- className: L("empty:hidden", N.laterales, N.haute),
62
+ className: H("empty:hidden", P.laterales, P.haute),
62
63
  children: a
63
64
  }),
64
65
  o
@@ -66,15 +67,15 @@ function K({ application: e, sections: t, compte: n, theme: r, lien: i, bandeau:
66
67
  })]
67
68
  })] });
68
69
  }
69
- function q() {
70
+ function ie() {
70
71
  return typeof document < "u" && /(?:^|;\s*)sidebar_state=false(?:;|$)/.test(document.cookie);
71
72
  }
72
- var J = "data-ferme-tiroir";
73
- function Y() {
74
- let { isMobile: e, open: t, toggleSidebar: n } = j();
73
+ var Z = "data-ferme-tiroir";
74
+ function ae() {
75
+ let { isMobile: e, open: t, toggleSidebar: n } = M();
75
76
  if (e) return null;
76
77
  let r = t ? "Replier le menu" : "Déplier le menu";
77
- return /* @__PURE__ */ V(F, {
78
+ return /* @__PURE__ */ K(B, {
78
79
  variant: "ghost",
79
80
  size: "icon-sm",
80
81
  "aria-label": r,
@@ -83,43 +84,43 @@ function Y() {
83
84
  "data-slot": "app-shell-collapse",
84
85
  className: "shrink-0",
85
86
  onClick: n,
86
- children: /* @__PURE__ */ V(G, {})
87
+ children: /* @__PURE__ */ K(X, {})
87
88
  });
88
89
  }
89
- function X({ children: e }) {
90
- let { isMobile: t, setOpenMobile: n } = j();
91
- return /* @__PURE__ */ H(_, {
90
+ function oe({ children: e }) {
91
+ let { isMobile: t, setOpenMobile: n } = M();
92
+ return /* @__PURE__ */ q(y, {
92
93
  collapsible: "icon",
93
- children: [/* @__PURE__ */ V("div", {
94
+ children: [/* @__PURE__ */ K("div", {
94
95
  className: "contents",
95
96
  onClick: (e) => {
96
- !t || e.ctrlKey || e.metaKey || e.shiftKey || e.target.closest(`a[href], [${J}]`) && n(!1);
97
+ !t || e.ctrlKey || e.metaKey || e.shiftKey || e.target.closest(`a[href], [${Z}]`) && n(!1);
97
98
  },
98
99
  children: e
99
- }), /* @__PURE__ */ V(k, {})]
100
+ }), /* @__PURE__ */ K(A, {})]
100
101
  });
101
102
  }
102
- function Z({ application: e, className: t }) {
103
- return e.logo ? /* @__PURE__ */ V("span", {
104
- className: L("flex shrink-0 items-center justify-center [&_img]:size-full [&_svg]:size-full", t),
103
+ function Q({ application: e, className: t }) {
104
+ return e.logo ? /* @__PURE__ */ K("span", {
105
+ className: H("flex shrink-0 items-center justify-center [&_img]:size-full [&_svg]:size-full", t),
105
106
  children: e.logo
106
107
  }) : null;
107
108
  }
108
- function Q({ application: e, Lien: t }) {
109
- return /* @__PURE__ */ V(T, {
109
+ function se({ application: e, Lien: t }) {
110
+ return /* @__PURE__ */ K(D, {
110
111
  className: "min-w-0 flex-1",
111
- children: /* @__PURE__ */ V(D, { children: /* @__PURE__ */ H(E, {
112
+ children: /* @__PURE__ */ K(k, { children: /* @__PURE__ */ q(O, {
112
113
  size: "lg",
113
- render: /* @__PURE__ */ V(t, { href: e.href ?? "/" }),
114
- children: [/* @__PURE__ */ V(Z, {
114
+ render: /* @__PURE__ */ K(t, { href: e.href ?? "/" }),
115
+ children: [/* @__PURE__ */ K(Q, {
115
116
  application: e,
116
- className: "size-7"
117
- }), /* @__PURE__ */ H("span", {
117
+ className: "size-8"
118
+ }), /* @__PURE__ */ q("span", {
118
119
  className: "grid flex-1 text-left leading-tight",
119
- children: [/* @__PURE__ */ V("span", {
120
+ children: [/* @__PURE__ */ K("span", {
120
121
  className: "truncate font-semibold",
121
122
  children: e.nom
122
- }), e.sousTitre ? /* @__PURE__ */ V("span", {
123
+ }), e.sousTitre ? /* @__PURE__ */ K("span", {
123
124
  className: "truncate text-xs text-muted-foreground",
124
125
  children: e.sousTitre
125
126
  }) : null]
@@ -127,99 +128,135 @@ function Q({ application: e, Lien: t }) {
127
128
  }) })
128
129
  });
129
130
  }
130
- function $({ sections: e, Lien: t }) {
131
- return /* @__PURE__ */ V("nav", {
131
+ function ce({ sections: e, Lien: t }) {
132
+ return /* @__PURE__ */ K("nav", {
132
133
  "aria-label": "Navigation principale",
133
- children: e.map((e, n) => /* @__PURE__ */ H(b, { children: [e.titre ? /* @__PURE__ */ V(S, { children: e.titre }) : null, /* @__PURE__ */ V(x, { children: /* @__PURE__ */ V(T, { children: e.liens.map(({ libelle: e, href: n, icone: r, actif: i }, a) => /* @__PURE__ */ V(D, { children: /* @__PURE__ */ H(E, {
134
+ children: e.map((e, n) => /* @__PURE__ */ q(S, { children: [e.titre ? /* @__PURE__ */ K(w, { children: e.titre }) : null, /* @__PURE__ */ K(C, { children: /* @__PURE__ */ K(D, { children: e.liens.map(({ libelle: e, href: n, icone: r, actif: i }, a) => /* @__PURE__ */ K(k, { children: /* @__PURE__ */ q(O, {
134
135
  isActive: i,
135
136
  tooltip: e,
136
- render: /* @__PURE__ */ V(t, {
137
+ render: /* @__PURE__ */ K(t, {
137
138
  href: n,
138
139
  "aria-current": i ? "page" : void 0
139
140
  }),
140
- children: [r ? /* @__PURE__ */ V(r, {}) : null, /* @__PURE__ */ V("span", {
141
+ children: [r ? /* @__PURE__ */ K(r, {}) : null, /* @__PURE__ */ K("span", {
141
142
  title: e,
142
143
  children: e
143
144
  })]
144
145
  }) }, a)) }) })] }, n))
145
146
  });
146
147
  }
147
- function ee({ compte: _, Lien: v }) {
148
- let [y, b] = z(!1);
149
- return /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(T, {
150
- className: "min-w-0 flex-1",
151
- children: /* @__PURE__ */ V(D, { children: /* @__PURE__ */ H(d, { children: [/* @__PURE__ */ H(g, {
152
- render: /* @__PURE__ */ V(E, {
153
- size: "lg",
154
- isActive: _.actif,
155
- "aria-label": `${_.nom}, menu du compte`,
156
- className: "data-popup-open:bg-sidebar-accent data-popup-open:text-sidebar-accent-foreground"
157
- }),
158
- children: [
159
- /* @__PURE__ */ H(c, { children: [_.photo ? /* @__PURE__ */ V(u, {
160
- src: _.photo,
161
- alt: ""
162
- }) : null, /* @__PURE__ */ V(l, { children: _.initiales })] }),
163
- /* @__PURE__ */ H("span", {
164
- className: "grid flex-1 text-left leading-tight",
165
- children: [/* @__PURE__ */ V("span", {
166
- className: "truncate font-medium",
167
- children: _.nom
168
- }), _.detail ? /* @__PURE__ */ V("span", {
169
- className: "truncate text-xs text-muted-foreground",
170
- children: _.detail
171
- }) : null]
148
+ function le({ valeur: e, onChoisir: t }) {
149
+ let { isMobile: n } = M(), { libelle: r, Icone: i } = R(e);
150
+ return n ? /* @__PURE__ */ q(d, { children: [/* @__PURE__ */ K(p, { children: "Thème de l'interface" }), /* @__PURE__ */ K(L, {
151
+ valeur: e,
152
+ onChoisir: t
153
+ })] }) : /* @__PURE__ */ q(h, { children: [/* @__PURE__ */ q(_, { children: [/* @__PURE__ */ K(i, {}), r] }), /* @__PURE__ */ K(g, {
154
+ className: "w-40",
155
+ children: /* @__PURE__ */ K(L, {
156
+ valeur: e,
157
+ onChoisir: t
158
+ })
159
+ })] });
160
+ }
161
+ function $({ compte: p, theme: h, Lien: g }) {
162
+ let [_, y] = W(!1), { echec: b, effacerEchec: x, choisir: S } = z({
163
+ valeur: h?.valeur ?? "system",
164
+ onValeurChange: h?.onValeurChange ?? (() => {})
165
+ });
166
+ return /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ q(D, {
167
+ className: "relative min-w-0 flex-1",
168
+ children: [/* @__PURE__ */ K(k, { children: /* @__PURE__ */ q(u, {
169
+ onOpenChange: (e) => e && x(),
170
+ children: [/* @__PURE__ */ q(v, {
171
+ render: /* @__PURE__ */ K(O, {
172
+ size: "lg",
173
+ isActive: p.actif,
174
+ "aria-label": `${p.nom}, menu du compte`,
175
+ className: "rounded-lg data-popup-open:bg-sidebar-accent data-popup-open:text-sidebar-accent-foreground"
172
176
  }),
173
- /* @__PURE__ */ V(U, { className: "ml-auto" })
174
- ]
175
- }), /* @__PURE__ */ H(f, {
176
- side: "top",
177
- align: "start",
178
- className: "min-w-56",
179
- children: [_.entrees?.length ? /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(p, { children: _.entrees.map(({ libelle: e, icone: t, href: n, onChoisir: r }, i) => /* @__PURE__ */ H(m, {
180
- render: n ? /* @__PURE__ */ V(v, { href: n }) : void 0,
181
- onClick: r,
182
- [J]: !0,
183
- children: [t ? /* @__PURE__ */ V(t, {}) : null, e]
184
- }, i)) }), /* @__PURE__ */ V(h, {})] }) : null, /* @__PURE__ */ H(m, {
185
- onClick: () => b(!0),
186
- children: [/* @__PURE__ */ V(W, {}), "Se déconnecter"]
177
+ children: [
178
+ /* @__PURE__ */ q(c, {
179
+ className: "rounded-lg after:rounded-lg",
180
+ children: [p.photo ? /* @__PURE__ */ K(l, {
181
+ src: p.photo,
182
+ alt: "",
183
+ className: "rounded-lg"
184
+ }) : null, /* @__PURE__ */ K(ee, {
185
+ className: "rounded-lg",
186
+ children: p.initiales
187
+ })]
188
+ }),
189
+ /* @__PURE__ */ q("span", {
190
+ className: "grid flex-1 text-left leading-tight",
191
+ children: [/* @__PURE__ */ K("span", {
192
+ className: "truncate font-medium",
193
+ children: p.nom
194
+ }), p.detail ? /* @__PURE__ */ K("span", {
195
+ className: "truncate text-xs text-muted-foreground",
196
+ children: p.detail
197
+ }) : null]
198
+ }),
199
+ /* @__PURE__ */ K(J, { className: "ml-auto" })
200
+ ]
201
+ }), /* @__PURE__ */ q(te, {
202
+ side: "top",
203
+ align: "start",
204
+ className: "min-w-56",
205
+ children: [
206
+ p.entrees?.length ? /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(d, { children: p.entrees.map(({ libelle: e, icone: t, href: n, onChoisir: r }, i) => /* @__PURE__ */ q(f, {
207
+ render: n ? /* @__PURE__ */ K(g, { href: n }) : void 0,
208
+ onClick: r,
209
+ [Z]: !0,
210
+ children: [t ? /* @__PURE__ */ K(t, {}) : null, e]
211
+ }, i)) }), /* @__PURE__ */ K(m, {})] }) : null,
212
+ h ? /* @__PURE__ */ q(G, { children: [/* @__PURE__ */ K(le, {
213
+ valeur: h.valeur,
214
+ onChoisir: S
215
+ }), /* @__PURE__ */ K(m, {})] }) : null,
216
+ /* @__PURE__ */ q(f, {
217
+ onClick: () => y(!0),
218
+ children: [/* @__PURE__ */ K(Y, {}), "Se déconnecter"]
219
+ })
220
+ ]
187
221
  })]
188
- })] }) })
189
- }), /* @__PURE__ */ V(e, {
190
- open: y,
191
- onOpenChange: b,
192
- children: /* @__PURE__ */ H(r, { children: [/* @__PURE__ */ H(o, { children: [/* @__PURE__ */ V(s, { children: "Se déconnecter" }), /* @__PURE__ */ V(i, { children: "Voulez-vous vraiment vous déconnecter ?" })] }), /* @__PURE__ */ H(a, { children: [/* @__PURE__ */ V(n, { children: "Annuler" }), /* @__PURE__ */ V(t, {
222
+ }) }), b ? /* @__PURE__ */ K(F, {
223
+ side: "top",
224
+ className: "left-0"
225
+ }) : null]
226
+ }), /* @__PURE__ */ K(e, {
227
+ open: _,
228
+ onOpenChange: y,
229
+ children: /* @__PURE__ */ q(r, { children: [/* @__PURE__ */ q(o, { children: [/* @__PURE__ */ K(s, { children: "Se déconnecter" }), /* @__PURE__ */ K(i, { children: "Voulez-vous vraiment vous déconnecter ?" })] }), /* @__PURE__ */ q(a, { children: [/* @__PURE__ */ K(n, { children: "Annuler" }), /* @__PURE__ */ K(t, {
193
230
  variant: "destructive",
194
231
  onClick: () => {
195
- b(!1), _.onSeDeconnecter();
232
+ y(!1), p.onSeDeconnecter();
196
233
  },
197
234
  children: "Se déconnecter"
198
235
  })] })] })
199
236
  })] });
200
237
  }
201
- function te({ application: e, Lien: t }) {
202
- let { isMobile: n, openMobile: r } = j();
203
- return n ? /* @__PURE__ */ H("header", {
238
+ function ue({ application: e, Lien: t }) {
239
+ let { isMobile: n, openMobile: r } = M();
240
+ return n ? /* @__PURE__ */ q("header", {
204
241
  "data-slot": "app-shell-mobile-bar",
205
242
  className: "sticky top-0 z-10 flex h-12 shrink-0 items-center gap-2 border-b bg-page px-2",
206
- children: [/* @__PURE__ */ V(A, {
243
+ children: [/* @__PURE__ */ K(j, {
207
244
  libelle: "Ouvrir le menu",
208
245
  "aria-expanded": r,
209
246
  className: "size-9"
210
- }), /* @__PURE__ */ H(t, {
247
+ }), /* @__PURE__ */ q(t, {
211
248
  href: e.href ?? "/",
212
249
  className: "flex min-w-0 items-center gap-2 rounded-md px-1 font-semibold outline-none focus-visible:ring-2 focus-visible:ring-ring",
213
- children: [/* @__PURE__ */ V(Z, {
250
+ children: [/* @__PURE__ */ K(Q, {
214
251
  application: e,
215
252
  className: "size-6"
216
- }), /* @__PURE__ */ V("span", {
253
+ }), /* @__PURE__ */ K("span", {
217
254
  className: "truncate",
218
255
  children: e.nom
219
256
  })]
220
257
  })]
221
258
  }) : null;
222
259
  }
223
- export { K as AppShell };
260
+ export { re as AppShell };
224
261
 
225
262
  //# sourceMappingURL=app-shell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"app-shell.js","names":["_Fragment","Fragment$1","AppShell","Lien","useLien","lien","idContenu","useId","TooltipProvider","event","SidebarProvider","colonneRepliee","Colonne","SidebarHeader","Marque","BoutonRepli","SidebarContent","Navigation","compte","theme","SidebarFooter","MenuCompte","ThemeMenu","SidebarInset","BarreMobile","cn","GOUTTIERES_PAGE","bandeau","children","FERME_TIROIR","useSidebar","isMobile","libelle","open","TooltipButton","toggleSidebar","PanelLeftIcon","Sidebar","setOpenMobile","SidebarRail","Logo","application","className","SidebarMenu","SidebarMenuItem","SidebarMenuButton","sections","SidebarGroup","section","SidebarGroupLabel","SidebarGroupContent","Icone","actif","i","index","confirmer","setConfirmer","useState","DropdownMenu","DropdownMenuTrigger","Avatar","AvatarImage","AvatarFallback","ChevronsUpDownIcon","DropdownMenuContent","DropdownMenuGroup","DropdownMenuItem","href","onChoisir","DropdownMenuSeparator","LogOutIcon","AlertDialog","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","SidebarTrigger","openMobile"],"sources":["../../../src/components/etic/app-shell.tsx"],"sourcesContent":["import { useId, useState, type ReactNode } from \"react\"\nimport { cn } from \"cn\"\nimport {\n ChevronsUpDownIcon,\n LogOutIcon,\n PanelLeftIcon,\n type LucideIcon,\n} from \"lucide-react\"\n\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from \"@etic-ui/components/ui/alert-dialog\"\nimport {\n Avatar,\n AvatarFallback,\n AvatarImage,\n} from \"@etic-ui/components/ui/avatar\"\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuSeparator,\n DropdownMenuTrigger,\n} from \"@etic-ui/components/ui/dropdown-menu\"\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInset,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarProvider,\n SidebarRail,\n SidebarTrigger,\n useSidebar,\n} from \"@etic-ui/components/ui/sidebar\"\nimport { TooltipProvider } from \"@etic-ui/components/ui/tooltip\"\nimport { GOUTTIERES_PAGE } from \"@etic-ui/components/etic/page-container\"\nimport {\n ThemeMenu,\n type ThemeMenuProps,\n} from \"@etic-ui/components/etic/theme-menu\"\nimport { TooltipButton } from \"@etic-ui/components/etic/tooltip-button\"\nimport { useLien, type LienComposant } from \"@etic-ui/components/etic/lien\"\n\n/** @deprecated Nom de la 0.2.0 : utiliser `LienComposant`. */\nexport type AppShellLienComposant = LienComposant\n\nexport interface AppShellLien {\n libelle: string\n href: string\n icone?: LucideIcon\n /** Page à l'écran. Calculé par l'application, seule à savoir qu'une fiche\n * appartient à telle rubrique. */\n actif?: boolean\n}\n\nexport interface AppShellSection {\n titre?: string\n liens: AppShellLien[]\n}\n\n/** Entrée du menu du compte : un lien, ou une action. */\nexport type AppShellEntreeCompte = {\n libelle: string\n icone?: LucideIcon\n} & (\n { href: string; onChoisir?: never } | { onChoisir: () => void; href?: never }\n)\n\nexport interface AppShellCompte {\n /** « Prénom Nom », ou le rôle d'un compte fonctionnel. */\n nom: string\n /** Seconde ligne, l'adresse par exemple. */\n detail?: string\n initiales: string\n /** Photo ; les initiales s'affichent tant qu'elle manque ou charge. */\n photo?: string | null\n /** La fiche du compte est la page à l'écran. */\n actif?: boolean\n /** Entrées du menu du compte, avant « Se déconnecter ». */\n entrees?: AppShellEntreeCompte[]\n /** Appelé après confirmation. */\n onSeDeconnecter: () => void\n}\n\nexport interface AppShellProps {\n application: {\n nom: string\n sousTitre?: string\n /** Image ou icône, 28 px de côté environ. */\n logo?: ReactNode\n /** Lien de la marque ; « / » par défaut. */\n href?: string\n }\n sections: AppShellSection[]\n compte?: AppShellCompte\n theme?: Pick<ThemeMenuProps, \"valeur\" | \"onValeurChange\">\n /** Composant de lien du routeur ; par défaut, celui du `LienProvider`,\n * sinon un `<a>`. */\n lien?: LienComposant\n /**\n * Au-dessus du contenu, avec les gouttières de `PageContainer` : message\n * qui concerne toute l'application (reprise de session impossible…). Il\n * prend toute la largeur du contenu : la coquille ignore la `largeur` de\n * la page, si bien qu'il déborde d'une page étroite (`largeur=\"md\"`) sur\n * grand écran. Un message propre à une page se place dans son\n * `PageContainer`.\n */\n bandeau?: ReactNode\n children: ReactNode\n}\n\n/**\n * Coquille commune des applications ETIC : la barre latérale de shadcn\n * (navigation par rubriques, menu du compte, thème), qui devient un tiroir\n * sous 1 025 px, ouvert par une barre du haut. Le tiroir se referme quand on\n * suit un de ses liens. Ne connaît ni le routeur ni l'authentification : l'application\n * fournit les liens, l'état actif, le compte et le thème.\n *\n * Un lien « Aller au contenu », visible au focus, ouvre la tabulation : il\n * saute la navigation et met le focus sur le `<main>`.\n */\nexport function AppShell({\n application,\n sections,\n compte,\n theme,\n lien,\n bandeau,\n children,\n}: AppShellProps) {\n const Lien = useLien(lien)\n const idContenu = useId()\n return (\n <TooltipProvider>\n <a\n href={`#${idContenu}`}\n data-slot=\"app-shell-skip-link\"\n onClick={(event) => {\n // Le focus, pas seulement le défilement ; et pas de `#…` ajouté à\n // l'adresse, que le routeur de l'application lirait.\n event.preventDefault()\n document.getElementById(idContenu)?.focus()\n }}\n className=\"sr-only rounded-md bg-background px-3 py-2 text-sm font-medium shadow-md ring-3 ring-ring/50 outline-none focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-50\"\n >\n Aller au contenu\n </a>\n <SidebarProvider defaultOpen={!colonneRepliee()}>\n <Colonne>\n <SidebarHeader className=\"flex-row items-center group-data-[collapsible=icon]:flex-col\">\n <Marque application={application} Lien={Lien} />\n <BoutonRepli />\n </SidebarHeader>\n <SidebarContent>\n <Navigation sections={sections} Lien={Lien} />\n </SidebarContent>\n {compte || theme ? (\n <SidebarFooter className=\"flex-row items-center gap-2 group-data-[collapsible=icon]:flex-col\">\n {compte ? <MenuCompte compte={compte} Lien={Lien} /> : null}\n {theme ? (\n <ThemeMenu\n {...theme}\n side=\"top\"\n className=\"size-12 shrink-0 bg-sidebar group-data-[collapsible=icon]:size-8\"\n />\n ) : null}\n </SidebarFooter>\n ) : null}\n </Colonne>\n <SidebarInset\n id={idContenu}\n tabIndex={-1}\n // Fond de page (bg-page) au lieu de bg-background (shadcn).\n className=\"min-w-0 bg-page outline-none\"\n >\n <BarreMobile application={application} Lien={Lien} />\n {/* Gouttières de `PageContainer`, qui suit et pose sa propre marge\n haute. Masqué quand le bandeau est absent ou ne rend rien\n (`ErrorBanner` sans erreur…). */}\n <div\n data-slot=\"app-shell-bandeau\"\n className={cn(\n \"empty:hidden\",\n GOUTTIERES_PAGE.laterales,\n GOUTTIERES_PAGE.haute\n )}\n >\n {bandeau}\n </div>\n {children}\n </SidebarInset>\n </SidebarProvider>\n </TooltipProvider>\n )\n}\n\n/** Colonne repliée lors de la dernière visite : shadcn écrit le cookie\n * `sidebar_state` à chaque repli, sans le relire. */\nfunction colonneRepliee() {\n return (\n typeof document !== \"undefined\" &&\n /(?:^|;\\s*)sidebar_state=false(?:;|$)/.test(document.cookie)\n )\n}\n\n/** Attribut des éléments, autres que les liens, qui referment le tiroir. */\nconst FERME_TIROIR = \"data-ferme-tiroir\"\n\n/**\n * Sur ordinateur, le bouton visible qui replie ou déplie la colonne (le rail\n * de shadcn n'est ni visible ni atteignable au clavier, et Ctrl+B ne se\n * devine pas). Sur mobile, la barre du haut s'en charge.\n */\nfunction BoutonRepli() {\n const { isMobile, open, toggleSidebar } = useSidebar()\n if (isMobile) return null\n const libelle = open ? \"Replier le menu\" : \"Déplier le menu\"\n return (\n <TooltipButton\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={libelle}\n infobulle={`${libelle} (Ctrl+B)`}\n aria-keyshortcuts=\"Control+B Meta+B\"\n data-slot=\"app-shell-collapse\"\n className=\"shrink-0\"\n onClick={toggleSidebar}\n >\n <PanelLeftIcon />\n </TooltipButton>\n )\n}\n\n/**\n * La barre latérale. Sur ordinateur, elle se replie en colonne d'icônes\n * (bouton de l'en-tête, rail, ou Ctrl+B hors d'un champ de saisie). Sur mobile, le tiroir se referme dès\n * qu'on suit un de ses liens dans la page, ou une entrée marquée\n * `data-ferme-tiroir` : un seul écouteur, qui reçoit aussi les clics des\n * menus ouverts depuis le tiroir (React fait remonter les évènements des\n * portails dans l'arbre des composants). Un clic qui ouvre un nouvel onglet\n * (Ctrl, Cmd, Maj) le laisse ouvert.\n */\nfunction Colonne({ children }: { children: ReactNode }) {\n const { isMobile, setOpenMobile } = useSidebar()\n return (\n <Sidebar collapsible=\"icon\">\n <div\n className=\"contents\"\n onClick={(event) => {\n if (!isMobile || event.ctrlKey || event.metaKey || event.shiftKey) {\n return\n }\n const cible = event.target as Element\n if (cible.closest(`a[href], [${FERME_TIROIR}]`)) setOpenMobile(false)\n }}\n >\n {children}\n </div>\n <SidebarRail />\n </Sidebar>\n )\n}\n\nfunction Logo({\n application,\n className,\n}: Pick<AppShellProps, \"application\"> & { className: string }) {\n return application.logo ? (\n <span\n className={cn(\n \"flex shrink-0 items-center justify-center [&_img]:size-full [&_svg]:size-full\",\n className\n )}\n >\n {application.logo}\n </span>\n ) : null\n}\n\nfunction Marque({\n application,\n Lien,\n}: Pick<AppShellProps, \"application\"> & { Lien: LienComposant }) {\n return (\n <SidebarMenu className=\"min-w-0 flex-1\">\n <SidebarMenuItem>\n <SidebarMenuButton\n size=\"lg\"\n render={<Lien href={application.href ?? \"/\"} />}\n >\n <Logo application={application} className=\"size-7\" />\n <span className=\"grid flex-1 text-left leading-tight\">\n <span className=\"truncate font-semibold\">{application.nom}</span>\n {application.sousTitre ? (\n <span className=\"truncate text-xs text-muted-foreground\">\n {application.sousTitre}\n </span>\n ) : null}\n </span>\n </SidebarMenuButton>\n </SidebarMenuItem>\n </SidebarMenu>\n )\n}\n\nfunction Navigation({\n sections,\n Lien,\n}: Pick<AppShellProps, \"sections\"> & { Lien: LienComposant }) {\n return (\n <nav aria-label=\"Navigation principale\">\n {sections.map((section, index) => (\n <SidebarGroup key={index}>\n {section.titre ? (\n <SidebarGroupLabel>{section.titre}</SidebarGroupLabel>\n ) : null}\n <SidebarGroupContent>\n <SidebarMenu>\n {section.liens.map(\n ({ libelle, href, icone: Icone, actif }, i) => (\n <SidebarMenuItem key={i}>\n <SidebarMenuButton\n isActive={actif}\n tooltip={libelle}\n render={\n <Lien\n href={href}\n aria-current={actif ? \"page\" : undefined}\n />\n }\n >\n {Icone ? <Icone /> : null}\n {/* Tronqué s'il est trop long : `title` le donne en\n entier au survol, barre dépliée. */}\n <span title={libelle}>{libelle}</span>\n </SidebarMenuButton>\n </SidebarMenuItem>\n )\n )}\n </SidebarMenu>\n </SidebarGroupContent>\n </SidebarGroup>\n ))}\n </nav>\n )\n}\n\nfunction MenuCompte({\n compte,\n Lien,\n}: {\n compte: AppShellCompte\n Lien: LienComposant\n}) {\n const [confirmer, setConfirmer] = useState(false)\n\n return (\n <>\n <SidebarMenu className=\"min-w-0 flex-1\">\n <SidebarMenuItem>\n <DropdownMenu>\n <DropdownMenuTrigger\n render={\n <SidebarMenuButton\n size=\"lg\"\n isActive={compte.actif}\n aria-label={`${compte.nom}, menu du compte`}\n className=\"data-popup-open:bg-sidebar-accent data-popup-open:text-sidebar-accent-foreground\"\n />\n }\n >\n <Avatar>\n {compte.photo ? (\n <AvatarImage src={compte.photo} alt=\"\" />\n ) : null}\n <AvatarFallback>{compte.initiales}</AvatarFallback>\n </Avatar>\n <span className=\"grid flex-1 text-left leading-tight\">\n <span className=\"truncate font-medium\">{compte.nom}</span>\n {compte.detail ? (\n <span className=\"truncate text-xs text-muted-foreground\">\n {compte.detail}\n </span>\n ) : null}\n </span>\n <ChevronsUpDownIcon className=\"ml-auto\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent side=\"top\" align=\"start\" className=\"min-w-56\">\n {compte.entrees?.length ? (\n <>\n <DropdownMenuGroup>\n {compte.entrees.map(\n ({ libelle, icone: Icone, href, onChoisir }, i) => (\n <DropdownMenuItem\n key={i}\n render={href ? <Lien href={href} /> : undefined}\n onClick={onChoisir}\n {...{ [FERME_TIROIR]: true }}\n >\n {Icone ? <Icone /> : null}\n {libelle}\n </DropdownMenuItem>\n )\n )}\n </DropdownMenuGroup>\n <DropdownMenuSeparator />\n </>\n ) : null}\n <DropdownMenuItem onClick={() => setConfirmer(true)}>\n <LogOutIcon />\n Se déconnecter\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n </SidebarMenu>\n\n <AlertDialog open={confirmer} onOpenChange={setConfirmer}>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Se déconnecter</AlertDialogTitle>\n <AlertDialogDescription>\n Voulez-vous vraiment vous déconnecter&#8239;?\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Annuler</AlertDialogCancel>\n <AlertDialogAction\n variant=\"destructive\"\n onClick={() => {\n setConfirmer(false)\n compte.onSeDeconnecter()\n }}\n >\n Se déconnecter\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </>\n )\n}\n\n/** Sous le seuil mobile, la barre latérale n'est plus à l'écran : cette barre\n * porte le bouton qui l'ouvre en tiroir, et la marque. */\nfunction BarreMobile({\n application,\n Lien,\n}: Pick<AppShellProps, \"application\"> & { Lien: LienComposant }) {\n const { isMobile, openMobile } = useSidebar()\n if (!isMobile) return null\n return (\n // Sa hauteur (h-12) est reprise par le `scroll-padding-top` de styles.css :\n // une ancre ne passe pas sous la barre collante. Sur le fond de la page.\n <header\n data-slot=\"app-shell-mobile-bar\"\n className=\"sticky top-0 z-10 flex h-12 shrink-0 items-center gap-2 border-b bg-page px-2\"\n >\n {/* Un seul nom, par `libelle` : un `aria-label` aurait masqué le texte\n lu de shadcn, qui en divergeait. */}\n <SidebarTrigger\n libelle=\"Ouvrir le menu\"\n aria-expanded={openMobile}\n className=\"size-9\"\n />\n <Lien\n href={application.href ?? \"/\"}\n className=\"flex min-w-0 items-center gap-2 rounded-md px-1 font-semibold outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <Logo application={application} className=\"size-6\" />\n <span className=\"truncate\">{application.nom}</span>\n </Lien>\n </header>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAwIA,SAAgBE,EAAS,EACvB,gBACA,aACA,WACA,UACA,SACA,YACA,eACgB;CAChB,IAAMC,IAAOC,EAAQC,CAAI,GACnBC,IAAYC,EAAM;CACxB,OACE,kBAACC,GAAD,EAAA,UAAA,CACE,kBAAC,KAAD;EACE,MAAM,IAAIF;EACV,aAAU;EACV,UAAU,MAAU;GAIlB,AADAG,EAAM,eAAe,GACrB,SAAS,eAAeH,CAAS,CAAC,EAAE,MAAM;EAC5C;EACA,WAAU;EACX,UAAA;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ASM,GAAY,EACnB,gBACA,WAC+D;CAC/D,IAAM,EAAE,aAAU,kBAAeM,EAAW;CAE5C,OADKC,IAIH,kBAAC,UAAD;EACE,aAAU;EACV,WAAU;EAFZ,UAAA,CAME,kBAACgD,GAAD;GACE,SAAQ;GACR,iBAAeC;GACf,WAAU;EACX,CAAA,GACD,kBAAC7E,GAAD;GACE,MAAMsC,EAAY,QAAQ;GAC1B,WAAU;GAFZ,UAAA,CAIE,kBAACD,GAAD;IAAmB;IAAa,WAAU;GAAU,CAAA,GACpD,kBAAC,QAAD;IAAM,WAAU;IAAY,UAAAC,EAAY;GAAU,CAAA,CAC9C;EACA,CAAA,CAAA;C,KAtBY;AAwBxB"}
1
+ {"version":3,"file":"app-shell.js","names":["_Fragment","Fragment$1","AppShell","Lien","useLien","lien","idContenu","useId","TooltipProvider","event","SidebarProvider","colonneRepliee","Colonne","SidebarHeader","Marque","BoutonRepli","SidebarContent","Navigation","compte","theme","SidebarFooter","MenuCompte","ThemeMenu","SidebarInset","BarreMobile","cn","GOUTTIERES_PAGE","bandeau","children","FERME_TIROIR","useSidebar","isMobile","libelle","open","TooltipButton","toggleSidebar","PanelLeftIcon","Sidebar","setOpenMobile","SidebarRail","Logo","application","className","SidebarMenu","SidebarMenuItem","SidebarMenuButton","sections","SidebarGroup","section","SidebarGroupLabel","SidebarGroupContent","Icone","actif","i","index","MenuTheme","themeActuel","valeur","DropdownMenuGroup","DropdownMenuLabel","ThemeRadioGroup","DropdownMenuSub","DropdownMenuSubTrigger","DropdownMenuSubContent","confirmer","setConfirmer","useState","useChoixTheme","DropdownMenu","ouvert","effacerEchec","DropdownMenuTrigger","Avatar","AvatarImage","AvatarFallback","ChevronsUpDownIcon","DropdownMenuContent","DropdownMenuItem","href","onChoisir","DropdownMenuSeparator","choisir","LogOutIcon","echec","EchecTheme","AlertDialog","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","SidebarTrigger","openMobile"],"sources":["../../../src/components/etic/app-shell.tsx"],"sourcesContent":["import { useId, useState, type ReactNode } from \"react\"\nimport { cn } from \"cn\"\nimport {\n ChevronsUpDownIcon,\n LogOutIcon,\n PanelLeftIcon,\n type LucideIcon,\n} from \"lucide-react\"\n\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogCancel,\n AlertDialogContent,\n AlertDialogDescription,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from \"@etic-ui/components/ui/alert-dialog\"\nimport {\n Avatar,\n AvatarFallback,\n AvatarImage,\n} from \"@etic-ui/components/ui/avatar\"\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuGroup,\n DropdownMenuItem,\n DropdownMenuLabel,\n DropdownMenuSeparator,\n DropdownMenuSub,\n DropdownMenuSubContent,\n DropdownMenuSubTrigger,\n DropdownMenuTrigger,\n} from \"@etic-ui/components/ui/dropdown-menu\"\nimport {\n Sidebar,\n SidebarContent,\n SidebarFooter,\n SidebarGroup,\n SidebarGroupContent,\n SidebarGroupLabel,\n SidebarHeader,\n SidebarInset,\n SidebarMenu,\n SidebarMenuButton,\n SidebarMenuItem,\n SidebarProvider,\n SidebarRail,\n SidebarTrigger,\n useSidebar,\n} from \"@etic-ui/components/ui/sidebar\"\nimport { TooltipProvider } from \"@etic-ui/components/ui/tooltip\"\nimport { GOUTTIERES_PAGE } from \"@etic-ui/components/etic/page-container\"\nimport {\n EchecTheme,\n ThemeMenu,\n ThemeRadioGroup,\n themeActuel,\n useChoixTheme,\n type ThemeMenuProps,\n} from \"@etic-ui/components/etic/theme-menu\"\nimport type { ThemePreference } from \"@etic-ui/theme\"\nimport { TooltipButton } from \"@etic-ui/components/etic/tooltip-button\"\nimport { useLien, type LienComposant } from \"@etic-ui/components/etic/lien\"\n\n/** @deprecated Nom de la 0.2.0 : utiliser `LienComposant`. */\nexport type AppShellLienComposant = LienComposant\n\nexport interface AppShellLien {\n libelle: string\n href: string\n icone?: LucideIcon\n /** Page à l'écran. Calculé par l'application, seule à savoir qu'une fiche\n * appartient à telle rubrique. */\n actif?: boolean\n}\n\nexport interface AppShellSection {\n titre?: string\n liens: AppShellLien[]\n}\n\n/** Entrée du menu du compte : un lien, ou une action. */\nexport type AppShellEntreeCompte = {\n libelle: string\n icone?: LucideIcon\n} & (\n { href: string; onChoisir?: never } | { onChoisir: () => void; href?: never }\n)\n\nexport interface AppShellCompte {\n /** « Prénom Nom », ou le rôle d'un compte fonctionnel. */\n nom: string\n /** Seconde ligne, l'adresse par exemple. */\n detail?: string\n initiales: string\n /** Photo ; les initiales s'affichent tant qu'elle manque ou charge. */\n photo?: string | null\n /** La fiche du compte est la page à l'écran. */\n actif?: boolean\n /** Entrées du menu du compte, avant « Se déconnecter ». */\n entrees?: AppShellEntreeCompte[]\n /** Appelé après confirmation. */\n onSeDeconnecter: () => void\n}\n\nexport interface AppShellProps {\n application: {\n nom: string\n sousTitre?: string\n /** Image ou icône, carrée : 32 px dans la barre latérale, 24 px dans la\n * barre du haut sur mobile. */\n logo?: ReactNode\n /** Lien de la marque ; « / » par défaut. */\n href?: string\n }\n sections: AppShellSection[]\n compte?: AppShellCompte\n /** Choix du thème : entrée « Thème » du menu du compte, ou son propre\n * bouton dans le pied de la barre sans `compte`. */\n theme?: Pick<ThemeMenuProps, \"valeur\" | \"onValeurChange\">\n /** Composant de lien du routeur ; par défaut, celui du `LienProvider`,\n * sinon un `<a>`. */\n lien?: LienComposant\n /**\n * Au-dessus du contenu, avec les gouttières de `PageContainer` : message\n * qui concerne toute l'application (reprise de session impossible…). Il\n * prend toute la largeur du contenu : la coquille ignore la `largeur` de\n * la page, si bien qu'il déborde d'une page étroite (`largeur=\"md\"`) sur\n * grand écran. Un message propre à une page se place dans son\n * `PageContainer`.\n */\n bandeau?: ReactNode\n children: ReactNode\n}\n\n/**\n * Coquille commune des applications ETIC : la barre latérale de shadcn\n * (navigation par rubriques, menu du compte, thème), qui devient un tiroir\n * sous 1 025 px, ouvert par une barre du haut. Le tiroir se referme quand on\n * suit un de ses liens. Ne connaît ni le routeur ni l'authentification : l'application\n * fournit les liens, l'état actif, le compte et le thème.\n *\n * Un lien « Aller au contenu », visible au focus, ouvre la tabulation : il\n * saute la navigation et met le focus sur le `<main>`.\n */\nexport function AppShell({\n application,\n sections,\n compte,\n theme,\n lien,\n bandeau,\n children,\n}: AppShellProps) {\n const Lien = useLien(lien)\n const idContenu = useId()\n return (\n <TooltipProvider>\n <a\n href={`#${idContenu}`}\n data-slot=\"app-shell-skip-link\"\n onClick={(event) => {\n // Le focus, pas seulement le défilement ; et pas de `#…` ajouté à\n // l'adresse, que le routeur de l'application lirait.\n event.preventDefault()\n document.getElementById(idContenu)?.focus()\n }}\n className=\"sr-only rounded-md bg-background px-3 py-2 text-sm font-medium shadow-md ring-3 ring-ring/50 outline-none focus:not-sr-only focus:fixed focus:top-2 focus:left-2 focus:z-50\"\n >\n Aller au contenu\n </a>\n <SidebarProvider defaultOpen={!colonneRepliee()}>\n <Colonne>\n <SidebarHeader className=\"flex-row items-center group-data-[collapsible=icon]:flex-col\">\n <Marque application={application} Lien={Lien} />\n <BoutonRepli />\n </SidebarHeader>\n <SidebarContent>\n <Navigation sections={sections} Lien={Lien} />\n </SidebarContent>\n {compte || theme ? (\n <SidebarFooter className=\"flex-row items-center gap-2 group-data-[collapsible=icon]:flex-col\">\n {/* Avec un compte, le thème est une entrée de son menu (comme le\n nav-user de shadcn) : le pied garde toute sa largeur pour le\n nom et l'adresse. Sans compte, son propre bouton. */}\n {compte ? (\n <MenuCompte compte={compte} theme={theme} Lien={Lien} />\n ) : theme ? (\n <ThemeMenu\n {...theme}\n side=\"top\"\n // Sans fond propre (le dark:bg-input/30 d'outline tranchait\n // sur la barre), le survol des entrées de la barre.\n className=\"size-12 shrink-0 bg-sidebar group-data-[collapsible=icon]:size-8 hover:bg-sidebar-accent hover:text-sidebar-accent-foreground aria-expanded:bg-sidebar-accent aria-expanded:text-sidebar-accent-foreground dark:bg-sidebar dark:hover:bg-sidebar-accent\"\n />\n ) : null}\n </SidebarFooter>\n ) : null}\n </Colonne>\n <SidebarInset\n id={idContenu}\n tabIndex={-1}\n // Fond de page (bg-page) au lieu de bg-background (shadcn).\n className=\"min-w-0 bg-page outline-none\"\n >\n <BarreMobile application={application} Lien={Lien} />\n {/* Gouttières de `PageContainer`, qui suit et pose sa propre marge\n haute. Masqué quand le bandeau est absent ou ne rend rien\n (`ErrorBanner` sans erreur…). */}\n <div\n data-slot=\"app-shell-bandeau\"\n className={cn(\n \"empty:hidden\",\n GOUTTIERES_PAGE.laterales,\n GOUTTIERES_PAGE.haute\n )}\n >\n {bandeau}\n </div>\n {children}\n </SidebarInset>\n </SidebarProvider>\n </TooltipProvider>\n )\n}\n\n/** Colonne repliée lors de la dernière visite : shadcn écrit le cookie\n * `sidebar_state` à chaque repli, sans le relire. */\nfunction colonneRepliee() {\n return (\n typeof document !== \"undefined\" &&\n /(?:^|;\\s*)sidebar_state=false(?:;|$)/.test(document.cookie)\n )\n}\n\n/** Attribut des éléments, autres que les liens, qui referment le tiroir. */\nconst FERME_TIROIR = \"data-ferme-tiroir\"\n\n/**\n * Sur ordinateur, le bouton visible qui replie ou déplie la colonne (le rail\n * de shadcn n'est ni visible ni atteignable au clavier, et Ctrl+B ne se\n * devine pas). Sur mobile, la barre du haut s'en charge.\n */\nfunction BoutonRepli() {\n const { isMobile, open, toggleSidebar } = useSidebar()\n if (isMobile) return null\n const libelle = open ? \"Replier le menu\" : \"Déplier le menu\"\n return (\n <TooltipButton\n variant=\"ghost\"\n size=\"icon-sm\"\n aria-label={libelle}\n infobulle={`${libelle} (Ctrl+B)`}\n aria-keyshortcuts=\"Control+B Meta+B\"\n data-slot=\"app-shell-collapse\"\n className=\"shrink-0\"\n onClick={toggleSidebar}\n >\n <PanelLeftIcon />\n </TooltipButton>\n )\n}\n\n/**\n * La barre latérale. Sur ordinateur, elle se replie en colonne d'icônes\n * (bouton de l'en-tête, rail, ou Ctrl+B hors d'un champ de saisie). Sur mobile, le tiroir se referme dès\n * qu'on suit un de ses liens dans la page, ou une entrée marquée\n * `data-ferme-tiroir` : un seul écouteur, qui reçoit aussi les clics des\n * menus ouverts depuis le tiroir (React fait remonter les évènements des\n * portails dans l'arbre des composants). Un clic qui ouvre un nouvel onglet\n * (Ctrl, Cmd, Maj) le laisse ouvert.\n */\nfunction Colonne({ children }: { children: ReactNode }) {\n const { isMobile, setOpenMobile } = useSidebar()\n return (\n <Sidebar collapsible=\"icon\">\n <div\n className=\"contents\"\n onClick={(event) => {\n if (!isMobile || event.ctrlKey || event.metaKey || event.shiftKey) {\n return\n }\n const cible = event.target as Element\n if (cible.closest(`a[href], [${FERME_TIROIR}]`)) setOpenMobile(false)\n }}\n >\n {children}\n </div>\n <SidebarRail />\n </Sidebar>\n )\n}\n\nfunction Logo({\n application,\n className,\n}: Pick<AppShellProps, \"application\"> & { className: string }) {\n return application.logo ? (\n <span\n className={cn(\n \"flex shrink-0 items-center justify-center [&_img]:size-full [&_svg]:size-full\",\n className\n )}\n >\n {application.logo}\n </span>\n ) : null\n}\n\nfunction Marque({\n application,\n Lien,\n}: Pick<AppShellProps, \"application\"> & { Lien: LienComposant }) {\n return (\n <SidebarMenu className=\"min-w-0 flex-1\">\n <SidebarMenuItem>\n <SidebarMenuButton\n size=\"lg\"\n render={<Lien href={application.href ?? \"/\"} />}\n >\n {/* 32 px, comme le sélecteur d'équipe de shadcn : toute la hauteur\n utile du bouton (48 px moins ses marges) ; dans la barre\n repliée, il remplit le bouton de 32 px, donc centré. */}\n <Logo application={application} className=\"size-8\" />\n <span className=\"grid flex-1 text-left leading-tight\">\n <span className=\"truncate font-semibold\">{application.nom}</span>\n {application.sousTitre ? (\n <span className=\"truncate text-xs text-muted-foreground\">\n {application.sousTitre}\n </span>\n ) : null}\n </span>\n </SidebarMenuButton>\n </SidebarMenuItem>\n </SidebarMenu>\n )\n}\n\nfunction Navigation({\n sections,\n Lien,\n}: Pick<AppShellProps, \"sections\"> & { Lien: LienComposant }) {\n return (\n <nav aria-label=\"Navigation principale\">\n {sections.map((section, index) => (\n <SidebarGroup key={index}>\n {section.titre ? (\n <SidebarGroupLabel>{section.titre}</SidebarGroupLabel>\n ) : null}\n <SidebarGroupContent>\n <SidebarMenu>\n {section.liens.map(\n ({ libelle, href, icone: Icone, actif }, i) => (\n <SidebarMenuItem key={i}>\n <SidebarMenuButton\n isActive={actif}\n tooltip={libelle}\n render={\n <Lien\n href={href}\n aria-current={actif ? \"page\" : undefined}\n />\n }\n >\n {Icone ? <Icone /> : null}\n {/* Tronqué s'il est trop long : `title` le donne en\n entier au survol, barre dépliée. */}\n <span title={libelle}>{libelle}</span>\n </SidebarMenuButton>\n </SidebarMenuItem>\n )\n )}\n </SidebarMenu>\n </SidebarGroupContent>\n </SidebarGroup>\n ))}\n </nav>\n )\n}\n\n/** Entrée « Thème : Sombre » du menu du compte, qui ouvre Clair / Système /\n * Sombre. Choisir ferme le menu. Dans le tiroir mobile, trop étroit pour un\n * sous-menu à côté du menu (il s'ouvrait dessous, sur « Se déconnecter »),\n * les trois choix sont dans le menu, sous un intitulé. */\nfunction MenuTheme({\n valeur,\n onChoisir,\n}: {\n valeur: ThemePreference\n onChoisir: (theme: ThemePreference) => void\n}) {\n const { isMobile } = useSidebar()\n const { libelle, Icone } = themeActuel(valeur)\n if (isMobile)\n return (\n <DropdownMenuGroup>\n <DropdownMenuLabel>Thème de l'interface</DropdownMenuLabel>\n <ThemeRadioGroup valeur={valeur} onChoisir={onChoisir} />\n </DropdownMenuGroup>\n )\n return (\n <DropdownMenuSub>\n <DropdownMenuSubTrigger>\n <Icone />\n {libelle}\n </DropdownMenuSubTrigger>\n <DropdownMenuSubContent className=\"w-40\">\n <ThemeRadioGroup valeur={valeur} onChoisir={onChoisir} />\n </DropdownMenuSubContent>\n </DropdownMenuSub>\n )\n}\n\nfunction MenuCompte({\n compte,\n theme,\n Lien,\n}: {\n compte: AppShellCompte\n theme?: AppShellProps[\"theme\"]\n Lien: LienComposant\n}) {\n const [confirmer, setConfirmer] = useState(false)\n const { echec, effacerEchec, choisir } = useChoixTheme({\n valeur: theme?.valeur ?? \"system\",\n onValeurChange: theme?.onValeurChange ?? (() => {}),\n })\n\n return (\n <>\n {/* relative : y pose « Thème non enregistré », au-dessus du bouton. */}\n <SidebarMenu className=\"relative min-w-0 flex-1\">\n <SidebarMenuItem>\n <DropdownMenu onOpenChange={(ouvert) => ouvert && effacerEchec()}>\n <DropdownMenuTrigger\n render={\n <SidebarMenuButton\n size=\"lg\"\n isActive={compte.actif}\n aria-label={`${compte.nom}, menu du compte`}\n // Sans contour, comme le nav-user de shadcn : le survol dit\n // qu'il s'ouvre. rounded-lg : le survol épouse l'avatar.\n className=\"rounded-lg data-popup-open:bg-sidebar-accent data-popup-open:text-sidebar-accent-foreground\"\n />\n }\n >\n {/* Carré arrondi, comme le nav-user de shadcn : la forme du\n survol du bouton. */}\n <Avatar className=\"rounded-lg after:rounded-lg\">\n {compte.photo ? (\n <AvatarImage\n src={compte.photo}\n alt=\"\"\n className=\"rounded-lg\"\n />\n ) : null}\n <AvatarFallback className=\"rounded-lg\">\n {compte.initiales}\n </AvatarFallback>\n </Avatar>\n <span className=\"grid flex-1 text-left leading-tight\">\n <span className=\"truncate font-medium\">{compte.nom}</span>\n {compte.detail ? (\n <span className=\"truncate text-xs text-muted-foreground\">\n {compte.detail}\n </span>\n ) : null}\n </span>\n <ChevronsUpDownIcon className=\"ml-auto\" />\n </DropdownMenuTrigger>\n <DropdownMenuContent side=\"top\" align=\"start\" className=\"min-w-56\">\n {compte.entrees?.length ? (\n <>\n <DropdownMenuGroup>\n {compte.entrees.map(\n ({ libelle, icone: Icone, href, onChoisir }, i) => (\n <DropdownMenuItem\n key={i}\n render={href ? <Lien href={href} /> : undefined}\n onClick={onChoisir}\n {...{ [FERME_TIROIR]: true }}\n >\n {Icone ? <Icone /> : null}\n {libelle}\n </DropdownMenuItem>\n )\n )}\n </DropdownMenuGroup>\n <DropdownMenuSeparator />\n </>\n ) : null}\n {theme ? (\n <>\n <MenuTheme valeur={theme.valeur} onChoisir={choisir} />\n <DropdownMenuSeparator />\n </>\n ) : null}\n <DropdownMenuItem onClick={() => setConfirmer(true)}>\n <LogOutIcon />\n Se déconnecter\n </DropdownMenuItem>\n </DropdownMenuContent>\n </DropdownMenu>\n </SidebarMenuItem>\n {echec ? <EchecTheme side=\"top\" className=\"left-0\" /> : null}\n </SidebarMenu>\n\n <AlertDialog open={confirmer} onOpenChange={setConfirmer}>\n <AlertDialogContent>\n <AlertDialogHeader>\n <AlertDialogTitle>Se déconnecter</AlertDialogTitle>\n <AlertDialogDescription>\n Voulez-vous vraiment vous déconnecter&#8239;?\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Annuler</AlertDialogCancel>\n <AlertDialogAction\n variant=\"destructive\"\n onClick={() => {\n setConfirmer(false)\n compte.onSeDeconnecter()\n }}\n >\n Se déconnecter\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n </>\n )\n}\n\n/** Sous le seuil mobile, la barre latérale n'est plus à l'écran : cette barre\n * porte le bouton qui l'ouvre en tiroir, et la marque. */\nfunction BarreMobile({\n application,\n Lien,\n}: Pick<AppShellProps, \"application\"> & { Lien: LienComposant }) {\n const { isMobile, openMobile } = useSidebar()\n if (!isMobile) return null\n return (\n // Sa hauteur (h-12) est reprise par le `scroll-padding-top` de styles.css :\n // une ancre ne passe pas sous la barre collante. Sur le fond de la page.\n <header\n data-slot=\"app-shell-mobile-bar\"\n className=\"sticky top-0 z-10 flex h-12 shrink-0 items-center gap-2 border-b bg-page px-2\"\n >\n {/* Un seul nom, par `libelle` : un `aria-label` aurait masqué le texte\n lu de shadcn, qui en divergeait. */}\n <SidebarTrigger\n libelle=\"Ouvrir le menu\"\n aria-expanded={openMobile}\n className=\"size-9\"\n />\n <Lien\n href={application.href ?? \"/\"}\n className=\"flex min-w-0 items-center gap-2 rounded-md px-1 font-semibold outline-none focus-visible:ring-2 focus-visible:ring-ring\"\n >\n <Logo application={application} className=\"size-6\" />\n <span className=\"truncate\">{application.nom}</span>\n </Lien>\n </header>\n )\n}\n"],"mappings":";;;;;;;;;;;;;;AAoJA,SAAgBE,GAAS,EACvB,gBACA,aACA,WACA,UACA,SACA,YACA,eACgB;CAChB,IAAMC,IAAOC,EAAQC,CAAI,GACnBC,IAAYC,EAAM;CACxB,OACE,kBAACC,GAAD,EAAA,UAAA,CACE,kBAAC,KAAD;EACE,MAAM,IAAIF;EACV,aAAU;EACV,UAAU,MAAU;GAIlB,AADAG,EAAM,eAAe,GACrB,SAAS,eAAeH,CAAS,CAAC,EAAE,MAAM;EAC5C;EACA,WAAU;EACX,UAAA;CAEE,CAAA,GACH,kBAACI,IAAD;EAAiB,aAAa,CAACC,GAAe;EAA9C,UAAA,CACE,kBAACC,IAAD,EAAA,UAAA;GACE,kBAACC,GAAD;IAAe,WAAU;IAAzB,UAAA,CACE,kBAACC,IAAD;KAAqB;KAAmB;IAAO,CAAA,GAC/C,kBAACC,IAAD,CAAc,CAAA,CACD;;GACf,kBAACC,GAAD,EAAA,UACE,kBAACC,IAAD;IAAsB;IAAgB;GAAO,CAAA,EAC/B,CAAA;GACfC,KAAUC,IACT,kBAACC,GAAD;IAAe,WAAU;IAItB,UAAAF,IACC,kBAACG,GAAD;KAAoB;KAAe;KAAa;IAAO,CAAA,IACrDF,IACF,kBAACG,GAAD;KACE,GAAIH;KACJ,MAAK;KAGL,WAAU;IACX,CAAA,IACC;GACS,CAAA,IACb;EACG,EAAA,CAAA,GACT,kBAACI,GAAD;GACE,IAAIjB;GACJ,UAAU;GAEV,WAAU;GAJZ,UAAA;IAME,kBAACkB,IAAD;KAA0B;KAAmB;IAAO,CAAA;IAIpD,kBAAC,OAAD;KACE,aAAU;KACV,WAAWC,EACT,gBACAC,EAAgB,WAChBA,EAAgB,KAClB;KAEC,UAAAC;IACE,CAAA;IACJC;GACW;EACC,CAAA,CAAA;CACF,C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EAAK,GAClB/C,EAAO,gBAAgB;GACzB;GACD,UAAA;EAEkB,CAAA,CACF,EAAA,CAAA,CACD,EAAA,CAAA;CACT,CAAA,CACb,EAAA,CAAA;AAEN;AAIA,SAASM,GAAY,EACnB,gBACA,WAC+D;CAC/D,IAAM,EAAE,aAAU,kBAAeM,EAAW;CAE5C,OADKC,IAIH,kBAAC,UAAD;EACE,aAAU;EACV,WAAU;EAFZ,UAAA,CAME,kBAAC8D,GAAD;GACE,SAAQ;GACR,iBAAeC;GACf,WAAU;EACX,CAAA,GACD,kBAAC3F,GAAD;GACE,MAAMsC,EAAY,QAAQ;GAC1B,WAAU;GAFZ,UAAA,CAIE,kBAACD,GAAD;IAAmB;IAAa,WAAU;GAAU,CAAA,GACpD,kBAAC,QAAD;IAAM,WAAU;IAAY,UAAAC,EAAY;GAAU,CAAA,CAC9C;EACA,CAAA,CAAA;C,KAtBY;AAwBxB"}
@@ -12,6 +12,13 @@ interface DataTableBulkActionsCommun {
12
12
  * `table.getSelectedRowModel()` (ou `getSelectedRowIds()`) ; quand
13
13
  * `toutSelectionne` est vrai, l'action porte sur tous les éléments. */
14
14
  children: ReactNode;
15
+ /** Actions moins fréquentes, rangées dans le menu « … » de la barre :
16
+ * des `DropdownMenuItem`. Le menu porte aussi « Sélectionner les 137 »
17
+ * quand il est proposé. Limite connue : une entrée qui vide aussitôt la
18
+ * sélection démonte la barre et son menu, et Base UI rend alors le focus
19
+ * au dernier menu ou sélecteur ouvert ailleurs dans la page (à corriger
20
+ * dans `DropdownMenuContent`, pour tous les menus). */
21
+ actionsSecondaires?: ReactNode;
15
22
  className?: string;
16
23
  }
17
24
  /** Barre branchée sur l'instance d'un `DataTable`. */
@@ -44,10 +51,16 @@ export type DataTableBulkActionsProps<TData extends RowData = RowData> = DataTab
44
51
  * action qui vide la sélection), le focus passe à la case d'en-tête du
45
52
  * tableau plutôt que de tomber sur `<body>`.
46
53
  *
54
+ * Avec le `total` du tableau, le compte le situe (« 25 membres sur 137
55
+ * sélectionnés ») ; quand toute la page est cochée, le menu « … » propose
56
+ * « Sélectionner les 137 membres » (à la Gmail), à côté des
57
+ * `actionsSecondaires`. Le menu n'apparaît que s'il a quelque chose à
58
+ * proposer ; « Tout désélectionner » est une croix seule, avec infobulle.
59
+ *
47
60
  * Avec `table`, elle suit la sélection d'un `DataTable` ; avec `nombre`,
48
61
  * `onToutDeselectionner` et `racine`, celle d'un tableau rendu à la main.
49
- * Sur téléphone, le compte et « × » restent ensemble sur la première ligne,
50
- * les actions passent dessous.
62
+ * Sur téléphone, le compte, « … » et « × » restent ensemble sur la première
63
+ * ligne, les actions passent dessous.
51
64
  */
52
65
  export declare function DataTableBulkActions<TData extends RowData>(props: DataTableBulkActionsProps<TData>): import("react").JSX.Element;
53
66
  export {};