@thecb/components 11.2.4-beta.1 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "11.2.4-beta.1",
3
+ "version": "11.2.4",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -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 balance has been paid and was removed from the system, or that there was an error loading it. .${
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,11 @@
1
+ import {
2
+ CHARADE_GREY,
3
+ CORNFLOWER_BLUE,
4
+ ROYAL_BLUE_VIVID
5
+ } from "../../../constants/colors";
6
+
7
+ export const fallbackValues = {
8
+ primaryColor: ROYAL_BLUE_VIVID,
9
+ secondaryColor: CHARADE_GREY,
10
+ background: CORNFLOWER_BLUE
11
+ };
@@ -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>>;
@@ -0,0 +1,3 @@
1
+ import RegistrationBanner from "./RegistrationBanner";
2
+
3
+ export default RegistrationBanner;