@thecb/components 11.2.3-beta.4 → 11.2.4-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 +93 -210
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +94 -210
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/icons/ExternalLinkIcon.js +2 -1
- package/src/components/atoms/layouts/Stack.js +2 -0
- package/src/components/atoms/layouts/Stack.styled.js +2 -0
- 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 +59 -25
- package/src/components/molecules/contact-card/ContactCard.stories.js +4 -0
- package/src/components/molecules/contact-card/ContactCard.styled.js +20 -23
- package/src/components/molecules/index.js +0 -1
- package/src/util/general.js +0 -36
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/molecules/registration-banner/RegistrationBanner.js +0 -112
- package/src/components/molecules/registration-banner/RegistrationBanner.mdx +0 -15
- package/src/components/molecules/registration-banner/RegistrationBanner.stories.js +0 -80
- package/src/components/molecules/registration-banner/RegistrationBanner.styled.js +0 -43
- package/src/components/molecules/registration-banner/RegistrationBanner.theme.js +0 -11
- package/src/components/molecules/registration-banner/index.d.ts +0 -15
- package/src/components/molecules/registration-banner/index.js +0 -3
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
|
|
3
|
-
const ExternalLinkIcon = ({ linkColor, text }) => (
|
|
3
|
+
const ExternalLinkIcon = ({ linkColor, text, ariaLabel = "External Link" }) => (
|
|
4
4
|
<svg
|
|
5
5
|
width="14"
|
|
6
6
|
height="14"
|
|
7
7
|
viewBox="0 0 14 14"
|
|
8
8
|
fill="none"
|
|
9
9
|
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
aria-label={ariaLabel}
|
|
10
11
|
>
|
|
11
12
|
<path
|
|
12
13
|
fillRule="evenodd"
|
|
@@ -19,6 +19,7 @@ const Stack = ({
|
|
|
19
19
|
children,
|
|
20
20
|
direction = "column",
|
|
21
21
|
justify,
|
|
22
|
+
extraStyles,
|
|
22
23
|
...rest
|
|
23
24
|
}) => (
|
|
24
25
|
<StackWrapper
|
|
@@ -27,6 +28,7 @@ const Stack = ({
|
|
|
27
28
|
fullHeight={fullHeight}
|
|
28
29
|
direction={direction}
|
|
29
30
|
justify={justify}
|
|
31
|
+
extraStyles={extraStyles}
|
|
30
32
|
{...rest}
|
|
31
33
|
>
|
|
32
34
|
{safeChildren(children, <Fragment />)}
|
|
@@ -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 {
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
import React, { useContext } from "react";
|
|
2
|
+
import * as R from "ramda";
|
|
2
3
|
import { Box, Stack } from "../../atoms/layouts";
|
|
3
|
-
import { ExternalLink } from "../../atoms";
|
|
4
|
+
import { ExternalLink, InternalLink } from "../../atoms";
|
|
4
5
|
import { ThemeContext } from "styled-components";
|
|
5
6
|
import * as Styled from "./ContactCard.styled";
|
|
6
7
|
import { createIdFromString } from "../../../util/general";
|
|
7
|
-
import {
|
|
8
|
+
import {
|
|
9
|
+
FONT_SIZE,
|
|
10
|
+
FONT_WEIGHT_SEMIBOLD
|
|
11
|
+
} from "../../../constants/style_constants";
|
|
8
12
|
import ExternalLinkIcon from "../../atoms/icons/ExternalLinkIcon";
|
|
9
13
|
import SolidDivider from "../../atoms/solid-divider";
|
|
10
|
-
import { ROYAL_BLUE_VIVID } from "../../../constants/colors";
|
|
14
|
+
import { ROYAL_BLUE_VIVID, WHITE } from "../../../constants/colors";
|
|
11
15
|
import { createThemeValues } from "../../../util/themeUtils";
|
|
16
|
+
import { TextWrapStyles } from "./ContactCard.styled";
|
|
17
|
+
import { URL_TEST } from "../../../constants/regex_constants";
|
|
12
18
|
|
|
13
19
|
const ContactCard = ({
|
|
14
20
|
title,
|
|
@@ -33,9 +39,10 @@ const ContactCard = ({
|
|
|
33
39
|
return (
|
|
34
40
|
<Styled.Container
|
|
35
41
|
borderRadius="8px"
|
|
42
|
+
background={WHITE}
|
|
36
43
|
boxShadow="0px 2px 4px rgba(0, 0, 0, 0.25)"
|
|
37
44
|
dataQa={createIdFromString(title, "contact-card")}
|
|
38
|
-
maxWidth=
|
|
45
|
+
maxWidth="100%"
|
|
39
46
|
minWidth={isMobile ? "240px" : "208px"}
|
|
40
47
|
minHeight="141px"
|
|
41
48
|
padding="1.5rem"
|
|
@@ -55,6 +62,7 @@ const ContactCard = ({
|
|
|
55
62
|
variant={titleVariant}
|
|
56
63
|
margin={0}
|
|
57
64
|
fontSize={FONT_SIZE.MD}
|
|
65
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
58
66
|
>
|
|
59
67
|
{title}
|
|
60
68
|
</Styled.Title>
|
|
@@ -77,13 +85,14 @@ const ContactCard = ({
|
|
|
77
85
|
variant={titleVariant}
|
|
78
86
|
margin={0}
|
|
79
87
|
fontSize={FONT_SIZE.MD}
|
|
88
|
+
weight={FONT_WEIGHT_SEMIBOLD}
|
|
80
89
|
>
|
|
81
90
|
{secondTitle}
|
|
82
91
|
</Styled.Title>
|
|
83
92
|
<Stack
|
|
84
93
|
childGap={"4px"}
|
|
85
94
|
justify="space-between"
|
|
86
|
-
|
|
95
|
+
extraStyles={`width: 100%;`}
|
|
87
96
|
fullHeight
|
|
88
97
|
>
|
|
89
98
|
{links.map(link => {
|
|
@@ -92,26 +101,51 @@ const ContactCard = ({
|
|
|
92
101
|
"contact-card-link"
|
|
93
102
|
);
|
|
94
103
|
return (
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
104
|
+
<>
|
|
105
|
+
{R.test(URL_TEST, link.link) ? (
|
|
106
|
+
<ExternalLink
|
|
107
|
+
key={linkID}
|
|
108
|
+
dataQa={linkID}
|
|
109
|
+
href={link.link}
|
|
110
|
+
newTab={true}
|
|
111
|
+
isUnderlined={false}
|
|
112
|
+
extraStyles={`
|
|
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
|
+
`}
|
|
120
|
+
size={FONT_SIZE.SM}
|
|
121
|
+
lineHeight="1.313rem"
|
|
122
|
+
>
|
|
123
|
+
{link.text}
|
|
124
|
+
<ExternalLinkIcon
|
|
125
|
+
linkColor={linkThemeValues.externalLinkColor}
|
|
126
|
+
text={link.text}
|
|
127
|
+
ariaLabel="(Opens in a new tab)"
|
|
128
|
+
/>
|
|
129
|
+
</ExternalLink>
|
|
130
|
+
) : (
|
|
131
|
+
<InternalLink
|
|
132
|
+
key={linkID}
|
|
133
|
+
to={link.link}
|
|
134
|
+
dataQa={linkID}
|
|
135
|
+
fontSize={FONT_SIZE.SM}
|
|
136
|
+
color={linkThemeValues.externalLinkColor}
|
|
137
|
+
isUnderlined={false}
|
|
138
|
+
active={false}
|
|
139
|
+
lineheight="1.313rem"
|
|
140
|
+
extraStyles={`
|
|
141
|
+
word-break: break-word;
|
|
142
|
+
${TextWrapStyles}
|
|
143
|
+
`}
|
|
144
|
+
>
|
|
145
|
+
{link.text}
|
|
146
|
+
</InternalLink>
|
|
147
|
+
)}
|
|
148
|
+
</>
|
|
115
149
|
);
|
|
116
150
|
})}
|
|
117
151
|
</Stack>
|
|
@@ -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/"
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import styled from "styled-components";
|
|
1
|
+
import styled, { css } from "styled-components";
|
|
2
2
|
import Heading from "../../atoms/heading";
|
|
3
|
-
import Stack from "../../atoms/layouts/Stack";
|
|
4
3
|
import { Box } from "../../atoms/layouts";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import { FONT_SIZE } from "../../../constants/style_constants";
|
|
5
|
+
|
|
6
|
+
export const TextWrapStyles = css`
|
|
7
|
+
word-wrap: break-word;
|
|
8
|
+
overflow-wrap: break-word;
|
|
9
|
+
white-space: normal;
|
|
10
|
+
max-width: 100%;
|
|
11
|
+
`;
|
|
9
12
|
|
|
10
13
|
export const Container = styled(Box)`
|
|
11
14
|
height: fit-content;
|
|
@@ -15,33 +18,27 @@ export const Container = styled(Box)`
|
|
|
15
18
|
align-items: flex-start;
|
|
16
19
|
gap: 1.5rem;
|
|
17
20
|
border-radius: 8px;
|
|
21
|
+
${({ extraStyles }) => extraStyles}
|
|
18
22
|
`;
|
|
19
23
|
|
|
20
24
|
export const Title = styled(Heading)`
|
|
21
|
-
|
|
22
|
-
-webkit-box-orient: vertical;
|
|
23
|
-
-webkit-line-clamp: 2;
|
|
24
|
-
align-self: stretch;
|
|
25
|
-
overflow: hidden;
|
|
26
|
-
text-overflow: ellipsis;
|
|
27
|
-
background-color: transparent;
|
|
28
|
-
font-weight: ${FONT_WEIGHT_SEMIBOLD};
|
|
25
|
+
${TextWrapStyles}
|
|
29
26
|
`;
|
|
30
27
|
|
|
31
28
|
export const Content = styled(Box)`
|
|
29
|
+
word-break: break-word;
|
|
32
30
|
padding: 0;
|
|
33
31
|
font-size: ${FONT_SIZE.SM};
|
|
34
32
|
line-height: 1.313rem;
|
|
35
|
-
overflow-wrap: normal;
|
|
36
33
|
letter-spacing: 0.14px;
|
|
37
|
-
|
|
34
|
+
${TextWrapStyles}
|
|
38
35
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
36
|
+
p {
|
|
37
|
+
margin: 0;
|
|
38
|
+
}
|
|
42
39
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
p,
|
|
41
|
+
span {
|
|
42
|
+
line-height: 1.313rem;
|
|
43
|
+
}
|
|
47
44
|
`;
|
|
@@ -29,7 +29,6 @@ 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";
|
|
33
32
|
export { default as RegistrationForm } from "./registration-form";
|
|
34
33
|
export { default as ResetConfirmationForm } from "./reset-confirmation-form";
|
|
35
34
|
export { default as ResetPasswordForm } from "./reset-password-form";
|
package/src/util/general.js
CHANGED
|
@@ -213,39 +213,3 @@ export const adjustHexColor = (hex, percent, action) => {
|
|
|
213
213
|
.slice(1)
|
|
214
214
|
.padStart(6, "0")}`;
|
|
215
215
|
};
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Converts a hex color code to an RGBA color string with the specified alpha value.
|
|
219
|
-
*
|
|
220
|
-
* @param {string} hex - The hex color code (e.g., "#3498db" or "3498db").
|
|
221
|
-
* @param {number} alpha - The alpha value (opacity) between 0 and 1.
|
|
222
|
-
* @returns {string} - The RGBA color string (e.g., "rgba(52, 152, 219, 0.5)").
|
|
223
|
-
* @throws {Error} - Throws an error if the hex code is not a valid 3 or 6-digit hex color.
|
|
224
|
-
*/
|
|
225
|
-
export const hexToRGBA = (hex, alpha) => {
|
|
226
|
-
// Remove hash at the start if present
|
|
227
|
-
hex = hex.replace(/^\s*#/, "");
|
|
228
|
-
|
|
229
|
-
// If hex is 3 characters, convert it to 6 characters.
|
|
230
|
-
if (hex.length === 3) {
|
|
231
|
-
hex = hex
|
|
232
|
-
.split("")
|
|
233
|
-
.map(char => char + char)
|
|
234
|
-
.join("");
|
|
235
|
-
}
|
|
236
|
-
|
|
237
|
-
// Validate hex length
|
|
238
|
-
if (hex.length !== 6) {
|
|
239
|
-
throw new Error(
|
|
240
|
-
"Invalid hex color provided. Expected a 3 or 6-digit hex color."
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
// Parse the hex color components
|
|
245
|
-
const bigint = parseInt(hex, 16);
|
|
246
|
-
const r = (bigint >> 16) & 255;
|
|
247
|
-
const g = (bigint >> 8) & 255;
|
|
248
|
-
const b = bigint & 255;
|
|
249
|
-
|
|
250
|
-
return `rgba(${r}, ${g}, ${b}, ${alpha})`;
|
|
251
|
-
};
|
|
Binary file
|
|
@@ -1,112 +0,0 @@
|
|
|
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
|
-
role="banner"
|
|
33
|
-
aria-label="Registration Banner"
|
|
34
|
-
justify="center"
|
|
35
|
-
>
|
|
36
|
-
<Styled.ContentContainer
|
|
37
|
-
role="main"
|
|
38
|
-
align="center"
|
|
39
|
-
justify="space-between"
|
|
40
|
-
overflow="visible"
|
|
41
|
-
isMobile={isMobile}
|
|
42
|
-
>
|
|
43
|
-
<Box padding="0" textAlign="left">
|
|
44
|
-
<Heading
|
|
45
|
-
as={titleAs}
|
|
46
|
-
color={themeValues.primaryColor}
|
|
47
|
-
fontSize={isMobile ? FONT_SIZE.XL : "1.5rem"}
|
|
48
|
-
variant={titleVariant}
|
|
49
|
-
weight={FONT_WEIGHT_SEMIBOLD}
|
|
50
|
-
>
|
|
51
|
-
Register for a {clientName} Wallet Account
|
|
52
|
-
</Heading>
|
|
53
|
-
<Text
|
|
54
|
-
extraStyles={`
|
|
55
|
-
display: block;
|
|
56
|
-
padding: ${isMobile ? ".125rem 0 1rem" : "0"}
|
|
57
|
-
`}
|
|
58
|
-
fontSize={isMobile ? FONT_SIZE.SM : FONT_SIZE.LG}
|
|
59
|
-
color={themeValues.secondaryColor}
|
|
60
|
-
>
|
|
61
|
-
Save payment methods and information for fast, easy, and safe
|
|
62
|
-
payments with {clientName}
|
|
63
|
-
</Text>
|
|
64
|
-
</Box>
|
|
65
|
-
<Styled.ButtonContainer
|
|
66
|
-
justify="space-between"
|
|
67
|
-
fullHeight
|
|
68
|
-
childGap="0.5rem"
|
|
69
|
-
isMobile={isMobile}
|
|
70
|
-
>
|
|
71
|
-
<Styled.RegisterLink
|
|
72
|
-
variant="secondary"
|
|
73
|
-
color={themeValues.primaryColor}
|
|
74
|
-
contentOverride
|
|
75
|
-
fontWeight={FONT_WEIGHT_SEMIBOLD}
|
|
76
|
-
url={registrationLink}
|
|
77
|
-
>
|
|
78
|
-
<Cluster justify="center" align="center">
|
|
79
|
-
<Text
|
|
80
|
-
extraStyles="margin-right: 0.5rem"
|
|
81
|
-
fontSize={isMobile ? FONT_SIZE.MD : FONT_SIZE.LG}
|
|
82
|
-
color={themeValues.primaryColor}
|
|
83
|
-
weight={FONT_WEIGHT_SEMIBOLD}
|
|
84
|
-
>
|
|
85
|
-
Register Now
|
|
86
|
-
</Text>
|
|
87
|
-
<ArrowRightIcon />
|
|
88
|
-
</Cluster>
|
|
89
|
-
</Styled.RegisterLink>
|
|
90
|
-
<Styled.LoginLink
|
|
91
|
-
text="Log In"
|
|
92
|
-
variant="secondary"
|
|
93
|
-
contentOverride
|
|
94
|
-
url={loginLink}
|
|
95
|
-
>
|
|
96
|
-
<Text
|
|
97
|
-
fontSize={isMobile ? FONT_SIZE.SM : FONT_SIZE.MD}
|
|
98
|
-
color={themeValues.primaryColor}
|
|
99
|
-
weight={FONT_WEIGHT_SEMIBOLD}
|
|
100
|
-
>
|
|
101
|
-
or Log In
|
|
102
|
-
</Text>
|
|
103
|
-
</Styled.LoginLink>
|
|
104
|
-
</Styled.ButtonContainer>
|
|
105
|
-
</Styled.ContentContainer>
|
|
106
|
-
</Styled.BannerContainer>
|
|
107
|
-
);
|
|
108
|
-
};
|
|
109
|
-
|
|
110
|
-
export default withWindowSize(
|
|
111
|
-
themeComponent(RegistrationBanner, "RegistrationBanner", fallbackValues)
|
|
112
|
-
);
|
|
@@ -1,15 +0,0 @@
|
|
|
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 />
|
|
@@ -1,80 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,43 +0,0 @@
|
|
|
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 { hexToRGBA } from "../../../util/general";
|
|
5
|
-
|
|
6
|
-
export const BannerContainer = styled(Cluster)`
|
|
7
|
-
background: ${({ themeValues }) => hexToRGBA(themeValues.background, 0.9)};
|
|
8
|
-
padding: ${({ isMobile }) => (isMobile ? "1rem 2rem" : " 2rem 8.25rem")};
|
|
9
|
-
`;
|
|
10
|
-
|
|
11
|
-
export const ContentContainer = styled(Cluster)`
|
|
12
|
-
padding: 0;
|
|
13
|
-
width: ${({ isMobile }) => (isMobile ? "296px" : " 1176px")};
|
|
14
|
-
> div {
|
|
15
|
-
flex-direction: ${({ isMobile }) => (isMobile ? "column" : "row")};
|
|
16
|
-
}
|
|
17
|
-
`;
|
|
18
|
-
|
|
19
|
-
export const ButtonContainer = styled(Stack)`
|
|
20
|
-
align-items: center;
|
|
21
|
-
> a {
|
|
22
|
-
width: ${({ isMobile }) => (isMobile ? "296px" : "222px")};
|
|
23
|
-
}
|
|
24
|
-
`;
|
|
25
|
-
|
|
26
|
-
export const RegisterLink = styled(ButtonWithLink)`
|
|
27
|
-
border-radius: 100px;
|
|
28
|
-
margin: 0;
|
|
29
|
-
width: 100%;
|
|
30
|
-
`;
|
|
31
|
-
|
|
32
|
-
export const LoginLink = styled(ButtonWithLink)`
|
|
33
|
-
border-radius: 100px;
|
|
34
|
-
padding: 0;
|
|
35
|
-
margin: 0;
|
|
36
|
-
width: 100%;
|
|
37
|
-
min-height: 2rem;
|
|
38
|
-
margin-top: 0px;
|
|
39
|
-
border: none;
|
|
40
|
-
&:hover {
|
|
41
|
-
text-decoration: none;
|
|
42
|
-
}
|
|
43
|
-
`;
|
|
@@ -1,15 +0,0 @@
|
|
|
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>>;
|