@etic-insa/ui 0.2.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.
- package/README.md +490 -52
- package/dist/components/etic/action.d.ts +16 -7
- package/dist/components/etic/action.js +25 -25
- package/dist/components/etic/action.js.map +1 -1
- package/dist/components/etic/app-shell.d.ts +20 -8
- package/dist/components/etic/app-shell.js +164 -120
- package/dist/components/etic/app-shell.js.map +1 -1
- package/dist/components/etic/auth-image.d.ts +29 -6
- package/dist/components/etic/auth-image.js +41 -18
- package/dist/components/etic/auth-image.js.map +1 -1
- 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/confirm-dialog.d.ts +33 -3
- package/dist/components/etic/confirm-dialog.js +92 -67
- package/dist/components/etic/confirm-dialog.js.map +1 -1
- package/dist/components/etic/copy-button.d.ts +3 -2
- package/dist/components/etic/copy-button.js +3 -3
- package/dist/components/etic/copy-button.js.map +1 -1
- package/dist/components/etic/data-table-bulk-actions.d.ts +41 -4
- package/dist/components/etic/data-table-bulk-actions.js +114 -60
- package/dist/components/etic/data-table-bulk-actions.js.map +1 -1
- 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 +3 -10
- package/dist/components/etic/data-table-format.js +4 -3
- package/dist/components/etic/data-table-format.js.map +1 -1
- package/dist/components/etic/data-table-pagination.d.ts +20 -6
- package/dist/components/etic/data-table-pagination.js +73 -43
- package/dist/components/etic/data-table-pagination.js.map +1 -1
- package/dist/components/etic/data-table-toolbar.d.ts +34 -13
- package/dist/components/etic/data-table-toolbar.js +66 -62
- package/dist/components/etic/data-table-toolbar.js.map +1 -1
- package/dist/components/etic/data-table-view-options.d.ts +44 -4
- package/dist/components/etic/data-table-view-options.js +145 -98
- package/dist/components/etic/data-table-view-options.js.map +1 -1
- package/dist/components/etic/data-table.d.ts +183 -17
- package/dist/components/etic/data-table.js +396 -241
- package/dist/components/etic/data-table.js.map +1 -1
- package/dist/components/etic/date-picker.d.ts +5 -1
- package/dist/components/etic/date-picker.js +97 -84
- package/dist/components/etic/date-picker.js.map +1 -1
- package/dist/components/etic/delete-button.d.ts +12 -4
- package/dist/components/etic/delete-button.js +21 -22
- package/dist/components/etic/delete-button.js.map +1 -1
- package/dist/components/etic/detail-list.d.ts +18 -4
- package/dist/components/etic/detail-list.js +30 -20
- package/dist/components/etic/detail-list.js.map +1 -1
- package/dist/components/etic/disclosure.d.ts +52 -0
- package/dist/components/etic/disclosure.js +71 -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/error-banner.js +34 -38
- package/dist/components/etic/error-banner.js.map +1 -1
- package/dist/components/etic/error-boundary.js +4 -3
- package/dist/components/etic/error-boundary.js.map +1 -1
- 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.js +66 -71
- package/dist/components/etic/file-upload.js.map +1 -1
- package/dist/components/etic/form-dialog.d.ts +25 -2
- package/dist/components/etic/form-dialog.js +95 -77
- package/dist/components/etic/form-dialog.js.map +1 -1
- package/dist/components/etic/icon-toggle.d.ts +27 -9
- package/dist/components/etic/icon-toggle.js +31 -19
- package/dist/components/etic/icon-toggle.js.map +1 -1
- 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 +0 -8
- package/dist/components/etic/loading.js +17 -25
- package/dist/components/etic/loading.js.map +1 -1
- package/dist/components/etic/page-container.d.ts +10 -0
- package/dist/components/etic/page-container.js +9 -5
- package/dist/components/etic/page-container.js.map +1 -1
- package/dist/components/etic/page-header.d.ts +19 -5
- package/dist/components/etic/page-header.js +60 -44
- package/dist/components/etic/page-header.js.map +1 -1
- package/dist/components/etic/phone-input.d.ts +16 -0
- package/dist/components/etic/phone-input.js +71 -65
- package/dist/components/etic/phone-input.js.map +1 -1
- package/dist/components/etic/query-boundary.d.ts +25 -2
- package/dist/components/etic/query-boundary.js +24 -12
- package/dist/components/etic/query-boundary.js.map +1 -1
- package/dist/components/etic/removable-badge.d.ts +30 -0
- package/dist/components/etic/removable-badge.js +39 -0
- package/dist/components/etic/removable-badge.js.map +1 -0
- package/dist/components/etic/save-bar.d.ts +32 -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.js +1 -1
- package/dist/components/etic/search-select.js.map +1 -1
- package/dist/components/etic/segmented-control.d.ts +6 -2
- package/dist/components/etic/segmented-control.js +28 -27
- package/dist/components/etic/segmented-control.js.map +1 -1
- 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 +10 -3
- package/dist/components/etic/stat-tile.js +32 -24
- package/dist/components/etic/stat-tile.js.map +1 -1
- package/dist/components/etic/status-badge.d.ts +2 -4
- package/dist/components/etic/status-badge.js +13 -23
- package/dist/components/etic/status-badge.js.map +1 -1
- 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 +29 -2
- package/dist/components/etic/theme-menu.js +75 -44
- 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 +17 -3
- package/dist/components/etic/tooltip-button.js +19 -19
- package/dist/components/etic/tooltip-button.js.map +1 -1
- 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 +3 -1
- package/dist/components/etic/use-draft-autosave.js +74 -78
- package/dist/components/etic/use-draft-autosave.js.map +1 -1
- 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 +2 -2
- package/dist/components/ui/alert-dialog.js.map +1 -1
- 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 +3 -2
- package/dist/components/ui/badge.js +27 -14
- package/dist/components/ui/badge.js.map +1 -1
- package/dist/components/ui/breadcrumb.js +13 -13
- package/dist/components/ui/button.d.ts +15 -2
- package/dist/components/ui/button.js +29 -17
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.js +1 -1
- package/dist/components/ui/calendar.js.map +1 -1
- package/dist/components/ui/checkbox.js +1 -1
- package/dist/components/ui/checkbox.js.map +1 -1
- package/dist/components/ui/combobox.d.ts +2 -2
- package/dist/components/ui/combobox.js +45 -32
- package/dist/components/ui/combobox.js.map +1 -1
- package/dist/components/ui/dialog.d.ts +10 -1
- package/dist/components/ui/dialog.js +12 -5
- package/dist/components/ui/dialog.js.map +1 -1
- package/dist/components/ui/input-group.d.ts +1 -1
- package/dist/components/ui/popover.d.ts +1 -1
- package/dist/components/ui/popover.js +3 -2
- package/dist/components/ui/popover.js.map +1 -1
- package/dist/components/ui/progress.d.ts +16 -2
- package/dist/components/ui/progress.js +34 -26
- package/dist/components/ui/progress.js.map +1 -1
- package/dist/components/ui/radio-group.js +1 -1
- package/dist/components/ui/radio-group.js.map +1 -1
- package/dist/components/ui/select.d.ts +10 -2
- package/dist/components/ui/select.js +70 -50
- package/dist/components/ui/select.js.map +1 -1
- 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/spinner.d.ts +7 -1
- package/dist/components/ui/spinner.js +9 -1
- package/dist/components/ui/spinner.js.map +1 -1
- package/dist/components/ui/switch.js +1 -1
- package/dist/components/ui/switch.js.map +1 -1
- package/dist/components/ui/table.js +1 -1
- package/dist/components/ui/table.js.map +1 -1
- package/dist/components/ui/tabs.js +2 -2
- package/dist/components/ui/tabs.js.map +1 -1
- 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 +40 -16
- package/dist/index.js +99 -76
- 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 +141 -56
- package/dist/theme.d.ts +34 -0
- package/dist/theme.js +45 -0
- package/dist/theme.js.map +1 -0
- package/package.json +4 -2
- package/src/theme-boot.js +22 -0
|
@@ -8,14 +8,17 @@ export type ActionDialogue = () => unknown;
|
|
|
8
8
|
/**
|
|
9
9
|
* État d'une action lancée depuis un dialogue. `lancer` appelle l'action :
|
|
10
10
|
* si elle renvoie une promesse, `enCours` vaut vrai jusqu'à son issue. Puis
|
|
11
|
-
* `succes
|
|
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,
|
|
12
13
|
* `erreur` reçoit la raison. Une action synchrone qui lève une exception
|
|
13
|
-
* échoue de même.
|
|
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.
|
|
14
17
|
*/
|
|
15
18
|
export declare function useAction(): {
|
|
16
19
|
enCours: boolean;
|
|
17
20
|
erreur: unknown;
|
|
18
|
-
lancer: (action: ActionDialogue, succes
|
|
21
|
+
lancer: (action: ActionDialogue, succes?: () => void) => Promise<void>;
|
|
19
22
|
reinitialiser: () => void;
|
|
20
23
|
};
|
|
21
24
|
/**
|
|
@@ -26,8 +29,14 @@ export declare function useAction(): {
|
|
|
26
29
|
export declare function useOuvertureDialogue(ouvert: boolean | undefined, onOuvertChange: ((ouvert: boolean) => void) | undefined, enCours: boolean): {
|
|
27
30
|
ouvert: boolean;
|
|
28
31
|
definir: (suivant: boolean) => void;
|
|
29
|
-
changer: (
|
|
32
|
+
changer: (ouvert: boolean) => void;
|
|
30
33
|
};
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
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;
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useCallback as t, useState as n } from "react";
|
|
3
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
1
|
+
import { useCallback as e, useRef as t, useState as n } from "react";
|
|
4
2
|
// src/components/etic/action.tsx
|
|
5
|
-
function
|
|
6
|
-
let [
|
|
3
|
+
function r() {
|
|
4
|
+
let [r, i] = n(!1), [a, o] = n(null), s = t(0);
|
|
7
5
|
return {
|
|
8
|
-
enCours:
|
|
9
|
-
erreur:
|
|
10
|
-
lancer:
|
|
11
|
-
|
|
12
|
-
|
|
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;
|
|
13
12
|
try {
|
|
14
|
-
|
|
13
|
+
r = await e();
|
|
15
14
|
} catch (e) {
|
|
16
|
-
|
|
15
|
+
if (n !== s.current) return;
|
|
16
|
+
o(e ?? /* @__PURE__ */ Error("L'action a échoué. Réessayez.")), i(!1);
|
|
17
17
|
return;
|
|
18
18
|
}
|
|
19
|
-
|
|
19
|
+
n === s.current && (i(!1), r !== !1 && t?.());
|
|
20
20
|
}, []),
|
|
21
|
-
reinitialiser:
|
|
22
|
-
|
|
21
|
+
reinitialiser: e(() => {
|
|
22
|
+
s.current++, o(null), i(!1);
|
|
23
23
|
}, [])
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
let [i,
|
|
28
|
-
|
|
26
|
+
function i(e, t, r) {
|
|
27
|
+
let [i, o] = n(!1), s = (e) => {
|
|
28
|
+
o(e), t?.(e);
|
|
29
29
|
};
|
|
30
30
|
return {
|
|
31
31
|
ouvert: e ?? i,
|
|
32
|
-
definir:
|
|
33
|
-
changer: (
|
|
34
|
-
(e || !r) && o(e);
|
|
35
|
-
}
|
|
32
|
+
definir: s,
|
|
33
|
+
changer: a(r, s)
|
|
36
34
|
};
|
|
37
35
|
}
|
|
38
|
-
function
|
|
39
|
-
return
|
|
36
|
+
function a(e, t) {
|
|
37
|
+
return (n) => {
|
|
38
|
+
(n || !e) && t(n);
|
|
39
|
+
};
|
|
40
40
|
}
|
|
41
|
-
export {
|
|
41
|
+
export { a as fermerSaufEnCours, r as useAction, i as useOuvertureDialogue };
|
|
42
42
|
|
|
43
43
|
//# sourceMappingURL=action.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"action.js","names":["useAction","enCours","setEnCours","useState","erreur","setErreur","useCallback","resultat","action","raison","succes","useOuvertureDialogue","ouvertInterne","setOuvertInterne","definir","suivant","onOuvertChange","ouvert","
|
|
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;
|
|
@@ -46,16 +46,28 @@ export interface AppShellProps {
|
|
|
46
46
|
application: {
|
|
47
47
|
nom: string;
|
|
48
48
|
sousTitre?: string;
|
|
49
|
-
/** Image ou icône,
|
|
49
|
+
/** Image ou icône, carrée : 32 px dans la barre latérale, 24 px dans la
|
|
50
|
+
* barre du haut sur mobile. */
|
|
50
51
|
logo?: ReactNode;
|
|
51
52
|
/** Lien de la marque ; « / » par défaut. */
|
|
52
53
|
href?: string;
|
|
53
54
|
};
|
|
54
55
|
sections: AppShellSection[];
|
|
55
56
|
compte?: AppShellCompte;
|
|
57
|
+
/** Choix du thème : entrée « Thème » du menu du compte, ou son propre
|
|
58
|
+
* bouton dans le pied de la barre sans `compte`. */
|
|
56
59
|
theme?: Pick<ThemeMenuProps, "valeur" | "onValeurChange">;
|
|
57
|
-
lien
|
|
58
|
-
|
|
60
|
+
/** Composant de lien du routeur ; par défaut, celui du `LienProvider`,
|
|
61
|
+
* sinon un `<a>`. */
|
|
62
|
+
lien?: LienComposant;
|
|
63
|
+
/**
|
|
64
|
+
* Au-dessus du contenu, avec les gouttières de `PageContainer` : message
|
|
65
|
+
* qui concerne toute l'application (reprise de session impossible…). Il
|
|
66
|
+
* prend toute la largeur du contenu : la coquille ignore la `largeur` de
|
|
67
|
+
* la page, si bien qu'il déborde d'une page étroite (`largeur="md"`) sur
|
|
68
|
+
* grand écran. Un message propre à une page se place dans son
|
|
69
|
+
* `PageContainer`.
|
|
70
|
+
*/
|
|
59
71
|
bandeau?: ReactNode;
|
|
60
72
|
children: ReactNode;
|
|
61
73
|
}
|
|
@@ -69,4 +81,4 @@ export interface AppShellProps {
|
|
|
69
81
|
* Un lien « Aller au contenu », visible au focus, ouvre la tabulation : il
|
|
70
82
|
* saute la navigation et met le focus sur le `<main>`.
|
|
71
83
|
*/
|
|
72
|
-
export declare function AppShell({ application, sections, compte, theme, lien
|
|
84
|
+
export declare function AppShell({ application, sections, compte, theme, lien, bandeau, children, }: AppShellProps): import("react").JSX.Element;
|
|
@@ -1,74 +1,81 @@
|
|
|
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
|
|
3
|
-
import { DropdownMenu as
|
|
4
|
-
import { Sidebar as
|
|
5
|
-
import { TooltipProvider as
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
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";
|
|
12
14
|
// src/components/etic/app-shell.tsx
|
|
13
|
-
function
|
|
14
|
-
let s =
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
href: `#${
|
|
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
|
+
href: `#${c}`,
|
|
17
19
|
"data-slot": "app-shell-skip-link",
|
|
18
20
|
onClick: (e) => {
|
|
19
|
-
e.preventDefault(), document.getElementById(
|
|
21
|
+
e.preventDefault(), document.getElementById(c)?.focus();
|
|
20
22
|
},
|
|
21
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",
|
|
22
24
|
children: "Aller au contenu"
|
|
23
|
-
}), /* @__PURE__ */
|
|
24
|
-
defaultOpen: !
|
|
25
|
-
children: [/* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */
|
|
25
|
+
}), /* @__PURE__ */ q(ne, {
|
|
26
|
+
defaultOpen: !ie(),
|
|
27
|
+
children: [/* @__PURE__ */ q(oe, { children: [
|
|
28
|
+
/* @__PURE__ */ q(T, {
|
|
27
29
|
className: "flex-row items-center group-data-[collapsible=icon]:flex-col",
|
|
28
|
-
children: [/* @__PURE__ */
|
|
30
|
+
children: [/* @__PURE__ */ K(se, {
|
|
29
31
|
application: e,
|
|
30
|
-
Lien:
|
|
31
|
-
}), /* @__PURE__ */
|
|
32
|
+
Lien: s
|
|
33
|
+
}), /* @__PURE__ */ K(ae, {})]
|
|
32
34
|
}),
|
|
33
|
-
/* @__PURE__ */
|
|
35
|
+
/* @__PURE__ */ K(b, { children: /* @__PURE__ */ K(ce, {
|
|
34
36
|
sections: t,
|
|
35
|
-
Lien:
|
|
37
|
+
Lien: s
|
|
36
38
|
}) }),
|
|
37
|
-
n || r ? /* @__PURE__ */
|
|
39
|
+
n || r ? /* @__PURE__ */ K(x, {
|
|
38
40
|
className: "flex-row items-center gap-2 group-data-[collapsible=icon]:flex-col",
|
|
39
|
-
children:
|
|
41
|
+
children: n ? /* @__PURE__ */ K($, {
|
|
40
42
|
compte: n,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
theme: r,
|
|
44
|
+
Lien: s
|
|
45
|
+
}) : r ? /* @__PURE__ */ K(I, {
|
|
43
46
|
...r,
|
|
44
47
|
side: "top",
|
|
45
|
-
className: "size-12 shrink-0 bg-sidebar group-data-[collapsible=icon]:size-8"
|
|
46
|
-
}) : 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
|
|
47
50
|
}) : null
|
|
48
|
-
] }), /* @__PURE__ */
|
|
49
|
-
id:
|
|
51
|
+
] }), /* @__PURE__ */ q(E, {
|
|
52
|
+
id: c,
|
|
50
53
|
tabIndex: -1,
|
|
51
|
-
className: "min-w-0 outline-none",
|
|
54
|
+
className: "min-w-0 bg-page outline-none",
|
|
52
55
|
children: [
|
|
53
|
-
/* @__PURE__ */
|
|
56
|
+
/* @__PURE__ */ K(ue, {
|
|
54
57
|
application: e,
|
|
55
|
-
Lien:
|
|
58
|
+
Lien: s
|
|
59
|
+
}),
|
|
60
|
+
/* @__PURE__ */ K("div", {
|
|
61
|
+
"data-slot": "app-shell-bandeau",
|
|
62
|
+
className: H("empty:hidden", P.laterales, P.haute),
|
|
63
|
+
children: a
|
|
56
64
|
}),
|
|
57
|
-
a,
|
|
58
65
|
o
|
|
59
66
|
]
|
|
60
67
|
})]
|
|
61
68
|
})] });
|
|
62
69
|
}
|
|
63
|
-
function
|
|
70
|
+
function ie() {
|
|
64
71
|
return typeof document < "u" && /(?:^|;\s*)sidebar_state=false(?:;|$)/.test(document.cookie);
|
|
65
72
|
}
|
|
66
|
-
var
|
|
67
|
-
function
|
|
68
|
-
let { isMobile: e, open: t, toggleSidebar: n } =
|
|
73
|
+
var Z = "data-ferme-tiroir";
|
|
74
|
+
function ae() {
|
|
75
|
+
let { isMobile: e, open: t, toggleSidebar: n } = M();
|
|
69
76
|
if (e) return null;
|
|
70
77
|
let r = t ? "Replier le menu" : "Déplier le menu";
|
|
71
|
-
return /* @__PURE__ */
|
|
78
|
+
return /* @__PURE__ */ K(B, {
|
|
72
79
|
variant: "ghost",
|
|
73
80
|
size: "icon-sm",
|
|
74
81
|
"aria-label": r,
|
|
@@ -77,43 +84,43 @@ function q() {
|
|
|
77
84
|
"data-slot": "app-shell-collapse",
|
|
78
85
|
className: "shrink-0",
|
|
79
86
|
onClick: n,
|
|
80
|
-
children: /* @__PURE__ */
|
|
87
|
+
children: /* @__PURE__ */ K(X, {})
|
|
81
88
|
});
|
|
82
89
|
}
|
|
83
|
-
function
|
|
84
|
-
let { isMobile: t, setOpenMobile: n } =
|
|
85
|
-
return /* @__PURE__ */
|
|
90
|
+
function oe({ children: e }) {
|
|
91
|
+
let { isMobile: t, setOpenMobile: n } = M();
|
|
92
|
+
return /* @__PURE__ */ q(y, {
|
|
86
93
|
collapsible: "icon",
|
|
87
|
-
children: [/* @__PURE__ */
|
|
94
|
+
children: [/* @__PURE__ */ K("div", {
|
|
88
95
|
className: "contents",
|
|
89
96
|
onClick: (e) => {
|
|
90
|
-
!t || e.ctrlKey || e.metaKey || e.shiftKey || e.target.closest(`a[href], [${
|
|
97
|
+
!t || e.ctrlKey || e.metaKey || e.shiftKey || e.target.closest(`a[href], [${Z}]`) && n(!1);
|
|
91
98
|
},
|
|
92
99
|
children: e
|
|
93
|
-
}), /* @__PURE__ */
|
|
100
|
+
}), /* @__PURE__ */ K(A, {})]
|
|
94
101
|
});
|
|
95
102
|
}
|
|
96
|
-
function
|
|
97
|
-
return e.logo ? /* @__PURE__ */
|
|
98
|
-
className:
|
|
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),
|
|
99
106
|
children: e.logo
|
|
100
107
|
}) : null;
|
|
101
108
|
}
|
|
102
|
-
function
|
|
103
|
-
return /* @__PURE__ */
|
|
109
|
+
function se({ application: e, Lien: t }) {
|
|
110
|
+
return /* @__PURE__ */ K(D, {
|
|
104
111
|
className: "min-w-0 flex-1",
|
|
105
|
-
children: /* @__PURE__ */
|
|
112
|
+
children: /* @__PURE__ */ K(k, { children: /* @__PURE__ */ q(O, {
|
|
106
113
|
size: "lg",
|
|
107
|
-
render: /* @__PURE__ */
|
|
108
|
-
children: [/* @__PURE__ */
|
|
114
|
+
render: /* @__PURE__ */ K(t, { href: e.href ?? "/" }),
|
|
115
|
+
children: [/* @__PURE__ */ K(Q, {
|
|
109
116
|
application: e,
|
|
110
|
-
className: "size-
|
|
111
|
-
}), /* @__PURE__ */
|
|
117
|
+
className: "size-8"
|
|
118
|
+
}), /* @__PURE__ */ q("span", {
|
|
112
119
|
className: "grid flex-1 text-left leading-tight",
|
|
113
|
-
children: [/* @__PURE__ */
|
|
120
|
+
children: [/* @__PURE__ */ K("span", {
|
|
114
121
|
className: "truncate font-semibold",
|
|
115
122
|
children: e.nom
|
|
116
|
-
}), e.sousTitre ? /* @__PURE__ */
|
|
123
|
+
}), e.sousTitre ? /* @__PURE__ */ K("span", {
|
|
117
124
|
className: "truncate text-xs text-muted-foreground",
|
|
118
125
|
children: e.sousTitre
|
|
119
126
|
}) : null]
|
|
@@ -121,98 +128,135 @@ function X({ application: e, Lien: t }) {
|
|
|
121
128
|
}) })
|
|
122
129
|
});
|
|
123
130
|
}
|
|
124
|
-
function
|
|
125
|
-
return /* @__PURE__ */
|
|
131
|
+
function ce({ sections: e, Lien: t }) {
|
|
132
|
+
return /* @__PURE__ */ K("nav", {
|
|
126
133
|
"aria-label": "Navigation principale",
|
|
127
|
-
children: e.map((e, n) => /* @__PURE__ */
|
|
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, {
|
|
128
135
|
isActive: i,
|
|
129
136
|
tooltip: e,
|
|
130
|
-
render: /* @__PURE__ */
|
|
137
|
+
render: /* @__PURE__ */ K(t, {
|
|
131
138
|
href: n,
|
|
132
139
|
"aria-current": i ? "page" : void 0
|
|
133
140
|
}),
|
|
134
|
-
children: [r ? /* @__PURE__ */
|
|
141
|
+
children: [r ? /* @__PURE__ */ K(r, {}) : null, /* @__PURE__ */ K("span", {
|
|
135
142
|
title: e,
|
|
136
143
|
children: e
|
|
137
144
|
})]
|
|
138
145
|
}) }, a)) }) })] }, n))
|
|
139
146
|
});
|
|
140
147
|
}
|
|
141
|
-
function
|
|
142
|
-
let
|
|
143
|
-
return /* @__PURE__ */
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
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"
|
|
166
176
|
}),
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
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
|
+
]
|
|
181
221
|
})]
|
|
182
|
-
})
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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, {
|
|
230
|
+
variant: "destructive",
|
|
187
231
|
onClick: () => {
|
|
188
|
-
|
|
232
|
+
y(!1), p.onSeDeconnecter();
|
|
189
233
|
},
|
|
190
234
|
children: "Se déconnecter"
|
|
191
235
|
})] })] })
|
|
192
236
|
})] });
|
|
193
237
|
}
|
|
194
|
-
function
|
|
195
|
-
let { isMobile: n, openMobile: r } =
|
|
196
|
-
return n ? /* @__PURE__ */
|
|
238
|
+
function ue({ application: e, Lien: t }) {
|
|
239
|
+
let { isMobile: n, openMobile: r } = M();
|
|
240
|
+
return n ? /* @__PURE__ */ q("header", {
|
|
197
241
|
"data-slot": "app-shell-mobile-bar",
|
|
198
|
-
className: "sticky top-0 z-10 flex h-12 shrink-0 items-center gap-2 border-b bg-
|
|
199
|
-
children: [/* @__PURE__ */
|
|
200
|
-
|
|
242
|
+
className: "sticky top-0 z-10 flex h-12 shrink-0 items-center gap-2 border-b bg-page px-2",
|
|
243
|
+
children: [/* @__PURE__ */ K(j, {
|
|
244
|
+
libelle: "Ouvrir le menu",
|
|
201
245
|
"aria-expanded": r,
|
|
202
246
|
className: "size-9"
|
|
203
|
-
}), /* @__PURE__ */
|
|
247
|
+
}), /* @__PURE__ */ q(t, {
|
|
204
248
|
href: e.href ?? "/",
|
|
205
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",
|
|
206
|
-
children: [/* @__PURE__ */
|
|
250
|
+
children: [/* @__PURE__ */ K(Q, {
|
|
207
251
|
application: e,
|
|
208
252
|
className: "size-6"
|
|
209
|
-
}), /* @__PURE__ */
|
|
253
|
+
}), /* @__PURE__ */ K("span", {
|
|
210
254
|
className: "truncate",
|
|
211
255
|
children: e.nom
|
|
212
256
|
})]
|
|
213
257
|
})]
|
|
214
258
|
}) : null;
|
|
215
259
|
}
|
|
216
|
-
export {
|
|
260
|
+
export { re as AppShell };
|
|
217
261
|
|
|
218
262
|
//# sourceMappingURL=app-shell.js.map
|