@hlf-fe/pulmo-ui 1.4.1 → 1.5.1
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/icons/document-icon/document-icon.d.ts +1 -0
- package/dist/components/icons/document-icon/document-icon.js +2 -0
- package/dist/components/icons/document-icon/document-icon.stories.d.ts +6 -0
- package/dist/components/icons/document-icon/document-icon.stories.js +14 -0
- package/dist/components/icons/download-icon/download-icon.d.ts +1 -0
- package/dist/components/icons/download-icon/download-icon.js +2 -0
- package/dist/components/icons/download-icon/download-icon.stories.d.ts +6 -0
- package/dist/components/icons/download-icon/download-icon.stories.js +14 -0
- package/dist/components/modules/downloadable-file/downloadable-file.d.ts +4 -0
- package/dist/components/modules/downloadable-file/downloadable-file.js +56 -0
- package/dist/components/modules/downloadable-file/downloadable-file.stories.d.ts +6 -0
- package/dist/components/modules/downloadable-file/downloadable-file.stories.js +25 -0
- package/dist/components/modules/footer/footer.d.ts +21 -0
- package/dist/components/modules/footer/footer.js +75 -0
- package/dist/components/modules/footer/footer.stories.d.ts +6 -0
- package/dist/components/modules/footer/footer.stories.js +31 -0
- package/dist/components/typography/portable-text/portable-text-component-default.d.ts +1 -0
- package/dist/components/typography/portable-text/portable-text-component-default.js +6 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DocumentIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export const DocumentIcon = () => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 32, height: 32, children: _jsx("path", { fill: "#D81125", fillRule: "evenodd", d: "M18 5a1.01 1.01 0 0 1 .25.031l.03.009c.03.009.061.02.091.031l.027.012a.914.914 0 0 1 .195.112c.04.03.078.062.114.098l-.093-.082.011.009.082.073 6 6a1.006 1.006 0 0 1 .21.309l.012.027c.012.03.022.06.031.091l.008.03A.921.921 0 0 1 25 12l-.008-.126L25 12v12a3 3 0 0 1-3 3H10a3 3 0 0 1-3-3V8a3 3 0 0 1 3-3h8zm-1 2h-7a1 1 0 0 0-1 1v16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V13h-5a1 1 0 0 1-.993-.883L17 12V7zm3 13a1 1 0 0 1 .117 1.993L20 22h-8a1 1 0 0 1-.117-1.993L12 20h8zm0-4a1 1 0 0 1 .117 1.993L20 18h-8a1 1 0 0 1-.117-1.993L12 16h8zm-6-4a1 1 0 0 1 .117 1.993L14 14h-2a1 1 0 0 1-.117-1.993L12 12h2zm5-3.585V11h2.586L19 8.415z" }) }));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DocumentIcon } from "./document-icon";
|
|
3
|
+
import { Decorator } from "../../../components/decorator/decorator";
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Icons/DocumentIcon",
|
|
6
|
+
component: DocumentIcon,
|
|
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 DownloadIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export const DownloadIcon = () => (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: 32, height: 32, children: _jsx("path", { fill: "#D81125", fillRule: "evenodd", d: "M25 18a1 1 0 0 1 .993.883L26 19v4a3 3 0 0 1-2.824 2.995L23 26H9a3 3 0 0 1-2.995-2.824L6 23v-4a1 1 0 0 1 1.993-.117L8 19v4a1 1 0 0 0 .883.993L9 24h14a1 1 0 0 0 .993-.883L24 23v-4a1 1 0 0 1 1-1zM16 6a1 1 0 0 1 .993.883L17 7v9.585l3.293-3.292a1 1 0 0 1 1.32-.083l.094.083a1 1 0 0 1 .083 1.32l-.083.094-5 5a1.006 1.006 0 0 1-.09.08l.09-.08a1.008 1.008 0 0 1-.674.292L16 20h-.032l-.054-.004L16 20a1.008 1.008 0 0 1-.613-.21 1.037 1.037 0 0 1-.094-.083l-5-5a1 1 0 0 1 1.32-1.497l.094.083L15 16.585V7a1 1 0 0 1 1-1z" }) }));
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DownloadIcon } from "./download-icon";
|
|
3
|
+
import { Decorator } from "../../../components/decorator/decorator";
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Icons/DownloadIcon",
|
|
6
|
+
component: DownloadIcon,
|
|
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,56 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { DownloadIcon } from "../../../components/icons/download-icon/download-icon";
|
|
3
|
+
import { DocumentIcon } from "../../../components/icons/document-icon/document-icon";
|
|
4
|
+
import styled from "styled-components";
|
|
5
|
+
import { rem } from "../../../styles/units";
|
|
6
|
+
import { media } from "../../../styles/mixins";
|
|
7
|
+
export const formatFileSize = (bytes) => {
|
|
8
|
+
const kb = bytes / 1024;
|
|
9
|
+
if (kb < 1000) {
|
|
10
|
+
return `${Math.floor(kb)} KB`;
|
|
11
|
+
}
|
|
12
|
+
if (kb >= 1000) {
|
|
13
|
+
const mb = kb / 1024;
|
|
14
|
+
return `${mb.toFixed(1)} MB`;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
export const DownloadableFile = ({ file }) => {
|
|
18
|
+
const { file: { asset }, title, } = file;
|
|
19
|
+
return (_jsxs(Link, { href: asset?.url, target: "_blank", children: [_jsxs(File, { children: [_jsxs(FileHeader, { children: [_jsx(DocumentIcon, {}), _jsx(FileTitle, { children: title })] }), _jsxs(FileData, { children: ["(", _jsx(FileExtension, { children: asset?.extension }), " ", formatFileSize(asset?.size), ")"] })] }), _jsx(DownloadIcon, {})] }));
|
|
20
|
+
};
|
|
21
|
+
const Link = styled.a `
|
|
22
|
+
display: flex;
|
|
23
|
+
align-items: center;
|
|
24
|
+
justify-content: space-between;
|
|
25
|
+
background-color: ${({ theme }) => theme?.white};
|
|
26
|
+
width: 100%;
|
|
27
|
+
padding: ${rem(16)} ${rem(24)};
|
|
28
|
+
border: ${rem(1)} solid #dde1e5;
|
|
29
|
+
border-radius: ${rem(4)};
|
|
30
|
+
text-decoration: none;
|
|
31
|
+
`;
|
|
32
|
+
const File = styled.div ``;
|
|
33
|
+
const FileHeader = styled.p `
|
|
34
|
+
display: flex;
|
|
35
|
+
align-items: center;
|
|
36
|
+
margin: 0;
|
|
37
|
+
`;
|
|
38
|
+
const FileTitle = styled.span `
|
|
39
|
+
font-size: ${rem(16)};
|
|
40
|
+
color: ${({ theme }) => theme?.redClear};
|
|
41
|
+
text-decoration: underline;
|
|
42
|
+
margin: 0;
|
|
43
|
+
|
|
44
|
+
${media.M `
|
|
45
|
+
font-size: ${rem(18)};
|
|
46
|
+
`}
|
|
47
|
+
`;
|
|
48
|
+
const FileData = styled.span `
|
|
49
|
+
font-family: ${({ theme }) => theme?.valueRegular};
|
|
50
|
+
font-size: ${rem(14)};
|
|
51
|
+
color: #545454;
|
|
52
|
+
text-decoration: none;
|
|
53
|
+
`;
|
|
54
|
+
const FileExtension = styled.span `
|
|
55
|
+
text-transform: uppercase;
|
|
56
|
+
`;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { DownloadableFile } from "./downloadable-file";
|
|
3
|
+
declare const meta: Meta<typeof DownloadableFile>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof DownloadableFile>;
|
|
6
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { DownloadableFile } from "./downloadable-file";
|
|
3
|
+
import { Decorator } from "../../../components/decorator/decorator";
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Modules/DownloadableFile",
|
|
6
|
+
component: DownloadableFile,
|
|
7
|
+
decorators: [
|
|
8
|
+
(Story) => (_jsx(Decorator, { maxWidth: "676px", children: _jsx(Story, {}) })),
|
|
9
|
+
],
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
export const Default = {
|
|
13
|
+
args: {
|
|
14
|
+
file: {
|
|
15
|
+
title: "Example-document",
|
|
16
|
+
file: {
|
|
17
|
+
asset: {
|
|
18
|
+
url: "https://example.com/document.pdf",
|
|
19
|
+
extension: "pdf",
|
|
20
|
+
size: 1048576,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SanityImage } from "../../../models/sanity-types";
|
|
2
|
+
type LinkItem = {
|
|
3
|
+
externalUrl: string;
|
|
4
|
+
internalLink: {
|
|
5
|
+
slug: {
|
|
6
|
+
current: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
openInNewWindow: boolean;
|
|
10
|
+
webUrlName: string;
|
|
11
|
+
};
|
|
12
|
+
type LinkColumn = {
|
|
13
|
+
heading?: string;
|
|
14
|
+
items: LinkItem[];
|
|
15
|
+
};
|
|
16
|
+
export type FooterProps = {
|
|
17
|
+
linkColumns: LinkColumn[];
|
|
18
|
+
footerLogo: SanityImage;
|
|
19
|
+
};
|
|
20
|
+
export declare const Footer: ({ linkColumns, footerLogo }: FooterProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Link } from "../../../components/typography/link/link";
|
|
3
|
+
import { Image } from "../../../components/layout/image/image";
|
|
4
|
+
import { media } from "../../../styles/mixins";
|
|
5
|
+
import { rem } from "../../../styles/units";
|
|
6
|
+
import styled from "styled-components";
|
|
7
|
+
export const Footer = ({ linkColumns, footerLogo }) => {
|
|
8
|
+
return (_jsxs(OuterContainer, { children: [_jsx(ColumnContainer, { children: linkColumns.map(({ heading, items }) => {
|
|
9
|
+
return (_jsxs(Column, { children: [heading && _jsx(Heading, { children: heading }), items?.map((item) => {
|
|
10
|
+
return (_jsx(StyledLink, { value: { reference: item }, children: item?.webUrlName }));
|
|
11
|
+
})] }));
|
|
12
|
+
}) }), _jsx(StyledImage, { image: footerLogo?.asset })] }));
|
|
13
|
+
};
|
|
14
|
+
const OuterContainer = styled.div `
|
|
15
|
+
width: 100%;
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: column;
|
|
18
|
+
justify-content: center;
|
|
19
|
+
min-height: ${rem(340)};
|
|
20
|
+
background: ${({ theme }) => theme?.redClear};
|
|
21
|
+
`;
|
|
22
|
+
const ColumnContainer = styled.div `
|
|
23
|
+
width: 100%;
|
|
24
|
+
max-width: ${rem(1024)};
|
|
25
|
+
flex-direction: column;
|
|
26
|
+
display: flex;
|
|
27
|
+
justify-content: center;
|
|
28
|
+
padding: ${rem(40)};
|
|
29
|
+
margin: 0 auto;
|
|
30
|
+
border-bottom: ${rem(1)} solid #e35361;
|
|
31
|
+
|
|
32
|
+
${media.M `
|
|
33
|
+
flex-direction: row;
|
|
34
|
+
`}
|
|
35
|
+
`;
|
|
36
|
+
const Heading = styled.span `
|
|
37
|
+
font-size: ${rem(14)};
|
|
38
|
+
font-family: ${({ theme }) => theme?.valueBold};
|
|
39
|
+
text-transform: uppercase;
|
|
40
|
+
color: ${({ theme }) => theme?.white};
|
|
41
|
+
padding: ${rem(10)} 0;
|
|
42
|
+
margin: 0;
|
|
43
|
+
`;
|
|
44
|
+
const StyledLink = styled(Link) ``;
|
|
45
|
+
const Column = styled.div `
|
|
46
|
+
display: flex;
|
|
47
|
+
flex-direction: column;
|
|
48
|
+
width: 100%;
|
|
49
|
+
margin-bottom: ${rem(20)};
|
|
50
|
+
|
|
51
|
+
${StyledLink} {
|
|
52
|
+
color: ${({ theme }) => theme?.white};
|
|
53
|
+
padding: ${rem(10)} 0;
|
|
54
|
+
text-decoration: none;
|
|
55
|
+
|
|
56
|
+
&[href^="mailto:"] {
|
|
57
|
+
text-decoration: underline;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
&:hover {
|
|
61
|
+
color: #f0f0f0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
${media.L `
|
|
66
|
+
margin-bottom: 0;
|
|
67
|
+
`}
|
|
68
|
+
`;
|
|
69
|
+
const StyledImage = styled(Image) `
|
|
70
|
+
max-width: ${rem(142)};
|
|
71
|
+
margin: ${rem(20)} auto;
|
|
72
|
+
${media.M `
|
|
73
|
+
margin: ${rem(40)} auto;
|
|
74
|
+
`}
|
|
75
|
+
`;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Footer } from "./footer";
|
|
3
|
+
import { Decorator } from "../../../components/decorator/decorator";
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Layout/Footer",
|
|
6
|
+
component: Footer,
|
|
7
|
+
decorators: [
|
|
8
|
+
(Story) => (_jsx(Decorator, { children: _jsx(Story, {}) })),
|
|
9
|
+
],
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
const generateLink = (index) => ({
|
|
13
|
+
externalUrl: `/`,
|
|
14
|
+
internalLink: {
|
|
15
|
+
slug: {
|
|
16
|
+
current: `internal-link-${index}`,
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
openInNewWindow: false,
|
|
20
|
+
webUrlName: `Link ${index}`,
|
|
21
|
+
});
|
|
22
|
+
const mockColumns = Array.from({ length: 4 }, (_, colIndex) => ({
|
|
23
|
+
heading: `Column ${colIndex + 1}`,
|
|
24
|
+
items: Array.from({ length: 5 }, (_, i) => generateLink(i + 1)),
|
|
25
|
+
}));
|
|
26
|
+
export const Default = {
|
|
27
|
+
args: {
|
|
28
|
+
linkColumns: mockColumns,
|
|
29
|
+
footerLogo: null,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
@@ -4,6 +4,7 @@ import { Link as LinkComponent, } from "../../../components/typography/link/link
|
|
|
4
4
|
import { H1 as H1Component, H2 as H2Component, H3 as H3Component, H4 as H4Component, } from "../../../components/typography/headings/headings";
|
|
5
5
|
import { NormalText as NormalTextComponent, LeadParagraph as LeadParagraphComponent, BoldText as BoldTextComponent, ItalicText as ItalicTextComponent, } from "../../../components/typography/text/text";
|
|
6
6
|
import { OrderedList as OrderedListComponent, UnorderedList as UnorderedListComponent, } from "../../../components/typography/list/list";
|
|
7
|
+
import { DownloadableFile } from "../../../components/modules/downloadable-file/downloadable-file";
|
|
7
8
|
const Link = withDefaultTheme(LinkComponent);
|
|
8
9
|
const H1 = withDefaultTheme(H1Component);
|
|
9
10
|
const H2 = withDefaultTheme(H2Component);
|
|
@@ -33,4 +34,9 @@ export const PortableTextComponentDefault = {
|
|
|
33
34
|
normal: ({ children }) => _jsx(NormalText, { children: children }),
|
|
34
35
|
leadParagraph: ({ children }) => _jsx(LeadParagraph, { children: children }),
|
|
35
36
|
},
|
|
37
|
+
types: {
|
|
38
|
+
downloadableFileReference: ({ value }) => {
|
|
39
|
+
return _jsx(DownloadableFile, { ...value });
|
|
40
|
+
},
|
|
41
|
+
},
|
|
36
42
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ import { type CardBannerProps } from "./components/surfaces/cards/card-banner/ca
|
|
|
19
19
|
import { type PaperProps } from "./components/surfaces/paper/paper";
|
|
20
20
|
import { type LinkProps } from "./components/typography/link/link";
|
|
21
21
|
import { PortableTextComponentDefault } from "./components/typography/portable-text/portable-text-component-default";
|
|
22
|
+
import { type FooterProps } from "./components/modules/footer/footer";
|
|
22
23
|
export type { ButtonProps, LoadingButtonProps, TextButtonProps, EmailSignupFormProps, ImageProps, ContainerProps, AlertProps, EntryListHeadingProps, EntryListTextProps, PaginationProps, NavigationCellProps, NavigationItemProps, CardBannerProps, PaperProps, };
|
|
23
24
|
export { CloseIcon } from "./components/icons/close-icon/close-icon";
|
|
24
25
|
export { ExclamationMarkIcon } from "./components/icons/exclamation-mark-icon/exclamation-mark-icon";
|
|
@@ -64,4 +65,5 @@ export declare const BoldText: import("react").FC<import("styled-components").Fa
|
|
|
64
65
|
export declare const ItalicText: import("react").FC<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, never>>;
|
|
65
66
|
export declare const OrderedList: import("react").FC<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").OlHTMLAttributes<HTMLOListElement>, HTMLOListElement>, never>>;
|
|
66
67
|
export declare const UnorderedList: import("react").FC<import("styled-components").FastOmit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLUListElement>, HTMLUListElement>, never>>;
|
|
68
|
+
export declare const Footer: import("react").FC<FooterProps>;
|
|
67
69
|
export { PortableTextComponentDefault };
|
package/dist/index.js
CHANGED
|
@@ -25,6 +25,7 @@ import { H1 as H1Component, H2 as H2Component, H3 as H3Component, H4 as H4Compon
|
|
|
25
25
|
import { NormalText as NormalTextComponent, LeadParagraph as LeadParagraphComponent, BoldText as BoldTextComponent, ItalicText as ItalicTextComponent, } from "./components/typography/text/text";
|
|
26
26
|
import { OrderedList as OrderedListComponent, UnorderedList as UnorderedListComponent, } from "./components/typography/list/list";
|
|
27
27
|
import { PortableTextComponentDefault } from "./components/typography/portable-text/portable-text-component-default";
|
|
28
|
+
import { Footer as FooterComponent, } from "./components/modules/footer/footer";
|
|
28
29
|
// Icons
|
|
29
30
|
export { CloseIcon } from "./components/icons/close-icon/close-icon";
|
|
30
31
|
export { ExclamationMarkIcon } from "./components/icons/exclamation-mark-icon/exclamation-mark-icon";
|
|
@@ -69,5 +70,5 @@ export const BoldText = withDefaultTheme(BoldTextComponent);
|
|
|
69
70
|
export const ItalicText = withDefaultTheme(ItalicTextComponent);
|
|
70
71
|
export const OrderedList = withDefaultTheme(OrderedListComponent);
|
|
71
72
|
export const UnorderedList = withDefaultTheme(UnorderedListComponent);
|
|
72
|
-
|
|
73
|
+
export const Footer = withDefaultTheme(FooterComponent);
|
|
73
74
|
export { PortableTextComponentDefault };
|