@axa-fr/design-system-apollo-react 1.0.5-alpha.367 → 1.0.5-alpha.371

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,6 +1,6 @@
1
1
  import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/Checkbox/CheckboxApollo.scss";
2
- import { CheckboxProps } from "./CheckboxCommon";
3
- export declare const Checkbox: {
4
- (props: CheckboxProps): import("react/jsx-runtime").JSX.Element;
5
- displayName: string;
6
- };
2
+ export declare const Checkbox: import("react").ForwardRefExoticComponent<import("react").InputHTMLAttributes<HTMLInputElement> & {
3
+ errorId?: string;
4
+ hasError?: boolean;
5
+ className?: string;
6
+ } & Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "disabled"> & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
2
3
  import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/Checkbox/CheckboxApollo.scss";
3
4
  import checkBoxIcon from "@material-symbols/svg-400/rounded/check_small.svg";
4
5
  import { CheckboxCommon } from "./CheckboxCommon";
5
- export const Checkbox = (props) => (_jsx(CheckboxCommon, { ...props, checkBoxIcon: checkBoxIcon }));
6
+ export const Checkbox = forwardRef((props, ref) => (_jsx(CheckboxCommon, { ...props, ref: ref, checkBoxIcon: checkBoxIcon })));
6
7
  Checkbox.displayName = "Checkbox";
@@ -1,15 +1,17 @@
1
1
  import React from "react";
2
- type CheckboxIcon = {
3
- checkBoxIcon: string;
4
- };
5
2
  export type CheckboxProps = React.InputHTMLAttributes<HTMLInputElement> & {
6
3
  errorId?: string;
7
4
  hasError?: boolean;
8
5
  className?: string;
9
6
  } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "disabled">;
10
- export type CheckboxCommonProps = CheckboxProps & CheckboxIcon;
11
- declare const CheckboxCommon: {
12
- ({ errorId, checkBoxIcon, hasError, ...inputProps }: CheckboxCommonProps): import("react/jsx-runtime").JSX.Element;
13
- displayName: string;
7
+ export type CheckboxCommonProps = CheckboxProps & {
8
+ checkBoxIcon: string;
14
9
  };
10
+ declare const CheckboxCommon: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & {
11
+ errorId?: string;
12
+ hasError?: boolean;
13
+ className?: string;
14
+ } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "disabled"> & {
15
+ checkBoxIcon: string;
16
+ } & React.RefAttributes<HTMLInputElement>>;
15
17
  export { CheckboxCommon };
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
2
3
  import { Svg } from "../../../Svg/Svg";
3
- const CheckboxCommon = ({ errorId, checkBoxIcon, hasError, ...inputProps }) => (_jsxs("span", { className: "af-checkbox", children: [_jsx(Svg, { src: checkBoxIcon, "aria-hidden": true }), _jsx("input", { ...inputProps, type: "checkbox", "aria-errormessage": errorId, "aria-invalid": hasError, disabled: false })] }));
4
+ const CheckboxCommon = forwardRef(({ errorId, checkBoxIcon, hasError, ...inputProps }, ref) => (_jsxs("span", { className: "af-checkbox", children: [_jsx(Svg, { src: checkBoxIcon, "aria-hidden": true }), _jsx("input", { ...inputProps, ref: ref, type: "checkbox", "aria-errormessage": errorId, "aria-invalid": hasError, disabled: false })] })));
4
5
  CheckboxCommon.displayName = "CheckboxCommon";
5
6
  export { CheckboxCommon };
@@ -1,6 +1,6 @@
1
1
  import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/Checkbox/CheckboxLF.scss";
2
- import { CheckboxProps } from "./CheckboxCommon";
3
- export declare const Checkbox: {
4
- (props: CheckboxProps): import("react/jsx-runtime").JSX.Element;
5
- displayName: string;
6
- };
2
+ export declare const Checkbox: import("react").ForwardRefExoticComponent<import("react").InputHTMLAttributes<HTMLInputElement> & {
3
+ errorId?: string;
4
+ hasError?: boolean;
5
+ className?: string;
6
+ } & Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "disabled"> & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,6 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
2
3
  import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/Checkbox/CheckboxLF.scss";
3
4
  import checkBoxIcon from "@material-symbols/svg-400/rounded/check.svg";
4
5
  import { CheckboxCommon } from "./CheckboxCommon";
5
- export const Checkbox = (props) => (_jsx(CheckboxCommon, { ...props, checkBoxIcon: checkBoxIcon }));
6
+ export const Checkbox = forwardRef((props, ref) => (_jsx(CheckboxCommon, { ...props, ref: ref, checkBoxIcon: checkBoxIcon })));
6
7
  Checkbox.displayName = "Checkbox";
@@ -1,6 +1,5 @@
1
1
  import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CheckboxText/CheckboxTextApollo.scss";
2
- import { CheckboxTextProps } from "./CheckboxTextCommon";
3
- export declare const CheckboxText: {
4
- (props: CheckboxTextProps): import("react/jsx-runtime").JSX.Element;
5
- displayName: string;
6
- };
2
+ export declare const CheckboxText: import("react").ForwardRefExoticComponent<{
3
+ label: string | import("react").ReactNode;
4
+ errorMessage?: string;
5
+ } & Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "disabled"> & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
2
3
  import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CheckboxText/CheckboxTextApollo.scss";
3
4
  import { ItemMessage } from "../../ItemMessage/ItemMessageApollo";
4
5
  import { Checkbox } from "../Checkbox/CheckboxApollo";
5
- import { CheckboxTextCommon } from "./CheckboxTextCommon";
6
- export const CheckboxText = (props) => (_jsx(CheckboxTextCommon, { ...props, CheckboxComponent: Checkbox, ItemMessageComponent: ItemMessage }));
6
+ import { CheckboxTextCommon, } from "./CheckboxTextCommon";
7
+ export const CheckboxText = forwardRef((props, ref) => (_jsx(CheckboxTextCommon, { ...props, ref: ref, CheckboxComponent: Checkbox, ItemMessageComponent: ItemMessage })));
7
8
  CheckboxText.displayName = "CheckboxText";
@@ -1,19 +1,19 @@
1
1
  import React, { type ReactNode, type ComponentProps, type ComponentType } from "react";
2
2
  import { ItemMessage } from "../../ItemMessage/ItemMessageCommon";
3
- import { CheckboxProps } from "../Checkbox/CheckboxCommon";
4
- type CheckboxComponent = {
5
- CheckboxComponent: ComponentType<CheckboxProps>;
6
- };
7
- type ItemMessageComponen = {
8
- ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
9
- };
3
+ import { CheckboxCommon } from "../Checkbox/CheckboxCommon";
10
4
  export type CheckboxTextProps = {
11
5
  label: string | ReactNode;
12
6
  errorMessage?: string;
13
7
  } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "disabled">;
14
- export type CheckboxTextCommonProps = CheckboxTextProps & CheckboxComponent & ItemMessageComponen;
15
- declare const CheckboxTextCommon: {
16
- ({ label, errorMessage, CheckboxComponent, ItemMessageComponent, ...inputProps }: CheckboxTextCommonProps): import("react/jsx-runtime").JSX.Element;
17
- displayName: string;
8
+ export type CheckboxTextCommonProps = CheckboxTextProps & {
9
+ CheckboxComponent: ComponentType<Omit<ComponentProps<typeof CheckboxCommon>, "checkBoxIcon">>;
10
+ ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
18
11
  };
12
+ declare const CheckboxTextCommon: React.ForwardRefExoticComponent<{
13
+ label: string | ReactNode;
14
+ errorMessage?: string;
15
+ } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "disabled"> & {
16
+ CheckboxComponent: ComponentType<Omit<ComponentProps<typeof CheckboxCommon>, "checkBoxIcon">>;
17
+ ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
18
+ } & React.RefAttributes<HTMLInputElement>>;
19
19
  export { CheckboxTextCommon };
@@ -1,10 +1,10 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useId, } from "react";
3
- const CheckboxTextCommon = ({ label, errorMessage, CheckboxComponent, ItemMessageComponent, ...inputProps }) => {
2
+ import { useId, forwardRef, } from "react";
3
+ const CheckboxTextCommon = forwardRef(({ label, errorMessage, CheckboxComponent, ItemMessageComponent, ...inputProps }, ref) => {
4
4
  const errorId = useId();
5
5
  let inputId = useId();
6
6
  inputId = inputProps.id || inputId;
7
- return (_jsxs("div", { className: "af-checkbox-text", children: [_jsx(CheckboxComponent, { id: inputId, errorId: errorId, hasError: Boolean(errorMessage), ...inputProps }), _jsx("label", { htmlFor: inputId, children: _jsx("span", { children: label }) }, inputProps.name), _jsx(ItemMessageComponent, { message: errorMessage })] }));
8
- };
7
+ return (_jsxs("div", { className: "af-checkbox-text", children: [_jsx(CheckboxComponent, { id: inputId, errorId: errorId, hasError: Boolean(errorMessage), ...inputProps, ref: ref }), _jsx("label", { htmlFor: inputId, children: _jsx("span", { children: label }) }, inputProps.name), _jsx(ItemMessageComponent, { message: errorMessage })] }));
8
+ });
9
9
  CheckboxTextCommon.displayName = "CheckboxTextCommon";
10
10
  export { CheckboxTextCommon };
@@ -1,6 +1,5 @@
1
1
  import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CheckboxText/CheckboxTextLF.scss";
2
- import { CheckboxTextProps } from "./CheckboxTextCommon";
3
- export declare const CheckboxText: {
4
- (props: CheckboxTextProps): import("react/jsx-runtime").JSX.Element;
5
- displayName: string;
6
- };
2
+ export declare const CheckboxText: import("react").ForwardRefExoticComponent<{
3
+ label: string | import("react").ReactNode;
4
+ errorMessage?: string;
5
+ } & Omit<import("react").InputHTMLAttributes<HTMLInputElement>, "disabled"> & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,7 +1,8 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
2
3
  import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CheckboxText/CheckboxTextLF.scss";
3
4
  import { ItemMessage } from "../../ItemMessage/ItemMessageLF";
4
5
  import { Checkbox } from "../Checkbox/CheckboxLF";
5
6
  import { CheckboxTextCommon } from "./CheckboxTextCommon";
6
- export const CheckboxText = (props) => (_jsx(CheckboxTextCommon, { ...props, CheckboxComponent: Checkbox, ItemMessageComponent: ItemMessage }));
7
+ export const CheckboxText = forwardRef((props, ref) => (_jsx(CheckboxTextCommon, { ...props, ref: ref, CheckboxComponent: Checkbox, ItemMessageComponent: ItemMessage })));
7
8
  CheckboxText.displayName = "CheckboxText";
@@ -1,6 +1,3 @@
1
1
  import "@axa-fr/design-system-apollo-css/dist/Form/Radio/Radio/RadioApollo.scss";
2
- import { RadioProps } from "./RadioCommon";
3
- export declare const Radio: {
4
- (props: RadioProps): import("react/jsx-runtime").JSX.Element;
5
- displayName: string;
6
- };
2
+ import { type RadioProps } from "./RadioCommon";
3
+ export declare const Radio: import("react").ForwardRefExoticComponent<RadioProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
2
3
  import "@axa-fr/design-system-apollo-css/dist/Form/Radio/Radio/RadioApollo.scss";
3
4
  import { RadioCommon } from "./RadioCommon";
4
- export const Radio = (props) => _jsx(RadioCommon, { ...props });
5
+ export const Radio = forwardRef((props, ref) => (_jsx(RadioCommon, { ...props, ref: ref })));
5
6
  Radio.displayName = "Radio";
@@ -1,6 +1,3 @@
1
1
  import React from "react";
2
2
  export type RadioProps = Omit<React.InputHTMLAttributes<HTMLInputElement>, "disabled">;
3
- export declare const RadioCommon: {
4
- (inputProps: RadioProps): import("react/jsx-runtime").JSX.Element;
5
- displayName: string;
6
- };
3
+ export declare const RadioCommon: React.ForwardRefExoticComponent<RadioProps & React.RefAttributes<HTMLInputElement>>;
@@ -1,3 +1,4 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- export const RadioCommon = (inputProps) => (_jsxs("span", { className: "af-radio", children: [_jsx("input", { ...inputProps, type: "radio" }), _jsx("span", { className: "af-radio__icons" })] }));
2
+ import { forwardRef } from "react";
3
+ export const RadioCommon = forwardRef((inputProps, ref) => (_jsxs("span", { className: "af-radio", children: [_jsx("input", { ...inputProps, type: "radio", ref: ref }), _jsx("span", { className: "af-radio__icons" })] })));
3
4
  RadioCommon.displayName = "RadioCommon";
@@ -1,6 +1,3 @@
1
1
  import "@axa-fr/design-system-apollo-css/dist/Form/Radio/Radio/RadioLF.scss";
2
- import { RadioProps } from "./RadioCommon";
3
- export declare const Radio: {
4
- (props: RadioProps): import("react/jsx-runtime").JSX.Element;
5
- displayName: string;
6
- };
2
+ import { type RadioProps } from "./RadioCommon";
3
+ export declare const Radio: import("react").ForwardRefExoticComponent<RadioProps & import("react").RefAttributes<HTMLInputElement>>;
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
2
3
  import "@axa-fr/design-system-apollo-css/dist/Form/Radio/Radio/RadioLF.scss";
3
4
  import { RadioCommon } from "./RadioCommon";
4
- export const Radio = (props) => _jsx(RadioCommon, { ...props });
5
+ export const Radio = forwardRef((props, ref) => (_jsx(RadioCommon, { ...props, ref: ref })));
5
6
  Radio.displayName = "Radio";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/design-system-apollo-react",
3
- "version": "1.0.5-alpha.367",
3
+ "version": "1.0.5-alpha.371",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -46,8 +46,8 @@
46
46
  },
47
47
  "homepage": "https://github.com/AxaFrance/design-system#readme",
48
48
  "peerDependencies": {
49
- "@axa-fr/design-system-apollo-css": "1.0.5-alpha.367",
50
- "@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.367",
49
+ "@axa-fr/design-system-apollo-css": "1.0.5-alpha.371",
50
+ "@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.371",
51
51
  "@material-symbols/svg-400": ">= 0.19.0",
52
52
  "react": ">= 18"
53
53
  },