@axa-fr/design-system-slash-react 1.2.1-alpha.7 → 1.2.1-alpha.71

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.
Files changed (79) hide show
  1. package/dist/Card/Card.d.ts +13 -0
  2. package/dist/Card/Card.js +6 -0
  3. package/dist/Form/Checkbox/CheckboxInput.d.ts +2 -2
  4. package/dist/Form/Checkbox/CheckboxInput.js +6 -16
  5. package/dist/Form/Checkbox/CheckboxItem.js +3 -1
  6. package/dist/Form/Choice/Choice.d.ts +2 -2
  7. package/dist/Form/Choice/Choice.js +0 -1
  8. package/dist/Form/Choice/ChoiceInput.d.ts +2 -2
  9. package/dist/Form/Choice/ChoiceInput.js +4 -17
  10. package/dist/Form/Date/DateInput.d.ts +6 -42
  11. package/dist/Form/Date/DateInput.js +5 -11
  12. package/dist/Form/File/FileInput.d.ts +3 -4
  13. package/dist/Form/File/FileInput.js +6 -11
  14. package/dist/Form/MultiSelect/MultiSelectInput.d.ts +4 -6
  15. package/dist/Form/MultiSelect/MultiSelectInput.js +6 -11
  16. package/dist/Form/Number/NumberInput.d.ts +4 -7
  17. package/dist/Form/Number/NumberInput.js +4 -11
  18. package/dist/Form/Pass/PassInput.d.ts +3 -3
  19. package/dist/Form/Pass/PassInput.js +5 -12
  20. package/dist/Form/Radio/Radio.d.ts +24 -7
  21. package/dist/Form/Radio/Radio.js +15 -4
  22. package/dist/Form/Radio/RadioCardGroup.d.ts +12 -0
  23. package/dist/Form/Radio/RadioCardGroup.js +26 -0
  24. package/dist/Form/Radio/RadioInput.d.ts +5 -43
  25. package/dist/Form/Radio/RadioInput.js +6 -11
  26. package/dist/Form/Select/Select.d.ts +52 -52
  27. package/dist/Form/Select/SelectInput.d.ts +61 -128
  28. package/dist/Form/Select/SelectInput.js +5 -11
  29. package/dist/Form/Slider/Slider.d.ts +3 -0
  30. package/dist/Form/Slider/Slider.js +3 -0
  31. package/dist/Form/Slider/SliderInput.d.ts +7 -6
  32. package/dist/Form/Slider/SliderInput.js +7 -12
  33. package/dist/Form/Text/TextInput.d.ts +3 -5
  34. package/dist/Form/Text/TextInput.js +3 -6
  35. package/dist/Form/Textarea/TextareaInput.d.ts +3 -5
  36. package/dist/Form/Textarea/TextareaInput.js +5 -12
  37. package/dist/Form/core/{LegacyField.d.ts → Deprecated/Field.d.ts} +4 -0
  38. package/dist/Form/core/{LegacyField.js → Deprecated/Field.js} +7 -3
  39. package/dist/Form/core/{FieldForm.d.ts → Deprecated/FieldForm.d.ts} +7 -2
  40. package/dist/Form/core/{FieldForm.js → Deprecated/FieldForm.js} +8 -3
  41. package/dist/Form/core/{FieldInput.d.ts → Deprecated/FieldInput.d.ts} +4 -0
  42. package/dist/Form/core/{FieldInput.js → Deprecated/FieldInput.js} +5 -1
  43. package/dist/Form/core/Field.d.ts +53 -5
  44. package/dist/Form/core/Field.js +23 -9
  45. package/dist/Form/core/FormClassManager.js +4 -1
  46. package/dist/Form/core/HelpMessage.d.ts +2 -1
  47. package/dist/Form/core/HelpMessage.js +1 -1
  48. package/dist/Form/core/index.d.ts +7 -4
  49. package/dist/Form/core/index.js +3 -3
  50. package/dist/Layout/Header/AnchorNavBar/AnchorNavBar.d.ts +16 -0
  51. package/dist/Layout/Header/AnchorNavBar/AnchorNavBar.js +20 -0
  52. package/dist/Layout/Header/HeaderTitle/HeaderTitle.d.ts +5 -1
  53. package/dist/Layout/Header/HeaderTitle/HeaderTitle.js +7 -2
  54. package/dist/Messages/Message.d.ts +47 -0
  55. package/dist/Messages/Message.js +43 -0
  56. package/dist/ModalAgent/BooleanModal.d.ts +28 -3
  57. package/dist/ModalAgent/BooleanModal.js +1 -1
  58. package/dist/ModalAgent/Modal.d.ts +17 -3
  59. package/dist/ModalAgent/Modal.js +15 -2
  60. package/dist/ModalAgent/components/Header.d.ts +25 -5
  61. package/dist/ModalAgent/components/Header.js +4 -3
  62. package/dist/Steps/StepBase.js +5 -3
  63. package/dist/Steps/VerticalStep.d.ts +16 -0
  64. package/dist/Steps/VerticalStep.js +22 -0
  65. package/dist/Steps/index.d.ts +1 -0
  66. package/dist/Steps/index.js +1 -0
  67. package/dist/Steps/types.d.ts +8 -0
  68. package/dist/Steps/types.js +1 -0
  69. package/dist/Summary/index.d.ts +3 -3
  70. package/dist/Summary/index.js +3 -2
  71. package/dist/Svg/Svg.js +1 -1
  72. package/dist/Table/Pagination/Li.js +1 -4
  73. package/dist/index.d.ts +10 -2
  74. package/dist/index.js +9 -2
  75. package/dist/utilities/helpers/getComponentClassName.d.ts +7 -0
  76. package/dist/utilities/helpers/getComponentClassName.js +14 -0
  77. package/package.json +4 -4
  78. package/dist/Alert/Alert.d.ts +0 -17
  79. package/dist/Alert/Alert.js +0 -14
@@ -1,16 +1,11 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useId } from "react";
3
- import { LegacyField, getFirstId, useInputClassModifier, useOptionsWithId, } from "../core";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { Field, useOptionsWithId } from "../core";
4
4
  import { Radio, RadioModes } from "./Radio";
5
- import { useAriaInvalid } from "../core/useAriaInvalid";
6
- const RadioInput = forwardRef(({ mode, messageType, message, className, classModifier = "", isVisible, options, classNameContainerLabel, classNameContainerInput, label, forceDisplayMessage, children, required, disabled = false, ariaLabelContainer, ...radioProps }, inputRef) => {
7
- const rowModifier = `${classModifier ?? ""}${mode === RadioModes.classic ? " label-top " : ""}`;
5
+ const RadioInput = forwardRef(({ label, mode, options, ...props }, inputRef) => {
6
+ const labelPosition = mode === RadioModes.classic ? "top" : "center";
8
7
  const newOptions = useOptionsWithId(options);
9
- const firstId = getFirstId(newOptions);
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: "radiogroup", ...props, renderInput: ({ classModifier, ariaInvalid, errorId, ...radioProps }) => (_jsx(Radio, { options: newOptions, mode: mode, classModifier: classModifier, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...radioProps })) }));
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
- contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
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
- nonce?: string | undefined | undefined;
26
- spellCheck?: (boolean | "true" | "false") | undefined;
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
- about?: string | undefined | undefined;
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,94 +1,15 @@
1
- import { OptionHTMLAttributes, ReactNode } from "react";
2
- declare const SelectInput: import("react").ForwardRefExoticComponent<(Omit<Omit<{
3
- message?: string;
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;
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<{
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;
1
+ import { OptionHTMLAttributes } from "react";
2
+ import { ConsumerFieldProps } from "../core";
3
+ declare const SelectInput: import("react").ForwardRefExoticComponent<(Omit<ConsumerFieldProps & Omit<Omit<{
45
4
  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
5
  className?: string | undefined | undefined;
50
- contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
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;
6
+ color?: string | undefined | undefined;
56
7
  id?: string | undefined | undefined;
57
8
  lang?: string | undefined | undefined;
58
- nonce?: string | undefined | undefined;
59
- spellCheck?: (boolean | "true" | "false") | undefined;
60
- tabIndex?: number | undefined | undefined;
61
- translate?: "yes" | "no" | undefined | undefined;
62
- radioGroup?: string | undefined | undefined;
9
+ name?: string | undefined | undefined;
10
+ style?: import("react").CSSProperties | undefined;
63
11
  role?: import("react").AriaRole | undefined;
64
- about?: string | undefined | undefined;
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;
12
+ tabIndex?: number | undefined | undefined;
92
13
  "aria-activedescendant"?: string | undefined | undefined;
93
14
  "aria-atomic"?: (boolean | "true" | "false") | undefined;
94
15
  "aria-autocomplete"?: "none" | "inline" | "list" | "both" | undefined | undefined;
@@ -142,7 +63,7 @@ declare const SelectInput: import("react").ForwardRefExoticComponent<(Omit<Omit<
142
63
  "aria-valuemin"?: number | undefined | undefined;
143
64
  "aria-valuenow"?: number | undefined | undefined;
144
65
  "aria-valuetext"?: string | undefined | undefined;
145
- children: ReactNode | undefined;
66
+ children: import("react").ReactNode | undefined;
146
67
  dangerouslySetInnerHTML?: {
147
68
  __html: string | TrustedHTML;
148
69
  } | undefined | undefined;
@@ -314,9 +235,56 @@ declare const SelectInput: import("react").ForwardRefExoticComponent<(Omit<Omit<
314
235
  onTransitionRunCapture?: import("react").TransitionEventHandler<HTMLSelectElement> | undefined;
315
236
  onTransitionStart?: import("react").TransitionEventHandler<HTMLSelectElement> | undefined;
316
237
  onTransitionStartCapture?: import("react").TransitionEventHandler<HTMLSelectElement> | undefined;
238
+ ref?: import("react").Ref<HTMLSelectElement> | undefined;
239
+ form?: string | undefined | undefined;
240
+ slot?: string | undefined | undefined;
241
+ title?: string | undefined | undefined;
242
+ dir?: string | undefined | undefined;
317
243
  classModifier?: string | undefined;
244
+ key?: import("react").Key | null | undefined;
245
+ defaultChecked?: boolean | undefined | undefined;
246
+ defaultValue?: string | number | readonly string[] | undefined;
247
+ suppressContentEditableWarning?: boolean | undefined | undefined;
248
+ accessKey?: string | undefined | undefined;
249
+ autoCapitalize?: "off" | "none" | "on" | "sentences" | "words" | "characters" | undefined | (string & {}) | undefined;
250
+ autoFocus?: boolean | undefined | undefined;
251
+ contentEditable?: (boolean | "true" | "false") | "inherit" | "plaintext-only" | undefined;
252
+ contextMenu?: string | undefined | undefined;
253
+ draggable?: (boolean | "true" | "false") | undefined;
254
+ enterKeyHint?: "enter" | "done" | "go" | "next" | "previous" | "search" | "send" | undefined | undefined;
255
+ hidden?: boolean | undefined | undefined;
256
+ nonce?: string | undefined | undefined;
257
+ spellCheck?: (boolean | "true" | "false") | undefined;
258
+ translate?: "yes" | "no" | undefined | undefined;
259
+ radioGroup?: string | undefined | undefined;
260
+ about?: string | undefined | undefined;
261
+ content?: string | undefined | undefined;
262
+ datatype?: string | undefined | undefined;
263
+ inlist?: any;
264
+ prefix?: string | undefined | undefined;
265
+ property?: string | undefined | undefined;
266
+ rel?: string | undefined | undefined;
267
+ resource?: string | undefined | undefined;
268
+ rev?: string | undefined | undefined;
269
+ typeof?: string | undefined | undefined;
270
+ vocab?: string | undefined | undefined;
271
+ autoCorrect?: string | undefined | undefined;
272
+ autoSave?: string | undefined | undefined;
273
+ itemProp?: string | undefined | undefined;
274
+ itemScope?: boolean | undefined | undefined;
275
+ itemType?: string | undefined | undefined;
276
+ itemID?: string | undefined | undefined;
277
+ itemRef?: string | undefined | undefined;
278
+ results?: number | undefined | undefined;
279
+ security?: string | undefined | undefined;
280
+ unselectable?: "on" | "off" | undefined | undefined;
281
+ popover?: "" | "auto" | "manual" | undefined | undefined;
282
+ popoverTargetAction?: "toggle" | "show" | "hide" | undefined | undefined;
283
+ popoverTarget?: string | undefined | undefined;
284
+ inert?: boolean | undefined | undefined;
285
+ inputMode?: "none" | "text" | "tel" | "url" | "email" | "numeric" | "decimal" | "search" | undefined | undefined;
286
+ is?: string | undefined | undefined;
318
287
  disabled?: boolean | undefined | undefined;
319
- name?: string | undefined | undefined;
320
288
  value?: string | number | readonly string[] | undefined;
321
289
  required?: boolean | undefined | undefined;
322
290
  autoComplete?: string | undefined | undefined;
@@ -328,46 +296,12 @@ declare const SelectInput: import("react").ForwardRefExoticComponent<(Omit<Omit<
328
296
  options?: OptionHTMLAttributes<HTMLOptionElement>[];
329
297
  mode?: "default" | "base";
330
298
  } & {
331
- children?: ReactNode | undefined;
299
+ children?: import("react").ReactNode | undefined;
332
300
  }, "ref"> & import("react").RefAttributes<HTMLSelectElement> & {
333
- helpMessage?: ReactNode;
334
301
  options: OptionHTMLAttributes<HTMLOptionElement>[];
335
302
  } & {
336
- children?: ReactNode | undefined;
337
- }, "ref"> | Omit<Omit<{
338
- message?: string;
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;
361
- id?: string;
362
- classModifier?: string;
363
- classNameContainerLabel?: string;
364
- classNameContainerInput?: string;
365
- isVisible?: boolean;
366
- roleContainer?: string;
367
- ariaLabelContainer?: string;
368
- isLabelContainerLinkedToInput?: boolean;
369
- errorId?: string;
370
- } & Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref"> & {
303
+ children?: import("react").ReactNode | undefined;
304
+ }, "ref"> | Omit<ConsumerFieldProps & Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").SelectHTMLAttributes<HTMLSelectElement>, HTMLSelectElement>, "ref"> & {
371
305
  options?: OptionHTMLAttributes<HTMLOptionElement>[];
372
306
  classModifier?: string;
373
307
  } & import("react").RefAttributes<HTMLSelectElement> & {
@@ -378,11 +312,10 @@ declare const SelectInput: import("react").ForwardRefExoticComponent<(Omit<Omit<
378
312
  options?: OptionHTMLAttributes<HTMLOptionElement>[];
379
313
  mode?: "default" | "base";
380
314
  } & {
381
- children?: ReactNode | undefined;
315
+ children?: import("react").ReactNode | undefined;
382
316
  }, "ref"> & import("react").RefAttributes<HTMLSelectElement> & {
383
- helpMessage?: ReactNode;
384
317
  options: OptionHTMLAttributes<HTMLOptionElement>[];
385
318
  } & {
386
- children?: ReactNode | undefined;
319
+ children?: import("react").ReactNode | undefined;
387
320
  }, "ref">) & import("react").RefAttributes<HTMLSelectElement>>;
388
321
  export { SelectInput };
@@ -1,15 +1,9 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { forwardRef, useId, } from "react";
3
- import { FieldInput, HelpMessage, LegacyField, useInputClassModifier, } from "../core";
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
- import { useAriaInvalid } from "../core/useAriaInvalid";
6
- const SelectInput = forwardRef(({ classModifier = "", message, children, helpMessage, id, disabled = false, label, classNameContainerLabel, classNameContainerInput, messageType, isVisible, forceDisplayMessage, className, required, ...otherSelectProps }, inputRef) => {
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, type ReactNode } from "react";
2
- import { LegacyField } from "../core";
1
+ import { type ComponentProps } from "react";
2
+ import { ConsumerFieldProps } from "../core";
3
3
  import { Slider } from "./Slider";
4
- type Props = ComponentProps<typeof LegacyField> & ComponentProps<typeof Slider> & {
5
- helpMessage?: ReactNode;
6
- };
7
- declare const SliderInput: ({ id, children, helpMessage, message, classNameContainerLabel, classNameContainerInput, label, messageType, isVisible, forceDisplayMessage, className, classModifier, ...sliderProps }: Props) => import("react/jsx-runtime").JSX.Element;
4
+ type Props = ConsumerFieldProps & ComponentProps<typeof Slider>;
5
+ /**
6
+ * @deprecated This component is deprecated and will be removed in a future major release.
7
+ */
8
+ declare const SliderInput: ({ children, 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 { useId, useMemo } from "react";
3
- import { HelpMessage, LegacyField } from "../core";
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Field } from "../core";
4
3
  import { Slider } from "./Slider";
5
- const SliderInput = ({ id, children, helpMessage, message, classNameContainerLabel, classNameContainerInput, label, messageType, isVisible, forceDisplayMessage, className, classModifier, ...sliderProps }) => {
6
- const generatedId = useId();
7
- const newId = useMemo(() => {
8
- if (id) {
9
- return id;
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 = ({ children, name, options, label, ...props }) => {
8
+ return (_jsx(Field, { label: label, ...props, renderInput: ({ id, classModifier, ...sliderProps }) => (_jsx(Slider, { id: id, classModifier: classModifier, name: name, options: options, ...sliderProps })), children: children }));
14
9
  };
15
10
  export { SliderInput };
@@ -1,8 +1,6 @@
1
- import { ComponentProps, ReactNode } from "react";
2
- import { Field } from "../core";
1
+ import { ComponentProps } from "react";
2
+ import { ConsumerFieldProps } from "../core";
3
3
  import { Text } from "./Text";
4
- export type TextInputProps = Omit<ComponentProps<typeof Field> & ComponentProps<typeof Text> & {
5
- helpMessage?: ReactNode;
6
- }, "renderInput">;
4
+ export type TextInputProps = ConsumerFieldProps & ComponentProps<typeof Text>;
7
5
  declare const TextInput: import("react").ForwardRefExoticComponent<Omit<TextInputProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
8
6
  export { TextInput };
@@ -1,12 +1,9 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef, useId } from "react";
2
+ import { forwardRef } from "react";
3
3
  import { Field } from "../core";
4
4
  import { Text } from "./Text";
5
- import { useAriaInvalid } from "../core/useAriaInvalid";
6
- const TextInput = forwardRef(({ children, message, forceDisplayMessage, messageType, ...props }, inputRef) => {
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(({ children, ...props }, inputRef) => {
6
+ return (_jsx(Field, { ...props, renderInput: ({ id, classModifier, ariaInvalid, errorId }) => (_jsx(Text, { id: id, classModifier: classModifier, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...props })), children: children }));
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, ReactNode } from "react";
5
- import { LegacyField } from "../core";
4
+ import { ComponentProps } from "react";
5
+ import { type ConsumerFieldProps } from "../core";
6
6
  import { Textarea } from "./Textarea";
7
- type Props = ComponentProps<typeof LegacyField> & ComponentProps<typeof Textarea> & {
8
- helpMessage?: ReactNode;
9
- };
7
+ type Props = ConsumerFieldProps & ComponentProps<typeof Textarea>;
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 } 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, useId } from "react";
6
- import { FieldInput, HelpMessage, LegacyField, useInputClassModifier, } from "../core";
5
+ import { forwardRef } from "react";
6
+ import { Field } from "../core";
7
7
  import { Textarea } from "./Textarea";
8
- import { useAriaInvalid } from "../core/useAriaInvalid";
9
- const TextareaInput = forwardRef(({ id, classModifier = "", message, children, helpMessage, classNameContainerLabel, classNameContainerInput, label, messageType, isVisible, forceDisplayMessage, className, rows = 5, cols = 50, disabled = false, required, ...textareaInputProps }, inputRef) => {
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, children, ...props }, inputRef) => {
9
+ return (_jsx(Field, { label: label, labelPosition: "top", classNameSuffix: "textarea", ...props, renderInput: ({ id, ariaInvalid, errorId, ...inputProps }) => (_jsx(Textarea, { id: id, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...inputProps })), children: children }));
17
10
  });
18
11
  TextareaInput.displayName = "TextareaInput";
19
12
  export { TextareaInput };
@@ -13,5 +13,9 @@ type FieldProps = Omit<ComponentPropsWithoutRef<typeof FieldForm>, "children"> &
13
13
  isLabelContainerLinkedToInput?: boolean;
14
14
  errorId?: string;
15
15
  };
16
+ /**
17
+ * @deprecated This component is deprecated and will be removed in future versions. Use components with labels instead, such as `TextInput`
18
+ * or `SelectInput`.
19
+ */
16
20
  export declare const LegacyField: ({ id, message, messageType, label, children, forceDisplayMessage, classModifier, className, classNameContainerLabel, classNameContainerInput, isVisible, roleContainer, ariaLabelContainer, isLabelContainerLinkedToInput, errorId, }: FieldProps) => import("react/jsx-runtime").JSX.Element | null;
17
21
  export {};
@@ -1,9 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import classNames from "classnames";
3
- import { getComponentClassName } from "../../utilities";
4
- import { FieldError } from "./FieldError";
3
+ import { getComponentClassName } from "../../../utilities";
4
+ import { FieldError } from "../FieldError";
5
+ import { MessageTypes } from "../MessageTypes";
5
6
  import { FieldForm } from "./FieldForm";
6
- import { MessageTypes } from "./MessageTypes";
7
+ /**
8
+ * @deprecated This component is deprecated and will be removed in future versions. Use components with labels instead, such as `TextInput`
9
+ * or `SelectInput`.
10
+ */
7
11
  export const LegacyField = ({ id = "", message = "", messageType = MessageTypes.error, label, children, forceDisplayMessage, classModifier = "", className, classNameContainerLabel = "col-md-2", classNameContainerInput = "col-md-10", isVisible = true, roleContainer, ariaLabelContainer, isLabelContainerLinkedToInput = true, errorId, }) => {
8
12
  if (!isVisible) {
9
13
  return null;
@@ -1,6 +1,6 @@
1
1
  import { type BaseSyntheticEvent, type Dispatch, type ReactElement, type ReactNode, type SetStateAction } from "react";
2
- import { FormClassManager } from "./FormClassManager";
3
- import { MessageTypes } from "./MessageTypes";
2
+ import { FormClassManager } from "../FormClassManager";
3
+ import { MessageTypes } from "../MessageTypes";
4
4
  type TMessage = {
5
5
  message?: string;
6
6
  messageType?: MessageTypes;
@@ -94,5 +94,10 @@ type RenderChildrenProps = {
94
94
  wrapper: EventFunction;
95
95
  } & Partial<Pick<FieldFormProps, "children">> & ReturnType<typeof getMessageInfo>;
96
96
  export declare const renderedChildren: ({ children, wrapper, message, messageType, }: RenderChildrenProps) => ReactNode;
97
+ /**
98
+ * @deprecated This component is deprecated and will be removed in future versions.
99
+ * This was an internal component used to manage the state of the form fields.
100
+ * It is not recommended to use it directly in your code as it is not a public API.
101
+ */
97
102
  export declare const FieldForm: ({ children, message, messageType, className, classModifier, forceDisplayMessage, setStateMemoryFn, onChangeByStateFn, setStateOnBlurFn, setStateOnFocusFn, initialState, }: FieldFormProps) => import("react/jsx-runtime").JSX.Element;
98
103
  export {};
@@ -1,8 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { Children, cloneElement, isValidElement, useEffect, useRef, useState, } from "react";
3
- import { getComponentClassName } from "../../utilities";
4
- import { FormClassManager } from "./FormClassManager";
5
- import { MessageTypes } from "./MessageTypes";
3
+ import { getComponentClassName } from "../../../utilities";
4
+ import { FormClassManager } from "../FormClassManager";
5
+ import { MessageTypes } from "../MessageTypes";
6
6
  const defaultClassName = "md-10";
7
7
  const INITIAL_STATE = {
8
8
  hasLostFocusOnce: false,
@@ -123,6 +123,11 @@ export const renderedChildren = ({ children, wrapper, message, messageType, }) =
123
123
  }),
124
124
  });
125
125
  });
126
+ /**
127
+ * @deprecated This component is deprecated and will be removed in future versions.
128
+ * This was an internal component used to manage the state of the form fields.
129
+ * It is not recommended to use it directly in your code as it is not a public API.
130
+ */
126
131
  export const FieldForm = ({ children, message = "", messageType = MessageTypes.error, className = defaultClassName, classModifier = "", forceDisplayMessage = false, setStateMemoryFn = setStateMemory, onChangeByStateFn = onChangeByState, setStateOnBlurFn = setStateOnBlur, setStateOnFocusFn = setStateOnFocus, initialState = INITIAL_STATE, }) => {
127
132
  const [state, setState] = useState(initialState);
128
133
  const previousForceDisplayMessage = useRef(forceDisplayMessage);
@@ -5,6 +5,10 @@ type FieldProps = {
5
5
  classModifier?: string;
6
6
  children?: ReactNode;
7
7
  };
8
+ /**
9
+ * @deprecated This component is deprecated and will be removed in future versions.
10
+ * This was an internal component and it is not recommended to use it directly in your code as it is not a public API.
11
+ */
8
12
  export declare const FieldInput: {
9
13
  ({ children, className, classModifier, isVisible, }: FieldProps): import("react/jsx-runtime").JSX.Element | null;
10
14
  displayName: string;