@hlf-fe/pulmo-ui 1.5.6 → 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.
- package/dist/components/modules/navigation/navigation-desktop/nav-section/nav-section.js +1 -1
- package/dist/components/modules/navigation/navigation-desktop/navigation-desktop.js +1 -1
- package/dist/components/modules/navigation/navigation-mobile/nav-panel.js +1 -1
- package/dist/components/modules/navigation/navigation-mobile/navigation-mobile.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +1 -1
- package/dist/components/navigation/nav-cell/nav-cell.d.ts +0 -6
- package/dist/components/navigation/nav-cell/nav-cell.js +0 -69
- package/dist/components/navigation/nav-cell/nav-cell.stories.d.ts +0 -7
- package/dist/components/navigation/nav-cell/nav-cell.stories.js +0 -23
- package/dist/components/navigation/nav-item/nav-item.d.ts +0 -18
- package/dist/components/navigation/nav-item/nav-item.js +0 -106
- package/dist/components/navigation/nav-item/nav-item.stories.d.ts +0 -9
- package/dist/components/navigation/nav-item/nav-item.stories.js +0 -73
- package/dist/components/typography/heading/heading.d.ts +0 -4
- package/dist/components/typography/heading/heading.js +0 -47
- package/dist/components/typography/heading/heading.stories.d.ts +0 -7
- package/dist/components/typography/heading/heading.stories.js +0 -26
- package/dist/components/typography/heading/headings.d.ts +0 -4
- package/dist/components/typography/heading/headings.js +0 -47
- package/dist/components/typography/heading/headings.stories.d.ts +0 -7
- package/dist/components/typography/heading/headings.stories.js +0 -26
- package/dist/components/typography/portable-text/portable-text-component.d.ts +0 -0
- package/dist/components/typography/portable-text/portable-text-component.js +0 -0
- package/dist/components/typography/portable-text/portable-text-default.d.ts +0 -39
- package/dist/components/typography/portable-text/portable-text-default.js +0 -23
- package/dist/styles/mixins/theme-mixins/theme-mixins.d.ts +0 -5
- package/dist/styles/mixins/theme-mixins/theme-mixins.js +0 -37
|
@@ -9,7 +9,7 @@ export const NavigationSection = ({ section, className, closeSection }) => {
|
|
|
9
9
|
const onToggle = (item) => {
|
|
10
10
|
setCurrentItem(currentItem?.key !== item?.key ? item : undefined);
|
|
11
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", {}));
|
|
12
|
+
const renderColumn = (title, items) => (items ? (_jsxs(NavCol, { children: [title && _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
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, i) => (_jsx(CardBanner, { ...banner, externalUrl: banner?.link?.externalUrl, internalLink: banner?.link?.internalLink?.slug?.current, onClick: closeSection }, `${banner.title.trim()}-${i}`))) })] }) }));
|
|
14
14
|
};
|
|
15
15
|
const Wrapper = styled.div `
|
|
@@ -18,7 +18,7 @@ export const NavigationDesktop = ({ logotype, mainMenuItems, topMenuItems, ctaBu
|
|
|
18
18
|
const sectionToShow = currentSection?.key !== section?.key ? section : undefined;
|
|
19
19
|
setCurrentSection(sectionToShow);
|
|
20
20
|
};
|
|
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(section => (_jsx(NavigationCell, { active: currentSection?.key === section.key, title: section.title, onToggleCell: () => onOpenSection(section) }, section.key))) }), ctaButton && (_jsxs(StyledButton, { dataTest: "nav-cta", to: ctaButton?.internalLink?.slug?.current, href: ctaButton?.externalUrl, 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: () => {
|
|
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(section => (_jsx(NavigationCell, { active: currentSection?.key === section.key, title: section.title, onToggleCell: () => onOpenSection(section) }, section.key))) }), 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
22
|
onOpenSection(undefined);
|
|
23
23
|
setIsSearchOpen(false);
|
|
24
24
|
} }))] }));
|
|
@@ -24,7 +24,7 @@ const NavigationPanel = ({ mainMenuItems, topMenuItems, scrollToTop, closeMenu,
|
|
|
24
24
|
const toggleItem = (item) => {
|
|
25
25
|
setCurrentItem(currentItem?.key !== item?.key ? item : undefined);
|
|
26
26
|
};
|
|
27
|
-
const renderColumn = (title, items) => (items && (_jsxs(_Fragment, { children: [_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))) })] })));
|
|
27
|
+
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
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((section) => (_jsx("li", { children: _jsxs(NavCell, { "data-test": "nav-cell", onClick: () => toggleSection(section), children: [_jsx("p", { children: section.title }), _jsx(Chevron, {})] }) }, section.key))) }), !!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
29
|
};
|
|
30
30
|
const Wrapper = styled.div `
|
|
@@ -28,7 +28,7 @@ export const NavigationMobile = ({ logotype, mainMenuItems, topMenuItems, ctaBut
|
|
|
28
28
|
const scrollToTop = () => {
|
|
29
29
|
stickyRef.current?.scroll({ top: 0, behavior: "smooth" });
|
|
30
30
|
};
|
|
31
|
-
return (_jsx(Wrapper, { children: _jsxs(StickyContainer, { "$expanded": isOpen, ref: stickyRef, children: [_jsxs(TopBar, { children: [logotype && (_jsx(StyledLogoLink, { "data-test": "nav-logo", to: "/", "aria-label": ariaLabelHome, children: _jsx(Image, { image: logotype?.asset, width: "95", height: "24" }) })), ctaButton && (_jsx(StyledButton, { btnSize: "s", dataTest: "nav-cta", to: ctaButton
|
|
31
|
+
return (_jsx(Wrapper, { children: _jsxs(StickyContainer, { "$expanded": isOpen, ref: stickyRef, children: [_jsxs(TopBar, { children: [logotype && (_jsx(StyledLogoLink, { "data-test": "nav-logo", to: "/", "aria-label": ariaLabelHome, children: _jsx(Image, { image: logotype?.asset, width: "95", height: "24" }) })), ctaButton && (_jsx(StyledButton, { btnSize: "s", dataTest: "nav-cta", to: ctaButton?.internalLink?.slug?.current, href: ctaButton?.externalUrl, target: ctaButton?.openInNewWindow ? "_blank" : "_self", marginRight: emptyMenuItems, children: ctaButton.webUrlName })), !emptyMenuItems && (_jsx(MenuToggle, { "data-test": !isOpen ? "nav-menu-closed" : "nav-menu-open", "aria-label": "Meny", onClick: () => setIsOpen(!isOpen), children: _jsx(IconWrapper, { children: !isOpen ? _jsx(HamburgerIcon, {}) : _jsx(MenuCloseIcon, {}) }) }))] }), isOpen && (_jsx(MenuContent, { children: _jsx(NavigationPanel, { mainMenuItems: mainMenuItems, topMenuItems: topMenuItems, scrollToTop: scrollToTop, closeMenu: () => setIsOpen(false), goBackText: goBack }) }))] }) }));
|
|
32
32
|
};
|
|
33
33
|
const Wrapper = styled.nav `
|
|
34
34
|
position: relative;
|
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,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
|
-
};
|
|
@@ -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
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const H1: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
|
|
2
|
-
export declare const H2: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
|
|
3
|
-
export declare const H3: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
|
|
4
|
-
export declare const H4: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import { media } from "../../../styles/mixins";
|
|
3
|
-
import { rem } from "../../../styles/units";
|
|
4
|
-
export const H1 = styled.h1 `
|
|
5
|
-
font-family: ${({ theme }) => theme.valueBold};
|
|
6
|
-
color: ${({ theme }) => theme.blackLight};
|
|
7
|
-
font-size: ${rem(40)};
|
|
8
|
-
line-height: 1.15;
|
|
9
|
-
|
|
10
|
-
${media.L `
|
|
11
|
-
font-size: ${rem(64)};
|
|
12
|
-
line-height: 1.09;
|
|
13
|
-
`}
|
|
14
|
-
`;
|
|
15
|
-
export const H2 = styled.h2 `
|
|
16
|
-
font-family: ${({ theme }) => theme.valueBold};
|
|
17
|
-
color: ${({ theme }) => theme.blackLight};
|
|
18
|
-
font-size: ${rem(28)};
|
|
19
|
-
line-height: 1.14;
|
|
20
|
-
|
|
21
|
-
${media.L `
|
|
22
|
-
font-size: ${rem(32)};
|
|
23
|
-
line-height: 1.5;
|
|
24
|
-
`}
|
|
25
|
-
`;
|
|
26
|
-
export const H3 = styled.h3 `
|
|
27
|
-
font-family: ${({ theme }) => theme.valueBold};
|
|
28
|
-
color: ${({ theme }) => theme.blackLight};
|
|
29
|
-
font-size: ${rem(22)};
|
|
30
|
-
line-height: 1.45;
|
|
31
|
-
|
|
32
|
-
${media.L `
|
|
33
|
-
font-size: ${rem(28)};
|
|
34
|
-
line-height: 1.43;
|
|
35
|
-
`}
|
|
36
|
-
`;
|
|
37
|
-
export const H4 = styled.h4 `
|
|
38
|
-
font-family: ${({ theme }) => theme.valueBold};
|
|
39
|
-
color: ${({ theme }) => theme.blackLight};
|
|
40
|
-
font-size: ${rem(22)};
|
|
41
|
-
line-height: 1.45;
|
|
42
|
-
|
|
43
|
-
${media.L `
|
|
44
|
-
font-size: ${rem(28)};
|
|
45
|
-
line-height: 1.43;
|
|
46
|
-
`}
|
|
47
|
-
`;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
declare const meta: Meta;
|
|
3
|
-
export default meta;
|
|
4
|
-
export declare const Heading1: StoryObj;
|
|
5
|
-
export declare const Heading2: StoryObj;
|
|
6
|
-
export declare const Heading3: StoryObj;
|
|
7
|
-
export declare const Heading4: StoryObj;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { H1, H2, H3, H4 } from "./heading";
|
|
3
|
-
import { Decorator } from "../../../components/decorator/decorator";
|
|
4
|
-
const meta = {
|
|
5
|
-
title: "Typography/Headings",
|
|
6
|
-
decorators: [
|
|
7
|
-
(Story) => (_jsx(Decorator, { children: _jsx(Story, {}) })),
|
|
8
|
-
],
|
|
9
|
-
};
|
|
10
|
-
export default meta;
|
|
11
|
-
export const Heading1 = {
|
|
12
|
-
name: "H1",
|
|
13
|
-
render: () => (_jsx(_Fragment, { children: _jsx(H1, { children: "This is an H1" }) })),
|
|
14
|
-
};
|
|
15
|
-
export const Heading2 = {
|
|
16
|
-
name: "H2",
|
|
17
|
-
render: () => (_jsx(_Fragment, { children: _jsx(H2, { children: "This is an H2" }) })),
|
|
18
|
-
};
|
|
19
|
-
export const Heading3 = {
|
|
20
|
-
name: "H3",
|
|
21
|
-
render: () => (_jsx(_Fragment, { children: _jsx(H3, { children: "This is an H2" }) })),
|
|
22
|
-
};
|
|
23
|
-
export const Heading4 = {
|
|
24
|
-
name: "H4",
|
|
25
|
-
render: () => (_jsx(_Fragment, { children: _jsx(H4, { children: "This is an H2" }) })),
|
|
26
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const H1: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
|
|
2
|
-
export declare const H2: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
|
|
3
|
-
export declare const H3: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
|
|
4
|
-
export declare const H4: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLHeadingElement>, HTMLHeadingElement>, never>> & string;
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
2
|
-
import { media } from "../../../styles/mixins";
|
|
3
|
-
import { rem } from "../../../styles/units";
|
|
4
|
-
export const H1 = styled.h1 `
|
|
5
|
-
font-family: ${({ theme }) => theme.valueBold};
|
|
6
|
-
color: ${({ theme }) => theme.blackLight};
|
|
7
|
-
font-size: ${rem(40)};
|
|
8
|
-
line-height: 1.15;
|
|
9
|
-
|
|
10
|
-
${media.L `
|
|
11
|
-
font-size: ${rem(64)};
|
|
12
|
-
line-height: 1.09;
|
|
13
|
-
`}
|
|
14
|
-
`;
|
|
15
|
-
export const H2 = styled.h2 `
|
|
16
|
-
font-family: ${({ theme }) => theme.valueBold};
|
|
17
|
-
color: ${({ theme }) => theme.blackLight};
|
|
18
|
-
font-size: ${rem(28)};
|
|
19
|
-
line-height: 1.14;
|
|
20
|
-
|
|
21
|
-
${media.L `
|
|
22
|
-
font-size: ${rem(32)};
|
|
23
|
-
line-height: 1.5;
|
|
24
|
-
`}
|
|
25
|
-
`;
|
|
26
|
-
export const H3 = styled.h3 `
|
|
27
|
-
font-family: ${({ theme }) => theme.valueBold};
|
|
28
|
-
color: ${({ theme }) => theme.blackLight};
|
|
29
|
-
font-size: ${rem(22)};
|
|
30
|
-
line-height: 1.45;
|
|
31
|
-
|
|
32
|
-
${media.L `
|
|
33
|
-
font-size: ${rem(28)};
|
|
34
|
-
line-height: 1.43;
|
|
35
|
-
`}
|
|
36
|
-
`;
|
|
37
|
-
export const H4 = styled.h4 `
|
|
38
|
-
font-family: ${({ theme }) => theme.valueBold};
|
|
39
|
-
color: ${({ theme }) => theme.blackLight};
|
|
40
|
-
font-size: ${rem(22)};
|
|
41
|
-
line-height: 1.45;
|
|
42
|
-
|
|
43
|
-
${media.L `
|
|
44
|
-
font-size: ${rem(28)};
|
|
45
|
-
line-height: 1.43;
|
|
46
|
-
`}
|
|
47
|
-
`;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
declare const meta: Meta;
|
|
3
|
-
export default meta;
|
|
4
|
-
export declare const Heading1: StoryObj;
|
|
5
|
-
export declare const Heading2: StoryObj;
|
|
6
|
-
export declare const Heading3: StoryObj;
|
|
7
|
-
export declare const Heading4: StoryObj;
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { H1, H2, H3, H4 } from "./headings";
|
|
3
|
-
import { Decorator } from "../../../components/decorator/decorator";
|
|
4
|
-
const meta = {
|
|
5
|
-
title: "Typography/Headings",
|
|
6
|
-
decorators: [
|
|
7
|
-
(Story) => (_jsx(Decorator, { children: _jsx(Story, {}) })),
|
|
8
|
-
],
|
|
9
|
-
};
|
|
10
|
-
export default meta;
|
|
11
|
-
export const Heading1 = {
|
|
12
|
-
name: "H1",
|
|
13
|
-
render: () => (_jsx(_Fragment, { children: _jsx(H1, { children: "This is an H1" }) })),
|
|
14
|
-
};
|
|
15
|
-
export const Heading2 = {
|
|
16
|
-
name: "H2",
|
|
17
|
-
render: () => (_jsx(_Fragment, { children: _jsx(H2, { children: "This is an H2" }) })),
|
|
18
|
-
};
|
|
19
|
-
export const Heading3 = {
|
|
20
|
-
name: "H3",
|
|
21
|
-
render: () => (_jsx(_Fragment, { children: _jsx(H3, { children: "This is an H2" }) })),
|
|
22
|
-
};
|
|
23
|
-
export const Heading4 = {
|
|
24
|
-
name: "H4",
|
|
25
|
-
render: () => (_jsx(_Fragment, { children: _jsx(H4, { children: "This is an H2" }) })),
|
|
26
|
-
};
|
|
File without changes
|
|
File without changes
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
export declare const PortableTextDefault: {
|
|
2
|
-
marks: {
|
|
3
|
-
link: any;
|
|
4
|
-
strong: ({ children }: {
|
|
5
|
-
children: any;
|
|
6
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
-
italic: ({ children }: {
|
|
8
|
-
children: any;
|
|
9
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
};
|
|
11
|
-
list: {
|
|
12
|
-
bullet: ({ children }: {
|
|
13
|
-
children: any;
|
|
14
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
-
number: ({ children }: {
|
|
16
|
-
children: any;
|
|
17
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
-
};
|
|
19
|
-
block: {
|
|
20
|
-
h1: ({ children }: {
|
|
21
|
-
children: any;
|
|
22
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
-
h2: ({ children }: {
|
|
24
|
-
children: any;
|
|
25
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
-
h3: ({ children }: {
|
|
27
|
-
children: any;
|
|
28
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
h4: ({ children }: {
|
|
30
|
-
children: any;
|
|
31
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
32
|
-
normal: ({ children }: {
|
|
33
|
-
children: any;
|
|
34
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
35
|
-
leadParagraph: ({ children }: {
|
|
36
|
-
children: any;
|
|
37
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { BoldText, ItalicText, NormalText, LeadParagraph, } from "../../../components/typography/text/text";
|
|
3
|
-
import { UnorderedList, OrderedList } from "../../../components/typography/list/list";
|
|
4
|
-
import { H1, H2, H3, H4 } from "../../../components/typography/heading/headings";
|
|
5
|
-
export const PortableTextDefault = {
|
|
6
|
-
marks: {
|
|
7
|
-
link: LinkElement,
|
|
8
|
-
strong: ({ children }) => _jsx(BoldText, { children: children }),
|
|
9
|
-
italic: ({ children }) => _jsx(ItalicText, { children: children }),
|
|
10
|
-
},
|
|
11
|
-
list: {
|
|
12
|
-
bullet: ({ children }) => _jsx(UnorderedList, { children: children }),
|
|
13
|
-
number: ({ children }) => _jsx(OrderedList, { children: children }),
|
|
14
|
-
},
|
|
15
|
-
block: {
|
|
16
|
-
h1: ({ children }) => _jsx(H1, { children: children }),
|
|
17
|
-
h2: ({ children }) => _jsx(H2, { children: children }),
|
|
18
|
-
h3: ({ children }) => _jsx(H3, { children: children }),
|
|
19
|
-
h4: ({ children }) => _jsx(H4, { children: children }),
|
|
20
|
-
normal: ({ children }) => _jsx(NormalText, { children: children }),
|
|
21
|
-
leadParagraph: ({ children }) => _jsx(LeadParagraph, { children: children }),
|
|
22
|
-
},
|
|
23
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { THEME_COLORS_BY_HEX, THEME_COLORS_BY_NAME, SIZES } from "../../../models/theme";
|
|
2
|
-
export declare const themeColors: (color: THEME_COLORS_BY_HEX | THEME_COLORS_BY_NAME) => string;
|
|
3
|
-
export declare const themeSpacing: (size: SIZES) => string;
|
|
4
|
-
export declare const themeBorderRadius: (size: "sm" | "md" | "lg") => string;
|
|
5
|
-
export declare const themeElevation: (elevation: 0 | 1) => string;
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { COLORS, THEME_SPACING } from "../../../styles/theme";
|
|
2
|
-
import { rem } from "../../../styles/units";
|
|
3
|
-
export const themeColors = (color) => {
|
|
4
|
-
const THEME_COLORS = {
|
|
5
|
-
green: COLORS.mint,
|
|
6
|
-
blue: COLORS.skyBlue,
|
|
7
|
-
purple: COLORS.lavender,
|
|
8
|
-
pink: COLORS.pink,
|
|
9
|
-
white: COLORS.white,
|
|
10
|
-
};
|
|
11
|
-
return THEME_COLORS[color] || color;
|
|
12
|
-
};
|
|
13
|
-
export const themeSpacing = (size) => {
|
|
14
|
-
const THEME_SPACING_SIZES = {
|
|
15
|
-
sm: THEME_SPACING.sm,
|
|
16
|
-
md: THEME_SPACING.md,
|
|
17
|
-
lg: THEME_SPACING.lg,
|
|
18
|
-
xl: THEME_SPACING.xl,
|
|
19
|
-
none: "0",
|
|
20
|
-
};
|
|
21
|
-
return THEME_SPACING_SIZES[size] || THEME_SPACING.md;
|
|
22
|
-
};
|
|
23
|
-
export const themeBorderRadius = (size) => {
|
|
24
|
-
const BORDER_RADIUS = {
|
|
25
|
-
sm: rem(6),
|
|
26
|
-
md: rem(8),
|
|
27
|
-
lg: rem(12),
|
|
28
|
-
};
|
|
29
|
-
return BORDER_RADIUS[size] || BORDER_RADIUS.sm;
|
|
30
|
-
};
|
|
31
|
-
export const themeElevation = (elevation) => {
|
|
32
|
-
const ELEVETION = {
|
|
33
|
-
0: "none",
|
|
34
|
-
1: `0 ${rem(4)} ${rem(16)} 0 rgba(0, 0, 0, 0.08)`,
|
|
35
|
-
};
|
|
36
|
-
return ELEVETION[elevation] || ELEVETION[0];
|
|
37
|
-
};
|