@axa-fr/design-system-apollo-react 1.0.5-alpha.250 → 1.0.5-alpha.251
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/checkbox/CheckboxApollo.d.ts +6 -0
- package/dist/Form/checkbox/checkbox/CheckboxApollo.js +6 -0
- package/dist/Form/checkbox/checkbox/CheckboxCommon.d.ts +15 -0
- package/dist/Form/checkbox/checkbox/CheckboxCommon.js +5 -0
- package/dist/Form/checkbox/checkbox/CheckboxLf.d.ts +6 -0
- package/dist/Form/checkbox/checkbox/CheckboxLf.js +6 -0
- package/dist/Form/checkbox/checkboxCard/CheckboxCardApollo.d.ts +6 -0
- package/dist/Form/checkbox/checkboxCard/CheckboxCardApollo.js +7 -0
- package/dist/Form/checkbox/checkboxCard/CheckboxCardCommon.d.ts +29 -0
- package/dist/Form/checkbox/checkboxCard/CheckboxCardCommon.js +16 -0
- package/dist/Form/checkbox/checkboxCard/CheckboxCardLF.d.ts +6 -0
- package/dist/Form/checkbox/checkboxCard/CheckboxCardLF.js +7 -0
- package/dist/Form/checkbox/checkboxText/CheckboxTextApollo.d.ts +6 -0
- package/dist/Form/checkbox/checkboxText/CheckboxTextApollo.js +7 -0
- package/dist/Form/checkbox/checkboxText/CheckboxTextCommon.d.ts +19 -0
- package/dist/Form/checkbox/checkboxText/CheckboxTextCommon.js +10 -0
- package/dist/Form/checkbox/checkboxText/CheckboxTextLF.d.ts +6 -0
- package/dist/Form/checkbox/checkboxText/CheckboxTextLF.js +7 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +3 -0
- package/dist/indexLF.d.ts +3 -0
- package/dist/indexLF.js +3 -0
- package/dist/utilities/constants.d.ts +6 -0
- package/dist/utilities/constants.js +6 -0
- package/dist/utilities/hook/useIsSmallScreen.d.ts +1 -0
- package/dist/utilities/hook/useIsSmallScreen.js +14 -0
- package/package.json +3 -3
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/Checkbox/CheckboxApollo.scss";
|
|
3
|
+
import checkBoxIcon from "@material-symbols/svg-400/outlined/check_small.svg";
|
|
4
|
+
import { CheckboxCommon } from "./CheckboxCommon";
|
|
5
|
+
export const Checkbox = (props) => (_jsx(CheckboxCommon, { ...props, checkBoxIcon: checkBoxIcon }));
|
|
6
|
+
Checkbox.displayName = "Checkbox";
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
type CheckboxIcon = {
|
|
3
|
+
checkBoxIcon: string;
|
|
4
|
+
};
|
|
5
|
+
export type CheckboxProps = React.InputHTMLAttributes<HTMLInputElement> & {
|
|
6
|
+
errorId?: string;
|
|
7
|
+
hasError?: boolean;
|
|
8
|
+
className?: string;
|
|
9
|
+
} & 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;
|
|
14
|
+
};
|
|
15
|
+
export { CheckboxCommon };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
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("span", { className: "af-checkbox__icons", children: _jsx(Svg, { src: checkBoxIcon, className: "af-checkbox__checked", "aria-hidden": true }) })] }));
|
|
4
|
+
CheckboxCommon.displayName = "CheckboxCommon";
|
|
5
|
+
export { CheckboxCommon };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/Checkbox/CheckboxLF.scss";
|
|
3
|
+
import checkBoxIcon from "@material-symbols/svg-400/outlined/check.svg";
|
|
4
|
+
import { CheckboxCommon } from "./CheckboxCommon";
|
|
5
|
+
export const Checkbox = (props) => (_jsx(CheckboxCommon, { ...props, checkBoxIcon: checkBoxIcon }));
|
|
6
|
+
Checkbox.displayName = "Checkbox";
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CheckboxCard/CheckboxCardApollo.scss";
|
|
3
|
+
import { CheckboxCardCommon } from "./CheckboxCardCommon";
|
|
4
|
+
import { Checkbox } from "../checkbox/CheckboxApollo";
|
|
5
|
+
import { Icon } from "../../../Icon/IconApollo";
|
|
6
|
+
export const CheckboxCard = (props) => (_jsx(CheckboxCardCommon, { ...props, IconComponent: Icon, CheckboxComponent: Checkbox }));
|
|
7
|
+
CheckboxCard.displayName = "CheckboxCard";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import React, { type ComponentProps, ComponentPropsWithRef, type ComponentType, type ReactNode } from "react";
|
|
2
|
+
import { CheckboxProps } from "../checkbox/CheckboxCommon";
|
|
3
|
+
import { Icon } from "../../../Icon/IconCommon";
|
|
4
|
+
type CheckboxComponent = {
|
|
5
|
+
CheckboxComponent: ComponentType<CheckboxProps>;
|
|
6
|
+
};
|
|
7
|
+
type IconComponent = {
|
|
8
|
+
IconComponent: ComponentType<ComponentProps<typeof Icon>>;
|
|
9
|
+
};
|
|
10
|
+
export type CheckboxCardProps = ComponentPropsWithRef<"input"> & {
|
|
11
|
+
type: "vertical" | "horizontal";
|
|
12
|
+
labelGroup?: string;
|
|
13
|
+
descriptionGroup?: string;
|
|
14
|
+
isRequired?: boolean;
|
|
15
|
+
options: ({
|
|
16
|
+
label: ReactNode;
|
|
17
|
+
subtitle?: ReactNode;
|
|
18
|
+
description?: ReactNode;
|
|
19
|
+
hasError?: boolean;
|
|
20
|
+
icon?: string;
|
|
21
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, "disabled">)[];
|
|
22
|
+
onChange?: React.ChangeEventHandler;
|
|
23
|
+
};
|
|
24
|
+
export type CheckboxCardCommonProps = CheckboxCardProps & CheckboxComponent & IconComponent;
|
|
25
|
+
declare const CheckboxCardCommon: {
|
|
26
|
+
({ className, labelGroup, descriptionGroup, CheckboxComponent, IconComponent, isRequired, options, onChange, type, }: CheckboxCardCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
displayName: string;
|
|
28
|
+
};
|
|
29
|
+
export { CheckboxCardCommon };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useId, } from "react";
|
|
3
|
+
import { getComponentClassName } from "../../../utilities/getComponentClassName";
|
|
4
|
+
import { useIsSmallScreen } from "../../../utilities/hook/useIsSmallScreen";
|
|
5
|
+
import { BREAKPOINT } from "../../../utilities/constants";
|
|
6
|
+
const CheckboxCardCommon = ({ className, labelGroup, descriptionGroup, CheckboxComponent, IconComponent, isRequired, options, onChange, type = "vertical", }) => {
|
|
7
|
+
const componentClassName = getComponentClassName("af-checkbox-card__container", className);
|
|
8
|
+
const checkboxGroupClassName = getComponentClassName(`af-checkbox-card-group--${type}`, className);
|
|
9
|
+
const optionId = useId();
|
|
10
|
+
const errorId = useId();
|
|
11
|
+
const isMobile = useIsSmallScreen(BREAKPOINT.SM);
|
|
12
|
+
const size = isMobile ? "M" : "L";
|
|
13
|
+
return (_jsxs("div", { className: componentClassName, children: [_jsxs("div", { className: "af-checkbox-card__label-container", children: [labelGroup && (_jsxs("span", { className: "af-checkbox-card__label", id: optionId, children: [labelGroup, isRequired && _jsx("span", { "aria-hidden": true, children: "\u00A0*" })] })), descriptionGroup && (_jsx("span", { className: "af-checkbox-card__description", children: descriptionGroup }))] }), _jsx("div", { role: "group", className: checkboxGroupClassName, children: options.map(({ label, description, subtitle, icon, hasError, ...inputProps }) => (_jsxs("label", { "aria-invalid": hasError, htmlFor: `id-${inputProps.name}`, className: "af-checkbox-card-label", children: [_jsx(CheckboxComponent, { id: `id-${inputProps.name}`, errorId: errorId, hasError: hasError, onChange: onChange, ...inputProps }), _jsxs("div", { className: "af-checkbox-card-content", children: [icon && _jsx(IconComponent, { src: icon, size: size }), _jsxs("div", { className: "af-checkbox-card-content-description", children: [_jsx("span", { children: label }), description && _jsx("span", { children: description }), subtitle && _jsx("span", { children: subtitle })] })] })] }, inputProps.name))) })] }));
|
|
14
|
+
};
|
|
15
|
+
CheckboxCardCommon.displayName = "CheckboxCardCommon";
|
|
16
|
+
export { CheckboxCardCommon };
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CheckboxCard/CheckboxCardLF.scss";
|
|
3
|
+
import { CheckboxCardCommon } from "./CheckboxCardCommon";
|
|
4
|
+
import { Checkbox } from "../checkbox/CheckboxLf";
|
|
5
|
+
import { Icon } from "../../../Icon/IconLF";
|
|
6
|
+
export const CheckboxCard = (props) => (_jsx(CheckboxCardCommon, { ...props, IconComponent: Icon, CheckboxComponent: Checkbox }));
|
|
7
|
+
CheckboxCard.displayName = "CheckboxCard";
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CheckboxText/CheckboxTextApollo.scss";
|
|
3
|
+
import { CheckboxTextCommon } from "./CheckboxTextCommon";
|
|
4
|
+
import { Checkbox } from "../checkbox/CheckboxApollo";
|
|
5
|
+
import { ItemMessage } from "../../ItemMessage/ItemMessageApollo";
|
|
6
|
+
export const CheckboxText = (props) => (_jsx(CheckboxTextCommon, { ...props, CheckboxComponent: Checkbox, ItemMessageComponent: ItemMessage }));
|
|
7
|
+
CheckboxText.displayName = "CheckboxText";
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { ReactNode, type ComponentType, type ComponentProps } from "react";
|
|
2
|
+
import { CheckboxProps } from "../checkbox/CheckboxCommon";
|
|
3
|
+
import { ItemMessage } from "../../ItemMessage/ItemMessageCommon";
|
|
4
|
+
type CheckboxComponent = {
|
|
5
|
+
CheckboxComponent: ComponentType<CheckboxProps>;
|
|
6
|
+
};
|
|
7
|
+
type ItemMessageComponen = {
|
|
8
|
+
ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
|
|
9
|
+
};
|
|
10
|
+
export type CheckboxTextProps = {
|
|
11
|
+
label: string | ReactNode;
|
|
12
|
+
errorMessage?: string;
|
|
13
|
+
} & 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;
|
|
18
|
+
};
|
|
19
|
+
export { CheckboxTextCommon };
|
|
@@ -0,0 +1,10 @@
|
|
|
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 }) => {
|
|
4
|
+
const errorId = useId();
|
|
5
|
+
let inputId = useId();
|
|
6
|
+
inputId = inputProps.id || inputId;
|
|
7
|
+
return (_jsxs("div", { className: "af-checkbox-text", children: [_jsxs("label", { htmlFor: inputId, children: [_jsx(CheckboxComponent, { id: inputId, errorId: errorId, hasError: Boolean(errorMessage), ...inputProps }), _jsx("span", { children: label })] }, inputProps.name), _jsx("div", { className: "af-checkbox-text__error", children: _jsx(ItemMessageComponent, { message: errorMessage }) })] }));
|
|
8
|
+
};
|
|
9
|
+
CheckboxTextCommon.displayName = "CheckboxTextCommon";
|
|
10
|
+
export { CheckboxTextCommon };
|
|
@@ -0,0 +1,6 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import "@axa-fr/design-system-apollo-css/dist/Form/Checkbox/CheckboxText/CheckboxTextLF.scss";
|
|
3
|
+
import { CheckboxTextCommon } from "./CheckboxTextCommon";
|
|
4
|
+
import { Checkbox } from "../checkbox/CheckboxLf";
|
|
5
|
+
import { ItemMessage } from "../../ItemMessage/ItemMessageLF";
|
|
6
|
+
export const CheckboxText = (props) => (_jsx(CheckboxTextCommon, { ...props, CheckboxComponent: Checkbox, ItemMessageComponent: ItemMessage }));
|
|
7
|
+
CheckboxText.displayName = "CheckboxText";
|
package/dist/index.d.ts
CHANGED
|
@@ -26,3 +26,6 @@ export { Stepper } from "./Stepper/StepperApollo";
|
|
|
26
26
|
export { DateInput } from "./Form/DateInput/DateInputApollo";
|
|
27
27
|
export { TimelineVertical } from "./TimelineVertical/TimelineVerticalApollo";
|
|
28
28
|
export { Heading, type HeadingLevel } from "./Heading/HeadingApollo";
|
|
29
|
+
export { Checkbox } from "./Form/checkbox/checkbox/CheckboxApollo";
|
|
30
|
+
export { CheckboxText } from "./Form/checkbox/checkboxText/CheckboxTextApollo";
|
|
31
|
+
export { CheckboxCard } from "./Form/checkbox/checkboxCard/CheckboxCardApollo";
|
package/dist/index.js
CHANGED
|
@@ -26,3 +26,6 @@ export { Stepper } from "./Stepper/StepperApollo";
|
|
|
26
26
|
export { DateInput } from "./Form/DateInput/DateInputApollo";
|
|
27
27
|
export { TimelineVertical } from "./TimelineVertical/TimelineVerticalApollo";
|
|
28
28
|
export { Heading } from "./Heading/HeadingApollo";
|
|
29
|
+
export { Checkbox } from "./Form/checkbox/checkbox/CheckboxApollo";
|
|
30
|
+
export { CheckboxText } from "./Form/checkbox/checkboxText/CheckboxTextApollo";
|
|
31
|
+
export { CheckboxCard } from "./Form/checkbox/checkboxCard/CheckboxCardApollo";
|
package/dist/indexLF.d.ts
CHANGED
|
@@ -25,3 +25,6 @@ export { Stepper } from "./Stepper/StepperLF";
|
|
|
25
25
|
export { DateInput } from "./Form/DateInput/DateInputLF";
|
|
26
26
|
export { TimelineVertical } from "./TimelineVertical/TimelineVerticalLF";
|
|
27
27
|
export { Heading, type HeadingLevel } from "./Heading/HeadingLF";
|
|
28
|
+
export { Checkbox } from "./Form/checkbox/checkbox/CheckboxLf";
|
|
29
|
+
export { CheckboxText } from "./Form/checkbox/checkboxText/CheckboxTextLF";
|
|
30
|
+
export { CheckboxCard } from "./Form/checkbox/checkboxCard/CheckboxCardLF";
|
package/dist/indexLF.js
CHANGED
|
@@ -25,3 +25,6 @@ export { Stepper } from "./Stepper/StepperLF";
|
|
|
25
25
|
export { DateInput } from "./Form/DateInput/DateInputLF";
|
|
26
26
|
export { TimelineVertical } from "./TimelineVertical/TimelineVerticalLF";
|
|
27
27
|
export { Heading } from "./Heading/HeadingLF";
|
|
28
|
+
export { Checkbox } from "./Form/checkbox/checkbox/CheckboxLf";
|
|
29
|
+
export { CheckboxText } from "./Form/checkbox/checkboxText/CheckboxTextLF";
|
|
30
|
+
export { CheckboxCard } from "./Form/checkbox/checkboxCard/CheckboxCardLF";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useIsSmallScreen: (breakPointToCheck: number) => boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { useCallback, useSyncExternalStore } from "react";
|
|
2
|
+
export const useIsSmallScreen = (breakPointToCheck) => {
|
|
3
|
+
const subscribe = useCallback((listener) => {
|
|
4
|
+
window.addEventListener("resize", listener);
|
|
5
|
+
return () => {
|
|
6
|
+
window.removeEventListener("resize", listener);
|
|
7
|
+
};
|
|
8
|
+
}, []);
|
|
9
|
+
const getSnapshot = useCallback(() => {
|
|
10
|
+
return window.innerWidth <= breakPointToCheck;
|
|
11
|
+
}, [breakPointToCheck]);
|
|
12
|
+
const getServerSnapshot = useCallback(() => false, []);
|
|
13
|
+
return useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
14
|
+
};
|
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.251",
|
|
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.251",
|
|
50
|
+
"@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.251",
|
|
51
51
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
52
52
|
"react": ">= 18"
|
|
53
53
|
},
|