@axa-fr/canopee-react 2.0.0-alpha.7 → 2.0.0-alpha.71
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 +17 -16
- package/dist/client.js +17 -16
- package/dist/distributeur/ButtonMultiActions/ButtonMultiActions.d.ts +10 -0
- package/dist/distributeur/ButtonMultiActions/ButtonMultiActions.js +51 -0
- package/dist/distributeur/ButtonMultiActions/index.d.ts +2 -0
- package/dist/distributeur/ButtonMultiActions/index.js +1 -0
- package/dist/distributeur/Card/BaseCard.d.ts +14 -0
- package/dist/distributeur/Card/BaseCard.js +23 -0
- package/dist/distributeur/CardButton/CardButton.d.ts +18 -0
- package/dist/distributeur/CardButton/CardButton.js +12 -0
- package/dist/distributeur/Form/Experimental/InputContainer.d.ts +4 -1
- package/dist/distributeur/Form/Experimental/InputContainer.js +2 -2
- package/dist/distributeur/Form/Experimental/InputUnit.d.ts +1 -1
- package/dist/distributeur/Form/Experimental/InputUnit.js +1 -1
- package/dist/distributeur/Form/Experimental/ItemMessage.d.ts +1 -1
- package/dist/distributeur/Form/Experimental/ItemMessage.js +1 -1
- package/dist/distributeur/Form/Experimental/Label.d.ts +1 -2
- package/dist/distributeur/Form/Experimental/Legend.d.ts +12 -0
- package/dist/distributeur/Form/Experimental/Legend.js +3 -0
- package/dist/distributeur/Form/Experimental/Radio/AddRadioCard.d.ts +7 -0
- package/dist/distributeur/Form/Experimental/Radio/AddRadioCard.js +14 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioButton.d.ts +13 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioButton.js +3 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioCard.d.ts +10 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioCard.js +13 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioGroup.d.ts +8 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioGroup.js +10 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioInput.d.ts +18 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioInput.js +34 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioItem.d.ts +4 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioItem.js +10 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioText.d.ts +6 -0
- package/dist/distributeur/Form/Experimental/Radio/RadioText.js +3 -0
- package/dist/distributeur/Form/Experimental/Radio/_radioInputOptions.d.ts +8 -0
- package/dist/distributeur/Form/Experimental/Radio/_radioInputOptions.js +7 -0
- package/dist/distributeur/Form/Experimental/index.d.ts +6 -0
- package/dist/distributeur/Form/Experimental/index.js +6 -0
- package/dist/distributeur/Form/Experimental/types.d.ts +1 -1
- package/dist/distributeur/Form/Experimental/useInput.hook.js +1 -1
- package/dist/distributeur/Title/Title.js +1 -1
- package/dist/distributeur-experimental.d.ts +2 -0
- package/dist/distributeur-experimental.js +2 -0
- package/dist/distributeur.d.ts +3 -0
- package/dist/distributeur.js +3 -0
- package/dist/prospect-client/AccordionCore/AccordionCoreCommon.d.ts +3 -5
- package/dist/prospect-client/AccordionCore/AccordionCoreCommon.js +10 -4
- package/dist/prospect-client/AppName/AppName.d.ts +44 -0
- package/dist/prospect-client/AppName/AppName.js +23 -0
- package/dist/prospect-client/Card/CardApollo.d.ts +1 -1
- package/dist/prospect-client/Card/CardApollo.js +1 -1
- package/dist/prospect-client/Card/CardCommon.d.ts +30 -2
- package/dist/prospect-client/Card/CardCommon.js +18 -1
- package/dist/prospect-client/Card/CardLF.d.ts +1 -1
- package/dist/prospect-client/Card/CardLF.js +1 -1
- package/dist/prospect-client/CardMessage/CardMessageCommon.js +6 -4
- package/dist/prospect-client/ContentItemDuoAction/ContentItemDuoActionCommon.d.ts +2 -2
- package/dist/prospect-client/ContentItemDuoAction/ContentItemDuoActionCommon.js +5 -2
- package/dist/prospect-client/ContentItemMono/ContentItemMonoCommon.d.ts +0 -4
- package/dist/prospect-client/ContentItemMono/ContentItemMonoCommon.js +2 -3
- package/dist/prospect-client/DataAgent/DataAgentCommon.js +2 -2
- package/dist/prospect-client/Divider/DividerCommon.js +6 -2
- package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxApollo.d.ts +1 -0
- package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxCommon.d.ts +1 -17
- package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxCommon.js +4 -4
- package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxLF.d.ts +1 -0
- package/dist/prospect-client/Form/Checkbox/Checkbox/CheckboxCommon.d.ts +2 -6
- package/dist/prospect-client/Form/Checkbox/Checkbox/CheckboxCommon.js +6 -2
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextCommon.d.ts +1 -5
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextCommon.js +3 -3
- package/dist/prospect-client/Form/Dropdown/DropdownCommon.d.ts +2 -10
- package/dist/prospect-client/Form/Dropdown/DropdownCommon.js +3 -3
- package/dist/prospect-client/Form/InputDate/InputDateCommon.d.ts +2 -10
- package/dist/prospect-client/Form/InputDate/InputDateCommon.js +4 -5
- package/dist/prospect-client/Form/InputPhone/InputPhoneCommon.d.ts +2 -10
- package/dist/prospect-client/Form/InputPhone/InputPhoneCommon.js +9 -5
- package/dist/prospect-client/Form/InputText/InputTextCommon.d.ts +3 -11
- package/dist/prospect-client/Form/InputText/InputTextCommon.js +6 -5
- package/dist/prospect-client/Form/ItemLabel/ItemLabelCommon.d.ts +2 -22
- package/dist/prospect-client/Form/ItemLabel/ItemLabelCommon.js +4 -5
- package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectApollo.d.ts +7 -0
- package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectApollo.js +6 -0
- package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectCommon.d.ts +8 -0
- package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectCommon.js +9 -0
- package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectLF.d.ts +7 -0
- package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectLF.js +6 -0
- package/dist/prospect-client/Form/MultiSelectList/MultiSelectListApollo.d.ts +4 -0
- package/dist/prospect-client/Form/MultiSelectList/MultiSelectListApollo.js +5 -0
- package/dist/prospect-client/Form/MultiSelectList/MultiSelectListCommon.d.ts +11 -0
- package/dist/prospect-client/Form/MultiSelectList/MultiSelectListCommon.js +2 -0
- package/dist/prospect-client/Form/MultiSelectList/MultiSelectListLF.d.ts +4 -0
- package/dist/prospect-client/Form/MultiSelectList/MultiSelectListLF.js +5 -0
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioCommon.d.ts +1 -5
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioCommon.js +4 -4
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupCommon.d.ts +3 -27
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupCommon.js +4 -6
- package/dist/prospect-client/Form/Radio/Radio/RadioCommon.d.ts +2 -5
- package/dist/prospect-client/Form/Radio/Radio/RadioCommon.js +6 -4
- package/dist/prospect-client/Form/TextArea/TextAreaCommon.d.ts +2 -6
- package/dist/prospect-client/Form/TextArea/TextAreaCommon.js +3 -3
- package/dist/prospect-client/Header/HeaderApollo.d.ts +4 -0
- package/dist/prospect-client/Header/HeaderApollo.js +8 -0
- package/dist/prospect-client/Header/HeaderCommon.d.ts +22 -0
- package/dist/prospect-client/Header/HeaderCommon.js +37 -0
- package/dist/prospect-client/Header/HeaderLF.d.ts +4 -0
- package/dist/prospect-client/Header/HeaderLF.js +8 -0
- package/dist/prospect-client/Icon/IconCommon.d.ts +1 -1
- package/dist/prospect-client/Icon/IconCommon.js +8 -9
- package/dist/prospect-client/ItemTabBar/ItemTabBarCommon.js +5 -2
- package/dist/prospect-client/Layout/ExitLayout/ExitLayoutApollo.d.ts +12 -0
- package/dist/prospect-client/Layout/ExitLayout/ExitLayoutApollo.js +12 -0
- package/dist/prospect-client/Layout/ExitLayout/ExitLayoutLF.d.ts +12 -0
- package/dist/prospect-client/Layout/ExitLayout/ExitLayoutLF.js +12 -0
- package/dist/prospect-client/Layout/ExitLayout/ExitLayoutSkeleton.d.ts +23 -0
- package/dist/prospect-client/Layout/ExitLayout/ExitLayoutSkeleton.js +17 -0
- package/dist/prospect-client/Link/LinkCommon.d.ts +1 -5
- package/dist/prospect-client/Link/LinkCommon.js +2 -2
- package/dist/prospect-client/List/ClickItem/ClickItemCommon.d.ts +1 -0
- package/dist/prospect-client/List/ContentItemDuo/ContentItemDuoCommon.d.ts +1 -5
- package/dist/prospect-client/List/ContentItemDuo/ContentItemDuoCommon.js +3 -7
- package/dist/prospect-client/List/List/ListCommon.d.ts +27 -2
- package/dist/prospect-client/List/List/ListCommon.js +12 -0
- package/dist/prospect-client/MenuBurger/MenuBurgerApollo.d.ts +4 -0
- package/dist/prospect-client/MenuBurger/MenuBurgerApollo.js +8 -0
- package/dist/prospect-client/MenuBurger/MenuBurgerCommon.d.ts +60 -0
- package/dist/prospect-client/MenuBurger/MenuBurgerCommon.js +34 -0
- package/dist/prospect-client/MenuBurger/MenuBurgerLF.d.ts +4 -0
- package/dist/prospect-client/MenuBurger/MenuBurgerLF.js +8 -0
- package/dist/prospect-client/MessageBar/MessageBarAction.d.ts +8 -0
- package/dist/prospect-client/MessageBar/MessageBarAction.js +11 -0
- package/dist/prospect-client/MessageBar/MessageBarApollo.d.ts +5 -0
- package/dist/prospect-client/MessageBar/MessageBarApollo.js +7 -0
- package/dist/prospect-client/MessageBar/MessageBarCommon.d.ts +26 -0
- package/dist/prospect-client/MessageBar/MessageBarCommon.js +33 -0
- package/dist/prospect-client/MessageBar/MessageBarDescription.d.ts +6 -0
- package/dist/prospect-client/MessageBar/MessageBarDescription.js +8 -0
- package/dist/prospect-client/MessageBar/MessageBarLF.d.ts +5 -0
- package/dist/prospect-client/MessageBar/MessageBarLF.js +7 -0
- package/dist/prospect-client/MessageBar/MessageBarSummary.d.ts +11 -0
- package/dist/prospect-client/MessageBar/MessageBarSummary.js +2 -0
- package/dist/prospect-client/MessageBar/types.d.ts +1 -0
- package/dist/prospect-client/MessageBar/types.js +1 -0
- package/dist/prospect-client/Modal/ModalApollo.d.ts +1 -1
- package/dist/prospect-client/Modal/ModalApollo.js +1 -3
- package/dist/prospect-client/Modal/ModalCommon.d.ts +1 -1
- package/dist/prospect-client/Modal/ModalCommon.js +1 -1
- package/dist/prospect-client/Modal/ModalLF.d.ts +1 -1
- package/dist/prospect-client/Modal/ModalLF.js +1 -3
- package/dist/prospect-client/Modal/components/ModalCoreHeaderCommon.d.ts +0 -7
- package/dist/prospect-client/Modal/components/ModalCoreHeaderCommon.js +2 -12
- package/dist/prospect-client/Modal/types.d.ts +0 -15
- package/dist/prospect-client/ProgressBarGroup/ProgressBarGroupCommon.d.ts +1 -5
- package/dist/prospect-client/ProgressBarGroup/ProgressBarGroupCommon.js +1 -1
- package/dist/prospect-client/Skeleton/Skeleton.d.ts +61 -0
- package/dist/prospect-client/Skeleton/Skeleton.js +41 -0
- package/dist/prospect-client/SkeletonGrid/SkeletonGrid.d.ts +51 -0
- package/dist/prospect-client/SkeletonGrid/SkeletonGrid.js +37 -0
- package/dist/prospect-client/SkeletonList/SkeletonListApollo.d.ts +7 -0
- package/dist/prospect-client/SkeletonList/SkeletonListApollo.js +8 -2
- package/dist/prospect-client/SkeletonList/SkeletonListCommon.d.ts +21 -4
- package/dist/prospect-client/SkeletonList/SkeletonListCommon.js +18 -2
- package/dist/prospect-client/SkeletonList/SkeletonListLF.d.ts +7 -0
- package/dist/prospect-client/SkeletonList/SkeletonListLF.js +8 -2
- package/dist/prospect-client/Stepper/StepperApollo.js +2 -1
- package/dist/prospect-client/Stepper/StepperCommon.d.ts +11 -6
- package/dist/prospect-client/Stepper/StepperCommon.js +2 -3
- package/dist/prospect-client/Stepper/StepperLF.js +2 -1
- package/dist/prospect-client/TabMenu/TabMenu.js +1 -1
- package/dist/prospect-client/Tag/TagCommon.js +6 -2
- package/dist/prospect-client/Toggle/ToggleCommon.js +2 -2
- package/dist/prospect.d.ts +11 -6
- package/dist/prospect.js +11 -6
- package/package.json +2 -2
- package/dist/prospect-client/Skeleton/SkeletonApollo.d.ts +0 -2
- package/dist/prospect-client/Skeleton/SkeletonApollo.js +0 -2
- package/dist/prospect-client/Skeleton/SkeletonCommon.d.ts +0 -19
- package/dist/prospect-client/Skeleton/SkeletonCommon.js +0 -11
- package/dist/prospect-client/Skeleton/SkeletonLF.d.ts +0 -2
- package/dist/prospect-client/Skeleton/SkeletonLF.js +0 -2
- package/dist/prospect-client/utilities/getComponentClassName.d.ts +0 -4
- package/dist/prospect-client/utilities/getComponentClassName.js +0 -30
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { RadioInputPropsButtonVariant, RadioInputPropsCardVariant } from "./RadioInput";
|
|
2
|
+
type RadioInputOptionsProps = {
|
|
3
|
+
inputId: string;
|
|
4
|
+
isInvalid: boolean;
|
|
5
|
+
describedBy?: string;
|
|
6
|
+
} & (Pick<RadioInputPropsCardVariant, "variant" | "options" | "showAddButton" | "orientation" | "onAdd"> | Pick<RadioInputPropsButtonVariant, "variant" | "options">);
|
|
7
|
+
export declare const RadioInputOptions: ({ inputId, isInvalid, describedBy, ...props }: RadioInputOptionsProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { AddRadioCard } from "./AddRadioCard";
|
|
3
|
+
import { RadioButton } from "./RadioButton";
|
|
4
|
+
import { RadioCard } from "./RadioCard";
|
|
5
|
+
export const RadioInputOptions = ({ inputId, isInvalid, describedBy, ...props }) => (_jsxs(_Fragment, { children: [!props.variant || props.variant === "button"
|
|
6
|
+
? props.options.map((o) => (_jsx(RadioButton, { ...o }, `${inputId}-${o.value}`)))
|
|
7
|
+
: null, props.variant === "card" ? (_jsxs(_Fragment, { children: [props.options.map((o) => (_jsx(RadioCard, { id: `${inputId}-${o.value}`, ...o, "aria-invalid": isInvalid, "aria-describedby": describedBy, orientation: props.orientation || "horizontal" }, `${inputId}-${o.value}`))), props.showAddButton ? (_jsx(AddRadioCard, { orientation: props.orientation || "horizontal", onClick: props.onAdd })) : null] })) : null] }));
|
|
@@ -7,3 +7,9 @@ export { TextInput } from "./TextInput";
|
|
|
7
7
|
export type { TextInputProps } from "./TextInput";
|
|
8
8
|
export type { InputBaseProps, LabelPosition, SingleLineLabelPosition, } from "./types";
|
|
9
9
|
export { useInput } from "./useInput.hook";
|
|
10
|
+
export { RadioButton, type RadioButtonProps } from "./Radio/RadioButton";
|
|
11
|
+
export { RadioCard, type RadioCardProps } from "./Radio/RadioCard";
|
|
12
|
+
export { RadioGroup, type RadioGroupProps } from "./Radio/RadioGroup";
|
|
13
|
+
export { RadioInput, type RadioInputProps, type RadioInputPropsButtonVariant, type RadioInputPropsCardVariant, } from "./Radio/RadioInput";
|
|
14
|
+
export { RadioItem, type RadioItemProps } from "./Radio/RadioItem";
|
|
15
|
+
export { RadioText, type RadioTextProps } from "./Radio/RadioText";
|
|
@@ -5,3 +5,9 @@ export { ItemMessage } from "./ItemMessage";
|
|
|
5
5
|
export { Label } from "./Label";
|
|
6
6
|
export { TextInput } from "./TextInput";
|
|
7
7
|
export { useInput } from "./useInput.hook";
|
|
8
|
+
export { RadioButton } from "./Radio/RadioButton";
|
|
9
|
+
export { RadioCard } from "./Radio/RadioCard";
|
|
10
|
+
export { RadioGroup } from "./Radio/RadioGroup";
|
|
11
|
+
export { RadioInput, } from "./Radio/RadioInput";
|
|
12
|
+
export { RadioItem } from "./Radio/RadioItem";
|
|
13
|
+
export { RadioText } from "./Radio/RadioText";
|
|
@@ -35,7 +35,7 @@ export type InputBaseProps = {
|
|
|
35
35
|
* - `leftAbove` will place the label above the input, aligned to the left. This is used to have the label above the input.
|
|
36
36
|
* @default "centerLeft"
|
|
37
37
|
*/
|
|
38
|
-
labelPosition?:
|
|
38
|
+
labelPosition?: LabelPosition;
|
|
39
39
|
/**
|
|
40
40
|
* The help message to display below the input.
|
|
41
41
|
*/
|
|
@@ -11,7 +11,7 @@ export const useInput = (props) => {
|
|
|
11
11
|
});
|
|
12
12
|
const labelClassName = getClassName({
|
|
13
13
|
baseClassName: "af-label",
|
|
14
|
-
modifiers: [props.labelPosition === "
|
|
14
|
+
modifiers: [props.labelPosition === "topLeft" && "top-left"],
|
|
15
15
|
className: props.labelClassName,
|
|
16
16
|
});
|
|
17
17
|
const errorId = isInvalid ? `${inputId}-description` : undefined;
|
|
@@ -13,6 +13,6 @@ export const Title = ({ className, classModifier, children, heading: Heading = "
|
|
|
13
13
|
modifiers,
|
|
14
14
|
className,
|
|
15
15
|
});
|
|
16
|
-
return (_jsxs("div", { className: `${baseClass}--container`, children: [_jsxs(Heading, { className: componentClassName, ...otherProps, children: [children, contentLeft] }), contentRight ? (_jsx("div", { className:
|
|
16
|
+
return (_jsxs("div", { className: `${baseClass}--container`, children: [_jsxs(Heading, { className: componentClassName, ...otherProps, children: [children, contentLeft] }), contentRight ? (_jsx("div", { className: `${baseClass}__content-right`, children: contentRight })) : null] }));
|
|
17
17
|
};
|
|
18
18
|
Title.displayName = "Title";
|
package/dist/distributeur.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export { Footer } from "./distributeur/Layout/Footer";
|
|
|
32
32
|
export { Header, HeaderTitle, Infos, MenuTitleWrapper, Name, NavBar, NavBarBase, NavBarItem, NavBarItemBase, NavBarItemLink, ToggleButton, User, type AnchorNavBarItem, } from "./distributeur/Layout/Header";
|
|
33
33
|
export { MainContainer } from "./distributeur/Layout/MainContainer/MainContainer";
|
|
34
34
|
export { Link, type LinkProps } from "./distributeur/Link/Link";
|
|
35
|
+
export { ButtonMultiActions, type ButtonMultiActionsProps, } from "./distributeur/ButtonMultiActions";
|
|
35
36
|
export { MandatoryMention } from "./distributeur/MandatoryMention/MandatoryMention";
|
|
36
37
|
export { BooleanModal, Modal, ModalBody, ModalFooter, ModalHeader, ModalHeaderBase, } from "./distributeur/ModalAgent";
|
|
37
38
|
export { ArticleRestitution, HeaderRestitution, Restitution, RestitutionList, SectionRestitution, SectionRestitutionColumn, SectionRestitutionRow, SectionRestitutionTitle, } from "./distributeur/Restitution";
|
|
@@ -71,3 +72,5 @@ export { CardData } from "./distributeur/CardData/CardData";
|
|
|
71
72
|
export type { CardDataVariant } from "./distributeur/CardData/CardData";
|
|
72
73
|
export { EditorialMessage, type EditorialMessageProps, type EditorialMessageType, } from "./distributeur/EditorialMessage/EditorialMessage";
|
|
73
74
|
export { Timeline, type TimelineProps, type TimelineVariants, } from "./distributeur/Timeline/Timeline";
|
|
75
|
+
export { CardButton, type CardButtonProps, } from "./distributeur/CardButton/CardButton";
|
|
76
|
+
export { BaseCard, type BaseCardProps } from "./distributeur/Card/BaseCard";
|
package/dist/distributeur.js
CHANGED
|
@@ -31,6 +31,7 @@ export { Footer } from "./distributeur/Layout/Footer";
|
|
|
31
31
|
export { Header, HeaderTitle, Infos, MenuTitleWrapper, Name, NavBar, NavBarBase, NavBarItem, NavBarItemBase, NavBarItemLink, ToggleButton, User, } from "./distributeur/Layout/Header";
|
|
32
32
|
export { MainContainer } from "./distributeur/Layout/MainContainer/MainContainer";
|
|
33
33
|
export { Link } from "./distributeur/Link/Link";
|
|
34
|
+
export { ButtonMultiActions, } from "./distributeur/ButtonMultiActions";
|
|
34
35
|
export { MandatoryMention } from "./distributeur/MandatoryMention/MandatoryMention";
|
|
35
36
|
export { BooleanModal, Modal, ModalBody, ModalFooter, ModalHeader, ModalHeaderBase, } from "./distributeur/ModalAgent";
|
|
36
37
|
export { ArticleRestitution, HeaderRestitution, Restitution, RestitutionList, SectionRestitution, SectionRestitutionColumn, SectionRestitutionRow, SectionRestitutionTitle, } from "./distributeur/Restitution";
|
|
@@ -60,3 +61,5 @@ export { SquareLoader } from "./distributeur/Loader/SquareLoader";
|
|
|
60
61
|
export { CardData } from "./distributeur/CardData/CardData";
|
|
61
62
|
export { EditorialMessage, } from "./distributeur/EditorialMessage/EditorialMessage";
|
|
62
63
|
export { Timeline, } from "./distributeur/Timeline/Timeline";
|
|
64
|
+
export { CardButton, } from "./distributeur/CardButton/CardButton";
|
|
65
|
+
export { BaseCard } from "./distributeur/Card/BaseCard";
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
import { type ComponentProps, type ComponentType, type MouseEventHandler, type ReactNode } from "react";
|
|
2
|
+
import type { ClickIconVariant } from "../ClickIcon/ClickIconCommon";
|
|
2
3
|
import type { IconProps } from "../Icon/IconCommon";
|
|
3
4
|
type SummaryOnClick = MouseEventHandler<HTMLElement>;
|
|
4
5
|
export type AccordionCoreProps = {
|
|
5
6
|
summary: ReactNode;
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated use `open` instead
|
|
8
|
-
*/
|
|
9
|
-
isOpen?: boolean;
|
|
10
7
|
summaryProps?: Omit<ComponentProps<"summary">, "onClick">;
|
|
11
8
|
onClick?: SummaryOnClick;
|
|
12
9
|
showArrowAsClickIcon?: boolean;
|
|
10
|
+
arrowClickIconVariant?: ClickIconVariant;
|
|
13
11
|
arrowIconVariant?: IconProps["variant"];
|
|
14
12
|
} & ComponentProps<"details">;
|
|
15
13
|
export type AccordionPropsCommonProps = AccordionCoreProps & {
|
|
16
14
|
IconComponent: ComponentType<IconProps>;
|
|
17
15
|
};
|
|
18
|
-
export declare const AccordionCoreCommon: ({ summary, children, className, summaryProps,
|
|
16
|
+
export declare const AccordionCoreCommon: ({ summary, children, className, summaryProps, IconComponent, onClick, showArrowAsClickIcon, arrowClickIconVariant, arrowIconVariant, ...detailsProps }: AccordionPropsCommonProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
17
|
export {};
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback, } from "react";
|
|
3
2
|
import keyboardDown from "@material-symbols/svg-400/rounded/keyboard_arrow_down-fill.svg";
|
|
3
|
+
import { useCallback, } from "react";
|
|
4
4
|
import { getClassName } from "../utilities/getClassName";
|
|
5
|
-
export const AccordionCoreCommon = ({ summary, children, className, summaryProps,
|
|
5
|
+
export const AccordionCoreCommon = ({ summary, children, className, summaryProps, IconComponent, onClick, showArrowAsClickIcon = true, arrowClickIconVariant = "default", arrowIconVariant, ...detailsProps }) => {
|
|
6
6
|
const handleSummaryClick = useCallback((event) => {
|
|
7
7
|
if (onClick) {
|
|
8
8
|
event.preventDefault();
|
|
9
9
|
onClick(event);
|
|
10
10
|
}
|
|
11
11
|
}, [onClick]);
|
|
12
|
+
const arrowClassName = showArrowAsClickIcon
|
|
13
|
+
? getClassName({
|
|
14
|
+
baseClassName: "af-click-icon",
|
|
15
|
+
modifiers: [arrowClickIconVariant === "ghost" && arrowClickIconVariant],
|
|
16
|
+
})
|
|
17
|
+
: undefined;
|
|
12
18
|
return (_jsxs("details", { className: getClassName({
|
|
13
19
|
baseClassName: "af-apollo-accordion",
|
|
14
20
|
className,
|
|
15
|
-
}),
|
|
21
|
+
}), ...detailsProps, children: [_jsxs("summary", { onClick: handleSummaryClick, tabIndex: 0, ...summaryProps, className: getClassName({
|
|
16
22
|
baseClassName: "af-apollo-accordion__summary",
|
|
17
23
|
className: summaryProps?.className,
|
|
18
24
|
}), children: [summary, _jsx("div", { className: getClassName({
|
|
19
25
|
baseClassName: "af-accordion__arrow",
|
|
20
|
-
className:
|
|
26
|
+
className: arrowClassName,
|
|
21
27
|
}), children: _jsx(IconComponent, { src: keyboardDown, role: "presentation", variant: arrowIconVariant }) })] }), children] }));
|
|
22
28
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ComponentPropsWithoutRef, ElementType } from "react";
|
|
2
|
+
import "@axa-fr/canopee-css/prospect/AppName/AppNameAll.css";
|
|
3
|
+
/**
|
|
4
|
+
* Props for the AppName component.
|
|
5
|
+
*/
|
|
6
|
+
export type AppNameProps = ComponentPropsWithoutRef<"div"> & {
|
|
7
|
+
/**
|
|
8
|
+
* Application name displayed next to the AXA logo.
|
|
9
|
+
*/
|
|
10
|
+
label: string;
|
|
11
|
+
/**
|
|
12
|
+
* Alt text for the AXA logo image.
|
|
13
|
+
* @default "Logo AXA"
|
|
14
|
+
*/
|
|
15
|
+
logoAlt?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Props forwarded to the `LogoLinkComponent` (defaults to `<a>`).
|
|
18
|
+
* @example { href: "/" }
|
|
19
|
+
* @example { to: "/" } // for React Router Link
|
|
20
|
+
*/
|
|
21
|
+
logoLinkProps?: Record<string, unknown>;
|
|
22
|
+
/**
|
|
23
|
+
* Element or component used to wrap the logo.
|
|
24
|
+
* Accepts native HTML elements (`"a"`) or custom components (e.g. `Link` from React Router or the DS).
|
|
25
|
+
* `logoLinkProps` are forwarded to it.
|
|
26
|
+
* @default "a"
|
|
27
|
+
* @example "a"
|
|
28
|
+
* @example Link // from react-router-dom or the DS
|
|
29
|
+
*/
|
|
30
|
+
LogoLinkComponent?: ElementType;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* Displays the application name alongside the AXA logo.
|
|
34
|
+
* The logo can optionally be wrapped in a native anchor or a custom link component.
|
|
35
|
+
*
|
|
36
|
+
* @component
|
|
37
|
+
* @param {AppNameProps} props - AppName props.
|
|
38
|
+
* @param {string} props.label - Application name displayed next to the logo.
|
|
39
|
+
* @param {string} [props.logoAlt="Logo AXA"] - Alt text for the AXA logo image.
|
|
40
|
+
* @param {Record<string, unknown>} [props.logoLinkProps] - Props forwarded to the wrapping anchor or `LogoLinkComponent`.
|
|
41
|
+
* @param {ElementType} [props.LogoLinkComponent="a"] - Element or component used to wrap the logo. Accepts `"a"` or any custom link component (e.g. React Router `Link`).
|
|
42
|
+
* @returns {JSX.Element} The rendered AppName component.
|
|
43
|
+
*/
|
|
44
|
+
export declare const AppName: ({ label, className, logoAlt, logoLinkProps, LogoLinkComponent, ...props }: AppNameProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import logoAxa from "@axa-fr/canopee-css/logo-axa.svg";
|
|
3
|
+
import { getClassName } from "../utilities/getClassName";
|
|
4
|
+
import "@axa-fr/canopee-css/prospect/AppName/AppNameAll.css";
|
|
5
|
+
/**
|
|
6
|
+
* Displays the application name alongside the AXA logo.
|
|
7
|
+
* The logo can optionally be wrapped in a native anchor or a custom link component.
|
|
8
|
+
*
|
|
9
|
+
* @component
|
|
10
|
+
* @param {AppNameProps} props - AppName props.
|
|
11
|
+
* @param {string} props.label - Application name displayed next to the logo.
|
|
12
|
+
* @param {string} [props.logoAlt="Logo AXA"] - Alt text for the AXA logo image.
|
|
13
|
+
* @param {Record<string, unknown>} [props.logoLinkProps] - Props forwarded to the wrapping anchor or `LogoLinkComponent`.
|
|
14
|
+
* @param {ElementType} [props.LogoLinkComponent="a"] - Element or component used to wrap the logo. Accepts `"a"` or any custom link component (e.g. React Router `Link`).
|
|
15
|
+
* @returns {JSX.Element} The rendered AppName component.
|
|
16
|
+
*/
|
|
17
|
+
export const AppName = ({ label, className, logoAlt = "Logo AXA", logoLinkProps, LogoLinkComponent = "a", ...props }) => {
|
|
18
|
+
const logo = (_jsx("img", { src: logoAxa, alt: logoAlt, className: "af-app-name__logo" }));
|
|
19
|
+
return (_jsxs("div", { className: getClassName({
|
|
20
|
+
baseClassName: "af-app-name",
|
|
21
|
+
className,
|
|
22
|
+
}), ...props, children: [LogoLinkComponent ? (_jsx(LogoLinkComponent, { className: "af-app-name__logo-link", ...logoLinkProps, children: logo })) : (logo), _jsx("span", { className: "af-app-name__label", children: label })] }));
|
|
23
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/prospect/Card/CardApollo.css";
|
|
2
|
-
export { type CardCommonProps as CardProps, CardCommon as Card, } from "./CardCommon";
|
|
2
|
+
export { cardVariants, type CardVariants, type CardCommonProps as CardProps, CardCommon as Card, } from "./CardCommon";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/prospect/Card/CardApollo.css";
|
|
2
|
-
export { CardCommon as Card, } from "./CardCommon";
|
|
2
|
+
export { cardVariants, CardCommon as Card, } from "./CardCommon";
|
|
@@ -1,4 +1,32 @@
|
|
|
1
1
|
import type { ComponentProps, ElementType } from "react";
|
|
2
2
|
import { type PolymorphicComponent } from "../utilities/types/PolymorphicComponent";
|
|
3
|
-
export
|
|
4
|
-
|
|
3
|
+
export declare const cardVariants: {
|
|
4
|
+
readonly unstyled: "unstyled";
|
|
5
|
+
};
|
|
6
|
+
export type CardVariants = keyof typeof cardVariants;
|
|
7
|
+
/**
|
|
8
|
+
* Props for the Card component.
|
|
9
|
+
*
|
|
10
|
+
* @template T - The element type rendered by the card (defaults to `"div"`).
|
|
11
|
+
*/
|
|
12
|
+
export type CardCommonProps<T extends ElementType> = PolymorphicComponent<T, ComponentProps<"div"> & {
|
|
13
|
+
/**
|
|
14
|
+
* Visual variant of the card.
|
|
15
|
+
* - `"unstyled"` — removes border and padding.
|
|
16
|
+
*/
|
|
17
|
+
variant?: CardVariants;
|
|
18
|
+
}>;
|
|
19
|
+
/**
|
|
20
|
+
* Polymorphic card wrapper that adds padding and a border.
|
|
21
|
+
* The underlying HTML element can be changed via the `as` prop.
|
|
22
|
+
*
|
|
23
|
+
* @component
|
|
24
|
+
* @template T - The element type rendered by the card.
|
|
25
|
+
* @param {CardCommonProps<T>} props - Card props.
|
|
26
|
+
* @param {ElementType} [props.as="div"] - HTML element or component to render as.
|
|
27
|
+
* @param {CardVariants} [props.variant] - Visual variant of the card.
|
|
28
|
+
* @param {string} [props.className] - Additional CSS class applied to the root element.
|
|
29
|
+
* @param {ReactNode} [props.children] - Content rendered inside the card.
|
|
30
|
+
* @returns {JSX.Element} The rendered Card component.
|
|
31
|
+
*/
|
|
32
|
+
export declare const CardCommon: <T extends ElementType = "div">({ as, children, className, variant, ...props }: CardCommonProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,10 +1,27 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import {} from "../utilities/types/PolymorphicComponent";
|
|
3
3
|
import { getClassName } from "../utilities/getClassName";
|
|
4
|
-
export const
|
|
4
|
+
export const cardVariants = {
|
|
5
|
+
unstyled: "unstyled",
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Polymorphic card wrapper that adds padding and a border.
|
|
9
|
+
* The underlying HTML element can be changed via the `as` prop.
|
|
10
|
+
*
|
|
11
|
+
* @component
|
|
12
|
+
* @template T - The element type rendered by the card.
|
|
13
|
+
* @param {CardCommonProps<T>} props - Card props.
|
|
14
|
+
* @param {ElementType} [props.as="div"] - HTML element or component to render as.
|
|
15
|
+
* @param {CardVariants} [props.variant] - Visual variant of the card.
|
|
16
|
+
* @param {string} [props.className] - Additional CSS class applied to the root element.
|
|
17
|
+
* @param {ReactNode} [props.children] - Content rendered inside the card.
|
|
18
|
+
* @returns {JSX.Element} The rendered Card component.
|
|
19
|
+
*/
|
|
20
|
+
export const CardCommon = ({ as, children, className, variant, ...props }) => {
|
|
5
21
|
const Component = as || "div";
|
|
6
22
|
return (_jsx(Component, { className: getClassName({
|
|
7
23
|
baseClassName: "af-card",
|
|
24
|
+
modifiers: [variant],
|
|
8
25
|
className,
|
|
9
26
|
}), ...props, children: children }));
|
|
10
27
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/client/Card/CardLF.css";
|
|
2
|
-
export { type CardCommonProps as CardProps, CardCommon as Card, } from "./CardCommon";
|
|
2
|
+
export { cardVariants, type CardVariants, type CardCommonProps as CardProps, CardCommon as Card, } from "./CardCommon";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/client/Card/CardLF.css";
|
|
2
|
-
export { CardCommon as Card, } from "./CardCommon";
|
|
2
|
+
export { cardVariants, CardCommon as Card, } from "./CardCommon";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { getClassName } from "../utilities/getClassName";
|
|
4
4
|
export const cardMessageVariants = {
|
|
5
5
|
info: "info",
|
|
6
6
|
warning: "warning",
|
|
@@ -8,8 +8,10 @@ export const cardMessageVariants = {
|
|
|
8
8
|
neutral: "neutral",
|
|
9
9
|
};
|
|
10
10
|
export const CardMessage = ({ variant = "info", title, text, className, ...props }) => {
|
|
11
|
-
const componentClassName = useMemo(() => {
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const componentClassName = useMemo(() => getClassName({
|
|
12
|
+
baseClassName: "af-card-message",
|
|
13
|
+
modifiers: [variant],
|
|
14
|
+
className,
|
|
15
|
+
}), [className, variant]);
|
|
14
16
|
return (_jsxs("div", { ...props, className: componentClassName, children: [title ? _jsx("span", { className: "af-card-message--title", children: title }) : null, _jsx("span", { className: "af-card-message--text", children: text })] }));
|
|
15
17
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type ComponentType, type ReactElement } from "react";
|
|
2
|
-
import type { ToggleProps } from "../Toggle/ToggleCommon";
|
|
3
|
-
import type { ContentItemProps } from "../ContentItemMono/ContentItemMonoCommon";
|
|
4
2
|
import type { ButtonProps } from "../Button/ButtonCommon";
|
|
3
|
+
import type { ContentItemProps } from "../ContentItemMono/ContentItemMonoCommon";
|
|
4
|
+
import type { ToggleProps } from "../Toggle/ToggleCommon";
|
|
5
5
|
export declare const ContentItemDuoActionState: {
|
|
6
6
|
readonly edit: "edit";
|
|
7
7
|
readonly toggle: "toggle";
|
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import {} from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { getClassName } from "../utilities/getClassName";
|
|
4
4
|
export const ContentItemDuoActionState = {
|
|
5
5
|
edit: "edit",
|
|
6
6
|
toggle: "toggle",
|
|
7
7
|
};
|
|
8
8
|
export const ContentItemDuoActionCommon = ({ className, state, ContentItemMonoComponent, contentItemProps, ToggleComponent, ...props }) => {
|
|
9
|
-
const componentClassName =
|
|
9
|
+
const componentClassName = getClassName({
|
|
10
|
+
baseClassName: "af-content-item-duo-action",
|
|
11
|
+
className,
|
|
12
|
+
});
|
|
10
13
|
return (_jsxs("div", { className: componentClassName, children: [_jsx(ContentItemMonoComponent, { ...contentItemProps }), _jsx("div", { className: "af-action-container", children: state === "edit" ? (props.buttons) : (_jsx(ToggleComponent, { ...props.toggleProps })) })] }));
|
|
11
14
|
};
|
|
@@ -14,10 +14,6 @@ export type ContentMonoItemIconProps = {
|
|
|
14
14
|
title?: string;
|
|
15
15
|
subtitle1?: string;
|
|
16
16
|
subtitle2?: string;
|
|
17
|
-
/**
|
|
18
|
-
* @deprecated Use `iconProps` instead.
|
|
19
|
-
*/
|
|
20
|
-
icon?: string;
|
|
21
17
|
iconProps?: IconProps;
|
|
22
18
|
};
|
|
23
19
|
export type ContentMonoItemStickProps = {
|
|
@@ -4,13 +4,12 @@ import { Icon } from "../Icon/IconCommon";
|
|
|
4
4
|
import { ContentItemMonoCore, } from "./ContentItemMonoCore";
|
|
5
5
|
export const getContentItemCoreProps = ({ IconComponent, type, ...props }) => {
|
|
6
6
|
if (type === "icon") {
|
|
7
|
-
const {
|
|
7
|
+
const { iconProps, title, subtitle1, subtitle2 } = props;
|
|
8
8
|
return {
|
|
9
9
|
title,
|
|
10
10
|
primarySubtitle: subtitle1,
|
|
11
11
|
subtitle: subtitle2,
|
|
12
|
-
leftComponent:
|
|
13
|
-
(icon && _jsx(IconComponent, { "data-testid": "icon", src: icon })),
|
|
12
|
+
leftComponent: iconProps && (_jsx(IconComponent, { "data-testid": "icon", ...iconProps })),
|
|
14
13
|
};
|
|
15
14
|
}
|
|
16
15
|
if (type === "picture") {
|
|
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
|
|
|
2
2
|
import { Fragment, useMemo, } from "react";
|
|
3
3
|
import { Divider } from "../Divider/DividerCommon";
|
|
4
4
|
import { BREAKPOINT } from "../utilities/constants";
|
|
5
|
-
import {
|
|
5
|
+
import { getClassName } from "../utilities/getClassName";
|
|
6
6
|
import { useIsSmallScreen } from "../utilities/hook/useIsSmallScreen";
|
|
7
7
|
export const DataAgentCommon = ({ className, agentProps, agentContractProps, contents, clickContents, texteOrias, DividerComponent, ContentItemMonoComponent, ClickItemComponent, isCompact = true, variant = "default", }) => {
|
|
8
|
-
const componentClassName = useMemo(() =>
|
|
8
|
+
const componentClassName = useMemo(() => getClassName({ baseClassName: "af-data-agent", className }), [className]);
|
|
9
9
|
const isMobile = useIsSmallScreen(BREAKPOINT.SM);
|
|
10
10
|
const renderForDefaultLayout = () => (_jsxs(_Fragment, { children: [_jsxs("section", { className: "af-data-agent__intro", children: [_jsx(ContentItemMonoComponent, { ...agentProps, type: "picture" }), agentContractProps ? (_jsx(ContentItemMonoComponent, { ...agentContractProps, type: "stick" })) : null] }), _jsx(DividerComponent, {}), contents && contents?.length > 0 ? (_jsx("section", { className: "af-data-agent__info-content", children: contents.map((content) => (_jsxs(Fragment, { children: [_jsx(ContentItemMonoComponent, { ...content, type: "icon" }), _jsx(DividerComponent, { className: "af-data-agent__line" })] }, `content--${crypto.randomUUID()}`))) })) : null, clickContents && clickContents?.length > 0 ? (_jsx("section", { className: "af-data-agent__info-click-content", children: clickContents.map((clickContent) => (_jsxs(Fragment, { children: [_jsx(ClickItemComponent, { ...clickContent, variant: "small" }), _jsx(DividerComponent, { className: "af-data-agent__line" })] }, `clickContent--${crypto.randomUUID()}`))) })) : null, Boolean(texteOrias) && (_jsx("p", { className: "af-data-agent__text-orias", children: texteOrias }))] }));
|
|
11
11
|
const renderForMobileLayout = () => (_jsx("section", { className: "af-data-agent__intro", children: _jsx(ClickItemComponent, { ...agentProps, basePictureProps: {
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { getClassName } from "../utilities/getClassName";
|
|
4
4
|
export const Divider = ({ className, classModifier }) => {
|
|
5
|
-
const componentClassName = useMemo(() =>
|
|
5
|
+
const componentClassName = useMemo(() => getClassName({
|
|
6
|
+
baseClassName: "af-divider",
|
|
7
|
+
className,
|
|
8
|
+
modifiers: classModifier?.split(" ").filter(Boolean) ?? [],
|
|
9
|
+
}), [className, classModifier]);
|
|
6
10
|
return _jsx("hr", { className: componentClassName });
|
|
7
11
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CardCheckboxProps } from "./CardCheckboxCommon";
|
|
2
2
|
import "@axa-fr/canopee-css/prospect/Form/Checkbox/CardCheckbox/CardCheckboxApollo.css";
|
|
3
|
+
export type { CardCheckboxProps };
|
|
3
4
|
export declare const CardCheckbox: {
|
|
4
5
|
(props: CardCheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
displayName: string;
|
|
@@ -7,25 +7,9 @@ type CheckboxOption = Omit<CardCheckboxOptionProps, "name" | "type">;
|
|
|
7
7
|
export type CardCheckboxProps = Omit<CardCheckboxOptionProps, "value" | "label" | "type" | "icon" | "description" | "subtitle" | "children"> & {
|
|
8
8
|
type?: "vertical" | "horizontal";
|
|
9
9
|
mode?: "text";
|
|
10
|
-
/**
|
|
11
|
-
* @deprecated Use `label` instead.
|
|
12
|
-
*/
|
|
13
|
-
labelGroup?: string;
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated Use `description` instead.
|
|
16
|
-
*/
|
|
17
|
-
descriptionGroup?: string;
|
|
18
10
|
label: ReactNode;
|
|
19
11
|
description?: ReactNode;
|
|
20
|
-
/**
|
|
21
|
-
* @deprecated Use `required` instead.
|
|
22
|
-
*/
|
|
23
|
-
isRequired?: boolean;
|
|
24
12
|
options: CheckboxOption[];
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated Use `message` and messageType instead.
|
|
27
|
-
*/
|
|
28
|
-
error?: string;
|
|
29
13
|
containerProps?: GridContainerProps<"fieldset">;
|
|
30
14
|
} & Partial<ItemMessageProps>;
|
|
31
15
|
type CardCheckboxCommonProps = CardCheckboxProps & {
|
|
@@ -34,7 +18,7 @@ type CardCheckboxCommonProps = CardCheckboxProps & {
|
|
|
34
18
|
ItemMessageComponent: ComponentType<ItemMessageProps>;
|
|
35
19
|
};
|
|
36
20
|
export declare const CardCheckboxCommon: {
|
|
37
|
-
({ className,
|
|
21
|
+
({ className, label, description, required, options, type, name, id, onChange, CardCheckboxItemComponent, CheckboxTextComponent, ItemMessageComponent, message, messageType, containerProps, mode, ...inputProps }: CardCheckboxCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
38
22
|
displayName: string;
|
|
39
23
|
};
|
|
40
24
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId, useRef, } from "react";
|
|
3
|
-
export const CardCheckboxCommon = ({ className,
|
|
3
|
+
export const CardCheckboxCommon = ({ className, label, description, required, options, type = "vertical", name, id, onChange = () => { }, CardCheckboxItemComponent, CheckboxTextComponent, ItemMessageComponent, message, messageType = "error", containerProps, mode, ...inputProps }) => {
|
|
4
4
|
const generatedId = useId();
|
|
5
5
|
const cardCheckboxId = id || generatedId;
|
|
6
6
|
const messageId = `${cardCheckboxId}-error`;
|
|
@@ -23,10 +23,10 @@ export const CardCheckboxCommon = ({ className, labelGroup, descriptionGroup, la
|
|
|
23
23
|
}
|
|
24
24
|
onChange(event);
|
|
25
25
|
};
|
|
26
|
-
const hasError =
|
|
27
|
-
return (_jsxs("fieldset", { className: ["af-card-checkbox", className].filter(Boolean).join(" "), id: cardCheckboxId, ...containerProps, children: [_jsxs("legend", { className: "af-card-checkbox__legend", children: [_jsxs("p", { className: "af-card-checkbox__label", children: [label,
|
|
26
|
+
const hasError = Boolean(message) && messageType === "error";
|
|
27
|
+
return (_jsxs("fieldset", { className: ["af-card-checkbox", className].filter(Boolean).join(" "), id: cardCheckboxId, ...containerProps, children: [_jsxs("legend", { className: "af-card-checkbox__legend", children: [_jsxs("p", { className: "af-card-checkbox__label", children: [label, required ? _jsx("span", { "aria-hidden": true, children: "*" }) : null] }), description ? (_jsx("p", { className: "af-card-checkbox__description", children: description })) : null] }), _jsx("div", { className: [
|
|
28
28
|
"af-card-checkbox__options",
|
|
29
29
|
`af-card-checkbox__options--${type}`,
|
|
30
|
-
].join(" "), ref: cardCheckboxOptionsRef, children: options.map((cardCheckboxItemProps) => (_jsx(CheckboxItemComponent, { id: `${cardCheckboxId}-${cardCheckboxItemProps.value}`, required: required, onChange: handleChange, ...inputProps, ...cardCheckboxItemProps, type: type, "aria-invalid": hasError || undefined, "aria-errormessage": hasError ? messageId : undefined, name: name }, `${name ?? cardCheckboxId}-${cardCheckboxItemProps.label}`))) }), _jsx(ItemMessageComponent, { id: messageId, message: message
|
|
30
|
+
].join(" "), ref: cardCheckboxOptionsRef, children: options.map((cardCheckboxItemProps) => (_jsx(CheckboxItemComponent, { id: `${cardCheckboxId}-${cardCheckboxItemProps.value}`, required: required, onChange: handleChange, ...inputProps, ...cardCheckboxItemProps, type: type, "aria-invalid": hasError || undefined, "aria-errormessage": hasError ? messageId : undefined, name: name }, `${name ?? cardCheckboxId}-${cardCheckboxItemProps.label}`))) }), _jsx(ItemMessageComponent, { id: messageId, message: message, messageType: messageType })] }));
|
|
31
31
|
};
|
|
32
32
|
CardCheckboxCommon.displayName = "CardCheckboxCommon";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type CardCheckboxProps } from "./CardCheckboxCommon";
|
|
2
2
|
import "@axa-fr/canopee-css/client/Form/Checkbox/CardCheckbox/CardCheckboxLF.css";
|
|
3
|
+
export type { CardCheckboxProps };
|
|
3
4
|
export declare const CardCheckbox: {
|
|
4
5
|
(props: CardCheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
5
6
|
displayName: string;
|
|
@@ -2,10 +2,6 @@ import { type ComponentProps } from "react";
|
|
|
2
2
|
export type CheckboxProps = {
|
|
3
3
|
/** @deprecated Use `aria-errormessage` instead */
|
|
4
4
|
errorId?: string;
|
|
5
|
-
|
|
6
|
-
hasError?: boolean;
|
|
5
|
+
variant?: "error" | "warning";
|
|
7
6
|
} & Omit<ComponentProps<"input">, "disabled" | "type">;
|
|
8
|
-
export declare const Checkbox: {
|
|
9
|
-
({ errorId, hasError, className, ...inputProps }: CheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
displayName: string;
|
|
11
|
-
};
|
|
7
|
+
export declare const Checkbox: ({ errorId, variant, className, ref, ...inputProps }: CheckboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import {} from "react";
|
|
3
|
-
|
|
4
|
-
Checkbox
|
|
3
|
+
import { getClassName } from "../../../utilities/getClassName";
|
|
4
|
+
export const Checkbox = ({ errorId, variant, className, ref, ...inputProps }) => (_jsx("input", { "aria-errormessage": errorId, "aria-invalid": variant === "error" || undefined, ...inputProps, className: getClassName({
|
|
5
|
+
baseClassName: "af-checkbox",
|
|
6
|
+
modifiers: [variant],
|
|
7
|
+
className,
|
|
8
|
+
}), ref: ref, type: "checkbox" }));
|
|
@@ -4,10 +4,6 @@ import type { ItemMessageProps } from "../../ItemMessage/ItemMessageCommon";
|
|
|
4
4
|
import type { CheckboxProps } from "../Checkbox/CheckboxCommon";
|
|
5
5
|
export type CheckboxTextProps = {
|
|
6
6
|
label: string | ReactNode;
|
|
7
|
-
/**
|
|
8
|
-
* @deprecated Use `message` and messageType instead.
|
|
9
|
-
*/
|
|
10
|
-
errorMessage?: string;
|
|
11
7
|
containerProps?: GridContainerProps;
|
|
12
8
|
} & Omit<CheckboxProps, "aria-errormessage" | "aria-invalid"> & Partial<ItemMessageProps>;
|
|
13
9
|
export type CheckboxTextCommonProps = CheckboxTextProps & {
|
|
@@ -15,7 +11,7 @@ export type CheckboxTextCommonProps = CheckboxTextProps & {
|
|
|
15
11
|
ItemMessageComponent: ComponentType<ItemMessageProps>;
|
|
16
12
|
};
|
|
17
13
|
declare const CheckboxTextCommon: {
|
|
18
|
-
({ label,
|
|
14
|
+
({ label, id, message, messageType, CheckboxComponent, ItemMessageComponent, containerProps, ...inputProps }: CheckboxTextCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
19
15
|
displayName: string;
|
|
20
16
|
};
|
|
21
17
|
export { CheckboxTextCommon };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
|
-
const CheckboxTextCommon = ({ label,
|
|
3
|
+
const CheckboxTextCommon = ({ label, id, message, messageType = "error", CheckboxComponent, ItemMessageComponent, containerProps, ...inputProps }) => {
|
|
4
4
|
const generatedId = useId();
|
|
5
5
|
const inputId = id ?? generatedId;
|
|
6
6
|
const messageId = `${inputId}-error`;
|
|
7
|
-
const hasError =
|
|
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
|
|
7
|
+
const hasError = Boolean(message) && messageType === "error";
|
|
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, id: messageId, messageType: messageType })] }));
|
|
9
9
|
};
|
|
10
10
|
CheckboxTextCommon.displayName = "CheckboxTextCommon";
|
|
11
11
|
export { CheckboxTextCommon };
|