@axa-fr/canopee-react 1.6.1-alpha.4 → 1.6.1-alpha.6
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/distributeur/Accordion/Accordion.js +8 -5
- package/dist/distributeur/Accordion/CollapseCard.d.ts +1 -0
- package/dist/distributeur/Accordion/CollapseCard.js +6 -2
- package/dist/distributeur/Accordion/Header.d.ts +1 -0
- package/dist/distributeur/Accordion/Header.js +6 -2
- package/dist/distributeur/Action/Action.d.ts +1 -0
- package/dist/distributeur/Action/Action.js +7 -2
- package/dist/distributeur/Form/Checkbox/CheckboxItem.d.ts +2 -0
- package/dist/distributeur/Form/Checkbox/CheckboxItem.js +2 -2
- package/dist/distributeur/Form/Choice/Choice.d.ts +1 -0
- package/dist/distributeur/Form/Date/Date.d.ts +1 -0
- package/dist/distributeur/Form/Date/Date.js +6 -2
- package/dist/distributeur/Form/File/File.d.ts +1 -0
- package/dist/distributeur/Form/File/File.js +6 -2
- package/dist/distributeur/Form/Number/Number.d.ts +1 -0
- package/dist/distributeur/Form/Number/Number.js +6 -2
- package/dist/distributeur/Form/Pass/Pass.d.ts +3 -0
- package/dist/distributeur/Form/Pass/Pass.js +3 -0
- package/dist/distributeur/Form/Pass/PassInput.d.ts +3 -0
- package/dist/distributeur/Form/Pass/PassInput.js +3 -0
- package/dist/distributeur/Form/Radio/RadioItem.d.ts +1 -0
- package/dist/distributeur/Form/Select/SelectBase.d.ts +1 -0
- package/dist/distributeur/Form/Select/SelectBase.js +6 -2
- package/dist/distributeur/Form/Slider/Slider.d.ts +1 -0
- package/dist/distributeur/Form/Slider/Slider.js +6 -2
- package/dist/distributeur/Form/Text/Text.d.ts +1 -0
- package/dist/distributeur/Form/Text/Text.js +6 -2
- package/dist/distributeur/Form/Textarea/Textarea.d.ts +1 -0
- package/dist/distributeur/Form/Textarea/Textarea.js +6 -2
- package/dist/distributeur/Form/core/getOptionClassName.d.ts +1 -1
- package/dist/distributeur/Form/core/getOptionClassName.js +11 -9
- package/dist/distributeur/HelpButton/index.js +6 -2
- package/dist/distributeur/Layout/Header/Header.d.ts +1 -0
- package/dist/distributeur/Layout/Header/Header.js +6 -2
- package/dist/distributeur/Layout/Header/Infos/Infos.d.ts +1 -0
- package/dist/distributeur/Layout/Header/Infos/Infos.js +6 -2
- package/dist/distributeur/Layout/Header/Name/Name.d.ts +1 -0
- package/dist/distributeur/Layout/Header/Name/Name.js +6 -2
- package/dist/distributeur/Layout/Header/NavBar/NavBarBase.d.ts +1 -0
- package/dist/distributeur/Layout/Header/NavBar/NavBarBase.js +6 -2
- package/dist/distributeur/Layout/Header/User/User.d.ts +1 -0
- package/dist/distributeur/Layout/Header/User/User.js +6 -2
- package/dist/distributeur/Loader/Loader.d.ts +1 -0
- package/dist/distributeur/Loader/Loader.js +6 -2
- package/dist/distributeur/MandatoryMention/MandatoryMention.d.ts +12 -0
- package/dist/distributeur/MandatoryMention/MandatoryMention.js +10 -0
- package/dist/distributeur/Messages/Message.js +5 -5
- package/dist/distributeur/ModalAgent/components/Body.d.ts +1 -0
- package/dist/distributeur/ModalAgent/components/Body.js +6 -2
- package/dist/distributeur/ModalAgent/components/Footer.d.ts +1 -0
- package/dist/distributeur/ModalAgent/components/Footer.js +6 -2
- package/dist/distributeur/ModalAgent/components/Header.d.ts +1 -0
- package/dist/distributeur/ModalAgent/components/Header.js +7 -2
- package/dist/distributeur/ModalAgent/components/HeaderBase.d.ts +1 -0
- package/dist/distributeur/ModalAgent/components/HeaderBase.js +6 -2
- package/dist/distributeur/Popover/AnimatedPopover.d.ts +1 -0
- package/dist/distributeur/Popover/AnimatedPopover.js +6 -2
- package/dist/distributeur/Popover/Popover.d.ts +1 -0
- package/dist/distributeur/Popover/Popover.types.d.ts +2 -0
- package/dist/distributeur/Popover/PopoverBase.d.ts +1 -0
- package/dist/distributeur/Popover/PopoverBase.js +1 -2
- package/dist/distributeur/Restitution/ArticleRestitution.d.ts +1 -0
- package/dist/distributeur/Restitution/ArticleRestitution.js +6 -2
- package/dist/distributeur/Restitution/HeaderRestitution.d.ts +1 -0
- package/dist/distributeur/Restitution/HeaderRestitution.js +6 -2
- package/dist/distributeur/Restitution/Restitution.d.ts +3 -1
- package/dist/distributeur/Restitution/Restitution.js +7 -3
- package/dist/distributeur/Restitution/SectionRestitution.d.ts +1 -0
- package/dist/distributeur/Restitution/SectionRestitution.js +6 -2
- package/dist/distributeur/Restitution/SectionRestitutionColumn.d.ts +1 -0
- package/dist/distributeur/Restitution/SectionRestitutionColumn.js +9 -2
- package/dist/distributeur/Restitution/SectionRestitutionRow.d.ts +1 -0
- package/dist/distributeur/Restitution/SectionRestitutionRow.js +10 -3
- package/dist/distributeur/Restitution/SectionRestitutionTitle.d.ts +1 -0
- package/dist/distributeur/Restitution/SectionRestitutionTitle.js +6 -2
- package/dist/distributeur/Steps/StepBase.d.ts +1 -0
- package/dist/distributeur/Steps/StepBase.js +7 -2
- package/dist/distributeur/Steps/Steps.d.ts +2 -1
- package/dist/distributeur/Steps/Steps.js +7 -3
- package/dist/distributeur/Table/TBody.d.ts +1 -0
- package/dist/distributeur/Table/TBody.js +6 -2
- package/dist/distributeur/Table/THead.d.ts +1 -0
- package/dist/distributeur/Table/THead.js +6 -2
- package/dist/distributeur/Table/Table.d.ts +3 -1
- package/dist/distributeur/Table/Table.js +6 -2
- package/dist/distributeur/Table/Td.d.ts +1 -0
- package/dist/distributeur/Table/Td.js +6 -2
- package/dist/distributeur/Table/Th.d.ts +3 -1
- package/dist/distributeur/Table/Th.js +7 -3
- package/dist/distributeur/Table/Tr.d.ts +1 -0
- package/dist/distributeur/Table/Tr.js +6 -2
- package/dist/distributeur/Tag/Tag.js +9 -9
- package/dist/distributeur/Title/Title.d.ts +1 -0
- package/dist/distributeur/Title/Title.js +6 -2
- package/dist/distributeur.d.ts +1 -0
- package/dist/distributeur.js +1 -0
- package/package.json +2 -2
|
@@ -2,14 +2,17 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { createElement as _createElement } from "react";
|
|
3
3
|
import "@axa-fr/canopee-css/distributeur/Accordion/Accordion.css";
|
|
4
4
|
import React, { useId } from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { getClassName } from "../utilities/helpers/getClassName";
|
|
6
6
|
import { CollapseCard } from "./CollapseCard";
|
|
7
7
|
const defaultClassName = "af-accordion";
|
|
8
8
|
const Accordion = ({ className, classModifier, variant = "default", children, onlyOne = false, }) => {
|
|
9
|
-
const componentClassName =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const componentClassName = getClassName({
|
|
10
|
+
baseClassName: defaultClassName,
|
|
11
|
+
modifiers: [
|
|
12
|
+
variant !== "default" && variant,
|
|
13
|
+
...(classModifier?.split(" ") ?? []),
|
|
14
|
+
],
|
|
15
|
+
className,
|
|
13
16
|
});
|
|
14
17
|
const id = useId();
|
|
15
18
|
const childrenArray = Array.isArray(children) ? children : [children];
|
|
@@ -8,6 +8,7 @@ export type CollapseProps = {
|
|
|
8
8
|
name?: string;
|
|
9
9
|
onToggle?: DetailsHTMLAttributes<HTMLDetailsElement>["onToggle"];
|
|
10
10
|
className?: string;
|
|
11
|
+
/** @deprecated Use `className` instead. */
|
|
11
12
|
classModifier?: string;
|
|
12
13
|
actions?: AccordionActions;
|
|
13
14
|
variant?: AccordionVariant;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { getClassName } from "../utilities/helpers/getClassName";
|
|
3
3
|
import { Body } from "./Body";
|
|
4
4
|
import { Header } from "./Header";
|
|
5
5
|
export const CollapseCard = ({ children, name, title, id, open, onToggle, className, classModifier = "", actions, variant, }) => {
|
|
6
6
|
const headerId = id;
|
|
7
7
|
let newClassModifier = open ? "open" : "";
|
|
8
8
|
newClassModifier += ` ${classModifier}`;
|
|
9
|
-
const componentClassName =
|
|
9
|
+
const componentClassName = getClassName({
|
|
10
|
+
baseClassName: "af-accordion__details",
|
|
11
|
+
modifiers: newClassModifier.trim().split(" "),
|
|
12
|
+
className,
|
|
13
|
+
});
|
|
10
14
|
return (_jsxs("details", { open: open, name: name, className: componentClassName, onToggle: onToggle, children: [_jsx(Header, { id: headerId, actions: actions, variant: variant, children: title }), _jsx(Body, { children: children })] }));
|
|
11
15
|
};
|
|
@@ -4,10 +4,14 @@ import React from "react";
|
|
|
4
4
|
import { Button } from "../Button/Button";
|
|
5
5
|
import { Svg } from "../Svg/Svg";
|
|
6
6
|
import { Title } from "../Title/Title";
|
|
7
|
-
import {
|
|
7
|
+
import { getClassName } from "../utilities/helpers/getClassName";
|
|
8
8
|
const defaultClassName = "af-accordion__item-header";
|
|
9
9
|
const Header = ({ children, className, classModifier, id, actions, variant, }) => {
|
|
10
|
-
const componentClassName =
|
|
10
|
+
const componentClassName = getClassName({
|
|
11
|
+
baseClassName: defaultClassName,
|
|
12
|
+
modifiers: classModifier?.split(" "),
|
|
13
|
+
className,
|
|
14
|
+
});
|
|
11
15
|
return (_jsx("summary", { className: componentClassName, id: id, children: variant === "light" ? (_jsxs(Title, { heading: "h3", children: [_jsx(Svg, { src: arrow, className: "af-accordion__item-header-icon" }), children, actions
|
|
12
16
|
? actions
|
|
13
17
|
.filter((action) => Boolean(action))
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/distributeur/Action/Action.css";
|
|
2
2
|
export declare const Action: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>, "ref"> & {
|
|
3
3
|
icon: string;
|
|
4
|
+
/** @deprecated Use `className` instead. */
|
|
4
5
|
classModifier?: string;
|
|
5
6
|
} & import("react").RefAttributes<HTMLAnchorElement>>;
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Action/Action.css";
|
|
3
|
+
import classNames from "classnames";
|
|
3
4
|
import { forwardRef } from "react";
|
|
4
|
-
import {
|
|
5
|
+
import { getClassName } from "../utilities/helpers/getClassName";
|
|
5
6
|
export const Action = forwardRef(({ icon, className, classModifier, ...otherProps }, ref) => {
|
|
6
|
-
const componentClassName =
|
|
7
|
+
const componentClassName = classNames("btn", getClassName({
|
|
8
|
+
baseClassName: "af-btn--circle",
|
|
9
|
+
modifiers: classModifier?.split(" "),
|
|
10
|
+
className,
|
|
11
|
+
}));
|
|
7
12
|
return (_jsx("a", { ...otherProps, className: componentClassName, ref: ref, children: _jsx("i", { role: "img", className: `glyphicon glyphicon-${icon}` }) }));
|
|
8
13
|
});
|
|
9
14
|
Action.displayName = "Action";
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Form/Checkbox/Checkbox.css";
|
|
3
3
|
declare const CheckboxItem: import("react").ForwardRefExoticComponent<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "ref">, "type"> & {
|
|
4
|
+
/** @deprecated Use `className` instead. */
|
|
4
5
|
classModifier?: string;
|
|
5
6
|
optionClassName?: string;
|
|
6
7
|
children?: ReactNode;
|
|
7
8
|
label?: ReactNode;
|
|
8
9
|
isChecked?: boolean;
|
|
10
|
+
variant?: "error" | "warning";
|
|
9
11
|
} & import("react").RefAttributes<HTMLInputElement>>;
|
|
10
12
|
export { CheckboxItem };
|
|
@@ -4,11 +4,11 @@ import { forwardRef, useId, } from "react";
|
|
|
4
4
|
import { getOptionClassName } from "../core";
|
|
5
5
|
import "@axa-fr/canopee-css/distributeur/Form/Checkbox/Checkbox.css";
|
|
6
6
|
import { Svg } from "../../Svg";
|
|
7
|
-
const CheckboxItem = forwardRef(({ disabled = false, value = "", id, children, label, isChecked, className, classModifier, ...otherProps }, inputRef) => {
|
|
7
|
+
const CheckboxItem = forwardRef(({ disabled = false, value = "", id, children, label, isChecked, className, classModifier, variant, ...otherProps }, inputRef) => {
|
|
8
8
|
const newLabel = children || label;
|
|
9
9
|
const generatedId = useId();
|
|
10
10
|
const newId = id ?? generatedId; // id is required on this component
|
|
11
|
-
const optionClassName = getOptionClassName(className ?? "", classModifier ?? "", "af-form__checkbox", disabled);
|
|
11
|
+
const optionClassName = getOptionClassName(className ?? "", classModifier ?? "", "af-form__checkbox", disabled, variant);
|
|
12
12
|
return (_jsxs("div", { className: optionClassName, children: [_jsx("input", { ...otherProps, className: "af-form__input-checkbox", value: value, id: newId, disabled: disabled, checked: isChecked, type: "checkbox", ref: inputRef }), _jsxs("label", { className: "af-form__label", htmlFor: newId, children: [_jsx("span", { className: "af-form__indicator", children: _jsx(Svg, { role: "presentation", className: "ok-icon", src: check }) }), _jsx("span", { className: "af-form__description", children: newLabel })] })] }));
|
|
13
13
|
});
|
|
14
14
|
CheckboxItem.displayName = "CheckboxItem";
|
|
@@ -8,6 +8,7 @@ type Props = Omit<ComponentProps<typeof Radio>, "options" | "value"> & {
|
|
|
8
8
|
value: boolean;
|
|
9
9
|
}>;
|
|
10
10
|
value?: boolean | string;
|
|
11
|
+
/** @deprecated Use `className` instead. */
|
|
11
12
|
classModifier?: string;
|
|
12
13
|
};
|
|
13
14
|
declare const Choice: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/distributeur/Form/Date/Date.css";
|
|
2
2
|
import { type ComponentPropsWithRef } from "react";
|
|
3
3
|
type Props = Omit<ComponentPropsWithRef<"input">, "value"> & {
|
|
4
|
+
/** @deprecated Use `className` and the native `disabled`/`required` props instead. */
|
|
4
5
|
classModifier?: string;
|
|
5
6
|
defaultValue?: Date | string;
|
|
6
7
|
value?: Date | string;
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Form/Date/Date.css";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
|
-
import { getComponentClassName } from "../../utilities";
|
|
5
4
|
import { formatDateInputValue } from "../../utilities/helpers/date";
|
|
5
|
+
import { getClassName } from "../../utilities/helpers/getClassName";
|
|
6
6
|
const Date = forwardRef(({ className, classModifier, defaultValue, value, ...otherProps }, ref) => {
|
|
7
|
-
const componentClassName =
|
|
7
|
+
const componentClassName = getClassName({
|
|
8
|
+
baseClassName: "af-form__input-date",
|
|
9
|
+
modifiers: classModifier?.split(" "),
|
|
10
|
+
className,
|
|
11
|
+
});
|
|
8
12
|
return (_jsx("input", { className: componentClassName, type: "date", defaultValue: formatDateInputValue(defaultValue), value: formatDateInputValue(value), ref: ref, disabled: classModifier?.includes("disabled"), required: classModifier?.includes("required"), ...otherProps }));
|
|
9
13
|
});
|
|
10
14
|
Date.displayName = "Date";
|
|
@@ -2,6 +2,7 @@ import { type DropzoneInputProps, type DropzoneOptions, type FileRejection } fro
|
|
|
2
2
|
import type { FileActions } from "./constants";
|
|
3
3
|
type Dropzone = DropzoneInputProps & DropzoneOptions;
|
|
4
4
|
type Props = Omit<Dropzone, "onDrop" | "onChange"> & {
|
|
5
|
+
/** @deprecated Use `className` instead. */
|
|
5
6
|
classModifier?: string;
|
|
6
7
|
label?: string;
|
|
7
8
|
icon?: string;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useId } from "react";
|
|
3
3
|
import { useDropzone, } from "react-dropzone";
|
|
4
4
|
import { Button } from "../../Button/Button";
|
|
5
|
-
import {
|
|
5
|
+
import { getClassName } from "../../utilities/helpers/getClassName";
|
|
6
6
|
const File = ({ className, classModifier, id, name, disabled, onChange, multiple = true, maxSize = 20000000, minSize = 0, accept, readOnly, placeholder = "Glissez/déposez vos fichiers", label = "Parcourir", icon = "open", ...otherProps }) => {
|
|
7
7
|
const valueId = useId();
|
|
8
8
|
const errorsId = useId();
|
|
@@ -54,7 +54,11 @@ const File = ({ className, classModifier, id, name, disabled, onChange, multiple
|
|
|
54
54
|
accept,
|
|
55
55
|
disabled,
|
|
56
56
|
});
|
|
57
|
-
const componentClassName =
|
|
57
|
+
const componentClassName = getClassName({
|
|
58
|
+
baseClassName: "af-form__file-input",
|
|
59
|
+
modifiers: classModifier?.split(" "),
|
|
60
|
+
className,
|
|
61
|
+
});
|
|
58
62
|
return (_jsxs("div", { className: componentClassName, children: [_jsxs("div", { ...getRootProps({ className: "drop-box" }), children: [_jsx("input", { ...getInputProps({ id, name, readOnly, ...otherProps }) }), _jsx("div", { children: placeholder })] }), _jsx(Button, { className: "af-btn--file", leftIcon: _jsx("i", { className: `glyphicon glyphicon-${icon}` }), onClick: open, disabled: disabled, children: label })] }));
|
|
59
63
|
};
|
|
60
64
|
export { File };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/distributeur/Form/Text/Text.css";
|
|
2
2
|
import { type ComponentPropsWithRef } from "react";
|
|
3
3
|
type Props = Omit<ComponentPropsWithRef<"input">, "type"> & {
|
|
4
|
+
/** @deprecated Use `className` and the native `required` prop instead. */
|
|
4
5
|
classModifier?: string;
|
|
5
6
|
};
|
|
6
7
|
declare const Number: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Form/Text/Text.css";
|
|
3
3
|
import { forwardRef, useId } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { getClassName } from "../../utilities/helpers/getClassName";
|
|
5
5
|
const Number = forwardRef(({ id, className, classModifier, required, ...otherProps }, inputRef) => {
|
|
6
6
|
const inputUseId = useId();
|
|
7
7
|
const inputId = id ?? inputUseId;
|
|
8
|
-
const componentClassName =
|
|
8
|
+
const componentClassName = getClassName({
|
|
9
|
+
baseClassName: "af-form__input-text",
|
|
10
|
+
modifiers: classModifier?.split(" "),
|
|
11
|
+
className,
|
|
12
|
+
});
|
|
9
13
|
return (_jsx("input", { className: componentClassName, id: inputId, type: "number", ref: inputRef, required: required || classModifier?.includes("required"), ...otherProps }));
|
|
10
14
|
});
|
|
11
15
|
Number.displayName = "Number";
|
|
@@ -5,5 +5,8 @@ type Props = Omit<ComponentPropsWithRef<"input">, "type" | "role"> & {
|
|
|
5
5
|
classModifier?: string;
|
|
6
6
|
onToggleType: () => void;
|
|
7
7
|
};
|
|
8
|
+
/**
|
|
9
|
+
* @deprecated The Pass component is deprecated and will be removed in a future release
|
|
10
|
+
*/
|
|
8
11
|
declare const Pass: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
9
12
|
export { Pass };
|
|
@@ -2,6 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
3
|
import { getComponentClassName } from "../../utilities";
|
|
4
4
|
import "@axa-fr/canopee-css/distributeur/Form/Pass/Pass.css";
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated The Pass component is deprecated and will be removed in a future release
|
|
7
|
+
*/
|
|
5
8
|
const Pass = forwardRef(({ onToggleType, type = "password", className, classModifier, ...inputProps }, inputRef) => {
|
|
6
9
|
const componentClassName = getComponentClassName(className, classModifier, "af-form__pass");
|
|
7
10
|
return (_jsxs("div", { className: componentClassName, children: [_jsx("div", { className: "af-form__pass-strength" }), _jsx("input", { ...inputProps, role: type === "password" ? "password" : "textbox", className: "af-form__input-text", type: type, ref: inputRef, required: classModifier?.includes("required") }), _jsx("button", { className: "af-form__pass-btn", type: "button", "aria-label": "show password", onClick: onToggleType, children: _jsx("i", { className: `glyphicon glyphicon-eye${type === "text" ? "-close" : "-open"}` }) })] }));
|
|
@@ -6,5 +6,8 @@ type Props = Omit<ConsumerFieldProps & PassProps & {
|
|
|
6
6
|
helpMessage?: ReactNode;
|
|
7
7
|
score?: string;
|
|
8
8
|
}, "onToggleType" | "type">;
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated The PassInput component is deprecated and will be removed in a future release
|
|
11
|
+
*/
|
|
9
12
|
declare const PassInput: ({ children, score, classModifier, disabled, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
13
|
export { PassInput };
|
|
@@ -23,6 +23,9 @@ const calculateStrength = (score) => {
|
|
|
23
23
|
}
|
|
24
24
|
return strengthList[strength];
|
|
25
25
|
};
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated The PassInput component is deprecated and will be removed in a future release
|
|
28
|
+
*/
|
|
26
29
|
const PassInput = ({ children, score, classModifier, disabled, ...props }) => {
|
|
27
30
|
const strength = calculateStrength(score);
|
|
28
31
|
const [type, setType] = useState("password");
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/distributeur/Form/Radio/Radio.css";
|
|
2
2
|
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
3
3
|
type Props = Omit<ComponentPropsWithRef<"input">, "checked" | "type"> & {
|
|
4
|
+
/** @deprecated Use `className` instead. */
|
|
4
5
|
classModifier?: string;
|
|
5
6
|
optionClassName?: string;
|
|
6
7
|
label?: ReactNode;
|
|
@@ -19,6 +19,7 @@ declare const SelectBase: import("react").ForwardRefExoticComponent<Omit<import(
|
|
|
19
19
|
* It allows you to use the `optgroup` tag for example.
|
|
20
20
|
*/
|
|
21
21
|
options?: OptionHTMLAttributes<HTMLOptionElement>[];
|
|
22
|
+
/** @deprecated Use `className` and the native `required` prop instead. */
|
|
22
23
|
classModifier?: string;
|
|
23
24
|
} & import("react").RefAttributes<HTMLSelectElement>>;
|
|
24
25
|
export { SelectBase };
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Form/Select/Select.css";
|
|
3
3
|
import { forwardRef, } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { getClassName } from "../../utilities/helpers/getClassName";
|
|
5
5
|
/**
|
|
6
6
|
* @deprecated Use Select instead
|
|
7
7
|
*/
|
|
8
8
|
const SelectBase = forwardRef(({ options, id, className, classModifier, required, children, ...otherProps }, inputRef) => {
|
|
9
|
-
const componentClassName =
|
|
9
|
+
const componentClassName = getClassName({
|
|
10
|
+
baseClassName: "af-form__input-select",
|
|
11
|
+
modifiers: classModifier?.split(" "),
|
|
12
|
+
className,
|
|
13
|
+
});
|
|
10
14
|
return (_jsxs("div", { className: "af-form__select-container", children: [_jsx("select", { ...otherProps, id: id, className: componentClassName, ref: inputRef, required: classModifier?.includes("required") || required, children: children ??
|
|
11
15
|
options?.map(({ label, ...opt }) => (_jsx("option", { ...opt, children: label }, opt.value?.toString()))) }), _jsx("span", { "aria-controls": id, className: "glyphicon glyphicon-menu-down" })] }));
|
|
12
16
|
});
|
|
@@ -2,6 +2,7 @@ import RcSlider from "rc-slider";
|
|
|
2
2
|
import { type ComponentProps, type ReactNode } from "react";
|
|
3
3
|
type RcSliderProps = ComponentProps<typeof RcSlider>;
|
|
4
4
|
type Props = Omit<RcSliderProps, "marks" | "onChange" | "onChangeComplete"> & {
|
|
5
|
+
/** @deprecated Use `className` instead. */
|
|
5
6
|
classModifier?: string;
|
|
6
7
|
options: {
|
|
7
8
|
value: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import RcSlider from "rc-slider";
|
|
3
3
|
import { useCallback, useMemo, } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { getClassName } from "../../utilities/helpers/getClassName";
|
|
5
5
|
/**
|
|
6
6
|
* @deprecated Slider is deprecated and will be removed in a future major release.
|
|
7
7
|
*/
|
|
@@ -21,7 +21,11 @@ const Slider = ({ options, value, defaultValue, className, classModifier, ...oth
|
|
|
21
21
|
newMarks[index] = optLabel || optValue;
|
|
22
22
|
return newMarks;
|
|
23
23
|
}, {}), [options]);
|
|
24
|
-
const componentClassName = useMemo(() =>
|
|
24
|
+
const componentClassName = useMemo(() => getClassName({
|
|
25
|
+
baseClassName: "af-slider",
|
|
26
|
+
modifiers: classModifier?.split(" "),
|
|
27
|
+
className,
|
|
28
|
+
}), [className, classModifier]);
|
|
25
29
|
const formatOnChange = useCallback((newValueIndex, onChange) => {
|
|
26
30
|
if (onChange && !Array.isArray(newValueIndex)) {
|
|
27
31
|
onChange({
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/distributeur/Form/Text/Text.css";
|
|
2
2
|
import { type ComponentPropsWithRef } from "react";
|
|
3
3
|
type Props = ComponentPropsWithRef<"input"> & {
|
|
4
|
+
/** @deprecated Use `className` and the native `required` prop instead. */
|
|
4
5
|
classModifier?: string;
|
|
5
6
|
};
|
|
6
7
|
declare const Text: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Form/Text/Text.css";
|
|
3
3
|
import { forwardRef } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { getClassName } from "../../utilities/helpers/getClassName";
|
|
5
5
|
const Text = forwardRef(({ className, classModifier, required, ...otherProps }, inputRef) => {
|
|
6
|
-
const componentClassName =
|
|
6
|
+
const componentClassName = getClassName({
|
|
7
|
+
baseClassName: "af-form__input-text",
|
|
8
|
+
modifiers: classModifier?.split(" "),
|
|
9
|
+
className,
|
|
10
|
+
});
|
|
7
11
|
return (_jsx("input", { className: componentClassName, type: "text", ref: inputRef, required: required || classModifier?.includes("required"), ...otherProps }));
|
|
8
12
|
});
|
|
9
13
|
Text.displayName = "Text";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/distributeur/Form/Textarea/Textarea.css";
|
|
2
2
|
declare const Textarea: import("react").ForwardRefExoticComponent<Omit<import("react").DetailedHTMLProps<import("react").TextareaHTMLAttributes<HTMLTextAreaElement>, HTMLTextAreaElement>, "ref"> & {
|
|
3
|
+
/** @deprecated Use `className` and the native `required` prop instead. */
|
|
3
4
|
classModifier?: string;
|
|
4
5
|
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
5
6
|
export { Textarea };
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Form/Textarea/Textarea.css";
|
|
3
3
|
import { forwardRef, useId } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { getClassName } from "../../utilities/helpers/getClassName";
|
|
5
5
|
const Textarea = forwardRef(({ id, className, classModifier, ...otherProps }, inputRef) => {
|
|
6
6
|
const inputUseId = useId();
|
|
7
7
|
const inputId = id ?? inputUseId;
|
|
8
|
-
const componentClassName =
|
|
8
|
+
const componentClassName = getClassName({
|
|
9
|
+
baseClassName: "af-form__input-textarea",
|
|
10
|
+
modifiers: classModifier?.split(" "),
|
|
11
|
+
className,
|
|
12
|
+
});
|
|
9
13
|
return (_jsx("textarea", { ...otherProps, id: inputId, className: componentClassName, ref: inputRef, required: classModifier?.includes("required") }));
|
|
10
14
|
});
|
|
11
15
|
Textarea.displayName = "Textarea";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function getOptionClassName(className: string, classModifier: string, defaultClassName: string, disabled: boolean): string;
|
|
1
|
+
export declare function getOptionClassName(className: string, classModifier: string, defaultClassName: string, disabled: boolean, variant?: string): string;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export function getOptionClassName(className, classModifier, defaultClassName, disabled) {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { getClassName } from "../../utilities/helpers/getClassName";
|
|
2
|
+
export function getOptionClassName(className, classModifier, defaultClassName, disabled, variant) {
|
|
3
|
+
return getClassName({
|
|
4
|
+
baseClassName: defaultClassName,
|
|
5
|
+
modifiers: [
|
|
6
|
+
variant,
|
|
7
|
+
...(classModifier?.split(" ") ?? []),
|
|
8
|
+
disabled && "disabled",
|
|
9
|
+
],
|
|
10
|
+
className,
|
|
11
|
+
});
|
|
10
12
|
}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Action/Action.css";
|
|
3
|
+
import classNames from "classnames";
|
|
3
4
|
import { Popover } from "../Popover";
|
|
4
|
-
import {
|
|
5
|
+
import { getClassName } from "../utilities/helpers/getClassName";
|
|
5
6
|
export const HelpButton = ({ className, classModifier, children, mode = "click", placement = "right", helpButtonContent = _jsx("span", { className: "af-more-help", children: "i" }), }) => {
|
|
6
|
-
const buttonClassName =
|
|
7
|
+
const buttonClassName = classNames("btn", getClassName({
|
|
8
|
+
baseClassName: "af-btn--circle",
|
|
9
|
+
modifiers: classModifier?.split(" "),
|
|
10
|
+
}));
|
|
7
11
|
return (_jsx(Popover, { className: className, classModifier: classModifier, placement: placement, mode: mode, popoverElement: children, children: _jsx("div", { className: buttonClassName, children: helpButtonContent }) }));
|
|
8
12
|
};
|
|
@@ -2,10 +2,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Layout/Header/Header.css";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import {} from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { getClassName } from "../../utilities/helpers/getClassName";
|
|
6
6
|
const defaultClassName = "af-header";
|
|
7
7
|
const Header = ({ classModifier, className, children }) => {
|
|
8
|
-
const componentClassName =
|
|
8
|
+
const componentClassName = getClassName({
|
|
9
|
+
baseClassName: defaultClassName,
|
|
10
|
+
modifiers: classModifier?.split(" "),
|
|
11
|
+
className,
|
|
12
|
+
});
|
|
9
13
|
return (_jsx("div", { className: classNames("af-container", componentClassName), children: _jsx("header", { className: `${defaultClassName}__content`, role: "banner", children: children }) }));
|
|
10
14
|
};
|
|
11
15
|
export { Header };
|
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import infoIcon from "@material-symbols/svg-400/outlined/info-fill.svg";
|
|
3
3
|
import { Fragment } from "react";
|
|
4
|
-
import { getComponentClassName } from "../../../utilities";
|
|
5
4
|
import { generateId } from "../../../utilities/helpers/generateId";
|
|
5
|
+
import { getClassName } from "../../../utilities/helpers/getClassName";
|
|
6
6
|
import "@axa-fr/canopee-css/distributeur/Layout/Header/Infos/Infos.css";
|
|
7
7
|
import { Svg } from "../../../Svg";
|
|
8
8
|
const defaultClassName = "af-contrat";
|
|
9
9
|
const Infos = ({ infos, className, classModifier }) => {
|
|
10
|
-
const componentClassName =
|
|
10
|
+
const componentClassName = getClassName({
|
|
11
|
+
baseClassName: defaultClassName,
|
|
12
|
+
modifiers: classModifier?.split(" "),
|
|
13
|
+
className,
|
|
14
|
+
});
|
|
11
15
|
return (_jsxs("div", { className: componentClassName, children: [_jsx(Svg, { className: "af-contrat__icon", src: infoIcon, "aria-hidden": "true" }), _jsx("dl", { className: `${defaultClassName}__list`, children: infos.map((info) => {
|
|
12
16
|
const idTerm = info.id ?? `info-${generateId(info)}`;
|
|
13
17
|
return (_jsxs(Fragment, { children: [_jsx("dt", { id: idTerm, className: `${defaultClassName}__word`, children: info.word }), _jsx("dd", { className: `${defaultClassName}__def`, "aria-labelledby": idTerm, children: info.definition })] }, idTerm));
|
|
@@ -2,10 +2,14 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Layout/Header/Logo/Logo.css";
|
|
3
3
|
import "@axa-fr/canopee-css/distributeur/Layout/Header/Name/Name.css";
|
|
4
4
|
import {} from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { getClassName } from "../../../utilities/helpers/getClassName";
|
|
6
6
|
const defaultClassName = "af-header__name";
|
|
7
7
|
const Name = ({ alt = "logo", classModifier, className, img, onClick, subtitle, title, }) => {
|
|
8
|
-
const componentClassName =
|
|
8
|
+
const componentClassName = getClassName({
|
|
9
|
+
baseClassName: defaultClassName,
|
|
10
|
+
modifiers: classModifier?.split(" "),
|
|
11
|
+
className,
|
|
12
|
+
});
|
|
9
13
|
return (_jsxs("div", { className: componentClassName, children: [_jsx("a", { className: "af-logo", href: "/", onClick: (event) => onClick && onClick({ event }), children: _jsx("img", { className: "af-logo__brand", src: img, alt: alt }) }), _jsxs("h2", { className: "af-header__title", children: [title, _jsx("span", { className: "af-header__subtitle", children: subtitle })] })] }));
|
|
10
14
|
};
|
|
11
15
|
export { Name };
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import classNames from "classnames";
|
|
3
|
-
import {
|
|
3
|
+
import { getClassName } from "../../../utilities/helpers/getClassName";
|
|
4
4
|
const defaultClassName = "af-nav-container";
|
|
5
5
|
const NavBarBase = ({ isVisible = true, onClick, id = "mainmenu", toggleMenuId = "togglemenu", isMenuFocused, className, classModifier, handleKeys, onFocus, onBlur, children, }) => {
|
|
6
|
-
const componentClassName =
|
|
6
|
+
const componentClassName = getClassName({
|
|
7
|
+
baseClassName: defaultClassName,
|
|
8
|
+
modifiers: classModifier?.split(" "),
|
|
9
|
+
className,
|
|
10
|
+
});
|
|
7
11
|
return (_jsxs("div", { className: classNames("af-container", componentClassName), children: [_jsx("button", { "aria-controls": id, "aria-haspopup": "true", type: "button", onClick: onClick, className: `mask fade ${isVisible ? "show" : ""}`, id: `open-${toggleMenuId}`, "aria-label": "Open Menu" }), _jsxs("nav", { className: `af-nav af-drawer left ${isVisible ? "show" : ""}`, role: "navigation", "aria-label": "Menu principal", children: [_jsxs("div", { className: "af-nav__aside-header", children: [_jsx("h4", { className: "af-nav__aside-title", children: "Menu" }), _jsx("button", { "aria-controls": id, "aria-haspopup": "true", onClick: onClick, type: "button", className: "af-nav__aside-close", id: `close-${toggleMenuId}`, "aria-label": "Close Menu", children: "\u00D7" })] }), _jsx("ul", { onKeyDown: (e) => {
|
|
8
12
|
e.preventDefault();
|
|
9
13
|
handleKeys(e.key);
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Layout/Header/User/User.css";
|
|
3
|
-
import {
|
|
3
|
+
import { getClassName } from "../../../utilities/helpers/getClassName";
|
|
4
4
|
import { InnerUser } from "./InnerUser";
|
|
5
5
|
const defaultClassName = "af-info-user";
|
|
6
6
|
const User = ({ children, classModifier, className, href, name, path, profile, onClick, title = "Voir mon profil", }) => {
|
|
7
|
-
const componentClassName =
|
|
7
|
+
const componentClassName = getClassName({
|
|
8
|
+
baseClassName: defaultClassName,
|
|
9
|
+
modifiers: classModifier?.split(" "),
|
|
10
|
+
className,
|
|
11
|
+
});
|
|
8
12
|
return (_jsxs("div", { className: componentClassName, children: [href ? (_jsx("a", { "aria-label": "user info link", className: `${defaultClassName}__link`, href: href, title: title, onClick: (event) => onClick && onClick({ path, event }), children: _jsx(InnerUser, { name: name, profile: profile }) })) : (_jsx(InnerUser, { name: name, profile: profile })), children] }));
|
|
9
13
|
};
|
|
10
14
|
export { User };
|
|
@@ -6,6 +6,7 @@ type LoaderProps = {
|
|
|
6
6
|
mode: LoaderMode;
|
|
7
7
|
text?: string;
|
|
8
8
|
children: ReactNode;
|
|
9
|
+
/** @deprecated Use `className` instead. */
|
|
9
10
|
classModifier?: string;
|
|
10
11
|
};
|
|
11
12
|
export declare const Loader: ({ className, text, children, classModifier, mode, }: LoaderProps) => import("react/jsx-runtime").JSX.Element;
|