@axa-fr/design-system-apollo-react 1.0.5-alpha.379 → 1.0.5-alpha.383
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/Form/Dropdown/DropdownCommon.js +1 -2
- package/dist/Form/InputDate/InputDateApollo.d.ts +1 -2
- package/dist/Form/InputDate/InputDateCommon.js +2 -2
- package/dist/Form/InputDate/InputDateLF.d.ts +1 -2
- package/dist/Form/InputPhone/InputPhoneCommon.js +2 -2
- package/dist/Form/InputText/InputTextApollo.d.ts +2 -3
- package/dist/Form/InputText/InputTextCommon.d.ts +2 -2
- package/dist/Form/InputText/InputTextCommon.js +2 -2
- package/dist/Form/InputText/InputTextLF.d.ts +2 -3
- package/dist/Form/InputTextAtom/InputTextAtomCommon.d.ts +2 -3
- package/dist/Form/InputTextAtom/InputTextAtomCommon.js +3 -3
- package/dist/Form/ItemLabel/ItemLabelCommon.d.ts +3 -4
- package/dist/Form/ItemLabel/ItemLabelCommon.js +3 -3
- package/dist/Form/Radio/CardRadio/CardRadioCommon.js +3 -2
- package/dist/Form/TextArea/TextAreaApollo.d.ts +1 -2
- package/dist/Form/TextArea/TextAreaCommon.js +2 -2
- package/dist/Form/TextArea/TextAreaLF.d.ts +1 -2
- package/package.json +3 -3
|
@@ -2,12 +2,11 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef, useId, } from "react";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
const Dropdown = forwardRef(({ id, required, label, error, placeholder, children, helper, success, description, buttonLabel, onButtonClick, sideButtonLabel, onSideButtonClick, ItemLabelComponent, ItemMessageComponent, ...otherProps }, inputRef) => {
|
|
5
|
-
const idLabel = useId();
|
|
6
5
|
const idMessage = useId();
|
|
7
6
|
let inputId = useId();
|
|
8
7
|
inputId = id || inputId;
|
|
9
8
|
const classname = classNames("af-form__dropdown-input", error && "af-form__dropdown-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
|
|
9
|
+
return (_jsxs("div", { children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, inputId: inputId }), _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
10
|
});
|
|
12
11
|
Dropdown.displayName = "Dropdown";
|
|
13
12
|
export { Dropdown };
|
|
@@ -14,11 +14,10 @@ export declare const InputDate: import("react").ForwardRefExoticComponent<Omit<O
|
|
|
14
14
|
ItemLabelComponent: import("react").ComponentType<Omit<ComponentProps<typeof import("../ItemLabel/ItemLabelCommon").ItemLabel>, "ButtonComponent">>;
|
|
15
15
|
ItemMessageComponent: import("react").ComponentType<ComponentProps<typeof ItemMessage>>;
|
|
16
16
|
} & Partial<{
|
|
17
|
-
label?:
|
|
17
|
+
label?: import("react").ReactNode;
|
|
18
18
|
description?: string;
|
|
19
19
|
required?: boolean;
|
|
20
20
|
inputId: string;
|
|
21
|
-
idLabel: string;
|
|
22
21
|
sideButtonLabel?: string;
|
|
23
22
|
onSideButtonClick?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
24
23
|
buttonLabel?: string;
|
|
@@ -8,8 +8,8 @@ const InputDate = forwardRef(({ className, classModifier = "", defaultValue, val
|
|
|
8
8
|
inputId = otherProps.id ?? inputId;
|
|
9
9
|
const idMessage = useId();
|
|
10
10
|
const idHelp = useId();
|
|
11
|
-
const
|
|
12
|
-
return (_jsxs("div", { className: "af-form__input-container", children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, required: required, inputId: inputId
|
|
11
|
+
const ariaDescribedby = [helper && idHelp, success && idMessage].filter(Boolean);
|
|
12
|
+
return (_jsxs("div", { className: "af-form__input-container", children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, required: required, inputId: inputId }), _jsx("input", { ...otherProps, id: inputId, className: componentClassName, type: "date", ref: inputRef, defaultValue: formatInputDateValue(defaultValue), value: formatInputDateValue(value), "aria-errormessage": ariaErrormessage ?? (error ? idMessage : undefined), "aria-invalid": Boolean(error ?? ariaErrormessage), "aria-describedby": ariaDescribedby.length > 0 ? ariaDescribedby.join(" ") : undefined, required: required, min: formatInputDateValue(min), max: formatInputDateValue(max) }), helper && (_jsx("span", { id: idHelp, className: "af-form__input-helper", children: helper })), _jsx(ItemMessageComponent, { id: idMessage, message: error || success, messageType: error ? "error" : "success" })] }));
|
|
13
13
|
});
|
|
14
14
|
InputDate.displayName = "InputDate";
|
|
15
15
|
export { InputDate };
|
|
@@ -14,11 +14,10 @@ export declare const InputDate: import("react").ForwardRefExoticComponent<Omit<O
|
|
|
14
14
|
ItemLabelComponent: import("react").ComponentType<Omit<ComponentProps<typeof import("../ItemLabel/ItemLabelCommon").ItemLabel>, "ButtonComponent">>;
|
|
15
15
|
ItemMessageComponent: import("react").ComponentType<ComponentProps<typeof ItemMessage>>;
|
|
16
16
|
} & Partial<{
|
|
17
|
-
label?:
|
|
17
|
+
label?: import("react").ReactNode;
|
|
18
18
|
description?: string;
|
|
19
19
|
required?: boolean;
|
|
20
20
|
inputId: string;
|
|
21
|
-
idLabel: string;
|
|
22
21
|
sideButtonLabel?: string;
|
|
23
22
|
onSideButtonClick?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
24
23
|
buttonLabel?: string;
|
|
@@ -8,8 +8,8 @@ const InputPhoneCommon = forwardRef(({ className, classModifier = "", helper, er
|
|
|
8
8
|
let inputId = useId();
|
|
9
9
|
inputId = otherProps.id || inputId;
|
|
10
10
|
const idMessage = useId();
|
|
11
|
-
const idLabel = useId();
|
|
12
11
|
const idHelp = useId();
|
|
12
|
+
const ariaDescribedby = [helper && idHelp, success && idMessage].filter(Boolean);
|
|
13
13
|
/**
|
|
14
14
|
* Gère le changement de valeur du champ numéro de téléphone.
|
|
15
15
|
* - Récupère une fonction de masquage (mask) depuis les props ou utilise une version par défaut.
|
|
@@ -25,7 +25,7 @@ const InputPhoneCommon = forwardRef(({ className, classModifier = "", helper, er
|
|
|
25
25
|
const maskedValue = mask(rawValue);
|
|
26
26
|
onChangeInput?.(maskedValue);
|
|
27
27
|
};
|
|
28
|
-
return (_jsxs("div", { className: "af-form__input-phone-container", children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, inputId: inputId
|
|
28
|
+
return (_jsxs("div", { className: "af-form__input-phone-container", children: [_jsx(ItemLabelComponent, { label: label, description: description, buttonLabel: buttonLabel, onButtonClick: onButtonClick, sideButtonLabel: sideButtonLabel, onSideButtonClick: onSideButtonClick, required: required, inputId: inputId }), _jsxs("div", { className: "af-form__input-phone-fields", children: [showSelect && (_jsx("div", { className: "af-form__country-code-wrapper", children: _jsx(CountryCodeSelect, { options: countryCodeOptions, defaultCountry: defaultCountry, onChangeSelect: onChangeSelect, IconComponent: IconComponent, disabled: disabled }) })), _jsx(InputTextComponent, { ...otherProps, className: componentClassName, ref: inputRef, error: error, type: "tel", required: required, placeholder: otherProps.placeholder, "aria-errormessage": ariaErrormessage, value: otherProps.value, onChange: handleChangeNumber, disabled: disabled, idMessage: error ? idMessage : undefined, idHelp: ariaDescribedby.length > 0 ? ariaDescribedby.join(" ") : undefined, id: inputId })] }), helper && (_jsx("span", { id: idHelp, className: "af-form__input-phone-helper", children: helper })), _jsx(ItemMessageComponent, { id: idMessage, message: error || success, messageType: error ? "error" : "success" })] }));
|
|
29
29
|
});
|
|
30
30
|
InputPhoneCommon.displayName = "InputPhone";
|
|
31
31
|
export { InputPhoneCommon };
|
|
@@ -3,7 +3,7 @@ import { type ComponentProps } from "react";
|
|
|
3
3
|
import { ItemMessage } from "../ItemMessage/ItemMessageApollo";
|
|
4
4
|
import { InputTextAtom } from "../InputTextAtom/InputTextAtomApollo";
|
|
5
5
|
export declare const InputText: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement> & {
|
|
6
|
-
unit?:
|
|
6
|
+
unit?: import("react").ReactNode;
|
|
7
7
|
classModifier?: string;
|
|
8
8
|
helper?: string;
|
|
9
9
|
error?: string;
|
|
@@ -13,11 +13,10 @@ export declare const InputText: import("react").ForwardRefExoticComponent<Omit<O
|
|
|
13
13
|
ItemMessageComponent: import("react").ComponentType<ComponentProps<typeof ItemMessage>>;
|
|
14
14
|
InputTextAtomComponent: import("react").ComponentType<ComponentProps<typeof InputTextAtom>>;
|
|
15
15
|
} & Partial<{
|
|
16
|
-
label?:
|
|
16
|
+
label?: import("react").ReactNode;
|
|
17
17
|
description?: string;
|
|
18
18
|
required?: boolean;
|
|
19
19
|
inputId: string;
|
|
20
|
-
idLabel: string;
|
|
21
20
|
sideButtonLabel?: string;
|
|
22
21
|
onSideButtonClick?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
23
22
|
buttonLabel?: string;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { type ComponentProps, type ComponentPropsWithRef, type ComponentType } from "react";
|
|
1
|
+
import { type ComponentProps, type ComponentPropsWithRef, type ComponentType, type ReactNode } from "react";
|
|
2
2
|
import { InputTextAtom } from "../InputTextAtom/InputTextAtomCommon";
|
|
3
3
|
import { ItemLabel } from "../ItemLabel/ItemLabelCommon";
|
|
4
4
|
import { ItemMessage } from "../ItemMessage/ItemMessageCommon";
|
|
5
5
|
type InputTextProps = ComponentPropsWithRef<"input"> & {
|
|
6
|
-
unit?:
|
|
6
|
+
unit?: ReactNode;
|
|
7
7
|
classModifier?: string;
|
|
8
8
|
helper?: string;
|
|
9
9
|
error?: string;
|
|
@@ -7,8 +7,8 @@ const InputText = forwardRef(({ unit, className, classModifier = "", helper, err
|
|
|
7
7
|
inputId = otherProps.id || inputId;
|
|
8
8
|
const idMessage = useId();
|
|
9
9
|
const idHelp = useId();
|
|
10
|
-
const
|
|
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
|
|
10
|
+
const ariaDescribedby = [helper && idHelp, success && idMessage].filter(Boolean);
|
|
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 }), _jsx(InputTextAtomComponent, { id: inputId, ref: inputRef, unit: unit, className: componentClassName, error: error, required: required, idMessage: error ? idMessage : undefined, idHelp: ariaDescribedby.length > 0 ? ariaDescribedby.join(" ") : undefined, ...otherProps }), helper && (_jsx("span", { id: idHelp, className: "af-form__input-helper", children: helper })), _jsx(ItemMessageComponent, { id: idMessage, message: error || success, messageType: error ? "error" : "success" })] }));
|
|
12
12
|
});
|
|
13
13
|
InputText.displayName = "InputText";
|
|
14
14
|
export { InputText };
|
|
@@ -3,7 +3,7 @@ import { type ComponentProps } from "react";
|
|
|
3
3
|
import { ItemMessage } from "../ItemMessage/ItemMessageLF";
|
|
4
4
|
import { InputTextAtom } from "../InputTextAtom/InputTextAtomLF";
|
|
5
5
|
export declare const InputText: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement> & {
|
|
6
|
-
unit?:
|
|
6
|
+
unit?: import("react").ReactNode;
|
|
7
7
|
classModifier?: string;
|
|
8
8
|
helper?: string;
|
|
9
9
|
error?: string;
|
|
@@ -13,11 +13,10 @@ export declare const InputText: import("react").ForwardRefExoticComponent<Omit<O
|
|
|
13
13
|
ItemMessageComponent: import("react").ComponentType<ComponentProps<typeof ItemMessage>>;
|
|
14
14
|
InputTextAtomComponent: import("react").ComponentType<ComponentProps<typeof InputTextAtom>>;
|
|
15
15
|
} & Partial<{
|
|
16
|
-
label?:
|
|
16
|
+
label?: import("react").ReactNode;
|
|
17
17
|
description?: string;
|
|
18
18
|
required?: boolean;
|
|
19
19
|
inputId: string;
|
|
20
|
-
idLabel: string;
|
|
21
20
|
sideButtonLabel?: string;
|
|
22
21
|
onSideButtonClick?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
23
22
|
buttonLabel?: string;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { type ComponentPropsWithRef } from "react";
|
|
1
|
+
import { type ComponentPropsWithRef, type ReactNode } from "react";
|
|
2
2
|
type InputTextAtomProps = ComponentPropsWithRef<"input"> & {
|
|
3
|
-
unit?:
|
|
3
|
+
unit?: ReactNode;
|
|
4
4
|
classModifier?: string;
|
|
5
5
|
error?: string;
|
|
6
6
|
idMessage?: string;
|
|
7
7
|
idHelp?: string;
|
|
8
|
-
idLabel?: string;
|
|
9
8
|
};
|
|
10
9
|
declare const InputTextAtom: import("react").ForwardRefExoticComponent<Omit<InputTextAtomProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
11
10
|
export { InputTextAtom };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef, useId } from "react";
|
|
2
|
+
import { forwardRef, useId, } from "react";
|
|
3
3
|
import { getComponentClassName } from "../../utilities/getComponentClassName";
|
|
4
|
-
const InputTextAtom = forwardRef(({ unit, className, classModifier = "", error, required, "aria-errormessage": ariaErrormessage, idMessage, idHelp,
|
|
4
|
+
const InputTextAtom = forwardRef(({ unit, className, classModifier = "", error, required, "aria-errormessage": ariaErrormessage, idMessage, idHelp, ...otherProps }, inputRef) => {
|
|
5
5
|
const componentClassName = getComponentClassName("af-form__input-text", className, classModifier + (error || ariaErrormessage ? " error" : ""));
|
|
6
6
|
let inputId = useId();
|
|
7
7
|
inputId = otherProps.id || inputId;
|
|
8
|
-
return (_jsxs("div", { className: "af-form__input-variant", children: [_jsx("input", { id: inputId, className: componentClassName, type: otherProps.type || "text", required: required, ref: inputRef, "aria-
|
|
8
|
+
return (_jsxs("div", { className: "af-form__input-variant", children: [_jsx("input", { id: inputId, className: componentClassName, type: otherProps.type || "text", required: required, ref: inputRef, "aria-errormessage": ariaErrormessage ?? idMessage, "aria-invalid": Boolean(error || ariaErrormessage), "aria-describedby": idHelp, ...otherProps }), unit] }));
|
|
9
9
|
});
|
|
10
10
|
InputTextAtom.displayName = "InputTextAtom";
|
|
11
11
|
export { InputTextAtom };
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { type ComponentType, type MouseEventHandler } from "react";
|
|
1
|
+
import { type ComponentType, type MouseEventHandler, type ReactNode } from "react";
|
|
2
2
|
import type { ButtonProps } from "../../Button/ButtonCommon";
|
|
3
3
|
type ItemLabelProps = {
|
|
4
|
-
label?:
|
|
4
|
+
label?: ReactNode;
|
|
5
5
|
description?: string;
|
|
6
6
|
required?: boolean;
|
|
7
7
|
inputId: string;
|
|
8
|
-
idLabel: string;
|
|
9
8
|
sideButtonLabel?: string;
|
|
10
9
|
onSideButtonClick?: MouseEventHandler<HTMLButtonElement>;
|
|
11
10
|
buttonLabel?: string;
|
|
12
11
|
onButtonClick?: MouseEventHandler<HTMLButtonElement>;
|
|
13
12
|
ButtonComponent: ComponentType<ButtonProps>;
|
|
14
13
|
};
|
|
15
|
-
export declare const ItemLabel: ({ label, description, required, inputId,
|
|
14
|
+
export declare const ItemLabel: ({ label, description, required, inputId, sideButtonLabel, onSideButtonClick, buttonLabel, onButtonClick, ButtonComponent, }: ItemLabelProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
16
15
|
export {};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useId } from "react";
|
|
2
|
+
import { useId, } from "react";
|
|
3
3
|
import infoIcon from "@material-symbols/svg-400/outlined/info.svg";
|
|
4
4
|
import { Svg } from "../../Svg/Svg";
|
|
5
|
-
export const ItemLabel = ({ label, description, required, inputId,
|
|
5
|
+
export const ItemLabel = ({ label, description, required, inputId, sideButtonLabel, onSideButtonClick, buttonLabel, onButtonClick, ButtonComponent, }) => {
|
|
6
6
|
const idDescription = useId();
|
|
7
7
|
if (!label && !description && !buttonLabel && !sideButtonLabel) {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
|
10
|
-
return (_jsxs("div", { className: "af-item-label", children: [label && (_jsxs("label", { htmlFor: inputId,
|
|
10
|
+
return (_jsxs("div", { className: "af-item-label", children: [label && (_jsxs("label", { htmlFor: inputId, "aria-describedby": description ? idDescription : undefined, className: "af-item-label__label", 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 }))] }));
|
|
11
11
|
};
|
|
@@ -7,14 +7,15 @@ import { CardRadioItem } from "./CardRadioItem";
|
|
|
7
7
|
const CardRadioCommon = ({ className, labelGroup, descriptionGroup, RadioComponent, IconComponent, isRequired, options, type = "vertical", error, name, value, onChange, ItemMessageComponent, ...inputProps }) => {
|
|
8
8
|
const componentClassName = getComponentClassName("af-card-radio__container", className);
|
|
9
9
|
const RadioGroupClassName = getComponentClassName("af-card-radio-group", className, type);
|
|
10
|
-
const
|
|
10
|
+
const cardRadioId = useId();
|
|
11
|
+
const errorId = `${cardRadioId}:error`;
|
|
11
12
|
const isMobile = useIsSmallScreen(BREAKPOINT.SM);
|
|
12
13
|
const size = isMobile
|
|
13
14
|
? "M"
|
|
14
15
|
: "L";
|
|
15
16
|
return (_jsxs("fieldset", { className: componentClassName, "aria-invalid": Boolean(error), "aria-errormessage": error ? errorId : undefined, children: [labelGroup && (_jsxs("legend", { className: "af-card-radio__legend", children: [_jsxs("p", { children: [labelGroup, isRequired && _jsx("span", { "aria-hidden": true, children: "\u00A0*" })] }), descriptionGroup && (_jsx("p", { className: "af-card-radio__description", children: descriptionGroup }))] })), _jsx("div", { className: RadioGroupClassName, children: options.map((cardRadioItemProps) => (_jsx(CardRadioItem, { name: name, onChange: onChange, size: size, RadioComponent: RadioComponent, IconComponent: IconComponent, checked: value !== undefined
|
|
16
17
|
? value === cardRadioItemProps.value
|
|
17
|
-
: undefined, ...inputProps, ...cardRadioItemProps }, `${name}-${
|
|
18
|
+
: undefined, ...inputProps, ...cardRadioItemProps }, `${name ?? cardRadioId}-${cardRadioItemProps.label}`))) }), _jsx(ItemMessageComponent, { id: errorId, message: error, messageType: "error" })] }));
|
|
18
19
|
};
|
|
19
20
|
CardRadioCommon.displayName = "CardRadioCommon";
|
|
20
21
|
export { CardRadioCommon };
|
|
@@ -2,11 +2,10 @@ import "@axa-fr/design-system-apollo-css/dist/Form/TextArea/TextAreaApollo.scss"
|
|
|
2
2
|
import { type ComponentProps } from "react";
|
|
3
3
|
import { ItemMessage } from "../ItemMessage/ItemMessageApollo";
|
|
4
4
|
export declare const TextArea: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").ClassAttributes<HTMLTextAreaElement> & import("react").TextareaHTMLAttributes<HTMLTextAreaElement> & Pick<{
|
|
5
|
-
label?:
|
|
5
|
+
label?: import("react").ReactNode;
|
|
6
6
|
description?: string;
|
|
7
7
|
required?: boolean;
|
|
8
8
|
inputId: string;
|
|
9
|
-
idLabel: string;
|
|
10
9
|
sideButtonLabel?: string;
|
|
11
10
|
onSideButtonClick?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
12
11
|
buttonLabel?: string;
|
|
@@ -5,9 +5,9 @@ const TextArea = forwardRef(({ className, classModifier = "", label, description
|
|
|
5
5
|
const componentClassName = getComponentClassName("af-form__input-textarea", className, classModifier);
|
|
6
6
|
let inputId = useId();
|
|
7
7
|
inputId = otherProps.id || inputId;
|
|
8
|
+
const idHelp = useId();
|
|
8
9
|
const idError = useId();
|
|
9
|
-
|
|
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 })] }));
|
|
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 }), _jsx("textarea", { id: inputId, className: componentClassName, ref: inputRef, "aria-errormessage": error ? idError : undefined, "aria-describedby": helper ? idHelp : undefined, "aria-invalid": Boolean(error), ...otherProps }), helper && (_jsx("span", { id: idHelp, className: "af-form__input-helper", children: helper })), _jsx(ItemMessageComponent, { id: idError, message: error })] }));
|
|
11
11
|
});
|
|
12
12
|
TextArea.displayName = "TextArea";
|
|
13
13
|
export { TextArea };
|
|
@@ -2,11 +2,10 @@ import "@axa-fr/design-system-apollo-css/dist/Form/TextArea/TextAreaLF.scss";
|
|
|
2
2
|
import { type ComponentProps } from "react";
|
|
3
3
|
import { ItemMessage } from "../ItemMessage/ItemMessageLF";
|
|
4
4
|
export declare const TextArea: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<import("react").ClassAttributes<HTMLTextAreaElement> & import("react").TextareaHTMLAttributes<HTMLTextAreaElement> & Pick<{
|
|
5
|
-
label?:
|
|
5
|
+
label?: import("react").ReactNode;
|
|
6
6
|
description?: string;
|
|
7
7
|
required?: boolean;
|
|
8
8
|
inputId: string;
|
|
9
|
-
idLabel: string;
|
|
10
9
|
sideButtonLabel?: string;
|
|
11
10
|
onSideButtonClick?: import("react").MouseEventHandler<HTMLButtonElement>;
|
|
12
11
|
buttonLabel?: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/design-system-apollo-react",
|
|
3
|
-
"version": "1.0.5-alpha.
|
|
3
|
+
"version": "1.0.5-alpha.383",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@axa-fr/design-system-apollo-css": "1.0.5-alpha.
|
|
50
|
-
"@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.
|
|
49
|
+
"@axa-fr/design-system-apollo-css": "1.0.5-alpha.383",
|
|
50
|
+
"@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.383",
|
|
51
51
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
52
52
|
"react": ">= 18"
|
|
53
53
|
},
|