@axa-fr/design-system-look-and-feel-react 1.0.5-ci.1 → 1.0.5-ci.101
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 +23 -22
- package/dist/Form/Radio/Radio.js +2 -2
- package/dist/Form/Radio/RadioSelect.d.ts +2 -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/IconBg/IconBg.js +1 -1
- package/dist/Layout/Header/Header.d.ts +3 -3
- package/dist/Layout/Header/Header.js +2 -2
- package/dist/Layout/Header/NavBar/NavBar.d.ts +2 -2
- package/dist/Layout/Header/NavBar/NavBar.js +3 -3
- 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/Loader/Loader.d.ts +1 -12
- package/dist/Loader/Loader.js +1 -11
- 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/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 +9 -5
- package/dist/index.js +8 -4
- package/dist/utilities/helpers/getComponentClassName.d.ts +1 -1
- package/dist/utilities/helpers/getComponentClassName.js +7 -8
- package/package.json +37 -72
- 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/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,31 +0,0 @@
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import { Footer } from "../../Layout/Footer";
|
3
|
-
export const MyFooter = () => (_jsx(Footer, { links: [
|
4
|
-
{
|
5
|
-
link: "https://www.axa.fr/qui-sommes-nous.html",
|
6
|
-
text: "À propos",
|
7
|
-
},
|
8
|
-
{
|
9
|
-
link: "https://www.axa.fr/configuration-securite/mentions-legales.html",
|
10
|
-
text: "Mentions légales",
|
11
|
-
},
|
12
|
-
{
|
13
|
-
link: "https://www.axa.fr/configuration-securite/donnees-personnelles.html",
|
14
|
-
text: "Données personnelles",
|
15
|
-
},
|
16
|
-
{
|
17
|
-
link: "https://www.axa.fr/configuration-securite/politique-cookies.html",
|
18
|
-
text: "Cookies",
|
19
|
-
},
|
20
|
-
], socialMedias: [
|
21
|
-
{ icon: "facebook", link: "https://www.facebook.com/axafrance" },
|
22
|
-
{ icon: "twitter", link: "https://twitter.com/AXAFrance" },
|
23
|
-
{
|
24
|
-
icon: "youtube",
|
25
|
-
link: "https://www.youtube.com/user/AXAFranceChaine",
|
26
|
-
},
|
27
|
-
{
|
28
|
-
icon: "linkedin",
|
29
|
-
link: "https://www.linkedin.com/company/axa-france/",
|
30
|
-
},
|
31
|
-
], copyright: `@AXA ${new Date().getFullYear()} - Tous droits réservés`, expandLinkText: "Liens utiles" }));
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const MyHeader: () => import("react/jsx-runtime").JSX.Element;
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import person from "@material-symbols/svg-400/outlined/person-fill.svg";
|
3
|
-
import lock from "@material-symbols/svg-400/outlined/lock-fill.svg";
|
4
|
-
import { Header } from "../../Layout/Header";
|
5
|
-
import { Button, ButtonVariants, Svg } from "../..";
|
6
|
-
export const MyHeader = () => (_jsxs(Header, { defaultActiveLink: 0, rightItem: [
|
7
|
-
_jsx(Button, { iconLeft: _jsx(Svg, { src: lock, fill: "#00008f" }), variant: ButtonVariants.secondary, children: "Espace Banque" }, "Banking Space Button"),
|
8
|
-
_jsx(Button, { iconLeft: _jsx(Svg, { src: person, fill: "#00008f" }), variant: ButtonVariants.ghost, children: "Mon Profil" }, "Profile Button"),
|
9
|
-
], children: [_jsx("a", { className: "af-navbar-item__link", href: "/mes-contrats", children: "MES CONTRATS" }, "MES CONTRATS link"), _jsx("a", { className: "af-navbar-item__link", href: "/mes-avantages", children: "MES AVANTAGES" }, "MES AVANTAGES link"), _jsx("a", { className: "af-navbar-item__link", href: "/mes-documents", children: "MES DOCUMENTS" }, "MES DOCUMENTS link")] }));
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const MyList: () => import("react/jsx-runtime").JSX.Element;
|
@@ -1,3 +0,0 @@
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import { ContentItemDuo, List } from "../..";
|
3
|
-
export const MyList = () => (_jsx(List, { classModifier: "extra-padding", children: [...Array(6).keys()].map(() => (_jsx(ContentItemDuo, { isVertical: false, isShowingDoneIcon: true, isShowingCloseIcon: false, buttonText: "En savoir plus", classModifier: "large", label: "Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quas, suscipit sint! Reiciendis, eos? Eveniet, aut qui. Autem reprehenderit", value: "R\u00E9ponse" }, crypto.randomUUID()))) }));
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const Offsets: () => import("react/jsx-runtime").JSX.Element[][];
|
@@ -1,7 +0,0 @@
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
const MAX_OFFSET = 12;
|
3
|
-
export const Offsets = () => [...Array(MAX_OFFSET).keys()].map((start) => {
|
4
|
-
const offset = start + 1;
|
5
|
-
const maxCols = MAX_OFFSET - offset + 1;
|
6
|
-
return [...Array(maxCols).keys()].map((col) => (_jsx("div", { className: `box box-offset box-offset-${offset}-${col + 1}` }, crypto.randomUUID())));
|
7
|
-
});
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const render: () => import("react/jsx-runtime").JSX.Element;
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
2
|
-
import { MyFooter } from "./components/MyFooter";
|
3
|
-
import { MyHeader } from "./components/MyHeader";
|
4
|
-
import { Button, ButtonVariants, TextInput, Title } from "..";
|
5
|
-
import { DebugGrid } from "./DebugGrid";
|
6
|
-
function capitalizeFirstLetter(val) {
|
7
|
-
return String(val).charAt(0).toUpperCase() + String(val).slice(1);
|
8
|
-
}
|
9
|
-
const setAttributesFields = (value, label, type = "text") => ({
|
10
|
-
value,
|
11
|
-
type,
|
12
|
-
name: label,
|
13
|
-
id: label,
|
14
|
-
disabled: false,
|
15
|
-
required: true,
|
16
|
-
label: `${capitalizeFirstLetter(label)} de la personne`,
|
17
|
-
placeholder: `Votre ${label}`,
|
18
|
-
description: `Saisissez un ${label}`,
|
19
|
-
error: `Un ${label} est obligatoire`,
|
20
|
-
className: "subgrid af-form__input-text",
|
21
|
-
helper: "Do you need help ?",
|
22
|
-
buttonLabel: "En savoir plus",
|
23
|
-
});
|
24
|
-
const FIELDS = [
|
25
|
-
setAttributesFields("Gomez", "nom"),
|
26
|
-
setAttributesFields("Samuel", "prénom"),
|
27
|
-
setAttributesFields("samuel.gomez@axa.fr", "email", "email"),
|
28
|
-
setAttributesFields("0601020304", "téléphone"),
|
29
|
-
];
|
30
|
-
export const render = () => (_jsxs(_Fragment, { children: [_jsx(DebugGrid, { isCheckedByDefault: true }), _jsx(MyHeader, {}), _jsx("main", { className: "grid example-form", children: _jsxs("form", { className: "form", children: [_jsxs("div", { className: "form__header subgrid", children: [_jsx(Title, { children: "Mon formulaire" }), _jsx("p", { children: "Les mentions avec * sont obligatoires" })] }), _jsx("div", { className: "form__fields subgrid", children: FIELDS.map((field) => (_jsx(TextInput, { ...field, classModifier: field.error ? "error" : "" }, field.id))) }), _jsxs("div", { className: "form__actions subgrid", children: [_jsx(Button, { variant: ButtonVariants.secondary, children: "Pr\u00E9c\u00E9dent" }), _jsx(Button, { variant: ButtonVariants.primary, children: "Valider" })] })] }) }), _jsx(MyFooter, {})] }));
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const render: () => import("react/jsx-runtime").JSX.Element;
|
@@ -1,9 +0,0 @@
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
2
|
-
import { Title, TitleSize } from "../Title";
|
3
|
-
import { Contacts } from "./components/Contacts";
|
4
|
-
import { MainTitle } from "./components/MainTitle";
|
5
|
-
import { MyFooter } from "./components/MyFooter";
|
6
|
-
import { MyHeader } from "./components/MyHeader";
|
7
|
-
import { MyList } from "./components/MyList";
|
8
|
-
import { DebugGrid } from "./DebugGrid";
|
9
|
-
export const render = () => (_jsxs(_Fragment, { children: [_jsx(DebugGrid, { isCheckedByDefault: true }), _jsx(MyHeader, {}), _jsxs("main", { className: "grid example-page", children: [_jsx(MainTitle, {}), _jsxs("div", { className: "container-part", children: [_jsxs("div", { className: "subgrid af-left-part", children: [_jsx(Title, { size: TitleSize.L, children: "My list title" }), _jsxs("div", { className: "subgrid af-list-part", children: [_jsx(MyList, {}), _jsx(MyList, {})] })] }), _jsxs("div", { className: "subgrid af-right-part", children: [_jsx(Title, { size: TitleSize.L, children: "Contacts" }), _jsx("div", { className: "af-contacts-part subgrid", children: _jsx(Contacts, {}) })] })] })] }), _jsx(MyFooter, {})] }));
|
@@ -1 +0,0 @@
|
|
1
|
-
export declare const render: () => import("react/jsx-runtime").JSX.Element;
|
@@ -1,5 +0,0 @@
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
2
|
-
import { DebugGrid } from "./DebugGrid";
|
3
|
-
import { Card } from "./components/Card";
|
4
|
-
import { Offsets } from "./components/Offsets";
|
5
|
-
export const render = () => (_jsxs(_Fragment, { children: [_jsx(DebugGrid, { isCheckedByDefault: true }), _jsxs("main", { className: "grid", children: [_jsx("h1", { className: "box", children: "Bonjour, Samuel G." }), _jsxs("div", { className: "box box-example-1 subgrid", children: [_jsx("h2", { className: "box", children: "Mes contrats" }), [...Array(6).keys()].map((_, index) => (_jsx(Card, { title: `contrat-${index + 1}` }, crypto.randomUUID())))] }), _jsxs("div", { className: "box box-example-2 subgrid", children: [_jsx("h2", { className: "box", children: "Profil" }), _jsx(Card, { title: "Mes coordonn\u00E9es" })] }), _jsxs("div", { className: "box box-example-3 subgrid", children: [_jsx("h2", { className: "box", children: "Mes Infos" }), _jsx("div", { className: "box box-half" }), _jsx("div", { className: "box box-half" }), _jsx("div", { className: "box box-half" }), _jsx("div", { className: "box box-half" })] }), _jsxs("div", { className: "box box-custom", children: [_jsx("h2", { className: "box", children: "Custom" }), _jsx("div", { className: "box box-content1", children: "Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quos, dolore. Ipsum commodi molestiae aut consectetur corrupti sed quos iste, nemo porro dicta necessitatibus aliquam! Ratione magni quae necessitatibus similique eos! Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quos, dolore. Ipsum commodi molestiae aut consectetur corrupti sed quos iste, nemo porro dicta necessitatibus aliquam! Ratione magni quae necessitatibus similique eos!" }), _jsx("div", { className: "box box-content2", children: "Lorem ipsum dolor sit amet consectetur adipisicing elit. Quidem nam, aliquid itaque magni sint natus earum praesentium minima. Laborum enim error animi similique delectus vel. Ipsa deleniti ut ipsam quis. Lorem ipsum dolor sit amet consectetur adipisicing elit. Quidem nam, aliquid itaque magni sint natus earum praesentium minima. Laborum enim error animi similique delectus vel. Ipsa deleniti ut ipsam quis. Lorem ipsum dolor sit amet consectetur adipisicing elit. Quidem nam, aliquid itaque magni sint natus earum praesentium minima. Laborum enim error animi similique delectus vel. Ipsa deleniti ut ipsam quis." }), _jsx("footer", { children: "@copyright" })] }), _jsx(Offsets, {})] })] }));
|
package/dist/Loader/index.d.ts
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export { Loader } from "./Loader";
|
package/dist/Loader/index.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export { Loader } from "./Loader";
|
@@ -1,4 +0,0 @@
|
|
1
|
-
import "@axa-fr/design-system-look-and-feel-css/dist/Modal/Modal.scss";
|
2
|
-
import { PropsWithChildren } from "react";
|
3
|
-
import { ModalProps } from "./type";
|
4
|
-
export declare const ModalContainer: ({ open, setIsOpen, hasCloseButton, onClose, onClickOutside, children, title, subtitle, iconTitle, actions, fullWidthButtons, }: PropsWithChildren<ModalProps>) => import("react").ReactPortal;
|
@@ -1,45 +0,0 @@
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import "@axa-fr/design-system-look-and-feel-css/dist/Modal/Modal.scss";
|
3
|
-
import { useEffect, useId, useRef } from "react";
|
4
|
-
import { createPortal } from "react-dom";
|
5
|
-
import { Modal } from "./Modal";
|
6
|
-
import { useModal } from "./Modal.hook";
|
7
|
-
export const ModalContainer = ({ open, setIsOpen, hasCloseButton = true, onClose, onClickOutside, children, title, subtitle, iconTitle, actions, fullWidthButtons, }) => {
|
8
|
-
const { handleClickOutside, handleKeyDown, handleCloseModal } = useModal({
|
9
|
-
setIsOpen,
|
10
|
-
onClose,
|
11
|
-
onClickOutside,
|
12
|
-
});
|
13
|
-
const modalRef = useRef(null);
|
14
|
-
const idTitle = useId();
|
15
|
-
const idContent = useId();
|
16
|
-
const actionCallback = (callback) => {
|
17
|
-
callback?.();
|
18
|
-
setIsOpen(false);
|
19
|
-
};
|
20
|
-
useEffect(() => {
|
21
|
-
const modalElement = modalRef.current;
|
22
|
-
if (modalElement) {
|
23
|
-
if (open) {
|
24
|
-
document.body.style.overflow = "hidden";
|
25
|
-
modalElement.showModal?.();
|
26
|
-
}
|
27
|
-
else {
|
28
|
-
document.body.style.overflow = "inherit";
|
29
|
-
modalElement.close?.();
|
30
|
-
}
|
31
|
-
}
|
32
|
-
return () => {
|
33
|
-
document.body.style.overflow = "inherit";
|
34
|
-
};
|
35
|
-
}, [open]);
|
36
|
-
useEffect(() => {
|
37
|
-
document.body.addEventListener("keydown", handleKeyDown);
|
38
|
-
document.body.addEventListener("click", handleClickOutside);
|
39
|
-
return () => {
|
40
|
-
document.body.removeEventListener("keydown", handleKeyDown);
|
41
|
-
document.body.removeEventListener("click", handleClickOutside);
|
42
|
-
};
|
43
|
-
}, [handleClickOutside, handleKeyDown]);
|
44
|
-
return createPortal(_jsx(Modal, { modalRef: modalRef, idTitle: idTitle, idContent: idContent, iconTitle: iconTitle, title: title, subtitle: subtitle, hasCloseButton: hasCloseButton, handleCloseModal: handleCloseModal, actionCallback: actionCallback, actions: actions, fullWidthButtons: fullWidthButtons, children: children }), document.body);
|
45
|
-
};
|
@@ -1,4 +0,0 @@
|
|
1
|
-
import { PropsWithChildren } from "react";
|
2
|
-
import "@axa-fr/design-system-look-and-feel-css/dist/Modal/Modal.scss";
|
3
|
-
import { TModalType } from "./type";
|
4
|
-
export declare const Modal: ({ modalRef, idTitle, idContent, iconTitle, title, subtitle, hasCloseButton, handleCloseModal, actionCallback, children, actions, fullWidthButtons, }: PropsWithChildren<TModalType>) => import("react/jsx-runtime").JSX.Element;
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import { useCallback } from "react";
|
2
|
-
export const useModal = ({ setIsOpen, onClose, onClickOutside, }) => {
|
3
|
-
const handleCloseModal = useCallback(() => {
|
4
|
-
onClose?.();
|
5
|
-
setIsOpen(false);
|
6
|
-
}, [onClose, setIsOpen]);
|
7
|
-
const handleClickOutside = useCallback((event) => {
|
8
|
-
if (event.target.tagName !== "DIALOG") {
|
9
|
-
return;
|
10
|
-
}
|
11
|
-
if (onClickOutside) {
|
12
|
-
onClickOutside();
|
13
|
-
setIsOpen(false);
|
14
|
-
}
|
15
|
-
else {
|
16
|
-
handleCloseModal();
|
17
|
-
}
|
18
|
-
}, [handleCloseModal, onClickOutside, setIsOpen]);
|
19
|
-
const handleKeyDown = useCallback((event) => {
|
20
|
-
if (event.key === "Escape") {
|
21
|
-
handleCloseModal();
|
22
|
-
}
|
23
|
-
}, [handleCloseModal]);
|
24
|
-
return { handleClickOutside, handleKeyDown, handleCloseModal };
|
25
|
-
};
|
@@ -1,6 +0,0 @@
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
2
|
-
import close from "@material-symbols/svg-400/outlined/close.svg";
|
3
|
-
import { ButtonClient as Button, Variants, Variants as ButtonVariants, } from "../Button/Button";
|
4
|
-
import "@axa-fr/design-system-look-and-feel-css/dist/Modal/Modal.scss";
|
5
|
-
import { Svg } from "../Svg";
|
6
|
-
export const Modal = ({ modalRef, idTitle, idContent, iconTitle, title, subtitle, hasCloseButton, handleCloseModal, actionCallback, children, actions, fullWidthButtons, }) => (_jsxs("dialog", { ref: modalRef, className: "af-modal", "aria-labelledby": idTitle, "aria-describedby": idContent, children: [_jsxs("div", { id: idTitle, className: "af-modal__top", children: [iconTitle, _jsxs("h2", { className: "af-modal__top-title", children: [_jsxs("div", { children: [_jsx("div", { className: "af-modal__top-title-text", children: title }), subtitle && (_jsx("span", { className: "af-modal__top-title-subtitle", children: subtitle }))] }), hasCloseButton && (_jsx(Button, { className: "af-modal__top-title-close-btn", onClick: handleCloseModal, variant: Variants.ghost, type: "button", "aria-label": "close", children: _jsx(Svg, { src: close, width: 32, height: 32 }) }))] })] }), _jsxs("div", { id: idContent, className: "af-modal__content", children: [children, actions && (_jsxs("div", { className: `af-modal__actions${fullWidthButtons ? " af-modal__actions--fullWidth" : ""} `, children: [actions?.primary && (_jsx(Button, { variant: ButtonVariants.primary, onClick: () => actionCallback(actions?.primary?.callback), disabled: actions?.primary.disabled, children: actions?.primary.text })), actions?.secondary && (_jsx(Button, { variant: ButtonVariants.secondary, onClick: () => actionCallback(actions?.secondary?.callback), disabled: actions?.secondary.disabled, children: actions?.secondary.text })), actions?.tertiary && (_jsx(Button, { variant: ButtonVariants.tertiary, onClick: () => actionCallback(actions?.tertiary?.callback), disabled: actions?.tertiary.disabled, children: actions?.tertiary.text }))] }))] })] }));
|
@@ -1 +0,0 @@
|
|
1
|
-
export { ModalContainer as Modal } from "./Modal.container";
|
@@ -1 +0,0 @@
|
|
1
|
-
export { ModalContainer as Modal } from "./Modal.container";
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import { ReactNode, RefObject } from "react";
|
2
|
-
export type ButtonAction = {
|
3
|
-
text: string;
|
4
|
-
disabled?: boolean;
|
5
|
-
callback: () => void;
|
6
|
-
};
|
7
|
-
export type TActionButton = {
|
8
|
-
primary?: ButtonAction;
|
9
|
-
secondary?: ButtonAction;
|
10
|
-
tertiary?: ButtonAction;
|
11
|
-
};
|
12
|
-
export type TModalHook = {
|
13
|
-
setIsOpen: (value: boolean) => void;
|
14
|
-
onClose?: () => void;
|
15
|
-
onClickOutside?: () => void;
|
16
|
-
};
|
17
|
-
export type ModalProps = TModalHook & {
|
18
|
-
open: boolean;
|
19
|
-
hasCloseButton?: boolean;
|
20
|
-
title: string;
|
21
|
-
subtitle?: string;
|
22
|
-
iconTitle?: ReactNode;
|
23
|
-
fullWidthButtons?: boolean;
|
24
|
-
actions?: TActionButton;
|
25
|
-
};
|
26
|
-
export type TModalType = {
|
27
|
-
modalRef: RefObject<HTMLDialogElement>;
|
28
|
-
idTitle: string;
|
29
|
-
idContent: string;
|
30
|
-
iconTitle: ReactNode;
|
31
|
-
title: string;
|
32
|
-
subtitle?: string;
|
33
|
-
hasCloseButton: boolean;
|
34
|
-
handleCloseModal: () => void;
|
35
|
-
actionCallback: (callback?: () => void) => void;
|
36
|
-
actions?: TActionButton;
|
37
|
-
fullWidthButtons?: boolean;
|
38
|
-
};
|
package/dist/ModalClient/type.js
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|