@thecb/components 7.10.2 → 7.10.4-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/dist/index.cjs.js +242 -266
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +242 -266
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/editable-list/EditableList.js +21 -1
- package/src/components/molecules/payment-form-ach/PaymentFormACH.js +8 -17
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +8 -17
package/package.json
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
BOSTON_BLUE,
|
|
14
14
|
CHARADE_GREY
|
|
15
15
|
} from "../../../constants/colors";
|
|
16
|
+
import { createIdFromString } from "../../../util/general";
|
|
16
17
|
|
|
17
18
|
const ACTIVE = "ACTIVE";
|
|
18
19
|
const EXPIRED = "EXPIRED";
|
|
@@ -36,6 +37,7 @@ const EditableList = ({
|
|
|
36
37
|
modalProps,
|
|
37
38
|
autoPayMethods,
|
|
38
39
|
as = "p",
|
|
40
|
+
listPadding = "0rem 0rem 1.5rem 0rem",
|
|
39
41
|
qaPrefix,
|
|
40
42
|
ariaLabel
|
|
41
43
|
}) => {
|
|
@@ -43,7 +45,20 @@ const EditableList = ({
|
|
|
43
45
|
itemName[0].match(/[aieouAIEOU]/) ? "n" : ""
|
|
44
46
|
} ${itemName}`;
|
|
45
47
|
return (
|
|
46
|
-
<Box
|
|
48
|
+
<Box
|
|
49
|
+
padding={listPadding}
|
|
50
|
+
as="section"
|
|
51
|
+
aria-labelledby={
|
|
52
|
+
typeof title === "string"
|
|
53
|
+
? `editable-list-${createIdFromString(title)}`
|
|
54
|
+
: ""
|
|
55
|
+
}
|
|
56
|
+
aria-label={
|
|
57
|
+
!title && typeof itemName === "string"
|
|
58
|
+
? `editable-list-${createIdFromString(itemName)}`
|
|
59
|
+
: ""
|
|
60
|
+
}
|
|
61
|
+
>
|
|
47
62
|
<Stack childGap="0rem">
|
|
48
63
|
{title !== "" && (
|
|
49
64
|
<Box padding="0rem 0rem 0.5rem 0rem">
|
|
@@ -52,6 +67,11 @@ const EditableList = ({
|
|
|
52
67
|
weight={titleWeight}
|
|
53
68
|
color={CHARADE_GREY}
|
|
54
69
|
extraStyles="letter-spacing: 0.29px; font-size: 1.125rem;"
|
|
70
|
+
id={
|
|
71
|
+
typeof title === "string"
|
|
72
|
+
? `editable-list-${createIdFromString(title)}`
|
|
73
|
+
: ""
|
|
74
|
+
}
|
|
55
75
|
>
|
|
56
76
|
{title}
|
|
57
77
|
</Title>
|
|
@@ -15,8 +15,7 @@ import {
|
|
|
15
15
|
import AccountAndRoutingModal from "../account-and-routing-modal";
|
|
16
16
|
import { noop } from "../../../util/general";
|
|
17
17
|
import { Cluster, Cover } from "../../atoms/layouts";
|
|
18
|
-
import
|
|
19
|
-
import Text from "../../atoms/text";
|
|
18
|
+
import TermsAndConditions from "../terms-and-conditions";
|
|
20
19
|
|
|
21
20
|
const PaymentFormACH = ({
|
|
22
21
|
variant = "default",
|
|
@@ -32,17 +31,14 @@ const PaymentFormACH = ({
|
|
|
32
31
|
showWalletCheckbox,
|
|
33
32
|
saveToWallet,
|
|
34
33
|
walletCheckboxMarked,
|
|
35
|
-
termsContent
|
|
36
|
-
termsTitle = "Terms & Conditions"
|
|
34
|
+
termsContent
|
|
37
35
|
}) => {
|
|
38
36
|
if (clearOnDismount) {
|
|
39
37
|
useEffect(() => () => actions.form.clear(), []);
|
|
40
38
|
}
|
|
41
39
|
const [showRouting, toggleShowRouting] = useState(false);
|
|
42
40
|
const [showAccount, toggleShowAccount] = useState(false);
|
|
43
|
-
const [termsModalOpen, setTermsModalOpen] = useState(false);
|
|
44
41
|
const showTerms = !!termsContent;
|
|
45
|
-
const showTermsLinkVariant = showWalletCheckbox ? "p" : "pS";
|
|
46
42
|
|
|
47
43
|
const nameErrors = {
|
|
48
44
|
[required.error]: "Name is required"
|
|
@@ -173,17 +169,12 @@ const PaymentFormACH = ({
|
|
|
173
169
|
)}
|
|
174
170
|
{showTerms && (
|
|
175
171
|
<Cover singleChild>
|
|
176
|
-
<
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
title={termsTitle}
|
|
183
|
-
isOpen={termsModalOpen}
|
|
184
|
-
toggleOpen={setTermsModalOpen}
|
|
185
|
-
/>
|
|
186
|
-
</Cluster>
|
|
172
|
+
<TermsAndConditions
|
|
173
|
+
version="v2"
|
|
174
|
+
showCheckbox={false}
|
|
175
|
+
description="View"
|
|
176
|
+
terms={termsContent}
|
|
177
|
+
/>
|
|
187
178
|
</Cover>
|
|
188
179
|
)}
|
|
189
180
|
</Cluster>
|
|
@@ -28,8 +28,7 @@ import {
|
|
|
28
28
|
} from "../../atoms/form-layouts";
|
|
29
29
|
import { Box, Cluster, Cover } from "../../atoms/layouts";
|
|
30
30
|
import withWindowSize from "../../withWindowSize";
|
|
31
|
-
import
|
|
32
|
-
import Text from "../../atoms/text";
|
|
31
|
+
import TermsAndConditions from "../terms-and-conditions";
|
|
33
32
|
|
|
34
33
|
const PaymentFormCard = ({
|
|
35
34
|
variant = "default",
|
|
@@ -43,13 +42,10 @@ const PaymentFormCard = ({
|
|
|
43
42
|
saveToWallet,
|
|
44
43
|
walletCheckboxMarked,
|
|
45
44
|
deniedCards,
|
|
46
|
-
termsContent
|
|
47
|
-
termsTitle = "Terms & Conditions"
|
|
45
|
+
termsContent
|
|
48
46
|
}) => {
|
|
49
47
|
const { isMobile } = useContext(ThemeContext);
|
|
50
|
-
const [termsModalOpen, setTermsModalOpen] = useState(false);
|
|
51
48
|
const showTerms = !!termsContent;
|
|
52
|
-
const showTermsLinkVariant = showWalletCheckbox ? "p" : "pS";
|
|
53
49
|
|
|
54
50
|
useEffect(() => {
|
|
55
51
|
if (deniedCards) {
|
|
@@ -197,17 +193,12 @@ const PaymentFormCard = ({
|
|
|
197
193
|
)}
|
|
198
194
|
{showTerms && (
|
|
199
195
|
<Cover singleChild>
|
|
200
|
-
<
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
title={termsTitle}
|
|
207
|
-
isOpen={termsModalOpen}
|
|
208
|
-
toggleOpen={setTermsModalOpen}
|
|
209
|
-
/>
|
|
210
|
-
</Cluster>
|
|
196
|
+
<TermsAndConditions
|
|
197
|
+
version="v2"
|
|
198
|
+
showCheckbox={false}
|
|
199
|
+
description="View"
|
|
200
|
+
terms={termsContent}
|
|
201
|
+
/>
|
|
211
202
|
</Cover>
|
|
212
203
|
)}
|
|
213
204
|
</Cluster>
|