@axa-fr/canopee-react 1.4.2-alpha.10 → 1.4.2-alpha.13
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/client.d.ts +1 -0
- package/dist/client.js +1 -0
- package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxApollo.js +2 -1
- package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxCommon.d.ts +4 -1
- package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxCommon.js +3 -2
- package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxLF.js +2 -1
- package/dist/prospect-client/Loader/LoaderApollo.d.ts +7 -0
- package/dist/prospect-client/Loader/LoaderApollo.js +7 -0
- package/dist/prospect-client/Loader/LoaderCommon.d.ts +13 -0
- package/dist/prospect-client/Loader/LoaderCommon.js +14 -0
- package/dist/prospect-client/Loader/LoaderLF.d.ts +7 -0
- package/dist/prospect-client/Loader/LoaderLF.js +7 -0
- package/dist/prospect.d.ts +1 -0
- package/dist/prospect.js +1 -0
- package/package.json +2 -2
package/dist/client.d.ts
CHANGED
|
@@ -74,3 +74,4 @@ export { FormLayout, type FormLayoutProps, } from "./prospect-client/Layout/Form
|
|
|
74
74
|
export { ValidPage, type ValidPageProps, } from "./prospect-client/pages/ValidPage/ValidPageLF";
|
|
75
75
|
export { ErrorPage, type ErrorPageProps, } from "./prospect-client/pages/ErrorPage/ErrorPageLF";
|
|
76
76
|
export type { GridContainerProps } from "./prospect-client/utilities/types/GridContainerProps";
|
|
77
|
+
export { Loader, type LoaderProps } from "./prospect-client/Loader/LoaderLF";
|
package/dist/client.js
CHANGED
|
@@ -73,3 +73,4 @@ export { ExitLayout, } from "./prospect-client/Layout/ExitLayout/ExitLayoutLF";
|
|
|
73
73
|
export { FormLayout, } from "./prospect-client/Layout/FormLayout/FormLayout";
|
|
74
74
|
export { ValidPage, } from "./prospect-client/pages/ValidPage/ValidPageLF";
|
|
75
75
|
export { ErrorPage, } from "./prospect-client/pages/ErrorPage/ErrorPageLF";
|
|
76
|
+
export { Loader } from "./prospect-client/Loader/LoaderLF";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ItemMessage } from "../../ItemMessage/ItemMessageApollo";
|
|
3
3
|
import { CardCheckboxOption } from "../CardCheckboxOption/CardCheckboxOptionApollo";
|
|
4
|
+
import { CheckboxText } from "../CheckboxText/CheckboxTextApollo";
|
|
4
5
|
import { CardCheckboxCommon, } from "./CardCheckboxCommon";
|
|
5
6
|
import "@axa-fr/canopee-css/prospect/Form/Checkbox/CardCheckbox/CardCheckboxApollo.css";
|
|
6
|
-
export const CardCheckbox = (props) => (_jsx(CardCheckboxCommon, { ...props, CardCheckboxItemComponent: CardCheckboxOption, ItemMessageComponent: ItemMessage }));
|
|
7
|
+
export const CardCheckbox = (props) => (_jsx(CardCheckboxCommon, { ...props, CardCheckboxItemComponent: CardCheckboxOption, CheckboxTextComponent: CheckboxText, ItemMessageComponent: ItemMessage }));
|
|
7
8
|
CardCheckbox.displayName = "CardCheckbox";
|
|
@@ -2,9 +2,11 @@ import { type ComponentType, type ReactNode } from "react";
|
|
|
2
2
|
import type { GridContainerProps } from "../../../utilities/types/GridContainerProps";
|
|
3
3
|
import type { ItemMessageProps } from "../../ItemMessage/ItemMessageCommon";
|
|
4
4
|
import type { CardCheckboxOptionProps } from "../CardCheckboxOption/CardCheckboxOptionCommon";
|
|
5
|
+
import type { CheckboxTextProps } from "../CheckboxText/CheckboxTextCommon";
|
|
5
6
|
type CheckboxOption = Omit<CardCheckboxOptionProps, "name" | "type">;
|
|
6
7
|
export type CardCheckboxProps = Omit<CardCheckboxOptionProps, "value" | "label" | "type" | "icon" | "description" | "subtitle" | "children"> & {
|
|
7
8
|
type?: "vertical" | "horizontal";
|
|
9
|
+
mode?: "text";
|
|
8
10
|
/**
|
|
9
11
|
* @deprecated Use `label` instead.
|
|
10
12
|
*/
|
|
@@ -27,11 +29,12 @@ export type CardCheckboxProps = Omit<CardCheckboxOptionProps, "value" | "label"
|
|
|
27
29
|
containerProps?: GridContainerProps<"fieldset">;
|
|
28
30
|
} & Partial<ItemMessageProps>;
|
|
29
31
|
type CardCheckboxCommonProps = CardCheckboxProps & {
|
|
32
|
+
CheckboxTextComponent: ComponentType<CheckboxTextProps>;
|
|
30
33
|
CardCheckboxItemComponent: ComponentType<CardCheckboxOptionProps>;
|
|
31
34
|
ItemMessageComponent: ComponentType<ItemMessageProps>;
|
|
32
35
|
};
|
|
33
36
|
export declare const CardCheckboxCommon: {
|
|
34
|
-
({ className, labelGroup, descriptionGroup, label, description, isRequired, required, options, type, error, name, id, onChange, CardCheckboxItemComponent, ItemMessageComponent, message, messageType, containerProps, ...inputProps }: CardCheckboxCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
+
({ className, labelGroup, descriptionGroup, label, description, isRequired, required, options, type, error, name, id, onChange, CardCheckboxItemComponent, CheckboxTextComponent, ItemMessageComponent, message, messageType, containerProps, mode, ...inputProps }: CardCheckboxCommonProps): import("react/jsx-runtime").JSX.Element;
|
|
35
38
|
displayName: string;
|
|
36
39
|
};
|
|
37
40
|
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
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, message, messageType = "error", containerProps, ...inputProps }) => {
|
|
3
|
+
export const CardCheckboxCommon = ({ className, labelGroup, descriptionGroup, label, description, isRequired, required, options, type = "vertical", error, name, id, onChange = () => { }, CardCheckboxItemComponent, CheckboxTextComponent, ItemMessageComponent, message, messageType = "error", containerProps, mode, ...inputProps }) => {
|
|
4
4
|
const generatedId = useId();
|
|
5
5
|
const cardCheckboxId = id || generatedId;
|
|
6
6
|
const messageId = `${cardCheckboxId}-error`;
|
|
7
|
+
const CheckboxItemComponent = mode === "text" ? CheckboxTextComponent : CardCheckboxItemComponent;
|
|
7
8
|
const cardCheckboxOptionsRef = useRef(null);
|
|
8
9
|
const handleChange = (event) => {
|
|
9
10
|
const cardCheckboxOptionsEl = cardCheckboxOptionsRef.current;
|
|
@@ -26,6 +27,6 @@ export const CardCheckboxCommon = ({ className, labelGroup, descriptionGroup, la
|
|
|
26
27
|
return (_jsxs("fieldset", { className: ["af-card-checkbox", className].filter(Boolean).join(" "), id: cardCheckboxId, ...containerProps, 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: [
|
|
27
28
|
"af-card-checkbox__options",
|
|
28
29
|
`af-card-checkbox__options--${type}`,
|
|
29
|
-
].join(" "), ref: cardCheckboxOptionsRef, children: options.map((cardCheckboxItemProps) => (_jsx(
|
|
30
|
+
].join(" "), ref: cardCheckboxOptionsRef, children: options.map((cardCheckboxItemProps) => (_jsx(CheckboxItemComponent, { id: `${cardCheckboxId}-${cardCheckboxItemProps.value}`, required: required, onChange: handleChange, ...inputProps, ...cardCheckboxItemProps, type: type, "aria-invalid": hasError || undefined, "aria-errormessage": hasError ? messageId : undefined, name: name }, `${name ?? cardCheckboxId}-${cardCheckboxItemProps.label}`))) }), _jsx(ItemMessageComponent, { id: messageId, message: message || error, messageType: messageType })] }));
|
|
30
31
|
};
|
|
31
32
|
CardCheckboxCommon.displayName = "CardCheckboxCommon";
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { ItemMessage } from "../../ItemMessage/ItemMessageLF";
|
|
3
3
|
import { CardCheckboxOption } from "../CardCheckboxOption/CardCheckboxOptionLF";
|
|
4
|
+
import { CheckboxText } from "../CheckboxText/CheckboxTextLF";
|
|
4
5
|
import { CardCheckboxCommon, } from "./CardCheckboxCommon";
|
|
5
6
|
import "@axa-fr/canopee-css/client/Form/Checkbox/CardCheckbox/CardCheckboxLF.css";
|
|
6
|
-
export const CardCheckbox = (props) => (_jsx(CardCheckboxCommon, { ...props, CardCheckboxItemComponent: CardCheckboxOption, ItemMessageComponent: ItemMessage }));
|
|
7
|
+
export const CardCheckbox = (props) => (_jsx(CardCheckboxCommon, { ...props, CardCheckboxItemComponent: CardCheckboxOption, CheckboxTextComponent: CheckboxText, ItemMessageComponent: ItemMessage }));
|
|
7
8
|
CardCheckbox.displayName = "CardCheckbox";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type LoaderProps } from "./LoaderCommon";
|
|
2
|
+
import "@axa-fr/canopee-css/prospect/Loader/LoaderApollo.css";
|
|
3
|
+
export { type LoaderProps } from "./LoaderCommon";
|
|
4
|
+
export declare const Loader: {
|
|
5
|
+
(props: LoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { LoaderCommon } from "./LoaderCommon";
|
|
3
|
+
import { Spinner } from "../Spinner/SpinnerApollo";
|
|
4
|
+
import "@axa-fr/canopee-css/prospect/Loader/LoaderApollo.css";
|
|
5
|
+
export {} from "./LoaderCommon";
|
|
6
|
+
export const Loader = (props) => (_jsx(LoaderCommon, { ...props, SpinnerComponent: Spinner }));
|
|
7
|
+
Loader.displayName = "Loader";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ComponentType, type ElementType } from "react";
|
|
2
|
+
import { type SpinnerProps } from "../Spinner/SpinnerCommon";
|
|
3
|
+
import type { PolymorphicComponent } from "../utilities/types/PolymorphicComponent";
|
|
4
|
+
export type LoaderProps = {
|
|
5
|
+
isDialog?: boolean;
|
|
6
|
+
title: string;
|
|
7
|
+
subtitle?: string;
|
|
8
|
+
spinnerProps?: SpinnerProps;
|
|
9
|
+
};
|
|
10
|
+
export type LoaderCommonProps<T extends ElementType> = PolymorphicComponent<T, LoaderProps> & {
|
|
11
|
+
SpinnerComponent: ComponentType<SpinnerProps>;
|
|
12
|
+
};
|
|
13
|
+
export declare const LoaderCommon: import("react").ForwardRefExoticComponent<Omit<LoaderCommonProps<ElementType>, "ref"> & import("react").RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef, useId } from "react";
|
|
3
|
+
import { getClassName } from "../utilities/getClassName";
|
|
4
|
+
import {} from "../Spinner/SpinnerCommon";
|
|
5
|
+
export const LoaderCommon = forwardRef(({ title, subtitle, SpinnerComponent, spinnerProps, className, isDialog, ...rest }, ref) => {
|
|
6
|
+
const baseClassName = "af-loader";
|
|
7
|
+
const titleId = useId();
|
|
8
|
+
const Component = (isDialog && "dialog") || "article";
|
|
9
|
+
return (_jsxs(Component, { ref: ref, className: getClassName({
|
|
10
|
+
baseClassName,
|
|
11
|
+
className,
|
|
12
|
+
}), "aria-labelledby": titleId, ...rest, children: [_jsx(SpinnerComponent, { ...spinnerProps }), _jsxs("div", { className: `${baseClassName}__content`, children: [_jsx("span", { id: titleId, className: `${baseClassName}__title`, children: title }), subtitle ? (_jsx("span", { className: `${baseClassName}__subtitle`, children: subtitle })) : null] })] }));
|
|
13
|
+
});
|
|
14
|
+
LoaderCommon.displayName = "LoaderCommon";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type LoaderProps } from "./LoaderCommon";
|
|
2
|
+
import "@axa-fr/canopee-css/client/Loader/LoaderLF.css";
|
|
3
|
+
export { type LoaderProps } from "./LoaderCommon";
|
|
4
|
+
export declare const Loader: {
|
|
5
|
+
(props: LoaderProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
displayName: string;
|
|
7
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { LoaderCommon } from "./LoaderCommon";
|
|
3
|
+
import { Spinner } from "../Spinner/SpinnerLF";
|
|
4
|
+
import "@axa-fr/canopee-css/client/Loader/LoaderLF.css";
|
|
5
|
+
export {} from "./LoaderCommon";
|
|
6
|
+
export const Loader = (props) => (_jsx(LoaderCommon, { ...props, SpinnerComponent: Spinner }));
|
|
7
|
+
Loader.displayName = "Loader";
|
package/dist/prospect.d.ts
CHANGED
|
@@ -70,3 +70,4 @@ export { FormLayout, type FormLayoutProps, } from "./prospect-client/Layout/Form
|
|
|
70
70
|
export { ValidPage, type ValidPageProps, } from "./prospect-client/pages/ValidPage/ValidPageApollo";
|
|
71
71
|
export { ErrorPage, type ErrorPageProps, } from "./prospect-client/pages/ErrorPage/ErrorPageApollo";
|
|
72
72
|
export type { GridContainerProps } from "./prospect-client/utilities/types/GridContainerProps";
|
|
73
|
+
export { Loader, type LoaderProps, } from "./prospect-client/Loader/LoaderApollo";
|
package/dist/prospect.js
CHANGED
|
@@ -69,3 +69,4 @@ export { ExitLayout, } from "./prospect-client/Layout/ExitLayout/ExitLayoutApoll
|
|
|
69
69
|
export { FormLayout, } from "./prospect-client/Layout/FormLayout/FormLayout";
|
|
70
70
|
export { ValidPage, } from "./prospect-client/pages/ValidPage/ValidPageApollo";
|
|
71
71
|
export { ErrorPage, } from "./prospect-client/pages/ErrorPage/ErrorPageApollo";
|
|
72
|
+
export { Loader, } from "./prospect-client/Loader/LoaderApollo";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/canopee-react",
|
|
3
|
-
"version": "1.4.2-alpha.
|
|
3
|
+
"version": "1.4.2-alpha.13",
|
|
4
4
|
"description": "Package React - Design System Canopée",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./distributeur": {
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
},
|
|
50
50
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@axa-fr/canopee-css": "1.4.2-alpha.
|
|
52
|
+
"@axa-fr/canopee-css": "1.4.2-alpha.13",
|
|
53
53
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
54
54
|
"@material-symbols/svg-700": ">= 0.19.0",
|
|
55
55
|
"react": ">= 18"
|