@axa-fr/design-system-look-and-feel-react 1.0.4 → 1.0.5-alpha.243

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.
Files changed (160) hide show
  1. package/dist/Accordion/AccordionTagDateContainer.d.ts +1 -1
  2. package/dist/Accordion/AccordionTagDateContainer.js +2 -2
  3. package/dist/AccordionCore/AccordionCore.js +1 -1
  4. package/dist/Alert/Alert.d.ts +3 -3
  5. package/dist/Alert/Alert.js +6 -6
  6. package/dist/BasePicture/BasePicture.d.ts +1 -0
  7. package/dist/BasePicture/BasePicture.js +1 -0
  8. package/dist/Button/Button.d.ts +2 -17
  9. package/dist/Button/Button.js +1 -15
  10. package/dist/Card/Card.js +1 -1
  11. package/dist/CardMessage/CardMessage.d.ts +1 -0
  12. package/dist/CardMessage/CardMessage.js +1 -0
  13. package/dist/ClickIcon/ClickIcon.d.ts +1 -0
  14. package/dist/ClickIcon/ClickIcon.js +1 -0
  15. package/dist/Divider/Divider.d.ts +1 -6
  16. package/dist/Divider/Divider.js +1 -7
  17. package/dist/Form/Checkbox/Checkbox.js +2 -2
  18. package/dist/Form/Checkbox/CheckboxSelect.d.ts +3 -3
  19. package/dist/Form/Checkbox/CheckboxSelect.js +5 -2
  20. package/dist/Form/Date/Date.d.ts +1 -0
  21. package/dist/Form/Date/Date.js +1 -0
  22. package/dist/Form/FileUpload/FileUpload.d.ts +7 -5
  23. package/dist/Form/FileUpload/FileUpload.js +14 -23
  24. package/dist/Form/ItemLabel/ItemLabel.d.ts +1 -0
  25. package/dist/Form/ItemLabel/ItemLabel.js +1 -0
  26. package/dist/Form/ItemMessage/ItemMessage.d.ts +1 -0
  27. package/dist/Form/ItemMessage/ItemMessage.js +1 -0
  28. package/dist/Form/Radio/Radio.js +2 -2
  29. package/dist/Form/Radio/RadioSelect.d.ts +2 -1
  30. package/dist/Form/Radio/RadioSelect.js +5 -2
  31. package/dist/Form/Select/Select.d.ts +1 -27
  32. package/dist/Form/Select/Select.js +1 -27
  33. package/dist/Form/Text/Text.d.ts +1 -13
  34. package/dist/Form/Text/Text.js +1 -18
  35. package/dist/Form/TextArea/TextArea.d.ts +1 -12
  36. package/dist/Form/TextArea/TextArea.js +1 -16
  37. package/dist/Form/core/FieldForm.d.ts +1 -1
  38. package/dist/Form/core/FieldForm.js +3 -2
  39. package/dist/Grid/DebugGrid.d.ts +1 -5
  40. package/dist/Grid/DebugGrid.js +1 -9
  41. package/dist/Icon/Icon.d.ts +1 -0
  42. package/dist/Icon/Icon.js +1 -0
  43. package/dist/IconBg/IconBg.js +1 -1
  44. package/dist/Layout/Header/BurgerMenu/BurgerMenu.d.ts +13 -0
  45. package/dist/Layout/Header/BurgerMenu/BurgerMenu.js +26 -0
  46. package/dist/Layout/Header/BurgerMenu/index.d.ts +1 -0
  47. package/dist/Layout/Header/BurgerMenu/index.js +1 -0
  48. package/dist/Layout/Header/Header.d.ts +6 -6
  49. package/dist/Layout/Header/Header.js +30 -4
  50. package/dist/Layout/Header/NavBar/NavBar.d.ts +3 -3
  51. package/dist/Layout/Header/NavBar/NavBar.js +10 -5
  52. package/dist/Layout/Header/PreviousLink/PreviousLink.d.ts +1 -1
  53. package/dist/Layout/Header/PreviousLink/PreviousLink.js +3 -1
  54. package/dist/Layout/Header/index.d.ts +3 -0
  55. package/dist/Layout/Header/index.js +3 -0
  56. package/dist/Link/Link.d.ts +1 -10
  57. package/dist/Link/Link.js +1 -14
  58. package/dist/List/ClickItem/ClickItem.d.ts +2 -0
  59. package/dist/List/ClickItem/ClickItem.js +9 -0
  60. package/dist/List/{ClickList/ClickItem → ClickItem}/index.d.ts +1 -0
  61. package/dist/List/{ClickList/ClickItem → ClickItem}/index.js +1 -0
  62. package/dist/List/ContentItemDuo/ContentItemDuo.d.ts +2 -1
  63. package/dist/List/ContentItemDuo/ContentItemDuo.js +3 -4
  64. package/dist/List/ContentItemMono/ContentItemMono.js +1 -1
  65. package/dist/List/ContentTabList/ContentTabItem/ContentTabItem.js +2 -2
  66. package/dist/Message/Message.d.ts +2 -0
  67. package/dist/Message/Message.js +1 -0
  68. package/dist/Modal/Modal.d.ts +12 -0
  69. package/dist/Modal/Modal.js +10 -0
  70. package/dist/Modal/ModalCore.d.ts +11 -0
  71. package/dist/Modal/ModalCore.js +6 -0
  72. package/dist/Modal/components/ModalCoreBody.d.ts +2 -0
  73. package/dist/Modal/components/ModalCoreBody.js +2 -0
  74. package/dist/Modal/components/ModalCoreFooter.d.ts +2 -0
  75. package/dist/Modal/components/ModalCoreFooter.js +2 -0
  76. package/dist/Modal/components/ModalCoreHeader.d.ts +12 -0
  77. package/dist/Modal/components/ModalCoreHeader.js +8 -0
  78. package/dist/Modal/index.d.ts +5 -0
  79. package/dist/Modal/index.js +5 -0
  80. package/dist/ProgressBar/ProgressBar.d.ts +1 -0
  81. package/dist/ProgressBar/ProgressBar.js +1 -0
  82. package/dist/ProgressBarGroup/ProgressBarGroup.d.ts +1 -0
  83. package/dist/ProgressBarGroup/ProgressBarGroup.js +1 -0
  84. package/dist/Skeleton/Skeleton.d.ts +1 -1
  85. package/dist/SkeletonList/SkeletonList.d.ts +1 -1
  86. package/dist/Spinner/Spinner.d.ts +2 -0
  87. package/dist/Spinner/Spinner.js +1 -0
  88. package/dist/Stepper/Stepper.d.ts +1 -12
  89. package/dist/Stepper/Stepper.js +1 -22
  90. package/dist/Tag/Tag.d.ts +2 -6
  91. package/dist/Tag/Tag.js +1 -7
  92. package/dist/TimelineVertical/TimelineVertical.d.ts +1 -0
  93. package/dist/TimelineVertical/TimelineVertical.js +1 -0
  94. package/dist/Title/Title.js +1 -1
  95. package/dist/Title/TitleWithSubtitles.d.ts +1 -1
  96. package/dist/Toggle/Toggle.d.ts +1 -0
  97. package/dist/Toggle/Toggle.js +1 -0
  98. package/dist/index.d.ts +27 -13
  99. package/dist/index.js +26 -12
  100. package/dist/utilities/helpers/getComponentClassName.d.ts +1 -1
  101. package/dist/utilities/helpers/getComponentClassName.js +6 -10
  102. package/package.json +38 -71
  103. package/dist/Divider/index.d.ts +0 -2
  104. package/dist/Divider/index.js +0 -2
  105. package/dist/Form/Select/CustomOption.d.ts +0 -4
  106. package/dist/Form/Select/CustomOption.js +0 -8
  107. package/dist/Form/Select/DropdownIndicator.d.ts +0 -4
  108. package/dist/Form/Select/DropdownIndicator.js +0 -11
  109. package/dist/Form/Select/index.d.ts +0 -1
  110. package/dist/Form/Select/index.js +0 -1
  111. package/dist/Form/Text/index.d.ts +0 -1
  112. package/dist/Form/Text/index.js +0 -1
  113. package/dist/Form/TextArea/index.d.ts +0 -2
  114. package/dist/Form/TextArea/index.js +0 -2
  115. package/dist/Grid/components/Card.d.ts +0 -3
  116. package/dist/Grid/components/Card.js +0 -2
  117. package/dist/Grid/components/Contacts.d.ts +0 -1
  118. package/dist/Grid/components/Contacts.js +0 -9
  119. package/dist/Grid/components/MainTitle.d.ts +0 -1
  120. package/dist/Grid/components/MainTitle.js +0 -4
  121. package/dist/Grid/components/MyFooter.d.ts +0 -1
  122. package/dist/Grid/components/MyFooter.js +0 -31
  123. package/dist/Grid/components/MyHeader.d.ts +0 -1
  124. package/dist/Grid/components/MyHeader.js +0 -9
  125. package/dist/Grid/components/MyList.d.ts +0 -1
  126. package/dist/Grid/components/MyList.js +0 -3
  127. package/dist/Grid/components/Offsets.d.ts +0 -1
  128. package/dist/Grid/components/Offsets.js +0 -7
  129. package/dist/Grid/renderExampleForm.d.ts +0 -1
  130. package/dist/Grid/renderExampleForm.js +0 -30
  131. package/dist/Grid/renderExamplePage.d.ts +0 -1
  132. package/dist/Grid/renderExamplePage.js +0 -9
  133. package/dist/Grid/renderWireframe.d.ts +0 -1
  134. package/dist/Grid/renderWireframe.js +0 -5
  135. package/dist/Link/index.d.ts +0 -2
  136. package/dist/Link/index.js +0 -2
  137. package/dist/List/ClickList/ClickItem/ClickItem.d.ts +0 -2
  138. package/dist/List/ClickList/ClickItem/ClickItem.js +0 -9
  139. package/dist/List/ClickList/ClickList.d.ts +0 -8
  140. package/dist/List/ClickList/ClickList.js +0 -4
  141. package/dist/List/ClickList/index.d.ts +0 -3
  142. package/dist/List/ClickList/index.js +0 -3
  143. package/dist/Loader/Loader.d.ts +0 -12
  144. package/dist/Loader/Loader.js +0 -11
  145. package/dist/Loader/index.d.ts +0 -1
  146. package/dist/Loader/index.js +0 -1
  147. package/dist/ModalClient/Modal.container.d.ts +0 -4
  148. package/dist/ModalClient/Modal.container.js +0 -45
  149. package/dist/ModalClient/Modal.d.ts +0 -4
  150. package/dist/ModalClient/Modal.hook.d.ts +0 -6
  151. package/dist/ModalClient/Modal.hook.js +0 -25
  152. package/dist/ModalClient/Modal.js +0 -6
  153. package/dist/ModalClient/index.d.ts +0 -1
  154. package/dist/ModalClient/index.js +0 -1
  155. package/dist/ModalClient/type.d.ts +0 -38
  156. package/dist/ModalClient/type.js +0 -1
  157. package/dist/Tag/index.d.ts +0 -2
  158. package/dist/Tag/index.js +0 -2
  159. /package/dist/List/{ClickList/ClickItem → ClickItem}/ClickItem.helpers.d.ts +0 -0
  160. /package/dist/List/{ClickList/ClickItem → ClickItem}/ClickItem.helpers.js +0 -0
@@ -0,0 +1 @@
1
+ export { Icon, iconVariants, iconSizeVariants, } from "@axa-fr/design-system-apollo-react/lf";
@@ -7,7 +7,7 @@ export const IconBg = ({ children, className, classModifier, isDisabled = false,
7
7
  if (isDisabled) {
8
8
  newClassModifier += " disabled";
9
9
  }
10
- return getComponentClassName(className, newClassModifier, "af-icon-bg");
10
+ return getComponentClassName("af-icon-bg", className, newClassModifier);
11
11
  }, [classModifier, isDisabled, className]);
12
12
  return _jsx("div", { className: componentClassName, children: children });
13
13
  };
@@ -0,0 +1,13 @@
1
+ import { type ComponentPropsWithoutRef, type Dispatch, type ReactElement, type SetStateAction } from "react";
2
+ import "@axa-fr/design-system-look-and-feel-css/dist/Layout/Header/BurgerMenu/BurgerMenu.scss";
3
+ import "@axa-fr/design-system-look-and-feel-css/dist/Card/Card.scss";
4
+ import "@axa-fr/design-system-look-and-feel-css/dist/List/List.scss";
5
+ import "@axa-fr/design-system-look-and-feel-css/dist/List/ClickItem/ClickItem.scss";
6
+ type BurgerMenuProps = {
7
+ isOpen: boolean;
8
+ items: ReactElement[];
9
+ setActiveLink: Dispatch<SetStateAction<number | undefined>>;
10
+ setIsOpen: Dispatch<SetStateAction<boolean>>;
11
+ } & ComponentPropsWithoutRef<"nav">;
12
+ declare const BurgerMenu: ({ isOpen, items, setActiveLink, setIsOpen, ...props }: BurgerMenuProps) => import("react/jsx-runtime").JSX.Element | null;
13
+ export { BurgerMenu };
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import "@axa-fr/design-system-look-and-feel-css/dist/Layout/Header/BurgerMenu/BurgerMenu.scss";
3
+ import "@axa-fr/design-system-look-and-feel-css/dist/Card/Card.scss";
4
+ import "@axa-fr/design-system-look-and-feel-css/dist/List/List.scss";
5
+ import "@axa-fr/design-system-look-and-feel-css/dist/List/ClickItem/ClickItem.scss";
6
+ import classNames from "classnames";
7
+ import { ClickItem, createClickItemParent } from "../../../List/ClickItem";
8
+ const BurgerMenu = ({ isOpen, items, setActiveLink, setIsOpen, ...props }) => {
9
+ const handleOnClick = (index) => () => {
10
+ setActiveLink(index);
11
+ setIsOpen(false);
12
+ };
13
+ if (items.length === 0)
14
+ return null;
15
+ return (_jsx("nav", { role: "navigation", "aria-label": "Menu principal mobile", "aria-hidden": !isOpen, className: classNames("af-card", "af-card--list", "af-burger-menu", {
16
+ open: isOpen,
17
+ }), ...props, children: _jsx("ul", { role: "menubar", children: items.map((item, index) => {
18
+ const { key, props: itemProps, type } = item;
19
+ const { children, ...otherProps } = itemProps;
20
+ return (_jsx("li", { className: "af-list__item", role: "none", children: _jsx(ClickItem, { classModifier: "small", onClick: handleOnClick(index), parentClickComponent: createClickItemParent(type, {
21
+ ...otherProps,
22
+ role: "menuitem",
23
+ }), children: children }) }, key ?? `list item ${index}`));
24
+ }) }) }));
25
+ };
26
+ export { BurgerMenu };
@@ -0,0 +1 @@
1
+ export { BurgerMenu } from "./BurgerMenu";
@@ -0,0 +1 @@
1
+ export { BurgerMenu } from "./BurgerMenu";
@@ -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";
3
- type HeaderProps = {
2
+ import { ComponentProps, PropsWithChildren, ReactElement, type ReactNode } from "react";
3
+ type HeaderProps = PropsWithChildren<{
4
4
  defaultActiveLink?: number;
5
- previousLink?: JSX.Element;
6
- rightItem?: JSX.Element[];
7
- } & ComponentPropsWithoutRef<"header">;
8
- export declare const Header: ({ children, defaultActiveLink, previousLink, rightItem, }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
5
+ previousLink?: ReactNode;
6
+ rightItem?: ReactElement | ReactElement[];
7
+ } & ComponentProps<"header">>;
8
+ export declare const Header: ({ children, defaultActiveLink, previousLink, rightItem, ...props }: HeaderProps) => import("react/jsx-runtime").JSX.Element;
9
9
  export {};
@@ -1,11 +1,37 @@
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
- import logo from "@axa-fr/design-system-look-and-feel-css/dist/common/assets/logo-axa.svg";
4
- import { useCallback, useState } from "react";
3
+ import logo from "@axa-fr/design-system-look-and-feel-css/logo-axa.svg";
4
+ import { Children, isValidElement, useCallback, useEffect, useMemo, useState, } from "react";
5
+ import menu from "@material-symbols/svg-400/outlined/menu.svg";
5
6
  import { NavBar } from "./NavBar";
6
7
  import { PreviousLink } from "./PreviousLink/PreviousLink";
7
- export const Header = ({ children, defaultActiveLink, previousLink, rightItem, }) => {
8
+ import { Button, IconBg, Svg } from "../..";
9
+ import { BurgerMenu } from "./BurgerMenu";
10
+ import { BREAKPOINT } from "../../utilities";
11
+ export const Header = ({ children, defaultActiveLink, previousLink, rightItem, ...props }) => {
8
12
  const [activeLink, setActiveLink] = useState(defaultActiveLink);
13
+ const [isOpen, setIsOpen] = useState(false);
14
+ const toggleMenu = () => setIsOpen((prev) => !prev);
9
15
  const resetActiveLink = useCallback(() => setActiveLink(defaultActiveLink), [defaultActiveLink]);
10
- return (_jsxs(_Fragment, { children: [_jsx("header", { className: "af-header", children: _jsxs("div", { className: "af-header-container", children: [_jsxs("div", { className: "af-header-left-item", children: [_jsx("img", { className: "af-logo", src: logo, alt: "" }), children && (_jsx(NavBar, { activeLink: activeLink, setActiveLink: setActiveLink, children: children }))] }), rightItem && _jsx("div", { className: "af-header-right-item", children: rightItem })] }) }), previousLink && (_jsx(PreviousLink, { handleClick: resetActiveLink, children: previousLink }))] }));
16
+ useEffect(() => {
17
+ const handleResize = () => {
18
+ if (window.innerWidth > BREAKPOINT.MD && isOpen) {
19
+ setIsOpen(false);
20
+ }
21
+ };
22
+ window.addEventListener("resize", handleResize);
23
+ return () => window.removeEventListener("resize", handleResize);
24
+ }, [isOpen]);
25
+ const burgerMenuItems = useMemo(() => {
26
+ const mapValidElements = (items) => (Children.map(items, (child) => isValidElement(child) && child) ?? []).filter(Boolean);
27
+ const validLinks = mapValidElements(children);
28
+ if (!rightItem) {
29
+ return [...validLinks];
30
+ }
31
+ if (Array.isArray(rightItem)) {
32
+ return [...validLinks, ...mapValidElements(rightItem)];
33
+ }
34
+ return [...validLinks, rightItem];
35
+ }, [children, rightItem]);
36
+ return (_jsxs(_Fragment, { children: [_jsxs("header", { className: "af-header", ...props, children: [_jsxs("div", { className: "af-header-container", children: [_jsxs("div", { className: "af-header-left-item", children: [_jsx("img", { className: "af-logo", src: logo, alt: "logo AXA" }), _jsx(NavBar, { activeLink: activeLink, setActiveLink: setActiveLink, children: children })] }), rightItem && _jsx("div", { className: "af-header-right-item", children: rightItem }), burgerMenuItems && burgerMenuItems.length > 0 && (_jsx(Button, { "aria-label": isOpen ? "Fermer le menu" : "Ouvrir le menu", onClick: toggleMenu, variant: "ghost", children: _jsx(IconBg, { children: _jsx(Svg, { src: menu, "aria-hidden": "true" }) }) }))] }), _jsx(BurgerMenu, { isOpen: isOpen, items: burgerMenuItems, setActiveLink: setActiveLink, setIsOpen: setIsOpen })] }), _jsx(PreviousLink, { handleClick: resetActiveLink, children: previousLink }), burgerMenuItems && burgerMenuItems.length > 0 && (_jsx("div", { className: `af-header-overlay ${isOpen ? "open" : ""}` }))] }));
11
37
  };
@@ -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
- declare const NavBar: ({ activeLink, children, setActiveLink, ...otherProps }: PropsWithChildren<NavBarProps>) => import("react/jsx-runtime").JSX.Element;
7
+ declare const NavBar: ({ activeLink, children, setActiveLink, ...props }: PropsWithChildren<NavBarProps>) => import("react/jsx-runtime").JSX.Element | null;
8
8
  export { NavBar };
@@ -1,10 +1,15 @@
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
- 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, {
7
- className: `af-navbar-item__link ${index === activeLink ? "af-navbar-item__link--active" : ""}`.trim(),
4
+ import classNames from "classnames";
5
+ const NavBar = ({ activeLink, children, setActiveLink, ...props }) => {
6
+ const validChildren = useMemo(() => (Children.map(children, (child) => isValidElement(child) && child) ?? []).filter((c) => Boolean(c)), [children]);
7
+ if (validChildren.length === 0)
8
+ return null;
9
+ return (_jsx("nav", { role: "navigation", "aria-label": "Menu principal", ...props, 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, {
10
+ className: classNames("af-navbar-item__link", {
11
+ "af-navbar-item__link--active": index === activeLink,
12
+ }),
8
13
  onClick: () => setActiveLink(index),
9
14
  onFocus: () => setActiveLink(index),
10
15
  role: "menuitem",
@@ -3,5 +3,5 @@ import { ComponentPropsWithoutRef, PropsWithChildren } from "react";
3
3
  type PreviousLinkProps = {
4
4
  handleClick: () => void;
5
5
  } & ComponentPropsWithoutRef<"div">;
6
- declare const PreviousLink: ({ handleClick, children, ...otherProps }: PropsWithChildren<PreviousLinkProps>) => import("react/jsx-runtime").JSX.Element;
6
+ declare const PreviousLink: ({ handleClick, children, ...otherProps }: PropsWithChildren<PreviousLinkProps>) => import("react/jsx-runtime").JSX.Element | null;
7
7
  export { PreviousLink };
@@ -5,8 +5,10 @@ import React, { isValidElement, useMemo, } from "react";
5
5
  import { Svg } from "../../../Svg";
6
6
  const PreviousLink = ({ handleClick, children, ...otherProps }) => {
7
7
  const validChildren = useMemo(() => (React.Children.map(children, (child) => isValidElement(child) && child) ?? []).filter((c) => Boolean(c)), [children]);
8
+ if (validChildren.length === 0)
9
+ return null;
8
10
  return (_jsx("div", { className: "af-header-previous-link-container", ...otherProps, children: React.Children.map(validChildren, (child) => React.cloneElement(child, {
9
- children: (_jsxs(_Fragment, { children: [_jsx(Svg, { src: arrowBack }), child.props.children] })),
11
+ children: (_jsxs(_Fragment, { children: [_jsx(Svg, { src: arrowBack, "aria-hidden": true }), child.props.children] })),
10
12
  className: "af-btn-client af-btn-client--ghost af-btn-client--header-previous-link",
11
13
  onClick: handleClick,
12
14
  })) }));
@@ -1 +1,4 @@
1
+ export { BurgerMenu } from "./BurgerMenu";
1
2
  export { Header } from "./Header";
3
+ export { NavBar } from "./NavBar";
4
+ export { PreviousLink } from "./PreviousLink";
@@ -1 +1,4 @@
1
+ export { BurgerMenu } from "./BurgerMenu";
1
2
  export { Header } from "./Header";
3
+ export { NavBar } from "./NavBar";
4
+ export { PreviousLink } from "./PreviousLink";
@@ -1,10 +1 @@
1
- import { ComponentPropsWithoutRef, PropsWithChildren, type ReactNode } from "react";
2
- type LinkProps = {
3
- openInNewTab?: boolean;
4
- leftIcon?: ReactNode;
5
- rightIcon?: ReactNode;
6
- className?: string;
7
- classModifier?: string;
8
- } & ComponentPropsWithoutRef<"a">;
9
- export declare const Link: ({ href, openInNewTab, leftIcon, rightIcon, children, className, classModifier, ...props }: PropsWithChildren<LinkProps>) => import("react/jsx-runtime").JSX.Element;
10
- export {};
1
+ export { Link } from "@axa-fr/design-system-apollo-react/lf";
package/dist/Link/Link.js CHANGED
@@ -1,14 +1 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import openInNew from "@material-symbols/svg-400/outlined/open_in_new.svg";
3
- import { useMemo, } from "react";
4
- import { Svg } from "../Svg";
5
- import { getComponentClassName } from "../utilities";
6
- export const Link = ({ href, openInNewTab = false, leftIcon, rightIcon, children, className, classModifier = "", ...props }) => {
7
- const newTabProps = openInNewTab && {
8
- target: "_blank",
9
- rel: "noopener noreferrer",
10
- };
11
- const componentClassName = useMemo(() => getComponentClassName(className, `${classModifier}${!className && openInNewTab ? " openInNewTab" : ""}`, "af-link"), [classModifier, className, openInNewTab]);
12
- return (_jsxs("a", { className: componentClassName, href: href, ...newTabProps, ...props, children: [leftIcon, children, (openInNewTab || Boolean(rightIcon)) &&
13
- (rightIcon ?? _jsx(Svg, { src: openInNew }))] }));
14
- };
1
+ export { Link } from "@axa-fr/design-system-apollo-react/lf";
@@ -0,0 +1,2 @@
1
+ import type { TClickItem } from "./types";
2
+ export declare const ClickItem: ({ children, icon, parentClickComponent: ClickComponent, isDisabled, disabled, className, classModifier, actionIcon, ...otherProps }: TClickItem) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import chevron from "@material-symbols/svg-400/outlined/chevron_right.svg";
3
+ import { useMemo } from "react";
4
+ import { Svg } from "../../Svg";
5
+ import { getComponentClassName } from "../../utilities";
6
+ export const ClickItem = ({ children, icon, parentClickComponent: ClickComponent = ({ children: parentClickComponentChildren, ...parentClickComponentProps }) => (_jsx("button", { type: "button", ...parentClickComponentProps, children: parentClickComponentChildren })), isDisabled = false, disabled = isDisabled, className, classModifier = "", actionIcon = _jsx(Svg, { src: chevron, "aria-hidden": true }), ...otherProps }) => {
7
+ const componentClassName = useMemo(() => getComponentClassName("af-click-item", className, `${classModifier}${disabled ? " disabled" : ""}`), [className, classModifier, disabled]);
8
+ return (_jsxs(ClickComponent, { className: componentClassName, disabled: disabled, ...otherProps, children: [_jsxs("div", { className: "af-click-item__content", children: [icon && _jsx("div", { className: "af-click-item__icon", children: icon }), _jsx("div", { className: "af-click-item__label", children: children })] }), _jsx("div", { className: "af-click-item__action", children: actionIcon })] }));
9
+ };
@@ -1,2 +1,3 @@
1
+ import "@axa-fr/design-system-look-and-feel-css/dist/List/ClickItem/ClickItem.scss";
1
2
  export { ClickItem } from "./ClickItem";
2
3
  export { createClickItemParent } from "./ClickItem.helpers";
@@ -1,2 +1,3 @@
1
+ import "@axa-fr/design-system-look-and-feel-css/dist/List/ClickItem/ClickItem.scss";
1
2
  export { ClickItem } from "./ClickItem";
2
3
  export { createClickItemParent } from "./ClickItem.helpers";
@@ -1,6 +1,7 @@
1
+ import { type ReactNode } from "react";
1
2
  type ContentItemDuoProps = {
2
3
  label: string;
3
- value: string;
4
+ value: ReactNode;
4
5
  isVertical?: boolean;
5
6
  className?: string;
6
7
  classModifier?: string;
@@ -2,17 +2,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import checkIcon from "@material-symbols/svg-400/outlined/check.svg";
3
3
  import closeIcon from "@material-symbols/svg-400/outlined/close.svg";
4
4
  import { useMemo } from "react";
5
- import { Variants } from "../../Button/Button";
6
- import { getComponentClassName } from "../../utilities";
7
5
  import { Button, Svg } from "../..";
6
+ import { getComponentClassName } from "../../utilities";
8
7
  export const ContentItemDuo = ({ label, value, isVertical = false, className, classModifier, isShowingDoneIcon = false, isShowingCloseIcon = false, buttonText, onButtonClick, }) => {
9
8
  const componentClassName = useMemo(() => {
10
9
  const classModifiers = [classModifier];
11
10
  if (isVertical) {
12
11
  classModifiers.push("vertical");
13
12
  }
14
- return getComponentClassName(className, classModifiers.filter(Boolean).join(" "), "af-content-item-duo");
13
+ return getComponentClassName("af-content-item-duo", className, classModifiers.filter(Boolean).join(" "));
15
14
  }, [classModifier, className, isVertical]);
16
15
  const iconContainerModifier = useMemo(() => ` af-content-item-duo__icon--${isShowingDoneIcon ? "done" : "close"}`, [isShowingDoneIcon]);
17
- return (_jsxs("div", { className: componentClassName, children: [(isShowingDoneIcon || isShowingCloseIcon) && (_jsxs("div", { className: `af-content-item-duo__icon${iconContainerModifier}`, children: [isShowingDoneIcon && _jsx(Svg, { src: checkIcon }), isShowingCloseIcon && _jsx(Svg, { src: closeIcon })] })), _jsx("p", { className: "af-content-item-duo__label", children: label }), _jsx("p", { className: "af-content-item-duo__value", children: value }), buttonText && (_jsx("div", { className: "af-content-item-duo__button", children: _jsx(Button, { variant: Variants.ghost, onClick: onButtonClick, children: buttonText }) }))] }));
16
+ return (_jsxs("div", { className: componentClassName, children: [(isShowingDoneIcon || isShowingCloseIcon) && (_jsxs("div", { className: `af-content-item-duo__icon${iconContainerModifier}`, children: [isShowingDoneIcon && _jsx(Svg, { src: checkIcon }), isShowingCloseIcon && _jsx(Svg, { src: closeIcon })] })), _jsx("p", { className: "af-content-item-duo__label", children: label }), typeof value === "string" ? (_jsx("p", { className: "af-content-item-duo__value", children: value })) : (_jsx("div", { className: "af-content-item-duo__value", children: value })), buttonText && (_jsx("div", { className: "af-content-item-duo__button", children: _jsx(Button, { variant: "ghost", onClick: onButtonClick, children: buttonText }) }))] }));
18
17
  };
@@ -8,7 +8,7 @@ export const ContentItemMono = ({ children, className, classModifier, secondaryT
8
8
  if (isDisabled) {
9
9
  classModifiers.push("disabled");
10
10
  }
11
- return getComponentClassName(className, classModifiers.filter(Boolean).join(" "), "af-content-item-mono");
11
+ return getComponentClassName("af-content-item-mono", className, classModifiers.filter(Boolean).join(" "));
12
12
  }, [classModifier, isDisabled, size, className]);
13
13
  return (_jsxs("div", { className: componentClassName, children: [hasStick && (_jsx("div", { className: "af-content-item-mono__stick", role: "presentation" })), leftElement && (_jsx("div", { className: `af-content-item-mono__left-container${isLeftElementCentered
14
14
  ? " af-content-item-mono__left-container--center"
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Tag } from "../../..";
3
- export const ContentTabItem = ({ title, subtitle, tag, tagProps, date, actions = [], value, isMobile = false, }) => (_jsxs(_Fragment, { children: [_jsxs("div", { className: "af-list-item__left-container", children: [Boolean(value) && (Boolean(tag) || Boolean(date)) && (_jsxs("div", { className: "af-list-item__additional-data-container", children: [Boolean(tag) && (_jsx(Tag, { classModifier: "warning", ...tagProps, children: tag })), Boolean(date) && _jsx("span", { className: "af-list-item__date", children: date })] })), _jsxs("div", { className: "af-list-item__label", children: [_jsx("span", { className: "af-list-item-label__title", children: title }), Boolean(subtitle) && (_jsx("span", { className: "af-list-item-label__subtitle", children: subtitle }))] }), !value && isMobile && (Boolean(tag) || Boolean(date)) && (_jsxs("div", { className: "af-list-item__additional-data-container", children: [Boolean(tag) && (_jsx(Tag, { classModifier: "warning", ...tagProps, children: tag })), Boolean(date) && _jsx("span", { className: "af-list-item__date", children: date })] }))] }), (actions.length > 0 ||
3
+ export const ContentTabItem = ({ title, subtitle, tag, tagProps, date, actions = [], value, isMobile = false, }) => (_jsxs(_Fragment, { children: [_jsxs("div", { className: "af-list-item__left-container", children: [Boolean(value) && (Boolean(tag) || Boolean(date)) && (_jsxs("div", { className: "af-list-item__additional-data-container", children: [Boolean(tag) && (_jsx(Tag, { variant: "warning", ...tagProps, children: tag })), Boolean(date) && _jsx("span", { className: "af-list-item__date", children: date })] })), _jsxs("div", { className: "af-list-item__label", children: [_jsx("span", { className: "af-list-item-label__title", children: title }), Boolean(subtitle) && (_jsx("span", { className: "af-list-item-label__subtitle", children: subtitle }))] }), !value && isMobile && (Boolean(tag) || Boolean(date)) && (_jsxs("div", { className: "af-list-item__additional-data-container", children: [Boolean(tag) && (_jsx(Tag, { variant: "warning", ...tagProps, children: tag })), Boolean(date) && _jsx("span", { className: "af-list-item__date", children: date })] }))] }), (actions.length > 0 ||
4
4
  Boolean(tag) ||
5
5
  Boolean(date) ||
6
- Boolean(value)) && (_jsxs("div", { className: "af-list-item__right-container", children: [!value && (Boolean(tag) || Boolean(date)) && !isMobile && (_jsxs("div", { className: "af-list-item__additional-data-container", children: [Boolean(tag) && (_jsx(Tag, { classModifier: "warning", ...tagProps, children: tag })), Boolean(date) && (_jsx("span", { className: "af-list-item__date", children: date }))] })), actions.map(({ id, component }) => (_jsx("div", { className: "af-list-item__action-container", children: component }, id))), Boolean(value) && _jsx("span", { className: "af-list-item__value", children: value })] }))] }));
6
+ Boolean(value)) && (_jsxs("div", { className: "af-list-item__right-container", children: [!value && (Boolean(tag) || Boolean(date)) && !isMobile && (_jsxs("div", { className: "af-list-item__additional-data-container", children: [Boolean(tag) && (_jsx(Tag, { variant: "warning", ...tagProps, children: tag })), Boolean(date) && (_jsx("span", { className: "af-list-item__date", children: date }))] })), actions.map(({ id, component }) => (_jsx("div", { className: "af-list-item__action-container", children: component }, id))), Boolean(value) && _jsx("span", { className: "af-list-item__value", children: value })] }))] }));
@@ -0,0 +1,2 @@
1
+ export { Message, messageVariants, } from "@axa-fr/design-system-apollo-react/lf";
2
+ export type { MessageVariants } from "@axa-fr/design-system-apollo-react/lf";
@@ -0,0 +1 @@
1
+ export { Message, messageVariants, } from "@axa-fr/design-system-apollo-react/lf";
@@ -0,0 +1,12 @@
1
+ import React from "react";
2
+ import { type ModalCoreProps } from "./ModalCore";
3
+ import { type ModalCoreHeaderProps } from "./components/ModalCoreHeader";
4
+ export type ModalProps = Omit<ModalCoreProps, "onOutsideTap" | "title"> & ModalCoreHeaderProps & {
5
+ onSubmit?: (event: React.MouseEvent | React.KeyboardEvent) => void;
6
+ submitTitle?: string;
7
+ cancelTitle?: string;
8
+ submitDisabled?: boolean;
9
+ cancelDisabled?: boolean;
10
+ };
11
+ declare const Modal: React.ForwardRefExoticComponent<Omit<ModalProps, "ref"> & React.RefAttributes<HTMLDialogElement>>;
12
+ export { Modal };
@@ -0,0 +1,10 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import { ModalCore } from "./ModalCore";
4
+ import { Button } from "../Button/Button";
5
+ import { ModalCoreHeader, } from "./components/ModalCoreHeader";
6
+ import { ModalCoreBody } from "./components/ModalCoreBody";
7
+ import { ModalCoreFooter } from "./components/ModalCoreFooter";
8
+ const Modal = forwardRef(({ children, title, submitTitle, cancelTitle, className, onCancel, onSubmit, closeButtonAriaLabel, cancelDisabled, submitDisabled, subtitle, iconTitle, levelTitle, ...props }, ref) => (_jsxs(ModalCore, { className: className, onOutsideTap: onCancel, title: title, ref: ref, ...props, children: [_jsx(ModalCoreHeader, { title: title, subtitle: subtitle, iconTitle: iconTitle, levelTitle: levelTitle, onCancel: onCancel, closeButtonAriaLabel: closeButtonAriaLabel }), _jsx(ModalCoreBody, { children: children }), _jsxs(ModalCoreFooter, { children: [onCancel && cancelTitle && (_jsx(Button, { variant: "secondary", onClick: onCancel, disabled: cancelDisabled, children: cancelTitle })), onSubmit && submitTitle && (_jsx(Button, { variant: "primary", onClick: onSubmit, disabled: submitDisabled, children: submitTitle }))] })] })));
9
+ Modal.displayName = "Modal";
10
+ export { Modal };
@@ -0,0 +1,11 @@
1
+ import { type ReactNode } from "react";
2
+ import "@axa-fr/design-system-look-and-feel-css/dist/Modal/Modal.scss";
3
+ export type ModalCoreProps = React.DetailedHTMLProps<React.DialogHTMLAttributes<HTMLDialogElement>, HTMLDialogElement> & {
4
+ className?: string;
5
+ title: string;
6
+ onOutsideTap: (event: React.MouseEvent | React.KeyboardEvent) => void;
7
+ children: ReactNode;
8
+ ref?: React.Ref<HTMLDialogElement>;
9
+ };
10
+ declare const ModalCore: import("react").ForwardRefExoticComponent<Omit<ModalCoreProps, "ref"> & import("react").RefAttributes<HTMLDialogElement>>;
11
+ export { ModalCore };
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { forwardRef } from "react";
3
+ import "@axa-fr/design-system-look-and-feel-css/dist/Modal/Modal.scss";
4
+ const ModalCore = forwardRef(({ className, title = "", onOutsideTap, children, ...props }, ref) => (_jsx("dialog", { "aria-label": title, className: ["af-modal", className].filter(Boolean).join(" "), onClick: onOutsideTap, ref: ref, ...props, children: _jsx("div", { className: "af-modal__dialog", onClick: (e) => e.stopPropagation(), children: _jsx("div", { className: "af-modal__content", children: children }) }) })));
5
+ ModalCore.displayName = "ModalCore";
6
+ export { ModalCore };
@@ -0,0 +1,2 @@
1
+ export type ModalCoreBodyProps = React.HTMLAttributes<HTMLDivElement>;
2
+ export declare const ModalCoreBody: ({ children, className, ...otherProps }: ModalCoreBodyProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export const ModalCoreBody = ({ children, className, ...otherProps }) => (_jsx("section", { className: ["af-modal__body", className].filter(Boolean).join(" "), ...otherProps, children: children }));
@@ -0,0 +1,2 @@
1
+ export type ModalCoreFooterProps = React.HTMLAttributes<HTMLDivElement>;
2
+ export declare const ModalCoreFooter: ({ className, ...rest }: ModalCoreFooterProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export const ModalCoreFooter = ({ className, ...rest }) => (_jsx("footer", { className: ["af-modal__footer", className].filter(Boolean).join(" "), ...rest }));
@@ -0,0 +1,12 @@
1
+ import type { HTMLAttributes, MouseEvent, KeyboardEvent } from "react";
2
+ import type { TitleLevel } from "../../Title";
3
+ export type ModalCoreHeaderProps = HTMLAttributes<HTMLDivElement> & {
4
+ className?: string;
5
+ title: string;
6
+ subtitle?: string;
7
+ iconTitle?: string;
8
+ levelTitle?: TitleLevel;
9
+ onCancel: (event: MouseEvent | KeyboardEvent) => void;
10
+ closeButtonAriaLabel?: string;
11
+ };
12
+ export declare const ModalCoreHeader: ({ className, title, subtitle, iconTitle, levelTitle, onCancel, closeButtonAriaLabel, ...props }: ModalCoreHeaderProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import closeSmall from "@material-symbols/svg-400/outlined/close.svg";
3
+ import { Button } from "../../Button/Button";
4
+ import { Svg } from "../../Svg";
5
+ export const ModalCoreHeader = ({ className, title, subtitle, iconTitle, levelTitle = 2, onCancel, closeButtonAriaLabel = "Fermer la boite de dialogue", ...props }) => {
6
+ const HLevel = `h${levelTitle}`;
7
+ return (_jsxs("header", { className: ["af-modal__header", className].filter(Boolean).join(" "), ...props, children: [_jsx(Button, { variant: "ghost", iconLeft: _jsx(Svg, { src: closeSmall, width: 32, height: 32, role: "graphics-document" }), "aria-label": closeButtonAriaLabel, onClick: onCancel }), _jsxs("div", { className: "af-modal__header-title", children: [iconTitle && (_jsx(Svg, { src: iconTitle, width: 32, height: 32, role: "graphics-document" })), _jsx(HLevel, { className: "af-modal__header-title-heading", children: title }), subtitle && (_jsx("span", { className: "af-modal__header-title-subtitle", children: subtitle }))] })] }));
8
+ };
@@ -0,0 +1,5 @@
1
+ export { Modal, type ModalProps } from "./Modal";
2
+ export { ModalCore, type ModalCoreProps } from "./ModalCore";
3
+ export { ModalCoreFooter, type ModalCoreFooterProps, } from "./components/ModalCoreFooter";
4
+ export { ModalCoreHeader, type ModalCoreHeaderProps, } from "./components/ModalCoreHeader";
5
+ export { ModalCoreBody, type ModalCoreBodyProps, } from "./components/ModalCoreBody";
@@ -0,0 +1,5 @@
1
+ export { Modal } from "./Modal";
2
+ export { ModalCore } from "./ModalCore";
3
+ export { ModalCoreFooter, } from "./components/ModalCoreFooter";
4
+ export { ModalCoreHeader, } from "./components/ModalCoreHeader";
5
+ export { ModalCoreBody, } from "./components/ModalCoreBody";
@@ -0,0 +1 @@
1
+ export { ProgressBar } from "@axa-fr/design-system-apollo-react/lf";
@@ -0,0 +1 @@
1
+ export { ProgressBar } from "@axa-fr/design-system-apollo-react/lf";
@@ -0,0 +1 @@
1
+ export { ProgressBarGroup } from "@axa-fr/design-system-apollo-react/lf";
@@ -0,0 +1 @@
1
+ export { ProgressBarGroup } from "@axa-fr/design-system-apollo-react/lf";
@@ -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;
@@ -0,0 +1,2 @@
1
+ export { Spinner, spinnerVariants, } from "@axa-fr/design-system-apollo-react/lf";
2
+ export type { SpinnerVariants } from "@axa-fr/design-system-apollo-react/lf";
@@ -0,0 +1 @@
1
+ export { Spinner, spinnerVariants, } from "@axa-fr/design-system-apollo-react/lf";
@@ -1,12 +1 @@
1
- import { HTMLAttributes } from "react";
2
- import "@axa-fr/design-system-look-and-feel-css/dist/Stepper/Stepper.scss";
3
- export type StepperProps = {
4
- currentStepProgress?: number;
5
- currentStep: number;
6
- currentSubtitle?: string;
7
- currentTitle?: string;
8
- nbSteps: 2 | 3 | 4 | 5 | 6;
9
- isTitleVisible?: boolean;
10
- isSubtitleVisible?: boolean;
11
- } & Omit<HTMLAttributes<HTMLDivElement>, "role">;
12
- export declare const Stepper: ({ currentStepProgress, currentTitle, nbSteps, currentStep, currentSubtitle, isTitleVisible, isSubtitleVisible, className, ...props }: StepperProps) => import("react/jsx-runtime").JSX.Element;
1
+ export { Stepper } from "@axa-fr/design-system-apollo-react/lf";
@@ -1,22 +1 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCallback, useId } from "react";
3
- import classNames from "classnames";
4
- import "@axa-fr/design-system-look-and-feel-css/dist/Stepper/Stepper.scss";
5
- const INITIAL_STEPPER_PROGRESS = 10;
6
- const MAX_STEPPER_PROGRESS = 100;
7
- export const Stepper = ({ currentStepProgress = INITIAL_STEPPER_PROGRESS, currentTitle, nbSteps, currentStep, currentSubtitle, isTitleVisible = true, isSubtitleVisible = true, className, ...props }) => {
8
- const stepperId = useId();
9
- const getCurrentProgress = useCallback((index) => {
10
- if (index < currentStep) {
11
- return MAX_STEPPER_PROGRESS;
12
- }
13
- if (index === currentStep) {
14
- if (currentStepProgress === 0) {
15
- return INITIAL_STEPPER_PROGRESS;
16
- }
17
- return currentStepProgress;
18
- }
19
- return 0;
20
- }, [currentStep, currentStepProgress]);
21
- return (_jsxs("div", { className: "af-stepper-client", ...props, children: [isTitleVisible && currentTitle && (_jsx("h2", { className: "af-stepper-client__title", "aria-describedby": stepperId, children: currentTitle })), isSubtitleVisible && currentSubtitle && (_jsx("p", { className: "af-stepper-client__subtitle", children: currentSubtitle })), _jsx("div", { id: stepperId, role: "group", "aria-label": currentTitle, className: classNames("af-stepper-client__content", className), children: [...Array(nbSteps).keys()].map((index) => (_jsx("div", { className: "af-stepper-client__progressbar", "aria-current": index === currentStep, "aria-hidden": index !== currentStep, "aria-label": `${getCurrentProgress(index)}%`, children: _jsx("div", { className: "af-stepper-client__progress", style: { width: `${getCurrentProgress(index)}%` } }) }, `${stepperId}-${index}`))) })] }));
22
- };
1
+ export { Stepper } from "@axa-fr/design-system-apollo-react/lf";
package/dist/Tag/Tag.d.ts CHANGED
@@ -1,6 +1,2 @@
1
- import { type ComponentProps } from "react";
2
- type TagProps = ComponentProps<"div"> & {
3
- classModifier?: string;
4
- };
5
- export declare const Tag: ({ children, className, classModifier, ...divProps }: TagProps) => import("react/jsx-runtime").JSX.Element;
6
- export {};
1
+ export { Tag, tagVariants } from "@axa-fr/design-system-apollo-react/lf";
2
+ export type { TagVariants } from "@axa-fr/design-system-apollo-react/lf";
package/dist/Tag/Tag.js CHANGED
@@ -1,7 +1 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useMemo } from "react";
3
- import { getComponentClassName } from "../utilities";
4
- export const Tag = ({ children, className, classModifier = "", ...divProps }) => {
5
- const componentClassName = useMemo(() => getComponentClassName(className, classModifier, "af-tag"), [className, classModifier]);
6
- return (_jsx("div", { className: componentClassName, ...divProps, children: _jsx("span", { className: "af-tag__label", children: children }) }));
7
- };
1
+ export { Tag, tagVariants } from "@axa-fr/design-system-apollo-react/lf";
@@ -0,0 +1 @@
1
+ export { TimelineVertical } from "@axa-fr/design-system-apollo-react/lf";
@@ -0,0 +1 @@
1
+ export { TimelineVertical } from "@axa-fr/design-system-apollo-react/lf";
@@ -5,7 +5,7 @@ import { getComponentClassName } from "../utilities";
5
5
  import { TitleSize } from "./constants";
6
6
  import { TitleWithSubtitles } from "./TitleWithSubtitles";
7
7
  export const Title = ({ children: title, className, classModifier, firstSubtitle, icon, secondSubtitle, size = TitleSize.XL, level = size === TitleSize.L ? 2 : 1, }) => {
8
- const componentClassName = useMemo(() => getComponentClassName(className, classModifier ? `${classModifier} ${size}` : size, "af-title"), [classModifier, className, size]);
8
+ const componentClassName = useMemo(() => getComponentClassName("af-title", className, classModifier ? `${classModifier} ${size}` : size), [classModifier, className, size]);
9
9
  const TitleWithSubtitlesPart = useCallback(({ ...args }) => (_jsx(TitleWithSubtitles, { title: title, firstSubtitle: firstSubtitle, level: level, ...args })), [title, firstSubtitle, level]);
10
10
  return (_jsx("header", { className: componentClassName, children: icon && size === TitleSize.XL ? (_jsxs(_Fragment, { children: [_jsx(IconBg, { className: "af-title__icon af-icon-bg", children: icon }), _jsx(TitleWithSubtitlesPart, { secondSubtitle: secondSubtitle })] })) : (_jsx(TitleWithSubtitlesPart, {})) }));
11
11
  };
@@ -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;
@@ -0,0 +1 @@
1
+ export { Toggle } from "@axa-fr/design-system-apollo-react/lf";
@@ -0,0 +1 @@
1
+ export { Toggle } from "@axa-fr/design-system-apollo-react/lf";