@axa-fr/design-system-apollo-react 1.0.3-ci.139 → 1.0.5-alpha.243
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/BasePicture/BasePictureApollo.d.ts +2 -0
- package/dist/BasePicture/BasePictureApollo.js +2 -0
- package/dist/BasePicture/BasePictureCommon.d.ts +1 -0
- package/dist/BasePicture/BasePictureCommon.js +8 -0
- package/dist/BasePicture/BasePictureLF.d.ts +2 -0
- package/dist/BasePicture/BasePictureLF.js +2 -0
- package/dist/CardMessage/CardMessageApollo.d.ts +2 -0
- package/dist/CardMessage/CardMessageApollo.js +2 -0
- package/dist/CardMessage/CardMessageCommon.d.ts +14 -0
- package/dist/CardMessage/CardMessageCommon.js +15 -0
- package/dist/CardMessage/CardMessageLF.d.ts +2 -0
- package/dist/CardMessage/CardMessageLF.js +2 -0
- package/dist/ClickIcon/ClickIconApollo.d.ts +2 -0
- package/dist/ClickIcon/ClickIconApollo.js +2 -0
- package/dist/ClickIcon/ClickIconCommon.d.ts +9 -0
- package/dist/ClickIcon/ClickIconCommon.js +3 -0
- package/dist/ClickIcon/ClickIconLF.d.ts +2 -0
- package/dist/ClickIcon/ClickIconLF.js +2 -0
- package/dist/Divider/DividerApollo.d.ts +2 -0
- package/dist/Divider/DividerApollo.js +2 -0
- package/dist/Divider/DividerCommon.d.ts +6 -0
- package/dist/Divider/DividerCommon.js +7 -0
- package/dist/Divider/DividerLF.d.ts +2 -0
- package/dist/Divider/DividerLF.js +2 -0
- package/dist/Form/DateInput/DateInput.helper.d.ts +1 -0
- package/dist/Form/DateInput/DateInput.helper.js +20 -0
- package/dist/Form/DateInput/DateInputApollo.d.ts +4 -0
- package/dist/Form/DateInput/DateInputApollo.js +6 -0
- package/dist/Form/DateInput/DateInputCommon.d.ts +17 -0
- package/dist/Form/DateInput/DateInputCommon.js +15 -0
- package/dist/Form/DateInput/DateInputLF.d.ts +4 -0
- package/dist/Form/DateInput/DateInputLF.js +6 -0
- package/dist/Form/ItemLabel/ItemLabelApollo.d.ts +4 -0
- package/dist/Form/ItemLabel/ItemLabelApollo.js +5 -0
- package/dist/Form/ItemLabel/ItemLabelCommon.d.ts +16 -0
- package/dist/Form/ItemLabel/ItemLabelCommon.js +8 -0
- package/dist/Form/ItemLabel/ItemLabelLF.d.ts +4 -0
- package/dist/Form/ItemLabel/ItemLabelLF.js +5 -0
- package/dist/Form/ItemMessage/ItemMessageCommon.d.ts +3 -3
- package/dist/Form/ItemMessage/ItemMessageCommon.js +6 -1
- package/dist/Form/Select/SelectApollo.d.ts +4 -0
- package/dist/Form/Select/SelectApollo.js +6 -0
- package/dist/Form/Select/SelectCommon.d.ts +19 -0
- package/dist/Form/Select/SelectCommon.js +13 -0
- package/dist/Form/Select/SelectLF.d.ts +4 -0
- package/dist/Form/Select/SelectLF.js +6 -0
- package/dist/Form/TextArea/TextAreaApollo.d.ts +4 -0
- package/dist/Form/TextArea/TextAreaApollo.js +6 -0
- package/dist/Form/TextArea/TextAreaCommon.d.ts +18 -0
- package/dist/Form/TextArea/TextAreaCommon.js +13 -0
- package/dist/Form/TextArea/TextAreaLF.d.ts +4 -0
- package/dist/Form/TextArea/TextAreaLF.js +6 -0
- package/dist/Form/TextInput/TextInputApollo.d.ts +4 -0
- package/dist/Form/TextInput/TextInputApollo.js +6 -0
- package/dist/Form/TextInput/TextInputCommon.d.ts +15 -0
- package/dist/Form/TextInput/TextInputCommon.js +14 -0
- package/dist/Form/TextInput/TextInputLF.d.ts +4 -0
- package/dist/Form/TextInput/TextInputLF.js +6 -0
- package/dist/Icon/IconApollo.d.ts +2 -0
- package/dist/Icon/IconApollo.js +2 -0
- package/dist/Icon/IconCommon.d.ts +21 -0
- package/dist/Icon/IconCommon.js +28 -0
- package/dist/Icon/IconLF.d.ts +2 -0
- package/dist/Icon/IconLF.js +2 -0
- package/dist/Link/LinkApollo.d.ts +2 -0
- package/dist/Link/LinkApollo.js +2 -0
- package/dist/Link/LinkCommon.d.ts +17 -0
- package/dist/Link/LinkCommon.js +19 -0
- package/dist/Link/LinkLF.d.ts +2 -0
- package/dist/Link/LinkLF.js +2 -0
- package/dist/Message/MessageApollo.d.ts +2 -0
- package/dist/Message/MessageApollo.js +2 -0
- package/dist/Message/MessageCommon.d.ts +21 -0
- package/dist/Message/MessageCommon.js +28 -0
- package/dist/Message/MessageLF.d.ts +2 -0
- package/dist/Message/MessageLF.js +2 -0
- package/dist/ProgressBar/ProgressBarApollo.d.ts +2 -0
- package/dist/ProgressBar/ProgressBarApollo.js +2 -0
- package/dist/ProgressBar/ProgressBarCommon.d.ts +5 -0
- package/dist/ProgressBar/ProgressBarCommon.js +6 -0
- package/dist/ProgressBar/ProgressBarLF.d.ts +2 -0
- package/dist/ProgressBar/ProgressBarLF.js +2 -0
- package/dist/ProgressBarGroup/ProgressBarGroupApollo.d.ts +3 -0
- package/dist/ProgressBarGroup/ProgressBarGroupApollo.js +5 -0
- package/dist/ProgressBarGroup/ProgressBarGroupCommon.d.ts +11 -0
- package/dist/ProgressBarGroup/ProgressBarGroupCommon.js +18 -0
- package/dist/ProgressBarGroup/ProgressBarGroupLF.d.ts +3 -0
- package/dist/ProgressBarGroup/ProgressBarGroupLF.js +5 -0
- package/dist/Stepper/StepperApollo.d.ts +3 -0
- package/dist/Stepper/StepperApollo.js +5 -0
- package/dist/Stepper/StepperCommon.d.ts +13 -0
- package/dist/Stepper/StepperCommon.js +7 -0
- package/dist/Stepper/StepperLF.d.ts +3 -0
- package/dist/Stepper/StepperLF.js +5 -0
- package/dist/Tag/TagApollo.d.ts +2 -0
- package/dist/Tag/TagApollo.js +2 -0
- package/dist/Tag/TagCommon.d.ts +13 -0
- package/dist/Tag/TagCommon.js +14 -0
- package/dist/Tag/TagLF.d.ts +2 -0
- package/dist/Tag/TagLF.js +2 -0
- package/dist/TimelineVertical/TimelineVerticalApollo.d.ts +4 -0
- package/dist/TimelineVertical/TimelineVerticalApollo.js +5 -0
- package/dist/TimelineVertical/TimelineVerticalCommon.d.ts +7 -0
- package/dist/TimelineVertical/TimelineVerticalCommon.js +3 -0
- package/dist/TimelineVertical/TimelineVerticalLF.d.ts +4 -0
- package/dist/TimelineVertical/TimelineVerticalLF.js +5 -0
- package/dist/TimelineVertical/types.d.ts +5 -0
- package/dist/TimelineVertical/types.js +1 -0
- package/dist/Toggle/ToggleApollo.d.ts +2 -0
- package/dist/Toggle/ToggleApollo.js +2 -0
- package/dist/Toggle/ToggleCommon.d.ts +3 -0
- package/dist/Toggle/ToggleCommon.js +9 -0
- package/dist/Toggle/ToggleLF.d.ts +2 -0
- package/dist/Toggle/ToggleLF.js +2 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +19 -0
- package/dist/indexLF.d.ts +18 -0
- package/dist/indexLF.js +18 -0
- package/dist/utilities/getComponentClassName.d.ts +1 -0
- package/dist/utilities/getComponentClassName.js +26 -0
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const BasePicture: ({ className, src, ...rest }: React.ImgHTMLAttributes<HTMLImageElement>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import logo from "@axa-fr/design-system-look-and-feel-css/logo-axa.svg";
|
|
4
|
+
import { getComponentClassName } from "../utilities/getComponentClassName";
|
|
5
|
+
export const BasePicture = ({ className, src, ...rest }) => {
|
|
6
|
+
const componentClassName = useMemo(() => getComponentClassName("af-basepicture", className), [className]);
|
|
7
|
+
return (_jsx("img", { className: componentClassName, alt: "", src: src || logo, ...rest }));
|
|
8
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
export declare const cardMessageVariants: {
|
|
3
|
+
readonly info: "info";
|
|
4
|
+
readonly warning: "warning";
|
|
5
|
+
readonly error: "error";
|
|
6
|
+
readonly neutral: "neutral";
|
|
7
|
+
};
|
|
8
|
+
export type CardMessageVariants = keyof typeof cardMessageVariants;
|
|
9
|
+
export type CardMessageProps = ComponentPropsWithoutRef<"div"> & {
|
|
10
|
+
variant?: CardMessageVariants;
|
|
11
|
+
title?: string;
|
|
12
|
+
text: string;
|
|
13
|
+
};
|
|
14
|
+
export declare const CardMessage: ({ variant, title, text, className, ...props }: CardMessageProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { getComponentClassName } from "../utilities/getComponentClassName";
|
|
4
|
+
export const cardMessageVariants = {
|
|
5
|
+
info: "info",
|
|
6
|
+
warning: "warning",
|
|
7
|
+
error: "error",
|
|
8
|
+
neutral: "neutral",
|
|
9
|
+
};
|
|
10
|
+
export const CardMessage = ({ variant = "info", title, text, className, ...props }) => {
|
|
11
|
+
const componentClassName = useMemo(() => {
|
|
12
|
+
return getComponentClassName("af-card-message", className, variant);
|
|
13
|
+
}, [className, variant]);
|
|
14
|
+
return (_jsxs("div", { ...props, className: componentClassName, children: [title && _jsx("span", { className: "af-card-message--title", children: title }), _jsx("span", { className: "af-card-message--text", children: text })] }));
|
|
15
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ComponentPropsWithRef } from "react";
|
|
2
|
+
import { IconVariants } from "../Icon/IconCommon";
|
|
3
|
+
export type ClickIconProps = ComponentPropsWithRef<"button"> & {
|
|
4
|
+
src: string;
|
|
5
|
+
className?: string;
|
|
6
|
+
iconVariant?: IconVariants;
|
|
7
|
+
iconClassName?: string;
|
|
8
|
+
};
|
|
9
|
+
export declare const ClickIcon: ({ src, className, iconVariant, iconClassName, ...props }: ClickIconProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Icon } from "../Icon/IconCommon";
|
|
3
|
+
export const ClickIcon = ({ src, className, iconVariant = "primary", iconClassName, ...props }) => (_jsx("button", { type: "button", className: ["af-click-icon", className].filter(Boolean).join(" "), ...props, children: _jsx(Icon, { src: src, variant: iconVariant, className: iconClassName }) }));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { getComponentClassName } from "../utilities/getComponentClassName";
|
|
4
|
+
export const Divider = ({ className, classModifier }) => {
|
|
5
|
+
const componentClassName = useMemo(() => getComponentClassName("af-divider", className, classModifier), [className, classModifier]);
|
|
6
|
+
return _jsx("hr", { className: componentClassName });
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const formatDateInputValue: (type: "date" | "text", value?: Date | string | undefined) => string | undefined;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const MAXIMUM_SIZE_DATE = 10;
|
|
2
|
+
export const formatDateInputValue = (type, value) => {
|
|
3
|
+
if (!value)
|
|
4
|
+
return undefined;
|
|
5
|
+
if (value instanceof Date) {
|
|
6
|
+
if (type === "date") {
|
|
7
|
+
return value.toISOString().slice(0, MAXIMUM_SIZE_DATE);
|
|
8
|
+
}
|
|
9
|
+
if (type === "text") {
|
|
10
|
+
const day = String(value.getDate()).padStart(2, "0");
|
|
11
|
+
const month = String(value.getMonth() + 1).padStart(2, "0");
|
|
12
|
+
const year = String(value.getFullYear()).padStart(4, "0");
|
|
13
|
+
return `${day}/${month}/${year}`;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
if (typeof value === "string") {
|
|
17
|
+
return value;
|
|
18
|
+
}
|
|
19
|
+
return undefined;
|
|
20
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/DateInput/DateInputApollo.scss";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { DateInput as DateInputCommon } from "./DateInputCommon";
|
|
4
|
+
export declare const DateInput: (props: Omit<ComponentProps<typeof DateInputCommon>, "ItemLabelComponent" | "ItemMessageComponent">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/DateInput/DateInputApollo.scss";
|
|
3
|
+
import { ItemLabel } from "../ItemLabel/ItemLabelApollo";
|
|
4
|
+
import { ItemMessage } from "../ItemMessage/ItemMessageApollo";
|
|
5
|
+
import { DateInput as DateInputCommon } from "./DateInputCommon";
|
|
6
|
+
export const DateInput = (props) => (_jsx(DateInputCommon, { ...props, ItemLabelComponent: ItemLabel, ItemMessageComponent: ItemMessage }));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { ComponentProps, ComponentPropsWithRef, ComponentType } from "react";
|
|
2
|
+
import { ItemLabel } from "../ItemLabel/ItemLabelCommon";
|
|
3
|
+
import { ItemMessage } from "../ItemMessage/ItemMessageCommon";
|
|
4
|
+
type DateInputProps = Omit<ComponentPropsWithRef<"input">, "value"> & {
|
|
5
|
+
classModifier?: string;
|
|
6
|
+
defaultValue?: Date | string;
|
|
7
|
+
value?: Date | string;
|
|
8
|
+
helper?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
success?: string;
|
|
11
|
+
label: ComponentProps<typeof ItemLabel>["label"];
|
|
12
|
+
type?: "text" | "date";
|
|
13
|
+
ItemLabelComponent: ComponentType<Omit<ComponentProps<typeof ItemLabel>, "ButtonComponent">>;
|
|
14
|
+
ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
|
|
15
|
+
} & Partial<ComponentPropsWithRef<typeof ItemLabel>>;
|
|
16
|
+
declare const DateInput: import("react").ForwardRefExoticComponent<Omit<DateInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
17
|
+
export { DateInput };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useId, } from "react";
|
|
3
|
+
import { getComponentClassName } from "../../utilities/getComponentClassName";
|
|
4
|
+
import { formatDateInputValue } from "./DateInput.helper";
|
|
5
|
+
const DateInput = forwardRef(({ className, classModifier = "", defaultValue, value, placeholder = "JJ/MM/AAAA", helper, error, success, label, description, buttonLabel, onButtonClick, ItemLabelComponent, ItemMessageComponent, required, "aria-errormessage": ariaErrormessage, type = "text", ...otherProps }, inputRef) => {
|
|
6
|
+
const componentClassName = getComponentClassName("af-form__input-date", className ?? "", classModifier + (error || ariaErrormessage ? " error" : ""));
|
|
7
|
+
let inputId = useId();
|
|
8
|
+
inputId = otherProps.id ?? inputId;
|
|
9
|
+
const idMessage = useId();
|
|
10
|
+
const idHelp = useId();
|
|
11
|
+
const idLabel = useId();
|
|
12
|
+
return (_jsxs("div", { className: "af-form__input-container", children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, required: required, inputId: inputId, idLabel: idLabel }), _jsx("input", { ...otherProps, id: inputId, className: componentClassName, type: type, placeholder: placeholder || "", ref: inputRef, defaultValue: formatDateInputValue(type, defaultValue), value: formatDateInputValue(type, value), "aria-labelledby": idLabel, "aria-errormessage": ariaErrormessage ?? idMessage, "aria-invalid": Boolean(error ?? ariaErrormessage), "aria-describedby": idHelp, required: required }), helper && (_jsx("span", { id: idHelp, className: "af-form__input-helper", children: helper })), _jsx(ItemMessageComponent, { id: idMessage, message: error ?? success, messageType: error ? "error" : "success" })] }));
|
|
13
|
+
});
|
|
14
|
+
DateInput.displayName = "DateInput";
|
|
15
|
+
export { DateInput };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/DateInput/DateInputLF.scss";
|
|
2
|
+
import { ComponentProps } from "react";
|
|
3
|
+
import { DateInput as DateInputCommon } from "./DateInputCommon";
|
|
4
|
+
export declare const DateInput: (props: Omit<ComponentProps<typeof DateInputCommon>, "ItemLabelComponent" | "ItemMessageComponent">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/DateInput/DateInputLF.scss";
|
|
3
|
+
import { ItemLabel } from "../ItemLabel/ItemLabelLF";
|
|
4
|
+
import { ItemMessage } from "../ItemMessage/ItemMessageLF";
|
|
5
|
+
import { DateInput as DateInputCommon } from "./DateInputCommon";
|
|
6
|
+
export const DateInput = (props) => (_jsx(DateInputCommon, { ...props, ItemLabelComponent: ItemLabel, ItemMessageComponent: ItemMessage }));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/ItemLabel/ItemLabelApollo.scss";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { ItemLabel as ItemLabelCommon } from "./ItemLabelCommon";
|
|
4
|
+
export declare const ItemLabel: (props: Omit<ComponentProps<typeof ItemLabelCommon>, "ButtonComponent">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/ItemLabel/ItemLabelApollo.scss";
|
|
3
|
+
import { Button } from "../../Button/ButtonApollo";
|
|
4
|
+
import { ItemLabel as ItemLabelCommon } from "./ItemLabelCommon";
|
|
5
|
+
export const ItemLabel = (props) => _jsx(ItemLabelCommon, { ...props, ButtonComponent: Button });
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ComponentProps, type ComponentType, type MouseEventHandler } from "react";
|
|
2
|
+
import { Button } from "../../Button/ButtonCommon";
|
|
3
|
+
type ItemLabelProps = {
|
|
4
|
+
label: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
inputId: string;
|
|
8
|
+
idLabel: string;
|
|
9
|
+
sideButtonLabel?: string;
|
|
10
|
+
onSideButtonClick?: MouseEventHandler<HTMLButtonElement>;
|
|
11
|
+
buttonLabel?: string;
|
|
12
|
+
onButtonClick?: MouseEventHandler<HTMLButtonElement>;
|
|
13
|
+
ButtonComponent: ComponentType<ComponentProps<typeof Button>>;
|
|
14
|
+
};
|
|
15
|
+
export declare const ItemLabel: ({ label, description, required, inputId, idLabel, sideButtonLabel, onSideButtonClick, buttonLabel, onButtonClick, ButtonComponent, }: ItemLabelProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId, } from "react";
|
|
3
|
+
import infoIcon from "@material-symbols/svg-400/outlined/info.svg";
|
|
4
|
+
import { Svg } from "../../Svg/Svg";
|
|
5
|
+
export const ItemLabel = ({ label, description, required, inputId, idLabel, sideButtonLabel, onSideButtonClick, buttonLabel, onButtonClick, ButtonComponent, }) => {
|
|
6
|
+
const idDescription = useId();
|
|
7
|
+
return (_jsxs("div", { className: "af-item-label", children: [_jsxs("label", { htmlFor: inputId, id: idLabel, "aria-describedby": description ? idDescription : undefined, children: [label, " ", required && _jsx("span", { "aria-hidden": "true", children: " *" })] }), sideButtonLabel && (_jsx(ButtonComponent, { variant: "ghost", onClick: onSideButtonClick, className: "af-item-label__sidebutton", children: sideButtonLabel })), description && (_jsx("span", { id: idDescription, className: "af-item-label__description", children: description })), buttonLabel && (_jsx(ButtonComponent, { className: "af-item-label__more", variant: "ghost", iconLeft: _jsx(Svg, { src: infoIcon, "aria-hidden": "true" }), onClick: onButtonClick, children: buttonLabel }))] }));
|
|
8
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/ItemLabel/ItemLabelLF.scss";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { ItemLabel as ItemLabelCommon } from "./ItemLabelCommon";
|
|
4
|
+
export declare const ItemLabel: (props: Omit<ComponentProps<typeof ItemLabelCommon>, "ButtonComponent">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/ItemLabel/ItemLabelLF.scss";
|
|
3
|
+
import { Button } from "../../Button/ButtonLF";
|
|
4
|
+
import { ItemLabel as ItemLabelCommon } from "./ItemLabelCommon";
|
|
5
|
+
export const ItemLabel = (props) => _jsx(ItemLabelCommon, { ...props, ButtonComponent: Button });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
type ItemMessageProps = {
|
|
2
|
-
message
|
|
2
|
+
message?: string;
|
|
3
3
|
id?: string;
|
|
4
|
-
|
|
4
|
+
messageType?: "error" | "success";
|
|
5
5
|
};
|
|
6
|
-
export declare const ItemMessage: ({ message, id,
|
|
6
|
+
export declare const ItemMessage: ({ message, id, messageType, }: ItemMessageProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
7
7
|
export {};
|
|
@@ -2,4 +2,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import errorIcon from "@material-symbols/svg-400/outlined/error-fill.svg";
|
|
3
3
|
import successIcon from "@material-symbols/svg-400/outlined/check_circle-fill.svg";
|
|
4
4
|
import { Svg } from "../../Svg/Svg";
|
|
5
|
-
export const ItemMessage = ({ message, id,
|
|
5
|
+
export const ItemMessage = ({ message, id, messageType = "error", }) => {
|
|
6
|
+
if (!message) {
|
|
7
|
+
return null;
|
|
8
|
+
}
|
|
9
|
+
return (_jsxs("small", { className: `af-item-message af-item-message--${messageType}`, role: messageType === "error" ? "alert" : undefined, "aria-live": "assertive", children: [_jsx(Svg, { src: messageType === "error" ? errorIcon : successIcon, className: "af-item-message__icon", "aria-hidden": "true" }), _jsx("span", { id: id, className: "af-item-message__message", children: message })] }));
|
|
10
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/Select/SelectApollo.scss";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { Select as SelectCommon } from "./SelectCommon";
|
|
4
|
+
export declare const Select: (props: Omit<ComponentProps<typeof SelectCommon>, "ItemLabelComponent" | "ItemMessageComponent">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/Select/SelectApollo.scss";
|
|
3
|
+
import { ItemLabel } from "../ItemLabel/ItemLabelApollo";
|
|
4
|
+
import { ItemMessage } from "../ItemMessage/ItemMessageApollo";
|
|
5
|
+
import { Select as SelectCommon } from "./SelectCommon";
|
|
6
|
+
export const Select = (props) => (_jsx(SelectCommon, { ...props, ItemLabelComponent: ItemLabel, ItemMessageComponent: ItemMessage }));
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { type ComponentProps, type ComponentPropsWithRef, type ComponentType } from "react";
|
|
2
|
+
import { ItemLabel } from "../ItemLabel/ItemLabelCommon";
|
|
3
|
+
import { ItemMessage } from "../ItemMessage/ItemMessageCommon";
|
|
4
|
+
type SelectProps = ComponentPropsWithRef<"select"> & {
|
|
5
|
+
id?: string;
|
|
6
|
+
classModifier?: string;
|
|
7
|
+
label: ComponentProps<typeof ItemLabel>["label"];
|
|
8
|
+
errorLabel?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
success?: string;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
buttonLabel?: string;
|
|
13
|
+
description?: string;
|
|
14
|
+
helper?: string;
|
|
15
|
+
ItemLabelComponent: ComponentType<Omit<ComponentProps<typeof ItemLabel>, "ButtonComponent">>;
|
|
16
|
+
ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
|
|
17
|
+
} & Partial<ComponentPropsWithRef<typeof ItemLabel>>;
|
|
18
|
+
declare const Select: import("react").ForwardRefExoticComponent<Omit<SelectProps, "ref"> & import("react").RefAttributes<HTMLSelectElement>>;
|
|
19
|
+
export { Select };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useId, } from "react";
|
|
3
|
+
import classNames from "classnames";
|
|
4
|
+
const Select = forwardRef(({ id, required, label, error, placeholder, children, helper, success, description, buttonLabel, onButtonClick, sideButtonLabel, onSideButtonClick, ItemLabelComponent, ItemMessageComponent, ...otherProps }, inputRef) => {
|
|
5
|
+
const idLabel = useId();
|
|
6
|
+
const idMessage = useId();
|
|
7
|
+
let inputId = useId();
|
|
8
|
+
inputId = id || inputId;
|
|
9
|
+
const classname = classNames("af-form__select-input", error && "af-form__select-input--error");
|
|
10
|
+
return (_jsxs("div", { children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, inputId: inputId, idLabel: idLabel }), _jsxs("select", { className: classname, ...otherProps, ref: inputRef, id: inputId, children: [Boolean(placeholder) && (_jsx("option", { disabled: true, value: "", children: placeholder })), children] }), helper && _jsx("span", { className: "af-form__input-helper", children: helper }), _jsx(ItemMessageComponent, { id: idMessage, message: error || success, messageType: error ? "error" : "success" })] }));
|
|
11
|
+
});
|
|
12
|
+
Select.displayName = "Select";
|
|
13
|
+
export { Select };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/Select/SelectLF.scss";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { Select as SelectCommon } from "./SelectCommon";
|
|
4
|
+
export declare const Select: (props: Omit<ComponentProps<typeof SelectCommon>, "ItemLabelComponent" | "ItemMessageComponent">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/Select/SelectLF.scss";
|
|
3
|
+
import { ItemLabel } from "../ItemLabel/ItemLabelLF";
|
|
4
|
+
import { ItemMessage } from "../ItemMessage/ItemMessageLF";
|
|
5
|
+
import { Select as SelectCommon } from "./SelectCommon";
|
|
6
|
+
export const Select = (props) => (_jsx(SelectCommon, { ...props, ItemLabelComponent: ItemLabel, ItemMessageComponent: ItemMessage }));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/TextArea/TextAreaApollo.scss";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { TextArea as TextAreaCommon } from "./TextAreaCommon";
|
|
4
|
+
export declare const TextArea: (props: Omit<ComponentProps<typeof TextAreaCommon>, "ItemLabelComponent" | "ItemMessageComponent">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/TextArea/TextAreaApollo.scss";
|
|
3
|
+
import { ItemLabel } from "../ItemLabel/ItemLabelApollo";
|
|
4
|
+
import { ItemMessage } from "../ItemMessage/ItemMessageApollo";
|
|
5
|
+
import { TextArea as TextAreaCommon } from "./TextAreaCommon";
|
|
6
|
+
export const TextArea = (props) => (_jsx(TextAreaCommon, { ...props, ItemLabelComponent: ItemLabel, ItemMessageComponent: ItemMessage }));
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ComponentProps, ComponentPropsWithRef, type ComponentType, MouseEventHandler } from "react";
|
|
2
|
+
import { ItemLabel } from "../ItemLabel/ItemLabelCommon";
|
|
3
|
+
import { ItemMessage } from "../ItemMessage/ItemMessageCommon";
|
|
4
|
+
type Props = ComponentPropsWithRef<"textarea"> & {
|
|
5
|
+
classModifier?: string;
|
|
6
|
+
sideButtonLabel: string;
|
|
7
|
+
onSideButtonClick?: MouseEventHandler<HTMLButtonElement>;
|
|
8
|
+
helper?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
description?: string;
|
|
11
|
+
label: ComponentProps<typeof ItemLabel>["label"];
|
|
12
|
+
ItemLabelComponent: ComponentType<Omit<ComponentProps<typeof ItemLabel>, "ButtonComponent">>;
|
|
13
|
+
ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
|
|
14
|
+
buttonLabel?: string;
|
|
15
|
+
onButtonClick?: MouseEventHandler<HTMLButtonElement>;
|
|
16
|
+
} & Partial<ComponentPropsWithRef<typeof ItemMessage>>;
|
|
17
|
+
declare const TextArea: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
18
|
+
export { TextArea };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useId, } from "react";
|
|
3
|
+
import { getComponentClassName } from "../../utilities/getComponentClassName";
|
|
4
|
+
const TextArea = forwardRef(({ className, classModifier = "", label, description, helper, error, buttonLabel, onButtonClick, required, sideButtonLabel, ItemLabelComponent, ItemMessageComponent, onSideButtonClick, ...otherProps }, inputRef) => {
|
|
5
|
+
const componentClassName = getComponentClassName("af-form__input-textarea", className, classModifier);
|
|
6
|
+
let inputId = useId();
|
|
7
|
+
inputId = otherProps.id || inputId;
|
|
8
|
+
const idError = useId();
|
|
9
|
+
const idLabel = useId();
|
|
10
|
+
return (_jsxs("div", { className: "af-form__input-container", children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, inputId: inputId, idLabel: idLabel }), _jsx("textarea", { id: inputId, className: componentClassName, ref: inputRef, "aria-errormessage": idError, "aria-invalid": Boolean(error), ...otherProps }), helper && _jsx("span", { className: "af-form__input-helper", children: helper }), _jsx(ItemMessageComponent, { id: idError, message: error })] }));
|
|
11
|
+
});
|
|
12
|
+
TextArea.displayName = "TextArea";
|
|
13
|
+
export { TextArea };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/TextArea/TextAreaLF.scss";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { TextArea as TextAreaCommon } from "./TextAreaCommon";
|
|
4
|
+
export declare const TextArea: (props: Omit<ComponentProps<typeof TextAreaCommon>, "ItemLabelComponent" | "ItemMessageComponent">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/TextArea/TextAreaLF.scss";
|
|
3
|
+
import { ItemLabel } from "../ItemLabel/ItemLabelLF";
|
|
4
|
+
import { ItemMessage } from "../ItemMessage/ItemMessageLF";
|
|
5
|
+
import { TextArea as TextAreaCommon } from "./TextAreaCommon";
|
|
6
|
+
export const TextArea = (props) => (_jsx(TextAreaCommon, { ...props, ItemLabelComponent: ItemLabel, ItemMessageComponent: ItemMessage }));
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/TextInput/TextInputApollo.scss";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { TextInput as TextInputCommon } from "./TextInputCommon";
|
|
4
|
+
export declare const TextInput: (props: Omit<ComponentProps<typeof TextInputCommon>, "ItemLabelComponent" | "ItemMessageComponent">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/TextInput/TextInputApollo.scss";
|
|
3
|
+
import { ItemLabel } from "../ItemLabel/ItemLabelApollo";
|
|
4
|
+
import { ItemMessage } from "../ItemMessage/ItemMessageApollo";
|
|
5
|
+
import { TextInput as TextInputCommon } from "./TextInputCommon";
|
|
6
|
+
export const TextInput = (props) => (_jsx(TextInputCommon, { ...props, ItemLabelComponent: ItemLabel, ItemMessageComponent: ItemMessage }));
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type ComponentProps, type ComponentPropsWithRef, type ComponentType } from "react";
|
|
2
|
+
import { ItemLabel } from "../ItemLabel/ItemLabelCommon";
|
|
3
|
+
import { ItemMessage } from "../ItemMessage/ItemMessageCommon";
|
|
4
|
+
type TextInputProps = ComponentPropsWithRef<"input"> & {
|
|
5
|
+
unit?: React.ReactNode;
|
|
6
|
+
classModifier?: string;
|
|
7
|
+
helper?: string;
|
|
8
|
+
error?: string;
|
|
9
|
+
success?: string;
|
|
10
|
+
label: ComponentProps<typeof ItemLabel>["label"];
|
|
11
|
+
ItemLabelComponent: ComponentType<Omit<ComponentProps<typeof ItemLabel>, "ButtonComponent">>;
|
|
12
|
+
ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
|
|
13
|
+
} & Partial<ComponentPropsWithRef<typeof ItemLabel>>;
|
|
14
|
+
declare const TextInput: import("react").ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
15
|
+
export { TextInput };
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useId, } from "react";
|
|
3
|
+
import { getComponentClassName } from "../../utilities/getComponentClassName";
|
|
4
|
+
const TextInput = forwardRef(({ unit, className, classModifier = "", helper, error, success, label, description, buttonLabel, onButtonClick, required, sideButtonLabel, onSideButtonClick, ItemLabelComponent, ItemMessageComponent, "aria-errormessage": ariaErrormessage, ...otherProps }, inputRef) => {
|
|
5
|
+
const componentClassName = getComponentClassName("af-form__input-text", className, classModifier + (error || ariaErrormessage ? " error" : ""));
|
|
6
|
+
let inputId = useId();
|
|
7
|
+
inputId = otherProps.id || inputId;
|
|
8
|
+
const idMessage = useId();
|
|
9
|
+
const idHelp = useId();
|
|
10
|
+
const idLabel = useId();
|
|
11
|
+
return (_jsxs("div", { className: "af-form__input-container", children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, inputId: inputId, idLabel: idLabel }), _jsxs("div", { className: "af-form__input-variant", children: [_jsx("input", { id: inputId, className: componentClassName, type: "text", required: required, ref: inputRef, "aria-labelledby": idLabel, "aria-errormessage": ariaErrormessage ?? idMessage, "aria-invalid": Boolean(error || ariaErrormessage), "aria-describedby": idHelp, ...otherProps }), unit] }), helper && (_jsx("span", { id: idHelp, className: "af-form__input-helper", children: helper })), _jsx(ItemMessageComponent, { id: idMessage, message: error || success, messageType: error ? "error" : "success" })] }));
|
|
12
|
+
});
|
|
13
|
+
TextInput.displayName = "TextInput";
|
|
14
|
+
export { TextInput };
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/TextInput/TextInputLF.scss";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
import { TextInput as TextInputCommon } from "./TextInputCommon";
|
|
4
|
+
export declare const TextInput: (props: Omit<ComponentProps<typeof TextInputCommon>, "ItemLabelComponent" | "ItemMessageComponent">) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/TextInput/TextInputLF.scss";
|
|
3
|
+
import { ItemLabel } from "../ItemLabel/ItemLabelLF";
|
|
4
|
+
import { ItemMessage } from "../ItemMessage/ItemMessageLF";
|
|
5
|
+
import { TextInput as TextInputCommon } from "./TextInputCommon";
|
|
6
|
+
export const TextInput = (props) => (_jsx(TextInputCommon, { ...props, ItemLabelComponent: ItemLabel, ItemMessageComponent: ItemMessage }));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { Svg } from "../Svg/Svg";
|
|
3
|
+
export declare const iconVariants: {
|
|
4
|
+
readonly primary: "primary";
|
|
5
|
+
readonly secondary: "secondary";
|
|
6
|
+
readonly disabled: "disabled";
|
|
7
|
+
};
|
|
8
|
+
export type IconVariants = keyof typeof iconVariants;
|
|
9
|
+
export declare const iconSizeVariants: {
|
|
10
|
+
readonly L: "large";
|
|
11
|
+
readonly M: "medium";
|
|
12
|
+
readonly S: "small";
|
|
13
|
+
readonly XS: "extra-small";
|
|
14
|
+
};
|
|
15
|
+
export type IconSizeVariants = keyof typeof iconSizeVariants;
|
|
16
|
+
export type IconProps = ComponentProps<typeof Svg> & {
|
|
17
|
+
variant?: IconVariants;
|
|
18
|
+
size?: IconSizeVariants;
|
|
19
|
+
hasBackground?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export declare const Icon: ({ variant, size, hasBackground, ...props }: IconProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { getComponentClassName } from "../utilities/getComponentClassName";
|
|
4
|
+
import { Svg } from "../Svg/Svg";
|
|
5
|
+
export const iconVariants = {
|
|
6
|
+
primary: "primary",
|
|
7
|
+
secondary: "secondary",
|
|
8
|
+
disabled: "disabled",
|
|
9
|
+
};
|
|
10
|
+
export const iconSizeVariants = {
|
|
11
|
+
L: "large",
|
|
12
|
+
M: "medium",
|
|
13
|
+
S: "small",
|
|
14
|
+
XS: "extra-small",
|
|
15
|
+
};
|
|
16
|
+
export const Icon = ({ variant = "primary", size = "S", hasBackground = false, ...props }) => {
|
|
17
|
+
const componentClassName = useMemo(() => {
|
|
18
|
+
const newClassModifier = [
|
|
19
|
+
variant,
|
|
20
|
+
iconSizeVariants[size],
|
|
21
|
+
hasBackground && "has-background",
|
|
22
|
+
]
|
|
23
|
+
.filter(Boolean)
|
|
24
|
+
.join(" ");
|
|
25
|
+
return getComponentClassName("af-icon", "", newClassModifier);
|
|
26
|
+
}, [variant, hasBackground, size]);
|
|
27
|
+
return (_jsx("div", { className: componentClassName, children: _jsx(Svg, { ...props }) }));
|
|
28
|
+
};
|