@axa-fr/canopee-react 1.2.1-alpha.11 → 1.2.1-alpha.12
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 +2 -0
- package/dist/client.js +2 -0
- package/dist/prospect-client/Skeleton/SkeletonApollo.d.ts +2 -0
- package/dist/prospect-client/Skeleton/SkeletonApollo.js +2 -0
- package/dist/prospect-client/Skeleton/SkeletonCommon.d.ts +19 -0
- package/dist/prospect-client/Skeleton/SkeletonCommon.js +11 -0
- package/dist/prospect-client/Skeleton/SkeletonLF.d.ts +2 -0
- package/dist/prospect-client/Skeleton/SkeletonLF.js +2 -0
- package/dist/prospect-client/SkeletonList/SkeletonListApollo.d.ts +3 -0
- package/dist/prospect-client/SkeletonList/SkeletonListApollo.js +5 -0
- package/dist/prospect-client/SkeletonList/SkeletonListCommon.d.ts +17 -0
- package/dist/prospect-client/SkeletonList/SkeletonListCommon.js +4 -0
- package/dist/prospect-client/SkeletonList/SkeletonListLF.d.ts +3 -0
- package/dist/prospect-client/SkeletonList/SkeletonListLF.js +5 -0
- package/dist/prospect.d.ts +2 -0
- package/dist/prospect.js +2 -0
- package/package.json +2 -2
package/dist/client.d.ts
CHANGED
|
@@ -61,3 +61,5 @@ export { ItemPagination, type ItemPaginationProps, } from "./prospect-client/Pag
|
|
|
61
61
|
export { Card, type CardProps } from "./prospect-client/Card/CardLF";
|
|
62
62
|
export { List, type ListProps } from "./prospect-client/List/List/ListLF";
|
|
63
63
|
export { LevelSelector, type LevelSelectorProps, } from "./prospect-client/LevelSelector/LevelSelectorLF";
|
|
64
|
+
export { Skeleton, type SkeletonProps, } from "./prospect-client/Skeleton/SkeletonLF";
|
|
65
|
+
export { SkeletonList, type SkeletonListProps, } from "./prospect-client/SkeletonList/SkeletonListLF";
|
package/dist/client.js
CHANGED
|
@@ -60,3 +60,5 @@ export { ItemPagination, } from "./prospect-client/Pagination/ItemPagination/Ite
|
|
|
60
60
|
export { Card } from "./prospect-client/Card/CardLF";
|
|
61
61
|
export { List } from "./prospect-client/List/List/ListLF";
|
|
62
62
|
export { LevelSelector, } from "./prospect-client/LevelSelector/LevelSelectorLF";
|
|
63
|
+
export { Skeleton, } from "./prospect-client/Skeleton/SkeletonLF";
|
|
64
|
+
export { SkeletonList, } from "./prospect-client/SkeletonList/SkeletonListLF";
|
|
@@ -0,0 +1,19 @@
|
|
|
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 {};
|
|
@@ -0,0 +1,11 @@
|
|
|
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);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Skeleton } from "../Skeleton/SkeletonApollo";
|
|
3
|
+
import { List } from "../List/List/ListApollo";
|
|
4
|
+
import { SkeletonListCommon, } from "./SkeletonListCommon";
|
|
5
|
+
export const SkeletonList = (props) => (_jsx(SkeletonListCommon, { ...props, SkeletonComponent: Skeleton, ListComponent: List }));
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentType, PropsWithChildren } from "react";
|
|
2
|
+
import type { SkeletonProps } from "../Skeleton/SkeletonCommon";
|
|
3
|
+
import type { ListProps } from "../List/List/ListCommon";
|
|
4
|
+
export type SkeletonListProps = {
|
|
5
|
+
lists: {
|
|
6
|
+
lines?: number;
|
|
7
|
+
grid: SkeletonProps["grid"];
|
|
8
|
+
}[];
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
className?: string;
|
|
11
|
+
} & PropsWithChildren;
|
|
12
|
+
type SkeletonListPropsCommon = SkeletonListProps & {
|
|
13
|
+
ListComponent: ComponentType<ListProps>;
|
|
14
|
+
SkeletonComponent: ComponentType<SkeletonProps>;
|
|
15
|
+
};
|
|
16
|
+
export declare const SkeletonListCommon: ({ children, isLoading, lists, className, ListComponent, SkeletonComponent, }: 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
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export const SkeletonListCommon = ({ children, isLoading, lists = [], className, ListComponent, SkeletonComponent, }) => isLoading
|
|
3
|
+
? lists.map(({ lines = 1, grid }, linesIndex) => (_jsx(ListComponent, { className: className, children: [...Array(lines).keys()].map((_, lineIndex) => (_jsx(SkeletonComponent, { grid: grid }, lineIndex))) }, linesIndex)))
|
|
4
|
+
: children;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Skeleton } from "../Skeleton/SkeletonLF";
|
|
3
|
+
import { List } from "../List/List/ListLF";
|
|
4
|
+
import { SkeletonListCommon, } from "./SkeletonListCommon";
|
|
5
|
+
export const SkeletonList = (props) => (_jsx(SkeletonListCommon, { ...props, SkeletonComponent: Skeleton, ListComponent: List }));
|
package/dist/prospect.d.ts
CHANGED
|
@@ -57,3 +57,5 @@ export { ItemPagination, type ItemPaginationProps, } from "./prospect-client/Pag
|
|
|
57
57
|
export { Card, type CardProps } from "./prospect-client/Card/CardApollo";
|
|
58
58
|
export { List, type ListProps } from "./prospect-client/List/List/ListApollo";
|
|
59
59
|
export { LevelSelector, type LevelSelectorProps, } from "./prospect-client/LevelSelector/LevelSelectorApollo";
|
|
60
|
+
export { Skeleton, type SkeletonProps, } from "./prospect-client/Skeleton/SkeletonApollo";
|
|
61
|
+
export { SkeletonList, type SkeletonListProps, } from "./prospect-client/SkeletonList/SkeletonListApollo";
|
package/dist/prospect.js
CHANGED
|
@@ -56,3 +56,5 @@ export { ItemPagination, } from "./prospect-client/Pagination/ItemPagination/Ite
|
|
|
56
56
|
export { Card } from "./prospect-client/Card/CardApollo";
|
|
57
57
|
export { List } from "./prospect-client/List/List/ListApollo";
|
|
58
58
|
export { LevelSelector, } from "./prospect-client/LevelSelector/LevelSelectorApollo";
|
|
59
|
+
export { Skeleton, } from "./prospect-client/Skeleton/SkeletonApollo";
|
|
60
|
+
export { SkeletonList, } from "./prospect-client/SkeletonList/SkeletonListApollo";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axa-fr/canopee-react",
|
|
3
|
-
"version": "1.2.1-alpha.
|
|
3
|
+
"version": "1.2.1-alpha.12",
|
|
4
4
|
"description": "Package React - Design System Canopée",
|
|
5
5
|
"exports": {
|
|
6
6
|
"./distributeur": {
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
},
|
|
46
46
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
|
47
47
|
"peerDependencies": {
|
|
48
|
-
"@axa-fr/canopee-css": "1.2.1-alpha.
|
|
48
|
+
"@axa-fr/canopee-css": "1.2.1-alpha.12",
|
|
49
49
|
"@material-symbols/svg-400": ">= 0.19.0",
|
|
50
50
|
"@material-symbols/svg-700": ">= 0.19.0",
|
|
51
51
|
"react": ">= 18"
|