@egen-civitas/esm-styleguide 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -0
- package/dist/components/_general.scss +52 -15
- package/dist/components/_panel-overrides.scss +5 -7
- package/dist/internal.d.ts +1 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/internal.js +1 -0
- package/dist/public.d.ts +1 -0
- package/dist/public.d.ts.map +1 -1
- package/dist/public.js +1 -0
- package/dist/top-bar/index.d.ts +2 -0
- package/dist/top-bar/index.d.ts.map +1 -0
- package/dist/top-bar/index.js +1 -0
- package/dist/top-bar/top-bar.component.d.ts +58 -0
- package/dist/top-bar/top-bar.component.d.ts.map +1 -0
- package/dist/top-bar/top-bar.component.js +124 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @egen-civitas/esm-styleguide
|
|
2
2
|
|
|
3
|
+
## 1.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 9bb7f95: Layout du shell : le contenu défile dans `#egen-scroll-region` (sous la TopBar) au lieu de la fenêtre, donc il est coupé net à la frontière TopBar/body et ne passe plus derrière la barre. La TopBar a une hauteur automatique (niveau 1 + niveau 2) mesurée en direct par le shell (`layout-sync.ts`) dans `--egen-navbar-height`, ce qui décale correctement le début du contenu. Le pied de page défile avec le contenu. Impression inchangée.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 799d1a1: Le conteneur de la TopBar n'est plus redéfini dans `_panel-overrides.scss` (il écrasait le z-index/position du shell) ; le side-nav se cale sur `--egen-navbar-height` (hauteur mesurée, niveau 2 inclus).
|
|
12
|
+
|
|
13
|
+
## 1.2.0
|
|
14
|
+
|
|
15
|
+
### Minor Changes
|
|
16
|
+
|
|
17
|
+
- 321720c: feat(styleguide): ajoute `TopBar`, `TopBarIconButton`, `TopBarDivider`, `TopBarAvatar` (Tailwind, présentationnels, guide d'usage en commentaire). Le preset Tailwind scanne désormais le styleguide publié (`@source`) et expose l'échelle `error-*`.
|
|
18
|
+
|
|
3
19
|
## 1.1.0
|
|
4
20
|
|
|
5
21
|
### Minor Changes
|
|
@@ -19,11 +19,12 @@ html {
|
|
|
19
19
|
html[data-public-route='true'] {
|
|
20
20
|
#egen-top-nav-app-container {
|
|
21
21
|
height: 0 !important;
|
|
22
|
+
min-height: 0 !important;
|
|
22
23
|
overflow: hidden;
|
|
23
24
|
}
|
|
24
25
|
|
|
25
26
|
#egen-apps-container {
|
|
26
|
-
min-height:
|
|
27
|
+
min-height: 100%;
|
|
27
28
|
}
|
|
28
29
|
|
|
29
30
|
#egen-left-nav-container,
|
|
@@ -52,15 +53,30 @@ html[data-public-route='true'] {
|
|
|
52
53
|
}
|
|
53
54
|
}
|
|
54
55
|
|
|
56
|
+
// Zone de scroll : le contenu des apps + le pied de page défilent ICI (et non
|
|
57
|
+
// plus sur la fenêtre), dans la ligne de grille située SOUS la TopBar. Le
|
|
58
|
+
// contenu est ainsi coupé net à la frontière TopBar / body : on ne le voit
|
|
59
|
+
// jamais passer derrière la barre (même si celle-ci est transparente).
|
|
60
|
+
#egen-scroll-region {
|
|
61
|
+
grid-area: appRoots;
|
|
62
|
+
display: flex;
|
|
63
|
+
flex-direction: column;
|
|
64
|
+
min-width: 0;
|
|
65
|
+
min-height: 0;
|
|
66
|
+
overflow-x: hidden;
|
|
67
|
+
overflow-y: auto;
|
|
68
|
+
overscroll-behavior: contain;
|
|
69
|
+
// La ligne de grille définit la hauteur : la région ne dépasse jamais.
|
|
70
|
+
height: 100%;
|
|
71
|
+
}
|
|
72
|
+
|
|
55
73
|
#egen-apps-container {
|
|
56
74
|
display: flex;
|
|
57
75
|
flex-direction: column;
|
|
58
76
|
width: 100%;
|
|
59
|
-
|
|
60
|
-
height: fit-content;
|
|
61
|
-
grid-area: appRoots;
|
|
62
|
-
overflow-x: auto;
|
|
77
|
+
flex: 1 0 auto;
|
|
63
78
|
min-width: 0;
|
|
79
|
+
overflow-x: auto;
|
|
64
80
|
}
|
|
65
81
|
|
|
66
82
|
#egen-left-nav-container {
|
|
@@ -70,39 +86,59 @@ html[data-public-route='true'] {
|
|
|
70
86
|
#egen-workspaces-container {
|
|
71
87
|
grid-area: workspace;
|
|
72
88
|
position: sticky;
|
|
73
|
-
height:
|
|
74
|
-
|
|
89
|
+
height: 100%;
|
|
90
|
+
min-height: 0;
|
|
91
|
+
top: 0;
|
|
75
92
|
z-index: 1000;
|
|
76
93
|
will-change: contents;
|
|
77
94
|
}
|
|
78
95
|
|
|
96
|
+
// TopBar : hauteur AUTOMATIQUE (niveau 1 + niveau 2 inclus). La hauteur réelle
|
|
97
|
+
// est mesurée par le shell (layout-sync.ts) et publiée dans
|
|
98
|
+
// --egen-navbar-height ; 3rem n'est qu'un minimum avant le montage de la barre.
|
|
99
|
+
// Le contenu de la barre (menus déroulants) peut déborder vers le bas : elle
|
|
100
|
+
// est donc au-dessus de la zone de scroll (z-index) et n'est pas rognée.
|
|
79
101
|
#egen-top-nav-app-container {
|
|
80
102
|
grid-area: topNav;
|
|
81
|
-
|
|
103
|
+
position: relative;
|
|
104
|
+
z-index: 1100;
|
|
105
|
+
height: auto;
|
|
106
|
+
min-height: 3rem;
|
|
107
|
+
overflow: visible;
|
|
82
108
|
}
|
|
83
109
|
|
|
84
|
-
// Pied de page
|
|
85
|
-
// colonnes (leftNav/appRoots/workspace). Vide (0 hauteur) sur les routes
|
|
86
|
-
// publiques : la garde de routes de l'app footer y rend `null`.
|
|
110
|
+
// Pied de page : défile avec le contenu (il vit dans #egen-scroll-region).
|
|
87
111
|
#egen-footer-app-container {
|
|
88
|
-
|
|
112
|
+
flex: 0 0 auto;
|
|
89
113
|
width: 100%;
|
|
90
114
|
}
|
|
91
115
|
|
|
116
|
+
// Le corps occupe exactement la fenêtre : la page ne défile plus, c'est
|
|
117
|
+
// #egen-scroll-region qui défile (voir plus haut).
|
|
118
|
+
html {
|
|
119
|
+
height: 100%;
|
|
120
|
+
overflow: hidden;
|
|
121
|
+
}
|
|
122
|
+
|
|
92
123
|
body {
|
|
93
124
|
display: grid;
|
|
94
125
|
grid-template-areas:
|
|
95
126
|
'topNav topNav topNav'
|
|
96
|
-
'leftNav appRoots workspace'
|
|
97
|
-
'footer footer footer';
|
|
127
|
+
'leftNav appRoots workspace';
|
|
98
128
|
grid-template-columns: min-content 1fr min-content;
|
|
99
|
-
grid-template-rows:
|
|
129
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
130
|
+
height: 100vh;
|
|
131
|
+
height: 100dvh;
|
|
132
|
+
overflow: hidden;
|
|
100
133
|
container-type: inline-size;
|
|
101
134
|
}
|
|
102
135
|
|
|
103
136
|
@media print {
|
|
137
|
+
html,
|
|
104
138
|
body {
|
|
105
139
|
display: block;
|
|
140
|
+
height: auto;
|
|
141
|
+
overflow: visible;
|
|
106
142
|
container-type: normal;
|
|
107
143
|
}
|
|
108
144
|
|
|
@@ -113,6 +149,7 @@ body {
|
|
|
113
149
|
display: none;
|
|
114
150
|
}
|
|
115
151
|
|
|
152
|
+
#egen-scroll-region,
|
|
116
153
|
#egen-apps-container {
|
|
117
154
|
height: auto;
|
|
118
155
|
min-height: auto;
|
|
@@ -131,15 +131,13 @@
|
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
// ── Conteneurs spécifiques EGEN ───────────────────────────────────────────────
|
|
134
|
-
#egen-top-nav-app-container
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
z-index: var(--z-index-sticky);
|
|
138
|
-
}
|
|
134
|
+
// NB : le positionnement de #egen-top-nav-app-container (hauteur auto, z-index)
|
|
135
|
+
// est défini UNIQUEMENT dans _general.scss (zone de scroll du shell). Ne pas le
|
|
136
|
+
// redéfinir ici : ce fichier est chargé après et écraserait le z-index.
|
|
139
137
|
|
|
140
138
|
#egen-left-nav-container .cds--side-nav {
|
|
141
|
-
height: calc(
|
|
142
|
-
top: var(--
|
|
139
|
+
height: calc(100dvh - var(--egen-navbar-height));
|
|
140
|
+
top: var(--egen-navbar-height);
|
|
143
141
|
position: sticky;
|
|
144
142
|
}
|
|
145
143
|
|
package/dist/internal.d.ts
CHANGED
package/dist/internal.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal.d.ts","sourceRoot":"","sources":["../src/internal.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,kBAAkB,CAAC;AACjC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qCAAqC,CAAC;AACpD,cAAc,iCAAiC,CAAC;AAChD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,0BAA0B,CAAC;AACzC,cAAc,sDAAsD,CAAC;AACrE,cAAc,2CAA2C,CAAC;AAC1D,cAAc,oDAAoD,CAAC;AACnE,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,yBAAyB,CAAC;AACxC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,mCAAmC,CAAC;AAClD,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,uDAAuD,CAAC;AACtE,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCA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AAC;AACtE,cAAc,2BAA2B,CAAC;AAC1C,cAAc,mCAAmC,CAAC;AAClD,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC"}
|
package/dist/internal.js
CHANGED
package/dist/public.d.ts
CHANGED
package/dist/public.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../src/public.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjE,cAAc,kBAAkB,CAAC;AACjC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,8BAA8B,CAAC;AAC7C,cAAc,4BAA4B,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACxF,OAAO,EACL,KAAK,gCAAgC,EACrC,KAAK,0BAA0B,GAChC,MAAM,sDAAsD,CAAC;AAC9D,OAAO,EAAE,KAAK,sBAAsB,EAAE,KAAK,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACrH,cAAc,wBAAwB,CAAC;AACvC,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;AACnC,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC"}
|
package/dist/public.js
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/top-bar/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./top-bar.component.js";
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
/** @category TopBar */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface TopBarProps {
|
|
4
|
+
/** Zone gauche : hamburger, logo, recherche, sélecteur de contexte... */
|
|
5
|
+
left?: React.ReactNode;
|
|
6
|
+
/** Zone centrale : contenu libre (ex. `ExtensionSlot`). Masquée si vide. */
|
|
7
|
+
center?: React.ReactNode;
|
|
8
|
+
/** Zone droite : actions (`TopBarIconButton`), `TopBarDivider`, `TopBarAvatar`... */
|
|
9
|
+
right?: React.ReactNode;
|
|
10
|
+
/** Seconde ligne sous la barre (ex. fil d'Ariane). Masquée si absente. */
|
|
11
|
+
secondary?: React.ReactNode;
|
|
12
|
+
/** Élément enfant rendu à l'intérieur de la barre (ex. panneau latéral positionné en absolu). */
|
|
13
|
+
children?: React.ReactNode;
|
|
14
|
+
/** Colle la barre en haut de page. @default true */
|
|
15
|
+
sticky?: boolean;
|
|
16
|
+
/** Décalage `top` en sticky (ex. bannière hors-ligne). @default 'var(--own-offline-banner-height, 0px)' */
|
|
17
|
+
stickyOffset?: string;
|
|
18
|
+
/** Style visuel : `glass` (flou translucide) ou `solid` (fond plein). @default 'glass' */
|
|
19
|
+
variant?: 'glass' | 'solid';
|
|
20
|
+
/** Libellé accessible de la navigation. @default 'Navigation principale' */
|
|
21
|
+
ariaLabel?: string;
|
|
22
|
+
/** Classes Tailwind additionnelles sur la barre principale. */
|
|
23
|
+
className?: string;
|
|
24
|
+
/** Classes Tailwind additionnelles sur le conteneur racine. */
|
|
25
|
+
wrapperClassName?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* `TopBar` — barre supérieure en trois zones (gauche / centre / droite) avec
|
|
29
|
+
* seconde ligne optionnelle. Voir le guide d'utilisation en bas de fichier.
|
|
30
|
+
*/
|
|
31
|
+
export declare const TopBar: React.ForwardRefExoticComponent<TopBarProps & React.RefAttributes<HTMLElement>>;
|
|
32
|
+
export interface TopBarIconButtonProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
33
|
+
/** Icône (ex. composant Carbon `<Notification size={20} />`). */
|
|
34
|
+
icon: React.ReactNode;
|
|
35
|
+
/** Libellé accessible ET infobulle (obligatoire : le bouton n'a pas de texte). */
|
|
36
|
+
label: string;
|
|
37
|
+
/** Pastille de compteur (nombre ou texte). Masquée si `0`/vide. */
|
|
38
|
+
badge?: number | string;
|
|
39
|
+
/** Met le bouton en surbrillance (panneau ouvert). */
|
|
40
|
+
active?: boolean;
|
|
41
|
+
}
|
|
42
|
+
/** Bouton icône compact de la `TopBar`, avec pastille de compteur optionnelle. */
|
|
43
|
+
export declare const TopBarIconButton: React.ForwardRefExoticComponent<TopBarIconButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
44
|
+
/** Séparateur vertical fin entre deux groupes d'actions de la `TopBar`. */
|
|
45
|
+
export declare function TopBarDivider({ className }: {
|
|
46
|
+
className?: string;
|
|
47
|
+
}): React.JSX.Element;
|
|
48
|
+
export interface TopBarAvatarProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'children'> {
|
|
49
|
+
/** Image du profil. Si absente, les initiales sont affichées. */
|
|
50
|
+
src?: string;
|
|
51
|
+
/** Nom complet (libellé accessible + calcul des initiales). */
|
|
52
|
+
name: string;
|
|
53
|
+
/** Met l'avatar en surbrillance (panneau ouvert). */
|
|
54
|
+
active?: boolean;
|
|
55
|
+
}
|
|
56
|
+
/** Avatar rond cliquable de la `TopBar` (image ou initiales). */
|
|
57
|
+
export declare const TopBarAvatar: React.ForwardRefExoticComponent<TopBarAvatarProps & React.RefAttributes<HTMLButtonElement>>;
|
|
58
|
+
//# sourceMappingURL=top-bar.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"top-bar.component.d.ts","sourceRoot":"","sources":["../../src/top-bar/top-bar.component.tsx"],"names":[],"mappings":"AAAA,uBAAuB;AACvB,OAAO,KAAqB,MAAM,OAAO,CAAC;AAgB1C,MAAM,WAAW,WAAW;IAC1B,yEAAyE;IACzE,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,4EAA4E;IAC5E,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,qFAAqF;IACrF,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC5B,iGAAiG;IACjG,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,oDAAoD;IACpD,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,2GAA2G;IAC3G,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0FAA0F;IAC1F,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC;IAC5B,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+DAA+D;IAC/D,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;GAGG;AACH,eAAO,MAAM,MAAM,iFA4CjB,CAAC;AAEH,MAAM,WAAW,qBAAsB,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IAC5G,iEAAiE;IACjE,IAAI,EAAE,KAAK,CAAC,SAAS,CAAC;IACtB,kFAAkF;IAClF,KAAK,EAAE,MAAM,CAAC;IACd,mEAAmE;IACnE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,sDAAsD;IACtD,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,kFAAkF;AAClF,eAAO,MAAM,gBAAgB,iGA6B3B,CAAC;AAEH,2EAA2E;AAC3E,wBAAgB,aAAa,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,qBAElE;AAED,MAAM,WAAW,iBAAkB,SAAQ,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,UAAU,CAAC;IACxG,iEAAiE;IACjE,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,+DAA+D;IAC/D,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,iEAAiE;AACjE,eAAO,MAAM,YAAY,6FA4BvB,CAAC"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** @category TopBar */ import React, { forwardRef } from "react";
|
|
3
|
+
import { cn } from "../page-background/page-background.utils.js";
|
|
4
|
+
/**
|
|
5
|
+
* `TopBar` — barre supérieure en trois zones (gauche / centre / droite) avec
|
|
6
|
+
* seconde ligne optionnelle. Voir le guide d'utilisation en bas de fichier.
|
|
7
|
+
*/ export const TopBar = /*#__PURE__*/ forwardRef(function TopBar({ left, center, right, secondary, children, sticky = true, stickyOffset = 'var(--own-offline-banner-height, 0px)', variant = 'glass', ariaLabel = 'Navigation principale', className, wrapperClassName }, ref) {
|
|
8
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
9
|
+
className: cn('flex flex-col w-full z-(--z-index-sticky,200)', sticky && 'sticky', wrapperClassName),
|
|
10
|
+
style: sticky ? {
|
|
11
|
+
top: stickyOffset
|
|
12
|
+
} : undefined,
|
|
13
|
+
children: [
|
|
14
|
+
/*#__PURE__*/ _jsxs("header", {
|
|
15
|
+
ref: ref,
|
|
16
|
+
role: "banner",
|
|
17
|
+
"aria-label": ariaLabel,
|
|
18
|
+
className: cn('relative flex w-full items-center justify-between gap-2 px-3 sm:px-4 select-none', 'h-(--layout-header-height,48px) border-b', 'border-b-(--panel-header-border,rgba(255,255,255,0.08))', 'text-(--colors-surface-foreground,#f4f4f4)', variant === 'glass' ? 'bg-(--panel-header-background,rgba(11,25,44,0.72)) backdrop-blur-xl shadow-(--panel-header-box-shadow,0_1px_12px_rgba(0,0,0,0.25))' : 'bg-(--colors-surface-card,#0b192c) shadow-(--panel-header-box-shadow,none)', className),
|
|
19
|
+
children: [
|
|
20
|
+
/*#__PURE__*/ _jsx("div", {
|
|
21
|
+
className: "flex min-w-0 shrink-0 items-center gap-2",
|
|
22
|
+
children: left
|
|
23
|
+
}),
|
|
24
|
+
center ? /*#__PURE__*/ _jsx("div", {
|
|
25
|
+
className: "flex min-w-0 flex-1 items-center justify-center gap-2 px-2",
|
|
26
|
+
children: center
|
|
27
|
+
}) : null,
|
|
28
|
+
/*#__PURE__*/ _jsx("div", {
|
|
29
|
+
className: "flex shrink-0 items-center gap-1",
|
|
30
|
+
children: right
|
|
31
|
+
}),
|
|
32
|
+
children
|
|
33
|
+
]
|
|
34
|
+
}),
|
|
35
|
+
secondary ? /*#__PURE__*/ _jsx("div", {
|
|
36
|
+
className: "w-full",
|
|
37
|
+
children: secondary
|
|
38
|
+
}) : null
|
|
39
|
+
]
|
|
40
|
+
});
|
|
41
|
+
});
|
|
42
|
+
/** Bouton icône compact de la `TopBar`, avec pastille de compteur optionnelle. */ export const TopBarIconButton = /*#__PURE__*/ forwardRef(function TopBarIconButton({ icon, label, badge, active = false, className, type = 'button', ...rest }, ref) {
|
|
43
|
+
const showBadge = badge !== undefined && badge !== null && badge !== '' && badge !== 0;
|
|
44
|
+
return /*#__PURE__*/ _jsxs("button", {
|
|
45
|
+
ref: ref,
|
|
46
|
+
type: type,
|
|
47
|
+
title: label,
|
|
48
|
+
"aria-label": label,
|
|
49
|
+
"aria-pressed": active || undefined,
|
|
50
|
+
className: cn('relative inline-flex h-9 min-w-9 cursor-pointer items-center justify-center rounded-md border-0 p-0', 'bg-transparent text-inherit transition-colors duration-150 outline-none', 'hover:bg-white/10 focus-visible:ring-2 focus-visible:ring-primary-400', active && 'bg-primary-500/25 text-primary-200', className),
|
|
51
|
+
...rest,
|
|
52
|
+
children: [
|
|
53
|
+
icon,
|
|
54
|
+
showBadge ? /*#__PURE__*/ _jsx("span", {
|
|
55
|
+
className: "absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-full bg-error-500 px-1 text-[10px] font-bold leading-none text-white",
|
|
56
|
+
children: badge
|
|
57
|
+
}) : null
|
|
58
|
+
]
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
/** Séparateur vertical fin entre deux groupes d'actions de la `TopBar`. */ export function TopBarDivider({ className }) {
|
|
62
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
63
|
+
"aria-hidden": "true",
|
|
64
|
+
className: cn('mx-1 h-5 w-px bg-white/15', className)
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/** Avatar rond cliquable de la `TopBar` (image ou initiales). */ export const TopBarAvatar = /*#__PURE__*/ forwardRef(function TopBarAvatar({ src, name, active = false, className, type = 'button', ...rest }, ref) {
|
|
68
|
+
const initials = name.split(/\s+/).filter(Boolean).slice(0, 2).map((w)=>w[0]?.toUpperCase()).join('');
|
|
69
|
+
return /*#__PURE__*/ _jsx("button", {
|
|
70
|
+
ref: ref,
|
|
71
|
+
type: type,
|
|
72
|
+
title: name,
|
|
73
|
+
"aria-label": name,
|
|
74
|
+
className: cn('relative inline-flex h-8 w-8 cursor-pointer items-center justify-center overflow-hidden rounded-full p-0', 'border border-primary-400/50 bg-primary-900/40 text-xs font-bold text-white outline-none', 'transition-transform duration-150 hover:scale-105 focus-visible:ring-2 focus-visible:ring-primary-400', active && 'ring-2 ring-primary-400', className),
|
|
75
|
+
...rest,
|
|
76
|
+
children: src ? /*#__PURE__*/ _jsx("img", {
|
|
77
|
+
src: src,
|
|
78
|
+
alt: "",
|
|
79
|
+
className: "h-full w-full object-cover"
|
|
80
|
+
}) : initials
|
|
81
|
+
});
|
|
82
|
+
}); /* =============================================================================
|
|
83
|
+
* GUIDE D'UTILISATION — TopBar
|
|
84
|
+
* =============================================================================
|
|
85
|
+
* IMPORT
|
|
86
|
+
* import { TopBar, TopBarIconButton, TopBarDivider, TopBarAvatar } from '@egen-civitas/esm-framework';
|
|
87
|
+
*
|
|
88
|
+
* PRÉREQUIS TAILWIND (une fois par app, tout en haut de root.component.tsx)
|
|
89
|
+
* import '@egen-civitas/tailwind-preset/tailwind.tw.css';
|
|
90
|
+
* Le preset scanne aussi le styleguide publié (`@source`), donc les classes
|
|
91
|
+
* de ce composant sont générées sans configuration supplémentaire.
|
|
92
|
+
*
|
|
93
|
+
* EXEMPLE MINIMAL
|
|
94
|
+
* <TopBar
|
|
95
|
+
* left={<Logo />}
|
|
96
|
+
* right={
|
|
97
|
+
* <>
|
|
98
|
+
* <TopBarIconButton icon={<Search size={20} />} label="Rechercher" onClick={openSearch} />
|
|
99
|
+
* <TopBarIconButton icon={<Notification size={20} />} label="Notifications" badge={3} />
|
|
100
|
+
* <TopBarDivider />
|
|
101
|
+
* <TopBarAvatar name="Samuel Nzila" src={photoUrl} onClick={toggleUserPanel} />
|
|
102
|
+
* </>
|
|
103
|
+
* }
|
|
104
|
+
* />
|
|
105
|
+
*
|
|
106
|
+
* PROPS PRINCIPALES
|
|
107
|
+
* left / center / right contenu des trois zones (center masquée si vide)
|
|
108
|
+
* secondary seconde ligne (ex. <BreadcrumbNav />), masquée si absente
|
|
109
|
+
* children rendu DANS la <header> (ex. panneau latéral en position absolue)
|
|
110
|
+
* sticky / stickyOffset collage en haut de page (défaut : true, décalé par la bannière hors-ligne)
|
|
111
|
+
* variant 'glass' (défaut, flou translucide) | 'solid'
|
|
112
|
+
* ariaLabel libellé accessible de la navigation
|
|
113
|
+
* className classes Tailwind en plus sur la barre
|
|
114
|
+
* wrapperClassName classes Tailwind en plus sur le conteneur racine
|
|
115
|
+
*
|
|
116
|
+
* BONNES PRATIQUES
|
|
117
|
+
* - Garder la logique (session, tenant, panneaux) DANS l'app : la TopBar ne
|
|
118
|
+
* fait que disposer ce qu'on lui donne.
|
|
119
|
+
* - Toujours fournir `label` aux TopBarIconButton (accessibilité + infobulle).
|
|
120
|
+
* - Couleurs/hauteur : pilotées par le thème (--panel-header-*,
|
|
121
|
+
* --layout-header-height) ; ne pas les coder en dur.
|
|
122
|
+
* - Pour surcharger un style, ajouter des classes Tailwind via `className`
|
|
123
|
+
* (pas de `!` nécessaire : ce composant ne partage aucun sélecteur SCSS).
|
|
124
|
+
* ===========================================================================*/
|