@axa-fr/design-system-look-and-feel-react 1.0.5-ci.39 → 1.0.5-ci.40

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.
@@ -9,6 +9,8 @@ type Props = ComponentPropsWithRef<"input"> & {
9
9
  label?: string;
10
10
  buttonLabel?: string;
11
11
  onButtonClick?: MouseEventHandler<HTMLButtonElement>;
12
+ sideButtonLabel?: string;
13
+ onSideButtonClick?: MouseEventHandler<HTMLButtonElement>;
12
14
  };
13
15
  declare const Text: import("react").ForwardRefExoticComponent<Omit<Props, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
14
16
  export { Text };
@@ -7,7 +7,7 @@ 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(({ unit, className, classModifier = "", label, description, helper, error, buttonLabel, onButtonClick, required, ...otherProps }, inputRef) => {
10
+ const Text = forwardRef(({ unit, className, classModifier = "", label, description, helper, error, buttonLabel, onButtonClick, required, sideButtonLabel, onSideButtonClick, ...otherProps }, inputRef) => {
11
11
  const componentClassName = getComponentClassName("af-form__input-text", className, classModifier +
12
12
  (error || otherProps["aria-errormessage"] ? " error" : ""));
13
13
  let inputId = useId();
@@ -16,7 +16,7 @@ const Text = forwardRef(({ unit, className, classModifier = "", label, descripti
16
16
  const idError = useId();
17
17
  const idHelp = useId();
18
18
  const idLabel = useId();
19
- return (_jsxs("div", { className: "af-form__input-container", children: [(label || description || buttonLabel) && (_jsxs("div", { className: "af-form__label-container", children: [_jsxs("label", { htmlFor: inputId, id: idLabel, "aria-describedby": idDescription, className: "af-form__input-label", children: [label, " ", required && _jsx("span", { "aria-hidden": "true", children: " *" })] }), description && (_jsx("span", { id: idDescription, 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 }))] })), _jsxs("div", { className: "af-form__input-variant", children: [_jsx("input", { id: inputId, className: componentClassName, type: "text", ref: inputRef, "aria-labelledby": idLabel, "aria-errormessage": otherProps["aria-errormessage"] ?? idError, "aria-invalid": Boolean(error || otherProps["aria-errormessage"]), "aria-describedby": idHelp, ...otherProps }), unit] }), helper && (_jsx("span", { id: idHelp, className: "af-form__input-helper", children: helper })), !otherProps["aria-errormessage"] && error && (_jsx(InputError, { id: idError, message: error }))] }));
19
+ return (_jsxs("div", { className: "af-form__input-container", children: [(label || description || buttonLabel) && (_jsxs("div", { className: "af-form__label-container", children: [_jsxs("div", { className: "af-form__label-header", children: [_jsxs("label", { htmlFor: inputId, id: idLabel, "aria-describedby": idDescription, className: "af-form__input-label", children: [label, " ", required && _jsx("span", { "aria-hidden": "true", children: " *" })] }), sideButtonLabel && (_jsx(Button, { className: "af-form__input-modify", variant: Variants.ghost, onClick: onSideButtonClick, children: sideButtonLabel }))] }), description && (_jsx("span", { id: idDescription, 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 }))] })), _jsxs("div", { className: "af-form__input-variant", children: [_jsx("input", { id: inputId, className: componentClassName, type: "text", ref: inputRef, "aria-labelledby": idLabel, "aria-errormessage": otherProps["aria-errormessage"] ?? idError, "aria-invalid": Boolean(error || otherProps["aria-errormessage"]), "aria-describedby": idHelp, ...otherProps }), unit] }), helper && (_jsx("span", { id: idHelp, className: "af-form__input-helper", children: helper })), !otherProps["aria-errormessage"] && error && (_jsx(InputError, { id: idError, message: error }))] }));
20
20
  });
21
21
  Text.displayName = "Text";
22
22
  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": "1.0.5-ci.39",
3
+ "version": "1.0.5-ci.40",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "homepage": "https://github.com/AxaFrance/design-system#readme",
47
47
  "peerDependencies": {
48
- "@axa-fr/design-system-look-and-feel-css": "1.0.5-ci.39",
48
+ "@axa-fr/design-system-look-and-feel-css": "1.0.5-ci.40",
49
49
  "@material-symbols/svg-400": ">= 0.19.0",
50
50
  "react": ">= 18"
51
51
  },