@axa-fr/design-system-apollo-react 1.0.5-alpha.437 → 1.0.5-alpha.439

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4 @@
1
+ export declare const DynamicIcon: ({ iconName, className, }: {
2
+ iconName: string;
3
+ className?: string;
4
+ }) => string | import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import facebook from "@axa-fr/design-system-apollo-css/facebook.svg";
3
+ import linkedin from "@axa-fr/design-system-apollo-css/linkedin.svg";
4
+ import twitterx from "@axa-fr/design-system-apollo-css/twitterx.svg";
5
+ import youtube from "@axa-fr/design-system-apollo-css/youtube.svg";
6
+ import { Svg } from "../../Svg/Svg";
7
+ export const DynamicIcon = ({ iconName, className, }) => {
8
+ switch (iconName) {
9
+ case "facebook":
10
+ return _jsx(Svg, { src: facebook, className: className });
11
+ case "twitter":
12
+ return _jsx(Svg, { src: twitterx, className: className });
13
+ case "youtube":
14
+ return _jsx(Svg, { src: youtube, className: className });
15
+ case "linkedin":
16
+ return _jsx(Svg, { src: linkedin, className: className });
17
+ default:
18
+ return iconName;
19
+ }
20
+ };
@@ -0,0 +1,2 @@
1
+ import "@axa-fr/design-system-apollo-css/dist/Layout/Footer/FooterApollo.scss";
2
+ export { type FooterProps, Footer } from "./FooterCommon";
@@ -0,0 +1,2 @@
1
+ import "@axa-fr/design-system-apollo-css/dist/Layout/Footer/FooterApollo.scss";
2
+ export { Footer } from "./FooterCommon";
@@ -0,0 +1,10 @@
1
+ import { SocialMedia } from "./MenuIcons";
2
+ import { Link } from "./MenuLink";
3
+ export type FooterProps = {
4
+ links: Link[];
5
+ socialMedias?: SocialMedia[];
6
+ copyright: string;
7
+ expandLinkText: string;
8
+ id?: string;
9
+ };
10
+ export declare const Footer: ({ links, socialMedias, copyright, expandLinkText, id, }: FooterProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import expandMore from "@material-symbols/svg-400/outlined/keyboard_arrow_down.svg";
3
+ import classNames from "classnames";
4
+ import { useCallback, useState } from "react";
5
+ import { MenuIcons } from "./MenuIcons";
6
+ import { MenuLink } from "./MenuLink";
7
+ import { Svg } from "../../Svg/Svg";
8
+ export const Footer = ({ links, socialMedias = [], copyright, expandLinkText, id, }) => {
9
+ const [isAboutOpen, setIsAboutOpen] = useState(false);
10
+ const handleClick = useCallback(() => {
11
+ setIsAboutOpen((isOpen) => !isOpen);
12
+ }, []);
13
+ return (_jsxs("footer", { role: "contentinfo", id: id, className: "af-footer", children: [_jsxs("div", { className: "af-footer__footerTop", children: [_jsxs("nav", { role: "navigation", 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 }) }) })] }));
14
+ };
@@ -0,0 +1,2 @@
1
+ import "@axa-fr/design-system-apollo-css/dist/Layout/Footer/FooterLF.scss";
2
+ export { type FooterProps, Footer } from "./FooterCommon";
@@ -0,0 +1,2 @@
1
+ import "@axa-fr/design-system-apollo-css/dist/Layout/Footer/FooterLF.scss";
2
+ export { Footer } from "./FooterCommon";
@@ -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", { role: "navigation", className: "af-footer__footerMenuIcons", children: _jsx("ul", { children: socialMedias.map((socialItem) => (_jsx("li", { children: _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/hook/useIsSmallScreen";
4
+ import { BREAKPOINT } from "../../utilities/constants";
5
+ export const MenuLink = ({ links, isAboutOpen = false }) => {
6
+ const isSmallScreen = useIsSmallScreen(BREAKPOINT.MD);
7
+ if (links.length === 0) {
8
+ return null;
9
+ }
10
+ return (_jsx("ul", { className: classNames("af-footer__menuLinks", isAboutOpen && "af-footer__menuLinks--display"), children: links.map((menuItem) => (_jsx("li", { children: _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
+ };
package/dist/index.d.ts CHANGED
@@ -47,3 +47,4 @@ export { Toggle } from "./Toggle/ToggleApollo";
47
47
  export { InputPhone } from "./Form/InputPhone/InputPhoneApollo";
48
48
  export { type OptionType } from "./Form/InputPhone/InputPhone.types";
49
49
  export { Dropdown } from "./Form/Dropdown/DropdownApollo";
50
+ export { Footer, type FooterProps } from "./Layout/Footer/FooterApollo";
package/dist/index.js CHANGED
@@ -46,3 +46,4 @@ export { TimelineVertical } from "./TimelineVertical/TimelineVerticalApollo";
46
46
  export { Toggle } from "./Toggle/ToggleApollo";
47
47
  export { InputPhone } from "./Form/InputPhone/InputPhoneApollo";
48
48
  export { Dropdown } from "./Form/Dropdown/DropdownApollo";
49
+ export { Footer } from "./Layout/Footer/FooterApollo";
package/dist/indexLF.d.ts CHANGED
@@ -51,3 +51,4 @@ export { TimelineVertical } from "./TimelineVertical/TimelineVerticalLF";
51
51
  export { Toggle } from "./Toggle/ToggleLF";
52
52
  export { type OptionType } from "./Form/InputPhone/InputPhone.types";
53
53
  export { Dropdown } from "./Form/Dropdown/DropdownLF";
54
+ export { Footer, type FooterProps } from "./Layout/Footer/FooterLF";
package/dist/indexLF.js CHANGED
@@ -50,3 +50,4 @@ export { Tag, tagVariants } from "./Tag/TagLF";
50
50
  export { TimelineVertical } from "./TimelineVertical/TimelineVerticalLF";
51
51
  export { Toggle } from "./Toggle/ToggleLF";
52
52
  export { Dropdown } from "./Form/Dropdown/DropdownLF";
53
+ export { Footer } from "./Layout/Footer/FooterLF";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axa-fr/design-system-apollo-react",
3
- "version": "1.0.5-alpha.437",
3
+ "version": "1.0.5-alpha.439",
4
4
  "description": "",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -46,8 +46,8 @@
46
46
  },
47
47
  "homepage": "https://github.com/AxaFrance/design-system#readme",
48
48
  "peerDependencies": {
49
- "@axa-fr/design-system-apollo-css": "1.0.5-alpha.437",
50
- "@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.437",
49
+ "@axa-fr/design-system-apollo-css": "1.0.5-alpha.439",
50
+ "@axa-fr/design-system-look-and-feel-css": "1.0.5-alpha.439",
51
51
  "@material-symbols/svg-400": ">= 0.19.0",
52
52
  "react": ">= 18"
53
53
  },