@thecb/components 10.7.2-beta.0 → 10.7.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 +20 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +20 -10
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/icons/.DS_Store +0 -0
- package/src/components/atoms/wallet-name/WalletName.js +6 -4
- package/src/components/atoms/wallet-name/WalletName.stories.js +26 -1
- package/src/components/atoms/wallet-name/index.d.ts +2 -0
- package/src/components/molecules/payment-button-bar/PaymentButtonBar.js +6 -4
- package/src/components/molecules/radio-section/RadioSection.js +2 -1
- package/src/components/molecules/toast-notification/ToastNotification.js +1 -1
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -7,7 +7,6 @@ import { ThemeContext } from "styled-components";
|
|
|
7
7
|
import Module from "../../molecules/module/Module";
|
|
8
8
|
import Spinner from "../spinner/Spinner";
|
|
9
9
|
import { CHARADE_GREY } from "../../../constants/colors";
|
|
10
|
-
import { noop } from "../../../util/general";
|
|
11
10
|
|
|
12
11
|
const WalletName = ({
|
|
13
12
|
mainText, // left side text
|
|
@@ -16,7 +15,9 @@ const WalletName = ({
|
|
|
16
15
|
actionText = null, // right side hyperlinked text
|
|
17
16
|
disableAction = false,
|
|
18
17
|
linkButtonExtraStyles = "", // hyperlinked text extraStyles
|
|
19
|
-
isLoading = false // shows a spinner on the left when true
|
|
18
|
+
isLoading = false, // shows a spinner on the left when true
|
|
19
|
+
dataQa = null,
|
|
20
|
+
actionTextPositionMobile = "outside" // whether action text is outside/below box or inside it
|
|
20
21
|
}) => {
|
|
21
22
|
const { isMobile } = useContext(ThemeContext);
|
|
22
23
|
|
|
@@ -49,7 +50,7 @@ const WalletName = ({
|
|
|
49
50
|
mainText && <Text>{mainText}</Text>
|
|
50
51
|
)}
|
|
51
52
|
</Box>
|
|
52
|
-
{!isMobile && (
|
|
53
|
+
{(actionTextPositionMobile === "inside" || !isMobile) && (
|
|
53
54
|
<Box padding="0">
|
|
54
55
|
{text && <Text variant="pXS">{text}</Text>}
|
|
55
56
|
{(text || actionText) && <> </>}
|
|
@@ -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={`
|
|
@@ -71,7 +73,7 @@ const WalletName = ({
|
|
|
71
73
|
)}
|
|
72
74
|
</Cluster>
|
|
73
75
|
</Module>
|
|
74
|
-
{isMobile && (
|
|
76
|
+
{!!isMobile && actionTextPositionMobile === "outside" && (
|
|
75
77
|
<Cluster
|
|
76
78
|
align="center"
|
|
77
79
|
justify={text || actionText ? "flex-end" : "flex-start"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import WalletName from "./WalletName";
|
|
3
|
-
import { text, object, boolean } from "@storybook/addon-knobs";
|
|
3
|
+
import { text, object, boolean, select } from "@storybook/addon-knobs";
|
|
4
4
|
import page from "../../../../.storybook/page";
|
|
5
5
|
|
|
6
6
|
export const walletName = () => {
|
|
@@ -12,6 +12,31 @@ export const walletName = () => {
|
|
|
12
12
|
text={text("text", "Not you?", "props")}
|
|
13
13
|
disableAction={boolean("disableAction", false, "props")}
|
|
14
14
|
isLoading={boolean("isLoading", false, "props")}
|
|
15
|
+
actionTextPositionMobile={select(
|
|
16
|
+
"actionTextPositionMobile",
|
|
17
|
+
{ inside: "inside", outside: "outside" },
|
|
18
|
+
"outside",
|
|
19
|
+
"props"
|
|
20
|
+
)}
|
|
21
|
+
/>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const walletNameWithOverrides = () => {
|
|
26
|
+
return (
|
|
27
|
+
<WalletName
|
|
28
|
+
mainText={text("mainText", "Firstname Lastname", "props")}
|
|
29
|
+
action={object("action", () => window.alert("action fired!"), "props")}
|
|
30
|
+
actionText={text("actionText", "Check out as a guest", "props")}
|
|
31
|
+
text={text("text", "Not you?", "props")}
|
|
32
|
+
disableAction={boolean("disableAction", false, "props")}
|
|
33
|
+
isLoading={boolean("isLoading", false, "props")}
|
|
34
|
+
actionTextPositionMobile={select(
|
|
35
|
+
"actionTextPositionMobile",
|
|
36
|
+
{ inside: "inside", outside: "outside" },
|
|
37
|
+
"outside",
|
|
38
|
+
"props"
|
|
39
|
+
)}
|
|
15
40
|
/>
|
|
16
41
|
);
|
|
17
42
|
};
|
|
@@ -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}
|
|
@@ -58,6 +58,7 @@ const RadioSection = ({
|
|
|
58
58
|
ariaDescribedBy,
|
|
59
59
|
isSectionRequired = false,
|
|
60
60
|
groupedSections,
|
|
61
|
+
borderOverride,
|
|
61
62
|
...rest
|
|
62
63
|
}) => {
|
|
63
64
|
const [focused, setFocused] = useState(null);
|
|
@@ -98,7 +99,7 @@ const RadioSection = ({
|
|
|
98
99
|
return (
|
|
99
100
|
<Box
|
|
100
101
|
padding="1px"
|
|
101
|
-
border={`1px solid ${themeValues.borderColor}`}
|
|
102
|
+
border={borderOverride || `1px solid ${themeValues.borderColor}`}
|
|
102
103
|
borderRadius="4px"
|
|
103
104
|
extraStyles={containerStyles}
|
|
104
105
|
role="radiogroup"
|