@hlf-fe/pulmo-ui 1.5.7 → 1.5.8

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 (45) hide show
  1. package/dist/index.d.ts +1 -0
  2. package/dist/index.js +1 -0
  3. package/package.json +1 -1
  4. package/dist/components/buttons/link-button/link-button.d.ts +0 -25
  5. package/dist/components/buttons/link-button/link-button.js +0 -80
  6. package/dist/components/buttons/link-button/link-button.stories.d.ts +0 -6
  7. package/dist/components/buttons/link-button/link-button.stories.js +0 -17
  8. package/dist/components/data-display/list/text-list/text-list.d.ts +0 -0
  9. package/dist/components/data-display/list/text-list/text-list.js +0 -0
  10. package/dist/components/data-display/list/text-list/text-list.stories.d.ts +0 -0
  11. package/dist/components/data-display/list/text-list/text-list.stories.js +0 -0
  12. package/dist/components/layout/image-list/image-list.d.ts +0 -6
  13. package/dist/components/layout/image-list/image-list.js +0 -55
  14. package/dist/components/layout/image-list/image-list.stories.d.ts +0 -6
  15. package/dist/components/layout/image-list/image-list.stories.js +0 -19
  16. package/dist/components/modules/navigation/navigation-desktop/nav-cell.d.ts +0 -6
  17. package/dist/components/modules/navigation/navigation-desktop/nav-cell.js +0 -69
  18. package/dist/components/modules/navigation/navigation-desktop/nav-section.d.ts +0 -8
  19. package/dist/components/modules/navigation/navigation-desktop/nav-section.js +0 -80
  20. package/dist/components/modules/navigation/types.d.ts +0 -39
  21. package/dist/components/modules/navigation/types.js +0 -1
  22. package/dist/components/navigation/dropdown-menu/dropdown-menu.d.ts +0 -0
  23. package/dist/components/navigation/dropdown-menu/dropdown-menu.js +0 -0
  24. package/dist/components/navigation/nav-cell/nav-cell.d.ts +0 -6
  25. package/dist/components/navigation/nav-cell/nav-cell.js +0 -69
  26. package/dist/components/navigation/nav-cell/nav-cell.stories.d.ts +0 -7
  27. package/dist/components/navigation/nav-cell/nav-cell.stories.js +0 -23
  28. package/dist/components/navigation/nav-cell/navbar.d.ts +0 -0
  29. package/dist/components/navigation/nav-cell/navbar.js +0 -0
  30. package/dist/components/navigation/nav-item/nav-item.d.ts +0 -18
  31. package/dist/components/navigation/nav-item/nav-item.js +0 -106
  32. package/dist/components/navigation/nav-item/nav-item.stories.d.ts +0 -9
  33. package/dist/components/navigation/nav-item/nav-item.stories.js +0 -73
  34. package/dist/components/navigation/nav-section/dropdown-menu.d.ts +0 -0
  35. package/dist/components/navigation/nav-section/dropdown-menu.js +0 -0
  36. package/dist/components/navigation/nav-section/nav-section.d.ts +0 -0
  37. package/dist/components/navigation/nav-section/nav-section.js +0 -0
  38. package/dist/components/navigation/navbar/navbar.d.ts +0 -0
  39. package/dist/components/navigation/navbar/navbar.js +0 -0
  40. package/dist/models/sanity.types.d.ts +0 -9
  41. package/dist/models/sanity.types.js +0 -1
  42. package/dist/models/web-page.url.d.ts +0 -10
  43. package/dist/models/web-page.url.js +0 -1
  44. /package/dist/components/layout/image/{Image.stories.d.ts → image.stories.d.ts} +0 -0
  45. /package/dist/components/layout/image/{Image.stories.js → image.stories.js} +0 -0
package/dist/index.d.ts CHANGED
@@ -21,6 +21,7 @@ import { type FooterProps } from "./components/modules/footer/footer";
21
21
  import { type LogoListProps } from "./components/modules/logo-list/logo-list";
22
22
  export type { ButtonProps, LoadingButtonProps, TextButtonProps, EmailSignupFormProps, ImageProps, ContainerProps, AlertProps, EntryListHeadingProps, EntryListTextProps, PaginationProps, CardBannerProps, PaperProps, };
23
23
  export { CloseIcon } from "./components/icons/close-icon/close-icon";
24
+ export { ChevronLeftIcon } from "./components/icons/chevron-left-icon/chevron-left-icon";
24
25
  export { ExclamationMarkIcon } from "./components/icons/exclamation-mark-icon/exclamation-mark-icon";
25
26
  export { WarningIcon } from "./components/icons/warning-icon/warning-icon";
26
27
  export { SearchIcon } from "./components/icons/search-icon/search-icon";
package/dist/index.js CHANGED
@@ -29,6 +29,7 @@ import { NavigationDesktop as NavigationDesktopComponent, } from "./components/m
29
29
  import { NavigationMobile as NavigationMobileComponent, } from "./components/modules/navigation/navigation-mobile/navigation-mobile";
30
30
  // Icons
31
31
  export { CloseIcon } from "./components/icons/close-icon/close-icon";
32
+ export { ChevronLeftIcon } from "./components/icons/chevron-left-icon/chevron-left-icon";
32
33
  export { ExclamationMarkIcon } from "./components/icons/exclamation-mark-icon/exclamation-mark-icon";
33
34
  export { WarningIcon } from "./components/icons/warning-icon/warning-icon";
34
35
  export { SearchIcon } from "./components/icons/search-icon/search-icon";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hlf-fe/pulmo-ui",
3
3
  "private": false,
4
- "version": "1.5.7",
4
+ "version": "1.5.8",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -1,25 +0,0 @@
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;
@@ -1,80 +0,0 @@
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
- `;
@@ -1,6 +0,0 @@
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;
@@ -1,17 +0,0 @@
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
- };
@@ -1,6 +0,0 @@
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;
@@ -1,55 +0,0 @@
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
- `;
@@ -1,6 +0,0 @@
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;
@@ -1,19 +0,0 @@
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
- };
@@ -1,6 +0,0 @@
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;
@@ -1,69 +0,0 @@
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
- `;
@@ -1,8 +0,0 @@
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 {};
@@ -1,80 +0,0 @@
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
- `;
@@ -1,39 +0,0 @@
1
- import { WebPageUrl } from '../../../models/web-page-url';
2
- import { SanityImage } from '../../../models/sanity-types';
3
- export type NavigationItemModel = {
4
- key: string;
5
- title: string;
6
- highlight?: boolean;
7
- link?: WebPageUrl;
8
- items?: any;
9
- };
10
- export type NavigationSectionModel = {
11
- key: string;
12
- title: string;
13
- column1Title?: string;
14
- column1Items?: NavigationItemModel[];
15
- column2Title?: string;
16
- column2Items?: NavigationItemModel[];
17
- backgroundColor?: {
18
- hex: string;
19
- };
20
- linkBanners: LinkBanner[];
21
- };
22
- export type LinkBanner = {
23
- title: string;
24
- text: string;
25
- image?: SanityImage;
26
- link?: WebPageUrl;
27
- };
28
- export type NavigationModel = {
29
- topMenuItems?: WebPageUrl[];
30
- mainMenuItems?: NavigationSectionModel[];
31
- logotype?: SanityImage;
32
- ctaButton?: WebPageUrl;
33
- __typename: string;
34
- localeText?: {
35
- ariaLabelHome?: string;
36
- goBack?: string;
37
- };
38
- isMenuVisible?: boolean;
39
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,6 +0,0 @@
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;
@@ -1,69 +0,0 @@
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 &&
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
- `;
@@ -1,7 +0,0 @@
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;
@@ -1,23 +0,0 @@
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
- };
File without changes
File without changes
@@ -1,18 +0,0 @@
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;
@@ -1,106 +0,0 @@
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
- `;
@@ -1,9 +0,0 @@
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;
@@ -1,73 +0,0 @@
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
- };
File without changes
File without changes
@@ -1,9 +0,0 @@
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
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,10 +0,0 @@
1
- export type WebPageUrl = {
2
- externalUrl?: string;
3
- openInNewWindow?: boolean;
4
- internalLink?: {
5
- slug?: {
6
- current: string;
7
- };
8
- };
9
- webUrlName?: string;
10
- };
@@ -1 +0,0 @@
1
- export {};