@etic-insa/ui 0.0.0 → 0.2.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 +549 -9
- package/dist/components/etic/action.d.ts +33 -0
- package/dist/components/etic/action.js +43 -0
- package/dist/components/etic/action.js.map +1 -0
- package/dist/components/etic/app-shell.d.ts +72 -0
- package/dist/components/etic/app-shell.js +218 -0
- package/dist/components/etic/app-shell.js.map +1 -0
- package/dist/components/etic/auth-image.d.ts +48 -0
- package/dist/components/etic/auth-image.js +44 -0
- package/dist/components/etic/auth-image.js.map +1 -0
- package/dist/components/etic/checkbox-list.d.ts +30 -0
- package/dist/components/etic/checkbox-list.js +56 -0
- package/dist/components/etic/checkbox-list.js.map +1 -0
- package/dist/components/etic/confirm-dialog.d.ts +63 -0
- package/dist/components/etic/confirm-dialog.js +84 -0
- package/dist/components/etic/confirm-dialog.js.map +1 -0
- package/dist/components/etic/copy-button.d.ts +24 -0
- package/dist/components/etic/copy-button.js +46 -0
- package/dist/components/etic/copy-button.js.map +1 -0
- package/dist/components/etic/data-table-bulk-actions.d.ts +29 -0
- package/dist/components/etic/data-table-bulk-actions.js +97 -0
- package/dist/components/etic/data-table-bulk-actions.js.map +1 -0
- package/dist/components/etic/data-table-format.d.ts +12 -0
- package/dist/components/etic/data-table-format.js +8 -0
- package/dist/components/etic/data-table-format.js.map +1 -0
- package/dist/components/etic/data-table-pagination.d.ts +22 -0
- package/dist/components/etic/data-table-pagination.js +104 -0
- package/dist/components/etic/data-table-pagination.js.map +1 -0
- package/dist/components/etic/data-table-toolbar.d.ts +69 -0
- package/dist/components/etic/data-table-toolbar.js +127 -0
- package/dist/components/etic/data-table-toolbar.js.map +1 -0
- package/dist/components/etic/data-table-view-options.d.ts +16 -0
- package/dist/components/etic/data-table-view-options.js +151 -0
- package/dist/components/etic/data-table-view-options.js.map +1 -0
- package/dist/components/etic/data-table.d.ts +263 -0
- package/dist/components/etic/data-table.js +403 -0
- package/dist/components/etic/data-table.js.map +1 -0
- package/dist/components/etic/date-picker.d.ts +32 -0
- package/dist/components/etic/date-picker.js +162 -0
- package/dist/components/etic/date-picker.js.map +1 -0
- package/dist/components/etic/delete-button.d.ts +57 -0
- package/dist/components/etic/delete-button.js +38 -0
- package/dist/components/etic/delete-button.js.map +1 -0
- package/dist/components/etic/detail-list.d.ts +14 -0
- package/dist/components/etic/detail-list.js +36 -0
- package/dist/components/etic/detail-list.js.map +1 -0
- package/dist/components/etic/empty-state.d.ts +20 -0
- package/dist/components/etic/empty-state.js +20 -0
- package/dist/components/etic/empty-state.js.map +1 -0
- package/dist/components/etic/error-banner.d.ts +50 -0
- package/dist/components/etic/error-banner.js +89 -0
- package/dist/components/etic/error-banner.js.map +1 -0
- package/dist/components/etic/error-boundary.d.ts +53 -0
- package/dist/components/etic/error-boundary.js +82 -0
- package/dist/components/etic/error-boundary.js.map +1 -0
- package/dist/components/etic/file-upload.d.ts +52 -0
- package/dist/components/etic/file-upload.js +142 -0
- package/dist/components/etic/file-upload.js.map +1 -0
- package/dist/components/etic/form-dialog.d.ts +45 -0
- package/dist/components/etic/form-dialog.js +136 -0
- package/dist/components/etic/form-dialog.js.map +1 -0
- package/dist/components/etic/form-field-context.d.ts +66 -0
- package/dist/components/etic/form-field-context.js +28 -0
- package/dist/components/etic/form-field-context.js.map +1 -0
- package/dist/components/etic/form-field.d.ts +53 -0
- package/dist/components/etic/form-field.js +105 -0
- package/dist/components/etic/form-field.js.map +1 -0
- package/dist/components/etic/icon-toggle.d.ts +33 -0
- package/dist/components/etic/icon-toggle.js +28 -0
- package/dist/components/etic/icon-toggle.js.map +1 -0
- package/dist/components/etic/loading.d.ts +45 -0
- package/dist/components/etic/loading.js +82 -0
- package/dist/components/etic/loading.js.map +1 -0
- package/dist/components/etic/page-container.d.ts +17 -0
- package/dist/components/etic/page-container.js +20 -0
- package/dist/components/etic/page-container.js.map +1 -0
- package/dist/components/etic/page-header.d.ts +58 -0
- package/dist/components/etic/page-header.js +104 -0
- package/dist/components/etic/page-header.js.map +1 -0
- package/dist/components/etic/phone-input.d.ts +31 -0
- package/dist/components/etic/phone-input.js +133 -0
- package/dist/components/etic/phone-input.js.map +1 -0
- package/dist/components/etic/query-boundary.d.ts +50 -0
- package/dist/components/etic/query-boundary.js +25 -0
- package/dist/components/etic/query-boundary.js.map +1 -0
- package/dist/components/etic/search-select.d.ts +41 -0
- package/dist/components/etic/search-select.js +126 -0
- package/dist/components/etic/search-select.js.map +1 -0
- package/dist/components/etic/section-card.d.ts +12 -0
- package/dist/components/etic/section-card.js +23 -0
- package/dist/components/etic/section-card.js.map +1 -0
- package/dist/components/etic/segmented-control.d.ts +29 -0
- package/dist/components/etic/segmented-control.js +44 -0
- package/dist/components/etic/segmented-control.js.map +1 -0
- package/dist/components/etic/stat-tile.d.ts +18 -0
- package/dist/components/etic/stat-tile.js +39 -0
- package/dist/components/etic/stat-tile.js.map +1 -0
- package/dist/components/etic/status-badge.d.ts +16 -0
- package/dist/components/etic/status-badge.js +30 -0
- package/dist/components/etic/status-badge.js.map +1 -0
- package/dist/components/etic/theme-menu.d.ts +21 -0
- package/dist/components/etic/theme-menu.js +72 -0
- package/dist/components/etic/theme-menu.js.map +1 -0
- package/dist/components/etic/tooltip-button.d.ts +29 -0
- package/dist/components/etic/tooltip-button.js +39 -0
- package/dist/components/etic/tooltip-button.js.map +1 -0
- package/dist/components/etic/use-draft-autosave.d.ts +68 -0
- package/dist/components/etic/use-draft-autosave.js +102 -0
- package/dist/components/etic/use-draft-autosave.js.map +1 -0
- package/dist/components/ui/alert-dialog.d.ts +18 -0
- package/dist/components/ui/alert-dialog.js +95 -0
- package/dist/components/ui/alert-dialog.js.map +1 -0
- package/dist/components/ui/alert.d.ts +10 -0
- package/dist/components/ui/alert.js +47 -0
- package/dist/components/ui/alert.js.map +1 -0
- package/dist/components/ui/avatar.d.ts +11 -0
- package/dist/components/ui/avatar.js +52 -0
- package/dist/components/ui/avatar.js.map +1 -0
- package/dist/components/ui/badge.d.ts +7 -0
- package/dist/components/ui/badge.js +32 -0
- package/dist/components/ui/badge.js.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +10 -0
- package/dist/components/ui/breadcrumb.js +73 -0
- package/dist/components/ui/breadcrumb.js.map +1 -0
- package/dist/components/ui/button-group.d.ts +10 -0
- package/dist/components/ui/button-group.js +42 -0
- package/dist/components/ui/button-group.js.map +1 -0
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/button.js +8 -8
- package/dist/components/ui/button.js.map +1 -1
- package/dist/components/ui/calendar.d.ts +10 -0
- package/dist/components/ui/calendar.js +96 -0
- package/dist/components/ui/calendar.js.map +1 -0
- package/dist/components/ui/card.d.ts +11 -0
- package/dist/components/ui/card.js +57 -0
- package/dist/components/ui/card.js.map +1 -0
- package/dist/components/ui/checkbox.d.ts +3 -0
- package/dist/components/ui/checkbox.js +20 -0
- package/dist/components/ui/checkbox.js.map +1 -0
- package/dist/components/ui/collapsible.d.ts +5 -0
- package/dist/components/ui/collapsible.js +25 -0
- package/dist/components/ui/collapsible.js.map +1 -0
- package/dist/components/ui/combobox.d.ts +24 -0
- package/dist/components/ui/combobox.js +165 -0
- package/dist/components/ui/combobox.js.map +1 -0
- package/dist/components/ui/dialog.d.ts +17 -0
- package/dist/components/ui/dialog.js +92 -0
- package/dist/components/ui/dialog.js.map +1 -0
- package/dist/components/ui/dropdown-menu.d.ts +29 -0
- package/dist/components/ui/dropdown-menu.js +137 -0
- package/dist/components/ui/dropdown-menu.js.map +1 -0
- package/dist/components/ui/empty.d.ts +11 -0
- package/dist/components/ui/empty.js +60 -0
- package/dist/components/ui/empty.js.map +1 -0
- package/dist/components/ui/field.d.ts +24 -0
- package/dist/components/ui/field.js +108 -0
- package/dist/components/ui/field.js.map +1 -0
- package/dist/components/ui/input-group.d.ts +18 -0
- package/dist/components/ui/input-group.js +79 -0
- package/dist/components/ui/input-group.js.map +1 -0
- package/dist/components/ui/input.d.ts +3 -0
- package/dist/components/ui/input.js +16 -0
- package/dist/components/ui/input.js.map +1 -0
- package/dist/components/ui/item.d.ts +22 -0
- package/dist/components/ui/item.js +122 -0
- package/dist/components/ui/item.js.map +1 -0
- package/dist/components/ui/kbd.d.ts +3 -0
- package/dist/components/ui/kbd.js +20 -0
- package/dist/components/ui/kbd.js.map +1 -0
- package/dist/components/ui/label.d.ts +3 -0
- package/dist/components/ui/label.js +14 -0
- package/dist/components/ui/label.js.map +1 -0
- package/dist/components/ui/native-select.d.ts +8 -0
- package/dist/components/ui/native-select.js +39 -0
- package/dist/components/ui/native-select.js.map +1 -0
- package/dist/components/ui/pagination.d.ts +17 -0
- package/dist/components/ui/pagination.js +81 -0
- package/dist/components/ui/pagination.js.map +1 -0
- package/dist/components/ui/popover.d.ts +9 -0
- package/dist/components/ui/popover.js +55 -0
- package/dist/components/ui/popover.js.map +1 -0
- package/dist/components/ui/progress.d.ts +7 -0
- package/dist/components/ui/progress.js +45 -0
- package/dist/components/ui/progress.js.map +1 -0
- package/dist/components/ui/radio-group.d.ts +5 -0
- package/dist/components/ui/radio-group.js +27 -0
- package/dist/components/ui/radio-group.js.map +1 -0
- package/dist/components/ui/scroll-area.d.ts +4 -0
- package/dist/components/ui/scroll-area.js +36 -0
- package/dist/components/ui/scroll-area.js.map +1 -0
- package/dist/components/ui/select.d.ts +15 -0
- package/dist/components/ui/select.js +99 -0
- package/dist/components/ui/select.js.map +1 -0
- package/dist/components/ui/separator.d.ts +3 -0
- package/dist/components/ui/separator.js +15 -0
- package/dist/components/ui/separator.js.map +1 -0
- package/dist/components/ui/sheet.d.ts +14 -0
- package/dist/components/ui/sheet.js +90 -0
- package/dist/components/ui/sheet.js.map +1 -0
- package/dist/components/ui/sidebar.d.ts +63 -0
- package/dist/components/ui/sidebar.js +358 -0
- package/dist/components/ui/sidebar.js.map +1 -0
- package/dist/components/ui/skeleton.d.ts +2 -0
- package/dist/components/ui/skeleton.js +13 -0
- package/dist/components/ui/skeleton.js.map +1 -0
- package/dist/components/ui/slider.d.ts +3 -0
- package/dist/components/ui/slider.js +36 -0
- package/dist/components/ui/slider.js.map +1 -0
- package/dist/components/ui/spinner.d.ts +2 -0
- package/dist/components/ui/spinner.js +16 -0
- package/dist/components/ui/spinner.js.map +1 -0
- package/dist/components/ui/switch.d.ts +5 -0
- package/dist/components/ui/switch.js +20 -0
- package/dist/components/ui/switch.js.map +1 -0
- package/dist/components/ui/table.d.ts +10 -0
- package/dist/components/ui/table.js +67 -0
- package/dist/components/ui/table.js.map +1 -0
- package/dist/components/ui/tabs.d.ts +10 -0
- package/dist/components/ui/tabs.js +46 -0
- package/dist/components/ui/tabs.js.map +1 -0
- package/dist/components/ui/textarea.d.ts +3 -0
- package/dist/components/ui/textarea.js +14 -0
- package/dist/components/ui/textarea.js.map +1 -0
- package/dist/components/ui/toggle-group.d.ts +11 -0
- package/dist/components/ui/toggle-group.js +54 -0
- package/dist/components/ui/toggle-group.js.map +1 -0
- package/dist/components/ui/toggle.d.ts +8 -0
- package/dist/components/ui/toggle.js +36 -0
- package/dist/components/ui/toggle.js.map +1 -0
- package/dist/components/ui/tooltip.d.ts +6 -0
- package/dist/components/ui/tooltip.js +42 -0
- package/dist/components/ui/tooltip.js.map +1 -0
- package/dist/hooks/use-mobile.d.ts +18 -0
- package/dist/hooks/use-mobile.js +16 -0
- package/dist/hooks/use-mobile.js.map +1 -0
- package/dist/index.d.ts +78 -0
- package/dist/index.js +77 -2
- package/dist/styles.css +39 -4
- package/package.json +19 -7
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { Card as e, CardContent as t } from "../ui/card.js";
|
|
2
|
+
import { Skeleton as n } from "../ui/skeleton.js";
|
|
3
|
+
import { Spinner as r } from "../ui/spinner.js";
|
|
4
|
+
import { cn as i } from "cn";
|
|
5
|
+
import { jsx as a, jsxs as o } from "react/jsx-runtime";
|
|
6
|
+
// src/components/etic/loading.tsx
|
|
7
|
+
function s(e) {
|
|
8
|
+
return /* @__PURE__ */ a(r, {
|
|
9
|
+
...e,
|
|
10
|
+
role: void 0,
|
|
11
|
+
"aria-label": void 0,
|
|
12
|
+
"aria-hidden": !0
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function c({ libelle: e = "Chargement…", className: t }) {
|
|
16
|
+
return /* @__PURE__ */ o("div", {
|
|
17
|
+
role: "status",
|
|
18
|
+
className: i("flex items-center justify-center gap-2 py-8 text-sm text-muted-foreground", t),
|
|
19
|
+
children: [/* @__PURE__ */ a(s, {}), e]
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function l() {
|
|
23
|
+
return /* @__PURE__ */ a("span", {
|
|
24
|
+
className: "sr-only",
|
|
25
|
+
role: "status",
|
|
26
|
+
children: "Chargement…"
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
var u = [
|
|
30
|
+
"w-[70%]",
|
|
31
|
+
"w-[55%]",
|
|
32
|
+
"w-[80%]",
|
|
33
|
+
"w-[40%]",
|
|
34
|
+
"w-[60%]"
|
|
35
|
+
];
|
|
36
|
+
function d({ lignes: e = 5, colonnes: t = 4, className: r }) {
|
|
37
|
+
return /* @__PURE__ */ o("div", {
|
|
38
|
+
className: i("flex flex-col gap-3 py-2", r),
|
|
39
|
+
children: [/* @__PURE__ */ a(l, {}), Array.from({ length: e }, (e, r) => /* @__PURE__ */ a("div", {
|
|
40
|
+
"aria-hidden": !0,
|
|
41
|
+
className: "grid gap-4",
|
|
42
|
+
style: { gridTemplateColumns: `repeat(${t}, minmax(0, 1fr))` },
|
|
43
|
+
children: Array.from({ length: t }, (e, t) => /* @__PURE__ */ a(n, { className: i("h-4", u[(r + t) % u.length]) }, t))
|
|
44
|
+
}, r))]
|
|
45
|
+
});
|
|
46
|
+
}
|
|
47
|
+
function f({ lignes: r = 3, annoncer: s = !0, className: c }) {
|
|
48
|
+
return /* @__PURE__ */ a(e, {
|
|
49
|
+
className: c,
|
|
50
|
+
children: /* @__PURE__ */ o(t, {
|
|
51
|
+
className: "flex flex-col gap-3",
|
|
52
|
+
children: [s ? /* @__PURE__ */ a(l, {}) : null, Array.from({ length: r }, (e, t) => /* @__PURE__ */ a(n, {
|
|
53
|
+
"aria-hidden": !0,
|
|
54
|
+
className: i("h-4", u[(t + 3) % u.length])
|
|
55
|
+
}, t))]
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
function p({ className: e }) {
|
|
60
|
+
return /* @__PURE__ */ o("div", {
|
|
61
|
+
className: i("flex flex-col gap-6", e),
|
|
62
|
+
children: [
|
|
63
|
+
/* @__PURE__ */ a(l, {}),
|
|
64
|
+
/* @__PURE__ */ o("div", {
|
|
65
|
+
"aria-hidden": !0,
|
|
66
|
+
className: "flex flex-col gap-2",
|
|
67
|
+
children: [/* @__PURE__ */ a(n, { className: "h-4 w-40" }), /* @__PURE__ */ a(n, { className: "h-7 w-72 max-w-full" })]
|
|
68
|
+
}),
|
|
69
|
+
/* @__PURE__ */ a(f, {
|
|
70
|
+
lignes: 4,
|
|
71
|
+
annoncer: !1
|
|
72
|
+
}),
|
|
73
|
+
/* @__PURE__ */ a(f, {
|
|
74
|
+
lignes: 3,
|
|
75
|
+
annoncer: !1
|
|
76
|
+
})
|
|
77
|
+
]
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
export { c as Loading, f as SkeletonCard, p as SkeletonPage, d as SkeletonTable, s as SpinnerDecoratif };
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=loading.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loading.js","names":["SpinnerDecoratif","Spinner","props","Loading","cn","className","libelle","StatutChargement","LARGEURS","SkeletonTable","lignes","colonnes","Skeleton","ligne","colonne","SkeletonCard","Card","CardContent","annoncer","index","SkeletonPage"],"sources":["../../../src/components/etic/loading.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\"\nimport { cn } from \"cn\"\n\nimport { Card, CardContent } from \"@etic-ui/components/ui/card\"\nimport { Skeleton } from \"@etic-ui/components/ui/skeleton\"\nimport { Spinner } from \"@etic-ui/components/ui/spinner\"\n\n/**\n * Roue muette, à côté d'un texte qui dit déjà qu'on attend (bouton occupé,\n * statut « Chargement… ») : sans rôle ni nom, cachée aux lecteurs d'écran.\n * Usage interne.\n */\nexport function SpinnerDecoratif(props: ComponentProps<typeof Spinner>) {\n return (\n <Spinner {...props} role={undefined} aria-label={undefined} aria-hidden />\n )\n}\n\nexport interface LoadingProps {\n /** Annoncé aux lecteurs d'écran à chaque changement ; « Chargement… »\n * par défaut. */\n libelle?: string\n className?: string\n}\n\n/** Attente sans forme connue : roue et libellé, annoncés poliment\n * (`role=\"status\"`). */\nexport function Loading({ libelle = \"Chargement…\", className }: LoadingProps) {\n return (\n <div\n role=\"status\"\n className={cn(\n \"flex items-center justify-center gap-2 py-8 text-sm text-muted-foreground\",\n className\n )}\n >\n <SpinnerDecoratif />\n {libelle}\n </div>\n )\n}\n\n/** Les squelettes sont décoratifs : ce statut masqué dit qu'on charge. */\nfunction StatutChargement() {\n return (\n <span className=\"sr-only\" role=\"status\">\n Chargement…\n </span>\n )\n}\n\nconst LARGEURS = [\"w-[70%]\", \"w-[55%]\", \"w-[80%]\", \"w-[40%]\", \"w-[60%]\"]\n\nexport interface SkeletonTableProps {\n /** 5 par défaut. */\n lignes?: number\n /** 4 par défaut. */\n colonnes?: number\n className?: string\n}\n\n/** Lignes de barres, à la place d'un tableau qui charge. */\nexport function SkeletonTable({\n lignes = 5,\n colonnes = 4,\n className,\n}: SkeletonTableProps) {\n return (\n <div className={cn(\"flex flex-col gap-3 py-2\", className)}>\n <StatutChargement />\n {Array.from({ length: lignes }, (_, ligne) => (\n <div\n key={ligne}\n aria-hidden\n className=\"grid gap-4\"\n style={{ gridTemplateColumns: `repeat(${colonnes}, minmax(0, 1fr))` }}\n >\n {Array.from({ length: colonnes }, (_, colonne) => (\n <Skeleton\n key={colonne}\n className={cn(\n \"h-4\",\n LARGEURS[(ligne + colonne) % LARGEURS.length]\n )}\n />\n ))}\n </div>\n ))}\n </div>\n )\n}\n\nexport interface SkeletonCardProps {\n /** 3 par défaut. */\n lignes?: number\n /**\n * Porte le statut « Chargement… » ; vrai par défaut. Faux quand la carte\n * fait partie d'un squelette qui l'annonce déjà (une seule annonce par\n * zone qui charge).\n */\n annoncer?: boolean\n className?: string\n}\n\n/** Une carte de lignes de texte, pour une fiche ou un résumé. */\nexport function SkeletonCard({\n lignes = 3,\n annoncer = true,\n className,\n}: SkeletonCardProps) {\n return (\n <Card className={className}>\n <CardContent className=\"flex flex-col gap-3\">\n {annoncer ? <StatutChargement /> : null}\n {Array.from({ length: lignes }, (_, index) => (\n <Skeleton\n key={index}\n aria-hidden\n className={cn(\"h-4\", LARGEURS[(index + 3) % LARGEURS.length])}\n />\n ))}\n </CardContent>\n </Card>\n )\n}\n\nexport interface SkeletonPageProps {\n className?: string\n}\n\n/** Une fiche qui charge : la ligne du titre, puis deux cartes ; un seul\n * statut « Chargement… ». */\nexport function SkeletonPage({ className }: SkeletonPageProps) {\n return (\n <div className={cn(\"flex flex-col gap-6\", className)}>\n <StatutChargement />\n <div aria-hidden className=\"flex flex-col gap-2\">\n <Skeleton className=\"h-4 w-40\" />\n <Skeleton className=\"h-7 w-72 max-w-full\" />\n </div>\n <SkeletonCard lignes={4} annoncer={false} />\n <SkeletonCard lignes={3} annoncer={false} />\n </div>\n )\n}\n"],"mappings":";;;;;;AAYA,SAAgBA,EAAiB,GAAuC;CACtE,OACE,kBAACC,GAAD;EAAS,GAAIC;EAAO,MAAM,KAAA;EAAW,cAAY,KAAA;EAAW,eAAA;CAAa,CAAA;AAE7E;AAWA,SAAgBC,EAAQ,EAAE,aAAU,eAAe,gBAA2B;CAC5E,OACE,kBAAC,OAAD;EACE,MAAK;EACL,WAAWC,EACT,6EACAC,CACF;EALF,UAAA,CAOE,kBAACL,GAAD,CAAmB,CAAA,GAClBM,CACE;;AAET;AAGA,SAASC,IAAmB;CAC1B,OACE,kBAAC,QAAD;EAAM,WAAU;EAAU,MAAK;EAAS,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,kBAACG,GAAD;IAAc,QAAQ;IAAG,UAAU;GAAQ,CAAA;GAC3C,kBAACA,GAAD;IAAc,QAAQ;IAAG,UAAU;GAAQ,CAAA;EACxC;;AAET"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
/** Largeur maximale du contenu ; « full » : toute la largeur disponible. */
|
|
3
|
+
export type PageContainerLargeur = "md" | "lg" | "xl" | "full";
|
|
4
|
+
export interface PageContainerProps extends ComponentProps<"div"> {
|
|
5
|
+
/** « full » par défaut (listes, tableaux) ; « md » pour un formulaire ou
|
|
6
|
+
* une fiche à lire, « lg » ou « xl » entre les deux. Le contenu limité
|
|
7
|
+
* est centré. */
|
|
8
|
+
largeur?: PageContainerLargeur;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Conteneur d'une page, dans le `<main>` d'`AppShell` : marges autour du
|
|
12
|
+
* contenu (resserrées sur téléphone), largeur maximale, et espacement
|
|
13
|
+
* vertical régulier entre les blocs (en-tête, cartes, tableau), sur le
|
|
14
|
+
* modèle des blocs « dashboard » de shadcn. Chaque page enveloppe son
|
|
15
|
+
* contenu dedans plutôt que de poser ses propres marges.
|
|
16
|
+
*/
|
|
17
|
+
export declare function PageContainer({ largeur, className, ...props }: PageContainerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { cn as e } from "cn";
|
|
2
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
3
|
+
// src/components/etic/page-container.tsx
|
|
4
|
+
var n = {
|
|
5
|
+
md: "max-w-3xl",
|
|
6
|
+
lg: "max-w-5xl",
|
|
7
|
+
xl: "max-w-7xl",
|
|
8
|
+
full: ""
|
|
9
|
+
};
|
|
10
|
+
function r({ largeur: r = "full", className: i, ...a }) {
|
|
11
|
+
return /* @__PURE__ */ t("div", {
|
|
12
|
+
"data-slot": "page-container",
|
|
13
|
+
"data-largeur": r,
|
|
14
|
+
className: e("mx-auto flex w-full min-w-0 flex-1 flex-col gap-6 px-4 py-6 min-[1025px]:px-8 min-[1025px]:py-8 sm:px-6", n[r], i),
|
|
15
|
+
...a
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export { r as PageContainer };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=page-container.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-container.js","names":["LARGEURS","PageContainer","props","largeur","cn","className"],"sources":["../../../src/components/etic/page-container.tsx"],"sourcesContent":["import type { ComponentProps } from \"react\"\nimport { cn } from \"cn\"\n\n/** Largeur maximale du contenu ; « full » : toute la largeur disponible. */\nexport type PageContainerLargeur = \"md\" | \"lg\" | \"xl\" | \"full\"\n\nconst LARGEURS: Record<PageContainerLargeur, string> = {\n md: \"max-w-3xl\",\n lg: \"max-w-5xl\",\n xl: \"max-w-7xl\",\n full: \"\",\n}\n\nexport interface PageContainerProps extends ComponentProps<\"div\"> {\n /** « full » par défaut (listes, tableaux) ; « md » pour un formulaire ou\n * une fiche à lire, « lg » ou « xl » entre les deux. Le contenu limité\n * est centré. */\n largeur?: PageContainerLargeur\n}\n\n/**\n * Conteneur d'une page, dans le `<main>` d'`AppShell` : marges autour du\n * contenu (resserrées sur téléphone), largeur maximale, et espacement\n * vertical régulier entre les blocs (en-tête, cartes, tableau), sur le\n * modèle des blocs « dashboard » de shadcn. Chaque page enveloppe son\n * contenu dedans plutôt que de poser ses propres marges.\n */\nexport function PageContainer({\n largeur = \"full\",\n className,\n ...props\n}: PageContainerProps) {\n return (\n <div\n data-slot=\"page-container\"\n data-largeur={largeur}\n className={cn(\n \"mx-auto flex w-full min-w-0 flex-1 flex-col gap-6 px-4 py-6 min-[1025px]:px-8 min-[1025px]:py-8 sm:px-6\",\n LARGEURS[largeur],\n className\n )}\n {...props}\n />\n )\n}\n"],"mappings":";;;AAMA,IAAMA,IAAiD;CACrD,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,MAAM;AACR;AAgBA,SAAgBC,EAAc,EAC5B,aAAU,QACV,cACA,GAAGC,KACkB;CACrB,OACE,kBAAC,OAAD;EACE,aAAU;EACV,gBAAcC;EACd,WAAWC,EACT,2GACAJ,EAASG,IACTE,CACF;EACA,GAAIH;CACL,CAAA;AAEL"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { LucideIcon } from 'lucide-react';
|
|
3
|
+
import { AppShellLienComposant } from './app-shell';
|
|
4
|
+
export interface PageHeaderProps {
|
|
5
|
+
titre: ReactNode;
|
|
6
|
+
/** Ligne discrète sous le titre. */
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
/** Boutons à droite (créer, exporter…) ; passent dessous sur un écran étroit. */
|
|
9
|
+
actions?: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
}
|
|
12
|
+
/** En-tête d'une page : titre (le `<h1>`) et description à gauche, actions
|
|
13
|
+
* à droite. */
|
|
14
|
+
export declare function PageHeader({ titre, description, actions, className, }: PageHeaderProps): import("react").JSX.Element;
|
|
15
|
+
/** Étape du fil d'Ariane, de la plus générale à la plus proche. */
|
|
16
|
+
export interface DetailHeaderEtape {
|
|
17
|
+
libelle: string;
|
|
18
|
+
href: string;
|
|
19
|
+
}
|
|
20
|
+
/** Action rare ou destructive, rangée sous « Plus d'actions ». */
|
|
21
|
+
export interface DetailHeaderActionSecondaire {
|
|
22
|
+
libelle: string;
|
|
23
|
+
onChoisir: () => void;
|
|
24
|
+
icone?: LucideIcon;
|
|
25
|
+
/** En rouge. */
|
|
26
|
+
destructif?: boolean;
|
|
27
|
+
/** Action impossible : l'entrée est grisée, ne fait rien, et cette raison
|
|
28
|
+
* s'affiche sous son libellé (comme `verrou` de `TooltipButton`). */
|
|
29
|
+
verrou?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface DetailHeaderProps {
|
|
32
|
+
/**
|
|
33
|
+
* Où se trouve la fiche : le fil d'Ariane, qui y ramène quel que soit
|
|
34
|
+
* l'historique du navigateur. La fiche elle-même (le titre) en est la
|
|
35
|
+
* dernière étape.
|
|
36
|
+
*/
|
|
37
|
+
chemin?: DetailHeaderEtape[];
|
|
38
|
+
titre: string;
|
|
39
|
+
/** À côté du titre : badges de statut, marqueurs. */
|
|
40
|
+
badges?: ReactNode;
|
|
41
|
+
/** Ligne discrète sous le titre : un code, une adresse. */
|
|
42
|
+
meta?: ReactNode;
|
|
43
|
+
/** Actions courantes, en boutons. */
|
|
44
|
+
actions?: ReactNode;
|
|
45
|
+
/** Actions rares ou destructives, derrière « Plus d'actions ». */
|
|
46
|
+
actionsSecondaires?: DetailHeaderActionSecondaire[];
|
|
47
|
+
/**
|
|
48
|
+
* Fiche dont la première carte répète déjà le nom : le fil d'Ariane porte
|
|
49
|
+
* seul le titre (le `<h1>`), actions sur la même ligne. Demande `chemin`.
|
|
50
|
+
*/
|
|
51
|
+
compact?: boolean;
|
|
52
|
+
/** Composant de lien du routeur, comme pour `AppShell`. */
|
|
53
|
+
lien?: AppShellLienComposant;
|
|
54
|
+
className?: string;
|
|
55
|
+
}
|
|
56
|
+
/** En-tête d'une fiche (un élément d'une liste) : fil d'Ariane, titre,
|
|
57
|
+
* badges, méta, actions courantes et menu des actions rares. */
|
|
58
|
+
export declare function DetailHeader({ chemin, titre, badges, meta, actions, actionsSecondaires, compact, lien: Lien, className, }: DetailHeaderProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,104 @@
|
|
|
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
|
+
import { Button as o } from "../ui/button.js";
|
|
3
|
+
import { DropdownMenu as s, DropdownMenuContent as c, DropdownMenuItem as l, DropdownMenuTrigger as u } from "../ui/dropdown-menu.js";
|
|
4
|
+
import { Tooltip as d, TooltipContent as f, TooltipTrigger as p } from "../ui/tooltip.js";
|
|
5
|
+
import { cn as m } from "cn";
|
|
6
|
+
import { Fragment as h } from "react";
|
|
7
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
8
|
+
import { EllipsisIcon as y } from "lucide-react";
|
|
9
|
+
// src/components/etic/page-header.tsx
|
|
10
|
+
function b({ titre: e, description: t, actions: n, className: r }) {
|
|
11
|
+
return /* @__PURE__ */ v("div", {
|
|
12
|
+
"data-slot": "page-header",
|
|
13
|
+
className: m("flex flex-wrap items-start justify-between gap-x-4 gap-y-3", r),
|
|
14
|
+
children: [/* @__PURE__ */ v("div", {
|
|
15
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
16
|
+
children: [/* @__PURE__ */ _("h1", {
|
|
17
|
+
className: "font-heading text-2xl font-semibold tracking-tight",
|
|
18
|
+
children: e
|
|
19
|
+
}), t ? /* @__PURE__ */ _("p", {
|
|
20
|
+
className: "text-sm text-muted-foreground",
|
|
21
|
+
children: t
|
|
22
|
+
}) : null]
|
|
23
|
+
}), n ? /* @__PURE__ */ _(x, { children: n }) : null]
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function x({ children: e }) {
|
|
27
|
+
return /* @__PURE__ */ _("div", {
|
|
28
|
+
className: "flex flex-wrap items-center gap-2",
|
|
29
|
+
children: e
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
function S({ chemin: o = [], titre: s, badges: c, meta: l, actions: u, actionsSecondaires: d = [], compact: f = !1, lien: p = "a", className: g }) {
|
|
33
|
+
let y = u || d.length > 0 ? /* @__PURE__ */ v(x, { children: [u, d.length > 0 ? /* @__PURE__ */ _(C, { actions: d }) : null] }) : null, b = o.map(({ libelle: e, href: r }, i) => /* @__PURE__ */ v(h, { children: [/* @__PURE__ */ _(t, { children: /* @__PURE__ */ _(n, {
|
|
34
|
+
render: /* @__PURE__ */ _(p, { href: r }),
|
|
35
|
+
children: e
|
|
36
|
+
}) }), /* @__PURE__ */ _(a, {})] }, i));
|
|
37
|
+
return f && o.length > 0 ? /* @__PURE__ */ v("div", {
|
|
38
|
+
"data-slot": "detail-header",
|
|
39
|
+
className: m("flex flex-wrap items-center justify-between gap-x-4 gap-y-2", g),
|
|
40
|
+
children: [/* @__PURE__ */ _(e, {
|
|
41
|
+
className: "min-w-0",
|
|
42
|
+
children: /* @__PURE__ */ v(r, { children: [b, /* @__PURE__ */ v(t, { children: [/* @__PURE__ */ _("h1", {
|
|
43
|
+
className: "text-sm font-medium",
|
|
44
|
+
children: /* @__PURE__ */ _(i, {
|
|
45
|
+
role: void 0,
|
|
46
|
+
"aria-disabled": void 0,
|
|
47
|
+
children: s
|
|
48
|
+
})
|
|
49
|
+
}), c] })] })
|
|
50
|
+
}), y]
|
|
51
|
+
}) : /* @__PURE__ */ v("div", {
|
|
52
|
+
"data-slot": "detail-header",
|
|
53
|
+
className: m("flex flex-col gap-3", g),
|
|
54
|
+
children: [o.length > 0 ? /* @__PURE__ */ _(e, { children: /* @__PURE__ */ v(r, { children: [b, /* @__PURE__ */ _(t, { children: /* @__PURE__ */ _(i, { children: s }) })] }) }) : null, /* @__PURE__ */ v("div", {
|
|
55
|
+
className: "flex flex-wrap items-start justify-between gap-x-4 gap-y-3",
|
|
56
|
+
children: [/* @__PURE__ */ v("div", {
|
|
57
|
+
className: "flex min-w-0 flex-col gap-1",
|
|
58
|
+
children: [/* @__PURE__ */ v("div", {
|
|
59
|
+
className: "flex flex-wrap items-center gap-2",
|
|
60
|
+
children: [/* @__PURE__ */ _("h1", {
|
|
61
|
+
className: "font-heading text-2xl font-semibold tracking-tight break-words",
|
|
62
|
+
children: s
|
|
63
|
+
}), c]
|
|
64
|
+
}), l ? /* @__PURE__ */ _("p", {
|
|
65
|
+
className: "text-sm break-words text-muted-foreground",
|
|
66
|
+
children: l
|
|
67
|
+
}) : null]
|
|
68
|
+
}), y]
|
|
69
|
+
})]
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
function C({ actions: e }) {
|
|
73
|
+
return /* @__PURE__ */ v(s, { children: [/* @__PURE__ */ v(d, { children: [/* @__PURE__ */ _(p, {
|
|
74
|
+
render: /* @__PURE__ */ _(u, { render: /* @__PURE__ */ _(o, {
|
|
75
|
+
variant: "outline",
|
|
76
|
+
size: "icon",
|
|
77
|
+
"aria-label": "Plus d'actions"
|
|
78
|
+
}) }),
|
|
79
|
+
children: /* @__PURE__ */ _(y, {})
|
|
80
|
+
}), /* @__PURE__ */ _(f, { children: "Plus d'actions" })] }), /* @__PURE__ */ _(c, {
|
|
81
|
+
align: "end",
|
|
82
|
+
className: "min-w-48",
|
|
83
|
+
children: e.map(({ libelle: e, onChoisir: t, icone: n, destructif: r, verrou: i }, a) => /* @__PURE__ */ _(l, {
|
|
84
|
+
variant: r ? "destructive" : "default",
|
|
85
|
+
disabled: !!i,
|
|
86
|
+
onClick: t,
|
|
87
|
+
className: i ? "data-disabled:opacity-100" : void 0,
|
|
88
|
+
children: i ? /* @__PURE__ */ v(g, { children: [n ? /* @__PURE__ */ _(n, { className: "opacity-50" }) : null, /* @__PURE__ */ v("span", {
|
|
89
|
+
className: "flex flex-col",
|
|
90
|
+
children: [/* @__PURE__ */ _("span", {
|
|
91
|
+
className: "opacity-50",
|
|
92
|
+
children: e
|
|
93
|
+
}), /* @__PURE__ */ _("span", {
|
|
94
|
+
"data-slot": "detail-header-raison",
|
|
95
|
+
className: "text-xs text-muted-foreground",
|
|
96
|
+
children: i
|
|
97
|
+
})]
|
|
98
|
+
})] }) : /* @__PURE__ */ v(g, { children: [n ? /* @__PURE__ */ _(n, {}) : null, e] })
|
|
99
|
+
}, a))
|
|
100
|
+
})] });
|
|
101
|
+
}
|
|
102
|
+
export { S as DetailHeader, b as PageHeader };
|
|
103
|
+
|
|
104
|
+
//# sourceMappingURL=page-header.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"page-header.js","names":["_Fragment","Fragment$1","PageHeader","cn","className","titre","description","actions","Actions","DetailHeader","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 type { AppShellLienComposant } from \"@etic-ui/components/etic/app-shell\"\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 className?: string\n}\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 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>{actions}</Actions> : null}\n </div>\n )\n}\n\nfunction Actions({ children }: { children: ReactNode }) {\n return <div className=\"flex flex-wrap items-center gap-2\">{children}</div>\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 * 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, comme pour `AppShell`. */\n lien?: AppShellLienComposant\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 compact = false,\n lien: Lien = \"a\",\n className,\n}: DetailHeaderProps) {\n const lesActions =\n actions || actionsSecondaires.length > 0 ? (\n <Actions>\n {actions}\n {actionsSecondaires.length > 0 ? (\n <MenuActions actions={actionsSecondaires} />\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({ actions }: { actions: DetailHeaderActionSecondaire[] }) {\n return (\n <DropdownMenu>\n <Tooltip>\n <TooltipTrigger\n render={\n <DropdownMenuTrigger\n render={\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 <DropdownMenuContent align=\"end\" className=\"min-w-48\">\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":";;;;;;;;;AAqCA,SAAgBE,EAAW,EACzB,UACA,gBACA,YACA,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,EAAA,UAAUD,EAAiB,CAAA,IAAI,IACvC;;AAET;AAEA,SAASC,EAAQ,EAAE,eAAqC;CACtD,OAAO,kBAAC,OAAD;EAAK,WAAU;EAAqC;CAAc,CAAA;AAC3E;AAgDA,SAAgBC,EAAa,EAC3B,YAAS,CAAC,GACV,UACA,WACA,SACA,YACA,wBAAqB,CAAC,GACtB,aAAU,IAC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XE,CA6BW,CAEtB;CACmB,CAAA,CACT,EAAA,CAAA;AAElB"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ComponentProps } from 'react';
|
|
2
|
+
import { CountryCode } from 'libphonenumber-js';
|
|
3
|
+
export type { CountryCode };
|
|
4
|
+
export interface PhoneInputDetails {
|
|
5
|
+
/** Numéro complet et plausible pour son pays (longueur, préfixes). */
|
|
6
|
+
valide: boolean;
|
|
7
|
+
/** Pays sélectionné, ou reconnu dans un numéro tapé avec « + ». */
|
|
8
|
+
pays: CountryCode;
|
|
9
|
+
}
|
|
10
|
+
export interface PhoneInputProps extends Omit<ComponentProps<"input">, "value" | "defaultValue" | "onChange"> {
|
|
11
|
+
/** Numéro au format E.164 (« +33612345678 »), ou "" s'il n'y en a pas. */
|
|
12
|
+
valeur: string;
|
|
13
|
+
/** Reçoit le numéro en E.164 dès qu'il a une longueur possible ; sinon le
|
|
14
|
+
* texte tapé (et `valide` à faux) ; "" si le champ est vide. */
|
|
15
|
+
onValeurChange: (valeur: string, details: PhoneInputDetails) => void;
|
|
16
|
+
/** Pays proposé tant que le numéro n'en indique pas d'autre. */
|
|
17
|
+
paysParDefaut?: CountryCode;
|
|
18
|
+
/** Pays proposés dans la liste ; tous par défaut. */
|
|
19
|
+
pays?: CountryCode[];
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Numéro de téléphone avec sélecteur de pays (Combobox de shadcn : drapeau et
|
|
23
|
+
* indicatif, recherche sur le nom du pays ou l'indicatif) : lu, validé et mis
|
|
24
|
+
* en forme par libphonenumber-js, rendu en E.164. Le numéro se tape
|
|
25
|
+
* librement ; il est mis en forme en quittant le champ. Un numéro tapé avec
|
|
26
|
+
* son indicatif (« +44… ») choisit le pays.
|
|
27
|
+
*
|
|
28
|
+
* `className` va à l'enveloppe (`ButtonGroup`), le reste au champ du numéro ;
|
|
29
|
+
* avec `name`, un champ caché soumet la valeur (E.164), pas le texte affiché.
|
|
30
|
+
*/
|
|
31
|
+
export declare function PhoneInput({ valeur, onValeurChange, paysParDefaut, pays: paysProposes, disabled, className, onBlur, placeholder, id, name, form, required, "aria-describedby": ariaDescribedby, "aria-invalid": ariaInvalid, ...props }: PhoneInputProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { Button as e } from "../ui/button.js";
|
|
2
|
+
import { ButtonGroup as t } from "../ui/button-group.js";
|
|
3
|
+
import { Combobox as n, ComboboxContent as r, ComboboxEmpty as i, ComboboxInput as a, ComboboxItem as o, ComboboxList as s, ComboboxTrigger as c, ComboboxValue as l } from "../ui/combobox.js";
|
|
4
|
+
import { Input as u } from "../ui/input.js";
|
|
5
|
+
import { attributsDuChamp as d, useFormField as f } from "./form-field-context.js";
|
|
6
|
+
import { useMemo as p, useState as m } from "react";
|
|
7
|
+
import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
|
|
8
|
+
import { getCountries as v, getCountryCallingCode as y, getExampleNumber as b, parsePhoneNumberFromString as x } from "libphonenumber-js";
|
|
9
|
+
import S from "libphonenumber-js/mobile/examples";
|
|
10
|
+
// src/components/etic/phone-input.tsx
|
|
11
|
+
function C(e) {
|
|
12
|
+
return String.fromCodePoint(...[...e].map((e) => 127462 + e.charCodeAt(0) - 65));
|
|
13
|
+
}
|
|
14
|
+
var w;
|
|
15
|
+
function T() {
|
|
16
|
+
if (!w) {
|
|
17
|
+
let e = new Intl.DisplayNames(["fr"], { type: "region" }), t = new Intl.Collator("fr");
|
|
18
|
+
w = v().map((t) => ({
|
|
19
|
+
code: t,
|
|
20
|
+
nom: e.of(t) ?? t
|
|
21
|
+
})).sort((e, n) => t.compare(e.nom, n.nom)).map(({ code: e, nom: t }) => ({
|
|
22
|
+
value: e,
|
|
23
|
+
label: `${t} +${y(e)}`
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
return w;
|
|
27
|
+
}
|
|
28
|
+
function E(e, t) {
|
|
29
|
+
return x(e, t);
|
|
30
|
+
}
|
|
31
|
+
function D(e, t) {
|
|
32
|
+
let n = e ? E(e, t) : void 0;
|
|
33
|
+
if (!n) return {
|
|
34
|
+
texte: e,
|
|
35
|
+
pays: t
|
|
36
|
+
};
|
|
37
|
+
let r = n.country ?? t;
|
|
38
|
+
return {
|
|
39
|
+
texte: n.formatNational(),
|
|
40
|
+
pays: r
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
function O({ valeur: v, onValeurChange: x, paysParDefaut: w = "FR", pays: O, disabled: k, className: A, onBlur: j, placeholder: M, id: N, name: P, form: F, required: I, "aria-describedby": L, "aria-invalid": R, ...z }) {
|
|
44
|
+
let B = d(f(), {
|
|
45
|
+
id: N,
|
|
46
|
+
required: I,
|
|
47
|
+
"aria-describedby": L,
|
|
48
|
+
"aria-invalid": R
|
|
49
|
+
}), [V, H] = m(() => D(v, w)), [U, W] = m(v);
|
|
50
|
+
v !== U && (W(v), H(D(v, V.pays)));
|
|
51
|
+
let G = O?.join(","), K = p(() => {
|
|
52
|
+
let e = G ? new Set(G.split(",")) : void 0;
|
|
53
|
+
return e ? T().filter((t) => e.has(t.value)) : T();
|
|
54
|
+
}, [G]);
|
|
55
|
+
function q(e, t) {
|
|
56
|
+
let n = e.trim() ? E(e, t) : void 0, r = e.trim().startsWith("+") && n?.country ? n.country : t, i = n?.isPossible() ? n.number : e.trim();
|
|
57
|
+
H({
|
|
58
|
+
texte: e,
|
|
59
|
+
pays: r
|
|
60
|
+
}), W(i), (i !== v || r !== V.pays) && x(i, {
|
|
61
|
+
valide: n?.isValid() ?? !1,
|
|
62
|
+
pays: r
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
return /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ _(t, {
|
|
66
|
+
className: A,
|
|
67
|
+
children: [/* @__PURE__ */ _(n, {
|
|
68
|
+
items: K,
|
|
69
|
+
value: K.find((e) => e.value === V.pays) ?? null,
|
|
70
|
+
isItemEqualToValue: (e, t) => e.value === t.value,
|
|
71
|
+
autoHighlight: !0,
|
|
72
|
+
onValueChange: (e) => {
|
|
73
|
+
if (!e) return;
|
|
74
|
+
let t = V.texte.trim().startsWith("+") ? void 0 : E(V.texte, e.value);
|
|
75
|
+
q(t?.isValid() ? t.formatNational() : V.texte, e.value);
|
|
76
|
+
},
|
|
77
|
+
disabled: k,
|
|
78
|
+
children: [/* @__PURE__ */ g(c, {
|
|
79
|
+
render: /* @__PURE__ */ g(e, {
|
|
80
|
+
variant: "outline",
|
|
81
|
+
"aria-label": "Pays",
|
|
82
|
+
className: "text-base md:text-sm"
|
|
83
|
+
}),
|
|
84
|
+
children: /* @__PURE__ */ g(l, { children: (e) => e ? `${C(e.value)} +${y(e.value)}` : null })
|
|
85
|
+
}), /* @__PURE__ */ _(r, {
|
|
86
|
+
className: "w-72",
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ g(a, {
|
|
89
|
+
showTrigger: !1,
|
|
90
|
+
placeholder: "Pays ou indicatif",
|
|
91
|
+
"aria-label": "Rechercher un pays"
|
|
92
|
+
}),
|
|
93
|
+
/* @__PURE__ */ g(i, { children: "Aucun pays trouvé." }),
|
|
94
|
+
/* @__PURE__ */ g(s, { children: (e) => /* @__PURE__ */ _(o, {
|
|
95
|
+
value: e,
|
|
96
|
+
children: [/* @__PURE__ */ g("span", {
|
|
97
|
+
"aria-hidden": "true",
|
|
98
|
+
children: C(e.value)
|
|
99
|
+
}), e.label]
|
|
100
|
+
}, e.value) })
|
|
101
|
+
]
|
|
102
|
+
})]
|
|
103
|
+
}), /* @__PURE__ */ g(u, {
|
|
104
|
+
type: "tel",
|
|
105
|
+
inputMode: "tel",
|
|
106
|
+
autoComplete: "tel-national",
|
|
107
|
+
...z,
|
|
108
|
+
...B,
|
|
109
|
+
form: F,
|
|
110
|
+
"aria-required": void 0,
|
|
111
|
+
disabled: k,
|
|
112
|
+
placeholder: M ?? b(V.pays, S)?.formatNational(),
|
|
113
|
+
value: V.texte,
|
|
114
|
+
onChange: (e) => q(e.target.value, V.pays),
|
|
115
|
+
onBlur: (e) => {
|
|
116
|
+
let t = E(V.texte, V.pays);
|
|
117
|
+
t?.isValid() && H({
|
|
118
|
+
texte: t.formatNational(),
|
|
119
|
+
pays: V.pays
|
|
120
|
+
}), j?.(e);
|
|
121
|
+
}
|
|
122
|
+
})]
|
|
123
|
+
}), P ? /* @__PURE__ */ g("input", {
|
|
124
|
+
type: "hidden",
|
|
125
|
+
name: P,
|
|
126
|
+
form: F,
|
|
127
|
+
disabled: k,
|
|
128
|
+
value: v
|
|
129
|
+
}) : null] });
|
|
130
|
+
}
|
|
131
|
+
export { O as PhoneInput };
|
|
132
|
+
|
|
133
|
+
//# sourceMappingURL=phone-input.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"phone-input.js","names":["_Fragment","Fragment$1","exemples","drapeau","pays","lettre","tousLesPays","listePays","noms","ordre","getCountries","code","a","b","nom","getCountryCallingCode","lire","parsePhoneNumberFromString","texte","enTexte","numero","valeur","paysNumero","PhoneInput","paysProposes","ariaDescribedby","ariaInvalid","props","champ","attributsDuChamp","useFormField","etat","setEtat","useState","paysParDefaut","valeurVue","setValeurVue","clePays","options","useMemo","retenus","option","emettre","paysRetenu","sortie","onValeurChange","ButtonGroup","Combobox","ComboboxTrigger","Button","ComboboxValue","ComboboxContent","ComboboxInput","ComboboxEmpty","ComboboxList","ComboboxItem","Input","placeholder","getExampleNumber","event","onBlur","name"],"sources":["../../../src/components/etic/phone-input.tsx"],"sourcesContent":["import { useMemo, useState, type ComponentProps } from \"react\"\nimport {\n getCountries,\n getCountryCallingCode,\n getExampleNumber,\n parsePhoneNumberFromString,\n type CountryCode,\n} from \"libphonenumber-js\"\nimport exemples from \"libphonenumber-js/mobile/examples\"\n\nimport { Button } from \"@etic-ui/components/ui/button\"\nimport { ButtonGroup } from \"@etic-ui/components/ui/button-group\"\nimport {\n Combobox,\n ComboboxContent,\n ComboboxEmpty,\n ComboboxInput,\n ComboboxItem,\n ComboboxList,\n ComboboxTrigger,\n ComboboxValue,\n} from \"@etic-ui/components/ui/combobox\"\nimport { Input } from \"@etic-ui/components/ui/input\"\nimport {\n attributsDuChamp,\n useFormField,\n} from \"@etic-ui/components/etic/form-field-context\"\n\ninterface OptionPays {\n value: CountryCode\n /** « France +33 » : ce que la recherche lit. */\n label: string\n}\n\nexport type { CountryCode }\n\nexport interface PhoneInputDetails {\n /** Numéro complet et plausible pour son pays (longueur, préfixes). */\n valide: boolean\n /** Pays sélectionné, ou reconnu dans un numéro tapé avec « + ». */\n pays: CountryCode\n}\n\nexport interface PhoneInputProps extends Omit<\n ComponentProps<\"input\">,\n \"value\" | \"defaultValue\" | \"onChange\"\n> {\n /** Numéro au format E.164 (« +33612345678 »), ou \"\" s'il n'y en a pas. */\n valeur: string\n /** Reçoit le numéro en E.164 dès qu'il a une longueur possible ; sinon le\n * texte tapé (et `valide` à faux) ; \"\" si le champ est vide. */\n onValeurChange: (valeur: string, details: PhoneInputDetails) => void\n /** Pays proposé tant que le numéro n'en indique pas d'autre. */\n paysParDefaut?: CountryCode\n /** Pays proposés dans la liste ; tous par défaut. */\n pays?: CountryCode[]\n}\n\n/** Drapeau en emoji, à partir des deux lettres du pays. */\nfunction drapeau(pays: CountryCode) {\n return String.fromCodePoint(\n ...[...pays].map((lettre) => 0x1f1e6 + lettre.charCodeAt(0) - 65)\n )\n}\n\n// Tous les pays, triés par leur nom à la française : calculés une fois, au\n// premier rendu d'un PhoneInput, puis filtrés par instance.\nlet tousLesPays: OptionPays[] | undefined\n\nfunction listePays(): OptionPays[] {\n if (!tousLesPays) {\n const noms = new Intl.DisplayNames([\"fr\"], { type: \"region\" })\n // Tri sur le nom seul : « Saint-Martin » avant « Saint-Martin (partie\n // néerlandaise) », quel que soit l'indicatif.\n const ordre = new Intl.Collator(\"fr\")\n tousLesPays = getCountries()\n .map((code) => ({ code, nom: noms.of(code) ?? code }))\n .sort((a, b) => ordre.compare(a.nom, b.nom))\n .map(({ code, nom }) => ({\n value: code,\n label: `${nom} +${getCountryCallingCode(code)}`,\n }))\n }\n return tousLesPays\n}\n\nfunction lire(texte: string, pays: CountryCode) {\n return parsePhoneNumberFromString(texte, pays)\n}\n\nfunction enTexte(valeur: string, pays: CountryCode) {\n const numero = valeur ? lire(valeur, pays) : undefined\n if (!numero) return { texte: valeur, pays }\n const paysNumero = numero.country ?? pays\n return { texte: numero.formatNational(), pays: paysNumero }\n}\n\n/**\n * Numéro de téléphone avec sélecteur de pays (Combobox de shadcn : drapeau et\n * indicatif, recherche sur le nom du pays ou l'indicatif) : lu, validé et mis\n * en forme par libphonenumber-js, rendu en E.164. Le numéro se tape\n * librement ; il est mis en forme en quittant le champ. Un numéro tapé avec\n * son indicatif (« +44… ») choisit le pays.\n *\n * `className` va à l'enveloppe (`ButtonGroup`), le reste au champ du numéro ;\n * avec `name`, un champ caché soumet la valeur (E.164), pas le texte affiché.\n */\nexport function PhoneInput({\n valeur,\n onValeurChange,\n paysParDefaut = \"FR\",\n pays: paysProposes,\n disabled,\n className,\n onBlur,\n placeholder,\n id,\n name,\n form,\n required,\n \"aria-describedby\": ariaDescribedby,\n \"aria-invalid\": ariaInvalid,\n ...props\n}: PhoneInputProps) {\n const champ = attributsDuChamp(useFormField(), {\n id,\n required,\n \"aria-describedby\": ariaDescribedby,\n \"aria-invalid\": ariaInvalid,\n })\n const [etat, setEtat] = useState(() => enTexte(valeur, paysParDefaut))\n // Dernière valeur vue (reçue ou émise) : une autre valeur, venue de\n // l'application, remplace la saisie.\n const [valeurVue, setValeurVue] = useState(valeur)\n if (valeur !== valeurVue) {\n setValeurVue(valeur)\n setEtat(enTexte(valeur, etat.pays))\n }\n\n // Clé stable : un tableau `pays` écrit en ligne ne refait pas le filtre.\n const clePays = paysProposes?.join(\",\")\n const options = useMemo<OptionPays[]>(() => {\n const retenus = clePays ? new Set(clePays.split(\",\")) : undefined\n return retenus\n ? listePays().filter((option) => retenus.has(option.value))\n : listePays()\n }, [clePays])\n\n function emettre(texte: string, pays: CountryCode) {\n const numero = texte.trim() ? lire(texte, pays) : undefined\n // Un numéro international désigne son pays : la liste le suit.\n const paysRetenu =\n texte.trim().startsWith(\"+\") && numero?.country ? numero.country : pays\n // Un numéro incomplet n'a pas d'écriture E.164 fiable (« 06 1 » donnerait\n // « +33061 ») : on rend alors le texte tapé.\n const sortie = numero?.isPossible() ? numero.number : texte.trim()\n setEtat({ texte, pays: paysRetenu })\n setValeurVue(sortie)\n if (sortie !== valeur || paysRetenu !== etat.pays)\n onValeurChange(sortie, {\n valide: numero?.isValid() ?? false,\n pays: paysRetenu,\n })\n }\n\n return (\n <>\n <ButtonGroup className={className}>\n <Combobox<OptionPays>\n items={options}\n value={options.find((option) => option.value === etat.pays) ?? null}\n isItemEqualToValue={(a, b) => a.value === b.value}\n // La recherche surligne le premier pays trouvé : Entrée le choisit.\n autoHighlight\n onValueChange={(option) => {\n if (!option) return\n // Le numéro national prend l'écriture du nouveau pays (« 04 70 12\n // 34 56 » devient « 0470 12 34 56 » en Belgique) ; un numéro\n // international garde son pays, et sa saisie.\n const numero = etat.texte.trim().startsWith(\"+\")\n ? undefined\n : lire(etat.texte, option.value)\n emettre(\n numero?.isValid() ? numero.formatNational() : etat.texte,\n option.value\n )\n }}\n disabled={disabled}\n >\n <ComboboxTrigger\n render={\n // 16 px sous md comme le champ : pas de zoom d'iOS, ni de tailles\n // mêlées dans la ligne.\n <Button\n variant=\"outline\"\n aria-label=\"Pays\"\n className=\"text-base md:text-sm\"\n />\n }\n >\n <ComboboxValue>\n {(option: OptionPays | null) =>\n option\n ? `${drapeau(option.value)} +${getCountryCallingCode(option.value)}`\n : null\n }\n </ComboboxValue>\n </ComboboxTrigger>\n <ComboboxContent className=\"w-72\">\n <ComboboxInput\n showTrigger={false}\n placeholder=\"Pays ou indicatif\"\n aria-label=\"Rechercher un pays\"\n />\n <ComboboxEmpty>Aucun pays trouvé.</ComboboxEmpty>\n <ComboboxList>\n {(option: OptionPays) => (\n <ComboboxItem key={option.value} value={option}>\n <span aria-hidden=\"true\">{drapeau(option.value)}</span>\n {option.label}\n </ComboboxItem>\n )}\n </ComboboxList>\n </ComboboxContent>\n </Combobox>\n <Input\n type=\"tel\"\n inputMode=\"tel\"\n autoComplete=\"tel-national\"\n {...props}\n {...champ}\n form={form}\n // Le `aria-required` posé par FormField cède au vrai `required`.\n aria-required={undefined}\n disabled={disabled}\n placeholder={\n placeholder ??\n getExampleNumber(etat.pays, exemples)?.formatNational()\n }\n value={etat.texte}\n onChange={(event) => emettre(event.target.value, etat.pays)}\n onBlur={(event) => {\n const numero = lire(etat.texte, etat.pays)\n if (numero?.isValid())\n setEtat({ texte: numero.formatNational(), pays: etat.pays })\n onBlur?.(event)\n }}\n />\n </ButtonGroup>\n {/* Hors du ButtonGroup, dont les arrondis suivent :first-child et\n :last-child. */}\n {name ? (\n <input\n type=\"hidden\"\n name={name}\n form={form}\n disabled={disabled}\n value={valeur}\n />\n ) : null}\n </>\n )\n}\n"],"mappings":";;;;;;;;;;AA2DA,SAASG,EAAQ,GAAmB;CAClC,OAAO,OAAO,cACZ,GAAG,CAAC,GAAGC,CAAI,CAAC,CAAC,KAAK,MAAW,SAAUC,EAAO,WAAW,CAAC,IAAI,EAAE,CAClE;AACF;AAIA,IAAIC;AAEJ,SAASC,IAA0B;CACjC,IAAI,CAACD,GAAa;EAChB,IAAME,IAAO,IAAI,KAAK,aAAa,CAAC,IAAI,GAAG,EAAE,MAAM,SAAS,CAAC,GAGvDC,IAAQ,IAAI,KAAK,SAAS,IAAI;EACpC,IAAcC,EAAa,CAAC,CACzB,KAAK,OAAU;GAAE;GAAM,KAAKF,EAAK,GAAGG,CAAI,KAAKA;EAAK,EAAE,CAAC,CACrD,MAAM,GAAG,MAAMF,EAAM,QAAQG,EAAE,KAAKC,EAAE,GAAG,CAAC,CAAC,CAC3C,KAAK,EAAE,SAAM,cAAW;GACvB,OAAOF;GACP,OAAO,GAAGG,EAAI,IAAIC,EAAsBJ,CAAI;EAC9C,EAAE;CACN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CACE,kBAAC,QAAD;OAAM,eAAY;OAAQ,UAAAtC,EAAQsC,EAAO,KAAK;MAAQ,CAAA,GACrDA,EAAO,KACI;KAHK,GAAAA,EAAO,KAGZ,EAEJ,CAAA;IACC;GACT,CAAA,CAAA;EACV,CAAA,GAAA,kBAACe,GAAD;GACE,MAAK;GACL,WAAU;GACV,cAAa;GACb,GAAI7B;GACJ,GAAIC;GACE;GAEN,iBAAe,KAAA;GACL;GACV,aACE6B,KACAC,EAAiB3B,EAAK,MAAM7B,CAAQ,CAAC,EAAE,eAAe;GAExD,OAAO6B,EAAK;GACZ,WAAW,MAAUW,EAAQiB,EAAM,OAAO,OAAO5B,EAAK,IAAI;GAC1D,SAAS,MAAU;IACjB,IAAMX,IAASJ,EAAKe,EAAK,OAAOA,EAAK,IAAI;IAGzC,AAFIX,GAAQ,QAAQ,KAClBY,EAAQ;KAAE,OAAOZ,EAAO,eAAe;KAAG,MAAMW,EAAK;IAAK,CAAC,GAC7D6B,IAASD,CAAK;GAChB;EACD,CAAA,CACU;CAGZ,CAAA,GAAAE,IACC,kBAAC,SAAD;EACE,MAAK;EACC;EACA;EACI;EACV,OAAOxC;CACR,CAAA,IACC,IACJ,EAAA,CAAA;AAEN"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Ce que `QueryBoundary` lit d'une requête : le résultat de `useQuery` de
|
|
4
|
+
* TanStack Query convient tel quel. Décrit ici plutôt qu'importé, pour que
|
|
5
|
+
* la bibliothèque n'exige pas `@tanstack/react-query`, même pour ses types.
|
|
6
|
+
*/
|
|
7
|
+
export interface QueryBoundaryRequete<T> {
|
|
8
|
+
data: T | undefined;
|
|
9
|
+
error: unknown;
|
|
10
|
+
isError: boolean;
|
|
11
|
+
/** Premier chargement en cours (et non une requête désactivée). */
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
/** Requête en cours, premier chargement ou non : après « Réessayer »,
|
|
14
|
+
* le bandeau d'erreur reste en place, son bouton occupé, le temps de la
|
|
15
|
+
* nouvelle tentative (le focus n'est pas perdu). */
|
|
16
|
+
isFetching?: boolean;
|
|
17
|
+
refetch?: () => unknown;
|
|
18
|
+
}
|
|
19
|
+
export interface QueryBoundaryProps<T> {
|
|
20
|
+
requete: QueryBoundaryRequete<T>;
|
|
21
|
+
/** Rendu des données chargées. */
|
|
22
|
+
children: (donnees: T) => ReactNode;
|
|
23
|
+
/**
|
|
24
|
+
* Affiché quand les données sont vides : une chaîne devient le titre d'un
|
|
25
|
+
* `EmptyState` (icône de boîte vide), un nœud (un `EmptyState` avec une
|
|
26
|
+
* description et une action…) est rendu tel quel. Sans lui, pas d'état
|
|
27
|
+
* vide.
|
|
28
|
+
*/
|
|
29
|
+
vide?: ReactNode;
|
|
30
|
+
/** Les données sont-elles vides ? Par défaut : un tableau vide, ou un
|
|
31
|
+
* objet dont `items` est un tableau vide (réponse paginée). */
|
|
32
|
+
estVide?: (donnees: T) => boolean;
|
|
33
|
+
/** Pendant le chargement, à la forme du contenu ; des lignes par défaut. */
|
|
34
|
+
squelette?: ReactNode;
|
|
35
|
+
/** Force le chargement : requête qui attend encore son entrée (une
|
|
36
|
+
* requête désactivée n'est ni en cours ni chargée). */
|
|
37
|
+
enAttente?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Les quatre états d'une requête, partout pareils : squelette pendant le
|
|
41
|
+
* chargement, bandeau d'erreur avec « Réessayer », état vide, puis les
|
|
42
|
+
* données. La page n'écrit que le dernier.
|
|
43
|
+
*
|
|
44
|
+
* Aucune enveloppe : le bandeau et le contenu sont rendus directement dans
|
|
45
|
+
* le parent (grille, flex…), qui règle l'espacement (`flex flex-col gap-4`
|
|
46
|
+
* par exemple). Le bandeau occupe toujours la même place, avant le contenu
|
|
47
|
+
* (vide sans erreur) : l'échec d'une actualisation l'affiche au-dessus des
|
|
48
|
+
* données sans démonter celles-ci (saisie, sélection, défilement gardés).
|
|
49
|
+
*/
|
|
50
|
+
export declare function QueryBoundary<T>({ requete, children, vide, estVide, squelette, enAttente, }: QueryBoundaryProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { EmptyState as e } from "./empty-state.js";
|
|
2
|
+
import { ErrorBanner as t } from "./error-banner.js";
|
|
3
|
+
import { SkeletonTable as n } from "./loading.js";
|
|
4
|
+
import { Fragment as r, jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
5
|
+
import { InboxIcon as o } from "lucide-react";
|
|
6
|
+
// src/components/etic/query-boundary.tsx
|
|
7
|
+
function s(e) {
|
|
8
|
+
if (Array.isArray(e)) return e.length === 0;
|
|
9
|
+
let t = e?.items;
|
|
10
|
+
return Array.isArray(t) && t.length === 0;
|
|
11
|
+
}
|
|
12
|
+
function c({ requete: c, children: l, vide: u, estVide: d = s, squelette: f, enAttente: p = !1 }) {
|
|
13
|
+
let { data: m, refetch: h } = c, g = p || c.isLoading, _ = c.isError && !p ? /* @__PURE__ */ i(t, {
|
|
14
|
+
erreur: c.error,
|
|
15
|
+
onReessayer: h ? () => void h() : void 0,
|
|
16
|
+
enCours: !!c.isFetching
|
|
17
|
+
}) : null, v = null;
|
|
18
|
+
return g ? v = f ?? /* @__PURE__ */ i(n, {}) : m !== void 0 && (v = u !== void 0 && d(m) ? typeof u == "string" ? /* @__PURE__ */ i(e, {
|
|
19
|
+
titre: u,
|
|
20
|
+
icone: o
|
|
21
|
+
}) : u : l(m)), /* @__PURE__ */ a(r, { children: [_, v] });
|
|
22
|
+
}
|
|
23
|
+
export { c as QueryBoundary };
|
|
24
|
+
|
|
25
|
+
//# sourceMappingURL=query-boundary.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"query-boundary.js","names":["_Fragment","videParDefaut","donnees","items","QueryBoundary","requete","chargement","enAttente","erreur","ErrorBanner","refetch","contenu","squelette","SkeletonTable","data","vide","estVide","EmptyState","InboxIcon","children","Fragment"],"sources":["../../../src/components/etic/query-boundary.tsx"],"sourcesContent":["import type { ReactNode } from \"react\"\nimport { InboxIcon } from \"lucide-react\"\n\nimport { EmptyState } from \"@etic-ui/components/etic/empty-state\"\nimport { ErrorBanner } from \"@etic-ui/components/etic/error-banner\"\nimport { SkeletonTable } from \"@etic-ui/components/etic/loading\"\n\n/**\n * Ce que `QueryBoundary` lit d'une requête : le résultat de `useQuery` de\n * TanStack Query convient tel quel. Décrit ici plutôt qu'importé, pour que\n * la bibliothèque n'exige pas `@tanstack/react-query`, même pour ses types.\n */\nexport interface QueryBoundaryRequete<T> {\n data: T | undefined\n error: unknown\n isError: boolean\n /** Premier chargement en cours (et non une requête désactivée). */\n isLoading: boolean\n /** Requête en cours, premier chargement ou non : après « Réessayer »,\n * le bandeau d'erreur reste en place, son bouton occupé, le temps de la\n * nouvelle tentative (le focus n'est pas perdu). */\n isFetching?: boolean\n refetch?: () => unknown\n}\n\nexport interface QueryBoundaryProps<T> {\n requete: QueryBoundaryRequete<T>\n /** Rendu des données chargées. */\n children: (donnees: T) => ReactNode\n /**\n * Affiché quand les données sont vides : une chaîne devient le titre d'un\n * `EmptyState` (icône de boîte vide), un nœud (un `EmptyState` avec une\n * description et une action…) est rendu tel quel. Sans lui, pas d'état\n * vide.\n */\n vide?: ReactNode\n /** Les données sont-elles vides ? Par défaut : un tableau vide, ou un\n * objet dont `items` est un tableau vide (réponse paginée). */\n estVide?: (donnees: T) => boolean\n /** Pendant le chargement, à la forme du contenu ; des lignes par défaut. */\n squelette?: ReactNode\n /** Force le chargement : requête qui attend encore son entrée (une\n * requête désactivée n'est ni en cours ni chargée). */\n enAttente?: boolean\n}\n\nfunction videParDefaut(donnees: unknown) {\n if (Array.isArray(donnees)) return donnees.length === 0\n const items = (donnees as { items?: unknown } | null)?.items\n return Array.isArray(items) && items.length === 0\n}\n\n/**\n * Les quatre états d'une requête, partout pareils : squelette pendant le\n * chargement, bandeau d'erreur avec « Réessayer », état vide, puis les\n * données. La page n'écrit que le dernier.\n *\n * Aucune enveloppe : le bandeau et le contenu sont rendus directement dans\n * le parent (grille, flex…), qui règle l'espacement (`flex flex-col gap-4`\n * par exemple). Le bandeau occupe toujours la même place, avant le contenu\n * (vide sans erreur) : l'échec d'une actualisation l'affiche au-dessus des\n * données sans démonter celles-ci (saisie, sélection, défilement gardés).\n */\nexport function QueryBoundary<T>({\n requete,\n children,\n vide,\n estVide = videParDefaut,\n squelette,\n enAttente = false,\n}: QueryBoundaryProps<T>) {\n const { data, refetch } = requete\n const chargement = enAttente || requete.isLoading\n\n const erreur =\n requete.isError && !enAttente ? (\n <ErrorBanner\n erreur={requete.error}\n onReessayer={refetch ? () => void refetch() : undefined}\n enCours={!!requete.isFetching}\n />\n ) : null\n\n let contenu: ReactNode = null\n if (chargement) contenu = squelette ?? <SkeletonTable />\n else if (data !== undefined) {\n contenu =\n vide !== undefined && estVide(data) ? (\n typeof vide === \"string\" ? (\n <EmptyState titre={vide} icone={InboxIcon} />\n ) : (\n vide\n )\n ) : (\n children(data)\n )\n }\n\n // Deux places fixes : `null` garde celle du bandeau absent, si bien que le\n // contenu ne change pas de position (ni n'est remonté) quand il apparaît.\n return (\n <>\n {erreur}\n {contenu}\n </>\n )\n}\n"],"mappings":";;;;;;AA8CA,SAASC,EAAc,GAAkB;CACvC,IAAI,MAAM,QAAQC,CAAO,GAAG,OAAOA,EAAQ,WAAW;CACtD,IAAMC,IAASD,GAAwC;CACvD,OAAO,MAAM,QAAQC,CAAK,KAAKA,EAAM,WAAW;AAClD;AAaA,SAAgBC,EAAiB,EAC/B,YACA,aACA,SACA,aAAUH,GACV,cACA,eAAY,MACY;CACxB,IAAM,EAAE,SAAM,eAAYI,GACpBC,IAAaC,KAAaF,EAAQ,WAElCG,IACJH,EAAQ,WAAW,CAACE,IAClB,kBAACE,GAAD;EACE,QAAQJ,EAAQ;EAChB,aAAaK,UAAgB,KAAKA,EAAQ,IAAI,KAAA;EAC9C,SAAS,CAAC,CAACL,EAAQ;CACpB,CAAA,IACC,MAEFM,IAAqB;CAiBzB,OAhBIL,IAAY,IAAUM,KAAa,kBAACC,GAAD,CAAgB,CAAA,IAC9CC,MAAS,KAAA,MAChB,IACEC,MAAS,KAAA,KAAaC,EAAQF,CAAI,IAChC,OAAOC,KAAS,WACd,kBAACE,GAAD;EAAY,OAAOF;EAAM,OAAOG;CAAY,CAAA,IAE5CH,IAGFI,EAASL,CAAI,IAOjB,kBAAAd,GAAA,EAAA,UAAA,CACGQ,GACAG,CACD,EAAA,CAAA;AAEN"}
|