@axa-fr/canopee-react 2.0.0-alpha.7 → 2.0.0-alpha.70
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 +17 -16
- package/dist/client.js +17 -16
- package/dist/distributeur/ButtonMultiActions/ButtonMultiActions.d.ts +10 -0
- package/dist/distributeur/ButtonMultiActions/ButtonMultiActions.js +51 -0
- package/dist/distributeur/ButtonMultiActions/index.d.ts +2 -0
- package/dist/distributeur/ButtonMultiActions/index.js +1 -0
- package/dist/distributeur/Title/Title.js +1 -1
- package/dist/distributeur.d.ts +1 -0
- package/dist/distributeur.js +1 -0
- package/dist/prospect-client/AccordionCore/AccordionCoreCommon.d.ts +3 -5
- package/dist/prospect-client/AccordionCore/AccordionCoreCommon.js +10 -4
- package/dist/prospect-client/AppName/AppName.d.ts +44 -0
- package/dist/prospect-client/AppName/AppName.js +23 -0
- package/dist/prospect-client/Card/CardApollo.d.ts +1 -1
- package/dist/prospect-client/Card/CardApollo.js +1 -1
- package/dist/prospect-client/Card/CardCommon.d.ts +30 -2
- package/dist/prospect-client/Card/CardCommon.js +18 -1
- package/dist/prospect-client/Card/CardLF.d.ts +1 -1
- package/dist/prospect-client/Card/CardLF.js +1 -1
- package/dist/prospect-client/CardMessage/CardMessageCommon.js +6 -4
- package/dist/prospect-client/ContentItemDuoAction/ContentItemDuoActionCommon.d.ts +2 -2
- package/dist/prospect-client/ContentItemDuoAction/ContentItemDuoActionCommon.js +5 -2
- package/dist/prospect-client/ContentItemMono/ContentItemMonoCommon.d.ts +0 -4
- package/dist/prospect-client/ContentItemMono/ContentItemMonoCommon.js +2 -3
- package/dist/prospect-client/DataAgent/DataAgentCommon.js +2 -2
- package/dist/prospect-client/Divider/DividerCommon.js +6 -2
- package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxApollo.d.ts +1 -0
- package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxCommon.d.ts +1 -17
- package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxCommon.js +4 -4
- package/dist/prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxLF.d.ts +1 -0
- package/dist/prospect-client/Form/Checkbox/Checkbox/CheckboxCommon.d.ts +2 -6
- package/dist/prospect-client/Form/Checkbox/Checkbox/CheckboxCommon.js +6 -2
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextCommon.d.ts +1 -5
- package/dist/prospect-client/Form/Checkbox/CheckboxText/CheckboxTextCommon.js +3 -3
- package/dist/prospect-client/Form/Dropdown/DropdownCommon.d.ts +2 -10
- package/dist/prospect-client/Form/Dropdown/DropdownCommon.js +3 -3
- package/dist/prospect-client/Form/InputDate/InputDateCommon.d.ts +2 -10
- package/dist/prospect-client/Form/InputDate/InputDateCommon.js +4 -5
- package/dist/prospect-client/Form/InputPhone/InputPhoneCommon.d.ts +2 -10
- package/dist/prospect-client/Form/InputPhone/InputPhoneCommon.js +9 -5
- package/dist/prospect-client/Form/InputText/InputTextCommon.d.ts +3 -11
- package/dist/prospect-client/Form/InputText/InputTextCommon.js +6 -5
- package/dist/prospect-client/Form/ItemLabel/ItemLabelCommon.d.ts +2 -22
- package/dist/prospect-client/Form/ItemLabel/ItemLabelCommon.js +4 -5
- package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectApollo.d.ts +7 -0
- package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectApollo.js +6 -0
- package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectCommon.d.ts +8 -0
- package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectCommon.js +9 -0
- package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectLF.d.ts +7 -0
- package/dist/prospect-client/Form/ItemMultiSelect/ItemMultiSelectLF.js +6 -0
- package/dist/prospect-client/Form/MultiSelectList/MultiSelectListApollo.d.ts +4 -0
- package/dist/prospect-client/Form/MultiSelectList/MultiSelectListApollo.js +5 -0
- package/dist/prospect-client/Form/MultiSelectList/MultiSelectListCommon.d.ts +11 -0
- package/dist/prospect-client/Form/MultiSelectList/MultiSelectListCommon.js +2 -0
- package/dist/prospect-client/Form/MultiSelectList/MultiSelectListLF.d.ts +4 -0
- package/dist/prospect-client/Form/MultiSelectList/MultiSelectListLF.js +5 -0
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioCommon.d.ts +1 -5
- package/dist/prospect-client/Form/Radio/CardRadio/CardRadioCommon.js +4 -4
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupCommon.d.ts +3 -27
- package/dist/prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupCommon.js +4 -6
- package/dist/prospect-client/Form/Radio/Radio/RadioCommon.d.ts +2 -5
- package/dist/prospect-client/Form/Radio/Radio/RadioCommon.js +6 -4
- package/dist/prospect-client/Form/TextArea/TextAreaCommon.d.ts +2 -6
- package/dist/prospect-client/Form/TextArea/TextAreaCommon.js +3 -3
- package/dist/prospect-client/Header/HeaderApollo.d.ts +4 -0
- package/dist/prospect-client/Header/HeaderApollo.js +8 -0
- package/dist/prospect-client/Header/HeaderCommon.d.ts +22 -0
- package/dist/prospect-client/Header/HeaderCommon.js +37 -0
- package/dist/prospect-client/Header/HeaderLF.d.ts +4 -0
- package/dist/prospect-client/Header/HeaderLF.js +8 -0
- package/dist/prospect-client/Icon/IconCommon.d.ts +1 -1
- package/dist/prospect-client/Icon/IconCommon.js +8 -9
- package/dist/prospect-client/ItemTabBar/ItemTabBarCommon.js +5 -2
- package/dist/prospect-client/Layout/ExitLayout/ExitLayoutApollo.d.ts +12 -0
- package/dist/prospect-client/Layout/ExitLayout/ExitLayoutApollo.js +12 -0
- package/dist/prospect-client/Layout/ExitLayout/ExitLayoutLF.d.ts +12 -0
- package/dist/prospect-client/Layout/ExitLayout/ExitLayoutLF.js +12 -0
- package/dist/prospect-client/Layout/ExitLayout/ExitLayoutSkeleton.d.ts +23 -0
- package/dist/prospect-client/Layout/ExitLayout/ExitLayoutSkeleton.js +17 -0
- package/dist/prospect-client/Link/LinkCommon.d.ts +1 -5
- package/dist/prospect-client/Link/LinkCommon.js +2 -2
- package/dist/prospect-client/List/ClickItem/ClickItemCommon.d.ts +1 -0
- package/dist/prospect-client/List/ContentItemDuo/ContentItemDuoCommon.d.ts +1 -5
- package/dist/prospect-client/List/ContentItemDuo/ContentItemDuoCommon.js +3 -7
- package/dist/prospect-client/List/List/ListCommon.d.ts +27 -2
- package/dist/prospect-client/List/List/ListCommon.js +12 -0
- package/dist/prospect-client/MenuBurger/MenuBurgerApollo.d.ts +4 -0
- package/dist/prospect-client/MenuBurger/MenuBurgerApollo.js +8 -0
- package/dist/prospect-client/MenuBurger/MenuBurgerCommon.d.ts +60 -0
- package/dist/prospect-client/MenuBurger/MenuBurgerCommon.js +34 -0
- package/dist/prospect-client/MenuBurger/MenuBurgerLF.d.ts +4 -0
- package/dist/prospect-client/MenuBurger/MenuBurgerLF.js +8 -0
- package/dist/prospect-client/MessageBar/MessageBarAction.d.ts +8 -0
- package/dist/prospect-client/MessageBar/MessageBarAction.js +11 -0
- package/dist/prospect-client/MessageBar/MessageBarApollo.d.ts +5 -0
- package/dist/prospect-client/MessageBar/MessageBarApollo.js +7 -0
- package/dist/prospect-client/MessageBar/MessageBarCommon.d.ts +26 -0
- package/dist/prospect-client/MessageBar/MessageBarCommon.js +33 -0
- package/dist/prospect-client/MessageBar/MessageBarDescription.d.ts +6 -0
- package/dist/prospect-client/MessageBar/MessageBarDescription.js +8 -0
- package/dist/prospect-client/MessageBar/MessageBarLF.d.ts +5 -0
- package/dist/prospect-client/MessageBar/MessageBarLF.js +7 -0
- package/dist/prospect-client/MessageBar/MessageBarSummary.d.ts +11 -0
- package/dist/prospect-client/MessageBar/MessageBarSummary.js +2 -0
- package/dist/prospect-client/MessageBar/types.d.ts +1 -0
- package/dist/prospect-client/MessageBar/types.js +1 -0
- package/dist/prospect-client/Modal/ModalApollo.d.ts +1 -1
- package/dist/prospect-client/Modal/ModalApollo.js +1 -3
- package/dist/prospect-client/Modal/ModalCommon.d.ts +1 -1
- package/dist/prospect-client/Modal/ModalCommon.js +1 -1
- package/dist/prospect-client/Modal/ModalLF.d.ts +1 -1
- package/dist/prospect-client/Modal/ModalLF.js +1 -3
- package/dist/prospect-client/Modal/components/ModalCoreHeaderCommon.d.ts +0 -7
- package/dist/prospect-client/Modal/components/ModalCoreHeaderCommon.js +2 -12
- package/dist/prospect-client/Modal/types.d.ts +0 -15
- package/dist/prospect-client/ProgressBarGroup/ProgressBarGroupCommon.d.ts +1 -5
- package/dist/prospect-client/ProgressBarGroup/ProgressBarGroupCommon.js +1 -1
- package/dist/prospect-client/Skeleton/Skeleton.d.ts +61 -0
- package/dist/prospect-client/Skeleton/Skeleton.js +41 -0
- package/dist/prospect-client/SkeletonGrid/SkeletonGrid.d.ts +51 -0
- package/dist/prospect-client/SkeletonGrid/SkeletonGrid.js +37 -0
- package/dist/prospect-client/SkeletonList/SkeletonListApollo.d.ts +7 -0
- package/dist/prospect-client/SkeletonList/SkeletonListApollo.js +8 -2
- package/dist/prospect-client/SkeletonList/SkeletonListCommon.d.ts +21 -4
- package/dist/prospect-client/SkeletonList/SkeletonListCommon.js +18 -2
- package/dist/prospect-client/SkeletonList/SkeletonListLF.d.ts +7 -0
- package/dist/prospect-client/SkeletonList/SkeletonListLF.js +8 -2
- package/dist/prospect-client/Stepper/StepperApollo.js +2 -1
- package/dist/prospect-client/Stepper/StepperCommon.d.ts +11 -6
- package/dist/prospect-client/Stepper/StepperCommon.js +2 -3
- package/dist/prospect-client/Stepper/StepperLF.js +2 -1
- package/dist/prospect-client/TabMenu/TabMenu.js +1 -1
- package/dist/prospect-client/Tag/TagCommon.js +6 -2
- package/dist/prospect-client/Toggle/ToggleCommon.js +2 -2
- package/dist/prospect.d.ts +11 -6
- package/dist/prospect.js +11 -6
- package/package.json +2 -2
- package/dist/prospect-client/Skeleton/SkeletonApollo.d.ts +0 -2
- package/dist/prospect-client/Skeleton/SkeletonApollo.js +0 -2
- package/dist/prospect-client/Skeleton/SkeletonCommon.d.ts +0 -19
- package/dist/prospect-client/Skeleton/SkeletonCommon.js +0 -11
- package/dist/prospect-client/Skeleton/SkeletonLF.d.ts +0 -2
- package/dist/prospect-client/Skeleton/SkeletonLF.js +0 -2
- package/dist/prospect-client/utilities/getComponentClassName.d.ts +0 -4
- package/dist/prospect-client/utilities/getComponentClassName.js +0 -30
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Skeleton } from "../Skeleton/Skeleton";
|
|
3
|
+
import "@axa-fr/canopee-css/prospect/SkeletonGrid/SkeletonGridAll.css";
|
|
4
|
+
import { getClassName } from "../utilities/getClassName";
|
|
5
|
+
const CLASS_NAME = "af-skeleton-grid";
|
|
6
|
+
/**
|
|
7
|
+
* Renders a responsive grid of skeleton placeholders.
|
|
8
|
+
*
|
|
9
|
+
* When `isLoading` is `false`, the component returns its `children` instead of
|
|
10
|
+
* the skeleton grid.
|
|
11
|
+
*
|
|
12
|
+
* @component
|
|
13
|
+
* @param {SkeletonGridProps} props - SkeletonGrid props.
|
|
14
|
+
* @param {SkeletonGridItem[][]} props.grid - Grid definition where each row contains one or more skeleton cells.
|
|
15
|
+
* @param {number} [props.maxCols=12] - Number of columns used to build the grid template.
|
|
16
|
+
* @param {number} [props.colGap=16] - Horizontal gap between grid columns, in pixels.
|
|
17
|
+
* @param {number} [props.rowGap=8] - Vertical gap between grid rows, in pixels.
|
|
18
|
+
* @param {boolean} [props.isLoading=true] - When `true`, displays the skeleton placeholders.
|
|
19
|
+
* @param {ReactNode} [props.children] - Content rendered when `isLoading` is `false`.
|
|
20
|
+
* @param {string} [props.className] - Additional CSS class applied to the root element.
|
|
21
|
+
* @param {string} [props.aria-label="Chargement"] - Accessible label for the loading region.
|
|
22
|
+
* @param {boolean} [props.aria-busy=true] - Announces the loading region as busy to assistive technologies.
|
|
23
|
+
* @returns {JSX.Element | ReactNode} The rendered skeleton grid or the fallback children.
|
|
24
|
+
*/
|
|
25
|
+
export const SkeletonGrid = ({ className, grid = [], "aria-busy": ariaBusy = true, "aria-label": ariaLabel = "Chargement", maxCols = 12, colGap = 16, rowGap = 8, isLoading = true, children, }) => {
|
|
26
|
+
if (isLoading) {
|
|
27
|
+
return (_jsx("div", { className: getClassName({
|
|
28
|
+
baseClassName: CLASS_NAME,
|
|
29
|
+
className,
|
|
30
|
+
}), "aria-label": ariaLabel, role: "status", "aria-busy": ariaBusy, style: {
|
|
31
|
+
"--max-cols": maxCols,
|
|
32
|
+
"--col-gap": `calc(${colGap} / var(--font-size-base) * 1rem)`,
|
|
33
|
+
"--row-gap": `calc(${rowGap} / var(--font-size-base) * 1rem)`,
|
|
34
|
+
}, children: grid.map((cols, indexRow) => cols.map((skeletonProps, indexCol) => (_jsx(Skeleton, { ...skeletonProps }, `${indexRow}-${indexCol}`)))) }));
|
|
35
|
+
}
|
|
36
|
+
return children;
|
|
37
|
+
};
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { type SkeletonListProps } from "./SkeletonListCommon";
|
|
2
2
|
export { type SkeletonListProps } from "./SkeletonListCommon";
|
|
3
|
+
/**
|
|
4
|
+
* Apollo-themed `SkeletonList` component.
|
|
5
|
+
*
|
|
6
|
+
* @component
|
|
7
|
+
* @param {SkeletonListProps} props - SkeletonList props.
|
|
8
|
+
* @returns {JSX.Element | ReactNode[]} The rendered Apollo-themed SkeletonList.
|
|
9
|
+
*/
|
|
3
10
|
export declare const SkeletonList: (props: SkeletonListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Skeleton } from "../Skeleton/SkeletonApollo";
|
|
3
2
|
import { List } from "../List/List/ListApollo";
|
|
4
3
|
import { SkeletonListCommon, } from "./SkeletonListCommon";
|
|
5
4
|
export {} from "./SkeletonListCommon";
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Apollo-themed `SkeletonList` component.
|
|
7
|
+
*
|
|
8
|
+
* @component
|
|
9
|
+
* @param {SkeletonListProps} props - SkeletonList props.
|
|
10
|
+
* @returns {JSX.Element | ReactNode[]} The rendered Apollo-themed SkeletonList.
|
|
11
|
+
*/
|
|
12
|
+
export const SkeletonList = (props) => (_jsx(SkeletonListCommon, { ...props, ListComponent: List }));
|
|
@@ -1,17 +1,34 @@
|
|
|
1
1
|
import type { ComponentType, PropsWithChildren } from "react";
|
|
2
|
-
import type {
|
|
2
|
+
import type { SkeletonGridProps } from "../SkeletonGrid/SkeletonGrid";
|
|
3
3
|
import type { ListProps } from "../List/List/ListCommon";
|
|
4
|
+
/**
|
|
5
|
+
* Props for the themed `SkeletonList` components.
|
|
6
|
+
*/
|
|
4
7
|
export type SkeletonListProps = {
|
|
5
8
|
lists: {
|
|
6
9
|
lines?: number;
|
|
7
|
-
grid:
|
|
10
|
+
grid: SkeletonGridProps["grid"];
|
|
8
11
|
}[];
|
|
9
12
|
isLoading?: boolean;
|
|
10
13
|
className?: string;
|
|
11
14
|
} & PropsWithChildren;
|
|
12
15
|
type SkeletonListPropsCommon = SkeletonListProps & {
|
|
13
16
|
ListComponent: ComponentType<ListProps>;
|
|
14
|
-
SkeletonComponent: ComponentType<SkeletonProps>;
|
|
15
17
|
};
|
|
16
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Shared implementation rendering repeated `SkeletonGrid` rows inside a `List`.
|
|
20
|
+
*
|
|
21
|
+
* The visual list container is injected through `ListComponent` to allow
|
|
22
|
+
* Apollo and Look and Feel theming.
|
|
23
|
+
*
|
|
24
|
+
* @component
|
|
25
|
+
* @param {SkeletonListPropsCommon} props - SkeletonList props.
|
|
26
|
+
* @param {{ lines?: number; grid: SkeletonGridProps["grid"] }[]} props.lists - Groups of skeleton rows to render while loading.
|
|
27
|
+
* @param {boolean} [props.isLoading=true] - When `true`, renders the list of skeleton placeholders.
|
|
28
|
+
* @param {string} [props.className] - Additional CSS class applied to each injected list container.
|
|
29
|
+
* @param {ReactNode} [props.children] - Content rendered when `isLoading` is `false`.
|
|
30
|
+
* @param {ComponentType<ListProps>} props.ListComponent - Theme-specific list component used to wrap each skeleton block.
|
|
31
|
+
* @returns {JSX.Element | ReactNode[]} The rendered skeleton list or the fallback children.
|
|
32
|
+
*/
|
|
33
|
+
export declare const SkeletonListCommon: ({ children, isLoading, lists, className, ListComponent, }: SkeletonListPropsCommon) => string | number | bigint | boolean | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element[] | null | undefined;
|
|
17
34
|
export {};
|
|
@@ -1,4 +1,20 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
import { SkeletonGrid } from "../SkeletonGrid/SkeletonGrid";
|
|
3
|
+
/**
|
|
4
|
+
* Shared implementation rendering repeated `SkeletonGrid` rows inside a `List`.
|
|
5
|
+
*
|
|
6
|
+
* The visual list container is injected through `ListComponent` to allow
|
|
7
|
+
* Apollo and Look and Feel theming.
|
|
8
|
+
*
|
|
9
|
+
* @component
|
|
10
|
+
* @param {SkeletonListPropsCommon} props - SkeletonList props.
|
|
11
|
+
* @param {{ lines?: number; grid: SkeletonGridProps["grid"] }[]} props.lists - Groups of skeleton rows to render while loading.
|
|
12
|
+
* @param {boolean} [props.isLoading=true] - When `true`, renders the list of skeleton placeholders.
|
|
13
|
+
* @param {string} [props.className] - Additional CSS class applied to each injected list container.
|
|
14
|
+
* @param {ReactNode} [props.children] - Content rendered when `isLoading` is `false`.
|
|
15
|
+
* @param {ComponentType<ListProps>} props.ListComponent - Theme-specific list component used to wrap each skeleton block.
|
|
16
|
+
* @returns {JSX.Element | ReactNode[]} The rendered skeleton list or the fallback children.
|
|
17
|
+
*/
|
|
18
|
+
export const SkeletonListCommon = ({ children, isLoading, lists = [], className, ListComponent, }) => isLoading
|
|
19
|
+
? lists.map(({ lines = 1, grid }, linesIndex) => (_jsx(ListComponent, { className: className, children: [...Array(lines).keys()].map((_, lineIndex) => (_jsx(SkeletonGrid, { grid: grid }, lineIndex))) }, linesIndex)))
|
|
4
20
|
: children;
|
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
import { type SkeletonListProps } from "./SkeletonListCommon";
|
|
2
2
|
export { type SkeletonListProps } from "./SkeletonListCommon";
|
|
3
|
+
/**
|
|
4
|
+
* Look and Feel-themed `SkeletonList` component.
|
|
5
|
+
*
|
|
6
|
+
* @component
|
|
7
|
+
* @param {SkeletonListProps} props - SkeletonList props.
|
|
8
|
+
* @returns {JSX.Element | ReactNode[]} The rendered Look and Feel SkeletonList.
|
|
9
|
+
*/
|
|
3
10
|
export declare const SkeletonList: (props: SkeletonListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Skeleton } from "../Skeleton/SkeletonLF";
|
|
3
2
|
import { List } from "../List/List/ListLF";
|
|
4
3
|
import { SkeletonListCommon, } from "./SkeletonListCommon";
|
|
5
4
|
export {} from "./SkeletonListCommon";
|
|
6
|
-
|
|
5
|
+
/**
|
|
6
|
+
* Look and Feel-themed `SkeletonList` component.
|
|
7
|
+
*
|
|
8
|
+
* @component
|
|
9
|
+
* @param {SkeletonListProps} props - SkeletonList props.
|
|
10
|
+
* @returns {JSX.Element | ReactNode[]} The rendered Look and Feel SkeletonList.
|
|
11
|
+
*/
|
|
12
|
+
export const SkeletonList = (props) => (_jsx(SkeletonListCommon, { ...props, ListComponent: List }));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/prospect/Stepper/StepperApollo.css";
|
|
3
|
+
import { Heading } from "../Heading/HeadingApollo";
|
|
3
4
|
import { ProgressBarGroup } from "../ProgressBarGroup/ProgressBarGroupApollo";
|
|
4
5
|
import { StepperCommon } from "./StepperCommon";
|
|
5
|
-
export const Stepper = (props) => (_jsx(StepperCommon, { ...props, ProgressBarGroupComponent: ProgressBarGroup }));
|
|
6
|
+
export const Stepper = (props) => (_jsx(StepperCommon, { ...props, ProgressBarGroupComponent: ProgressBarGroup, HeadingComponent: Heading }));
|
|
@@ -1,18 +1,23 @@
|
|
|
1
|
-
import { type ComponentType, type HTMLAttributes } from "react";
|
|
1
|
+
import { type ComponentType, type HTMLAttributes, type ReactNode } from "react";
|
|
2
2
|
import { type ItemMessageProps } from "../Form/ItemMessage/ItemMessageCommon";
|
|
3
3
|
import { type ProgressBarGroupProps } from "../ProgressBarGroup/ProgressBarGroupCommon";
|
|
4
|
+
import type { HeadingCommonProps } from "../Heading/HeadingCommon";
|
|
5
|
+
import type { HeadingLevel } from "../Heading/types";
|
|
4
6
|
export type StepperProps = {
|
|
5
7
|
currentStepProgress?: number;
|
|
6
8
|
currentStep: number;
|
|
7
|
-
currentSubtitle?:
|
|
8
|
-
currentTitle?:
|
|
9
|
+
currentSubtitle?: ReactNode;
|
|
10
|
+
currentTitle?: ReactNode;
|
|
9
11
|
nbSteps?: 2 | 3 | 4 | 5 | 6 | 7 | 8;
|
|
10
12
|
helper?: string;
|
|
13
|
+
icon?: string;
|
|
14
|
+
iconProps?: HeadingCommonProps["iconProps"];
|
|
11
15
|
message?: string;
|
|
12
16
|
messageType?: ItemMessageProps["messageType"];
|
|
13
|
-
titleLevel?:
|
|
14
|
-
} & Omit<HTMLAttributes<HTMLDivElement>, "role">;
|
|
17
|
+
titleLevel?: HeadingLevel;
|
|
18
|
+
} & Omit<HTMLAttributes<HTMLDivElement>, "role" | "title">;
|
|
15
19
|
export type StepperCommonProps = StepperProps & {
|
|
16
20
|
ProgressBarGroupComponent: ComponentType<ProgressBarGroupProps>;
|
|
21
|
+
HeadingComponent: ComponentType<HeadingCommonProps>;
|
|
17
22
|
};
|
|
18
|
-
export declare const StepperCommon: ({ currentStepProgress, currentTitle, nbSteps, currentStep, currentSubtitle, className, ProgressBarGroupComponent, helper, message, messageType, titleLevel, ...props }: StepperCommonProps) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export declare const StepperCommon: ({ currentStepProgress, currentTitle, nbSteps, currentStep, currentSubtitle, className, ProgressBarGroupComponent, HeadingComponent, helper, icon, iconProps, message, messageType, titleLevel, ...props }: StepperCommonProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,8 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useId, } from "react";
|
|
3
3
|
import { ItemMessage, } from "../Form/ItemMessage/ItemMessageCommon";
|
|
4
4
|
import {} from "../ProgressBarGroup/ProgressBarGroupCommon";
|
|
5
|
-
export const StepperCommon = ({ currentStepProgress, currentTitle, nbSteps, currentStep, currentSubtitle, className, ProgressBarGroupComponent, helper, message, messageType = "success", titleLevel = 2, ...props }) => {
|
|
5
|
+
export const StepperCommon = ({ currentStepProgress, currentTitle, nbSteps, currentStep, currentSubtitle, className, ProgressBarGroupComponent, HeadingComponent, helper, icon, iconProps, message, messageType = "success", titleLevel = 2, ...props }) => {
|
|
6
6
|
const titleId = useId();
|
|
7
|
-
|
|
8
|
-
return (_jsxs("div", { className: "af-stepper", ...props, tabIndex: undefined, children: [_jsxs("div", { className: "af-stepper__header", children: [_jsx(Title, { id: titleId, className: "af-stepper__title", children: currentTitle }), Boolean(currentSubtitle) && (_jsx("p", { className: "af-stepper__subtitle", children: currentSubtitle }))] }), _jsx(ProgressBarGroupComponent, { className: className, currentStep: currentStep, stepsCount: nbSteps, currentStepProgress: currentStepProgress, "aria-labelledby": titleId }), Boolean(helper) && _jsx("span", { className: "af-stepper__helper", children: helper }), _jsx(ItemMessage, { message: message, messageType: messageType })] }));
|
|
7
|
+
return (_jsxs("div", { className: "af-stepper", ...props, tabIndex: undefined, children: [_jsx("div", { className: "af-stepper__header", id: titleId, children: _jsx(HeadingComponent, { level: titleLevel, icon: icon, iconProps: iconProps, firstSubtitle: currentSubtitle, children: currentTitle }) }), _jsx(ProgressBarGroupComponent, { className: className, currentStep: currentStep, stepsCount: nbSteps, currentStepProgress: currentStepProgress, "aria-labelledby": titleId }), Boolean(helper) && _jsx("span", { className: "af-stepper__helper", children: helper }), _jsx(ItemMessage, { message: message, messageType: messageType })] }));
|
|
9
8
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import "@axa-fr/canopee-css/client/Stepper/StepperLF.css";
|
|
3
|
+
import { Heading } from "../Heading/HeadingLF";
|
|
3
4
|
import { ProgressBarGroup } from "../ProgressBarGroup/ProgressBarGroupLF";
|
|
4
5
|
import { StepperCommon } from "./StepperCommon";
|
|
5
|
-
export const Stepper = (props) => (_jsx(StepperCommon, { ...props, ProgressBarGroupComponent: ProgressBarGroup }));
|
|
6
|
+
export const Stepper = (props) => (_jsx(StepperCommon, { ...props, ProgressBarGroupComponent: ProgressBarGroup, HeadingComponent: Heading }));
|
|
@@ -33,7 +33,7 @@ export const TabMenu = ({ items, className, initialPosition = 0, ...props }) =>
|
|
|
33
33
|
className,
|
|
34
34
|
}), ...props,
|
|
35
35
|
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
36
|
-
tabIndex: 0, onKeyDown: (e) => handleKeys(e.key), children: _jsx("ul", { className: "af-tab-menu__list", children: items.map((item, index) => (_jsx("li", {
|
|
36
|
+
tabIndex: 0, onKeyDown: (e) => handleKeys(e.key), children: _jsx("ul", { className: "af-tab-menu__list", children: items.map((item, index) => (_jsx("li", { children: _jsx(ItemMenu, { ref: (el) => {
|
|
37
37
|
itemRefs.current[index] = el;
|
|
38
38
|
}, ...item, isActive: index === position ? true : item.isActive, tabIndex: index === position ? 0 : -1, children: item.label }) }, item.href))) }) }));
|
|
39
39
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { getClassName } from "../utilities/getClassName";
|
|
4
4
|
export const tagVariants = {
|
|
5
5
|
info: "info",
|
|
6
6
|
success: "success",
|
|
@@ -9,6 +9,10 @@ export const tagVariants = {
|
|
|
9
9
|
neutral: "neutral",
|
|
10
10
|
};
|
|
11
11
|
export const Tag = ({ children, className, variant = "info", ...divProps }) => {
|
|
12
|
-
const componentClassName = useMemo(() =>
|
|
12
|
+
const componentClassName = useMemo(() => getClassName({
|
|
13
|
+
baseClassName: "af-tag",
|
|
14
|
+
className,
|
|
15
|
+
modifiers: [variant],
|
|
16
|
+
}), [className, variant]);
|
|
13
17
|
return (_jsx("div", { className: componentClassName, ...divProps, children: _jsx("span", { className: "af-tag__label", children: children }) }));
|
|
14
18
|
};
|
|
@@ -2,10 +2,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import check from "@material-symbols/svg-400/rounded/check.svg";
|
|
3
3
|
import close from "@material-symbols/svg-400/rounded/close.svg";
|
|
4
4
|
import { useId } from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { getClassName } from "../utilities/getClassName";
|
|
6
6
|
export const ToggleCommon = ({ className, IconComponent, ...inputProps }) => {
|
|
7
7
|
let inputId = useId();
|
|
8
8
|
inputId = inputProps.id ?? inputId;
|
|
9
|
-
return (_jsxs("label", { className:
|
|
9
|
+
return (_jsxs("label", { className: getClassName({ baseClassName: "af-toggle", className }), htmlFor: inputId, children: [_jsx("div", { className: "af-toggle__root", children: _jsxs("span", { className: "af-toggle__handle", children: [_jsx(IconComponent, { src: check, "aria-hidden": "true", className: "af-toggle__icon af-toggle__icon--check", size: "XS" }), _jsx(IconComponent, { src: close, "aria-hidden": "true", className: "af-toggle__icon af-toggle__icon--close", size: "XS" })] }) }), _jsx("input", { ...inputProps, type: "checkbox", id: inputId })] }));
|
|
10
10
|
};
|
|
11
11
|
ToggleCommon.displayName = "ToggleCommon";
|
package/dist/prospect.d.ts
CHANGED
|
@@ -5,9 +5,10 @@ import "@fontsource/source-sans-pro";
|
|
|
5
5
|
export { Accordion, accordionVariants, type AccordionVariants, } from "./prospect-client/Accordion/AccordionApollo";
|
|
6
6
|
export { AccordionContextual, accordionContextualVariants, type AccordionContextualVariants, } from "./prospect-client/AccordionContextual/AccordionContextualApollo";
|
|
7
7
|
export { AccordionCore } from "./prospect-client/AccordionCore/AccordionCoreApollo";
|
|
8
|
+
export { AppName, type AppNameProps } from "./prospect-client/AppName/AppName";
|
|
8
9
|
export { BasePicture } from "./prospect-client/BasePicture/BasePicture";
|
|
9
10
|
export { Button, buttonVariants, type ButtonVariants, } from "./prospect-client/Button/ButtonApollo";
|
|
10
|
-
export { Card, type CardProps } from "./prospect-client/Card/CardApollo";
|
|
11
|
+
export { Card, cardVariants, type CardProps, type CardVariants, } from "./prospect-client/Card/CardApollo";
|
|
11
12
|
export { CardMessage, cardMessageVariants, type CardMessageVariants, } from "./prospect-client/CardMessage/CardMessageApollo";
|
|
12
13
|
export { ClickIcon } from "./prospect-client/ClickIcon/ClickIconApollo";
|
|
13
14
|
export { ContentItemDuoAction, type ContentItemDuoActionState, } from "./prospect-client/ContentItemDuoAction/ContentItemDuoActionApollo";
|
|
@@ -15,9 +16,7 @@ export { ContentItemMono } from "./prospect-client/ContentItemMono/ContentItemMo
|
|
|
15
16
|
export { DataAgent, type DataAgentProps, } from "./prospect-client/DataAgent/DataAgentApollo";
|
|
16
17
|
export { Divider } from "./prospect-client/Divider/DividerApollo";
|
|
17
18
|
export { Fieldset, type FieldsetProps, } from "./prospect-client/Fieldset/FieldsetApollo";
|
|
18
|
-
export { CardCheckbox,
|
|
19
|
-
/** @deprecated Use `CardCheckbox` instead. */
|
|
20
|
-
CardCheckbox as CheckboxCard, } from "./prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxApollo";
|
|
19
|
+
export { CardCheckbox, type CardCheckboxProps, } from "./prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxApollo";
|
|
21
20
|
export { CardCheckboxOption } from "./prospect-client/Form/Checkbox/CardCheckboxOption/CardCheckboxOptionApollo";
|
|
22
21
|
export { Checkbox } from "./prospect-client/Form/Checkbox/Checkbox/CheckboxApollo";
|
|
23
22
|
export { CheckboxText } from "./prospect-client/Form/Checkbox/CheckboxText/CheckboxTextApollo";
|
|
@@ -32,6 +31,8 @@ export { InputText } from "./prospect-client/Form/InputText/InputTextApollo";
|
|
|
32
31
|
export { InputTextAtom } from "./prospect-client/Form/InputTextAtom/InputTextAtomApollo";
|
|
33
32
|
export { ItemLabel } from "./prospect-client/Form/ItemLabel/ItemLabelApollo";
|
|
34
33
|
export { ItemMessage, itemMessageVariants, type ItemMessageVariants, } from "./prospect-client/Form/ItemMessage/ItemMessageApollo";
|
|
34
|
+
export { ItemMultiSelect, type ItemMultiSelectProps, } from "./prospect-client/Form/ItemMultiSelect/ItemMultiSelectApollo";
|
|
35
|
+
export { MultiSelectList, type MultiSelectListProps, } from "./prospect-client/Form/MultiSelectList/MultiSelectListApollo";
|
|
35
36
|
export { CardRadio } from "./prospect-client/Form/Radio/CardRadio/CardRadioApollo";
|
|
36
37
|
export { CardRadioGroup } from "./prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupApollo";
|
|
37
38
|
export { Radio } from "./prospect-client/Form/Radio/Radio/RadioApollo";
|
|
@@ -39,11 +40,13 @@ export { RadioText, type RadioTextProps, } from "./prospect-client/Form/Radio/Ra
|
|
|
39
40
|
export { TextArea } from "./prospect-client/Form/TextArea/TextAreaApollo";
|
|
40
41
|
export { DebugGrid } from "./prospect-client/Grid/DebugGridApollo";
|
|
41
42
|
export { Heading, type HeadingLevel, type HeadingProps, } from "./prospect-client/Heading/HeadingApollo";
|
|
43
|
+
export { Header, type HeaderProps, } from "./prospect-client/Header/HeaderApollo";
|
|
42
44
|
export { Icon, iconSizeVariants, iconVariants, type IconSizeVariants, type IconVariants, } from "./prospect-client/Icon/IconApollo";
|
|
43
45
|
export { ItemTabBar, type ItemTabBarProps, } from "./prospect-client/ItemTabBar/ItemTabBarApollo";
|
|
44
46
|
export { ItemMenu, type ItemMenuProps, } from "./prospect-client/ItemMenu/ItemMenuApollo";
|
|
47
|
+
export { MenuBurger, type MenuBurgerProps, } from "./prospect-client/MenuBurger/MenuBurgerApollo";
|
|
45
48
|
export { TabMenu, type TabMenuProps } from "./prospect-client/TabMenu/TabMenu";
|
|
46
|
-
export { ExitLayout, type ExitLayoutProps, type ExitLayoutWithSubComponents, } from "./prospect-client/Layout/ExitLayout/ExitLayoutApollo";
|
|
49
|
+
export { ExitLayout, type ExitLayoutProps, type ExitLayoutWithSubComponents, ExitLayoutSkeleton, type ExitLayoutSkeletonProps, } from "./prospect-client/Layout/ExitLayout/ExitLayoutApollo";
|
|
47
50
|
export { Footer, type FooterProps, } from "./prospect-client/Layout/Footer/FooterApollo";
|
|
48
51
|
export { FormLayout, type FormLayoutProps, } from "./prospect-client/Layout/FormLayout/FormLayout";
|
|
49
52
|
export { LevelSelector, type LevelSelectorProps, } from "./prospect-client/LevelSelector/LevelSelectorApollo";
|
|
@@ -61,7 +64,8 @@ export { ItemPagination, type ItemPaginationProps, } from "./prospect-client/Pag
|
|
|
61
64
|
export { Pagination } from "./prospect-client/Pagination/PaginationApollo";
|
|
62
65
|
export { ProgressBar } from "./prospect-client/ProgressBar/ProgressBarApollo";
|
|
63
66
|
export { ProgressBarGroup } from "./prospect-client/ProgressBarGroup/ProgressBarGroupApollo";
|
|
64
|
-
export { Skeleton, type SkeletonProps, } from "./prospect-client/Skeleton/
|
|
67
|
+
export { Skeleton, skeletonSizeVariants, skeletonVariants, type SkeletonActionSizeVariant, type SkeletonCircleSizeVariant, type SkeletonProps, type SkeletonSizeVariant, type SkeletonVariant, } from "./prospect-client/Skeleton/Skeleton";
|
|
68
|
+
export { SkeletonGrid, type SkeletonGridProps, } from "./prospect-client/SkeletonGrid/SkeletonGrid";
|
|
65
69
|
export { SkeletonList, type SkeletonListProps, } from "./prospect-client/SkeletonList/SkeletonListApollo";
|
|
66
70
|
export { Spinner, spinnerVariants, type SpinnerVariants, } from "./prospect-client/Spinner/SpinnerApollo";
|
|
67
71
|
export { Stepper } from "./prospect-client/Stepper/StepperApollo";
|
|
@@ -74,3 +78,4 @@ export { TagList, type TagListProps, } from "./prospect-client/TagList/TagListAp
|
|
|
74
78
|
export { TimelineVertical } from "./prospect-client/TimelineVertical/TimelineVerticalApollo";
|
|
75
79
|
export { Toggle } from "./prospect-client/Toggle/ToggleApollo";
|
|
76
80
|
export type { GridContainerProps } from "./prospect-client/utilities/types/GridContainerProps";
|
|
81
|
+
export { MessageBar, type MessageBarProps, type MessageBarVariant, } from "./prospect-client/MessageBar/MessageBarApollo";
|
package/dist/prospect.js
CHANGED
|
@@ -5,9 +5,10 @@ import "@fontsource/source-sans-pro";
|
|
|
5
5
|
export { Accordion, accordionVariants, } from "./prospect-client/Accordion/AccordionApollo";
|
|
6
6
|
export { AccordionContextual, accordionContextualVariants, } from "./prospect-client/AccordionContextual/AccordionContextualApollo";
|
|
7
7
|
export { AccordionCore } from "./prospect-client/AccordionCore/AccordionCoreApollo";
|
|
8
|
+
export { AppName } from "./prospect-client/AppName/AppName";
|
|
8
9
|
export { BasePicture } from "./prospect-client/BasePicture/BasePicture";
|
|
9
10
|
export { Button, buttonVariants, } from "./prospect-client/Button/ButtonApollo";
|
|
10
|
-
export { Card } from "./prospect-client/Card/CardApollo";
|
|
11
|
+
export { Card, cardVariants, } from "./prospect-client/Card/CardApollo";
|
|
11
12
|
export { CardMessage, cardMessageVariants, } from "./prospect-client/CardMessage/CardMessageApollo";
|
|
12
13
|
export { ClickIcon } from "./prospect-client/ClickIcon/ClickIconApollo";
|
|
13
14
|
export { ContentItemDuoAction, } from "./prospect-client/ContentItemDuoAction/ContentItemDuoActionApollo";
|
|
@@ -15,9 +16,7 @@ export { ContentItemMono } from "./prospect-client/ContentItemMono/ContentItemMo
|
|
|
15
16
|
export { DataAgent, } from "./prospect-client/DataAgent/DataAgentApollo";
|
|
16
17
|
export { Divider } from "./prospect-client/Divider/DividerApollo";
|
|
17
18
|
export { Fieldset, } from "./prospect-client/Fieldset/FieldsetApollo";
|
|
18
|
-
export { CardCheckbox,
|
|
19
|
-
/** @deprecated Use `CardCheckbox` instead. */
|
|
20
|
-
CardCheckbox as CheckboxCard, } from "./prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxApollo";
|
|
19
|
+
export { CardCheckbox, } from "./prospect-client/Form/Checkbox/CardCheckbox/CardCheckboxApollo";
|
|
21
20
|
export { CardCheckboxOption } from "./prospect-client/Form/Checkbox/CardCheckboxOption/CardCheckboxOptionApollo";
|
|
22
21
|
export { Checkbox } from "./prospect-client/Form/Checkbox/Checkbox/CheckboxApollo";
|
|
23
22
|
export { CheckboxText } from "./prospect-client/Form/Checkbox/CheckboxText/CheckboxTextApollo";
|
|
@@ -32,6 +31,8 @@ export { InputText } from "./prospect-client/Form/InputText/InputTextApollo";
|
|
|
32
31
|
export { InputTextAtom } from "./prospect-client/Form/InputTextAtom/InputTextAtomApollo";
|
|
33
32
|
export { ItemLabel } from "./prospect-client/Form/ItemLabel/ItemLabelApollo";
|
|
34
33
|
export { ItemMessage, itemMessageVariants, } from "./prospect-client/Form/ItemMessage/ItemMessageApollo";
|
|
34
|
+
export { ItemMultiSelect, } from "./prospect-client/Form/ItemMultiSelect/ItemMultiSelectApollo";
|
|
35
|
+
export { MultiSelectList, } from "./prospect-client/Form/MultiSelectList/MultiSelectListApollo";
|
|
35
36
|
export { CardRadio } from "./prospect-client/Form/Radio/CardRadio/CardRadioApollo";
|
|
36
37
|
export { CardRadioGroup } from "./prospect-client/Form/Radio/CardRadioGroup/CardRadioGroupApollo";
|
|
37
38
|
export { Radio } from "./prospect-client/Form/Radio/Radio/RadioApollo";
|
|
@@ -39,11 +40,13 @@ export { RadioText, } from "./prospect-client/Form/Radio/RadioText/RadioTextApol
|
|
|
39
40
|
export { TextArea } from "./prospect-client/Form/TextArea/TextAreaApollo";
|
|
40
41
|
export { DebugGrid } from "./prospect-client/Grid/DebugGridApollo";
|
|
41
42
|
export { Heading, } from "./prospect-client/Heading/HeadingApollo";
|
|
43
|
+
export { Header, } from "./prospect-client/Header/HeaderApollo";
|
|
42
44
|
export { Icon, iconSizeVariants, iconVariants, } from "./prospect-client/Icon/IconApollo";
|
|
43
45
|
export { ItemTabBar, } from "./prospect-client/ItemTabBar/ItemTabBarApollo";
|
|
44
46
|
export { ItemMenu, } from "./prospect-client/ItemMenu/ItemMenuApollo";
|
|
47
|
+
export { MenuBurger, } from "./prospect-client/MenuBurger/MenuBurgerApollo";
|
|
45
48
|
export { TabMenu } from "./prospect-client/TabMenu/TabMenu";
|
|
46
|
-
export { ExitLayout, } from "./prospect-client/Layout/ExitLayout/ExitLayoutApollo";
|
|
49
|
+
export { ExitLayout, ExitLayoutSkeleton, } from "./prospect-client/Layout/ExitLayout/ExitLayoutApollo";
|
|
47
50
|
export { Footer, } from "./prospect-client/Layout/Footer/FooterApollo";
|
|
48
51
|
export { FormLayout, } from "./prospect-client/Layout/FormLayout/FormLayout";
|
|
49
52
|
export { LevelSelector, } from "./prospect-client/LevelSelector/LevelSelectorApollo";
|
|
@@ -61,7 +64,8 @@ export { ItemPagination, } from "./prospect-client/Pagination/ItemPagination/Ite
|
|
|
61
64
|
export { Pagination } from "./prospect-client/Pagination/PaginationApollo";
|
|
62
65
|
export { ProgressBar } from "./prospect-client/ProgressBar/ProgressBarApollo";
|
|
63
66
|
export { ProgressBarGroup } from "./prospect-client/ProgressBarGroup/ProgressBarGroupApollo";
|
|
64
|
-
export { Skeleton, } from "./prospect-client/Skeleton/
|
|
67
|
+
export { Skeleton, skeletonSizeVariants, skeletonVariants, } from "./prospect-client/Skeleton/Skeleton";
|
|
68
|
+
export { SkeletonGrid, } from "./prospect-client/SkeletonGrid/SkeletonGrid";
|
|
65
69
|
export { SkeletonList, } from "./prospect-client/SkeletonList/SkeletonListApollo";
|
|
66
70
|
export { Spinner, spinnerVariants, } from "./prospect-client/Spinner/SpinnerApollo";
|
|
67
71
|
export { Stepper } from "./prospect-client/Stepper/StepperApollo";
|
|
@@ -73,3 +77,4 @@ export { Tag, tagVariants, } from "./prospect-client/Tag/TagApollo";
|
|
|
73
77
|
export { TagList, } from "./prospect-client/TagList/TagListApollo";
|
|
74
78
|
export { TimelineVertical } from "./prospect-client/TimelineVertical/TimelineVerticalApollo";
|
|
75
79
|
export { Toggle } from "./prospect-client/Toggle/ToggleApollo";
|
|
80
|
+
export { MessageBar, } from "./prospect-client/MessageBar/MessageBarApollo";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/canopee-react",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.70",
|
|
4
4
|
"description": "Package React - Design System Canopée",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./distributeur": {
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@axa-fr/canopee-css": "2.0.0-alpha.
|
|
56
|
+
"@axa-fr/canopee-css": "2.0.0-alpha.70",
|
|
57
57
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
58
58
|
"@material-symbols/svg-700": ">= 0.19.0",
|
|
59
59
|
"react": ">= 19"
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
type isLoadingAndChildrenProps = {
|
|
3
|
-
children: ReactNode;
|
|
4
|
-
isLoading: boolean;
|
|
5
|
-
} | {
|
|
6
|
-
children?: undefined;
|
|
7
|
-
isLoading?: boolean;
|
|
8
|
-
};
|
|
9
|
-
export type SkeletonProps = {
|
|
10
|
-
className?: string;
|
|
11
|
-
grid: number[][];
|
|
12
|
-
"aria-busy"?: boolean;
|
|
13
|
-
"aria-label"?: string;
|
|
14
|
-
maxCols?: number;
|
|
15
|
-
colGap?: number;
|
|
16
|
-
rowGap?: number;
|
|
17
|
-
} & isLoadingAndChildrenProps;
|
|
18
|
-
export declare const Skeleton: ({ className, grid, "aria-busy": ariaBusy, "aria-label": ariaLabel, maxCols, colGap, rowGap, isLoading, children, }: SkeletonProps) => string | number | bigint | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
|
|
19
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { getClassName } from "../utilities/getClassName";
|
|
3
|
-
const CLASS_NAME = "af-skeleton";
|
|
4
|
-
export const Skeleton = ({ className, grid = [], "aria-busy": ariaBusy = true, "aria-label": ariaLabel = "Chargement", maxCols = 12, colGap = 16, rowGap = 8, isLoading = true, children, }) => isLoading ? (_jsx("div", { className: getClassName({
|
|
5
|
-
baseClassName: `${CLASS_NAME}-container`,
|
|
6
|
-
className,
|
|
7
|
-
}), "aria-label": ariaLabel, role: "status", "aria-busy": ariaBusy, style: {
|
|
8
|
-
"--max-cols": maxCols,
|
|
9
|
-
"--col-gap": `calc(${colGap} / var(--font-size-base) * 1rem)`,
|
|
10
|
-
"--row-gap": `calc(${rowGap} / var(--font-size-base) * 1rem)`,
|
|
11
|
-
}, children: grid.map((cols, indexRow) => cols.map((colSize, indexCol) => (_jsx("div", { style: { "--col-size": colSize }, className: CLASS_NAME }, `${indexRow}-${indexCol}`)))) })) : (children);
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import classNames from "classnames";
|
|
2
|
-
const getLastClassName = (defaultClassName) => {
|
|
3
|
-
if (!defaultClassName) {
|
|
4
|
-
return null;
|
|
5
|
-
}
|
|
6
|
-
return defaultClassName.split(" ").filter(Boolean).at(-1);
|
|
7
|
-
};
|
|
8
|
-
const listClassModifier = (classModifier) => {
|
|
9
|
-
if (!classModifier) {
|
|
10
|
-
return [];
|
|
11
|
-
}
|
|
12
|
-
return classModifier.split(" ");
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* @deprecated This function is deprecated and will be removed in a future release. Use getClassName instead.
|
|
16
|
-
*/
|
|
17
|
-
export const getComponentClassName = (defaultClassName, className, classModifier) => {
|
|
18
|
-
// Fail fast, when no defaultClassName we don't want to loop on modifier
|
|
19
|
-
if (!defaultClassName) {
|
|
20
|
-
return "";
|
|
21
|
-
}
|
|
22
|
-
const classWithoutModifier = getLastClassName(defaultClassName);
|
|
23
|
-
const modifiers = listClassModifier(classModifier);
|
|
24
|
-
const modifiersObject = modifiers
|
|
25
|
-
.filter((it) => /\S/.test(it))
|
|
26
|
-
.map((it) => {
|
|
27
|
-
return `${classWithoutModifier}--${it}`;
|
|
28
|
-
});
|
|
29
|
-
return classNames(defaultClassName, className, modifiersObject);
|
|
30
|
-
};
|