@thecb/components 11.2.4-beta.0 → 11.2.4
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 +169 -41
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +169 -42
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/link/ExternalLink.js +2 -0
- package/src/components/atoms/link/ExternalLink.styled.js +4 -1
- package/src/components/atoms/link/InternalLink.js +3 -1
- package/src/components/atoms/link/InternalLink.styled.js +4 -1
- package/src/components/molecules/contact-card/ContactCard.js +16 -11
- package/src/components/molecules/contact-card/ContactCard.stories.js +4 -0
- package/src/components/molecules/index.js +1 -0
- package/src/components/molecules/obligation/modules/InactiveTitleModule.js +1 -1
- package/src/components/molecules/registration-banner/RegistrationBanner.js +110 -0
- package/src/components/molecules/registration-banner/RegistrationBanner.mdx +15 -0
- package/src/components/molecules/registration-banner/RegistrationBanner.stories.js +80 -0
- package/src/components/molecules/registration-banner/RegistrationBanner.styled.js +44 -0
- package/src/components/molecules/registration-banner/RegistrationBanner.theme.js +11 -0
- package/src/components/molecules/registration-banner/index.d.ts +15 -0
- package/src/components/molecules/registration-banner/index.js +3 -0
package/package.json
CHANGED
|
@@ -21,6 +21,7 @@ const ExternalLink = forwardRef(
|
|
|
21
21
|
tabIndex = "0",
|
|
22
22
|
dataQa,
|
|
23
23
|
ariaLabel,
|
|
24
|
+
isUnderlined = true,
|
|
24
25
|
children
|
|
25
26
|
},
|
|
26
27
|
ref
|
|
@@ -60,6 +61,7 @@ const ExternalLink = forwardRef(
|
|
|
60
61
|
rel={newTab ? "noopener" : ""}
|
|
61
62
|
data-qa={dataQa}
|
|
62
63
|
aria-label={ariaLabel}
|
|
64
|
+
isUnderlined={isUnderlined}
|
|
63
65
|
ref={ref}
|
|
64
66
|
>
|
|
65
67
|
{safeChildren(children, <span />)}
|
|
@@ -22,15 +22,18 @@ 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: ${
|
|
25
|
+
text-decoration: ${({ isUnderlined }) =>
|
|
26
|
+
isUnderlined ? LINK_TEXT_DECORATION : "none"};
|
|
26
27
|
|
|
27
28
|
&:hover {
|
|
28
29
|
color: ${({ hoverColor }) => hoverColor};
|
|
30
|
+
text-decoration: ${LINK_TEXT_DECORATION};
|
|
29
31
|
}
|
|
30
32
|
|
|
31
33
|
&:focus {
|
|
32
34
|
outline: 3px solid ${ROYAL_BLUE};
|
|
33
35
|
outline-offset: 2px;
|
|
36
|
+
text-decoration: ${LINK_TEXT_DECORATION};
|
|
34
37
|
}
|
|
35
38
|
|
|
36
39
|
&:active {
|
|
@@ -19,7 +19,8 @@ const InternalLink = forwardRef(
|
|
|
19
19
|
margin,
|
|
20
20
|
tabIndex = "0",
|
|
21
21
|
dataQa,
|
|
22
|
-
extraStyles =
|
|
22
|
+
extraStyles = ``,
|
|
23
|
+
isUnderlined = true
|
|
23
24
|
},
|
|
24
25
|
ref
|
|
25
26
|
) => {
|
|
@@ -46,6 +47,7 @@ const InternalLink = forwardRef(
|
|
|
46
47
|
tabIndex={tabIndex}
|
|
47
48
|
extrastyles={extraStyles}
|
|
48
49
|
data-qa={dataQa}
|
|
50
|
+
isUnderlined={isUnderlined}
|
|
49
51
|
ref={ref}
|
|
50
52
|
>
|
|
51
53
|
{safeChildren(children, <span />)}
|
|
@@ -28,15 +28,18 @@ export const StyledInternalLink = styled(
|
|
|
28
28
|
font-size: ${({ fontSize }) => fontSize};
|
|
29
29
|
font-family: ${({ fontFamily }) => fontFamily};
|
|
30
30
|
margin: ${({ margin }) => margin};
|
|
31
|
-
text-decoration: ${
|
|
31
|
+
text-decoration: ${({ isUnderlined }) =>
|
|
32
|
+
isUnderlined ? LINK_TEXT_DECORATION : "none"};
|
|
32
33
|
|
|
33
34
|
&:hover {
|
|
34
35
|
color: ${({ hoverColor }) => hoverColor};
|
|
36
|
+
text-decoration: ${LINK_TEXT_DECORATION};
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
&:focus {
|
|
38
40
|
outline: 3px solid ${ROYAL_BLUE};
|
|
39
41
|
outline-offset: 2px;
|
|
42
|
+
text-decoration: ${LINK_TEXT_DECORATION};
|
|
40
43
|
}
|
|
41
44
|
|
|
42
45
|
&:active {
|
|
@@ -42,7 +42,7 @@ const ContactCard = ({
|
|
|
42
42
|
background={WHITE}
|
|
43
43
|
boxShadow="0px 2px 4px rgba(0, 0, 0, 0.25)"
|
|
44
44
|
dataQa={createIdFromString(title, "contact-card")}
|
|
45
|
-
maxWidth=
|
|
45
|
+
maxWidth="100%"
|
|
46
46
|
minWidth={isMobile ? "240px" : "208px"}
|
|
47
47
|
minHeight="141px"
|
|
48
48
|
padding="1.5rem"
|
|
@@ -108,14 +108,15 @@ const ContactCard = ({
|
|
|
108
108
|
dataQa={linkID}
|
|
109
109
|
href={link.link}
|
|
110
110
|
newTab={true}
|
|
111
|
+
isUnderlined={false}
|
|
111
112
|
extraStyles={`
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
113
|
+
flex-direction: row;
|
|
114
|
+
align-items: center;
|
|
115
|
+
align-content: flex-start;
|
|
116
|
+
justify-content: space-between;
|
|
117
|
+
word-break: break-word;
|
|
118
|
+
${TextWrapStyles}
|
|
119
|
+
`}
|
|
119
120
|
size={FONT_SIZE.SM}
|
|
120
121
|
lineHeight="1.313rem"
|
|
121
122
|
>
|
|
@@ -132,10 +133,14 @@ const ContactCard = ({
|
|
|
132
133
|
to={link.link}
|
|
133
134
|
dataQa={linkID}
|
|
134
135
|
fontSize={FONT_SIZE.SM}
|
|
136
|
+
color={linkThemeValues.externalLinkColor}
|
|
137
|
+
isUnderlined={false}
|
|
138
|
+
active={false}
|
|
139
|
+
lineheight="1.313rem"
|
|
135
140
|
extraStyles={`
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
141
|
+
word-break: break-word;
|
|
142
|
+
${TextWrapStyles}
|
|
143
|
+
`}
|
|
139
144
|
>
|
|
140
145
|
{link.text}
|
|
141
146
|
</InternalLink>
|
|
@@ -60,6 +60,10 @@ export const BasicContactCard = {
|
|
|
60
60
|
content:
|
|
61
61
|
"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod",
|
|
62
62
|
links: [
|
|
63
|
+
{
|
|
64
|
+
text: "Wallet Login",
|
|
65
|
+
link: "/login"
|
|
66
|
+
},
|
|
63
67
|
{
|
|
64
68
|
text: "Cityville Home",
|
|
65
69
|
link: "https://cityville-demos.uat.cityba.se/"
|
|
@@ -29,6 +29,7 @@ export { default as PhoneForm } from "./phone-form";
|
|
|
29
29
|
export { default as Popover } from "./popover";
|
|
30
30
|
export { default as RadioGroup } from "./radio-group";
|
|
31
31
|
export { default as RadioSection } from "./radio-section";
|
|
32
|
+
export { default as RegistrationBanner } from "./registration-banner";
|
|
32
33
|
export { default as RegistrationForm } from "./registration-form";
|
|
33
34
|
export { default as ResetConfirmationForm } from "./reset-confirmation-form";
|
|
34
35
|
export { default as ResetPasswordForm } from "./reset-password-form";
|
|
@@ -28,7 +28,7 @@ const InactiveTitleModule = ({ title, subtitle, autoPayEnabled }) => (
|
|
|
28
28
|
Unable to load account details
|
|
29
29
|
</Detail>
|
|
30
30
|
<Detail variant="extraSmall" as="p" color={BLACK}>
|
|
31
|
-
{`This may mean the
|
|
31
|
+
{`This may mean that the account has been paid off or there was an error loading it. If you have questions about this account, please contact us.${
|
|
32
32
|
autoPayEnabled
|
|
33
33
|
? " You may disable autopay for this account by pressing the 'Turn off Autopay' button."
|
|
34
34
|
: ""
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import React, { useContext } from "react";
|
|
2
|
+
import { themeComponent } from "../../../util/themeUtils";
|
|
3
|
+
import { fallbackValues } from "./RegistrationBanner.theme";
|
|
4
|
+
import * as Styled from "./RegistrationBanner.styled";
|
|
5
|
+
import ArrowRightIcon from "../../atoms/icons/ArrowRightIcon";
|
|
6
|
+
import { Box, Cluster } from "../../atoms/layouts";
|
|
7
|
+
import Text from "../../atoms/text";
|
|
8
|
+
import { ThemeContext } from "styled-components";
|
|
9
|
+
import {
|
|
10
|
+
FONT_SIZE,
|
|
11
|
+
FONT_WEIGHT_SEMIBOLD
|
|
12
|
+
} from "../../../constants/style_constants";
|
|
13
|
+
import withWindowSize from "../../withWindowSize";
|
|
14
|
+
import Heading from "../../atoms/heading";
|
|
15
|
+
|
|
16
|
+
const RegistrationBanner = ({
|
|
17
|
+
clientName,
|
|
18
|
+
extraStyles,
|
|
19
|
+
loginLink = "/login",
|
|
20
|
+
registrationLink = "/registration",
|
|
21
|
+
themeValues,
|
|
22
|
+
titleAs,
|
|
23
|
+
titleVariant
|
|
24
|
+
}) => {
|
|
25
|
+
const themeContext = useContext(ThemeContext);
|
|
26
|
+
const { isMobile } = themeContext;
|
|
27
|
+
return (
|
|
28
|
+
<Styled.BannerContainer
|
|
29
|
+
extraStyles={extraStyles}
|
|
30
|
+
themeValues={themeValues}
|
|
31
|
+
isMobile={isMobile}
|
|
32
|
+
aria-label="Registration Banner"
|
|
33
|
+
justify="center"
|
|
34
|
+
>
|
|
35
|
+
<Styled.ContentContainer
|
|
36
|
+
align="center"
|
|
37
|
+
justify="space-between"
|
|
38
|
+
overflow="visible"
|
|
39
|
+
isMobile={isMobile}
|
|
40
|
+
>
|
|
41
|
+
<Box padding="0" textAlign="left">
|
|
42
|
+
<Heading
|
|
43
|
+
as={titleAs}
|
|
44
|
+
color={themeValues.primaryColor}
|
|
45
|
+
fontSize={isMobile ? FONT_SIZE.XL : "1.5rem"}
|
|
46
|
+
variant={titleVariant}
|
|
47
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
48
|
+
>
|
|
49
|
+
Register for a {clientName} Wallet Account
|
|
50
|
+
</Heading>
|
|
51
|
+
<Text
|
|
52
|
+
extraStyles={`
|
|
53
|
+
display: block;
|
|
54
|
+
padding: ${isMobile ? ".125rem 0 1rem" : "0"}
|
|
55
|
+
`}
|
|
56
|
+
fontSize={isMobile ? FONT_SIZE.SM : FONT_SIZE.LG}
|
|
57
|
+
color={themeValues.secondaryColor}
|
|
58
|
+
>
|
|
59
|
+
Save payment methods and information for fast, easy, and safe
|
|
60
|
+
payments with {clientName}
|
|
61
|
+
</Text>
|
|
62
|
+
</Box>
|
|
63
|
+
<Styled.ButtonContainer
|
|
64
|
+
justify="space-between"
|
|
65
|
+
fullHeight
|
|
66
|
+
childGap="0.5rem"
|
|
67
|
+
isMobile={isMobile}
|
|
68
|
+
>
|
|
69
|
+
<Styled.RegisterLink
|
|
70
|
+
variant="secondary"
|
|
71
|
+
color={themeValues.primaryColor}
|
|
72
|
+
contentOverride
|
|
73
|
+
fontWeight={FONT_WEIGHT_SEMIBOLD}
|
|
74
|
+
url={registrationLink}
|
|
75
|
+
>
|
|
76
|
+
<Cluster justify="center" align="center">
|
|
77
|
+
<Text
|
|
78
|
+
extraStyles="margin-right: 0.5rem"
|
|
79
|
+
fontSize={isMobile ? FONT_SIZE.MD : FONT_SIZE.LG}
|
|
80
|
+
color={themeValues.primaryColor}
|
|
81
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
82
|
+
>
|
|
83
|
+
Register Now
|
|
84
|
+
</Text>
|
|
85
|
+
<ArrowRightIcon />
|
|
86
|
+
</Cluster>
|
|
87
|
+
</Styled.RegisterLink>
|
|
88
|
+
<Styled.LoginLink
|
|
89
|
+
text="Log In"
|
|
90
|
+
variant="secondary"
|
|
91
|
+
contentOverride
|
|
92
|
+
url={loginLink}
|
|
93
|
+
>
|
|
94
|
+
<Text
|
|
95
|
+
fontSize={isMobile ? FONT_SIZE.SM : FONT_SIZE.MD}
|
|
96
|
+
color={themeValues.primaryColor}
|
|
97
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
98
|
+
>
|
|
99
|
+
or Log In
|
|
100
|
+
</Text>
|
|
101
|
+
</Styled.LoginLink>
|
|
102
|
+
</Styled.ButtonContainer>
|
|
103
|
+
</Styled.ContentContainer>
|
|
104
|
+
</Styled.BannerContainer>
|
|
105
|
+
);
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
export default withWindowSize(
|
|
109
|
+
themeComponent(RegistrationBanner, "RegistrationBanner", fallbackValues)
|
|
110
|
+
);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Canvas, Meta, Title, Story, Controls } from '@storybook/blocks';
|
|
2
|
+
|
|
3
|
+
import * as RegistrationBannerStories from './RegistrationBanner.stories.js';
|
|
4
|
+
|
|
5
|
+
<Meta of={RegistrationBannerStories} />
|
|
6
|
+
|
|
7
|
+
<Title />
|
|
8
|
+
|
|
9
|
+
Originally used in the PayDot project, `RegistrationBanner` displays a promotional banner for user registration.
|
|
10
|
+
|
|
11
|
+
- Title and Description: A `clientName` prop is passed, which displays within the title and description text.
|
|
12
|
+
- Responsive: Adjusts its layout and font sizes based on whether the user is on a mobile device, using the `isMobile` value from the theme context.
|
|
13
|
+
- Action Links: Provides two main action links - one for registration ("Register Now") and another for logging in ("Log In").
|
|
14
|
+
|
|
15
|
+
<Controls />
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import RegistrationBanner from "./RegistrationBanner";
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Molecules/RegistrationBanner",
|
|
6
|
+
component: RegistrationBanner,
|
|
7
|
+
parameters: {
|
|
8
|
+
layout: "centered"
|
|
9
|
+
},
|
|
10
|
+
tags: ["!autodocs"],
|
|
11
|
+
args: {
|
|
12
|
+
clientName: "Cityville",
|
|
13
|
+
extraStyles: "",
|
|
14
|
+
titleAs: "h1",
|
|
15
|
+
titleVariant: "h1",
|
|
16
|
+
registrationLink: "/registration",
|
|
17
|
+
loginLink: "/login"
|
|
18
|
+
},
|
|
19
|
+
argTypes: {
|
|
20
|
+
clientName: {
|
|
21
|
+
description:
|
|
22
|
+
"Name of the client using the RegistrationBanner (e.g. Cityville). This will be displayed in the title and description of the banner.",
|
|
23
|
+
table: {
|
|
24
|
+
type: { summary: "string" },
|
|
25
|
+
defaultValue: {
|
|
26
|
+
summary: "Cityville"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
extraStyles: {
|
|
31
|
+
description: "Additional styles for the RegistrationBanner",
|
|
32
|
+
table: {
|
|
33
|
+
type: { summary: "string" },
|
|
34
|
+
defaultValue: { summary: "" }
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
titleAs: {
|
|
38
|
+
description: "HTML tag to use for the title",
|
|
39
|
+
table: {
|
|
40
|
+
type: { summary: "string" },
|
|
41
|
+
defaultValue: { summary: "h1" }
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
titleVariant: {
|
|
45
|
+
description: "Variant of the title",
|
|
46
|
+
table: {
|
|
47
|
+
type: { summary: "string" },
|
|
48
|
+
defaultValue: { summary: "h1" }
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
registrationLink: {
|
|
52
|
+
description: "URL for the registration link",
|
|
53
|
+
table: {
|
|
54
|
+
type: { summary: "string" },
|
|
55
|
+
defaultValue: { summary: "/registration" }
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
loginLink: {
|
|
59
|
+
description: "URL for the login link",
|
|
60
|
+
table: {
|
|
61
|
+
type: { summary: "string" },
|
|
62
|
+
defaultValue: { summary: "/login" }
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export default meta;
|
|
69
|
+
|
|
70
|
+
export const StandardRegistrationBanner = {
|
|
71
|
+
args: {},
|
|
72
|
+
parameters: {
|
|
73
|
+
viewport: {
|
|
74
|
+
defaultViewport: "responsive"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
render: args => {
|
|
78
|
+
return <RegistrationBanner {...args} key="registration-banner-standard" />;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import styled from "styled-components";
|
|
2
|
+
import { Box, Cluster, Stack } from "../../atoms/layouts";
|
|
3
|
+
import ButtonWithLink from "../../atoms/button-with-link/ButtonWithLink";
|
|
4
|
+
import { adjustHexColor } from "../../../util/general";
|
|
5
|
+
|
|
6
|
+
export const BannerContainer = styled(Cluster)`
|
|
7
|
+
background: ${({ themeValues }) =>
|
|
8
|
+
adjustHexColor(themeValues.background, 10, "lighten")};
|
|
9
|
+
padding: ${({ isMobile }) => (isMobile ? "1rem 2rem" : " 2rem 8.25rem")};
|
|
10
|
+
`;
|
|
11
|
+
|
|
12
|
+
export const ContentContainer = styled(Cluster)`
|
|
13
|
+
padding: 0;
|
|
14
|
+
width: ${({ isMobile }) => (isMobile ? "296px" : " 1176px")};
|
|
15
|
+
> div {
|
|
16
|
+
flex-direction: ${({ isMobile }) => (isMobile ? "column" : "row")};
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
|
|
20
|
+
export const ButtonContainer = styled(Stack)`
|
|
21
|
+
align-items: center;
|
|
22
|
+
> a {
|
|
23
|
+
width: ${({ isMobile }) => (isMobile ? "296px" : "222px")};
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
export const RegisterLink = styled(ButtonWithLink)`
|
|
28
|
+
border-radius: 100px;
|
|
29
|
+
margin: 0;
|
|
30
|
+
width: 100%;
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
export const LoginLink = styled(ButtonWithLink)`
|
|
34
|
+
border-radius: 100px;
|
|
35
|
+
padding: 0;
|
|
36
|
+
margin: 0;
|
|
37
|
+
width: 100%;
|
|
38
|
+
min-height: 2rem;
|
|
39
|
+
margin-top: 0px;
|
|
40
|
+
border: none;
|
|
41
|
+
&:hover {
|
|
42
|
+
text-decoration: none;
|
|
43
|
+
}
|
|
44
|
+
`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Expand from "../../../util/expand";
|
|
3
|
+
|
|
4
|
+
export interface RegistrationBannerProps {
|
|
5
|
+
clientName?: string;
|
|
6
|
+
extraStyles?: string;
|
|
7
|
+
loginLink?: string;
|
|
8
|
+
registrationLink?: string;
|
|
9
|
+
themeValues?: any;
|
|
10
|
+
titleAs?: string;
|
|
11
|
+
titleVariant?: string;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const RegistrationBanner: React.FC<Expand<RegistrationBannerProps> &
|
|
15
|
+
React.HTMLAttributes<HTMLElement>>;
|