@axa-fr/design-system-look-and-feel-react 1.0.5-ci.68 → 1.0.5-ci.72

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.
@@ -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.children,
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?: JSX.Element;
6
- rightItem?: JSX.Element[];
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 React, { ComponentPropsWithoutRef, PropsWithChildren } from "react";
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: React.Dispatch<React.SetStateAction<number | undefined>>;
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 React, { isValidElement, useMemo, } from "react";
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(() => (React.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: React.Children.map(validChildren, (child, index) => (_jsx("li", { className: "af-navbar-item", role: "none", children: React.cloneElement(child, {
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 = React.HTMLAttributes<HTMLDivElement> & {
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: React.MouseEvent | React.KeyboardEvent) => void;
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;
@@ -1,4 +1,4 @@
1
- import { type ReactNode } from "react";
1
+ import type { ReactNode } from "react";
2
2
  import type { TitleLevel } from ".";
3
3
  type TitleTextProps = {
4
4
  title: ReactNode;
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.68",
3
+ "version": "1.0.5-ci.72",
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.68",
47
+ "@axa-fr/design-system-look-and-feel-css": "1.0.5-ci.72",
48
48
  "@material-symbols/svg-400": ">= 0.19.0",
49
49
  "react": ">= 18"
50
50
  },