@axa-fr/design-system-apollo-react 1.0.5-alpha.411 → 1.0.5-alpha.416

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,5 +1,5 @@
1
- import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CardCheckbox/CardCheckboxApollo.scss";
2
1
  import { type CardCheckboxProps } from "./CardCheckboxCommon";
2
+ import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CardCheckbox/CardCheckboxApollo.scss";
3
3
  export declare const CardCheckbox: {
4
4
  (props: CardCheckboxProps): import("react/jsx-runtime").JSX.Element;
5
5
  displayName: string;
@@ -1,8 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CardCheckbox/CardCheckboxApollo.scss";
3
- import { Icon } from "../../../Icon/IconApollo";
4
2
  import { ItemMessage } from "../../ItemMessage/ItemMessageApollo";
5
- import { Checkbox } from "../Checkbox/CheckboxApollo";
3
+ import { CardCheckboxOption } from "../CardCheckboxOption/CardCheckboxOptionApollo";
6
4
  import { CardCheckboxCommon, } from "./CardCheckboxCommon";
7
- export const CardCheckbox = (props) => (_jsx(CardCheckboxCommon, { ...props, IconComponent: Icon, CheckboxComponent: Checkbox, ItemMessageComponent: ItemMessage }));
5
+ import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CardCheckbox/CardCheckboxApollo.scss";
6
+ export const CardCheckbox = (props) => (_jsx(CardCheckboxCommon, { ...props, CardCheckboxItemComponent: CardCheckboxOption, ItemMessageComponent: ItemMessage }));
8
7
  CardCheckbox.displayName = "CardCheckbox";
@@ -1,21 +1,32 @@
1
- import { type ChangeEventHandler, type ComponentProps, type ComponentType } from "react";
2
- import { ItemMessage } from "../../ItemMessage/ItemMessageLF";
3
- import { type TCardCheckboxItem } from "./CardCheckboxItem";
4
- import type { CheckboxComponent, IconComponent } from "./types";
5
- export type CardCheckboxProps = Partial<TCardCheckboxItem> & {
6
- type: "vertical" | "horizontal";
1
+ import { type ComponentType, type ReactNode } from "react";
2
+ import type { ItemMessageProps } from "../../ItemMessage/ItemMessageCommon";
3
+ import type { CardCheckboxOptionProps } from "../CardCheckboxOption/CardCheckboxOptionCommon";
4
+ type CheckboxOption = Omit<CardCheckboxOptionProps, "name" | "type">;
5
+ export type CardCheckboxProps = Omit<CardCheckboxOptionProps, "value" | "label" | "type" | "icon" | "description" | "subtitle" | "children"> & {
6
+ type?: "vertical" | "horizontal";
7
+ /**
8
+ * @deprecated Use `label` instead.
9
+ */
7
10
  labelGroup?: string;
11
+ /**
12
+ * @deprecated Use `description` instead.
13
+ */
8
14
  descriptionGroup?: string;
15
+ label: ReactNode;
16
+ description?: ReactNode;
17
+ /**
18
+ * @deprecated Use `required` instead.
19
+ */
9
20
  isRequired?: boolean;
10
- options: TCardCheckboxItem[];
11
- onChange?: ChangeEventHandler;
21
+ options: CheckboxOption[];
12
22
  error?: string;
13
23
  };
14
- type CardCheckboxCommonProps = CardCheckboxProps & CheckboxComponent & IconComponent & {
15
- ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
24
+ type CardCheckboxCommonProps = CardCheckboxProps & {
25
+ CardCheckboxItemComponent: ComponentType<CardCheckboxOptionProps>;
26
+ ItemMessageComponent: ComponentType<ItemMessageProps>;
16
27
  };
17
28
  export declare const CardCheckboxCommon: {
18
- ({ className, labelGroup, descriptionGroup, CheckboxComponent, IconComponent, isRequired, options, onChange, type, error, ItemMessageComponent, ...inputProps }: CardCheckboxCommonProps): import("react/jsx-runtime").JSX.Element;
29
+ ({ className, labelGroup, descriptionGroup, label, description, isRequired, required, options, type, error, name, id, onChange, CardCheckboxItemComponent, ItemMessageComponent, ...inputProps }: CardCheckboxCommonProps): import("react/jsx-runtime").JSX.Element;
19
30
  displayName: string;
20
31
  };
21
32
  export {};
@@ -1,15 +1,30 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useId, } from "react";
3
- import { BREAKPOINT } from "../../../utilities/constants";
4
- import { getComponentClassName } from "../../../utilities/getComponentClassName";
5
- import { useIsSmallScreen } from "../../../utilities/hook/useIsSmallScreen";
6
- import { CardCheckboxItem } from "./CardCheckboxItem";
7
- export const CardCheckboxCommon = ({ className, labelGroup, descriptionGroup, CheckboxComponent, IconComponent, isRequired, options, onChange, type = "vertical", error, ItemMessageComponent, ...inputProps }) => {
8
- const componentClassName = getComponentClassName("af-card-checkbox__container", className);
9
- const checkboxGroupClassName = getComponentClassName("af-card-checkbox-group", className, type);
10
- const errorId = useId();
11
- const isMobile = useIsSmallScreen(BREAKPOINT.SM);
12
- const size = isMobile ? "M" : "L";
13
- return (_jsxs("fieldset", { className: componentClassName, children: [labelGroup ? (_jsxs("legend", { className: "af-card-checkbox__legend", children: [_jsxs("p", { children: [labelGroup, isRequired ? _jsx("span", { "aria-hidden": true, children: "\u00A0*" }) : null] }), descriptionGroup ? (_jsx("p", { className: "af-card-checkbox__description", children: descriptionGroup })) : null] })) : null, _jsxs("div", { className: "af-card-checkbox__choices", children: [_jsx("ul", { className: checkboxGroupClassName, children: options.map(({ hasError, ...optionProps }) => (_jsx("li", { children: _jsx(CardCheckboxItem, { ...inputProps, size: size, errorId: errorId, onChange: onChange, CheckboxComponent: CheckboxComponent, IconComponent: IconComponent, hasError: Boolean(error) || hasError, ...optionProps }) }, crypto.randomUUID()))) }), _jsx(ItemMessageComponent, { id: errorId, message: error, messageType: "error" })] })] }));
2
+ import { useId, useRef, } from "react";
3
+ export const CardCheckboxCommon = ({ className, labelGroup, descriptionGroup, label, description, isRequired, required, options, type = "vertical", error, name, id, onChange = () => { }, CardCheckboxItemComponent, ItemMessageComponent, ...inputProps }) => {
4
+ const generatedId = useId();
5
+ const cardCheckboxId = id || generatedId;
6
+ const errorId = `${cardCheckboxId}-error`;
7
+ const cardCheckboxOptionsRef = useRef(null);
8
+ const handleChange = (event) => {
9
+ const cardCheckboxOptionsEl = cardCheckboxOptionsRef.current;
10
+ if (cardCheckboxOptionsEl && required) {
11
+ const nbCheckedElements = cardCheckboxOptionsEl.querySelectorAll("input[type='checkbox']:checked").length;
12
+ cardCheckboxOptionsEl
13
+ .querySelectorAll("input[type='checkbox']")
14
+ .forEach((el) => {
15
+ if (nbCheckedElements < 1 && !event.target.checked) {
16
+ el.setAttribute("required", "true");
17
+ }
18
+ else {
19
+ el.removeAttribute("required");
20
+ }
21
+ });
22
+ }
23
+ onChange(event);
24
+ };
25
+ return (_jsxs("fieldset", { className: ["af-card-checkbox", className].filter(Boolean).join(" "), id: cardCheckboxId, children: [_jsxs("legend", { className: "af-card-checkbox__legend", children: [_jsxs("p", { className: "af-card-checkbox__label", children: [label, labelGroup, required || isRequired ? _jsx("span", { "aria-hidden": true, children: "*" }) : null] }), description || descriptionGroup ? (_jsxs("p", { className: "af-card-checkbox__description", children: [description, descriptionGroup] })) : null] }), _jsx("div", { className: [
26
+ "af-card-checkbox__options",
27
+ `af-card-checkbox__options--${type}`,
28
+ ].join(" "), ref: cardCheckboxOptionsRef, children: options.map((cardCheckboxItemProps) => (_jsx(CardCheckboxItemComponent, { id: `${cardCheckboxId}-${cardCheckboxItemProps.value}`, required: required, onChange: handleChange, ...inputProps, ...cardCheckboxItemProps, type: type, "aria-invalid": error ? true : undefined, "aria-errormessage": error ? errorId : undefined, name: name }, `${name ?? cardCheckboxId}-${cardCheckboxItemProps.label}`))) }), _jsx(ItemMessageComponent, { id: errorId, message: error, messageType: "error" })] }));
14
29
  };
15
30
  CardCheckboxCommon.displayName = "CardCheckboxCommon";
@@ -1,5 +1,5 @@
1
- import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CardCheckbox/CardCheckboxLF.scss";
2
1
  import { type CardCheckboxProps } from "./CardCheckboxCommon";
2
+ import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CardCheckbox/CardCheckboxLF.scss";
3
3
  export declare const CardCheckbox: {
4
4
  (props: CardCheckboxProps): import("react/jsx-runtime").JSX.Element;
5
5
  displayName: string;
@@ -1,8 +1,7 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CardCheckbox/CardCheckboxLF.scss";
3
- import { Icon } from "../../../Icon/IconLF";
4
2
  import { ItemMessage } from "../../ItemMessage/ItemMessageLF";
5
- import { Checkbox } from "../Checkbox/CheckboxLF";
3
+ import { CardCheckboxOption } from "../CardCheckboxOption/CardCheckboxOptionLF";
6
4
  import { CardCheckboxCommon, } from "./CardCheckboxCommon";
7
- export const CardCheckbox = (props) => (_jsx(CardCheckboxCommon, { ...props, IconComponent: Icon, CheckboxComponent: Checkbox, ItemMessageComponent: ItemMessage }));
5
+ import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CardCheckbox/CardCheckboxLF.scss";
6
+ export const CardCheckbox = (props) => (_jsx(CardCheckboxCommon, { ...props, CardCheckboxItemComponent: CardCheckboxOption, ItemMessageComponent: ItemMessage }));
8
7
  CardCheckbox.displayName = "CardCheckbox";
@@ -0,0 +1,3 @@
1
+ import { type CardCheckboxOptionProps } from "./CardCheckboxOptionCommon";
2
+ import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CardCheckboxOption/CardCheckboxOptionApollo.scss";
3
+ export declare const CardCheckboxOption: (props: CardCheckboxOptionProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Icon } from "../../../Icon/IconApollo";
3
+ import { Checkbox } from "../Checkbox/CheckboxApollo";
4
+ import { CardCheckboxOptionCommon, } from "./CardCheckboxOptionCommon";
5
+ import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CardCheckboxOption/CardCheckboxOptionApollo.scss";
6
+ export const CardCheckboxOption = (props) => (_jsx(CardCheckboxOptionCommon, { ...props, CheckboxComponent: Checkbox, IconComponent: Icon }));
@@ -0,0 +1,15 @@
1
+ import { type ComponentType, type ReactNode } from "react";
2
+ import type { IconProps } from "../../../Icon/IconCommon";
3
+ import type { CheckboxProps } from "../Checkbox/CheckboxCommon";
4
+ export type CardCheckboxOptionProps = CheckboxProps & {
5
+ label: ReactNode;
6
+ type?: "vertical" | "horizontal";
7
+ description?: ReactNode;
8
+ subtitle?: ReactNode;
9
+ icon?: IconProps["src"];
10
+ };
11
+ export type CardCheckboxOptionCommonProps = CardCheckboxOptionProps & {
12
+ CheckboxComponent: ComponentType<CheckboxProps>;
13
+ IconComponent: ComponentType<IconProps>;
14
+ };
15
+ export declare const CardCheckboxOptionCommon: import("react").ForwardRefExoticComponent<Omit<CardCheckboxOptionCommonProps, "ref"> & import("react").RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ export const CardCheckboxOptionCommon = forwardRef(({ label, type = "vertical", description, subtitle, icon, className, CheckboxComponent, IconComponent, ...inputProps }, ref) => {
4
+ return (_jsxs("label", { className: [
5
+ "af-card-checkbox-option",
6
+ type === "horizontal" && "af-card-checkbox-option--horizontal",
7
+ className,
8
+ ]
9
+ .filter(Boolean)
10
+ .join(" "), children: [icon ? _jsx(IconComponent, { src: icon, role: "presentation" }) : null, _jsxs("div", { className: "af-card-checkbox-option__content", children: [_jsx("p", { className: "af-card-checkbox-option__label", children: label }), Boolean(description) && (_jsx("p", { className: "af-card-checkbox-option__description", children: description })), Boolean(subtitle) && (_jsx("p", { className: "af-card-checkbox-option__subtitle", children: subtitle }))] }), _jsx(CheckboxComponent, { ...inputProps, ref: ref })] }));
11
+ });
12
+ CardCheckboxOptionCommon.displayName = "CardCheckboxOptionCommon";
@@ -0,0 +1,3 @@
1
+ import { type CardCheckboxOptionProps } from "./CardCheckboxOptionCommon";
2
+ import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CardCheckboxOption/CardCheckboxOptionLF.scss";
3
+ export declare const CardCheckboxOption: (props: CardCheckboxOptionProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Icon } from "../../../Icon/IconLF";
3
+ import { Checkbox } from "../Checkbox/CheckboxLF";
4
+ import { CardCheckboxOptionCommon, } from "./CardCheckboxOptionCommon";
5
+ import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CardCheckboxOption/CardCheckboxOptionLF.scss";
6
+ export const CardCheckboxOption = (props) => (_jsx(CardCheckboxOptionCommon, { ...props, CheckboxComponent: Checkbox, IconComponent: Icon }));
@@ -1,4 +1,2 @@
1
- import { type DebugGridCommonProps } from "./DebugGridCommon";
2
- type DebugGridProps<P = object> = Omit<DebugGridCommonProps<P>, "CardCheckbox">;
1
+ import { type DebugGridProps } from "./DebugGridCommon";
3
2
  export declare const DebugGrid: <P = object>({ ...props }: DebugGridProps<P>) => import("react/jsx-runtime").JSX.Element;
4
- export {};
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { CardCheckbox } from "../Form/Checkbox/CardCheckbox/CardCheckboxApollo";
2
+ import { CardCheckboxOption } from "../Form/Checkbox/CardCheckboxOption/CardCheckboxOptionApollo";
3
3
  import { DebugGridCommon } from "./DebugGridCommon";
4
4
  export const DebugGrid = ({ ...props }) => {
5
- return (_jsx(DebugGridCommon, { ...props, CardCheckbox: CardCheckbox }));
5
+ return _jsx(DebugGridCommon, { ...props, CardCheckboxOption: CardCheckboxOption });
6
6
  };
@@ -1,9 +1,11 @@
1
1
  import "@axa-fr/design-system-apollo-css/dist/Grid/DebugGrid.scss";
2
- import type { ComponentProps, ComponentType } from "react";
3
- import type { CardCheckboxCommon } from "../Form/Checkbox/CardCheckbox/CardCheckboxCommon";
4
- export type DebugGridCommonProps<P = object> = P & {
2
+ import type { ComponentType } from "react";
3
+ import type { CardCheckboxOptionProps } from "../Form/Checkbox/CardCheckboxOption/CardCheckboxOptionCommon";
4
+ export type DebugGridProps<P = object> = P & {
5
5
  cols?: number;
6
6
  isCheckedByDefault?: boolean;
7
- CardCheckbox: ComponentType<Partial<ComponentProps<typeof CardCheckboxCommon>>>;
8
7
  };
9
- export declare const DebugGridCommon: <P = object>({ cols, isCheckedByDefault, CardCheckbox, ...props }: DebugGridCommonProps<P>) => import("react/jsx-runtime").JSX.Element | null;
8
+ export type DebugGridCommonProps<P = object> = DebugGridProps<P> & {
9
+ CardCheckboxOption: ComponentType<CardCheckboxOptionProps>;
10
+ };
11
+ export declare const DebugGridCommon: <P = object>({ cols, isCheckedByDefault, CardCheckboxOption, ...props }: DebugGridCommonProps<P>) => import("react/jsx-runtime").JSX.Element | null;
@@ -1,16 +1,10 @@
1
1
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import "@axa-fr/design-system-apollo-css/dist/Grid/DebugGrid.scss";
3
- export const DebugGridCommon = ({ cols = 12, isCheckedByDefault = false, CardCheckbox, ...props }) => {
3
+ export const DebugGridCommon = ({ cols = 12, isCheckedByDefault = false, CardCheckboxOption, ...props }) => {
4
4
  // The forceVisible prop is a hidden prop to force the component's visibility when building the storybook
5
5
  const forceVisible = props?.forceVisible || false;
6
6
  if (process.env.NODE_ENV === "production" && !forceVisible) {
7
7
  return null;
8
8
  }
9
- return (_jsxs(_Fragment, { children: [_jsx(CardCheckbox, { type: "horizontal", options: [
10
- {
11
- name: "debuggrid",
12
- label: "Grid",
13
- defaultChecked: isCheckedByDefault,
14
- },
15
- ] }), _jsx("div", { className: "debug-grid", role: "presentation", children: _jsx("div", { className: "grid", children: [...Array(cols).keys()].map((col) => (_jsx("div", { className: "cols" }, col))) }) })] }));
9
+ return (_jsxs(_Fragment, { children: [_jsx(CardCheckboxOption, { type: "horizontal", name: "debuggrid", label: "Grid", defaultChecked: isCheckedByDefault }), _jsx("div", { className: "debug-grid", role: "presentation", children: _jsx("div", { className: "grid", children: [...Array(cols).keys()].map((col) => (_jsx("div", { className: "cols" }, col))) }) })] }));
16
10
  };
@@ -1,4 +1,2 @@
1
- import { type DebugGridCommonProps } from "./DebugGridCommon";
2
- type DebugGridProps<P = object> = Omit<DebugGridCommonProps<P>, "CardCheckbox">;
1
+ import { type DebugGridProps } from "./DebugGridCommon";
3
2
  export declare const DebugGrid: <P = object>({ ...props }: DebugGridProps<P>) => import("react/jsx-runtime").JSX.Element;
4
- export {};
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { CardCheckbox } from "../Form/Checkbox/CardCheckbox/CardCheckboxLF";
2
+ import { CardCheckboxOption } from "../Form/Checkbox/CardCheckboxOption/CardCheckboxOptionLF";
3
3
  import { DebugGridCommon } from "./DebugGridCommon";
4
4
  export const DebugGrid = ({ ...props }) => {
5
- return (_jsx(DebugGridCommon, { ...props, CardCheckbox: CardCheckbox }));
5
+ return _jsx(DebugGridCommon, { ...props, CardCheckboxOption: CardCheckboxOption });
6
6
  };
package/dist/index.d.ts CHANGED
@@ -17,6 +17,7 @@ export { CardCheckbox,
17
17
  /** @deprecated Use `CardCheckbox` instead. */
18
18
  CardCheckbox as CheckboxCard, } from "./Form/Checkbox/CardCheckbox/CardCheckboxApollo";
19
19
  export { CheckboxText } from "./Form/Checkbox/CheckboxText/CheckboxTextApollo";
20
+ export { CardCheckboxOption } from "./Form/Checkbox/CardCheckboxOption/CardCheckboxOptionApollo";
20
21
  export { InputDate } from "./Form/InputDate/InputDateApollo";
21
22
  export { ItemLabel } from "./Form/ItemLabel/ItemLabelApollo";
22
23
  export { ItemMessage } from "./Form/ItemMessage/ItemMessageApollo";
package/dist/index.js CHANGED
@@ -17,6 +17,7 @@ export { CardCheckbox,
17
17
  /** @deprecated Use `CardCheckbox` instead. */
18
18
  CardCheckbox as CheckboxCard, } from "./Form/Checkbox/CardCheckbox/CardCheckboxApollo";
19
19
  export { CheckboxText } from "./Form/Checkbox/CheckboxText/CheckboxTextApollo";
20
+ export { CardCheckboxOption } from "./Form/Checkbox/CardCheckboxOption/CardCheckboxOptionApollo";
20
21
  export { InputDate } from "./Form/InputDate/InputDateApollo";
21
22
  export { ItemLabel } from "./Form/ItemLabel/ItemLabelApollo";
22
23
  export { ItemMessage } from "./Form/ItemMessage/ItemMessageApollo";
package/dist/indexLF.d.ts CHANGED
@@ -17,6 +17,7 @@ export { CardCheckbox,
17
17
  /** @deprecated Use `CardCheckbox` instead. */
18
18
  CardCheckbox as CheckboxCard, } from "./Form/Checkbox/CardCheckbox/CardCheckboxLF";
19
19
  export { CheckboxText } from "./Form/Checkbox/CheckboxText/CheckboxTextLF";
20
+ export { CardCheckboxOption } from "./Form/Checkbox/CardCheckboxOption/CardCheckboxOptionLF";
20
21
  export { InputDate,
21
22
  /** @deprecated Use `InputDate` instead. */
22
23
  InputDate as DateInput, } from "./Form/InputDate/InputDateLF";
package/dist/indexLF.js CHANGED
@@ -17,6 +17,7 @@ export { CardCheckbox,
17
17
  /** @deprecated Use `CardCheckbox` instead. */
18
18
  CardCheckbox as CheckboxCard, } from "./Form/Checkbox/CardCheckbox/CardCheckboxLF";
19
19
  export { CheckboxText } from "./Form/Checkbox/CheckboxText/CheckboxTextLF";
20
+ export { CardCheckboxOption } from "./Form/Checkbox/CardCheckboxOption/CardCheckboxOptionLF";
20
21
  export { InputDate,
21
22
  /** @deprecated Use `InputDate` instead. */
22
23
  InputDate as DateInput, } from "./Form/InputDate/InputDateLF";
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.411",
3
+ "version": "1.0.5-alpha.416",
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.411",
50
- "@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.411",
49
+ "@axa-fr/design-system-apollo-css": "1.0.5-alpha.416",
50
+ "@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.416",
51
51
  "@material-symbols/svg-400": ">= 0.19.0",
52
52
  "react": ">= 18"
53
53
  },
@@ -1,15 +0,0 @@
1
- import { type ReactNode } from "react";
2
- import type { CheckboxComponent, IconComponent } from "./types";
3
- export type TCardCheckboxItem = {
4
- label: ReactNode;
5
- subtitle?: ReactNode;
6
- description?: ReactNode;
7
- hasError?: boolean;
8
- icon?: string;
9
- } & Omit<React.InputHTMLAttributes<HTMLInputElement>, "disabled" | "size">;
10
- type CardCheckboxItemProps = {
11
- size: "M" | "L";
12
- errorId: string;
13
- } & TCardCheckboxItem & CheckboxComponent & IconComponent;
14
- export declare const CardCheckboxItem: ({ CheckboxComponent, IconComponent, id, label, description, subtitle, icon, errorId, hasError, size, ...inputProps }: CardCheckboxItemProps) => import("react/jsx-runtime").JSX.Element;
15
- export {};
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useId } from "react";
3
- export const CardCheckboxItem = ({ CheckboxComponent, IconComponent, id, label, description, subtitle, icon, errorId, hasError, size, ...inputProps }) => {
4
- let inputId = useId();
5
- inputId = id ?? inputId;
6
- return (_jsxs("label", { htmlFor: inputId, className: "af-card-checkbox-label", "aria-invalid": hasError, children: [_jsx(CheckboxComponent, { id: inputId, errorId: errorId, hasError: hasError, ...inputProps }), _jsxs("div", { className: "af-card-checkbox-content", children: [icon ? _jsx(IconComponent, { src: icon, size: size }) : null, _jsxs("div", { className: "af-card-checkbox-content-description", children: [_jsx("span", { children: label }), description ? _jsx("span", { children: description }) : null, subtitle ? _jsx("span", { children: subtitle }) : null] })] })] }));
7
- };