@axa-fr/canopee-react 1.8.1-alpha.1 → 2.0.0-alpha.22
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 +11 -6
- package/dist/client.js +11 -6
- 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/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/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/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/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/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/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/List/ClickItem/ClickItemCommon.d.ts +1 -0
- 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/Loader/LoaderCommon.d.ts +4 -1
- package/dist/prospect-client/Loader/LoaderCommon.js +4 -4
- 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/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/TagList/TagListApollo.d.ts +4 -0
- package/dist/prospect-client/TagList/TagListApollo.js +5 -0
- package/dist/prospect-client/TagList/TagListCommon.d.ts +10 -0
- package/dist/prospect-client/TagList/TagListCommon.js +16 -0
- package/dist/prospect-client/TagList/TagListLF.d.ts +4 -0
- package/dist/prospect-client/TagList/TagListLF.js +5 -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 +10 -5
- package/dist/prospect.js +10 -5
- 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
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ComponentProps, type ComponentType, type FC, type ReactNode } from "react";
|
|
2
|
+
export type ItemMultiSelectVariant = "primary" | "secondary";
|
|
3
|
+
export type ItemMultiSelectCommonProps = Omit<ComponentProps<"input">, "type"> & {
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
variant?: ItemMultiSelectVariant;
|
|
6
|
+
Checkbox: ComponentType<ComponentProps<"input">>;
|
|
7
|
+
};
|
|
8
|
+
export declare const ItemMultiSelectCommon: FC<ItemMultiSelectCommonProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import {} from "react";
|
|
3
|
+
import { getClassName } from "../../utilities/getClassName";
|
|
4
|
+
export const ItemMultiSelectCommon = ({ label, variant = "primary", className = "", id, Checkbox, ...inputProps }) => (_jsxs("label", { className: getClassName({
|
|
5
|
+
baseClassName: "af-item-multi-select",
|
|
6
|
+
modifiers: [variant],
|
|
7
|
+
className: className ?? "",
|
|
8
|
+
}), htmlFor: id, children: [_jsx("span", { className: "af-item-multi-select__checkbox", children: _jsx(Checkbox, { id: id, ...inputProps }) }), _jsx("span", { className: "af-item-multi-select__label", children: label })] }));
|
|
9
|
+
ItemMultiSelectCommon.displayName = "ItemMultiSelectCommon";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import "@axa-fr/canopee-css/client/Form/ItemMultiSelect/ItemMultiSelectLF.css";
|
|
2
|
+
import { type ItemMultiSelectCommonProps } from "./ItemMultiSelectCommon";
|
|
3
|
+
export type ItemMultiSelectProps = Omit<ItemMultiSelectCommonProps, "Checkbox">;
|
|
4
|
+
export declare const ItemMultiSelect: {
|
|
5
|
+
(props: ItemMultiSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/canopee-css/client/Form/ItemMultiSelect/ItemMultiSelectLF.css";
|
|
3
|
+
import { Checkbox } from "../Checkbox/Checkbox/CheckboxLF";
|
|
4
|
+
import { ItemMultiSelectCommon, } from "./ItemMultiSelectCommon";
|
|
5
|
+
export const ItemMultiSelect = (props) => (_jsx(ItemMultiSelectCommon, { ...props, Checkbox: Checkbox }));
|
|
6
|
+
ItemMultiSelect.displayName = "ItemMultiSelect";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Icon } from "../../../Icon/IconApollo";
|
|
3
|
+
import { Radio } from "../Radio/RadioApollo";
|
|
4
|
+
import { CardRadioCommon } from "./CardRadioCommon";
|
|
5
|
+
import "@axa-fr/canopee-css/prospect/Form/Radio/CardRadio/CardRadioApollo.css";
|
|
6
|
+
export const CardRadio = (props) => (_jsx(CardRadioCommon, { ...props, RadioComponent: Radio, IconComponent: Icon }));
|
|
@@ -2,12 +2,12 @@ import { type ComponentProps, type ComponentType, type ReactNode } from "react";
|
|
|
2
2
|
import { BasePicture } from "../../../BasePicture/BasePicture";
|
|
3
3
|
import type { Icon as IconCommon } from "../../../Icon/IconCommon";
|
|
4
4
|
import type { Radio } from "../Radio/RadioCommon";
|
|
5
|
-
type
|
|
5
|
+
type BaseCardRadioProps = Omit<ComponentProps<typeof Radio>, "size"> & {
|
|
6
6
|
label: ReactNode;
|
|
7
7
|
description?: ReactNode;
|
|
8
8
|
subtitle?: ReactNode;
|
|
9
9
|
};
|
|
10
|
-
export type
|
|
10
|
+
export type CardRadioProps = BaseCardRadioProps & {
|
|
11
11
|
/**
|
|
12
12
|
* @deprecated Use `position` instead.
|
|
13
13
|
*/
|
|
@@ -17,9 +17,12 @@ export type CardRadioOptionProps = BaseCardRadioOptionProps & {
|
|
|
17
17
|
src?: ComponentProps<typeof BasePicture>["src"];
|
|
18
18
|
basePictureProps?: Omit<ComponentProps<typeof BasePicture>, "src">;
|
|
19
19
|
};
|
|
20
|
-
export type
|
|
20
|
+
export type CardRadioCommonProps = CardRadioProps & {
|
|
21
21
|
RadioComponent: ComponentType<ComponentProps<typeof Radio>>;
|
|
22
22
|
IconComponent: ComponentType<ComponentProps<typeof IconCommon>>;
|
|
23
23
|
};
|
|
24
|
-
export declare const
|
|
24
|
+
export declare const CardRadioCommon: {
|
|
25
|
+
({ label, position, type, description, subtitle, icon, src, basePictureProps, isInvalid, className, RadioComponent, IconComponent, ...inputProps }: CardRadioCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
displayName: string;
|
|
27
|
+
};
|
|
25
28
|
export {};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import {} from "react";
|
|
3
|
+
import { BasePicture } from "../../../BasePicture/BasePicture";
|
|
4
|
+
import { getClassName } from "../../../utilities/getClassName";
|
|
5
|
+
export const CardRadioCommon = ({ label, position, type, description, subtitle, icon, src, basePictureProps, isInvalid, className, RadioComponent, IconComponent, ...inputProps }) => {
|
|
6
|
+
const isCardRadioHorizontal = [position, type].includes("horizontal");
|
|
7
|
+
return (_jsxs("label", { className: getClassName({
|
|
8
|
+
baseClassName: "af-card-radio",
|
|
9
|
+
modifiers: [
|
|
10
|
+
isInvalid && "invalid",
|
|
11
|
+
isCardRadioHorizontal && "horizontal",
|
|
12
|
+
],
|
|
13
|
+
className,
|
|
14
|
+
}), children: [icon ? _jsx(IconComponent, { src: icon, role: "presentation" }) : null, isCardRadioHorizontal && src ? (_jsx(BasePicture, { src: src, ...basePictureProps })) : null, _jsxs("div", { className: "af-card-radio__content", children: [_jsx("p", { className: "af-card-radio__label", children: label }), Boolean(description) && (_jsx("p", { className: "af-card-radio__description", children: description })), Boolean(subtitle) && (_jsx("p", { className: "af-card-radio__subtitle", children: subtitle }))] }), _jsx(RadioComponent, { ...inputProps, isInvalid: isInvalid })] }));
|
|
15
|
+
};
|
|
16
|
+
CardRadioCommon.displayName = "CardRadioCommon";
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Icon } from "../../../Icon/IconLF";
|
|
3
|
+
import { Radio } from "../Radio/RadioLF";
|
|
4
|
+
import { CardRadioCommon } from "./CardRadioCommon";
|
|
5
|
+
import "@axa-fr/canopee-css/client/Form/Radio/CardRadio/CardRadioLF.css";
|
|
6
|
+
export const CardRadio = (props) => (_jsx(CardRadioCommon, { ...props, RadioComponent: Radio, IconComponent: Icon }));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ItemMessage } from "../../ItemMessage/ItemMessageApollo";
|
|
3
|
-
import {
|
|
3
|
+
import { CardRadio } from "../CardRadio/CardRadioApollo";
|
|
4
4
|
import { CardRadioGroupCommon, } from "./CardRadioGroupCommon";
|
|
5
5
|
import "@axa-fr/canopee-css/prospect/Form/Radio/CardRadioGroup/CardRadioGroupApollo.css";
|
|
6
|
-
export const CardRadioGroup = (props) => (_jsx(CardRadioGroupCommon, { ...props,
|
|
6
|
+
export const CardRadioGroup = (props) => (_jsx(CardRadioGroupCommon, { ...props, CardRadioComponent: CardRadio, ItemMessageComponent: ItemMessage }));
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { type ComponentProps, type ComponentType, type PropsWithChildren, type ReactNode } from "react";
|
|
2
2
|
import type { GridContainerProps } from "../../../utilities/types/GridContainerProps";
|
|
3
3
|
import { ItemMessage, type ItemMessageProps } from "../../ItemMessage/ItemMessageCommon";
|
|
4
|
-
import { type
|
|
5
|
-
type RadioOption = Omit<
|
|
6
|
-
export type CardRadioGroupProps = Omit<
|
|
4
|
+
import { type CardRadioProps } from "../CardRadio/CardRadioCommon";
|
|
5
|
+
type RadioOption = Omit<CardRadioProps, "name" | "type" | "isInvalid">;
|
|
6
|
+
export type CardRadioGroupProps = Omit<CardRadioProps, "value" | "label" | "type" | "isInvalid" | "icon" | "src" | "basePictureProps" | "description" | "subtitle" | "children" | "position"> & {
|
|
7
7
|
/**
|
|
8
8
|
* @deprecated Use `position` and `cardStyle` instead.
|
|
9
9
|
*/
|
|
10
10
|
type?: "vertical" | "horizontal";
|
|
11
|
-
cardStyle?:
|
|
11
|
+
cardStyle?: CardRadioProps["position"];
|
|
12
12
|
position?: "line" | "column";
|
|
13
13
|
/**
|
|
14
14
|
* @deprecated Use `label` instead.
|
|
@@ -36,11 +36,11 @@ export type CardRadioGroupProps = Omit<CardRadioOptionProps, "value" | "label" |
|
|
|
36
36
|
containerProps?: GridContainerProps<"fieldset">;
|
|
37
37
|
} & PropsWithChildren & Partial<ItemMessageProps>;
|
|
38
38
|
export type CardRadioCommonProps = CardRadioGroupProps & {
|
|
39
|
-
|
|
39
|
+
CardRadioComponent: ComponentType<CardRadioProps>;
|
|
40
40
|
ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
|
|
41
41
|
};
|
|
42
42
|
declare const CardRadioGroupCommon: {
|
|
43
|
-
({ className, labelGroup, descriptionGroup, label, description, isRequired, required, options, cardStyle, type, position, error, message, messageType, name, value, id,
|
|
43
|
+
({ className, labelGroup, descriptionGroup, label, description, isRequired, required, options, cardStyle, type, position, error, message, messageType, name, value, id, CardRadioComponent, ItemMessageComponent, containerProps, ...inputProps }: CardRadioCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
44
44
|
displayName: string;
|
|
45
45
|
};
|
|
46
46
|
export { CardRadioGroupCommon };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId, } from "react";
|
|
3
3
|
import { ItemMessage, } from "../../ItemMessage/ItemMessageCommon";
|
|
4
|
-
import {} from "../
|
|
5
|
-
const CardRadioGroupCommon = ({ className, labelGroup, descriptionGroup, label, description, isRequired, required, options, cardStyle, type = "vertical", position = (cardStyle ?? type) === "vertical" ? "column" : "line", error, message, messageType = "error", name, value, id,
|
|
4
|
+
import {} from "../CardRadio/CardRadioCommon";
|
|
5
|
+
const CardRadioGroupCommon = ({ className, labelGroup, descriptionGroup, label, description, isRequired, required, options, cardStyle, type = "vertical", position = (cardStyle ?? type) === "vertical" ? "column" : "line", error, message, messageType = "error", name, value, id, CardRadioComponent, ItemMessageComponent, containerProps, ...inputProps }) => {
|
|
6
6
|
const generatedId = useId();
|
|
7
7
|
const cardRadioGroupId = id ?? generatedId;
|
|
8
8
|
const messageId = `${cardRadioGroupId}-error`;
|
|
@@ -10,7 +10,7 @@ const CardRadioGroupCommon = ({ className, labelGroup, descriptionGroup, label,
|
|
|
10
10
|
return (_jsxs("fieldset", { className: ["af-card-radio-group", className].filter(Boolean).join(" "), role: "radiogroup", "aria-required": Boolean(required) || undefined, "aria-invalid": hasError || undefined, "aria-errormessage": hasError ? messageId : undefined, id: cardRadioGroupId, ...containerProps, children: [_jsxs("legend", { className: "af-card-radio-group__legend", children: [_jsxs("p", { className: "af-card-radio-group__label", children: [label, labelGroup, required || isRequired ? _jsx("span", { "aria-hidden": true, children: "*" }) : null] }), description || descriptionGroup ? (_jsxs("p", { className: "af-card-radio-group__description", children: [description, descriptionGroup] })) : null] }), _jsx("div", { className: [
|
|
11
11
|
"af-card-radio-group__options",
|
|
12
12
|
`af-card-radio-group__options--${position}`,
|
|
13
|
-
].join(" "), children: options.map((cardRadioItemProps) => (_jsx(
|
|
13
|
+
].join(" "), children: options.map((cardRadioItemProps) => (_jsx(CardRadioComponent, { id: `${cardRadioGroupId}-${cardRadioItemProps.value}`, checked: value !== undefined
|
|
14
14
|
? value === cardRadioItemProps.value
|
|
15
15
|
: undefined, required: required, position: cardStyle ?? type, ...inputProps, ...cardRadioItemProps, isInvalid: hasError, name: name }, `${name ?? cardRadioGroupId}-${cardRadioItemProps.label}`))) }), _jsx(ItemMessageComponent, { id: messageId, message: message || error, messageType: messageType })] }));
|
|
16
16
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ItemMessage } from "../../ItemMessage/ItemMessageLF";
|
|
3
|
-
import {
|
|
3
|
+
import { CardRadio } from "../CardRadio/CardRadioLF";
|
|
4
4
|
import { CardRadioGroupCommon, } from "./CardRadioGroupCommon";
|
|
5
5
|
import "@axa-fr/canopee-css/client/Form/Radio/CardRadioGroup/CardRadioGroupLF.css";
|
|
6
|
-
export const CardRadioGroup = (props) => (_jsx(CardRadioGroupCommon, { ...props,
|
|
6
|
+
export const CardRadioGroup = (props) => (_jsx(CardRadioGroupCommon, { ...props, CardRadioComponent: CardRadio, ItemMessageComponent: ItemMessage }));
|
|
@@ -2,4 +2,7 @@ import { type ComponentProps } from "react";
|
|
|
2
2
|
export type RadioProps = Omit<ComponentProps<"input">, "disabled" | "type"> & {
|
|
3
3
|
isInvalid?: boolean;
|
|
4
4
|
};
|
|
5
|
-
export declare const Radio:
|
|
5
|
+
export declare const Radio: {
|
|
6
|
+
({ className, isInvalid, ...props }: RadioProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
export const Radio =
|
|
2
|
+
import {} from "react";
|
|
3
|
+
export const Radio = ({ className, isInvalid, ...props }) => (_jsx("input", { ...props, className: ["af-radio", isInvalid && "af-radio--invalid", className]
|
|
4
4
|
.filter(Boolean)
|
|
5
|
-
.join(" "), type: "radio"
|
|
5
|
+
.join(" "), type: "radio" }));
|
|
6
6
|
Radio.displayName = "Radio";
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/prospect/Form/TextArea/TextAreaApollo.css";
|
|
2
2
|
import { type TextAreaProps } from "./TextAreaCommon";
|
|
3
|
-
export declare const TextArea:
|
|
3
|
+
export declare const TextArea: {
|
|
4
|
+
({ ...props }: TextAreaProps): 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
2
|
import "@axa-fr/canopee-css/prospect/Form/TextArea/TextAreaApollo.css";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
3
|
import { ItemLabel } from "../ItemLabel/ItemLabelApollo";
|
|
5
4
|
import { ItemMessage } from "../ItemMessage/ItemMessageApollo";
|
|
6
5
|
import { TextAreaCommon } from "./TextAreaCommon";
|
|
7
|
-
export const TextArea =
|
|
6
|
+
export const TextArea = ({ ...props }) => (_jsx(TextAreaCommon, { ...props, ItemLabelComponent: ItemLabel, ItemMessageComponent: ItemMessage }));
|
|
8
7
|
TextArea.displayName = "TextArea";
|
|
@@ -15,5 +15,8 @@ type TextAreaCommonProps = TextAreaProps & {
|
|
|
15
15
|
ItemLabelComponent: ComponentType<Omit<ComponentProps<typeof ItemLabelCommon>, "ButtonComponent">>;
|
|
16
16
|
ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
|
|
17
17
|
};
|
|
18
|
-
declare const TextAreaCommon:
|
|
18
|
+
declare const TextAreaCommon: {
|
|
19
|
+
({ id, className, label, description, helper, error, message, messageType, buttonLabel, moreButtonLabel, onButtonClick, onMoreButtonClick, required, sideButtonLabel, ItemLabelComponent, ItemMessageComponent, onSideButtonClick, placeholder, containerProps, ...inputProps }: TextAreaCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
19
22
|
export { TextAreaCommon };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useId, } from "react";
|
|
3
3
|
import { getClassName } from "../../utilities/getClassName";
|
|
4
4
|
import { ItemLabelCommon, } from "../ItemLabel/ItemLabelCommon";
|
|
5
5
|
import { ItemMessage, } from "../ItemMessage/ItemMessageCommon";
|
|
6
|
-
const TextAreaCommon =
|
|
6
|
+
const TextAreaCommon = ({ id, className, label, description, helper, error, message, messageType, buttonLabel, moreButtonLabel, onButtonClick, onMoreButtonClick, required, sideButtonLabel, ItemLabelComponent, ItemMessageComponent, onSideButtonClick, placeholder = " ", containerProps, ...inputProps }) => {
|
|
7
7
|
const generatedId = useId();
|
|
8
8
|
const inputId = id ?? generatedId;
|
|
9
9
|
const helperId = `${inputId}-helper`;
|
|
@@ -16,7 +16,7 @@ const TextAreaCommon = forwardRef(({ id, className, label, description, helper,
|
|
|
16
16
|
});
|
|
17
17
|
return (_jsxs("div", { className: ["af-form__input-container", className]
|
|
18
18
|
.filter(Boolean)
|
|
19
|
-
.join(" "), ...containerProps, children: [_jsx(ItemLabelComponent, { description: description, moreButtonLabel: moreButtonLabel ?? buttonLabel, onMoreButtonClick: onMoreButtonClick ?? onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, htmlFor: inputId, children: label }), _jsx("textarea", { id: inputId, className: textareaClassName,
|
|
20
|
-
}
|
|
19
|
+
.join(" "), ...containerProps, children: [_jsx(ItemLabelComponent, { description: description, moreButtonLabel: moreButtonLabel ?? buttonLabel, onMoreButtonClick: onMoreButtonClick ?? onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, htmlFor: inputId, children: label }), _jsx("textarea", { id: inputId, className: textareaClassName, "aria-errormessage": hasError ? messageId : undefined, "aria-describedby": helper ? helperId : undefined, required: required, "aria-invalid": hasError || undefined, placeholder: placeholder, ...inputProps }), helper ? (_jsx("span", { id: helperId, className: "af-form__input-helper", children: helper })) : null, _jsx(ItemMessageComponent, { id: messageId, message: message || error, messageType: messageType })] }));
|
|
20
|
+
};
|
|
21
21
|
TextAreaCommon.displayName = "TextArea";
|
|
22
22
|
export { TextAreaCommon };
|
|
@@ -1,3 +1,6 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/client/Form/TextArea/TextAreaLF.css";
|
|
2
2
|
import { type TextAreaProps } from "./TextAreaCommon";
|
|
3
|
-
export declare const TextArea:
|
|
3
|
+
export declare const TextArea: {
|
|
4
|
+
({ ...props }: TextAreaProps): 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
2
|
import "@axa-fr/canopee-css/client/Form/TextArea/TextAreaLF.css";
|
|
3
|
-
import { forwardRef } from "react";
|
|
4
3
|
import { ItemLabel } from "../ItemLabel/ItemLabelLF";
|
|
5
4
|
import { ItemMessage } from "../ItemMessage/ItemMessageLF";
|
|
6
5
|
import { TextAreaCommon } from "./TextAreaCommon";
|
|
7
|
-
export const TextArea =
|
|
6
|
+
export const TextArea = ({ ...props }) => (_jsx(TextAreaCommon, { ...props, ItemLabelComponent: ItemLabel, ItemMessageComponent: ItemMessage }));
|
|
8
7
|
TextArea.displayName = "TextArea";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/canopee-css/prospect/Header/HeaderApollo.css";
|
|
3
|
+
import { AppName } from "../AppName/AppName";
|
|
4
|
+
import { Heading } from "../Heading/HeadingApollo";
|
|
5
|
+
import { MenuBurger } from "../MenuBurger/MenuBurgerApollo";
|
|
6
|
+
import { ClickIcon } from "../ClickIcon/ClickIconApollo";
|
|
7
|
+
import { HeaderCommon } from "./HeaderCommon";
|
|
8
|
+
export const Header = (props) => (_jsx(HeaderCommon, { AppNameComponent: AppName, HeadingComponent: Heading, MenuBurgerComponent: MenuBurger, ClickIconComponent: ClickIcon, ...props }));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ComponentPropsWithoutRef, type ComponentType, type ReactNode } from "react";
|
|
2
|
+
import { type ClickIconProps } from "../ClickIcon/ClickIconCommon";
|
|
3
|
+
import { type AppNameProps } from "../AppName/AppName";
|
|
4
|
+
import { type HeadingProps } from "../Heading/types";
|
|
5
|
+
import { type MenuBurgerProps } from "../MenuBurger/MenuBurgerCommon";
|
|
6
|
+
import { type TabMenuProps } from "../TabMenu/TabMenu";
|
|
7
|
+
export type HeaderProps = Omit<ComponentPropsWithoutRef<"header">, "title"> & {
|
|
8
|
+
appNameProps: AppNameProps;
|
|
9
|
+
menuBurgerProps?: MenuBurgerProps;
|
|
10
|
+
tabMenuProps?: TabMenuProps;
|
|
11
|
+
clickIconProps?: ClickIconProps;
|
|
12
|
+
title?: string;
|
|
13
|
+
actionChildren?: ReactNode;
|
|
14
|
+
};
|
|
15
|
+
type HeaderCommonProps = HeaderProps & {
|
|
16
|
+
AppNameComponent: ComponentType<AppNameProps>;
|
|
17
|
+
HeadingComponent: ComponentType<HeadingProps>;
|
|
18
|
+
MenuBurgerComponent: ComponentType<MenuBurgerProps>;
|
|
19
|
+
ClickIconComponent: ComponentType<ClickIconProps>;
|
|
20
|
+
};
|
|
21
|
+
export declare const HeaderCommon: ({ appNameProps, menuBurgerProps, tabMenuProps, clickIconProps, title, className, AppNameComponent, HeadingComponent, MenuBurgerComponent, ClickIconComponent, actionChildren, ...props }: HeaderCommonProps) => import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import {} from "react";
|
|
3
|
+
import menu from "@material-symbols/svg-400/outlined/menu.svg";
|
|
4
|
+
import { BREAKPOINT } from "../utilities/constants";
|
|
5
|
+
import {} from "../ClickIcon/ClickIconCommon";
|
|
6
|
+
import { TabMenu } from "../TabMenu/TabMenu";
|
|
7
|
+
import {} from "../AppName/AppName";
|
|
8
|
+
import {} from "../Heading/types";
|
|
9
|
+
import {} from "../MenuBurger/MenuBurgerCommon";
|
|
10
|
+
import {} from "../TabMenu/TabMenu";
|
|
11
|
+
import { getClassName } from "../utilities/getClassName";
|
|
12
|
+
import { useIsSmallScreen } from "../utilities/hook/useIsSmallScreen";
|
|
13
|
+
const withElementClass = (props, baseClassName) => ({
|
|
14
|
+
...props,
|
|
15
|
+
className: getClassName({
|
|
16
|
+
baseClassName,
|
|
17
|
+
className: props.className,
|
|
18
|
+
}),
|
|
19
|
+
});
|
|
20
|
+
export const HeaderCommon = ({ appNameProps, menuBurgerProps, tabMenuProps, clickIconProps, title, className, AppNameComponent, HeadingComponent, MenuBurgerComponent, ClickIconComponent, actionChildren, ...props }) => {
|
|
21
|
+
const isSmallScreen = useIsSmallScreen(BREAKPOINT.MD);
|
|
22
|
+
const parsedAppNameProps = withElementClass(appNameProps, "af-header__app-name");
|
|
23
|
+
const parsedMenuBurgerProps = menuBurgerProps
|
|
24
|
+
? withElementClass(menuBurgerProps, "af-header__menu-burger")
|
|
25
|
+
: undefined;
|
|
26
|
+
const parsedTabMenuProps = tabMenuProps
|
|
27
|
+
? withElementClass(tabMenuProps, "af-header__tab-menu")
|
|
28
|
+
: undefined;
|
|
29
|
+
return (_jsxs("header", { className: getClassName({
|
|
30
|
+
baseClassName: "af-header",
|
|
31
|
+
className,
|
|
32
|
+
}), ...props, children: [_jsx(AppNameComponent, { ...parsedAppNameProps }), Boolean(parsedMenuBurgerProps) ||
|
|
33
|
+
Boolean(parsedTabMenuProps) ||
|
|
34
|
+
Boolean(actionChildren) ? (_jsx(ClickIconComponent, { ...clickIconProps, src: menu, size: "S", variant: "ghost", className: "af-header__menu-icon", "aria-haspopup": isSmallScreen ? "menu" : undefined, "aria-label": clickIconProps?.["aria-label"] ?? "Ouvrir le menu", popoverTarget: isSmallScreen ? "af-header-menu" : undefined, popoverTargetAction: isSmallScreen ? "toggle" : undefined })) : null, _jsxs("div", { id: "af-header-menu", popover: isSmallScreen ? "auto" : undefined, className: "af-header__menu", children: [parsedTabMenuProps ? _jsx(TabMenu, { ...parsedTabMenuProps }) : null, (title && !isSmallScreen) ||
|
|
35
|
+
actionChildren ||
|
|
36
|
+
parsedMenuBurgerProps ? (_jsxs("div", { className: "af-header__actions", children: [title ? (_jsx(HeadingComponent, { level: 1, className: "af-header__title", children: title })) : null, actionChildren ? (_jsx("div", { className: "af-header__actions-children", children: actionChildren })) : null, parsedMenuBurgerProps ? (_jsx(MenuBurgerComponent, { ...parsedMenuBurgerProps })) : null] })) : null] })] }));
|
|
37
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/canopee-css/client/Header/HeaderLF.css";
|
|
3
|
+
import { AppName } from "../AppName/AppName";
|
|
4
|
+
import { Heading } from "../Heading/HeadingLF";
|
|
5
|
+
import { MenuBurger } from "../MenuBurger/MenuBurgerLF";
|
|
6
|
+
import { ClickIcon } from "../ClickIcon/ClickIconLF";
|
|
7
|
+
import { HeaderCommon } from "./HeaderCommon";
|
|
8
|
+
export const Header = (props) => (_jsx(HeaderCommon, { AppNameComponent: AppName, HeadingComponent: Heading, MenuBurgerComponent: MenuBurger, ClickIconComponent: ClickIcon, ...props }));
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef, type PropsWithChildren } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* Props for the ItemMenu component.
|
|
4
|
+
*/
|
|
5
|
+
export type ItemMenuProps = {
|
|
6
|
+
/**
|
|
7
|
+
* Applies the active modifier class.
|
|
8
|
+
* @default false
|
|
9
|
+
*/
|
|
10
|
+
isActive?: boolean;
|
|
11
|
+
} & ComponentPropsWithRef<"a">;
|
|
12
|
+
/**
|
|
13
|
+
* Renders a navigational item as an anchor element.
|
|
14
|
+
*
|
|
15
|
+
* @component
|
|
16
|
+
* @param {PropsWithChildren<ItemMenuProps>} props - ItemMenu props.
|
|
17
|
+
* @param {boolean} [props.isActive=false] - Adds active styling.
|
|
18
|
+
* @param {React.ReactNode} props.children - Item label/content.
|
|
19
|
+
* @param {React.Ref<HTMLAnchorElement>} props.ref - Optional ref to the anchor element.
|
|
20
|
+
* @returns {JSX.Element} The rendered ItemMenu component.
|
|
21
|
+
*/
|
|
22
|
+
export declare const ItemMenu: ({ isActive, children, className, ...props }: PropsWithChildren<ItemMenuProps>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import {} from "react";
|
|
3
|
+
import { getClassName } from "../utilities/getClassName";
|
|
4
|
+
/**
|
|
5
|
+
* Renders a navigational item as an anchor element.
|
|
6
|
+
*
|
|
7
|
+
* @component
|
|
8
|
+
* @param {PropsWithChildren<ItemMenuProps>} props - ItemMenu props.
|
|
9
|
+
* @param {boolean} [props.isActive=false] - Adds active styling.
|
|
10
|
+
* @param {React.ReactNode} props.children - Item label/content.
|
|
11
|
+
* @param {React.Ref<HTMLAnchorElement>} props.ref - Optional ref to the anchor element.
|
|
12
|
+
* @returns {JSX.Element} The rendered ItemMenu component.
|
|
13
|
+
*/
|
|
14
|
+
export const ItemMenu = ({ isActive = false, children, className, ...props }) => (_jsx("a", { className: getClassName({
|
|
15
|
+
baseClassName: "af-item-menu",
|
|
16
|
+
modifiers: [isActive && "active"],
|
|
17
|
+
className,
|
|
18
|
+
}), ...props, children: children }));
|
|
@@ -3,4 +3,7 @@ export type ItemTabBarProps = ComponentPropsWithRef<"button"> & {
|
|
|
3
3
|
isActive?: boolean;
|
|
4
4
|
title: string;
|
|
5
5
|
};
|
|
6
|
-
export declare const ItemTabBar:
|
|
6
|
+
export declare const ItemTabBar: {
|
|
7
|
+
({ isActive, title, className, ...props }: ItemTabBarProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
displayName: string;
|
|
9
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import {} from "react";
|
|
3
3
|
import { getComponentClassName } from "../utilities/getComponentClassName";
|
|
4
|
-
export const ItemTabBar =
|
|
4
|
+
export const ItemTabBar = ({ isActive = false, title, className, ...props }) => {
|
|
5
5
|
const classNames = getComponentClassName("af-item-tab-bar", className);
|
|
6
|
-
return (_jsx("button", {
|
|
7
|
-
}
|
|
6
|
+
return (_jsx("button", { type: "button", role: "tab", "aria-selected": isActive, className: classNames, ...props, children: title }));
|
|
7
|
+
};
|
|
8
8
|
ItemTabBar.displayName = "ItemTabBar";
|
|
@@ -1,8 +1,33 @@
|
|
|
1
1
|
import { type ComponentProps, type ComponentType } from "react";
|
|
2
|
-
import { CardCommon as Card, type CardCommonProps } from "../../Card/CardCommon";
|
|
3
|
-
|
|
2
|
+
import { CardCommon as Card, type CardCommonProps, type CardVariants } from "../../Card/CardCommon";
|
|
3
|
+
/**
|
|
4
|
+
* Props for the List component.
|
|
5
|
+
* Extends `CardCommonProps` (without `variant` override) to allow the list
|
|
6
|
+
* to be rendered as a `ul` or `ol` with optional card styling.
|
|
7
|
+
*/
|
|
8
|
+
export type ListProps = Omit<CardCommonProps<"ul" | "ol">, "variant"> & {
|
|
9
|
+
/**
|
|
10
|
+
* Visual variant inherited from Card.
|
|
11
|
+
* - `"default"` — bordered list with padding.
|
|
12
|
+
* - `"unstyled"` — removes border and padding.
|
|
13
|
+
* @default "default"
|
|
14
|
+
*/
|
|
15
|
+
variant?: CardVariants;
|
|
16
|
+
};
|
|
4
17
|
type ListPropsCommon = ListProps & {
|
|
5
18
|
CardComponent: ComponentType<ComponentProps<typeof Card>>;
|
|
6
19
|
};
|
|
20
|
+
/**
|
|
21
|
+
* Renders an accessible list (`ul` or `ol`) wrapped in a Card.
|
|
22
|
+
* Each direct child is automatically wrapped in a `<li>` element.
|
|
23
|
+
*
|
|
24
|
+
* @component
|
|
25
|
+
* @param {ListPropsCommon} props - List props.
|
|
26
|
+
* @param {ReactNode} props.children - Items to render inside the list. Each child is wrapped in a `<li>`.
|
|
27
|
+
* @param {"ul" | "ol"} [props.as="ul"] - HTML list element to render.
|
|
28
|
+
* @param {CardVariants} [props.variant="default"] - Visual variant of the surrounding Card.
|
|
29
|
+
* @param {ComponentType} props.CardComponent - Injected Card component (theme-specific).
|
|
30
|
+
* @returns {JSX.Element} The rendered List component.
|
|
31
|
+
*/
|
|
7
32
|
export declare const ListCommon: ({ children, CardComponent, as, ...listProps }: ListPropsCommon) => import("react/jsx-runtime").JSX.Element;
|
|
8
33
|
export {};
|
|
@@ -2,4 +2,16 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { Children } from "react";
|
|
3
3
|
import { CardCommon as Card, } from "../../Card/CardCommon";
|
|
4
4
|
import { generateId } from "../../utilities/generateId";
|
|
5
|
+
/**
|
|
6
|
+
* Renders an accessible list (`ul` or `ol`) wrapped in a Card.
|
|
7
|
+
* Each direct child is automatically wrapped in a `<li>` element.
|
|
8
|
+
*
|
|
9
|
+
* @component
|
|
10
|
+
* @param {ListPropsCommon} props - List props.
|
|
11
|
+
* @param {ReactNode} props.children - Items to render inside the list. Each child is wrapped in a `<li>`.
|
|
12
|
+
* @param {"ul" | "ol"} [props.as="ul"] - HTML list element to render.
|
|
13
|
+
* @param {CardVariants} [props.variant="default"] - Visual variant of the surrounding Card.
|
|
14
|
+
* @param {ComponentType} props.CardComponent - Injected Card component (theme-specific).
|
|
15
|
+
* @returns {JSX.Element} The rendered List component.
|
|
16
|
+
*/
|
|
5
17
|
export const ListCommon = ({ children, CardComponent, as = "ul", ...listProps }) => (_jsx(CardComponent, { as: as, ...listProps, children: Children.toArray(children).map((child) => (_jsx("li", { children: child }, generateId(child)))) }));
|
|
@@ -10,4 +10,7 @@ export type LoaderProps = {
|
|
|
10
10
|
export type LoaderCommonProps<T extends ElementType> = PolymorphicComponent<T, LoaderProps> & {
|
|
11
11
|
SpinnerComponent: ComponentType<SpinnerProps>;
|
|
12
12
|
};
|
|
13
|
-
export declare const LoaderCommon:
|
|
13
|
+
export declare const LoaderCommon: {
|
|
14
|
+
({ title, subtitle, SpinnerComponent, spinnerProps, className, isDialog, ...rest }: LoaderCommonProps<ElementType>): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
displayName: string;
|
|
16
|
+
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useId } from "react";
|
|
3
3
|
import { getClassName } from "../utilities/getClassName";
|
|
4
4
|
import {} from "../Spinner/SpinnerCommon";
|
|
5
|
-
export const LoaderCommon =
|
|
5
|
+
export const LoaderCommon = ({ title, subtitle, SpinnerComponent, spinnerProps, className, isDialog, ...rest }) => {
|
|
6
6
|
const baseClassName = "af-loader";
|
|
7
7
|
const titleId = useId();
|
|
8
8
|
const Component = (isDialog && "dialog") || "article";
|
|
9
|
-
return (_jsxs(Component, {
|
|
9
|
+
return (_jsxs(Component, { className: getClassName({
|
|
10
10
|
baseClassName,
|
|
11
11
|
className,
|
|
12
12
|
}), "aria-labelledby": titleId, ...rest, children: [_jsx(SpinnerComponent, { ...spinnerProps }), _jsxs("div", { className: `${baseClassName}__content`, children: [_jsx("span", { id: titleId, className: `${baseClassName}__title`, children: title }), subtitle ? (_jsx("span", { className: `${baseClassName}__subtitle`, children: subtitle })) : null] })] }));
|
|
13
|
-
}
|
|
13
|
+
};
|
|
14
14
|
LoaderCommon.displayName = "LoaderCommon";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/canopee-css/prospect/MenuBurger/MenuBurgerAll.css";
|
|
3
|
+
import { Button } from "../Button/ButtonApollo";
|
|
4
|
+
import { Icon } from "../Icon/IconApollo";
|
|
5
|
+
import { ClickItem } from "../List/ClickItem/ClickItemApollo";
|
|
6
|
+
import { List } from "../List/List/ListApollo";
|
|
7
|
+
import { MenuBurgerCommon } from "./MenuBurgerCommon";
|
|
8
|
+
export const MenuBurger = (props) => (_jsx(MenuBurgerCommon, { ButtonComponent: Button, ClickItemComponent: ClickItem, IconComponent: Icon, ListComponent: List, ...props }));
|