@axa-fr/design-system-slash-react 1.2.1-alpha.11 → 1.2.1-alpha.111

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 (116) hide show
  1. package/dist/Card/Card.d.ts +13 -0
  2. package/dist/Card/Card.js +6 -0
  3. package/dist/Divider/Divider.d.ts +7 -0
  4. package/dist/Divider/Divider.js +10 -0
  5. package/dist/Form/Checkbox/CheckboxInput.d.ts +2 -2
  6. package/dist/Form/Checkbox/CheckboxInput.js +6 -16
  7. package/dist/Form/Checkbox/CheckboxItem.js +3 -1
  8. package/dist/Form/Choice/Choice.d.ts +3 -2
  9. package/dist/Form/Choice/Choice.js +1 -2
  10. package/dist/Form/Choice/ChoiceInput.d.ts +2 -2
  11. package/dist/Form/Choice/ChoiceInput.js +4 -17
  12. package/dist/Form/Date/DateInput.d.ts +6 -42
  13. package/dist/Form/Date/DateInput.js +5 -11
  14. package/dist/Form/File/FileErrors.js +3 -2
  15. package/dist/Form/File/FileInput.d.ts +4 -5
  16. package/dist/Form/File/FileInput.js +6 -11
  17. package/dist/Form/File/FileTable.js +1 -1
  18. package/dist/Form/MultiSelect/FormatOptionLabel.d.ts +4 -0
  19. package/dist/Form/MultiSelect/FormatOptionLabel.js +12 -0
  20. package/dist/Form/MultiSelect/MultiSelect.d.ts +6 -3
  21. package/dist/Form/MultiSelect/MultiSelect.js +25 -5
  22. package/dist/Form/MultiSelect/MultiSelectInput.d.ts +4 -6
  23. package/dist/Form/MultiSelect/MultiSelectInput.js +6 -11
  24. package/dist/Form/MultiSelect/NoOptionsMessage.d.ts +3 -0
  25. package/dist/Form/MultiSelect/NoOptionsMessage.js +1 -0
  26. package/dist/Form/MultiSelect/ValueContainer.d.ts +4 -0
  27. package/dist/Form/MultiSelect/ValueContainer.js +20 -0
  28. package/dist/Form/MultiSelect/useMultiSelectStyle.d.ts +5 -0
  29. package/dist/Form/MultiSelect/useMultiSelectStyle.js +81 -0
  30. package/dist/Form/Number/NumberInput.d.ts +4 -7
  31. package/dist/Form/Number/NumberInput.js +4 -11
  32. package/dist/Form/Pass/PassInput.d.ts +4 -4
  33. package/dist/Form/Pass/PassInput.js +5 -12
  34. package/dist/Form/Radio/Radio.d.ts +19 -7
  35. package/dist/Form/Radio/Radio.js +13 -4
  36. package/dist/Form/Radio/RadioCardGroup.d.ts +10 -0
  37. package/dist/Form/Radio/RadioCardGroup.js +26 -0
  38. package/dist/Form/Radio/RadioInput.d.ts +5 -43
  39. package/dist/Form/Radio/RadioInput.js +6 -11
  40. package/dist/Form/Select/Select.d.ts +52 -52
  41. package/dist/Form/Select/SelectInput.d.ts +96 -108
  42. package/dist/Form/Select/SelectInput.js +5 -11
  43. package/dist/Form/Slider/Slider.d.ts +3 -0
  44. package/dist/Form/Slider/Slider.js +3 -0
  45. package/dist/Form/Slider/SliderInput.d.ts +7 -6
  46. package/dist/Form/Slider/SliderInput.js +7 -12
  47. package/dist/Form/Text/TextInput.d.ts +3 -5
  48. package/dist/Form/Text/TextInput.js +4 -7
  49. package/dist/Form/Textarea/TextareaInput.d.ts +3 -5
  50. package/dist/Form/Textarea/TextareaInput.js +5 -12
  51. package/dist/Form/core/{LegacyField.d.ts → Deprecated/Field.d.ts} +4 -0
  52. package/dist/Form/core/{LegacyField.js → Deprecated/Field.js} +7 -3
  53. package/dist/Form/core/{FieldForm.d.ts → Deprecated/FieldForm.d.ts} +7 -2
  54. package/dist/Form/core/{FieldForm.js → Deprecated/FieldForm.js} +8 -3
  55. package/dist/Form/core/{FieldInput.d.ts → Deprecated/FieldInput.d.ts} +4 -0
  56. package/dist/Form/core/{FieldInput.js → Deprecated/FieldInput.js} +5 -1
  57. package/dist/Form/core/Field.d.ts +58 -6
  58. package/dist/Form/core/Field.js +23 -10
  59. package/dist/Form/core/FormClassManager.js +4 -1
  60. package/dist/Form/core/HelpMessage.d.ts +2 -1
  61. package/dist/Form/core/HelpMessage.js +1 -1
  62. package/dist/Form/core/index.d.ts +7 -4
  63. package/dist/Form/core/index.js +3 -3
  64. package/dist/Layout/Footer/Footer.d.ts +2 -1
  65. package/dist/Layout/Footer/Footer.js +4 -2
  66. package/dist/Layout/Header/AnchorNavBar/AnchorNavBar.d.ts +39 -0
  67. package/dist/Layout/Header/AnchorNavBar/AnchorNavBar.js +21 -0
  68. package/dist/Layout/Header/Header.js +2 -1
  69. package/dist/Layout/Header/HeaderTitle/HeaderTitle.d.ts +5 -1
  70. package/dist/Layout/Header/HeaderTitle/HeaderTitle.js +8 -3
  71. package/dist/Layout/Header/Infos/Infos.js +3 -1
  72. package/dist/Layout/Header/NavBar/NavBarBase.js +9 -8
  73. package/dist/Layout/Header/NavBar/NavBarItem/NavBarItem.js +1 -1
  74. package/dist/Layout/Header/NavBar/index.d.ts +1 -0
  75. package/dist/Layout/Header/NavBar/index.js +1 -0
  76. package/dist/Layout/Header/User/InnerUser.js +1 -1
  77. package/dist/Layout/MainContainer/MainContainer.d.ts +6 -0
  78. package/dist/Layout/MainContainer/MainContainer.js +4 -0
  79. package/dist/Link/LinkAnchor.js +1 -1
  80. package/dist/Loader/Loader.js +1 -1
  81. package/dist/Messages/Message.d.ts +47 -0
  82. package/dist/Messages/Message.js +43 -0
  83. package/dist/ModalAgent/BooleanModal.d.ts +28 -3
  84. package/dist/ModalAgent/BooleanModal.js +1 -1
  85. package/dist/ModalAgent/Modal.d.ts +17 -3
  86. package/dist/ModalAgent/Modal.js +15 -2
  87. package/dist/ModalAgent/components/Header.d.ts +25 -5
  88. package/dist/ModalAgent/components/Header.js +4 -3
  89. package/dist/Popover/AnimatedPopover.js +1 -1
  90. package/dist/Steps/StepBase.js +5 -3
  91. package/dist/Steps/VerticalStep.d.ts +48 -0
  92. package/dist/Steps/VerticalStep.js +22 -0
  93. package/dist/Steps/index.d.ts +1 -0
  94. package/dist/Steps/index.js +1 -0
  95. package/dist/Steps/types.d.ts +8 -0
  96. package/dist/Steps/types.js +1 -0
  97. package/dist/Summary/index.d.ts +3 -3
  98. package/dist/Summary/index.js +3 -2
  99. package/dist/Svg/Svg.js +1 -1
  100. package/dist/Table/Pagination/Items.d.ts +1 -1
  101. package/dist/Table/Pagination/Li.d.ts +2 -1
  102. package/dist/Table/Pagination/Li.js +2 -5
  103. package/dist/Table/Pagination/Pager.d.ts +5 -1
  104. package/dist/Table/Pagination/Pager.js +3 -3
  105. package/dist/Table/Pagination/PaginationButton.d.ts +2 -1
  106. package/dist/Table/Pagination/PaginationButton.js +2 -2
  107. package/dist/Table/Pagination/Paging.d.ts +2 -1
  108. package/dist/Table/Pagination/Paging.js +2 -2
  109. package/dist/Title/Title.d.ts +2 -2
  110. package/dist/index.d.ts +12 -2
  111. package/dist/index.js +11 -2
  112. package/dist/utilities/helpers/getComponentClassName.d.ts +7 -0
  113. package/dist/utilities/helpers/getComponentClassName.js +14 -0
  114. package/package.json +6 -5
  115. package/dist/Alert/Alert.d.ts +0 -17
  116. package/dist/Alert/Alert.js +0 -14
@@ -0,0 +1,13 @@
1
+ import type { ComponentProps } from "react";
2
+ import "@axa-fr/design-system-slash-css/dist/Card/Card.css";
3
+ type CardProps = ComponentProps<"button"> & {
4
+ /** By default : *vertical* */
5
+ orientation?: "vertical" | "horizontal";
6
+ /** icon url, for exemple from "@material-symbols" :
7
+ *
8
+ * import villaIcon from "@material-symbols/svg-400/outlined/villa.svg"; */
9
+ iconSrc?: string;
10
+ error?: boolean;
11
+ };
12
+ export declare const Card: ({ children, className, iconSrc, orientation, error, ...otherProps }: CardProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import classNames from "classnames";
3
+ import { Svg } from "../Svg";
4
+ import "@axa-fr/design-system-slash-css/dist/Card/Card.css";
5
+ const DEFAULT_CLASS_NAME = "af-card";
6
+ export const Card = ({ children, className, iconSrc, orientation = "vertical", error = false, ...otherProps }) => (_jsxs("button", { type: "button", className: classNames(DEFAULT_CLASS_NAME, error && `${DEFAULT_CLASS_NAME}--error`, orientation === "horizontal" && `${DEFAULT_CLASS_NAME}--${orientation}`, className), ...otherProps, children: [iconSrc ? _jsx(Svg, { src: iconSrc }) : null, children] }));
@@ -0,0 +1,7 @@
1
+ import "@axa-fr/design-system-slash-css/dist/Divider/Divider.css";
2
+ type DividerProps = {
3
+ mode?: "horizontal" | "vertical";
4
+ classModifier?: string;
5
+ };
6
+ export declare const Divider: ({ mode, classModifier, }: DividerProps) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import classnames from "classnames";
3
+ import "@axa-fr/design-system-slash-css/dist/Divider/Divider.css";
4
+ export const Divider = ({ mode = "horizontal", classModifier, }) => {
5
+ const componentClassName = classnames("af-divider", classModifier, {
6
+ "af-divider--horizontal": mode === "horizontal",
7
+ "af-divider--vertical": mode === "vertical",
8
+ });
9
+ return _jsx("hr", { className: componentClassName });
10
+ };
@@ -1,6 +1,6 @@
1
1
  import { ComponentProps } from "react";
2
- import { LegacyField } from "../core";
2
+ import { type ConsumerFieldProps } from "../core";
3
3
  import { Checkbox } from "./Checkbox";
4
- type Props = Omit<ComponentProps<typeof Checkbox> & ComponentProps<typeof LegacyField>, "children" | "placeholder">;
4
+ type Props = Omit<ComponentProps<typeof Checkbox> & ConsumerFieldProps, "children" | "placeholder">;
5
5
  declare const CheckboxInput: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
6
6
  export { CheckboxInput };
@@ -1,23 +1,13 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef, useId } from "react";
3
- import { LegacyField, MessageTypes, useOptionsWithId } from "../core";
2
+ import { forwardRef } from "react";
3
+ import { Field, useOptionsWithId } from "../core";
4
4
  import { Checkbox } from "./Checkbox";
5
5
  import { CheckboxModes } from "./CheckboxModes";
6
- import { useAriaInvalid } from "../core/useAriaInvalid";
7
- const CheckboxInput = forwardRef(({ mode, messageType, message, classModifier, options, classNameContainerLabel, classNameContainerInput, label, isVisible, className, forceDisplayMessage, required, ...checkboxProps }, inputRef) => {
8
- let rowModifier = classModifier;
9
- if (mode === CheckboxModes.classic) {
10
- rowModifier += " label-top";
11
- }
12
- if (required) {
13
- rowModifier += " required";
14
- }
15
- const errorUseId = useId();
6
+ const CheckboxInput = forwardRef(({ label, mode = "default", options, ...otherProps }, inputRef) => {
16
7
  const newOptions = useOptionsWithId(options);
17
- const isInvalid = useAriaInvalid(message, forceDisplayMessage, messageType);
18
- return (_jsx(LegacyField, { label: label, id: newOptions[0].id, message: message, messageType: messageType, isVisible: isVisible, forceDisplayMessage: forceDisplayMessage, className: className, classModifier: rowModifier, classNameContainerLabel: classNameContainerLabel, classNameContainerInput: classNameContainerInput, errorId: errorUseId, children: _jsx(Checkbox, { mode: mode, options: newOptions, classModifier: message && messageType === MessageTypes.error && forceDisplayMessage
19
- ? `${classModifier} error`
20
- : classModifier, ref: inputRef, "aria-describedby": errorUseId, "aria-invalid": isInvalid, ...checkboxProps }) }));
8
+ return (_jsx(Field, { label: label, labelPosition: mode === CheckboxModes.classic ? "top" : "center", roleContainer: "group", ...otherProps, renderInput: ({ classModifier, id, ariaInvalid, errorId, ...props }) => {
9
+ return (_jsx(Checkbox, { id: id, mode: mode, options: newOptions, classModifier: ariaInvalid ? `${classModifier} error` : classModifier, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...props }));
10
+ } }));
21
11
  });
22
12
  CheckboxInput.displayName = "CheckboxInput";
23
13
  export { CheckboxInput };
@@ -1,13 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import check from "@material-symbols/svg-400/sharp/check.svg";
2
3
  import { forwardRef, useId } from "react";
3
4
  import { getOptionClassName } from "../core";
4
5
  import "@axa-fr/design-system-slash-css/dist/Form/Checkbox/Checkbox.scss";
6
+ import { Svg } from "../../Svg";
5
7
  const CheckboxItem = forwardRef(({ disabled = false, value = "", id, children, label, isChecked, className, classModifier, ...otherProps }, inputRef) => {
6
8
  const newLabel = children || label;
7
9
  const generatedId = useId();
8
10
  const newId = id ?? generatedId; // id is required on this component
9
11
  const optionClassName = getOptionClassName(className ?? "", classModifier ?? "", "af-form__checkbox", disabled);
10
- return (_jsxs("div", { className: optionClassName, children: [_jsx("input", { ...otherProps, className: "af-form__input-checkbox", value: value, id: newId, disabled: disabled, checked: isChecked, type: "checkbox", ref: inputRef }), _jsxs("label", { className: "af-form__label", htmlFor: newId, children: [_jsx("span", { className: "af-form__indicator", children: _jsx("i", { className: "glyphicon glyphicon-ok" }) }), _jsx("span", { className: "af-form__description", children: newLabel })] })] }));
12
+ return (_jsxs("div", { className: optionClassName, children: [_jsx("input", { ...otherProps, className: "af-form__input-checkbox", value: value, id: newId, disabled: disabled, checked: isChecked, type: "checkbox", ref: inputRef }), _jsxs("label", { className: "af-form__label", htmlFor: newId, children: [_jsx("span", { className: "af-form__indicator", children: _jsx(Svg, { role: "presentation", className: "ok-icon", src: check }) }), _jsx("span", { className: "af-form__description", children: newLabel })] })] }));
11
13
  });
12
14
  CheckboxItem.displayName = "CheckboxItem";
13
15
  export { CheckboxItem };
@@ -1,13 +1,14 @@
1
- import "@axa-fr/design-system-slash-css/dist/Form/Choice/Choice.scss";
2
1
  import { type ComponentProps } from "react";
3
2
  import { Radio } from "../Radio";
4
3
  import { type Option } from "../core";
5
- type Props = Omit<ComponentProps<typeof Radio>, "options"> & {
4
+ type Props = Omit<ComponentProps<typeof Radio>, "options" | "value"> & {
6
5
  id: string;
7
6
  name?: string;
8
7
  options?: Array<Omit<Option, "value"> & {
9
8
  value: boolean;
10
9
  }>;
10
+ value?: boolean | string;
11
+ classModifier?: string;
11
12
  };
12
13
  declare const Choice: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
13
14
  export { Choice };
@@ -1,5 +1,4 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import "@axa-fr/design-system-slash-css/dist/Form/Choice/Choice.scss";
3
2
  import { forwardRef, useId } from "react";
4
3
  import { Radio } from "../Radio";
5
4
  import { useOptionsWithId } from "../core";
@@ -13,7 +12,7 @@ const Choice = forwardRef(({ children, value, options = defaultOptions, name, ..
13
12
  value: `${o.value}`,
14
13
  })));
15
14
  const generatedId = useId();
16
- return (_jsx(Radio, { ...otherProps, ref: inputRef, name: name ?? `choice_${generatedId}`, value: value?.toString(), options: choiceOptions, children: children }));
15
+ return (_jsx(Radio, { ...otherProps, mode: "default", ref: inputRef, name: name ?? `choice_${generatedId}`, value: value?.toString(), options: choiceOptions, children: children }));
17
16
  });
18
17
  Choice.displayName = "Choice";
19
18
  export { Choice };
@@ -1,6 +1,6 @@
1
1
  import { type ComponentProps } from "react";
2
- import { LegacyField } from "../core";
2
+ import { type ConsumerFieldProps } from "../core";
3
3
  import { Choice } from "./Choice";
4
- type Props = ComponentProps<typeof Choice> & Omit<ComponentProps<typeof LegacyField>, "children">;
4
+ type Props = ComponentProps<typeof Choice> & Omit<ConsumerFieldProps, "children">;
5
5
  declare const ChoiceInput: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
6
6
  export { ChoiceInput };
@@ -1,26 +1,13 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { forwardRef, useId } from "react";
3
- import { LegacyField, useInputClassModifier, useOptionsWithId } from "../core";
2
+ import { forwardRef } from "react";
3
+ import { Field } from "../core";
4
4
  import { Choice } from "./Choice";
5
- import { useAriaInvalid } from "../core/useAriaInvalid";
6
5
  const defaultOptions = [
7
6
  { label: "Oui", value: true },
8
7
  { label: "Non", value: false },
9
8
  ];
10
- const ChoiceInput = forwardRef(({ id, name, messageType, message, className, classModifier, isVisible, classNameContainerLabel, classNameContainerInput, label, forceDisplayMessage, options = defaultOptions, disabled, required, ...otherProps }, inputRef) => {
11
- const errorUseId = useId();
12
- const newOptions = useOptionsWithId(options.map((o) => ({
13
- ...o,
14
- value: `${o.value}`,
15
- })));
16
- const { inputClassModifier, inputFieldClassModifier } = useInputClassModifier(classModifier ?? "", disabled ?? false, false, required);
17
- const firstId = newOptions?.[0]?.id ?? "";
18
- const choiceOptions = newOptions.map((o) => ({
19
- ...o,
20
- value: o.value === "true",
21
- }));
22
- const isInvalid = useAriaInvalid(message, forceDisplayMessage, messageType);
23
- return (_jsx(LegacyField, { label: label, id: firstId, message: message, messageType: messageType, isVisible: isVisible, forceDisplayMessage: forceDisplayMessage, className: className, classModifier: inputFieldClassModifier, classNameContainerLabel: classNameContainerLabel, classNameContainerInput: classNameContainerInput, errorId: errorUseId, children: _jsx(Choice, { ...otherProps, id: id, name: name, ref: inputRef, classModifier: inputClassModifier, options: options ? choiceOptions : undefined, required: required, disabled: disabled, "aria-describedby": errorUseId, "aria-invalid": isInvalid }) }));
9
+ const ChoiceInput = forwardRef(({ label, options = defaultOptions, ...otherProps }, inputRef) => {
10
+ return (_jsx(Field, { label: label, roleContainer: "radiogroup", ...otherProps, renderInput: ({ classModifier, id, errorId, ariaInvalid, ...props }) => (_jsx(Choice, { id: id, ref: inputRef, classModifier: classModifier, "aria-describedby": errorId, "aria-invalid": ariaInvalid, options: options, ...props })) }));
24
11
  });
25
12
  ChoiceInput.displayName = "ChoiceInput";
26
13
  export { ChoiceInput };
@@ -1,44 +1,8 @@
1
- import { ReactNode } from "react";
2
- declare const DateInput: import("react").ForwardRefExoticComponent<Omit<Omit<Omit<Omit<import("react").DetailedHTMLProps<import("react").InputHTMLAttributes<HTMLInputElement>, HTMLInputElement>, "value"> & {
3
- classModifier?: string;
4
- defaultValue?: Date | string;
5
- value?: Date | string;
6
- }, "ref"> & import("react").RefAttributes<HTMLInputElement>, "ref">, "placeholderText"> & Omit<{
7
- message?: string;
8
- messageType?: import("../core").MessageTypes;
9
- } & {
10
- className?: string;
11
- classModifier?: string;
12
- forceDisplayMessage?: boolean;
13
- children: ReactNode;
14
- setStateMemoryFn?: typeof import("../core/FieldForm").setStateMemory;
15
- onChangeByStateFn?: typeof import("../core/FieldForm").onChangeByState;
16
- setStateOnBlurFn?: typeof import("../core/FieldForm").setStateOnBlur;
17
- setStateOnFocusFn?: typeof import("../core/FieldForm").setStateOnFocus;
18
- initialState?: {
19
- hasLostFocusOnce: boolean;
20
- hasFocus: boolean;
21
- hasChange: boolean;
22
- memory: {
23
- message?: string;
24
- messageType?: import("../core").MessageTypes;
25
- };
26
- };
27
- }, "children"> & {
28
- label: ReactNode;
29
- children?: ReactNode;
30
- id?: string;
31
- classModifier?: string;
32
- classNameContainerLabel?: string;
33
- classNameContainerInput?: string;
34
- isVisible?: boolean;
35
- roleContainer?: string;
36
- ariaLabelContainer?: string;
37
- isLabelContainerLinkedToInput?: boolean;
38
- errorId?: string;
39
- } & {
40
- placeholder?: string;
1
+ import { ComponentProps, ReactNode } from "react";
2
+ import { ConsumerFieldProps } from "../core";
3
+ import { Date } from "./Date";
4
+ type Props = Omit<ConsumerFieldProps & ComponentProps<typeof Date> & {
41
5
  helpMessage?: ReactNode;
42
- children?: ReactNode;
43
- } & import("react").RefAttributes<HTMLInputElement>>;
6
+ }, "renderInput" | "children">;
7
+ declare const DateInput: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
44
8
  export { DateInput };
@@ -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, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { Field } from "../core";
4
4
  import { Date } from "./Date";
5
- import { useAriaInvalid } from "../core/useAriaInvalid";
6
- const DateInput = forwardRef(({ classModifier = "", message, children, helpMessage, id, classNameContainerLabel, classNameContainerInput, label, messageType, isVisible, forceDisplayMessage, className, disabled = false, required, ...otherProps }, ref) => {
7
- const inputUseId = useId();
8
- const errorUseId = useId();
9
- const inputId = id ?? inputUseId;
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__date", classModifier: inputFieldClassModifier, children: [_jsx(Date, { id: inputId, classModifier: inputClassModifier, disabled: disabled, required: required, ref: ref, "aria-describedby": errorUseId, "aria-invalid": isInvalid, ...otherProps }), children] }), _jsx(HelpMessage, { message: helpMessage, isVisible: !message })] }));
5
+ const DateInput = forwardRef(({ rightElement, ...otherProps }, inputRef) => {
6
+ return (_jsx(Field, { ...otherProps, renderInput: ({ id, classModifier, ariaInvalid, errorId }) => (_jsxs(_Fragment, { children: [_jsx(Date, { id: id, classModifier: classModifier, ref: inputRef, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...otherProps }), rightElement] })) }));
13
7
  });
14
8
  DateInput.displayName = "DateInput";
15
9
  export { DateInput };
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- const FileErrors = ({ errors }) => (_jsxs("div", { className: "af-form__file-errors", children: [_jsx("span", { children: "Le chargement de certains fichiers a \u00E9chou\u00E9 : " }), _jsx("ul", { className: "af-form__file-errors-list", children: errors &&
3
- errors.map((err) => (_jsxs("li", { children: [err.file.name, " (", err.file.size, ")"] }, err.file.name))) })] }));
2
+ const FileErrors = ({ errors }) => (_jsxs("div", { className: "af-form__file-errors", children: [_jsx("span", { children: "Le chargement de certains fichiers a \u00E9chou\u00E9 : " }), _jsx("ul", { className: "af-form__file-errors-list", children: errors
3
+ ? errors.map((err) => (_jsxs("li", { children: [err.file.name, " (", err.file.size, ")"] }, err.file.name)))
4
+ : null })] }));
4
5
  export { FileErrors };
@@ -1,14 +1,13 @@
1
1
  import "@axa-fr/design-system-slash-css/dist/Form/File/File.scss";
2
2
  import { ComponentPropsWithoutRef, ReactNode } from "react";
3
- import { LegacyField } from "../core";
3
+ import { type ConsumerFieldProps } from "../core";
4
4
  import { File } from "./File";
5
5
  import { FileTable } from "./FileTable";
6
- type FieldProps = ComponentPropsWithoutRef<typeof LegacyField>;
7
6
  type FileProps = ComponentPropsWithoutRef<typeof File>;
8
7
  type FileTableProps = ComponentPropsWithoutRef<typeof FileTable>;
9
- type Props = FieldProps & FileProps & Pick<FileTableProps, "values" | "errors"> & {
8
+ type Props = Omit<ConsumerFieldProps & FileProps & Pick<FileTableProps, "values" | "errors"> & {
10
9
  fileLabel?: string;
11
10
  helpMessage?: ReactNode;
12
- };
13
- declare const FileInput: ({ values, name, onChange, classModifier, message, children, helpMessage, id, forceDisplayMessage, messageType, classNameContainerLabel, classNameContainerInput, label, isVisible, className, errors, fileLabel, disabled, required, ...otherFileProps }: Props) => import("react/jsx-runtime").JSX.Element;
11
+ }, "children">;
12
+ declare const FileInput: ({ values, id, name, onChange, rightElement, label, errors, fileLabel, classModifier, ...otherFileProps }: Props) => import("react/jsx-runtime").JSX.Element;
14
13
  export { FileInput };
@@ -1,11 +1,10 @@
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/Form/File/File.scss";
3
3
  import { useId } from "react";
4
- import { FieldInput, HelpMessage, LegacyField, useInputClassModifier, } from "../core";
4
+ import { Field } from "../core";
5
5
  import { File } from "./File";
6
6
  import { FileTable } from "./FileTable";
7
- import { useAriaInvalid } from "../core/useAriaInvalid";
8
- const FileInput = ({ values = [], name = "", onChange, classModifier = "", message, children, helpMessage, id = "", forceDisplayMessage, messageType, classNameContainerLabel, classNameContainerInput, label, isVisible, className, errors, fileLabel, disabled = false, required, ...otherFileProps }) => {
7
+ const FileInput = ({ values = [], id, name = "", onChange, rightElement, label, errors, fileLabel, classModifier, ...otherFileProps }) => {
9
8
  const onDeleteClick = (selectedId, selectInputId) => {
10
9
  const newValues = values.filter((element) => element.id !== selectedId);
11
10
  onChange({
@@ -15,12 +14,8 @@ const FileInput = ({ values = [], name = "", onChange, classModifier = "", messa
15
14
  fileAction: "delete",
16
15
  });
17
16
  };
18
- const inputUseId = useId();
19
- const errorUseId = useId();
20
- const inputId = id ?? inputUseId;
21
- const { inputClassModifier, inputFieldClassModifier } = useInputClassModifier(classModifier, disabled, Boolean(children), required);
22
- const rowModifier = `${inputFieldClassModifier} label-top`;
23
- const isInvalid = useAriaInvalid(message, forceDisplayMessage, messageType);
24
- return (_jsxs(LegacyField, { label: label, id: inputId, message: message, messageType: messageType, isVisible: isVisible, forceDisplayMessage: forceDisplayMessage, className: className, classModifier: rowModifier, classNameContainerLabel: classNameContainerLabel, classNameContainerInput: classNameContainerInput, errorId: errorUseId, children: [_jsxs(FieldInput, { className: "af-form__file", classModifier: inputFieldClassModifier, children: [_jsx(File, { id: inputId, name: name, onChange: onChange, disabled: disabled, classModifier: inputClassModifier, label: fileLabel, required: required || classModifier?.includes("required"), "aria-describedby": errorUseId, "aria-invalid": isInvalid, ...otherFileProps }), children] }), _jsx(HelpMessage, { message: helpMessage, isVisible: !message }), _jsx(FileTable, { errors: errors, values: values, onClick: (selectedId) => onDeleteClick(selectedId, inputId), classModifier: classModifier })] }));
17
+ const generatedId = useId();
18
+ const actualId = id ?? generatedId;
19
+ return (_jsx(Field, { label: label, labelPosition: "top", id: actualId, classNameSuffix: "file", ...otherFileProps, renderInput: ({ classModifier: inputClassModifiers, id: inputId, ariaInvalid, errorId, ...inputProps }) => (_jsxs(_Fragment, { children: [_jsx(File, { id: inputId, name: name, onChange: onChange, classModifier: inputClassModifiers, label: fileLabel, "aria-describedby": errorId, "aria-invalid": ariaInvalid, ...inputProps }), rightElement] })), appendChildren: _jsx(FileTable, { errors: errors, values: values, onClick: (selectedId) => onDeleteClick(selectedId, actualId), classModifier: classModifier }) }));
25
20
  };
26
21
  export { FileInput };
@@ -4,6 +4,6 @@ import { FileErrors } from "./FileErrors";
4
4
  import { getComponentClassName } from "../../utilities";
5
5
  const FileTable = ({ errors, values, className, classModifier, disabled, onClick, }) => {
6
6
  const componentClassName = getComponentClassName(className, classModifier, "custom-table-file af-file-table");
7
- return (_jsxs("div", { className: componentClassName, children: [errors && errors.length > 0 && _jsx(FileErrors, { errors: errors }), values && values.length > 0 && (_jsx("ul", { className: "af-form__file-list", children: values.map(({ file, id }) => (_jsx(FileLine, { disabled: disabled, file: file, onClick: onClick, id: id }, id))) }))] }));
7
+ return (_jsxs("div", { className: componentClassName, children: [errors && errors.length > 0 ? _jsx(FileErrors, { errors: errors }) : null, values && values.length > 0 ? (_jsx("ul", { className: "af-form__file-list", children: values.map(({ file, id }) => (_jsx(FileLine, { disabled: disabled, file: file, onClick: onClick, id: id }, id))) })) : null] }));
8
8
  };
9
9
  export { FileTable };
@@ -0,0 +1,4 @@
1
+ import { type FormatOptionLabelMeta } from "react-select";
2
+ import { Option } from "./MultiSelect";
3
+ declare const formatOptionLabel: (data: Option, formatOptionLabelMeta: FormatOptionLabelMeta<Option>) => string | import("react/jsx-runtime").JSX.Element;
4
+ export { formatOptionLabel };
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import classNames from "classnames";
3
+ import checkIcon from "@material-symbols/svg-700/outlined/check.svg";
4
+ import { Svg } from "../..";
5
+ const formatOptionLabel = (data, formatOptionLabelMeta) => {
6
+ if (formatOptionLabelMeta.context === "value") {
7
+ return data.label;
8
+ }
9
+ const isChecked = formatOptionLabelMeta.selectValue.some((selectValue) => data.value === selectValue.value);
10
+ return (_jsxs("div", { className: "react-select__multi-option-label", children: [_jsx("div", { className: "checkbox-indicator", children: _jsx("span", { className: classNames("indicator", { "checkbox-checked": isChecked }), children: isChecked ? _jsx(Svg, { src: checkIcon }) : null }) }), data.label] }));
11
+ };
12
+ export { formatOptionLabel };
@@ -1,5 +1,6 @@
1
- import { GroupBase } from "react-select";
1
+ import { type GroupBase } from "react-select";
2
2
  import { AsyncProps } from "react-select/async";
3
+ import "@axa-fr/design-system-slash-css/dist/Form/MultiSelect/MultiSelect.scss";
3
4
  type Option = {
4
5
  value: string;
5
6
  label: string;
@@ -9,6 +10,8 @@ type Props = Omit<AsyncProps<Option, true, GroupBase<Option>>, "value" | "isDisa
9
10
  values?: string[] | null;
10
11
  value?: string;
11
12
  disabled?: boolean;
13
+ selectedLimit?: number;
14
+ selectedLimitLabel?: string;
12
15
  };
13
16
  type onChangeProps = {
14
17
  id: string;
@@ -16,5 +19,5 @@ type onChangeProps = {
16
19
  values?: string[];
17
20
  value?: string;
18
21
  };
19
- declare const MultiSelect: ({ id, name, loadOptions, values, options, value, onChange, onBlur, placeholder, className, disabled, loadingMessage, ...otherProps }: Props) => import("react/jsx-runtime").JSX.Element;
20
- export { MultiSelect };
22
+ declare const MultiSelect: ({ id, name, loadOptions, values, options, value, onChange, onBlur, placeholder, className, disabled, loadingMessage, isMulti, selectedLimit, selectedLimitLabel, ...otherProps }: Props) => import("react/jsx-runtime").JSX.Element;
23
+ export { MultiSelect, type Option };
@@ -1,8 +1,14 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useId } from "react";
3
- import ReactSelect from "react-select";
4
- import ReactSelectAsync from "react-select/async";
5
- const MultiSelect = ({ id, name, loadOptions, values, options, value, onChange, onBlur, placeholder = "Select", className = "react-select", disabled, loadingMessage = () => "Chargement...", ...otherProps }) => {
3
+ import Select from "react-select";
4
+ import AsyncSelect from "react-select/async";
5
+ import { ValueContainer } from "./ValueContainer";
6
+ import "@axa-fr/design-system-slash-css/dist/Form/MultiSelect/MultiSelect.scss";
7
+ import { formatOptionLabel } from "./FormatOptionLabel";
8
+ import { useMultiSelectStyle } from "./useMultiSelectStyle";
9
+ import { noOptionsMessage } from "./NoOptionsMessage";
10
+ const MultiSelect = ({ id, name, loadOptions, values, options, value, onChange, onBlur, placeholder = "- Sélectionner -", className = "react-select", disabled, loadingMessage = () => "Chargement...", isMulti, selectedLimit, selectedLimitLabel, ...otherProps }) => {
11
+ const { styles } = useMultiSelectStyle();
6
12
  const generatedId = useId();
7
13
  const inputId = id || generatedId;
8
14
  const handleOnChange = (newValue) => {
@@ -37,11 +43,25 @@ const MultiSelect = ({ id, name, loadOptions, values, options, value, onChange,
37
43
  options,
38
44
  valueKey: "value",
39
45
  labelKey: "label",
46
+ styles,
47
+ isMulti,
48
+ noOptionsMessage,
49
+ isClearable: true,
50
+ hideSelectedOptions: false,
51
+ components: { ValueContainer },
52
+ closeMenuOnSelect: !values,
40
53
  ...otherProps,
41
54
  };
42
55
  if (values) {
43
56
  const newValues = options.filter((opt) => values.includes(opt.value));
44
- return loadOptions ? (_jsx(ReactSelectAsync, { ...commonProps, isMulti: true, value: newValues, loadOptions: loadOptions, loadingMessage: loadingMessage })) : (_jsx(ReactSelect, { ...commonProps, isMulti: true, value: newValues }));
57
+ const commonValuesProps = {
58
+ ...commonProps,
59
+ value: newValues,
60
+ formatOptionLabel,
61
+ selectedLimit,
62
+ selectedLimitLabel,
63
+ };
64
+ return loadOptions ? (_jsx(AsyncSelect, { ...commonValuesProps, loadOptions: loadOptions, loadingMessage: loadingMessage, isMulti: true })) : (_jsx(Select, { ...commonValuesProps, isMulti: true }));
45
65
  }
46
66
  const newValue = options.find((o) => o.value === value);
47
67
  const commonValueProps = {
@@ -49,6 +69,6 @@ const MultiSelect = ({ id, name, loadOptions, values, options, value, onChange,
49
69
  multi: false,
50
70
  value: newValue,
51
71
  };
52
- return loadOptions ? (_jsx(ReactSelectAsync, { ...commonValueProps, loadOptions: loadOptions, loadingMessage: loadingMessage })) : (_jsx(ReactSelect, { ...commonValueProps }));
72
+ return loadOptions ? (_jsx(AsyncSelect, { ...commonValueProps, loadOptions: loadOptions, loadingMessage: loadingMessage })) : (_jsx(Select, { ...commonValueProps }));
53
73
  };
54
74
  export { MultiSelect };
@@ -1,9 +1,7 @@
1
1
  import "@axa-fr/design-system-slash-css/dist/Form/MultiSelect/MultiSelect.scss";
2
- import { type ComponentProps, type ReactNode } from "react";
3
- import { LegacyField } from "../core";
2
+ import { type ComponentProps } from "react";
3
+ import { ConsumerFieldProps } from "../core";
4
4
  import { MultiSelect } from "./MultiSelect";
5
- type Props = ComponentProps<typeof LegacyField> & ComponentProps<typeof MultiSelect> & {
6
- helpMessage?: ReactNode;
7
- };
8
- declare const MultiSelectInput: ({ classModifier, message, children, helpMessage, id, disabled, classNameContainerLabel, classNameContainerInput, label, messageType, isVisible, forceDisplayMessage, className, required, ...multiSelectProps }: Props) => import("react/jsx-runtime").JSX.Element;
5
+ type Props = ConsumerFieldProps & ComponentProps<typeof MultiSelect>;
6
+ declare const MultiSelectInput: ({ label, ...multiSelectProps }: Props) => import("react/jsx-runtime").JSX.Element;
9
7
  export { MultiSelectInput };
@@ -1,15 +1,10 @@
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/Form/MultiSelect/MultiSelect.scss";
3
- import { useId } from "react";
4
- import { FieldInput, HelpMessage, LegacyField, useInputClassModifier, } from "../core";
3
+ import { Field } from "../core";
5
4
  import { MultiSelect } from "./MultiSelect";
6
- import { useAriaInvalid } from "../core/useAriaInvalid";
7
- const MultiSelectInput = ({ classModifier, message, children, helpMessage, id, disabled, classNameContainerLabel, classNameContainerInput, label, messageType, isVisible, forceDisplayMessage, className, required, ...multiSelectProps }) => {
8
- const { inputFieldClassModifier } = useInputClassModifier(classModifier ?? "", disabled ?? false, Boolean(children), required);
9
- const generatedId = useId();
10
- const errorUseId = useId();
11
- const inputId = id || generatedId;
12
- const isInvalid = useAriaInvalid(message, forceDisplayMessage, messageType);
13
- 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(MultiSelect, { inputId: inputId, disabled: disabled, required: required, "aria-invalid": isInvalid, "aria-errormessage": errorUseId, ...multiSelectProps }), children] }), _jsx(HelpMessage, { message: helpMessage, isVisible: !message })] }));
5
+ const MultiSelectInput = ({ label, ...multiSelectProps }) => {
6
+ return (_jsx(Field, { label: label, ...multiSelectProps, classNameSuffix: "select", renderInput: ({ id, ariaInvalid, errorId, ...props }) => {
7
+ return (_jsx(MultiSelect, { id: id, "aria-invalid": ariaInvalid, "aria-describedby": errorId, ...props }));
8
+ } }));
14
9
  };
15
10
  export { MultiSelectInput };
@@ -0,0 +1,3 @@
1
+ export declare const noOptionsMessage: ({ inputValue }: {
2
+ inputValue: string;
3
+ }) => string;
@@ -0,0 +1 @@
1
+ export const noOptionsMessage = ({ inputValue }) => `Pas de résultats pour "${inputValue}"`;
@@ -0,0 +1,4 @@
1
+ import { type GroupBase, type ValueContainerProps } from "react-select";
2
+ import { Option } from "./MultiSelect";
3
+ declare const ValueContainer: ({ children, ...props }: ValueContainerProps<Option, boolean, GroupBase<Option>>) => import("react/jsx-runtime").JSX.Element;
4
+ export { ValueContainer };
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import React from "react";
3
+ import { components, } from "react-select";
4
+ const ValueContainer = ({ children, ...props }) => {
5
+ const { selectProps, getStyles, innerProps } = props;
6
+ const { selectedLimit, selectedLimitLabel, value: selectedOptions, isMulti, } = selectProps;
7
+ if (!isMulti) {
8
+ return (_jsx(components.ValueContainer, { ...props, children: children }));
9
+ }
10
+ const [values, input] = children;
11
+ const visibleOptions = React.Children.toArray(values).slice(0, selectedLimit);
12
+ const extraCount = Array.isArray(selectedOptions) && selectedLimit !== undefined
13
+ ? selectedOptions.length - selectedLimit
14
+ : 0;
15
+ // On est obligé de sortir le borderRadius ici pour ne pas devoir ajouter un important dans le fichier scss
16
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
17
+ const { borderRadius, ...multiValueLabelStyles } = getStyles("multiValueLabel", props);
18
+ return (_jsxs(components.ValueContainer, { ...props, children: [extraCount > 0 ? (_jsxs(_Fragment, { children: [visibleOptions, _jsxs("div", { ...innerProps, style: multiValueLabelStyles, className: "multi-value-limit", children: ["+ ", extraCount, " ", selectedLimitLabel || ""] })] })) : (values), input] }));
19
+ };
20
+ export { ValueContainer };
@@ -0,0 +1,5 @@
1
+ import { type GroupBase, type StylesConfig } from "react-select";
2
+ import { Option } from "./MultiSelect";
3
+ export declare const useMultiSelectStyle: () => {
4
+ styles: StylesConfig<Option, boolean, GroupBase<Option>>;
5
+ };
@@ -0,0 +1,81 @@
1
+ export const useMultiSelectStyle = () => {
2
+ // The recommended way to provide custom styles to react-select is to use the styles prop
3
+ // https://react-select.com/styles#the-styles-prop
4
+ const styles = {
5
+ container: () => ({
6
+ width: "100%",
7
+ }),
8
+ control: (provided, state) => ({
9
+ ...provided,
10
+ whiteSpace: "normal",
11
+ borderRadius: "0",
12
+ borderColor: state.isFocused ? "var(--axablue80)" : provided.borderColor,
13
+ boxShadow: state.isFocused ? "0" : provided.boxShadow,
14
+ width: "100%",
15
+ cursor: state.isDisabled ? "not-allowed" : "pointer",
16
+ ":hover": {
17
+ borderColor: state.isFocused
18
+ ? "var(--axablue80)"
19
+ : provided.borderColor,
20
+ },
21
+ }),
22
+ menu: (provided) => ({
23
+ ...provided,
24
+ borderRadius: "0",
25
+ }),
26
+ menuList: (provided) => ({
27
+ ...provided,
28
+ padding: "0",
29
+ }),
30
+ option: (provided, state) => ({
31
+ ...provided,
32
+ backgroundColor: (state.isSelected && !state.isMulti) || state.isFocused
33
+ ? "var(--axablue30)"
34
+ : "var(--white)",
35
+ color: state.isSelected || state.isFocused
36
+ ? "var(--axablue80)"
37
+ : provided.color,
38
+ cursor: state.isDisabled ? "not-allowed" : "pointer",
39
+ padding: "0.406rem 0.75rem",
40
+ ":hover": {
41
+ backgroundColor: "var(--axablue30)",
42
+ color: "var(--axablue80)",
43
+ },
44
+ }),
45
+ singleValue: (provided) => ({
46
+ ...provided,
47
+ whiteSpace: "normal",
48
+ }),
49
+ multiValue: (provided) => ({
50
+ ...provided,
51
+ whiteSpace: "normal",
52
+ flexDirection: "row-reverse",
53
+ borderRadius: "0.25rem",
54
+ }),
55
+ multiValueLabel: (provided, state) => ({
56
+ ...provided,
57
+ whiteSpace: "normal",
58
+ backgroundColor: state.isDisabled
59
+ ? provided.backgroundColor
60
+ : "var(--axablue30)",
61
+ color: state.isDisabled ? provided.backgroundColor : "var(--axablue80)",
62
+ padding: "0.125rem 0.375rem 0.125rem 0.375rem",
63
+ borderRadius: "0 0.25rem 0.25rem 0",
64
+ }),
65
+ multiValueRemove: (provided, state) => ({
66
+ ...provided,
67
+ backgroundColor: state.isDisabled
68
+ ? provided.backgroundColor
69
+ : "var(--axablue30)",
70
+ color: state.isDisabled ? provided.color : "var(--axablue80)",
71
+ // borderRadius: "0.25rem 0 0 0.25rem",
72
+ ":hover": {
73
+ backgroundColor: state.isDisabled
74
+ ? provided.backgroundColor
75
+ : "var(--axablue40)",
76
+ color: state.isDisabled ? provided.color : "var(--axablue80)",
77
+ },
78
+ }),
79
+ };
80
+ return { styles };
81
+ };
@@ -1,12 +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 { ComponentPropsWithoutRef, ComponentPropsWithRef, ReactNode } from "react";
5
- import { LegacyField } from "../core";
4
+ import { ComponentPropsWithRef } from "react";
5
+ import { type ConsumerFieldProps } from "../core";
6
6
  import { Number } from "./Number";
7
- type Props = ComponentPropsWithoutRef<typeof LegacyField> & ComponentPropsWithRef<typeof Number> & {
8
- helpMessage?: ReactNode;
9
- children?: ReactNode;
10
- };
11
- export declare const NumberInput: ({ message, children, helpMessage, id, label, classNameContainerLabel, classNameContainerInput, forceDisplayMessage, messageType, isVisible, className, disabled, classModifier, required, ...otherProps }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ type Props = Omit<ConsumerFieldProps & ComponentPropsWithRef<typeof Number>, "children">;
8
+ export declare const NumberInput: ({ rightElement, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
12
9
  export {};