@thecb/components 10.6.4 → 10.6.5-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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "10.6.4",
3
+ "version": "10.6.5-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",
Binary file
@@ -16,7 +16,8 @@ const WalletName = ({
16
16
  actionText = null, // right side hyperlinked text
17
17
  disableAction = false,
18
18
  linkButtonExtraStyles = "", // hyperlinked text extraStyles
19
- isLoading = false // shows a spinner on the left when true
19
+ isLoading = false, // shows a spinner on the left when true
20
+ dataQa = null
20
21
  }) => {
21
22
  const { isMobile } = useContext(ThemeContext);
22
23
 
@@ -57,6 +58,7 @@ const WalletName = ({
57
58
  <ButtonWithAction
58
59
  disabled={disableAction}
59
60
  text={actionText}
61
+ dataQa={dataQa}
60
62
  action={action}
61
63
  variant="smallGhost"
62
64
  extraStyles={`
@@ -9,6 +9,7 @@ export interface WalletNameProps {
9
9
  text?: string | null;
10
10
  isLoading: boolean;
11
11
  buttonExtraStyles?: string;
12
+ dataQa?: string | null;
12
13
  }
13
14
 
14
15
  export const WalletName: React.FC<Expand<WalletNameProps> &
@@ -25,7 +25,9 @@ const PaymentButtonBar = ({
25
25
  hideBackButton = false,
26
26
  buttonGroupStyles,
27
27
  hideAdditionalButton = false,
28
- additionalButton
28
+ additionalButton,
29
+ nextButtonTestId = null,
30
+ backButtonTestId = null
29
31
  }) => {
30
32
  const { isMobile } = useContext(ThemeContext);
31
33
 
@@ -36,7 +38,7 @@ const PaymentButtonBar = ({
36
38
  url={cancelURL}
37
39
  variant={backButtonVariant}
38
40
  extraStyles={isMobile && "flex-grow: 1"}
39
- dataQa={cancelText}
41
+ dataQa={backButtonTestId || cancelText}
40
42
  aria-labelledby={`${kebabCaseString(cancelText)}-button`}
41
43
  role="link"
42
44
  />
@@ -60,7 +62,7 @@ const PaymentButtonBar = ({
60
62
  text={redirectText}
61
63
  variant={forwardButtonVariant}
62
64
  extraStyles={isMobile && "flex-grow: 1"}
63
- dataQa={redirectText}
65
+ dataQa={nextButtonTestId || redirectText}
64
66
  disabled={isForwardButtonDisabled}
65
67
  aria-labelledby={`${kebabCaseString(redirectText)}-button`}
66
68
  role={forwardButtonAriaRole}
@@ -73,7 +75,7 @@ const PaymentButtonBar = ({
73
75
  action={forwardButtonAction}
74
76
  isLoading={forwardButtonLoading}
75
77
  extraStyles={isMobile && "flex-grow: 1"}
76
- dataQa={forwardButtonText}
78
+ dataQa={nextButtonTestId || forwardButtonText}
77
79
  disabled={isForwardButtonDisabled}
78
80
  aria-labelledby={`${kebabCaseString(forwardButtonText)}-button`}
79
81
  role={forwardButtonAriaRole}