@axa-fr/design-system-slash-react 1.2.1-alpha.9 → 1.2.1-alpha.94
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/Card/Card.d.ts +13 -0
- package/dist/Card/Card.js +6 -0
- package/dist/Form/Checkbox/CheckboxInput.d.ts +2 -2
- package/dist/Form/Checkbox/CheckboxInput.js +6 -16
- package/dist/Form/Checkbox/CheckboxItem.js +3 -1
- package/dist/Form/Choice/Choice.d.ts +3 -2
- package/dist/Form/Choice/Choice.js +1 -2
- package/dist/Form/Choice/ChoiceInput.d.ts +2 -2
- package/dist/Form/Choice/ChoiceInput.js +4 -17
- package/dist/Form/Date/DateInput.d.ts +6 -42
- package/dist/Form/Date/DateInput.js +5 -11
- package/dist/Form/File/FileErrors.js +3 -2
- package/dist/Form/File/FileInput.d.ts +4 -5
- package/dist/Form/File/FileInput.js +6 -11
- package/dist/Form/File/FileTable.js +1 -1
- package/dist/Form/MultiSelect/MultiSelectInput.d.ts +4 -6
- package/dist/Form/MultiSelect/MultiSelectInput.js +6 -11
- package/dist/Form/Number/NumberInput.d.ts +4 -7
- package/dist/Form/Number/NumberInput.js +4 -11
- package/dist/Form/Pass/PassInput.d.ts +4 -4
- package/dist/Form/Pass/PassInput.js +5 -12
- package/dist/Form/Radio/Radio.d.ts +19 -7
- package/dist/Form/Radio/Radio.js +13 -4
- package/dist/Form/Radio/RadioCardGroup.d.ts +10 -0
- package/dist/Form/Radio/RadioCardGroup.js +26 -0
- package/dist/Form/Radio/RadioInput.d.ts +5 -43
- package/dist/Form/Radio/RadioInput.js +6 -11
- package/dist/Form/Select/Select.d.ts +52 -52
- package/dist/Form/Select/SelectInput.d.ts +96 -108
- package/dist/Form/Select/SelectInput.js +5 -11
- package/dist/Form/Slider/Slider.d.ts +3 -0
- package/dist/Form/Slider/Slider.js +3 -0
- package/dist/Form/Slider/SliderInput.d.ts +7 -6
- package/dist/Form/Slider/SliderInput.js +7 -12
- package/dist/Form/Text/TextInput.d.ts +3 -5
- package/dist/Form/Text/TextInput.js +4 -7
- package/dist/Form/Textarea/TextareaInput.d.ts +3 -5
- package/dist/Form/Textarea/TextareaInput.js +5 -12
- package/dist/Form/core/{LegacyField.d.ts → Deprecated/Field.d.ts} +4 -0
- package/dist/Form/core/{LegacyField.js → Deprecated/Field.js} +7 -3
- package/dist/Form/core/{FieldForm.d.ts → Deprecated/FieldForm.d.ts} +7 -2
- package/dist/Form/core/{FieldForm.js → Deprecated/FieldForm.js} +8 -3
- package/dist/Form/core/{FieldInput.d.ts → Deprecated/FieldInput.d.ts} +4 -0
- package/dist/Form/core/{FieldInput.js → Deprecated/FieldInput.js} +5 -1
- package/dist/Form/core/Field.d.ts +58 -6
- package/dist/Form/core/Field.js +23 -10
- package/dist/Form/core/FormClassManager.js +4 -1
- package/dist/Form/core/HelpMessage.d.ts +2 -1
- package/dist/Form/core/HelpMessage.js +1 -1
- package/dist/Form/core/index.d.ts +7 -4
- package/dist/Form/core/index.js +3 -3
- package/dist/Layout/Footer/Footer.js +1 -1
- package/dist/Layout/Header/AnchorNavBar/AnchorNavBar.d.ts +16 -0
- package/dist/Layout/Header/AnchorNavBar/AnchorNavBar.js +20 -0
- package/dist/Layout/Header/HeaderTitle/HeaderTitle.d.ts +5 -1
- package/dist/Layout/Header/HeaderTitle/HeaderTitle.js +7 -2
- package/dist/Layout/Header/NavBar/NavBarItem/NavBarItem.js +1 -1
- package/dist/Layout/Header/User/InnerUser.js +1 -1
- package/dist/Loader/Loader.js +1 -1
- package/dist/Messages/Message.d.ts +47 -0
- package/dist/Messages/Message.js +43 -0
- package/dist/ModalAgent/BooleanModal.d.ts +28 -3
- package/dist/ModalAgent/BooleanModal.js +1 -1
- package/dist/ModalAgent/Modal.d.ts +17 -3
- package/dist/ModalAgent/Modal.js +15 -2
- package/dist/ModalAgent/components/Header.d.ts +25 -5
- package/dist/ModalAgent/components/Header.js +4 -3
- package/dist/Popover/AnimatedPopover.js +1 -1
- package/dist/Steps/StepBase.js +5 -3
- package/dist/Steps/VerticalStep.d.ts +16 -0
- package/dist/Steps/VerticalStep.js +22 -0
- package/dist/Steps/index.d.ts +1 -0
- package/dist/Steps/index.js +1 -0
- package/dist/Steps/types.d.ts +8 -0
- package/dist/Steps/types.js +1 -0
- package/dist/Summary/index.d.ts +3 -3
- package/dist/Summary/index.js +3 -2
- package/dist/Svg/Svg.js +1 -1
- package/dist/Table/Pagination/Li.js +1 -4
- package/dist/index.d.ts +10 -2
- package/dist/index.js +9 -2
- package/dist/utilities/helpers/getComponentClassName.d.ts +7 -0
- package/dist/utilities/helpers/getComponentClassName.js +14 -0
- package/package.json +4 -4
- package/dist/Alert/Alert.d.ts +0 -17
- package/dist/Alert/Alert.js +0 -14
|
@@ -1,44 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
className?: string;
|
|
7
|
-
classModifier?: string;
|
|
8
|
-
forceDisplayMessage?: boolean;
|
|
9
|
-
children: import("react").ReactNode;
|
|
10
|
-
setStateMemoryFn?: typeof import("../core/FieldForm").setStateMemory;
|
|
11
|
-
onChangeByStateFn?: typeof import("../core/FieldForm").onChangeByState;
|
|
12
|
-
setStateOnBlurFn?: typeof import("../core/FieldForm").setStateOnBlur;
|
|
13
|
-
setStateOnFocusFn?: typeof import("../core/FieldForm").setStateOnFocus;
|
|
14
|
-
initialState?: {
|
|
15
|
-
hasLostFocusOnce: boolean;
|
|
16
|
-
hasFocus: boolean;
|
|
17
|
-
hasChange: boolean;
|
|
18
|
-
memory: {
|
|
19
|
-
message?: string;
|
|
20
|
-
messageType?: import("../core").MessageTypes;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
}, "children"> & {
|
|
24
|
-
label: import("react").ReactNode;
|
|
25
|
-
children?: import("react").ReactNode;
|
|
26
|
-
id?: string;
|
|
27
|
-
classModifier?: string;
|
|
28
|
-
classNameContainerLabel?: string;
|
|
29
|
-
classNameContainerInput?: string;
|
|
30
|
-
isVisible?: boolean;
|
|
31
|
-
roleContainer?: string;
|
|
32
|
-
ariaLabelContainer?: string;
|
|
33
|
-
isLabelContainerLinkedToInput?: boolean;
|
|
34
|
-
errorId?: string;
|
|
35
|
-
} & Omit<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "type" | "checked"> & {
|
|
36
|
-
classModifier?: string;
|
|
37
|
-
optionClassName?: string;
|
|
38
|
-
label?: import("react").ReactNode;
|
|
39
|
-
isChecked?: boolean;
|
|
40
|
-
}, "ref"> & import("react").RefAttributes<HTMLInputElement>, "label" | "className" | "id"> & {
|
|
41
|
-
options: import("../core").Option[];
|
|
42
|
-
mode?: keyof typeof RadioModes;
|
|
43
|
-
}, "ref"> & import("react").RefAttributes<HTMLInputElement>, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
1
|
+
import { ComponentPropsWithoutRef } from "react";
|
|
2
|
+
import { type ConsumerFieldProps } from "../core";
|
|
3
|
+
import { Radio } from "./Radio";
|
|
4
|
+
type RadioInputProps = Omit<ConsumerFieldProps & ComponentPropsWithoutRef<typeof Radio>, "children">;
|
|
5
|
+
declare const RadioInput: import("react").ForwardRefExoticComponent<RadioInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
44
6
|
export { RadioInput };
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import { Field, useOptionsWithId } from "../core";
|
|
4
4
|
import { Radio, RadioModes } from "./Radio";
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
const rowModifier = `${classModifier ?? ""}${mode === RadioModes.classic ? " label-top " : ""}`;
|
|
5
|
+
const RadioInput = forwardRef(({ label, mode = "default", options, rightElement, ...props }, inputRef) => {
|
|
6
|
+
const labelPosition = mode === RadioModes.classic ? "top" : "center";
|
|
8
7
|
const newOptions = useOptionsWithId(options);
|
|
9
|
-
|
|
10
|
-
const errorUseId = useId();
|
|
11
|
-
const { inputClassModifier, inputFieldClassModifier } = useInputClassModifier(classModifier, disabled, Boolean(children), required);
|
|
12
|
-
const isInvalid = useAriaInvalid(message, forceDisplayMessage, messageType);
|
|
13
|
-
return (_jsxs(LegacyField, { label: label, id: firstId, message: message, messageType: messageType, isVisible: isVisible, forceDisplayMessage: forceDisplayMessage, className: className, classModifier: rowModifier + inputFieldClassModifier, classNameContainerLabel: classNameContainerLabel, classNameContainerInput: classNameContainerInput, roleContainer: "radiogroup", ariaLabelContainer: ariaLabelContainer ?? label?.toString(), isLabelContainerLinkedToInput: false, errorId: errorUseId, children: [_jsx(Radio, { options: newOptions, mode: mode, classModifier: inputClassModifier, ref: inputRef, disabled: disabled, required: required || classModifier?.includes("required"), "aria-describedby": errorUseId, "aria-invalid": isInvalid, ...radioProps }), children] }));
|
|
8
|
+
return (_jsx(Field, { label: label, labelPosition: labelPosition, roleContainer: mode !== "card" ? "radiogroup" : undefined, ...props, renderInput: ({ classModifier, ariaInvalid, errorId, ...radioProps }) => (_jsxs(_Fragment, { children: [_jsx(Radio, { options: newOptions, mode: mode, classModifier: classModifier, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...radioProps }), rightElement] })) }));
|
|
14
9
|
});
|
|
15
10
|
RadioInput.displayName = "EnhancedInputRadio";
|
|
16
11
|
export { RadioInput };
|
|
@@ -1,61 +1,14 @@
|
|
|
1
1
|
import { OptionHTMLAttributes } from "react";
|
|
2
2
|
declare const Select: import("react").ForwardRefExoticComponent<(Omit<Omit<{
|
|
3
|
-
form?: string | undefined | undefined;
|
|
4
|
-
slot?: string | undefined | undefined;
|
|
5
|
-
style?: import("react").CSSProperties | undefined;
|
|
6
|
-
title?: string | undefined | undefined;
|
|
7
|
-
ref?: import("react").Ref<HTMLSelectElement> | undefined;
|
|
8
|
-
key?: import("react").Key | null | undefined;
|
|
9
|
-
defaultChecked?: boolean | undefined | undefined;
|
|
10
|
-
defaultValue?: string | number | readonly string[] | undefined;
|
|
11
|
-
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
12
3
|
suppressHydrationWarning?: boolean | undefined | undefined;
|
|
13
|
-
accessKey?: string | undefined | undefined;
|
|
14
|
-
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
15
|
-
autoFocus?: boolean | undefined | undefined;
|
|
16
4
|
className?: string | undefined | undefined;
|
|
17
|
-
|
|
18
|
-
contextMenu?: string | undefined | undefined;
|
|
19
|
-
dir?: string | undefined | undefined;
|
|
20
|
-
draggable?: (boolean | "true" | "false") | undefined;
|
|
21
|
-
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
22
|
-
hidden?: boolean | undefined | undefined;
|
|
5
|
+
color?: string | undefined | undefined;
|
|
23
6
|
id?: string | undefined | undefined;
|
|
24
7
|
lang?: string | undefined | undefined;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
tabIndex?: number | undefined | undefined;
|
|
28
|
-
translate?: "yes" | "no" | undefined | undefined;
|
|
29
|
-
radioGroup?: string | undefined | undefined;
|
|
8
|
+
name?: string | undefined | undefined;
|
|
9
|
+
style?: import("react").CSSProperties | undefined;
|
|
30
10
|
role?: import("react").AriaRole | undefined;
|
|
31
|
-
|
|
32
|
-
content?: string | undefined | undefined;
|
|
33
|
-
datatype?: string | undefined | undefined;
|
|
34
|
-
inlist?: any;
|
|
35
|
-
prefix?: string | undefined | undefined;
|
|
36
|
-
property?: string | undefined | undefined;
|
|
37
|
-
rel?: string | undefined | undefined;
|
|
38
|
-
resource?: string | undefined | undefined;
|
|
39
|
-
rev?: string | undefined | undefined;
|
|
40
|
-
typeof?: string | undefined | undefined;
|
|
41
|
-
vocab?: string | undefined | undefined;
|
|
42
|
-
autoCorrect?: string | undefined | undefined;
|
|
43
|
-
autoSave?: string | undefined | undefined;
|
|
44
|
-
color?: string | undefined | undefined;
|
|
45
|
-
itemProp?: string | undefined | undefined;
|
|
46
|
-
itemScope?: boolean | undefined | undefined;
|
|
47
|
-
itemType?: string | undefined | undefined;
|
|
48
|
-
itemID?: string | undefined | undefined;
|
|
49
|
-
itemRef?: string | undefined | undefined;
|
|
50
|
-
results?: number | undefined | undefined;
|
|
51
|
-
security?: string | undefined | undefined;
|
|
52
|
-
unselectable?: "on" | "off" | undefined | undefined;
|
|
53
|
-
popover?: "" | "auto" | "manual" | undefined | undefined;
|
|
54
|
-
popoverTargetAction?: "toggle" | "show" | "hide" | undefined | undefined;
|
|
55
|
-
popoverTarget?: string | undefined | undefined;
|
|
56
|
-
inert?: boolean | undefined | undefined;
|
|
57
|
-
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
58
|
-
is?: string | undefined | undefined;
|
|
11
|
+
tabIndex?: number | undefined | undefined;
|
|
59
12
|
"aria-activedescendant"?: string | undefined | undefined;
|
|
60
13
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
61
14
|
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
|
|
@@ -281,9 +234,56 @@ declare const Select: import("react").ForwardRefExoticComponent<(Omit<Omit<{
|
|
|
281
234
|
onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLSelectElement> | undefined;
|
|
282
235
|
onTransitionStart?: import("react").TransitionEventHandler<HTMLSelectElement> | undefined;
|
|
283
236
|
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLSelectElement> | undefined;
|
|
237
|
+
ref?: import("react").Ref<HTMLSelectElement> | undefined;
|
|
238
|
+
form?: string | undefined | undefined;
|
|
239
|
+
slot?: string | undefined | undefined;
|
|
240
|
+
title?: string | undefined | undefined;
|
|
241
|
+
dir?: string | undefined | undefined;
|
|
284
242
|
classModifier?: string | undefined;
|
|
243
|
+
key?: import("react").Key | null | undefined;
|
|
244
|
+
defaultChecked?: boolean | undefined | undefined;
|
|
245
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
246
|
+
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
247
|
+
accessKey?: string | undefined | undefined;
|
|
248
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
249
|
+
autoFocus?: boolean | undefined | undefined;
|
|
250
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
251
|
+
contextMenu?: string | undefined | undefined;
|
|
252
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
253
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
254
|
+
hidden?: boolean | undefined | undefined;
|
|
255
|
+
nonce?: string | undefined | undefined;
|
|
256
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
257
|
+
translate?: "yes" | "no" | undefined | undefined;
|
|
258
|
+
radioGroup?: string | undefined | undefined;
|
|
259
|
+
about?: string | undefined | undefined;
|
|
260
|
+
content?: string | undefined | undefined;
|
|
261
|
+
datatype?: string | undefined | undefined;
|
|
262
|
+
inlist?: any;
|
|
263
|
+
prefix?: string | undefined | undefined;
|
|
264
|
+
property?: string | undefined | undefined;
|
|
265
|
+
rel?: string | undefined | undefined;
|
|
266
|
+
resource?: string | undefined | undefined;
|
|
267
|
+
rev?: string | undefined | undefined;
|
|
268
|
+
typeof?: string | undefined | undefined;
|
|
269
|
+
vocab?: string | undefined | undefined;
|
|
270
|
+
autoCorrect?: string | undefined | undefined;
|
|
271
|
+
autoSave?: string | undefined | undefined;
|
|
272
|
+
itemProp?: string | undefined | undefined;
|
|
273
|
+
itemScope?: boolean | undefined | undefined;
|
|
274
|
+
itemType?: string | undefined | undefined;
|
|
275
|
+
itemID?: string | undefined | undefined;
|
|
276
|
+
itemRef?: string | undefined | undefined;
|
|
277
|
+
results?: number | undefined | undefined;
|
|
278
|
+
security?: string | undefined | undefined;
|
|
279
|
+
unselectable?: "on" | "off" | undefined | undefined;
|
|
280
|
+
popover?: "" | "auto" | "manual" | undefined | undefined;
|
|
281
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined | undefined;
|
|
282
|
+
popoverTarget?: string | undefined | undefined;
|
|
283
|
+
inert?: boolean | undefined | undefined;
|
|
284
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
285
|
+
is?: string | undefined | undefined;
|
|
285
286
|
disabled?: boolean | undefined | undefined;
|
|
286
|
-
name?: string | undefined | undefined;
|
|
287
287
|
value?: string | number | readonly string[] | undefined;
|
|
288
288
|
required?: boolean | undefined | undefined;
|
|
289
289
|
autoComplete?: string | undefined | undefined;
|
|
@@ -1,29 +1,8 @@
|
|
|
1
|
-
import { OptionHTMLAttributes
|
|
1
|
+
import { OptionHTMLAttributes } from "react";
|
|
2
2
|
declare const SelectInput: import("react").ForwardRefExoticComponent<(Omit<Omit<{
|
|
3
|
-
|
|
4
|
-
messageType?: import("../core").MessageTypes;
|
|
5
|
-
} & {
|
|
6
|
-
className?: string;
|
|
7
|
-
classModifier?: string;
|
|
8
|
-
forceDisplayMessage?: boolean;
|
|
9
|
-
children: ReactNode;
|
|
10
|
-
setStateMemoryFn?: typeof import("../core/FieldForm").setStateMemory;
|
|
11
|
-
onChangeByStateFn?: typeof import("../core/FieldForm").onChangeByState;
|
|
12
|
-
setStateOnBlurFn?: typeof import("../core/FieldForm").setStateOnBlur;
|
|
13
|
-
setStateOnFocusFn?: typeof import("../core/FieldForm").setStateOnFocus;
|
|
14
|
-
initialState?: {
|
|
15
|
-
hasLostFocusOnce: boolean;
|
|
16
|
-
hasFocus: boolean;
|
|
17
|
-
hasChange: boolean;
|
|
18
|
-
memory: {
|
|
19
|
-
message?: string;
|
|
20
|
-
messageType?: import("../core").MessageTypes;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
}, "children"> & {
|
|
24
|
-
label: ReactNode;
|
|
25
|
-
children?: ReactNode;
|
|
3
|
+
label: import("react").ReactNode;
|
|
26
4
|
id?: string;
|
|
5
|
+
className?: string;
|
|
27
6
|
classModifier?: string;
|
|
28
7
|
classNameContainerLabel?: string;
|
|
29
8
|
classNameContainerInput?: string;
|
|
@@ -31,64 +10,33 @@ declare const SelectInput: import("react").ForwardRefExoticComponent<(Omit<Omit<
|
|
|
31
10
|
roleContainer?: string;
|
|
32
11
|
ariaLabelContainer?: string;
|
|
33
12
|
isLabelContainerLinkedToInput?: boolean;
|
|
34
|
-
|
|
13
|
+
forceDisplayMessage?: boolean;
|
|
14
|
+
message?: string;
|
|
15
|
+
messageType?: import("../core").MessageTypes;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
helpMessage?: import("react").ReactNode;
|
|
19
|
+
labelPosition?: "top" | "center";
|
|
20
|
+
classNameSuffix?: string;
|
|
21
|
+
renderInput: (props: {
|
|
22
|
+
id: string;
|
|
23
|
+
classModifier: string;
|
|
24
|
+
errorId?: string;
|
|
25
|
+
ariaInvalid?: boolean;
|
|
26
|
+
} & Record<string, unknown>) => import("react").ReactNode;
|
|
27
|
+
appendChildren?: import("react").ReactNode;
|
|
28
|
+
}, "children" | "renderInput" | "classNameSuffix"> & {
|
|
29
|
+
rightElement?: import("react").ReactNode;
|
|
35
30
|
} & Omit<Omit<{
|
|
36
|
-
form?: string | undefined | undefined;
|
|
37
|
-
slot?: string | undefined | undefined;
|
|
38
|
-
style?: import("react").CSSProperties | undefined;
|
|
39
|
-
title?: string | undefined | undefined;
|
|
40
|
-
ref?: import("react").Ref<HTMLSelectElement> | undefined;
|
|
41
|
-
key?: import("react").Key | null | undefined;
|
|
42
|
-
defaultChecked?: boolean | undefined | undefined;
|
|
43
|
-
defaultValue?: string | number | readonly string[] | undefined;
|
|
44
|
-
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
45
31
|
suppressHydrationWarning?: boolean | undefined | undefined;
|
|
46
|
-
accessKey?: string | undefined | undefined;
|
|
47
|
-
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
48
|
-
autoFocus?: boolean | undefined | undefined;
|
|
49
32
|
className?: string | undefined | undefined;
|
|
50
|
-
|
|
51
|
-
contextMenu?: string | undefined | undefined;
|
|
52
|
-
dir?: string | undefined | undefined;
|
|
53
|
-
draggable?: (boolean | "true" | "false") | undefined;
|
|
54
|
-
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
55
|
-
hidden?: boolean | undefined | undefined;
|
|
33
|
+
color?: string | undefined | undefined;
|
|
56
34
|
id?: string | undefined | undefined;
|
|
57
35
|
lang?: string | undefined | undefined;
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
tabIndex?: number | undefined | undefined;
|
|
61
|
-
translate?: "yes" | "no" | undefined | undefined;
|
|
62
|
-
radioGroup?: string | undefined | undefined;
|
|
36
|
+
name?: string | undefined | undefined;
|
|
37
|
+
style?: import("react").CSSProperties | undefined;
|
|
63
38
|
role?: import("react").AriaRole | undefined;
|
|
64
|
-
|
|
65
|
-
content?: string | undefined | undefined;
|
|
66
|
-
datatype?: string | undefined | undefined;
|
|
67
|
-
inlist?: any;
|
|
68
|
-
prefix?: string | undefined | undefined;
|
|
69
|
-
property?: string | undefined | undefined;
|
|
70
|
-
rel?: string | undefined | undefined;
|
|
71
|
-
resource?: string | undefined | undefined;
|
|
72
|
-
rev?: string | undefined | undefined;
|
|
73
|
-
typeof?: string | undefined | undefined;
|
|
74
|
-
vocab?: string | undefined | undefined;
|
|
75
|
-
autoCorrect?: string | undefined | undefined;
|
|
76
|
-
autoSave?: string | undefined | undefined;
|
|
77
|
-
color?: string | undefined | undefined;
|
|
78
|
-
itemProp?: string | undefined | undefined;
|
|
79
|
-
itemScope?: boolean | undefined | undefined;
|
|
80
|
-
itemType?: string | undefined | undefined;
|
|
81
|
-
itemID?: string | undefined | undefined;
|
|
82
|
-
itemRef?: string | undefined | undefined;
|
|
83
|
-
results?: number | undefined | undefined;
|
|
84
|
-
security?: string | undefined | undefined;
|
|
85
|
-
unselectable?: "on" | "off" | undefined | undefined;
|
|
86
|
-
popover?: "" | "auto" | "manual" | undefined | undefined;
|
|
87
|
-
popoverTargetAction?: "toggle" | "show" | "hide" | undefined | undefined;
|
|
88
|
-
popoverTarget?: string | undefined | undefined;
|
|
89
|
-
inert?: boolean | undefined | undefined;
|
|
90
|
-
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
91
|
-
is?: string | undefined | undefined;
|
|
39
|
+
tabIndex?: number | undefined | undefined;
|
|
92
40
|
"aria-activedescendant"?: string | undefined | undefined;
|
|
93
41
|
"aria-atomic"?: (boolean | "true" | "false") | undefined;
|
|
94
42
|
"aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
|
|
@@ -142,7 +90,7 @@ declare const SelectInput: import("react").ForwardRefExoticComponent<(Omit<Omit<
|
|
|
142
90
|
"aria-valuemin"?: number | undefined | undefined;
|
|
143
91
|
"aria-valuenow"?: number | undefined | undefined;
|
|
144
92
|
"aria-valuetext"?: string | undefined | undefined;
|
|
145
|
-
children: ReactNode | undefined;
|
|
93
|
+
children: import("react").ReactNode | undefined;
|
|
146
94
|
dangerouslySetInnerHTML?: {
|
|
147
95
|
__html: string | TrustedHTML;
|
|
148
96
|
} | undefined | undefined;
|
|
@@ -314,9 +262,56 @@ declare const SelectInput: import("react").ForwardRefExoticComponent<(Omit<Omit<
|
|
|
314
262
|
onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLSelectElement> | undefined;
|
|
315
263
|
onTransitionStart?: import("react").TransitionEventHandler<HTMLSelectElement> | undefined;
|
|
316
264
|
onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLSelectElement> | undefined;
|
|
265
|
+
ref?: import("react").Ref<HTMLSelectElement> | undefined;
|
|
266
|
+
form?: string | undefined | undefined;
|
|
267
|
+
slot?: string | undefined | undefined;
|
|
268
|
+
title?: string | undefined | undefined;
|
|
269
|
+
dir?: string | undefined | undefined;
|
|
317
270
|
classModifier?: string | undefined;
|
|
271
|
+
key?: import("react").Key | null | undefined;
|
|
272
|
+
defaultChecked?: boolean | undefined | undefined;
|
|
273
|
+
defaultValue?: string | number | readonly string[] | undefined;
|
|
274
|
+
suppressContentEditableWarning?: boolean | undefined | undefined;
|
|
275
|
+
accessKey?: string | undefined | undefined;
|
|
276
|
+
autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
|
|
277
|
+
autoFocus?: boolean | undefined | undefined;
|
|
278
|
+
contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
|
|
279
|
+
contextMenu?: string | undefined | undefined;
|
|
280
|
+
draggable?: (boolean | "true" | "false") | undefined;
|
|
281
|
+
enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
|
|
282
|
+
hidden?: boolean | undefined | undefined;
|
|
283
|
+
nonce?: string | undefined | undefined;
|
|
284
|
+
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
285
|
+
translate?: "yes" | "no" | undefined | undefined;
|
|
286
|
+
radioGroup?: string | undefined | undefined;
|
|
287
|
+
about?: string | undefined | undefined;
|
|
288
|
+
content?: string | undefined | undefined;
|
|
289
|
+
datatype?: string | undefined | undefined;
|
|
290
|
+
inlist?: any;
|
|
291
|
+
prefix?: string | undefined | undefined;
|
|
292
|
+
property?: string | undefined | undefined;
|
|
293
|
+
rel?: string | undefined | undefined;
|
|
294
|
+
resource?: string | undefined | undefined;
|
|
295
|
+
rev?: string | undefined | undefined;
|
|
296
|
+
typeof?: string | undefined | undefined;
|
|
297
|
+
vocab?: string | undefined | undefined;
|
|
298
|
+
autoCorrect?: string | undefined | undefined;
|
|
299
|
+
autoSave?: string | undefined | undefined;
|
|
300
|
+
itemProp?: string | undefined | undefined;
|
|
301
|
+
itemScope?: boolean | undefined | undefined;
|
|
302
|
+
itemType?: string | undefined | undefined;
|
|
303
|
+
itemID?: string | undefined | undefined;
|
|
304
|
+
itemRef?: string | undefined | undefined;
|
|
305
|
+
results?: number | undefined | undefined;
|
|
306
|
+
security?: string | undefined | undefined;
|
|
307
|
+
unselectable?: "on" | "off" | undefined | undefined;
|
|
308
|
+
popover?: "" | "auto" | "manual" | undefined | undefined;
|
|
309
|
+
popoverTargetAction?: "toggle" | "show" | "hide" | undefined | undefined;
|
|
310
|
+
popoverTarget?: string | undefined | undefined;
|
|
311
|
+
inert?: boolean | undefined | undefined;
|
|
312
|
+
inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
|
|
313
|
+
is?: string | undefined | undefined;
|
|
318
314
|
disabled?: boolean | undefined | undefined;
|
|
319
|
-
name?: string | undefined | undefined;
|
|
320
315
|
value?: string | number | readonly string[] | undefined;
|
|
321
316
|
required?: boolean | undefined | undefined;
|
|
322
317
|
autoComplete?: string | undefined | undefined;
|
|
@@ -328,37 +323,15 @@ declare const SelectInput: import("react").ForwardRefExoticComponent<(Omit<Omit<
|
|
|
328
323
|
options?: OptionHTMLAttributes<HTMLOptionElement>[];
|
|
329
324
|
mode?: "default" | "base";
|
|
330
325
|
} & {
|
|
331
|
-
children?: ReactNode | undefined;
|
|
326
|
+
children?: import("react").ReactNode | undefined;
|
|
332
327
|
}, "ref"> & import("react").RefAttributes<HTMLSelectElement> & {
|
|
333
|
-
helpMessage?: ReactNode;
|
|
334
328
|
options: OptionHTMLAttributes<HTMLOptionElement>[];
|
|
335
329
|
} & {
|
|
336
|
-
children?: ReactNode | undefined;
|
|
330
|
+
children?: import("react").ReactNode | undefined;
|
|
337
331
|
}, "ref"> | Omit<Omit<{
|
|
338
|
-
|
|
339
|
-
messageType?: import("../core").MessageTypes;
|
|
340
|
-
} & {
|
|
341
|
-
className?: string;
|
|
342
|
-
classModifier?: string;
|
|
343
|
-
forceDisplayMessage?: boolean;
|
|
344
|
-
children: ReactNode;
|
|
345
|
-
setStateMemoryFn?: typeof import("../core/FieldForm").setStateMemory;
|
|
346
|
-
onChangeByStateFn?: typeof import("../core/FieldForm").onChangeByState;
|
|
347
|
-
setStateOnBlurFn?: typeof import("../core/FieldForm").setStateOnBlur;
|
|
348
|
-
setStateOnFocusFn?: typeof import("../core/FieldForm").setStateOnFocus;
|
|
349
|
-
initialState?: {
|
|
350
|
-
hasLostFocusOnce: boolean;
|
|
351
|
-
hasFocus: boolean;
|
|
352
|
-
hasChange: boolean;
|
|
353
|
-
memory: {
|
|
354
|
-
message?: string;
|
|
355
|
-
messageType?: import("../core").MessageTypes;
|
|
356
|
-
};
|
|
357
|
-
};
|
|
358
|
-
}, "children"> & {
|
|
359
|
-
label: ReactNode;
|
|
360
|
-
children?: ReactNode;
|
|
332
|
+
label: import("react").ReactNode;
|
|
361
333
|
id?: string;
|
|
334
|
+
className?: string;
|
|
362
335
|
classModifier?: string;
|
|
363
336
|
classNameContainerLabel?: string;
|
|
364
337
|
classNameContainerInput?: string;
|
|
@@ -366,7 +339,23 @@ declare const SelectInput: import("react").ForwardRefExoticComponent<(Omit<Omit<
|
|
|
366
339
|
roleContainer?: string;
|
|
367
340
|
ariaLabelContainer?: string;
|
|
368
341
|
isLabelContainerLinkedToInput?: boolean;
|
|
369
|
-
|
|
342
|
+
forceDisplayMessage?: boolean;
|
|
343
|
+
message?: string;
|
|
344
|
+
messageType?: import("../core").MessageTypes;
|
|
345
|
+
required?: boolean;
|
|
346
|
+
disabled?: boolean;
|
|
347
|
+
helpMessage?: import("react").ReactNode;
|
|
348
|
+
labelPosition?: "top" | "center";
|
|
349
|
+
classNameSuffix?: string;
|
|
350
|
+
renderInput: (props: {
|
|
351
|
+
id: string;
|
|
352
|
+
classModifier: string;
|
|
353
|
+
errorId?: string;
|
|
354
|
+
ariaInvalid?: boolean;
|
|
355
|
+
} & Record<string, unknown>) => import("react").ReactNode;
|
|
356
|
+
appendChildren?: import("react").ReactNode;
|
|
357
|
+
}, "children" | "renderInput" | "classNameSuffix"> & {
|
|
358
|
+
rightElement?: import("react").ReactNode;
|
|
370
359
|
} & Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref"> & {
|
|
371
360
|
options?: OptionHTMLAttributes<HTMLOptionElement>[];
|
|
372
361
|
classModifier?: string;
|
|
@@ -378,11 +367,10 @@ declare const SelectInput: import("react").ForwardRefExoticComponent<(Omit<Omit<
|
|
|
378
367
|
options?: OptionHTMLAttributes<HTMLOptionElement>[];
|
|
379
368
|
mode?: "default" | "base";
|
|
380
369
|
} & {
|
|
381
|
-
children?: ReactNode | undefined;
|
|
370
|
+
children?: import("react").ReactNode | undefined;
|
|
382
371
|
}, "ref"> & import("react").RefAttributes<HTMLSelectElement> & {
|
|
383
|
-
helpMessage?: ReactNode;
|
|
384
372
|
options: OptionHTMLAttributes<HTMLOptionElement>[];
|
|
385
373
|
} & {
|
|
386
|
-
children?: ReactNode | undefined;
|
|
374
|
+
children?: import("react").ReactNode | undefined;
|
|
387
375
|
}, "ref">) & import("react").RefAttributes<HTMLSelectElement>>;
|
|
388
376
|
export { SelectInput };
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
2
|
-
import { forwardRef,
|
|
3
|
-
import {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, } from "react";
|
|
3
|
+
import { Field } from "../core";
|
|
4
4
|
import { Select } from "./Select";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const generatedId = useId();
|
|
8
|
-
const errorUseId = useId();
|
|
9
|
-
const inputId = id ?? generatedId;
|
|
10
|
-
const { inputClassModifier, inputFieldClassModifier } = useInputClassModifier(classModifier, disabled, Boolean(children), required);
|
|
11
|
-
const isInvalid = useAriaInvalid(message, forceDisplayMessage, messageType);
|
|
12
|
-
return (_jsxs(LegacyField, { label: label, id: inputId, message: message, messageType: messageType, isVisible: isVisible, forceDisplayMessage: forceDisplayMessage, className: className, classModifier: inputFieldClassModifier, classNameContainerLabel: classNameContainerLabel, classNameContainerInput: classNameContainerInput, errorId: errorUseId, children: [_jsxs(FieldInput, { className: "af-form__select", classModifier: inputFieldClassModifier, children: [_jsx(Select, { id: inputId, disabled: disabled, classModifier: inputClassModifier, ref: inputRef, required: required, "aria-describedby": errorUseId, "aria-invalid": isInvalid, ...otherSelectProps }), children] }), _jsx(HelpMessage, { message: helpMessage, isVisible: !message })] }));
|
|
5
|
+
const SelectInput = forwardRef(({ label, options, ...props }, inputRef) => {
|
|
6
|
+
return (_jsx(Field, { label: label, classNameSuffix: "select", ...props, renderInput: ({ classModifier, id, ariaInvalid, errorId, ...otherSelectProps }) => (_jsx(Select, { id: id, ref: inputRef, classModifier: classModifier, "aria-describedby": errorId, "aria-invalid": ariaInvalid, options: options, ...otherSelectProps })) }));
|
|
13
7
|
});
|
|
14
8
|
SelectInput.displayName = "SelectInput";
|
|
15
9
|
export { SelectInput };
|
|
@@ -20,5 +20,8 @@ type Props = Omit<RcSliderProps, "marks" | "onChange" | "onChangeComplete"> & {
|
|
|
20
20
|
value: number;
|
|
21
21
|
}) => void;
|
|
22
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* @deprecated Slider is deprecated and will be removed in a future major release.
|
|
25
|
+
*/
|
|
23
26
|
declare const Slider: ({ options, value, defaultValue, className, classModifier, ...otherProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
24
27
|
export { Slider };
|
|
@@ -2,6 +2,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import RcSlider from "rc-slider";
|
|
3
3
|
import { useCallback, useMemo, } from "react";
|
|
4
4
|
import { getComponentClassName } from "../../utilities";
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated Slider is deprecated and will be removed in a future major release.
|
|
7
|
+
*/
|
|
5
8
|
const Slider = ({ options, value, defaultValue, className, classModifier, ...otherProps }) => {
|
|
6
9
|
const defaultValueIndex = useMemo(() => {
|
|
7
10
|
const newDefaultValueIndex = options.findIndex((opt) => opt.value === (defaultValue || value));
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { type ComponentProps
|
|
2
|
-
import {
|
|
1
|
+
import { type ComponentProps } from "react";
|
|
2
|
+
import { ConsumerFieldProps } from "../core";
|
|
3
3
|
import { Slider } from "./Slider";
|
|
4
|
-
type Props =
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
type Props = Omit<ConsumerFieldProps & ComponentProps<typeof Slider>, "children">;
|
|
5
|
+
/**
|
|
6
|
+
* @deprecated This component is deprecated and will be removed in a future major release.
|
|
7
|
+
*/
|
|
8
|
+
declare const SliderInput: ({ rightElement, name, options, label, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export { SliderInput };
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import { HelpMessage, LegacyField } from "../core";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Field } from "../core";
|
|
4
3
|
import { Slider } from "./Slider";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
return generatedId;
|
|
12
|
-
}, [generatedId, id]);
|
|
13
|
-
return (_jsxs(LegacyField, { id: newId, label: label, message: message, messageType: messageType, isVisible: isVisible, forceDisplayMessage: forceDisplayMessage, className: className, classModifier: classModifier, classNameContainerLabel: classNameContainerLabel, classNameContainerInput: classNameContainerInput, children: [_jsx(Slider, { ...sliderProps, id: id, classModifier: classModifier }), children, _jsx(HelpMessage, { message: helpMessage, isVisible: !message })] }));
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated This component is deprecated and will be removed in a future major release.
|
|
6
|
+
*/
|
|
7
|
+
const SliderInput = ({ rightElement, name, options, label, ...props }) => {
|
|
8
|
+
return (_jsx(Field, { label: label, ...props, renderInput: ({ id, classModifier, ...sliderProps }) => (_jsxs(_Fragment, { children: [_jsx(Slider, { id: id, classModifier: classModifier, name: name, options: options, ...sliderProps }), rightElement] })) }));
|
|
14
9
|
};
|
|
15
10
|
export { SliderInput };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { ComponentProps
|
|
2
|
-
import {
|
|
1
|
+
import { ComponentProps } from "react";
|
|
2
|
+
import { ConsumerFieldProps } from "../core";
|
|
3
3
|
import { Text } from "./Text";
|
|
4
|
-
export type TextInputProps = Omit<
|
|
5
|
-
helpMessage?: ReactNode;
|
|
6
|
-
}, "renderInput">;
|
|
4
|
+
export type TextInputProps = Omit<ConsumerFieldProps & ComponentProps<typeof Text>, "children">;
|
|
7
5
|
declare const TextInput: import("react").ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
|
|
8
6
|
export { TextInput };
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
3
|
import { Field } from "../core";
|
|
4
4
|
import { Text } from "./Text";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const errorUseId = useId();
|
|
8
|
-
const isInvalid = useAriaInvalid(message, forceDisplayMessage, messageType);
|
|
9
|
-
return (_jsx(Field, { ...props, renderInput: ({ id, classModifier }) => (_jsx(Text, { id: id, classModifier: classModifier, ref: inputRef, "aria-describedby": errorUseId, "aria-invalid": isInvalid, ...props })), errorId: errorUseId, forceDisplayMessage: forceDisplayMessage, message: message, children: children }));
|
|
5
|
+
const TextInput = forwardRef(({ rightElement, ...props }, inputRef) => {
|
|
6
|
+
return (_jsx(Field, { ...props, renderInput: ({ id, classModifier, ariaInvalid, errorId }) => (_jsxs(_Fragment, { children: [_jsx(Text, { id: id, classModifier: classModifier, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...props }), rightElement] })) }));
|
|
10
7
|
});
|
|
11
8
|
TextInput.displayName = "TextInput";
|
|
12
9
|
export { TextInput };
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import "@axa-fr/design-system-slash-css/dist/common/grid.scss";
|
|
2
2
|
import "@axa-fr/design-system-slash-css/dist/common/reboot.scss";
|
|
3
3
|
import "@axa-fr/design-system-slash-css/dist/Form/core/FormCore.scss";
|
|
4
|
-
import { ComponentProps
|
|
5
|
-
import {
|
|
4
|
+
import { ComponentProps } from "react";
|
|
5
|
+
import { type ConsumerFieldProps } from "../core";
|
|
6
6
|
import { Textarea } from "./Textarea";
|
|
7
|
-
type Props =
|
|
8
|
-
helpMessage?: ReactNode;
|
|
9
|
-
};
|
|
7
|
+
type Props = Omit<ConsumerFieldProps & ComponentProps<typeof Textarea>, "children">;
|
|
10
8
|
declare const TextareaInput: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
11
9
|
export { TextareaInput };
|
|
@@ -1,19 +1,12 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/design-system-slash-css/dist/common/grid.scss";
|
|
3
3
|
import "@axa-fr/design-system-slash-css/dist/common/reboot.scss";
|
|
4
4
|
import "@axa-fr/design-system-slash-css/dist/Form/core/FormCore.scss";
|
|
5
|
-
import { forwardRef
|
|
6
|
-
import {
|
|
5
|
+
import { forwardRef } from "react";
|
|
6
|
+
import { Field } from "../core";
|
|
7
7
|
import { Textarea } from "./Textarea";
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const rowModifier = `${classModifier} label-top`;
|
|
11
|
-
const inputUseId = useId();
|
|
12
|
-
const errorUseId = useId();
|
|
13
|
-
const inputId = id ?? inputUseId;
|
|
14
|
-
const { inputClassModifier, inputFieldClassModifier } = useInputClassModifier(classModifier, disabled, Boolean(children), required);
|
|
15
|
-
const isInvalid = useAriaInvalid(message, forceDisplayMessage, messageType);
|
|
16
|
-
return (_jsxs(LegacyField, { label: label, id: inputId, message: message, messageType: messageType, isVisible: isVisible, forceDisplayMessage: forceDisplayMessage, className: className, classModifier: inputFieldClassModifier, classNameContainerLabel: classNameContainerLabel, classNameContainerInput: classNameContainerInput, errorId: errorUseId, children: [_jsxs(FieldInput, { className: "af-form__textarea", classModifier: `${rowModifier} ${inputFieldClassModifier}`, children: [_jsx(Textarea, { ...textareaInputProps, id: inputId, rows: rows, cols: cols, classModifier: inputClassModifier, disabled: disabled, ref: inputRef, "aria-describedby": errorUseId, "aria-invalid": isInvalid }), children] }), _jsx(HelpMessage, { message: helpMessage, isVisible: !message })] }));
|
|
8
|
+
const TextareaInput = forwardRef(({ label, rightElement, ...props }, inputRef) => {
|
|
9
|
+
return (_jsx(Field, { label: label, labelPosition: "top", classNameSuffix: "textarea", ...props, renderInput: ({ id, ariaInvalid, errorId, ...inputProps }) => (_jsxs(_Fragment, { children: [_jsx(Textarea, { id: id, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...inputProps }), rightElement] })) }));
|
|
17
10
|
});
|
|
18
11
|
TextareaInput.displayName = "TextareaInput";
|
|
19
12
|
export { TextareaInput };
|