@thecb/components 10.3.0 → 10.4.0-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 (29) hide show
  1. package/dist/index.cjs.js +215 -107
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +215 -107
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/src/apps/checkout/pages/payment/sub-pages/payment-amount/PaymentAmount_old.js +49322 -0
  6. package/package.json +1 -1
  7. package/src/.DS_Store +0 -0
  8. package/src/components/.DS_Store +0 -0
  9. package/src/components/atoms/.DS_Store +0 -0
  10. package/src/components/atoms/badge/Badge.js +6 -2
  11. package/src/components/atoms/badge/Badge.stories.js +2 -1
  12. package/src/components/atoms/badge/Badge.theme.js +8 -4
  13. package/src/components/atoms/button-with-action/ButtonWithAction.js +27 -21
  14. package/src/components/atoms/button-with-action/ButtonWithAction.stories.js +2 -1
  15. package/src/components/atoms/button-with-action/ButtonWithAction.theme.js +52 -2
  16. package/src/components/atoms/icons/.DS_Store +0 -0
  17. package/src/components/atoms/icons/AutopayIcon.js +2 -2
  18. package/src/components/atoms/layouts/Box.js +1 -0
  19. package/src/components/atoms/layouts/examples/box-example/BoxExample.stories.js +2 -1
  20. package/src/components/atoms/placeholder/Placeholder.js +86 -73
  21. package/src/components/molecules/link-card/LinkCard.js +13 -6
  22. package/src/components/molecules/link-card/LinkCard.stories.js +64 -34
  23. package/src/components/molecules/link-card/LinkCard.styled.js +11 -4
  24. package/src/components/molecules/link-card/LinkCard.theme.js +20 -5
  25. package/src/components/molecules/obligation/Obligation.js +6 -1
  26. package/src/components/molecules/obligation/modules/AutopayModalModule.js +17 -10
  27. package/src/components/molecules/obligation/modules/InactiveControlsModule.js +6 -3
  28. package/src/components/molecules/obligation/modules/PaymentDetailsActions.js +22 -5
  29. package/src/components/molecules/obligation/modules/RemoveAccountModalModule.js +5 -3
@@ -4,6 +4,7 @@ import Paragraph from "../../atoms/paragraph";
4
4
  import Stack from "../../atoms/layouts/Stack";
5
5
  import { Box } from "../../atoms/layouts";
6
6
  import { FONT_WEIGHT_SEMIBOLD } from "../../../constants/style_constants";
7
+ import { TRANSPARENT, GHOST_GREY } from "../../../constants/colors";
7
8
 
8
9
  export const Container = styled(Box)`
9
10
  display: flex;
@@ -22,13 +23,19 @@ export const Container = styled(Box)`
22
23
 
23
24
  &:hover,
24
25
  &:active {
25
- cursor: pointer;
26
- box-shadow: 0px 0px 0px 0px rgba(41, 42, 51, 0.1),
26
+ cursor: ${({ disabled }) => (disabled ? `default` : `pointer`)};
27
+ box-shadow: ${({ disabled }) => `
28
+ ${
29
+ disabled
30
+ ? `none`
31
+ : `0px 0px 0px 0px rgba(41, 42, 51, 0.1),
27
32
  0px 5px 11px 0px rgba(41, 42, 51, 0.1),
28
33
  0px 4px 19px 0px rgba(41, 42, 51, 0.09),
29
34
  0px 27px 26px 0px rgba(41, 42, 51, 0.05),
30
35
  0px 56px 31px 0px rgba(41, 42, 51, 0.01),
31
- 0px 80px 33px 0px rgba(41, 42, 51, 0);
36
+ 0px 80px 33px 0px rgba(41, 42, 51, 0);`
37
+ }
38
+ `};
32
39
  }
33
40
 
34
41
  &:hover:not(:active) {
@@ -38,7 +45,7 @@ export const Container = styled(Box)`
38
45
  &:active {
39
46
  ${({ theme }) => `
40
47
  background-color: ${theme.activeBackgroundColor};
41
- border: 1px solid ${theme.color};
48
+ border: 1px solid ${theme.borderColor};
42
49
  ;`}
43
50
  }
44
51
  `;
@@ -2,13 +2,28 @@ import {
2
2
  CORNFLOWER_BLUE,
3
3
  LINK_WATER,
4
4
  MOON_RAKER,
5
- ROYAL_BLUE_VIVID
5
+ ROYAL_BLUE_VIVID,
6
+ MANATEE_GREY,
7
+ GHOST_GREY,
8
+ TRANSPARENT
6
9
  } from "../../../constants/colors";
7
10
 
8
- const activeBackgroundColor = CORNFLOWER_BLUE;
9
- const backgroundColor = LINK_WATER;
10
- const borderColor = MOON_RAKER;
11
- const color = ROYAL_BLUE_VIVID;
11
+ const activeBackgroundColor = {
12
+ primary: `${CORNFLOWER_BLUE}`,
13
+ disabled: `${TRANSPARENT}`
14
+ };
15
+ const backgroundColor = {
16
+ primary: `${LINK_WATER}`,
17
+ disabled: `${TRANSPARENT}`
18
+ };
19
+ const borderColor = {
20
+ primary: `${MOON_RAKER}`,
21
+ disabled: `${GHOST_GREY}`
22
+ };
23
+ const color = {
24
+ primary: `${ROYAL_BLUE_VIVID}`,
25
+ disabled: `${MANATEE_GREY}`
26
+ };
12
27
 
13
28
  export const fallbackValues = {
14
29
  activeBackgroundColor,
@@ -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>
@@ -218,6 +221,7 @@ const Obligation = ({
218
221
  description={description}
219
222
  subDescription={subDescription}
220
223
  allowedPaymentInstruments={allowedPaymentInstruments}
224
+ isInCustomerManagement={isInCustomerManagement}
221
225
  />
222
226
  )}
223
227
  </Cluster>
@@ -240,6 +244,7 @@ const Obligation = ({
240
244
  description={description}
241
245
  subDescription={subDescription}
242
246
  allowedPaymentInstruments={allowedPaymentInstruments}
247
+ isInCustomerManagement={isInCustomerManagement}
243
248
  />
244
249
  )}
245
250
  </Stack>
@@ -8,7 +8,7 @@ import { SEA_GREEN } from "../../../../constants/colors";
8
8
  import { ACH_METHOD, CC_METHOD } from "../../../../constants/general";
9
9
  import { fallbackValues } from "./AutopayModalModule.theme";
10
10
  import { themeComponent } from "../../../../util/themeUtils";
11
- import { titleCaseString } from "../../../../util/general";
11
+ import { titleCaseString, noop } from "../../../../util/general";
12
12
 
13
13
  const AutopayModal = ({
14
14
  autoPayActive,
@@ -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,10 +101,11 @@ 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
- variant="tertiary"
106
+ variant={isInCustomerManagement ? "disabledTertiary" : "tertiary"}
104
107
  action={() => {
105
- toggleModal(true);
108
+ isInCustomerManagement ? noop : toggleModal(true);
106
109
  }}
107
110
  dataQa="Manage Autopay"
108
111
  extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
@@ -114,7 +117,7 @@ const AutopayModal = ({
114
117
  <Box
115
118
  padding="0"
116
119
  onClick={() => {
117
- toggleModal(true);
120
+ isInCustomerManagement ? noop : toggleModal(true);
118
121
  }}
119
122
  hoverStyles={hoverStyles}
120
123
  activeStyles={activeStyles}
@@ -128,9 +131,13 @@ const AutopayModal = ({
128
131
  <Text
129
132
  variant="pS"
130
133
  onClick={() => toggleModal(true)}
131
- onKeyPress={e => {
132
- e.key === "Enter" && toggleModal(true);
133
- }}
134
+ onKeyPress={
135
+ isInCustomerManagement
136
+ ? noop
137
+ : e => {
138
+ e.key === "Enter" && toggleModal(true);
139
+ }
140
+ }
134
141
  tabIndex="0"
135
142
  dataQa={`${shortPlan} On`}
136
143
  color={SEA_GREEN}
@@ -148,8 +155,8 @@ const AutopayModal = ({
148
155
  };
149
156
  return (
150
157
  <Modal
151
- showModal={() => toggleModal(true)}
152
- hideModal={() => toggleModal(false)}
158
+ showModal={isInCustomerManagement ? noop : () => toggleModal(true)}
159
+ hideModal={isInCustomerManagement ? noop : () => toggleModal(false)}
153
160
  modalOpen={modalOpen}
154
161
  {...modalExtraProps}
155
162
  >
@@ -1,9 +1,9 @@
1
1
  import React, { useState } from "react";
2
2
  import { GHOST_GREY } from "../../../../constants/colors";
3
- import ButtonWithAction from "../../../atoms/button-with-action";
4
3
  import { Box, Cluster } from "../../../atoms/layouts";
5
4
  import { AutopayModalModule } from "./AutopayModalModule";
6
5
  import RemoveAccountModalModule from "./RemoveAccountModalModule";
6
+ import { noop } from "../../../../util/general";
7
7
 
8
8
  const InactiveControlsModule = ({
9
9
  autoPayEnabled,
@@ -21,7 +21,8 @@ const InactiveControlsModule = ({
21
21
  actions,
22
22
  description,
23
23
  subDescription,
24
- allowedPaymentInstruments
24
+ allowedPaymentInstruments,
25
+ isInCustomerManagement = false
25
26
  }) => {
26
27
  const [modalOpen, toggleModal] = useState(false);
27
28
  const { deleteObligationAssoc } = actions;
@@ -58,15 +59,17 @@ const InactiveControlsModule = ({
58
59
  description={description}
59
60
  subDescription={subDescription}
60
61
  allowedPaymentInstruments={allowedPaymentInstruments}
62
+ isInCustomerManagement={isInCustomerManagement}
61
63
  />
62
64
  </Box>
63
65
  )}
64
66
  <Box padding="0" extraStyles={`flex-grow: 1;`}>
65
67
  <RemoveAccountModalModule
66
68
  agencyName={agencyName}
67
- removeAccount={handleRemoveAccount}
69
+ removeAccount={isInCustomerManagement ? noop : handleRemoveAccount}
68
70
  accountType={configType === "ACCOUNT" ? "Account" : "Property"}
69
71
  isMobile={isMobile}
72
+ isInCustomerManagement={isInCustomerManagement}
70
73
  />
71
74
  </Box>
72
75
  </Cluster>
@@ -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);
@@ -94,7 +95,7 @@ const PaymentDetailsActions = ({
94
95
  extraStyles={isMobile && `flex-grow: 1;`}
95
96
  >
96
97
  <ButtonWithAction
97
- variant="tertiary"
98
+ variant={isInCustomerManagement ? "disabledTertiary" : "tertiary"}
98
99
  text={
99
100
  config.type === "ACCOUNT"
100
101
  ? "Account Details"
@@ -111,7 +112,9 @@ const PaymentDetailsActions = ({
111
112
  >
112
113
  {autoPayAvailable && !autoPayEnabled ? (
113
114
  <ButtonWithAction
114
- variant="tertiary"
115
+ variant={
116
+ isInCustomerManagement ? "disabledTertiary" : "tertiary"
117
+ }
115
118
  text={`Set Up ${planType}`}
116
119
  action={() => {
117
120
  setDetailedObligation(obligations, config, obligationAssocID);
@@ -119,6 +122,7 @@ const PaymentDetailsActions = ({
119
122
  }}
120
123
  dataQa="Set Up Autopay"
121
124
  extraStyles={isMobile && `flex-grow: 1; width: 100%;`}
125
+ disabled={isInCustomerManagement}
122
126
  />
123
127
  ) : (
124
128
  <AutopayModalModule
@@ -137,6 +141,7 @@ const PaymentDetailsActions = ({
137
141
  description={description}
138
142
  subDescription={subDescription}
139
143
  allowedPaymentInstruments={allowedPaymentInstruments}
144
+ isInCustomerManagement={isInCustomerManagement}
140
145
  />
141
146
  )}
142
147
  </Box>
@@ -144,10 +149,21 @@ const PaymentDetailsActions = ({
144
149
  <Box padding={"0"}>
145
150
  <ButtonWithAction
146
151
  isLoading={isLoading}
147
- action={() => handleClick(obligations)}
152
+ action={
153
+ isInCustomerManagement ? noop : () => handleClick(obligations)
154
+ }
148
155
  text="Pay Now"
149
- variant={isMobile ? "smallSecondary" : "secondary"}
156
+ variant={
157
+ isMobile
158
+ ? isInCustomerManagement
159
+ ? "disabledSmallSecondary"
160
+ : "smallSecondary"
161
+ : isInCustomerManagement
162
+ ? "disabledSecondary"
163
+ : "secondary"
164
+ }
150
165
  dataQa="Pay Now"
166
+ disabled={isInCustomerManagement}
151
167
  />
152
168
  </Box>
153
169
  )}
@@ -161,6 +177,7 @@ const PaymentDetailsActions = ({
161
177
  variant={isMobile ? "smallSecondary" : "secondary"}
162
178
  dataQa="Pay Now"
163
179
  extraStyles={isMobile && `flex-grow: 1; width: 100%; margin: 0;`}
180
+ disabled={isInCustomerManagement}
164
181
  />
165
182
  </Box>
166
183
  )}
@@ -8,7 +8,8 @@ const RemoveAccountModalModule = ({
8
8
  obligations = [],
9
9
  removeAccount,
10
10
  accountType,
11
- isMobile
11
+ isMobile,
12
+ isInCustomerManagement = false
12
13
  }) => {
13
14
  const [modalIsOpen, setModalIsOpen] = useState(false);
14
15
  const lastItem = [...obligations].pop();
@@ -48,12 +49,13 @@ const RemoveAccountModalModule = ({
48
49
  <Box padding="0" extraStyles={`flex-grow: 1;`}>
49
50
  <ButtonWithAction
50
51
  text="Remove"
51
- variant="secondary"
52
- action={() => setModalIsOpen(true)}
52
+ variant={isInCustomerManagement ? "disabledSecondary" : "secondary"}
53
+ action={isInCustomerManagement ? noop : () => setModalIsOpen(true)}
53
54
  dataQa="Remove Account"
54
55
  extraStyles={
55
56
  isMobile ? `flex-grow: 1; width: 100%; margin: 0;` : `flex-grow: 1;`
56
57
  }
58
+ disabled={isInCustomerManagement}
57
59
  />
58
60
  </Box>
59
61
  </Modal>