@axa-fr/canopee-react 1.8.1-alpha.1 → 2.0.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.d.ts +4 -4
- package/dist/client.js +4 -4
- package/dist/distributeur/Action/Action.d.ts +8 -2
- package/dist/distributeur/Action/Action.js +4 -4
- package/dist/distributeur/Button/Button.d.ts +8 -5
- package/dist/distributeur/Button/Button.js +2 -2
- package/dist/distributeur/Form/Checkbox/Checkbox.d.ts +6 -3
- package/dist/distributeur/Form/Checkbox/Checkbox.js +4 -4
- package/dist/distributeur/Form/Checkbox/CheckboxInput.d.ts +6 -3
- package/dist/distributeur/Form/Checkbox/CheckboxInput.js +4 -4
- package/dist/distributeur/Form/Checkbox/CheckboxItem.d.ts +7 -3
- package/dist/distributeur/Form/Checkbox/CheckboxItem.js +4 -4
- package/dist/distributeur/Form/Choice/Choice.d.ts +6 -3
- package/dist/distributeur/Form/Choice/Choice.js +4 -4
- package/dist/distributeur/Form/Choice/ChoiceInput.d.ts +6 -3
- package/dist/distributeur/Form/Choice/ChoiceInput.js +2 -4
- package/dist/distributeur/Form/Date/Date.d.ts +4 -1
- package/dist/distributeur/Form/Date/Date.js +4 -4
- package/dist/distributeur/Form/Date/DateInput.d.ts +4 -1
- package/dist/distributeur/Form/Date/DateInput.js +2 -4
- package/dist/distributeur/Form/Experimental/Input.d.ts +5 -1
- package/dist/distributeur/Form/Experimental/Input.js +4 -4
- package/dist/distributeur/Form/Experimental/TextInput.d.ts +4 -1
- package/dist/distributeur/Form/Experimental/TextInput.js +4 -4
- package/dist/distributeur/Form/Number/Number.d.ts +4 -1
- package/dist/distributeur/Form/Number/Number.js +4 -4
- package/dist/distributeur/Form/Pass/Pass.d.ts +4 -1
- package/dist/distributeur/Form/Pass/Pass.js +4 -4
- package/dist/distributeur/Form/Radio/Radio.d.ts +12 -23
- package/dist/distributeur/Form/Radio/Radio.js +4 -4
- package/dist/distributeur/Form/Radio/RadioInput.d.ts +6 -3
- package/dist/distributeur/Form/Radio/RadioInput.js +4 -4
- package/dist/distributeur/Form/Radio/RadioItem.d.ts +4 -1
- package/dist/distributeur/Form/Radio/RadioItem.js +4 -4
- package/dist/distributeur/Form/Select/Select.d.ts +9 -325
- package/dist/distributeur/Form/Select/Select.js +5 -5
- package/dist/distributeur/Form/Select/SelectBase.d.ts +10 -6
- package/dist/distributeur/Form/Select/SelectBase.js +4 -4
- package/dist/distributeur/Form/Select/SelectDefault.d.ts +4 -1
- package/dist/distributeur/Form/Select/SelectDefault.js +4 -4
- package/dist/distributeur/Form/Select/SelectDefaultWithOptions.d.ts +4 -1
- package/dist/distributeur/Form/Select/SelectDefaultWithOptions.js +5 -12
- package/dist/distributeur/Form/Select/SelectInput.d.ts +9 -376
- package/dist/distributeur/Form/Select/SelectInput.js +2 -4
- package/dist/distributeur/Form/Text/Text.d.ts +4 -1
- package/dist/distributeur/Form/Text/Text.js +4 -4
- package/dist/distributeur/Form/Text/TextInput.d.ts +4 -1
- package/dist/distributeur/Form/Text/TextInput.js +2 -4
- package/dist/distributeur/Form/Textarea/Textarea.d.ts +7 -2
- package/dist/distributeur/Form/Textarea/Textarea.js +4 -4
- package/dist/distributeur/Form/Textarea/TextareaInput.d.ts +4 -1
- package/dist/distributeur/Form/Textarea/TextareaInput.js +2 -4
- package/dist/distributeur/Layout/Footer/Footer.d.ts +5 -3
- package/dist/distributeur/Layout/Footer/Footer.js +2 -2
- package/dist/distributeur/Layout/Header/Name/Name.js +1 -1
- package/dist/distributeur/Layout/Header/NavBar/NavBarItem/NavBarItemBase.js +1 -1
- package/dist/distributeur/Link/Link.d.ts +4 -1
- package/dist/distributeur/Link/Link.js +3 -4
- package/dist/distributeur/Link/LinkAnchor.d.ts +4 -1
- package/dist/distributeur/Link/LinkAnchor.js +4 -4
- package/dist/distributeur/Loader/ItemLoader.d.ts +4 -0
- package/dist/distributeur/Loader/ItemLoader.js +8 -0
- package/dist/distributeur/Loader/Loader.d.ts +7 -10
- package/dist/distributeur/Loader/Loader.js +12 -27
- package/dist/distributeur/Loader/SquareLoader.d.ts +15 -0
- package/dist/distributeur/Loader/SquareLoader.js +33 -0
- package/dist/distributeur/ModalAgent/BooleanModal.d.ts +4 -1
- package/dist/distributeur/ModalAgent/BooleanModal.js +4 -4
- package/dist/distributeur/ModalAgent/Modal.d.ts +4 -1
- package/dist/distributeur/ModalAgent/Modal.js +4 -4
- package/dist/distributeur/Steps/VerticalStep.d.ts +2 -8
- package/dist/distributeur/Svg/svgInjector.js +1 -0
- package/dist/distributeur/Tag/Tag.d.ts +4 -1
- package/dist/distributeur/Tag/Tag.js +4 -4
- package/dist/distributeur/Title/Title.d.ts +4 -1
- package/dist/distributeur/Title/Title.js +4 -4
- package/dist/distributeur.d.ts +12 -6
- package/dist/distributeur.js +4 -1
- package/dist/prospect-client/Form/Checkbox/CardCheckboxOption/CardCheckboxOptionCommon.d.ts +4 -1
- package/dist/prospect-client/Form/Checkbox/CardCheckboxOption/CardCheckboxOptionCommon.js +3 -3
- package/dist/prospect-client/Form/Checkbox/Checkbox/CheckboxCommon.d.ts +4 -1
- package/dist/prospect-client/Form/Checkbox/Checkbox/CheckboxCommon.js +2 -2
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextApollo.d.ts +4 -1
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextApollo.js +1 -2
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextCommon.d.ts +4 -1
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextCommon.js +4 -4
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextLF.d.ts +4 -1
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextLF.js +1 -2
- package/dist/prospect-client/Form/Dropdown/DropdownCommon.d.ts +4 -1
- package/dist/prospect-client/Form/Dropdown/DropdownCommon.js +4 -4
- package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadApollo.d.ts +4 -1
- package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadApollo.js +1 -2
- package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadCommon.d.ts +4 -1
- package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadCommon.js +4 -4
- package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadLF.d.ts +4 -1
- package/dist/prospect-client/Form/FileUpload/FileUpload/FileUploadLF.js +1 -2
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileApollo.d.ts +4 -1
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileApollo.js +3 -4
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileCommon.d.ts +4 -1
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileCommon.js +4 -6
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileLF.d.ts +4 -1
- package/dist/prospect-client/Form/FileUpload/InputFile/InputFileLF.js +1 -2
- package/dist/prospect-client/Form/InputDate/InputDateApollo.d.ts +4 -1
- package/dist/prospect-client/Form/InputDate/InputDateApollo.js +1 -2
- package/dist/prospect-client/Form/InputDate/InputDateAtom.d.ts +4 -1
- package/dist/prospect-client/Form/InputDate/InputDateAtom.js +2 -2
- package/dist/prospect-client/Form/InputDate/InputDateCommon.d.ts +4 -1
- package/dist/prospect-client/Form/InputDate/InputDateCommon.js +4 -4
- package/dist/prospect-client/Form/InputDate/InputDateLF.d.ts +4 -1
- package/dist/prospect-client/Form/InputDate/InputDateLF.js +1 -2
- package/dist/prospect-client/Form/InputDate/InputDateTextAtom.d.ts +4 -1
- package/dist/prospect-client/Form/InputDate/InputDateTextAtom.js +4 -4
- package/dist/prospect-client/Form/InputPhone/InputPhoneCommon.d.ts +4 -1
- package/dist/prospect-client/Form/InputPhone/InputPhoneCommon.js +4 -4
- package/dist/prospect-client/Form/InputText/InputTextApollo.d.ts +4 -1
- package/dist/prospect-client/Form/InputText/InputTextApollo.js +1 -2
- package/dist/prospect-client/Form/InputText/InputTextCommon.d.ts +4 -1
- package/dist/prospect-client/Form/InputText/InputTextCommon.js +4 -4
- package/dist/prospect-client/Form/InputText/InputTextLF.d.ts +4 -1
- package/dist/prospect-client/Form/InputText/InputTextLF.js +1 -2
- package/dist/prospect-client/Form/InputTextAtom/InputTextAtomCommon.d.ts +4 -1
- package/dist/prospect-client/Form/InputTextAtom/InputTextAtomCommon.js +4 -4
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioApollo.d.ts +3 -0
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioApollo.js +6 -0
- package/dist/prospect-client/Form/Radio/{CardRadioOption/CardRadioOptionCommon.d.ts → CardRadio/CardRadioCommon.d.ts} +7 -4
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioCommon.js +16 -0
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioLF.d.ts +3 -0
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioLF.js +6 -0
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupApollo.js +2 -2
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupCommon.d.ts +6 -6
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupCommon.js +3 -3
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupLF.js +2 -2
- package/dist/prospect-client/Form/Radio/Radio/RadioCommon.d.ts +4 -1
- package/dist/prospect-client/Form/Radio/Radio/RadioCommon.js +3 -3
- package/dist/prospect-client/Form/TextArea/TextAreaApollo.d.ts +4 -1
- package/dist/prospect-client/Form/TextArea/TextAreaApollo.js +1 -2
- package/dist/prospect-client/Form/TextArea/TextAreaCommon.d.ts +4 -1
- package/dist/prospect-client/Form/TextArea/TextAreaCommon.js +4 -4
- package/dist/prospect-client/Form/TextArea/TextAreaLF.d.ts +4 -1
- package/dist/prospect-client/Form/TextArea/TextAreaLF.js +1 -2
- package/dist/prospect-client/ItemMenu/ItemMenuApollo.d.ts +2 -0
- package/dist/prospect-client/ItemMenu/ItemMenuApollo.js +2 -0
- package/dist/prospect-client/ItemMenu/ItemMenuCommon.d.ts +22 -0
- package/dist/prospect-client/ItemMenu/ItemMenuCommon.js +18 -0
- package/dist/prospect-client/ItemMenu/ItemMenuLF.d.ts +2 -0
- package/dist/prospect-client/ItemMenu/ItemMenuLF.js +2 -0
- package/dist/prospect-client/ItemTabBar/ItemTabBarCommon.d.ts +4 -1
- package/dist/prospect-client/ItemTabBar/ItemTabBarCommon.js +4 -4
- package/dist/prospect-client/Loader/LoaderCommon.d.ts +4 -1
- package/dist/prospect-client/Loader/LoaderCommon.js +4 -4
- package/dist/prospect-client/Modal/ModalApollo.d.ts +4 -1
- package/dist/prospect-client/Modal/ModalApollo.js +2 -3
- package/dist/prospect-client/Modal/ModalCommon.d.ts +4 -1
- package/dist/prospect-client/Modal/ModalCommon.js +1 -2
- package/dist/prospect-client/Modal/ModalLF.d.ts +4 -1
- package/dist/prospect-client/Modal/ModalLF.js +2 -3
- package/dist/prospect-client/Modal/components/ModalCore.d.ts +4 -1
- package/dist/prospect-client/Modal/components/ModalCore.js +3 -3
- package/dist/prospect-client/TabMenu/TabMenu.d.ts +36 -0
- package/dist/prospect-client/TabMenu/TabMenu.helpers.d.ts +1 -0
- package/dist/prospect-client/TabMenu/TabMenu.helpers.js +12 -0
- package/dist/prospect-client/TabMenu/TabMenu.js +39 -0
- package/dist/prospect-client/Toggle/ToggleApollo.d.ts +4 -1
- package/dist/prospect-client/Toggle/ToggleApollo.js +1 -2
- package/dist/prospect-client/Toggle/ToggleCommon.d.ts +4 -3
- package/dist/prospect-client/Toggle/ToggleCommon.js +4 -4
- package/dist/prospect-client/Toggle/ToggleLF.d.ts +4 -1
- package/dist/prospect-client/Toggle/ToggleLF.js +1 -2
- package/dist/prospect.d.ts +4 -4
- package/dist/prospect.js +4 -4
- package/package.json +3 -3
- package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionApollo.d.ts +0 -3
- package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionApollo.js +0 -6
- package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionCommon.js +0 -16
- package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionLF.d.ts +0 -3
- package/dist/prospect-client/Form/Radio/CardRadioOption/CardRadioOptionLF.js +0 -6
package/dist/client.d.ts
CHANGED
|
@@ -36,10 +36,8 @@ InputText as TextInput, } from "./prospect-client/Form/InputText/InputTextLF";
|
|
|
36
36
|
export { InputTextAtom } from "./prospect-client/Form/InputTextAtom/InputTextAtomLF";
|
|
37
37
|
export { ItemLabel } from "./prospect-client/Form/ItemLabel/ItemLabelLF";
|
|
38
38
|
export { ItemMessage, itemMessageVariants, type ItemMessageVariants, } from "./prospect-client/Form/ItemMessage/ItemMessageLF";
|
|
39
|
-
export {
|
|
40
|
-
|
|
41
|
-
CardRadioGroup as CardRadio, CardRadioGroup, } from "./prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupLF";
|
|
42
|
-
export { CardRadioOption } from "./prospect-client/Form/Radio/CardRadioOption/CardRadioOptionLF";
|
|
39
|
+
export { CardRadio } from "./prospect-client/Form/Radio/CardRadio/CardRadioLF";
|
|
40
|
+
export { CardRadioGroup } from "./prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupLF";
|
|
43
41
|
export { Radio } from "./prospect-client/Form/Radio/Radio/RadioLF";
|
|
44
42
|
export { RadioText, type RadioTextProps, } from "./prospect-client/Form/Radio/RadioText/RadioTextLF";
|
|
45
43
|
export { TextArea } from "./prospect-client/Form/TextArea/TextAreaLF";
|
|
@@ -47,6 +45,8 @@ export { DebugGrid } from "./prospect-client/Grid/DebugGridLF";
|
|
|
47
45
|
export { Heading, type HeadingLevel, type HeadingProps, } from "./prospect-client/Heading/HeadingLF";
|
|
48
46
|
export { Icon, iconSizeVariants, iconVariants, type IconSizeVariants, type IconVariants, } from "./prospect-client/Icon/IconLF";
|
|
49
47
|
export { ItemTabBar, type ItemTabBarProps, } from "./prospect-client/ItemTabBar/ItemTabBarLF";
|
|
48
|
+
export { ItemMenu, type ItemMenuProps, } from "./prospect-client/ItemMenu/ItemMenuLF";
|
|
49
|
+
export { TabMenu, type TabMenuProps } from "./prospect-client/TabMenu/TabMenu";
|
|
50
50
|
export { ExitLayout, type ExitLayoutProps, type ExitLayoutWithSubComponents, } from "./prospect-client/Layout/ExitLayout/ExitLayoutLF";
|
|
51
51
|
export { Footer, type FooterProps, } from "./prospect-client/Layout/Footer/FooterLF";
|
|
52
52
|
export { FormLayout, type FormLayoutProps, } from "./prospect-client/Layout/FormLayout/FormLayout";
|
package/dist/client.js
CHANGED
|
@@ -36,10 +36,8 @@ InputText as TextInput, } from "./prospect-client/Form/InputText/InputTextLF";
|
|
|
36
36
|
export { InputTextAtom } from "./prospect-client/Form/InputTextAtom/InputTextAtomLF";
|
|
37
37
|
export { ItemLabel } from "./prospect-client/Form/ItemLabel/ItemLabelLF";
|
|
38
38
|
export { ItemMessage, itemMessageVariants, } from "./prospect-client/Form/ItemMessage/ItemMessageLF";
|
|
39
|
-
export {
|
|
40
|
-
|
|
41
|
-
CardRadioGroup as CardRadio, CardRadioGroup, } from "./prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupLF";
|
|
42
|
-
export { CardRadioOption } from "./prospect-client/Form/Radio/CardRadioOption/CardRadioOptionLF";
|
|
39
|
+
export { CardRadio } from "./prospect-client/Form/Radio/CardRadio/CardRadioLF";
|
|
40
|
+
export { CardRadioGroup } from "./prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupLF";
|
|
43
41
|
export { Radio } from "./prospect-client/Form/Radio/Radio/RadioLF";
|
|
44
42
|
export { RadioText, } from "./prospect-client/Form/Radio/RadioText/RadioTextLF";
|
|
45
43
|
export { TextArea } from "./prospect-client/Form/TextArea/TextAreaLF";
|
|
@@ -47,6 +45,8 @@ export { DebugGrid } from "./prospect-client/Grid/DebugGridLF";
|
|
|
47
45
|
export { Heading, } from "./prospect-client/Heading/HeadingLF";
|
|
48
46
|
export { Icon, iconSizeVariants, iconVariants, } from "./prospect-client/Icon/IconLF";
|
|
49
47
|
export { ItemTabBar, } from "./prospect-client/ItemTabBar/ItemTabBarLF";
|
|
48
|
+
export { ItemMenu, } from "./prospect-client/ItemMenu/ItemMenuLF";
|
|
49
|
+
export { TabMenu } from "./prospect-client/TabMenu/TabMenu";
|
|
50
50
|
export { ExitLayout, } from "./prospect-client/Layout/ExitLayout/ExitLayoutLF";
|
|
51
51
|
export { Footer, } from "./prospect-client/Layout/Footer/FooterLF";
|
|
52
52
|
export { FormLayout, } from "./prospect-client/Layout/FormLayout/FormLayout";
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/distributeur/Action/Action.css";
|
|
2
|
-
|
|
2
|
+
import { type ComponentPropsWithRef } from "react";
|
|
3
|
+
type ActionCoreProps = ComponentPropsWithRef<"a"> & {
|
|
3
4
|
icon: string;
|
|
4
5
|
/** @deprecated Use `className` instead. */
|
|
5
6
|
classModifier?: string;
|
|
6
|
-
}
|
|
7
|
+
};
|
|
8
|
+
export declare const Action: {
|
|
9
|
+
({ icon, className, classModifier, ...otherProps }: ActionCoreProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
displayName: string;
|
|
11
|
+
};
|
|
12
|
+
export {};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Action/Action.css";
|
|
3
3
|
import classNames from "classnames";
|
|
4
|
-
import {
|
|
4
|
+
import {} from "react";
|
|
5
5
|
import { getClassName } from "../utilities/helpers/getClassName";
|
|
6
|
-
export const Action =
|
|
6
|
+
export const Action = ({ icon, className, classModifier, ...otherProps }) => {
|
|
7
7
|
const componentClassName = classNames("btn", getClassName({
|
|
8
8
|
baseClassName: "af-btn--circle",
|
|
9
9
|
modifiers: classModifier?.split(" "),
|
|
10
10
|
className,
|
|
11
11
|
}));
|
|
12
|
-
return (_jsx("a", { ...otherProps, className: componentClassName,
|
|
13
|
-
}
|
|
12
|
+
return (_jsx("a", { ...otherProps, className: componentClassName, children: _jsx("i", { role: "img", className: `glyphicon glyphicon-${icon}` }) }));
|
|
13
|
+
};
|
|
14
14
|
Action.displayName = "Action";
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
1
|
+
import { type ComponentPropsWithRef, type PropsWithChildren, type ReactNode } from "react";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Button/Button.css";
|
|
3
3
|
export type ButtonVariant = "primary" | "secondary" | "validated" | "danger" | "ghost" | "ghost-reverse";
|
|
4
|
-
|
|
4
|
+
type ButtonProps = PropsWithChildren<{
|
|
5
5
|
variant?: ButtonVariant;
|
|
6
6
|
small?: boolean;
|
|
7
7
|
leftIcon?: ReactNode;
|
|
8
8
|
rightIcon?: ReactNode;
|
|
9
|
-
} &
|
|
10
|
-
|
|
11
|
-
}
|
|
9
|
+
} & ComponentPropsWithRef<"button">>;
|
|
10
|
+
export declare const Button: {
|
|
11
|
+
({ variant, small, leftIcon, rightIcon, className, children, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import classNames from "classnames";
|
|
3
|
-
import {
|
|
3
|
+
import {} from "react";
|
|
4
4
|
import "@axa-fr/canopee-css/distributeur/Button/Button.css";
|
|
5
5
|
const DEFAULT_CLASS_NAME = "af-btn";
|
|
6
|
-
export const Button =
|
|
6
|
+
export const Button = ({ variant = "primary", small, leftIcon, rightIcon, className, children, ...props }) => (_jsxs("button", { type: "button", className: classNames(DEFAULT_CLASS_NAME, variant !== "primary" && `${DEFAULT_CLASS_NAME}--${variant}`, small && `${DEFAULT_CLASS_NAME}--small`, className), ...props, children: [leftIcon, children, rightIcon] }));
|
|
7
7
|
Button.displayName = "Button";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
2
|
import type { Option } from "../core";
|
|
3
3
|
import { CheckboxItem } from "./CheckboxItem";
|
|
4
4
|
import { CheckboxModes } from "./CheckboxModes";
|
|
@@ -13,7 +13,7 @@ type OnChange = {
|
|
|
13
13
|
id?: string;
|
|
14
14
|
}) => void;
|
|
15
15
|
};
|
|
16
|
-
type Props = Omit<
|
|
16
|
+
type Props = Omit<ComponentPropsWithRef<typeof CheckboxItem>, "value" | "label" | "checked" | "onChange"> & {
|
|
17
17
|
options: Option[];
|
|
18
18
|
values?: string[];
|
|
19
19
|
children?: ReactNode;
|
|
@@ -22,5 +22,8 @@ type Props = Omit<ComponentProps<typeof CheckboxItem>, "value" | "label" | "chec
|
|
|
22
22
|
*/
|
|
23
23
|
mode?: keyof typeof CheckboxModes;
|
|
24
24
|
} & OnChange;
|
|
25
|
-
export declare const Checkbox:
|
|
25
|
+
export declare const Checkbox: {
|
|
26
|
+
({ id, name, options, disabled, children, values, mode, onChange, ...otherProps }: Props): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
26
29
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { createElement as _createElement } from "react";
|
|
3
|
-
import React, {
|
|
3
|
+
import React, {} from "react";
|
|
4
4
|
import { CheckboxItem } from "./CheckboxItem";
|
|
5
5
|
import { CheckboxModes } from "./CheckboxModes";
|
|
6
6
|
const defaultClassName = (mode) => {
|
|
@@ -13,7 +13,7 @@ const defaultClassName = (mode) => {
|
|
|
13
13
|
return `af-form__checkbox-${mode}`;
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
|
-
const CheckboxInner =
|
|
16
|
+
const CheckboxInner = ({ id, name, options, disabled, children, values = [], mode = CheckboxModes.default, onChange = () => { }, ...otherProps }) => {
|
|
17
17
|
const className = defaultClassName(mode);
|
|
18
18
|
const handleOnChange = ({ target: { value, checked }, }) => {
|
|
19
19
|
const newValues = checked
|
|
@@ -23,8 +23,8 @@ const CheckboxInner = forwardRef(({ id, name, options, disabled, children, value
|
|
|
23
23
|
};
|
|
24
24
|
return (_jsx("div", { className: "af-form__checkbox-container", children: options.map((option) => {
|
|
25
25
|
const isChecked = values ? values.indexOf(option.value) >= 0 : false;
|
|
26
|
-
return (_createElement(CheckboxItem, { ...otherProps, onChange: handleOnChange, key: option.value, className: className, isChecked: isChecked, name: name, disabled: option.disabled || disabled,
|
|
26
|
+
return (_createElement(CheckboxItem, { ...otherProps, onChange: handleOnChange, key: option.value, className: className, isChecked: isChecked, name: name, disabled: option.disabled || disabled, ...option }, children));
|
|
27
27
|
}) }));
|
|
28
|
-
}
|
|
28
|
+
};
|
|
29
29
|
CheckboxInner.displayName = "Checkbox";
|
|
30
30
|
export const Checkbox = CheckboxInner;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
2
|
import { type ConsumerFieldProps } from "../core";
|
|
3
3
|
import { Checkbox } from "./Checkbox";
|
|
4
|
-
type Props = Omit<
|
|
5
|
-
declare const CheckboxInput:
|
|
4
|
+
type Props = Omit<ComponentPropsWithRef<typeof Checkbox> & ConsumerFieldProps, "placeholder">;
|
|
5
|
+
declare const CheckboxInput: {
|
|
6
|
+
({ label, mode, options, children, ...otherProps }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
6
9
|
export { CheckboxInput };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import {} from "react";
|
|
3
3
|
import { Field, useOptionsWithId } from "../core";
|
|
4
4
|
import { Checkbox } from "./Checkbox";
|
|
5
5
|
import { CheckboxModes } from "./CheckboxModes";
|
|
6
|
-
const CheckboxInput =
|
|
6
|
+
const CheckboxInput = ({ label, mode = "default", options, children, ...otherProps }) => {
|
|
7
7
|
const newOptions = useOptionsWithId(options);
|
|
8
8
|
return (_jsx(Field, { label: label, labelPosition: mode === CheckboxModes.classic ? "top" : "center", roleContainer: "group", ...otherProps, renderInput: ({ classModifier, id, ariaInvalid, errorId, ...props }) => {
|
|
9
|
-
return (_jsxs(_Fragment, { children: [_jsx(Checkbox, { id: id, mode: mode, options: newOptions, classModifier: ariaInvalid ? `${classModifier} error` : classModifier,
|
|
9
|
+
return (_jsxs(_Fragment, { children: [_jsx(Checkbox, { id: id, mode: mode, options: newOptions, classModifier: ariaInvalid ? `${classModifier} error` : classModifier, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...props }), children] }));
|
|
10
10
|
} }));
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
12
|
CheckboxInput.displayName = "CheckboxInput";
|
|
13
13
|
export { CheckboxInput };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Form/Checkbox/Checkbox.css";
|
|
3
|
-
|
|
3
|
+
type Props = Omit<ComponentPropsWithRef<"input">, "type"> & {
|
|
4
4
|
/** @deprecated Use `className` instead. */
|
|
5
5
|
classModifier?: string;
|
|
6
6
|
optionClassName?: string;
|
|
@@ -8,5 +8,9 @@ declare const CheckboxItem: import("react").ForwardRefExoticComponent<Omit<Omit<
|
|
|
8
8
|
label?: ReactNode;
|
|
9
9
|
isChecked?: boolean;
|
|
10
10
|
variant?: "error" | "warning";
|
|
11
|
-
}
|
|
11
|
+
};
|
|
12
|
+
declare const CheckboxItem: {
|
|
13
|
+
({ disabled, value, id, children, label, isChecked, className, classModifier, variant, ...otherProps }: Props): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
displayName: string;
|
|
15
|
+
};
|
|
12
16
|
export { CheckboxItem };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import check from "@material-symbols/svg-700/sharp/check.svg";
|
|
3
|
-
import {
|
|
3
|
+
import { useId } from "react";
|
|
4
4
|
import { getOptionClassName } from "../core";
|
|
5
5
|
import "@axa-fr/canopee-css/distributeur/Form/Checkbox/Checkbox.css";
|
|
6
6
|
import { Svg } from "../../Svg";
|
|
7
|
-
const CheckboxItem =
|
|
7
|
+
const CheckboxItem = ({ disabled = false, value = "", id, children, label, isChecked, className, classModifier, variant, ...otherProps }) => {
|
|
8
8
|
const newLabel = children || label;
|
|
9
9
|
const generatedId = useId();
|
|
10
10
|
const newId = id ?? generatedId; // id is required on this component
|
|
11
11
|
const optionClassName = getOptionClassName(className ?? "", classModifier ?? "", "af-form__checkbox", disabled, variant);
|
|
12
|
-
return (_jsxs("div", { className: optionClassName, children: [_jsx("input", { ...otherProps, className: "af-form__input-checkbox", value: value, id: newId, disabled: disabled, checked: isChecked, type: "checkbox"
|
|
13
|
-
}
|
|
12
|
+
return (_jsxs("div", { className: optionClassName, children: [_jsx("input", { ...otherProps, className: "af-form__input-checkbox", value: value, id: newId, disabled: disabled, checked: isChecked, type: "checkbox" }), _jsxs("label", { className: "af-form__label", htmlFor: newId, children: [_jsx("span", { className: "af-form__indicator", children: _jsx(Svg, { role: "presentation", className: "ok-icon", src: check }) }), _jsx("span", { className: "af-form__description", children: newLabel })] })] }));
|
|
13
|
+
};
|
|
14
14
|
CheckboxItem.displayName = "CheckboxItem";
|
|
15
15
|
export { CheckboxItem };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
2
|
import { Radio } from "../Radio";
|
|
3
3
|
import { type Option } from "../core";
|
|
4
|
-
type Props = Omit<
|
|
4
|
+
type Props = Omit<ComponentPropsWithRef<typeof Radio>, "options" | "value"> & {
|
|
5
5
|
id: string;
|
|
6
6
|
name?: string;
|
|
7
7
|
options?: Array<Omit<Option, "value"> & {
|
|
@@ -11,5 +11,8 @@ type Props = Omit<ComponentProps<typeof Radio>, "options" | "value"> & {
|
|
|
11
11
|
/** @deprecated Use `className` instead. */
|
|
12
12
|
classModifier?: string;
|
|
13
13
|
};
|
|
14
|
-
declare const Choice:
|
|
14
|
+
declare const Choice: {
|
|
15
|
+
({ children, value, options, name, ...otherProps }: Props): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
displayName: string;
|
|
17
|
+
};
|
|
15
18
|
export { Choice };
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useId } from "react";
|
|
3
3
|
import { Radio } from "../Radio";
|
|
4
4
|
import { useOptionsWithId } from "../core";
|
|
5
5
|
const defaultOptions = [
|
|
6
6
|
{ label: "Oui", value: true },
|
|
7
7
|
{ label: "Non", value: false },
|
|
8
8
|
];
|
|
9
|
-
const Choice =
|
|
9
|
+
const Choice = ({ children, value, options = defaultOptions, name, ...otherProps }) => {
|
|
10
10
|
const choiceOptions = useOptionsWithId(options.map((o) => ({
|
|
11
11
|
...o,
|
|
12
12
|
value: `${o.value}`,
|
|
13
13
|
})));
|
|
14
14
|
const generatedId = useId();
|
|
15
|
-
return (_jsx(Radio, { ...otherProps, mode: "default",
|
|
16
|
-
}
|
|
15
|
+
return (_jsx(Radio, { ...otherProps, mode: "default", name: name ?? `choice_${generatedId}`, value: value?.toString(), options: choiceOptions, children: children }));
|
|
16
|
+
};
|
|
17
17
|
Choice.displayName = "Choice";
|
|
18
18
|
export { Choice };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
2
|
import { type ConsumerFieldProps } from "../core";
|
|
3
3
|
import { Choice } from "./Choice";
|
|
4
|
-
type Props =
|
|
5
|
-
declare const ChoiceInput:
|
|
4
|
+
type Props = ComponentPropsWithRef<typeof Choice> & ConsumerFieldProps;
|
|
5
|
+
declare const ChoiceInput: {
|
|
6
|
+
({ label, options, children, ...otherProps }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
6
9
|
export { ChoiceInput };
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import {} from "react";
|
|
3
3
|
import { Field } from "../core";
|
|
4
4
|
import { Choice } from "./Choice";
|
|
5
5
|
const defaultOptions = [
|
|
6
6
|
{ label: "Oui", value: true },
|
|
7
7
|
{ label: "Non", value: false },
|
|
8
8
|
];
|
|
9
|
-
const ChoiceInput =
|
|
10
|
-
return (_jsx(Field, { label: label, roleContainer: "radiogroup", ...otherProps, renderInput: ({ classModifier, id, errorId, ariaInvalid, ...props }) => (_jsxs(_Fragment, { children: [_jsx(Choice, { id: id, ref: inputRef, classModifier: classModifier, "aria-describedby": errorId, "aria-invalid": ariaInvalid, options: options, ...props }), children] })) }));
|
|
11
|
-
});
|
|
9
|
+
const ChoiceInput = ({ label, options = defaultOptions, children, ...otherProps }) => (_jsx(Field, { label: label, roleContainer: "radiogroup", ...otherProps, renderInput: ({ classModifier, id, errorId, ariaInvalid, ...props }) => (_jsxs(_Fragment, { children: [_jsx(Choice, { id: id, classModifier: classModifier, "aria-describedby": errorId, "aria-invalid": ariaInvalid, options: options, ...props }), children] })) }));
|
|
12
10
|
ChoiceInput.displayName = "ChoiceInput";
|
|
13
11
|
export { ChoiceInput };
|
|
@@ -6,5 +6,8 @@ type Props = Omit<ComponentPropsWithRef<"input">, "value"> & {
|
|
|
6
6
|
defaultValue?: Date | string;
|
|
7
7
|
value?: Date | string;
|
|
8
8
|
};
|
|
9
|
-
declare const Date:
|
|
9
|
+
declare const Date: {
|
|
10
|
+
({ className, classModifier, defaultValue, value, ...otherProps }: Props): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
displayName: string;
|
|
12
|
+
};
|
|
10
13
|
export { Date };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Form/Date/Date.css";
|
|
3
|
-
import {
|
|
3
|
+
import {} from "react";
|
|
4
4
|
import { formatDateInputValue } from "../../utilities/helpers/date";
|
|
5
5
|
import { getClassName } from "../../utilities/helpers/getClassName";
|
|
6
|
-
const Date =
|
|
6
|
+
const Date = ({ className, classModifier, defaultValue, value, ...otherProps }) => {
|
|
7
7
|
const componentClassName = getClassName({
|
|
8
8
|
baseClassName: "af-form__input-date",
|
|
9
9
|
modifiers: classModifier?.split(" "),
|
|
10
10
|
className,
|
|
11
11
|
});
|
|
12
|
-
return (_jsx("input", { className: componentClassName, type: "date", defaultValue: formatDateInputValue(defaultValue), value: formatDateInputValue(value),
|
|
13
|
-
}
|
|
12
|
+
return (_jsx("input", { className: componentClassName, type: "date", defaultValue: formatDateInputValue(defaultValue), value: formatDateInputValue(value), disabled: classModifier?.includes("disabled"), required: classModifier?.includes("required"), ...otherProps }));
|
|
13
|
+
};
|
|
14
14
|
Date.displayName = "Date";
|
|
15
15
|
export { Date };
|
|
@@ -4,5 +4,8 @@ import { Date } from "./Date";
|
|
|
4
4
|
type Props = ConsumerFieldProps & ComponentProps<typeof Date> & {
|
|
5
5
|
helpMessage?: ReactNode;
|
|
6
6
|
};
|
|
7
|
-
declare const DateInput:
|
|
7
|
+
declare const DateInput: {
|
|
8
|
+
({ children, ...otherProps }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
8
11
|
export { DateInput };
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import {} from "react";
|
|
3
3
|
import { Field } from "../core";
|
|
4
4
|
import { Date } from "./Date";
|
|
5
|
-
const DateInput =
|
|
6
|
-
return (_jsx(Field, { classNameSuffix: "date", ...otherProps, renderInput: ({ id, classModifier, ariaInvalid, errorId, ...props }) => (_jsxs(_Fragment, { children: [_jsx(Date, { id: id, classModifier: classModifier, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...props }), children] })) }));
|
|
7
|
-
});
|
|
5
|
+
const DateInput = ({ children, ...otherProps }) => (_jsx(Field, { classNameSuffix: "date", ...otherProps, renderInput: ({ id, classModifier, ariaInvalid, errorId, ...props }) => (_jsxs(_Fragment, { children: [_jsx(Date, { id: id, classModifier: classModifier, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...props }), children] })) }));
|
|
8
6
|
DateInput.displayName = "DateInput";
|
|
9
7
|
export { DateInput };
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import "@axa-fr/canopee-css/distributeur/Form/Experimental/Input.css";
|
|
2
|
-
|
|
2
|
+
import { type ComponentPropsWithRef } from "react";
|
|
3
|
+
declare const Input: {
|
|
4
|
+
({ className, ...otherProps }: ComponentPropsWithRef<"input">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
3
7
|
export { Input };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Form/Experimental/Input.css";
|
|
3
|
-
import {
|
|
3
|
+
import {} from "react";
|
|
4
4
|
import { getClassName } from "../../utilities/helpers/getClassName";
|
|
5
|
-
const Input =
|
|
5
|
+
const Input = ({ className, ...otherProps }) => {
|
|
6
6
|
const componentClassName = getClassName({
|
|
7
7
|
baseClassName: "af-input__input",
|
|
8
8
|
className,
|
|
9
9
|
});
|
|
10
|
-
return
|
|
11
|
-
}
|
|
10
|
+
return _jsx("input", { className: componentClassName, ...otherProps });
|
|
11
|
+
};
|
|
12
12
|
Input.displayName = "Input";
|
|
13
13
|
export { Input };
|
|
@@ -7,5 +7,8 @@ export type TextInputProps = Omit<ComponentProps<typeof Input>, "children"> & In
|
|
|
7
7
|
* It can be customized to render the label on top, or on the left of the input.
|
|
8
8
|
* It also supports adding a unit on the right of the input.
|
|
9
9
|
*/
|
|
10
|
-
declare const TextInput:
|
|
10
|
+
declare const TextInput: {
|
|
11
|
+
({ contentRight, id, labelPosition, inputClassName: inputClassNameProp, labelClassName: labelClassNameProp, helpMessage, containerClassName, required, label, errorMessage, ...props }: TextInputProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
displayName: string;
|
|
13
|
+
};
|
|
11
14
|
export { TextInput };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import {} from "react";
|
|
3
3
|
import { Input } from "./Input";
|
|
4
4
|
import { InputContainer } from "./InputContainer";
|
|
5
5
|
import { InputUnit } from "./InputUnit";
|
|
@@ -11,7 +11,7 @@ import { useInput } from "./useInput.hook";
|
|
|
11
11
|
* It can be customized to render the label on top, or on the left of the input.
|
|
12
12
|
* It also supports adding a unit on the right of the input.
|
|
13
13
|
*/
|
|
14
|
-
const TextInput =
|
|
14
|
+
const TextInput = ({ contentRight, id, labelPosition, inputClassName: inputClassNameProp, labelClassName: labelClassNameProp, helpMessage, containerClassName, required, label, errorMessage, ...props }) => {
|
|
15
15
|
const { describedBy, errorId, helperId, inputClassName, inputId, isContainerVertical, isInvalid, labelClassName, } = useInput({
|
|
16
16
|
id,
|
|
17
17
|
labelPosition,
|
|
@@ -20,7 +20,7 @@ const TextInput = forwardRef(({ contentRight, id, labelPosition, inputClassName:
|
|
|
20
20
|
errorMessage,
|
|
21
21
|
helpMessage,
|
|
22
22
|
});
|
|
23
|
-
return (_jsxs(InputContainer, { vertical: isContainerVertical, className: containerClassName, children: [_jsx(Label, { htmlFor: inputId, required: required, className: labelClassName, children: label }), _jsx(Input, { ...props, className: inputClassName, id: inputId,
|
|
24
|
-
}
|
|
23
|
+
return (_jsxs(InputContainer, { vertical: isContainerVertical, className: containerClassName, children: [_jsx(Label, { htmlFor: inputId, required: required, className: labelClassName, children: label }), _jsx(Input, { ...props, className: inputClassName, id: inputId, "aria-describedby": describedBy, "aria-invalid": isInvalid }), contentRight ? _jsx(InputUnit, { children: contentRight }) : null, helpMessage ? (_jsx(ItemMessage, { id: helperId, children: helpMessage })) : null, errorMessage ? (_jsx(ItemMessage, { variant: "error", id: errorId, children: errorMessage })) : null] }));
|
|
24
|
+
};
|
|
25
25
|
TextInput.displayName = "TextInput";
|
|
26
26
|
export { TextInput };
|
|
@@ -4,5 +4,8 @@ type Props = Omit<ComponentPropsWithRef<"input">, "type"> & {
|
|
|
4
4
|
/** @deprecated Use `className` and the native `required` prop instead. */
|
|
5
5
|
classModifier?: string;
|
|
6
6
|
};
|
|
7
|
-
declare const Number:
|
|
7
|
+
declare const Number: {
|
|
8
|
+
({ id, className, classModifier, required, ...otherProps }: Props): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
displayName: string;
|
|
10
|
+
};
|
|
8
11
|
export { Number };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/distributeur/Form/Text/Text.css";
|
|
3
|
-
import {
|
|
3
|
+
import { useId } from "react";
|
|
4
4
|
import { getClassName } from "../../utilities/helpers/getClassName";
|
|
5
|
-
const Number =
|
|
5
|
+
const Number = ({ id, className, classModifier, required, ...otherProps }) => {
|
|
6
6
|
const inputUseId = useId();
|
|
7
7
|
const inputId = id ?? inputUseId;
|
|
8
8
|
const componentClassName = getClassName({
|
|
@@ -10,7 +10,7 @@ const Number = forwardRef(({ id, className, classModifier, required, ...otherPro
|
|
|
10
10
|
modifiers: classModifier?.split(" "),
|
|
11
11
|
className,
|
|
12
12
|
});
|
|
13
|
-
return (_jsx("input", { className: componentClassName, id: inputId, type: "number",
|
|
14
|
-
}
|
|
13
|
+
return (_jsx("input", { className: componentClassName, id: inputId, type: "number", required: required || classModifier?.includes("required"), ...otherProps }));
|
|
14
|
+
};
|
|
15
15
|
Number.displayName = "Number";
|
|
16
16
|
export { Number };
|
|
@@ -8,5 +8,8 @@ type Props = Omit<ComponentPropsWithRef<"input">, "type" | "role"> & {
|
|
|
8
8
|
/**
|
|
9
9
|
* @deprecated The Pass component is deprecated and will be removed in a future release
|
|
10
10
|
*/
|
|
11
|
-
declare const Pass:
|
|
11
|
+
declare const Pass: {
|
|
12
|
+
({ onToggleType, type, className, classModifier, ...inputProps }: Props): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
displayName: string;
|
|
14
|
+
};
|
|
12
15
|
export { Pass };
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import {} from "react";
|
|
3
3
|
import { getComponentClassName } from "../../utilities";
|
|
4
4
|
import "@axa-fr/canopee-css/distributeur/Form/Pass/Pass.css";
|
|
5
5
|
/**
|
|
6
6
|
* @deprecated The Pass component is deprecated and will be removed in a future release
|
|
7
7
|
*/
|
|
8
|
-
const Pass =
|
|
8
|
+
const Pass = ({ onToggleType, type = "password", className, classModifier, ...inputProps }) => {
|
|
9
9
|
const componentClassName = getComponentClassName(className, classModifier, "af-form__pass");
|
|
10
|
-
return (_jsxs("div", { className: componentClassName, children: [_jsx("div", { className: "af-form__pass-strength" }), _jsx("input", { ...inputProps, role: type === "password" ? "password" : "textbox", className: "af-form__input-text", type: type,
|
|
11
|
-
}
|
|
10
|
+
return (_jsxs("div", { className: componentClassName, children: [_jsx("div", { className: "af-form__pass-strength" }), _jsx("input", { ...inputProps, role: type === "password" ? "password" : "textbox", className: "af-form__input-text", type: type, required: classModifier?.includes("required") }), _jsx("button", { className: "af-form__pass-btn", type: "button", "aria-label": "show password", onClick: onToggleType, children: _jsx("i", { className: `glyphicon glyphicon-eye${type === "text" ? "-close" : "-open"}` }) })] }));
|
|
11
|
+
};
|
|
12
12
|
Pass.displayName = "Pass";
|
|
13
13
|
export { Pass };
|
|
@@ -1,33 +1,22 @@
|
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
1
2
|
import type { Option } from "../core";
|
|
3
|
+
import { RadioCardGroup } from "./RadioCardGroup";
|
|
4
|
+
import { RadioItem } from "./RadioItem";
|
|
2
5
|
export declare enum RadioModes {
|
|
3
6
|
classic = "classic",
|
|
4
7
|
default = "default",
|
|
5
8
|
inline = "inline",
|
|
6
9
|
cardRadio = "cardRadio"
|
|
7
10
|
}
|
|
8
|
-
|
|
11
|
+
type Props = {
|
|
9
12
|
options: Option[];
|
|
10
|
-
} & Omit<
|
|
11
|
-
options: ({
|
|
12
|
-
id?: string;
|
|
13
|
-
icon?: import("react").ReactNode;
|
|
14
|
-
label: import("react").ReactNode;
|
|
15
|
-
description?: import("react").ReactNode;
|
|
16
|
-
value: string;
|
|
17
|
-
} & import("react").InputHTMLAttributes<HTMLInputElement> & {
|
|
18
|
-
action?: import("react").ReactNode;
|
|
19
|
-
})[];
|
|
20
|
-
orientation?: "horizontal" | "vertical";
|
|
21
|
-
}, "ref"> & {
|
|
22
|
-
mode: "cardRadio";
|
|
23
|
-
}) | Omit<{
|
|
24
|
-
options: Option[];
|
|
25
|
-
} & Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "type" | "checked"> & {
|
|
26
|
-
classModifier?: string;
|
|
27
|
-
optionClassName?: string;
|
|
28
|
-
label?: import("react").ReactNode;
|
|
29
|
-
isChecked?: boolean;
|
|
30
|
-
}, "ref"> & import("react").RefAttributes<HTMLInputElement>, "className" | "id" | "label"> & {
|
|
13
|
+
} & ((Omit<ComponentPropsWithRef<typeof RadioItem>, "id" | "label" | "className"> & {
|
|
31
14
|
mode?: "classic" | "default" | "inline";
|
|
32
|
-
}
|
|
15
|
+
}) | (ComponentPropsWithRef<typeof RadioCardGroup> & {
|
|
16
|
+
mode: "cardRadio";
|
|
17
|
+
}));
|
|
18
|
+
declare const Radio: {
|
|
19
|
+
({ options, value, children, disabled, ...otherProps }: Props): import("react/jsx-runtime").JSX.Element;
|
|
20
|
+
displayName: string;
|
|
21
|
+
};
|
|
33
22
|
export { Radio };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createElement as _createElement } from "react";
|
|
2
2
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import classNames from "classnames";
|
|
4
|
-
import {
|
|
4
|
+
import {} from "react";
|
|
5
5
|
import { RadioCardGroup } from "./RadioCardGroup";
|
|
6
6
|
import { RadioItem } from "./RadioItem";
|
|
7
7
|
export var RadioModes;
|
|
@@ -23,7 +23,7 @@ const getClassNameMode = (mode) => {
|
|
|
23
23
|
return "af-form__radio-custom";
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
|
-
const Radio =
|
|
26
|
+
const Radio = ({ options, value = "", children, disabled, ...otherProps }) => {
|
|
27
27
|
const { mode, ...onlyNecessaryProps } = otherProps;
|
|
28
28
|
const classNameMode = getClassNameMode(mode ?? "default");
|
|
29
29
|
if (mode === "cardRadio") {
|
|
@@ -31,7 +31,7 @@ const Radio = forwardRef(({ options, value = "", children, disabled, ...otherPro
|
|
|
31
31
|
}
|
|
32
32
|
return (_jsxs(_Fragment, { children: [_jsx("div", { className: classNames("af-form__radio-group", [
|
|
33
33
|
{ "af-form__radio-group-classic": mode === RadioModes.classic },
|
|
34
|
-
]), children: options.map((option) => (_createElement(RadioItem, { ...onlyNecessaryProps, key: option.value, isChecked: option.value === value, disabled: option.disabled || disabled, className: classNameMode,
|
|
35
|
-
}
|
|
34
|
+
]), children: options.map((option) => (_createElement(RadioItem, { ...onlyNecessaryProps, key: option.value, isChecked: option.value === value, disabled: option.disabled || disabled, className: classNameMode, ...option }))) }), children] }));
|
|
35
|
+
};
|
|
36
36
|
Radio.displayName = "EnhancedInputRadio";
|
|
37
37
|
export { Radio };
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
-
import { type
|
|
1
|
+
import { type ComponentPropsWithRef } from "react";
|
|
2
2
|
import { type ConsumerFieldProps } from "../core";
|
|
3
3
|
import { Radio } from "./Radio";
|
|
4
|
-
type RadioInputProps = ConsumerFieldProps &
|
|
5
|
-
declare const RadioInput:
|
|
4
|
+
type RadioInputProps = ConsumerFieldProps & ComponentPropsWithRef<typeof Radio>;
|
|
5
|
+
declare const RadioInput: {
|
|
6
|
+
({ label, mode, options, children, ...props }: RadioInputProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
displayName: string;
|
|
8
|
+
};
|
|
6
9
|
export { RadioInput };
|