@axa-fr/design-system-look-and-feel-react 0.2.0-beta.306

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 (257) hide show
  1. package/dist/Accordion/Accordion.d.ts +8 -0
  2. package/dist/Accordion/Accordion.js +7 -0
  3. package/dist/Accordion/Accordion.stories.d.ts +8 -0
  4. package/dist/Accordion/Accordion.stories.js +24 -0
  5. package/dist/Accordion/AccordionItem.d.ts +6 -0
  6. package/dist/Accordion/AccordionItem.js +10 -0
  7. package/dist/Alert/Alert.d.ts +12 -0
  8. package/dist/Alert/Alert.js +26 -0
  9. package/dist/Alert/Alert.stories.d.ts +5 -0
  10. package/dist/Alert/Alert.stories.js +26 -0
  11. package/dist/Button/Button.d.ts +17 -0
  12. package/dist/Button/Button.js +15 -0
  13. package/dist/Button/Button.stories.d.ts +22 -0
  14. package/dist/Button/Button.stories.js +99 -0
  15. package/dist/Card/Card.d.ts +6 -0
  16. package/dist/Card/Card.js +9 -0
  17. package/dist/Card/Card.stories.d.ts +6 -0
  18. package/dist/Card/Card.stories.js +40 -0
  19. package/dist/Card/__tests__/Card.test.d.ts +1 -0
  20. package/dist/Card/__tests__/Card.test.js +27 -0
  21. package/dist/Card/index.d.ts +2 -0
  22. package/dist/Card/index.js +2 -0
  23. package/dist/Form/Checkbox/Checkbox.d.ts +7 -0
  24. package/dist/Form/Checkbox/Checkbox.js +15 -0
  25. package/dist/Form/Checkbox/Checkbox.stories.d.ts +6 -0
  26. package/dist/Form/Checkbox/Checkbox.stories.js +38 -0
  27. package/dist/Form/Checkbox/CheckboxSelect.d.ts +15 -0
  28. package/dist/Form/Checkbox/CheckboxSelect.js +7 -0
  29. package/dist/Form/Checkbox/CheckboxSelect.stories.d.ts +6 -0
  30. package/dist/Form/Checkbox/CheckboxSelect.stories.js +55 -0
  31. package/dist/Form/Checkbox/index.d.ts +2 -0
  32. package/dist/Form/Checkbox/index.js +2 -0
  33. package/dist/Form/FileUpload/FIleUpload.stories.d.ts +6 -0
  34. package/dist/Form/FileUpload/FIleUpload.stories.js +54 -0
  35. package/dist/Form/FileUpload/FileUpload.d.ts +32 -0
  36. package/dist/Form/FileUpload/FileUpload.js +51 -0
  37. package/dist/Form/FileUpload/index.d.ts +1 -0
  38. package/dist/Form/FileUpload/index.js +1 -0
  39. package/dist/Form/InputError/InputError.d.ts +7 -0
  40. package/dist/Form/InputError/InputError.js +5 -0
  41. package/dist/Form/InputError/InputError.stories.d.ts +5 -0
  42. package/dist/Form/InputError/InputError.stories.js +12 -0
  43. package/dist/Form/InputError/index.d.ts +1 -0
  44. package/dist/Form/InputError/index.js +1 -0
  45. package/dist/Form/Radio/Radio.d.ts +7 -0
  46. package/dist/Form/Radio/Radio.js +14 -0
  47. package/dist/Form/Radio/Radio.stories.d.ts +6 -0
  48. package/dist/Form/Radio/Radio.stories.js +38 -0
  49. package/dist/Form/Radio/RadioSelect.d.ts +18 -0
  50. package/dist/Form/Radio/RadioSelect.js +16 -0
  51. package/dist/Form/Radio/RadioSelect.stories.d.ts +7 -0
  52. package/dist/Form/Radio/RadioSelect.stories.js +90 -0
  53. package/dist/Form/Radio/index.d.ts +2 -0
  54. package/dist/Form/Radio/index.js +2 -0
  55. package/dist/Form/Select/CustomOption.d.ts +4 -0
  56. package/dist/Form/Select/CustomOption.js +8 -0
  57. package/dist/Form/Select/DropdownIndicator.d.ts +4 -0
  58. package/dist/Form/Select/DropdownIndicator.js +11 -0
  59. package/dist/Form/Select/Select.d.ts +27 -0
  60. package/dist/Form/Select/Select.js +27 -0
  61. package/dist/Form/Select/Select.stories.d.ts +10 -0
  62. package/dist/Form/Select/Select.stories.js +31 -0
  63. package/dist/Form/Select/index.d.ts +1 -0
  64. package/dist/Form/Select/index.js +1 -0
  65. package/dist/Form/Text/Text.d.ts +12 -0
  66. package/dist/Form/Text/Text.js +12 -0
  67. package/dist/Form/Text/Text.stories.d.ts +8 -0
  68. package/dist/Form/Text/Text.stories.js +46 -0
  69. package/dist/Form/Text/index.d.ts +1 -0
  70. package/dist/Form/Text/index.js +1 -0
  71. package/dist/Form/core/Field.d.ts +16 -0
  72. package/dist/Form/core/Field.js +12 -0
  73. package/dist/Form/core/FieldError.d.ts +7 -0
  74. package/dist/Form/core/FieldError.js +8 -0
  75. package/dist/Form/core/FieldForm.d.ts +59 -0
  76. package/dist/Form/core/FieldForm.js +151 -0
  77. package/dist/Form/core/FieldInput.d.ts +9 -0
  78. package/dist/Form/core/FieldInput.js +9 -0
  79. package/dist/Form/core/FormClassManager.d.ts +7 -0
  80. package/dist/Form/core/FormClassManager.js +33 -0
  81. package/dist/Form/core/HelpMessage.d.ts +7 -0
  82. package/dist/Form/core/HelpMessage.js +2 -0
  83. package/dist/Form/core/InputList.d.ts +8 -0
  84. package/dist/Form/core/InputList.js +4 -0
  85. package/dist/Form/core/MessageTypes.d.ts +5 -0
  86. package/dist/Form/core/MessageTypes.js +6 -0
  87. package/dist/Form/core/getComponentClassName.d.ts +1 -0
  88. package/dist/Form/core/getComponentClassName.js +27 -0
  89. package/dist/Form/core/getFirstId.d.ts +2 -0
  90. package/dist/Form/core/getFirstId.js +1 -0
  91. package/dist/Form/core/getOptionClassName.d.ts +1 -0
  92. package/dist/Form/core/getOptionClassName.js +10 -0
  93. package/dist/Form/core/index.d.ts +31 -0
  94. package/dist/Form/core/index.js +13 -0
  95. package/dist/Form/core/useInputClassModifier.d.ts +4 -0
  96. package/dist/Form/core/useInputClassModifier.js +12 -0
  97. package/dist/Form/core/useOptionsWithId.d.ts +2 -0
  98. package/dist/Form/core/useOptionsWithId.js +13 -0
  99. package/dist/IconBg/IconBg.d.ts +9 -0
  100. package/dist/IconBg/IconBg.js +13 -0
  101. package/dist/IconBg/IconBg.stories.d.ts +5 -0
  102. package/dist/IconBg/IconBg.stories.js +23 -0
  103. package/dist/IconBg/__tests__/IconBg.test.d.ts +1 -0
  104. package/dist/IconBg/__tests__/IconBg.test.js +22 -0
  105. package/dist/IconBg/index.d.ts +2 -0
  106. package/dist/IconBg/index.js +2 -0
  107. package/dist/Layout/Footer/DynamicIcons.d.ts +4 -0
  108. package/dist/Layout/Footer/DynamicIcons.js +20 -0
  109. package/dist/Layout/Footer/Footer.d.ts +14 -0
  110. package/dist/Layout/Footer/Footer.js +16 -0
  111. package/dist/Layout/Footer/Footer.stories.d.ts +14 -0
  112. package/dist/Layout/Footer/Footer.stories.js +48 -0
  113. package/dist/Layout/Footer/MenuIcons.d.ts +9 -0
  114. package/dist/Layout/Footer/MenuIcons.js +8 -0
  115. package/dist/Layout/Footer/MenuLink.d.ts +11 -0
  116. package/dist/Layout/Footer/MenuLink.js +11 -0
  117. package/dist/Layout/Header/Header.d.ts +9 -0
  118. package/dist/Layout/Header/Header.js +11 -0
  119. package/dist/Layout/Header/Header.stories.d.ts +10 -0
  120. package/dist/Layout/Header/Header.stories.js +52 -0
  121. package/dist/Layout/Header/NavBar/NavBar.d.ts +8 -0
  122. package/dist/Layout/Header/NavBar/NavBar.js +13 -0
  123. package/dist/Layout/Header/NavBar/NavBar.stories.d.ts +8 -0
  124. package/dist/Layout/Header/NavBar/NavBar.stories.js +17 -0
  125. package/dist/Layout/Header/NavBar/index.d.ts +1 -0
  126. package/dist/Layout/Header/NavBar/index.js +1 -0
  127. package/dist/Layout/Header/PreviousLink/PreviousLink.d.ts +7 -0
  128. package/dist/Layout/Header/PreviousLink/PreviousLink.js +14 -0
  129. package/dist/Layout/Header/PreviousLink/PreviousLink.stories.d.ts +8 -0
  130. package/dist/Layout/Header/PreviousLink/PreviousLink.stories.js +16 -0
  131. package/dist/Layout/Header/PreviousLink/index.d.ts +1 -0
  132. package/dist/Layout/Header/PreviousLink/index.js +1 -0
  133. package/dist/Layout/Header/index.d.ts +1 -0
  134. package/dist/Layout/Header/index.js +1 -0
  135. package/dist/Link/Link.d.ts +7 -0
  136. package/dist/Link/Link.js +11 -0
  137. package/dist/Link/Link.stories.d.ts +5 -0
  138. package/dist/Link/Link.stories.js +14 -0
  139. package/dist/List/ClickList/ClickList.d.ts +11 -0
  140. package/dist/List/ClickList/ClickList.js +6 -0
  141. package/dist/List/ClickList/ClickList.stories.d.ts +6 -0
  142. package/dist/List/ClickList/ClickList.stories.js +60 -0
  143. package/dist/List/ClickList/__tests__/ClickList.client.test.d.ts +1 -0
  144. package/dist/List/ClickList/__tests__/ClickList.client.test.js +18 -0
  145. package/dist/List/ClickList/index.d.ts +1 -0
  146. package/dist/List/ClickList/index.js +1 -0
  147. package/dist/List/ContentItemDuo/ContentItemDuo.d.ts +13 -0
  148. package/dist/List/ContentItemDuo/ContentItemDuo.js +18 -0
  149. package/dist/List/ContentItemDuo/ContentItemDuo.stories.d.ts +28 -0
  150. package/dist/List/ContentItemDuo/ContentItemDuo.stories.js +86 -0
  151. package/dist/List/ContentItemDuo/__tests__/ContentItemDuo.test.d.ts +1 -0
  152. package/dist/List/ContentItemDuo/__tests__/ContentItemDuo.test.js +40 -0
  153. package/dist/List/ContentItemDuo/index.d.ts +2 -0
  154. package/dist/List/ContentItemDuo/index.js +2 -0
  155. package/dist/List/ContentItemMono/ContentItemMono.d.ts +16 -0
  156. package/dist/List/ContentItemMono/ContentItemMono.js +16 -0
  157. package/dist/List/ContentItemMono/ContentItemMono.stories.d.ts +16 -0
  158. package/dist/List/ContentItemMono/ContentItemMono.stories.js +99 -0
  159. package/dist/List/ContentItemMono/__tests__/ContentItemMono.test.d.ts +1 -0
  160. package/dist/List/ContentItemMono/__tests__/ContentItemMono.test.js +45 -0
  161. package/dist/List/ContentItemMono/constants.d.ts +4 -0
  162. package/dist/List/ContentItemMono/constants.js +5 -0
  163. package/dist/List/ContentItemMono/index.d.ts +3 -0
  164. package/dist/List/ContentItemMono/index.js +3 -0
  165. package/dist/List/ContentTabList/ContentTabItem/ContentTabItem.d.ts +6 -0
  166. package/dist/List/ContentTabList/ContentTabItem/ContentTabItem.js +6 -0
  167. package/dist/List/ContentTabList/ContentTabItem/__tests__/ContentTabItem.test.d.ts +1 -0
  168. package/dist/List/ContentTabList/ContentTabItem/__tests__/ContentTabItem.test.js +100 -0
  169. package/dist/List/ContentTabList/ContentTabItem/index.d.ts +2 -0
  170. package/dist/List/ContentTabList/ContentTabItem/index.js +1 -0
  171. package/dist/List/ContentTabList/ContentTabList.d.ts +8 -0
  172. package/dist/List/ContentTabList/ContentTabList.js +10 -0
  173. package/dist/List/ContentTabList/ContentTabList.stories.d.ts +7 -0
  174. package/dist/List/ContentTabList/ContentTabList.stories.js +78 -0
  175. package/dist/List/ContentTabList/__tests__/ContentTabList.test.d.ts +1 -0
  176. package/dist/List/ContentTabList/__tests__/ContentTabList.test.js +57 -0
  177. package/dist/List/ContentTabList/index.d.ts +1 -0
  178. package/dist/List/ContentTabList/index.js +1 -0
  179. package/dist/List/List.d.ts +6 -0
  180. package/dist/List/List.js +9 -0
  181. package/dist/List/List.stories.d.ts +8 -0
  182. package/dist/List/List.stories.js +56 -0
  183. package/dist/List/__tests__/List.test.d.ts +1 -0
  184. package/dist/List/__tests__/List.test.js +30 -0
  185. package/dist/List/index.d.ts +1 -0
  186. package/dist/List/index.js +1 -0
  187. package/dist/Loader/Loader.d.ts +11 -0
  188. package/dist/Loader/Loader.js +10 -0
  189. package/dist/Loader/Loader.stories.d.ts +6 -0
  190. package/dist/Loader/Loader.stories.js +15 -0
  191. package/dist/Loader/index.d.ts +1 -0
  192. package/dist/Loader/index.js +1 -0
  193. package/dist/ModalClient/Modal.d.ts +23 -0
  194. package/dist/ModalClient/Modal.js +44 -0
  195. package/dist/ModalClient/Modal.stories.d.ts +20 -0
  196. package/dist/ModalClient/Modal.stories.js +37 -0
  197. package/dist/Pagination/Pagination.d.ts +9 -0
  198. package/dist/Pagination/Pagination.js +15 -0
  199. package/dist/Pagination/Pagination.stories.d.ts +11 -0
  200. package/dist/Pagination/Pagination.stories.js +19 -0
  201. package/dist/Pagination/PaginationDesktop.d.ts +9 -0
  202. package/dist/Pagination/PaginationDesktop.js +31 -0
  203. package/dist/Pagination/PaginationMobile.d.ts +9 -0
  204. package/dist/Pagination/PaginationMobile.js +10 -0
  205. package/dist/Stepper/Stepper.d.ts +12 -0
  206. package/dist/Stepper/Stepper.js +22 -0
  207. package/dist/Stepper/Stepper.stories.d.ts +16 -0
  208. package/dist/Stepper/Stepper.stories.js +23 -0
  209. package/dist/Svg/Svg.d.ts +7 -0
  210. package/dist/Svg/Svg.js +47 -0
  211. package/dist/Svg/Svg.stories.d.ts +7 -0
  212. package/dist/Svg/Svg.stories.js +40 -0
  213. package/dist/Svg/__tests__/Svg.test.d.ts +1 -0
  214. package/dist/Svg/__tests__/Svg.test.js +38 -0
  215. package/dist/Svg/index.d.ts +1 -0
  216. package/dist/Svg/index.js +1 -0
  217. package/dist/Svg/svgInjector.d.ts +12 -0
  218. package/dist/Svg/svgInjector.js +28 -0
  219. package/dist/Tabs/Tabs.d.ts +16 -0
  220. package/dist/Tabs/Tabs.js +48 -0
  221. package/dist/Tabs/Tabs.stories.d.ts +17 -0
  222. package/dist/Tabs/Tabs.stories.js +89 -0
  223. package/dist/Tag/Tag.d.ts +6 -0
  224. package/dist/Tag/Tag.js +7 -0
  225. package/dist/Tag/Tag.stories.d.ts +5 -0
  226. package/dist/Tag/Tag.stories.js +22 -0
  227. package/dist/Tag/__test__/Tag.test.d.ts +1 -0
  228. package/dist/Tag/__test__/Tag.test.js +18 -0
  229. package/dist/Tag/index.d.ts +2 -0
  230. package/dist/Tag/index.js +2 -0
  231. package/dist/Title/Title.d.ts +13 -0
  232. package/dist/Title/Title.js +11 -0
  233. package/dist/Title/Title.stories.d.ts +6 -0
  234. package/dist/Title/Title.stories.js +45 -0
  235. package/dist/Title/TitleWithSubtitles.d.ts +8 -0
  236. package/dist/Title/TitleWithSubtitles.js +2 -0
  237. package/dist/Title/__tests__/Title.test.d.ts +1 -0
  238. package/dist/Title/__tests__/Title.test.js +28 -0
  239. package/dist/Title/__tests__/TitleWithSubtitles.test.d.ts +1 -0
  240. package/dist/Title/__tests__/TitleWithSubtitles.test.js +14 -0
  241. package/dist/Title/constants.d.ts +4 -0
  242. package/dist/Title/constants.js +5 -0
  243. package/dist/Title/index.d.ts +3 -0
  244. package/dist/Title/index.js +3 -0
  245. package/dist/assets/svg/facebook.svg +1 -0
  246. package/dist/assets/svg/linkedin.svg +1 -0
  247. package/dist/assets/svg/twitterx.svg +1 -0
  248. package/dist/assets/svg/youtube.svg +1 -0
  249. package/dist/index.d.ts +29 -0
  250. package/dist/index.js +27 -0
  251. package/dist/utilities/helpers/getComponentClassName.d.ts +1 -0
  252. package/dist/utilities/helpers/getComponentClassName.js +27 -0
  253. package/dist/utilities/hooks/useIsSmallScreen.d.ts +1 -0
  254. package/dist/utilities/hooks/useIsSmallScreen.js +14 -0
  255. package/dist/utilities.d.ts +2 -0
  256. package/dist/utilities.js +2 -0
  257. package/package.json +119 -0
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import "@axa-fr/design-system-look-and-feel-css/dist/common/reboot.scss";
3
+ import "@axa-fr/design-system-look-and-feel-css/dist/Layout/Footer/Footer.scss";
4
+ import expandMore from "@material-symbols/svg-400/outlined/keyboard_arrow_down.svg";
5
+ import classNames from "classnames";
6
+ import { useCallback, useState } from "react";
7
+ import { MenuIcons } from "./MenuIcons";
8
+ import { MenuLink } from "./MenuLink";
9
+ import { Svg } from "../../Svg";
10
+ export const Footer = ({ links, socialMedias = [], copyright, expandLinkText, id, }) => {
11
+ const [isAboutOpen, setIsAboutOpen] = useState(false);
12
+ const handleClick = useCallback(() => {
13
+ setIsAboutOpen((isOpen) => !isOpen);
14
+ }, []);
15
+ return (_jsxs("footer", { id: id, className: "af-footer", children: [_jsxs("div", { className: "af-footer__footerTop", children: [_jsxs("nav", { className: "af-footer__menuTop", "aria-label": expandLinkText, children: [_jsxs("button", { type: "button", onClick: handleClick, className: "af-footer__menuAboutTrigger", children: [_jsx("span", { className: "af-footer__menuAboutTriggerText", children: expandLinkText }), _jsx(Svg, { src: expandMore, className: classNames("af-footer__icon", "af-footer__iconTrigger", isAboutOpen && "af-footer__iconTrigger--display") })] }), _jsx(MenuLink, { links: links, isAboutOpen: isAboutOpen })] }), _jsx(MenuIcons, { socialMedias: socialMedias })] }), _jsx("div", { className: "af-footer__footerBottom", children: _jsx("div", { className: "af-footer__footerBottomWidth", children: _jsx("span", { className: "af-footer__textCopyright", children: copyright }) }) })] }));
16
+ };
@@ -0,0 +1,14 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Footer } from "./Footer";
3
+ import { SocialMedia } from "./MenuIcons";
4
+ import { Link } from "./MenuLink";
5
+ declare const meta: Meta<typeof Footer>;
6
+ export default meta;
7
+ type StoryProps = Omit<React.ComponentProps<typeof Footer>, "links" | "socialMedias" | "copyright" | "expandLinkText"> & {
8
+ links: Link[];
9
+ socialMedias?: SocialMedia[];
10
+ copyright: string;
11
+ expandLinkText: string;
12
+ };
13
+ type Story = StoryObj<StoryProps>;
14
+ export declare const Playground: Story;
@@ -0,0 +1,48 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Footer } from "./Footer";
3
+ const meta = {
4
+ component: Footer,
5
+ title: "Components/Footer",
6
+ parameters: {
7
+ layout: "centered",
8
+ },
9
+ };
10
+ export default meta;
11
+ export const Playground = {
12
+ name: "Footer",
13
+ render: ({ links, socialMedias, copyright, expandLinkText }) => (_jsx(Footer, { links: links, socialMedias: socialMedias, copyright: copyright, expandLinkText: expandLinkText })),
14
+ args: {
15
+ links: [
16
+ {
17
+ link: "https://www.axa.fr/qui-sommes-nous.html",
18
+ text: "À propos",
19
+ },
20
+ {
21
+ link: "https://www.axa.fr/configuration-securite/mentions-legales.html",
22
+ text: "Mentions légales",
23
+ },
24
+ {
25
+ link: "https://www.axa.fr/configuration-securite/donnees-personnelles.html",
26
+ text: "Données personnelles",
27
+ },
28
+ {
29
+ link: "https://www.axa.fr/configuration-securite/politique-cookies.html",
30
+ text: "Cookies",
31
+ },
32
+ ],
33
+ socialMedias: [
34
+ { icon: "facebook", link: "https://www.facebook.com/axafrance" },
35
+ { icon: "twitter", link: "https://twitter.com/AXAFrance" },
36
+ {
37
+ icon: "youtube",
38
+ link: "https://www.youtube.com/user/AXAFranceChaine",
39
+ },
40
+ {
41
+ icon: "linkedin",
42
+ link: "https://www.linkedin.com/company/axa-france/",
43
+ },
44
+ ],
45
+ expandLinkText: "Liens utiles",
46
+ copyright: `@AXA ${new Date().getFullYear()} - Tous droits réservés`,
47
+ },
48
+ };
@@ -0,0 +1,9 @@
1
+ export type SocialMedia = {
2
+ icon: "facebook" | "twitter" | "youtube" | "linkedin";
3
+ link: string;
4
+ };
5
+ type MenuIconsProps = {
6
+ socialMedias: SocialMedia[];
7
+ };
8
+ export declare const MenuIcons: ({ socialMedias }: MenuIconsProps) => import("react/jsx-runtime").JSX.Element | null;
9
+ export {};
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { DynamicIcon } from "./DynamicIcons";
3
+ export const MenuIcons = ({ socialMedias }) => {
4
+ if (socialMedias.length === 0) {
5
+ return null;
6
+ }
7
+ return (_jsx("nav", { className: "af-footer__footerMenuIcons", children: socialMedias.map((socialItem) => (_jsx("a", { "aria-label": `social media ${socialItem.icon}`, className: "af-footer__menuIconLinks", href: socialItem.link, target: "_blank", rel: "noopener noreferrer", children: _jsx(DynamicIcon, { iconName: socialItem.icon }) }, socialItem.icon))) }));
8
+ };
@@ -0,0 +1,11 @@
1
+ export type Link = {
2
+ link: string;
3
+ text: string;
4
+ openInCurrentTab?: boolean;
5
+ };
6
+ type MenuLinkProps = {
7
+ links: Link[];
8
+ isAboutOpen?: boolean;
9
+ };
10
+ export declare const MenuLink: ({ links, isAboutOpen }: MenuLinkProps) => import("react/jsx-runtime").JSX.Element | null;
11
+ export {};
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import classNames from "classnames";
3
+ import { useIsSmallScreen } from "../../utilities";
4
+ const BREAKPOINT_SMALL = 1024;
5
+ export const MenuLink = ({ links, isAboutOpen = false }) => {
6
+ const isSmallScreen = useIsSmallScreen(BREAKPOINT_SMALL);
7
+ if (links.length === 0) {
8
+ return null;
9
+ }
10
+ return (_jsx("div", { className: classNames("af-footer__menuLinks", isAboutOpen && "af-footer__menuLinks--display"), children: links.map((menuItem) => (_jsx("a", { className: "af-footer__linkItem", href: menuItem.link, target: menuItem.openInCurrentTab ? "_top" : "_blank", rel: "noreferrer", tabIndex: isSmallScreen && !isAboutOpen ? -1 : undefined, children: menuItem.text }, menuItem.text))) }));
11
+ };
@@ -0,0 +1,9 @@
1
+ import "@axa-fr/design-system-look-and-feel-css/dist/Layout/Header/Header.scss";
2
+ import { ComponentPropsWithoutRef } from "react";
3
+ type HeaderProps = {
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;
9
+ export {};
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
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";
5
+ import { NavBar } from "./NavBar";
6
+ import { PreviousLink } from "./PreviousLink/PreviousLink";
7
+ export const Header = ({ children, defaultActiveLink, previousLink, rightItem, }) => {
8
+ const [activeLink, setActiveLink] = useState(defaultActiveLink);
9
+ const resetActiveLink = useCallback(() => setActiveLink(defaultActiveLink), [defaultActiveLink]);
10
+ return (_jsxs("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 }))] }));
11
+ };
@@ -0,0 +1,10 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Header } from "./Header";
3
+ declare const meta: Meta<typeof Header>;
4
+ export default meta;
5
+ type Story = StoryObj<React.ComponentProps<typeof Header>>;
6
+ export declare const Default: Story;
7
+ export declare const HeaderWithNavBar: StoryObj<typeof Header>;
8
+ export declare const HeaderWithNavBarAndRightItem: StoryObj<typeof Header>;
9
+ export declare const HeaderWithLinksAndRightItemAndPreviousLink: StoryObj<typeof Header>;
10
+ export declare const HeaderWithLinksAndRightItemAndPreviousLinkAndActiveLink: StoryObj<typeof Header>;
@@ -0,0 +1,52 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import person from "@material-symbols/svg-400/outlined/person-fill.svg";
3
+ import lock from "@material-symbols/svg-400/outlined/lock-fill.svg";
4
+ import { Svg } from "../../Svg";
5
+ import { Button, ButtonVariants } from "../..";
6
+ import { Header } from "./Header";
7
+ const meta = {
8
+ component: Header,
9
+ title: "Components/Header",
10
+ };
11
+ export default meta;
12
+ export const Default = {
13
+ name: "Header",
14
+ render: () => _jsx(Header, {}),
15
+ };
16
+ export const HeaderWithNavBar = {
17
+ name: "Header with navigation bar",
18
+ render: () => (_jsxs(Header, { children: [_jsx("a", { className: "af-navbar-item__link", href: "/mes-contrats", target: "_", children: "MES CONTRATS" }, "MES CONTRATS link"), _jsx("a", { className: "af-navbar-item__link", href: "/mes-avantages", target: "_", children: "MES AVANTAGES" }, "MES AVANTAGES link"), _jsx("a", { className: "af-navbar-item__link", href: "/mes-documents", target: "_", children: "MES DOCUMENTS" }, "MES DOCUMENTS link")] })),
19
+ };
20
+ export const HeaderWithNavBarAndRightItem = {
21
+ name: "Header with navigation bar and right item",
22
+ render: ({ rightItem }) => (_jsxs(Header, { rightItem: rightItem, children: [_jsx("a", { className: "af-navbar-item__link", href: "/mes-contrats", children: "MES CONTRATS" }, "MES CONTRATS link"), _jsx("a", { className: "af-navbar-item__link", href: "/mes-avantages", children: "MES AVANTAGES" }, "MES AVANTAGES link"), _jsx("a", { className: "af-navbar-item__link", href: "/mes-documents", children: "MES DOCUMENTS" }, "MES DOCUMENTS link")] })),
23
+ args: {
24
+ rightItem: [
25
+ _jsx(Button, { iconLeft: _jsx(Svg, { src: lock, fill: "#00008f" }), variant: ButtonVariants.secondary, children: "Espace Banque" }, "Banking Space Button"),
26
+ _jsx(Button, { iconLeft: _jsx(Svg, { src: person, fill: "#00008f" }), variant: ButtonVariants.ghost, children: "Mon Profil" }, "Profile Button"),
27
+ ],
28
+ },
29
+ };
30
+ export const HeaderWithLinksAndRightItemAndPreviousLink = {
31
+ name: "Header with links, right item and Previous link",
32
+ render: ({ previousLink, rightItem }) => (_jsxs(Header, { previousLink: previousLink, rightItem: rightItem, children: [_jsx("a", { className: "af-navbar-item__link", href: "/mes-contrats", children: "MES CONTRATS" }, "MES CONTRATS link"), _jsx("a", { className: "af-navbar-item__link", href: "/mes-avantages", children: "MES AVANTAGES" }, "MES AVANTAGES link"), _jsx("a", { className: "af-navbar-item__link", href: "/mes-documents", children: "MES DOCUMENTS" }, "MES DOCUMENTS link")] })),
33
+ args: {
34
+ previousLink: (_jsx("a", { href: "/mes-contrats", children: "Retour \u00E0 mes contrats" }, "Previous link")),
35
+ rightItem: [
36
+ _jsx(Button, { iconLeft: _jsx(Svg, { src: lock, fill: "#00008f" }), variant: ButtonVariants.secondary, children: "Espace Banque" }, "Banking Space Button"),
37
+ _jsx(Button, { iconLeft: _jsx(Svg, { src: person, fill: "#00008f" }), variant: ButtonVariants.ghost, children: "Mon Profil" }, "Profile Button"),
38
+ ],
39
+ },
40
+ };
41
+ export const HeaderWithLinksAndRightItemAndPreviousLinkAndActiveLink = {
42
+ name: "Header with links, right item, Previous link and active link",
43
+ render: ({ defaultActiveLink, previousLink, rightItem }) => (_jsxs(Header, { defaultActiveLink: defaultActiveLink, previousLink: previousLink, rightItem: rightItem, children: [_jsx("a", { className: "af-navbar-item__link", href: "/mes-contrats", children: "MES CONTRATS" }, "MES CONTRATS link"), _jsx("a", { className: "af-navbar-item__link", href: "/mes-avantages", children: "MES AVANTAGES" }, "MES AVANTAGES link"), _jsx("a", { className: "af-navbar-item__link", href: "/mes-documents", children: "MES DOCUMENTS" }, "MES DOCUMENTS link")] })),
44
+ args: {
45
+ defaultActiveLink: 0,
46
+ previousLink: (_jsx("a", { href: "/mes-contrats", children: "Retour \u00E0 mes contrats" }, "Previous link")),
47
+ rightItem: [
48
+ _jsx(Button, { iconLeft: _jsx(Svg, { src: lock, fill: "#00008f" }), variant: ButtonVariants.secondary, children: "Espace Banque" }, "Banking Space Button"),
49
+ _jsx(Button, { iconLeft: _jsx(Svg, { src: person, fill: "#00008f" }), variant: ButtonVariants.ghost, children: "Mon Profil" }, "Profile Button"),
50
+ ],
51
+ },
52
+ };
@@ -0,0 +1,8 @@
1
+ import React, { ComponentPropsWithoutRef, PropsWithChildren } from "react";
2
+ import "@axa-fr/design-system-look-and-feel-css/dist/Layout/Header/NavBar/NavBar.scss";
3
+ type NavBarProps = {
4
+ activeLink?: number;
5
+ setActiveLink: React.Dispatch<React.SetStateAction<number | undefined>>;
6
+ } & ComponentPropsWithoutRef<"nav">;
7
+ declare const NavBar: ({ activeLink, children, setActiveLink, ...otherProps }: PropsWithChildren<NavBarProps>) => import("react/jsx-runtime").JSX.Element;
8
+ export { NavBar };
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import React, { isValidElement, useMemo, } from "react";
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(),
8
+ onClick: () => setActiveLink(index),
9
+ onFocus: () => setActiveLink(index),
10
+ role: "menuitem",
11
+ }) }))) }) }));
12
+ };
13
+ export { NavBar };
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import type React from "react";
3
+ import { NavBar } from "./NavBar";
4
+ declare const meta: Meta<typeof NavBar>;
5
+ export default meta;
6
+ type StoryProps = React.ComponentProps<typeof NavBar>;
7
+ type Story = StoryObj<StoryProps>;
8
+ export declare const Default: Story;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { NavBar } from "./NavBar";
3
+ const meta = {
4
+ title: "Components/Header/NavBar",
5
+ component: NavBar,
6
+ argTypes: {
7
+ setActiveLink: { action: "active link changed" },
8
+ activeLink: { control: { type: "number", min: 0, max: 3 } },
9
+ },
10
+ };
11
+ export default meta;
12
+ export const Default = {
13
+ render: ({ activeLink, setActiveLink }) => (_jsxs(NavBar, { activeLink: activeLink, setActiveLink: setActiveLink, children: [_jsx("a", { className: "af-navbar-item__link", href: "/mes-contrats", children: "MES CONTRATS" }, "MES CONTRATS link"), _jsx("a", { className: "af-navbar-item__link", href: "/mes-avantages", children: "MES AVANTAGES" }, "MES AVANTAGES link"), _jsx("a", { className: "af-navbar-item__link", href: "/mes-documents", children: "MES DOCUMENTS" }, "MES DOCUMENTS link")] })),
14
+ args: {
15
+ activeLink: 0,
16
+ },
17
+ };
@@ -0,0 +1 @@
1
+ export { NavBar } from "./NavBar";
@@ -0,0 +1 @@
1
+ export { NavBar } from "./NavBar";
@@ -0,0 +1,7 @@
1
+ import "@axa-fr/design-system-look-and-feel-css/dist/Layout/Header/PreviousLink/PreviousLink.scss";
2
+ import { ComponentPropsWithoutRef, PropsWithChildren } from "react";
3
+ type PreviousLinkProps = {
4
+ handleClick: () => void;
5
+ } & ComponentPropsWithoutRef<"div">;
6
+ declare const PreviousLink: ({ handleClick, children, ...otherProps }: PropsWithChildren<PreviousLinkProps>) => import("react/jsx-runtime").JSX.Element;
7
+ export { PreviousLink };
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import arrowBack from "@material-symbols/svg-400/outlined/arrow_back.svg";
3
+ import "@axa-fr/design-system-look-and-feel-css/dist/Layout/Header/PreviousLink/PreviousLink.scss";
4
+ import React, { isValidElement, useMemo, } from "react";
5
+ import { Svg } from "../../../Svg";
6
+ const PreviousLink = ({ handleClick, children, ...otherProps }) => {
7
+ const validChildren = useMemo(() => (React.Children.map(children, (child) => isValidElement(child) && child) ?? []).filter((c) => Boolean(c)), [children]);
8
+ 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, { className: "af-header-previous-link__icon", src: arrowBack }), _jsx("span", { className: "af-header-previous-link__text", children: child.props.children })] })),
10
+ className: "af-header-previous-link",
11
+ onClick: handleClick,
12
+ })) }));
13
+ };
14
+ export { PreviousLink };
@@ -0,0 +1,8 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import type React from "react";
3
+ import { PreviousLink } from "./PreviousLink";
4
+ declare const meta: Meta<typeof PreviousLink>;
5
+ export default meta;
6
+ type StoryProps = React.ComponentProps<typeof PreviousLink>;
7
+ type Story = StoryObj<StoryProps>;
8
+ export declare const Default: Story;
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { PreviousLink } from "./PreviousLink";
3
+ const meta = {
4
+ title: "Components/Header/PreviousLink",
5
+ component: PreviousLink,
6
+ argTypes: {
7
+ handleClick: { action: "active link reset" },
8
+ },
9
+ };
10
+ export default meta;
11
+ export const Default = {
12
+ render: ({ children, handleClick }) => (_jsx(PreviousLink, { handleClick: handleClick, children: children })),
13
+ args: {
14
+ children: (_jsx("a", { href: "/mes-contrats", children: "Retour \u00E0 mes contrats" }, "Previous link")),
15
+ },
16
+ };
@@ -0,0 +1 @@
1
+ export { PreviousLink } from "./PreviousLink";
@@ -0,0 +1 @@
1
+ export { PreviousLink } from "./PreviousLink";
@@ -0,0 +1 @@
1
+ export { Header } from "./Header";
@@ -0,0 +1 @@
1
+ export { Header } from "./Header";
@@ -0,0 +1,7 @@
1
+ import { ComponentPropsWithoutRef, PropsWithChildren } from "react";
2
+ import "@axa-fr/design-system-look-and-feel-css/dist/Link/Link.scss";
3
+ type LinkProps = {
4
+ openInNewTab?: boolean;
5
+ } & ComponentPropsWithoutRef<"a">;
6
+ export declare const Link: ({ href, openInNewTab, children, ...props }: PropsWithChildren<LinkProps>) => import("react/jsx-runtime").JSX.Element;
7
+ export {};
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import "@axa-fr/design-system-look-and-feel-css/dist/Link/Link.scss";
3
+ import openInNew from "@material-symbols/svg-400/outlined/open_in_new.svg";
4
+ import { Svg } from "../Svg";
5
+ export const Link = ({ href, openInNewTab, children, ...props }) => {
6
+ const newTabProps = openInNewTab && {
7
+ target: "_blank",
8
+ rel: "noopener noreferrer",
9
+ };
10
+ return (_jsxs("a", { className: `af-link ${openInNewTab ? " af-link--openInNewTab" : ""}`, href: href, ...newTabProps, ...props, children: [children, newTabProps && _jsx(Svg, { src: openInNew })] }));
11
+ };
@@ -0,0 +1,5 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import { Link } from "./Link";
3
+ declare const meta: Meta<typeof Link>;
4
+ export default meta;
5
+ export declare const Default: StoryObj<typeof Link>;
@@ -0,0 +1,14 @@
1
+ import { Link } from "./Link";
2
+ const meta = {
3
+ title: "Components/Link",
4
+ component: Link,
5
+ };
6
+ export default meta;
7
+ export const Default = {
8
+ name: "Default",
9
+ args: {
10
+ href: "https://fakelink.com",
11
+ openInNewTab: true,
12
+ children: "My link",
13
+ },
14
+ };
@@ -0,0 +1,11 @@
1
+ import type { ComponentProps, ReactNode } from "react";
2
+ import "@axa-fr/design-system-look-and-feel-css/dist/List/ClickList/ClickList.scss";
3
+ type TClickList = {
4
+ items: Array<ComponentProps<"button"> & {
5
+ label: ReactNode;
6
+ icon?: ReactNode;
7
+ }>;
8
+ classModifier?: string;
9
+ };
10
+ export declare const ClickList: ({ items, classModifier }: TClickList) => import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,6 @@
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 { List } from "..";
4
+ import { Svg } from "../../Svg";
5
+ import "@axa-fr/design-system-look-and-feel-css/dist/List/ClickList/ClickList.scss";
6
+ export const ClickList = ({ items, classModifier }) => (_jsx(List, { classModifier: `list click-list ${classModifier}`, tabIndex: -1, children: items.map(({ id, label, icon, ...buttonProps }) => (_jsxs("button", { id: id, className: "af-list-item__button", type: "button", ...buttonProps, children: [_jsxs("div", { className: "af-list-item__content", children: [icon && _jsx("div", { className: "af-list-item-content__icon", children: icon }), _jsx("div", { className: "af-list-item-content__label", children: label })] }), _jsx("div", { className: "af-list-item__action", children: _jsx(Svg, { src: chevron }) })] }, id ?? label?.toString()))) }));
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { ClickList } from "./ClickList";
3
+ declare const meta: Meta<typeof ClickList>;
4
+ export default meta;
5
+ export declare const ClickListWithIcon: StoryObj<typeof ClickList>;
6
+ export declare const ClickListWithoutIcon: StoryObj<typeof ClickList>;
@@ -0,0 +1,60 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import contentPasteGo from "@material-symbols/svg-400/outlined/content_paste_go.svg";
3
+ import error from "@material-symbols/svg-400/outlined/error-fill.svg";
4
+ import { Svg } from "../../Svg";
5
+ import { ClickList } from "./ClickList";
6
+ const meta = {
7
+ title: "Components/List/ClickList",
8
+ component: ClickList,
9
+ };
10
+ export default meta;
11
+ export const ClickListWithIcon = {
12
+ name: "ClickList with icon",
13
+ render: (args) => _jsx(ClickList, { ...args }),
14
+ args: {
15
+ items: [
16
+ {
17
+ id: "report-claim",
18
+ icon: _jsx(Svg, { src: error }),
19
+ label: "Déclarer un sinistre",
20
+ },
21
+ {
22
+ id: "follow-claim",
23
+ icon: _jsx(Svg, { src: contentPasteGo }),
24
+ label: "Suivre mes sinistres",
25
+ disabled: true,
26
+ },
27
+ ],
28
+ classModifier: "",
29
+ },
30
+ argTypes: {
31
+ classModifier: {
32
+ options: ["", "large"],
33
+ control: { type: "select" },
34
+ defaultValue: "",
35
+ },
36
+ },
37
+ };
38
+ export const ClickListWithoutIcon = {
39
+ name: "ClickList without icon",
40
+ render: (args) => _jsx(ClickList, { ...args }),
41
+ args: {
42
+ items: [
43
+ {
44
+ label: (_jsxs(_Fragment, { children: [_jsx("h3", { className: "af-list-item-content-label__title", children: "Fiche Orias pr\u00E9contractuelle" }), _jsx("p", { className: "af-list-item-content-label__subtitle", children: "30 novembre 2021" }), _jsx("p", { className: "af-list-item-content-label__secondary", children: "Sign\u00E9 \u00E9lectroniquement" })] })),
45
+ },
46
+ {
47
+ label: (_jsxs(_Fragment, { children: [_jsx("h3", { className: "af-list-item-content-label__title", children: "Fiche Orias pr\u00E9contractuelle" }), _jsx("p", { className: "af-list-item-content-label__subtitle", children: "30 novembre 2021" }), _jsx("p", { className: "af-list-item-content-label__secondary", children: "Sign\u00E9 \u00E9lectroniquement" })] })),
48
+ disabled: true,
49
+ },
50
+ ],
51
+ classModifier: "",
52
+ },
53
+ argTypes: {
54
+ classModifier: {
55
+ options: ["", "large"],
56
+ control: { type: "select" },
57
+ defaultValue: "",
58
+ },
59
+ },
60
+ };
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { render, screen } from "@testing-library/react";
3
+ import { ClickList } from "..";
4
+ describe("ClickList", () => {
5
+ const items = [
6
+ { id: "1", label: "Item 1", icon: _jsx("span", { children: "Icon 1" }) },
7
+ { id: "2", label: "Item 2", icon: _jsx("span", { children: "Icon 2" }) },
8
+ { id: "3", label: "Item 3", icon: _jsx("span", { children: "Icon 3" }) },
9
+ ];
10
+ it("should render labels and icons from items array", () => {
11
+ render(_jsx(ClickList, { items: items }));
12
+ items.forEach((item) => {
13
+ expect(screen.getByText(item.icon.props.children)).toBeInTheDocument();
14
+ expect(screen.getByText(item.label)).toBeInTheDocument();
15
+ });
16
+ expect(screen.getAllByRole("separator")).toHaveLength(2);
17
+ });
18
+ });
@@ -0,0 +1 @@
1
+ export { ClickList } from "./ClickList";
@@ -0,0 +1 @@
1
+ export { ClickList } from "./ClickList";
@@ -0,0 +1,13 @@
1
+ type ContentItemDuoProps = {
2
+ label: string;
3
+ value: string;
4
+ isVertical?: boolean;
5
+ className?: string;
6
+ classModifier?: string;
7
+ isShowingDoneIcon?: boolean;
8
+ isShowingCloseIcon?: boolean;
9
+ buttonText?: string;
10
+ onButtonClick?: () => void;
11
+ };
12
+ export declare const ContentItemDuo: ({ label, value, isVertical, className, classModifier, isShowingDoneIcon, isShowingCloseIcon, buttonText, onButtonClick, }: ContentItemDuoProps) => import("react/jsx-runtime").JSX.Element;
13
+ export {};
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import checkIcon from "@material-symbols/svg-400/outlined/check.svg";
3
+ import closeIcon from "@material-symbols/svg-400/outlined/close.svg";
4
+ import { useMemo } from "react";
5
+ import { Variants } from "../../Button/Button";
6
+ import { getComponentClassName } from "../../utilities";
7
+ import { Button, Svg } from "../..";
8
+ export const ContentItemDuo = ({ label, value, isVertical = false, className, classModifier, isShowingDoneIcon = false, isShowingCloseIcon = false, buttonText, onButtonClick, }) => {
9
+ const componentClassName = useMemo(() => {
10
+ const classModifiers = [classModifier];
11
+ if (isVertical) {
12
+ classModifiers.push("vertical");
13
+ }
14
+ return getComponentClassName(className, classModifiers.filter(Boolean).join(" "), "af-content-item-duo");
15
+ }, [classModifier, className, isVertical]);
16
+ 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 }) }))] }));
18
+ };
@@ -0,0 +1,28 @@
1
+ import { Meta, StoryObj } from "@storybook/react";
2
+ import type { ComponentProps } from "react";
3
+ import { ContentItemDuo } from ".";
4
+ import { List } from "../List";
5
+ declare const meta: Meta<typeof ContentItemDuo>;
6
+ export default meta;
7
+ export declare const Default: StoryObj<Omit<ComponentProps<typeof ContentItemDuo>, "classModifier"> & {
8
+ classModifier: string[];
9
+ }>;
10
+ export declare const Vertical: StoryObj<Omit<ComponentProps<typeof ContentItemDuo>, "classModifier"> & {
11
+ classModifier: string[];
12
+ }>;
13
+ export declare const DefaultContentItemDuoList: StoryObj<{
14
+ items: Array<Omit<ComponentProps<typeof ContentItemDuo>, "classModifier"> & {
15
+ id: string;
16
+ classModifier: string[];
17
+ }>;
18
+ } & Omit<ComponentProps<typeof List>, "classModifier"> & {
19
+ classModifier: string[];
20
+ }>;
21
+ export declare const VerticalContentItemDuoList: StoryObj<{
22
+ items: Array<Omit<ComponentProps<typeof ContentItemDuo>, "classModifier"> & {
23
+ id: string;
24
+ classModifier: string[];
25
+ }>;
26
+ } & Omit<ComponentProps<typeof List>, "classModifier"> & {
27
+ classModifier: string[];
28
+ }>;