@axa-fr/design-system-apollo-react 1.0.5-alpha.286 → 1.0.5-alpha.290
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.
- package/dist/Form/Checkbox/CardCheckbox/CardCheckboxApollo.d.ts +6 -0
- package/dist/Form/Checkbox/{CheckboxCard/CheckboxCardApollo.js → CardCheckbox/CardCheckboxApollo.js} +4 -4
- package/dist/Form/Checkbox/{CheckboxCard/CheckboxCardCommon.d.ts → CardCheckbox/CardCheckboxCommon.d.ts} +6 -6
- package/dist/Form/Checkbox/CardCheckbox/CardCheckboxCommon.js +15 -0
- package/dist/Form/Checkbox/{CheckboxCard/CheckboxCardItem.d.ts → CardCheckbox/CardCheckboxItem.d.ts} +4 -4
- package/dist/Form/Checkbox/{CheckboxCard/CheckboxCardItem.js → CardCheckbox/CardCheckboxItem.js} +2 -2
- package/dist/Form/Checkbox/CardCheckbox/CardCheckboxLF.d.ts +6 -0
- package/dist/Form/Checkbox/{CheckboxCard/CheckboxCardLF.js → CardCheckbox/CardCheckboxLF.js} +4 -4
- package/dist/Form/Checkbox/Checkbox/CheckboxApollo.js +1 -1
- package/dist/Form/Checkbox/Checkbox/CheckboxCommon.js +1 -1
- package/dist/Form/Checkbox/Checkbox/CheckboxLF.js +1 -1
- package/dist/Form/Checkbox/CheckboxText/CheckboxTextCommon.d.ts +1 -1
- package/dist/Form/Checkbox/CheckboxText/CheckboxTextCommon.js +1 -1
- package/dist/Grid/DebugGridApollo.js +2 -2
- package/dist/Grid/DebugGridLF.js +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/indexLF.d.ts +1 -1
- package/dist/indexLF.js +1 -1
- package/package.json +3 -3
- package/dist/Form/Checkbox/CheckboxCard/CheckboxCardApollo.d.ts +0 -6
- package/dist/Form/Checkbox/CheckboxCard/CheckboxCardCommon.js +0 -15
- package/dist/Form/Checkbox/CheckboxCard/CheckboxCardLF.d.ts +0 -6
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CardCheckbox/CardCheckboxApollo.scss";
|
|
2
|
+
import { type CardCheckboxProps } from "./CardCheckboxCommon";
|
|
3
|
+
export declare const CardCheckbox: {
|
|
4
|
+
(props: CardCheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
package/dist/Form/Checkbox/{CheckboxCard/CheckboxCardApollo.js → CardCheckbox/CardCheckboxApollo.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CardCheckbox/CardCheckboxApollo.scss";
|
|
3
3
|
import { Icon } from "../../../Icon/IconApollo";
|
|
4
4
|
import { ItemMessage } from "../../ItemMessage/ItemMessageApollo";
|
|
5
5
|
import { Checkbox } from "../Checkbox/CheckboxApollo";
|
|
6
|
-
import {
|
|
7
|
-
export const
|
|
8
|
-
|
|
6
|
+
import { CardCheckboxCommon, } from "./CardCheckboxCommon";
|
|
7
|
+
export const CardCheckbox = (props) => (_jsx(CardCheckboxCommon, { ...props, IconComponent: Icon, CheckboxComponent: Checkbox, ItemMessageComponent: ItemMessage }));
|
|
8
|
+
CardCheckbox.displayName = "CardCheckbox";
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import React, { ComponentPropsWithRef, type ComponentProps, type ComponentType } from "react";
|
|
2
2
|
import { ItemMessage } from "../../ItemMessage/ItemMessageLF";
|
|
3
|
-
import { type
|
|
3
|
+
import { type TCardCheckboxItem } from "./CardCheckboxItem";
|
|
4
4
|
import type { CheckboxComponent, IconComponent } from "./types";
|
|
5
|
-
export type
|
|
5
|
+
export type CardCheckboxProps = ComponentPropsWithRef<"input"> & {
|
|
6
6
|
type: "vertical" | "horizontal";
|
|
7
7
|
labelGroup?: string;
|
|
8
8
|
descriptionGroup?: string;
|
|
9
9
|
isRequired?: boolean;
|
|
10
|
-
options:
|
|
10
|
+
options: TCardCheckboxItem[];
|
|
11
11
|
onChange?: React.ChangeEventHandler;
|
|
12
12
|
error?: string;
|
|
13
13
|
};
|
|
14
|
-
type
|
|
14
|
+
type CardCheckboxCommonProps = CardCheckboxProps & CheckboxComponent & IconComponent & {
|
|
15
15
|
ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
|
|
16
16
|
};
|
|
17
|
-
export declare const
|
|
18
|
-
({ className, labelGroup, descriptionGroup, CheckboxComponent, IconComponent, isRequired, options, onChange, type, error, ItemMessageComponent, }:
|
|
17
|
+
export declare const CardCheckboxCommon: {
|
|
18
|
+
({ className, labelGroup, descriptionGroup, CheckboxComponent, IconComponent, isRequired, options, onChange, type, error, ItemMessageComponent, }: CardCheckboxCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
19
19
|
displayName: string;
|
|
20
20
|
};
|
|
21
21
|
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
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, }) => {
|
|
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*" })] }), descriptionGroup && (_jsx("p", { className: "af-card-checkbox__description", children: descriptionGroup }))] })), _jsxs("div", { className: "af-card-checkbox__choices", children: [_jsx("ul", { className: checkboxGroupClassName, children: options.map(({ hasError, ...inputProps }) => (_jsx("li", { children: _jsx(CardCheckboxItem, { size: size, errorId: errorId, onChange: onChange, CheckboxComponent: CheckboxComponent, IconComponent: IconComponent, hasError: Boolean(error) || hasError, ...inputProps }) }, crypto.randomUUID()))) }), _jsx(ItemMessageComponent, { id: errorId, message: error, messageType: "error" })] })] }));
|
|
14
|
+
};
|
|
15
|
+
CardCheckboxCommon.displayName = "CardCheckboxCommon";
|
package/dist/Form/Checkbox/{CheckboxCard/CheckboxCardItem.d.ts → CardCheckbox/CardCheckboxItem.d.ts}
RENAMED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { type ReactNode } from "react";
|
|
2
2
|
import type { CheckboxComponent, IconComponent } from "./types";
|
|
3
|
-
export type
|
|
3
|
+
export type TCardCheckboxItem = {
|
|
4
4
|
label: ReactNode;
|
|
5
5
|
subtitle?: ReactNode;
|
|
6
6
|
description?: ReactNode;
|
|
7
7
|
hasError?: boolean;
|
|
8
8
|
icon?: string;
|
|
9
9
|
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "disabled" | "size">;
|
|
10
|
-
type
|
|
10
|
+
type CardCheckboxItemProps = {
|
|
11
11
|
size: "M" | "L";
|
|
12
12
|
errorId: string;
|
|
13
|
-
} &
|
|
14
|
-
export declare const
|
|
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
15
|
export {};
|
package/dist/Form/Checkbox/{CheckboxCard/CheckboxCardItem.js → CardCheckbox/CardCheckboxItem.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useId } from "react";
|
|
3
|
-
export const
|
|
3
|
+
export const CardCheckboxItem = ({ CheckboxComponent, IconComponent, id, label, description, subtitle, icon, errorId, hasError, size, ...inputProps }) => {
|
|
4
4
|
let inputId = useId();
|
|
5
5
|
inputId = id ?? inputId;
|
|
6
|
-
return (_jsxs("label", { htmlFor: inputId, className: "af-checkbox-
|
|
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 }), _jsxs("div", { className: "af-card-checkbox-content-description", children: [_jsx("span", { children: label }), description && _jsx("span", { children: description }), subtitle && _jsx("span", { children: subtitle })] })] })] }));
|
|
7
7
|
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CardCheckbox/CardCheckboxLF.scss";
|
|
2
|
+
import { type CardCheckboxProps } from "./CardCheckboxCommon";
|
|
3
|
+
export declare const CardCheckbox: {
|
|
4
|
+
(props: CardCheckboxProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
package/dist/Form/Checkbox/{CheckboxCard/CheckboxCardLF.js → CardCheckbox/CardCheckboxLF.js}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CardCheckbox/CardCheckboxLF.scss";
|
|
3
3
|
import { Icon } from "../../../Icon/IconLF";
|
|
4
4
|
import { ItemMessage } from "../../ItemMessage/ItemMessageLF";
|
|
5
5
|
import { Checkbox } from "../Checkbox/CheckboxLF";
|
|
6
|
-
import {
|
|
7
|
-
export const
|
|
8
|
-
|
|
6
|
+
import { CardCheckboxCommon, } from "./CardCheckboxCommon";
|
|
7
|
+
export const CardCheckbox = (props) => (_jsx(CardCheckboxCommon, { ...props, IconComponent: Icon, CheckboxComponent: Checkbox, ItemMessageComponent: ItemMessage }));
|
|
8
|
+
CardCheckbox.displayName = "CardCheckbox";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/Checkbox/CheckboxApollo.scss";
|
|
3
|
-
import checkBoxIcon from "@material-symbols/svg-400/
|
|
3
|
+
import checkBoxIcon from "@material-symbols/svg-400/rounded/check_small.svg";
|
|
4
4
|
import { CheckboxCommon } from "./CheckboxCommon";
|
|
5
5
|
export const Checkbox = (props) => (_jsx(CheckboxCommon, { ...props, checkBoxIcon: checkBoxIcon }));
|
|
6
6
|
Checkbox.displayName = "Checkbox";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Svg } from "../../../Svg/Svg";
|
|
3
|
-
const CheckboxCommon = ({ errorId, checkBoxIcon, hasError, ...inputProps }) => (_jsxs("span", { className: "af-checkbox", children: [_jsx("input", { ...inputProps, type: "checkbox", "aria-errormessage": errorId, "aria-invalid": hasError, disabled: false }), _jsx(
|
|
3
|
+
const CheckboxCommon = ({ errorId, checkBoxIcon, hasError, ...inputProps }) => (_jsxs("span", { className: "af-checkbox", children: [_jsx("input", { ...inputProps, type: "checkbox", "aria-errormessage": errorId, "aria-invalid": hasError, disabled: false }), _jsx(Svg, { src: checkBoxIcon, "aria-hidden": true })] }));
|
|
4
4
|
CheckboxCommon.displayName = "CheckboxCommon";
|
|
5
5
|
export { CheckboxCommon };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/Checkbox/CheckboxLF.scss";
|
|
3
|
-
import checkBoxIcon from "@material-symbols/svg-400/
|
|
3
|
+
import checkBoxIcon from "@material-symbols/svg-400/rounded/check.svg";
|
|
4
4
|
import { CheckboxCommon } from "./CheckboxCommon";
|
|
5
5
|
export const Checkbox = (props) => (_jsx(CheckboxCommon, { ...props, checkBoxIcon: checkBoxIcon }));
|
|
6
6
|
Checkbox.displayName = "Checkbox";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode, type ComponentProps, type ComponentType } from "react";
|
|
1
|
+
import React, { type ReactNode, type ComponentProps, type ComponentType } from "react";
|
|
2
2
|
import { ItemMessage } from "../../ItemMessage/ItemMessageCommon";
|
|
3
3
|
import { CheckboxProps } from "../Checkbox/CheckboxCommon";
|
|
4
4
|
type CheckboxComponent = {
|
|
@@ -4,7 +4,7 @@ const CheckboxTextCommon = ({ label, errorMessage, CheckboxComponent, ItemMessag
|
|
|
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: [
|
|
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
8
|
};
|
|
9
9
|
CheckboxTextCommon.displayName = "CheckboxTextCommon";
|
|
10
10
|
export { CheckboxTextCommon };
|
|
@@ -1,12 +1,12 @@
|
|
|
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
3
|
import { useState } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { CardCheckbox } from "../Form/Checkbox/CardCheckbox/CardCheckboxApollo";
|
|
5
5
|
import { DebugGridCommon } from "./DebugGridCommon";
|
|
6
6
|
export const DebugGrid = ({ cols = 12, isCheckedByDefault = false, }) => {
|
|
7
7
|
const [checked, setChecked] = useState(isCheckedByDefault);
|
|
8
8
|
const handleChecked = () => setChecked(!checked);
|
|
9
|
-
return (_jsxs(_Fragment, { children: [_jsx(
|
|
9
|
+
return (_jsxs(_Fragment, { children: [_jsx(CardCheckbox, { type: "horizontal", options: [
|
|
10
10
|
{
|
|
11
11
|
name: "debuggrid",
|
|
12
12
|
label: "Grid",
|
package/dist/Grid/DebugGridLF.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
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
3
|
import { useState } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { CardCheckbox } from "../Form/Checkbox/CardCheckbox/CardCheckboxLF";
|
|
5
5
|
import { DebugGridCommon } from "./DebugGridCommon";
|
|
6
6
|
export const DebugGrid = ({ cols = 12, isCheckedByDefault = false, }) => {
|
|
7
7
|
const [checked, setChecked] = useState(isCheckedByDefault);
|
|
8
8
|
const handleChecked = () => setChecked(!checked);
|
|
9
|
-
return (_jsxs(_Fragment, { children: [_jsx(
|
|
9
|
+
return (_jsxs(_Fragment, { children: [_jsx(CardCheckbox, { type: "horizontal", options: [
|
|
10
10
|
{
|
|
11
11
|
name: "debuggrid",
|
|
12
12
|
label: "Grid",
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { ClickIcon } from "./ClickIcon/ClickIconApollo";
|
|
|
9
9
|
export { ContentItemMono } from "./ContentItemMono/ContentItemMonoApollo";
|
|
10
10
|
export { Divider } from "./Divider/DividerApollo";
|
|
11
11
|
export { Checkbox } from "./Form/Checkbox/Checkbox/CheckboxApollo";
|
|
12
|
-
export { CheckboxCard } from "./Form/Checkbox/
|
|
12
|
+
export { CardCheckbox, CardCheckbox as CheckboxCard, } from "./Form/Checkbox/CardCheckbox/CardCheckboxApollo";
|
|
13
13
|
export { CheckboxText } from "./Form/Checkbox/CheckboxText/CheckboxTextApollo";
|
|
14
14
|
export { InputDate } from "./Form/InputDate/InputDateApollo";
|
|
15
15
|
export { ItemLabel } from "./Form/ItemLabel/ItemLabelApollo";
|
package/dist/index.js
CHANGED
|
@@ -9,7 +9,7 @@ export { ClickIcon } from "./ClickIcon/ClickIconApollo";
|
|
|
9
9
|
export { ContentItemMono } from "./ContentItemMono/ContentItemMonoApollo";
|
|
10
10
|
export { Divider } from "./Divider/DividerApollo";
|
|
11
11
|
export { Checkbox } from "./Form/Checkbox/Checkbox/CheckboxApollo";
|
|
12
|
-
export { CheckboxCard } from "./Form/Checkbox/
|
|
12
|
+
export { CardCheckbox, CardCheckbox as CheckboxCard, } from "./Form/Checkbox/CardCheckbox/CardCheckboxApollo";
|
|
13
13
|
export { CheckboxText } from "./Form/Checkbox/CheckboxText/CheckboxTextApollo";
|
|
14
14
|
export { InputDate } from "./Form/InputDate/InputDateApollo";
|
|
15
15
|
export { ItemLabel } from "./Form/ItemLabel/ItemLabelApollo";
|
package/dist/indexLF.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export { ClickIcon } from "./ClickIcon/ClickIconLF";
|
|
|
8
8
|
export { ContentItemMono } from "./ContentItemMono/ContentItemMonoLF";
|
|
9
9
|
export { Divider } from "./Divider/DividerLF";
|
|
10
10
|
export { Checkbox } from "./Form/Checkbox/Checkbox/CheckboxLF";
|
|
11
|
-
export { CheckboxCard } from "./Form/Checkbox/
|
|
11
|
+
export { CardCheckbox, CardCheckbox as CheckboxCard, } from "./Form/Checkbox/CardCheckbox/CardCheckboxLF";
|
|
12
12
|
export { CheckboxText } from "./Form/Checkbox/CheckboxText/CheckboxTextLF";
|
|
13
13
|
export { InputDate, InputDate as DateInput, } from "./Form/InputDate/InputDateLF";
|
|
14
14
|
export { ItemLabel } from "./Form/ItemLabel/ItemLabelLF";
|
package/dist/indexLF.js
CHANGED
|
@@ -8,7 +8,7 @@ export { ClickIcon } from "./ClickIcon/ClickIconLF";
|
|
|
8
8
|
export { ContentItemMono } from "./ContentItemMono/ContentItemMonoLF";
|
|
9
9
|
export { Divider } from "./Divider/DividerLF";
|
|
10
10
|
export { Checkbox } from "./Form/Checkbox/Checkbox/CheckboxLF";
|
|
11
|
-
export { CheckboxCard } from "./Form/Checkbox/
|
|
11
|
+
export { CardCheckbox, CardCheckbox as CheckboxCard, } from "./Form/Checkbox/CardCheckbox/CardCheckboxLF";
|
|
12
12
|
export { CheckboxText } from "./Form/Checkbox/CheckboxText/CheckboxTextLF";
|
|
13
13
|
export { InputDate, InputDate as DateInput, } from "./Form/InputDate/InputDateLF";
|
|
14
14
|
export { ItemLabel } from "./Form/ItemLabel/ItemLabelLF";
|
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.
|
|
3
|
+
"version": "1.0.5-alpha.290",
|
|
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.
|
|
50
|
-
"@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.
|
|
49
|
+
"@axa-fr/design-system-apollo-css": "1.0.5-alpha.290",
|
|
50
|
+
"@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.290",
|
|
51
51
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
52
52
|
"react": ">= 18"
|
|
53
53
|
},
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CheckboxCard/CheckboxCardApollo.scss";
|
|
2
|
-
import { CheckboxCardProps } from "./CheckboxCardCommon";
|
|
3
|
-
export declare const CheckboxCard: {
|
|
4
|
-
(props: CheckboxCardProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
displayName: string;
|
|
6
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
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 { CheckboxCardItem } from "./CheckboxCardItem";
|
|
7
|
-
export const CheckboxCardCommon = ({ className, labelGroup, descriptionGroup, CheckboxComponent, IconComponent, isRequired, options, onChange, type = "vertical", error, ItemMessageComponent, }) => {
|
|
8
|
-
const componentClassName = getComponentClassName("af-checkbox-card__container", className);
|
|
9
|
-
const checkboxGroupClassName = getComponentClassName("af-checkbox-card-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: [_jsx("div", { className: "af-checkbox-card__label-container", children: labelGroup && (_jsxs("legend", { className: "af-checkbox-card__legend", children: [labelGroup, isRequired && _jsx("span", { "aria-hidden": true, children: "\u00A0*" }), descriptionGroup && (_jsx("p", { className: "af-checkbox-card__description", children: descriptionGroup }))] })) }), _jsxs("div", { className: "af-checkbox-card__choices", children: [_jsx("ul", { className: checkboxGroupClassName, children: options.map(({ hasError, ...inputProps }) => (_jsx("li", { children: _jsx(CheckboxCardItem, { size: size, errorId: errorId, onChange: onChange, CheckboxComponent: CheckboxComponent, IconComponent: IconComponent, hasError: Boolean(error) || hasError, ...inputProps }) }, crypto.randomUUID()))) }), error && (_jsx(ItemMessageComponent, { id: errorId, message: error, messageType: "error" }))] })] }));
|
|
14
|
-
};
|
|
15
|
-
CheckboxCardCommon.displayName = "CheckboxCardCommon";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CheckboxCard/CheckboxCardLF.scss";
|
|
2
|
-
import { CheckboxCardProps } from "./CheckboxCardCommon";
|
|
3
|
-
export declare const CheckboxCard: {
|
|
4
|
-
(props: CheckboxCardProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
displayName: string;
|
|
6
|
-
};
|