@etic-insa/ui 0.4.1 → 0.5.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 +109 -51
- package/dist/components/etic/centered-screen.d.ts +19 -1
- package/dist/components/etic/centered-screen.js +35 -3
- package/dist/components/etic/centered-screen.js.map +1 -1
- package/dist/components/etic/data-table-toolbar.d.ts +6 -4
- package/dist/components/etic/data-table-toolbar.js +2 -2
- package/dist/components/etic/data-table-toolbar.js.map +1 -1
- package/dist/components/etic/data-table.d.ts +3 -1
- package/dist/components/etic/data-table.js.map +1 -1
- package/dist/components/etic/dropdown-menu-action.d.ts +30 -0
- package/dist/components/etic/dropdown-menu-action.js +30 -0
- package/dist/components/etic/dropdown-menu-action.js.map +1 -0
- package/dist/components/etic/error-banner.d.ts +44 -10
- package/dist/components/etic/error-banner.js +43 -27
- package/dist/components/etic/error-banner.js.map +1 -1
- package/dist/components/etic/form-dialog.d.ts +8 -1
- package/dist/components/etic/form-dialog.js +92 -60
- package/dist/components/etic/form-dialog.js.map +1 -1
- package/dist/components/etic/page-header.d.ts +2 -1
- package/dist/components/etic/page-header.js +40 -52
- package/dist/components/etic/page-header.js.map +1 -1
- package/dist/components/etic/save-bar.d.ts +11 -5
- package/dist/components/etic/save-bar.js +15 -14
- package/dist/components/etic/save-bar.js.map +1 -1
- package/dist/components/ui/sheet.js +41 -36
- package/dist/components/ui/sheet.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.js +46 -45
- package/dist/styles.css +7 -3
- package/dist/testing/index.d.ts +19 -0
- package/dist/testing/index.js +40 -0
- package/dist/testing/index.js.map +1 -0
- package/package.json +19 -3
- package/vite-plugin.d.ts +31 -0
- package/vite-plugin.js +156 -0
|
@@ -1,82 +1,83 @@
|
|
|
1
1
|
import { Breadcrumb as e, BreadcrumbItem as t, BreadcrumbLink as n, BreadcrumbList as r, BreadcrumbPage as i, BreadcrumbSeparator as a } from "../ui/breadcrumb.js";
|
|
2
2
|
import { Button as o } from "../ui/button.js";
|
|
3
|
-
import { DropdownMenu as s, DropdownMenuContent as c,
|
|
3
|
+
import { DropdownMenu as s, DropdownMenuContent as c, DropdownMenuTrigger as l } from "../ui/dropdown-menu.js";
|
|
4
|
+
import { DropdownMenuAction as u } from "./dropdown-menu-action.js";
|
|
4
5
|
import { Tooltip as d, TooltipContent as f, TooltipTrigger as p } from "../ui/tooltip.js";
|
|
5
6
|
import { useLien as m } from "./lien.js";
|
|
6
7
|
import { cn as h } from "cn";
|
|
7
8
|
import { Fragment as g } from "react";
|
|
8
|
-
import {
|
|
9
|
-
import { EllipsisIcon as
|
|
9
|
+
import { jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
10
|
+
import { EllipsisIcon as y } from "lucide-react";
|
|
10
11
|
// src/components/etic/page-header.tsx
|
|
11
|
-
function
|
|
12
|
-
return /* @__PURE__ */
|
|
12
|
+
function b({ titre: e, description: t, actions: n, tailleActions: r = "lg", className: i }) {
|
|
13
|
+
return /* @__PURE__ */ v("div", {
|
|
13
14
|
"data-slot": "page-header",
|
|
14
15
|
className: h("flex flex-wrap items-start justify-between gap-x-4 gap-y-3", i),
|
|
15
|
-
children: [/* @__PURE__ */
|
|
16
|
+
children: [/* @__PURE__ */ v("div", {
|
|
16
17
|
className: "flex min-w-0 flex-col gap-1",
|
|
17
|
-
children: [/* @__PURE__ */
|
|
18
|
+
children: [/* @__PURE__ */ _("h1", {
|
|
18
19
|
className: "font-heading text-2xl font-semibold tracking-tight",
|
|
19
20
|
children: e
|
|
20
|
-
}), t ? /* @__PURE__ */
|
|
21
|
+
}), t ? /* @__PURE__ */ _("p", {
|
|
21
22
|
className: "text-sm text-muted-foreground",
|
|
22
23
|
children: t
|
|
23
24
|
}) : null]
|
|
24
|
-
}), n ? /* @__PURE__ */
|
|
25
|
+
}), n ? /* @__PURE__ */ _(x, {
|
|
25
26
|
taille: r,
|
|
26
27
|
children: n
|
|
27
28
|
}) : null]
|
|
28
29
|
});
|
|
29
30
|
}
|
|
30
|
-
function
|
|
31
|
-
return /* @__PURE__ */
|
|
31
|
+
function x({ taille: e, children: t }) {
|
|
32
|
+
return /* @__PURE__ */ _("div", {
|
|
32
33
|
"data-echelle": e,
|
|
33
|
-
className: h("flex flex-wrap items-center gap-2",
|
|
34
|
+
className: h("flex flex-wrap items-center gap-2", S[e]),
|
|
34
35
|
children: t
|
|
35
36
|
});
|
|
36
37
|
}
|
|
37
|
-
var
|
|
38
|
+
var S = {
|
|
38
39
|
default: "[--bouton-hauteur:2rem] [--bouton-icone:2rem]",
|
|
39
40
|
lg: "[--bouton-hauteur:2.25rem] [--bouton-icone:2.25rem]"
|
|
40
41
|
};
|
|
41
|
-
function
|
|
42
|
-
let
|
|
42
|
+
function C({ chemin: o = [], titre: s, badges: c, meta: l, actions: u, actionsSecondaires: d = [], tailleActions: f = "lg", compact: p = !1, lien: y, className: b }) {
|
|
43
|
+
let S = m(y), C = u || d.length > 0 ? /* @__PURE__ */ v(x, {
|
|
43
44
|
taille: f,
|
|
44
|
-
children: [u, d.length > 0 ? /* @__PURE__ */
|
|
45
|
+
children: [u, d.length > 0 ? /* @__PURE__ */ _(w, {
|
|
45
46
|
actions: d,
|
|
46
47
|
taille: f
|
|
47
48
|
}) : null]
|
|
48
|
-
}) : null,
|
|
49
|
-
render: /* @__PURE__ */
|
|
49
|
+
}) : null, T = o.map(({ libelle: e, href: r }, i) => /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(t, { children: /* @__PURE__ */ _(n, {
|
|
50
|
+
render: /* @__PURE__ */ _(S, { href: r }),
|
|
50
51
|
children: e
|
|
51
|
-
}) }), /* @__PURE__ */
|
|
52
|
-
return p && o.length > 0 ? /* @__PURE__ */
|
|
52
|
+
}) }), /* @__PURE__ */ _(a, {})] }, i));
|
|
53
|
+
return p && o.length > 0 ? /* @__PURE__ */ v("div", {
|
|
53
54
|
"data-slot": "detail-header",
|
|
54
55
|
className: h("flex flex-wrap items-center justify-between gap-x-4 gap-y-2", b),
|
|
55
|
-
children: [/* @__PURE__ */
|
|
56
|
+
children: [/* @__PURE__ */ _(e, {
|
|
56
57
|
className: "min-w-0",
|
|
57
|
-
children: /* @__PURE__ */
|
|
58
|
+
children: /* @__PURE__ */ v(r, { children: [T, /* @__PURE__ */ v(t, { children: [/* @__PURE__ */ _("h1", {
|
|
58
59
|
className: "text-sm font-medium",
|
|
59
|
-
children: /* @__PURE__ */
|
|
60
|
+
children: /* @__PURE__ */ _(i, {
|
|
60
61
|
role: void 0,
|
|
61
62
|
"aria-disabled": void 0,
|
|
62
63
|
children: s
|
|
63
64
|
})
|
|
64
65
|
}), c] })] })
|
|
65
66
|
}), C]
|
|
66
|
-
}) : /* @__PURE__ */
|
|
67
|
+
}) : /* @__PURE__ */ v("div", {
|
|
67
68
|
"data-slot": "detail-header",
|
|
68
69
|
className: h("flex flex-col gap-3", b),
|
|
69
|
-
children: [o.length > 0 ? /* @__PURE__ */
|
|
70
|
+
children: [o.length > 0 ? /* @__PURE__ */ _(e, { children: /* @__PURE__ */ v(r, { children: [T, /* @__PURE__ */ _(t, { children: /* @__PURE__ */ _(i, { children: s }) })] }) }) : null, /* @__PURE__ */ v("div", {
|
|
70
71
|
className: "flex flex-wrap items-start justify-between gap-x-4 gap-y-3",
|
|
71
|
-
children: [/* @__PURE__ */
|
|
72
|
+
children: [/* @__PURE__ */ v("div", {
|
|
72
73
|
className: "flex min-w-0 flex-col gap-1",
|
|
73
|
-
children: [/* @__PURE__ */
|
|
74
|
+
children: [/* @__PURE__ */ v("div", {
|
|
74
75
|
className: "flex flex-wrap items-center gap-2",
|
|
75
|
-
children: [/* @__PURE__ */
|
|
76
|
+
children: [/* @__PURE__ */ _("h1", {
|
|
76
77
|
className: "font-heading text-2xl font-semibold tracking-tight break-words",
|
|
77
78
|
children: s
|
|
78
79
|
}), c]
|
|
79
|
-
}), l ? /* @__PURE__ */
|
|
80
|
+
}), l ? /* @__PURE__ */ _("p", {
|
|
80
81
|
className: "text-sm break-words text-muted-foreground",
|
|
81
82
|
children: l
|
|
82
83
|
}) : null]
|
|
@@ -84,37 +85,24 @@ function w({ chemin: o = [], titre: s, badges: c, meta: l, actions: u, actionsSe
|
|
|
84
85
|
})]
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
|
-
function
|
|
88
|
-
return /* @__PURE__ */
|
|
89
|
-
render: /* @__PURE__ */
|
|
88
|
+
function w({ actions: e, taille: t }) {
|
|
89
|
+
return /* @__PURE__ */ v(s, { children: [/* @__PURE__ */ v(d, { children: [/* @__PURE__ */ _(p, {
|
|
90
|
+
render: /* @__PURE__ */ _(l, { render: /* @__PURE__ */ _(o, {
|
|
90
91
|
variant: "outline",
|
|
91
92
|
size: "icon",
|
|
92
93
|
"aria-label": "Plus d'actions"
|
|
93
94
|
}) }),
|
|
94
|
-
children: /* @__PURE__ */
|
|
95
|
-
}), /* @__PURE__ */
|
|
95
|
+
children: /* @__PURE__ */ _(y, {})
|
|
96
|
+
}), /* @__PURE__ */ _(f, { children: "Plus d'actions" })] }), /* @__PURE__ */ _(c, {
|
|
96
97
|
align: "end",
|
|
97
98
|
sideOffset: t === "lg" ? 6 : 4,
|
|
98
99
|
className: "min-w-48",
|
|
99
|
-
children: e.map((
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
className: i ? "data-disabled:opacity-100" : void 0,
|
|
104
|
-
children: i ? /* @__PURE__ */ y(_, { children: [n ? /* @__PURE__ */ v(n, { className: "opacity-50" }) : null, /* @__PURE__ */ y("span", {
|
|
105
|
-
className: "flex flex-col",
|
|
106
|
-
children: [/* @__PURE__ */ v("span", {
|
|
107
|
-
className: "opacity-50",
|
|
108
|
-
children: e
|
|
109
|
-
}), /* @__PURE__ */ v("span", {
|
|
110
|
-
"data-slot": "detail-header-raison",
|
|
111
|
-
className: "text-xs text-muted-foreground",
|
|
112
|
-
children: i
|
|
113
|
-
})]
|
|
114
|
-
})] }) : /* @__PURE__ */ y(_, { children: [n ? /* @__PURE__ */ v(n, {}) : null, e] })
|
|
115
|
-
}, a))
|
|
100
|
+
children: e.map((e, t) => /* @__PURE__ */ _(u, {
|
|
101
|
+
...e,
|
|
102
|
+
verrou: e.verrou || void 0
|
|
103
|
+
}, t))
|
|
116
104
|
})] });
|
|
117
105
|
}
|
|
118
|
-
export {
|
|
106
|
+
export { C as DetailHeader, b as PageHeader };
|
|
119
107
|
|
|
120
108
|
//# sourceMappingURL=page-header.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"page-header.js","names":["_Fragment","Fragment$1","PageHeader","cn","className","titre","description","actions","Actions","tailleActions","taille","ECHELLES","DetailHeader","Lien","useLien","lien","lesActions","actionsSecondaires","MenuActions","etapes","chemin","Fragment","BreadcrumbItem","BreadcrumbLink","libelle","BreadcrumbSeparator","index","compact","Breadcrumb","BreadcrumbList","BreadcrumbPage","badges","meta","DropdownMenu","Tooltip","TooltipTrigger","DropdownMenuTrigger","Button","EllipsisIcon","TooltipContent","DropdownMenuContent","Icone","DropdownMenuItem","destructif","verrou","onChoisir"],"sources":["../../../src/components/etic/page-header.tsx"],"sourcesContent":["import { Fragment, type ReactNode } from \"react\"\nimport { cn } from \"cn\"\nimport { EllipsisIcon, type LucideIcon } from \"lucide-react\"\n\nimport {\n Breadcrumb,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbSeparator,\n} from \"@etic-ui/components/ui/breadcrumb\"\nimport { Button } from \"@etic-ui/components/ui/button\"\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuItem,\n DropdownMenuTrigger,\n} from \"@etic-ui/components/ui/dropdown-menu\"\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"@etic-ui/components/ui/tooltip\"\nimport { useLien, type LienComposant } from \"@etic-ui/components/etic/lien\"\n\nexport interface PageHeaderProps {\n titre: ReactNode\n /** Ligne discrète sous le titre. */\n description?: ReactNode\n /** Boutons à droite (créer, exporter…) ; passent dessous sur un écran étroit. */\n actions?: ReactNode\n /**\n * Taille des boutons de `actions` : `lg` par défaut (36 px), sans `size`\n * à leur donner — `default` et `icon` y deviennent `lg` et `icon-lg`.\n * `\"default\"` garde les tailles données.\n */\n tailleActions?: TailleActions\n className?: string\n}\n\ntype TailleActions = \"default\" | \"lg\"\n\n/** En-tête d'une page : titre (le `<h1>`) et description à gauche, actions\n * à droite. */\nexport function PageHeader({\n titre,\n description,\n actions,\n tailleActions = \"lg\",\n className,\n}: PageHeaderProps) {\n return (\n <div\n data-slot=\"page-header\"\n className={cn(\n \"flex flex-wrap items-start justify-between gap-x-4 gap-y-3\",\n className\n )}\n >\n <div className=\"flex min-w-0 flex-col gap-1\">\n <h1 className=\"font-heading text-2xl font-semibold tracking-tight\">\n {titre}\n </h1>\n {description ? (\n <p className=\"text-sm text-muted-foreground\">{description}</p>\n ) : null}\n </div>\n {actions ? <Actions taille={tailleActions}>{actions}</Actions> : null}\n </div>\n )\n}\n\nfunction Actions({\n taille,\n children,\n}: {\n taille: TailleActions\n children: ReactNode\n}) {\n // Hauteur des tailles `default` et `icon` de `Button` (et de tout\n // `buttonVariants`) dans cette zone : héritée par ses descendants, pas par\n // un dialogue ouvert d'ici (rendu dans un portail). Posée aussi à\n // `default`, pour ne pas hériter d'une zone `lg` englobante.\n return (\n <div\n data-echelle={taille}\n className={cn(\"flex flex-wrap items-center gap-2\", ECHELLES[taille])}\n >\n {children}\n </div>\n )\n}\n\nconst ECHELLES: Record<TailleActions, string> = {\n default: \"[--bouton-hauteur:2rem] [--bouton-icone:2rem]\",\n lg: \"[--bouton-hauteur:2.25rem] [--bouton-icone:2.25rem]\",\n}\n\n/** Étape du fil d'Ariane, de la plus générale à la plus proche. */\nexport interface DetailHeaderEtape {\n libelle: string\n href: string\n}\n\n/** Action rare ou destructive, rangée sous « Plus d'actions ». */\nexport interface DetailHeaderActionSecondaire {\n libelle: string\n onChoisir: () => void\n icone?: LucideIcon\n /** En rouge. */\n destructif?: boolean\n /** Action impossible : l'entrée est grisée, ne fait rien, et cette raison\n * s'affiche sous son libellé (comme `verrou` de `TooltipButton`). */\n verrou?: string\n}\n\nexport interface DetailHeaderProps {\n /**\n * Où se trouve la fiche : le fil d'Ariane, qui y ramène quel que soit\n * l'historique du navigateur. La fiche elle-même (le titre) en est la\n * dernière étape.\n */\n chemin?: DetailHeaderEtape[]\n titre: string\n /** À côté du titre : badges de statut, marqueurs. */\n badges?: ReactNode\n /** Ligne discrète sous le titre : un code, une adresse. */\n meta?: ReactNode\n /** Actions courantes, en boutons. */\n actions?: ReactNode\n /** Actions rares ou destructives, derrière « Plus d'actions ». */\n actionsSecondaires?: DetailHeaderActionSecondaire[]\n /**\n * Taille des boutons de `actions` et du bouton « Plus d'actions » : `lg`\n * par défaut, comme `PageHeader` (voir sa `tailleActions`).\n */\n tailleActions?: TailleActions\n /**\n * Fiche dont la première carte répète déjà le nom : le fil d'Ariane porte\n * seul le titre (le `<h1>`), actions sur la même ligne. Demande `chemin`.\n */\n compact?: boolean\n /** Composant de lien du routeur ; par défaut, celui du `LienProvider`,\n * sinon un `<a>`. */\n lien?: LienComposant\n className?: string\n}\n\n/** En-tête d'une fiche (un élément d'une liste) : fil d'Ariane, titre,\n * badges, méta, actions courantes et menu des actions rares. */\nexport function DetailHeader({\n chemin = [],\n titre,\n badges,\n meta,\n actions,\n actionsSecondaires = [],\n tailleActions = \"lg\",\n compact = false,\n lien,\n className,\n}: DetailHeaderProps) {\n const Lien = useLien(lien)\n const lesActions =\n actions || actionsSecondaires.length > 0 ? (\n <Actions taille={tailleActions}>\n {actions}\n {actionsSecondaires.length > 0 ? (\n <MenuActions actions={actionsSecondaires} taille={tailleActions} />\n ) : null}\n </Actions>\n ) : null\n\n const etapes = chemin.map(({ libelle, href }, index) => (\n <Fragment key={index}>\n <BreadcrumbItem>\n <BreadcrumbLink render={<Lien href={href} />}>{libelle}</BreadcrumbLink>\n </BreadcrumbItem>\n <BreadcrumbSeparator />\n </Fragment>\n ))\n\n // La dernière étape devient le titre de la page : sans elle, la page\n // n'aurait plus de <h1>.\n if (compact && chemin.length > 0) {\n return (\n <div\n data-slot=\"detail-header\"\n className={cn(\n \"flex flex-wrap items-center justify-between gap-x-4 gap-y-2\",\n className\n )}\n >\n <Breadcrumb className=\"min-w-0\">\n <BreadcrumbList>\n {etapes}\n <BreadcrumbItem>\n <h1 className=\"text-sm font-medium\">\n {/* Sans le rôle de lien désactivé de shadcn : le titre de la\n page ne s'annonce pas « lien, indisponible ». */}\n <BreadcrumbPage role={undefined} aria-disabled={undefined}>\n {titre}\n </BreadcrumbPage>\n </h1>\n {badges}\n </BreadcrumbItem>\n </BreadcrumbList>\n </Breadcrumb>\n {lesActions}\n </div>\n )\n }\n\n return (\n <div\n data-slot=\"detail-header\"\n className={cn(\"flex flex-col gap-3\", className)}\n >\n {chemin.length > 0 ? (\n <Breadcrumb>\n <BreadcrumbList>\n {etapes}\n <BreadcrumbItem>\n <BreadcrumbPage>{titre}</BreadcrumbPage>\n </BreadcrumbItem>\n </BreadcrumbList>\n </Breadcrumb>\n ) : null}\n <div className=\"flex flex-wrap items-start justify-between gap-x-4 gap-y-3\">\n <div className=\"flex min-w-0 flex-col gap-1\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <h1 className=\"font-heading text-2xl font-semibold tracking-tight break-words\">\n {titre}\n </h1>\n {badges}\n </div>\n {meta ? (\n <p className=\"text-sm break-words text-muted-foreground\">{meta}</p>\n ) : null}\n </div>\n {lesActions}\n </div>\n </div>\n )\n}\n\nfunction MenuActions({\n actions,\n taille,\n}: {\n actions: DetailHeaderActionSecondaire[]\n taille: TailleActions\n}) {\n return (\n <DropdownMenu>\n <Tooltip>\n <TooltipTrigger\n render={\n <DropdownMenuTrigger\n render={\n // `icon` : l'échelle de la zone (`data-echelle`) l'agrandit.\n <Button\n variant=\"outline\"\n size=\"icon\"\n aria-label=\"Plus d'actions\"\n />\n }\n />\n }\n >\n <EllipsisIcon />\n </TooltipTrigger>\n <TooltipContent>Plus d'actions</TooltipContent>\n </Tooltip>\n {/* L'écart suit la taille du bouton : 4 px sous un bouton de 32, 6 sous\n un de 36 — collé à de grands boutons, le menu paraissait à l'étroit. */}\n <DropdownMenuContent\n align=\"end\"\n sideOffset={taille === \"lg\" ? 6 : 4}\n className=\"min-w-48\"\n >\n {actions.map(\n ({ libelle, onChoisir, icone: Icone, destructif, verrou }, index) => (\n <DropdownMenuItem\n key={index}\n variant={destructif ? \"destructive\" : \"default\"}\n disabled={!!verrou}\n onClick={onChoisir}\n // La raison doit rester lisible (4,5:1) : seuls l'icône et le\n // libellé sont estompés, pas toute l'entrée.\n className={verrou ? \"data-disabled:opacity-100\" : undefined}\n >\n {verrou ? (\n <>\n {Icone ? <Icone className=\"opacity-50\" /> : null}\n {/* Une entrée désactivée ne reçoit pas le survol : la\n raison s'affiche sous le libellé. */}\n <span className=\"flex flex-col\">\n <span className=\"opacity-50\">{libelle}</span>\n <span\n data-slot=\"detail-header-raison\"\n className=\"text-xs text-muted-foreground\"\n >\n {verrou}\n </span>\n </span>\n </>\n ) : (\n <>\n {Icone ? <Icone /> : null}\n {libelle}\n </>\n )}\n </DropdownMenuItem>\n )\n )}\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n"],"mappings":";;;;;;;;;;AA6CA,SAAgBE,EAAW,EACzB,UACA,gBACA,YACA,mBAAgB,MAChB,gBACkB;CAClB,OACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAWC,EACT,8DACAC,CACF;EALF,UAAA,CAOE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,MAAD;IAAI,WAAU;IACX,UAAAC;GACC,CAAA,GACHC,IACC,kBAAC,KAAD;IAAG,WAAU;IAAiC,UAAAA;GAAe,CAAA,IAC3D,IACD;EACJ,CAAA,GAAAC,IAAU,kBAACC,GAAD;GAAS,QAAQC;GAAgB,UAAAF;EAAiB,CAAA,IAAI,IAC9D;;AAET;AAEA,SAASC,EAAQ,EACf,WACA,eAIC;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CAAA,IAAI,MAG5C,kBAAC,QAAD;IAAM,WAAU;IAAhB,UAAA,CACE,kBAAC,QAAD;KAAM,WAAU;KAAc,UAAAjB;IAAc,CAAA,GAC5C,kBAAC,QAAD;KACE,aAAU;KACV,WAAU;KAET,UAAAoB;IACG,CAAA,CACF;GACN,CAAA,CAAA,EAAA,CAAA,IAEF,kBAAA5C,GAAA,EAAA,UAAA,CACGyC,IAAQ,kBAACA,GAAD,CAAQ,CAAA,IAAI,MACpBjB,CACD,EAAA,CAAA;EAEY,GA7BXE,CA6BW,CAEtB;CACmB,CAAA,CACT,EAAA,CAAA;AAElB"}
|
|
1
|
+
{"version":3,"file":"page-header.js","names":["PageHeader","cn","className","titre","description","actions","Actions","tailleActions","taille","ECHELLES","DetailHeader","Lien","useLien","lien","lesActions","actionsSecondaires","MenuActions","etapes","chemin","Fragment","BreadcrumbItem","BreadcrumbLink","libelle","BreadcrumbSeparator","index","compact","Breadcrumb","BreadcrumbList","BreadcrumbPage","badges","meta","DropdownMenu","Tooltip","TooltipTrigger","DropdownMenuTrigger","Button","EllipsisIcon","TooltipContent","DropdownMenuContent","DropdownMenuAction","action"],"sources":["../../../src/components/etic/page-header.tsx"],"sourcesContent":["import { Fragment, type ReactNode } from \"react\"\nimport { cn } from \"cn\"\nimport { EllipsisIcon, type LucideIcon } from \"lucide-react\"\n\nimport {\n Breadcrumb,\n BreadcrumbItem,\n BreadcrumbLink,\n BreadcrumbList,\n BreadcrumbPage,\n BreadcrumbSeparator,\n} from \"@etic-ui/components/ui/breadcrumb\"\nimport { Button } from \"@etic-ui/components/ui/button\"\nimport {\n DropdownMenu,\n DropdownMenuContent,\n DropdownMenuTrigger,\n} from \"@etic-ui/components/ui/dropdown-menu\"\nimport { DropdownMenuAction } from \"@etic-ui/components/etic/dropdown-menu-action\"\nimport {\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from \"@etic-ui/components/ui/tooltip\"\nimport { useLien, type LienComposant } from \"@etic-ui/components/etic/lien\"\n\nexport interface PageHeaderProps {\n titre: ReactNode\n /** Ligne discrète sous le titre. */\n description?: ReactNode\n /** Boutons à droite (créer, exporter…) ; passent dessous sur un écran étroit. */\n actions?: ReactNode\n /**\n * Taille des boutons de `actions` : `lg` par défaut (36 px), sans `size`\n * à leur donner — `default` et `icon` y deviennent `lg` et `icon-lg`.\n * `\"default\"` garde les tailles données.\n */\n tailleActions?: TailleActions\n className?: string\n}\n\ntype TailleActions = \"default\" | \"lg\"\n\n/** En-tête d'une page : titre (le `<h1>`) et description à gauche, actions\n * à droite. */\nexport function PageHeader({\n titre,\n description,\n actions,\n tailleActions = \"lg\",\n className,\n}: PageHeaderProps) {\n return (\n <div\n data-slot=\"page-header\"\n className={cn(\n \"flex flex-wrap items-start justify-between gap-x-4 gap-y-3\",\n className\n )}\n >\n <div className=\"flex min-w-0 flex-col gap-1\">\n <h1 className=\"font-heading text-2xl font-semibold tracking-tight\">\n {titre}\n </h1>\n {description ? (\n <p className=\"text-sm text-muted-foreground\">{description}</p>\n ) : null}\n </div>\n {actions ? <Actions taille={tailleActions}>{actions}</Actions> : null}\n </div>\n )\n}\n\nfunction Actions({\n taille,\n children,\n}: {\n taille: TailleActions\n children: ReactNode\n}) {\n // Hauteur des tailles `default` et `icon` de `Button` (et de tout\n // `buttonVariants`) dans cette zone : héritée par ses descendants, pas par\n // un dialogue ouvert d'ici (rendu dans un portail). Posée aussi à\n // `default`, pour ne pas hériter d'une zone `lg` englobante.\n return (\n <div\n data-echelle={taille}\n className={cn(\"flex flex-wrap items-center gap-2\", ECHELLES[taille])}\n >\n {children}\n </div>\n )\n}\n\nconst ECHELLES: Record<TailleActions, string> = {\n default: \"[--bouton-hauteur:2rem] [--bouton-icone:2rem]\",\n lg: \"[--bouton-hauteur:2.25rem] [--bouton-icone:2.25rem]\",\n}\n\n/** Étape du fil d'Ariane, de la plus générale à la plus proche. */\nexport interface DetailHeaderEtape {\n libelle: string\n href: string\n}\n\n/** Action rare ou destructive, rangée sous « Plus d'actions ». */\nexport interface DetailHeaderActionSecondaire {\n libelle: string\n onChoisir: () => void\n icone?: LucideIcon\n /** En rouge. */\n destructif?: boolean\n /** Action impossible : l'entrée est grisée, ne fait rien, et cette raison\n * s'affiche sous son libellé (comme `verrou` de `TooltipButton`). Rendue\n * par `DropdownMenuAction`. */\n verrou?: string\n}\n\nexport interface DetailHeaderProps {\n /**\n * Où se trouve la fiche : le fil d'Ariane, qui y ramène quel que soit\n * l'historique du navigateur. La fiche elle-même (le titre) en est la\n * dernière étape.\n */\n chemin?: DetailHeaderEtape[]\n titre: string\n /** À côté du titre : badges de statut, marqueurs. */\n badges?: ReactNode\n /** Ligne discrète sous le titre : un code, une adresse. */\n meta?: ReactNode\n /** Actions courantes, en boutons. */\n actions?: ReactNode\n /** Actions rares ou destructives, derrière « Plus d'actions ». */\n actionsSecondaires?: DetailHeaderActionSecondaire[]\n /**\n * Taille des boutons de `actions` et du bouton « Plus d'actions » : `lg`\n * par défaut, comme `PageHeader` (voir sa `tailleActions`).\n */\n tailleActions?: TailleActions\n /**\n * Fiche dont la première carte répète déjà le nom : le fil d'Ariane porte\n * seul le titre (le `<h1>`), actions sur la même ligne. Demande `chemin`.\n */\n compact?: boolean\n /** Composant de lien du routeur ; par défaut, celui du `LienProvider`,\n * sinon un `<a>`. */\n lien?: LienComposant\n className?: string\n}\n\n/** En-tête d'une fiche (un élément d'une liste) : fil d'Ariane, titre,\n * badges, méta, actions courantes et menu des actions rares. */\nexport function DetailHeader({\n chemin = [],\n titre,\n badges,\n meta,\n actions,\n actionsSecondaires = [],\n tailleActions = \"lg\",\n compact = false,\n lien,\n className,\n}: DetailHeaderProps) {\n const Lien = useLien(lien)\n const lesActions =\n actions || actionsSecondaires.length > 0 ? (\n <Actions taille={tailleActions}>\n {actions}\n {actionsSecondaires.length > 0 ? (\n <MenuActions actions={actionsSecondaires} taille={tailleActions} />\n ) : null}\n </Actions>\n ) : null\n\n const etapes = chemin.map(({ libelle, href }, index) => (\n <Fragment key={index}>\n <BreadcrumbItem>\n <BreadcrumbLink render={<Lien href={href} />}>{libelle}</BreadcrumbLink>\n </BreadcrumbItem>\n <BreadcrumbSeparator />\n </Fragment>\n ))\n\n // La dernière étape devient le titre de la page : sans elle, la page\n // n'aurait plus de <h1>.\n if (compact && chemin.length > 0) {\n return (\n <div\n data-slot=\"detail-header\"\n className={cn(\n \"flex flex-wrap items-center justify-between gap-x-4 gap-y-2\",\n className\n )}\n >\n <Breadcrumb className=\"min-w-0\">\n <BreadcrumbList>\n {etapes}\n <BreadcrumbItem>\n <h1 className=\"text-sm font-medium\">\n {/* Sans le rôle de lien désactivé de shadcn : le titre de la\n page ne s'annonce pas « lien, indisponible ». */}\n <BreadcrumbPage role={undefined} aria-disabled={undefined}>\n {titre}\n </BreadcrumbPage>\n </h1>\n {badges}\n </BreadcrumbItem>\n </BreadcrumbList>\n </Breadcrumb>\n {lesActions}\n </div>\n )\n }\n\n return (\n <div\n data-slot=\"detail-header\"\n className={cn(\"flex flex-col gap-3\", className)}\n >\n {chemin.length > 0 ? (\n <Breadcrumb>\n <BreadcrumbList>\n {etapes}\n <BreadcrumbItem>\n <BreadcrumbPage>{titre}</BreadcrumbPage>\n </BreadcrumbItem>\n </BreadcrumbList>\n </Breadcrumb>\n ) : null}\n <div className=\"flex flex-wrap items-start justify-between gap-x-4 gap-y-3\">\n <div className=\"flex min-w-0 flex-col gap-1\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <h1 className=\"font-heading text-2xl font-semibold tracking-tight break-words\">\n {titre}\n </h1>\n {badges}\n </div>\n {meta ? (\n <p className=\"text-sm break-words text-muted-foreground\">{meta}</p>\n ) : null}\n </div>\n {lesActions}\n </div>\n </div>\n )\n}\n\nfunction MenuActions({\n actions,\n taille,\n}: {\n actions: DetailHeaderActionSecondaire[]\n taille: TailleActions\n}) {\n return (\n <DropdownMenu>\n <Tooltip>\n <TooltipTrigger\n render={\n <DropdownMenuTrigger\n render={\n // `icon` : l'échelle de la zone (`data-echelle`) l'agrandit.\n <Button\n variant=\"outline\"\n size=\"icon\"\n aria-label=\"Plus d'actions\"\n />\n }\n />\n }\n >\n <EllipsisIcon />\n </TooltipTrigger>\n <TooltipContent>Plus d'actions</TooltipContent>\n </Tooltip>\n {/* L'écart suit la taille du bouton : 4 px sous un bouton de 32, 6 sous\n un de 36 — collé à de grands boutons, le menu paraissait à l'étroit. */}\n <DropdownMenuContent\n align=\"end\"\n sideOffset={taille === \"lg\" ? 6 : 4}\n className=\"min-w-48\"\n >\n {actions.map((action, index) => (\n // Une chaîne vide ne verrouille pas : seule une raison le fait.\n <DropdownMenuAction\n key={index}\n {...action}\n verrou={action.verrou || undefined}\n />\n ))}\n </DropdownMenuContent>\n </DropdownMenu>\n )\n}\n"],"mappings":";;;;;;;;;;;AA6CA,SAAgBA,EAAW,EACzB,UACA,gBACA,YACA,mBAAgB,MAChB,gBACkB;CAClB,OACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAWC,EACT,8DACAC,CACF;EALF,UAAA,CAOE,kBAAC,OAAD;GAAK,WAAU;GAAf,UAAA,CACE,kBAAC,MAAD;IAAI,WAAU;IACX,UAAAC;GACC,CAAA,GACHC,IACC,kBAAC,KAAD;IAAG,WAAU;IAAiC,UAAAA;GAAe,CAAA,IAC3D,IACD;EACJ,CAAA,GAAAC,IAAU,kBAACC,GAAD;GAAS,QAAQC;GAAgB,UAAAF;EAAiB,CAAA,IAAI,IAC9D;;AAET;AAEA,SAASC,EAAQ,EACf,WACA,eAIC;CAKD,OACE,kBAAC,OAAD;EACE,gBAAcE;EACd,WAAWP,EAAG,qCAAqCQ,EAASD,EAAO;EAElE;CACE,CAAA;AAET;AAEA,IAAMC,IAA0C;CAC9C,SAAS;CACT,IAAI;AACN;AAuDA,SAAgBC,EAAa,EAC3B,YAAS,CAAC,GACV,UACA,WACA,SACA,YACA,wBAAqB,CAAC,GACtB,mBAAgB,MAChB,aAAU,IACV,SACA,gBACoB;CACpB,IAAMC,IAAOC,EAAQC,CAAI,GACnB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AC,OAAD;KAAK,WAAU;KAAf,UAAA,CACE,kBAAC,MAAD;MAAI,WAAU;MACX,UAAAA;KACC,CAAA,GACH0B,CACE;IACJ,CAAA,GAAAC,IACC,kBAAC,KAAD;KAAG,WAAU;KAA6C,UAAAA;IAAQ,CAAA,IAChE,IACD;GACJ,CAAA,GAAAhB,CACE;EACF,CAAA,CAAA;;AAET;AAEA,SAASE,EAAY,EACnB,YACA,aAIC;CACD,OACE,kBAACe,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD,EAAA,UAAA,CACE,kBAACC,GAAD;EACE,QACE,kBAACC,GAAD,EACE,QAEE,kBAACC,GAAD;GACE,SAAQ;GACR,MAAK;GACL,cAAW;EACZ,CAAA,EAEJ,CAAA;EAGH,UAAA,kBAACC,GAAD,CAAe,CAAA;CACD,CAAA,GAChB,kBAACC,GAAD,EAAA,UAAgB,iBAA8B,CAAA,CACvC,EAAA,CAAA,GAGT,kBAACC,GAAD;EACE,OAAM;EACN,YAAY9B,MAAW,OAAO,IAAI;EAClC,WAAU;EAET,UAAAH,EAAQ,KAAK,GAAQ,MAEpB,kBAACkC,GAAD;GAEE,GAAIC;GACJ,QAAQA,EAAO,UAAU,KAAA;EAC1B,GAHMhB,CAGN,CACF;CACkB,CAAA,CACT,EAAA,CAAA;AAElB"}
|
|
@@ -12,11 +12,17 @@ export interface SaveBarProps {
|
|
|
12
12
|
* enregistrées », la raison pour laquelle « Enregistrer » est actif,
|
|
13
13
|
* même après un enregistrement réussi. */
|
|
14
14
|
modifie?: boolean;
|
|
15
|
-
/** Pied d'un formulaire plus haut que l'écran,
|
|
16
|
-
* gauche. Tant que `modifie` est vrai
|
|
17
|
-
* l'
|
|
18
|
-
*
|
|
15
|
+
/** Pied d'un formulaire plus haut que l'écran, sur une carte opaque,
|
|
16
|
+
* boutons à droite, statut à gauche. Tant que `modifie` est vrai (ou
|
|
17
|
+
* pendant l'envoi), la barre se colle en bas de l'écran ; sinon, elle
|
|
18
|
+
* reste à sa place : elle ne flotte pas sur le contenu sans raison. Les
|
|
19
|
+
* bords de la carte s'alignent sur ceux des cartes de la page. */
|
|
19
20
|
collante?: boolean;
|
|
21
|
+
/** Avec `collante` : la barre n'apparaît que lorsqu'elle a quelque chose
|
|
22
|
+
* à dire (modifications, envoi en cours, « Enregistré »). Au repos, il ne
|
|
23
|
+
* reste que sa zone de statut, invisible et sans place, pour que le
|
|
24
|
+
* premier message soit annoncé. */
|
|
25
|
+
masqueeAuRepos?: boolean;
|
|
20
26
|
/** Sans gestionnaire, « Enregistrer » soumet le formulaire qui l'entoure. */
|
|
21
27
|
onEnregistrer?: () => void;
|
|
22
28
|
/** Revenir à ce qui est enregistré : affiche « Annuler ». À ne passer que
|
|
@@ -29,4 +35,4 @@ export interface SaveBarProps {
|
|
|
29
35
|
* « Annuler » au besoin, et le statut, annoncé (« Enregistré »,
|
|
30
36
|
* « Modifications non enregistrées »).
|
|
31
37
|
*/
|
|
32
|
-
export declare function SaveBar({ enCours, desactive, enregistre, modifie, collante, onEnregistrer, onAnnuler, className, }: SaveBarProps): import("react").JSX.Element;
|
|
38
|
+
export declare function SaveBar({ enCours, desactive, enregistre, modifie, collante, masqueeAuRepos, onEnregistrer, onAnnuler, className, }: SaveBarProps): import("react").JSX.Element;
|
|
@@ -3,24 +3,24 @@ import { cn as t } from "cn";
|
|
|
3
3
|
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
4
|
import { CheckIcon as i } from "lucide-react";
|
|
5
5
|
// src/components/etic/save-bar.tsx
|
|
6
|
-
function a({ enCours: a = !1, desactive: o = !1, enregistre: s = !1, modifie: c = !1, collante: l = !1,
|
|
7
|
-
let
|
|
8
|
-
type:
|
|
9
|
-
onClick:
|
|
6
|
+
function a({ enCours: a = !1, desactive: o = !1, enregistre: s = !1, modifie: c = !1, collante: l = !1, masqueeAuRepos: u = !1, onEnregistrer: d, onAnnuler: f, className: p }) {
|
|
7
|
+
let m = l && u && !c && !a && !s, h = /* @__PURE__ */ n(e, {
|
|
8
|
+
type: d ? "button" : "submit",
|
|
9
|
+
onClick: d,
|
|
10
10
|
enCours: a,
|
|
11
11
|
libelleEnCours: "Enregistrement…",
|
|
12
12
|
disabled: o,
|
|
13
13
|
focusableWhenDisabled: !0,
|
|
14
14
|
children: "Enregistrer"
|
|
15
|
-
}),
|
|
15
|
+
}), g = f ? /* @__PURE__ */ n(e, {
|
|
16
16
|
variant: "outline",
|
|
17
|
-
onClick:
|
|
17
|
+
onClick: f,
|
|
18
18
|
disabled: a,
|
|
19
19
|
focusableWhenDisabled: !0,
|
|
20
20
|
children: "Annuler"
|
|
21
|
-
}) : null,
|
|
21
|
+
}) : null, _ = /* @__PURE__ */ n("p", {
|
|
22
22
|
role: "status",
|
|
23
|
-
className: t("text-sm text-muted-foreground", l && "me-auto"),
|
|
23
|
+
className: t("text-sm text-muted-foreground", l && "me-auto min-w-0 flex-1", m && "sr-only"),
|
|
24
24
|
children: c ? "Modifications non enregistrées" : s ? /* @__PURE__ */ r("span", {
|
|
25
25
|
className: "inline-flex items-center gap-1.5 font-medium text-success",
|
|
26
26
|
children: [/* @__PURE__ */ n(i, {
|
|
@@ -28,16 +28,17 @@ function a({ enCours: a = !1, desactive: o = !1, enregistre: s = !1, modifie: c
|
|
|
28
28
|
"aria-hidden": !0
|
|
29
29
|
}), "Enregistré"]
|
|
30
30
|
}) : null
|
|
31
|
+
}), v = m ? null : /* @__PURE__ */ r("div", {
|
|
32
|
+
"data-slot": "save-bar-actions",
|
|
33
|
+
className: "flex shrink-0 items-center gap-3",
|
|
34
|
+
children: [l ? g : h, l ? h : g]
|
|
31
35
|
});
|
|
32
36
|
return /* @__PURE__ */ r("div", {
|
|
33
37
|
"data-slot": "save-bar",
|
|
34
38
|
"data-collante": l || void 0,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
m,
|
|
39
|
-
l ? p : h
|
|
40
|
-
]
|
|
39
|
+
"data-repos": m || void 0,
|
|
40
|
+
className: t("flex items-center gap-3", !l && "flex-wrap", m && "contents", l && !m && "justify-end rounded-xl border border-border bg-card px-4 py-3", l && (c || a) && "sticky bottom-4 z-10 shadow-sm", p),
|
|
41
|
+
children: [l ? _ : v, l ? v : _]
|
|
41
42
|
});
|
|
42
43
|
}
|
|
43
44
|
export { a as SaveBar };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"save-bar.js","names":["SaveBar","
|
|
1
|
+
{"version":3,"file":"save-bar.js","names":["SaveBar","auRepos","collante","masqueeAuRepos","modifie","enCours","enregistre","enregistrer","Button","onEnregistrer","desactive","annuler","onAnnuler","statut","cn","CheckIcon","boutons","className"],"sources":["../../../src/components/etic/save-bar.tsx"],"sourcesContent":["import { cn } from \"cn\"\nimport { CheckIcon } from \"lucide-react\"\n\nimport { Button } from \"@etic-ui/components/ui/button\"\n\nexport interface SaveBarProps {\n /** Enregistrement en cours : « Enregistrer » devient « Enregistrement… »,\n * occupé (`aria-busy`), ignore les clics, mais garde le focus ;\n * « Annuler » attend la fin. */\n enCours?: boolean\n /** Rien à enregistrer, ou une saisie à corriger d'abord. */\n desactive?: boolean\n /** Affiche « Enregistré » : la dernière mutation a réussi\n * (`mutation.isSuccess`). `modifie` l'emporte. */\n enregistre?: boolean\n /** Des modifications attendent : le statut dit « Modifications non\n * enregistrées », la raison pour laquelle « Enregistrer » est actif,\n * même après un enregistrement réussi. */\n modifie?: boolean\n /** Pied d'un formulaire plus haut que l'écran, sur une carte opaque,\n * boutons à droite, statut à gauche. Tant que `modifie` est vrai (ou\n * pendant l'envoi), la barre se colle en bas de l'écran ; sinon, elle\n * reste à sa place : elle ne flotte pas sur le contenu sans raison. Les\n * bords de la carte s'alignent sur ceux des cartes de la page. */\n collante?: boolean\n /** Avec `collante` : la barre n'apparaît que lorsqu'elle a quelque chose\n * à dire (modifications, envoi en cours, « Enregistré »). Au repos, il ne\n * reste que sa zone de statut, invisible et sans place, pour que le\n * premier message soit annoncé. */\n masqueeAuRepos?: boolean\n /** Sans gestionnaire, « Enregistrer » soumet le formulaire qui l'entoure. */\n onEnregistrer?: () => void\n /** Revenir à ce qui est enregistré : affiche « Annuler ». À ne passer que\n * s'il y a des modifications (`onAnnuler={modifie ? annuler : undefined}`). */\n onAnnuler?: () => void\n className?: string\n}\n\n/**\n * Pied d'un formulaire de page (profil, paramètres) : « Enregistrer »,\n * « Annuler » au besoin, et le statut, annoncé (« Enregistré »,\n * « Modifications non enregistrées »).\n */\nexport function SaveBar({\n enCours = false,\n desactive = false,\n enregistre = false,\n modifie = false,\n collante = false,\n masqueeAuRepos = false,\n onEnregistrer,\n onAnnuler,\n className,\n}: SaveBarProps) {\n const auRepos =\n collante && masqueeAuRepos && !modifie && !enCours && !enregistre\n const enregistrer = (\n <Button\n type={onEnregistrer ? \"button\" : \"submit\"}\n onClick={onEnregistrer}\n enCours={enCours}\n libelleEnCours=\"Enregistrement…\"\n // Désactivé mais focalisable : le bouton qu'on vient d'activer ne\n // rend pas le focus à <body> quand l'enregistrement finit et qu'il ne\n // reste rien à enregistrer.\n disabled={desactive}\n focusableWhenDisabled\n >\n Enregistrer\n </Button>\n )\n const annuler = onAnnuler ? (\n <Button\n variant=\"outline\"\n onClick={onAnnuler}\n disabled={enCours}\n focusableWhenDisabled\n >\n Annuler\n </Button>\n ) : null\n // Toujours présent : une zone `status` ajoutée en même temps que son texte\n // n'est pas annoncée.\n const statut = (\n <p\n role=\"status\"\n className={cn(\n \"text-sm text-muted-foreground\",\n // Le statut se replie sur deux lignes plutôt que de séparer les\n // boutons de la barre.\n collante && \"me-auto min-w-0 flex-1\",\n auRepos && \"sr-only\"\n )}\n >\n {/* Une modification faite après l'enregistrement l'emporte :\n « Enregistré » ne vaut que pour ce qui est à l'écran. */}\n {modifie ? (\n \"Modifications non enregistrées\"\n ) : enregistre ? (\n <span className=\"inline-flex items-center gap-1.5 font-medium text-success\">\n <CheckIcon className=\"size-4\" aria-hidden />\n Enregistré\n </span>\n ) : null}\n </p>\n )\n\n // Les deux boutons ne se séparent jamais : au téléphone, c'est le statut\n // qui passe à la ligne (barre simple) ou se replie (barre collante).\n const boutons = auRepos ? null : (\n <div\n data-slot=\"save-bar-actions\"\n className=\"flex shrink-0 items-center gap-3\"\n >\n {/* Ordre du DOM = ordre visuel : « Enregistrer » d'abord, ou à droite\n quand la barre est collante. */}\n {collante ? annuler : enregistrer}\n {collante ? enregistrer : annuler}\n </div>\n )\n\n return (\n <div\n data-slot=\"save-bar\"\n data-collante={collante || undefined}\n data-repos={auRepos || undefined}\n className={cn(\n \"flex items-center gap-3\",\n !collante && \"flex-wrap\",\n // Au repos, la barre ne prend aucune place : seule reste la zone de\n // statut (une zone `status` ajoutée en même temps que son texte\n // n'est pas annoncée).\n auRepos && \"contents\",\n // Toujours sur sa carte : sans elle, les marges intérieures\n // décalaient les boutons par rapport aux cartes de la page. Carte\n // pleinement opaque : un fond translucide laissait deviner, flou, le\n // texte qu'elle recouvre.\n collante &&\n !auRepos &&\n \"justify-end rounded-xl border border-border bg-card px-4 py-3\",\n collante && (modifie || enCours) && \"sticky bottom-4 z-10 shadow-sm\",\n className\n )}\n >\n {collante ? statut : boutons}\n {collante ? boutons : statut}\n </div>\n )\n}\n"],"mappings":";;;;;AA2CA,SAAgBA,EAAQ,EACtB,aAAU,IACV,eAAY,IACZ,gBAAa,IACb,aAAU,IACV,cAAW,IACX,oBAAiB,IACjB,kBACA,cACA,gBACe;CACf,IAAMC,IACJC,KAAYC,KAAkB,CAACC,KAAW,CAACC,KAAW,CAACC,GACnDC,IACJ,kBAACC,GAAD;EACE,MAAMC,IAAgB,WAAW;EACjC,SAASA;EACA;EACT,gBAAe;EAIf,UAAUC;EACV,uBAAA;EACD,UAAA;CAEO,CAAA,GAEJC,IAAUC,IACd,kBAACJ,GAAD;EACE,SAAQ;EACR,SAASI;EACT,UAAUP;EACV,uBAAA;EACD,UAAA;CAEO,CAAA,IACN,MAGEQ,IACJ,kBAAC,KAAD;EACE,MAAK;EACL,WAAWC,EACT,iCAGAZ,KAAY,0BACZD,KAAW,SACb;EAIC,UAAAG,IACC,mCACEE,IACF,kBAAC,QAAD;GAAM,WAAU;GAAhB,UAAA,CACE,kBAACS,GAAD;IAAW,WAAU;IAAS,eAAA;GAAa,CAAA,GAAC,YAExC;EACJ,CAAA,IAAA;CACH,CAAA,GAKCC,IAAUf,IAAU,OACxB,kBAAC,OAAD;EACE,aAAU;EACV,WAAU;EAFZ,UAAA,CAMGC,IAAWS,IAAUJ,GACrBL,IAAWK,IAAcI,CACvB;;CAGP,OACE,kBAAC,OAAD;EACE,aAAU;EACV,iBAAeT,KAAY,KAAA;EAC3B,cAAYD,KAAW,KAAA;EACvB,WAAWa,EACT,2BACA,CAACZ,KAAY,aAIbD,KAAW,YAKXC,KACE,CAACD,KACD,iEACFC,MAAaE,KAAWC,MAAY,kCACpCY,CACF;EApBF,UAAA,CAsBGf,IAAWW,IAASG,GACpBd,IAAWc,IAAUH,CACnB;;AAET"}
|
|
@@ -1,90 +1,95 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { Button as e } from "./button.js";
|
|
3
3
|
import { cn as t } from "cn";
|
|
4
|
-
import "react";
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { XIcon as
|
|
7
|
-
import { Dialog as
|
|
4
|
+
import * as n from "react";
|
|
5
|
+
import { jsx as r, jsxs as i } from "react/jsx-runtime";
|
|
6
|
+
import { XIcon as a } from "lucide-react";
|
|
7
|
+
import { Dialog as o } from "@base-ui/react/dialog";
|
|
8
8
|
// src/components/ui/sheet.tsx
|
|
9
|
-
function
|
|
10
|
-
return /* @__PURE__ */
|
|
9
|
+
function s({ ...e }) {
|
|
10
|
+
return /* @__PURE__ */ r(o.Root, {
|
|
11
11
|
"data-slot": "sheet",
|
|
12
12
|
...e
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
|
-
function
|
|
16
|
-
return /* @__PURE__ */
|
|
15
|
+
function c({ ...e }) {
|
|
16
|
+
return /* @__PURE__ */ r(o.Trigger, {
|
|
17
17
|
"data-slot": "sheet-trigger",
|
|
18
18
|
...e
|
|
19
19
|
});
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
return /* @__PURE__ */
|
|
21
|
+
function l({ ...e }) {
|
|
22
|
+
return /* @__PURE__ */ r(o.Close, {
|
|
23
23
|
"data-slot": "sheet-close",
|
|
24
24
|
...e
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
-
|
|
28
|
-
|
|
27
|
+
var u = n.createContext(!1);
|
|
28
|
+
function d({ ...e }) {
|
|
29
|
+
return /* @__PURE__ */ r(o.Portal, {
|
|
29
30
|
"data-slot": "sheet-portal",
|
|
30
31
|
...e
|
|
31
32
|
});
|
|
32
33
|
}
|
|
33
|
-
function
|
|
34
|
-
return /* @__PURE__ */
|
|
34
|
+
function f({ className: e, ...n }) {
|
|
35
|
+
return /* @__PURE__ */ r(o.Backdrop, {
|
|
35
36
|
"data-slot": "sheet-overlay",
|
|
36
37
|
className: t("fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs", e),
|
|
37
|
-
...
|
|
38
|
+
...n
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
-
return /* @__PURE__ */
|
|
41
|
+
function p({ className: n, children: s, side: c = "right", showCloseButton: l = !0, ...p }) {
|
|
42
|
+
return /* @__PURE__ */ i(d, { children: [/* @__PURE__ */ r(f, {}), /* @__PURE__ */ i(o.Popup, {
|
|
42
43
|
"data-slot": "sheet-content",
|
|
43
44
|
"data-side": c,
|
|
44
|
-
className: t("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm",
|
|
45
|
-
...
|
|
46
|
-
children: [
|
|
45
|
+
className: t("fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm", n),
|
|
46
|
+
...p,
|
|
47
|
+
children: [/* @__PURE__ */ r(u.Provider, {
|
|
48
|
+
value: l,
|
|
49
|
+
children: s
|
|
50
|
+
}), l && /* @__PURE__ */ i(o.Close, {
|
|
47
51
|
"data-slot": "sheet-close",
|
|
48
|
-
render: /* @__PURE__ */
|
|
52
|
+
render: /* @__PURE__ */ r(e, {
|
|
49
53
|
variant: "ghost",
|
|
50
54
|
className: "absolute top-3 right-3",
|
|
51
55
|
size: "icon-sm"
|
|
52
56
|
}),
|
|
53
|
-
children: [/* @__PURE__ */
|
|
57
|
+
children: [/* @__PURE__ */ r(a, {}), /* @__PURE__ */ r("span", {
|
|
54
58
|
className: "sr-only",
|
|
55
59
|
children: "Fermer"
|
|
56
60
|
})]
|
|
57
61
|
})]
|
|
58
62
|
})] });
|
|
59
63
|
}
|
|
60
|
-
function
|
|
61
|
-
|
|
64
|
+
function m({ className: e, ...i }) {
|
|
65
|
+
let a = n.useContext(u);
|
|
66
|
+
return /* @__PURE__ */ r("div", {
|
|
62
67
|
"data-slot": "sheet-header",
|
|
63
|
-
className: t("flex flex-col gap-0.5 p-4", e),
|
|
64
|
-
...
|
|
68
|
+
className: t("flex flex-col gap-0.5 p-4", a && "pr-12", e),
|
|
69
|
+
...i
|
|
65
70
|
});
|
|
66
71
|
}
|
|
67
|
-
function
|
|
68
|
-
return /* @__PURE__ */
|
|
72
|
+
function h({ className: e, ...n }) {
|
|
73
|
+
return /* @__PURE__ */ r("div", {
|
|
69
74
|
"data-slot": "sheet-footer",
|
|
70
75
|
className: t("mt-auto flex flex-col gap-2 p-4", e),
|
|
71
|
-
...
|
|
76
|
+
...n
|
|
72
77
|
});
|
|
73
78
|
}
|
|
74
|
-
function
|
|
75
|
-
return /* @__PURE__ */
|
|
79
|
+
function g({ className: e, ...n }) {
|
|
80
|
+
return /* @__PURE__ */ r(o.Title, {
|
|
76
81
|
"data-slot": "sheet-title",
|
|
77
82
|
className: t("font-heading text-base font-medium text-foreground", e),
|
|
78
|
-
...
|
|
83
|
+
...n
|
|
79
84
|
});
|
|
80
85
|
}
|
|
81
|
-
function
|
|
82
|
-
return /* @__PURE__ */
|
|
86
|
+
function _({ className: e, ...n }) {
|
|
87
|
+
return /* @__PURE__ */ r(o.Description, {
|
|
83
88
|
"data-slot": "sheet-description",
|
|
84
89
|
className: t("text-sm text-muted-foreground", e),
|
|
85
|
-
...
|
|
90
|
+
...n
|
|
86
91
|
});
|
|
87
92
|
}
|
|
88
|
-
export {
|
|
93
|
+
export { s as Sheet, l as SheetClose, p as SheetContent, _ as SheetDescription, h as SheetFooter, m as SheetHeader, g as SheetTitle, c as SheetTrigger };
|
|
89
94
|
|
|
90
95
|
//# sourceMappingURL=sheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.js","names":["SheetPrimitive","Sheet","props","Dialog","SheetTrigger","SheetClose","SheetPortal","SheetOverlay","cn","className","SheetContent","side","
|
|
1
|
+
{"version":3,"file":"sheet.js","names":["SheetPrimitive","React","Sheet","props","Dialog","SheetTrigger","SheetClose","ContexteCroixSheet","SheetPortal","SheetOverlay","cn","className","SheetContent","side","showCloseButton","Button","XIcon","SheetHeader","croix","SheetFooter","SheetTitle","SheetDescription"],"sources":["../../../src/components/ui/sheet.tsx"],"sourcesContent":["\"use client\"\n\nimport * as React from \"react\"\nimport { Dialog as SheetPrimitive } from \"@base-ui/react/dialog\"\nimport { cn } from \"cn\"\n\nimport { Button } from \"@etic-ui/components/ui/button\"\nimport { XIcon } from \"lucide-react\"\n\nfunction Sheet({ ...props }: SheetPrimitive.Root.Props) {\n return <SheetPrimitive.Root data-slot=\"sheet\" {...props} />\n}\n\nfunction SheetTrigger({ ...props }: SheetPrimitive.Trigger.Props) {\n return <SheetPrimitive.Trigger data-slot=\"sheet-trigger\" {...props} />\n}\n\nfunction SheetClose({ ...props }: SheetPrimitive.Close.Props) {\n return <SheetPrimitive.Close data-slot=\"sheet-close\" {...props} />\n}\n\n// ETIC : le tiroir dit à son en-tête s'il porte la croix, pour que le titre\n// ne passe pas dessous (voir le README, écarts).\nconst ContexteCroixSheet = React.createContext(false)\n\nfunction SheetPortal({ ...props }: SheetPrimitive.Portal.Props) {\n return <SheetPrimitive.Portal data-slot=\"sheet-portal\" {...props} />\n}\n\nfunction SheetOverlay({ className, ...props }: SheetPrimitive.Backdrop.Props) {\n return (\n <SheetPrimitive.Backdrop\n data-slot=\"sheet-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/10 transition-opacity duration-150 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SheetContent({\n className,\n children,\n side = \"right\",\n showCloseButton = true,\n ...props\n}: SheetPrimitive.Popup.Props & {\n side?: \"top\" | \"right\" | \"bottom\" | \"left\"\n showCloseButton?: boolean\n}) {\n return (\n <SheetPortal>\n <SheetOverlay />\n <SheetPrimitive.Popup\n data-slot=\"sheet-content\"\n data-side={side}\n className={cn(\n \"fixed z-50 flex flex-col gap-4 bg-popover bg-clip-padding text-sm text-popover-foreground shadow-lg transition duration-200 ease-in-out data-ending-style:opacity-0 data-starting-style:opacity-0 data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=bottom]:data-ending-style:translate-y-[2.5rem] data-[side=bottom]:data-starting-style:translate-y-[2.5rem] data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=left]:data-ending-style:translate-x-[-2.5rem] data-[side=left]:data-starting-style:translate-x-[-2.5rem] data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=right]:data-ending-style:translate-x-[2.5rem] data-[side=right]:data-starting-style:translate-x-[2.5rem] data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=top]:data-ending-style:translate-y-[-2.5rem] data-[side=top]:data-starting-style:translate-y-[-2.5rem] data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm\",\n className\n )}\n {...props}\n >\n <ContexteCroixSheet.Provider value={showCloseButton}>\n {children}\n </ContexteCroixSheet.Provider>\n {showCloseButton && (\n <SheetPrimitive.Close\n data-slot=\"sheet-close\"\n render={\n <Button\n variant=\"ghost\"\n className=\"absolute top-3 right-3\"\n size=\"icon-sm\"\n />\n }\n >\n <XIcon />\n <span className=\"sr-only\">Fermer</span>\n </SheetPrimitive.Close>\n )}\n </SheetPrimitive.Popup>\n </SheetPortal>\n )\n}\n\nfunction SheetHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n const croix = React.useContext(ContexteCroixSheet)\n return (\n <div\n data-slot=\"sheet-header\"\n // ETIC : place de la croix réservée (28 px à 12 px du bord).\n className={cn(\"flex flex-col gap-0.5 p-4\", croix && \"pr-12\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"sheet-footer\"\n className={cn(\"mt-auto flex flex-col gap-2 p-4\", className)}\n {...props}\n />\n )\n}\n\nfunction SheetTitle({ className, ...props }: SheetPrimitive.Title.Props) {\n return (\n <SheetPrimitive.Title\n data-slot=\"sheet-title\"\n className={cn(\n \"font-heading text-base font-medium text-foreground\",\n className\n )}\n {...props}\n />\n )\n}\n\nfunction SheetDescription({\n className,\n ...props\n}: SheetPrimitive.Description.Props) {\n return (\n <SheetPrimitive.Description\n data-slot=\"sheet-description\"\n className={cn(\"text-sm text-muted-foreground\", className)}\n {...props}\n />\n )\n}\n\nexport {\n Sheet,\n SheetTrigger,\n SheetClose,\n SheetContent,\n SheetHeader,\n SheetFooter,\n SheetTitle,\n SheetDescription,\n}\n"],"mappings":";;;;;;;;AASA,SAASE,EAAM,EAAE,GAAGC,KAAoC;CACtD,OAAO,kBAACH,EAAe,MAAhB;EAAqB,aAAU;EAAQ,GAAIG;CAAQ,CA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EACE,aAAU;EAEV,WAAWG,EAAG,6BAA6BQ,KAAS,SAASP,CAAS;EACtE,GAAIR;CACL,CAAA;AAEL;AAEA,SAASgB,EAAY,EAAE,cAAW,GAAGhB,KAAsC;CACzE,OACE,kBAAC,OAAD;EACE,aAAU;EACV,WAAWO,EAAG,mCAAmCC,CAAS;EAC1D,GAAIR;CACL,CAAA;AAEL;AAEA,SAASiB,EAAW,EAAE,cAAW,GAAGjB,KAAqC;CACvE,OACE,kBAACH,EAAe,OAAhB;EACE,aAAU;EACV,WAAWU,EACT,sDACAC,CACF;EACA,GAAIR;CACL,CAAA;AAEL;AAEA,SAASkB,EAAiB,EACxB,cACA,GAAGlB,KACgC;CACnC,OACE,kBAACH,EAAe,aAAhB;EACE,aAAU;EACV,WAAWU,EAAG,iCAAiCC,CAAS;EACxD,GAAIR;CACL,CAAA;AAEL"}
|
package/dist/index.d.ts
CHANGED
|
@@ -56,15 +56,16 @@ export type { ActionDialogue } from './components/etic/action';
|
|
|
56
56
|
export { fermerSaufEnCours } from './components/etic/action';
|
|
57
57
|
export { AuthAvatar, type AuthAvatarProps, AuthImage, type AuthImageCharger, type AuthImageProps, type AuthObjectUrlEtat, useAuthObjectUrl, useAuthObjectUrlEtat, } from './components/etic/auth-image';
|
|
58
58
|
export { ButtonLink, type ButtonLinkProps } from './components/etic/button-link';
|
|
59
|
-
export { CenteredScreen, type CenteredScreenProps, } from './components/etic/centered-screen';
|
|
59
|
+
export { CenteredScreen, type CenteredScreenProps, MessageScreen, type MessageScreenProps, } from './components/etic/centered-screen';
|
|
60
60
|
export { ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogSaisie, type ConfirmDialogTaille, type DialogFinalFocus, } from './components/etic/confirm-dialog';
|
|
61
61
|
export { CopyButton, type CopyButtonProps } from './components/etic/copy-button';
|
|
62
62
|
export { DeleteButton, type DeleteButtonProps, } from './components/etic/delete-button';
|
|
63
63
|
export { DetailItem, type DetailItemProps, DetailList, type DetailListProps, type DetailListDisposition, } from './components/etic/detail-list';
|
|
64
64
|
export { Disclosure, type DisclosureProps, type DisclosureTaille, DisclosureTrigger, type DisclosureTriggerProps, type DisclosureVariante, } from './components/etic/disclosure';
|
|
65
|
+
export { DropdownMenuAction, type DropdownMenuActionProps, } from './components/etic/dropdown-menu-action';
|
|
65
66
|
export { DraftResumeDialog, type DraftResumeDialogProps, } from './components/etic/draft-resume-dialog';
|
|
66
67
|
export { EmptyState, type EmptyStateProps } from './components/etic/empty-state';
|
|
67
|
-
export { ErrorBanner, type ErrorBannerProps, } from './components/etic/error-banner';
|
|
68
|
+
export { BoutonReessayer, type BoutonReessayerProps, decrireErreur, DetailTechnique, type ErreurDecrite, ErrorBanner, type ErrorBannerProps, ErrorBannerProvider, type ErrorBannerProviderProps, } from './components/etic/error-banner';
|
|
68
69
|
export { ErrorBoundary, type ErrorBoundaryProps, } from './components/etic/error-boundary';
|
|
69
70
|
export { FormDialog, type FormDialogActionSecondaire, type FormDialogProps, type FormDialogTaille, } from './components/etic/form-dialog';
|
|
70
71
|
export { IconToggle, type IconToggleProps } from './components/etic/icon-toggle';
|