@sentropic/design-system-react 0.1.0 → 0.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.
@@ -0,0 +1,20 @@
1
+ import React from "react";
2
+ export type BackToTopProps = Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className"> & {
3
+ label?: string;
4
+ disabled?: boolean;
5
+ targetId?: string;
6
+ threshold?: number;
7
+ autoHide?: boolean;
8
+ smooth?: boolean;
9
+ className?: string;
10
+ };
11
+ export declare const BackToTop: React.ForwardRefExoticComponent<Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, "className"> & {
12
+ label?: string;
13
+ disabled?: boolean;
14
+ targetId?: string;
15
+ threshold?: number;
16
+ autoHide?: boolean;
17
+ smooth?: boolean;
18
+ className?: string;
19
+ } & React.RefAttributes<HTMLButtonElement>>;
20
+ //# sourceMappingURL=BackToTop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BackToTop.d.ts","sourceRoot":"","sources":["../src/BackToTop.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,oBAAoB,CAAC,iBAAiB,CAAC,EAAE,WAAW,CAAC,GAAG;IAC9F,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAsBF,eAAO,MAAM,SAAS;YA7BZ,MAAM;eACH,OAAO;eACP,MAAM;gBACL,MAAM;eACP,OAAO;aACT,OAAO;gBACJ,MAAM;2CAoGnB,CAAC"}
@@ -0,0 +1,44 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { classNames } from "./classNames.js";
4
+ function ArrowUpIcon() {
5
+ return (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: 16, height: 16, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("path", { d: "m5 12 7-7 7 7" }), _jsx("path", { d: "M12 19V5" })] }));
6
+ }
7
+ export const BackToTop = React.forwardRef(({ label = "Retour en haut", targetId = "top", threshold = 240, autoHide = true, smooth = true, disabled = false, className, ...rest }, ref) => {
8
+ const normalizedTarget = targetId ? `#${targetId.replace(/^#/, "")}` : "#top";
9
+ const [visible, setVisible] = React.useState(!autoHide);
10
+ React.useEffect(() => {
11
+ if (!autoHide || typeof window === "undefined") {
12
+ setVisible(true);
13
+ return;
14
+ }
15
+ const updateVisibility = () => {
16
+ setVisible(window.scrollY > threshold);
17
+ };
18
+ updateVisibility();
19
+ window.addEventListener("scroll", updateVisibility, { passive: true });
20
+ return () => {
21
+ window.removeEventListener("scroll", updateVisibility);
22
+ };
23
+ }, [autoHide, threshold]);
24
+ const goTop = () => {
25
+ const target = normalizedTarget;
26
+ const anchor = target.startsWith("#") ? target.slice(1) : target;
27
+ const element = anchor ? document.getElementById(anchor) : null;
28
+ if (element) {
29
+ element.scrollIntoView({
30
+ behavior: smooth ? "smooth" : "auto",
31
+ block: "start",
32
+ });
33
+ return;
34
+ }
35
+ window.scrollTo({
36
+ top: 0,
37
+ behavior: smooth ? "smooth" : "auto",
38
+ });
39
+ };
40
+ const hidden = autoHide && !visible;
41
+ return (_jsxs("button", { ...rest, ref: ref, type: "button", className: classNames("st-backToTop", className), onClick: goTop, "aria-label": label, "aria-hidden": hidden || undefined, "aria-live": hidden ? "polite" : undefined, tabIndex: hidden ? -1 : undefined, disabled: disabled, children: [_jsx("span", { className: "st-backToTop__icon", "aria-hidden": "true", children: _jsx(ArrowUpIcon, {}) }), _jsx("span", { className: "st-backToTop__label", children: label })] }));
42
+ });
43
+ BackToTop.displayName = "BackToTop";
44
+ //# sourceMappingURL=BackToTop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BackToTop.js","sourceRoot":"","sources":["../src/BackToTop.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAY7C,SAAS,WAAW;IAClB,OAAO,CACL,eACE,KAAK,EAAC,4BAA4B,EAClC,KAAK,EAAE,EAAE,EACT,MAAM,EAAE,EAAE,EACV,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAE,CAAC,EACd,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,aAElB,eAAM,CAAC,EAAC,eAAe,GAAG,EAC1B,eAAM,CAAC,EAAC,UAAU,GAAG,IACjB,CACP,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,SAAS,GAAG,KAAK,CAAC,UAAU,CACvC,CACE,EACE,KAAK,GAAG,gBAAgB,EACxB,QAAQ,GAAG,KAAK,EAChB,SAAS,GAAG,GAAG,EACf,QAAQ,GAAG,IAAI,EACf,MAAM,GAAG,IAAI,EACb,QAAQ,GAAG,KAAK,EAChB,SAAS,EACT,GAAG,IAAI,EACR,EACD,GAAG,EACH,EAAE;IACF,MAAM,gBAAgB,GAAG,QAAQ,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC;IAE9E,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;IAExD,KAAK,CAAC,SAAS,CAAC,GAAG,EAAE;QACnB,IAAI,CAAC,QAAQ,IA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AAG,QAAQ,IAAI,CAAC,OAAO,CAAC;IAEpC,OAAO,CACL,qBACM,IAAI,EACR,GAAG,EAAE,GAAG,EACR,IAAI,EAAC,QAAQ,EACb,SAAS,EAAE,UAAU,CAAC,cAAc,EAAE,SAAS,CAAC,EAChD,OAAO,EAAE,KAAK,gBACF,KAAK,iBACJ,MAAM,IAAI,SAAS,eACrB,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,EACxC,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EACjC,QAAQ,EAAE,QAAQ,aAElB,eAAM,SAAS,EAAC,oBAAoB,iBAAa,MAAM,YACrD,KAAC,WAAW,KAAG,GACV,EACP,eAAM,SAAS,EAAC,qBAAqB,YAAE,KAAK,GAAQ,IAC7C,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,SAAS,CAAC,WAAW,GAAG,WAAW,CAAC"}
@@ -0,0 +1,31 @@
1
+ import React from "react";
2
+ export type DisplayFontScale = "normal" | "large" | "extra-large";
3
+ export type DisplayContrast = "default" | "high";
4
+ export type DisplayLineSpacing = "normal" | "comfortable";
5
+ export interface DisplaySettingsState {
6
+ fontScale: DisplayFontScale;
7
+ contrast: DisplayContrast;
8
+ lineSpacing: DisplayLineSpacing;
9
+ reducedMotion: boolean;
10
+ }
11
+ export type DisplaySettingsProps = Omit<React.HTMLAttributes<HTMLElement>, "className" | "children" | "onChange"> & {
12
+ title?: string;
13
+ values?: Partial<DisplaySettingsState>;
14
+ showFontScale?: boolean;
15
+ showContrast?: boolean;
16
+ showLineSpacing?: boolean;
17
+ showReducedMotion?: boolean;
18
+ onChange?: (settings: DisplaySettingsState) => void;
19
+ className?: string;
20
+ };
21
+ export declare const DisplaySettings: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement>, "className" | "children" | "onChange"> & {
22
+ title?: string;
23
+ values?: Partial<DisplaySettingsState>;
24
+ showFontScale?: boolean;
25
+ showContrast?: boolean;
26
+ showLineSpacing?: boolean;
27
+ showReducedMotion?: boolean;
28
+ onChange?: (settings: DisplaySettingsState) => void;
29
+ className?: string;
30
+ } & React.RefAttributes<HTMLDivElement>>;
31
+ //# sourceMappingURL=DisplaySettings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DisplaySettings.d.ts","sourceRoot":"","sources":["../src/DisplaySettings.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,OAAO,GAAG,aAAa,CAAC;AAClE,MAAM,MAAM,eAAe,GAAG,SAAS,GAAG,MAAM,CAAC;AACjD,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,aAAa,CAAC;AAE1D,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,gBAAgB,CAAC;IAC5B,QAAQ,EAAE,eAAe,CAAC;IAC1B,WAAW,EAAE,kBAAkB,CAAC;IAChC,aAAa,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EACjC,WAAW,GAAG,UAAU,GAAG,UAAU,CACtC,GAAG;IACF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IACvC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,oBAAoB,KAAK,IAAI,CAAC;IACpD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AASF,eAAO,MAAM,eAAe;YAjBlB,MAAM;aACL,OAAO,CAAC,oBAAoB,CAAC;oBACtB,OAAO;mBACR,OAAO;sBACJ,OAAO;wBACL,OAAO;eAChB,CAAC,QAAQ,EAAE,oBAAoB,KAAK,IAAI;gBACvC,MAAM;wCAsHnB,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { classNames } from "./classNames.js";
4
+ const DEFAULT_SETTINGS = {
5
+ fontScale: "normal",
6
+ contrast: "default",
7
+ lineSpacing: "normal",
8
+ reducedMotion: false,
9
+ };
10
+ export const DisplaySettings = React.forwardRef(({ title = "Paramètres d’affichage", values, showFontScale = true, showContrast = true, showLineSpacing = true, showReducedMotion = true, onChange, className, ...rest }, ref) => {
11
+ const resolved = {
12
+ fontScale: values?.fontScale ?? DEFAULT_SETTINGS.fontScale,
13
+ contrast: values?.contrast ?? DEFAULT_SETTINGS.contrast,
14
+ lineSpacing: values?.lineSpacing ?? DEFAULT_SETTINGS.lineSpacing,
15
+ reducedMotion: values?.reducedMotion ?? DEFAULT_SETTINGS.reducedMotion,
16
+ };
17
+ const [state, setState] = React.useState(resolved);
18
+ React.useEffect(() => {
19
+ setState((prev) => prev.fontScale === resolved.fontScale &&
20
+ prev.contrast === resolved.contrast &&
21
+ prev.lineSpacing === resolved.lineSpacing &&
22
+ prev.reducedMotion === resolved.reducedMotion
23
+ ? prev
24
+ : { ...prev, ...resolved });
25
+ // eslint-disable-next-line react-hooks/exhaustive-deps
26
+ }, [resolved.fontScale, resolved.contrast, resolved.lineSpacing, resolved.reducedMotion]);
27
+ const update = (next) => {
28
+ const merged = { ...state, ...next };
29
+ setState(merged);
30
+ onChange?.(merged);
31
+ };
32
+ return (_jsxs("div", { ...rest, ref: ref, className: classNames("st-displaySettings", className), children: [_jsx("p", { className: "st-displaySettings__title", children: title }), _jsxs("div", { className: "st-displaySettings__grid", children: [showFontScale ? (_jsxs("label", { className: "st-displaySettings__field", children: [_jsx("span", { className: "st-displaySettings__label", children: "Taille de texte" }), _jsxs("select", { value: state.fontScale, onChange: (event) => update({ fontScale: event.currentTarget.value }), children: [_jsx("option", { value: "normal", children: "Normale" }), _jsx("option", { value: "large", children: "Grande" }), _jsx("option", { value: "extra-large", children: "Tr\u00E8s grande" })] })] })) : null, showContrast ? (_jsxs("label", { className: "st-displaySettings__field", children: [_jsx("span", { className: "st-displaySettings__label", children: "Contraste" }), _jsxs("select", { value: state.contrast, onChange: (event) => update({ contrast: event.currentTarget.value }), children: [_jsx("option", { value: "default", children: "Standard" }), _jsx("option", { value: "high", children: "\u00C9lev\u00E9" })] })] })) : null, showLineSpacing ? (_jsxs("label", { className: "st-displaySettings__field", children: [_jsx("span", { className: "st-displaySettings__label", children: "Interligne" }), _jsxs("select", { value: state.lineSpacing, onChange: (event) => update({ lineSpacing: event.currentTarget.value }), children: [_jsx("option", { value: "normal", children: "Normal" }), _jsx("option", { value: "comfortable", children: "Confortable" })] })] })) : null, showReducedMotion ? (_jsxs("label", { className: "st-displaySettings__field st-displaySettings__field--switch", children: [_jsx("span", { className: "st-displaySettings__label", children: "Animations (r\u00E9duction)" }), _jsx("input", { type: "checkbox", role: "switch", checked: state.reducedMotion, onChange: (event) => update({ reducedMotion: event.currentTarget.checked }) })] })) : null] })] }));
33
+ });
34
+ DisplaySettings.displayName = "DisplaySettings";
35
+ //# sourceMappingURL=DisplaySettings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DisplaySettings.js","sourceRoot":"","sources":["../src/DisplaySettings.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AA2B7C,MAAM,gBAAgB,GAAyB;IAC7C,SAAS,EAAE,QAAQ;IACnB,QAAQ,EAAE,SAAS;IACnB,WAAW,EAAE,QAAQ;IACrB,aAAa,EAAE,KAAK;CACrB,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAC7C,CACE,EACE,KAAK,GAAG,wBAA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,kBACE,KAAK,EAAE,KAAK,CAAC,WAAW,EACxB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAClB,MAAM,CAAC,EAAE,WAAW,EAAE,KAAK,CAAC,aAAa,CAAC,KAA2B,EAAE,CAAC,aAG1E,iBAAQ,KAAK,EAAC,QAAQ,uBAAgB,EACtC,iBAAQ,KAAK,EAAC,aAAa,4BAAqB,IACzC,IACH,CACT,CAAC,CAAC,CAAC,IAAI,EAEP,iBAAiB,CAAC,CAAC,CAAC,CACnB,iBAAO,SAAS,EAAC,6DAA6D,aAC5E,eAAM,SAAS,EAAC,2BAA2B,4CAA8B,EACzE,gBACE,IAAI,EAAC,UAAU,EACf,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,KAAK,CAAC,aAAa,EAC5B,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,EAAE,aAAa,EAAE,KAAK,CAAC,aAAa,CAAC,OAAO,EAAE,CAAC,GAC3E,IACI,CACT,CAAC,CAAC,CAAC,IAAI,IACJ,IACF,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC"}
@@ -1,3 +1,3 @@
1
- export { ForceGraph } from "./catalog.js";
2
- export type { ForceGraphProps, ForceGraphNode, ForceGraphEdge, ForceGraphTone } from "./catalog.js";
1
+ export { ForceGraph, GraphLegend, nodeShapePath } from "./catalog.js";
2
+ export type { ForceGraphProps, ForceGraphNode, ForceGraphEdge, ForceGraphTone, ForceGraphNodeShape, ForceGraphLegendEntry, GraphLegendProps, } from "./catalog.js";
3
3
  //# sourceMappingURL=ForceGraph.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ForceGraph.d.ts","sourceRoot":"","sources":["../src/ForceGraph.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"ForceGraph.d.ts","sourceRoot":"","sources":["../src/ForceGraph.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AACtE,YAAY,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,cAAc,CAAC"}
@@ -1,2 +1,2 @@
1
- export { ForceGraph } from "./catalog.js";
1
+ export { ForceGraph, GraphLegend, nodeShapePath } from "./catalog.js";
2
2
  //# sourceMappingURL=ForceGraph.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ForceGraph.js","sourceRoot":"","sources":["../src/ForceGraph.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC"}
1
+ {"version":3,"file":"ForceGraph.js","sourceRoot":"","sources":["../src/ForceGraph.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,33 @@
1
+ import React from "react";
2
+ export type MediaKind = "image" | "video";
3
+ export type MediaContentProps = Omit<React.HTMLAttributes<HTMLElement>, "className" | "children"> & {
4
+ title?: string;
5
+ caption?: string;
6
+ byline?: string;
7
+ media?: string;
8
+ mediaAlt?: string;
9
+ mediaKind?: MediaKind;
10
+ mediaControls?: boolean;
11
+ aspectRatio?: string;
12
+ mediaCaptions?: string;
13
+ mediaCaptionsLabel?: string;
14
+ mediaCaptionsLang?: string;
15
+ className?: string;
16
+ children?: React.ReactNode;
17
+ };
18
+ export declare const MediaContent: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement>, "className" | "children"> & {
19
+ title?: string;
20
+ caption?: string;
21
+ byline?: string;
22
+ media?: string;
23
+ mediaAlt?: string;
24
+ mediaKind?: MediaKind;
25
+ mediaControls?: boolean;
26
+ aspectRatio?: string;
27
+ mediaCaptions?: string;
28
+ mediaCaptionsLabel?: string;
29
+ mediaCaptionsLang?: string;
30
+ className?: string;
31
+ children?: React.ReactNode;
32
+ } & React.RefAttributes<HTMLElement>>;
33
+ //# sourceMappingURL=MediaContent.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaContent.d.ts","sourceRoot":"","sources":["../src/MediaContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,OAAO,CAAC;AAE1C,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,UAAU,CAAC,GAAG;IAClG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,SAAS,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAIF,eAAO,MAAM,YAAY;YAjBf,MAAM;cACJ,MAAM;aACP,MAAM;YACP,MAAM;eACH,MAAM;gBACL,SAAS;oBACL,OAAO;kBACT,MAAM;oBACJ,MAAM;yBACD,MAAM;wBACP,MAAM;gBACd,MAAM;eACP,KAAK,CAAC,SAAS;qCAmE3B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { classNames } from "./classNames.js";
4
+ const DEFAULT_CAPTIONS = "data:text/vtt,WEBVTT";
5
+ export const MediaContent = React.forwardRef(({ title, caption, byline, media, mediaAlt = "", mediaKind = "image", mediaControls = true, aspectRatio = "16/9", mediaCaptions, mediaCaptionsLabel = "Français", mediaCaptionsLang = "fr", className, children, ...rest }, ref) => {
6
+ const hasMedia = Boolean(media?.trim());
7
+ return (_jsxs("figure", { ...rest, ref: ref, className: classNames("st-mediaContent", className), children: [_jsx("div", { className: "st-mediaContent__media", style: { "--st-mediaContent-ratio": aspectRatio }, children: hasMedia ? (mediaKind === "video" ? (_jsx("video", { controls: mediaControls, src: media, "aria-label": title || "Contenu média", preload: "metadata", children: _jsx("track", { kind: "captions", src: mediaCaptions ?? DEFAULT_CAPTIONS, srcLang: mediaCaptionsLang, label: mediaCaptionsLabel, default: true }) })) : (_jsx("img", { src: media, alt: mediaAlt, loading: "lazy", decoding: "async" }))) : (children) }), title || caption || byline ? (_jsxs("figcaption", { className: "st-mediaContent__caption", children: [title ? _jsx("p", { className: "st-mediaContent__title", children: title }) : null, caption ? _jsx("p", { children: caption }) : null, byline ? _jsx("p", { className: "st-mediaContent__byline", children: byline }) : null] })) : null] }));
8
+ });
9
+ MediaContent.displayName = "MediaContent";
10
+ //# sourceMappingURL=MediaContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MediaContent.js","sourceRoot":"","sources":["../src/MediaContent.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAoB7C,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAEhD,MAAM,CAAC,MAAM,YAAY,GAAG,KAAK,CAAC,UAAU,CAC1C,CACE,EACE,KAAK,EACL,OAAO,EACP,MAAM,EACN,KAAK,EACL,QAAQ,GAAG,EAAE,EACb,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ACjC,MAAM,CAAC,CAAC,CAAC,YAAG,SAAS,EAAC,yBAAyB,YAAE,MAAM,GAAK,CAAC,CAAC,CAAC,IAAI,IACzD,CACd,CAAC,CAAC,CAAC,IAAI,IACD,CACV,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,YAAY,CAAC,WAAW,GAAG,cAAc,CAAC"}
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ export type NotificationProps = Omit<React.HTMLAttributes<HTMLElement>, "className" | "title"> & {
3
+ tone?: "info" | "success" | "warning" | "error";
4
+ title: string;
5
+ message?: string;
6
+ dismissible?: boolean;
7
+ dismissLabel?: string;
8
+ onDismiss?: () => void;
9
+ className?: string;
10
+ actions?: React.ReactNode;
11
+ children?: React.ReactNode;
12
+ };
13
+ export declare const Notification: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement>, "className" | "title"> & {
14
+ tone?: "info" | "success" | "warning" | "error";
15
+ title: string;
16
+ message?: string;
17
+ dismissible?: boolean;
18
+ dismissLabel?: string;
19
+ onDismiss?: () => void;
20
+ className?: string;
21
+ actions?: React.ReactNode;
22
+ children?: React.ReactNode;
23
+ } & React.RefAttributes<HTMLElement>>;
24
+ //# sourceMappingURL=Notification.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Notification.d.ts","sourceRoot":"","sources":["../src/Notification.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG;IAC/F,IAAI,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAChD,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;AAEF,eAAO,MAAM,YAAY;WAXhB,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO;WACxC,MAAM;cACH,MAAM;kBACF,OAAO;mBACN,MAAM;gBACT,MAAM,IAAI;gBACV,MAAM;cACR,KAAK,CAAC,SAAS;eACd,KAAK,CAAC,SAAS;qCAmD3B,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { classNames } from "./classNames.js";
4
+ export const Notification = React.forwardRef(({ tone = "info", title, message, dismissible = false, dismissLabel = "Dismiss", onDismiss, className, actions, children, ...rest }, ref) => {
5
+ const canDismiss = dismissible && typeof onDismiss === "function";
6
+ const role = tone === "error" ? "alert" : "status";
7
+ return (_jsxs("section", { ...rest, ref: ref, className: classNames("st-notification", `st-notification--${tone}`, className), role: role, children: [_jsxs("div", { className: "st-notification__content", children: [_jsx("h2", { className: "st-notification__title", children: title }), message ? _jsx("p", { className: "st-notification__message", children: message }) : null, children] }), _jsxs("div", { className: "st-notification__meta", children: [actions ? _jsx("div", { className: "st-notification__actions", children: actions }) : null, canDismiss ? (_jsx("button", { type: "button", className: "st-notification__close", "aria-label": dismissLabel, title: dismissLabel, onClick: () => onDismiss?.(), children: "\u00D7" })) : null] })] }));
8
+ });
9
+ Notification.displayName = "Notification";
10
+ //# sourceMappingURL=Notification.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Notification.js","sourceRoot":"","sources":["../src/Notification.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAc7C,MAAM,CAAC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fContentsItem {
3
+ id: string;
4
+ label: string;
5
+ level?: number;
6
+ }
7
+ export type TableOfContentsProps = Omit<React.HTMLAttributes<HTMLElement>, "className" | "items"> & {
8
+ title?: string;
9
+ items: TableOfContentsItem[];
10
+ activeId?: string;
11
+ className?: string;
12
+ };
13
+ export declare const TableOfContents: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement>, "className" | "items"> & {
14
+ title?: string;
15
+ items: TableOfContentsItem[];
16
+ activeId?: string;
17
+ className?: string;
18
+ } & React.RefAttributes<HTMLElement>>;
19
+ //# sourceMappingURL=TableOfContents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableOfContents.d.ts","sourceRoot":"","sources":["../src/TableOfContents.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,oBAAoB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,GAAG;IAClG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAIF,eAAO,MAAM,eAAe;YARlB,MAAM;WACP,mBAAmB,EAAE;eACjB,MAAM;gBACL,MAAM;qCA6CnB,CAAC"}
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { classNames } from "./classNames.js";
4
+ const normalizeItemId = (value) => value.replace(/^#/, "");
5
+ export const TableOfContents = React.forwardRef(({ title, items, activeId = "", className, ...rest }, ref) => {
6
+ const normalizedActive = normalizeItemId(activeId);
7
+ const normalizedItems = items.map((item) => ({
8
+ ...item,
9
+ id: normalizeItemId(item.id),
10
+ level: Math.max(item.level ?? 1, 1),
11
+ }));
12
+ return (_jsxs("nav", { ...rest, ref: ref, className: classNames("st-tableOfContents", className), "aria-label": title ?? "Table des matières", children: [title ? _jsx("p", { className: "st-tableOfContents__title", children: title }) : null, _jsx("ol", { className: "st-tableOfContents__list", children: normalizedItems.map((item) => {
13
+ const isActive = item.id === normalizedActive;
14
+ return (_jsx("li", { className: "st-tableOfContents__item", style: { "--st-tableOfContents-level": item.level - 1 }, children: _jsx("a", { className: "st-tableOfContents__link", href: `#${item.id}`, "aria-current": isActive ? "location" : undefined, children: item.label }) }, item.id));
15
+ }) })] }));
16
+ });
17
+ TableOfContents.displayName = "TableOfContents";
18
+ //# sourceMappingURL=TableOfContents.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TableOfContents.js","sourceRoot":"","sources":["../src/TableOfContents.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAe7C,MAAM,eAAe,GAAG,CAAC,KAAa,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAEnE,MAAM,CAAC,MAAM,eAAe,GAAG,KAAK,CAAC,UAAU,CAC7C,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,QAAQ,GAAG,EAAE,EAAE,SAAS,EAAE,GAAG,IAAI,EAAE,EAAE,GAAG,EAAE,EAAE;IAC3D,MAAM,gBAAgB,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC;IACnD,MAAM,eAAe,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC3C,GAAG,IAAI;QACP,EAAE,EAAE,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,EAAE,CAAC,CAAC;KACpC,CAAC,CAAC,CAAC;IAEJ,OAAO,CACL,kBACM,IAAI,EACR,GAAG,EAAE,GAAG,EACR,SAAS,EAAE,UAAU,CAAC,oBAAoB,EAAE,SAAS,CAAC,gBAC1C,KAAK,IAAI,oBAAoB,aAExC,KAAK,CAAC,CAAC,CAAC,YAAG,SAAS,EAAC,2BAA2B,YAAE,KAAK,GAAK,CAAC,CAAC,CAAC,IAAI,EACpE,aAAI,SAAS,EAAC,0BAA0B,YACrC,eAAe,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;oBAC5B,MAAM,QAAQ,GAAG,IAAI,CAAC,EAAE,KAAK,gBAAgB,CAAC;oBAC9C,OAAO,CACL,aAEE,SAAS,EAAC,0BAA0B,EACpC,KAAK,EAAE,EAAE,4BAA4B,EAAE,IAAI,CAAC,KAAK,GAAG,CAAC,EAAyB,YAE9E,YACE,SAAS,EAAC,0BAA0B,EACpC,IAAI,EAAE,IAAI,IAAI,CAAC,EAAE,EAAE,kBACL,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,YAE9C,IAAI,CAAC,KAAK,GACT,IAVC,IAAI,CAAC,EAAE,CAWT,CACN,CAAC;gBACJ,CAAC,CAAC,GACC,IACD,CACP,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,eAAe,CAAC,WAAW,GAAG,iBAAiB,CAAC"}
@@ -0,0 +1,24 @@
1
+ import React from "react";
2
+ export type TranscriptionSegment = {
3
+ speaker?: string;
4
+ startTime?: string;
5
+ endTime?: string;
6
+ text: string;
7
+ };
8
+ export type TranscriptionProps = Omit<React.HTMLAttributes<HTMLElement>, "className"> & {
9
+ title?: string;
10
+ segments?: TranscriptionSegment[];
11
+ text?: string;
12
+ className?: string;
13
+ open?: boolean;
14
+ showTimestamps?: boolean;
15
+ };
16
+ export declare const Transcription: React.ForwardRefExoticComponent<Omit<React.HTMLAttributes<HTMLElement>, "className"> & {
17
+ title?: string;
18
+ segments?: TranscriptionSegment[];
19
+ text?: string;
20
+ className?: string;
21
+ open?: boolean;
22
+ showTimestamps?: boolean;
23
+ } & React.RefAttributes<HTMLDetailsElement>>;
24
+ //# sourceMappingURL=Transcription.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Transcription.d.ts","sourceRoot":"","sources":["../src/Transcription.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,GAAG;IACtF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAClC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,eAAO,MAAM,aAAa;YARhB,MAAM;eACH,oBAAoB,EAAE;WAC1B,MAAM;gBACD,MAAM;WACX,OAAO;qBACG,OAAO;4CAgEzB,CAAC"}
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { classNames } from "./classNames.js";
4
+ export const Transcription = React.forwardRef(({ title = "Transcription", segments, text, open = false, showTimestamps = true, className, ...rest }, ref) => {
5
+ const resolvedSegments = (segments ?? []).filter((segment) => Boolean(segment.text?.trim()));
6
+ const hasSegments = resolvedSegments.length > 0;
7
+ const hasText = Boolean(text && text.trim().length);
8
+ const formatInterval = (segment) => {
9
+ if (!showTimestamps || (!segment.startTime && !segment.endTime))
10
+ return "";
11
+ if (!segment.startTime)
12
+ return segment.endTime ? `- ${segment.endTime}` : "";
13
+ if (!segment.endTime)
14
+ return `${segment.startTime} -`;
15
+ return `${segment.startTime} - ${segment.endTime}`;
16
+ };
17
+ return (_jsxs("details", { ...rest, ref: ref, open: open, className: classNames("st-transcription", className), children: [_jsx("summary", { children: title }), _jsx("div", { className: "st-transcription__content", children: hasSegments ? (_jsx("ol", { className: "st-transcription__list", children: resolvedSegments.map((segment, index) => {
18
+ const interval = formatInterval(segment);
19
+ return (_jsxs("li", { className: "st-transcription__item", children: [_jsxs("p", { className: "st-transcription__meta", children: [segment.speaker ? (_jsx("span", { className: "st-transcription__speaker", children: segment.speaker })) : null, segment.speaker && interval ? _jsx("span", { "aria-hidden": "true", children: "\u00A0\u2022\u00A0" }) : null, interval ? (_jsxs("time", { children: [_jsxs("span", { className: "st-transcription__sr-only", children: ["Horodatage ", interval] }), _jsx("span", { "aria-hidden": "true", children: interval })] })) : null] }), _jsx("p", { className: "st-transcription__text", children: segment.text })] }, index));
20
+ }) })) : hasText ? (_jsx("p", { className: "st-transcription__text", children: text })) : (_jsx("p", { className: "st-transcription__text", children: "Aucun contenu de transcription fourni." })) })] }));
21
+ });
22
+ Transcription.displayName = "Transcription";
23
+ //# sourceMappingURL=Transcription.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Transcription.js","sourceRoot":"","sources":["../src/Transcription.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAkB7C,MAAM,CAAC,MAAM,aAAa,GAAG,KAAK,CAAC,UAAU,CAC3C,CACE,EACE,KAAK,GAAG,eAAe,EACvB,QAAQ,EACR,IAAI,EACJ,IAAI,GAAG,KAAK,EACZ,cAAc,GAAG,IAAI,EACrB,SAAS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AAO,CAAC,CAAC;wBACzC,OAAO,CACL,cAAgB,SAAS,EAAC,wBAAwB,aAChD,aAAG,SAAS,EAAC,wBAAwB,aAClC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,CACjB,eAAM,SAAS,EAAC,2BAA2B,YAAE,OAAO,CAAC,OAAO,GAAQ,CACrE,CAAC,CAAC,CAAC,IAAI,EACP,OAAO,CAAC,OAAO,IAAI,QAAQ,CAAC,CAAC,CAAC,8BAAkB,MAAM,mCAAqB,CAAC,CAAC,CAAC,IAAI,EAClF,QAAQ,CAAC,CAAC,CAAC,CACV,2BACE,gBAAM,SAAS,EAAC,2BAA2B,4BAAa,QAAQ,IAAQ,EACxE,8BAAkB,MAAM,YAAE,QAAQ,GAAQ,IACrC,CACR,CAAC,CAAC,CAAC,IAAI,IACN,EACJ,YAAG,SAAS,EAAC,wBAAwB,YAAE,OAAO,CAAC,IAAI,GAAK,KAbjD,KAAK,CAcT,CACN,CAAC;oBACJ,CAAC,CAAC,GACC,CACN,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CACZ,YAAG,SAAS,EAAC,wBAAwB,YAAE,IAAI,GAAK,CACjD,CAAC,CAAC,CAAC,CACF,YAAG,SAAS,EAAC,wBAAwB,uDAA2C,CACjF,GACG,IACE,CACX,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,aAAa,CAAC,WAAW,GAAG,eAAe,CAAC"}
package/dist/catalog.d.ts CHANGED
@@ -273,32 +273,110 @@ export type FooterProps = React.HTMLAttributes<HTMLElement> & {
273
273
  copyright?: React.ReactNode;
274
274
  };
275
275
  export declare function Footer({ brand, columns, links, copyright, className, ...rest }: FooterProps): import("react/jsx-runtime").JSX.Element;
276
- export type ForceGraphTone = DataTone;
276
+ export type ForceGraphTone = "category1" | "category2" | "category3" | "category4" | "category5" | "category6" | "category7" | "category8";
277
+ export type ForceGraphNodeShape = "dot" | "circle" | "diamond" | "star" | "hexagon" | "box" | "square" | "triangle";
277
278
  export type ForceGraphNode = {
279
+ /** Stable identifier; referenced by edges. */
278
280
  id: string;
281
+ /** Visible label (falls back to id). */
279
282
  label?: string;
283
+ /**
284
+ * Grouping key (e.g. node type or community). Nodes sharing a group get
285
+ * the same tone when `tone` is not set explicitly.
286
+ */
280
287
  group?: string | number;
288
+ /** Explicit data-vis tone; overrides the group-derived tone. */
281
289
  tone?: ForceGraphTone;
290
+ /** Relative node radius weight (defaults to 1). */
282
291
  weight?: number;
292
+ /** Pin the node to a fixed position (ignored by the simulation). */
283
293
  fx?: number;
284
294
  fy?: number;
295
+ /**
296
+ * Visual shape for the node. Defaults to 'dot' (circle).
297
+ * Supported: 'dot'|'circle', 'diamond', 'star', 'hexagon', 'box'|'square', 'triangle'.
298
+ */
299
+ shape?: ForceGraphNodeShape;
285
300
  };
286
301
  export type ForceGraphEdge = {
302
+ /** Source node id. */
287
303
  source: string;
304
+ /** Target node id. */
288
305
  target: string;
306
+ /** Optional relation label, surfaced in the tooltip on hover/focus. */
289
307
  relation?: string;
308
+ /**
309
+ * When true the link renders as a dashed/faded "weak" link. Lets callers
310
+ * map a confidence dimension onto link strength without extra props.
311
+ */
290
312
  weak?: boolean;
291
313
  };
314
+ export type ForceGraphLegendEntry = {
315
+ /** Label shown in the legend. */
316
+ label: string;
317
+ /** Shape for this entry (node legend). Absent = line-style legend entry. */
318
+ shape?: ForceGraphNodeShape;
319
+ /** Tone for this entry. Defaults to category1. */
320
+ tone?: ForceGraphTone;
321
+ /** When true, renders as a dashed line (edge legend). */
322
+ weak?: boolean;
323
+ };
324
+ export declare function nodeShapePath(shape: ForceGraphNodeShape | undefined, r: number): string | null;
292
325
  export type ForceGraphProps = React.HTMLAttributes<HTMLElement> & {
293
326
  nodes: ForceGraphNode[];
294
327
  edges: ForceGraphEdge[];
295
- label?: string;
328
+ /** Accessible name for the figure (required). */
329
+ label: string;
330
+ width?: number;
331
+ height?: number;
332
+ /** Base node radius in px (scaled by node.weight). */
333
+ nodeRadius?: number;
334
+ /** Show text labels next to nodes. */
335
+ showLabels?: boolean;
336
+ /**
337
+ * Number of cooling ticks. The simulation runs a synchronous warmup then
338
+ * animates the remainder unless reduced motion is requested.
339
+ */
340
+ iterations?: number;
341
+ /**
342
+ * IDs of currently selected nodes. Highlighted visually without
343
+ * re-running the layout. Defaults to [].
344
+ */
296
345
  selectedIds?: string[];
346
+ /**
347
+ * ID of the node to focus/centre visually (ring highlight). Does not
348
+ * re-run the layout. Defaults to null.
349
+ */
297
350
  focusId?: string | null;
351
+ /**
352
+ * Called when the user clicks (or presses Space/Enter) a node.
353
+ * Fires with the node's stable id.
354
+ */
298
355
  onSelect?: (id: string) => void;
356
+ /**
357
+ * Called when the user activates a node (double-click or Enter key while
358
+ * keyboard-focused). Intended to open a detail panel.
359
+ * Fires with the node's stable id.
360
+ */
299
361
  onOpenEntity?: (id: string) => void;
300
- };
301
- export declare function ForceGraph({ nodes, edges, label, selectedIds, focusId, onSelect, onOpenEntity, className, ...rest }: ForceGraphProps): import("react/jsx-runtime").JSX.Element;
362
+ /**
363
+ * Called when the user hovers an edge.
364
+ * Fires with the edge object (source/target/relation/weak).
365
+ */
366
+ onEdgeHover?: (edge: ForceGraphEdge) => void;
367
+ /**
368
+ * Legend entries rendered as a corner overlay.
369
+ * Each entry has a label + optional shape (node) or weak (edge).
370
+ */
371
+ legend?: ForceGraphLegendEntry[];
372
+ };
373
+ export declare function ForceGraph({ nodes, edges, label, width, height, nodeRadius, showLabels, iterations, selectedIds, focusId, onSelect, onOpenEntity, onEdgeHover, legend, className, ...rest }: ForceGraphProps): import("react/jsx-runtime").JSX.Element;
374
+ export type GraphLegendProps = React.HTMLAttributes<HTMLDivElement> & {
375
+ entries: ForceGraphLegendEntry[];
376
+ /** Optional heading shown above entries. */
377
+ title?: string;
378
+ };
379
+ export declare function GraphLegend({ entries, title, className, ...rest }: GraphLegendProps): import("react/jsx-runtime").JSX.Element;
302
380
  export type FormProps = Omit<React.FormHTMLAttributes<HTMLFormElement>, "onSubmit"> & {
303
381
  status?: "idle" | "submitting" | "submitted" | "error";
304
382
  message?: React.ReactNode;