@thecb/components 7.8.3-beta.1 → 7.8.3-beta.2
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 +10 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +10 -2
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/payment-form-ach/PaymentFormACH.js +3 -1
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +3 -1
- package/src/components/molecules/payment-form-card/index.d.ts +21 -0
- package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.stories.js +10 -0
package/package.json
CHANGED
|
@@ -42,6 +42,7 @@ const PaymentFormACH = ({
|
|
|
42
42
|
const [showAccount, toggleShowAccount] = useState(false);
|
|
43
43
|
const [termsModalOpen, setTermsModalOpen] = useState(false);
|
|
44
44
|
const showTerms = !!termsContent;
|
|
45
|
+
const showTermsLinkVariant = showWalletCheckbox ? "p" : "pS";
|
|
45
46
|
|
|
46
47
|
const nameErrors = {
|
|
47
48
|
[required.error]: "Name is required"
|
|
@@ -173,9 +174,10 @@ const PaymentFormACH = ({
|
|
|
173
174
|
{showTerms && (
|
|
174
175
|
<Cover singleChild>
|
|
175
176
|
<Cluster childGap={0}>
|
|
176
|
-
<Text>View </Text>
|
|
177
|
+
<Text variant={showTermsLinkVariant}>View </Text>
|
|
177
178
|
<TermsAndConditionsModal
|
|
178
179
|
link={termsTitle}
|
|
180
|
+
linkVariant={showTermsLinkVariant}
|
|
179
181
|
terms={termsContent}
|
|
180
182
|
title={termsTitle}
|
|
181
183
|
isOpen={termsModalOpen}
|
|
@@ -49,6 +49,7 @@ const PaymentFormCard = ({
|
|
|
49
49
|
const { isMobile } = useContext(ThemeContext);
|
|
50
50
|
const [termsModalOpen, setTermsModalOpen] = useState(false);
|
|
51
51
|
const showTerms = !!termsContent;
|
|
52
|
+
const showTermsLinkVariant = showWalletCheckbox ? "p" : "pS";
|
|
52
53
|
|
|
53
54
|
useEffect(() => {
|
|
54
55
|
if (deniedCards) {
|
|
@@ -197,9 +198,10 @@ const PaymentFormCard = ({
|
|
|
197
198
|
{showTerms && (
|
|
198
199
|
<Cover singleChild>
|
|
199
200
|
<Cluster childGap={0}>
|
|
200
|
-
<Text>View </Text>
|
|
201
|
+
<Text variant={showTermsLinkVariant}>View </Text>
|
|
201
202
|
<TermsAndConditionsModal
|
|
202
203
|
link={termsTitle}
|
|
204
|
+
linkVariant={showTermsLinkVariant}
|
|
203
205
|
terms={termsContent}
|
|
204
206
|
title={termsTitle}
|
|
205
207
|
isOpen={termsModalOpen}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Expand from "../../../util/expand";
|
|
3
|
+
|
|
4
|
+
export interface PaymentFormCardProps {
|
|
5
|
+
variant?: string;
|
|
6
|
+
hideZipCode?: boolean;
|
|
7
|
+
clearOnDismount?: boolean;
|
|
8
|
+
fields,
|
|
9
|
+
actions,
|
|
10
|
+
showErrors,
|
|
11
|
+
handleSubmit = noop,
|
|
12
|
+
showWalletCheckbox,
|
|
13
|
+
saveToWallet,
|
|
14
|
+
walletCheckboxMarked,
|
|
15
|
+
deniedCards,
|
|
16
|
+
termsContent,
|
|
17
|
+
termsTitle = "Terms & Conditions"
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export const Paragraph: React.FC<Expand<PaymentFormCardProps> &
|
|
21
|
+
React.HTMLAttributes<HTMLElement>>;
|
package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.stories.js
CHANGED
|
@@ -11,6 +11,15 @@ const variants = {
|
|
|
11
11
|
};
|
|
12
12
|
const groupId = "props";
|
|
13
13
|
|
|
14
|
+
const linkVariants = {
|
|
15
|
+
p: "p",
|
|
16
|
+
pL: "pL",
|
|
17
|
+
pS: "pS",
|
|
18
|
+
pXS: "pXS",
|
|
19
|
+
pXXS: "pXXs",
|
|
20
|
+
pXL: "PXL"
|
|
21
|
+
};
|
|
22
|
+
|
|
14
23
|
export const termsAndConditionsModal = () => (
|
|
15
24
|
<TermsAndConditionsModal
|
|
16
25
|
link={text("text", "Show modal", groupId)}
|
|
@@ -21,6 +30,7 @@ export const termsAndConditionsModal = () => (
|
|
|
21
30
|
acceptText={text("acceptText", "Accept", groupId)}
|
|
22
31
|
terms={text("terms", "terms and conditions", groupId)}
|
|
23
32
|
variant={select("variants", variants, "default", groupId)}
|
|
33
|
+
linkVariant={select("linkVariants", linkVariants, groupId)}
|
|
24
34
|
/>
|
|
25
35
|
);
|
|
26
36
|
|