@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "7.8.3-beta.1",
3
+ "version": "7.8.3-beta.2",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -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&nbsp;</Text>
177
+ <Text variant={showTermsLinkVariant}>View&nbsp;</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&nbsp;</Text>
201
+ <Text variant={showTermsLinkVariant}>View&nbsp;</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 &amp; Conditions"
18
+ }
19
+
20
+ export const Paragraph: React.FC<Expand<PaymentFormCardProps> &
21
+ React.HTMLAttributes<HTMLElement>>;
@@ -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