@axa-fr/design-system-slash-react 1.2.1-alpha.99 → 2.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Button/Button.d.ts +11 -7
- package/dist/Button/Button.js +7 -7
- package/dist/CardData/CardData.d.ts +15 -0
- package/dist/CardData/CardData.js +6 -0
- package/dist/CardData/CardDataHeader.d.ts +14 -0
- package/dist/CardData/CardDataHeader.js +9 -0
- package/dist/Divider/Divider.d.ts +3 -3
- package/dist/Divider/Divider.js +4 -4
- package/dist/Form/Checkbox/CheckboxInput.js +1 -1
- package/dist/Form/File/File.js +1 -1
- package/dist/Layout/Footer/Footer.d.ts +2 -1
- package/dist/Layout/Footer/Footer.js +4 -2
- package/dist/Layout/Header/AnchorNavBar/AnchorNavBar.d.ts +23 -0
- package/dist/Layout/Header/AnchorNavBar/AnchorNavBar.js +3 -2
- package/dist/Layout/Header/Header.js +2 -1
- package/dist/Layout/Header/HeaderTitle/HeaderTitle.js +4 -4
- package/dist/Layout/Header/Infos/Infos.d.ts +1 -1
- package/dist/Layout/Header/Infos/Infos.js +4 -2
- package/dist/Layout/Header/NavBar/NavBarBase.js +9 -8
- package/dist/Layout/Header/NavBar/index.d.ts +1 -0
- package/dist/Layout/Header/NavBar/index.js +1 -0
- package/dist/Layout/Header/User/User.d.ts +45 -3
- package/dist/Layout/Header/User/User.js +2 -2
- package/dist/Layout/MainContainer/MainContainer.d.ts +6 -0
- package/dist/Layout/MainContainer/MainContainer.js +4 -0
- package/dist/Link/Link.d.ts +1 -1
- package/dist/Link/Link.js +1 -1
- package/dist/Link/LinkAnchor.d.ts +5 -3
- package/dist/Link/LinkAnchor.js +5 -3
- package/dist/ModalAgent/BooleanModal.js +1 -1
- package/dist/Steps/VerticalStep.d.ts +33 -1
- package/dist/Steps/VerticalStep.js +2 -2
- package/dist/Table/Pagination/Items.d.ts +1 -1
- package/dist/Table/Pagination/Li.d.ts +2 -1
- package/dist/Table/Pagination/Li.js +2 -2
- package/dist/Table/Pagination/Pager.d.ts +5 -1
- package/dist/Table/Pagination/Pager.js +3 -3
- package/dist/Table/Pagination/PaginationButton.d.ts +2 -1
- package/dist/Table/Pagination/PaginationButton.js +2 -2
- package/dist/Table/Pagination/Paging.d.ts +2 -1
- package/dist/Table/Pagination/Paging.js +2 -2
- package/dist/Tag/Tag.d.ts +29 -0
- package/dist/Tag/Tag.js +27 -0
- package/dist/Title/Title.d.ts +2 -2
- package/dist/index.d.ts +12 -1
- package/dist/index.js +7 -1
- package/dist/utilities/helpers/getComponentClassName.d.ts +8 -0
- package/dist/utilities/helpers/getComponentClassName.js +8 -0
- package/package.json +2 -2
- package/dist/Badge/Badge.d.ts +0 -8
- package/dist/Badge/Badge.js +0 -9
package/dist/Button/Button.d.ts
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import
|
|
3
|
-
type
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { ReactNode } from "react";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Button/Button.css";
|
|
3
|
+
export type ButtonVariant = "primary" | "secondary" | "validated" | "danger" | "ghost" | "ghost-reverse";
|
|
4
|
+
export declare const Button: import("react").ForwardRefExoticComponent<{
|
|
5
|
+
variant?: ButtonVariant;
|
|
6
|
+
small?: boolean;
|
|
7
|
+
leftIcon?: ReactNode;
|
|
8
|
+
rightIcon?: ReactNode;
|
|
9
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
10
|
+
children?: ReactNode | undefined;
|
|
11
|
+
} & import("react").RefAttributes<HTMLButtonElement>>;
|
package/dist/Button/Button.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, } from "react";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import "@axa-fr/design-system-slash-css/dist/Button/Button.css";
|
|
5
|
+
const DEFAULT_CLASS_NAME = "af-btn";
|
|
6
|
+
export const Button = forwardRef(({ variant = "primary", small, leftIcon, rightIcon, className, children, ...props }, ref) => (_jsxs("button", { type: "button", className: classNames(DEFAULT_CLASS_NAME, variant !== "primary" && `${DEFAULT_CLASS_NAME}--${variant}`, small && `${DEFAULT_CLASS_NAME}--small`, className), ...props, ref: ref, children: [leftIcon, children, rightIcon] })));
|
|
7
|
+
Button.displayName = "Button";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React, { PropsWithChildren } from "react";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/CardData/CardData.css";
|
|
3
|
+
export type CardDataVariant = "error" | "warning" | "information" | "success" | "default" | "dark" | "gray" | "purple";
|
|
4
|
+
type CardDataProps = {
|
|
5
|
+
title: React.ReactNode;
|
|
6
|
+
subTitle?: React.ReactNode;
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
icon: string;
|
|
9
|
+
variant?: CardDataVariant;
|
|
10
|
+
contentFitAllSize?: boolean;
|
|
11
|
+
contentRight?: React.ReactNode;
|
|
12
|
+
withDivider?: boolean;
|
|
13
|
+
};
|
|
14
|
+
export declare const CardData: ({ title, subTitle, description, icon, variant, contentFitAllSize, contentRight, children, withDivider, }: PropsWithChildren<CardDataProps>) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classNames from "classnames";
|
|
3
|
+
import { CardDataHeader } from "./CardDataHeader";
|
|
4
|
+
import "@axa-fr/design-system-slash-css/dist/CardData/CardData.css";
|
|
5
|
+
const defaultClassName = "af-card-data";
|
|
6
|
+
export const CardData = ({ title, subTitle, description, icon, variant = "default", contentFitAllSize = false, contentRight, children, withDivider = true, }) => (_jsxs("div", { className: defaultClassName, children: [_jsx(CardDataHeader, { title: title, subTitle: subTitle, description: description, icon: icon, variant: variant, contentRight: contentRight, withDivider: withDivider }), _jsx("section", { className: classNames({ [`${defaultClassName}-content--max-size`]: contentFitAllSize }, { [`${defaultClassName}-content`]: !contentFitAllSize }), children: children })] }));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/CardData/CardData.css";
|
|
3
|
+
import { CardDataVariant } from "./CardData";
|
|
4
|
+
type CardDataHeaderProps = {
|
|
5
|
+
title: React.ReactNode;
|
|
6
|
+
subTitle?: React.ReactNode;
|
|
7
|
+
description?: React.ReactNode;
|
|
8
|
+
icon: string;
|
|
9
|
+
variant?: CardDataVariant;
|
|
10
|
+
contentRight?: React.ReactNode;
|
|
11
|
+
withDivider?: boolean;
|
|
12
|
+
};
|
|
13
|
+
export declare const CardDataHeader: ({ title, subTitle, description, icon, variant, contentRight, withDivider, }: CardDataHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/CardData/CardData.css";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
import { Svg } from "../Svg";
|
|
5
|
+
import { Divider } from "../Divider/Divider";
|
|
6
|
+
import { Title } from "../Title/Title";
|
|
7
|
+
const defaultClassName = "af-card-data-header";
|
|
8
|
+
const iconDefaultClassName = `${defaultClassName}-icon`;
|
|
9
|
+
export const CardDataHeader = ({ title, subTitle, description, icon, variant, contentRight, withDivider, }) => (_jsxs(_Fragment, { children: [_jsxs("header", { className: defaultClassName, children: [_jsx("span", { className: classNames(iconDefaultClassName, variant !== "default" ? `${iconDefaultClassName}--${variant}` : null), children: _jsx(Svg, { src: icon }) }), _jsxs(Title, { heading: "h3", children: [title, subTitle ? (_jsx("span", { className: `${defaultClassName}-subtitle`, children: subTitle })) : null, description ? (_jsx("span", { className: `${defaultClassName}-description`, children: description })) : null] }), contentRight ? (_jsx("span", { className: `${defaultClassName}-rightcontent`, children: contentRight })) : null] }), withDivider ? _jsx(Divider, {}) : null] }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "@axa-fr/design-system-slash-css/dist/Divider/Divider.css";
|
|
2
|
-
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
type DividerProps = ComponentProps<"hr"> & {
|
|
3
4
|
mode?: "horizontal" | "vertical";
|
|
4
|
-
classModifier?: string;
|
|
5
5
|
};
|
|
6
|
-
export declare const Divider: ({ mode,
|
|
6
|
+
export declare const Divider: ({ mode, className, ...props }: DividerProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export {};
|
package/dist/Divider/Divider.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import classnames from "classnames";
|
|
3
3
|
import "@axa-fr/design-system-slash-css/dist/Divider/Divider.css";
|
|
4
|
-
export const Divider = ({ mode = "horizontal",
|
|
5
|
-
const componentClassName = classnames("af-divider",
|
|
4
|
+
export const Divider = ({ mode = "horizontal", className, ...props }) => {
|
|
5
|
+
const componentClassName = classnames("af-divider", {
|
|
6
6
|
"af-divider--horizontal": mode === "horizontal",
|
|
7
7
|
"af-divider--vertical": mode === "vertical",
|
|
8
|
-
});
|
|
9
|
-
return _jsx("hr", { className: componentClassName });
|
|
8
|
+
}, className);
|
|
9
|
+
return _jsx("hr", { className: componentClassName, ...props });
|
|
10
10
|
};
|
|
@@ -5,7 +5,7 @@ import { Checkbox } from "./Checkbox";
|
|
|
5
5
|
import { CheckboxModes } from "./CheckboxModes";
|
|
6
6
|
const CheckboxInput = forwardRef(({ label, mode = "default", options, ...otherProps }, inputRef) => {
|
|
7
7
|
const newOptions = useOptionsWithId(options);
|
|
8
|
-
return (_jsx(Field, { label: label, labelPosition: mode === CheckboxModes.classic ? "top" : "center", roleContainer: "group", ...otherProps, renderInput: ({ classModifier, id, ariaInvalid, errorId, ...props }) => {
|
|
8
|
+
return (_jsx(Field, { label: label, labelPosition: mode === CheckboxModes.classic ? "top" : "center", roleContainer: "group", classNameSuffix: "checkbox-container", ...otherProps, renderInput: ({ classModifier, id, ariaInvalid, errorId, ...props }) => {
|
|
9
9
|
return (_jsx(Checkbox, { id: id, mode: mode, options: newOptions, classModifier: ariaInvalid ? `${classModifier} error` : classModifier, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...props }));
|
|
10
10
|
} }));
|
|
11
11
|
});
|
package/dist/Form/File/File.js
CHANGED
|
@@ -55,6 +55,6 @@ const File = ({ className, classModifier, id, name, disabled, onChange, multiple
|
|
|
55
55
|
disabled,
|
|
56
56
|
});
|
|
57
57
|
const componentClassName = getComponentClassName(className, classModifier, "af-form__file-input");
|
|
58
|
-
return (_jsxs("div", { className: componentClassName, children: [_jsxs("div", { ...getRootProps({ className: "drop-box" }), children: [_jsx("input", { ...getInputProps({ id, name, readOnly, ...otherProps }) }), _jsx("div", { children: placeholder })] }),
|
|
58
|
+
return (_jsxs("div", { className: componentClassName, children: [_jsxs("div", { ...getRootProps({ className: "drop-box" }), children: [_jsx("input", { ...getInputProps({ id, name, readOnly, ...otherProps }) }), _jsx("div", { children: placeholder })] }), _jsx(Button, { className: "af-btn--file", leftIcon: _jsx("i", { className: `glyphicon glyphicon-${icon}` }), onClick: open, disabled: disabled, children: label })] }));
|
|
59
59
|
};
|
|
60
60
|
export { File };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import "@axa-fr/design-system-slash-css/dist/Layout/Footer/Footer.
|
|
1
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/Footer/Footer.css";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/common/breakpoints.css";
|
|
2
3
|
type FooterProps = {
|
|
3
4
|
href?: string;
|
|
4
5
|
title?: string;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import logo from "@axa-fr/design-system-slash-css/logo-axa.svg";
|
|
3
|
-
import "@axa-fr/design-system-slash-css/dist/Layout/Footer/Footer.
|
|
3
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/Footer/Footer.css";
|
|
4
|
+
import "@axa-fr/design-system-slash-css/dist/common/breakpoints.css";
|
|
4
5
|
import { forwardRef } from "react";
|
|
5
|
-
|
|
6
|
+
import classNames from "classnames";
|
|
7
|
+
export const Footer = forwardRef(({ className = "af-footer", href = "https://www.axa.fr/", title = "Site Axa", icon = logo, alt = "Logo Axa", version, children = `© ${new Date().getFullYear()} AXA Tous droits réservés`, ...props }, ref) => (_jsxs("footer", { ref: ref, className: classNames("af-container", className), ...props, children: [Boolean(icon) && (_jsx("a", { className: "af-logo", href: href, title: title, target: "_blank", rel: "noopener noreferrer", children: _jsx("img", { className: "af-logo__brand", src: icon, alt: alt }) })), _jsx("div", { className: "af-footer-content", children: children }), version ? (_jsxs("span", { className: "af-footer-version", children: ["Version ", version] })) : null] })));
|
|
6
8
|
Footer.displayName = "Footer";
|
|
@@ -1,15 +1,38 @@
|
|
|
1
1
|
import { ReactNode } from "react";
|
|
2
2
|
import "@axa-fr/design-system-slash-css/dist/Layout/Header/AnchorNavBar/AnchorNavBar.css";
|
|
3
|
+
import "@axa-fr/design-system-slash-css/dist/common/breakpoints.css";
|
|
3
4
|
export type AnchorNavBarItem = {
|
|
5
|
+
/**
|
|
6
|
+
* name - The display name of the navigation item.
|
|
7
|
+
*/
|
|
4
8
|
name: string;
|
|
9
|
+
/**
|
|
10
|
+
* isActive - If true, the item is highlighted as active.
|
|
11
|
+
*/
|
|
5
12
|
isActive?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* onClick - Optional click handler for the navigation item.
|
|
15
|
+
*/
|
|
6
16
|
onClick?: () => void;
|
|
17
|
+
/**
|
|
18
|
+
* link - The URL or anchor to navigate to when the item is clicked.
|
|
19
|
+
*/
|
|
7
20
|
link?: string;
|
|
21
|
+
/**
|
|
22
|
+
* externalLink - If true, the link will open in a new tab and show an external link icon.
|
|
23
|
+
*/
|
|
8
24
|
externalLink?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* render - Optional custom render function for the navigation item. If provided, it overrides the default rendering.
|
|
27
|
+
*/
|
|
9
28
|
render?: (props: {
|
|
10
29
|
className: string;
|
|
11
30
|
}) => ReactNode;
|
|
12
31
|
};
|
|
32
|
+
/**
|
|
33
|
+
* Props for the AnchorNavBar component.
|
|
34
|
+
* items - An array of navigation items to display in the navigation bar.
|
|
35
|
+
*/
|
|
13
36
|
export type AnchorNavBarProps = {
|
|
14
37
|
items: AnchorNavBarItem[];
|
|
15
38
|
};
|
|
@@ -5,9 +5,10 @@ import { Svg } from "../../../Svg";
|
|
|
5
5
|
import { Link } from "../../../Link/Link";
|
|
6
6
|
import { linkClassName } from "../../../Link/linkClassName";
|
|
7
7
|
import "@axa-fr/design-system-slash-css/dist/Layout/Header/AnchorNavBar/AnchorNavBar.css";
|
|
8
|
+
import "@axa-fr/design-system-slash-css/dist/common/breakpoints.css";
|
|
8
9
|
const defaultClassName = "af-anchor-navbar";
|
|
9
10
|
export const AnchorNavBar = ({ items }) => {
|
|
10
|
-
return (_jsx("nav", { className: defaultClassName, children: _jsx("ul", { children: items.map((item) => {
|
|
11
|
+
return (_jsx("nav", { className: classNames("af-container", defaultClassName), children: _jsx("ul", { children: items.map((item) => {
|
|
11
12
|
if (item.render) {
|
|
12
13
|
return (_jsx("li", { children: _jsx(Link, { render: item.render, className: classNames(`${linkClassName} ${defaultClassName}-link`, {
|
|
13
14
|
[`${defaultClassName}-link--active`]: item.isActive,
|
|
@@ -15,6 +16,6 @@ export const AnchorNavBar = ({ items }) => {
|
|
|
15
16
|
}
|
|
16
17
|
return (_jsx("li", { children: _jsxs(Link, { href: item.link, "aria-current": item.isActive ? "page" : undefined, onClick: item.onClick, className: classNames(`${defaultClassName}-link`, {
|
|
17
18
|
[`${defaultClassName}-link--active`]: item.isActive,
|
|
18
|
-
}), children: [item.name, item.externalLink ? (_jsx(Svg, { role: "presentation", src: externalLinkIcon, className: `${defaultClassName}-external-link-svg` })) : null] }) }, `nav-item-${item.name}`));
|
|
19
|
+
}), target: item.externalLink ? "_blank" : undefined, children: [item.name, item.externalLink ? (_jsx(Svg, { role: "presentation", src: externalLinkIcon, className: `${defaultClassName}-external-link-svg` })) : null] }) }, `nav-item-${item.name}`));
|
|
19
20
|
}) }) }));
|
|
20
21
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/design-system-slash-css/dist/Layout/Header/Header.scss";
|
|
3
|
+
import classNames from "classnames";
|
|
3
4
|
import { getComponentClassName } from "../../utilities";
|
|
4
5
|
const defaultClassName = "af-header";
|
|
5
6
|
const Header = ({ classModifier, className, children }) => {
|
|
6
7
|
const componentClassName = getComponentClassName(className, classModifier, defaultClassName);
|
|
7
|
-
return (_jsx("div", { className:
|
|
8
|
+
return (_jsx("div", { className: classNames("af-container", componentClassName), children: _jsx("header", { className: `${defaultClassName}__content`, role: "banner", children: children }) }));
|
|
8
9
|
};
|
|
9
10
|
export { Header };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/design-system-slash-css/dist/Layout/Header/HeaderTitle/HeaderTitle.scss";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import { getComponentClassName } from "../../../utilities";
|
|
@@ -10,8 +10,8 @@ const defaultClassName = "af-title-bar";
|
|
|
10
10
|
const HeaderTitle = ({ children, classModifier, className, isSticky = true, contentLeft, contentRight, subtitle, title, toggleMenu, anchorNavBarItems, }) => {
|
|
11
11
|
const componentClassName = getComponentClassName(className, getClassModifier(classModifier, isSticky), defaultClassName);
|
|
12
12
|
const isAnchorNavBarPresent = anchorNavBarItems && anchorNavBarItems.length > 0;
|
|
13
|
-
return (_jsxs("div", { className: classNames(componentClassName, {
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
return (_jsxs(_Fragment, { children: [_jsxs("div", { className: classNames("af-container", componentClassName, {
|
|
14
|
+
[`${defaultClassName}__withAnchorNavBar`]: isAnchorNavBarPresent,
|
|
15
|
+
}), children: [Boolean(toggleMenu) && (_jsx("div", { className: "burger-container", children: _jsx(ToggleButton, { idControl: "mainmenu", children: _jsx(Action, { className: "btn af-title-bar__mobile-menu af-btn--circle", id: "togglemenu", icon: "menu-hamburger", title: "Toggle menu", onClick: toggleMenu }) }) })), _jsxs("div", { className: `${defaultClassName}__leftSection`, children: [contentLeft, _jsxs("h1", { className: `${defaultClassName}__title`, children: [title, subtitle ? (_jsx("span", { className: `${defaultClassName}__subtitle`, children: subtitle })) : null] }), children] }), contentRight ? (_jsx("div", { className: `${defaultClassName}__rightSection`, children: contentRight })) : null] }), isAnchorNavBarPresent ? (_jsx(AnchorNavBar, { items: anchorNavBarItems })) : null] }));
|
|
16
16
|
};
|
|
17
17
|
export { HeaderTitle };
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import infoIcon from "@material-symbols/svg-400/outlined/info-fill.svg";
|
|
2
3
|
import { Fragment } from "react";
|
|
3
4
|
import { getComponentClassName } from "../../../utilities";
|
|
4
5
|
import { generateId } from "../../../utilities/helpers/generateId";
|
|
5
|
-
import "@axa-fr/design-system-slash-css/dist/Layout/Header/Infos/Infos.
|
|
6
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/Header/Infos/Infos.css";
|
|
7
|
+
import { Svg } from "../../../Svg";
|
|
6
8
|
const defaultClassName = "af-contrat";
|
|
7
9
|
const Infos = ({ infos, className, classModifier }) => {
|
|
8
10
|
const componentClassName = getComponentClassName(className, classModifier, defaultClassName);
|
|
9
|
-
return (_jsxs("div", { className: componentClassName, children: [_jsx(
|
|
11
|
+
return (_jsxs("div", { className: componentClassName, children: [_jsx(Svg, { className: "af-contrat__icon", src: infoIcon, "aria-hidden": "true" }), _jsx("dl", { className: `${defaultClassName}__list`, children: infos.map((info) => {
|
|
10
12
|
const idTerm = info.id ?? `info-${generateId(info)}`;
|
|
11
13
|
return (_jsxs(Fragment, { children: [_jsx("dt", { id: idTerm, className: `${defaultClassName}__word`, children: info.word }), _jsx("dd", { className: `${defaultClassName}__def`, "aria-labelledby": idTerm, children: info.definition })] }, idTerm));
|
|
12
14
|
}) })] }));
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import classNames from "classnames";
|
|
2
3
|
import { getComponentClassName } from "../../../utilities";
|
|
3
4
|
const defaultClassName = "af-nav-container";
|
|
4
5
|
const NavBarBase = ({ isVisible = true, onClick, id = "mainmenu", toggleMenuId = "togglemenu", isMenuFocused, className, classModifier, handleKeys, onFocus, onBlur, children, }) => {
|
|
5
6
|
const componentClassName = getComponentClassName(className, classModifier, defaultClassName);
|
|
6
|
-
return (_jsxs("div", { className: componentClassName, children: [_jsx("button", { "aria-controls": id, "aria-haspopup": "true", type: "button", onClick: onClick, className: `mask fade ${isVisible ? "show" : ""}`, id: `open-${toggleMenuId}`, "aria-label": "Open Menu" }),
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
return (_jsxs("div", { className: classNames("af-container", componentClassName), children: [_jsx("button", { "aria-controls": id, "aria-haspopup": "true", type: "button", onClick: onClick, className: `mask fade ${isVisible ? "show" : ""}`, id: `open-${toggleMenuId}`, "aria-label": "Open Menu" }), _jsxs("nav", { className: `af-nav af-drawer left ${isVisible ? "show" : ""}`, role: "navigation", "aria-label": "Menu principal", children: [_jsxs("div", { className: "af-nav__aside-header", children: [_jsx("h4", { className: "af-nav__aside-title", children: "Menu" }), _jsx("button", { "aria-controls": id, "aria-haspopup": "true", onClick: onClick, type: "button", className: "af-nav__aside-close", id: `close-${toggleMenuId}`, "aria-label": "Close Menu", children: "\u00D7" })] }), _jsx("ul", { onKeyDown: (e) => {
|
|
8
|
+
e.preventDefault();
|
|
9
|
+
handleKeys(e.key);
|
|
10
|
+
}, onFocus: (e) => {
|
|
11
|
+
onFocus({ e });
|
|
12
|
+
}, onBlur: (e) => {
|
|
13
|
+
onBlur({ e });
|
|
14
|
+
}, className: `af-nav__list ${isMenuFocused ? "af-nav__list--focused" : ""}`, role: "menubar", id: id, children: children })] })] }));
|
|
14
15
|
};
|
|
15
16
|
export { NavBarBase };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "@axa-fr/design-system-slash-css/dist/Layout/Header/NavBar/NavBar.scss";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/common/breakpoints.css";
|
|
2
3
|
export { NavBar } from "./NavBar";
|
|
3
4
|
export { NavBarBase } from "./NavBarBase";
|
|
4
5
|
export { NavBarItem, NavBarItemBase, NavBarItemLink } from "./NavBarItem";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import "@axa-fr/design-system-slash-css/dist/Layout/Header/NavBar/NavBar.scss";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/common/breakpoints.css";
|
|
2
3
|
export { NavBar } from "./NavBar";
|
|
3
4
|
export { NavBarBase } from "./NavBarBase";
|
|
4
5
|
export { NavBarItem, NavBarItemBase, NavBarItemLink } from "./NavBarItem";
|
|
@@ -1,17 +1,59 @@
|
|
|
1
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/Header/User/User.css";
|
|
1
2
|
import { MouseEvent, ReactNode } from "react";
|
|
2
|
-
import "@axa-fr/design-system-slash-css/dist/Layout/Header/User/User.scss";
|
|
3
3
|
type Props = {
|
|
4
|
+
/**
|
|
5
|
+
* User's name
|
|
6
|
+
*/
|
|
7
|
+
name: string;
|
|
8
|
+
/**
|
|
9
|
+
* User's profile or role, optional
|
|
10
|
+
*/
|
|
11
|
+
profile?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Children elements to be rendered next to the user's name and role
|
|
14
|
+
*/
|
|
4
15
|
children?: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Class modifier to apply additional styles\
|
|
18
|
+
* @example
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <User classModifier="custom-class" />
|
|
21
|
+
* ```
|
|
22
|
+
* This will apply the class `af-info-user--custom-class` to the component.
|
|
23
|
+
*/
|
|
5
24
|
classModifier?: string;
|
|
25
|
+
/**
|
|
26
|
+
* classNames to override completely the component's style
|
|
27
|
+
*/
|
|
6
28
|
className?: string;
|
|
29
|
+
/**
|
|
30
|
+
* URL to navigate to when the user name is clicked
|
|
31
|
+
* If provided, the user name will be wrapped in an anchor tag.
|
|
32
|
+
* If not provided, the user name will be displayed as plain text.
|
|
33
|
+
*/
|
|
7
34
|
href?: string;
|
|
8
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Function to call when the user name link is clicked
|
|
37
|
+
* @param action - Contains the event and optionally the path
|
|
38
|
+
*/
|
|
9
39
|
onClick?: (action: {
|
|
10
40
|
path?: string;
|
|
11
41
|
event: MouseEvent<HTMLAnchorElement>;
|
|
12
42
|
}) => void;
|
|
43
|
+
/**
|
|
44
|
+
* Optional path to be used in the onClick function
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* <User onClick={({ path }) => console.log(path)} path="/user-profile" />
|
|
48
|
+
* ```
|
|
49
|
+
* This will log `/user-profile` when the user name link is clicked.
|
|
50
|
+
*/
|
|
13
51
|
path?: string;
|
|
14
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Title for the user link, defaults to "Voir mon profil"
|
|
54
|
+
* This is used as the `title` attribute for the anchor tag if `href` is provided.
|
|
55
|
+
* It provides additional context for screen readers and tooltips.
|
|
56
|
+
*/
|
|
15
57
|
title?: string;
|
|
16
58
|
};
|
|
17
59
|
declare const User: ({ children, classModifier, className, href, name, path, profile, onClick, title, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import "@axa-fr/design-system-slash-css/dist/Layout/Header/User/User.scss";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/Header/User/User.css";
|
|
4
3
|
import { getComponentClassName } from "../../../utilities";
|
|
4
|
+
import { InnerUser } from "./InnerUser";
|
|
5
5
|
const defaultClassName = "af-info-user";
|
|
6
6
|
const User = ({ children, classModifier, className, href, name, path, profile, onClick, title = "Voir mon profil", }) => {
|
|
7
7
|
const componentClassName = getComponentClassName(className, classModifier, defaultClassName);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef, PropsWithChildren } from "react";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/MainContainer/MainContainer.css";
|
|
3
|
+
import "@axa-fr/design-system-slash-css/dist/common/breakpoints.css";
|
|
4
|
+
type MainContainerProps = ComponentPropsWithoutRef<"main"> & PropsWithChildren;
|
|
5
|
+
export declare const MainContainer: ({ children, ...othersProps }: MainContainerProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Layout/MainContainer/MainContainer.css";
|
|
3
|
+
import "@axa-fr/design-system-slash-css/dist/common/breakpoints.css";
|
|
4
|
+
export const MainContainer = ({ children, ...othersProps }) => (_jsx("main", { className: "af-container", ...othersProps, children: children }));
|
package/dist/Link/Link.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "@axa-fr/design-system-slash-css/dist/Link/Link.
|
|
1
|
+
import "@axa-fr/design-system-slash-css/dist/Link/Link.css";
|
|
2
2
|
import { type CustomLinkProps } from "./CustomLink";
|
|
3
3
|
import { type LinkComponentProps } from "./LinkAnchor";
|
|
4
4
|
export type LinkProps = LinkComponentProps | CustomLinkProps;
|
package/dist/Link/Link.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import "@axa-fr/design-system-slash-css/dist/Link/Link.
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Link/Link.css";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { CustomLink } from "./CustomLink";
|
|
5
5
|
import { LinkAnchor } from "./LinkAnchor";
|
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { ComponentPropsWithRef,
|
|
1
|
+
import { ComponentPropsWithRef, ReactElement } from "react";
|
|
2
|
+
import { Svg } from "../Svg";
|
|
2
3
|
type AnchorLinkProps = {
|
|
3
|
-
leftIcon?:
|
|
4
|
-
rightIcon?:
|
|
4
|
+
leftIcon?: ReactElement<typeof Svg>;
|
|
5
|
+
rightIcon?: ReactElement<typeof Svg>;
|
|
5
6
|
className?: string;
|
|
6
7
|
disabled?: boolean;
|
|
8
|
+
variant?: "default" | "reverse";
|
|
7
9
|
};
|
|
8
10
|
type LinkComponentProps = ComponentPropsWithRef<"a"> & AnchorLinkProps;
|
|
9
11
|
declare const LinkAnchor: import("react").ForwardRefExoticComponent<Omit<LinkComponentProps, "ref"> & import("react").RefAttributes<HTMLAnchorElement>>;
|
package/dist/Link/LinkAnchor.js
CHANGED
|
@@ -2,9 +2,11 @@ import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import classnames from "classnames";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
4
|
import { linkClassName } from "./linkClassName";
|
|
5
|
-
const LinkAnchor = forwardRef(({ className, target, rel, leftIcon, children, rightIcon, disabled, ...restProps }, ref) => {
|
|
6
|
-
const finalClassName = classnames(linkClassName, className
|
|
7
|
-
|
|
5
|
+
const LinkAnchor = forwardRef(({ className, target, rel, leftIcon, children, rightIcon, disabled, variant, ...restProps }, ref) => {
|
|
6
|
+
const finalClassName = classnames(linkClassName, className, {
|
|
7
|
+
[`${linkClassName}--reverse`]: variant === "reverse",
|
|
8
|
+
});
|
|
9
|
+
return (_jsxs("a", { className: finalClassName, rel: target === "_blank" ? "noopener noreferrer" : rel, "aria-disabled": disabled ?? restProps["aria-disabled"], ref: ref, target: target, ...restProps, children: [leftIcon, children, rightIcon] }));
|
|
8
10
|
});
|
|
9
11
|
LinkAnchor.displayName = "LinkAnchor";
|
|
10
12
|
export { LinkAnchor };
|
|
@@ -7,7 +7,7 @@ import { Header } from "./components/Header";
|
|
|
7
7
|
const defaultClassName = "af-modal";
|
|
8
8
|
const BooleanModal = forwardRef(({ children, title, submitTitle = "Valider", cancelTitle = "Annuler", className = defaultClassName, classModifier, onCancel, onSubmit, closeButtonAriaLabel, ...props }, ref) => {
|
|
9
9
|
const componentClassName = getComponentClassName(className, classModifier, defaultClassName);
|
|
10
|
-
return (_jsxs(Modal, { className: componentClassName, onOutsideTap: onCancel, title: title, ref: ref, ...props, children: [_jsx(Header, { title: title, onCancel: onCancel, closeButtonAriaLabel: closeButtonAriaLabel }), _jsx(Body, { children: children }), _jsxs(Footer, { children: [_jsx(Button, {
|
|
10
|
+
return (_jsxs(Modal, { className: componentClassName, onOutsideTap: onCancel, title: title, ref: ref, ...props, children: [_jsx(Header, { title: title, onCancel: onCancel, closeButtonAriaLabel: closeButtonAriaLabel }), _jsx(Body, { children: children }), _jsxs(Footer, { children: [_jsx(Button, { variant: "secondary", onClick: onCancel, children: cancelTitle }), _jsx(Button, { onClick: onSubmit, variant: "validated", children: submitTitle })] })] }));
|
|
11
11
|
});
|
|
12
12
|
BooleanModal.displayName = "BooleanModal";
|
|
13
13
|
export { BooleanModal };
|
|
@@ -2,15 +2,47 @@ import { ReactNode } from "react";
|
|
|
2
2
|
import type { VerticalStepMode } from "./types";
|
|
3
3
|
import "@axa-fr/design-system-slash-css/dist/Steps/VerticalStep.css";
|
|
4
4
|
type Props = {
|
|
5
|
+
/**
|
|
6
|
+
* title - The title of the step.
|
|
7
|
+
*/
|
|
5
8
|
title: string;
|
|
9
|
+
/**
|
|
10
|
+
* id - The id of the step, used for accessibility.
|
|
11
|
+
* It should be unique within the document.
|
|
12
|
+
*/
|
|
6
13
|
id: string;
|
|
14
|
+
/**
|
|
15
|
+
* stepMode - The mode of the step, can be "edited", "validated", or "locked".
|
|
16
|
+
*/
|
|
7
17
|
stepMode: VerticalStepMode;
|
|
18
|
+
/**
|
|
19
|
+
* onEdit - The function to call when the edit button is clicked.
|
|
20
|
+
*/
|
|
8
21
|
onEdit: React.MouseEventHandler<HTMLButtonElement>;
|
|
22
|
+
/**
|
|
23
|
+
* form - The content of the form to display when the step is in "edited" mode.
|
|
24
|
+
*/
|
|
9
25
|
form: ReactNode;
|
|
26
|
+
/**
|
|
27
|
+
* restitution - The content to display when the step is in "validated" mode.
|
|
28
|
+
*/
|
|
10
29
|
restitution: ReactNode;
|
|
30
|
+
/**
|
|
31
|
+
* editButtonLabel - The label of the edit button.
|
|
32
|
+
*/
|
|
11
33
|
editButtonLabel?: string;
|
|
34
|
+
/**
|
|
35
|
+
* editButtonAriaLabel - The aria-label of the edit button.
|
|
36
|
+
*/
|
|
12
37
|
editButtonAriaLabel?: string;
|
|
38
|
+
/**
|
|
39
|
+
* showRestitution - Whether to show the restitution content when the step is validated.
|
|
40
|
+
*/
|
|
13
41
|
showRestitution?: boolean;
|
|
42
|
+
/**
|
|
43
|
+
* contentRight - Additional content to display on the right side of the title.
|
|
44
|
+
*/
|
|
45
|
+
contentRight?: string;
|
|
14
46
|
};
|
|
15
|
-
export declare const VerticalStep: ({ title, id, stepMode, editButtonLabel, editButtonAriaLabel, onEdit, form, restitution, showRestitution, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare const VerticalStep: ({ title, id, stepMode, editButtonLabel, editButtonAriaLabel, onEdit, form, restitution, showRestitution, contentRight, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
16
48
|
export {};
|
|
@@ -8,7 +8,7 @@ import { Svg } from "../Svg";
|
|
|
8
8
|
import "@axa-fr/design-system-slash-css/dist/Steps/VerticalStep.css";
|
|
9
9
|
import { Button } from "../Button/Button";
|
|
10
10
|
const defaultClassName = "af-vertical-step";
|
|
11
|
-
export const VerticalStep = ({ title, id, stepMode, editButtonLabel = "Modifier", editButtonAriaLabel = `Modifier l'étape ${title}`, onEdit, form, restitution, showRestitution = true, }) => {
|
|
11
|
+
export const VerticalStep = ({ title, id, stepMode, editButtonLabel = "Modifier", editButtonAriaLabel = `Modifier l'étape ${title}`, onEdit, form, restitution, showRestitution = true, contentRight, }) => {
|
|
12
12
|
const isStepInEdition = stepMode === "edited";
|
|
13
13
|
const isStepValidated = stepMode === "validated";
|
|
14
14
|
const isStepLocked = stepMode === "locked";
|
|
@@ -18,5 +18,5 @@ export const VerticalStep = ({ title, id, stepMode, editButtonLabel = "Modifier"
|
|
|
18
18
|
[`${defaultClassName}-icon--validated`]: isStepValidated,
|
|
19
19
|
[`${defaultClassName}-icon--locked`]: isStepLocked,
|
|
20
20
|
[`${defaultClassName}-icon--edited`]: isStepInEdition,
|
|
21
|
-
}), children: [isStepValidated ? _jsx(Svg, { role: "presentation", src: check }) : null, isStepLocked ? _jsx(Svg, { role: "presentation", src: lock }) : null, isStepInEdition ? _jsx(Svg, { role: "presentation", src: edit }) : null] }), _jsx(Title, {
|
|
21
|
+
}), children: [isStepValidated ? _jsx(Svg, { role: "presentation", src: check }) : null, isStepLocked ? _jsx(Svg, { role: "presentation", src: lock }) : null, isStepInEdition ? _jsx(Svg, { role: "presentation", src: edit }) : null] }), _jsx(Title, { id: id, contentLeft: isStepValidated ? (_jsxs(Button, { "aria-label": editButtonAriaLabel, onClick: onEdit, className: "af-vertical-step-title-button", children: [_jsx(Svg, { role: "presentation", src: edit }), editButtonLabel] })) : undefined, contentRight: contentRight, children: title }), isStepInEdition ? _jsx("section", { children: form }) : null, isStepValidated && showRestitution ? (_jsx("section", { children: restitution })) : null, isStepInEdition ? (_jsx("div", { className: classNames(`${defaultClassName}-icon ${defaultClassName}-icon--lastIcon`), children: _jsx(Svg, { role: "presentation", src: check }) })) : null] }));
|
|
22
22
|
};
|
|
@@ -2,9 +2,10 @@ type LiProps = {
|
|
|
2
2
|
isVisible?: boolean;
|
|
3
3
|
active?: boolean;
|
|
4
4
|
value: number;
|
|
5
|
+
pageLinkLabel: string;
|
|
5
6
|
onChange: (e: {
|
|
6
7
|
value: number;
|
|
7
8
|
}) => void;
|
|
8
9
|
};
|
|
9
|
-
declare const Li: ({ isVisible, active, value,
|
|
10
|
+
declare const Li: ({ isVisible, active, value, pageLinkLabel, onChange }: LiProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
10
11
|
export { Li };
|
|
@@ -5,10 +5,10 @@ const onClick = ({ onChange, value }) => (event) => {
|
|
|
5
5
|
value: Number(value),
|
|
6
6
|
});
|
|
7
7
|
};
|
|
8
|
-
const Li = ({ isVisible, active, value,
|
|
8
|
+
const Li = ({ isVisible, active, value, pageLinkLabel, onChange }) => {
|
|
9
9
|
if (!isVisible) {
|
|
10
10
|
return null;
|
|
11
11
|
}
|
|
12
|
-
return (_jsx("li", { className: "af-pager__item", children: _jsx("a", { "aria-current": active ? "page" : undefined, className: "af-pager__item-link", href: "/#", onClick: onClick({
|
|
12
|
+
return (_jsx("li", { className: "af-pager__item", children: _jsx("a", { "aria-current": active ? "page" : undefined, className: "af-pager__item-link", href: "/#", "aria-label": `Page ${value} des ${pageLinkLabel}`, onClick: onClick({ onChange, value }), children: _jsx("span", { children: value }) }) }));
|
|
13
13
|
};
|
|
14
14
|
export { Li };
|
|
@@ -27,11 +27,15 @@ export type PagerComponentProps = Pick<ComponentPropsWithoutRef<typeof Paginatio
|
|
|
27
27
|
* Label for the next button
|
|
28
28
|
*/
|
|
29
29
|
nextLabel?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Label for page links and select
|
|
32
|
+
*/
|
|
33
|
+
elementsLabel?: string;
|
|
30
34
|
/**
|
|
31
35
|
* Label for text betweeen current page a total number of pages. Only used in "light" mode
|
|
32
36
|
* @default "sur"
|
|
33
37
|
*/
|
|
34
38
|
ofLabel?: string;
|
|
35
39
|
};
|
|
36
|
-
declare const Pager: ({ className, classModifier, numberPages, currentPage, onChange, mode, previousLabel, nextLabel, ofLabel, }: PagerComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
declare const Pager: ({ className, classModifier, numberPages, currentPage, onChange, mode, previousLabel, nextLabel, elementsLabel, ofLabel, }: PagerComponentProps) => import("react/jsx-runtime").JSX.Element;
|
|
37
41
|
export { Pager };
|
|
@@ -4,13 +4,13 @@ import { getComponentClassName } from "../..";
|
|
|
4
4
|
import { Li } from "./Li";
|
|
5
5
|
import { LiPoint } from "./LiPoint";
|
|
6
6
|
import { PaginationButton } from "./PaginationButton";
|
|
7
|
-
const Pager = ({ className, classModifier, numberPages = 1, currentPage = 1, onChange, mode = "default", previousLabel = "« Précédent", nextLabel = "Suivant »", ofLabel = "sur", }) => {
|
|
7
|
+
const Pager = ({ className, classModifier, numberPages = 1, currentPage = 1, onChange, mode = "default", previousLabel = "« Précédent", nextLabel = "Suivant »", elementsLabel = "éléments", ofLabel = "sur", }) => {
|
|
8
8
|
const hasNext = currentPage < numberPages;
|
|
9
9
|
const hasPrevious = currentPage > 1;
|
|
10
10
|
const componentClassName = getComponentClassName(className, classModifier, "af-pager");
|
|
11
11
|
if (mode === "light") {
|
|
12
|
-
return (_jsx("nav", { className: componentClassName, children: _jsxs("ul", { className: "af-pager__pagination", children: [_jsx(PaginationButton, { onChange: onChange, value: currentPage - 1, active: hasPrevious, isVisible: true, children: _jsx("i", { className: "glyphicon glyphicon-chevron-left", "aria-hidden": "true" }) }), _jsxs(LiPoint, { isVisible: true, children: [currentPage, " ", ofLabel, " ", numberPages] }), _jsx(PaginationButton, { onChange: onChange, value: currentPage + 1, active: hasNext, isVisible: true, children: _jsx("i", { className: "glyphicon glyphicon-chevron-right", "aria-hidden": "true" }) })] }) }));
|
|
12
|
+
return (_jsx("nav", { className: componentClassName, children: _jsxs("ul", { className: "af-pager__pagination", children: [_jsx(PaginationButton, { onChange: onChange, value: currentPage - 1, active: hasPrevious, isVisible: true, ariaLabel: `Page précédente des ${elementsLabel}`, children: _jsx("i", { className: "glyphicon glyphicon-chevron-left", "aria-hidden": "true" }) }), _jsxs(LiPoint, { isVisible: true, children: [currentPage, " ", ofLabel, " ", numberPages] }), _jsx(PaginationButton, { onChange: onChange, value: currentPage + 1, active: hasNext, isVisible: true, ariaLabel: `Page suivante des ${elementsLabel}`, children: _jsx("i", { className: "glyphicon glyphicon-chevron-right", "aria-hidden": "true" }) })] }) }));
|
|
13
13
|
}
|
|
14
|
-
return (_jsx("nav", { className: componentClassName, children: _jsxs("ul", { className: "af-pager__pagination", children: [_jsx(PaginationButton, { onChange: onChange, value: currentPage - 1, active: hasPrevious, isVisible: true, children: previousLabel }), _jsx(Li, { onChange: onChange, value: 1, isVisible: numberPages > 1 && currentPage > 1 }), _jsx(LiPoint, { isVisible: currentPage > 3, children: "..." }), _jsx(Li, { onChange: onChange, value: currentPage - 1, isVisible: numberPages > 2 && currentPage > 2 }), _jsx(Li, { onChange: onChange, value: currentPage, active: true, isVisible: numberPages > 0 }), _jsx(Li, { onChange: onChange, value: currentPage + 1, isVisible: currentPage < numberPages - 1 }), _jsx(LiPoint, { isVisible: currentPage < numberPages - 2, children: "..." }), _jsx(Li, { onChange: onChange, value: numberPages, isVisible: currentPage < numberPages }), _jsx(PaginationButton, { onChange: onChange, value: currentPage + 1, active: hasNext, isVisible: true, children: nextLabel })] }) }));
|
|
14
|
+
return (_jsx("nav", { className: componentClassName, children: _jsxs("ul", { className: "af-pager__pagination", children: [_jsx(PaginationButton, { onChange: onChange, value: currentPage - 1, active: hasPrevious, isVisible: true, ariaLabel: `Page précédente des ${elementsLabel}`, children: previousLabel }), _jsx(Li, { onChange: onChange, value: 1, isVisible: numberPages > 1 && currentPage > 1, pageLinkLabel: elementsLabel }), _jsx(LiPoint, { isVisible: currentPage > 3, children: "..." }), _jsx(Li, { onChange: onChange, value: currentPage - 1, isVisible: numberPages > 2 && currentPage > 2, pageLinkLabel: elementsLabel }), _jsx(Li, { onChange: onChange, value: currentPage, active: true, isVisible: numberPages > 0, pageLinkLabel: elementsLabel }), _jsx(Li, { onChange: onChange, value: currentPage + 1, isVisible: currentPage < numberPages - 1, pageLinkLabel: elementsLabel }), _jsx(LiPoint, { isVisible: currentPage < numberPages - 2, children: "..." }), _jsx(Li, { onChange: onChange, value: numberPages, isVisible: currentPage < numberPages, pageLinkLabel: elementsLabel }), _jsx(PaginationButton, { onChange: onChange, value: currentPage + 1, active: hasNext, isVisible: true, ariaLabel: `Page suivante des ${elementsLabel}`, children: nextLabel })] }) }));
|
|
15
15
|
};
|
|
16
16
|
export { Pager };
|
|
@@ -7,6 +7,7 @@ type PaginationButtonProps = {
|
|
|
7
7
|
onChange: (e: {
|
|
8
8
|
value: number;
|
|
9
9
|
}) => void;
|
|
10
|
+
ariaLabel: string;
|
|
10
11
|
};
|
|
11
|
-
declare const PaginationButton: ({ isVisible, active, children, value, onChange, }: PaginationButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
declare const PaginationButton: ({ isVisible, active, children, value, onChange, ariaLabel, }: PaginationButtonProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
12
13
|
export { PaginationButton };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
const PaginationButton = ({ isVisible, active, children, value, onChange, }) => {
|
|
2
|
+
const PaginationButton = ({ isVisible, active, children, value, onChange, ariaLabel, }) => {
|
|
3
3
|
if (!isVisible) {
|
|
4
4
|
return null;
|
|
5
5
|
}
|
|
6
6
|
if (active) {
|
|
7
|
-
return (_jsx("li", { className: "af-pager__item", children: _jsx("a", { className: "af-pager__item-link", href: "/#", role: "button", onClick: (e) => {
|
|
7
|
+
return (_jsx("li", { className: "af-pager__item", children: _jsx("a", { className: "af-pager__item-link", href: "/#", role: "button", "aria-label": ariaLabel, onClick: (e) => {
|
|
8
8
|
e.preventDefault();
|
|
9
9
|
onChange({ value });
|
|
10
10
|
}, children: children }) }));
|
|
@@ -9,6 +9,7 @@ type OnChangePager = (e: {
|
|
|
9
9
|
}) => void;
|
|
10
10
|
export type Props = Omit<PagingComponentProps, "onChange"> & {
|
|
11
11
|
onChange?: OnChangePager;
|
|
12
|
+
selectPageSizeLabel?: string;
|
|
12
13
|
};
|
|
13
|
-
declare const Paging: ({ className, classModifier, currentPage, displayLabel,
|
|
14
|
+
declare const Paging: ({ className, classModifier, currentPage, displayLabel, elementsLabel, selectPageSizeLabel, id, mode, nextLabel, numberItems, numberPages, ofLabel, previousLabel, items, onChange, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
14
15
|
export { Paging };
|
|
@@ -4,7 +4,7 @@ import { useCallback } from "react";
|
|
|
4
4
|
import { getComponentClassName } from "../..";
|
|
5
5
|
import { Items } from "./Items";
|
|
6
6
|
import { Pager } from "./Pager";
|
|
7
|
-
const Paging = ({ className, classModifier, currentPage = 1, displayLabel,
|
|
7
|
+
const Paging = ({ className, classModifier, currentPage = 1, displayLabel, elementsLabel, selectPageSizeLabel, id, mode, nextLabel, numberItems = 10, numberPages, ofLabel, previousLabel, items, onChange, }) => {
|
|
8
8
|
const componentClassName = getComponentClassName(className, classModifier, "af-paging");
|
|
9
9
|
const handleChangeItems = useCallback((e) => onChange &&
|
|
10
10
|
onChange({
|
|
@@ -16,6 +16,6 @@ const Paging = ({ className, classModifier, currentPage = 1, displayLabel, selec
|
|
|
16
16
|
numberItems,
|
|
17
17
|
page: e.value,
|
|
18
18
|
}), [numberItems, onChange]);
|
|
19
|
-
return (_jsxs("div", { className: componentClassName, children: [_jsx("div", { className: "af-paging__limit", children: _jsx(Items, { onChange: handleChangeItems, numberItems: numberItems, id: id, displayLabel: displayLabel, selectAriaLabel:
|
|
19
|
+
return (_jsxs("div", { className: componentClassName, children: [_jsx("div", { className: "af-paging__limit", children: _jsx(Items, { onChange: handleChangeItems, numberItems: numberItems, id: id, displayLabel: displayLabel, selectAriaLabel: selectPageSizeLabel, elementsLabel: elementsLabel, items: items }) }), _jsx("div", { className: "af-paging__pager", children: _jsx(Pager, { onChange: handleChangePager, currentPage: currentPage, numberPages: numberPages, previousLabel: previousLabel, nextLabel: nextLabel, elementsLabel: elementsLabel, ofLabel: ofLabel, mode: mode }) })] }));
|
|
20
20
|
};
|
|
21
21
|
export { Paging };
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ComponentPropsWithRef, PropsWithChildren } from "react";
|
|
2
|
+
import "@axa-fr/design-system-slash-css/dist/Tag/Tag.scss";
|
|
3
|
+
type TagModifier = "success" | "information" | "warning" | "error" | "default" | "dark" | "purple" | "gray";
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated instead use warning
|
|
6
|
+
*/
|
|
7
|
+
type TagModifierDecrepated = "danger" | "info";
|
|
8
|
+
type TagProps = ComponentPropsWithRef<"span"> & {
|
|
9
|
+
classModifier?: `${TagModifier | TagModifierDecrepated}` | string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* Tag component to display a label with various styles.
|
|
14
|
+
*
|
|
15
|
+
* @component
|
|
16
|
+
* @example
|
|
17
|
+
* // Basic usage
|
|
18
|
+
* <Tag classModifier="success">Success Tag</Tag>
|
|
19
|
+
*
|
|
20
|
+
* @param {object} props - The properties object.
|
|
21
|
+
* @param {React.ReactNode} props.children - The content to be displayed inside the tag.
|
|
22
|
+
* @param {string} [props.className] - Additional class names to apply to the tag.
|
|
23
|
+
* @param {string} [props.classModifier] - Modifier class to apply specific styles. Note: "danger" is deprecated, use "warning" instead. "info" is deprecated, use "information" instead
|
|
24
|
+
* @param {boolean} [props.disabled] - If true, the tag will be disabled.
|
|
25
|
+
* @param {React.Ref<HTMLSpanElement>} ref - The ref to the span element.
|
|
26
|
+
* @returns {JSX.Element} The rendered Tag component.
|
|
27
|
+
*/
|
|
28
|
+
export declare const Tag: import("react").ForwardRefExoticComponent<Omit<PropsWithChildren<TagProps>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
29
|
+
export {};
|
package/dist/Tag/Tag.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { getComponentClassName } from "../utilities";
|
|
4
|
+
import "@axa-fr/design-system-slash-css/dist/Tag/Tag.scss";
|
|
5
|
+
/**
|
|
6
|
+
* Tag component to display a label with various styles.
|
|
7
|
+
*
|
|
8
|
+
* @component
|
|
9
|
+
* @example
|
|
10
|
+
* // Basic usage
|
|
11
|
+
* <Tag classModifier="success">Success Tag</Tag>
|
|
12
|
+
*
|
|
13
|
+
* @param {object} props - The properties object.
|
|
14
|
+
* @param {React.ReactNode} props.children - The content to be displayed inside the tag.
|
|
15
|
+
* @param {string} [props.className] - Additional class names to apply to the tag.
|
|
16
|
+
* @param {string} [props.classModifier] - Modifier class to apply specific styles. Note: "danger" is deprecated, use "warning" instead. "info" is deprecated, use "information" instead
|
|
17
|
+
* @param {boolean} [props.disabled] - If true, the tag will be disabled.
|
|
18
|
+
* @param {React.Ref<HTMLSpanElement>} ref - The ref to the span element.
|
|
19
|
+
* @returns {JSX.Element} The rendered Tag component.
|
|
20
|
+
*/
|
|
21
|
+
export const Tag = forwardRef(({ children, className, classModifier = "default", ...otherProps }, ref) => {
|
|
22
|
+
const componentClassName = getComponentClassName(className, classModifier, "af-tag");
|
|
23
|
+
// Kept for backward compatibility. May be removed in a future version
|
|
24
|
+
const badgeClassName = getComponentClassName(className, classModifier, "af-badge");
|
|
25
|
+
return (_jsx("span", { ref: ref, className: `${componentClassName} ${badgeClassName}`, ...otherProps, children: children }));
|
|
26
|
+
});
|
|
27
|
+
Tag.displayName = "Tag";
|
package/dist/Title/Title.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "@axa-fr/design-system-slash-css/dist/Title/Title.scss";
|
|
2
|
-
import { ComponentPropsWithRef, PropsWithChildren, ReactElement } from "react";
|
|
2
|
+
import { ComponentPropsWithRef, PropsWithChildren, ReactElement, ReactNode } from "react";
|
|
3
3
|
type Headings = "h2" | "h3" | "h4";
|
|
4
4
|
type TitleProps = ComponentPropsWithRef<"h2"> & {
|
|
5
5
|
classModifier?: string;
|
|
6
6
|
heading?: Headings;
|
|
7
7
|
contentLeft?: ReactElement;
|
|
8
|
-
contentRight?:
|
|
8
|
+
contentRight?: ReactNode;
|
|
9
9
|
};
|
|
10
10
|
export declare const Title: import("react").ForwardRefExoticComponent<Omit<PropsWithChildren<TitleProps>, "ref"> & import("react").RefAttributes<HTMLHeadingElement>>;
|
|
11
11
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,18 @@ import "@axa-fr/design-system-slash-css/dist/common/icons.scss";
|
|
|
2
2
|
import "@axa-fr/design-system-slash-css/dist/common/reboot.scss";
|
|
3
3
|
import "@axa-fr/design-system-slash-css/dist/common/tokens.css";
|
|
4
4
|
import "@fontsource/source-sans-pro";
|
|
5
|
+
import "@fontsource/source-sans-pro/700.css";
|
|
5
6
|
import { Message } from "./Messages/Message";
|
|
7
|
+
import { Tag } from "./Tag/Tag";
|
|
6
8
|
export { Action } from "./Action/Action";
|
|
7
|
-
|
|
9
|
+
/** @deprecated Use `Tag` instead. */
|
|
10
|
+
declare const Badge: import("react").ForwardRefExoticComponent<Omit<import("react").PropsWithChildren<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
|
|
11
|
+
classModifier?: `${("error" | "warning" | "success" | "information" | "default" | "dark" | "purple" | "gray") | ("info" | "danger")}` | string;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
}>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
14
|
+
export { Badge, Tag };
|
|
8
15
|
export { Button } from "./Button/Button";
|
|
16
|
+
export type { ButtonVariant } from "./Button/Button";
|
|
9
17
|
export { Card } from "./Card/Card";
|
|
10
18
|
export { Divider } from "./Divider/Divider";
|
|
11
19
|
export { Checkbox, CheckboxInput, CheckboxItem, CheckboxModes, } from "./Form/Checkbox";
|
|
@@ -24,6 +32,7 @@ export { Text, TextInput } from "./Form/Text";
|
|
|
24
32
|
export { Textarea, TextareaInput } from "./Form/Textarea";
|
|
25
33
|
export { Footer } from "./Layout/Footer";
|
|
26
34
|
export { Header, HeaderTitle, Infos, MenuTitleWrapper, Name, NavBar, NavBarBase, NavBarItem, NavBarItemBase, NavBarItemLink, ToggleButton, User, } from "./Layout/Header";
|
|
35
|
+
export { MainContainer } from "./Layout/MainContainer/MainContainer";
|
|
27
36
|
export { Link, type LinkProps } from "./Link/Link";
|
|
28
37
|
export { BooleanModal, Modal, ModalBody, ModalFooter, ModalHeader, ModalHeaderBase, } from "./ModalAgent";
|
|
29
38
|
export { ArticleRestitution, HeaderRestitution, Restitution, RestitutionList, SectionRestitution, SectionRestitutionColumn, SectionRestitutionRow, SectionRestitutionTitle, } from "./Restitution";
|
|
@@ -45,3 +54,5 @@ export * from "./Table";
|
|
|
45
54
|
export { Alert, Message };
|
|
46
55
|
export { HelpButton } from "./HelpButton";
|
|
47
56
|
export { Loader } from "./Loader/Loader";
|
|
57
|
+
export { CardData } from "./CardData/CardData";
|
|
58
|
+
export type { CardDataVariant } from "./CardData/CardData";
|
package/dist/index.js
CHANGED
|
@@ -2,9 +2,13 @@ import "@axa-fr/design-system-slash-css/dist/common/icons.scss";
|
|
|
2
2
|
import "@axa-fr/design-system-slash-css/dist/common/reboot.scss";
|
|
3
3
|
import "@axa-fr/design-system-slash-css/dist/common/tokens.css";
|
|
4
4
|
import "@fontsource/source-sans-pro";
|
|
5
|
+
import "@fontsource/source-sans-pro/700.css";
|
|
5
6
|
import { Message } from "./Messages/Message";
|
|
7
|
+
import { Tag } from "./Tag/Tag";
|
|
6
8
|
export { Action } from "./Action/Action";
|
|
7
|
-
|
|
9
|
+
/** @deprecated Use `Tag` instead. */
|
|
10
|
+
const Badge = Tag;
|
|
11
|
+
export { Badge, Tag };
|
|
8
12
|
export { Button } from "./Button/Button";
|
|
9
13
|
export { Card } from "./Card/Card";
|
|
10
14
|
export { Divider } from "./Divider/Divider";
|
|
@@ -24,6 +28,7 @@ export { Text, TextInput } from "./Form/Text";
|
|
|
24
28
|
export { Textarea, TextareaInput } from "./Form/Textarea";
|
|
25
29
|
export { Footer } from "./Layout/Footer";
|
|
26
30
|
export { Header, HeaderTitle, Infos, MenuTitleWrapper, Name, NavBar, NavBarBase, NavBarItem, NavBarItemBase, NavBarItemLink, ToggleButton, User, } from "./Layout/Header";
|
|
31
|
+
export { MainContainer } from "./Layout/MainContainer/MainContainer";
|
|
27
32
|
export { Link } from "./Link/Link";
|
|
28
33
|
export { BooleanModal, Modal, ModalBody, ModalFooter, ModalHeader, ModalHeaderBase, } from "./ModalAgent";
|
|
29
34
|
export { ArticleRestitution, HeaderRestitution, Restitution, RestitutionList, SectionRestitution, SectionRestitutionColumn, SectionRestitutionRow, SectionRestitutionTitle, } from "./Restitution";
|
|
@@ -44,3 +49,4 @@ export * from "./Table";
|
|
|
44
49
|
export { Alert, Message };
|
|
45
50
|
export { HelpButton } from "./HelpButton";
|
|
46
51
|
export { Loader } from "./Loader/Loader";
|
|
52
|
+
export { CardData } from "./CardData/CardData";
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates a component class name string based on provided class names and modifiers.
|
|
3
|
+
*
|
|
4
|
+
* @param {string} [className] - The base class name.
|
|
5
|
+
* @param {string} [classModifier] - A space-separated string of class modifiers.
|
|
6
|
+
* @param {string} [defaultClassName] - The default class name to use if className is not provided.
|
|
7
|
+
* @returns {string} The generated class name string.
|
|
8
|
+
*/
|
|
1
9
|
export declare const getComponentClassName: (className?: string, classModifier?: string, defaultClassName?: string) => string;
|
|
2
10
|
type getComponentClassNameWithUserClassnameParams = {
|
|
3
11
|
userClassName?: string;
|
|
@@ -11,6 +11,14 @@ const listClassModifier = (classModifier) => {
|
|
|
11
11
|
}
|
|
12
12
|
return classModifier.split(" ");
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* Generates a component class name string based on provided class names and modifiers.
|
|
16
|
+
*
|
|
17
|
+
* @param {string} [className] - The base class name.
|
|
18
|
+
* @param {string} [classModifier] - A space-separated string of class modifiers.
|
|
19
|
+
* @param {string} [defaultClassName] - The default class name to use if className is not provided.
|
|
20
|
+
* @returns {string} The generated class name string.
|
|
21
|
+
*/
|
|
14
22
|
export const getComponentClassName = (className, classModifier, defaultClassName) => {
|
|
15
23
|
const classNameToUse = className || defaultClassName;
|
|
16
24
|
// Fail fast, when no className or defaultClassName we don't want to loop on modifier
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/design-system-slash-react",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0-alpha.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
},
|
|
48
48
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"@axa-fr/design-system-slash-css": "
|
|
50
|
+
"@axa-fr/design-system-slash-css": "2.0.0-alpha.1",
|
|
51
51
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
52
52
|
"react": ">= 18"
|
|
53
53
|
},
|
package/dist/Badge/Badge.d.ts
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { ComponentPropsWithRef, PropsWithChildren } from "react";
|
|
2
|
-
import "@axa-fr/design-system-slash-css/dist/Badge/Badge.scss";
|
|
3
|
-
type BadgeProps = ComponentPropsWithRef<"span"> & {
|
|
4
|
-
classModifier?: string;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export declare const Badge: import("react").ForwardRefExoticComponent<Omit<PropsWithChildren<BadgeProps>, "ref"> & import("react").RefAttributes<HTMLSpanElement>>;
|
|
8
|
-
export {};
|
package/dist/Badge/Badge.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
|
-
import { getComponentClassName } from "../utilities";
|
|
4
|
-
import "@axa-fr/design-system-slash-css/dist/Badge/Badge.scss";
|
|
5
|
-
export const Badge = forwardRef(({ children, className, classModifier, ...otherProps }, ref) => {
|
|
6
|
-
const componentClassName = getComponentClassName(className, classModifier, "af-badge");
|
|
7
|
-
return (_jsx("span", { ref: ref, className: componentClassName, ...otherProps, children: children }));
|
|
8
|
-
});
|
|
9
|
-
Badge.displayName = "Badge";
|