@hlf-fe/pulmo-ui 1.4.1 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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,6 @@
1
+ import type { Meta, StoryObj } from "@storybook/react";
2
+ import { Footer } from "./footer";
3
+ declare const meta: Meta<typeof Footer>;
4
+ export default meta;
5
+ type Story = StoryObj<typeof Footer>;
6
+ export declare const Default: Story;
@@ -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
+ };
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
- // Configs
73
+ export const Footer = withDefaultTheme(FooterComponent);
73
74
  export { PortableTextComponentDefault };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hlf-fe/pulmo-ui",
3
3
  "private": false,
4
- "version": "1.4.1",
4
+ "version": "1.5.0",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",