@thecb/components 10.2.3 → 10.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.
Files changed (27) hide show
  1. package/dist/index.cjs.js +2875 -3214
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +1 -28
  4. package/dist/index.esm.js +2876 -3212
  5. package/dist/index.esm.js.map +1 -1
  6. package/dist/src/apps/checkout/pages/payment/sub-pages/payment-amount/PaymentAmount_old.js +49322 -0
  7. package/package.json +1 -1
  8. package/src/.DS_Store +0 -0
  9. package/src/components/.DS_Store +0 -0
  10. package/src/components/atoms/.DS_Store +0 -0
  11. package/src/components/atoms/button-with-action/ButtonWithAction.js +3 -1
  12. package/src/components/atoms/icons/.DS_Store +0 -0
  13. package/src/components/atoms/icons/icons.stories.js +1 -5
  14. package/src/components/atoms/icons/index.d.ts +0 -2
  15. package/src/components/atoms/icons/index.js +1 -5
  16. package/src/components/atoms/placeholder/Placeholder.js +15 -6
  17. package/src/components/atoms/placeholder/Placeholder.stories.js +22 -9
  18. package/src/components/molecules/index.d.ts +0 -1
  19. package/src/components/molecules/index.js +0 -1
  20. package/src/components/molecules/obligation/Obligation.js +4 -1
  21. package/src/components/molecules/obligation/modules/AutopayModalModule.js +4 -1
  22. package/src/components/molecules/obligation/modules/PaymentDetailsActions.js +5 -1
  23. package/src/components/templates/default-page-template/DefaultPageTemplate.js +2 -3
  24. package/src/components/atoms/icons/CloseIcon.d.ts +0 -1
  25. package/src/components/atoms/icons/CloseIcon.js +0 -48
  26. package/src/components/atoms/icons/TrashIconV2.d.ts +0 -1
  27. package/src/components/atoms/icons/TrashIconV2.js +0 -41
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "10.2.3",
3
+ "version": "10.2.4-beta.1",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
package/src/.DS_Store CHANGED
Binary file
Binary file
Binary file
@@ -155,7 +155,9 @@ const ButtonWithAction = forwardRef(
155
155
  variant={themeValues.fontSizeVariant}
156
156
  color={themeValues.color}
157
157
  textWrap={textWrap}
158
- extraStyles={textExtraStyles}
158
+ extraStyles={
159
+ disabled ? textExtraStyles + disabledStyles : textExtraStyles
160
+ }
159
161
  >
160
162
  {text}
161
163
  </Text>
@@ -40,9 +40,7 @@ import {
40
40
  StatusUnknownIcon,
41
41
  AutopayIcon,
42
42
  KebabMenuIcon,
43
- MultiCartIcon,
44
- CloseIcon,
45
- TrashIconV2
43
+ MultiCartIcon
46
44
  } from "./index";
47
45
 
48
46
  const story = page({
@@ -90,5 +88,3 @@ export const statusUnknownIcon = () => <StatusUnknownIcon />;
90
88
  export const autopayIcon = () => <AutopayIcon />;
91
89
  export const kebabMenuIcon = () => <KebabMenuIcon />;
92
90
  export const multiCartIcon = () => <MultiCartIcon />;
93
- export const closeIcon = () => <CloseIcon />;
94
- export const trashIconV2 = () => <TrashIconV2 />;
@@ -23,5 +23,3 @@ export * from "./XCircleIconMedium";
23
23
  export * from "./XCircleIconSmall";
24
24
  export * from "./KebabMenuIcon";
25
25
  export * from "./MultiCartIcon";
26
- export * from "./CloseIcon";
27
- export * from "./TrashIconV2";
@@ -88,8 +88,6 @@ import ChargebackReversalIconMedium from "./ChargebackReversalIconMedium";
88
88
  import PlusCircleIcon from "./PlusCircleIcon";
89
89
  import KebabMenuIcon from "./KebabMenuIcon";
90
90
  import MultiCartIcon from "./MultiCartIcon";
91
- import CloseIcon from "./CloseIcon";
92
- import TrashIconV2 from "./TrashIconV2";
93
91
 
94
92
  export {
95
93
  AccountsIcon,
@@ -181,7 +179,5 @@ export {
181
179
  ChargebackReversalIconMedium,
182
180
  PlusCircleIcon,
183
181
  KebabMenuIcon,
184
- MultiCartIcon,
185
- CloseIcon,
186
- TrashIconV2
182
+ MultiCartIcon
187
183
  };
@@ -17,6 +17,7 @@ import {
17
17
  PaymentMethodAddIcon
18
18
  } from "../icons";
19
19
  import { FONT_WEIGHT_REGULAR } from "../../../constants/style_constants";
20
+ import { noop } from "../../../util/general";
20
21
 
21
22
  const getLargeIcon = iconName => {
22
23
  switch (iconName) {
@@ -36,21 +37,27 @@ const PlaceholderContentWrapper = ({
36
37
  action,
37
38
  destination,
38
39
  children,
39
- dataQa
40
+ dataQa,
41
+ disabled = false
40
42
  }) =>
41
43
  isLink ? (
42
- <Link to={destination} data-qa={dataQa}>
44
+ <Link to={destination} data-qa={dataQa} disabled={disabled}>
43
45
  <Box padding="0" minHeight="100%" extraStyles={`cursor: pointer;`}>
44
46
  {children}
45
47
  </Box>
46
48
  </Link>
47
49
  ) : (
48
50
  <Box
49
- onClick={action}
51
+ onClick={disabled ? noop : action}
50
52
  padding="0"
51
53
  minHeight="100%"
52
- extraStyles={`cursor: pointer;`}
53
54
  dataQa={dataQa}
55
+ aria-disabled={disabled}
56
+ extraStyles={
57
+ disabled
58
+ ? "cursor: default; opacity: 0.7;"
59
+ : "cursor: pointer; opacity: 1;"
60
+ }
54
61
  >
55
62
  {children}
56
63
  </Box>
@@ -65,13 +72,15 @@ const Placeholder = ({
65
72
  variant,
66
73
  largeIcon,
67
74
  themeValues,
68
- dataQa
75
+ dataQa,
76
+ disabled = false
69
77
  }) => (
70
78
  <PlaceholderContentWrapper
71
79
  isLink={isLink}
72
80
  action={action}
73
81
  destination={destination}
74
82
  dataQa={dataQa}
83
+ disabled={disabled}
75
84
  >
76
85
  <Box
77
86
  padding="0"
@@ -108,7 +117,7 @@ const Placeholder = ({
108
117
  <Box
109
118
  padding="0"
110
119
  tabIndex="0"
111
- onKeyPress={e => e.key === "Enter" && action()}
120
+ onKeyPress={e => e.key === "Enter" && !disabled && action()}
112
121
  >
113
122
  <Cluster justify="center" align="center" minHeight="100%">
114
123
  <Switcher maxChildren={2} childGap="0">
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { text, select } from "@storybook/addon-knobs";
2
+ import { text, select, boolean } from "@storybook/addon-knobs";
3
3
  import Placeholder from "./Placeholder";
4
4
  import page from "../../../../.storybook/page";
5
5
 
@@ -21,14 +21,27 @@ const iconLabel = "largeIcon";
21
21
  const defaultIcon = "accounts";
22
22
 
23
23
  export const placeholder = () => (
24
- <Placeholder
25
- variant={select(variantsLabel, variants, defaultValue, groupId)}
26
- isLink
27
- destination={text("destination", "add-account", "props")}
28
- text={text("text", "Add an Account", "props")}
29
- largeIcon={select(iconLabel, icons, defaultIcon, groupId)}
30
- key="placeholder"
31
- />
24
+ <>
25
+ <h2>Placeholder w/Link</h2>
26
+ <Placeholder
27
+ variant={select(variantsLabel, variants, defaultValue, groupId)}
28
+ isLink
29
+ destination={text("destination", "/", "props")}
30
+ text={text("text", "Add an Account", "props")}
31
+ largeIcon={select(iconLabel, icons, defaultIcon, groupId)}
32
+ key="placeholder1"
33
+ disabled={boolean("disabled", false, groupId)}
34
+ />
35
+ <h2>Placeholder w/Action</h2>
36
+ <Placeholder
37
+ variant={select(variantsLabel, variants, defaultValue, groupId)}
38
+ text={text("text", "Add an Account", "props")}
39
+ largeIcon={select(iconLabel, icons, defaultIcon, groupId)}
40
+ key="placeholder2"
41
+ disabled={boolean("disabled", false, groupId)}
42
+ action={() => window.alert("Click event registered!")}
43
+ />
44
+ </>
32
45
  );
33
46
 
34
47
  const story = page({
@@ -5,4 +5,3 @@ export * from "./footer-with-subfooter";
5
5
  export * from "./popover";
6
6
  export * from "./radio-group";
7
7
  export * from "./toast-notification";
8
- export * from "./popup-menu";
@@ -40,4 +40,3 @@ export { default as Timeout } from "./timeout";
40
40
  export { default as ToastNotification } from "./toast-notification";
41
41
  export { default as WelcomeModule } from "./welcome-module";
42
42
  export { default as WorkflowTile } from "./workflow-tile";
43
- export { default as PopupMenu } from "./popup-menu";
@@ -36,7 +36,8 @@ const Obligation = ({
36
36
  inactive = false,
37
37
  inactiveLookupTitle = "",
38
38
  inactiveLookupInput = "Account",
39
- inactiveLookupValue = ""
39
+ inactiveLookupValue = "",
40
+ isInCustomerManagement = false
40
41
  }) => {
41
42
  /*
42
43
  The value of obligations is always an array. It can contain:
@@ -137,6 +138,7 @@ const Obligation = ({
137
138
  description={description}
138
139
  subDescription={subDescription}
139
140
  allowedPaymentInstruments={allowedPaymentInstruments}
141
+ isInCustomerManagement={isInCustomerManagement}
140
142
  />
141
143
  )}
142
144
  </Stack>
@@ -160,6 +162,7 @@ const Obligation = ({
160
162
  description={description}
161
163
  subDescription={subDescription}
162
164
  allowedPaymentInstruments={allowedPaymentInstruments}
165
+ isInCustomerManagement={isInCustomerManagement}
163
166
  />
164
167
  )}
165
168
  </Box>
@@ -27,7 +27,8 @@ const AutopayModal = ({
27
27
  inactive,
28
28
  description,
29
29
  subDescription,
30
- allowedPaymentInstruments
30
+ allowedPaymentInstruments,
31
+ isInCustomerManagement = false
31
32
  }) => {
32
33
  const generateMethodNeededText = (planText, allowedPaymentInstruments) => {
33
34
  const allowsCard = allowedPaymentInstruments.includes(CC_METHOD);
@@ -80,6 +81,7 @@ const AutopayModal = ({
80
81
  case "secondary": {
81
82
  return (
82
83
  <ButtonWithAction
84
+ disabled={isInCustomerManagement}
83
85
  text={
84
86
  autoPayActive ? `Turn off ${shortPlan}` : `Set Up ${shortPlan}`
85
87
  }
@@ -99,6 +101,7 @@ const AutopayModal = ({
99
101
  case "tertiary": {
100
102
  return (
101
103
  <ButtonWithAction
104
+ disabled={isInCustomerManagement}
102
105
  text={autoPayActive ? `Manage ${shortPlan}` : `Set Up ${shortPlan}`}
103
106
  variant="tertiary"
104
107
  action={() => {
@@ -23,7 +23,8 @@ const PaymentDetailsActions = ({
23
23
  dueDate,
24
24
  description,
25
25
  subDescription,
26
- allowedPaymentInstruments
26
+ allowedPaymentInstruments,
27
+ isInCustomerManagement = false
27
28
  }) => {
28
29
  const planType = isPaymentPlan ? "Payment Plan" : "Autopay";
29
30
  const [isLoading, setIsLoading] = useState(false);
@@ -119,6 +120,7 @@ const PaymentDetailsActions = ({
119
120
  }}
120
121
  dataQa="Set Up Autopay"
121
122
  extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
123
+ disabled={isInCustomerManagement}
122
124
  />
123
125
  ) : (
124
126
  <AutopayModalModule
@@ -148,6 +150,7 @@ const PaymentDetailsActions = ({
148
150
  text="Pay Now"
149
151
  variant={isMobile ? "smallSecondary" : "secondary"}
150
152
  dataQa="Pay Now"
153
+ disabled={isInCustomerManagement}
151
154
  />
152
155
  </Box>
153
156
  )}
@@ -161,6 +164,7 @@ const PaymentDetailsActions = ({
161
164
  variant={isMobile ? "smallSecondary" : "secondary"}
162
165
  dataQa="Pay Now"
163
166
  extraStyles={isMobile && `flex-grow: 1; width: 100%; margin: 0;`}
167
+ disabled={isInCustomerManagement}
164
168
  />
165
169
  </Box>
166
170
  )}
@@ -15,8 +15,7 @@ const CenterSingle = ({
15
15
  themeValues,
16
16
  maxWidth = "75rem",
17
17
  gutters = "2rem",
18
- fillPageVertical = false,
19
- background = COOL_GREY_05
18
+ fillPageVertical = false
20
19
  }) => {
21
20
  const themeContext = useContext(ThemeContext);
22
21
  const { isMobile } = themeContext;
@@ -25,7 +24,7 @@ const CenterSingle = ({
25
24
  <Box
26
25
  padding="0"
27
26
  minWidth="100%"
28
- background={background}
27
+ background={COOL_GREY_05}
29
28
  extraStyles="flex-grow: 1;"
30
29
  >
31
30
  <Cover
@@ -1 +0,0 @@
1
- export const CloseIcon: JSX.Element;
@@ -1,48 +0,0 @@
1
- import React from "react";
2
-
3
- export const CloseIcon = ({
4
- iconFill = "#3B414D",
5
- iconWidth = "24",
6
- iconHeight = "24",
7
- ...rest
8
- }) => {
9
- return (
10
- <svg
11
- xmlns="http://www.w3.org/2000/svg"
12
- width={iconWidth}
13
- height={iconHeight}
14
- viewBox="0 0 24 24"
15
- fill="none"
16
- {...rest}
17
- >
18
- <title>Close Icon</title>
19
- <path
20
- fillRule="evenodd"
21
- clipRule="evenodd"
22
- d="M17.3033 5.98982C17.108 5.79456 16.7915 5.79456 16.5962 5.98982L12 10.586L7.40381 5.98982C7.20854 5.79456 6.89196 5.79456 6.6967 5.98982L5.98959 6.69693C5.79433 6.89219 5.79433 7.20878 5.98959 7.40404L10.5858 12.0002L5.98959 16.5964C5.79433 16.7917 5.79433 17.1083 5.98959 17.3035L6.6967 18.0106C6.89196 18.2059 7.20854 18.2059 7.40381 18.0106L12 13.4144L16.5962 18.0106C16.7915 18.2059 17.108 18.2059 17.3033 18.0106L18.0104 17.3035C18.2057 17.1083 18.2057 16.7917 18.0104 16.5964L13.4142 12.0002L18.0104 7.40404C18.2057 7.20878 18.2057 6.89219 18.0104 6.69693L17.3033 5.98982Z"
23
- fill={iconFill}
24
- />
25
- <mask
26
- id="mask0_3727_16765"
27
- style={{ maskType: "luminance" }}
28
- maskUnits="userSpaceOnUse"
29
- x="5"
30
- y="5"
31
- width="14"
32
- height="14"
33
- >
34
- <path
35
- fillRule="evenodd"
36
- clipRule="evenodd"
37
- d="M17.3033 5.98982C17.108 5.79456 16.7915 5.79456 16.5962 5.98982L12 10.586L7.40381 5.98982C7.20854 5.79456 6.89196 5.79456 6.6967 5.98982L5.98959 6.69693C5.79433 6.89219 5.79433 7.20878 5.98959 7.40404L10.5858 12.0002L5.98959 16.5964C5.79433 16.7917 5.79433 17.1083 5.98959 17.3035L6.6967 18.0106C6.89196 18.2059 7.20854 18.2059 7.40381 18.0106L12 13.4144L16.5962 18.0106C16.7915 18.2059 17.108 18.2059 17.3033 18.0106L18.0104 17.3035C18.2057 17.1083 18.2057 16.7917 18.0104 16.5964L13.4142 12.0002L18.0104 7.40404C18.2057 7.20878 18.2057 6.89219 18.0104 6.69693L17.3033 5.98982Z"
38
- fill="none"
39
- />
40
- </mask>
41
- <g mask="url(#mask0_3727_16765)">
42
- <path d="M0 0H24V24H0V0Z" fill={iconFill} />
43
- </g>
44
- </svg>
45
- );
46
- };
47
-
48
- export default CloseIcon;
@@ -1 +0,0 @@
1
- export const TrashIconV2: JSX.Element;
@@ -1,41 +0,0 @@
1
- import React from "react";
2
- import { fallbackValues } from "./Icons.theme";
3
- import { themeComponent } from "../../../util/themeUtils";
4
-
5
- const TrashIconV2 = ({ themeValues, iconFill }) => {
6
- return (
7
- <svg
8
- xmlns="http://www.w3.org/2000/svg"
9
- width="18"
10
- height="18"
11
- viewBox="0 0 18 18"
12
- fill="none"
13
- >
14
- <path
15
- fillRule="evenodd"
16
- clipRule="evenodd"
17
- d="M11.5 4H14V6H4V4H6.5L7.21429 3H10.7857L11.5 4ZM6.99048 15C6.25714 15 5.65714 14.4857 5.65714 13.8571L4.85714 7H12.8571L12.0571 13.8571C12.0571 14.4857 11.4571 15 10.7238 15H6.99048Z"
18
- fill={iconFill ?? themeValues.singleIconColor}
19
- />
20
- <mask
21
- id="mask0_4292_11876"
22
- style={{ maskType: "luminance" }}
23
- maskUnits="userSpaceOnUse"
24
- x="4"
25
- y="3"
26
- width="10"
27
- height="12"
28
- >
29
- <path
30
- fillRule="evenodd"
31
- clipRule="evenodd"
32
- d="M11.5 4H14V6H4V4H6.5L7.21429 3H10.7857L11.5 4ZM6.99048 15C6.25714 15 5.65714 14.4857 5.65714 13.8571L4.85714 7H12.8571L12.0571 13.8571C12.0571 14.4857 11.4571 15 10.7238 15H6.99048Z"
33
- fill="white"
34
- />
35
- </mask>
36
- <g mask="url(#mask0_4292_11876)"></g>
37
- </svg>
38
- );
39
- };
40
-
41
- export default themeComponent(TrashIconV2, "Icons", fallbackValues, "primary");