@axa-fr/design-system-look-and-feel-react 0.3.0-ci.298 → 0.3.0-ci.300

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.
@@ -0,0 +1,20 @@
1
+ import "@axa-fr/design-system-look-and-feel-css/dist/Skeleton/Skeleton.scss";
2
+ import { ReactNode } from "react";
3
+ type isLoadingAndChildrenProps = {
4
+ children: ReactNode;
5
+ isLoading: boolean;
6
+ } | {
7
+ children?: undefined;
8
+ isLoading?: boolean;
9
+ };
10
+ export type SkeletonProps = {
11
+ className?: string;
12
+ grid: number[][];
13
+ ariaBusy?: boolean;
14
+ ariaLabel?: string;
15
+ maxCols?: number;
16
+ colGap?: number;
17
+ rowGap?: number;
18
+ } & isLoadingAndChildrenProps;
19
+ export declare const Skeleton: ({ className, grid, ariaBusy, ariaLabel, maxCols, colGap, rowGap, isLoading, children, }: SkeletonProps) => string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
20
+ export {};
@@ -0,0 +1,7 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import "@axa-fr/design-system-look-and-feel-css/dist/Skeleton/Skeleton.scss";
3
+ export const Skeleton = ({ className = "af-skeleton", grid = [], ariaBusy = true, ariaLabel = "Chargement", maxCols = 12, colGap = 16, rowGap = 8, isLoading = true, children, }) => isLoading ? (_jsx("div", { className: `${className}-container`, "aria-label": ariaLabel, role: "status", "aria-live": "polite", "aria-busy": ariaBusy, style: {
4
+ "--max-cols": maxCols,
5
+ "--col-gap": `calc(${colGap} / var(--font-size-base) * 1rem)`,
6
+ "--row-gap": `calc(${rowGap} / var(--font-size-base) * 1rem)`,
7
+ }, children: grid.map((cols, indexRow) => cols.map((colSize, indexCol) => (_jsx("div", { style: { "--col-size": colSize }, className: className }, `${indexRow}-${indexCol}`)))) })) : (children);
@@ -0,0 +1,11 @@
1
+ import { ComponentPropsWithRef, PropsWithChildren } from "react";
2
+ import { Skeleton, List } from "..";
3
+ export type SkeletonListProps = {
4
+ lists: {
5
+ lines?: number;
6
+ grid: ComponentPropsWithRef<typeof Skeleton>["grid"];
7
+ }[];
8
+ classModifierList?: ComponentPropsWithRef<typeof List>["classModifier"];
9
+ isLoading: boolean;
10
+ } & PropsWithChildren;
11
+ export declare const SkeletonList: ({ children, isLoading, lists, classModifierList, }: SkeletonListProps) => string | number | boolean | import("react").ReactElement<any, string | import("react").JSXElementConstructor<any>> | Iterable<import("react").ReactNode> | import("react/jsx-runtime").JSX.Element[] | null | undefined;
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Skeleton, List } from "..";
3
+ export const SkeletonList = ({ children, isLoading, lists = [], classModifierList, }) => isLoading
4
+ ? lists.map(({ lines = 1, grid }) => (_jsx(List, { classModifier: classModifierList, children: [...Array(lines).keys()].map(() => (_jsx(Skeleton, { grid: grid }, crypto.randomUUID()))) }, crypto.randomUUID())))
5
+ : children;
package/dist/index.d.ts CHANGED
@@ -29,3 +29,4 @@ export { Svg } from "./Svg";
29
29
  export { TabsClient as Tabs, Direction as TabsDirection } from "./Tabs/Tabs";
30
30
  export { Tag } from "./Tag";
31
31
  export { Title, TitleSize, type TitleLevel } from "./Title";
32
+ export { Skeleton } from "./Skeleton/Skeleton";
package/dist/index.js CHANGED
@@ -27,3 +27,4 @@ export { Svg } from "./Svg";
27
27
  export { TabsClient as Tabs, Direction as TabsDirection } from "./Tabs/Tabs";
28
28
  export { Tag } from "./Tag";
29
29
  export { Title, TitleSize } from "./Title";
30
+ export { Skeleton } from "./Skeleton/Skeleton";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/design-system-look-and-feel-react",
3
- "version": "0.3.0-ci.298",
3
+ "version": "0.3.0-ci.300",
4
4
  "description": "",
5
5
  "exports": {
6
6
  ".": {
@@ -45,7 +45,7 @@
45
45
  },
46
46
  "homepage": "https://github.com/AxaFrance/design-system#readme",
47
47
  "peerDependencies": {
48
- "@axa-fr/design-system-look-and-feel-css": "0.3.0-ci.298",
48
+ "@axa-fr/design-system-look-and-feel-css": "0.3.0-ci.300",
49
49
  "@material-symbols/svg-400": ">= 0.19.0",
50
50
  "react": ">= 18"
51
51
  },