@axa-fr/canopee-react 1.8.0 → 2.0.0-alpha.2
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/client.d.ts +4 -4
- package/dist/client.js +4 -4
- package/dist/distributeur/Action/Action.d.ts +8 -2
- package/dist/distributeur/Action/Action.js +4 -4
- package/dist/distributeur/Button/Button.d.ts +8 -5
- package/dist/distributeur/Button/Button.js +2 -2
- package/dist/distributeur/Form/Checkbox/Checkbox.d.ts +6 -3
- package/dist/distributeur/Form/Checkbox/Checkbox.js +4 -4
- package/dist/distributeur/Form/Checkbox/CheckboxInput.d.ts +6 -3
- package/dist/distributeur/Form/Checkbox/CheckboxInput.js +4 -4
- package/dist/distributeur/Form/Checkbox/CheckboxItem.d.ts +7 -3
- package/dist/distributeur/Form/Checkbox/CheckboxItem.js +4 -4
- package/dist/distributeur/Form/Choice/Choice.d.ts +6 -3
- package/dist/distributeur/Form/Choice/Choice.js +4 -4
- package/dist/distributeur/Form/Choice/ChoiceInput.d.ts +6 -3
- package/dist/distributeur/Form/Choice/ChoiceInput.js +2 -4
- package/dist/distributeur/Form/Date/Date.d.ts +4 -1
- package/dist/distributeur/Form/Date/Date.js +4 -4
- package/dist/distributeur/Form/Date/DateInput.d.ts +4 -1
- package/dist/distributeur/Form/Date/DateInput.js +2 -4
- package/dist/distributeur/Form/Experimental/Input.d.ts +5 -1
- package/dist/distributeur/Form/Experimental/Input.js +4 -4
- package/dist/distributeur/Form/Experimental/TextInput.d.ts +4 -1
- package/dist/distributeur/Form/Experimental/TextInput.js +4 -4
- package/dist/distributeur/Form/Number/Number.d.ts +4 -1
- package/dist/distributeur/Form/Number/Number.js +4 -4
- package/dist/distributeur/Form/Pass/Pass.d.ts +4 -1
- package/dist/distributeur/Form/Pass/Pass.js +4 -4
- package/dist/distributeur/Form/Radio/Radio.d.ts +12 -23
- package/dist/distributeur/Form/Radio/Radio.js +4 -4
- package/dist/distributeur/Form/Radio/RadioInput.d.ts +6 -3
- package/dist/distributeur/Form/Radio/RadioInput.js +4 -4
- package/dist/distributeur/Form/Radio/RadioItem.d.ts +4 -1
- package/dist/distributeur/Form/Radio/RadioItem.js +4 -4
- package/dist/distributeur/Form/Select/Select.d.ts +9 -325
- package/dist/distributeur/Form/Select/Select.js +5 -5
- package/dist/distributeur/Form/Select/SelectBase.d.ts +10 -6
- package/dist/distributeur/Form/Select/SelectBase.js +4 -4
- package/dist/distributeur/Form/Select/SelectDefault.d.ts +4 -1
- package/dist/distributeur/Form/Select/SelectDefault.js +4 -4
- package/dist/distributeur/Form/Select/SelectDefaultWithOptions.d.ts +4 -1
- package/dist/distributeur/Form/Select/SelectDefaultWithOptions.js +5 -12
- package/dist/distributeur/Form/Select/SelectInput.d.ts +9 -376
- package/dist/distributeur/Form/Select/SelectInput.js +2 -4
- package/dist/distributeur/Form/Text/Text.d.ts +4 -1
- package/dist/distributeur/Form/Text/Text.js +4 -4
- package/dist/distributeur/Form/Text/TextInput.d.ts +4 -1
- package/dist/distributeur/Form/Text/TextInput.js +2 -4
- package/dist/distributeur/Form/Textarea/Textarea.d.ts +7 -2
- package/dist/distributeur/Form/Textarea/Textarea.js +4 -4
- package/dist/distributeur/Form/Textarea/TextareaInput.d.ts +4 -1
- package/dist/distributeur/Form/Textarea/TextareaInput.js +2 -4
- package/dist/distributeur/Layout/Footer/Footer.d.ts +5 -3
- package/dist/distributeur/Layout/Footer/Footer.js +2 -2
- package/dist/distributeur/Layout/Header/Name/Name.js +1 -1
- package/dist/distributeur/Layout/Header/NavBar/NavBarItem/NavBarItemBase.js +1 -1
- package/dist/distributeur/Link/Link.d.ts +4 -1
- package/dist/distributeur/Link/Link.js +3 -4
- package/dist/distributeur/Link/LinkAnchor.d.ts +4 -1
- package/dist/distributeur/Link/LinkAnchor.js +4 -4
- package/dist/distributeur/Loader/ItemLoader.d.ts +4 -0
- package/dist/distributeur/Loader/ItemLoader.js +8 -0
- package/dist/distributeur/Loader/Loader.d.ts +7 -10
- package/dist/distributeur/Loader/Loader.js +12 -27
- package/dist/distributeur/Loader/SquareLoader.d.ts +15 -0
- package/dist/distributeur/Loader/SquareLoader.js +33 -0
- package/dist/distributeur/ModalAgent/BooleanModal.d.ts +4 -1
- package/dist/distributeur/ModalAgent/BooleanModal.js +4 -4
- package/dist/distributeur/ModalAgent/Modal.d.ts +4 -1
- package/dist/distributeur/ModalAgent/Modal.js +4 -4
- package/dist/distributeur/Steps/VerticalStep.d.ts +2 -8
- package/dist/distributeur/Svg/svgInjector.js +1 -0
- package/dist/distributeur/Tag/Tag.d.ts +4 -1
- package/dist/distributeur/Tag/Tag.js +4 -4
- package/dist/distributeur/Title/Title.d.ts +4 -1
- package/dist/distributeur/Title/Title.js +4 -4
- package/dist/distributeur.d.ts +12 -6
- package/dist/distributeur.js +4 -1
- package/dist/prospect-client/Form/Checkbox/CardCheckboxOption/CardCheckboxOptionCommon.d.ts +4 -1
- package/dist/prospect-client/Form/Checkbox/CardCheckboxOption/CardCheckboxOptionCommon.js +3 -3
- package/dist/prospect-client/Form/Checkbox/Checkbox/CheckboxCommon.d.ts +4 -1
- package/dist/prospect-client/Form/Checkbox/Checkbox/CheckboxCommon.js +2 -2
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextApollo.d.ts +4 -1
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextApollo.js +1 -2
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextCommon.d.ts +4 -1
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextCommon.js +4 -4
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextLF.d.ts +4 -1
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextLF.js +1 -2
- package/dist/prospect-client/Form/Dropdown/DropdownCommon.d.ts +4 -1
- package/dist/prospect-client/Form/Dropdown/DropdownCommon.js +4 -4
- package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadApollo.d.ts +4 -1
- package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadApollo.js +1 -2
- package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadCommon.d.ts +4 -1
- package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadCommon.js +4 -4
- package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadLF.d.ts +4 -1
- package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadLF.js +1 -2
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileApollo.d.ts +4 -1
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileApollo.js +3 -4
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileCommon.d.ts +4 -1
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileCommon.js +4 -6
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileLF.d.ts +4 -1
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileLF.js +1 -2
- package/dist/prospect-client/Form/InputDate/InputDateApollo.d.ts +4 -1
- package/dist/prospect-client/Form/InputDate/InputDateApollo.js +1 -2
- package/dist/prospect-client/Form/InputDate/InputDateAtom.d.ts +4 -1
- package/dist/prospect-client/Form/InputDate/InputDateAtom.js +2 -2
- package/dist/prospect-client/Form/InputDate/InputDateCommon.d.ts +4 -1
- package/dist/prospect-client/Form/InputDate/InputDateCommon.js +4 -4
- package/dist/prospect-client/Form/InputDate/InputDateLF.d.ts +4 -1
- package/dist/prospect-client/Form/InputDate/InputDateLF.js +1 -2
- package/dist/prospect-client/Form/InputDate/InputDateTextAtom.d.ts +4 -1
- package/dist/prospect-client/Form/InputDate/InputDateTextAtom.js +4 -4
- package/dist/prospect-client/Form/InputPhone/InputPhoneCommon.d.ts +4 -1
- package/dist/prospect-client/Form/InputPhone/InputPhoneCommon.js +4 -4
- package/dist/prospect-client/Form/InputText/InputTextApollo.d.ts +4 -1
- package/dist/prospect-client/Form/InputText/InputTextApollo.js +1 -2
- package/dist/prospect-client/Form/InputText/InputTextCommon.d.ts +4 -1
- package/dist/prospect-client/Form/InputText/InputTextCommon.js +4 -4
- package/dist/prospect-client/Form/InputText/InputTextLF.d.ts +4 -1
- package/dist/prospect-client/Form/InputText/InputTextLF.js +1 -2
- package/dist/prospect-client/Form/InputTextAtom/InputTextAtomCommon.d.ts +4 -1
- package/dist/prospect-client/Form/InputTextAtom/InputTextAtomCommon.js +4 -4
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioApollo.d.ts +3 -0
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioApollo.js +6 -0
- package/dist/prospect-client/Form/Radio/{CardRadioOption/CardRadioOptionCommon.d.ts → CardRadio/CardRadioCommon.d.ts} +7 -4
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioCommon.js +16 -0
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioLF.d.ts +3 -0
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioLF.js +6 -0
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupApollo.js +2 -2
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupCommon.d.ts +6 -6
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupCommon.js +3 -3
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupLF.js +2 -2
- package/dist/prospect-client/Form/Radio/Radio/RadioCommon.d.ts +4 -1
- package/dist/prospect-client/Form/Radio/Radio/RadioCommon.js +3 -3
- package/dist/prospect-client/Form/TextArea/TextAreaApollo.d.ts +4 -1
- package/dist/prospect-client/Form/TextArea/TextAreaApollo.js +1 -2
- package/dist/prospect-client/Form/TextArea/TextAreaCommon.d.ts +4 -1
- package/dist/prospect-client/Form/TextArea/TextAreaCommon.js +4 -4
- package/dist/prospect-client/Form/TextArea/TextAreaLF.d.ts +4 -1
- package/dist/prospect-client/Form/TextArea/TextAreaLF.js +1 -2
- package/dist/prospect-client/ItemMenu/ItemMenuApollo.d.ts +2 -0
- package/dist/prospect-client/ItemMenu/ItemMenuApollo.js +2 -0
- package/dist/prospect-client/ItemMenu/ItemMenuCommon.d.ts +22 -0
- package/dist/prospect-client/ItemMenu/ItemMenuCommon.js +18 -0
- package/dist/prospect-client/ItemMenu/ItemMenuLF.d.ts +2 -0
- package/dist/prospect-client/ItemMenu/ItemMenuLF.js +2 -0
- package/dist/prospect-client/ItemTabBar/ItemTabBarCommon.d.ts +4 -1
- package/dist/prospect-client/ItemTabBar/ItemTabBarCommon.js +4 -4
- package/dist/prospect-client/Loader/LoaderCommon.d.ts +4 -1
- package/dist/prospect-client/Loader/LoaderCommon.js +4 -4
- package/dist/prospect-client/Modal/ModalApollo.d.ts +4 -1
- package/dist/prospect-client/Modal/ModalApollo.js +2 -3
- package/dist/prospect-client/Modal/ModalCommon.d.ts +4 -1
- package/dist/prospect-client/Modal/ModalCommon.js +1 -2
- package/dist/prospect-client/Modal/ModalLF.d.ts +4 -1
- package/dist/prospect-client/Modal/ModalLF.js +2 -3
- package/dist/prospect-client/Modal/components/ModalCore.d.ts +4 -1
- package/dist/prospect-client/Modal/components/ModalCore.js +3 -3
- package/dist/prospect-client/TabMenu/TabMenu.d.ts +36 -0
- package/dist/prospect-client/TabMenu/TabMenu.helpers.d.ts +1 -0
- package/dist/prospect-client/TabMenu/TabMenu.helpers.js +12 -0
- package/dist/prospect-client/TabMenu/TabMenu.js +39 -0
- package/dist/prospect-client/Toggle/ToggleApollo.d.ts +4 -1
- package/dist/prospect-client/Toggle/ToggleApollo.js +1 -2
- package/dist/prospect-client/Toggle/ToggleCommon.d.ts +4 -3
- package/dist/prospect-client/Toggle/ToggleCommon.js +4 -4
- package/dist/prospect-client/Toggle/ToggleLF.d.ts +4 -1
- package/dist/prospect-client/Toggle/ToggleLF.js +1 -2
- package/dist/prospect.d.ts +4 -4
- package/dist/prospect.js +4 -4
- package/package.json +3 -3
- package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionApollo.d.ts +0 -3
- package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionApollo.js +0 -6
- package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionCommon.js +0 -16
- package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionLF.d.ts +0 -3
- package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionLF.js +0 -6
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import classnames from "classnames";
|
|
3
|
-
import {
|
|
3
|
+
import {} from "react";
|
|
4
4
|
import { Svg } from "../Svg";
|
|
5
5
|
import { linkClassName } from "./linkClassName";
|
|
6
|
-
const LinkAnchor =
|
|
6
|
+
const LinkAnchor = ({ className, target, rel, leftIcon, children, rightIcon, disabled, variant, ...restProps }) => {
|
|
7
7
|
const finalClassName = classnames(linkClassName, className, {
|
|
8
8
|
[`${linkClassName}--reverse`]: variant === "reverse",
|
|
9
9
|
});
|
|
10
|
-
return (_jsxs("a", { className: finalClassName, rel: target === "_blank" ? "noopener noreferrer" : rel, "aria-disabled": disabled ?? restProps["aria-disabled"],
|
|
11
|
-
}
|
|
10
|
+
return (_jsxs("a", { className: finalClassName, rel: target === "_blank" ? "noopener noreferrer" : rel, "aria-disabled": disabled ?? restProps["aria-disabled"], target: target, ...restProps, children: [leftIcon, children, rightIcon] }));
|
|
11
|
+
};
|
|
12
12
|
LinkAnchor.displayName = "LinkAnchor";
|
|
13
13
|
export { LinkAnchor };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Loader from "@axa-fr/canopee-css/Item_Loader.svg";
|
|
3
|
+
import LoaderInverse from "@axa-fr/canopee-css/Item_Loader_Inverse.svg";
|
|
4
|
+
const DEFAULT_CLASS_NAME = "af-loader";
|
|
5
|
+
export const ItemLoader = ({ variant }) => {
|
|
6
|
+
const isInverse = variant === "fullscreen";
|
|
7
|
+
return (_jsx("img", { className: `${DEFAULT_CLASS_NAME}__icon`, src: isInverse ? LoaderInverse : Loader, "aria-hidden": "true", alt: "" }));
|
|
8
|
+
};
|
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/distributeur/Loader/Loader.css";
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
type LoaderProps = {
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import { type ItemLoaderVariant } from "./ItemLoader";
|
|
4
|
+
export type LoaderProps = {
|
|
5
5
|
className?: string;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
children
|
|
9
|
-
/** @deprecated Use `className` instead. */
|
|
10
|
-
classModifier?: string;
|
|
6
|
+
text: string;
|
|
7
|
+
variant?: ItemLoaderVariant;
|
|
8
|
+
children?: ReactNode;
|
|
11
9
|
};
|
|
12
|
-
export declare const Loader: ({ className, text,
|
|
13
|
-
export {};
|
|
10
|
+
export declare const Loader: ({ className, text, variant, children, }: LoaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,31 +1,16 @@
|
|
|
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/canopee-css/distributeur/Loader/Loader.css";
|
|
3
|
-
import {} from "react";
|
|
4
3
|
import { getClassName } from "../utilities/helpers/getClassName";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
case "error":
|
|
16
|
-
return "Une erreur est survenue lors du chargement du composant";
|
|
17
|
-
default:
|
|
18
|
-
return "";
|
|
4
|
+
import { ItemLoader } from "./ItemLoader";
|
|
5
|
+
const LOADER_CLASS_NAME = "af-loader";
|
|
6
|
+
export const Loader = ({ className, text, variant = "fullscreen", children, }) => {
|
|
7
|
+
const loader = (_jsxs("section", { role: "alert", "aria-live": "assertive", "aria-busy": "true", className: getClassName({
|
|
8
|
+
baseClassName: LOADER_CLASS_NAME,
|
|
9
|
+
modifiers: [variant !== "inline" && variant],
|
|
10
|
+
className,
|
|
11
|
+
}), children: [_jsx(ItemLoader, { variant: variant }), _jsx("p", { className: `${LOADER_CLASS_NAME}__text`, children: text })] }));
|
|
12
|
+
if (variant === "fullscreen" && children) {
|
|
13
|
+
return (_jsxs(_Fragment, { children: [children, loader] }));
|
|
19
14
|
}
|
|
20
|
-
|
|
21
|
-
export const Loader = ({ className, text, children, classModifier, mode = "none", }) => {
|
|
22
|
-
const componentClassName = getClassName({
|
|
23
|
-
baseClassName: "af-loader",
|
|
24
|
-
modifiers: classModifier?.split(" "),
|
|
25
|
-
className,
|
|
26
|
-
});
|
|
27
|
-
const message = text || getText(mode);
|
|
28
|
-
const isLoaderVisible = mode !== "none";
|
|
29
|
-
const isLoaderInError = mode === "error";
|
|
30
|
-
return (_jsxs("div", { className: componentClassName, children: [children, isLoaderVisible ? (_jsx("div", { className: `${componentClassName} af-loader-on`, children: _jsxs("div", { className: "af-spinner", role: "alert", "aria-live": "assertive", "aria-busy": !isLoaderInError, "aria-label": message, children: [!isLoaderInError && _jsx("div", { className: "af-spinner__animation" }), _jsx("div", { className: "af-spinner__caption", children: message })] }) })) : null] }));
|
|
15
|
+
return loader;
|
|
31
16
|
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
import "@axa-fr/canopee-css/distributeur/Loader/SquareLoader.css";
|
|
3
|
+
export type SquareLoaderProps = {
|
|
4
|
+
className?: string;
|
|
5
|
+
mode?: LoaderMode;
|
|
6
|
+
text?: string;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
/** @deprecated Use `className` instead. */
|
|
9
|
+
classModifier?: string;
|
|
10
|
+
};
|
|
11
|
+
export type LoaderMode = "none" | "get" | "post" | "delete" | "update" | "error";
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use `Loader` with `variant="fullscreen"` instead.
|
|
14
|
+
*/
|
|
15
|
+
export declare const SquareLoader: ({ className, text, children, classModifier, mode, }: SquareLoaderProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { getClassName } from "../utilities/helpers/getClassName";
|
|
3
|
+
import "@axa-fr/canopee-css/distributeur/Loader/SquareLoader.css";
|
|
4
|
+
const getText = (index) => {
|
|
5
|
+
switch (index) {
|
|
6
|
+
case "get":
|
|
7
|
+
return "Chargement en cours";
|
|
8
|
+
case "post":
|
|
9
|
+
return "Sauvegarde en cours";
|
|
10
|
+
case "delete":
|
|
11
|
+
return "Suppression en cours";
|
|
12
|
+
case "update":
|
|
13
|
+
return "Mise à jour en cours";
|
|
14
|
+
case "error":
|
|
15
|
+
return "Une erreur est survenue lors du chargement du composant";
|
|
16
|
+
default:
|
|
17
|
+
return "";
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated Use `Loader` with `variant="fullscreen"` instead.
|
|
22
|
+
*/
|
|
23
|
+
export const SquareLoader = ({ className, text, children, classModifier, mode = "none", }) => {
|
|
24
|
+
const componentClassName = getClassName({
|
|
25
|
+
baseClassName: "af-square-loader",
|
|
26
|
+
modifiers: classModifier?.split(" "),
|
|
27
|
+
className,
|
|
28
|
+
});
|
|
29
|
+
const message = text || getText(mode);
|
|
30
|
+
const isLoaderVisible = mode !== "none";
|
|
31
|
+
const isLoaderInError = mode === "error";
|
|
32
|
+
return (_jsxs("div", { className: componentClassName, children: [children, isLoaderVisible ? (_jsx("div", { className: `${componentClassName} af-square-loader-on`, children: isLoaderInError ? (_jsx("div", { className: "af-spinner", role: "alert", "aria-live": "assertive", "aria-busy": "false", "aria-label": message, children: _jsx("div", { className: "af-spinner__caption", children: message }) })) : (_jsxs("div", { className: "af-spinner", role: "alert", "aria-live": "assertive", "aria-busy": "true", "aria-label": message, children: [_jsx("div", { className: "af-spinner__animation" }), _jsx("div", { className: "af-spinner__caption", children: message })] })) })) : null] }));
|
|
33
|
+
};
|
|
@@ -36,5 +36,8 @@ export type BooleanModalProps = React.DetailedHTMLProps<React.DialogHTMLAttribut
|
|
|
36
36
|
*/
|
|
37
37
|
classModifier?: string;
|
|
38
38
|
};
|
|
39
|
-
declare const BooleanModal:
|
|
39
|
+
declare const BooleanModal: {
|
|
40
|
+
({ children, title, submitTitle, cancelTitle, className, classModifier, onCancel, onSubmit, closeButtonAriaLabel, ...props }: BooleanModalProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
+
displayName: string;
|
|
42
|
+
};
|
|
40
43
|
export { BooleanModal };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React, {
|
|
2
|
+
import React, {} from "react";
|
|
3
3
|
import { Button, Modal, getComponentClassName } from "../../distributeur";
|
|
4
4
|
import { Body } from "./components/Body";
|
|
5
5
|
import { Footer } from "./components/Footer";
|
|
6
6
|
import { Header } from "./components/Header";
|
|
7
7
|
const defaultClassName = "af-modal";
|
|
8
|
-
const BooleanModal =
|
|
8
|
+
const BooleanModal = ({ children, title, submitTitle = "Valider", cancelTitle = "Annuler", className = defaultClassName, classModifier, onCancel, onSubmit, closeButtonAriaLabel, ...props }) => {
|
|
9
9
|
const componentClassName = getComponentClassName(className, classModifier, defaultClassName);
|
|
10
|
-
return (_jsxs(Modal, { className: componentClassName, onOutsideTap: onCancel, title: title,
|
|
11
|
-
}
|
|
10
|
+
return (_jsxs(Modal, { className: componentClassName, onOutsideTap: onCancel, title: title, ...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
|
+
};
|
|
12
12
|
BooleanModal.displayName = "BooleanModal";
|
|
13
13
|
export { BooleanModal };
|
|
@@ -21,5 +21,8 @@ export type ModalProps = React.DetailedHTMLProps<React.DialogHTMLAttributes<HTML
|
|
|
21
21
|
*/
|
|
22
22
|
ref?: React.Ref<HTMLDialogElement>;
|
|
23
23
|
};
|
|
24
|
-
declare const Modal:
|
|
24
|
+
declare const Modal: {
|
|
25
|
+
({ className, title, onOutsideTap, children, classModifier, size, ...props }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
displayName: string;
|
|
27
|
+
};
|
|
25
28
|
export { Modal };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import {} from "react";
|
|
3
3
|
import { getComponentClassName } from "../utilities";
|
|
4
|
-
const Modal =
|
|
4
|
+
const Modal = ({ className, title = "", onOutsideTap, children, classModifier, size, ...props }) => {
|
|
5
5
|
// If size is set to 'lg' or 'sm', use it as the classModifier, otherwise use the provided classModifier
|
|
6
6
|
let effectiveClassModifier;
|
|
7
7
|
if (size) {
|
|
@@ -18,7 +18,7 @@ const Modal = forwardRef(({ className, title = "", onOutsideTap, children, class
|
|
|
18
18
|
const componentClassName = getComponentClassName(className, effectiveClassModifier, "af-modal");
|
|
19
19
|
return (
|
|
20
20
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events
|
|
21
|
-
_jsx("dialog", { "aria-label": title, className: componentClassName, onClick: onOutsideTap,
|
|
22
|
-
}
|
|
21
|
+
_jsx("dialog", { "aria-label": title, className: componentClassName, onClick: onOutsideTap, ...props, children: _jsx("div", { className: "af-modal__dialog", onClick: (event) => event.stopPropagation(), children: _jsx("div", { className: "af-modal__content", children: children }) }) }));
|
|
22
|
+
};
|
|
23
23
|
Modal.displayName = "Modal";
|
|
24
24
|
export { Modal };
|
|
@@ -34,17 +34,11 @@ type Props = {
|
|
|
34
34
|
/** Labels for different states for accessibility purposes
|
|
35
35
|
* @default
|
|
36
36
|
* {
|
|
37
|
-
* validatedState: "validée",
|
|
38
|
-
* editState: "en cours de modification",
|
|
39
|
-
* lockedState: "verrouillée",
|
|
40
|
-
* }
|
|
37
|
+
* validatedState: "validée", * editState: "en cours de modification", * lockedState: "verrouillée", * }
|
|
41
38
|
* @example
|
|
42
39
|
* ```json
|
|
43
40
|
* {
|
|
44
|
-
* validatedState: "completed",
|
|
45
|
-
* editState: "being edited",
|
|
46
|
-
* lockedState: "locked",
|
|
47
|
-
* }
|
|
41
|
+
* validatedState: "completed", * editState: "being edited", * lockedState: "locked", * }
|
|
48
42
|
* ```
|
|
49
43
|
* will change the aria-labels of the step to "Étape verticale ${title} (completed)" when validated, "Étape verticale ${title} (being edited)" when in edition and "Étape verticale ${title} (locked)" when locked.
|
|
50
44
|
*/
|
|
@@ -28,5 +28,8 @@ type TagProps = ComponentPropsWithRef<"span"> & {
|
|
|
28
28
|
* @param {React.Ref<HTMLSpanElement>} ref - The ref to the span element.
|
|
29
29
|
* @returns {JSX.Element} The rendered Tag component.
|
|
30
30
|
*/
|
|
31
|
-
export declare const Tag:
|
|
31
|
+
export declare const Tag: {
|
|
32
|
+
({ children, className, classModifier, variant, ...otherProps }: PropsWithChildren<TagProps>): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
displayName: string;
|
|
34
|
+
};
|
|
32
35
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Tag/Tag.css";
|
|
3
|
-
import {
|
|
3
|
+
import {} from "react";
|
|
4
4
|
import { getClassName } from "../utilities/helpers/getClassName";
|
|
5
5
|
/**
|
|
6
6
|
* Tag component to display a label with various styles.
|
|
@@ -14,7 +14,7 @@ import { getClassName } from "../utilities/helpers/getClassName";
|
|
|
14
14
|
* @param {React.Ref<HTMLSpanElement>} ref - The ref to the span element.
|
|
15
15
|
* @returns {JSX.Element} The rendered Tag component.
|
|
16
16
|
*/
|
|
17
|
-
export const Tag =
|
|
17
|
+
export const Tag = ({ children, className, classModifier, variant, ...otherProps }) => {
|
|
18
18
|
const actualModifier = variant || classModifier || "default";
|
|
19
19
|
const componentClassName = getClassName({
|
|
20
20
|
baseClassName: "af-tag",
|
|
@@ -27,6 +27,6 @@ export const Tag = forwardRef(({ children, className, classModifier, variant, ..
|
|
|
27
27
|
modifiers: [actualModifier],
|
|
28
28
|
className,
|
|
29
29
|
});
|
|
30
|
-
return (_jsx("span", {
|
|
31
|
-
}
|
|
30
|
+
return (_jsx("span", { className: `${componentClassName} ${badgeClassName}`, ...otherProps, children: children }));
|
|
31
|
+
};
|
|
32
32
|
Tag.displayName = "Tag";
|
|
@@ -9,5 +9,8 @@ type TitleProps = ComponentPropsWithRef<"h2"> & {
|
|
|
9
9
|
contentRight?: ReactNode;
|
|
10
10
|
withDivider?: boolean;
|
|
11
11
|
};
|
|
12
|
-
export declare const Title:
|
|
12
|
+
export declare const Title: {
|
|
13
|
+
({ className, classModifier, children, heading: Heading, contentLeft, contentRight, withDivider, ...otherProps }: PropsWithChildren<TitleProps>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
13
16
|
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Title/Title.css";
|
|
3
|
-
import {
|
|
3
|
+
import {} from "react";
|
|
4
4
|
import { getClassName } from "../utilities/helpers/getClassName";
|
|
5
5
|
const baseClass = "af-title";
|
|
6
|
-
export const Title =
|
|
6
|
+
export const Title = ({ className, classModifier, children, heading: Heading = "h2", contentLeft, contentRight, withDivider = true, ...otherProps }) => {
|
|
7
7
|
const modifiers = classModifier?.split(" ") ?? [];
|
|
8
8
|
if (!withDivider) {
|
|
9
9
|
modifiers.push("without-divider");
|
|
@@ -13,6 +13,6 @@ export const Title = forwardRef(({ className, classModifier, children, heading:
|
|
|
13
13
|
modifiers,
|
|
14
14
|
className,
|
|
15
15
|
});
|
|
16
|
-
return (_jsxs("div", { className: `${baseClass}--container`, children: [_jsxs(Heading, {
|
|
17
|
-
}
|
|
16
|
+
return (_jsxs("div", { className: `${baseClass}--container`, children: [_jsxs(Heading, { className: componentClassName, ...otherProps, children: [children, contentLeft] }), contentRight ? (_jsx("div", { className: "content-right", children: contentRight })) : null] }));
|
|
17
|
+
};
|
|
18
18
|
Title.displayName = "Title";
|
package/dist/distributeur.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import "@axa-fr/canopee-css/distributeur/common/layers.css";
|
|
2
|
+
import "@axa-fr/canopee-css/distributeur/common/reboot.css";
|
|
1
3
|
import "@axa-fr/canopee-css/distributeur/common/grid.css";
|
|
2
4
|
import "@axa-fr/canopee-css/distributeur/common/icons.css";
|
|
3
|
-
import "@axa-fr/canopee-css/distributeur/common/reboot.css";
|
|
4
5
|
import "@axa-fr/canopee-css/distributeur/common/tokens.css";
|
|
5
6
|
import "@axa-fr/canopee-css/distributeur/Form/core/FormCore.css";
|
|
6
7
|
import "@fontsource/source-sans-pro/400.css";
|
|
@@ -42,11 +43,14 @@ export { Tabs } from "./distributeur/Tabs/Tabs";
|
|
|
42
43
|
export { Title } from "./distributeur/Title/Title";
|
|
43
44
|
export { getComponentClassName } from "./distributeur/utilities";
|
|
44
45
|
/** @deprecated Use `Tag` instead. */
|
|
45
|
-
declare const Badge:
|
|
46
|
-
classModifier
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
declare const Badge: {
|
|
47
|
+
({ children, className, classModifier, variant, ...otherProps }: import("react").PropsWithChildren<import("react").ClassAttributes<HTMLSpanElement> & import("react").HTMLAttributes<HTMLSpanElement> & {
|
|
48
|
+
classModifier?: string;
|
|
49
|
+
variant?: import("./distributeur").TagVariants;
|
|
50
|
+
disabled?: boolean;
|
|
51
|
+
}>): import("react/jsx-runtime").JSX.Element;
|
|
52
|
+
displayName: string;
|
|
53
|
+
};
|
|
50
54
|
export type { TagVariants } from "./distributeur/Tag/Tag";
|
|
51
55
|
export { Badge, Tag };
|
|
52
56
|
/**
|
|
@@ -61,6 +65,8 @@ export * from "./distributeur/Table";
|
|
|
61
65
|
export { Alert, Message };
|
|
62
66
|
export { HelpButton } from "./distributeur/HelpButton";
|
|
63
67
|
export { Loader } from "./distributeur/Loader/Loader";
|
|
68
|
+
export { ItemLoader, type ItemLoaderVariant, } from "./distributeur/Loader/ItemLoader";
|
|
69
|
+
export { SquareLoader } from "./distributeur/Loader/SquareLoader";
|
|
64
70
|
export { CardData } from "./distributeur/CardData/CardData";
|
|
65
71
|
export type { CardDataVariant } from "./distributeur/CardData/CardData";
|
|
66
72
|
export { EditorialMessage, type EditorialMessageProps, type EditorialMessageType, } from "./distributeur/EditorialMessage/EditorialMessage";
|
package/dist/distributeur.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import "@axa-fr/canopee-css/distributeur/common/layers.css";
|
|
2
|
+
import "@axa-fr/canopee-css/distributeur/common/reboot.css";
|
|
1
3
|
import "@axa-fr/canopee-css/distributeur/common/grid.css";
|
|
2
4
|
import "@axa-fr/canopee-css/distributeur/common/icons.css";
|
|
3
|
-
import "@axa-fr/canopee-css/distributeur/common/reboot.css";
|
|
4
5
|
import "@axa-fr/canopee-css/distributeur/common/tokens.css";
|
|
5
6
|
import "@axa-fr/canopee-css/distributeur/Form/core/FormCore.css";
|
|
6
7
|
import "@fontsource/source-sans-pro/400.css";
|
|
@@ -54,6 +55,8 @@ export * from "./distributeur/Table";
|
|
|
54
55
|
export { Alert, Message };
|
|
55
56
|
export { HelpButton } from "./distributeur/HelpButton";
|
|
56
57
|
export { Loader } from "./distributeur/Loader/Loader";
|
|
58
|
+
export { ItemLoader, } from "./distributeur/Loader/ItemLoader";
|
|
59
|
+
export { SquareLoader } from "./distributeur/Loader/SquareLoader";
|
|
57
60
|
export { CardData } from "./distributeur/CardData/CardData";
|
|
58
61
|
export { EditorialMessage, } from "./distributeur/EditorialMessage/EditorialMessage";
|
|
59
62
|
export { Timeline, } from "./distributeur/Timeline/Timeline";
|
|
@@ -12,5 +12,8 @@ export type CardCheckboxOptionCommonProps = CardCheckboxOptionProps & {
|
|
|
12
12
|
CheckboxComponent: ComponentType<CheckboxProps>;
|
|
13
13
|
IconComponent: ComponentType<IconProps>;
|
|
14
14
|
};
|
|
15
|
-
declare const CardCheckboxOptionCommon:
|
|
15
|
+
declare const CardCheckboxOptionCommon: {
|
|
16
|
+
({ label, type, description, subtitle, icon, className, CheckboxComponent, IconComponent, ...inputProps }: CardCheckboxOptionCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
displayName: string;
|
|
18
|
+
};
|
|
16
19
|
export { CardCheckboxOptionCommon };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
const CardCheckboxOptionCommon =
|
|
2
|
+
import {} from "react";
|
|
3
|
+
const CardCheckboxOptionCommon = ({ label, type = "vertical", description, subtitle, icon, className, CheckboxComponent, IconComponent, ...inputProps }) => (_jsxs("label", { className: [
|
|
4
4
|
"af-card-checkbox-option",
|
|
5
5
|
type === "horizontal" && "af-card-checkbox-option--horizontal",
|
|
6
6
|
className,
|
|
7
7
|
]
|
|
8
8
|
.filter(Boolean)
|
|
9
|
-
.join(" "), children: [icon ? _jsx(IconComponent, { src: icon, role: "presentation" }) : null, _jsxs("div", { className: "af-card-checkbox-option__content", children: [_jsx("p", { className: "af-card-checkbox-option__label", children: label }), Boolean(description) && (_jsx("p", { className: "af-card-checkbox-option__description", children: description })), Boolean(subtitle) && (_jsx("p", { className: "af-card-checkbox-option__subtitle", children: subtitle }))] }), _jsx(CheckboxComponent, { ...inputProps
|
|
9
|
+
.join(" "), children: [icon ? _jsx(IconComponent, { src: icon, role: "presentation" }) : null, _jsxs("div", { className: "af-card-checkbox-option__content", children: [_jsx("p", { className: "af-card-checkbox-option__label", children: label }), Boolean(description) && (_jsx("p", { className: "af-card-checkbox-option__description", children: description })), Boolean(subtitle) && (_jsx("p", { className: "af-card-checkbox-option__subtitle", children: subtitle }))] }), _jsx(CheckboxComponent, { ...inputProps })] }));
|
|
10
10
|
CardCheckboxOptionCommon.displayName = "CardCheckboxOptionCommon";
|
|
11
11
|
export { CardCheckboxOptionCommon };
|
|
@@ -5,4 +5,7 @@ export type CheckboxProps = {
|
|
|
5
5
|
/** @deprecated Use `aria-invalid` instead */
|
|
6
6
|
hasError?: boolean;
|
|
7
7
|
} & Omit<ComponentProps<"input">, "disabled" | "type">;
|
|
8
|
-
export declare const Checkbox:
|
|
8
|
+
export declare const Checkbox: {
|
|
9
|
+
({ errorId, hasError, className, ...inputProps }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
export const Checkbox =
|
|
2
|
+
import {} from "react";
|
|
3
|
+
export const Checkbox = ({ errorId, hasError, className, ...inputProps }) => (_jsx("input", { "aria-errormessage": errorId, "aria-invalid": hasError, ...inputProps, className: ["af-checkbox", className].filter(Boolean).join(" "), type: "checkbox" }));
|
|
4
4
|
Checkbox.displayName = "Checkbox";
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/prospect/Form/Checkbox/CheckboxText/CheckboxTextApollo.css";
|
|
2
2
|
import { type CheckboxTextProps } from "./CheckboxTextCommon";
|
|
3
|
-
export declare const CheckboxText:
|
|
3
|
+
export declare const CheckboxText: {
|
|
4
|
+
({ ...props }: CheckboxTextProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
2
|
import "@axa-fr/canopee-css/prospect/Form/Checkbox/CheckboxText/CheckboxTextApollo.css";
|
|
4
3
|
import { ItemMessage } from "../../ItemMessage/ItemMessageApollo";
|
|
5
4
|
import { Checkbox } from "../Checkbox/CheckboxApollo";
|
|
6
5
|
import { CheckboxTextCommon, } from "./CheckboxTextCommon";
|
|
7
|
-
export const CheckboxText =
|
|
6
|
+
export const CheckboxText = ({ ...props }) => (_jsx(CheckboxTextCommon, { ...props, CheckboxComponent: Checkbox, ItemMessageComponent: ItemMessage }));
|
|
8
7
|
CheckboxText.displayName = "CheckboxText";
|
|
@@ -14,5 +14,8 @@ export type CheckboxTextCommonProps = CheckboxTextProps & {
|
|
|
14
14
|
CheckboxComponent: ComponentType<Omit<CheckboxProps, "checkBoxIcon">>;
|
|
15
15
|
ItemMessageComponent: ComponentType<ItemMessageProps>;
|
|
16
16
|
};
|
|
17
|
-
declare const CheckboxTextCommon:
|
|
17
|
+
declare const CheckboxTextCommon: {
|
|
18
|
+
({ label, errorMessage, id, message, messageType, CheckboxComponent, ItemMessageComponent, containerProps, ...inputProps }: CheckboxTextCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
18
21
|
export { CheckboxTextCommon };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
const CheckboxTextCommon =
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
const CheckboxTextCommon = ({ label, errorMessage, id, message, messageType, CheckboxComponent, ItemMessageComponent, containerProps, ...inputProps }) => {
|
|
4
4
|
const generatedId = useId();
|
|
5
5
|
const inputId = id ?? generatedId;
|
|
6
6
|
const messageId = `${inputId}-error`;
|
|
7
7
|
const hasError = (Boolean(message) && messageType === "error") || Boolean(errorMessage);
|
|
8
|
-
return (_jsxs("div", { className: "af-checkbox-text", ...containerProps, children: [_jsxs("label", { htmlFor: inputId, children: [_jsx(CheckboxComponent, { id: inputId, ...inputProps, "aria-errormessage": hasError ? messageId : undefined, "aria-invalid": hasError || undefined
|
|
9
|
-
}
|
|
8
|
+
return (_jsxs("div", { className: "af-checkbox-text", ...containerProps, children: [_jsxs("label", { htmlFor: inputId, children: [_jsx(CheckboxComponent, { id: inputId, ...inputProps, "aria-errormessage": hasError ? messageId : undefined, "aria-invalid": hasError || undefined }), _jsx("span", { className: "af-checkbox-text__label-content", children: label })] }), _jsx(ItemMessageComponent, { message: message || errorMessage, id: messageId, messageType: messageType })] }));
|
|
9
|
+
};
|
|
10
10
|
CheckboxTextCommon.displayName = "CheckboxTextCommon";
|
|
11
11
|
export { CheckboxTextCommon };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/client/Form/Checkbox/CheckboxText/CheckboxTextLF.css";
|
|
2
2
|
import { type CheckboxTextProps } from "./CheckboxTextCommon";
|
|
3
|
-
export declare const CheckboxText:
|
|
3
|
+
export declare const CheckboxText: {
|
|
4
|
+
({ ...props }: CheckboxTextProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
2
|
import "@axa-fr/canopee-css/client/Form/Checkbox/CheckboxText/CheckboxTextLF.css";
|
|
4
3
|
import { ItemMessage } from "../../ItemMessage/ItemMessageLF";
|
|
5
4
|
import { Checkbox } from "../Checkbox/CheckboxLF";
|
|
6
5
|
import { CheckboxTextCommon, } from "./CheckboxTextCommon";
|
|
7
|
-
export const CheckboxText =
|
|
6
|
+
export const CheckboxText = ({ ...props }) => (_jsx(CheckboxTextCommon, { ...props, CheckboxComponent: Checkbox, ItemMessageComponent: ItemMessage }));
|
|
8
7
|
CheckboxText.displayName = "CheckboxText";
|
|
@@ -23,5 +23,8 @@ type DropdownCommonProps = DropdownProps & {
|
|
|
23
23
|
ItemLabelComponent: ComponentType<Omit<ComponentProps<typeof ItemLabelCommon>, "ButtonComponent">>;
|
|
24
24
|
ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
|
|
25
25
|
};
|
|
26
|
-
declare const DropdownCommon:
|
|
26
|
+
declare const DropdownCommon: {
|
|
27
|
+
({ id, required, label, error, placeholder, children, helper, success, message, messageType, description, buttonLabel, moreButtonLabel, onButtonClick, onMoreButtonClick, sideButtonLabel, onSideButtonClick, ItemLabelComponent, ItemMessageComponent, containerProps, ...otherProps }: DropdownCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
displayName: string;
|
|
29
|
+
};
|
|
27
30
|
export { DropdownCommon };
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import classNames from "classnames";
|
|
3
|
-
import {
|
|
3
|
+
import { useId, } from "react";
|
|
4
4
|
import { ItemLabelCommon, } from "../ItemLabel/ItemLabelCommon";
|
|
5
5
|
import { ItemMessage, } from "../ItemMessage/ItemMessageCommon";
|
|
6
|
-
const DropdownCommon =
|
|
6
|
+
const DropdownCommon = ({ id, required, label, error, placeholder, children, helper, success, message, messageType, description, buttonLabel, moreButtonLabel, onButtonClick, onMoreButtonClick, sideButtonLabel, onSideButtonClick, ItemLabelComponent, ItemMessageComponent, containerProps, ...otherProps }) => {
|
|
7
7
|
const idMessage = useId();
|
|
8
8
|
let inputId = useId();
|
|
9
9
|
inputId = id || inputId;
|
|
10
10
|
const hasError = (Boolean(message) && messageType === "error") || Boolean(error);
|
|
11
11
|
const hasWarning = !hasError && Boolean(message) && messageType === "warning";
|
|
12
12
|
const classname = classNames("af-form__dropdown-input", hasError && "af-form__dropdown-input--error", hasWarning && "af-form__dropdown-input--warning");
|
|
13
|
-
return (_jsxs("div", { className: "af-form__dropdown-container", ...containerProps, children: [_jsx(ItemLabelComponent, { description: description, moreButtonLabel: moreButtonLabel ?? buttonLabel, onMoreButtonClick: onMoreButtonClick ?? onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, htmlFor: inputId, children: label }), _jsxs("select", { className: classname, ...otherProps,
|
|
14
|
-
}
|
|
13
|
+
return (_jsxs("div", { className: "af-form__dropdown-container", ...containerProps, children: [_jsx(ItemLabelComponent, { description: description, moreButtonLabel: moreButtonLabel ?? buttonLabel, onMoreButtonClick: onMoreButtonClick ?? onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, htmlFor: inputId, children: label }), _jsxs("select", { className: classname, ...otherProps, id: inputId, children: [Boolean(placeholder) && _jsx("option", { value: "", children: placeholder }), children] }), helper ? _jsx("span", { className: "af-form__input-helper", children: helper }) : null, _jsx(ItemMessageComponent, { id: idMessage, message: message || error || success, messageType: messageType || (error ? "error" : "success") })] }));
|
|
14
|
+
};
|
|
15
15
|
DropdownCommon.displayName = "Dropdown";
|
|
16
16
|
export { DropdownCommon };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { type FileUploadProps } from "./FileUploadCommon";
|
|
2
2
|
import "@axa-fr/canopee-css/prospect/Form/FileUpload/FileUpload/FileUploadAll.css";
|
|
3
|
-
export declare const FileUpload:
|
|
3
|
+
export declare const FileUpload: {
|
|
4
|
+
({ ...props }: FileUploadProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
2
|
import { InputFile } from "../InputFile/InputFileApollo";
|
|
4
3
|
import { FileUploadCommon } from "./FileUploadCommon";
|
|
5
4
|
import "@axa-fr/canopee-css/prospect/Form/FileUpload/FileUpload/FileUploadAll.css";
|
|
6
|
-
export const FileUpload =
|
|
5
|
+
export const FileUpload = ({ ...props }) => (_jsx(FileUploadCommon, { ...props, InputFileComponent: InputFile }));
|
|
7
6
|
FileUpload.displayName = "FileUpload";
|
|
@@ -14,5 +14,8 @@ export type FileUploadProps = Omit<InputFileProps, "children"> & {
|
|
|
14
14
|
type FileUploadCommonProps = FileUploadProps & {
|
|
15
15
|
InputFileComponent: ComponentType<InputFileProps>;
|
|
16
16
|
};
|
|
17
|
-
export declare const FileUploadCommon:
|
|
17
|
+
export declare const FileUploadCommon: {
|
|
18
|
+
({ InputFileComponent, className, children, fileListLabel, ...props }: FileUploadCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
displayName: string;
|
|
20
|
+
};
|
|
18
21
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Children,
|
|
2
|
+
import { Children, } from "react";
|
|
3
3
|
import { generateId } from "../../../utilities/generateId";
|
|
4
4
|
import { getClassName } from "../../../utilities/getClassName";
|
|
5
|
-
export const FileUploadCommon =
|
|
5
|
+
export const FileUploadCommon = ({ InputFileComponent, className, children, fileListLabel = "Vos fichiers importés :", ...props }) => {
|
|
6
6
|
return (_jsx(InputFileComponent, { ...props, className: getClassName({
|
|
7
7
|
baseClassName: "af-file-upload",
|
|
8
8
|
className,
|
|
9
|
-
}),
|
|
10
|
-
}
|
|
9
|
+
}), children: children ? (_jsxs(_Fragment, { children: [_jsx("p", { className: "af-file-list__title", children: fileListLabel }), _jsx("ul", { className: "af-file-list", children: Children.map(children, (child) => (_jsx("li", { className: "af-file-list__item", children: child }, generateId(child)))) })] })) : null }));
|
|
10
|
+
};
|
|
11
11
|
FileUploadCommon.displayName = "FileUploadCommon";
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import { type FileUploadProps } from "./FileUploadCommon";
|
|
2
2
|
import "@axa-fr/canopee-css/client/Form/FileUpload/FileUpload/FileUploadAll.css";
|
|
3
|
-
export declare const FileUpload:
|
|
3
|
+
export declare const FileUpload: {
|
|
4
|
+
({ ...props }: FileUploadProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from "react";
|
|
3
2
|
import { InputFile } from "../InputFile/InputFileLF";
|
|
4
3
|
import { FileUploadCommon } from "./FileUploadCommon";
|
|
5
4
|
import "@axa-fr/canopee-css/client/Form/FileUpload/FileUpload/FileUploadAll.css";
|
|
6
|
-
export const FileUpload =
|
|
5
|
+
export const FileUpload = ({ ...props }) => (_jsx(FileUploadCommon, { ...props, InputFileComponent: InputFile }));
|
|
7
6
|
FileUpload.displayName = "FileUpload";
|