@axa-fr/design-system-look-and-feel-react 1.0.5-ci.69 → 1.0.5-ci.74
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/Form/core/FieldForm.d.ts +1 -1
- package/dist/Form/core/FieldForm.js +3 -2
- package/dist/Layout/Header/Header.d.ts +3 -3
- package/dist/Layout/Header/Header.js +1 -1
- package/dist/Layout/Header/NavBar/NavBar.d.ts +2 -2
- package/dist/Layout/Header/NavBar/NavBar.js +3 -3
- package/dist/Modal/components/ModalCoreHeader.d.ts +3 -2
- package/dist/Skeleton/Skeleton.d.ts +1 -1
- package/dist/SkeletonList/SkeletonList.d.ts +1 -1
- package/dist/Title/TitleWithSubtitles.d.ts +1 -1
- package/package.json +14 -2
@@ -49,7 +49,7 @@ export declare const eventWrapper: ({ wrapper, props }: EventWrapperProps) => {
|
|
49
49
|
onFocus: (ev: BaseSyntheticEvent) => void;
|
50
50
|
};
|
51
51
|
type AddPropsClone = Omit<RenderChildrenProps, "children"> & {
|
52
|
-
child: ReactElement
|
52
|
+
child: ReactElement<Record<string, unknown>>;
|
53
53
|
classModifier: string;
|
54
54
|
name: string;
|
55
55
|
getMessageClassModifierFn?: typeof FormClassManager.getMessageClassModifier;
|
@@ -101,7 +101,8 @@ export const renderedChildren = ({ children, wrapper, message, messageType, }) =
|
|
101
101
|
};
|
102
102
|
if (child.props.children) {
|
103
103
|
const subChildren = renderedChildren({
|
104
|
-
children: child.props
|
104
|
+
children: child.props
|
105
|
+
.children,
|
105
106
|
wrapper,
|
106
107
|
message,
|
107
108
|
messageType,
|
@@ -119,7 +120,7 @@ export const renderedChildren = ({ children, wrapper, message, messageType, }) =
|
|
119
120
|
messageType,
|
120
121
|
classModifier: props.classModifier,
|
121
122
|
wrapper,
|
122
|
-
child,
|
123
|
+
child: child,
|
123
124
|
}),
|
124
125
|
});
|
125
126
|
});
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import "@axa-fr/design-system-look-and-feel-css/dist/Layout/Header/Header.scss";
|
2
|
-
import { ComponentPropsWithoutRef } from "react";
|
2
|
+
import { type ComponentPropsWithoutRef, type ReactNode } from "react";
|
3
3
|
type HeaderProps = {
|
4
4
|
defaultActiveLink?: number;
|
5
|
-
previousLink?:
|
6
|
-
rightItem?:
|
5
|
+
previousLink?: ReactNode;
|
6
|
+
rightItem?: ReactNode[];
|
7
7
|
} & ComponentPropsWithoutRef<"header">;
|
8
8
|
export declare const Header: ({ children, defaultActiveLink, previousLink, rightItem, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
|
9
9
|
export {};
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
2
2
|
import "@axa-fr/design-system-look-and-feel-css/dist/Layout/Header/Header.scss";
|
3
3
|
import logo from "@axa-fr/design-system-look-and-feel-css/dist/common/assets/logo-axa.svg";
|
4
|
-
import { useCallback, useState } from "react";
|
4
|
+
import { useCallback, useState, } from "react";
|
5
5
|
import { NavBar } from "./NavBar";
|
6
6
|
import { PreviousLink } from "./PreviousLink/PreviousLink";
|
7
7
|
export const Header = ({ children, defaultActiveLink, previousLink, rightItem, }) => {
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import
|
1
|
+
import { type ComponentPropsWithoutRef, type PropsWithChildren, type Dispatch, type SetStateAction } from "react";
|
2
2
|
import "@axa-fr/design-system-look-and-feel-css/dist/Layout/Header/NavBar/NavBar.scss";
|
3
3
|
type NavBarProps = {
|
4
4
|
activeLink?: number;
|
5
|
-
setActiveLink:
|
5
|
+
setActiveLink: Dispatch<SetStateAction<number | undefined>>;
|
6
6
|
} & ComponentPropsWithoutRef<"nav">;
|
7
7
|
declare const NavBar: ({ activeLink, children, setActiveLink, ...otherProps }: PropsWithChildren<NavBarProps>) => import("react/jsx-runtime").JSX.Element;
|
8
8
|
export { NavBar };
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
2
|
-
import
|
2
|
+
import { isValidElement, useMemo, Children, cloneElement, } from "react";
|
3
3
|
import "@axa-fr/design-system-look-and-feel-css/dist/Layout/Header/NavBar/NavBar.scss";
|
4
4
|
const NavBar = ({ activeLink, children, setActiveLink, ...otherProps }) => {
|
5
|
-
const validChildren = useMemo(() => (
|
6
|
-
return (_jsx("nav", { role: "navigation", "aria-label": "Menu principal", ...otherProps, children: _jsx("ul", { className: "af-navbar-container", role: "menubar", children:
|
5
|
+
const validChildren = useMemo(() => (Children.map(children, (child) => isValidElement(child) && child) ?? []).filter((c) => Boolean(c)), [children]);
|
6
|
+
return (_jsx("nav", { role: "navigation", "aria-label": "Menu principal", ...otherProps, children: _jsx("ul", { className: "af-navbar-container", role: "menubar", children: Children.map(validChildren, (child, index) => (_jsx("li", { className: "af-navbar-item", role: "none", children: cloneElement(child, {
|
7
7
|
className: `af-navbar-item__link ${index === activeLink ? "af-navbar-item__link--active" : ""}`.trim(),
|
8
8
|
onClick: () => setActiveLink(index),
|
9
9
|
onFocus: () => setActiveLink(index),
|
@@ -1,11 +1,12 @@
|
|
1
|
+
import type { HTMLAttributes, MouseEvent, KeyboardEvent } from "react";
|
1
2
|
import type { TitleLevel } from "../../Title";
|
2
|
-
export type ModalCoreHeaderProps =
|
3
|
+
export type ModalCoreHeaderProps = HTMLAttributes<HTMLDivElement> & {
|
3
4
|
className?: string;
|
4
5
|
title: string;
|
5
6
|
subtitle?: string;
|
6
7
|
iconTitle?: string;
|
7
8
|
levelTitle?: TitleLevel;
|
8
|
-
onCancel: (event:
|
9
|
+
onCancel: (event: MouseEvent | KeyboardEvent) => void;
|
9
10
|
closeButtonAriaLabel?: string;
|
10
11
|
};
|
11
12
|
export declare const ModalCoreHeader: ({ className, title, subtitle, iconTitle, levelTitle, onCancel, closeButtonAriaLabel, ...props }: ModalCoreHeaderProps) => import("react/jsx-runtime").JSX.Element;
|
@@ -16,5 +16,5 @@ export type SkeletonProps = {
|
|
16
16
|
colGap?: number;
|
17
17
|
rowGap?: number;
|
18
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;
|
19
|
+
export declare const Skeleton: ({ className, grid, ariaBusy, ariaLabel, maxCols, colGap, rowGap, isLoading, children, }: SkeletonProps) => string | number | bigint | boolean | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
20
20
|
export {};
|
@@ -8,4 +8,4 @@ export type SkeletonListProps = {
|
|
8
8
|
classModifierList?: ComponentPropsWithRef<typeof List>["classModifier"];
|
9
9
|
isLoading: boolean;
|
10
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;
|
11
|
+
export declare const SkeletonList: ({ children, isLoading, lists, classModifierList, }: SkeletonListProps) => 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;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@axa-fr/design-system-look-and-feel-react",
|
3
|
-
"version": "1.0.5-ci.
|
3
|
+
"version": "1.0.5-ci.74",
|
4
4
|
"description": "",
|
5
5
|
"main": "./dist/index.js",
|
6
6
|
"types": "./dist/index.d.ts",
|
@@ -44,7 +44,7 @@
|
|
44
44
|
},
|
45
45
|
"homepage": "https://github.com/AxaFrance/design-system#readme",
|
46
46
|
"peerDependencies": {
|
47
|
-
"@axa-fr/design-system-look-and-feel-css": "1.0.5-ci.
|
47
|
+
"@axa-fr/design-system-look-and-feel-css": "1.0.5-ci.74",
|
48
48
|
"@material-symbols/svg-400": ">= 0.19.0",
|
49
49
|
"react": ">= 18"
|
50
50
|
},
|
@@ -67,5 +67,17 @@
|
|
67
67
|
},
|
68
68
|
"volta": {
|
69
69
|
"extends": "../../../package.json"
|
70
|
+
},
|
71
|
+
"devDependencies": {
|
72
|
+
"@testing-library/dom": "^10.4.0",
|
73
|
+
"@testing-library/jest-dom": "^6.6.3",
|
74
|
+
"@testing-library/react": "^16.2.0",
|
75
|
+
"@testing-library/user-event": "^14.6.1",
|
76
|
+
"@types/jest": "^29.5.14",
|
77
|
+
"@types/jest-axe": "^3.5.9",
|
78
|
+
"@vitest/coverage-v8": "^3.0.7",
|
79
|
+
"@vitest/ui": "^3.0.7",
|
80
|
+
"jest-axe": "^9.0.0",
|
81
|
+
"vitest": "^3.0.7"
|
70
82
|
}
|
71
83
|
}
|