@hlf-fe/pulmo-ui 1.0.1 → 1.2.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.
- package/README.md +21 -54
- package/dist/components/buttons/button/button.js +1 -1
- package/dist/components/buttons/button/button.stories.js +6 -1
- package/dist/components/buttons/loading-button/loading-button.d.ts +14 -0
- package/dist/components/buttons/loading-button/loading-button.js +26 -0
- package/dist/components/buttons/loading-button/loading-button.stories.d.ts +7 -0
- package/dist/components/buttons/loading-button/loading-button.stories.js +23 -0
- package/dist/components/buttons/text-button/text-button.d.ts +20 -0
- package/dist/components/buttons/text-button/text-button.js +61 -0
- package/dist/components/buttons/text-button/text-button.stories.d.ts +6 -0
- package/dist/components/buttons/text-button/text-button.stories.js +16 -0
- package/dist/components/decorator/decorator.d.ts +7 -0
- package/dist/components/decorator/decorator.js +13 -0
- package/dist/components/feedback/alert/alert.d.ts +17 -0
- package/dist/components/feedback/alert/alert.js +68 -0
- package/dist/components/feedback/alert/alert.stories.d.ts +6 -0
- package/dist/components/feedback/alert/alert.stories.js +23 -0
- package/dist/components/icons/chevron-left-icon/chevron-left-icon.d.ts +7 -0
- package/dist/components/icons/chevron-left-icon/chevron-left-icon.js +3 -0
- package/dist/components/icons/chevron-left-icon/chevron-left-icon.stories.d.ts +6 -0
- package/dist/components/icons/chevron-left-icon/chevron-left-icon.stories.js +14 -0
- package/dist/components/icons/chevron-right-icon/chevron-right-icon.d.ts +7 -0
- package/dist/components/icons/chevron-right-icon/chevron-right-icon.js +3 -0
- package/dist/components/icons/chevron-right-icon/chevron-right-icon.stories.d.ts +6 -0
- package/dist/components/icons/chevron-right-icon/chevron-right-icon.stories.js +14 -0
- package/dist/components/icons/close-icon/close-icon.d.ts +12 -0
- package/dist/components/icons/close-icon/close-icon.js +9 -0
- package/dist/components/icons/close-icon/close-icon.stories.d.ts +6 -0
- package/dist/components/icons/close-icon/close-icon.stories.js +16 -0
- package/dist/components/icons/exclamation-mark-icon/exclamation-mark-icon.d.ts +3 -0
- package/dist/components/icons/exclamation-mark-icon/exclamation-mark-icon.js +3 -0
- package/dist/components/icons/exclamation-mark-icon/exclamation-mark-icon.stories.d.ts +6 -0
- package/dist/components/icons/exclamation-mark-icon/exclamation-mark-icon.stories.js +16 -0
- package/dist/components/icons/external-icon/external-icon.d.ts +5 -0
- package/dist/components/icons/external-icon/external-icon.js +2 -0
- package/dist/components/icons/external-icon/external-icon.stories.d.ts +6 -0
- package/dist/components/icons/external-icon/external-icon.stories.js +14 -0
- package/dist/components/icons/hamburger-icon/hamburger-icon.d.ts +1 -0
- package/dist/components/icons/hamburger-icon/hamburger-icon.js +2 -0
- package/dist/components/icons/hamburger-icon/hamburger-icon.stories.d.ts +6 -0
- package/dist/components/icons/hamburger-icon/hamburger-icon.stories.js +14 -0
- package/dist/components/icons/heart-icon/heart-icon.d.ts +1 -0
- package/dist/components/icons/heart-icon/heart-icon.js +2 -0
- package/dist/components/icons/heart-icon/heart-icon.stories.d.ts +6 -0
- package/dist/components/icons/heart-icon/heart-icon.stories.js +12 -0
- package/dist/components/icons/loading-spinner/loading-spinner.d.ts +20 -0
- package/dist/components/icons/loading-spinner/loading-spinner.js +32 -0
- package/dist/components/icons/loading-spinner/loading-spinner.stories.d.ts +6 -0
- package/dist/components/icons/loading-spinner/loading-spinner.stories.js +18 -0
- package/dist/components/icons/menu-close-icon/menu-close-icon.d.ts +1 -0
- package/dist/components/icons/menu-close-icon/menu-close-icon.js +2 -0
- package/dist/components/icons/menu-close-icon/menu-close-icon.stories.d.ts +6 -0
- package/dist/components/icons/menu-close-icon/menu-close-icon.stories.js +14 -0
- package/dist/components/icons/search-icon/search-icon.d.ts +5 -0
- package/dist/components/icons/search-icon/search-icon.js +3 -0
- package/dist/components/icons/search-icon/search-icon.stories.d.ts +6 -0
- package/dist/components/icons/search-icon/search-icon.stories.js +18 -0
- package/dist/components/icons/toggable-chevron/toggable-chevron.d.ts +12 -0
- package/dist/components/icons/toggable-chevron/toggable-chevron.js +20 -0
- package/dist/components/icons/toggable-chevron/toggable-chevron.stories.d.ts +7 -0
- package/dist/components/icons/toggable-chevron/toggable-chevron.stories.js +21 -0
- package/dist/components/icons/toggable-plus-minus-icon/toggable-plus-minus-icon.d.ts +6 -0
- package/dist/components/icons/toggable-plus-minus-icon/toggable-plus-minus-icon.js +13 -0
- package/dist/components/icons/toggable-plus-minus-icon/toggable-plus-minus-icon.stories.d.ts +7 -0
- package/dist/components/icons/toggable-plus-minus-icon/toggable-plus-minus-icon.stories.js +21 -0
- package/dist/components/icons/warning-icon/warning-icon.d.ts +3 -0
- package/dist/components/icons/warning-icon/warning-icon.js +3 -0
- package/dist/components/icons/warning-icon/warning-icon.stories.d.ts +6 -0
- package/dist/components/icons/warning-icon/warning-icon.stories.js +16 -0
- package/dist/components/inputs/dropdown/dropdown-list-item.d.ts +6 -0
- package/dist/components/inputs/dropdown/dropdown-list-item.js +33 -0
- package/dist/components/inputs/dropdown/dropdown.d.ts +13 -0
- package/dist/components/inputs/dropdown/dropdown.js +109 -0
- package/dist/components/inputs/dropdown/dropdown.stories.d.ts +7 -0
- package/dist/components/inputs/dropdown/dropdown.stories.js +84 -0
- package/dist/components/inputs/form-error/form-error.d.ts +11 -0
- package/dist/components/inputs/form-error/form-error.js +16 -0
- package/dist/components/inputs/form-error/form-error.stories.d.ts +6 -0
- package/dist/components/inputs/form-error/form-error.stories.js +22 -0
- package/dist/components/inputs/form-label/form-label.d.ts +7 -0
- package/dist/components/inputs/form-label/form-label.js +12 -0
- package/dist/components/inputs/form-label/form-label.stories.d.ts +6 -0
- package/dist/components/inputs/form-label/form-label.stories.js +16 -0
- package/dist/components/inputs/text-field/text-field.d.ts +32 -0
- package/dist/components/inputs/text-field/text-field.js +65 -0
- package/dist/components/inputs/text-field/text-field.stories.d.ts +11 -0
- package/dist/components/inputs/text-field/text-field.stories.js +51 -0
- package/dist/components/layout/accordion/accordion.d.ts +13 -0
- package/dist/components/layout/accordion/accordion.js +115 -0
- package/dist/components/layout/accordion/accordion.stories.d.ts +6 -0
- package/dist/components/layout/accordion/accordion.stories.js +14 -0
- package/dist/components/layout/container/container.d.ts +10 -0
- package/dist/components/layout/container/container.js +19 -0
- package/dist/components/layout/container/container.stories.d.ts +9 -0
- package/dist/components/layout/container/container.stories.js +47 -0
- package/dist/components/layout/image/image.d.ts +22 -0
- package/dist/components/layout/image/image.js +27 -0
- package/dist/components/layout/image/image.stories.d.ts +6 -0
- package/dist/components/layout/image/image.stories.js +33 -0
- package/dist/components/modules/email-signup-form/email-signup-form.d.ts +16 -0
- package/dist/components/modules/email-signup-form/email-signup-form.js +63 -0
- package/dist/components/modules/email-signup-form/email-signup-form.stories.d.ts +9 -0
- package/dist/components/modules/email-signup-form/email-signup-form.stories.js +51 -0
- package/dist/components/modules/entry-list/entry-list.d.ts +27 -0
- package/dist/components/modules/entry-list/entry-list.js +54 -0
- package/dist/components/modules/entry-list/entry-list.stories.d.ts +6 -0
- package/dist/components/modules/entry-list/entry-list.stories.js +14 -0
- package/dist/components/navigation/nav-cell/nav-cell.d.ts +6 -0
- package/dist/components/navigation/nav-cell/nav-cell.js +67 -0
- package/dist/components/navigation/nav-cell/nav-cell.stories.d.ts +7 -0
- package/dist/components/navigation/nav-cell/nav-cell.stories.js +23 -0
- package/dist/components/navigation/nav-item/nav-item.d.ts +18 -0
- package/dist/components/navigation/nav-item/nav-item.js +106 -0
- package/dist/components/navigation/nav-item/nav-item.stories.d.ts +9 -0
- package/dist/components/navigation/nav-item/nav-item.stories.js +73 -0
- package/dist/components/navigation/pagination/pagination.d.ts +12 -0
- package/dist/components/navigation/pagination/pagination.js +114 -0
- package/dist/components/navigation/pagination/pagination.stories.d.ts +6 -0
- package/dist/components/navigation/pagination/pagination.stories.js +21 -0
- package/dist/components/surfaces/cards/card-banner/card-banner.d.ts +14 -0
- package/dist/components/surfaces/cards/card-banner/card-banner.js +62 -0
- package/dist/components/surfaces/cards/card-banner/card-banner.stories.d.ts +6 -0
- package/dist/components/surfaces/cards/card-banner/card-banner.stories.js +29 -0
- package/dist/constants/general.d.ts +4 -0
- package/dist/constants/general.js +5 -0
- package/dist/hoc/withDefaultTheme.d.ts +1 -1
- package/dist/hoc/withDefaultTheme.js +4 -8
- package/dist/index.d.ts +50 -2
- package/dist/index.js +52 -2
- package/dist/mocks/image-mocks.d.ts +30 -0
- package/dist/mocks/image-mocks.js +32 -0
- package/dist/models/sanity-types.d.ts +9 -0
- package/dist/models/web-page-url.d.ts +10 -0
- package/dist/models/web-page-url.js +1 -0
- package/dist/styles/mixins.js +8 -4
- package/dist/styles/theme.d.ts +11 -9
- package/dist/styles/theme.js +12 -11
- package/package.json +78 -67
- package/dist/App.d.ts +0 -3
- package/dist/App.js +0 -10
- package/dist/main.d.ts +0 -1
- package/dist/main.js +0 -6
- package/dist/stories/Button.d.ts +0 -14
- package/dist/stories/Button.js +0 -20
- package/dist/stories/Button.stories.d.ts +0 -23
- package/dist/stories/Button.stories.js +0 -44
- package/dist/stories/Header.d.ts +0 -12
- package/dist/stories/Header.js +0 -4
- package/dist/stories/Header.stories.d.ts +0 -18
- package/dist/stories/Header.stories.js +0 -26
- package/dist/stories/Page.d.ts +0 -3
- package/dist/stories/Page.js +0 -7
- package/dist/stories/Page.stories.d.ts +0 -12
- package/dist/stories/Page.stories.js +0 -24
- package/dist/styles/styles/mixins/theme-mixins.d.ts +0 -5
- package/dist/styles/styles/mixins/theme-mixins.js +0 -37
- package/dist/styles/styles/mixins/units.d.ts +0 -3
- package/dist/styles/styles/mixins/units.js +0 -3
- package/dist/styles/styles/mixins.d.ts +0 -48
- package/dist/styles/styles/mixins.js +0 -336
- package/dist/styles/styles/theme.d.ts +0 -135
- package/dist/styles/styles/theme.js +0 -77
- package/dist/styles/types.d.ts +0 -3
- package/dist/styles/withDefaultTheme.d.ts +0 -1
- package/dist/styles/withDefaultTheme.js +0 -12
- /package/dist/{styles/types.js → models/sanity-types.js} +0 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useForm } from "react-hook-form";
|
|
3
|
+
import { yupResolver } from "@hookform/resolvers/yup";
|
|
4
|
+
import * as yup from "yup";
|
|
5
|
+
import { TextField } from "../../../components/inputs/text-field/text-field";
|
|
6
|
+
import { LoadingButton } from "../../../components/buttons/loading-button/loading-button";
|
|
7
|
+
import { FormLabel } from "../../../components/inputs/form-label/form-label";
|
|
8
|
+
import { Alert } from "../../../components/feedback/alert/alert";
|
|
9
|
+
import styled from "styled-components";
|
|
10
|
+
import { media } from "../../../styles/mixins";
|
|
11
|
+
import { rem } from "../../../styles/units";
|
|
12
|
+
const schema = yup.object({
|
|
13
|
+
email: yup.string().email().required(),
|
|
14
|
+
});
|
|
15
|
+
export const EmailSignupForm = ({ heading, description, localeText, onSubmit, loading, success, failed, }) => {
|
|
16
|
+
const { emailLabel, sendButtonText, successMessage, errorMessage } = localeText;
|
|
17
|
+
const { register, handleSubmit, formState: { errors }, } = useForm({
|
|
18
|
+
mode: "onChange",
|
|
19
|
+
resolver: yupResolver(schema),
|
|
20
|
+
});
|
|
21
|
+
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 }) })) }));
|
|
22
|
+
};
|
|
23
|
+
const Container = styled.form ``;
|
|
24
|
+
const TextFieldAndButton = styled.div `
|
|
25
|
+
display: flex;
|
|
26
|
+
flex-direction: column;
|
|
27
|
+
width: 100%;
|
|
28
|
+
|
|
29
|
+
${media.L `
|
|
30
|
+
flex-direction: row;
|
|
31
|
+
`}
|
|
32
|
+
`;
|
|
33
|
+
const Box = styled.div ``;
|
|
34
|
+
const BoxCenter = styled(Box) `
|
|
35
|
+
display: flex;
|
|
36
|
+
width: 100%;
|
|
37
|
+
justify-content: center;
|
|
38
|
+
align-items: center;
|
|
39
|
+
`;
|
|
40
|
+
const Heading = styled.h2 `
|
|
41
|
+
font-family: ${({ theme }) => theme.valueBold};
|
|
42
|
+
font-size: ${rem(32)};
|
|
43
|
+
color: ${({ theme }) => theme.blackLight};
|
|
44
|
+
line-height: 1.5;
|
|
45
|
+
margin: 0;
|
|
46
|
+
`;
|
|
47
|
+
const Text = styled.p `
|
|
48
|
+
color: ${({ theme }) => theme.blackLight};
|
|
49
|
+
font-size: ${rem(18)};
|
|
50
|
+
`;
|
|
51
|
+
const StyledAlert = styled(Alert) `
|
|
52
|
+
margin-top: ${rem(15)};
|
|
53
|
+
`;
|
|
54
|
+
const StyledLoadingButton = styled(LoadingButton) `
|
|
55
|
+
width: 100%;
|
|
56
|
+
margin-top: ${rem(15)};
|
|
57
|
+
|
|
58
|
+
${media.L `
|
|
59
|
+
margin-left: ${rem(15)};
|
|
60
|
+
margin-top: 0;
|
|
61
|
+
width: auto;
|
|
62
|
+
`}
|
|
63
|
+
`;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { EmailSignupForm } from "./email-signup-form";
|
|
3
|
+
declare const meta: Meta<typeof EmailSignupForm>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof EmailSignupForm>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Loading: Story;
|
|
8
|
+
export declare const Error: Story;
|
|
9
|
+
export declare const Success: Story;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { EmailSignupForm } from "./email-signup-form";
|
|
3
|
+
import { Decorator } from "../../../components/decorator/decorator";
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Modules/EmailSignupForm",
|
|
6
|
+
component: EmailSignupForm,
|
|
7
|
+
decorators: [
|
|
8
|
+
(Story) => (_jsx(Decorator, { maxWidth: "600px", children: _jsx(Story, {}) })),
|
|
9
|
+
],
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
const baseArgs = {
|
|
13
|
+
heading: "Fusce dapibus mollis orci, at lobortis nisi mattis eget",
|
|
14
|
+
description: "Sed in tellus ex. Integer eget placerat nulla, eu tincidunt orci. Morbi erat sapien, laoreet eget commodo vel, consectetur vitae arcu.",
|
|
15
|
+
localeText: {
|
|
16
|
+
emailLabel: "Your email address",
|
|
17
|
+
sendButtonText: "Subscribe",
|
|
18
|
+
successMessage: "Thank you for subscribing!",
|
|
19
|
+
goBackText: "Back to form",
|
|
20
|
+
errorMessage: undefined,
|
|
21
|
+
},
|
|
22
|
+
loading: false,
|
|
23
|
+
success: false,
|
|
24
|
+
onSubmit: (email) => alert(`Submitted: ${email}`),
|
|
25
|
+
onReset: () => alert("Reset"),
|
|
26
|
+
};
|
|
27
|
+
export const Default = {
|
|
28
|
+
args: baseArgs,
|
|
29
|
+
};
|
|
30
|
+
export const Loading = {
|
|
31
|
+
args: {
|
|
32
|
+
...baseArgs,
|
|
33
|
+
loading: true,
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
export const Error = {
|
|
37
|
+
args: {
|
|
38
|
+
...baseArgs,
|
|
39
|
+
localeText: {
|
|
40
|
+
...baseArgs.localeText,
|
|
41
|
+
errorMessage: "Something went wrong. Please try again.",
|
|
42
|
+
},
|
|
43
|
+
failed: true,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
export const Success = {
|
|
47
|
+
args: {
|
|
48
|
+
...baseArgs,
|
|
49
|
+
success: true,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { media } from "../../../styles/mixins";
|
|
2
|
+
export type EntryListProps = {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
};
|
|
5
|
+
export type EntryListItemProps = {
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
};
|
|
8
|
+
export type EntryListHeadingProps = {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
fontSizeMobile?: number;
|
|
11
|
+
fontSizeDesktop?: number;
|
|
12
|
+
breakpoint?: keyof typeof media;
|
|
13
|
+
as?: "h2" | "h3";
|
|
14
|
+
};
|
|
15
|
+
export type EntryListTextProps = {
|
|
16
|
+
children: React.ReactNode;
|
|
17
|
+
fontSizeMobile?: number;
|
|
18
|
+
fontSizeDesktop?: number;
|
|
19
|
+
breakpoint?: keyof typeof media;
|
|
20
|
+
as?: "span" | "p";
|
|
21
|
+
bold?: boolean;
|
|
22
|
+
color?: string;
|
|
23
|
+
};
|
|
24
|
+
export declare const EntryList: ({ children }: EntryListProps) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare const EntryListItem: ({ children }: EntryListItemProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export declare const EntryListText: ({ children, fontSizeMobile, fontSizeDesktop, breakpoint, bold, as, color, }: EntryListTextProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export declare const EntryListHeading: ({ children, fontSizeMobile, fontSizeDesktop, as, breakpoint, }: EntryListHeadingProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styled, { css } from "styled-components";
|
|
3
|
+
import { rem } from "../../../styles/units";
|
|
4
|
+
import { media } from "../../../styles/mixins";
|
|
5
|
+
export const EntryList = ({ children }) => {
|
|
6
|
+
return _jsx(List, { children: children });
|
|
7
|
+
};
|
|
8
|
+
export const EntryListItem = ({ children }) => {
|
|
9
|
+
return _jsx(ListItem, { children: children });
|
|
10
|
+
};
|
|
11
|
+
export const EntryListText = ({ children, fontSizeMobile = 14, fontSizeDesktop = 16, breakpoint = "M", bold = false, as = "p", color, }) => {
|
|
12
|
+
return (_jsx(Text, { as: as, fontSizeMobile: fontSizeMobile, fontSizeDesktop: fontSizeDesktop, breakpoint: breakpoint, bold: bold, color: color, children: children }));
|
|
13
|
+
};
|
|
14
|
+
export const EntryListHeading = ({ children, fontSizeMobile = 18, fontSizeDesktop = 20, as = "h2", breakpoint = "M", }) => {
|
|
15
|
+
return (_jsx(Heading, { as: as, fontSizeMobile: fontSizeMobile, fontSizeDesktop: fontSizeDesktop, breakpoint: breakpoint, children: children }));
|
|
16
|
+
};
|
|
17
|
+
const List = styled.ul `
|
|
18
|
+
list-style: none;
|
|
19
|
+
padding: 0;
|
|
20
|
+
margin: 0;
|
|
21
|
+
`;
|
|
22
|
+
const ListItem = styled.li `
|
|
23
|
+
border-bottom: 1px solid #e9e9e9;
|
|
24
|
+
padding: 20px 0;
|
|
25
|
+
&:first-of-type {
|
|
26
|
+
border-top: 1px solid #e9e9e9;
|
|
27
|
+
}
|
|
28
|
+
`;
|
|
29
|
+
const responsiveFont = css `
|
|
30
|
+
font-size: ${({ fontSizeMobile }) => rem(fontSizeMobile)};
|
|
31
|
+
|
|
32
|
+
${({ fontSizeDesktop, breakpoint }) => media[breakpoint] `
|
|
33
|
+
font-size: ${rem(fontSizeDesktop)};
|
|
34
|
+
`}
|
|
35
|
+
`;
|
|
36
|
+
const Heading = styled.h2 `
|
|
37
|
+
font-family: ${({ theme }) => theme.valueBold};
|
|
38
|
+
color: ${({ theme }) => theme.blackLight};
|
|
39
|
+
margin-top: 0;
|
|
40
|
+
${responsiveFont}
|
|
41
|
+
`;
|
|
42
|
+
const Text = styled.p `
|
|
43
|
+
color: ${({ theme, color }) => (color ? color : theme.blackLight)};
|
|
44
|
+
font-family: ${({ theme, bold }) => bold ? theme.valueBold : theme.valueRegular};
|
|
45
|
+
|
|
46
|
+
${responsiveFont}
|
|
47
|
+
&:last-child {
|
|
48
|
+
margin-bottom: 0;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
&:first-of-type {
|
|
52
|
+
margin-top: 0;
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { EntryList, EntryListItem, EntryListHeading, EntryListText, } from "./entry-list";
|
|
3
|
+
import { Decorator } from "../../../components/decorator/decorator";
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Modules/EntryList",
|
|
6
|
+
component: EntryList,
|
|
7
|
+
decorators: [
|
|
8
|
+
(Story) => (_jsx(Decorator, { maxWidth: "800px", children: _jsx(Story, {}) })),
|
|
9
|
+
],
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
export const Default = {
|
|
13
|
+
render: () => (_jsxs(EntryList, { children: [_jsxs(EntryListItem, { children: [_jsx(EntryListText, { fontSizeDesktop: 14, color: "#545454", children: "2025-05-11" }), _jsx(EntryListHeading, { children: "In volutpat est eu dolor efficitur" }), _jsxs(EntryListText, { children: [_jsxs(EntryListText, { as: "span", fontSizeMobile: 12, fontSizeDesktop: 14, children: ["Nulla facilisi:", " "] }), _jsx(EntryListText, { as: "span", fontSizeMobile: 12, fontSizeDesktop: 14, bold: true, children: "volutpat, XiO, MD, Condimentum Ultricies" })] }), _jsx(EntryListText, { children: "Aliquam erat volutpat. Nulla facilisi. Vestibulum eget ullamcorper elit. Praesent mattis arcu ante, in gravida eros pharetra sit amet." }), _jsx(EntryListText, { children: "Praesent mattis arcu ante, in gravida eros pharetra sit amet. Etiam ac enim lorem. Proin euismod vulputate faucibus." })] }), _jsxs(EntryListItem, { children: [_jsx(EntryListHeading, { children: "In volutpat est eu dolor efficitur" }), _jsxs(EntryListText, { children: [_jsxs(EntryListText, { as: "span", fontSizeMobile: 12, fontSizeDesktop: 14, children: ["Nulla facilisi:", " "] }), _jsx(EntryListText, { as: "span", fontSizeMobile: 12, fontSizeDesktop: 14, bold: true, children: "volutpat, XiO, MD, Condimentum Ultricies" })] }), _jsx(EntryListText, { children: "Aliquam erat volutpat. Nulla facilisi. Vestibulum eget ullamcorper elit. Praesent mattis arcu ante, in gravida eros pharetra sit amet." }), _jsx(EntryListText, { children: "Praesent mattis arcu ante, in gravida eros pharetra sit amet. Etiam ac enim lorem. Proin euismod vulputate faucibus." })] }), _jsxs(EntryListItem, { children: [_jsx(EntryListHeading, { children: "In volutpat est eu dolor efficitur" }), _jsxs(EntryListText, { children: [_jsxs(EntryListText, { as: "span", fontSizeMobile: 12, fontSizeDesktop: 14, children: ["Nulla facilisi:", " "] }), _jsx(EntryListText, { as: "span", fontSizeMobile: 12, fontSizeDesktop: 14, bold: true, children: "volutpat, XiO, MD, Condimentum Ultricies" })] }), _jsx(EntryListText, { children: "Aliquam erat volutpat. Nulla facilisi. Vestibulum eget ullamcorper elit. Praesent mattis arcu ante, in gravida eros pharetra sit amet." }), _jsx(EntryListText, { children: "Praesent mattis arcu ante, in gravida eros pharetra sit amet. Etiam ac enim lorem. Proin euismod vulputate faucibus." })] })] })),
|
|
14
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
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 && css `
|
|
49
|
+
${({ theme }) => css `
|
|
50
|
+
color: ${theme.red};
|
|
51
|
+
box-shadow: inset 0 -4px 0 ${theme.red};
|
|
52
|
+
`};
|
|
53
|
+
`};
|
|
54
|
+
`;
|
|
55
|
+
const StyledToggle = styled(ToggableChevron).attrs({
|
|
56
|
+
disableCircle: true,
|
|
57
|
+
}) `
|
|
58
|
+
margin-left: ${rem(4)};
|
|
59
|
+
|
|
60
|
+
svg {
|
|
61
|
+
${(props) => props.toggled && css `
|
|
62
|
+
${({ theme }) => css `
|
|
63
|
+
fill: ${theme.red};
|
|
64
|
+
`};
|
|
65
|
+
`};
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
@@ -0,0 +1,7 @@
|
|
|
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;
|
|
@@ -0,0 +1,23 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
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;
|
|
@@ -0,0 +1,106 @@
|
|
|
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
|
+
`;
|
|
@@ -0,0 +1,9 @@
|
|
|
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;
|
|
@@ -0,0 +1,73 @@
|
|
|
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
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type PaginationProps = {
|
|
2
|
+
numberOfPages: number;
|
|
3
|
+
currentPage: number;
|
|
4
|
+
onChange?: (page: number) => void;
|
|
5
|
+
isMobile?: boolean;
|
|
6
|
+
indexStartsAt?: number;
|
|
7
|
+
localeText: {
|
|
8
|
+
prePage: string;
|
|
9
|
+
nextPage: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export declare const Pagination: ({ numberOfPages, currentPage, isMobile, localeText, onChange, indexStartsAt, }: PaginationProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import styled, { css } from "styled-components";
|
|
3
|
+
import { rem } from "../../../styles/units";
|
|
4
|
+
import { ChevronLeftIcon } from "../../../components/icons/chevron-left-icon/chevron-left-icon";
|
|
5
|
+
import { ChevronRightIcon } from "../../../components/icons/chevron-right-icon/chevron-right-icon";
|
|
6
|
+
import { COLORS } from "../../../styles/theme";
|
|
7
|
+
export const Pagination = ({ numberOfPages, currentPage, isMobile = true, localeText = {
|
|
8
|
+
prePage: "",
|
|
9
|
+
nextPage: "",
|
|
10
|
+
}, onChange = () => { }, indexStartsAt = 0, }) => {
|
|
11
|
+
const pageIndex = currentPage - indexStartsAt;
|
|
12
|
+
const { prePage, nextPage } = localeText;
|
|
13
|
+
const isFirstPage = pageIndex === 0;
|
|
14
|
+
const isLastPage = pageIndex === numberOfPages - 1;
|
|
15
|
+
const goToPage = (e, pageIndex) => {
|
|
16
|
+
e.preventDefault();
|
|
17
|
+
const adjustedIndex = pageIndex + indexStartsAt;
|
|
18
|
+
onChange(adjustedIndex);
|
|
19
|
+
};
|
|
20
|
+
const getVisiblePages = (currentPage, total, isMobile) => {
|
|
21
|
+
if (total <= 7)
|
|
22
|
+
return Array.from({ length: total }, (_, i) => i);
|
|
23
|
+
if (isMobile) {
|
|
24
|
+
if (currentPage <= 1)
|
|
25
|
+
return [0, 1, 2, "...", total - 1];
|
|
26
|
+
if (currentPage >= total - 2)
|
|
27
|
+
return [0, "...", total - 3, total - 2, total - 1];
|
|
28
|
+
return [0, "...", currentPage, "...", total - 1];
|
|
29
|
+
}
|
|
30
|
+
if (currentPage <= 2)
|
|
31
|
+
return [0, 1, 2, 3, 4, "...", total - 1];
|
|
32
|
+
if (currentPage >= total - 3)
|
|
33
|
+
return [0, "...", total - 5, total - 4, total - 3, total - 2, total - 1];
|
|
34
|
+
return [
|
|
35
|
+
0,
|
|
36
|
+
"...",
|
|
37
|
+
currentPage - 1,
|
|
38
|
+
currentPage,
|
|
39
|
+
currentPage + 1,
|
|
40
|
+
"...",
|
|
41
|
+
total - 1,
|
|
42
|
+
];
|
|
43
|
+
};
|
|
44
|
+
return (numberOfPages > 0 && (_jsxs(StyledList, { children: [_jsx(StyleListItem, { children: _jsx(PaginationArrow, { isDisabled: isFirstPage, "aria-label": prePage, onClick: (e) => goToPage(e, pageIndex - 1), children: _jsx(ChevronLeftIcon, { width: 12, height: 12, color: isFirstPage ? COLORS.grayDark : COLORS.blackLight }) }) }), getVisiblePages(pageIndex, numberOfPages, isMobile).map((page, index) => (_jsx(StyleListItem, { children: page === "..." ? (_jsx(Ellipsis, { children: "\u2026" })) : (_jsx(PaginationItem, { isSelected: pageIndex === page, onClick: (e) => goToPage(e, page), children: page + 1 })) }, index))), _jsx(StyleListItem, { children: _jsx(PaginationArrow, { isDisabled: isLastPage, "aria-label": nextPage, onClick: (e) => goToPage(e, pageIndex + 1), children: _jsx(ChevronRightIcon, { width: 12, height: 12, color: isLastPage ? COLORS.grayDark : COLORS.blackLight }) }) })] })));
|
|
45
|
+
};
|
|
46
|
+
const StyledList = styled.ul `
|
|
47
|
+
margin: 0 auto;
|
|
48
|
+
margin-top: ${rem(32)};
|
|
49
|
+
display: flex;
|
|
50
|
+
padding: 0;
|
|
51
|
+
flex-wrap: wrap;
|
|
52
|
+
list-style: none;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: center;
|
|
55
|
+
`;
|
|
56
|
+
const StyleListItem = styled.li `
|
|
57
|
+
padding: ${rem(4)};
|
|
58
|
+
`;
|
|
59
|
+
const PaginationItem = styled.button `
|
|
60
|
+
cursor: pointer;
|
|
61
|
+
width: ${rem(40)};
|
|
62
|
+
height: ${rem(40)};
|
|
63
|
+
padding: 0;
|
|
64
|
+
margin: 0;
|
|
65
|
+
display: flex;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
align-items: center;
|
|
68
|
+
border-radius: ${rem(5)};
|
|
69
|
+
background-color: transparent;
|
|
70
|
+
text-decoration: none;
|
|
71
|
+
|
|
72
|
+
${({ theme }) => css `
|
|
73
|
+
color: ${theme.blackLight};
|
|
74
|
+
font-family: ${theme.valueBold};
|
|
75
|
+
font-weight: 400;
|
|
76
|
+
line-height: ${rem(22)};
|
|
77
|
+
border: ${rem(1)} solid ${theme.blackLight};
|
|
78
|
+
`};
|
|
79
|
+
|
|
80
|
+
${({ theme, isSelected }) => isSelected &&
|
|
81
|
+
css `
|
|
82
|
+
background-color: ${theme.blackLight};
|
|
83
|
+
border-color: transparent;
|
|
84
|
+
color: ${theme.white};
|
|
85
|
+
`};
|
|
86
|
+
`;
|
|
87
|
+
const PaginationArrow = styled.button `
|
|
88
|
+
cursor: pointer;
|
|
89
|
+
display: flex;
|
|
90
|
+
align-items: center;
|
|
91
|
+
justify-content: center;
|
|
92
|
+
width: ${rem(40)};
|
|
93
|
+
height: ${rem(40)};
|
|
94
|
+
border: ${({ theme }) => `${rem(1)} solid ${theme.blackLight}`};
|
|
95
|
+
border-radius: ${rem(5)};
|
|
96
|
+
background-color: ${({ theme }) => theme.white};
|
|
97
|
+
|
|
98
|
+
${({ isDisabled }) => isDisabled &&
|
|
99
|
+
css `
|
|
100
|
+
pointer-events: none;
|
|
101
|
+
cursor: default;
|
|
102
|
+
border: ${({ theme }) => `${rem(1)} solid ${theme.grayDark}`};
|
|
103
|
+
`}
|
|
104
|
+
`;
|
|
105
|
+
const Ellipsis = styled.span `
|
|
106
|
+
display: flex;
|
|
107
|
+
align-items: center;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
width: ${rem(40)};
|
|
110
|
+
height: ${rem(40)};
|
|
111
|
+
border: ${({ theme }) => `${rem(1)} solid ${theme.blackLight}`};
|
|
112
|
+
border-radius: ${rem(5)};
|
|
113
|
+
color: ${({ theme }) => theme.blackLight};
|
|
114
|
+
`;
|