@hlf-fe/pulmo-ui 1.1.0 → 1.2.0

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 (37) hide show
  1. package/dist/components/icons/external-icon/external-icon.d.ts +5 -0
  2. package/dist/components/icons/external-icon/external-icon.js +2 -0
  3. package/dist/components/icons/external-icon/external-icon.stories.d.ts +6 -0
  4. package/dist/components/icons/external-icon/external-icon.stories.js +14 -0
  5. package/dist/components/icons/hamburger-icon/hamburger-icon.d.ts +1 -0
  6. package/dist/components/icons/hamburger-icon/hamburger-icon.js +2 -0
  7. package/dist/components/icons/hamburger-icon/hamburger-icon.stories.d.ts +6 -0
  8. package/dist/components/icons/hamburger-icon/hamburger-icon.stories.js +14 -0
  9. package/dist/components/icons/heart-icon/heart-icon.d.ts +1 -0
  10. package/dist/components/icons/heart-icon/heart-icon.js +2 -0
  11. package/dist/components/icons/heart-icon/heart-icon.stories.d.ts +6 -0
  12. package/dist/components/icons/heart-icon/heart-icon.stories.js +12 -0
  13. package/dist/components/icons/menu-close-icon/menu-close-icon.d.ts +1 -0
  14. package/dist/components/icons/menu-close-icon/menu-close-icon.js +2 -0
  15. package/dist/components/icons/menu-close-icon/menu-close-icon.stories.d.ts +6 -0
  16. package/dist/components/icons/menu-close-icon/menu-close-icon.stories.js +14 -0
  17. package/dist/components/navigation/nav-cell/nav-cell.d.ts +6 -0
  18. package/dist/components/navigation/nav-cell/nav-cell.js +67 -0
  19. package/dist/components/navigation/nav-cell/nav-cell.stories.d.ts +7 -0
  20. package/dist/components/navigation/nav-cell/nav-cell.stories.js +23 -0
  21. package/dist/components/navigation/nav-item/nav-item.d.ts +18 -0
  22. package/dist/components/navigation/nav-item/nav-item.js +106 -0
  23. package/dist/components/navigation/nav-item/nav-item.stories.d.ts +9 -0
  24. package/dist/components/navigation/nav-item/nav-item.stories.js +73 -0
  25. package/dist/components/surfaces/cards/card-banner/card-banner.d.ts +14 -0
  26. package/dist/components/surfaces/cards/card-banner/card-banner.js +62 -0
  27. package/dist/components/surfaces/cards/card-banner/card-banner.stories.d.ts +6 -0
  28. package/dist/components/surfaces/cards/card-banner/card-banner.stories.js +29 -0
  29. package/dist/index.d.ts +11 -1
  30. package/dist/index.js +10 -0
  31. package/dist/mocks/image-mocks.d.ts +30 -0
  32. package/dist/mocks/image-mocks.js +32 -0
  33. package/dist/models/sanity-types.d.ts +9 -0
  34. package/dist/models/sanity-types.js +1 -0
  35. package/dist/models/web-page-url.d.ts +10 -0
  36. package/dist/models/web-page-url.js +1 -0
  37. package/package.json +1 -1
@@ -0,0 +1,5 @@
1
+ type ExternalIconType = {
2
+ className?: string;
3
+ };
4
+ export declare const ExternalIcon: ({ className }: ExternalIconType) => import("react/jsx-runtime").JSX.Element;
5
+ export {};
@@ -0,0 +1,2 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export const ExternalIcon = ({ className = "" }) => (_jsx("svg", { className: className, width: "16px", height: "16px", viewBox: "0 0 16 16", version: "1.1", xmlns: "http://www.w3.org/2000/svg", children: _jsx("g", { stroke: "none", "stroke-width": "1", fill: "none", fillRule: "evenodd", children: _jsx("g", { transform: "translate(-428.000000, -10860.000000)", fill: "currentColor", fillRule: "nonzero", children: _jsx("path", { d: "M433,10861 C433.552285,10861 434,10861.4477 434,10862 C434,10862.5523 433.552285,10863 433,10863 L431,10863 C430.447715,10863 430,10863.4477 430,10864 L430,10873 C430,10873.5523 430.447715,10874 431,10874 L440,10874 C440.552285,10874 441,10873.5523 441,10873 L441,10871 C441,10870.4477 441.447715,10870 442,10870 C442.552285,10870 443,10870.4477 443,10871 L443,10873 C443,10874.6569 441.656854,10876 440,10876 L431,10876 C429.343146,10876 428,10874.6569 428,10873 L428,10864 C428,10862.3431 429.343146,10861 431,10861 L433,10861 Z M443,10860 L443.019354,10860.0002 C443.042681,10860.0006 443.065995,10860.0019 443.08925,10860.004 L443,10860 C443.05062,10860 443.100362,10860.0038 443.148961,10860.011 C443.165949,10860.0136 443.183375,10860.0167 443.200726,10860.0202 C443.222746,10860.0246 443.244436,10860.0298 443.26584,10860.0357 C443.281463,10860.0401 443.296851,10860.0447 443.312143,10860.0497 C443.331798,10860.0561 443.351579,10860.0633 443.371059,10860.0711 C443.388796,10860.0782 443.406098,10860.0857 443.423222,10860.0937 C443.443891,10860.1034 443.464294,10860.1138 443.484277,10860.1249 C443.496394,10860.1315 443.508613,10860.1386 443.520709,10860.146 C443.546275,10860.1617 443.571131,10860.1785 443.595159,10860.1963 C443.602603,10860.2018 443.609842,10860.2073 443.617022,10860.2129 C443.680182,10860.2626 443.737448,10860.3198 443.787214,10860.3832 L443.707107,10860.2929 C443.742501,10860.3283 443.774687,10860.3657 443.803665,10860.4047 C443.82151,10860.4289 443.838281,10860.4537 443.853933,10860.4793 C443.861393,10860.4914 443.868501,10860.5036 443.875329,10860.5159 C443.886206,10860.5357 443.896623,10860.5561 443.906346,10860.5769 C443.914321,10860.5939 443.921804,10860.6112 443.928775,10860.6287 C443.936684,10860.6484 443.943878,10860.6682 443.950453,10860.6883 C443.955271,10860.7031 443.959902,10860.7185 443.964155,10860.734 C443.970166,10860.7556 443.97536,10860.7773 443.979835,10860.7992 C443.983298,10860.8166 443.986372,10860.8341 443.988982,10860.8515 C443.992033,10860.8715 443.994467,10860.8921 443.996262,10860.9129 C443.997844,10860.9317 443.998905,10860.9497 443.999483,10860.9677 C443.999818,10860.9778 444,10860.9889 444,10861 L444,10867 C444,10867.5523 443.552285,10868 443,10868 C442.447715,10868 442,10867.5523 442,10867 L442,10863.414 L433.707107,10871.7071 C433.316582,10872.0976 432.683418,10872.0976 432.292893,10871.7071 C431.902369,10871.3166 431.902369,10870.6834 432.292893,10870.2929 L440.584,10862 L437,10862 C436.487164,10862 436.064493,10861.614 436.006728,10861.1166 L436,10861 C436,10860.4477 436.447715,10860 437,10860 L443,10860 Z" }) }) }) }));
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { ExternalIcon } from "./external-icon";
3
+ declare const meta: Meta<typeof ExternalIcon>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof ExternalIcon>;
6
+ export declare const Default: Story;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { ExternalIcon } from "./external-icon";
3
+ import { Decorator } from "../../../components/decorator/decorator";
4
+ const meta = {
5
+ title: "Icons/ExternalIcon",
6
+ component: ExternalIcon,
7
+ decorators: [
8
+ (Story) => (_jsx(Decorator, { children: _jsx(Story, {}) })),
9
+ ],
10
+ };
11
+ export default meta;
12
+ export const Default = {
13
+ args: {},
14
+ };
@@ -0,0 +1 @@
1
+ export declare const HamburgerIcon: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export const HamburgerIcon = () => (_jsx("svg", { width: "30px", height: "19px", viewBox: "0 0 30 19", fill: "#333333", version: "1.1", xmlns: "http://www.w3.org/2000/svg", children: _jsx("g", { stroke: "none", strokeWidth: "1", fillRule: "evenodd", children: _jsx("g", { transform: "translate(-326.000000, -113.000000)", children: _jsx("g", { transform: "translate(0.000000, 94.000000)", children: _jsx("path", { d: "M326,19 L356,19 L356,22 L326,22 Z M326,27 L356,27 L356,30 L326,30 Z M326,35 L356,35 L356,38 L326,38 Z" }) }) }) }) }));
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { HamburgerIcon } from "./hamburger-icon";
3
+ declare const meta: Meta<typeof HamburgerIcon>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof HamburgerIcon>;
6
+ export declare const Default: Story;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { HamburgerIcon } from "./hamburger-icon";
3
+ import { Decorator } from "../../../components/decorator/decorator";
4
+ const meta = {
5
+ title: "Icons/HamburgerIcon",
6
+ component: HamburgerIcon,
7
+ decorators: [
8
+ (Story) => (_jsx(Decorator, { children: _jsx(Story, {}) })),
9
+ ],
10
+ };
11
+ export default meta;
12
+ export const Default = {
13
+ args: {},
14
+ };
@@ -0,0 +1 @@
1
+ export declare const HeartIcon: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export const HeartIcon = () => (_jsx("svg", { width: "20px", height: "18px", viewBox: "0 0 20 18", version: "1.1", xmlns: "http://www.w3.org/2000/svg", children: _jsx("g", { id: "Page-1", stroke: "none", strokeWidth: "1", fill: "none", fillRule: "evenodd", children: _jsx("g", { id: "navigation_1440_1", transform: "translate(-337.000000, -220.000000)", fill: "#ED1B2F", fillRule: "nonzero", children: _jsx("g", { id: "Group-23", transform: "translate(0.000000, 128.000000)", children: _jsx("g", { id: "Group-16", transform: "translate(128.000000, 0.000000)", children: _jsx("g", { id: "Group-15", transform: "translate(80.000000, 32.000000)", children: _jsx("path", { d: "M143.961126,60.790431 C142.253052,60.6643448 140.432682,61.3962357 139.210237,62.6994547 L139.134389,62.7802287 L139.05854,62.6994547 C137.927704,61.4927704 136.283659,60.7766403 134.690836,60.7766403 C134.562779,60.7766403 134.434723,60.7815655 134.307652,60.790431 C132.310959,60.9381882 130.761478,62.1694987 130.050273,64.1691469 C129.145013,66.7253474 130.275849,69.6056288 133.414213,72.7311873 C135.013394,74.2978159 136.778889,75.6851081 138.679296,76.8683905 L138.954125,77.0319085 C139.065219,77.0979816 139.203558,77.0979816 139.314653,77.0319085 L139.589481,76.8683905 C141.489053,75.6839171 143.254424,74.2967226 144.854565,72.7311873 C147.991944,69.6056288 149.123764,66.7223923 148.21752,64.1691469 C147.5073,62.1694987 145.954864,60.9401583 143.961126,60.790431 Z", id: "heart_icon_red" }) }) }) }) }) }) }));
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { HeartIcon } from "./heart-icon";
3
+ declare const meta: Meta<typeof HeartIcon>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof HeartIcon>;
6
+ export declare const Default: Story;
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { HeartIcon } from "./heart-icon";
3
+ import { Decorator } from "../../../components/decorator/decorator";
4
+ const meta = {
5
+ title: "Icons/HeartIcon",
6
+ component: HeartIcon,
7
+ decorators: [
8
+ (Story) => (_jsx(Decorator, { children: _jsx(Story, {}) })),
9
+ ],
10
+ };
11
+ export default meta;
12
+ export const Default = {};
@@ -0,0 +1 @@
1
+ export declare const MenuCloseIcon: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,2 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export const MenuCloseIcon = () => (_jsx("svg", { width: "24px", height: "25px", viewBox: "0 0 24 25", version: "1.1", fill: "#333333", xmlns: "http://www.w3.org/2000/svg", children: _jsx("g", { stroke: "none", strokeWidth: "1", fillRule: "evenodd", children: _jsx("g", { transform: "translate(-329.000000, -110.000000)", children: _jsx("path", { d: "M350.545942,110.832738 L352.667262,112.954058 L343.120738,122.499738 L352.667262,132.045942 L350.545942,134.167262 L340.999738,124.620738 L331.454058,134.167262 L329.332738,132.045942 L338.878738,122.499738 L329.332738,112.954058 L331.454058,110.832738 L340.999738,120.378738 L350.545942,110.832738 Z" }) }) }) }));
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { MenuCloseIcon } from "./menu-close-icon";
3
+ declare const meta: Meta<typeof MenuCloseIcon>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof MenuCloseIcon>;
6
+ export declare const Default: Story;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { MenuCloseIcon } from "./menu-close-icon";
3
+ import { Decorator } from "../../../components/decorator/decorator";
4
+ const meta = {
5
+ title: "Icons/MenuCloseIcon",
6
+ component: MenuCloseIcon,
7
+ decorators: [
8
+ (Story) => (_jsx(Decorator, { children: _jsx(Story, {}) })),
9
+ ],
10
+ };
11
+ export default meta;
12
+ export const Default = {
13
+ args: {},
14
+ };
@@ -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,67 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import styled, { css } from "styled-components";
3
+ import { media } from "../../../styles/mixins";
4
+ import { rem } from "../../../styles/units";
5
+ import { ToggableChevron } from "../../../components/icons/toggable-chevron/toggable-chevron";
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 && css `
49
+ ${({ theme }) => css `
50
+ color: ${theme.red};
51
+ box-shadow: inset 0 -4px 0 ${theme.red};
52
+ `};
53
+ `};
54
+ `;
55
+ const StyledToggle = styled(ToggableChevron).attrs({
56
+ disableCircle: true,
57
+ }) `
58
+ margin-left: ${rem(4)};
59
+
60
+ svg {
61
+ ${(props) => props.toggled && css `
62
+ ${({ theme }) => css `
63
+ fill: ${theme.red};
64
+ `};
65
+ `};
66
+ }
67
+ `;
@@ -0,0 +1,7 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { NavigationCell } from "./nav-cell";
3
+ declare const meta: Meta<typeof NavigationCell>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof NavigationCell>;
6
+ export declare const Default: Story;
7
+ export declare const Active: Story;
@@ -0,0 +1,23 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { NavigationCell } from "./nav-cell";
3
+ import { Decorator } from "../../../components/decorator/decorator";
4
+ const meta = {
5
+ title: "Navigation/NavCell",
6
+ component: NavigationCell,
7
+ decorators: [
8
+ (Story) => (_jsx(Decorator, { children: _jsx("div", { style: { height: '76px' }, children: _jsx(Story, {}) }) })),
9
+ ],
10
+ };
11
+ export default meta;
12
+ export const Default = {
13
+ args: {
14
+ title: "Lorem ipsum",
15
+ active: false
16
+ }
17
+ };
18
+ export const Active = {
19
+ args: {
20
+ title: "Lorem ipsum",
21
+ active: true
22
+ }
23
+ };
@@ -0,0 +1,18 @@
1
+ import { WebPageUrl } from '../../../models/web-page-url';
2
+ export type NavigationItemProps = {
3
+ model: NavigationItemModel;
4
+ expanded?: boolean;
5
+ parent?: string;
6
+ onToggle: (model: NavigationItemModel) => void;
7
+ onLinkClick?: () => void;
8
+ };
9
+ export type NavigationItemModel = {
10
+ key: string;
11
+ title: string;
12
+ highlight?: boolean;
13
+ slug?: {
14
+ current: string;
15
+ };
16
+ items?: WebPageUrl[];
17
+ };
18
+ export declare const NavigationItem: ({ model, expanded, onToggle, onLinkClick }: NavigationItemProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,106 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Link } from "gatsby";
3
+ import styled, { css } from "styled-components";
4
+ import { media } from "../../../styles/mixins";
5
+ import { rem } from "../../../styles/units";
6
+ import { ToggableChevron } from "../../../components/icons/toggable-chevron/toggable-chevron";
7
+ import { HeartIcon } from "../../../components/icons/heart-icon/heart-icon";
8
+ export const NavigationItem = ({ model, expanded, onToggle, onLinkClick }) => {
9
+ const { highlight, title, items, slug } = model;
10
+ return (_jsxs(Wrapper, { "data-test": "nav-item", children: [slug ? (_jsxs(HeaderLink, { to: slug.current, onClick: () => {
11
+ onLinkClick?.();
12
+ }, children: [_jsx(Title, { active: highlight, children: title }), highlight && (_jsx(IconWrapper, { children: _jsx(HeartIcon, {}) }))] })) : (_jsxs(HeaderButton, { onClick: () => {
13
+ onToggle(model);
14
+ }, children: [_jsx(Title, { children: title }), _jsx(StyledToggle, { toggled: expanded, disableCircle: false })] })), (!slug && items) && (_jsx(Expandable, { "data-test": "nav-item-list", active: expanded, children: items.map(({ webUrlName, internalLink }) => (_jsx(StyledListItem, { children: _jsx(StyledLink, { tabIndex: !expanded ? -1 : 0, to: internalLink?.slug?.current ?? "", onClick: () => {
15
+ onLinkClick?.();
16
+ }, children: webUrlName }) }, webUrlName))) }))] }));
17
+ };
18
+ const Wrapper = styled.li `
19
+ display: flex;
20
+ flex-direction: column;
21
+ margin-top: ${rem(16)};
22
+ `;
23
+ const HeaderButton = styled.button `
24
+ display: flex;
25
+ flex-direction: row;
26
+ align-items: center;
27
+ cursor: pointer;
28
+ padding: 0;
29
+ border: 0;
30
+ background: none;
31
+ `;
32
+ const HeaderLink = styled(Link) `
33
+ display: flex;
34
+ flex-direction: row;
35
+ align-items: center;
36
+ cursor: pointer;
37
+ text-decoration: none;
38
+
39
+ svg {
40
+ flex-shrink: 0;
41
+ }
42
+ `;
43
+ const Title = styled.p `
44
+ font-size: ${rem(16)};
45
+ margin: 0;
46
+ margin-right: ${rem(8)};
47
+ text-align: left;
48
+
49
+ ${({ theme }) => css `
50
+ color: ${theme.blackLight};
51
+ font-family: ${theme.valueBold};
52
+ `};
53
+
54
+ ${({ active }) => active && css `
55
+ color: ${({ theme }) => theme.red};
56
+ `};
57
+
58
+ ${media.L `
59
+ font-size: ${rem(18)};
60
+ margin-right: ${rem(6)};
61
+ `}
62
+ `;
63
+ const IconWrapper = styled.div `
64
+ display: flex;
65
+
66
+ ${media.L `
67
+ margin-right: ${rem(20)};
68
+ `}
69
+ `;
70
+ const StyledToggle = styled(ToggableChevron) `
71
+ margin-left: auto;
72
+
73
+ ${media.L `
74
+ margin-right: ${rem(20)};
75
+ `}
76
+ `;
77
+ const Expandable = styled.ul `
78
+ position: relative;
79
+ display: flex;
80
+ flex-direction: column;
81
+ overflow: hidden;
82
+ margin: 0;
83
+ padding: 0;
84
+ display: none;
85
+
86
+ ${({ active }) => active && css `
87
+ display: block;
88
+ `};
89
+ `;
90
+ const StyledListItem = styled.li `
91
+ margin-top: ${rem(16)};
92
+ margin-left: ${rem(8)};
93
+ `;
94
+ const StyledLink = styled(Link) `
95
+ font-size: ${rem(16)};
96
+ text-decoration: none;
97
+
98
+ ${({ theme }) => css `
99
+ color: ${theme.blackLight};
100
+ font-family: ${theme.valueRegular};
101
+
102
+ ${media.L `
103
+ font-family: ${theme.valueMedium};
104
+ `}
105
+ `};
106
+ `;
@@ -0,0 +1,9 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { NavigationItem } from "./nav-item";
3
+ declare const meta: Meta<typeof NavigationItem>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof NavigationItem>;
6
+ export declare const Default: Story;
7
+ export declare const Highlighted: Story;
8
+ export declare const WithItems: Story;
9
+ export declare const WithItemsExpanded: Story;
@@ -0,0 +1,73 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { NavigationItem } from "./nav-item";
3
+ import { Decorator } from "../../../components/decorator/decorator";
4
+ const mockWebUrlItems = [
5
+ {
6
+ webUrlName: 'Sub Item #1',
7
+ slugReference: {
8
+ slug: '/sub-item-1/',
9
+ },
10
+ },
11
+ {
12
+ webUrlName: 'Sub Item #2',
13
+ slugReference: {
14
+ slug: '/sub-item-2/',
15
+ },
16
+ },
17
+ ];
18
+ const navItemModelMockDefault = {
19
+ key: 'A0',
20
+ title: 'Nav Item default',
21
+ highlight: false,
22
+ slug: {
23
+ current: '/item-1/',
24
+ },
25
+ items: [],
26
+ };
27
+ const navItemModelMockHiglighted = {
28
+ key: 'A0',
29
+ title: 'Nav Item Highlighted',
30
+ highlight: true,
31
+ slug: {
32
+ current: '/item-1/',
33
+ },
34
+ items: [],
35
+ };
36
+ const navItemModelMockExpandable = {
37
+ key: 'A0',
38
+ title: 'Nav Item Expandable',
39
+ highlight: false,
40
+ items: [...mockWebUrlItems],
41
+ };
42
+ const meta = {
43
+ title: "Navigation/NavItem",
44
+ component: NavigationItem,
45
+ decorators: [
46
+ (Story) => (_jsx(Decorator, { children: _jsx(Story, {}) })),
47
+ ],
48
+ };
49
+ export default meta;
50
+ export const Default = {
51
+ args: {
52
+ model: navItemModelMockDefault,
53
+ expanded: false
54
+ }
55
+ };
56
+ export const Highlighted = {
57
+ args: {
58
+ model: navItemModelMockHiglighted,
59
+ expanded: false
60
+ }
61
+ };
62
+ export const WithItems = {
63
+ args: {
64
+ model: navItemModelMockExpandable,
65
+ expanded: false
66
+ }
67
+ };
68
+ export const WithItemsExpanded = {
69
+ args: {
70
+ model: navItemModelMockExpandable,
71
+ expanded: true
72
+ }
73
+ };
@@ -0,0 +1,14 @@
1
+ import { SanityImage } from '../../../../models/sanity-types';
2
+ export type CardBannerProps = {
3
+ title: string;
4
+ text: string;
5
+ image?: SanityImage;
6
+ backgroundColor?: {
7
+ value: string;
8
+ };
9
+ externalUrl?: string;
10
+ internalLink?: string;
11
+ onClick?: () => void;
12
+ };
13
+ export declare const CardBanner: ({ title, text, image, externalUrl, internalLink, onClick, }: CardBannerProps) => import("react/jsx-runtime").JSX.Element;
14
+ export default CardBanner;
@@ -0,0 +1,62 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Image } from '../../../../components/layout/image/image';
3
+ import { Link } from 'gatsby';
4
+ import styled, { css } from 'styled-components';
5
+ import { media } from '../../../../styles/mixins';
6
+ import { rem } from "../../../../styles/units";
7
+ export const CardBanner = ({ title, text, image, externalUrl, internalLink, onClick, }) => {
8
+ return (_jsxs(Wrapper, { "data-test": "card-banner", as: externalUrl ? 'a' : !internalLink ? 'div' : Link, href: externalUrl || undefined, to: internalLink || undefined, target: externalUrl ? '_blank' : undefined, onClick: () => onClick?.(), children: [_jsx(ImageWrapper, { children: _jsx(StyledImage, { image: image?.asset }) }), _jsxs(TextWrapper, { children: [_jsx(Title, { children: title }), _jsx(StyledParagraph, { children: text })] })] }));
9
+ };
10
+ const Wrapper = styled(Link) `
11
+ display: flex;
12
+ align-items: flex-start;
13
+ background-color: white;
14
+ border-radius: ${rem(6)};
15
+ text-decoration: none;
16
+ box-shadow: 0 ${rem(4)} ${rem(16)} 0 rgba(0,0,0,0.08);
17
+ padding: ${rem(16)};
18
+ `;
19
+ const ImageWrapper = styled.div `
20
+ border-radius: 50%;
21
+ flex-shrink: 0;
22
+ overflow: hidden;
23
+ width: ${rem(64)};
24
+ height: ${rem(64)};
25
+
26
+ ${media.L `
27
+ width: ${rem(72)};
28
+ height: ${rem(72)};
29
+ `}
30
+ `;
31
+ const StyledImage = styled(Image) `
32
+ width: 100%;
33
+ height: 100%;
34
+ object-fit: cover;
35
+ `;
36
+ const TextWrapper = styled.div `
37
+ word-break: break-word;
38
+ margin-left: ${rem(16)};
39
+ `;
40
+ const Title = styled.h3 `
41
+ margin: 0;
42
+ margin-bottom: ${rem(5)};
43
+
44
+ ${({ theme }) => css `
45
+ color: ${theme.blackLight};
46
+ font-family: ${theme.valueBold};
47
+ font-size: ${rem(20)};
48
+ line-height: ${rem(28)};
49
+
50
+ `};
51
+ `;
52
+ const StyledParagraph = styled.p `
53
+ margin: 0;
54
+
55
+ ${({ theme }) => css `
56
+ color: ${theme.blackLight};
57
+ font-family: ${theme.valueRegular};
58
+ font-size: ${rem(16)};
59
+ line-height: ${rem(24)};
60
+ `};
61
+ `;
62
+ export default CardBanner;
@@ -0,0 +1,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { CardBanner } from "./card-banner";
3
+ declare const meta: Meta<typeof CardBanner>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof CardBanner>;
6
+ export declare const Default: Story;
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { CardBanner } from "./card-banner";
3
+ import { Decorator } from "../../../../components/decorator/decorator";
4
+ import { mockImage_128_128 } from '../../../../mocks/image-mocks';
5
+ const mockWebUrlItem = {
6
+ externalUrl: 'https://example.com',
7
+ internalLink: {
8
+ slug: {
9
+ current: '/sub-item-2/'
10
+ }
11
+ }
12
+ };
13
+ const meta = {
14
+ title: "Surfaces/Cards/CardBanner",
15
+ component: CardBanner,
16
+ decorators: [
17
+ (Story) => (_jsx(Decorator, { children: _jsx("div", { style: { width: '300px' }, children: _jsx(Story, {}) }) })),
18
+ ],
19
+ };
20
+ export default meta;
21
+ export const Default = {
22
+ args: {
23
+ title: 'Rubrik',
24
+ text: 'Lorem ipsum dolor sit amet, sit amet dolor.',
25
+ // @ts-ignore
26
+ image: mockImage_128_128,
27
+ webPageUrl: mockWebUrlItem
28
+ }
29
+ };
package/dist/index.d.ts CHANGED
@@ -13,11 +13,18 @@ import { type EntryListProps, type EntryListItemProps, type EntryListHeadingProp
13
13
  import { type DropdownProps } from "./components/inputs/dropdown/dropdown";
14
14
  import { type PaginationProps } from "./components/navigation/pagination/pagination";
15
15
  import { type AccordionItemProps } from "./components/layout/accordion/accordion";
16
- export type { ButtonProps, LoadingButtonProps, TextButtonProps, EmailSignupFormProps, ImageProps, ContainerProps, AlertProps, EntryListHeadingProps, EntryListTextProps, PaginationProps, };
16
+ import { type NavigationCellProps } from "./components/navigation/nav-cell/nav-cell";
17
+ import { type NavigationItemProps } from "./components/navigation/nav-item/nav-item";
18
+ import { type CardBannerProps } from "./components/surfaces/cards/card-banner/card-banner";
19
+ export type { ButtonProps, LoadingButtonProps, TextButtonProps, EmailSignupFormProps, ImageProps, ContainerProps, AlertProps, EntryListHeadingProps, EntryListTextProps, PaginationProps, NavigationCellProps, NavigationItemProps, CardBannerProps };
17
20
  export { CloseIcon } from "./components/icons/close-icon/close-icon";
18
21
  export { ExclamationMarkIcon } from "./components/icons/exclamation-mark-icon/exclamation-mark-icon";
19
22
  export { WarningIcon } from "./components/icons/warning-icon/warning-icon";
20
23
  export { SearchIcon } from "./components/icons/search-icon/search-icon";
24
+ export { ToggableChevron } from "./components/icons/toggable-chevron/toggable-chevron";
25
+ export { HamburgerIcon } from "./components/icons/hamburger-icon/hamburger-icon";
26
+ export { MenuCloseIcon } from "./components/icons/menu-close-icon/menu-close-icon";
27
+ export { ExternalIcon } from "./components/icons/external-icon/external-icon";
21
28
  export declare const LoadingSpinner: import("react").FC<LoadingSpinnerProps>;
22
29
  export declare const Button: import("react").FC<ButtonProps>;
23
30
  export declare const LoadingButton: import("react").FC<LoadingButtonProps>;
@@ -39,3 +46,6 @@ export declare const Accordion: import("react").FC<import("styled-components/dis
39
46
  disabled?: boolean;
40
47
  }>>;
41
48
  export declare const AccordionItem: import("react").FC<AccordionItemProps>;
49
+ export declare const NavigationCell: import("react").FC<NavigationCellProps>;
50
+ export declare const NavigationItem: import("react").FC<NavigationItemProps>;
51
+ export declare const CardBanner: import("react").FC<CardBannerProps>;
package/dist/index.js CHANGED
@@ -16,11 +16,18 @@ import { EntryList as EntryListComponent, EntryListItem as EntryListItemComponen
16
16
  import { Dropdown as DropdownComponent, } from "./components/inputs/dropdown/dropdown";
17
17
  import { Pagination as PaginationComponent, } from "./components/navigation/pagination/pagination";
18
18
  import { Accordion as AccordionComponent, AccordionItem as AccordionItemComponent, } from "./components/layout/accordion/accordion";
19
+ import { NavigationCell as NavigationCellComponent, } from "./components/navigation/nav-cell/nav-cell";
20
+ import { NavigationItem as NavigationItemComponent, } from "./components/navigation/nav-item/nav-item";
21
+ import { CardBanner as CardBannerComponent, } from "./components/surfaces/cards/card-banner/card-banner";
19
22
  // Icons
20
23
  export { CloseIcon } from "./components/icons/close-icon/close-icon";
21
24
  export { ExclamationMarkIcon } from "./components/icons/exclamation-mark-icon/exclamation-mark-icon";
22
25
  export { WarningIcon } from "./components/icons/warning-icon/warning-icon";
23
26
  export { SearchIcon } from "./components/icons/search-icon/search-icon";
27
+ export { ToggableChevron } from "./components/icons/toggable-chevron/toggable-chevron";
28
+ export { HamburgerIcon } from "./components/icons/hamburger-icon/hamburger-icon";
29
+ export { MenuCloseIcon } from "./components/icons/menu-close-icon/menu-close-icon";
30
+ export { ExternalIcon } from "./components/icons/external-icon/external-icon";
24
31
  export const LoadingSpinner = withDefaultTheme(LoadingSpinnerComponent);
25
32
  // Components
26
33
  export const Button = withDefaultTheme(ButtonComponent);
@@ -41,3 +48,6 @@ export const Dropdown = withDefaultTheme(DropdownComponent);
41
48
  export const Pagination = withDefaultTheme(PaginationComponent);
42
49
  export const Accordion = withDefaultTheme(AccordionComponent);
43
50
  export const AccordionItem = withDefaultTheme(AccordionItemComponent);
51
+ export const NavigationCell = withDefaultTheme(NavigationCellComponent);
52
+ export const NavigationItem = withDefaultTheme(NavigationItemComponent);
53
+ export const CardBanner = withDefaultTheme(CardBannerComponent);
@@ -0,0 +1,30 @@
1
+ export declare const mockImage_128_128: {
2
+ asset: {
3
+ description: string;
4
+ gatsbyImageData: {
5
+ images: {
6
+ sources: {
7
+ srcSet: string;
8
+ sizes: string;
9
+ type: string;
10
+ }[];
11
+ fallback: {
12
+ src: string;
13
+ srcSet: string;
14
+ sizes: string;
15
+ };
16
+ };
17
+ layout: string;
18
+ backgroundColor: string;
19
+ width: number;
20
+ height: number;
21
+ };
22
+ };
23
+ };
24
+ export declare const svgMock: {
25
+ asset: {
26
+ description: string;
27
+ url: string;
28
+ extension: string;
29
+ };
30
+ };
@@ -0,0 +1,32 @@
1
+ export const mockImage_128_128 = {
2
+ asset: {
3
+ description: 'lorem ipsum',
4
+ gatsbyImageData: {
5
+ images: {
6
+ sources: [
7
+ {
8
+ srcSet: '//images.ctfassets.net/e8gvzq1fwq00/4KETnnG9zWRzgrz8C6txFE/593a0fa983e140a49f78ed7ce6b16313/Blodtrycket_liten.jpg?w=452&h=650&q=50&fm=webp 452w,\n//images.ctfassets.net/e8gvzq1fwq00/4KETnnG9zWRzgrz8C6txFE/593a0fa983e140a49f78ed7ce6b16313/Blodtrycket_liten.jpg?w=904&h=1300&q=50&fm=webp 904w,\n//images.ctfassets.net/e8gvzq1fwq00/4KETnnG9zWRzgrz8C6txFE/593a0fa983e140a49f78ed7ce6b16313/Blodtrycket_liten.jpg?w=1808&h=2599&q=50&fm=webp 1808w',
9
+ sizes: '(min-width: 128px) 128px, 100vw',
10
+ type: 'image/webp',
11
+ },
12
+ ],
13
+ fallback: {
14
+ src: '//images.ctfassets.net/e8gvzq1fwq00/4KETnnG9zWRzgrz8C6txFE/593a0fa983e140a49f78ed7ce6b16313/Blodtrycket_liten.jpg?w=1808&h=2599&fl=progressive&q=50&fm=jpg',
15
+ srcSet: '//images.ctfassets.net/e8gvzq1fwq00/4KETnnG9zWRzgrz8C6txFE/593a0fa983e140a49f78ed7ce6b16313/Blodtrycket_liten.jpg?w=452&h=650&fl=progressive&q=50&fm=jpg 452w,\n//images.ctfassets.net/e8gvzq1fwq00/4KETnnG9zWRzgrz8C6txFE/593a0fa983e140a49f78ed7ce6b16313/Blodtrycket_liten.jpg?w=904&h=1300&fl=progressive&q=50&fm=jpg 904w,\n//images.ctfassets.net/e8gvzq1fwq00/4KETnnG9zWRzgrz8C6txFE/593a0fa983e140a49f78ed7ce6b16313/Blodtrycket_liten.jpg?w=1808&h=2599&fl=progressive&q=50&fm=jpg 1808w',
16
+ sizes: '(min-width: 128px) 128px, 100vw',
17
+ },
18
+ },
19
+ layout: 'constrained',
20
+ backgroundColor: '#e89888',
21
+ width: 128,
22
+ height: 128,
23
+ },
24
+ }
25
+ };
26
+ export const svgMock = {
27
+ asset: {
28
+ description: 'lorem ipsum',
29
+ url: 'https://cdn.sanity.io/images/1mvwv0jt/development/c3fd17a2e85054afbc33b99672c469f82cdde69c-189x135.svg',
30
+ extension: 'svg'
31
+ }
32
+ };
@@ -0,0 +1,9 @@
1
+ import { IGatsbyImageData } from 'gatsby-plugin-image';
2
+ export type SanityImage = {
3
+ asset: {
4
+ gatsbyImageData: IGatsbyImageData;
5
+ description: string;
6
+ url?: string;
7
+ extension?: string;
8
+ };
9
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ export type WebPageUrl = {
2
+ externalUrl?: string;
3
+ openInNewWindow?: boolean;
4
+ internalLink?: {
5
+ slug?: {
6
+ current: string;
7
+ };
8
+ };
9
+ webUrlName?: string;
10
+ };
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hlf-fe/pulmo-ui",
3
3
  "private": false,
4
- "version": "1.1.0",
4
+ "version": "1.2.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",