@sentropic/design-system-vue 0.19.0 → 0.20.1
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/dist/AppHeader.d.ts +67 -0
- package/dist/AppHeader.d.ts.map +1 -0
- package/dist/AppHeader.js +95 -0
- package/dist/AppHeader.js.map +1 -0
- package/dist/Avatar.d.ts +1 -1
- package/dist/AvatarGroup.d.ts +1 -1
- package/dist/CopyButton.d.ts +1 -1
- package/dist/GaugeChart.d.ts +1 -1
- package/dist/IdentityMenu.d.ts +135 -0
- package/dist/IdentityMenu.d.ts.map +1 -0
- package/dist/IdentityMenu.js +235 -0
- package/dist/IdentityMenu.js.map +1 -0
- package/dist/KpiCard.d.ts +1 -1
- package/dist/LanguageToggle.d.ts +96 -0
- package/dist/LanguageToggle.d.ts.map +1 -0
- package/dist/LanguageToggle.js +83 -0
- package/dist/LanguageToggle.js.map +1 -0
- package/dist/NumberInput.d.ts +1 -1
- package/dist/ProgressBar.d.ts +1 -1
- package/dist/Rating.d.ts +1 -1
- package/dist/Slider.d.ts +1 -1
- package/dist/TimePicker.d.ts +1 -1
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/styles.css +367 -0
- package/package.json +1 -1
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
export type AppHeaderProps = {
|
|
2
|
+
compact?: boolean;
|
|
3
|
+
menuOpen?: boolean;
|
|
4
|
+
menuLabel?: string;
|
|
5
|
+
/**
|
|
6
|
+
* Id du tiroir, partagé entre `aria-controls` (burger) et `id` (drawer).
|
|
7
|
+
* Auto-généré et stable si non fourni.
|
|
8
|
+
*/
|
|
9
|
+
drawerId?: string;
|
|
10
|
+
class?: string;
|
|
11
|
+
};
|
|
12
|
+
export declare const AppHeader: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
13
|
+
compact: {
|
|
14
|
+
type: BooleanConstructor;
|
|
15
|
+
default: boolean;
|
|
16
|
+
};
|
|
17
|
+
menuOpen: {
|
|
18
|
+
type: BooleanConstructor;
|
|
19
|
+
default: boolean;
|
|
20
|
+
};
|
|
21
|
+
menuLabel: {
|
|
22
|
+
type: StringConstructor;
|
|
23
|
+
default: string;
|
|
24
|
+
};
|
|
25
|
+
drawerId: {
|
|
26
|
+
type: StringConstructor;
|
|
27
|
+
default: undefined;
|
|
28
|
+
};
|
|
29
|
+
class: {
|
|
30
|
+
type: StringConstructor;
|
|
31
|
+
default: undefined;
|
|
32
|
+
};
|
|
33
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
34
|
+
[key: string]: any;
|
|
35
|
+
}> | import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
36
|
+
[key: string]: any;
|
|
37
|
+
}>[], {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, "menuToggle"[], "menuToggle", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
38
|
+
compact: {
|
|
39
|
+
type: BooleanConstructor;
|
|
40
|
+
default: boolean;
|
|
41
|
+
};
|
|
42
|
+
menuOpen: {
|
|
43
|
+
type: BooleanConstructor;
|
|
44
|
+
default: boolean;
|
|
45
|
+
};
|
|
46
|
+
menuLabel: {
|
|
47
|
+
type: StringConstructor;
|
|
48
|
+
default: string;
|
|
49
|
+
};
|
|
50
|
+
drawerId: {
|
|
51
|
+
type: StringConstructor;
|
|
52
|
+
default: undefined;
|
|
53
|
+
};
|
|
54
|
+
class: {
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
default: undefined;
|
|
57
|
+
};
|
|
58
|
+
}>> & Readonly<{
|
|
59
|
+
onMenuToggle?: ((...args: any[]) => any) | undefined;
|
|
60
|
+
}>, {
|
|
61
|
+
class: string;
|
|
62
|
+
compact: boolean;
|
|
63
|
+
menuOpen: boolean;
|
|
64
|
+
menuLabel: string;
|
|
65
|
+
drawerId: string;
|
|
66
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
67
|
+
//# sourceMappingURL=AppHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppHeader.d.ts","sourceRoot":"","sources":["../src/AppHeader.ts"],"names":[],"mappings":"AAOA,MAAM,MAAM,cAAc,GAAG;IAC3B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAgDF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EAmEpB,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { defineComponent, h } from "vue";
|
|
2
|
+
import { classNames } from "./classNames.js";
|
|
3
|
+
// Compteur module pour générer un id de tiroir stable, déterministe et
|
|
4
|
+
// SSR-safe (pas de crypto). Aligné sur le pattern des 3 fw.
|
|
5
|
+
let appHeaderIdCounter = 0;
|
|
6
|
+
// Icônes lucide reproduites en SVG inline (mêmes paths que @lucide/svelte) pour
|
|
7
|
+
// conserver une parité stricte sans dépendance lucide-vue-next.
|
|
8
|
+
function MenuIcon() {
|
|
9
|
+
return h("svg", {
|
|
10
|
+
width: 20,
|
|
11
|
+
height: 20,
|
|
12
|
+
viewBox: "0 0 24 24",
|
|
13
|
+
fill: "none",
|
|
14
|
+
stroke: "currentColor",
|
|
15
|
+
"stroke-width": 2,
|
|
16
|
+
"stroke-linecap": "round",
|
|
17
|
+
"stroke-linejoin": "round",
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
focusable: "false",
|
|
20
|
+
class: "st-appHeader__burgerIcon",
|
|
21
|
+
}, [
|
|
22
|
+
h("path", { d: "M4 5h16" }),
|
|
23
|
+
h("path", { d: "M4 12h16" }),
|
|
24
|
+
h("path", { d: "M4 19h16" }),
|
|
25
|
+
]);
|
|
26
|
+
}
|
|
27
|
+
function XIcon() {
|
|
28
|
+
return h("svg", {
|
|
29
|
+
width: 20,
|
|
30
|
+
height: 20,
|
|
31
|
+
viewBox: "0 0 24 24",
|
|
32
|
+
fill: "none",
|
|
33
|
+
stroke: "currentColor",
|
|
34
|
+
"stroke-width": 2,
|
|
35
|
+
"stroke-linecap": "round",
|
|
36
|
+
"stroke-linejoin": "round",
|
|
37
|
+
"aria-hidden": "true",
|
|
38
|
+
focusable: "false",
|
|
39
|
+
class: "st-appHeader__burgerIcon",
|
|
40
|
+
}, [h("path", { d: "M18 6 6 18" }), h("path", { d: "m6 6 12 12" })]);
|
|
41
|
+
}
|
|
42
|
+
export const AppHeader = defineComponent({
|
|
43
|
+
name: "AppHeader",
|
|
44
|
+
props: {
|
|
45
|
+
compact: { type: Boolean, default: false },
|
|
46
|
+
menuOpen: { type: Boolean, default: false },
|
|
47
|
+
menuLabel: { type: String, default: "Menu" },
|
|
48
|
+
drawerId: { type: String, default: undefined },
|
|
49
|
+
class: { type: String, default: undefined },
|
|
50
|
+
},
|
|
51
|
+
emits: ["menuToggle"],
|
|
52
|
+
setup(props, { slots, emit }) {
|
|
53
|
+
const onToggle = () => emit("menuToggle");
|
|
54
|
+
// Id stable du tiroir : prop fournie sinon compteur module (SSR-safe).
|
|
55
|
+
const resolvedDrawerId = props.drawerId ?? `st-appHeader-drawer-${++appHeaderIdCounter}`;
|
|
56
|
+
return () => {
|
|
57
|
+
const bar = h("div", { class: "st-appHeader__bar" }, [
|
|
58
|
+
props.compact
|
|
59
|
+
? h("div", { class: "st-appHeader__burger" }, [
|
|
60
|
+
h("button", {
|
|
61
|
+
type: "button",
|
|
62
|
+
class: "st-appHeader__burgerButton",
|
|
63
|
+
"aria-label": props.menuLabel,
|
|
64
|
+
"aria-expanded": props.menuOpen ? "true" : "false",
|
|
65
|
+
"aria-controls": resolvedDrawerId,
|
|
66
|
+
"aria-haspopup": "menu",
|
|
67
|
+
onClick: onToggle,
|
|
68
|
+
}, [props.menuOpen ? XIcon() : MenuIcon()]),
|
|
69
|
+
])
|
|
70
|
+
: h("nav", { class: "st-appHeader__nav", "aria-label": "Primary" }, slots.nav?.()),
|
|
71
|
+
slots.logo
|
|
72
|
+
? h("div", { class: "st-appHeader__logo" }, slots.logo())
|
|
73
|
+
: null,
|
|
74
|
+
!props.compact
|
|
75
|
+
? h("div", { class: "st-appHeader__actions" }, slots.actions?.())
|
|
76
|
+
: null,
|
|
77
|
+
]);
|
|
78
|
+
const header = h("header", { class: classNames("st-appHeader", props.class) }, [bar]);
|
|
79
|
+
if (props.compact && props.menuOpen && slots.drawer) {
|
|
80
|
+
return [
|
|
81
|
+
header,
|
|
82
|
+
h("button", {
|
|
83
|
+
type: "button",
|
|
84
|
+
class: "st-appHeader__scrim",
|
|
85
|
+
"aria-label": props.menuLabel,
|
|
86
|
+
onClick: onToggle,
|
|
87
|
+
}),
|
|
88
|
+
h("aside", { id: resolvedDrawerId, class: "st-appHeader__drawer" }, slots.drawer()),
|
|
89
|
+
];
|
|
90
|
+
}
|
|
91
|
+
return header;
|
|
92
|
+
};
|
|
93
|
+
},
|
|
94
|
+
});
|
|
95
|
+
//# sourceMappingURL=AppHeader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppHeader.js","sourceRoot":"","sources":["../src/AppHeader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAE7C,uEAAuE;AACvE,4DAA4D;AAC5D,IAAI,kBAAkB,GAAG,CAAC,CAAC;AAc3B,gFAAgF;AAChF,gEAAgE;AAChE,SAAS,QAAQ;IACf,OAAO,CAAC,CACN,KAAK,EACL;QACE,KAAK,EAAE,EAAE;QACT,M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AAE,CACd;gBACL,KAAK,CAAC,IAAI;oBACR,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,oBAAoB,EAAE,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC;oBACzD,CAAC,CAAC,IAAI;gBACR,CAAC,KAAK,CAAC,OAAO;oBACZ,CAAC,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,uBAAuB,EAAE,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC;oBACjE,CAAC,CAAC,IAAI;aACT,CAAC,CAAC;YAEH,MAAM,MAAM,GAAG,CAAC,CACd,QAAQ,EACR,EAAE,KAAK,EAAE,UAAU,CAAC,cAAc,EAAE,KAAK,CAAC,KAAK,CAAC,EAAE,EAClD,CAAC,GAAG,CAAC,CACN,CAAC;YAEF,IAAI,KAAK,CAAC,OAAO,IAAI,KAAK,CAAC,QAAQ,IAAI,KAAK,CAAC,MAAM,EAAE,CAAC;gBACpD,OAAO;oBACL,MAAM;oBACN,CAAC,CAAC,QAAQ,EAAE;wBACV,IAAI,EAAE,QAAQ;wBACd,KAAK,EAAE,qBAAqB;wBAC5B,YAAY,EAAE,KAAK,CAAC,SAAS;wBAC7B,OAAO,EAAE,QAAQ;qBAClB,CAAC;oBACF,CAAC,CAAC,OAAO,EAAE,EAAE,EAAE,EAAE,gBAAgB,EAAE,KAAK,EAAE,sBAAsB,EAAE,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;iBACpF,CAAC;YACJ,CAAC;YAED,OAAO,MAAM,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
package/dist/Avatar.d.ts
CHANGED
|
@@ -77,9 +77,9 @@ export declare const Avatar: import("vue").DefineComponent<import("vue").Extract
|
|
|
77
77
|
}>> & Readonly<{}>, {
|
|
78
78
|
class: string;
|
|
79
79
|
tone: AvatarTone;
|
|
80
|
+
size: AvatarSize;
|
|
80
81
|
src: string;
|
|
81
82
|
alt: string;
|
|
82
|
-
size: AvatarSize;
|
|
83
83
|
shape: AvatarShape;
|
|
84
84
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
85
85
|
//# sourceMappingURL=Avatar.d.ts.map
|
package/dist/AvatarGroup.d.ts
CHANGED
|
@@ -46,8 +46,8 @@ export declare const AvatarGroup: import("vue").DefineComponent<import("vue").Ex
|
|
|
46
46
|
};
|
|
47
47
|
}>> & Readonly<{}>, {
|
|
48
48
|
class: string;
|
|
49
|
-
max: number;
|
|
50
49
|
size: AvatarSize;
|
|
50
|
+
max: number;
|
|
51
51
|
total: number;
|
|
52
52
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
53
53
|
//# sourceMappingURL=AvatarGroup.d.ts.map
|
package/dist/CopyButton.d.ts
CHANGED
|
@@ -64,8 +64,8 @@ export declare const CopyButton: import("vue").DefineComponent<import("vue").Ext
|
|
|
64
64
|
}>, {
|
|
65
65
|
class: string;
|
|
66
66
|
label: string;
|
|
67
|
-
text: string;
|
|
68
67
|
size: CopyButtonSize;
|
|
68
|
+
text: string;
|
|
69
69
|
value: string;
|
|
70
70
|
copiedLabel: string;
|
|
71
71
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
package/dist/GaugeChart.d.ts
CHANGED
|
@@ -121,9 +121,9 @@ export declare const GaugeChart: import("vue").DefineComponent<import("vue").Ext
|
|
|
121
121
|
}>> & Readonly<{}>, {
|
|
122
122
|
class: string;
|
|
123
123
|
label: string;
|
|
124
|
+
size: number;
|
|
124
125
|
min: number;
|
|
125
126
|
max: number;
|
|
126
|
-
size: number;
|
|
127
127
|
thickness: number;
|
|
128
128
|
thresholds: GaugeChartThreshold[];
|
|
129
129
|
format: GaugeChartFormat;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
export type IdentityUser = {
|
|
2
|
+
displayName: string;
|
|
3
|
+
email?: string;
|
|
4
|
+
id?: string;
|
|
5
|
+
};
|
|
6
|
+
export type IdentityMenuProps = {
|
|
7
|
+
user?: IdentityUser | null;
|
|
8
|
+
isAuthenticated?: boolean;
|
|
9
|
+
/**
|
|
10
|
+
* État ouvert du dropdown (optionnellement contrôlé). Si fourni, le parent
|
|
11
|
+
* contrôle ; sinon le composant gère un état interne. Aligné sur les 3 fw.
|
|
12
|
+
*/
|
|
13
|
+
open?: boolean;
|
|
14
|
+
devicesHref?: string;
|
|
15
|
+
settingsHref?: string;
|
|
16
|
+
loginLabel?: string;
|
|
17
|
+
devicesLabel?: string;
|
|
18
|
+
settingsLabel?: string;
|
|
19
|
+
logoutLabel?: string;
|
|
20
|
+
variant?: "dropdown" | "accordion";
|
|
21
|
+
class?: string;
|
|
22
|
+
};
|
|
23
|
+
/** Première lettre du displayName, en majuscule (calque de la source). */
|
|
24
|
+
export declare function identityInitial(user: IdentityUser | null | undefined): string;
|
|
25
|
+
export declare const IdentityMenu: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
26
|
+
user: {
|
|
27
|
+
type: () => IdentityUser | null;
|
|
28
|
+
default: null;
|
|
29
|
+
};
|
|
30
|
+
isAuthenticated: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
default: boolean;
|
|
33
|
+
};
|
|
34
|
+
open: {
|
|
35
|
+
type: BooleanConstructor;
|
|
36
|
+
default: undefined;
|
|
37
|
+
};
|
|
38
|
+
devicesHref: {
|
|
39
|
+
type: StringConstructor;
|
|
40
|
+
default: string;
|
|
41
|
+
};
|
|
42
|
+
settingsHref: {
|
|
43
|
+
type: StringConstructor;
|
|
44
|
+
default: string;
|
|
45
|
+
};
|
|
46
|
+
loginLabel: {
|
|
47
|
+
type: StringConstructor;
|
|
48
|
+
default: string;
|
|
49
|
+
};
|
|
50
|
+
devicesLabel: {
|
|
51
|
+
type: StringConstructor;
|
|
52
|
+
default: string;
|
|
53
|
+
};
|
|
54
|
+
settingsLabel: {
|
|
55
|
+
type: StringConstructor;
|
|
56
|
+
default: string;
|
|
57
|
+
};
|
|
58
|
+
logoutLabel: {
|
|
59
|
+
type: StringConstructor;
|
|
60
|
+
default: string;
|
|
61
|
+
};
|
|
62
|
+
variant: {
|
|
63
|
+
type: () => "dropdown" | "accordion";
|
|
64
|
+
default: string;
|
|
65
|
+
};
|
|
66
|
+
class: {
|
|
67
|
+
type: StringConstructor;
|
|
68
|
+
default: undefined;
|
|
69
|
+
};
|
|
70
|
+
}>, () => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
71
|
+
[key: string]: any;
|
|
72
|
+
}>, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("update:open" | "login" | "logout" | "openChange")[], "update:open" | "login" | "logout" | "openChange", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
73
|
+
user: {
|
|
74
|
+
type: () => IdentityUser | null;
|
|
75
|
+
default: null;
|
|
76
|
+
};
|
|
77
|
+
isAuthenticated: {
|
|
78
|
+
type: BooleanConstructor;
|
|
79
|
+
default: boolean;
|
|
80
|
+
};
|
|
81
|
+
open: {
|
|
82
|
+
type: BooleanConstructor;
|
|
83
|
+
default: undefined;
|
|
84
|
+
};
|
|
85
|
+
devicesHref: {
|
|
86
|
+
type: StringConstructor;
|
|
87
|
+
default: string;
|
|
88
|
+
};
|
|
89
|
+
settingsHref: {
|
|
90
|
+
type: StringConstructor;
|
|
91
|
+
default: string;
|
|
92
|
+
};
|
|
93
|
+
loginLabel: {
|
|
94
|
+
type: StringConstructor;
|
|
95
|
+
default: string;
|
|
96
|
+
};
|
|
97
|
+
devicesLabel: {
|
|
98
|
+
type: StringConstructor;
|
|
99
|
+
default: string;
|
|
100
|
+
};
|
|
101
|
+
settingsLabel: {
|
|
102
|
+
type: StringConstructor;
|
|
103
|
+
default: string;
|
|
104
|
+
};
|
|
105
|
+
logoutLabel: {
|
|
106
|
+
type: StringConstructor;
|
|
107
|
+
default: string;
|
|
108
|
+
};
|
|
109
|
+
variant: {
|
|
110
|
+
type: () => "dropdown" | "accordion";
|
|
111
|
+
default: string;
|
|
112
|
+
};
|
|
113
|
+
class: {
|
|
114
|
+
type: StringConstructor;
|
|
115
|
+
default: undefined;
|
|
116
|
+
};
|
|
117
|
+
}>> & Readonly<{
|
|
118
|
+
"onUpdate:open"?: ((...args: any[]) => any) | undefined;
|
|
119
|
+
onLogin?: ((...args: any[]) => any) | undefined;
|
|
120
|
+
onLogout?: ((...args: any[]) => any) | undefined;
|
|
121
|
+
onOpenChange?: ((...args: any[]) => any) | undefined;
|
|
122
|
+
}>, {
|
|
123
|
+
open: boolean;
|
|
124
|
+
class: string;
|
|
125
|
+
variant: "accordion" | "dropdown";
|
|
126
|
+
user: IdentityUser | null;
|
|
127
|
+
isAuthenticated: boolean;
|
|
128
|
+
devicesHref: string;
|
|
129
|
+
settingsHref: string;
|
|
130
|
+
loginLabel: string;
|
|
131
|
+
devicesLabel: string;
|
|
132
|
+
settingsLabel: string;
|
|
133
|
+
logoutLabel: string;
|
|
134
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
135
|
+
//# sourceMappingURL=IdentityMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentityMenu.d.ts","sourceRoot":"","sources":["../src/IdentityMenu.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,YAAY,GAAG;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,EAAE,CAAC,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,CAAC,EAAE,YAAY,GAAG,IAAI,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;OAGG;IACH,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,UAAU,GAAG,WAAW,CAAC;IACnC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAG7E;AAyBD,eAAO,MAAM,YAAY;;cAGG,MAAM,YAAY,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAUtB,MAAM,UAAU,GAAG,WAAW;;;;;;;;;;;cAVjC,MAAM,YAAY,GAAG,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAUtB,MAAM,UAAU,GAAG,WAAW;;;;;;;;;;;;;;;;;;;;;;;;4EA0O3D,CAAC"}
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { computed, defineComponent, h, nextTick, onBeforeUnmount, ref, watch } from "vue";
|
|
2
|
+
import { classNames } from "./classNames.js";
|
|
3
|
+
/** Première lettre du displayName, en majuscule (calque de la source). */
|
|
4
|
+
export function identityInitial(user) {
|
|
5
|
+
const source = user?.displayName || user?.email || "U";
|
|
6
|
+
return source.charAt(0).toUpperCase();
|
|
7
|
+
}
|
|
8
|
+
function ChevronDownIcon(open) {
|
|
9
|
+
return h("svg", {
|
|
10
|
+
width: 16,
|
|
11
|
+
height: 16,
|
|
12
|
+
viewBox: "0 0 24 24",
|
|
13
|
+
fill: "none",
|
|
14
|
+
stroke: "currentColor",
|
|
15
|
+
"stroke-width": 2,
|
|
16
|
+
"stroke-linecap": "round",
|
|
17
|
+
"stroke-linejoin": "round",
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
focusable: "false",
|
|
20
|
+
class: classNames("st-identityMenu__chevron", open && "st-identityMenu__chevron--open"),
|
|
21
|
+
}, [h("path", { d: "m6 9 6 6 6-6" })]);
|
|
22
|
+
}
|
|
23
|
+
export const IdentityMenu = defineComponent({
|
|
24
|
+
name: "IdentityMenu",
|
|
25
|
+
props: {
|
|
26
|
+
user: { type: Object, default: null },
|
|
27
|
+
isAuthenticated: { type: Boolean, default: false },
|
|
28
|
+
// `default: undefined` permet de distinguer contrôlé / non-contrôlé.
|
|
29
|
+
open: { type: Boolean, default: undefined },
|
|
30
|
+
devicesHref: { type: String, default: "#" },
|
|
31
|
+
settingsHref: { type: String, default: "#" },
|
|
32
|
+
loginLabel: { type: String, default: "Se connecter" },
|
|
33
|
+
devicesLabel: { type: String, default: "Appareils" },
|
|
34
|
+
settingsLabel: { type: String, default: "Paramètres" },
|
|
35
|
+
logoutLabel: { type: String, default: "Se déconnecter" },
|
|
36
|
+
variant: { type: String, default: "dropdown" },
|
|
37
|
+
class: { type: String, default: undefined },
|
|
38
|
+
},
|
|
39
|
+
// `openChange` notifie le parent (pattern contrôlé/non-contrôlé, aligné 3 fw).
|
|
40
|
+
// `update:open` permet aussi un v-model:open idiomatique côté Vue.
|
|
41
|
+
emits: ["login", "logout", "openChange", "update:open"],
|
|
42
|
+
setup(props, { emit }) {
|
|
43
|
+
// Pattern contrôlé/non-contrôlé, IDENTIQUE aux 3 fw : si `open` est fourni
|
|
44
|
+
// en prop, le parent contrôle ; sinon un état interne prend le relais.
|
|
45
|
+
const internalOpen = ref(false);
|
|
46
|
+
const isOpen = computed(() => (props.open === undefined ? internalOpen.value : props.open));
|
|
47
|
+
const setOpen = (next) => {
|
|
48
|
+
if (props.open === undefined)
|
|
49
|
+
internalOpen.value = next;
|
|
50
|
+
emit("openChange", next);
|
|
51
|
+
emit("update:open", next);
|
|
52
|
+
};
|
|
53
|
+
const rootEl = ref(null);
|
|
54
|
+
const triggerEl = ref(null);
|
|
55
|
+
// Quel item focuser à la prochaine ouverture : "first" (défaut) ou "last".
|
|
56
|
+
let pendingFocus = "first";
|
|
57
|
+
const onPointerDown = (event) => {
|
|
58
|
+
const target = event.target;
|
|
59
|
+
if (isOpen.value && rootEl.value && target && !rootEl.value.contains(target)) {
|
|
60
|
+
// Clic extérieur : ferme ET restaure le focus sur le trigger.
|
|
61
|
+
setOpen(false);
|
|
62
|
+
triggerEl.value?.focus();
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
watch(isOpen, (value) => {
|
|
66
|
+
if (value) {
|
|
67
|
+
document.addEventListener("pointerdown", onPointerDown);
|
|
68
|
+
// À l'ouverture : focus le 1er item (ou le dernier sur ArrowUp).
|
|
69
|
+
const which = pendingFocus;
|
|
70
|
+
void nextTick(() => focusItem(which === "last" ? -1 : 0));
|
|
71
|
+
pendingFocus = "first";
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
document.removeEventListener("pointerdown", onPointerDown);
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
onBeforeUnmount(() => document.removeEventListener("pointerdown", onPointerDown));
|
|
78
|
+
const getItems = () => Array.from(rootEl.value?.querySelectorAll('[role="menuitem"]') ?? []);
|
|
79
|
+
const focusItem = (index) => {
|
|
80
|
+
const items = getItems();
|
|
81
|
+
if (!items.length)
|
|
82
|
+
return;
|
|
83
|
+
const len = items.length;
|
|
84
|
+
items[((index % len) + len) % len]?.focus();
|
|
85
|
+
};
|
|
86
|
+
const closeAndFocusTrigger = () => {
|
|
87
|
+
setOpen(false);
|
|
88
|
+
triggerEl.value?.focus();
|
|
89
|
+
};
|
|
90
|
+
const onTriggerKeyDown = (event) => {
|
|
91
|
+
if (event.key === "ArrowDown" || event.key === "Enter" || event.key === " ") {
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
pendingFocus = "first";
|
|
94
|
+
if (isOpen.value)
|
|
95
|
+
void nextTick(() => focusItem(0));
|
|
96
|
+
else
|
|
97
|
+
setOpen(true);
|
|
98
|
+
}
|
|
99
|
+
else if (event.key === "ArrowUp") {
|
|
100
|
+
event.preventDefault();
|
|
101
|
+
pendingFocus = "last";
|
|
102
|
+
if (isOpen.value)
|
|
103
|
+
void nextTick(() => focusItem(-1));
|
|
104
|
+
else
|
|
105
|
+
setOpen(true);
|
|
106
|
+
}
|
|
107
|
+
else if (event.key === "Escape" && isOpen.value) {
|
|
108
|
+
// Esc ferme aussi depuis le trigger (global au composant ouvert).
|
|
109
|
+
event.preventDefault();
|
|
110
|
+
closeAndFocusTrigger();
|
|
111
|
+
}
|
|
112
|
+
};
|
|
113
|
+
const onMenuKeyDown = (event) => {
|
|
114
|
+
const items = getItems();
|
|
115
|
+
const current = items.indexOf(document.activeElement);
|
|
116
|
+
if (event.key === "ArrowDown") {
|
|
117
|
+
event.preventDefault();
|
|
118
|
+
focusItem(current + 1);
|
|
119
|
+
}
|
|
120
|
+
else if (event.key === "ArrowUp") {
|
|
121
|
+
event.preventDefault();
|
|
122
|
+
focusItem(current - 1);
|
|
123
|
+
}
|
|
124
|
+
else if (event.key === "Home") {
|
|
125
|
+
event.preventDefault();
|
|
126
|
+
focusItem(0);
|
|
127
|
+
}
|
|
128
|
+
else if (event.key === "End") {
|
|
129
|
+
event.preventDefault();
|
|
130
|
+
focusItem(items.length - 1);
|
|
131
|
+
}
|
|
132
|
+
else if (event.key === "Tab") {
|
|
133
|
+
// Piège de focus : Tab/Shift+Tab bouclent DANS le menu.
|
|
134
|
+
if (!items.length)
|
|
135
|
+
return;
|
|
136
|
+
event.preventDefault();
|
|
137
|
+
focusItem(current + (event.shiftKey ? -1 : 1));
|
|
138
|
+
}
|
|
139
|
+
else if (event.key === "Escape") {
|
|
140
|
+
event.preventDefault();
|
|
141
|
+
closeAndFocusTrigger();
|
|
142
|
+
}
|
|
143
|
+
};
|
|
144
|
+
// Enter/Space activent l'item courant. Sur un <a>, on suit le href via un
|
|
145
|
+
// clic natif (preventDefault sur Space pour éviter le scroll).
|
|
146
|
+
const onItemKeyDown = (event) => {
|
|
147
|
+
if (event.key === "Enter" || event.key === " ") {
|
|
148
|
+
event.preventDefault();
|
|
149
|
+
event.currentTarget.click();
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
const selectAndClose = () => {
|
|
153
|
+
setOpen(false);
|
|
154
|
+
triggerEl.value?.focus();
|
|
155
|
+
};
|
|
156
|
+
return () => {
|
|
157
|
+
const user = props.user;
|
|
158
|
+
if (!(props.isAuthenticated && user)) {
|
|
159
|
+
return h("button", {
|
|
160
|
+
type: "button",
|
|
161
|
+
class: classNames("st-identityMenu__login", props.variant === "accordion" && "st-identityMenu__login--accordion", props.class),
|
|
162
|
+
onClick: () => emit("login"),
|
|
163
|
+
}, props.loginLabel);
|
|
164
|
+
}
|
|
165
|
+
const displayName = user.displayName || user.email || "User";
|
|
166
|
+
return h("div", {
|
|
167
|
+
ref: rootEl,
|
|
168
|
+
class: classNames("st-identityMenu", props.variant === "accordion" && "st-identityMenu--accordion", props.class),
|
|
169
|
+
}, [
|
|
170
|
+
h("button", {
|
|
171
|
+
type: "button",
|
|
172
|
+
ref: triggerEl,
|
|
173
|
+
class: "st-identityMenu__trigger",
|
|
174
|
+
"aria-haspopup": "menu",
|
|
175
|
+
"aria-expanded": isOpen.value ? "true" : "false",
|
|
176
|
+
"aria-label": `Compte de ${displayName}`,
|
|
177
|
+
onClick: () => setOpen(!isOpen.value),
|
|
178
|
+
onKeydown: onTriggerKeyDown,
|
|
179
|
+
}, [
|
|
180
|
+
h("span", { class: "st-identityMenu__avatar", "aria-hidden": "true" }, identityInitial(user)),
|
|
181
|
+
h("span", { class: "st-identityMenu__meta" }, [
|
|
182
|
+
h("span", { class: "st-identityMenu__name" }, displayName),
|
|
183
|
+
props.variant === "accordion" && user.email
|
|
184
|
+
? h("span", { class: "st-identityMenu__email" }, user.email)
|
|
185
|
+
: null,
|
|
186
|
+
]),
|
|
187
|
+
ChevronDownIcon(isOpen.value),
|
|
188
|
+
]),
|
|
189
|
+
isOpen.value
|
|
190
|
+
? h("div", {
|
|
191
|
+
class: "st-identityMenu__menu",
|
|
192
|
+
role: "menu",
|
|
193
|
+
tabindex: "-1",
|
|
194
|
+
"aria-label": `Menu de ${displayName}`,
|
|
195
|
+
onKeydown: onMenuKeyDown,
|
|
196
|
+
}, [
|
|
197
|
+
h("a", {
|
|
198
|
+
href: props.devicesHref,
|
|
199
|
+
class: "st-identityMenu__item",
|
|
200
|
+
role: "menuitem",
|
|
201
|
+
tabindex: "-1",
|
|
202
|
+
onClick: selectAndClose,
|
|
203
|
+
onKeydown: onItemKeyDown,
|
|
204
|
+
}, props.devicesLabel),
|
|
205
|
+
h("a", {
|
|
206
|
+
href: props.settingsHref,
|
|
207
|
+
class: "st-identityMenu__item",
|
|
208
|
+
role: "menuitem",
|
|
209
|
+
tabindex: "-1",
|
|
210
|
+
onClick: selectAndClose,
|
|
211
|
+
onKeydown: onItemKeyDown,
|
|
212
|
+
}, props.settingsLabel),
|
|
213
|
+
h("div", {
|
|
214
|
+
class: "st-identityMenu__divider",
|
|
215
|
+
role: "separator",
|
|
216
|
+
"aria-hidden": "true",
|
|
217
|
+
}),
|
|
218
|
+
h("button", {
|
|
219
|
+
type: "button",
|
|
220
|
+
class: "st-identityMenu__item st-identityMenu__item--danger",
|
|
221
|
+
role: "menuitem",
|
|
222
|
+
tabindex: "-1",
|
|
223
|
+
onClick: () => {
|
|
224
|
+
setOpen(false);
|
|
225
|
+
triggerEl.value?.focus();
|
|
226
|
+
emit("logout");
|
|
227
|
+
},
|
|
228
|
+
}, props.logoutLabel),
|
|
229
|
+
])
|
|
230
|
+
: null,
|
|
231
|
+
]);
|
|
232
|
+
};
|
|
233
|
+
},
|
|
234
|
+
});
|
|
235
|
+
//# sourceMappingURL=IdentityMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdentityMenu.js","sourceRoot":"","sources":["../src/IdentityMenu.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,eAAe,EAAE,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,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,QAAQ,EAAE,IAAI;4BACd,OAAO,EAAE,cAAc;4BACvB,SAAS,EAAE,aAAa;yBACzB,EACD,KAAK,CAAC,YAAY,CACnB;wBACD,CAAC,CACC,GAAG,EACH;4BACE,IAAI,EAAE,KAAK,CAAC,YAAY;4BACxB,KAAK,EAAE,uBAAuB;4BAC9B,IAAI,EAAE,UAAU;4BAChB,QAAQ,EAAE,IAAI;4BACd,OAAO,EAAE,cAAc;4BACvB,SAAS,EAAE,aAAa;yBACzB,EACD,KAAK,CAAC,aAAa,CACpB;wBACD,CAAC,CAAC,KAAK,EAAE;4BACP,KAAK,EAAE,0BAA0B;4BACjC,IAAI,EAAE,WAAW;4BACjB,aAAa,EAAE,MAAM;yBACtB,CAAC;wBACF,CAAC,CACC,QAAQ,EACR;4BACE,IAAI,EAAE,QAAQ;4BACd,KAAK,EAAE,qDAAqD;4BAC5D,IAAI,EAAE,UAAU;4BAChB,QAAQ,EAAE,IAAI;4BACd,OAAO,EAAE,GAAG,EAAE;gCACZ,OAAO,CAAC,KAAK,CAAC,CAAC;gCACf,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,CAAC;gCACzB,IAAI,CAAC,QAAQ,CAAC,CAAC;4BACjB,CAAC;yBACF,EACD,KAAK,CAAC,WAAW,CAClB;qBACF,CACF;oBACH,CAAC,CAAC,IAAI;aACT,CACF,CAAC;QACJ,CAAC,CAAC;IACJ,CAAC;CACF,CAAC,CAAC"}
|
package/dist/KpiCard.d.ts
CHANGED
|
@@ -138,8 +138,8 @@ export declare const KpiCard: import("vue").DefineComponent<import("vue").Extrac
|
|
|
138
138
|
}>> & Readonly<{}>, {
|
|
139
139
|
class: string;
|
|
140
140
|
tone: KpiCardTone;
|
|
141
|
-
locale: string;
|
|
142
141
|
size: KpiCardSize;
|
|
142
|
+
locale: string;
|
|
143
143
|
format: KpiCardFormat;
|
|
144
144
|
unit: string;
|
|
145
145
|
currency: string;
|