@axa-fr/canopee-react 1.4.2-alpha.3 → 1.4.2-alpha.36
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/distributeur/Tabs/components/Tab.d.ts +4 -1
- package/dist/distributeur/Tabs/components/Tab.js +1 -2
- package/dist/distributeur/Tabs/components/TabsCore.d.ts +3 -4
- package/dist/distributeur/Tabs/components/TabsCore.js +15 -12
- package/dist/distributeur/Tabs/components/TabsStateless.d.ts +12 -8
- package/dist/distributeur/Tabs/components/TabsStateless.js +48 -6
- 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/List/ContentItemDuo/ContentItemDuoApollo.js +2 -1
- package/dist/prospect-client/List/ContentItemDuo/ContentItemDuoCommon.d.ts +4 -2
- package/dist/prospect-client/List/ContentItemDuo/ContentItemDuoCommon.js +3 -2
- package/dist/prospect-client/List/ContentItemDuo/ContentItemDuoLF.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-client/Stepper/StepperCommon.d.ts +1 -1
- package/dist/prospect.d.ts +1 -0
- package/dist/prospect.js +1 -0
- package/package.json +2 -2
- package/dist/distributeur/Tabs/components/Title.d.ts +0 -15
- package/dist/distributeur/Tabs/components/Title.js +0 -14
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";
|
|
@@ -4,7 +4,10 @@ export type TabProps = {
|
|
|
4
4
|
title: ReactNode;
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Use className instead
|
|
9
|
+
*/
|
|
7
10
|
classModifier?: string;
|
|
8
11
|
};
|
|
9
|
-
declare const Tab: () =>
|
|
12
|
+
declare const Tab: () => null;
|
|
10
13
|
export { Tab };
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type FormEvent } from "react";
|
|
2
2
|
import { type TabsStatelessProps } from "./TabsStateless";
|
|
3
3
|
type Tabs = {
|
|
4
|
-
onChange?: (event:
|
|
4
|
+
onChange?: (event: FormEvent<HTMLButtonElement>) => void;
|
|
5
5
|
activeIndex?: string;
|
|
6
6
|
};
|
|
7
7
|
export type TabsCoreProps = Tabs & Omit<TabsStatelessProps, "activeIndex">;
|
|
8
|
-
|
|
9
|
-
declare const TabsCore: React.FunctionComponent<TabsCoreProps>;
|
|
8
|
+
declare const TabsCore: ({ activeIndex: activeIndexProp, onChange, ...otherProps }: TabsCoreProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
9
|
export { TabsCore };
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
3
|
import { TabsStateless } from "./TabsStateless";
|
|
4
4
|
const DEFAULT_ACTIVE_INDEX = "0";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
5
|
+
const TabsCore = ({ activeIndex: activeIndexProp = DEFAULT_ACTIVE_INDEX, onChange, ...otherProps }) => {
|
|
6
|
+
const [activeIndex, setActiveIndex] = useState(Number(activeIndexProp));
|
|
7
|
+
// Allow to update activeIndex from props
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
setActiveIndex(Number(activeIndexProp));
|
|
10
|
+
}, [activeIndexProp]);
|
|
11
|
+
return (_jsx(TabsStateless, { activeIndex: activeIndex, ...otherProps, onChange: (e, index) => {
|
|
12
|
+
if (onChange) {
|
|
13
|
+
onChange(e);
|
|
14
|
+
}
|
|
15
|
+
if (index >= 0) {
|
|
16
|
+
setActiveIndex(index);
|
|
17
|
+
}
|
|
18
|
+
} }));
|
|
16
19
|
};
|
|
17
20
|
export { TabsCore };
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { type FormEvent, type ReactElement } from "react";
|
|
2
|
+
import type { TabProps } from "./Tab";
|
|
3
|
+
export type TabsStatelessProps = {
|
|
4
|
+
children: ReactElement<TabProps> | ReactElement<TabProps>[];
|
|
5
|
+
activeIndex: number;
|
|
5
6
|
className?: string;
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Use `className` instead
|
|
9
|
+
*/
|
|
6
10
|
classModifier?: string;
|
|
7
|
-
}
|
|
8
|
-
export
|
|
9
|
-
onChange: (event:
|
|
10
|
-
}
|
|
11
|
+
};
|
|
12
|
+
export type TabsStatelessHandlers = {
|
|
13
|
+
onChange: (event: FormEvent<HTMLButtonElement>, index: number) => void;
|
|
14
|
+
};
|
|
11
15
|
type Props = TabsStatelessProps & TabsStatelessHandlers;
|
|
12
16
|
declare const TabsStateless: ({ activeIndex, className, classModifier, children, onChange, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
13
17
|
export { TabsStateless };
|
|
@@ -1,11 +1,53 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
/* eslint-disable react/no-array-index-key */
|
|
3
|
-
import { Children, isValidElement, } from "react";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { Children, isValidElement, useId, useRef, } from "react";
|
|
4
|
+
import { getClassName } from "../../utilities/helpers/getClassName";
|
|
5
|
+
function handleKeyDown(event, moveToTab, index, totalNumberOfTabs) {
|
|
6
|
+
let targetIndex = null;
|
|
7
|
+
if (event.key === "ArrowLeft") {
|
|
8
|
+
targetIndex = index - 1;
|
|
9
|
+
}
|
|
10
|
+
else if (event.key === "ArrowRight") {
|
|
11
|
+
targetIndex = index + 1;
|
|
12
|
+
}
|
|
13
|
+
else if (event.key === "Home") {
|
|
14
|
+
targetIndex = 0;
|
|
15
|
+
}
|
|
16
|
+
else if (event.key === "End") {
|
|
17
|
+
targetIndex = totalNumberOfTabs - 1;
|
|
18
|
+
}
|
|
19
|
+
if (targetIndex !== null) {
|
|
20
|
+
moveToTab(event, targetIndex);
|
|
21
|
+
event.preventDefault();
|
|
22
|
+
event.stopPropagation();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
7
25
|
const TabsStateless = ({ activeIndex, className = "af-tabs", classModifier, children, onChange, }) => {
|
|
8
|
-
const componentClassName =
|
|
9
|
-
|
|
26
|
+
const componentClassName = getClassName({
|
|
27
|
+
baseClassName: "af-tabs",
|
|
28
|
+
className,
|
|
29
|
+
modifiers: classModifier?.split(" "),
|
|
30
|
+
});
|
|
31
|
+
const tabRefs = useRef([]);
|
|
32
|
+
const moveToTab = (event, index) => {
|
|
33
|
+
if (index < 0 || index >= Children.count(children)) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
tabRefs.current[index]?.focus();
|
|
37
|
+
onChange(event, index);
|
|
38
|
+
};
|
|
39
|
+
const id = useId();
|
|
40
|
+
return (_jsxs("div", { className: componentClassName, role: "tablist", children: [_jsx("ul", { className: "af-tabs__control", children: Children.map(children, (child, index) => isValidElement(child) && (_jsx("li", { className: getClassName({
|
|
41
|
+
className,
|
|
42
|
+
modifiers: [activeIndex === index && "active"],
|
|
43
|
+
baseClassName: "af-tabs__item",
|
|
44
|
+
}), children: _jsx("button", { type: "button", id: `${id}-tab-${index}`, ref: (el) => {
|
|
45
|
+
tabRefs.current[index] = el;
|
|
46
|
+
}, "aria-controls": `${id}-pane-${index}`, onChange: (event) => onChange(event, index), onKeyDown: (event) => {
|
|
47
|
+
handleKeyDown(event, moveToTab, index, Children.count(children));
|
|
48
|
+
}, className: "af-tabs__link", onClick: (event) => onChange(event, index), tabIndex: activeIndex === index ? 0 : -1, children: child.props.title }) }))) }), _jsx("div", { className: "af-tabs__content", children: Children.map(children, (child, index) => isValidElement(child) && (_jsx("div", { id: `${id}-pane-${index}`, "aria-labelledby": `${id}-tab-${index}`, className: getClassName({
|
|
49
|
+
baseClassName: "af-tabs__pane",
|
|
50
|
+
modifiers: [activeIndex === index && "active"],
|
|
51
|
+
}), role: "tabpanel", tabIndex: 0, children: child.props.children }, `pane-${index}`))) })] }));
|
|
10
52
|
};
|
|
11
53
|
export { TabsStateless };
|
|
@@ -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";
|
|
@@ -2,4 +2,5 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import "@axa-fr/canopee-css/prospect/List/ContentItemDuo/ContentItemDuoApollo.css";
|
|
3
3
|
import { Button } from "../../Button/ButtonApollo";
|
|
4
4
|
import { ContentItemDuoCommon, } from "./ContentItemDuoCommon";
|
|
5
|
-
|
|
5
|
+
import { ItemMessage } from "../../Form/ItemMessage/ItemMessageApollo";
|
|
6
|
+
export const ContentItemDuo = (props) => (_jsx(ContentItemDuoCommon, { ...props, ButtonComponent: Button, ItemMessageComponent: ItemMessage }));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ComponentProps, type ComponentType, type ReactNode } from "react";
|
|
2
2
|
import type { ButtonProps } from "../../Button/ButtonCommon";
|
|
3
|
+
import { ItemMessage, type ItemMessageProps } from "../../Form/ItemMessage/ItemMessageCommon";
|
|
3
4
|
type ContentItemDuoPositions = {
|
|
4
5
|
position?: "horizontal";
|
|
5
6
|
size?: "small" | "large";
|
|
@@ -16,9 +17,10 @@ export type ContentItemDuoProps = {
|
|
|
16
17
|
isVertical?: boolean;
|
|
17
18
|
/** @deprecated Use `size` or `className` instead */
|
|
18
19
|
classModifier?: string;
|
|
19
|
-
} & ContentItemDuoPositions & ComponentProps<"div">;
|
|
20
|
+
} & Pick<ItemMessageProps, "message" | "messageType"> & ContentItemDuoPositions & ComponentProps<"div">;
|
|
20
21
|
type ContentItemDuoCommonProps = ContentItemDuoProps & {
|
|
21
22
|
ButtonComponent: ComponentType<ButtonProps>;
|
|
23
|
+
ItemMessageComponent: ComponentType<ComponentProps<typeof ItemMessage>>;
|
|
22
24
|
};
|
|
23
|
-
export declare const ContentItemDuoCommon: ({ label, value, position, size, className, classModifier, isVertical, buttonText, onButtonClick, ButtonComponent, ...containerProps }: ContentItemDuoCommonProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare const ContentItemDuoCommon: ({ label, value, position, size, className, classModifier, isVertical, buttonText, onButtonClick, ButtonComponent, message, messageType, ItemMessageComponent, ...containerProps }: ContentItemDuoCommonProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
26
|
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import {} from "react";
|
|
3
3
|
import { getClassName } from "../../utilities/getClassName";
|
|
4
|
-
|
|
4
|
+
import { ItemMessage, } from "../../Form/ItemMessage/ItemMessageCommon";
|
|
5
|
+
export const ContentItemDuoCommon = ({ label, value, position = "horizontal", size = "large", className, classModifier, isVertical, buttonText, onButtonClick, ButtonComponent, message, messageType, ItemMessageComponent, ...containerProps }) => {
|
|
5
6
|
const componentClassName = getClassName({
|
|
6
7
|
baseClassName: "af-content-item-duo",
|
|
7
8
|
className,
|
|
@@ -11,5 +12,5 @@ export const ContentItemDuoCommon = ({ label, value, position = "horizontal", si
|
|
|
11
12
|
classModifier,
|
|
12
13
|
],
|
|
13
14
|
});
|
|
14
|
-
return (_jsxs("div", { className: componentClassName, ...containerProps, children: [_jsx("dt", { className: "af-content-item-duo__label", children: label }),
|
|
15
|
+
return (_jsxs("div", { className: componentClassName, ...containerProps, children: [_jsx("dt", { className: "af-content-item-duo__label", children: label }), _jsxs("dd", { className: "af-content-item-duo__value", children: [value, message ? (_jsx(ItemMessageComponent, { message: message, messageType: messageType })) : null] }), buttonText && onButtonClick ? (_jsx(ButtonComponent, { className: "af-content-item-duo__button", variant: "ghost", onClick: onButtonClick, children: buttonText })) : null] }));
|
|
15
16
|
};
|
|
@@ -2,4 +2,5 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import "@axa-fr/canopee-css/client/List/ContentItemDuo/ContentItemDuoLF.css";
|
|
3
3
|
import { Button } from "../../Button/ButtonLF";
|
|
4
4
|
import { ContentItemDuoCommon, } from "./ContentItemDuoCommon";
|
|
5
|
-
|
|
5
|
+
import { ItemMessage } from "../../Form/ItemMessage/ItemMessageLF";
|
|
6
|
+
export const ContentItemDuo = (props) => (_jsx(ContentItemDuoCommon, { ...props, ButtonComponent: Button, ItemMessageComponent: ItemMessage }));
|
|
@@ -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";
|
|
@@ -6,7 +6,7 @@ export type StepperProps = {
|
|
|
6
6
|
currentStep: number;
|
|
7
7
|
currentSubtitle?: string;
|
|
8
8
|
currentTitle?: string;
|
|
9
|
-
nbSteps?: 3 | 4 | 5 | 6 | 7 | 8;
|
|
9
|
+
nbSteps?: 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
|
10
10
|
helper?: string;
|
|
11
11
|
message?: string;
|
|
12
12
|
messageType?: ItemMessageProps["messageType"];
|
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.36",
|
|
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.36",
|
|
53
53
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
54
54
|
"@material-symbols/svg-700": ">= 0.19.0",
|
|
55
55
|
"react": ">= 18"
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
export type TitleComponentProps = {
|
|
3
|
-
enable?: boolean | null;
|
|
4
|
-
active: boolean;
|
|
5
|
-
className?: string;
|
|
6
|
-
classModifier?: string;
|
|
7
|
-
id: string;
|
|
8
|
-
children?: React.ReactNode;
|
|
9
|
-
onChange: (event: React.MouseEvent<HTMLButtonElement>, index: string) => void;
|
|
10
|
-
};
|
|
11
|
-
declare const Title: {
|
|
12
|
-
({ active, onChange, children, classModifier, className, enable, id, }: TitleComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
-
displayName: string;
|
|
14
|
-
};
|
|
15
|
-
export { Title };
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import classNames from "classnames";
|
|
3
|
-
import React from "react";
|
|
4
|
-
import { getComponentClassName } from "../../utilities";
|
|
5
|
-
const Title = ({ active, onChange, children, classModifier, className, enable, id, }) => {
|
|
6
|
-
const newClassModifier = classNames(classModifier, {
|
|
7
|
-
disabled: enable === false,
|
|
8
|
-
active,
|
|
9
|
-
});
|
|
10
|
-
const componentClassName = getComponentClassName(className, newClassModifier, "af-tabs__item");
|
|
11
|
-
return (_jsx("li", { className: componentClassName, children: _jsx("button", { type: "button", id: id, className: "af-tabs__link", onClick: (event) => onChange(event, id), children: children }) }));
|
|
12
|
-
};
|
|
13
|
-
Title.displayName = "Title";
|
|
14
|
-
export { Title };
|