@hlf-fe/pulmo-ui 1.5.2 → 1.5.3

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 (75) hide show
  1. package/dist/components/buttons/link-button/link-button.d.ts +25 -0
  2. package/dist/components/buttons/link-button/link-button.js +80 -0
  3. package/dist/components/buttons/link-button/link-button.stories.d.ts +6 -0
  4. package/dist/components/buttons/link-button/link-button.stories.js +17 -0
  5. package/dist/components/data-display/list/text-list/text-list.stories.d.ts +0 -0
  6. package/dist/components/data-display/list/text-list/text-list.stories.js +0 -0
  7. package/dist/components/layout/image-list/image-list.d.ts +6 -0
  8. package/dist/components/layout/image-list/image-list.js +55 -0
  9. package/dist/components/layout/image-list/image-list.stories.d.ts +6 -0
  10. package/dist/components/layout/image-list/image-list.stories.js +19 -0
  11. package/dist/components/modules/logo-list/logo-list.d.ts +5 -0
  12. package/dist/components/modules/logo-list/logo-list.js +34 -0
  13. package/dist/components/modules/logo-list/logo-list.stories.d.ts +6 -0
  14. package/dist/components/modules/logo-list/logo-list.stories.js +18 -0
  15. package/dist/components/modules/navigation/navigation-desktop/nav-cell/nav-cell.d.ts +6 -0
  16. package/dist/components/modules/navigation/navigation-desktop/nav-cell/nav-cell.js +69 -0
  17. package/dist/components/modules/navigation/navigation-desktop/nav-cell.d.ts +6 -0
  18. package/dist/components/modules/navigation/navigation-desktop/nav-cell.js +69 -0
  19. package/dist/components/modules/navigation/navigation-desktop/nav-section/nav-section.d.ts +8 -0
  20. package/dist/components/modules/navigation/navigation-desktop/nav-section/nav-section.js +80 -0
  21. package/dist/components/modules/navigation/navigation-desktop/nav-section.d.ts +8 -0
  22. package/dist/components/modules/navigation/navigation-desktop/nav-section.js +80 -0
  23. package/dist/components/modules/navigation/navigation-desktop/navigation-desktop.d.ts +3 -0
  24. package/dist/components/modules/navigation/navigation-desktop/navigation-desktop.js +136 -0
  25. package/dist/components/modules/navigation/navigation-desktop/navigation-desktop.stories.d.ts +6 -0
  26. package/dist/components/modules/navigation/navigation-desktop/navigation-desktop.stories.js +12 -0
  27. package/dist/components/modules/navigation/navigation-mobile/nav-panel.d.ts +11 -0
  28. package/dist/components/modules/navigation/navigation-mobile/nav-panel.js +158 -0
  29. package/dist/components/modules/navigation/navigation-mobile/navigation-mobile.d.ts +3 -0
  30. package/dist/components/modules/navigation/navigation-mobile/navigation-mobile.js +97 -0
  31. package/dist/components/modules/navigation/navigation-mobile/navigation-mobile.stories.d.ts +6 -0
  32. package/dist/components/modules/navigation/navigation-mobile/navigation-mobile.stories.js +12 -0
  33. package/dist/components/modules/navigation/shared/nav-item/nav-item.d.ts +18 -0
  34. package/dist/components/modules/navigation/shared/nav-item/nav-item.js +106 -0
  35. package/dist/components/modules/navigation/shared/types/types.d.ts +43 -0
  36. package/dist/components/modules/navigation/shared/types/types.js +1 -0
  37. package/dist/components/modules/navigation/types.d.ts +39 -0
  38. package/dist/components/modules/navigation/types.js +1 -0
  39. package/dist/components/navigation/dropdown-menu/dropdown-menu.d.ts +0 -0
  40. package/dist/components/navigation/dropdown-menu/dropdown-menu.js +0 -0
  41. package/dist/components/navigation/nav-cell/navbar.d.ts +0 -0
  42. package/dist/components/navigation/nav-cell/navbar.js +0 -0
  43. package/dist/components/navigation/nav-section/dropdown-menu.d.ts +0 -0
  44. package/dist/components/navigation/nav-section/dropdown-menu.js +0 -0
  45. package/dist/components/navigation/nav-section/nav-section.d.ts +0 -0
  46. package/dist/components/navigation/nav-section/nav-section.js +0 -0
  47. package/dist/components/navigation/navbar/navbar.d.ts +0 -0
  48. package/dist/components/navigation/navbar/navbar.js +0 -0
  49. package/dist/index.d.ts +5 -5
  50. package/dist/index.js +6 -4
  51. package/dist/mocks/image-mocks.d.ts +7 -0
  52. package/dist/mocks/image-mocks.js +7 -0
  53. package/dist/mocks/navigation-mock.d.ts +5 -0
  54. package/dist/mocks/navigation-mock.js +153 -0
  55. package/dist/models/sanity.types.d.ts +9 -0
  56. package/dist/models/sanity.types.js +1 -0
  57. package/dist/models/web-page.url.d.ts +10 -0
  58. package/dist/models/web-page.url.js +1 -0
  59. package/package.json +1 -1
  60. package/dist/components/typography/heading/heading.d.ts +0 -4
  61. package/dist/components/typography/heading/heading.js +0 -47
  62. package/dist/components/typography/heading/heading.stories.d.ts +0 -7
  63. package/dist/components/typography/heading/heading.stories.js +0 -26
  64. package/dist/components/typography/heading/headings.d.ts +0 -4
  65. package/dist/components/typography/heading/headings.js +0 -47
  66. package/dist/components/typography/heading/headings.stories.d.ts +0 -7
  67. package/dist/components/typography/heading/headings.stories.js +0 -26
  68. package/dist/components/typography/portable-text/portable-text-default.d.ts +0 -39
  69. package/dist/components/typography/portable-text/portable-text-default.js +0 -23
  70. package/dist/styles/mixins/theme-mixins/theme-mixins.d.ts +0 -5
  71. package/dist/styles/mixins/theme-mixins/theme-mixins.js +0 -37
  72. /package/dist/components/{typography/portable-text/portable-text-component.d.ts → data-display/list/text-list/text-list.d.ts} +0 -0
  73. /package/dist/components/{typography/portable-text/portable-text-component.js → data-display/list/text-list/text-list.js} +0 -0
  74. /package/dist/components/layout/image/{image.stories.d.ts → Image.stories.d.ts} +0 -0
  75. /package/dist/components/layout/image/{image.stories.js → Image.stories.js} +0 -0
@@ -0,0 +1,25 @@
1
+ import { ReactNode } from "react";
2
+ export type LinkButtonProps = {
3
+ type?: "button" | "reset" | "submit";
4
+ icon?: ReactNode;
5
+ className?: string;
6
+ inverted?: boolean;
7
+ disabled?: boolean;
8
+ onClick?: () => void;
9
+ btnSize?: "s" | "m" | "l";
10
+ fullWidth?: boolean;
11
+ fullWidthMobile?: boolean;
12
+ dataTest?: string;
13
+ tabIndex?: number;
14
+ to?: string;
15
+ href?: string;
16
+ target?: "_blank" | "_self" | "_parent" | "_top";
17
+ children: ReactNode;
18
+ };
19
+ export type StyledLinkButtonProps = {
20
+ inverted?: boolean;
21
+ btnSize?: "s" | "m" | "l";
22
+ fullWidthMobile?: boolean;
23
+ fullWidth?: boolean;
24
+ };
25
+ export declare const LinkButton: ({ type, onClick, className, inverted, disabled, btnSize, fullWidth, fullWidthMobile, dataTest, tabIndex, children, to, href, target, }: LinkButtonProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,80 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import styled, { css } from "styled-components";
3
+ import { media, buttonSize } from "../../../styles/mixins";
4
+ import { rem } from "../../../styles/units";
5
+ import { Link } from "gatsby";
6
+ export const LinkButton = ({ type = "submit", onClick, className = "", inverted = false, disabled = false, btnSize = "m", fullWidth, fullWidthMobile, dataTest, tabIndex, children, to, href, target, }) => {
7
+ const commonProps = {
8
+ className,
9
+ onClick,
10
+ inverted,
11
+ btnSize,
12
+ fullWidth,
13
+ fullWidthMobile,
14
+ "data-test": dataTest,
15
+ tabIndex,
16
+ };
17
+ const asElement = to ? Link : href ? "a" : "button";
18
+ return (_jsx(StyledLinkButton, { as: asElement, ...commonProps, ...(to ? { to } : {}), ...(href
19
+ ? {
20
+ href,
21
+ target,
22
+ rel: target === "_blank" ? "noopener noreferrer" : undefined,
23
+ }
24
+ : {}), ...(!to && !href ? { type, disabled } : {}), children: children }));
25
+ };
26
+ const StyledLinkButton = styled.button `
27
+ display: flex;
28
+ justify-content: center;
29
+ align-items: center;
30
+ gap: ${rem(10)};
31
+ font-family: ${({ theme }) => theme.valueBold};
32
+ font-weight: 400;
33
+ text-decoration: none;
34
+ color: ${({ theme, inverted }) => (inverted ? theme.red : theme.white)};
35
+ width: ${({ fullWidthMobile }) => (fullWidthMobile ? "100%" : "fit-content")};
36
+ background-color: ${({ theme, inverted }) => inverted ? theme.white : theme.red};
37
+ line-height: 2.5;
38
+ border-radius: ${rem(5)};
39
+ border-color: ${({ theme, inverted }) => inverted ? theme.red : "transparent"};
40
+ transition: background-color 0.3s ease-out;
41
+ border-style: solid;
42
+
43
+ &:disabled {
44
+ cursor: default;
45
+ opacity: 0.6;
46
+ }
47
+
48
+ ${({ btnSize }) => {
49
+ switch (btnSize) {
50
+ case "s":
51
+ return buttonSize.S;
52
+ case "m":
53
+ return buttonSize.M;
54
+ case "l":
55
+ return buttonSize.L;
56
+ default:
57
+ return buttonSize.M;
58
+ }
59
+ }}
60
+
61
+ ${({ theme, inverted, fullWidth }) => css `
62
+ ${media.M `
63
+ width: ${fullWidth ? "100%" : "fit-content"};
64
+ `}
65
+
66
+ &:not(:disabled) {
67
+ ${media.L `
68
+ &:hover, :active, :focus-visible {
69
+ background-color: ${inverted ? theme.red : theme.redHover};
70
+ color: ${theme.white};
71
+ }
72
+
73
+ &:focus-visible {
74
+ outline: ${rem(2)} solid ${theme.blackLight};
75
+ outline-offset: ${rem(2)};
76
+ }
77
+ `};
78
+ }
79
+ `};
80
+ `;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { LinkButton } from "./link-button";
3
+ declare const meta: Meta<typeof LinkButton>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof LinkButton>;
6
+ export declare const Default: Story;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { LinkButton } from "./link-button";
3
+ import { Decorator } from "../../../components/decorator/decorator";
4
+ const meta = {
5
+ title: "Buttons/LinkButton",
6
+ component: LinkButton,
7
+ decorators: [
8
+ (Story) => (_jsx(Decorator, { children: _jsx(Story, {}) })),
9
+ ],
10
+ };
11
+ export default meta;
12
+ export const Default = {
13
+ args: {
14
+ inverted: false,
15
+ children: "Button Text",
16
+ },
17
+ };
@@ -0,0 +1,6 @@
1
+ import { SanityImage } from '../../../models/sanity-types';
2
+ export type ImageListProps = {
3
+ heading?: string;
4
+ images: SanityImage[];
5
+ };
6
+ export declare const ImageList: ({ heading, images }: ImageListProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,55 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Image } from "../../../components/layout/image/image";
3
+ import { Container } from "../../../components/layout/container/container";
4
+ import styled from 'styled-components';
5
+ import { media } from '../../../styles/mixins';
6
+ import { rem } from '../../../styles/units';
7
+ export const ImageList = ({ heading, images }) => {
8
+ return (_jsx(OuterContainer, { children: _jsxs(StyledContainer, { children: [heading && _jsx(Heading, { children: heading }), _jsx(LogoContainer, { children: images?.map((image, i) => {
9
+ return _jsx(Image, { image: image?.asset }, `${image?.asset?.url}-${i}`);
10
+ }) })] }) }));
11
+ };
12
+ const OuterContainer = styled.div `
13
+ background-color: ${({ theme }) => theme.white};
14
+ `;
15
+ const StyledContainer = styled(Container) `
16
+ margin-bottom: 0;
17
+ `;
18
+ const LogoContainer = styled.div `
19
+ display: grid;
20
+ grid-template-columns: repeat(2, 1fr);
21
+ grid-auto-rows: ${rem(110)};
22
+ grid-gap: ${rem(20)};
23
+ padding: ${rem(32)} 0 ${rem(40)};
24
+
25
+ ${media.L `
26
+ grid-template-columns: repeat(5, 1fr);
27
+ grid-auto-rows: ${rem(135)};
28
+ padding: ${rem(32)} 0 ${rem(48)};
29
+ `}
30
+
31
+ img {
32
+ width: 100%;
33
+ height: ${rem(110)};
34
+ border-radius: ${rem(4)};
35
+ box-shadow: 0 ${rem(4)} ${rem(16)} 0 rgba(0, 0, 0, 0.08);
36
+ padding: ${rem(10)};
37
+
38
+ ${media.L `
39
+ height: ${rem(135)};
40
+ `}
41
+ }
42
+ `;
43
+ const Heading = styled.h2 `
44
+ font-family: ${({ theme }) => theme.valueRegular};
45
+ font-size: ${rem(16)};
46
+ font-weight: normal;
47
+ color: ${({ theme }) => theme.blackLight};
48
+ margin: 0;
49
+ padding-top: ${rem(32)};
50
+
51
+ ${media.M `
52
+ font-size: ${rem(18)};
53
+ text-align: center;
54
+ `}
55
+ `;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { ImageList } from "./image-list";
3
+ declare const meta: Meta<typeof ImageList>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof ImageList>;
6
+ export declare const Default: Story;
@@ -0,0 +1,19 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ImageList } from "./image-list";
3
+ import { Decorator } from "../../../components/decorator/decorator";
4
+ import { svgMock } from '../../../mocks/image-mocks';
5
+ const meta = {
6
+ title: "Layout/ImageList",
7
+ component: ImageList,
8
+ decorators: [
9
+ (Story) => (_jsx(Decorator, { children: _jsx(Story, {}) })),
10
+ ],
11
+ };
12
+ export default meta;
13
+ const images = Array(10).fill(svgMock);
14
+ export const Default = {
15
+ args: {
16
+ heading: 'Lorem ipsum dolor sit amet',
17
+ images,
18
+ },
19
+ };
@@ -0,0 +1,5 @@
1
+ import { SanityImage } from '../../../models/sanity-types';
2
+ export type LogoListProps = {
3
+ images: SanityImage[];
4
+ };
5
+ export declare const LogoList: ({ images }: LogoListProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,34 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Image } from "../../../components/layout/image/image";
3
+ import { Container } from "../../../components/layout/container/container";
4
+ import styled from 'styled-components';
5
+ import { media } from '../../../styles/mixins';
6
+ import { rem } from '../../../styles/units';
7
+ export const LogoList = ({ images }) => {
8
+ return (_jsx(Container, { children: _jsx(LogoContainer, { children: images?.map((image, i) => {
9
+ return _jsx(Image, { image: image?.asset }, `${image?.asset?.url}-${i}`);
10
+ }) }) }));
11
+ };
12
+ const LogoContainer = styled.div `
13
+ display: grid;
14
+ grid-template-columns: repeat(2, 1fr);
15
+ grid-auto-rows: ${rem(110)};
16
+ grid-gap: ${rem(20)};
17
+
18
+ ${media.L `
19
+ grid-template-columns: repeat(5, 1fr);
20
+ grid-auto-rows: ${rem(135)};
21
+ `}
22
+
23
+ img {
24
+ width: 100%;
25
+ height: ${rem(110)};
26
+ border-radius: ${rem(4)};
27
+ box-shadow: 0 ${rem(4)} ${rem(16)} 0 rgba(0, 0, 0, 0.08);
28
+ padding: ${rem(10)};
29
+
30
+ ${media.L `
31
+ height: ${rem(135)};
32
+ `}
33
+ }
34
+ `;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { LogoList } from "./logo-list";
3
+ declare const meta: Meta<typeof LogoList>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof LogoList>;
6
+ export declare const Default: Story;
@@ -0,0 +1,18 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { LogoList } from "./logo-list";
3
+ import { Decorator } from "../../../components/decorator/decorator";
4
+ import { svgMock } from '../../../mocks/image-mocks';
5
+ const meta = {
6
+ title: "Modules/LogoList",
7
+ component: LogoList,
8
+ decorators: [
9
+ (Story) => (_jsx(Decorator, { children: _jsx(Story, {}) })),
10
+ ],
11
+ };
12
+ export default meta;
13
+ const images = Array(10).fill(svgMock);
14
+ export const Default = {
15
+ args: {
16
+ images,
17
+ },
18
+ };
@@ -0,0 +1,6 @@
1
+ export type NavigationCellProps = {
2
+ title: string;
3
+ active?: boolean;
4
+ onToggleCell: () => void;
5
+ };
6
+ export declare const NavigationCell: ({ title, active, onToggleCell, }: NavigationCellProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,69 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ToggableChevron } from "../../../../../components/icons/toggable-chevron/toggable-chevron";
3
+ import styled, { css } from "styled-components";
4
+ import { media } from "../../../../../styles/mixins";
5
+ import { rem } from "../../../../../styles/units";
6
+ export const NavigationCell = ({ title, active, onToggleCell, }) => (_jsx(StyledListItem, { children: _jsxs(NavCell, { "data-test": "nav-cell", "$active": active, onClick: onToggleCell, children: [title, _jsx(StyledToggle, { toggled: active })] }) }));
7
+ const StyledListItem = styled.li `
8
+ display: inline-block;
9
+ height: 100%;
10
+ padding-right: ${rem(16)};
11
+
12
+ ${media.XL `
13
+ padding-right: ${rem(32)};
14
+
15
+ &:last-of-type {
16
+ padding-right: ${rem(40)};
17
+ }
18
+ `}
19
+ `;
20
+ const NavCell = styled.button `
21
+ padding: 0;
22
+ border: 0;
23
+ background: none;
24
+ cursor: pointer;
25
+ display: grid;
26
+ grid-template-columns: 1fr 22px;
27
+ align-items: center;
28
+ height: 100%;
29
+ font-size: ${rem(14)};
30
+
31
+ ${media.XL `
32
+ font-size: ${rem(18)};
33
+ `}
34
+
35
+ p {
36
+ font-size: inherit;
37
+ overflow: hidden;
38
+ text-overflow: ellipsis;
39
+ white-space: nowrap;
40
+ margin: 0;
41
+ }
42
+
43
+ ${({ theme }) => css `
44
+ color: ${theme.blackLight};
45
+ font-family: ${theme.valueBold};
46
+ `};
47
+
48
+ ${({ $active }) => $active &&
49
+ css `
50
+ ${({ theme }) => css `
51
+ color: ${theme.red};
52
+ box-shadow: inset 0 -4px 0 ${theme.red};
53
+ `};
54
+ `};
55
+ `;
56
+ const StyledToggle = styled(ToggableChevron).attrs({
57
+ disableCircle: true,
58
+ }) `
59
+ margin-left: ${rem(4)};
60
+
61
+ svg {
62
+ ${(props) => props.toggled &&
63
+ css `
64
+ ${({ theme }) => css `
65
+ fill: ${theme.red};
66
+ `};
67
+ `};
68
+ }
69
+ `;
@@ -0,0 +1,6 @@
1
+ export type NavigationCellProps = {
2
+ title: string;
3
+ active?: boolean;
4
+ onToggleCell: () => void;
5
+ };
6
+ export declare const NavigationCell: ({ title, active, onToggleCell, }: NavigationCellProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,69 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ToggableChevron } from "../../../../components/icons/toggable-chevron/toggable-chevron";
3
+ import styled, { css } from "styled-components";
4
+ import { media } from "../../../../styles/mixins";
5
+ import { rem } from "../../../../styles/units";
6
+ export const NavigationCell = ({ title, active, onToggleCell, }) => (_jsx(StyledListItem, { children: _jsxs(NavCell, { "data-test": "nav-cell", "$active": active, onClick: onToggleCell, children: [title, _jsx(StyledToggle, { toggled: active })] }) }));
7
+ const StyledListItem = styled.li `
8
+ display: inline-block;
9
+ height: 100%;
10
+ padding-right: ${rem(16)};
11
+
12
+ ${media.XL `
13
+ padding-right: ${rem(32)};
14
+
15
+ &:last-of-type {
16
+ padding-right: ${rem(40)};
17
+ }
18
+ `}
19
+ `;
20
+ const NavCell = styled.button `
21
+ padding: 0;
22
+ border: 0;
23
+ background: none;
24
+ cursor: pointer;
25
+ display: grid;
26
+ grid-template-columns: 1fr 22px;
27
+ align-items: center;
28
+ height: 100%;
29
+ font-size: ${rem(14)};
30
+
31
+ ${media.XL `
32
+ font-size: ${rem(18)};
33
+ `}
34
+
35
+ p {
36
+ font-size: inherit;
37
+ overflow: hidden;
38
+ text-overflow: ellipsis;
39
+ white-space: nowrap;
40
+ margin: 0;
41
+ }
42
+
43
+ ${({ theme }) => css `
44
+ color: ${theme.blackLight};
45
+ font-family: ${theme.valueBold};
46
+ `};
47
+
48
+ ${({ $active }) => $active &&
49
+ css `
50
+ ${({ theme }) => css `
51
+ color: ${theme.red};
52
+ box-shadow: inset 0 -4px 0 ${theme.red};
53
+ `};
54
+ `};
55
+ `;
56
+ const StyledToggle = styled(ToggableChevron).attrs({
57
+ disableCircle: true,
58
+ }) `
59
+ margin-left: ${rem(4)};
60
+
61
+ svg {
62
+ ${(props) => props.toggled &&
63
+ css `
64
+ ${({ theme }) => css `
65
+ fill: ${theme.red};
66
+ `};
67
+ `};
68
+ }
69
+ `;
@@ -0,0 +1,8 @@
1
+ import { NavigationSectionModel } from "../../shared/types/types";
2
+ type Props = {
3
+ section: NavigationSectionModel;
4
+ className?: string;
5
+ closeSection: () => void;
6
+ };
7
+ export declare const NavigationSection: ({ section, className, closeSection }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,80 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import { NavigationItem } from "../../shared/nav-item/nav-item";
4
+ import { CardBanner } from "../../../../../components/surfaces/cards/card-banner/card-banner";
5
+ import styled, { css } from "styled-components";
6
+ import { rem } from '../../../../../styles/units';
7
+ export const NavigationSection = ({ section, className, closeSection }) => {
8
+ const [currentItem, setCurrentItem] = useState();
9
+ const onToggle = (item) => {
10
+ setCurrentItem(currentItem?.key !== item?.key ? item : undefined);
11
+ };
12
+ const renderColumn = (title, items) => (items ? (_jsxs(NavCol, { children: [_jsx(Header, { children: title }), _jsx(StyledList, { children: items.map((item) => (_jsx(NavigationItem, { model: item, expanded: currentItem?.key === item.key, parent: section.title, onToggle: onToggle, onLinkClick: closeSection }, item.key))) })] })) : _jsx("span", {}));
13
+ return (_jsx(Wrapper, { "data-test": "nav-section", className: className, children: _jsxs(Content, { children: [_jsxs(NavWrapper, { "data-test": "nav-block", children: [renderColumn(section.column1Title, section.column1Items), renderColumn(section.column2Title, section.column2Items)] }), _jsx(InfoWrapper, { color: section?.backgroundColor?.hex, children: section?.linkBanners && section?.linkBanners?.map((banner) => (_jsx(CardBanner, { ...banner, externalUrl: banner?.link?.externalUrl, internalLink: banner?.link?.internalLink?.slug?.current, onClick: closeSection }, banner.title.trim()))) })] }) }));
14
+ };
15
+ const Wrapper = styled.div `
16
+ @keyframes fadeIn {
17
+ 0% { opacity: 0; }
18
+ 100% { opacity: 1; }
19
+ }
20
+
21
+ position: absolute;
22
+ width: 100%;
23
+ animation: fadeIn 0.2s;
24
+ `;
25
+ const Content = styled.div `
26
+ position: absolute;
27
+ width: 100%;
28
+ display: grid;
29
+ grid-template-columns: 55% 45%;
30
+ max-width: 1114px;
31
+ left: 50%;
32
+ transform: translateX(-50%);
33
+ `;
34
+ const NavWrapper = styled.div `
35
+ display: grid;
36
+ grid-template-columns: 1fr 1fr;
37
+ grid-column-gap: ${rem(20)};
38
+ background-color: white;
39
+ padding: ${rem(32)} ${rem(62)} ${rem(56)} ${rem(45)};
40
+ `;
41
+ const InfoWrapper = styled.div `
42
+ display: flex;
43
+ flex-direction: column;
44
+ justify-content: center;
45
+ padding: ${rem(45)};
46
+ background-color: white;
47
+
48
+ ${({ color }) => color && css `
49
+ background-color: ${color};
50
+ `};
51
+
52
+ > * {
53
+ &:first-child {
54
+ margin-bottom: ${rem(24)};
55
+ }
56
+ }
57
+ `;
58
+ const NavCol = styled.div `
59
+ display: flex;
60
+ flex-direction: column;
61
+ overflow: hidden;
62
+ `;
63
+ const StyledList = styled.ul `
64
+ margin: 0;
65
+ padding: 0;
66
+ `;
67
+ const Header = styled.h2 `
68
+ font-size: ${rem(24)};
69
+ margin: 0;
70
+ overflow: hidden;
71
+ white-space: nowrap;
72
+ text-overflow: ellipsis;
73
+ border-bottom: 1px solid ${({ theme }) => theme.grayPale};
74
+ padding-bottom: 2px;
75
+
76
+ ${({ theme }) => css `
77
+ color: ${theme.blackLight};
78
+ font-family: ${theme.valueBold};
79
+ `};
80
+ `;
@@ -0,0 +1,8 @@
1
+ import { NavigationSectionModel } from "../types";
2
+ type Props = {
3
+ section: NavigationSectionModel;
4
+ className?: string;
5
+ closeSection: () => void;
6
+ };
7
+ export declare const NavigationSection: ({ section, className, closeSection }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,80 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useState } from "react";
3
+ import styled, { css } from "styled-components";
4
+ import { NavigationItem } from "../../../../components/navigation/nav-item/nav-item";
5
+ import { CardBanner } from "../../../../components/surfaces/cards/card-banner/card-banner";
6
+ import { rem } from '../../../../styles/units';
7
+ export const NavigationSection = ({ section, className, closeSection }) => {
8
+ const [currentItem, setCurrentItem] = useState();
9
+ const onToggle = (item) => {
10
+ setCurrentItem(currentItem?.key !== item?.key ? item : undefined);
11
+ };
12
+ const renderColumn = (title, items) => (items ? (_jsxs(NavCol, { children: [_jsx(Header, { children: title }), _jsx(StyledList, { children: items.map((item) => (_jsx(NavigationItem, { model: item, expanded: currentItem?.key === item.key, parent: section.title, onToggle: onToggle, onLinkClick: closeSection }, item.key))) })] })) : _jsx("span", {}));
13
+ return (_jsx(Wrapper, { "data-test": "nav-section", className: className, children: _jsxs(Content, { children: [_jsxs(NavWrapper, { "data-test": "nav-block", children: [renderColumn(section.column1Title, section.column1Items), renderColumn(section.column2Title, section.column2Items)] }), _jsx(InfoWrapper, { color: section?.backgroundColor?.hex, children: section?.linkBanners && section?.linkBanners?.map((banner) => (_jsx(CardBanner, { ...banner, externalUrl: banner?.link?.externalUrl, internalLink: banner?.link?.internalLink?.slug?.current, onClick: closeSection }, banner.title.trim()))) })] }) }));
14
+ };
15
+ const Wrapper = styled.div `
16
+ @keyframes fadeIn {
17
+ 0% { opacity: 0; }
18
+ 100% { opacity: 1; }
19
+ }
20
+
21
+ position: absolute;
22
+ width: 100%;
23
+ animation: fadeIn 0.2s;
24
+ `;
25
+ const Content = styled.div `
26
+ position: absolute;
27
+ width: 100%;
28
+ display: grid;
29
+ grid-template-columns: 55% 45%;
30
+ max-width: 1114px;
31
+ left: 50%;
32
+ transform: translateX(-50%);
33
+ `;
34
+ const NavWrapper = styled.div `
35
+ display: grid;
36
+ grid-template-columns: 1fr 1fr;
37
+ grid-column-gap: ${rem(20)};
38
+ background-color: white;
39
+ padding: ${rem(32)} ${rem(62)} ${rem(56)} ${rem(45)};
40
+ `;
41
+ const InfoWrapper = styled.div `
42
+ display: flex;
43
+ flex-direction: column;
44
+ justify-content: center;
45
+ padding: ${rem(45)};
46
+ background-color: white;
47
+
48
+ ${({ color }) => color && css `
49
+ background-color: ${color};
50
+ `};
51
+
52
+ > * {
53
+ &:first-child {
54
+ margin-bottom: ${rem(24)};
55
+ }
56
+ }
57
+ `;
58
+ const NavCol = styled.div `
59
+ display: flex;
60
+ flex-direction: column;
61
+ overflow: hidden;
62
+ `;
63
+ const StyledList = styled.ul `
64
+ margin: 0;
65
+ padding: 0;
66
+ `;
67
+ const Header = styled.h2 `
68
+ font-size: ${rem(24)};
69
+ margin: 0;
70
+ overflow: hidden;
71
+ white-space: nowrap;
72
+ text-overflow: ellipsis;
73
+ border-bottom: 1px solid ${({ theme }) => theme.grayPale};
74
+ padding-bottom: 2px;
75
+
76
+ ${({ theme }) => css `
77
+ color: ${theme.blackLight};
78
+ font-family: ${theme.valueBold};
79
+ `};
80
+ `;
@@ -0,0 +1,3 @@
1
+ import { NavigationModel } from '../shared/types/types';
2
+ export type NavigationDesktopProps = NavigationModel;
3
+ export declare const NavigationDesktop: ({ logotype, mainMenuItems, topMenuItems, ctaButton, localeText, isMenuVisible, menuRef }: NavigationDesktopProps) => import("react/jsx-runtime").JSX.Element;