@thecb/components 11.2.5 → 11.2.6-beta.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/index.cjs.js +155 -55
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +155 -56
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/layouts/Center.styled.js +2 -0
- package/src/components/atoms/link/ExternalLink.js +4 -2
- package/src/components/atoms/link/ExternalLink.styled.js +1 -2
- package/src/components/atoms/link/InternalLink.js +4 -2
- package/src/components/atoms/link/InternalLink.styled.js +1 -2
- package/src/components/atoms/title/Title.theme.js +3 -0
- package/src/components/molecules/contact-card/ContactCard.js +2 -4
- package/src/components/molecules/hero-image/HeroImage.js +99 -0
- package/src/components/molecules/hero-image/HeroImage.mdx +15 -0
- package/src/components/molecules/hero-image/HeroImage.stories.js +97 -0
- package/src/components/molecules/hero-image/HeroImage.styled.js +29 -0
- package/src/components/molecules/hero-image/HeroImage.theme.js +15 -0
- package/src/components/molecules/hero-image/index.js +3 -0
- package/src/components/molecules/index.js +1 -0
- package/src/components/molecules/registration-banner/RegistrationBanner.js +5 -10
- package/src/components/molecules/registration-banner/RegistrationBanner.styled.js +4 -6
- package/src/util/general.js +12 -0
- package/src/components/atoms/.DS_Store +0 -0
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ export const CenterWrapper = styled.div`
|
|
|
4
4
|
box-sizing: content-box;
|
|
5
5
|
margin-left: auto;
|
|
6
6
|
margin-right: auto;
|
|
7
|
+
width: ${({ width }) => width || "auto"};
|
|
7
8
|
max-width: ${({ maxWidth }) => maxWidth};
|
|
8
9
|
padding-left: ${({ gutters }) => gutters};
|
|
9
10
|
padding-right: ${({ gutters }) => gutters};
|
|
@@ -15,4 +16,5 @@ export const CenterWrapper = styled.div`
|
|
|
15
16
|
align-items: center;
|
|
16
17
|
`
|
|
17
18
|
: ``};
|
|
19
|
+
${({ extraStyles }) => extraStyles}
|
|
18
20
|
`;
|
|
@@ -6,6 +6,7 @@ import { StyledExternalLink } from "./ExternalLink.styled";
|
|
|
6
6
|
import { FONT_WEIGHT_REGULAR } from "../../../constants/style_constants";
|
|
7
7
|
import { safeChildren } from "../../../util/general";
|
|
8
8
|
import { Box } from "../layouts";
|
|
9
|
+
import { LINK_TEXT_DECORATION } from "../../../constants/style_constants";
|
|
9
10
|
|
|
10
11
|
const ExternalLink = forwardRef(
|
|
11
12
|
(
|
|
@@ -57,11 +58,12 @@ const ExternalLink = forwardRef(
|
|
|
57
58
|
activeColor={themeValues.activeColor}
|
|
58
59
|
fontFamily={themeValues.fontFamily}
|
|
59
60
|
tabIndex={tabIndex}
|
|
60
|
-
extrastyles={
|
|
61
|
+
extrastyles={`${
|
|
62
|
+
isUnderlined ? LINK_TEXT_DECORATION : "none"
|
|
63
|
+
} ${extraStyles}`}
|
|
61
64
|
rel={newTab ? "noopener" : ""}
|
|
62
65
|
data-qa={dataQa}
|
|
63
66
|
aria-label={ariaLabel}
|
|
64
|
-
isUnderlined={isUnderlined}
|
|
65
67
|
ref={ref}
|
|
66
68
|
>
|
|
67
69
|
{safeChildren(children, <span />)}
|
|
@@ -22,8 +22,7 @@ export const StyledExternalLink = styled(
|
|
|
22
22
|
font-weight: ${({ weight }) => weight};
|
|
23
23
|
font-family: ${({ fontFamily }) => fontFamily};
|
|
24
24
|
line-height: ${({ lineheight }) => lineheight};
|
|
25
|
-
text-decoration: ${
|
|
26
|
-
isUnderlined ? LINK_TEXT_DECORATION : "none"};
|
|
25
|
+
text-decoration: ${LINK_TEXT_DECORATION};
|
|
27
26
|
|
|
28
27
|
&:hover {
|
|
29
28
|
color: ${({ hoverColor }) => hoverColor};
|
|
@@ -4,6 +4,7 @@ import { fallbackValues } from "./Link.theme";
|
|
|
4
4
|
import { createThemeValues } from "../../../util/themeUtils";
|
|
5
5
|
import { StyledInternalLink } from "./InternalLink.styled";
|
|
6
6
|
import { safeChildren } from "../../../util/general";
|
|
7
|
+
import { LINK_TEXT_DECORATION } from "../../../constants/style_constants";
|
|
7
8
|
|
|
8
9
|
const InternalLink = forwardRef(
|
|
9
10
|
(
|
|
@@ -45,9 +46,10 @@ const InternalLink = forwardRef(
|
|
|
45
46
|
hoverColor={themeValues.hoverColor}
|
|
46
47
|
activeColor={themeValues.activeColor}
|
|
47
48
|
tabIndex={tabIndex}
|
|
48
|
-
extrastyles={
|
|
49
|
+
extrastyles={`${
|
|
50
|
+
isUnderlined ? LINK_TEXT_DECORATION : "none"
|
|
51
|
+
} ${extraStyles}`}
|
|
49
52
|
data-qa={dataQa}
|
|
50
|
-
isUnderlined={isUnderlined}
|
|
51
53
|
ref={ref}
|
|
52
54
|
>
|
|
53
55
|
{safeChildren(children, <span />)}
|
|
@@ -28,8 +28,7 @@ export const StyledInternalLink = styled(
|
|
|
28
28
|
font-size: ${({ fontSize }) => fontSize};
|
|
29
29
|
font-family: ${({ fontFamily }) => fontFamily};
|
|
30
30
|
margin: ${({ margin }) => margin};
|
|
31
|
-
text-decoration: ${
|
|
32
|
-
isUnderlined ? LINK_TEXT_DECORATION : "none"};
|
|
31
|
+
text-decoration: ${LINK_TEXT_DECORATION};
|
|
33
32
|
|
|
34
33
|
&:hover {
|
|
35
34
|
color: ${({ hoverColor }) => hoverColor};
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
// Comments assume desktop base font size of 16px, mobile base font size of 14px
|
|
2
2
|
|
|
3
3
|
const fontSize = {
|
|
4
|
+
hero: "3rem", // 48px
|
|
4
5
|
large: "1.5rem", // 24px (at base font size of 16px)
|
|
5
6
|
small: "1.25rem" // 20px
|
|
6
7
|
};
|
|
7
8
|
|
|
8
9
|
const fontFamily = {
|
|
10
|
+
hero: "Public Sans",
|
|
9
11
|
large: "Public Sans",
|
|
10
12
|
small: "Public Sans"
|
|
11
13
|
};
|
|
12
14
|
|
|
13
15
|
const mobileFontSize = {
|
|
16
|
+
hero: "2.5rem", // 40px
|
|
14
17
|
large: "1.5rem", // 21px (at base font size of 14px)
|
|
15
18
|
small: "1.2142rem" // 17px
|
|
16
19
|
};
|
|
@@ -101,10 +101,9 @@ const ContactCard = ({
|
|
|
101
101
|
"contact-card-link"
|
|
102
102
|
);
|
|
103
103
|
return (
|
|
104
|
-
|
|
104
|
+
<React.Fragment key={linkID}>
|
|
105
105
|
{R.test(URL_TEST, link.link) ? (
|
|
106
106
|
<ExternalLink
|
|
107
|
-
key={linkID}
|
|
108
107
|
dataQa={linkID}
|
|
109
108
|
href={link.link}
|
|
110
109
|
newTab={true}
|
|
@@ -129,7 +128,6 @@ const ContactCard = ({
|
|
|
129
128
|
</ExternalLink>
|
|
130
129
|
) : (
|
|
131
130
|
<InternalLink
|
|
132
|
-
key={linkID}
|
|
133
131
|
to={link.link}
|
|
134
132
|
dataQa={linkID}
|
|
135
133
|
fontSize={FONT_SIZE.SM}
|
|
@@ -145,7 +143,7 @@ const ContactCard = ({
|
|
|
145
143
|
{link.text}
|
|
146
144
|
</InternalLink>
|
|
147
145
|
)}
|
|
148
|
-
|
|
146
|
+
</React.Fragment>
|
|
149
147
|
);
|
|
150
148
|
})}
|
|
151
149
|
</Stack>
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { ThemeContext } from "styled-components";
|
|
3
|
+
import { Box, Center, Stack } from "../../atoms/layouts";
|
|
4
|
+
import { themeComponent } from "../../../util/themeUtils";
|
|
5
|
+
import Paragraph from "../../atoms/paragraph";
|
|
6
|
+
import Title from "../../atoms/title";
|
|
7
|
+
import { fallbackValues } from "./HeroImage.theme";
|
|
8
|
+
import {
|
|
9
|
+
FONT_WEIGHT_BOLD,
|
|
10
|
+
FONT_WEIGHT_SEMIBOLD
|
|
11
|
+
} from "../../../constants/style_constants";
|
|
12
|
+
import * as Styled from "./HeroImage.styled";
|
|
13
|
+
import { getNextHeading } from "../../../util/general";
|
|
14
|
+
|
|
15
|
+
const HeroImage = ({
|
|
16
|
+
themeValues,
|
|
17
|
+
heading,
|
|
18
|
+
headingVariant = "h2",
|
|
19
|
+
subheading,
|
|
20
|
+
description,
|
|
21
|
+
imageUrl,
|
|
22
|
+
variant = "v1",
|
|
23
|
+
minWidth = "100%",
|
|
24
|
+
minHeight = "auto",
|
|
25
|
+
contentSpacing = "0.5rem",
|
|
26
|
+
paddingOverride
|
|
27
|
+
}) => {
|
|
28
|
+
const { isMobile } = useContext(ThemeContext);
|
|
29
|
+
const secondaryHeadingVariant = getNextHeading(headingVariant);
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<>
|
|
33
|
+
{imageUrl && (
|
|
34
|
+
<Styled.HeroImageContainer
|
|
35
|
+
minWidth={minWidth}
|
|
36
|
+
minHeight={minHeight}
|
|
37
|
+
padding={paddingOverride ?? (isMobile ? "2rem" : "3rem 5.75rem")}
|
|
38
|
+
extraStyles={Styled.getHeroImageVariantStyles({
|
|
39
|
+
imageUrl,
|
|
40
|
+
isMobile,
|
|
41
|
+
variant,
|
|
42
|
+
gradientColorPrimary: themeValues.gradientColorPrimary,
|
|
43
|
+
gradientColorSecondary: themeValues.gradientColorSecondary
|
|
44
|
+
})}
|
|
45
|
+
>
|
|
46
|
+
<Center
|
|
47
|
+
maxWidth={"78.5rem"}
|
|
48
|
+
width={"100%"}
|
|
49
|
+
intrinsic
|
|
50
|
+
extraStyles={`
|
|
51
|
+
flex-flow: unset;
|
|
52
|
+
justify-content: flex-start;
|
|
53
|
+
flex-wrap: nowrap;"
|
|
54
|
+
`}
|
|
55
|
+
>
|
|
56
|
+
<Stack
|
|
57
|
+
childGap={contentSpacing}
|
|
58
|
+
extraStyles={`max-width: ${isMobile ? "100%" : "50%"};`}
|
|
59
|
+
>
|
|
60
|
+
<Stack childGap="0">
|
|
61
|
+
<Title
|
|
62
|
+
variant="hero"
|
|
63
|
+
as={headingVariant}
|
|
64
|
+
weight={FONT_WEIGHT_BOLD}
|
|
65
|
+
color={themeValues.textColor}
|
|
66
|
+
extraStyles={`line-height: ${isMobile ? "125%" : "115%"};`}
|
|
67
|
+
>
|
|
68
|
+
{heading}
|
|
69
|
+
</Title>
|
|
70
|
+
<Title
|
|
71
|
+
variant={"large"}
|
|
72
|
+
as={secondaryHeadingVariant}
|
|
73
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
74
|
+
fontSize={isMobile ? "1.5rem" : "2rem"}
|
|
75
|
+
color={themeValues.textColor}
|
|
76
|
+
extraStyles={`line-height: ${isMobile ? "150%" : "115%"};`}
|
|
77
|
+
>
|
|
78
|
+
{subheading}
|
|
79
|
+
</Title>
|
|
80
|
+
</Stack>
|
|
81
|
+
<Box padding="0">
|
|
82
|
+
<Paragraph
|
|
83
|
+
color={themeValues.textColor}
|
|
84
|
+
extraStyles={`line-height: ${
|
|
85
|
+
isMobile ? "150%" : "115%"
|
|
86
|
+
}; ${!isMobile && `font-size: 1.125rem;`}`}
|
|
87
|
+
>
|
|
88
|
+
{description}
|
|
89
|
+
</Paragraph>
|
|
90
|
+
</Box>
|
|
91
|
+
</Stack>
|
|
92
|
+
</Center>
|
|
93
|
+
</Styled.HeroImageContainer>
|
|
94
|
+
)}
|
|
95
|
+
</>
|
|
96
|
+
);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export default themeComponent(HeroImage, "HeroImage", fallbackValues);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as HeroImageStories from './HeroImage.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={HeroImageStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
HeroImage is a themeable component that renders a heading, sub-heading, and description with an image gradient background. It supports custom padding and content spacing for both mobile and desktop, as well as minimum width and height values.
|
|
10
|
+
|
|
11
|
+
<div style={{ margin: "2em 0"}}>
|
|
12
|
+
<Story />
|
|
13
|
+
</div>
|
|
14
|
+
|
|
15
|
+
<Controls />
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import HeroImage from "./HeroImage";
|
|
2
|
+
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "Molecules/HeroImage",
|
|
5
|
+
component: HeroImage,
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: "centered"
|
|
8
|
+
},
|
|
9
|
+
tags: ["!autodocs"],
|
|
10
|
+
args: {
|
|
11
|
+
heading: "Cityville",
|
|
12
|
+
subheading: "Payment Center",
|
|
13
|
+
description:
|
|
14
|
+
"Find and make payments quickly and conveniently from your computer or phone.",
|
|
15
|
+
imageUrl:
|
|
16
|
+
"https://images.unsplash.com/photo-1477959858617-67f85cf4f1df?q=80&w=1844&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D",
|
|
17
|
+
contentSpacing: "0.5rem"
|
|
18
|
+
},
|
|
19
|
+
argTypes: {
|
|
20
|
+
heading: {
|
|
21
|
+
description: "Hero image main heading",
|
|
22
|
+
table: {
|
|
23
|
+
type: { summary: "string" },
|
|
24
|
+
defaultValue: { summary: undefined }
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
headingVariant: {
|
|
28
|
+
description: "Heading variant for the hero image heading",
|
|
29
|
+
table: {
|
|
30
|
+
type: { summary: "string" },
|
|
31
|
+
defaultValue: { summary: undefined }
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
subheading: {
|
|
35
|
+
description: "Hero image sub-heading",
|
|
36
|
+
table: {
|
|
37
|
+
type: { summary: "string" },
|
|
38
|
+
defaultValue: { summary: undefined }
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
description: {
|
|
42
|
+
description: "Hero image description",
|
|
43
|
+
table: {
|
|
44
|
+
type: { summary: "string" },
|
|
45
|
+
defaultValue: { summary: undefined }
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
imageUrl: {
|
|
49
|
+
description: "Image URL for the hero image",
|
|
50
|
+
table: {
|
|
51
|
+
type: { summary: "string" },
|
|
52
|
+
defaultValue: { summary: undefined }
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
paddingOverride: {
|
|
56
|
+
description: "padding override around the HeroImage content (desktop)",
|
|
57
|
+
table: {
|
|
58
|
+
type: { summary: "string" },
|
|
59
|
+
defaultValue: { summary: "0.5rem 1.5rem" }
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
minWidth: {
|
|
63
|
+
description:
|
|
64
|
+
"Minimum width of the HeroImage, must be a valid value for the `min-width` property.",
|
|
65
|
+
table: {
|
|
66
|
+
type: { summary: "string" },
|
|
67
|
+
defaultValue: { summary: "100%" }
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
minHeight: {
|
|
71
|
+
description:
|
|
72
|
+
"Minimum height of the HeroImage, must be a valid value for the `min-height` property.",
|
|
73
|
+
table: {
|
|
74
|
+
type: { summary: "string" },
|
|
75
|
+
defaultValue: { summary: "auto" }
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
contentSpacing: {
|
|
79
|
+
description:
|
|
80
|
+
"Space between the headers and image, must be a valid CSS measurement value with a unit",
|
|
81
|
+
table: {
|
|
82
|
+
type: { summary: "string" },
|
|
83
|
+
defaultValue: { summary: "3rem" }
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export default meta;
|
|
90
|
+
|
|
91
|
+
export const DesktopV1 = {
|
|
92
|
+
args: {
|
|
93
|
+
variant: "v1",
|
|
94
|
+
minWidth: "1000px",
|
|
95
|
+
minHeight: "274px"
|
|
96
|
+
}
|
|
97
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
|
+
import { Box } from "../../atoms";
|
|
3
|
+
import { rgba } from "polished";
|
|
4
|
+
|
|
5
|
+
export const getHeroImageVariantStyles = ({
|
|
6
|
+
imageUrl,
|
|
7
|
+
isMobile,
|
|
8
|
+
variant,
|
|
9
|
+
gradientColorPrimary,
|
|
10
|
+
gradientColorSecondary
|
|
11
|
+
}) => {
|
|
12
|
+
return css`
|
|
13
|
+
background: ${!isMobile
|
|
14
|
+
? `linear-gradient(
|
|
15
|
+
90deg,
|
|
16
|
+
${gradientColorPrimary} 33%,
|
|
17
|
+
transparent 100%
|
|
18
|
+
)`
|
|
19
|
+
: `linear-gradient(
|
|
20
|
+
${rgba(gradientColorPrimary, 0.8)},
|
|
21
|
+
${rgba(gradientColorPrimary, 0.8)}
|
|
22
|
+
)`},
|
|
23
|
+
url(${imageUrl}) center / cover no-repeat;
|
|
24
|
+
`;
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const HeroImageContainer = styled(Box)`
|
|
28
|
+
display: flex;
|
|
29
|
+
`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import {
|
|
2
|
+
MATISSE_BLUE,
|
|
3
|
+
ROYAL_BLUE_VIVID,
|
|
4
|
+
WHITE
|
|
5
|
+
} from "../../../constants/colors";
|
|
6
|
+
|
|
7
|
+
const gradientColorPrimary = ROYAL_BLUE_VIVID;
|
|
8
|
+
const gradientColorSecondary = MATISSE_BLUE;
|
|
9
|
+
const textColor = WHITE;
|
|
10
|
+
|
|
11
|
+
export const fallbackValues = {
|
|
12
|
+
gradientColorPrimary,
|
|
13
|
+
gradientColorSecondary,
|
|
14
|
+
textColor
|
|
15
|
+
};
|
|
@@ -45,3 +45,4 @@ export { default as WorkflowTile } from "./workflow-tile";
|
|
|
45
45
|
export { default as PopupMenu } from "./popup-menu";
|
|
46
46
|
export { default as MultipleSelectFilter } from "./multiple-select-filter";
|
|
47
47
|
export { default as ContactCard } from "./contact-card";
|
|
48
|
+
export { default as HeroImage } from "./hero-image";
|
|
@@ -37,7 +37,6 @@ const RegistrationBanner = ({
|
|
|
37
37
|
justify="space-between"
|
|
38
38
|
overflow="visible"
|
|
39
39
|
isMobile={isMobile}
|
|
40
|
-
nowrap
|
|
41
40
|
>
|
|
42
41
|
<Box padding="0" textAlign="left">
|
|
43
42
|
<Heading
|
|
@@ -47,18 +46,18 @@ const RegistrationBanner = ({
|
|
|
47
46
|
variant={titleVariant}
|
|
48
47
|
weight={FONT_WEIGHT_SEMIBOLD}
|
|
49
48
|
>
|
|
50
|
-
Register for a {clientName} Wallet
|
|
49
|
+
Register for a {clientName} Wallet Account
|
|
51
50
|
</Heading>
|
|
52
51
|
<Text
|
|
53
52
|
extraStyles={`
|
|
54
53
|
display: block;
|
|
55
54
|
padding: ${isMobile ? ".125rem 0 1rem" : "0"}
|
|
56
55
|
`}
|
|
57
|
-
fontSize={isMobile ? FONT_SIZE.
|
|
56
|
+
fontSize={isMobile ? FONT_SIZE.SM : FONT_SIZE.LG}
|
|
58
57
|
color={themeValues.secondaryColor}
|
|
59
58
|
>
|
|
60
|
-
Save payment methods and
|
|
61
|
-
|
|
59
|
+
Save payment methods and information for fast, easy, and safe
|
|
60
|
+
payments with {clientName}
|
|
62
61
|
</Text>
|
|
63
62
|
</Box>
|
|
64
63
|
<Styled.ButtonContainer
|
|
@@ -74,11 +73,7 @@ const RegistrationBanner = ({
|
|
|
74
73
|
fontWeight={FONT_WEIGHT_SEMIBOLD}
|
|
75
74
|
url={registrationLink}
|
|
76
75
|
>
|
|
77
|
-
<Cluster
|
|
78
|
-
justify="center"
|
|
79
|
-
align="center"
|
|
80
|
-
extraStyles="min-width: 100%"
|
|
81
|
-
>
|
|
76
|
+
<Cluster justify="center" align="center">
|
|
82
77
|
<Text
|
|
83
78
|
extraStyles="margin-right: 0.5rem"
|
|
84
79
|
fontSize={isMobile ? FONT_SIZE.MD : FONT_SIZE.LG}
|
|
@@ -6,12 +6,12 @@ import { adjustHexColor } from "../../../util/general";
|
|
|
6
6
|
export const BannerContainer = styled(Cluster)`
|
|
7
7
|
background: ${({ themeValues }) =>
|
|
8
8
|
adjustHexColor(themeValues.background, 10, "lighten")};
|
|
9
|
-
padding: 2rem;
|
|
9
|
+
padding: ${({ isMobile }) => (isMobile ? "1rem 2rem" : " 2rem 8.25rem")};
|
|
10
10
|
`;
|
|
11
11
|
|
|
12
12
|
export const ContentContainer = styled(Cluster)`
|
|
13
13
|
padding: 0;
|
|
14
|
-
width: ${({ isMobile }) => (isMobile ? "
|
|
14
|
+
width: ${({ isMobile }) => (isMobile ? "296px" : " 1176px")};
|
|
15
15
|
> div {
|
|
16
16
|
flex-direction: ${({ isMobile }) => (isMobile ? "column" : "row")};
|
|
17
17
|
}
|
|
@@ -19,10 +19,8 @@ export const ContentContainer = styled(Cluster)`
|
|
|
19
19
|
|
|
20
20
|
export const ButtonContainer = styled(Stack)`
|
|
21
21
|
align-items: center;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
> * {
|
|
25
|
-
width: inherit;
|
|
22
|
+
> a {
|
|
23
|
+
width: ${({ isMobile }) => (isMobile ? "296px" : "222px")};
|
|
26
24
|
}
|
|
27
25
|
`;
|
|
28
26
|
|
package/src/util/general.js
CHANGED
|
@@ -213,3 +213,15 @@ export const adjustHexColor = (hex, percent, action) => {
|
|
|
213
213
|
.slice(1)
|
|
214
214
|
.padStart(6, "0")}`;
|
|
215
215
|
};
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Gets the next heading level in the sequence.
|
|
219
|
+
*
|
|
220
|
+
* @param {string} heading - The current heading level (e.g., "h1").
|
|
221
|
+
* @returns {string} - The next heading level in the sequence.
|
|
222
|
+
*/
|
|
223
|
+
const headingOrder = ["h1", "h2", "h3", "h4", "h5", "h6"];
|
|
224
|
+
export const getNextHeading = heading => {
|
|
225
|
+
const index = headingOrder.indexOf(heading);
|
|
226
|
+
return index >= 0 && index < 5 ? headingOrder[index + 1] : headingOrder[5];
|
|
227
|
+
};
|
|
Binary file
|