@axa-fr/design-system-look-and-feel-react 0.2.0-beta.335 → 0.2.0-beta.336

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.
@@ -1,12 +1,11 @@
1
1
  import "@axa-fr/design-system-look-and-feel-css/dist/Form/Text/Text.scss";
2
2
  import { ComponentPropsWithRef, MouseEventHandler } from "react";
3
- type Props = Omit<ComponentPropsWithRef<"input">, "required"> & {
3
+ type Props = ComponentPropsWithRef<"input"> & {
4
4
  classModifier?: string;
5
5
  helper?: string;
6
6
  error?: string;
7
7
  description?: string;
8
8
  label?: string;
9
- required?: boolean;
10
9
  buttonLabel?: string;
11
10
  onButtonClick?: MouseEventHandler<HTMLButtonElement>;
12
11
  };
@@ -7,10 +7,10 @@ import { Variants } from "../../Button/Button";
7
7
  import { Svg } from "../../Svg";
8
8
  import { getComponentClassName } from "../../utilities";
9
9
  import { InputError } from "../InputError";
10
- const Text = forwardRef(({ className, classModifier = "", ...otherProps }, inputRef) => {
10
+ const Text = forwardRef(({ className, classModifier = "", label, description, helper, error, buttonLabel, onButtonClick, ...otherProps }, inputRef) => {
11
11
  const componentClassName = getComponentClassName(className, classModifier, "af-form__input-text");
12
- const { id, label, required, disabled, description, helper, error, buttonLabel, onButtonClick, } = otherProps;
13
- return (_jsxs("div", { className: "af-form__input-container", children: [_jsxs("label", { htmlFor: id, className: "af-form__input-label", children: [label, " ", required && _jsx("span", { children: " *" })] }), description && (_jsx("span", { className: "af-form__input-description", children: description })), buttonLabel && (_jsx(Button, { className: "af-form__input-more", variant: Variants.ghost, iconLeft: _jsx(Svg, { src: infoIcon }), onClick: onButtonClick, children: buttonLabel })), _jsx("input", { className: componentClassName, type: "text", ref: inputRef, required: required, disabled: disabled, "aria-invalid": Boolean(error), "aria-describedby": error ? `${id}-error` : undefined, ...otherProps }), helper && _jsx("span", { className: "af-form__input-helper", children: helper }), error && _jsx(InputError, { id: `${id}-error`, message: error })] }));
12
+ const { id, required } = otherProps;
13
+ return (_jsxs("div", { className: "af-form__input-container", children: [_jsxs("label", { htmlFor: id, className: "af-form__input-label", children: [label, " ", required && _jsx("span", { children: " *" })] }), description && (_jsx("span", { className: "af-form__input-description", children: description })), buttonLabel && (_jsx(Button, { className: "af-form__input-more", variant: Variants.ghost, iconLeft: _jsx(Svg, { src: infoIcon }), onClick: onButtonClick, children: buttonLabel })), _jsx("input", { className: componentClassName, type: "text", ref: inputRef, "aria-invalid": Boolean(error), "aria-describedby": error ? `${id}-error` : undefined, ...otherProps }), helper && _jsx("span", { className: "af-form__input-helper", children: helper }), error && _jsx(InputError, { id: `${id}-error`, message: error })] }));
14
14
  });
15
15
  Text.displayName = "Text";
16
16
  export { Text };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/design-system-look-and-feel-react",
3
- "version": "0.2.0-beta.335",
3
+ "version": "0.2.0-beta.336",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "homepage": "https://github.com/AxaFrance/design-system#readme",
43
43
  "peerDependencies": {
44
- "@axa-fr/design-system-look-and-feel-css": "0.2.0-beta.335",
44
+ "@axa-fr/design-system-look-and-feel-css": "0.2.0-beta.336",
45
45
  "@material-symbols/svg-400": ">= 0.19.0",
46
46
  "react": ">= 18"
47
47
  },