@axa-fr/design-system-look-and-feel-react 1.0.5-ci.12 → 1.0.5-ci.120
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/AccordionCore/AccordionCore.js +1 -1
- package/dist/Alert/Alert.d.ts +3 -3
- package/dist/Alert/Alert.js +6 -6
- package/dist/Button/Button.d.ts +2 -17
- package/dist/Button/Button.js +1 -15
- package/dist/Card/Card.js +1 -1
- package/dist/Divider/Divider.js +1 -1
- package/dist/Form/Checkbox/Checkbox.js +2 -2
- package/dist/Form/Checkbox/CheckboxSelect.d.ts +3 -3
- package/dist/Form/Checkbox/CheckboxSelect.js +5 -2
- package/dist/Form/FileUpload/FileUpload.d.ts +7 -5
- package/dist/Form/FileUpload/FileUpload.js +22 -23
- package/dist/Form/Radio/Radio.js +2 -2
- package/dist/Form/Radio/RadioSelect.d.ts +1 -1
- package/dist/Form/Radio/RadioSelect.js +5 -2
- package/dist/Form/Select/Select.d.ts +5 -22
- package/dist/Form/Select/Select.js +11 -23
- package/dist/Form/Text/Text.d.ts +3 -0
- package/dist/Form/Text/Text.js +7 -4
- package/dist/Form/TextArea/TextArea.js +2 -3
- package/dist/Form/core/FieldForm.d.ts +1 -1
- package/dist/Form/core/FieldForm.js +3 -2
- package/dist/Grid/DebugGrid.d.ts +1 -5
- package/dist/Grid/DebugGrid.js +1 -9
- package/dist/IconBg/IconBg.js +1 -1
- package/dist/Layout/Header/BurgerMenu/BurgerMenu.d.ts +13 -0
- package/dist/Layout/Header/BurgerMenu/BurgerMenu.js +26 -0
- package/dist/Layout/Header/BurgerMenu/index.d.ts +1 -0
- package/dist/Layout/Header/BurgerMenu/index.js +1 -0
- package/dist/Layout/Header/Header.d.ts +6 -6
- package/dist/Layout/Header/Header.js +30 -4
- package/dist/Layout/Header/NavBar/NavBar.d.ts +3 -3
- package/dist/Layout/Header/NavBar/NavBar.js +10 -5
- package/dist/Layout/Header/PreviousLink/PreviousLink.d.ts +1 -1
- package/dist/Layout/Header/PreviousLink/PreviousLink.js +3 -1
- package/dist/Layout/Header/index.d.ts +3 -0
- package/dist/Layout/Header/index.js +3 -0
- package/dist/Link/Link.js +1 -1
- package/dist/List/ClickList/ClickItem/ClickItem.js +1 -1
- package/dist/List/ContentItemDuo/ContentItemDuo.d.ts +2 -1
- package/dist/List/ContentItemDuo/ContentItemDuo.js +3 -4
- package/dist/List/ContentItemMono/ContentItemMono.js +1 -1
- package/dist/Modal/Modal.d.ts +12 -0
- package/dist/Modal/Modal.js +10 -0
- package/dist/Modal/ModalCore.d.ts +11 -0
- package/dist/Modal/ModalCore.js +6 -0
- package/dist/Modal/components/ModalCoreBody.d.ts +2 -0
- package/dist/Modal/components/ModalCoreBody.js +2 -0
- package/dist/Modal/components/ModalCoreFooter.d.ts +2 -0
- package/dist/Modal/components/ModalCoreFooter.js +2 -0
- package/dist/Modal/components/ModalCoreHeader.d.ts +12 -0
- package/dist/Modal/components/ModalCoreHeader.js +8 -0
- package/dist/Modal/index.d.ts +5 -0
- package/dist/Modal/index.js +5 -0
- package/dist/Skeleton/Skeleton.d.ts +1 -1
- package/dist/SkeletonList/SkeletonList.d.ts +1 -1
- package/dist/Spinner/Spinner.d.ts +2 -0
- package/dist/Spinner/Spinner.js +1 -0
- package/dist/Stepper/Stepper.d.ts +1 -1
- package/dist/Stepper/Stepper.js +3 -3
- package/dist/Tag/Tag.js +1 -1
- package/dist/Title/Title.js +1 -1
- package/dist/Title/TitleWithSubtitles.d.ts +1 -1
- package/dist/index.d.ts +8 -6
- package/dist/index.js +7 -5
- package/dist/utilities/helpers/getComponentClassName.d.ts +1 -1
- package/dist/utilities/helpers/getComponentClassName.js +7 -8
- package/package.json +41 -21
- package/dist/Form/Select/CustomOption.d.ts +0 -4
- package/dist/Form/Select/CustomOption.js +0 -8
- package/dist/Form/Select/DropdownIndicator.d.ts +0 -4
- package/dist/Form/Select/DropdownIndicator.js +0 -11
- package/dist/Grid/components/Card.d.ts +0 -3
- package/dist/Grid/components/Card.js +0 -2
- package/dist/Grid/components/Contacts.d.ts +0 -1
- package/dist/Grid/components/Contacts.js +0 -9
- package/dist/Grid/components/MainTitle.d.ts +0 -1
- package/dist/Grid/components/MainTitle.js +0 -4
- package/dist/Grid/components/MyFooter.d.ts +0 -1
- package/dist/Grid/components/MyFooter.js +0 -31
- package/dist/Grid/components/MyHeader.d.ts +0 -1
- package/dist/Grid/components/MyHeader.js +0 -9
- package/dist/Grid/components/MyList.d.ts +0 -1
- package/dist/Grid/components/MyList.js +0 -3
- package/dist/Grid/components/Offsets.d.ts +0 -1
- package/dist/Grid/components/Offsets.js +0 -7
- package/dist/Grid/renderExampleForm.d.ts +0 -1
- package/dist/Grid/renderExampleForm.js +0 -30
- package/dist/Grid/renderExamplePage.d.ts +0 -1
- package/dist/Grid/renderExamplePage.js +0 -9
- package/dist/Grid/renderWireframe.d.ts +0 -1
- package/dist/Grid/renderWireframe.js +0 -5
- package/dist/Loader/Loader.d.ts +0 -12
- package/dist/Loader/Loader.js +0 -11
- package/dist/Loader/index.d.ts +0 -1
- package/dist/Loader/index.js +0 -1
- package/dist/ModalClient/Modal.container.d.ts +0 -4
- package/dist/ModalClient/Modal.container.js +0 -45
- package/dist/ModalClient/Modal.d.ts +0 -4
- package/dist/ModalClient/Modal.hook.d.ts +0 -6
- package/dist/ModalClient/Modal.hook.js +0 -25
- package/dist/ModalClient/Modal.js +0 -6
- package/dist/ModalClient/index.d.ts +0 -1
- package/dist/ModalClient/index.js +0 -1
- package/dist/ModalClient/type.d.ts +0 -38
- package/dist/ModalClient/type.js +0 -1
@@ -1,9 +1,9 @@
|
|
1
1
|
import "@axa-fr/design-system-look-and-feel-css/dist/Layout/Header/Header.scss";
|
2
|
-
import {
|
3
|
-
type HeaderProps = {
|
2
|
+
import { ComponentProps, PropsWithChildren, ReactElement, type ReactNode } from "react";
|
3
|
+
type HeaderProps = PropsWithChildren<{
|
4
4
|
defaultActiveLink?: number;
|
5
|
-
previousLink?:
|
6
|
-
rightItem?:
|
7
|
-
} &
|
8
|
-
export declare const Header: ({ children, defaultActiveLink, previousLink, rightItem, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
5
|
+
previousLink?: ReactNode;
|
6
|
+
rightItem?: ReactElement | ReactElement[];
|
7
|
+
} & ComponentProps<"header">>;
|
8
|
+
export declare const Header: ({ children, defaultActiveLink, previousLink, rightItem, ...props }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
9
9
|
export {};
|
@@ -1,11 +1,37 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
2
2
|
import "@axa-fr/design-system-look-and-feel-css/dist/Layout/Header/Header.scss";
|
3
|
-
import logo from "@axa-fr/design-system-look-and-feel-css/
|
4
|
-
import { useCallback, useState } from "react";
|
3
|
+
import logo from "@axa-fr/design-system-look-and-feel-css/logo-axa.svg";
|
4
|
+
import { Children, isValidElement, useCallback, useEffect, useMemo, useState, } from "react";
|
5
|
+
import menu from "@material-symbols/svg-400/outlined/menu.svg";
|
5
6
|
import { NavBar } from "./NavBar";
|
6
7
|
import { PreviousLink } from "./PreviousLink/PreviousLink";
|
7
|
-
|
8
|
+
import { Button, IconBg, Svg } from "../..";
|
9
|
+
import { BurgerMenu } from "./BurgerMenu";
|
10
|
+
import { BREAKPOINT } from "../../utilities";
|
11
|
+
export const Header = ({ children, defaultActiveLink, previousLink, rightItem, ...props }) => {
|
8
12
|
const [activeLink, setActiveLink] = useState(defaultActiveLink);
|
13
|
+
const [isOpen, setIsOpen] = useState(false);
|
14
|
+
const toggleMenu = () => setIsOpen((prev) => !prev);
|
9
15
|
const resetActiveLink = useCallback(() => setActiveLink(defaultActiveLink), [defaultActiveLink]);
|
10
|
-
|
16
|
+
useEffect(() => {
|
17
|
+
const handleResize = () => {
|
18
|
+
if (window.innerWidth > BREAKPOINT.MD && isOpen) {
|
19
|
+
setIsOpen(false);
|
20
|
+
}
|
21
|
+
};
|
22
|
+
window.addEventListener("resize", handleResize);
|
23
|
+
return () => window.removeEventListener("resize", handleResize);
|
24
|
+
}, [isOpen]);
|
25
|
+
const burgerMenuItems = useMemo(() => {
|
26
|
+
const mapValidElements = (items) => (Children.map(items, (child) => isValidElement(child) && child) ?? []).filter(Boolean);
|
27
|
+
const validLinks = mapValidElements(children);
|
28
|
+
if (!rightItem || !isValidElement(rightItem)) {
|
29
|
+
return validLinks;
|
30
|
+
}
|
31
|
+
if (Array.isArray(rightItem)) {
|
32
|
+
return [...validLinks, ...mapValidElements(rightItem)];
|
33
|
+
}
|
34
|
+
return [...validLinks, rightItem];
|
35
|
+
}, [children, rightItem]);
|
36
|
+
return (_jsxs(_Fragment, { children: [_jsxs("header", { className: "af-header", ...props, children: [_jsxs("div", { className: "af-header-container", children: [_jsxs("div", { className: "af-header-left-item", children: [_jsx("img", { className: "af-logo", src: logo, alt: "logo AXA" }), _jsx(NavBar, { activeLink: activeLink, setActiveLink: setActiveLink, children: children })] }), rightItem && _jsx("div", { className: "af-header-right-item", children: rightItem }), burgerMenuItems && burgerMenuItems.length > 0 && (_jsx(Button, { "aria-label": isOpen ? "Fermer le menu" : "Ouvrir le menu", onClick: toggleMenu, variant: "ghost", children: _jsx(IconBg, { children: _jsx(Svg, { src: menu, "aria-hidden": "true" }) }) }))] }), _jsx(BurgerMenu, { isOpen: isOpen, items: burgerMenuItems, setActiveLink: setActiveLink, setIsOpen: setIsOpen })] }), _jsx(PreviousLink, { handleClick: resetActiveLink, children: previousLink }), burgerMenuItems && burgerMenuItems.length > 0 && (_jsx("div", { className: `af-header-overlay ${isOpen ? "open" : ""}` }))] }));
|
11
37
|
};
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import
|
1
|
+
import { type ComponentPropsWithoutRef, type PropsWithChildren, type Dispatch, type SetStateAction } from "react";
|
2
2
|
import "@axa-fr/design-system-look-and-feel-css/dist/Layout/Header/NavBar/NavBar.scss";
|
3
3
|
type NavBarProps = {
|
4
4
|
activeLink?: number;
|
5
|
-
setActiveLink:
|
5
|
+
setActiveLink: Dispatch<SetStateAction<number | undefined>>;
|
6
6
|
} & ComponentPropsWithoutRef<"nav">;
|
7
|
-
declare const NavBar: ({ activeLink, children, setActiveLink, ...
|
7
|
+
declare const NavBar: ({ activeLink, children, setActiveLink, ...props }: PropsWithChildren<NavBarProps>) => import("react/jsx-runtime").JSX.Element | null;
|
8
8
|
export { NavBar };
|
@@ -1,10 +1,15 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import
|
2
|
+
import { isValidElement, useMemo, Children, cloneElement, } from "react";
|
3
3
|
import "@axa-fr/design-system-look-and-feel-css/dist/Layout/Header/NavBar/NavBar.scss";
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
import classNames from "classnames";
|
5
|
+
const NavBar = ({ activeLink, children, setActiveLink, ...props }) => {
|
6
|
+
const validChildren = useMemo(() => (Children.map(children, (child) => isValidElement(child) && child) ?? []).filter((c) => Boolean(c)), [children]);
|
7
|
+
if (validChildren.length === 0)
|
8
|
+
return null;
|
9
|
+
return (_jsx("nav", { role: "navigation", "aria-label": "Menu principal", ...props, children: _jsx("ul", { className: "af-navbar-container", role: "menubar", children: Children.map(validChildren, (child, index) => (_jsx("li", { className: "af-navbar-item", role: "none", children: cloneElement(child, {
|
10
|
+
className: classNames("af-navbar-item__link", {
|
11
|
+
"af-navbar-item__link--active": index === activeLink,
|
12
|
+
}),
|
8
13
|
onClick: () => setActiveLink(index),
|
9
14
|
onFocus: () => setActiveLink(index),
|
10
15
|
role: "menuitem",
|
@@ -3,5 +3,5 @@ import { ComponentPropsWithoutRef, PropsWithChildren } from "react";
|
|
3
3
|
type PreviousLinkProps = {
|
4
4
|
handleClick: () => void;
|
5
5
|
} & ComponentPropsWithoutRef<"div">;
|
6
|
-
declare const PreviousLink: ({ handleClick, children, ...otherProps }: PropsWithChildren<PreviousLinkProps>) => import("react/jsx-runtime").JSX.Element;
|
6
|
+
declare const PreviousLink: ({ handleClick, children, ...otherProps }: PropsWithChildren<PreviousLinkProps>) => import("react/jsx-runtime").JSX.Element | null;
|
7
7
|
export { PreviousLink };
|
@@ -5,8 +5,10 @@ import React, { isValidElement, useMemo, } from "react";
|
|
5
5
|
import { Svg } from "../../../Svg";
|
6
6
|
const PreviousLink = ({ handleClick, children, ...otherProps }) => {
|
7
7
|
const validChildren = useMemo(() => (React.Children.map(children, (child) => isValidElement(child) && child) ?? []).filter((c) => Boolean(c)), [children]);
|
8
|
+
if (validChildren.length === 0)
|
9
|
+
return null;
|
8
10
|
return (_jsx("div", { className: "af-header-previous-link-container", ...otherProps, children: React.Children.map(validChildren, (child) => React.cloneElement(child, {
|
9
|
-
children: (_jsxs(_Fragment, { children: [_jsx(Svg, { src: arrowBack }), child.props.children] })),
|
11
|
+
children: (_jsxs(_Fragment, { children: [_jsx(Svg, { src: arrowBack, "aria-hidden": true }), child.props.children] })),
|
10
12
|
className: "af-btn-client af-btn-client--ghost af-btn-client--header-previous-link",
|
11
13
|
onClick: handleClick,
|
12
14
|
})) }));
|
package/dist/Link/Link.js
CHANGED
@@ -8,7 +8,7 @@ export const Link = ({ href, openInNewTab = false, leftIcon, rightIcon, children
|
|
8
8
|
target: "_blank",
|
9
9
|
rel: "noopener noreferrer",
|
10
10
|
};
|
11
|
-
const componentClassName = useMemo(() => getComponentClassName(className, `${classModifier}${!className && openInNewTab ? " openInNewTab" : ""}
|
11
|
+
const componentClassName = useMemo(() => getComponentClassName("af-link", className, `${classModifier}${!className && openInNewTab ? " openInNewTab" : ""}`), [classModifier, className, openInNewTab]);
|
12
12
|
return (_jsxs("a", { className: componentClassName, href: href, ...newTabProps, ...props, children: [leftIcon, children, (openInNewTab || Boolean(rightIcon)) &&
|
13
13
|
(rightIcon ?? _jsx(Svg, { src: openInNew }))] }));
|
14
14
|
};
|
@@ -4,6 +4,6 @@ import { useMemo } from "react";
|
|
4
4
|
import { Svg } from "../../../Svg";
|
5
5
|
import { getComponentClassName } from "../../../utilities";
|
6
6
|
export const ClickItem = ({ children, icon, parentClickComponent: ClickComponent = ({ children: parentClickComponentChildren, ...parentClickComponentProps }) => (_jsx("button", { type: "button", ...parentClickComponentProps, children: parentClickComponentChildren })), isDisabled = false, className, classModifier = "", actionIcon = _jsx(Svg, { src: chevron, "aria-hidden": true }), ...otherProps }) => {
|
7
|
-
const componentClassName = useMemo(() => getComponentClassName(className, `${classModifier}${isDisabled ? " disabled" : ""}
|
7
|
+
const componentClassName = useMemo(() => getComponentClassName("af-click-item", className, `${classModifier}${isDisabled ? " disabled" : ""}`), [className, classModifier, isDisabled]);
|
8
8
|
return (_jsxs(ClickComponent, { className: componentClassName, disabled: isDisabled, "aria-disabled": isDisabled, ...otherProps, children: [_jsxs("div", { className: "af-click-item__content", children: [icon && _jsx("div", { className: "af-click-item__icon", children: icon }), _jsx("div", { className: "af-click-item__label", children: children })] }), _jsx("div", { className: "af-click-item__action", children: actionIcon })] }));
|
9
9
|
};
|
@@ -2,17 +2,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import checkIcon from "@material-symbols/svg-400/outlined/check.svg";
|
3
3
|
import closeIcon from "@material-symbols/svg-400/outlined/close.svg";
|
4
4
|
import { useMemo } from "react";
|
5
|
-
import { Variants } from "../../Button/Button";
|
6
|
-
import { getComponentClassName } from "../../utilities";
|
7
5
|
import { Button, Svg } from "../..";
|
6
|
+
import { getComponentClassName } from "../../utilities";
|
8
7
|
export const ContentItemDuo = ({ label, value, isVertical = false, className, classModifier, isShowingDoneIcon = false, isShowingCloseIcon = false, buttonText, onButtonClick, }) => {
|
9
8
|
const componentClassName = useMemo(() => {
|
10
9
|
const classModifiers = [classModifier];
|
11
10
|
if (isVertical) {
|
12
11
|
classModifiers.push("vertical");
|
13
12
|
}
|
14
|
-
return getComponentClassName(className, classModifiers.filter(Boolean).join(" ")
|
13
|
+
return getComponentClassName("af-content-item-duo", className, classModifiers.filter(Boolean).join(" "));
|
15
14
|
}, [classModifier, className, isVertical]);
|
16
15
|
const iconContainerModifier = useMemo(() => ` af-content-item-duo__icon--${isShowingDoneIcon ? "done" : "close"}`, [isShowingDoneIcon]);
|
17
|
-
return (_jsxs("div", { className: componentClassName, children: [(isShowingDoneIcon || isShowingCloseIcon) && (_jsxs("div", { className: `af-content-item-duo__icon${iconContainerModifier}`, children: [isShowingDoneIcon && _jsx(Svg, { src: checkIcon }), isShowingCloseIcon && _jsx(Svg, { src: closeIcon })] })), _jsx("p", { className: "af-content-item-duo__label", children: label }), _jsx("p", { className: "af-content-item-duo__value", children: value }), buttonText && (_jsx("div", { className: "af-content-item-duo__button", children: _jsx(Button, { variant:
|
16
|
+
return (_jsxs("div", { className: componentClassName, children: [(isShowingDoneIcon || isShowingCloseIcon) && (_jsxs("div", { className: `af-content-item-duo__icon${iconContainerModifier}`, children: [isShowingDoneIcon && _jsx(Svg, { src: checkIcon }), isShowingCloseIcon && _jsx(Svg, { src: closeIcon })] })), _jsx("p", { className: "af-content-item-duo__label", children: label }), typeof value === "string" ? (_jsx("p", { className: "af-content-item-duo__value", children: value })) : (_jsx("div", { className: "af-content-item-duo__value", children: value })), buttonText && (_jsx("div", { className: "af-content-item-duo__button", children: _jsx(Button, { variant: "ghost", onClick: onButtonClick, children: buttonText }) }))] }));
|
18
17
|
};
|
@@ -8,7 +8,7 @@ export const ContentItemMono = ({ children, className, classModifier, secondaryT
|
|
8
8
|
if (isDisabled) {
|
9
9
|
classModifiers.push("disabled");
|
10
10
|
}
|
11
|
-
return getComponentClassName(className, classModifiers.filter(Boolean).join(" ")
|
11
|
+
return getComponentClassName("af-content-item-mono", className, classModifiers.filter(Boolean).join(" "));
|
12
12
|
}, [classModifier, isDisabled, size, className]);
|
13
13
|
return (_jsxs("div", { className: componentClassName, children: [hasStick && (_jsx("div", { className: "af-content-item-mono__stick", role: "presentation" })), leftElement && (_jsx("div", { className: `af-content-item-mono__left-container${isLeftElementCentered
|
14
14
|
? " af-content-item-mono__left-container--center"
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { type ModalCoreProps } from "./ModalCore";
|
3
|
+
import { type ModalCoreHeaderProps } from "./components/ModalCoreHeader";
|
4
|
+
export type ModalProps = Omit<ModalCoreProps, "onOutsideTap" | "title"> & ModalCoreHeaderProps & {
|
5
|
+
onSubmit?: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
6
|
+
submitTitle?: string;
|
7
|
+
cancelTitle?: string;
|
8
|
+
submitDisabled?: boolean;
|
9
|
+
cancelDisabled?: boolean;
|
10
|
+
};
|
11
|
+
declare const Modal: React.ForwardRefExoticComponent<Omit<ModalProps, "ref"> & React.RefAttributes<HTMLDialogElement>>;
|
12
|
+
export { Modal };
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import { forwardRef } from "react";
|
3
|
+
import { ModalCore } from "./ModalCore";
|
4
|
+
import { Button } from "../Button/Button";
|
5
|
+
import { ModalCoreHeader, } from "./components/ModalCoreHeader";
|
6
|
+
import { ModalCoreBody } from "./components/ModalCoreBody";
|
7
|
+
import { ModalCoreFooter } from "./components/ModalCoreFooter";
|
8
|
+
const Modal = forwardRef(({ children, title, submitTitle, cancelTitle, className, onCancel, onSubmit, closeButtonAriaLabel, cancelDisabled, submitDisabled, subtitle, iconTitle, levelTitle, ...props }, ref) => (_jsxs(ModalCore, { className: className, onOutsideTap: onCancel, title: title, ref: ref, ...props, children: [_jsx(ModalCoreHeader, { title: title, subtitle: subtitle, iconTitle: iconTitle, levelTitle: levelTitle, onCancel: onCancel, closeButtonAriaLabel: closeButtonAriaLabel }), _jsx(ModalCoreBody, { children: children }), _jsxs(ModalCoreFooter, { children: [onCancel && cancelTitle && (_jsx(Button, { variant: "secondary", onClick: onCancel, disabled: cancelDisabled, children: cancelTitle })), onSubmit && submitTitle && (_jsx(Button, { variant: "primary", onClick: onSubmit, disabled: submitDisabled, children: submitTitle }))] })] })));
|
9
|
+
Modal.displayName = "Modal";
|
10
|
+
export { Modal };
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { type ReactNode } from "react";
|
2
|
+
import "@axa-fr/design-system-look-and-feel-css/dist/Modal/Modal.scss";
|
3
|
+
export type ModalCoreProps = React.DetailedHTMLProps<React.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement> & {
|
4
|
+
className?: string;
|
5
|
+
title: string;
|
6
|
+
onOutsideTap: (event: React.MouseEvent | React.KeyboardEvent) => void;
|
7
|
+
children: ReactNode;
|
8
|
+
ref?: React.Ref<HTMLDialogElement>;
|
9
|
+
};
|
10
|
+
declare const ModalCore: import("react").ForwardRefExoticComponent<Omit<ModalCoreProps, "ref"> & import("react").RefAttributes<HTMLDialogElement>>;
|
11
|
+
export { ModalCore };
|
@@ -0,0 +1,6 @@
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
+
import { forwardRef } from "react";
|
3
|
+
import "@axa-fr/design-system-look-and-feel-css/dist/Modal/Modal.scss";
|
4
|
+
const ModalCore = forwardRef(({ className, title = "", onOutsideTap, children, ...props }, ref) => (_jsx("dialog", { "aria-describedby": title, className: ["af-modal", className].filter(Boolean).join(" "), onClick: onOutsideTap, ref: ref, ...props, children: _jsx("div", { className: "af-modal__dialog", onClick: (e) => e.stopPropagation(), children: _jsx("div", { className: "af-modal__content", children: children }) }) })));
|
5
|
+
ModalCore.displayName = "ModalCore";
|
6
|
+
export { ModalCore };
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import type { HTMLAttributes, MouseEvent, KeyboardEvent } from "react";
|
2
|
+
import type { TitleLevel } from "../../Title";
|
3
|
+
export type ModalCoreHeaderProps = HTMLAttributes<HTMLDivElement> & {
|
4
|
+
className?: string;
|
5
|
+
title: string;
|
6
|
+
subtitle?: string;
|
7
|
+
iconTitle?: string;
|
8
|
+
levelTitle?: TitleLevel;
|
9
|
+
onCancel: (event: MouseEvent | KeyboardEvent) => void;
|
10
|
+
closeButtonAriaLabel?: string;
|
11
|
+
};
|
12
|
+
export declare const ModalCoreHeader: ({ className, title, subtitle, iconTitle, levelTitle, onCancel, closeButtonAriaLabel, ...props }: ModalCoreHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
@@ -0,0 +1,8 @@
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
+
import closeSmall from "@material-symbols/svg-400/outlined/close.svg";
|
3
|
+
import { Button } from "../../Button/Button";
|
4
|
+
import { Svg } from "../../Svg";
|
5
|
+
export const ModalCoreHeader = ({ className, title, subtitle, iconTitle, levelTitle = 2, onCancel, closeButtonAriaLabel = "Fermer la boite de dialogue", ...props }) => {
|
6
|
+
const HLevel = `h${levelTitle}`;
|
7
|
+
return (_jsxs("header", { className: ["af-modal__header", className].filter(Boolean).join(" "), ...props, children: [_jsx(Button, { variant: "ghost", iconLeft: _jsx(Svg, { src: closeSmall, width: 32, height: 32, role: "graphics-document" }), "aria-label": closeButtonAriaLabel, onClick: onCancel }), _jsxs("div", { className: "af-modal__header-title", children: [iconTitle && (_jsx(Svg, { src: iconTitle, width: 32, height: 32, role: "graphics-document" })), _jsx(HLevel, { className: "af-modal__header-title-heading", children: title }), subtitle && (_jsx("span", { className: "af-modal__header-title-subtitle", children: subtitle }))] })] }));
|
8
|
+
};
|
@@ -0,0 +1,5 @@
|
|
1
|
+
export { Modal, type ModalProps } from "./Modal";
|
2
|
+
export { ModalCore, type ModalCoreProps } from "./ModalCore";
|
3
|
+
export { ModalCoreFooter, type ModalCoreFooterProps, } from "./components/ModalCoreFooter";
|
4
|
+
export { ModalCoreHeader, type ModalCoreHeaderProps, } from "./components/ModalCoreHeader";
|
5
|
+
export { ModalCoreBody, type ModalCoreBodyProps, } from "./components/ModalCoreBody";
|
@@ -0,0 +1,5 @@
|
|
1
|
+
export { Modal } from "./Modal";
|
2
|
+
export { ModalCore } from "./ModalCore";
|
3
|
+
export { ModalCoreFooter, } from "./components/ModalCoreFooter";
|
4
|
+
export { ModalCoreHeader, } from "./components/ModalCoreHeader";
|
5
|
+
export { ModalCoreBody, } from "./components/ModalCoreBody";
|
@@ -16,5 +16,5 @@ export type SkeletonProps = {
|
|
16
16
|
colGap?: number;
|
17
17
|
rowGap?: number;
|
18
18
|
} & isLoadingAndChildrenProps;
|
19
|
-
export declare const Skeleton: ({ className, grid, ariaBusy, ariaLabel, maxCols, colGap, rowGap, isLoading, children, }: SkeletonProps) => string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
19
|
+
export declare const Skeleton: ({ className, grid, ariaBusy, ariaLabel, maxCols, colGap, rowGap, isLoading, children, }: SkeletonProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
20
20
|
export {};
|
@@ -8,4 +8,4 @@ export type SkeletonListProps = {
|
|
8
8
|
classModifierList?: ComponentPropsWithRef<typeof List>["classModifier"];
|
9
9
|
isLoading: boolean;
|
10
10
|
} & PropsWithChildren;
|
11
|
-
export declare const SkeletonList: ({ children, isLoading, lists, classModifierList, }: SkeletonListProps) => string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element[] | null | undefined;
|
11
|
+
export declare const SkeletonList: ({ children, isLoading, lists, classModifierList, }: SkeletonListProps) => string | number | bigint | boolean | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element[] | null | undefined;
|
@@ -0,0 +1 @@
|
|
1
|
+
export { Spinner, spinnerVariants, } from "@axa-fr/design-system-apollo-react/lf";
|
package/dist/Stepper/Stepper.js
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import { useCallback, useId } from "react";
|
3
|
-
import classNames from "classnames";
|
4
2
|
import "@axa-fr/design-system-look-and-feel-css/dist/Stepper/Stepper.scss";
|
3
|
+
import classNames from "classnames";
|
4
|
+
import { useCallback, useId } from "react";
|
5
5
|
const INITIAL_STEPPER_PROGRESS = 10;
|
6
6
|
const MAX_STEPPER_PROGRESS = 100;
|
7
7
|
export const Stepper = ({ currentStepProgress = INITIAL_STEPPER_PROGRESS, currentTitle, nbSteps, currentStep, currentSubtitle, isTitleVisible = true, isSubtitleVisible = true, className, ...props }) => {
|
@@ -18,5 +18,5 @@ export const Stepper = ({ currentStepProgress = INITIAL_STEPPER_PROGRESS, curren
|
|
18
18
|
}
|
19
19
|
return 0;
|
20
20
|
}, [currentStep, currentStepProgress]);
|
21
|
-
return (_jsxs("div", { className: "af-stepper-client", ...props, children: [isTitleVisible && currentTitle && (_jsx("h2", { className: "af-stepper-client__title", "aria-describedby": stepperId, children: currentTitle })), isSubtitleVisible && currentSubtitle && (_jsx("p", { className: "af-stepper-client__subtitle", children: currentSubtitle })), _jsx("div", { id: stepperId, role: "group", "aria-label": currentTitle, className: classNames("af-stepper-client__content", className), children: [...Array(nbSteps).keys()].map((index) => (_jsx("div", { className: "af-stepper-client__progressbar", "aria-current": index === currentStep, "aria-hidden": index !== currentStep, "aria-label": `${getCurrentProgress(index)}%`, children: _jsx("div", { className: "af-stepper-client__progress", style: { width: `${getCurrentProgress(index)}%` } }) }, `${stepperId}-${index}`))) })] }));
|
21
|
+
return (_jsxs("div", { className: "af-stepper-client", ...props, children: [_jsxs("div", { children: [isTitleVisible && currentTitle && (_jsx("h2", { className: "af-stepper-client__title", "aria-describedby": stepperId, children: currentTitle })), isSubtitleVisible && currentSubtitle && (_jsx("p", { className: "af-stepper-client__subtitle", children: currentSubtitle }))] }), _jsx("div", { id: stepperId, role: "group", "aria-label": currentTitle, className: classNames("af-stepper-client__content", className), children: [...Array(nbSteps).keys()].map((index) => (_jsx("div", { className: "af-stepper-client__progressbar", "aria-current": index === currentStep, "aria-hidden": index !== currentStep, "aria-label": `${getCurrentProgress(index)}%`, children: _jsx("div", { className: "af-stepper-client__progress", style: { width: `${getCurrentProgress(index)}%` } }) }, `${stepperId}-${index}`))) })] }));
|
22
22
|
};
|
package/dist/Tag/Tag.js
CHANGED
@@ -2,6 +2,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
3
3
|
import { getComponentClassName } from "../utilities";
|
4
4
|
export const Tag = ({ children, className, classModifier = "", ...divProps }) => {
|
5
|
-
const componentClassName = useMemo(() => getComponentClassName(
|
5
|
+
const componentClassName = useMemo(() => getComponentClassName("af-tag", className, classModifier), [className, classModifier]);
|
6
6
|
return (_jsx("div", { className: componentClassName, ...divProps, children: _jsx("span", { className: "af-tag__label", children: children }) }));
|
7
7
|
};
|
package/dist/Title/Title.js
CHANGED
@@ -5,7 +5,7 @@ import { getComponentClassName } from "../utilities";
|
|
5
5
|
import { TitleSize } from "./constants";
|
6
6
|
import { TitleWithSubtitles } from "./TitleWithSubtitles";
|
7
7
|
export const Title = ({ children: title, className, classModifier, firstSubtitle, icon, secondSubtitle, size = TitleSize.XL, level = size === TitleSize.L ? 2 : 1, }) => {
|
8
|
-
const componentClassName = useMemo(() => getComponentClassName(className, classModifier ? `${classModifier} ${size}` : size
|
8
|
+
const componentClassName = useMemo(() => getComponentClassName("af-title", className, classModifier ? `${classModifier} ${size}` : size), [classModifier, className, size]);
|
9
9
|
const TitleWithSubtitlesPart = useCallback(({ ...args }) => (_jsx(TitleWithSubtitles, { title: title, firstSubtitle: firstSubtitle, level: level, ...args })), [title, firstSubtitle, level]);
|
10
10
|
return (_jsx("header", { className: componentClassName, children: icon && size === TitleSize.XL ? (_jsxs(_Fragment, { children: [_jsx(IconBg, { className: "af-title__icon af-icon-bg", children: icon }), _jsx(TitleWithSubtitlesPart, { secondSubtitle: secondSubtitle })] })) : (_jsx(TitleWithSubtitlesPart, {})) }));
|
11
11
|
};
|
package/dist/index.d.ts
CHANGED
@@ -4,26 +4,29 @@ export { Accordion } from "./Accordion";
|
|
4
4
|
export { AccordionCore } from "./AccordionCore";
|
5
5
|
export { Alert } from "./Alert/Alert";
|
6
6
|
export type { AlertType } from "./Alert/Alert";
|
7
|
-
export {
|
7
|
+
export { Button, buttonVariants, type ButtonVariants } from "./Button/Button";
|
8
8
|
export { Card } from "./Card";
|
9
|
+
export { Divider } from "./Divider";
|
9
10
|
export { Checkbox, CheckboxSelect } from "./Form/Checkbox";
|
10
11
|
export { FileUpload } from "./Form/FileUpload";
|
12
|
+
export { InputError } from "./Form/InputError";
|
11
13
|
export { Radio, RadioSelect } from "./Form/Radio";
|
12
14
|
export { Select } from "./Form/Select";
|
13
15
|
export { Text as TextInput } from "./Form/Text";
|
14
16
|
export { TextArea } from "./Form/TextArea";
|
17
|
+
export { DebugGrid } from "./Grid/DebugGrid";
|
15
18
|
export { IconBg } from "./IconBg";
|
16
19
|
export { Footer } from "./Layout/Footer/Footer";
|
17
|
-
export { Header } from "./Layout/Header";
|
20
|
+
export { BurgerMenu, Header, NavBar, PreviousLink } from "./Layout/Header";
|
18
21
|
export { Link } from "./Link";
|
19
22
|
export { List } from "./List";
|
20
23
|
export { ClickItem, ClickList, createClickItemParent } from "./List/ClickList";
|
21
24
|
export { ContentItemDuo } from "./List/ContentItemDuo";
|
22
25
|
export { ContentItemMono, ContentItemMonoSize } from "./List/ContentItemMono";
|
23
26
|
export { ContentTabItem, ContentTabList } from "./List/ContentTabList";
|
24
|
-
export {
|
25
|
-
export { Modal } from "./
|
26
|
-
export type {
|
27
|
+
export { Spinner, type SpinnerVariants, spinnerVariants, } from "./Spinner/Spinner";
|
28
|
+
export { Modal, ModalCore, ModalCoreBody, ModalCoreFooter, ModalCoreHeader, } from "./Modal";
|
29
|
+
export type { ModalCoreBodyProps, ModalCoreFooterProps, ModalCoreHeaderProps, ModalCoreProps, ModalProps, } from "./Modal";
|
27
30
|
export { Pagination } from "./Pagination/Pagination";
|
28
31
|
export { Skeleton } from "./Skeleton/Skeleton";
|
29
32
|
export { SkeletonList } from "./SkeletonList/SkeletonList";
|
@@ -32,4 +35,3 @@ export { Svg } from "./Svg";
|
|
32
35
|
export { TabsClient as Tabs, Direction as TabsDirection } from "./Tabs/Tabs";
|
33
36
|
export { Tag } from "./Tag";
|
34
37
|
export { Title, TitleSize, type TitleLevel } from "./Title";
|
35
|
-
export { DebugGrid } from "./Grid/DebugGrid";
|
package/dist/index.js
CHANGED
@@ -3,25 +3,28 @@ import "@fontsource/source-sans-pro";
|
|
3
3
|
export { Accordion } from "./Accordion";
|
4
4
|
export { AccordionCore } from "./AccordionCore";
|
5
5
|
export { Alert } from "./Alert/Alert";
|
6
|
-
export {
|
6
|
+
export { Button, buttonVariants } from "./Button/Button";
|
7
7
|
export { Card } from "./Card";
|
8
|
+
export { Divider } from "./Divider";
|
8
9
|
export { Checkbox, CheckboxSelect } from "./Form/Checkbox";
|
9
10
|
export { FileUpload } from "./Form/FileUpload";
|
11
|
+
export { InputError } from "./Form/InputError";
|
10
12
|
export { Radio, RadioSelect } from "./Form/Radio";
|
11
13
|
export { Select } from "./Form/Select";
|
12
14
|
export { Text as TextInput } from "./Form/Text";
|
13
15
|
export { TextArea } from "./Form/TextArea";
|
16
|
+
export { DebugGrid } from "./Grid/DebugGrid";
|
14
17
|
export { IconBg } from "./IconBg";
|
15
18
|
export { Footer } from "./Layout/Footer/Footer";
|
16
|
-
export { Header } from "./Layout/Header";
|
19
|
+
export { BurgerMenu, Header, NavBar, PreviousLink } from "./Layout/Header";
|
17
20
|
export { Link } from "./Link";
|
18
21
|
export { List } from "./List";
|
19
22
|
export { ClickItem, ClickList, createClickItemParent } from "./List/ClickList";
|
20
23
|
export { ContentItemDuo } from "./List/ContentItemDuo";
|
21
24
|
export { ContentItemMono, ContentItemMonoSize } from "./List/ContentItemMono";
|
22
25
|
export { ContentTabItem, ContentTabList } from "./List/ContentTabList";
|
23
|
-
export {
|
24
|
-
export { Modal } from "./
|
26
|
+
export { Spinner, spinnerVariants, } from "./Spinner/Spinner";
|
27
|
+
export { Modal, ModalCore, ModalCoreBody, ModalCoreFooter, ModalCoreHeader, } from "./Modal";
|
25
28
|
export { Pagination } from "./Pagination/Pagination";
|
26
29
|
export { Skeleton } from "./Skeleton/Skeleton";
|
27
30
|
export { SkeletonList } from "./SkeletonList/SkeletonList";
|
@@ -30,4 +33,3 @@ export { Svg } from "./Svg";
|
|
30
33
|
export { TabsClient as Tabs, Direction as TabsDirection } from "./Tabs/Tabs";
|
31
34
|
export { Tag } from "./Tag";
|
32
35
|
export { Title, TitleSize } from "./Title";
|
33
|
-
export { DebugGrid } from "./Grid/DebugGrid";
|
@@ -1 +1 @@
|
|
1
|
-
export declare const getComponentClassName: (
|
1
|
+
export declare const getComponentClassName: (defaultClassName: string, className?: string, classModifier?: string) => string;
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import classNames from "classnames";
|
2
|
-
const getLastClassName = (
|
3
|
-
if (!
|
2
|
+
const getLastClassName = (defaultClassName) => {
|
3
|
+
if (!defaultClassName) {
|
4
4
|
return null;
|
5
5
|
}
|
6
|
-
return
|
6
|
+
return defaultClassName.split(" ").filter(Boolean).at(-1);
|
7
7
|
};
|
8
8
|
const listClassModifier = (classModifier) => {
|
9
9
|
if (!classModifier) {
|
@@ -11,17 +11,16 @@ const listClassModifier = (classModifier) => {
|
|
11
11
|
}
|
12
12
|
return classModifier.split(" ");
|
13
13
|
};
|
14
|
-
export const getComponentClassName = (className, classModifier
|
15
|
-
|
16
|
-
if (!classNameToUse) {
|
14
|
+
export const getComponentClassName = (defaultClassName, className, classModifier) => {
|
15
|
+
if (!defaultClassName) {
|
17
16
|
return "";
|
18
17
|
}
|
19
|
-
const classWithoutModifier = getLastClassName(
|
18
|
+
const classWithoutModifier = getLastClassName(defaultClassName);
|
20
19
|
const modifiers = listClassModifier(classModifier);
|
21
20
|
const modifiersObject = modifiers
|
22
21
|
.filter((it) => /\S/.test(it))
|
23
22
|
.map((it) => {
|
24
23
|
return `${classWithoutModifier}--${it}`;
|
25
24
|
});
|
26
|
-
return classNames(
|
25
|
+
return classNames(defaultClassName, className, modifiersObject);
|
27
26
|
};
|