@thecb/components 11.2.4-beta.1 → 11.2.5-beta.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/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.5-beta.0",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
Binary file
@@ -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,111 @@
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
+ nowrap
41
+ >
42
+ <Box padding="0" textAlign="left">
43
+ <Heading
44
+ as={titleAs}
45
+ color={themeValues.primaryColor}
46
+ fontSize={isMobile ? FONT_SIZE.XL : "1.5rem"}
47
+ variant={titleVariant}
48
+ weight={FONT_WEIGHT_SEMIBOLD}
49
+ >
50
+ Register for a {clientName} Wallet Account
51
+ </Heading>
52
+ <Text
53
+ extraStyles={`
54
+ display: block;
55
+ padding: ${isMobile ? ".125rem 0 1rem" : "0"}
56
+ `}
57
+ fontSize={isMobile ? FONT_SIZE.SM : FONT_SIZE.LG}
58
+ color={themeValues.secondaryColor}
59
+ >
60
+ Save payment methods and information for fast, easy, and safe
61
+ payments with {clientName}
62
+ </Text>
63
+ </Box>
64
+ <Styled.ButtonContainer
65
+ justify="space-between"
66
+ fullHeight
67
+ childGap="0.5rem"
68
+ isMobile={isMobile}
69
+ >
70
+ <Styled.RegisterLink
71
+ variant="secondary"
72
+ color={themeValues.primaryColor}
73
+ contentOverride
74
+ fontWeight={FONT_WEIGHT_SEMIBOLD}
75
+ url={registrationLink}
76
+ >
77
+ <Cluster justify="center" align="center">
78
+ <Text
79
+ extraStyles="margin-right: 0.5rem"
80
+ fontSize={isMobile ? FONT_SIZE.MD : FONT_SIZE.LG}
81
+ color={themeValues.primaryColor}
82
+ weight={FONT_WEIGHT_SEMIBOLD}
83
+ >
84
+ Register Now
85
+ </Text>
86
+ <ArrowRightIcon />
87
+ </Cluster>
88
+ </Styled.RegisterLink>
89
+ <Styled.LoginLink
90
+ text="Log In"
91
+ variant="secondary"
92
+ contentOverride
93
+ url={loginLink}
94
+ >
95
+ <Text
96
+ fontSize={isMobile ? FONT_SIZE.SM : FONT_SIZE.MD}
97
+ color={themeValues.primaryColor}
98
+ weight={FONT_WEIGHT_SEMIBOLD}
99
+ >
100
+ or Log In
101
+ </Text>
102
+ </Styled.LoginLink>
103
+ </Styled.ButtonContainer>
104
+ </Styled.ContentContainer>
105
+ </Styled.BannerContainer>
106
+ );
107
+ };
108
+
109
+ export default withWindowSize(
110
+ themeComponent(RegistrationBanner, "RegistrationBanner", fallbackValues)
111
+ );
@@ -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,83 @@
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
+ parameters: {
78
+ layout: "fullscreen"
79
+ },
80
+ render: args => {
81
+ return <RegistrationBanner {...args} key="registration-banner-standard" />;
82
+ }
83
+ };
@@ -0,0 +1,45 @@
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 1rem")};
10
+ `;
11
+
12
+ export const ContentContainer = styled(Cluster)`
13
+ padding: 0;
14
+ width: ${({ isMobile }) => (isMobile ? "100%" : " 1224px")};
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 ? "100%" : "222px")};
24
+ }
25
+ padding-left: ${({ isMobile }) => (isMobile ? "0" : " 2rem")};
26
+ `;
27
+
28
+ export const RegisterLink = styled(ButtonWithLink)`
29
+ border-radius: 100px;
30
+ margin: 0;
31
+ width: 100%;
32
+ `;
33
+
34
+ export const LoginLink = styled(ButtonWithLink)`
35
+ border-radius: 100px;
36
+ padding: 0;
37
+ margin: 0;
38
+ width: 100%;
39
+ min-height: 2rem;
40
+ margin-top: 0px;
41
+ border: none;
42
+ &:hover {
43
+ text-decoration: none;
44
+ }
45
+ `;
@@ -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;