@hlf-fe/pulmo-ui 1.5.9 → 1.5.11
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.
- package/dist/components/layout/container/container.d.ts +2 -0
- package/dist/components/layout/container/container.js +5 -4
- package/dist/components/modules/email-signup-form/email-signup-form.js +33 -33
- package/dist/components/modules/navigation/navigation-desktop/nav-cell/nav-cell.d.ts +2 -1
- package/dist/components/modules/navigation/navigation-desktop/nav-cell/nav-cell.js +16 -2
- package/dist/components/modules/navigation/navigation-desktop/navigation-desktop.js +15 -3
- package/dist/components/modules/navigation/navigation-mobile/nav-panel.d.ts +2 -2
- package/dist/components/modules/navigation/navigation-mobile/nav-panel.js +25 -6
- package/dist/components/modules/navigation/shared/types/types.d.ts +3 -1
- package/dist/components/modules/navigation/shared/types/types.js +3 -1
- package/dist/index.d.ts +2 -1
- package/dist/styles/mixins.d.ts +7 -0
- package/dist/styles/mixins.js +15 -0
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@ export type ContainerProps = {
|
|
|
8
8
|
innerContainerWidth?: string;
|
|
9
9
|
alignBlock?: "center" | "left";
|
|
10
10
|
innerWidth?: number;
|
|
11
|
+
gutters?: boolean;
|
|
11
12
|
} & CSSTypes;
|
|
12
13
|
export declare const Container: import("react").ForwardRefExoticComponent<{
|
|
13
14
|
children: ReactNode;
|
|
@@ -16,5 +17,6 @@ export declare const Container: import("react").ForwardRefExoticComponent<{
|
|
|
16
17
|
innerContainerWidth?: string;
|
|
17
18
|
alignBlock?: "center" | "left";
|
|
18
19
|
innerWidth?: number;
|
|
20
|
+
gutters?: boolean;
|
|
19
21
|
} & CSSTypes & import("react").RefAttributes<HTMLDivElement>>;
|
|
20
22
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef } from "react";
|
|
3
|
-
import { siteWidthRow, siteWidthRowMd, siteWidthRowXL, siteWidthRowS, siteWidthRowAuto, } from "../../../styles/mixins";
|
|
3
|
+
import { siteWidthRow, siteWidthRowMd, siteWidthRowXL, siteWidthRowS, siteWidthRowAuto, siteWidthOnly, } from "../../../styles/mixins";
|
|
4
4
|
import { rem } from "../../../styles/units";
|
|
5
5
|
import styled from "styled-components";
|
|
6
6
|
const MAX_WIDTH = {
|
|
@@ -22,14 +22,15 @@ const getMaxWidth = (size) => {
|
|
|
22
22
|
const getInnerWidth = (size) => {
|
|
23
23
|
return INNER_WIDTH?.[size];
|
|
24
24
|
};
|
|
25
|
-
export const Container = forwardRef(({ children, className, maxWidth = "lg", position = "static", display = "block", alignBlock = "center", innerWidth, }, ref) => {
|
|
25
|
+
export const Container = forwardRef(({ children, className, maxWidth = "lg", position = "static", display = "block", alignBlock = "center", innerWidth, gutters = true, }, ref) => {
|
|
26
26
|
const containerWidth = alignBlock === "left" ? "lg" : maxWidth;
|
|
27
27
|
const innerContainerWidth = alignBlock == "left" ? getInnerWidth(maxWidth) : innerWidth;
|
|
28
28
|
const content = innerContainerWidth ? (_jsx(Inner, { "$innerContainerWidth": innerContainerWidth, children: children })) : (children);
|
|
29
|
-
return (_jsx(Div, { ref: ref, className: className, "$maxWidth": getMaxWidth(containerWidth), "$display": display, "$position": position, children: content }));
|
|
29
|
+
return (_jsx(Div, { ref: ref, className: className, "$maxWidth": getMaxWidth(containerWidth), "$display": display, "$position": position, "$gutters": gutters, "$size": containerWidth, children: content }));
|
|
30
30
|
});
|
|
31
31
|
const Div = styled.div `
|
|
32
|
-
${({ $maxWidth }) => $maxWidth};
|
|
32
|
+
${({ $maxWidth, $gutters }) => $gutters && $maxWidth};
|
|
33
|
+
${({ $gutters, $size }) => !$gutters && $size && siteWidthOnly($size)};
|
|
33
34
|
display: ${({ $display }) => $display};
|
|
34
35
|
position: ${({ $position }) => $position};
|
|
35
36
|
`;
|
|
@@ -24,43 +24,43 @@ export const EmailSignupForm = ({ heading, description, localeText, onSubmit, lo
|
|
|
24
24
|
return (_jsx(Container, { children: !success ? (_jsxs(Box, { children: [heading && _jsx(Heading, { children: heading }), description && _jsx(Text, { children: description }), _jsx(FormLabel, { htmlFor: "email", children: emailLabel }), _jsxs(TextFieldAndButton, { children: [_jsx(TextField, { type: "email", name: "email", errors: errors, register: register("email") }), _jsx(StyledLoadingButton, { onClick: handleSubmit(({ email }) => onSubmit(email)), children: sendButtonText, disabled: loading, loading: loading, btnSize: "l", fullWidthMobile: true })] }), failed && _jsx(StyledAlert, { severity: "error", children: errorMessage })] })) : (_jsx(BoxCenter, { children: _jsx(Heading, { children: successMessage }) })) }));
|
|
25
25
|
};
|
|
26
26
|
const Container = styled.form ``;
|
|
27
|
-
const TextFieldAndButton = styled.div `
|
|
28
|
-
display: flex;
|
|
29
|
-
flex-direction: column;
|
|
30
|
-
width: 100%;
|
|
31
|
-
|
|
32
|
-
${media.L `
|
|
33
|
-
flex-direction: row;
|
|
34
|
-
`}
|
|
27
|
+
const TextFieldAndButton = styled.div `
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
width: 100%;
|
|
31
|
+
|
|
32
|
+
${media.L `
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
`}
|
|
35
35
|
`;
|
|
36
36
|
const Box = styled.div ``;
|
|
37
|
-
const BoxCenter = styled(Box) `
|
|
38
|
-
display: flex;
|
|
39
|
-
width: 100%;
|
|
40
|
-
justify-content: center;
|
|
41
|
-
align-items: center;
|
|
37
|
+
const BoxCenter = styled(Box) `
|
|
38
|
+
display: flex;
|
|
39
|
+
width: 100%;
|
|
40
|
+
justify-content: center;
|
|
41
|
+
align-items: center;
|
|
42
42
|
`;
|
|
43
|
-
const Heading = styled.h2 `
|
|
44
|
-
font-family: ${({ theme }) => theme.valueBold};
|
|
45
|
-
font-size: ${rem(32)};
|
|
46
|
-
color: ${({ theme }) => theme.blackLight};
|
|
47
|
-
line-height: 1.5;
|
|
48
|
-
margin: 0;
|
|
43
|
+
const Heading = styled.h2 `
|
|
44
|
+
font-family: ${({ theme }) => theme.valueBold};
|
|
45
|
+
font-size: ${rem(32)};
|
|
46
|
+
color: ${({ theme }) => theme.blackLight};
|
|
47
|
+
line-height: 1.5;
|
|
48
|
+
margin: 0;
|
|
49
49
|
`;
|
|
50
|
-
const Text = styled.p `
|
|
51
|
-
color: ${({ theme }) => theme.blackLight};
|
|
52
|
-
font-size: ${rem(18)};
|
|
50
|
+
const Text = styled.p `
|
|
51
|
+
color: ${({ theme }) => theme.blackLight};
|
|
52
|
+
font-size: ${rem(18)};
|
|
53
53
|
`;
|
|
54
|
-
const StyledAlert = styled(Alert) `
|
|
55
|
-
margin-top: ${rem(15)};
|
|
54
|
+
const StyledAlert = styled(Alert) `
|
|
55
|
+
margin-top: ${rem(15)};
|
|
56
56
|
`;
|
|
57
|
-
const StyledLoadingButton = styled(LoadingButton) `
|
|
58
|
-
width: 100%;
|
|
59
|
-
margin-top: ${rem(15)};
|
|
60
|
-
|
|
61
|
-
${media.L `
|
|
62
|
-
margin-left: ${rem(15)};
|
|
63
|
-
margin-top: 0;
|
|
64
|
-
width: auto;
|
|
65
|
-
`}
|
|
57
|
+
const StyledLoadingButton = styled(LoadingButton) `
|
|
58
|
+
width: 100%;
|
|
59
|
+
margin-top: ${rem(15)};
|
|
60
|
+
|
|
61
|
+
${media.L `
|
|
62
|
+
margin-left: ${rem(15)};
|
|
63
|
+
margin-top: 0;
|
|
64
|
+
width: auto;
|
|
65
|
+
`}
|
|
66
66
|
`;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export type NavigationCellProps = {
|
|
2
2
|
title: string;
|
|
3
3
|
active?: boolean;
|
|
4
|
+
url?: string;
|
|
4
5
|
onToggleCell: () => void;
|
|
5
6
|
};
|
|
6
|
-
export declare const NavigationCell: ({ title, active, onToggleCell, }: NavigationCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare const NavigationCell: ({ title, active, url, onToggleCell, }: NavigationCellProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Link } from 'gatsby';
|
|
2
3
|
import { ToggableChevron } from "../../../../../components/icons/toggable-chevron/toggable-chevron";
|
|
3
4
|
import styled, { css } from "styled-components";
|
|
4
5
|
import { media } from "../../../../../styles/mixins";
|
|
5
6
|
import { rem } from "../../../../../styles/units";
|
|
6
|
-
export const NavigationCell = ({ title, active, onToggleCell, }) =>
|
|
7
|
+
export const NavigationCell = ({ title, active, url, onToggleCell, }) => {
|
|
8
|
+
if (url) {
|
|
9
|
+
return (_jsx(StyledListItem, { children: _jsx(NavCellAsLink, { "data-test": "nav-cell-link", to: url, children: title }) }));
|
|
10
|
+
}
|
|
11
|
+
return (_jsx(StyledListItem, { children: _jsxs(NavCell, { "data-test": "nav-cell", "$active": active, onClick: onToggleCell, children: [title, _jsx(StyledToggle, { toggled: active })] }) }));
|
|
12
|
+
};
|
|
7
13
|
const StyledListItem = styled.li `
|
|
8
14
|
display: inline-block;
|
|
9
15
|
height: 100%;
|
|
@@ -17,7 +23,7 @@ const StyledListItem = styled.li `
|
|
|
17
23
|
}
|
|
18
24
|
`}
|
|
19
25
|
`;
|
|
20
|
-
const
|
|
26
|
+
const NavCellStyles = css `
|
|
21
27
|
padding: 0;
|
|
22
28
|
border: 0;
|
|
23
29
|
background: none;
|
|
@@ -27,6 +33,7 @@ const NavCell = styled.button `
|
|
|
27
33
|
align-items: center;
|
|
28
34
|
height: 100%;
|
|
29
35
|
font-size: ${rem(14)};
|
|
36
|
+
text-decoration: none;
|
|
30
37
|
|
|
31
38
|
${media.XL `
|
|
32
39
|
font-size: ${rem(18)};
|
|
@@ -44,6 +51,9 @@ const NavCell = styled.button `
|
|
|
44
51
|
color: ${theme.blackLight};
|
|
45
52
|
font-family: ${theme.valueBold};
|
|
46
53
|
`};
|
|
54
|
+
`;
|
|
55
|
+
const NavCell = styled.button `
|
|
56
|
+
${NavCellStyles}
|
|
47
57
|
|
|
48
58
|
${({ $active }) => $active &&
|
|
49
59
|
css `
|
|
@@ -53,6 +63,10 @@ const NavCell = styled.button `
|
|
|
53
63
|
`};
|
|
54
64
|
`};
|
|
55
65
|
`;
|
|
66
|
+
const NavCellAsLink = styled(Link) `
|
|
67
|
+
${NavCellStyles}
|
|
68
|
+
grid-template-columns: 1fr;
|
|
69
|
+
`;
|
|
56
70
|
const StyledToggle = styled(ToggableChevron).attrs({
|
|
57
71
|
disableCircle: true,
|
|
58
72
|
}) `
|
|
@@ -6,6 +6,7 @@ import { NavigationCell } from './nav-cell/nav-cell';
|
|
|
6
6
|
import { Image } from '../../../../components/layout/image/image';
|
|
7
7
|
import { Button } from '../../../../components/buttons/button/button';
|
|
8
8
|
import { ExternalIcon } from '../../../../components/icons/external-icon/external-icon';
|
|
9
|
+
import { isNavLink } from '../shared/types/types';
|
|
9
10
|
import styled, { css } from 'styled-components';
|
|
10
11
|
import { rem } from '../../../../styles/units';
|
|
11
12
|
export const NavigationDesktop = ({ logotype, mainMenuItems, topMenuItems, ctaButton, localeText = {
|
|
@@ -14,11 +15,22 @@ export const NavigationDesktop = ({ logotype, mainMenuItems, topMenuItems, ctaBu
|
|
|
14
15
|
const [currentSection, setCurrentSection] = useState();
|
|
15
16
|
const [isSearchOpen, setIsSearchOpen] = useState(false);
|
|
16
17
|
const { ariaLabelHome } = localeText;
|
|
17
|
-
const onOpenSection = (
|
|
18
|
-
|
|
18
|
+
const onOpenSection = (item) => {
|
|
19
|
+
if (item && isNavLink(item)) {
|
|
20
|
+
setCurrentSection(undefined);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const sectionModel = item;
|
|
24
|
+
const sectionToShow = currentSection?.key !== sectionModel?.key ? sectionModel : undefined;
|
|
19
25
|
setCurrentSection(sectionToShow);
|
|
20
26
|
};
|
|
21
|
-
return (_jsxs(Wrapper, { ref: menuRef, children: [_jsxs(MenuContainer, { children: [!!topMenuItems?.length && (_jsx(TopBar, { "data-test": "nav-top-bar", children: topMenuItems.map(({ webUrlName, internalLink, externalUrl }) => (_jsx(StyledTopLink, { to: externalUrl || internalLink?.slug?.current || '/', children: webUrlName }, webUrlName))) })), _jsxs(NavBar, { children: [logotype && (_jsx(StyledLogoLink, { "data-test": "nav-logo", to: '/', "aria-label": ariaLabelHome, children: _jsx(Image, { image: logotype?.asset, width: "127", height: "32" }) })), _jsx(StyledList, { "data-test": "nav-list", children: mainMenuItems?.map(
|
|
27
|
+
return (_jsxs(Wrapper, { ref: menuRef, children: [_jsxs(MenuContainer, { children: [!!topMenuItems?.length && (_jsx(TopBar, { "data-test": "nav-top-bar", children: topMenuItems.map(({ webUrlName, internalLink, externalUrl }) => (_jsx(StyledTopLink, { to: externalUrl || internalLink?.slug?.current || '/', children: webUrlName }, webUrlName))) })), _jsxs(NavBar, { children: [logotype && (_jsx(StyledLogoLink, { "data-test": "nav-logo", to: '/', "aria-label": ariaLabelHome, children: _jsx(Image, { image: logotype?.asset, width: "127", height: "32" }) })), _jsx(StyledList, { "data-test": "nav-list", children: mainMenuItems?.map(item => {
|
|
28
|
+
const isLink = isNavLink(item);
|
|
29
|
+
const title = isLink ? item.webUrlName : item.title;
|
|
30
|
+
const url = isLink ? (item.externalUrl || item.internalLink?.slug?.current) : undefined;
|
|
31
|
+
const key = isLink ? item.webUrlName : item.key;
|
|
32
|
+
return (_jsx(NavigationCell, { active: !isLink && currentSection?.key === item.key, title: title || '', url: url, onToggleCell: () => onOpenSection(item) }, key || (isLink ? item.webUrlName : item.title)));
|
|
33
|
+
}) }), ctaButton && (_jsxs(StyledButton, { dataTest: "nav-cta", to: ctaButton?.internalLink?.slug?.current, href: ctaButton?.externalUrl, target: ctaButton?.openInNewWindow ? "_blank" : "_self", children: [ctaButton.webUrlName, _jsx(IconWrapper, { children: _jsx(ExternalIcon, {}) })] }))] })] }), currentSection && (_jsx(StyledNavSection, { section: currentSection, closeSection: () => onOpenSection(undefined) })), (currentSection || isSearchOpen) && (_jsx(Overlay, { "data-test": "nav-overlay", "$isSearchOpen": isSearchOpen, "$playFadeOut": !isMenuVisible, onClick: () => {
|
|
22
34
|
onOpenSection(undefined);
|
|
23
35
|
setIsSearchOpen(false);
|
|
24
36
|
} }))] }));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { WebPageUrl } from "../../../../models/web-page-url";
|
|
2
|
-
import {
|
|
2
|
+
import { MainMenuItemModel } from "../shared/types/types";
|
|
3
3
|
type Props = {
|
|
4
|
-
mainMenuItems?:
|
|
4
|
+
mainMenuItems?: MainMenuItemModel[];
|
|
5
5
|
topMenuItems?: WebPageUrl[];
|
|
6
6
|
scrollToTop: () => void;
|
|
7
7
|
closeMenu: () => void;
|
|
@@ -4,6 +4,7 @@ import { Link } from "gatsby";
|
|
|
4
4
|
import { ToggableChevron } from "../../../../components/icons/toggable-chevron/toggable-chevron";
|
|
5
5
|
import { CardBanner } from "../../../../components/surfaces/cards/card-banner/card-banner";
|
|
6
6
|
import { NavigationItem } from "../shared/nav-item/nav-item";
|
|
7
|
+
import { isNavLink } from "../shared/types/types";
|
|
7
8
|
import styled, { css } from "styled-components";
|
|
8
9
|
import { rem } from '../../../../styles/units';
|
|
9
10
|
const NavigationPanel = ({ mainMenuItems, topMenuItems, scrollToTop, closeMenu, goBackText }) => {
|
|
@@ -11,13 +12,17 @@ const NavigationPanel = ({ mainMenuItems, topMenuItems, scrollToTop, closeMenu,
|
|
|
11
12
|
const [currentItem, setCurrentItem] = useState();
|
|
12
13
|
const [isShowingSection, setIsShowingSection] = useState(false);
|
|
13
14
|
const [isAnimating, setIsAnimating] = useState(false);
|
|
14
|
-
const toggleSection = (
|
|
15
|
+
const toggleSection = (item) => {
|
|
15
16
|
if (isAnimating)
|
|
16
17
|
return;
|
|
17
|
-
if (
|
|
18
|
-
|
|
18
|
+
if (item && isNavLink(item)) {
|
|
19
|
+
closeMenu();
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
if (item) {
|
|
23
|
+
setCurrentSection(item);
|
|
19
24
|
}
|
|
20
|
-
setIsShowingSection(!!
|
|
25
|
+
setIsShowingSection(!!item);
|
|
21
26
|
setIsAnimating(true);
|
|
22
27
|
scrollToTop();
|
|
23
28
|
};
|
|
@@ -25,7 +30,13 @@ const NavigationPanel = ({ mainMenuItems, topMenuItems, scrollToTop, closeMenu,
|
|
|
25
30
|
setCurrentItem(currentItem?.key !== item?.key ? item : undefined);
|
|
26
31
|
};
|
|
27
32
|
const renderColumn = (title, items) => (items && (_jsxs(_Fragment, { children: [title && _jsx(Header, { children: title }), _jsx(StyledList, { children: items.map((item) => (_jsx(NavigationItem, { model: item, expanded: currentItem?.key === item.key, parent: currentSection?.title, onToggle: toggleItem, onLinkClick: closeMenu }, item.key))) })] })));
|
|
28
|
-
return (_jsxs(Wrapper, { "data-test": "nav-panel-wrapper", toggled: isShowingSection, onTransitionEnd: () => setIsAnimating(false), children: [_jsx(Panel, { visible: true, children: _jsxs(PanelLayout, { children: [_jsx(StyledList, { "data-test": "nav-list", children: mainMenuItems?.map((
|
|
33
|
+
return (_jsxs(Wrapper, { "data-test": "nav-panel-wrapper", toggled: isShowingSection, onTransitionEnd: () => setIsAnimating(false), children: [_jsx(Panel, { visible: true, children: _jsxs(PanelLayout, { children: [_jsx(StyledList, { "data-test": "nav-list", children: mainMenuItems?.map((item) => {
|
|
34
|
+
const isLink = isNavLink(item);
|
|
35
|
+
const title = isLink ? item.webUrlName : item.title;
|
|
36
|
+
const url = isLink ? (item.externalUrl || item.internalLink?.slug?.current) : undefined;
|
|
37
|
+
const key = isLink ? item.webUrlName : item.key;
|
|
38
|
+
return (_jsx("li", { children: isLink ? (_jsx(NavLink, { to: url || "/", "data-test": "nav-cell-link", onClick: closeMenu, children: _jsx("p", { children: title }) })) : (_jsxs(NavCell, { "data-test": "nav-cell", onClick: () => toggleSection(item), children: [_jsx("p", { children: title }), _jsx(Chevron, {})] })) }, key || (isLink ? item.webUrlName : item.title)));
|
|
39
|
+
}) }), !!topMenuItems?.length && (_jsx(LinkContainer, { "data-test": "nav-sub-menu", children: topMenuItems.map(({ webUrlName, internalLink, externalUrl }) => (_jsx(StyledLink, { to: externalUrl || internalLink?.slug?.current || "/", children: webUrlName }, webUrlName))) }))] }) }), _jsxs(Panel, { "data-test": "nav-panel-section", visible: isShowingSection || isAnimating, children: [_jsxs(PanelLayout, { children: [_jsxs(BackCell, { "data-test": "nav-panel-back", onClick: () => toggleSection(undefined), children: [_jsx(BackChevron, { disableCircle: false }), goBackText] }), renderColumn(currentSection?.column1Title, currentSection?.column1Items), renderColumn(currentSection?.column2Title, currentSection?.column2Items)] }), _jsx(InfoWrapper, { color: currentSection?.backgroundColor?.hex, children: currentSection?.linkBanners && currentSection?.linkBanners?.map((banner, i) => (_jsx(CardBanner, { ...banner, externalUrl: banner?.link?.externalUrl, internalLink: banner?.link?.internalLink?.slug?.current, onClick: closeMenu }, `${banner.title.trim()}-${i}`))) })] })] }));
|
|
29
40
|
};
|
|
30
41
|
const Wrapper = styled.div `
|
|
31
42
|
width: 100%;
|
|
@@ -65,7 +76,7 @@ const StyledList = styled.ul `
|
|
|
65
76
|
}
|
|
66
77
|
}
|
|
67
78
|
`;
|
|
68
|
-
const
|
|
79
|
+
const NavCellStyles = css `
|
|
69
80
|
padding: 0;
|
|
70
81
|
border: 0;
|
|
71
82
|
background: none;
|
|
@@ -75,6 +86,7 @@ const NavCell = styled.button `
|
|
|
75
86
|
align-items: center;
|
|
76
87
|
width: 100%;
|
|
77
88
|
font-size: ${rem(20)};
|
|
89
|
+
text-decoration: none;
|
|
78
90
|
|
|
79
91
|
p {
|
|
80
92
|
font-size: inherit;
|
|
@@ -90,6 +102,13 @@ const NavCell = styled.button `
|
|
|
90
102
|
font-family: ${theme.valueBold};
|
|
91
103
|
`};
|
|
92
104
|
`;
|
|
105
|
+
const NavCell = styled.button `
|
|
106
|
+
${NavCellStyles}
|
|
107
|
+
`;
|
|
108
|
+
const NavLink = styled(Link) `
|
|
109
|
+
${NavCellStyles}
|
|
110
|
+
grid-template-columns: 1fr;
|
|
111
|
+
`;
|
|
93
112
|
const Chevron = styled(ToggableChevron).attrs({
|
|
94
113
|
rotation: -90,
|
|
95
114
|
}) `
|
|
@@ -28,9 +28,10 @@ export type LinkBanner = {
|
|
|
28
28
|
image?: SanityImage;
|
|
29
29
|
link?: WebPageUrl;
|
|
30
30
|
};
|
|
31
|
+
export type MainMenuItemModel = NavigationSectionModel | WebPageUrl;
|
|
31
32
|
export type NavigationModel = {
|
|
32
33
|
topMenuItems?: WebPageUrl[];
|
|
33
|
-
mainMenuItems?:
|
|
34
|
+
mainMenuItems?: MainMenuItemModel[];
|
|
34
35
|
logotype?: SanityImage;
|
|
35
36
|
ctaButton?: WebPageUrl;
|
|
36
37
|
__typename: string;
|
|
@@ -41,3 +42,4 @@ export type NavigationModel = {
|
|
|
41
42
|
isMenuVisible?: boolean;
|
|
42
43
|
menuRef?: RefObject<HTMLElement>;
|
|
43
44
|
};
|
|
45
|
+
export declare const isNavLink: (item: MainMenuItemModel) => item is WebPageUrl;
|
package/dist/index.d.ts
CHANGED
|
@@ -41,11 +41,12 @@ export declare const EmailSignupForm: import("react").FC<EmailSignupFormProps>;
|
|
|
41
41
|
export declare const Image: import("react").FC<ImageProps>;
|
|
42
42
|
export declare const Container: import("react").ForwardRefExoticComponent<{
|
|
43
43
|
children: import("react").ReactNode;
|
|
44
|
-
maxWidth?: "
|
|
44
|
+
maxWidth?: "sm" | "md" | "lg" | "xl" | "auto";
|
|
45
45
|
className?: string;
|
|
46
46
|
innerContainerWidth?: string;
|
|
47
47
|
alignBlock?: "center" | "left";
|
|
48
48
|
innerWidth?: number;
|
|
49
|
+
gutters?: boolean;
|
|
49
50
|
} & {
|
|
50
51
|
position?: import("csstype").Property.Position | undefined;
|
|
51
52
|
display?: import("csstype").Property.Display | undefined;
|
package/dist/styles/mixins.d.ts
CHANGED
|
@@ -18,6 +18,13 @@ export declare const siteWidthRowMd: () => import("styled-components").RuleSet<o
|
|
|
18
18
|
export declare const siteWidthRow: () => import("styled-components").RuleSet<object>;
|
|
19
19
|
export declare const siteWidthRowXL: () => import("styled-components").RuleSet<object>;
|
|
20
20
|
export declare const siteWidthRowAuto: () => import("styled-components").RuleSet<object>;
|
|
21
|
+
/**
|
|
22
|
+
* Returns only max-width without any gutters (margin/padding).
|
|
23
|
+
* Use this when embedding content inside an existing container.
|
|
24
|
+
* Includes margin: 0 auto for centering when max-width is set.
|
|
25
|
+
*/
|
|
26
|
+
export type SiteWidthSize = "sm" | "md" | "lg" | "xl" | "auto";
|
|
27
|
+
export declare const siteWidthOnly: (size: SiteWidthSize) => import("styled-components").RuleSet<object>;
|
|
21
28
|
export declare const fullWidthRow: () => import("styled-components").RuleSet<object>;
|
|
22
29
|
export declare const fontSize: {
|
|
23
30
|
XS: () => import("styled-components").RuleSet<object>;
|
package/dist/styles/mixins.js
CHANGED
|
@@ -165,6 +165,21 @@ export const siteWidthRowXL = () => css `
|
|
|
165
165
|
export const siteWidthRowAuto = () => css `
|
|
166
166
|
width: auto;
|
|
167
167
|
`;
|
|
168
|
+
const SITE_WIDTH_VALUES = {
|
|
169
|
+
sm: VARIABLES.siteWidthS,
|
|
170
|
+
md: rem(800),
|
|
171
|
+
lg: VARIABLES.siteWidth,
|
|
172
|
+
xl: VARIABLES.siteWidthXL,
|
|
173
|
+
auto: "none",
|
|
174
|
+
};
|
|
175
|
+
export const siteWidthOnly = (size) => css `
|
|
176
|
+
max-width: ${SITE_WIDTH_VALUES[size]};
|
|
177
|
+
${size !== "auto" &&
|
|
178
|
+
css `
|
|
179
|
+
margin-left: auto;
|
|
180
|
+
margin-right: auto;
|
|
181
|
+
`}
|
|
182
|
+
`;
|
|
168
183
|
export const fullWidthRow = () => css `
|
|
169
184
|
padding-top: ${SPACING.spacingL};
|
|
170
185
|
padding-right: ${SPACING.spacingXS};
|