@egen-civitas/esm-styleguide 1.16.0 → 1.17.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 +14 -0
- package/dist/content-section/content-section.component.d.ts +4 -0
- package/dist/content-section/content-section.component.d.ts.map +1 -1
- package/dist/content-section/content-section.component.js +4 -0
- package/dist/public.d.ts +1 -0
- package/dist/public.d.ts.map +1 -1
- package/dist/public.js +1 -0
- package/dist/section/index.d.ts +6 -0
- package/dist/section/index.d.ts.map +1 -0
- package/dist/section/index.js +5 -0
- package/dist/section/section-action.component.d.ts +31 -0
- package/dist/section/section-action.component.d.ts.map +1 -0
- package/dist/section/section-action.component.js +51 -0
- package/dist/section/section-grid.component.d.ts +38 -0
- package/dist/section/section-grid.component.d.ts.map +1 -0
- package/dist/section/section-grid.component.js +50 -0
- package/dist/section/section-parts.component.d.ts +14 -0
- package/dist/section/section-parts.component.d.ts.map +1 -0
- package/dist/section/section-parts.component.js +228 -0
- package/dist/section/section.component.d.ts +22 -0
- package/dist/section/section.component.d.ts.map +1 -0
- package/dist/section/section.component.js +192 -0
- package/dist/section/section.context.d.ts +21 -0
- package/dist/section/section.context.d.ts.map +1 -0
- package/dist/section/section.context.js +21 -0
- package/dist/section/section.types.d.ts +140 -0
- package/dist/section/section.types.d.ts.map +1 -0
- package/dist/section/section.types.js +1 -0
- package/dist/workbench/tool-window-rail.component.d.ts +1 -1
- package/dist/workbench/tool-window-rail.component.d.ts.map +1 -1
- package/dist/workbench/tool-window-rail.component.js +19 -8
- package/dist/workbench/use-tool-windows.d.ts +2 -1
- package/dist/workbench/use-tool-windows.d.ts.map +1 -1
- package/dist/workbench/use-tool-windows.js +5 -3
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @egen-civitas/esm-styleguide
|
|
2
2
|
|
|
3
|
+
## 1.17.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 0978f93: Rails : le rail droit porte aussi un groupe bas ; `ToolWindowMeta.rail` ('left' par défaut | 'right') choisit le rail d'une option de la zone basse (pleine largeur entre les rails).
|
|
8
|
+
- 5e15585: Ajout du squelette `Section` (Tailwind) : en-tête / corps / pied séparés par un trait fin sans bordure ni fond, dispositions configurables (`headerLayout`, `footerLayout`), repli optionnel, `classNames` par partie et variables CSS `--section-*`. Livré avec `SectionAction` (boutons de contrôle / filtres) et `SectionGrid` (grille responsive par colonnes ou par largeur minimale de carte). `ContentSection` est conservé et marqué `@deprecated`.
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies [0978f93]
|
|
13
|
+
- Updated dependencies [ac88343]
|
|
14
|
+
- @egen-civitas/esm-extensions@1.5.0
|
|
15
|
+
- @egen-civitas/esm-globals@1.0.3
|
|
16
|
+
|
|
3
17
|
## 1.16.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
|
@@ -24,6 +24,10 @@ export interface ContentSectionProps {
|
|
|
24
24
|
children?: React.ReactNode;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
27
|
+
* @deprecated Préférer `Section` (en-tête / corps / pied, trait fin, repli,
|
|
28
|
+
* dispositions configurables). `ContentSection` est conservé tel quel pour ne
|
|
29
|
+
* casser aucun consommateur (HeroMosaic, vitrine).
|
|
30
|
+
*
|
|
27
31
|
* Squelette réutilisable pour une section de contenu de page : un titre
|
|
28
32
|
* optionnel, une description optionnelle, un slot d'actions optionnel
|
|
29
33
|
* (ex. « Voir tout ») et une zone de contenu libre.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content-section.component.d.ts","sourceRoot":"","sources":["../../src/content-section/content-section.component.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,qDAAqD;IACrD,EAAE,CAAC,EAAE,SAAS,GAAG,KAAK,GAAG,OAAO,CAAC;IACjC,+CAA+C;IAC/C,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC;IAClC,2FAA2F;IAC3F,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,iDAAiD;IACjD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,0EAA0E;IAC1E,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,sFAAsF;IACtF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED
|
|
1
|
+
{"version":3,"file":"content-section.component.d.ts","sourceRoot":"","sources":["../../src/content-section/content-section.component.tsx"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,mBAAmB;IAClC,oEAAoE;IACpE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,qDAAqD;IACrD,EAAE,CAAC,EAAE,SAAS,GAAG,KAAK,GAAG,OAAO,CAAC;IACjC,+CAA+C;IAC/C,OAAO,CAAC,EAAE,aAAa,GAAG,OAAO,CAAC;IAClC,2FAA2F;IAC3F,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACxB,0CAA0C;IAC1C,OAAO,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACtB,iDAAiD;IACjD,WAAW,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC9B,0EAA0E;IAC1E,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,sFAAsF;IACtF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,cAAc,CAAC,EAC7B,EAAE,EACF,EAAc,EACd,OAAuB,EACvB,KAAK,EACL,OAAc,EACd,WAAW,EACX,OAAO,EACP,SAAS,EACT,IAAY,EACZ,SAAS,EACT,QAAQ,GACT,EAAE,mBAAmB,qBA8BrB"}
|
|
@@ -2,6 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
/** @category Content Section */ import React from "react";
|
|
3
3
|
import styles from "./content-section.module.scss";
|
|
4
4
|
/**
|
|
5
|
+
* @deprecated Préférer `Section` (en-tête / corps / pied, trait fin, repli,
|
|
6
|
+
* dispositions configurables). `ContentSection` est conservé tel quel pour ne
|
|
7
|
+
* casser aucun consommateur (HeroMosaic, vitrine).
|
|
8
|
+
*
|
|
5
9
|
* Squelette réutilisable pour une section de contenu de page : un titre
|
|
6
10
|
* optionnel, une description optionnelle, un slot d'actions optionnel
|
|
7
11
|
* (ex. « Voir tout ») et une zone de contenu libre.
|
package/dist/public.d.ts
CHANGED
|
@@ -39,6 +39,7 @@ export * from './dialogs/index.js';
|
|
|
39
39
|
export * from './selections/index.js';
|
|
40
40
|
export * from './carousel/index.js';
|
|
41
41
|
export * from './content-section/index.js';
|
|
42
|
+
export * from './section/index.js';
|
|
42
43
|
export * from './hero-mosaic/index.js';
|
|
43
44
|
export * from './top-bar/index.js';
|
|
44
45
|
export * from './sites/index.js';
|
package/dist/public.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"public.d.ts","sourceRoot":"","sources":["../src/public.ts"],"names":[],"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AAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,KAAK,WAAW,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC"}
|
package/dist/public.js
CHANGED
|
@@ -36,6 +36,7 @@ export * from "./dialogs/index.js";
|
|
|
36
36
|
export * from "./selections/index.js";
|
|
37
37
|
export * from "./carousel/index.js";
|
|
38
38
|
export * from "./content-section/index.js";
|
|
39
|
+
export * from "./section/index.js";
|
|
39
40
|
export * from "./hero-mosaic/index.js";
|
|
40
41
|
export * from "./top-bar/index.js";
|
|
41
42
|
export * from "./sites/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/section/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,+BAA+B,CAAC;AAC9C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** @category Section */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface SectionActionProps {
|
|
4
|
+
/** Libellé visible. Omis : bouton icône seule (`label` devient alors obligatoire côté accessibilité). */
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
/** Icône avant le libellé. */
|
|
7
|
+
icon?: React.ReactNode;
|
|
8
|
+
/** Libellé accessible + infobulle (requis pour un bouton icône seule). */
|
|
9
|
+
label?: string;
|
|
10
|
+
/** Option sélectionnée (filtre, onglet) : fond marqué + `aria-pressed`. */
|
|
11
|
+
active?: boolean;
|
|
12
|
+
/** `ghost` (défaut, sans fond), `outline` (contour fin) ou `solid` (couleur d'accent). */
|
|
13
|
+
variant?: 'ghost' | 'outline' | 'solid';
|
|
14
|
+
/** @default 'md' */
|
|
15
|
+
size?: 'sm' | 'md';
|
|
16
|
+
/** Rend un lien `<a>` au lieu d'un `<button>`. */
|
|
17
|
+
href?: string;
|
|
18
|
+
target?: string;
|
|
19
|
+
rel?: string;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
type?: 'button' | 'submit' | 'reset';
|
|
22
|
+
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Bouton de contrôle pour l'en-tête ou le pied d'un `Section` : « Voir tout »,
|
|
27
|
+
* filtre, rafraîchir... Plusieurs `SectionAction` avec `active` forment un
|
|
28
|
+
* sélecteur d'options (filtres, onglets).
|
|
29
|
+
*/
|
|
30
|
+
export declare function SectionAction({ children, icon, label, active, variant, size, href, target, rel, disabled, type, onClick, className, }: SectionActionProps): React.JSX.Element;
|
|
31
|
+
//# sourceMappingURL=section-action.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-action.component.d.ts","sourceRoot":"","sources":["../../src/section/section-action.component.tsx"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,kBAAkB;IACjC,yGAAyG;IACzG,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,8BAA8B;IAC9B,IAAI,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACvB,0EAA0E;IAC1E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2EAA2E;IAC3E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,0FAA0F;IAC1F,OAAO,CAAC,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;IACxC,oBAAoB;IACpB,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IACnB,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,QAAQ,GAAG,QAAQ,GAAG,OAAO,CAAC;IACrC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,KAAK,IAAI,CAAC;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAOD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,EAC5B,QAAQ,EACR,IAAI,EACJ,KAAK,EACL,MAAc,EACd,OAAiB,EACjB,IAAW,EACX,IAAI,EACJ,MAAM,EACN,GAAG,EACH,QAAQ,EACR,IAAe,EACf,OAAO,EACP,SAAS,GACV,EAAE,kBAAkB,qBAgEpB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/** @category Section */ import React from "react";
|
|
3
|
+
import { cn } from "../page-background/page-background.utils.js";
|
|
4
|
+
const SIZE = {
|
|
5
|
+
sm: {
|
|
6
|
+
text: 'h-7 px-2.5 text-xs',
|
|
7
|
+
icon: 'size-7'
|
|
8
|
+
},
|
|
9
|
+
md: {
|
|
10
|
+
text: 'h-8 px-3 text-[13px]',
|
|
11
|
+
icon: 'size-8'
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Bouton de contrôle pour l'en-tête ou le pied d'un `Section` : « Voir tout »,
|
|
16
|
+
* filtre, rafraîchir... Plusieurs `SectionAction` avec `active` forment un
|
|
17
|
+
* sélecteur d'options (filtres, onglets).
|
|
18
|
+
*/ export function SectionAction({ children, icon, label, active = false, variant = 'ghost', size = 'md', href, target, rel, disabled, type = 'button', onClick, className }) {
|
|
19
|
+
const iconOnly = !children;
|
|
20
|
+
const classes = cn('inline-flex shrink-0 cursor-pointer select-none items-center justify-center gap-1.5 whitespace-nowrap rounded-md', 'font-medium leading-none no-underline outline-none transition-colors duration-150', 'focus-visible:ring-2 focus-visible:ring-(--section-accent,#34d399)/70', 'aria-disabled:pointer-events-none aria-disabled:opacity-40 disabled:pointer-events-none disabled:opacity-40', iconOnly ? cn(SIZE[size].icon, 'p-0') : SIZE[size].text, variant === 'solid' ? 'border-0 bg-(--section-accent,#10b981) text-white hover:brightness-110' : variant === 'outline' ? cn('border border-solid border-(--section-line,rgba(255,255,255,0.12))', active ? 'bg-(--section-fg,#fff)/12 text-(--section-fg,#fff)' : 'bg-transparent text-(--section-muted,rgba(255,255,255,0.65)) hover:bg-(--section-fg,#fff)/8 hover:text-(--section-fg,#fff)') : cn('border-0', active ? 'bg-(--section-fg,#fff)/12 text-(--section-fg,#fff)' : 'bg-transparent text-(--section-muted,rgba(255,255,255,0.65)) hover:bg-(--section-fg,#fff)/8 hover:text-(--section-fg,#fff)'), className);
|
|
21
|
+
const content = /*#__PURE__*/ _jsxs(_Fragment, {
|
|
22
|
+
children: [
|
|
23
|
+
icon,
|
|
24
|
+
children
|
|
25
|
+
]
|
|
26
|
+
});
|
|
27
|
+
if (href) {
|
|
28
|
+
return /*#__PURE__*/ _jsx("a", {
|
|
29
|
+
href: href,
|
|
30
|
+
target: target,
|
|
31
|
+
rel: rel ?? (target === '_blank' ? 'noreferrer noopener' : undefined),
|
|
32
|
+
title: label,
|
|
33
|
+
"aria-label": iconOnly ? label : undefined,
|
|
34
|
+
"aria-current": active || undefined,
|
|
35
|
+
"aria-disabled": disabled || undefined,
|
|
36
|
+
onClick: onClick,
|
|
37
|
+
className: classes,
|
|
38
|
+
children: content
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
return /*#__PURE__*/ _jsx("button", {
|
|
42
|
+
type: type,
|
|
43
|
+
title: label,
|
|
44
|
+
"aria-label": iconOnly ? label : undefined,
|
|
45
|
+
"aria-pressed": active || undefined,
|
|
46
|
+
disabled: disabled,
|
|
47
|
+
onClick: onClick,
|
|
48
|
+
className: classes,
|
|
49
|
+
children: content
|
|
50
|
+
});
|
|
51
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/** @category Section */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export interface SectionGridColumns {
|
|
4
|
+
/** Nombre de colonnes par défaut (mobile). */
|
|
5
|
+
base?: number;
|
|
6
|
+
sm?: number;
|
|
7
|
+
md?: number;
|
|
8
|
+
lg?: number;
|
|
9
|
+
xl?: number;
|
|
10
|
+
'2xl'?: number;
|
|
11
|
+
}
|
|
12
|
+
export interface SectionGridProps {
|
|
13
|
+
/** @default 'div' */
|
|
14
|
+
as?: 'div' | 'ul' | 'ol';
|
|
15
|
+
/**
|
|
16
|
+
* Nombre de colonnes, fixe (`3`) ou par breakpoint (`{ base: 1, md: 2, xl: 4 }`).
|
|
17
|
+
* Un breakpoint omis reprend la valeur du précédent. Ignoré si `minItemWidth` est fourni.
|
|
18
|
+
* @default { base: 1, md: 2, lg: 3 }
|
|
19
|
+
*/
|
|
20
|
+
columns?: number | SectionGridColumns;
|
|
21
|
+
/**
|
|
22
|
+
* Largeur minimale d'une carte (ex. `'16rem'`) : le nombre de colonnes
|
|
23
|
+
* s'adapte alors à la largeur RÉELLE du conteneur — plus fiable que les
|
|
24
|
+
* breakpoints quand la grille vit dans une colonne de page.
|
|
25
|
+
*/
|
|
26
|
+
minItemWidth?: string;
|
|
27
|
+
/** @default 'md' */
|
|
28
|
+
gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
29
|
+
className?: string;
|
|
30
|
+
children?: React.ReactNode;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Grille responsive pour le corps d'un `Section`. Les colonnes passent par des
|
|
34
|
+
* variables CSS (`--sg-*`) : n'importe quel nombre de colonnes est possible sans
|
|
35
|
+
* classe Tailwind dynamique (que le scanner ne verrait pas).
|
|
36
|
+
*/
|
|
37
|
+
export declare function SectionGrid({ as: Tag, columns, minItemWidth, gap, className, children, }: SectionGridProps): React.JSX.Element;
|
|
38
|
+
//# sourceMappingURL=section-grid.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-grid.component.d.ts","sourceRoot":"","sources":["../../src/section/section-grid.component.tsx"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,kBAAkB;IACjC,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAgB;IAC/B,qBAAqB;IACrB,EAAE,CAAC,EAAE,KAAK,GAAG,IAAI,GAAG,IAAI,CAAC;IACzB;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,kBAAkB,CAAC;IACtC;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,oBAAoB;IACpB,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B;AAcD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAC1B,EAAE,EAAE,GAAW,EACf,OAAyB,EACzB,YAAY,EACZ,GAAU,EACV,SAAS,EACT,QAAQ,GACT,EAAE,gBAAgB,qBAqClB"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/** @category Section */ import React from "react";
|
|
3
|
+
import { cn } from "../page-background/page-background.utils.js";
|
|
4
|
+
const GAP = {
|
|
5
|
+
none: 'gap-0',
|
|
6
|
+
xs: 'gap-2',
|
|
7
|
+
sm: 'gap-3',
|
|
8
|
+
md: 'gap-5',
|
|
9
|
+
lg: 'gap-8',
|
|
10
|
+
xl: 'gap-10'
|
|
11
|
+
};
|
|
12
|
+
const DEFAULT_COLUMNS = {
|
|
13
|
+
base: 1,
|
|
14
|
+
md: 2,
|
|
15
|
+
lg: 3
|
|
16
|
+
};
|
|
17
|
+
const BREAKPOINTS = [
|
|
18
|
+
'base',
|
|
19
|
+
'sm',
|
|
20
|
+
'md',
|
|
21
|
+
'lg',
|
|
22
|
+
'xl',
|
|
23
|
+
'2xl'
|
|
24
|
+
];
|
|
25
|
+
/**
|
|
26
|
+
* Grille responsive pour le corps d'un `Section`. Les colonnes passent par des
|
|
27
|
+
* variables CSS (`--sg-*`) : n'importe quel nombre de colonnes est possible sans
|
|
28
|
+
* classe Tailwind dynamique (que le scanner ne verrait pas).
|
|
29
|
+
*/ export function SectionGrid({ as: Tag = 'div', columns = DEFAULT_COLUMNS, minItemWidth, gap = 'md', className, children }) {
|
|
30
|
+
const style = {};
|
|
31
|
+
if (minItemWidth) {
|
|
32
|
+
style['--sg-min'] = minItemWidth;
|
|
33
|
+
} else {
|
|
34
|
+
const cols = typeof columns === 'number' ? {
|
|
35
|
+
base: columns
|
|
36
|
+
} : columns;
|
|
37
|
+
for (const bp of BREAKPOINTS){
|
|
38
|
+
const value = cols[bp];
|
|
39
|
+
if (typeof value === 'number' && value > 0) {
|
|
40
|
+
style[`--sg-${bp}`] = String(Math.floor(value));
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
return /*#__PURE__*/ _jsx(Tag, {
|
|
45
|
+
"data-section-part": "grid",
|
|
46
|
+
style: style,
|
|
47
|
+
className: cn('grid min-w-0', GAP[gap], minItemWidth ? 'grid-cols-[repeat(auto-fill,minmax(min(100%,var(--sg-min)),1fr))]' : cn('grid-cols-[repeat(var(--sg-base,1),minmax(0,1fr))]', 'sm:grid-cols-[repeat(var(--sg-sm,var(--sg-base,1)),minmax(0,1fr))]', 'md:grid-cols-[repeat(var(--sg-md,var(--sg-sm,var(--sg-base,1))),minmax(0,1fr))]', 'lg:grid-cols-[repeat(var(--sg-lg,var(--sg-md,var(--sg-sm,var(--sg-base,1)))),minmax(0,1fr))]', 'xl:grid-cols-[repeat(var(--sg-xl,var(--sg-lg,var(--sg-md,var(--sg-sm,var(--sg-base,1))))),minmax(0,1fr))]', '2xl:grid-cols-[repeat(var(--sg-2xl,var(--sg-xl,var(--sg-lg,var(--sg-md,var(--sg-sm,var(--sg-base,1)))))),minmax(0,1fr))]'), className),
|
|
48
|
+
children: children
|
|
49
|
+
});
|
|
50
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** @category Section */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { SectionBodyProps, SectionFooterProps, SectionHeaderProps } from './section.types.js';
|
|
4
|
+
/** Trait fin pleine largeur, légèrement visible : ni bordure ni fond. */
|
|
5
|
+
export declare function SectionDivider({ className }: {
|
|
6
|
+
className?: string;
|
|
7
|
+
}): React.JSX.Element;
|
|
8
|
+
/** En-tête : titre à gauche, actions à droite (disposition par défaut), puis trait fin. */
|
|
9
|
+
export declare function SectionHeader({ title, titleAs, titleSize, icon, description, count, actions, children, layout, divider, className, }: SectionHeaderProps): React.JSX.Element;
|
|
10
|
+
/** Corps : contenu libre, repliable avec le `Section` parent. */
|
|
11
|
+
export declare function SectionBody({ children, flush, maxHeight, className }: SectionBodyProps): React.JSX.Element;
|
|
12
|
+
/** Pied : contenu à gauche, actions à droite (disposition par défaut), précédé d'un trait fin. */
|
|
13
|
+
export declare function SectionFooter({ children, actions, layout, divider, className }: SectionFooterProps): React.JSX.Element | null;
|
|
14
|
+
//# sourceMappingURL=section-parts.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section-parts.component.d.ts","sourceRoot":"","sources":["../../src/section/section-parts.component.tsx"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,KAAsC,MAAM,OAAO,CAAC;AAG3D,OAAO,KAAK,EACV,gBAAgB,EAGhB,kBAAkB,EAElB,kBAAkB,EAEnB,MAAM,oBAAoB,CAAC;AA4D5B,yEAAyE;AACzE,wBAAgB,cAAc,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,qBAUnE;AAsCD,2FAA2F;AAC3F,wBAAgB,aAAa,CAAC,EAC5B,KAAK,EACL,OAAc,EACd,SAAgB,EAChB,IAAI,EACJ,WAAW,EACX,KAAK,EACL,OAAO,EACP,QAAQ,EACR,MAAM,EACN,OAAO,EACP,SAAS,GACV,EAAE,kBAAkB,qBAuFpB;AAED,iEAAiE;AACjE,wBAAgB,WAAW,CAAC,EAAE,QAAQ,EAAE,KAAa,EAAE,SAAS,EAAE,SAAS,EAAE,EAAE,gBAAgB,qBAoD9F;AAED,kGAAkG;AAClG,wBAAgB,aAAa,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,kBAAkB,4BAsClG"}
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** @category Section */ import React, { useEffect, useRef, useState } from "react";
|
|
3
|
+
import { cn } from "../page-background/page-background.utils.js";
|
|
4
|
+
import { useSectionContext } from "./section.context.js";
|
|
5
|
+
// =============================================================================
|
|
6
|
+
// Parties du squelette Section : SectionDivider, SectionHeader, SectionBody,
|
|
7
|
+
// SectionFooter. Chacune lit la configuration de son `Section` parent (ton,
|
|
8
|
+
// densité, dispositions, classNames) et reste utilisable seule.
|
|
9
|
+
//
|
|
10
|
+
// Couleurs : variables CSS surchargeables (valeurs par défaut pour un fond
|
|
11
|
+
// sombre) — `--section-fg`, `--section-muted`, `--section-line`,
|
|
12
|
+
// `--section-accent`. Le texte reste clair quel que soit le thème, car le fond
|
|
13
|
+
// de page (PageBackground) est toujours sombre.
|
|
14
|
+
// =============================================================================
|
|
15
|
+
/** Durée du repli — doit rester alignée sur `duration-300` du corps. */ const COLLAPSE_MS = 320;
|
|
16
|
+
const HEADER_PAD = {
|
|
17
|
+
compact: 'pb-2',
|
|
18
|
+
comfortable: 'pb-3',
|
|
19
|
+
spacious: 'pb-4'
|
|
20
|
+
};
|
|
21
|
+
const BODY_PAD = {
|
|
22
|
+
compact: 'pt-3',
|
|
23
|
+
comfortable: 'pt-4',
|
|
24
|
+
spacious: 'pt-6'
|
|
25
|
+
};
|
|
26
|
+
const FOOTER_GAP = {
|
|
27
|
+
compact: 'mt-3',
|
|
28
|
+
comfortable: 'mt-4',
|
|
29
|
+
spacious: 'mt-6'
|
|
30
|
+
};
|
|
31
|
+
const FOOTER_PAD = {
|
|
32
|
+
compact: 'pt-2',
|
|
33
|
+
comfortable: 'pt-3',
|
|
34
|
+
spacious: 'pt-4'
|
|
35
|
+
};
|
|
36
|
+
const TITLE_SIZE = {
|
|
37
|
+
sm: 'text-base font-medium leading-snug',
|
|
38
|
+
md: 'text-xl font-light leading-tight sm:text-2xl',
|
|
39
|
+
lg: 'text-2xl font-light leading-tight sm:text-3xl'
|
|
40
|
+
};
|
|
41
|
+
const HEADER_ROW = {
|
|
42
|
+
split: 'flex-wrap items-center justify-between',
|
|
43
|
+
stacked: 'flex-col items-start',
|
|
44
|
+
centered: 'flex-col items-center text-center'
|
|
45
|
+
};
|
|
46
|
+
const HEADER_ACTIONS = {
|
|
47
|
+
split: 'ml-auto justify-end',
|
|
48
|
+
stacked: 'justify-start',
|
|
49
|
+
centered: 'justify-center'
|
|
50
|
+
};
|
|
51
|
+
const FOOTER_JUSTIFY = {
|
|
52
|
+
between: 'justify-between',
|
|
53
|
+
start: 'justify-start',
|
|
54
|
+
center: 'justify-center',
|
|
55
|
+
end: 'justify-end'
|
|
56
|
+
};
|
|
57
|
+
/** Trait fin pleine largeur, légèrement visible : ni bordure ni fond. */ export function SectionDivider({ className }) {
|
|
58
|
+
const { classNames } = useSectionContext();
|
|
59
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
60
|
+
role: "presentation",
|
|
61
|
+
"aria-hidden": "true",
|
|
62
|
+
"data-section-part": "divider",
|
|
63
|
+
className: cn('h-px w-full shrink-0 bg-(--section-line,rgba(255,255,255,0.12))', classNames.divider, className)
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
function CollapseToggle() {
|
|
67
|
+
const { collapsed, toggle, labels, bodyId } = useSectionContext();
|
|
68
|
+
const label = collapsed ? labels.expand : labels.collapse;
|
|
69
|
+
return /*#__PURE__*/ _jsx("button", {
|
|
70
|
+
type: "button",
|
|
71
|
+
onClick: toggle,
|
|
72
|
+
title: label,
|
|
73
|
+
"aria-label": label,
|
|
74
|
+
"aria-expanded": !collapsed,
|
|
75
|
+
"aria-controls": bodyId,
|
|
76
|
+
className: cn('inline-flex size-8 shrink-0 cursor-pointer items-center justify-center rounded-md border-0 p-0', 'bg-transparent text-(--section-muted,rgba(255,255,255,0.65)) outline-none transition-colors duration-150', 'hover:bg-(--section-fg,#fff)/10 hover:text-(--section-fg,#fff)', 'focus-visible:ring-2 focus-visible:ring-(--section-accent,#34d399)/70'),
|
|
77
|
+
children: /*#__PURE__*/ _jsx("svg", {
|
|
78
|
+
viewBox: "0 0 16 16",
|
|
79
|
+
width: "16",
|
|
80
|
+
height: "16",
|
|
81
|
+
fill: "none",
|
|
82
|
+
stroke: "currentColor",
|
|
83
|
+
strokeWidth: "1.5",
|
|
84
|
+
strokeLinecap: "round",
|
|
85
|
+
strokeLinejoin: "round",
|
|
86
|
+
"aria-hidden": "true",
|
|
87
|
+
className: cn('transition-transform duration-300 motion-reduce:transition-none', !collapsed && 'rotate-180'),
|
|
88
|
+
children: /*#__PURE__*/ _jsx("path", {
|
|
89
|
+
d: "M4 6l4 4 4-4"
|
|
90
|
+
})
|
|
91
|
+
})
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/** En-tête : titre à gauche, actions à droite (disposition par défaut), puis trait fin. */ export function SectionHeader({ title, titleAs = 'h2', titleSize = 'md', icon, description, count, actions, children, layout, divider, className }) {
|
|
95
|
+
const ctx = useSectionContext();
|
|
96
|
+
const { classNames, density, collapsible } = ctx;
|
|
97
|
+
const resolvedLayout = layout ?? ctx.headerLayout;
|
|
98
|
+
const showDivider = divider ?? ctx.divider;
|
|
99
|
+
const TitleTag = titleAs;
|
|
100
|
+
const hasCount = count !== undefined && count !== null && count !== '';
|
|
101
|
+
const hasActions = actions !== undefined && actions !== null && actions !== false;
|
|
102
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
103
|
+
"data-section-part": "header",
|
|
104
|
+
className: cn('flex flex-col', classNames.header, className),
|
|
105
|
+
children: [
|
|
106
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
107
|
+
className: cn('flex gap-x-4 gap-y-2', HEADER_ROW[resolvedLayout], HEADER_PAD[density]),
|
|
108
|
+
children: [
|
|
109
|
+
children !== undefined && children !== null ? /*#__PURE__*/ _jsx("div", {
|
|
110
|
+
className: "min-w-0 flex-1",
|
|
111
|
+
children: children
|
|
112
|
+
}) : /*#__PURE__*/ _jsxs("div", {
|
|
113
|
+
className: cn('flex min-w-0 flex-col gap-1', resolvedLayout === 'split' && 'flex-1 basis-48', classNames.heading),
|
|
114
|
+
children: [
|
|
115
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
116
|
+
className: cn('flex min-w-0 items-center gap-2.5', resolvedLayout === 'centered' && 'justify-center'),
|
|
117
|
+
children: [
|
|
118
|
+
icon ? /*#__PURE__*/ _jsx("span", {
|
|
119
|
+
className: cn('inline-flex shrink-0 items-center justify-center text-(--section-accent,#34d399)', classNames.leading),
|
|
120
|
+
children: icon
|
|
121
|
+
}) : null,
|
|
122
|
+
title ? /*#__PURE__*/ _jsx(TitleTag, {
|
|
123
|
+
id: ctx.headingId,
|
|
124
|
+
className: cn('m-0 min-w-0 text-balance tracking-tight text-(--section-fg,#fff)', TITLE_SIZE[titleSize], classNames.title),
|
|
125
|
+
children: title
|
|
126
|
+
}) : null,
|
|
127
|
+
hasCount ? /*#__PURE__*/ _jsx("span", {
|
|
128
|
+
className: cn('inline-flex h-5 min-w-5 shrink-0 items-center justify-center rounded-full px-1.5', 'bg-(--section-fg,#fff)/10 text-[11px] font-medium leading-none text-(--section-muted,rgba(255,255,255,0.65))', classNames.count),
|
|
129
|
+
children: count
|
|
130
|
+
}) : null
|
|
131
|
+
]
|
|
132
|
+
}),
|
|
133
|
+
description ? /*#__PURE__*/ _jsx("p", {
|
|
134
|
+
className: cn('m-0 max-w-3xl text-sm leading-relaxed text-(--section-muted,rgba(255,255,255,0.65))', classNames.description),
|
|
135
|
+
children: description
|
|
136
|
+
}) : null
|
|
137
|
+
]
|
|
138
|
+
}),
|
|
139
|
+
hasActions || collapsible ? /*#__PURE__*/ _jsxs("div", {
|
|
140
|
+
className: cn('flex flex-wrap items-center gap-1.5', HEADER_ACTIONS[resolvedLayout], children !== undefined && children !== null && resolvedLayout === 'split' && 'shrink-0', classNames.actions),
|
|
141
|
+
children: [
|
|
142
|
+
actions,
|
|
143
|
+
collapsible ? /*#__PURE__*/ _jsx(CollapseToggle, {}) : null
|
|
144
|
+
]
|
|
145
|
+
}) : null
|
|
146
|
+
]
|
|
147
|
+
}),
|
|
148
|
+
showDivider ? /*#__PURE__*/ _jsx(SectionDivider, {}) : null
|
|
149
|
+
]
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
/** Corps : contenu libre, repliable avec le `Section` parent. */ export function SectionBody({ children, flush = false, maxHeight, className }) {
|
|
153
|
+
const { classNames, density, collapsible, collapsed, bodyId } = useSectionContext();
|
|
154
|
+
// `overflow: hidden` n'est posé que pendant l'animation de repli et quand le
|
|
155
|
+
// corps est replié : en régime établi il reste visible, pour ne pas rogner
|
|
156
|
+
// ombres, anneaux de focus ni effets de survol des cartes.
|
|
157
|
+
const [clip, setClip] = useState(collapsed);
|
|
158
|
+
const firstRun = useRef(true);
|
|
159
|
+
useEffect(()=>{
|
|
160
|
+
if (firstRun.current) {
|
|
161
|
+
firstRun.current = false;
|
|
162
|
+
return undefined;
|
|
163
|
+
}
|
|
164
|
+
setClip(true);
|
|
165
|
+
const timer = setTimeout(()=>setClip(collapsed), COLLAPSE_MS);
|
|
166
|
+
return ()=>clearTimeout(timer);
|
|
167
|
+
}, [
|
|
168
|
+
collapsed
|
|
169
|
+
]);
|
|
170
|
+
const content = /*#__PURE__*/ _jsx("div", {
|
|
171
|
+
"data-section-part": "body",
|
|
172
|
+
className: cn('min-w-0', !flush && BODY_PAD[density], maxHeight && 'overflow-y-auto overscroll-contain', classNames.body, className),
|
|
173
|
+
style: maxHeight ? {
|
|
174
|
+
maxHeight
|
|
175
|
+
} : undefined,
|
|
176
|
+
children: children
|
|
177
|
+
});
|
|
178
|
+
if (!collapsible) {
|
|
179
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
180
|
+
id: bodyId,
|
|
181
|
+
children: content
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
return /*#__PURE__*/ _jsx("div", {
|
|
185
|
+
id: bodyId,
|
|
186
|
+
"aria-hidden": collapsed || undefined,
|
|
187
|
+
...collapsed ? {
|
|
188
|
+
inert: ''
|
|
189
|
+
} : {},
|
|
190
|
+
className: cn('grid transition-[grid-template-rows] duration-300 ease-out motion-reduce:transition-none', collapsed ? 'grid-rows-[0fr]' : 'grid-rows-[1fr]'),
|
|
191
|
+
children: /*#__PURE__*/ _jsx("div", {
|
|
192
|
+
className: cn('min-h-0', clip && 'overflow-hidden'),
|
|
193
|
+
children: content
|
|
194
|
+
})
|
|
195
|
+
});
|
|
196
|
+
}
|
|
197
|
+
/** Pied : contenu à gauche, actions à droite (disposition par défaut), précédé d'un trait fin. */ export function SectionFooter({ children, actions, layout, divider, className }) {
|
|
198
|
+
const ctx = useSectionContext();
|
|
199
|
+
const { classNames, density, collapsible, collapsed } = ctx;
|
|
200
|
+
const resolvedLayout = layout ?? ctx.footerLayout;
|
|
201
|
+
const showDivider = divider ?? ctx.footerDivider;
|
|
202
|
+
const hasChildren = children !== undefined && children !== null && children !== false;
|
|
203
|
+
const hasActions = actions !== undefined && actions !== null && actions !== false;
|
|
204
|
+
// Un `Section` replié ne montre que son en-tête.
|
|
205
|
+
if (collapsible && collapsed) {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
return /*#__PURE__*/ _jsxs("div", {
|
|
209
|
+
"data-section-part": "footer",
|
|
210
|
+
className: cn('flex flex-col', FOOTER_GAP[density], classNames.footer, className),
|
|
211
|
+
children: [
|
|
212
|
+
showDivider ? /*#__PURE__*/ _jsx(SectionDivider, {}) : null,
|
|
213
|
+
/*#__PURE__*/ _jsxs("div", {
|
|
214
|
+
className: cn('flex flex-wrap items-center gap-x-4 gap-y-2 text-xs text-(--section-muted,rgba(255,255,255,0.65))', FOOTER_PAD[density], FOOTER_JUSTIFY[resolvedLayout]),
|
|
215
|
+
children: [
|
|
216
|
+
hasChildren ? /*#__PURE__*/ _jsx("div", {
|
|
217
|
+
className: cn('min-w-0', classNames.footerStart),
|
|
218
|
+
children: children
|
|
219
|
+
}) : null,
|
|
220
|
+
hasActions ? /*#__PURE__*/ _jsx("div", {
|
|
221
|
+
className: cn('flex flex-wrap items-center gap-1.5', resolvedLayout === 'between' && 'ml-auto', classNames.footerEnd),
|
|
222
|
+
children: actions
|
|
223
|
+
}) : null
|
|
224
|
+
]
|
|
225
|
+
})
|
|
226
|
+
]
|
|
227
|
+
});
|
|
228
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** @category Section */
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { SectionAction } from './section-action.component.js';
|
|
4
|
+
import { SectionGrid } from './section-grid.component.js';
|
|
5
|
+
import { SectionBody, SectionDivider, SectionFooter, SectionHeader } from './section-parts.component.js';
|
|
6
|
+
import type { SectionProps } from './section.types.js';
|
|
7
|
+
declare function SectionRoot({ id, as: Root, ariaLabel, variant, tone, density, title, titleAs, titleSize, icon, description, count, actions, header, headerLayout, divider, footer, footerActions, footerLayout, footerDivider, bodyMaxHeight, bodyFlush, collapsible, collapsed: collapsedProp, defaultCollapsed, onCollapsedChange, labels, className, classNames, children, }: SectionProps): React.JSX.Element;
|
|
8
|
+
/**
|
|
9
|
+
* `Section` — squelette en-tête / corps / pied. Les parties sont aussi
|
|
10
|
+
* disponibles en statiques : `Section.Header`, `Section.Body`, `Section.Footer`,
|
|
11
|
+
* `Section.Divider`, `Section.Action`, `Section.Grid`.
|
|
12
|
+
*/
|
|
13
|
+
export declare const Section: typeof SectionRoot & {
|
|
14
|
+
Header: typeof SectionHeader;
|
|
15
|
+
Body: typeof SectionBody;
|
|
16
|
+
Footer: typeof SectionFooter;
|
|
17
|
+
Divider: typeof SectionDivider;
|
|
18
|
+
Action: typeof SectionAction;
|
|
19
|
+
Grid: typeof SectionGrid;
|
|
20
|
+
};
|
|
21
|
+
export {};
|
|
22
|
+
//# sourceMappingURL=section.component.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section.component.d.ts","sourceRoot":"","sources":["../../src/section/section.component.tsx"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,KAA0E,MAAM,OAAO,CAAC;AAG/F,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AACzG,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAiCvD,iBAAS,WAAW,CAAC,EACnB,EAAE,EACF,EAAE,EAAE,IAAgB,EACpB,SAAS,EACT,OAAiB,EACjB,IAAe,EACf,OAAuB,EACvB,KAAK,EACL,OAAO,EACP,SAAS,EACT,IAAI,EACJ,WAAW,EACX,KAAK,EACL,OAAO,EACP,MAAM,EACN,YAAsB,EACtB,OAAc,EACd,MAAM,EACN,aAAa,EACb,YAAwB,EACxB,aAAoB,EACpB,aAAa,EACb,SAAS,EACT,WAAmB,EACnB,SAAS,EAAE,aAAa,EACxB,gBAAwB,EACxB,iBAAiB,EACjB,MAAM,EACN,SAAS,EACT,UAAe,EACf,QAAQ,GACT,EAAE,YAAY,qBAyGd;AAED;;;;GAIG;AACH,eAAO,MAAM,OAAO;;;;;;;CAOlB,CAAC"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/** @category Section */ import React, { Children, isValidElement, useCallback, useId, useMemo, useState } from "react";
|
|
3
|
+
import { cn } from "../page-background/page-background.utils.js";
|
|
4
|
+
import { DEFAULT_SECTION_LABELS, SectionContext } from "./section.context.js";
|
|
5
|
+
import { SectionAction } from "./section-action.component.js";
|
|
6
|
+
import { SectionGrid } from "./section-grid.component.js";
|
|
7
|
+
import { SectionBody, SectionDivider, SectionFooter, SectionHeader } from "./section-parts.component.js";
|
|
8
|
+
// =============================================================================
|
|
9
|
+
// SECTION — squelette réutilisable pour toute section de page
|
|
10
|
+
//
|
|
11
|
+
// ┌ En-tête ─────────────────────────────────────────────┐
|
|
12
|
+
// │ [icône] Titre (compteur) [actions…] ▾ │
|
|
13
|
+
// │ Description │
|
|
14
|
+
// ├──────────────────── trait fin ───────────────────────┤ ← 1 px, opacité réduite
|
|
15
|
+
// │ Corps : contenu libre (SectionGrid, liste, carte...) │
|
|
16
|
+
// ├──────────────────── trait fin ───────────────────────┤
|
|
17
|
+
// │ Pied : contenu [actions] │
|
|
18
|
+
// └──────────────────────────────────────────────────────┘
|
|
19
|
+
//
|
|
20
|
+
// Aucune bordure, aucun fond par défaut : la section est posée directement
|
|
21
|
+
// sur le fond de page. Tout est optionnel et configurable (voir le guide
|
|
22
|
+
// d'utilisation en bas de fichier).
|
|
23
|
+
// =============================================================================
|
|
24
|
+
const TONE_ON_LIGHT = '[--section-fg:#0f172a] [--section-muted:rgba(15,23,42,0.62)] [--section-line:rgba(15,23,42,0.14)]';
|
|
25
|
+
const VARIANT = {
|
|
26
|
+
plain: '',
|
|
27
|
+
glass: 'rounded-2xl p-5 backdrop-blur-xl ring-1 ring-inset ring-(--section-line,rgba(255,255,255,0.12))'
|
|
28
|
+
};
|
|
29
|
+
const GLASS_FILL = {
|
|
30
|
+
onDark: 'bg-black/40',
|
|
31
|
+
onLight: 'bg-white/70'
|
|
32
|
+
};
|
|
33
|
+
const PART_TYPES = new Set([
|
|
34
|
+
SectionHeader,
|
|
35
|
+
SectionBody,
|
|
36
|
+
SectionFooter
|
|
37
|
+
]);
|
|
38
|
+
function isPresent(node) {
|
|
39
|
+
return node !== undefined && node !== null && node !== false && node !== '';
|
|
40
|
+
}
|
|
41
|
+
function SectionRoot({ id, as: Root = 'section', ariaLabel, variant = 'plain', tone = 'onDark', density = 'comfortable', title, titleAs, titleSize, icon, description, count, actions, header, headerLayout = 'split', divider = true, footer, footerActions, footerLayout = 'between', footerDivider = true, bodyMaxHeight, bodyFlush, collapsible = false, collapsed: collapsedProp, defaultCollapsed = false, onCollapsedChange, labels, className, classNames = {}, children }) {
|
|
42
|
+
const reactId = useId();
|
|
43
|
+
const headingId = `${reactId}-title`;
|
|
44
|
+
const bodyId = `${reactId}-body`;
|
|
45
|
+
const [innerCollapsed, setInnerCollapsed] = useState(defaultCollapsed);
|
|
46
|
+
const collapsed = collapsible && (collapsedProp ?? innerCollapsed);
|
|
47
|
+
const toggle = useCallback(()=>{
|
|
48
|
+
const next = !collapsed;
|
|
49
|
+
if (collapsedProp === undefined) {
|
|
50
|
+
setInnerCollapsed(next);
|
|
51
|
+
}
|
|
52
|
+
onCollapsedChange?.(next);
|
|
53
|
+
}, [
|
|
54
|
+
collapsed,
|
|
55
|
+
collapsedProp,
|
|
56
|
+
onCollapsedChange
|
|
57
|
+
]);
|
|
58
|
+
const hasTitle = isPresent(title);
|
|
59
|
+
const labelsValue = useMemo(()=>({
|
|
60
|
+
...DEFAULT_SECTION_LABELS,
|
|
61
|
+
...labels
|
|
62
|
+
}), [
|
|
63
|
+
labels
|
|
64
|
+
]);
|
|
65
|
+
const ctx = useMemo(()=>({
|
|
66
|
+
tone,
|
|
67
|
+
density,
|
|
68
|
+
classNames,
|
|
69
|
+
labels: labelsValue,
|
|
70
|
+
headerLayout,
|
|
71
|
+
footerLayout,
|
|
72
|
+
divider,
|
|
73
|
+
footerDivider,
|
|
74
|
+
collapsible,
|
|
75
|
+
collapsed,
|
|
76
|
+
toggle,
|
|
77
|
+
headingId: hasTitle ? headingId : undefined,
|
|
78
|
+
bodyId
|
|
79
|
+
}), [
|
|
80
|
+
tone,
|
|
81
|
+
density,
|
|
82
|
+
classNames,
|
|
83
|
+
labelsValue,
|
|
84
|
+
headerLayout,
|
|
85
|
+
footerLayout,
|
|
86
|
+
divider,
|
|
87
|
+
footerDivider,
|
|
88
|
+
collapsible,
|
|
89
|
+
collapsed,
|
|
90
|
+
toggle,
|
|
91
|
+
hasTitle,
|
|
92
|
+
headingId,
|
|
93
|
+
bodyId
|
|
94
|
+
]);
|
|
95
|
+
const hasHeader = hasTitle || isPresent(description) || isPresent(actions) || isPresent(icon) || isPresent(header) || count !== undefined && count !== null && count !== '' || collapsible;
|
|
96
|
+
const hasFooter = isPresent(footer) || isPresent(footerActions);
|
|
97
|
+
const hasBody = isPresent(children);
|
|
98
|
+
const composed = Children.toArray(children).some((child)=>/*#__PURE__*/ isValidElement(child) && PART_TYPES.has(child.type));
|
|
99
|
+
return /*#__PURE__*/ _jsx(SectionContext.Provider, {
|
|
100
|
+
value: ctx,
|
|
101
|
+
children: /*#__PURE__*/ _jsxs(Root, {
|
|
102
|
+
id: id,
|
|
103
|
+
"aria-label": ariaLabel,
|
|
104
|
+
"aria-labelledby": !ariaLabel && hasTitle ? headingId : undefined,
|
|
105
|
+
"data-section-variant": variant,
|
|
106
|
+
className: cn('relative flex w-full min-w-0 flex-col text-(--section-fg,#fff)', tone === 'onLight' && TONE_ON_LIGHT, VARIANT[variant], variant === 'glass' && GLASS_FILL[tone], className, classNames.root),
|
|
107
|
+
children: [
|
|
108
|
+
hasHeader ? /*#__PURE__*/ _jsx(SectionHeader, {
|
|
109
|
+
title: title,
|
|
110
|
+
titleAs: titleAs,
|
|
111
|
+
titleSize: titleSize,
|
|
112
|
+
icon: icon,
|
|
113
|
+
description: description,
|
|
114
|
+
count: count,
|
|
115
|
+
actions: actions,
|
|
116
|
+
children: header
|
|
117
|
+
}) : null,
|
|
118
|
+
hasBody ? composed ? children : /*#__PURE__*/ _jsx(SectionBody, {
|
|
119
|
+
flush: bodyFlush,
|
|
120
|
+
maxHeight: bodyMaxHeight,
|
|
121
|
+
children: children
|
|
122
|
+
}) : null,
|
|
123
|
+
hasFooter ? /*#__PURE__*/ _jsx(SectionFooter, {
|
|
124
|
+
actions: footerActions,
|
|
125
|
+
children: footer
|
|
126
|
+
}) : null
|
|
127
|
+
]
|
|
128
|
+
})
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* `Section` — squelette en-tête / corps / pied. Les parties sont aussi
|
|
133
|
+
* disponibles en statiques : `Section.Header`, `Section.Body`, `Section.Footer`,
|
|
134
|
+
* `Section.Divider`, `Section.Action`, `Section.Grid`.
|
|
135
|
+
*/ export const Section = Object.assign(SectionRoot, {
|
|
136
|
+
Header: SectionHeader,
|
|
137
|
+
Body: SectionBody,
|
|
138
|
+
Footer: SectionFooter,
|
|
139
|
+
Divider: SectionDivider,
|
|
140
|
+
Action: SectionAction,
|
|
141
|
+
Grid: SectionGrid
|
|
142
|
+
}); /* ============================================================================
|
|
143
|
+
* GUIDE D'UTILISATION — Section
|
|
144
|
+
* ============================================================================
|
|
145
|
+
* Cas courant — raccourcis `title` / `actions` / `footer` :
|
|
146
|
+
*
|
|
147
|
+
* <Section
|
|
148
|
+
* title="Actualités"
|
|
149
|
+
* count={8}
|
|
150
|
+
* actions={<SectionAction onClick={...}>Voir tout</SectionAction>}
|
|
151
|
+
* footer="6 articles sur 8"
|
|
152
|
+
* footerActions={<SectionAction size="sm" href="/informations/news">Tout lire →</SectionAction>}
|
|
153
|
+
* >
|
|
154
|
+
* <SectionGrid minItemWidth="16rem" gap="lg">{cards}</SectionGrid>
|
|
155
|
+
* </Section>
|
|
156
|
+
*
|
|
157
|
+
* Filtres dans l'en-tête (plusieurs SectionAction avec `active`) :
|
|
158
|
+
*
|
|
159
|
+
* <Section title="Annonces" actions={levels.map((l) => (
|
|
160
|
+
* <SectionAction key={l} size="sm" active={l === level} onClick={() => setLevel(l)}>{l}</SectionAction>
|
|
161
|
+
* ))}>…</Section>
|
|
162
|
+
*
|
|
163
|
+
* Disposition de l'en-tête / du pied :
|
|
164
|
+
*
|
|
165
|
+
* <Section headerLayout="stacked" footerLayout="center" …>
|
|
166
|
+
*
|
|
167
|
+
* En-tête libre (remplace titre + description + actions) :
|
|
168
|
+
*
|
|
169
|
+
* <Section header={<MyToolbar />}>…</Section>
|
|
170
|
+
*
|
|
171
|
+
* Composition manuelle — dès qu'un enfant est une partie, rien n'est
|
|
172
|
+
* enveloppé automatiquement, vous placez chaque partie où vous voulez :
|
|
173
|
+
*
|
|
174
|
+
* <Section ariaLabel="Équipe" collapsible>
|
|
175
|
+
* <Section.Header title="Équipe" actions={…} />
|
|
176
|
+
* <Section.Body maxHeight="20rem">…</Section.Body>
|
|
177
|
+
* <Section.Footer layout="end">…</Section.Footer>
|
|
178
|
+
* </Section>
|
|
179
|
+
*
|
|
180
|
+
* Repli : `collapsible` (+ `defaultCollapsed`, ou `collapsed` /
|
|
181
|
+
* `onCollapsedChange` en mode contrôlé). Un `Section` replié ne montre que
|
|
182
|
+
* son en-tête.
|
|
183
|
+
*
|
|
184
|
+
* Personnalisation fine :
|
|
185
|
+
* - `classNames={{ title: '…', divider: '…', body: '…' }}` pour chaque partie ;
|
|
186
|
+
* - variables CSS `--section-fg`, `--section-muted`, `--section-line`,
|
|
187
|
+
* `--section-accent` (via `style` ou une classe) ;
|
|
188
|
+
* - `tone="onLight"` pour un fond clair, `variant="glass"` pour un panneau
|
|
189
|
+
* vitré, `density="compact" | "spacious"` pour les espacements.
|
|
190
|
+
*
|
|
191
|
+
* Sans trait : `divider={false}` (sous l'en-tête) / `footerDivider={false}`.
|
|
192
|
+
* ==========================================================================*/
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { SectionClassNames, SectionDensity, SectionFooterLayout, SectionHeaderLayout, SectionLabels, SectionTone } from './section.types.js';
|
|
2
|
+
export interface SectionContextValue {
|
|
3
|
+
tone: SectionTone;
|
|
4
|
+
density: SectionDensity;
|
|
5
|
+
classNames: SectionClassNames;
|
|
6
|
+
labels: SectionLabels;
|
|
7
|
+
headerLayout: SectionHeaderLayout;
|
|
8
|
+
footerLayout: SectionFooterLayout;
|
|
9
|
+
divider: boolean;
|
|
10
|
+
footerDivider: boolean;
|
|
11
|
+
collapsible: boolean;
|
|
12
|
+
collapsed: boolean;
|
|
13
|
+
toggle: () => void;
|
|
14
|
+
headingId?: string;
|
|
15
|
+
bodyId?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const DEFAULT_SECTION_LABELS: SectionLabels;
|
|
18
|
+
/** Valeurs par défaut : permet d'utiliser les parties hors d'un `Section`. */
|
|
19
|
+
export declare const SectionContext: import("react").Context<SectionContextValue>;
|
|
20
|
+
export declare function useSectionContext(): SectionContextValue;
|
|
21
|
+
//# sourceMappingURL=section.context.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section.context.d.ts","sourceRoot":"","sources":["../../src/section/section.context.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,iBAAiB,EACjB,cAAc,EACd,mBAAmB,EACnB,mBAAmB,EACnB,aAAa,EACb,WAAW,EACZ,MAAM,oBAAoB,CAAC;AAE5B,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,EAAE,cAAc,CAAC;IACxB,UAAU,EAAE,iBAAiB,CAAC;IAC9B,MAAM,EAAE,aAAa,CAAC;IACtB,YAAY,EAAE,mBAAmB,CAAC;IAClC,YAAY,EAAE,mBAAmB,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;IACnB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,eAAO,MAAM,sBAAsB,EAAE,aAGpC,CAAC;AAEF,8EAA8E;AAC9E,eAAO,MAAM,cAAc,8CAYzB,CAAC;AAEH,wBAAgB,iBAAiB,IAAI,mBAAmB,CAEvD"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/** @category Section */ import { createContext, useContext } from "react";
|
|
2
|
+
export const DEFAULT_SECTION_LABELS = {
|
|
3
|
+
collapse: 'Replier la section',
|
|
4
|
+
expand: 'Déplier la section'
|
|
5
|
+
};
|
|
6
|
+
/** Valeurs par défaut : permet d'utiliser les parties hors d'un `Section`. */ export const SectionContext = createContext({
|
|
7
|
+
tone: 'onDark',
|
|
8
|
+
density: 'comfortable',
|
|
9
|
+
classNames: {},
|
|
10
|
+
labels: DEFAULT_SECTION_LABELS,
|
|
11
|
+
headerLayout: 'split',
|
|
12
|
+
footerLayout: 'between',
|
|
13
|
+
divider: true,
|
|
14
|
+
footerDivider: true,
|
|
15
|
+
collapsible: false,
|
|
16
|
+
collapsed: false,
|
|
17
|
+
toggle: ()=>undefined
|
|
18
|
+
});
|
|
19
|
+
export function useSectionContext() {
|
|
20
|
+
return useContext(SectionContext);
|
|
21
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/** @category Section */
|
|
2
|
+
import type React from 'react';
|
|
3
|
+
/** `onDark` : texte clair (fond de page sombre, cas par défaut). `onLight` : texte foncé. */
|
|
4
|
+
export type SectionTone = 'onDark' | 'onLight';
|
|
5
|
+
/** `plain` : aucun habillage (défaut). `glass` : panneau vitré, opt-in. */
|
|
6
|
+
export type SectionVariant = 'plain' | 'glass';
|
|
7
|
+
/** Espacement vertical entre en-tête, corps et pied. */
|
|
8
|
+
export type SectionDensity = 'compact' | 'comfortable' | 'spacious';
|
|
9
|
+
export type SectionTitleSize = 'sm' | 'md' | 'lg';
|
|
10
|
+
export type SectionTitleTag = 'h1' | 'h2' | 'h3' | 'h4' | 'div';
|
|
11
|
+
export type SectionRootTag = 'section' | 'div' | 'aside' | 'article';
|
|
12
|
+
/**
|
|
13
|
+
* Disposition de l'en-tête.
|
|
14
|
+
* - `split` (défaut) : titre à gauche, actions à droite (passent dessous si la place manque).
|
|
15
|
+
* - `stacked` : titre puis actions en dessous, alignés à gauche.
|
|
16
|
+
* - `centered` : titre puis actions en dessous, centrés.
|
|
17
|
+
*/
|
|
18
|
+
export type SectionHeaderLayout = 'split' | 'stacked' | 'centered';
|
|
19
|
+
/**
|
|
20
|
+
* Disposition du pied.
|
|
21
|
+
* - `between` (défaut) : contenu à gauche, actions à droite.
|
|
22
|
+
* - `start` | `center` | `end` : tout regroupé de ce côté.
|
|
23
|
+
*/
|
|
24
|
+
export type SectionFooterLayout = 'between' | 'start' | 'center' | 'end';
|
|
25
|
+
/** Classes additionnelles par partie (fusionnées après les classes par défaut). */
|
|
26
|
+
export interface SectionClassNames {
|
|
27
|
+
root?: string;
|
|
28
|
+
header?: string;
|
|
29
|
+
leading?: string;
|
|
30
|
+
heading?: string;
|
|
31
|
+
title?: string;
|
|
32
|
+
description?: string;
|
|
33
|
+
count?: string;
|
|
34
|
+
actions?: string;
|
|
35
|
+
divider?: string;
|
|
36
|
+
body?: string;
|
|
37
|
+
footer?: string;
|
|
38
|
+
footerStart?: string;
|
|
39
|
+
footerEnd?: string;
|
|
40
|
+
}
|
|
41
|
+
/** Libellés accessibles du bouton replier/déplier. Doivent être déjà traduits. */
|
|
42
|
+
export interface SectionLabels {
|
|
43
|
+
collapse: string;
|
|
44
|
+
expand: string;
|
|
45
|
+
}
|
|
46
|
+
export interface SectionHeaderProps {
|
|
47
|
+
/** Titre de la section (à gauche en disposition `split`). */
|
|
48
|
+
title?: React.ReactNode;
|
|
49
|
+
/** Balise du titre. @default 'h2' */
|
|
50
|
+
titleAs?: SectionTitleTag;
|
|
51
|
+
/** Taille typographique du titre. @default 'md' */
|
|
52
|
+
titleSize?: SectionTitleSize;
|
|
53
|
+
/** Icône ou visuel placé avant le titre. */
|
|
54
|
+
icon?: React.ReactNode;
|
|
55
|
+
/** Texte descriptif sous le titre. */
|
|
56
|
+
description?: React.ReactNode;
|
|
57
|
+
/** Compteur affiché en pastille après le titre (masqué si `undefined`/`null`). */
|
|
58
|
+
count?: number | string | null;
|
|
59
|
+
/** Boutons de contrôle, filtres, menus... (à droite en disposition `split`). */
|
|
60
|
+
actions?: React.ReactNode;
|
|
61
|
+
/** Remplace entièrement titre/description/actions par un contenu libre. */
|
|
62
|
+
children?: React.ReactNode;
|
|
63
|
+
/** Surcharge la disposition définie sur `Section`. */
|
|
64
|
+
layout?: SectionHeaderLayout;
|
|
65
|
+
/** Trait fin sous l'en-tête. Surcharge la valeur de `Section`. */
|
|
66
|
+
divider?: boolean;
|
|
67
|
+
className?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface SectionBodyProps {
|
|
70
|
+
children?: React.ReactNode;
|
|
71
|
+
/** Supprime l'espacement entre le trait de l'en-tête et le contenu. @default false */
|
|
72
|
+
flush?: boolean;
|
|
73
|
+
/** Hauteur max (ex. `'24rem'`) : au-delà, le corps défile verticalement. */
|
|
74
|
+
maxHeight?: string;
|
|
75
|
+
className?: string;
|
|
76
|
+
}
|
|
77
|
+
export interface SectionFooterProps {
|
|
78
|
+
/** Contenu principal (à gauche en disposition `between`). */
|
|
79
|
+
children?: React.ReactNode;
|
|
80
|
+
/** Actions (à droite en disposition `between`). */
|
|
81
|
+
actions?: React.ReactNode;
|
|
82
|
+
/** Surcharge la disposition définie sur `Section`. */
|
|
83
|
+
layout?: SectionFooterLayout;
|
|
84
|
+
/** Trait fin au-dessus du pied. Surcharge la valeur de `Section`. */
|
|
85
|
+
divider?: boolean;
|
|
86
|
+
className?: string;
|
|
87
|
+
}
|
|
88
|
+
export interface SectionProps {
|
|
89
|
+
id?: string;
|
|
90
|
+
/** Balise racine. @default 'section' */
|
|
91
|
+
as?: SectionRootTag;
|
|
92
|
+
/** Libellé accessible si le titre visuel ne suffit pas. */
|
|
93
|
+
ariaLabel?: string;
|
|
94
|
+
variant?: SectionVariant;
|
|
95
|
+
tone?: SectionTone;
|
|
96
|
+
density?: SectionDensity;
|
|
97
|
+
title?: React.ReactNode;
|
|
98
|
+
titleAs?: SectionTitleTag;
|
|
99
|
+
titleSize?: SectionTitleSize;
|
|
100
|
+
icon?: React.ReactNode;
|
|
101
|
+
description?: React.ReactNode;
|
|
102
|
+
count?: number | string | null;
|
|
103
|
+
actions?: React.ReactNode;
|
|
104
|
+
/** Contenu libre qui remplace titre/description/actions. */
|
|
105
|
+
header?: React.ReactNode;
|
|
106
|
+
/** @default 'split' */
|
|
107
|
+
headerLayout?: SectionHeaderLayout;
|
|
108
|
+
/** Trait fin sous l'en-tête. @default true */
|
|
109
|
+
divider?: boolean;
|
|
110
|
+
/** Contenu du pied (à gauche en disposition `between`). Pas de pied si absent. */
|
|
111
|
+
footer?: React.ReactNode;
|
|
112
|
+
/** Actions du pied (à droite en disposition `between`). */
|
|
113
|
+
footerActions?: React.ReactNode;
|
|
114
|
+
/** @default 'between' */
|
|
115
|
+
footerLayout?: SectionFooterLayout;
|
|
116
|
+
/** Trait fin au-dessus du pied. @default true */
|
|
117
|
+
footerDivider?: boolean;
|
|
118
|
+
/** Hauteur max du corps (défile au-delà). */
|
|
119
|
+
bodyMaxHeight?: string;
|
|
120
|
+
/** Supprime l'espacement entre le trait de l'en-tête et le contenu. */
|
|
121
|
+
bodyFlush?: boolean;
|
|
122
|
+
/** Affiche un bouton replier/déplier dans l'en-tête. @default false */
|
|
123
|
+
collapsible?: boolean;
|
|
124
|
+
/** État replié (mode contrôlé). */
|
|
125
|
+
collapsed?: boolean;
|
|
126
|
+
/** État replié initial (mode non contrôlé). @default false */
|
|
127
|
+
defaultCollapsed?: boolean;
|
|
128
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
129
|
+
/** @default { collapse: 'Replier la section', expand: 'Déplier la section' } */
|
|
130
|
+
labels?: Partial<SectionLabels>;
|
|
131
|
+
className?: string;
|
|
132
|
+
classNames?: SectionClassNames;
|
|
133
|
+
/**
|
|
134
|
+
* Contenu du corps. Si les enfants contiennent déjà `SectionHeader`,
|
|
135
|
+
* `SectionBody` ou `SectionFooter`, ils sont rendus tels quels (composition
|
|
136
|
+
* manuelle) ; sinon ils sont enveloppés dans un `SectionBody`.
|
|
137
|
+
*/
|
|
138
|
+
children?: React.ReactNode;
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=section.types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"section.types.d.ts","sourceRoot":"","sources":["../../src/section/section.types.ts"],"names":[],"mappings":"AAAA,wBAAwB;AACxB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,6FAA6F;AAC7F,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,SAAS,CAAC;AAC/C,2EAA2E;AAC3E,MAAM,MAAM,cAAc,GAAG,OAAO,GAAG,OAAO,CAAC;AAC/C,wDAAwD;AACxD,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC;AACpE,MAAM,MAAM,gBAAgB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAClD,MAAM,MAAM,eAAe,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,KAAK,CAAC;AAChE,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,KAAK,GAAG,OAAO,GAAG,SAAS,CAAC;AAErE;;;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,CAAC,SAAS,CAAC;IAC9B,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC/B,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,4DAA4D;IAC5D,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,uBAAuB;IACvB,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,8CAA8C;IAC9C,OAAO,CAAC,EAAE,OAAO,CAAC;IAGlB,kFAAkF;IAClF,MAAM,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IACzB,2DAA2D;IAC3D,aAAa,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAChC,yBAAyB;IACzB,YAAY,CAAC,EAAE,mBAAmB,CAAC;IACnC,iDAAiD;IACjD,aAAa,CAAC,EAAE,OAAO,CAAC;IAGxB,6CAA6C;IAC7C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,SAAS,CAAC,EAAE,OAAO,CAAC;IAGpB,uEAAuE;IACvE,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,mCAAmC;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,8DAA8D;IAC9D,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,iBAAiB,CAAC,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAC;IACjD,gFAAgF;IAChF,MAAM,CAAC,EAAE,OAAO,CAAC,aAAa,CAAC,CAAC;IAEhC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,iBAAiB,CAAC;IAC/B;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/** @category Section */ export { };
|
|
@@ -4,6 +4,6 @@ import React from 'react';
|
|
|
4
4
|
* gauche ; en bas, celles affichées dans la zone basse (ex. terminal).
|
|
5
5
|
*/
|
|
6
6
|
export declare function LeftRail(): React.JSX.Element;
|
|
7
|
-
/** Rail droit (fixe) : options globales,
|
|
7
|
+
/** Rail droit (fixe) : options globales en haut (zone droite) ; en bas, celles qui ouvrent la zone basse. */
|
|
8
8
|
export declare function RightRail(): React.JSX.Element;
|
|
9
9
|
//# sourceMappingURL=tool-window-rail.component.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-window-rail.component.d.ts","sourceRoot":"","sources":["../../src/workbench/tool-window-rail.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAyD1B;;;GAGG;AACH,wBAAgB,QAAQ,sBAQvB;AAED,
|
|
1
|
+
{"version":3,"file":"tool-window-rail.component.d.ts","sourceRoot":"","sources":["../../src/workbench/tool-window-rail.component.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAyD1B;;;GAGG;AACH,wBAAgB,QAAQ,sBAQvB;AAED,6GAA6G;AAC7G,wBAAgB,SAAS,sBAQxB"}
|
|
@@ -6,8 +6,8 @@ import { toolWindowTitle, useToolWindows } from "./use-tool-windows.js";
|
|
|
6
6
|
import { toggleToolWindow, workbenchStore } from "./workbench.store.js";
|
|
7
7
|
import { formatToolWindowBadge, workbenchBadgeStore } from "./workbench-badges.js";
|
|
8
8
|
import styles from "./workbench.module.scss";
|
|
9
|
-
function RailGroup({ anchor, label }) {
|
|
10
|
-
const tools = useToolWindows(anchor);
|
|
9
|
+
function RailGroup({ anchor, label, rail }) {
|
|
10
|
+
const tools = useToolWindows(anchor, rail);
|
|
11
11
|
// NB : `useStore` retourne toujours un objet (état étalé) : on lit l'état entier, jamais une valeur primitive.
|
|
12
12
|
const { active } = useStore(workbenchStore);
|
|
13
13
|
const activeId = active[anchor];
|
|
@@ -71,19 +71,30 @@ function RailButton({ tool, active, onClick }) {
|
|
|
71
71
|
}),
|
|
72
72
|
/*#__PURE__*/ _jsx(RailGroup, {
|
|
73
73
|
anchor: "bottom",
|
|
74
|
+
rail: "left",
|
|
74
75
|
label: "Panneau inférieur"
|
|
75
76
|
})
|
|
76
77
|
]
|
|
77
78
|
});
|
|
78
79
|
}
|
|
79
|
-
/** Rail droit (fixe) : options globales,
|
|
80
|
-
return /*#__PURE__*/
|
|
80
|
+
/** Rail droit (fixe) : options globales en haut (zone droite) ; en bas, celles qui ouvrent la zone basse. */ export function RightRail() {
|
|
81
|
+
return /*#__PURE__*/ _jsxs("nav", {
|
|
81
82
|
"aria-label": "Outils globaux",
|
|
82
83
|
"data-testid": "workbench-rail-right",
|
|
83
84
|
className: styles.rail,
|
|
84
|
-
children:
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
85
|
+
children: [
|
|
86
|
+
/*#__PURE__*/ _jsx(RailGroup, {
|
|
87
|
+
anchor: "right",
|
|
88
|
+
label: "Panneau droit"
|
|
89
|
+
}),
|
|
90
|
+
/*#__PURE__*/ _jsx("span", {
|
|
91
|
+
className: styles.railSpacer
|
|
92
|
+
}),
|
|
93
|
+
/*#__PURE__*/ _jsx(RailGroup, {
|
|
94
|
+
anchor: "bottom",
|
|
95
|
+
rail: "right",
|
|
96
|
+
label: "Panneau inférieur"
|
|
97
|
+
})
|
|
98
|
+
]
|
|
88
99
|
});
|
|
89
100
|
}
|
|
@@ -13,6 +13,7 @@ export declare function toolWindowTitle({ moduleName, meta }: ToolWindow): strin
|
|
|
13
13
|
* Zones `left` et `bottom` : celles de l'app active (le rail change avec l'app) et celles qui
|
|
14
14
|
* déclarent `meta.global` (toujours présentes).
|
|
15
15
|
* Zone `right` : globale, toujours toutes les extensions déclarées.
|
|
16
|
+
* Zone `bottom` + `rail` : ne garde que les entrées portées par ce rail (`meta.rail`, défaut `left`).
|
|
16
17
|
*/
|
|
17
|
-
export declare function useToolWindows(anchor: ToolWindowAnchor): ToolWindow[];
|
|
18
|
+
export declare function useToolWindows(anchor: ToolWindowAnchor, rail?: 'left' | 'right'): ToolWindow[];
|
|
18
19
|
//# sourceMappingURL=use-tool-windows.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-tool-windows.d.ts","sourceRoot":"","sources":["../../src/workbench/use-tool-windows.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AAKtC,MAAM,WAAW,UAAU;IACzB,4EAA4E;IAC5E,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,UAAU,GAAG,MAAM,CAExE;AAED
|
|
1
|
+
{"version":3,"file":"use-tool-windows.d.ts","sourceRoot":"","sources":["../../src/workbench/use-tool-windows.ts"],"names":[],"mappings":"AACA,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACpB,MAAM,8BAA8B,CAAC;AAKtC,MAAM,WAAW,UAAU;IACzB,4EAA4E;IAC5E,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,cAAc,CAAC;CACtB;AAED,sFAAsF;AACtF,wBAAgB,eAAe,CAAC,EAAE,UAAU,EAAE,IAAI,EAAE,EAAE,UAAU,GAAG,MAAM,CAExE;AAED;;;;;;;GAOG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,UAAU,EAAE,CA+B9F"}
|
|
@@ -12,13 +12,14 @@ import { useActiveAppModules } from "./use-active-app-modules.js";
|
|
|
12
12
|
* Zones `left` et `bottom` : celles de l'app active (le rail change avec l'app) et celles qui
|
|
13
13
|
* déclarent `meta.global` (toujours présentes).
|
|
14
14
|
* Zone `right` : globale, toujours toutes les extensions déclarées.
|
|
15
|
-
|
|
15
|
+
* Zone `bottom` + `rail` : ne garde que les entrées portées par ce rail (`meta.rail`, défaut `left`).
|
|
16
|
+
*/ export function useToolWindows(anchor, rail) {
|
|
16
17
|
const assigned = useAssignedExtensions(TOOL_WINDOW_SLOTS[anchor]);
|
|
17
18
|
const activeModules = useActiveAppModules();
|
|
18
19
|
return useMemo(()=>assigned.map((extension, index)=>({
|
|
19
20
|
extension,
|
|
20
21
|
index
|
|
21
|
-
})).filter(({ extension })=>isToolWindowMeta(extension.meta)).filter(({ extension })=>anchor === 'right' || extension.meta.global === true || activeModules.has(extension.moduleName)).sort((a, b)=>{
|
|
22
|
+
})).filter(({ extension })=>isToolWindowMeta(extension.meta)).filter(({ extension })=>!rail || anchor !== 'bottom' || (extension.meta.rail ?? 'left') === rail).filter(({ extension })=>anchor === 'right' || extension.meta.global === true || activeModules.has(extension.moduleName)).sort((a, b)=>{
|
|
22
23
|
const orderA = a.extension.meta.order ?? a.index;
|
|
23
24
|
const orderB = b.extension.meta.order ?? b.index;
|
|
24
25
|
return orderA - orderB || a.index - b.index;
|
|
@@ -29,6 +30,7 @@ import { useActiveAppModules } from "./use-active-app-modules.js";
|
|
|
29
30
|
})), [
|
|
30
31
|
assigned,
|
|
31
32
|
activeModules,
|
|
32
|
-
anchor
|
|
33
|
+
anchor,
|
|
34
|
+
rail
|
|
33
35
|
]);
|
|
34
36
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@egen-civitas/esm-styleguide",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.17.0",
|
|
4
4
|
"license": "MPL-2.0",
|
|
5
5
|
"description": "The styleguide for Egen SPA",
|
|
6
6
|
"main": "dist/internal.js",
|
|
@@ -98,8 +98,8 @@
|
|
|
98
98
|
"@egen-civitas/esm-config": "^1.0.0",
|
|
99
99
|
"@egen-civitas/esm-data-api": "^1.0.2",
|
|
100
100
|
"@egen-civitas/esm-error-handling": "^1.0.0",
|
|
101
|
-
"@egen-civitas/esm-extensions": "^1.
|
|
102
|
-
"@egen-civitas/esm-globals": "^1.0.
|
|
101
|
+
"@egen-civitas/esm-extensions": "^1.5.0",
|
|
102
|
+
"@egen-civitas/esm-globals": "^1.0.3",
|
|
103
103
|
"@egen-civitas/esm-navigation": "^1.0.2",
|
|
104
104
|
"@egen-civitas/esm-react-utils": "^1.0.5",
|
|
105
105
|
"@egen-civitas/esm-routes": "^1.0.0",
|
|
@@ -121,8 +121,8 @@
|
|
|
121
121
|
"@egen-civitas/esm-data-api": "^1.0.2",
|
|
122
122
|
"@egen-civitas/esm-error-handling": "^1.0.0",
|
|
123
123
|
"@egen-civitas/esm-expression-evaluator": "^1.0.0",
|
|
124
|
-
"@egen-civitas/esm-extensions": "^1.
|
|
125
|
-
"@egen-civitas/esm-globals": "^1.0.
|
|
124
|
+
"@egen-civitas/esm-extensions": "^1.5.0",
|
|
125
|
+
"@egen-civitas/esm-globals": "^1.0.3",
|
|
126
126
|
"@egen-civitas/esm-navigation": "^1.0.2",
|
|
127
127
|
"@egen-civitas/esm-react-utils": "^1.0.5",
|
|
128
128
|
"@egen-civitas/esm-routes": "^1.0.0",
|