@egen-civitas/esm-styleguide 1.1.0 → 1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @egen-civitas/esm-styleguide
2
2
 
3
+ ## 1.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 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-*`.
8
+
3
9
  ## 1.1.0
4
10
 
5
11
  ### Minor Changes
@@ -43,4 +43,5 @@ export * from './selections/index.js';
43
43
  export * from './carousel/index.js';
44
44
  export * from './content-section/index.js';
45
45
  export * from './hero-mosaic/index.js';
46
+ export * from './top-bar/index.js';
46
47
  //# sourceMappingURL=internal.d.ts.map
@@ -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;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BAA4B,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,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
@@ -43,3 +43,4 @@ export * from "./selections/index.js";
43
43
  export * from "./carousel/index.js";
44
44
  export * from "./content-section/index.js";
45
45
  export * from "./hero-mosaic/index.js";
46
+ export * from "./top-bar/index.js";
package/dist/public.d.ts CHANGED
@@ -38,4 +38,5 @@ export * from './selections/index.js';
38
38
  export * from './carousel/index.js';
39
39
  export * from './content-section/index.js';
40
40
  export * from './hero-mosaic/index.js';
41
+ export * from './top-bar/index.js';
41
42
  //# sourceMappingURL=public.d.ts.map
@@ -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,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YAAY,EAAE,KAAK,kBAAkB,EAAE,KAAK,YAAY,EAAE,KAAK,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACnH,OAAO,EACL,SAAS,EACT,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,SAAS,EACd,KAAK,YAAY,EACjB,KAAK,qBAAqB,GAC3B,MAAM,mBAAmB,CAAC;AAC3B,cAAc,wBAAwB,CAAC;AACvC,OAAO,EACL,gBAAgB,EAChB,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,EAC5B,oBAAoB,EACpB,iBAAiB,EACjB,UAAU,EACV,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,GAC/B,MAAM,wBAAwB,CAAC;AAChC,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/public.js CHANGED
@@ -35,3 +35,4 @@ export * from "./selections/index.js";
35
35
  export * from "./carousel/index.js";
36
36
  export * from "./content-section/index.js";
37
37
  export * from "./hero-mosaic/index.js";
38
+ export * from "./top-bar/index.js";
@@ -0,0 +1,2 @@
1
+ export * from './top-bar.component.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -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
+ * ===========================================================================*/
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@egen-civitas/esm-styleguide",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "license": "MPL-2.0",
5
5
  "description": "The styleguide for Egen SPA",
6
6
  "main": "dist/internal.js",