@etic-insa/ui 0.1.0 → 0.3.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.
- package/README.md +897 -12
- package/dist/components/etic/action.d.ts +42 -0
- package/dist/components/etic/action.js +43 -0
- package/dist/components/etic/action.js.map +1 -0
- package/dist/components/etic/app-shell.d.ts +23 -11
- package/dist/components/etic/app-shell.js +133 -88
- package/dist/components/etic/app-shell.js.map +1 -1
- package/dist/components/etic/auth-image.d.ts +71 -0
- package/dist/components/etic/auth-image.js +67 -0
- package/dist/components/etic/auth-image.js.map +1 -0
- package/dist/components/etic/button-link.d.ts +19 -0
- package/dist/components/etic/button-link.js +19 -0
- package/dist/components/etic/button-link.js.map +1 -0
- package/dist/components/etic/centered-screen.d.ts +13 -0
- package/dist/components/etic/centered-screen.js +13 -0
- package/dist/components/etic/centered-screen.js.map +1 -0
- package/dist/components/etic/checkbox-list.d.ts +30 -0
- package/dist/components/etic/checkbox-list.js +56 -0
- package/dist/components/etic/checkbox-list.js.map +1 -0
- package/dist/components/etic/confirm-dialog.d.ts +93 -0
- package/dist/components/etic/confirm-dialog.js +109 -0
- package/dist/components/etic/confirm-dialog.js.map +1 -0
- package/dist/components/etic/copy-button.d.ts +25 -0
- package/dist/components/etic/copy-button.js +46 -0
- package/dist/components/etic/copy-button.js.map +1 -0
- package/dist/components/etic/data-table-bulk-actions.d.ts +53 -0
- package/dist/components/etic/data-table-bulk-actions.js +104 -0
- package/dist/components/etic/data-table-bulk-actions.js.map +1 -0
- package/dist/components/etic/data-table-focus.d.ts +17 -0
- package/dist/components/etic/data-table-focus.js +29 -0
- package/dist/components/etic/data-table-focus.js.map +1 -0
- package/dist/components/etic/data-table-format.d.ts +5 -0
- package/dist/components/etic/data-table-format.js +9 -0
- package/dist/components/etic/data-table-format.js.map +1 -0
- package/dist/components/etic/data-table-pagination.d.ts +36 -0
- package/dist/components/etic/data-table-pagination.js +134 -0
- package/dist/components/etic/data-table-pagination.js.map +1 -0
- package/dist/components/etic/data-table-toolbar.d.ts +90 -0
- package/dist/components/etic/data-table-toolbar.js +131 -0
- package/dist/components/etic/data-table-toolbar.js.map +1 -0
- package/dist/components/etic/data-table-view-options.d.ts +56 -0
- package/dist/components/etic/data-table-view-options.js +198 -0
- package/dist/components/etic/data-table-view-options.js.map +1 -0
- package/dist/components/etic/data-table.d.ts +421 -0
- package/dist/components/etic/data-table.js +582 -0
- package/dist/components/etic/data-table.js.map +1 -0
- package/dist/components/etic/date-picker.d.ts +36 -0
- package/dist/components/etic/date-picker.js +175 -0
- package/dist/components/etic/date-picker.js.map +1 -0
- package/dist/components/etic/delete-button.d.ts +65 -0
- package/dist/components/etic/delete-button.js +37 -0
- package/dist/components/etic/delete-button.js.map +1 -0
- package/dist/components/etic/detail-list.d.ts +26 -0
- package/dist/components/etic/detail-list.js +46 -0
- package/dist/components/etic/detail-list.js.map +1 -0
- package/dist/components/etic/disclosure.d.ts +52 -0
- package/dist/components/etic/disclosure.js +70 -0
- package/dist/components/etic/disclosure.js.map +1 -0
- package/dist/components/etic/draft-resume-dialog.d.ts +42 -0
- package/dist/components/etic/draft-resume-dialog.js +60 -0
- package/dist/components/etic/draft-resume-dialog.js.map +1 -0
- package/dist/components/etic/empty-state.d.ts +20 -0
- package/dist/components/etic/empty-state.js +20 -0
- package/dist/components/etic/empty-state.js.map +1 -0
- package/dist/components/etic/error-banner.d.ts +50 -0
- package/dist/components/etic/error-banner.js +85 -0
- package/dist/components/etic/error-banner.js.map +1 -0
- package/dist/components/etic/error-boundary.d.ts +53 -0
- package/dist/components/etic/error-boundary.js +83 -0
- package/dist/components/etic/error-boundary.js.map +1 -0
- package/dist/components/etic/explained-badge.d.ts +26 -0
- package/dist/components/etic/explained-badge.js +17 -0
- package/dist/components/etic/explained-badge.js.map +1 -0
- package/dist/components/etic/file-upload.d.ts +52 -0
- package/dist/components/etic/file-upload.js +137 -0
- package/dist/components/etic/file-upload.js.map +1 -0
- package/dist/components/etic/form-dialog.d.ts +68 -0
- package/dist/components/etic/form-dialog.js +154 -0
- package/dist/components/etic/form-dialog.js.map +1 -0
- package/dist/components/etic/form-field-context.d.ts +66 -0
- package/dist/components/etic/form-field-context.js +28 -0
- package/dist/components/etic/form-field-context.js.map +1 -0
- package/dist/components/etic/form-field.d.ts +53 -0
- package/dist/components/etic/form-field.js +105 -0
- package/dist/components/etic/form-field.js.map +1 -0
- package/dist/components/etic/icon-toggle.d.ts +51 -0
- package/dist/components/etic/icon-toggle.js +40 -0
- package/dist/components/etic/icon-toggle.js.map +1 -0
- package/dist/components/etic/lien.d.ts +34 -0
- package/dist/components/etic/lien.js +17 -0
- package/dist/components/etic/lien.js.map +1 -0
- package/dist/components/etic/loading.d.ts +37 -0
- package/dist/components/etic/loading.js +74 -0
- package/dist/components/etic/loading.js.map +1 -0
- package/dist/components/etic/page-container.d.ts +27 -0
- package/dist/components/etic/page-container.js +24 -0
- package/dist/components/etic/page-container.js.map +1 -0
- package/dist/components/etic/page-header.d.ts +64 -0
- package/dist/components/etic/page-header.js +109 -0
- package/dist/components/etic/page-header.js.map +1 -0
- package/dist/components/etic/phone-input.d.ts +47 -0
- package/dist/components/etic/phone-input.js +139 -0
- package/dist/components/etic/phone-input.js.map +1 -0
- package/dist/components/etic/query-boundary.d.ts +73 -0
- package/dist/components/etic/query-boundary.js +37 -0
- package/dist/components/etic/query-boundary.js.map +1 -0
- package/dist/components/etic/removable-badge.d.ts +30 -0
- package/dist/components/etic/removable-badge.js +31 -0
- package/dist/components/etic/removable-badge.js.map +1 -0
- package/dist/components/etic/save-bar.d.ts +31 -0
- package/dist/components/etic/save-bar.js +45 -0
- package/dist/components/etic/save-bar.js.map +1 -0
- package/dist/components/etic/search-select.d.ts +41 -0
- package/dist/components/etic/search-select.js +126 -0
- package/dist/components/etic/search-select.js.map +1 -0
- package/dist/components/etic/section-card.d.ts +12 -0
- package/dist/components/etic/section-card.js +23 -0
- package/dist/components/etic/section-card.js.map +1 -0
- package/dist/components/etic/segmented-control.d.ts +33 -0
- package/dist/components/etic/segmented-control.js +45 -0
- package/dist/components/etic/segmented-control.js.map +1 -0
- package/dist/components/etic/stat-grid.d.ts +15 -0
- package/dist/components/etic/stat-grid.js +17 -0
- package/dist/components/etic/stat-grid.js.map +1 -0
- package/dist/components/etic/stat-tile.d.ts +18 -0
- package/dist/components/etic/stat-tile.js +33 -0
- package/dist/components/etic/stat-tile.js.map +1 -0
- package/dist/components/etic/status-badge.d.ts +14 -0
- package/dist/components/etic/status-badge.js +20 -0
- package/dist/components/etic/status-badge.js.map +1 -0
- package/dist/components/etic/tailles-dialogue.d.ts +8 -0
- package/dist/components/etic/tailles-dialogue.js +10 -0
- package/dist/components/etic/tailles-dialogue.js.map +1 -0
- package/dist/components/etic/theme-menu.d.ts +6 -5
- package/dist/components/etic/theme-menu.js +46 -36
- package/dist/components/etic/theme-menu.js.map +1 -1
- package/dist/components/etic/toggletip.d.ts +36 -0
- package/dist/components/etic/toggletip.js +59 -0
- package/dist/components/etic/toggletip.js.map +1 -0
- package/dist/components/etic/tooltip-button.d.ts +39 -0
- package/dist/components/etic/tooltip-button.js +39 -0
- package/dist/components/etic/tooltip-button.js.map +1 -0
- package/dist/components/etic/unsaved-changes.d.ts +41 -0
- package/dist/components/etic/unsaved-changes.js +17 -0
- package/dist/components/etic/unsaved-changes.js.map +1 -0
- package/dist/components/etic/use-draft-autosave.d.ts +70 -0
- package/dist/components/etic/use-draft-autosave.js +98 -0
- package/dist/components/etic/use-draft-autosave.js.map +1 -0
- package/dist/components/etic/use-unsaved-changes-warning.d.ts +10 -0
- package/dist/components/etic/use-unsaved-changes-warning.js +20 -0
- package/dist/components/etic/use-unsaved-changes-warning.js.map +1 -0
- package/dist/components/ui/alert-dialog.js +33 -33
- package/dist/components/ui/alert-dialog.js.map +1 -1
- package/dist/components/ui/alert.d.ts +10 -0
- package/dist/components/ui/alert.js +47 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +5 -1
- package/dist/components/ui/avatar.js +20 -11
- package/dist/components/ui/avatar.js.map +1 -1
- package/dist/components/ui/badge.d.ts +8 -0
- package/dist/components/ui/badge.js +45 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +10 -0
- package/dist/components/ui/breadcrumb.js +73 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/button-group.d.ts +10 -0
- package/dist/components/ui/button-group.js +42 -0
- package/dist/components/ui/button-group.js.map +1 -0
- package/dist/components/ui/button.d.ts +16 -3
- package/dist/components/ui/button.js +28 -16
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.d.ts +10 -0
- package/dist/components/ui/calendar.js +96 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/card.d.ts +11 -0
- package/dist/components/ui/card.js +57 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +3 -0
- package/dist/components/ui/checkbox.js +20 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/collapsible.js +25 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/combobox.d.ts +24 -0
- package/dist/components/ui/combobox.js +178 -0
- package/dist/components/ui/combobox.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +26 -0
- package/dist/components/ui/dialog.js +99 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/dropdown-menu.js +36 -36
- package/dist/components/ui/empty.d.ts +11 -0
- package/dist/components/ui/empty.js +60 -0
- package/dist/components/ui/empty.js.map +1 -0
- package/dist/components/ui/field.d.ts +24 -0
- package/dist/components/ui/field.js +108 -0
- package/dist/components/ui/field.js.map +1 -0
- package/dist/components/ui/input-group.d.ts +18 -0
- package/dist/components/ui/input-group.js +79 -0
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/item.d.ts +22 -0
- package/dist/components/ui/item.js +122 -0
- package/dist/components/ui/item.js.map +1 -0
- package/dist/components/ui/kbd.d.ts +3 -0
- package/dist/components/ui/kbd.js +20 -0
- package/dist/components/ui/kbd.js.map +1 -0
- package/dist/components/ui/label.d.ts +3 -0
- package/dist/components/ui/label.js +14 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/native-select.d.ts +8 -0
- package/dist/components/ui/native-select.js +39 -0
- package/dist/components/ui/native-select.js.map +1 -0
- package/dist/components/ui/pagination.d.ts +17 -0
- package/dist/components/ui/pagination.js +81 -0
- package/dist/components/ui/pagination.js.map +1 -0
- package/dist/components/ui/popover.d.ts +9 -0
- package/dist/components/ui/popover.js +56 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +21 -0
- package/dist/components/ui/progress.js +53 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/radio-group.js +27 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +4 -0
- package/dist/components/ui/scroll-area.js +36 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/select.d.ts +23 -0
- package/dist/components/ui/select.js +119 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/sidebar.d.ts +6 -1
- package/dist/components/ui/sidebar.js +92 -92
- package/dist/components/ui/sidebar.js.map +1 -1
- package/dist/components/ui/slider.d.ts +3 -0
- package/dist/components/ui/slider.js +36 -0
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/spinner.d.ts +8 -0
- package/dist/components/ui/spinner.js +24 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.js +20 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/table.js +67 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +10 -0
- package/dist/components/ui/tabs.js +46 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/textarea.js +14 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +11 -0
- package/dist/components/ui/toggle-group.js +54 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle.d.ts +8 -0
- package/dist/components/ui/toggle.js +36 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +7 -2
- package/dist/components/ui/tooltip.js +27 -19
- package/dist/components/ui/tooltip.js.map +1 -1
- package/dist/hooks/use-column-prefs.d.ts +84 -0
- package/dist/hooks/use-column-prefs.js +71 -0
- package/dist/hooks/use-column-prefs.js.map +1 -0
- package/dist/hooks/use-debounced-value.d.ts +13 -0
- package/dist/hooks/use-debounced-value.js +12 -0
- package/dist/hooks/use-debounced-value.js.map +1 -0
- package/dist/hooks/use-document-title.d.ts +5 -0
- package/dist/hooks/use-document-title.js +13 -0
- package/dist/hooks/use-document-title.js.map +1 -0
- package/dist/hooks/use-persisted-state.d.ts +43 -0
- package/dist/hooks/use-persisted-state.js +40 -0
- package/dist/hooks/use-persisted-state.js.map +1 -0
- package/dist/index.d.ts +91 -1
- package/dist/index.js +99 -13
- package/dist/lib/autofill.d.ts +18 -0
- package/dist/lib/autofill.js +10 -0
- package/dist/lib/autofill.js.map +1 -0
- package/dist/lib/dates.d.ts +20 -0
- package/dist/lib/dates.js +16 -0
- package/dist/lib/dates.js.map +1 -0
- package/dist/lib/focus-rendu.d.ts +24 -0
- package/dist/lib/focus-rendu.js +14 -0
- package/dist/lib/focus-rendu.js.map +1 -0
- package/dist/lib/format.d.ts +54 -0
- package/dist/lib/format.js +80 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/normalize.d.ts +28 -0
- package/dist/lib/normalize.js +21 -0
- package/dist/lib/normalize.js.map +1 -0
- package/dist/lib/ordre-colonnes.d.ts +15 -0
- package/dist/lib/ordre-colonnes.js +14 -0
- package/dist/lib/ordre-colonnes.js.map +1 -0
- package/dist/lib/ton.d.ts +23 -0
- package/dist/lib/ton.js +51 -0
- package/dist/lib/ton.js.map +1 -0
- package/dist/styles.css +140 -58
- package/dist/theme.d.ts +34 -0
- package/dist/theme.js +45 -0
- package/dist/theme.js.map +1 -0
- package/package.json +21 -8
- package/src/theme-boot.js +22 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action d'un dialogue : synchrone, ou une promesse que le dialogue attend.
|
|
3
|
+
* Renvoyer `false` (ou une promesse résolue à `false`) garde le dialogue
|
|
4
|
+
* ouvert, sans erreur : la page change sa question (« Supprimer quand
|
|
5
|
+
* même ? ») ou signale elle-même ce qui manque.
|
|
6
|
+
*/
|
|
7
|
+
export type ActionDialogue = () => unknown;
|
|
8
|
+
/**
|
|
9
|
+
* État d'une action lancée depuis un dialogue. `lancer` appelle l'action :
|
|
10
|
+
* si elle renvoie une promesse, `enCours` vaut vrai jusqu'à son issue. Puis
|
|
11
|
+
* `succes`, s'il est donné, est appelé, sauf si l'action a renvoyé `false`
|
|
12
|
+
* (une action qui ne ferme rien n'en passe pas) ; en cas d'échec,
|
|
13
|
+
* `erreur` reçoit la raison. Une action synchrone qui lève une exception
|
|
14
|
+
* échoue de même. `reinitialiser` (à la fermeture du dialogue) oublie une
|
|
15
|
+
* action encore en cours : son issue, venue après, est ignorée, et aucune
|
|
16
|
+
* erreur périmée n'apparaît à la réouverture.
|
|
17
|
+
*/
|
|
18
|
+
export declare function useAction(): {
|
|
19
|
+
enCours: boolean;
|
|
20
|
+
erreur: unknown;
|
|
21
|
+
lancer: (action: ActionDialogue, succes?: () => void) => Promise<void>;
|
|
22
|
+
reinitialiser: () => void;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Ouverture d'un dialogue, contrôlée (`ouvert`, `onOuvertChange`) ou
|
|
26
|
+
* interne. Pendant l'action, toute demande de fermeture (Échap, Annuler,
|
|
27
|
+
* croix, clic sur le voile) est ignorée.
|
|
28
|
+
*/
|
|
29
|
+
export declare function useOuvertureDialogue(ouvert: boolean | undefined, onOuvertChange: ((ouvert: boolean) => void) | undefined, enCours: boolean): {
|
|
30
|
+
ouvert: boolean;
|
|
31
|
+
definir: (suivant: boolean) => void;
|
|
32
|
+
changer: (ouvert: boolean) => void;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* `onOpenChange` d'un dialogue composé à la main qui ne se ferme pas pendant
|
|
36
|
+
* son action (Échap, clic sur le voile, croix, « Annuler ») : le fermer ne
|
|
37
|
+
* l'arrêterait pas, elle aboutirait après coup. Toute demande d'ouverture
|
|
38
|
+
* (`DialogTrigger`) passe, et une fermeture hors de l'action aussi :
|
|
39
|
+
* `onOpenChange={fermerSaufEnCours(enCours, setOuvert)}`. `ConfirmDialog` et
|
|
40
|
+
* `FormDialog` le font d'eux-mêmes.
|
|
41
|
+
*/
|
|
42
|
+
export declare function fermerSaufEnCours(enCours: boolean, onOuvertChange: (ouvert: boolean) => void): (ouvert: boolean) => void;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { useCallback as e, useRef as t, useState as n } from "react";
|
|
2
|
+
// src/components/etic/action.tsx
|
|
3
|
+
function r() {
|
|
4
|
+
let [r, i] = n(!1), [a, o] = n(null), s = t(0);
|
|
5
|
+
return {
|
|
6
|
+
enCours: r,
|
|
7
|
+
erreur: a,
|
|
8
|
+
lancer: e(async (e, t) => {
|
|
9
|
+
let n = ++s.current;
|
|
10
|
+
o(null), i(!0);
|
|
11
|
+
let r;
|
|
12
|
+
try {
|
|
13
|
+
r = await e();
|
|
14
|
+
} catch (e) {
|
|
15
|
+
if (n !== s.current) return;
|
|
16
|
+
o(e ?? /* @__PURE__ */ Error("L'action a échoué. Réessayez.")), i(!1);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
n === s.current && (i(!1), r !== !1 && t?.());
|
|
20
|
+
}, []),
|
|
21
|
+
reinitialiser: e(() => {
|
|
22
|
+
s.current++, o(null), i(!1);
|
|
23
|
+
}, [])
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function i(e, t, r) {
|
|
27
|
+
let [i, o] = n(!1), s = (e) => {
|
|
28
|
+
o(e), t?.(e);
|
|
29
|
+
};
|
|
30
|
+
return {
|
|
31
|
+
ouvert: e ?? i,
|
|
32
|
+
definir: s,
|
|
33
|
+
changer: a(r, s)
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
function a(e, t) {
|
|
37
|
+
return (n) => {
|
|
38
|
+
(n || !e) && t(n);
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
export { a as fermerSaufEnCours, r as useAction, i as useOuvertureDialogue };
|
|
42
|
+
|
|
43
|
+
//# sourceMappingURL=action.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.js","names":["useAction","enCours","setEnCours","useState","erreur","setErreur","generation","useRef","useCallback","numero","resultat","action","raison","succes","useOuvertureDialogue","ouvertInterne","setOuvertInterne","definir","suivant","onOuvertChange","ouvert","fermerSaufEnCours"],"sources":["../../../src/components/etic/action.tsx"],"sourcesContent":["import { useCallback, useRef, useState } from \"react\"\n\n/**\n * Action d'un dialogue : synchrone, ou une promesse que le dialogue attend.\n * Renvoyer `false` (ou une promesse résolue à `false`) garde le dialogue\n * ouvert, sans erreur : la page change sa question (« Supprimer quand\n * même ? ») ou signale elle-même ce qui manque.\n */\nexport type ActionDialogue = () => unknown\n\n/**\n * État d'une action lancée depuis un dialogue. `lancer` appelle l'action :\n * si elle renvoie une promesse, `enCours` vaut vrai jusqu'à son issue. Puis\n * `succes`, s'il est donné, est appelé, sauf si l'action a renvoyé `false`\n * (une action qui ne ferme rien n'en passe pas) ; en cas d'échec,\n * `erreur` reçoit la raison. Une action synchrone qui lève une exception\n * échoue de même. `reinitialiser` (à la fermeture du dialogue) oublie une\n * action encore en cours : son issue, venue après, est ignorée, et aucune\n * erreur périmée n'apparaît à la réouverture.\n */\nexport function useAction() {\n const [enCours, setEnCours] = useState(false)\n const [erreur, setErreur] = useState<unknown>(null)\n // Numéro de la dernière action lancée ou oubliée : une issue qui ne porte\n // plus ce numéro est périmée.\n const generation = useRef(0)\n\n const lancer = useCallback(\n async (action: ActionDialogue, succes?: () => void) => {\n const numero = ++generation.current\n setErreur(null)\n setEnCours(true)\n let resultat: unknown\n try {\n resultat = await action()\n } catch (raison) {\n if (numero !== generation.current) return\n // Une promesse rejetée sans raison doit tout de même s'afficher.\n setErreur(raison ?? new Error(\"L'action a échoué. Réessayez.\"))\n setEnCours(false)\n return\n }\n if (numero !== generation.current) return\n setEnCours(false)\n if (resultat !== false) succes?.()\n },\n []\n )\n\n const reinitialiser = useCallback(() => {\n generation.current++\n setErreur(null)\n setEnCours(false)\n }, [])\n\n return { enCours, erreur, lancer, reinitialiser }\n}\n\n/**\n * Ouverture d'un dialogue, contrôlée (`ouvert`, `onOuvertChange`) ou\n * interne. Pendant l'action, toute demande de fermeture (Échap, Annuler,\n * croix, clic sur le voile) est ignorée.\n */\nexport function useOuvertureDialogue(\n ouvert: boolean | undefined,\n onOuvertChange: ((ouvert: boolean) => void) | undefined,\n enCours: boolean\n) {\n const [ouvertInterne, setOuvertInterne] = useState(false)\n const definir = (suivant: boolean) => {\n setOuvertInterne(suivant)\n onOuvertChange?.(suivant)\n }\n return {\n ouvert: ouvert ?? ouvertInterne,\n definir,\n changer: fermerSaufEnCours(enCours, definir),\n }\n}\n\n/**\n * `onOpenChange` d'un dialogue composé à la main qui ne se ferme pas pendant\n * son action (Échap, clic sur le voile, croix, « Annuler ») : le fermer ne\n * l'arrêterait pas, elle aboutirait après coup. Toute demande d'ouverture\n * (`DialogTrigger`) passe, et une fermeture hors de l'action aussi :\n * `onOpenChange={fermerSaufEnCours(enCours, setOuvert)}`. `ConfirmDialog` et\n * `FormDialog` le font d'eux-mêmes.\n */\nexport function fermerSaufEnCours(\n enCours: boolean,\n onOuvertChange: (ouvert: boolean) => void\n): (ouvert: boolean) => void {\n return (suivant) => {\n if (suivant || !enCours) onOuvertChange(suivant)\n }\n}\n"],"mappings":";;AAoBA,SAAgBA,IAAY;CAC1B,IAAM,CAACC,GAASC,KAAcC,EAAS,EAAK,GACtC,CAACC,GAAQC,KAAaF,EAAkB,IAAI,GAG5CG,IAAaC,EAAO,CAAC;CA8B3B,OAAO;EAAE;EAAS;EAAQ,QA5BXC,EACb,OAAO,GAAwB,MAAwB;GACrD,IAAMC,IAAS,EAAEH,EAAW;GAE5B,AADAD,EAAU,IAAI,GACdH,EAAW,EAAI;GACf,IAAIQ;GACJ,IAAI;IACF,IAAW,MAAMC,EAAO;GAC1B,SAASC,GAAQ;IACf,IAAIH,MAAWH,EAAW,SAAS;IAGnC,AADAD,EAAUO,KAAU,gBAAI,MAAM,+BAA+B,CAAC,GAC9DV,EAAW,EAAK;IAChB;GACF;GACA,AAAIO,MAAWH,EAAW,YAC1BJ,EAAW,EAAK,GACZQ,MAAa,MAAOG,IAAS;EACnC,GACA,CAAC,CASuB;EAAQ,eANZL,QAAkB;GAGtC,AAFA,EAAW,WACXH,EAAU,IAAI,GACdH,EAAW,EAAK;EAClB,GAAG,CAAC,CAE8B;CAAc;AAClD;AAOA,SAAgBY,EACd,GACA,GACA,GACA;CACA,IAAM,CAACC,GAAeC,KAAoBb,EAAS,EAAK,GAClDc,KAAW,MAAqB;EAEpC,AADAD,EAAiBE,CAAO,GACxBC,IAAiBD,CAAO;CAC1B;CACA,OAAO;EACL,QAAQE,KAAUL;EAClB;EACA,SAASM,EAAkBpB,GAASgB,CAAO;CAC7C;AACF;AAUA,SAAgBI,EACd,GACA,GAC2B;CAC3B,QAAQ,MAAY;EAClB,CAAIH,KAAW,CAACjB,MAASkB,EAAeD,CAAO;CACjD;AACF"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
2
|
import { LucideIcon } from 'lucide-react';
|
|
3
3
|
import { ThemeMenuProps } from './theme-menu';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export type AppShellLienComposant =
|
|
4
|
+
import { LienComposant } from './lien';
|
|
5
|
+
/** @deprecated Nom de la 0.2.0 : utiliser `LienComposant`. */
|
|
6
|
+
export type AppShellLienComposant = LienComposant;
|
|
7
7
|
export interface AppShellLien {
|
|
8
8
|
libelle: string;
|
|
9
9
|
href: string;
|
|
@@ -22,9 +22,9 @@ export type AppShellEntreeCompte = {
|
|
|
22
22
|
icone?: LucideIcon;
|
|
23
23
|
} & ({
|
|
24
24
|
href: string;
|
|
25
|
-
|
|
25
|
+
onChoisir?: never;
|
|
26
26
|
} | {
|
|
27
|
-
|
|
27
|
+
onChoisir: () => void;
|
|
28
28
|
href?: never;
|
|
29
29
|
});
|
|
30
30
|
export interface AppShellCompte {
|
|
@@ -40,7 +40,7 @@ export interface AppShellCompte {
|
|
|
40
40
|
/** Entrées du menu du compte, avant « Se déconnecter ». */
|
|
41
41
|
entrees?: AppShellEntreeCompte[];
|
|
42
42
|
/** Appelé après confirmation. */
|
|
43
|
-
|
|
43
|
+
onSeDeconnecter: () => void;
|
|
44
44
|
}
|
|
45
45
|
export interface AppShellProps {
|
|
46
46
|
application: {
|
|
@@ -53,9 +53,18 @@ export interface AppShellProps {
|
|
|
53
53
|
};
|
|
54
54
|
sections: AppShellSection[];
|
|
55
55
|
compte?: AppShellCompte;
|
|
56
|
-
theme?: Pick<ThemeMenuProps, "valeur" | "
|
|
57
|
-
lien
|
|
58
|
-
|
|
56
|
+
theme?: Pick<ThemeMenuProps, "valeur" | "onValeurChange">;
|
|
57
|
+
/** Composant de lien du routeur ; par défaut, celui du `LienProvider`,
|
|
58
|
+
* sinon un `<a>`. */
|
|
59
|
+
lien?: LienComposant;
|
|
60
|
+
/**
|
|
61
|
+
* Au-dessus du contenu, avec les gouttières de `PageContainer` : message
|
|
62
|
+
* qui concerne toute l'application (reprise de session impossible…). Il
|
|
63
|
+
* prend toute la largeur du contenu : la coquille ignore la `largeur` de
|
|
64
|
+
* la page, si bien qu'il déborde d'une page étroite (`largeur="md"`) sur
|
|
65
|
+
* grand écran. Un message propre à une page se place dans son
|
|
66
|
+
* `PageContainer`.
|
|
67
|
+
*/
|
|
59
68
|
bandeau?: ReactNode;
|
|
60
69
|
children: ReactNode;
|
|
61
70
|
}
|
|
@@ -65,5 +74,8 @@ export interface AppShellProps {
|
|
|
65
74
|
* sous 1 025 px, ouvert par une barre du haut. Le tiroir se referme quand on
|
|
66
75
|
* suit un de ses liens. Ne connaît ni le routeur ni l'authentification : l'application
|
|
67
76
|
* fournit les liens, l'état actif, le compte et le thème.
|
|
77
|
+
*
|
|
78
|
+
* Un lien « Aller au contenu », visible au focus, ouvre la tabulation : il
|
|
79
|
+
* saute la navigation et met le focus sur le `<main>`.
|
|
68
80
|
*/
|
|
69
|
-
export declare function AppShell({ application, sections, compte, theme, lien
|
|
81
|
+
export declare function AppShell({ application, sections, compte, theme, lien, bandeau, children, }: AppShellProps): import("react").JSX.Element;
|
|
@@ -3,178 +3,223 @@ import { Avatar as c, AvatarFallback as l, AvatarImage as u } from "../ui/avatar
|
|
|
3
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
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
5
|
import { TooltipProvider as M } from "../ui/tooltip.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
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";
|
|
11
14
|
// src/components/etic/app-shell.tsx
|
|
12
|
-
function
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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", {
|
|
18
|
+
href: `#${c}`,
|
|
19
|
+
"data-slot": "app-shell-skip-link",
|
|
20
|
+
onClick: (e) => {
|
|
21
|
+
e.preventDefault(), document.getElementById(c)?.focus();
|
|
22
|
+
},
|
|
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
|
+
children: "Aller au contenu"
|
|
25
|
+
}), /* @__PURE__ */ H(O, {
|
|
26
|
+
defaultOpen: !q(),
|
|
27
|
+
children: [/* @__PURE__ */ H(X, { children: [
|
|
28
|
+
/* @__PURE__ */ H(C, {
|
|
29
|
+
className: "flex-row items-center group-data-[collapsible=icon]:flex-col",
|
|
30
|
+
children: [/* @__PURE__ */ V(Q, {
|
|
31
|
+
application: e,
|
|
32
|
+
Lien: s
|
|
33
|
+
}), /* @__PURE__ */ V(Y, {})]
|
|
34
|
+
}),
|
|
35
|
+
/* @__PURE__ */ V(v, { children: /* @__PURE__ */ V($, {
|
|
21
36
|
sections: t,
|
|
22
|
-
Lien:
|
|
37
|
+
Lien: s
|
|
23
38
|
}) }),
|
|
24
|
-
n || r ? /* @__PURE__ */
|
|
39
|
+
n || r ? /* @__PURE__ */ H(y, {
|
|
25
40
|
className: "flex-row items-center gap-2 group-data-[collapsible=icon]:flex-col",
|
|
26
|
-
children: [n ? /* @__PURE__ */
|
|
41
|
+
children: [n ? /* @__PURE__ */ V(ee, {
|
|
27
42
|
compte: n,
|
|
28
|
-
Lien:
|
|
29
|
-
}) : null, r ? /* @__PURE__ */
|
|
43
|
+
Lien: s
|
|
44
|
+
}) : null, r ? /* @__PURE__ */ V(P, {
|
|
30
45
|
...r,
|
|
31
46
|
side: "top",
|
|
32
47
|
className: "size-12 shrink-0 bg-sidebar group-data-[collapsible=icon]:size-8"
|
|
33
48
|
}) : null]
|
|
34
49
|
}) : null
|
|
35
|
-
] }), /* @__PURE__ */
|
|
36
|
-
|
|
50
|
+
] }), /* @__PURE__ */ H(w, {
|
|
51
|
+
id: c,
|
|
52
|
+
tabIndex: -1,
|
|
53
|
+
className: "min-w-0 bg-page outline-none",
|
|
37
54
|
children: [
|
|
38
|
-
/* @__PURE__ */
|
|
55
|
+
/* @__PURE__ */ V(te, {
|
|
39
56
|
application: e,
|
|
40
|
-
Lien:
|
|
57
|
+
Lien: s
|
|
58
|
+
}),
|
|
59
|
+
/* @__PURE__ */ V("div", {
|
|
60
|
+
"data-slot": "app-shell-bandeau",
|
|
61
|
+
className: L("empty:hidden", N.laterales, N.haute),
|
|
62
|
+
children: a
|
|
41
63
|
}),
|
|
42
|
-
a,
|
|
43
64
|
o
|
|
44
65
|
]
|
|
45
66
|
})]
|
|
46
|
-
}) });
|
|
67
|
+
})] });
|
|
47
68
|
}
|
|
48
|
-
function
|
|
69
|
+
function q() {
|
|
49
70
|
return typeof document < "u" && /(?:^|;\s*)sidebar_state=false(?:;|$)/.test(document.cookie);
|
|
50
71
|
}
|
|
51
|
-
var
|
|
52
|
-
function
|
|
72
|
+
var J = "data-ferme-tiroir";
|
|
73
|
+
function Y() {
|
|
74
|
+
let { isMobile: e, open: t, toggleSidebar: n } = j();
|
|
75
|
+
if (e) return null;
|
|
76
|
+
let r = t ? "Replier le menu" : "Déplier le menu";
|
|
77
|
+
return /* @__PURE__ */ V(F, {
|
|
78
|
+
variant: "ghost",
|
|
79
|
+
size: "icon-sm",
|
|
80
|
+
"aria-label": r,
|
|
81
|
+
infobulle: `${r} (Ctrl+B)`,
|
|
82
|
+
"aria-keyshortcuts": "Control+B Meta+B",
|
|
83
|
+
"data-slot": "app-shell-collapse",
|
|
84
|
+
className: "shrink-0",
|
|
85
|
+
onClick: n,
|
|
86
|
+
children: /* @__PURE__ */ V(G, {})
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
function X({ children: e }) {
|
|
53
90
|
let { isMobile: t, setOpenMobile: n } = j();
|
|
54
|
-
return /* @__PURE__ */
|
|
91
|
+
return /* @__PURE__ */ H(_, {
|
|
55
92
|
collapsible: "icon",
|
|
56
|
-
children: [/* @__PURE__ */
|
|
93
|
+
children: [/* @__PURE__ */ V("div", {
|
|
57
94
|
className: "contents",
|
|
58
95
|
onClick: (e) => {
|
|
59
|
-
!t || e.ctrlKey || e.metaKey || e.shiftKey || e.target.closest(`a[href], [${
|
|
96
|
+
!t || e.ctrlKey || e.metaKey || e.shiftKey || e.target.closest(`a[href], [${J}]`) && n(!1);
|
|
60
97
|
},
|
|
61
98
|
children: e
|
|
62
|
-
}), /* @__PURE__ */
|
|
99
|
+
}), /* @__PURE__ */ V(k, {})]
|
|
63
100
|
});
|
|
64
101
|
}
|
|
65
|
-
function
|
|
66
|
-
return e.logo ? /* @__PURE__ */
|
|
67
|
-
className:
|
|
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),
|
|
68
105
|
children: e.logo
|
|
69
106
|
}) : null;
|
|
70
107
|
}
|
|
71
|
-
function
|
|
72
|
-
return /* @__PURE__ */
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
className: "
|
|
82
|
-
children:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
108
|
+
function Q({ application: e, Lien: t }) {
|
|
109
|
+
return /* @__PURE__ */ V(T, {
|
|
110
|
+
className: "min-w-0 flex-1",
|
|
111
|
+
children: /* @__PURE__ */ V(D, { children: /* @__PURE__ */ H(E, {
|
|
112
|
+
size: "lg",
|
|
113
|
+
render: /* @__PURE__ */ V(t, { href: e.href ?? "/" }),
|
|
114
|
+
children: [/* @__PURE__ */ V(Z, {
|
|
115
|
+
application: e,
|
|
116
|
+
className: "size-7"
|
|
117
|
+
}), /* @__PURE__ */ H("span", {
|
|
118
|
+
className: "grid flex-1 text-left leading-tight",
|
|
119
|
+
children: [/* @__PURE__ */ V("span", {
|
|
120
|
+
className: "truncate font-semibold",
|
|
121
|
+
children: e.nom
|
|
122
|
+
}), e.sousTitre ? /* @__PURE__ */ V("span", {
|
|
123
|
+
className: "truncate text-xs text-muted-foreground",
|
|
124
|
+
children: e.sousTitre
|
|
125
|
+
}) : null]
|
|
126
|
+
})]
|
|
127
|
+
}) })
|
|
128
|
+
});
|
|
89
129
|
}
|
|
90
|
-
function
|
|
91
|
-
return /* @__PURE__ */
|
|
130
|
+
function $({ sections: e, Lien: t }) {
|
|
131
|
+
return /* @__PURE__ */ V("nav", {
|
|
92
132
|
"aria-label": "Navigation principale",
|
|
93
|
-
children: e.map((e, n) => /* @__PURE__ */
|
|
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, {
|
|
94
134
|
isActive: i,
|
|
95
135
|
tooltip: e,
|
|
96
|
-
render: /* @__PURE__ */
|
|
136
|
+
render: /* @__PURE__ */ V(t, {
|
|
97
137
|
href: n,
|
|
98
138
|
"aria-current": i ? "page" : void 0
|
|
99
139
|
}),
|
|
100
|
-
children: [r ? /* @__PURE__ */
|
|
140
|
+
children: [r ? /* @__PURE__ */ V(r, {}) : null, /* @__PURE__ */ V("span", {
|
|
141
|
+
title: e,
|
|
142
|
+
children: e
|
|
143
|
+
})]
|
|
101
144
|
}) }, a)) }) })] }, n))
|
|
102
145
|
});
|
|
103
146
|
}
|
|
104
|
-
function
|
|
105
|
-
let [y, b] =
|
|
106
|
-
return /* @__PURE__ */
|
|
147
|
+
function ee({ compte: _, Lien: v }) {
|
|
148
|
+
let [y, b] = z(!1);
|
|
149
|
+
return /* @__PURE__ */ H(B, { children: [/* @__PURE__ */ V(T, {
|
|
107
150
|
className: "min-w-0 flex-1",
|
|
108
|
-
children: /* @__PURE__ */
|
|
109
|
-
render: /* @__PURE__ */
|
|
151
|
+
children: /* @__PURE__ */ V(D, { children: /* @__PURE__ */ H(d, { children: [/* @__PURE__ */ H(g, {
|
|
152
|
+
render: /* @__PURE__ */ V(E, {
|
|
110
153
|
size: "lg",
|
|
111
154
|
isActive: _.actif,
|
|
112
155
|
"aria-label": `${_.nom}, menu du compte`,
|
|
113
156
|
className: "data-popup-open:bg-sidebar-accent data-popup-open:text-sidebar-accent-foreground"
|
|
114
157
|
}),
|
|
115
158
|
children: [
|
|
116
|
-
/* @__PURE__ */
|
|
159
|
+
/* @__PURE__ */ H(c, { children: [_.photo ? /* @__PURE__ */ V(u, {
|
|
117
160
|
src: _.photo,
|
|
118
161
|
alt: ""
|
|
119
|
-
}) : null, /* @__PURE__ */
|
|
120
|
-
/* @__PURE__ */
|
|
162
|
+
}) : null, /* @__PURE__ */ V(l, { children: _.initiales })] }),
|
|
163
|
+
/* @__PURE__ */ H("span", {
|
|
121
164
|
className: "grid flex-1 text-left leading-tight",
|
|
122
|
-
children: [/* @__PURE__ */
|
|
165
|
+
children: [/* @__PURE__ */ V("span", {
|
|
123
166
|
className: "truncate font-medium",
|
|
124
167
|
children: _.nom
|
|
125
|
-
}), _.detail ? /* @__PURE__ */
|
|
168
|
+
}), _.detail ? /* @__PURE__ */ V("span", {
|
|
126
169
|
className: "truncate text-xs text-muted-foreground",
|
|
127
170
|
children: _.detail
|
|
128
171
|
}) : null]
|
|
129
172
|
}),
|
|
130
|
-
/* @__PURE__ */
|
|
173
|
+
/* @__PURE__ */ V(U, { className: "ml-auto" })
|
|
131
174
|
]
|
|
132
|
-
}), /* @__PURE__ */
|
|
175
|
+
}), /* @__PURE__ */ H(f, {
|
|
133
176
|
side: "top",
|
|
134
177
|
align: "start",
|
|
135
178
|
className: "min-w-56",
|
|
136
|
-
children: [_.entrees?.length ? /* @__PURE__ */
|
|
137
|
-
render: n ? /* @__PURE__ */
|
|
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,
|
|
138
181
|
onClick: r,
|
|
139
|
-
[
|
|
140
|
-
children: [t ? /* @__PURE__ */
|
|
141
|
-
}, i)) }), /* @__PURE__ */
|
|
182
|
+
[J]: !0,
|
|
183
|
+
children: [t ? /* @__PURE__ */ V(t, {}) : null, e]
|
|
184
|
+
}, i)) }), /* @__PURE__ */ V(h, {})] }) : null, /* @__PURE__ */ H(m, {
|
|
142
185
|
onClick: () => b(!0),
|
|
143
|
-
children: [/* @__PURE__ */
|
|
186
|
+
children: [/* @__PURE__ */ V(W, {}), "Se déconnecter"]
|
|
144
187
|
})]
|
|
145
188
|
})] }) })
|
|
146
|
-
}), /* @__PURE__ */
|
|
189
|
+
}), /* @__PURE__ */ V(e, {
|
|
147
190
|
open: y,
|
|
148
191
|
onOpenChange: b,
|
|
149
|
-
children: /* @__PURE__ */
|
|
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, {
|
|
193
|
+
variant: "destructive",
|
|
150
194
|
onClick: () => {
|
|
151
|
-
b(!1), _.
|
|
195
|
+
b(!1), _.onSeDeconnecter();
|
|
152
196
|
},
|
|
153
197
|
children: "Se déconnecter"
|
|
154
198
|
})] })] })
|
|
155
199
|
})] });
|
|
156
200
|
}
|
|
157
|
-
function
|
|
201
|
+
function te({ application: e, Lien: t }) {
|
|
158
202
|
let { isMobile: n, openMobile: r } = j();
|
|
159
|
-
return n ? /* @__PURE__ */
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
203
|
+
return n ? /* @__PURE__ */ H("header", {
|
|
204
|
+
"data-slot": "app-shell-mobile-bar",
|
|
205
|
+
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, {
|
|
207
|
+
libelle: "Ouvrir le menu",
|
|
163
208
|
"aria-expanded": r,
|
|
164
209
|
className: "size-9"
|
|
165
|
-
}), /* @__PURE__ */
|
|
210
|
+
}), /* @__PURE__ */ H(t, {
|
|
166
211
|
href: e.href ?? "/",
|
|
167
212
|
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",
|
|
168
|
-
children: [/* @__PURE__ */
|
|
213
|
+
children: [/* @__PURE__ */ V(Z, {
|
|
169
214
|
application: e,
|
|
170
215
|
className: "size-6"
|
|
171
|
-
}), /* @__PURE__ */
|
|
216
|
+
}), /* @__PURE__ */ V("span", {
|
|
172
217
|
className: "truncate",
|
|
173
218
|
children: e.nom
|
|
174
219
|
})]
|
|
175
220
|
})]
|
|
176
221
|
}) : null;
|
|
177
222
|
}
|
|
178
|
-
export {
|
|
223
|
+
export { K as AppShell };
|
|
179
224
|
|
|
180
225
|
//# sourceMappingURL=app-shell.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-shell.js","names":["_Fragment","AppShell","Lien","TooltipProvider","SidebarProvider","colonneRepliee","Colonne","SidebarHeader","Marque","SidebarContent","Navigation","compte","theme","SidebarFooter","MenuCompte","ThemeMenu","SidebarInset","BarreMobile","bandeau","children","FERME_TIROIR","useSidebar","Sidebar","isMobile","event","setOpenMobile","SidebarRail","Logo","application","cn","className","SidebarMenu","SidebarMenuItem","SidebarMenuButton","sections","SidebarGroup","section","SidebarGroupLabel","SidebarGroupContent","Icone","actif","libelle","i","index","confirmer","setConfirmer","useState","Fragment","DropdownMenu","DropdownMenuTrigger","Avatar","AvatarImage","AvatarFallback","ChevronsUpDownIcon","DropdownMenuContent","DropdownMenuGroup","DropdownMenuItem","href","onSelect","DropdownMenuSeparator","LogOutIcon","AlertDialog","AlertDialogContent","AlertDialogHeader","AlertDialogTitle","AlertDialogDescription","AlertDialogFooter","AlertDialogCancel","AlertDialogAction","SidebarTrigger","openMobile"],"sources":["../../../src/components/etic/app-shell.tsx"],"sourcesContent":["import {\n useState,\n type ComponentProps,\n type ComponentType,\n type ReactNode,\n} from \"react\"\nimport { cn } from \"cn\"\nimport { ChevronsUpDownIcon, LogOutIcon, type LucideIcon } 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 {\n ThemeMenu,\n type ThemeMenuProps,\n} from \"@etic-ui/components/etic/theme-menu\"\n\n/** Lien du routeur de l'application (react-router, TanStack Router…), qui\n * reçoit `href` comme un `<a>`. Par défaut, un `<a>` : rechargement complet. */\nexport type AppShellLienComposant = ComponentType<ComponentProps<\"a\">> | \"a\"\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; onSelect?: never } | { onSelect: () => 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 seDeconnecter: () => 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\" | \"changer\">\n lien?: AppShellLienComposant\n /** Au-dessus du contenu, sur toute sa largeur (bandeau d'erreur…). */\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 */\nexport function AppShell({\n application,\n sections,\n compte,\n theme,\n lien: Lien = \"a\",\n bandeau,\n children,\n}: AppShellProps) {\n return (\n <TooltipProvider>\n <SidebarProvider defaultOpen={!colonneRepliee()}>\n <Colonne>\n <SidebarHeader>\n <Marque application={application} Lien={Lien} />\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 className=\"min-w-0\">\n <BarreMobile application={application} Lien={Lien} />\n {bandeau}\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 * La barre latérale. Sur ordinateur, elle se replie en colonne d'icônes\n * (rail, ou Ctrl+B), comme dans shadcn. 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: AppShellLienComposant }) {\n return (\n <SidebarMenu>\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: AppShellLienComposant }) {\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 <span>{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: AppShellLienComposant\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, onSelect }, i) => (\n <DropdownMenuItem\n key={i}\n render={href ? <Lien href={href} /> : undefined}\n onClick={onSelect}\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 ?\n </AlertDialogDescription>\n </AlertDialogHeader>\n <AlertDialogFooter>\n <AlertDialogCancel>Annuler</AlertDialogCancel>\n <AlertDialogAction\n onClick={() => {\n setConfirmer(false)\n compte.seDeconnecter()\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: AppShellLienComposant }) {\n const { isMobile, openMobile } = useSidebar()\n if (!isMobile) return null\n return (\n <header className=\"sticky top-0 z-10 flex h-12 shrink-0 items-center gap-2 border-b bg-background px-2\">\n <SidebarTrigger\n aria-label=\"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":";;;;;;;;;;;AA0HA,SAAgBC,EAAS,EACv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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 ?\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;CAEE,CAAA,GACH,kBAACI,GAAD;EAAiB,aAAa,CAACC,EAAe;EAA9C,UAAA,CACE,kBAACC,GAAD,EAAA,UAAA;GACE,kBAACC,GAAD;IAAe,WAAU;IAAzB,UAAA,CACE,kBAACC,GAAD;KAAqB;KAAmB;IAAO,CAAA,GAC/C,kBAACC,GAAD,CAAc,CAAA,CACD;;GACf,kBAACC,GAAD,EAAA,UACE,kBAACC,GAAD;IAAsB;IAAgB;GAAO,CAAA,EAC/B,CAAA;GACfC,KAAUC,IACT,kBAACC,GAAD;IAAe,WAAU;IAAzB,UAAA,CACGF,IAAS,kBAACG,IAAD;KAAoB;KAAc;IAAO,CAAA,IAAI,MACtDF,IACC,kBAACG,GAAD;KACE,GAAIH;KACJ,MAAK;KACL,WAAU;IACX,CAAA,IACC,IACS;GACb,CAAA,IAAA;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,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