@thecb/components 10.4.2-beta.2 → 10.4.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 +13 -23
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +13 -23
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/molecules/account-and-routing-modal/AccountAndRoutingModal.js +50 -50
- package/src/components/molecules/registration-form/RegistrationForm.js +3 -6
- package/src/components/molecules/registration-form/RegistrationForm.state.js +3 -4
- package/dist/src/apps/checkout/pages/payment/sub-pages/payment-amount/PaymentAmount_old.js +0 -49322
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/icons/.DS_Store +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thecb/components",
|
|
3
|
-
"version": "10.4.2
|
|
3
|
+
"version": "10.4.2",
|
|
4
4
|
"description": "Common lib for CityBase react components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -90,6 +90,6 @@
|
|
|
90
90
|
"ramda": "^0.27.0",
|
|
91
91
|
"react-aria-modal": "^4.0.0",
|
|
92
92
|
"react-pose": "^4.0.10",
|
|
93
|
-
"redux-freeform": "^5.
|
|
93
|
+
"redux-freeform": "^5.8.0"
|
|
94
94
|
}
|
|
95
95
|
}
|
|
@@ -3,6 +3,7 @@ import Modal from "../modal";
|
|
|
3
3
|
import Text from "../../atoms/text";
|
|
4
4
|
import Paragraph from "../../atoms/paragraph";
|
|
5
5
|
import { Box, Stack, Center } from "../../atoms/layouts";
|
|
6
|
+
import ButtonWithAction from "../../atoms/button-with-action/ButtonWithAction";
|
|
6
7
|
import { fallbackValues } from "./AccountAndRoutingModal.theme";
|
|
7
8
|
import { themeComponent } from "../../../util/themeUtils";
|
|
8
9
|
import { AccountNumberImage, RoutingNumberImage } from "../../atoms/icons";
|
|
@@ -18,57 +19,56 @@ const AccountAndRoutingModal = ({
|
|
|
18
19
|
imageType,
|
|
19
20
|
themeValues,
|
|
20
21
|
dataQa = null
|
|
21
|
-
}) =>
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
<
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<Text
|
|
56
|
-
variant="pS"
|
|
57
|
-
onClick={() => toggleOpen(true)}
|
|
58
|
-
onKeyPress={e => e.key === "Enter" && toggleOpen(true)}
|
|
59
|
-
tabIndex="0"
|
|
60
|
-
color={themeValues.linkColor}
|
|
61
|
-
weight={themeValues.fontWeight}
|
|
62
|
-
hoverStyles={themeValues.modalLinkHoverFocus}
|
|
63
|
-
textDecoration={themeValues.linkTextDecoration}
|
|
64
|
-
extraStyles={`cursor: pointer;`}
|
|
65
|
-
role="button"
|
|
66
|
-
className="modal-trigger"
|
|
22
|
+
}) => {
|
|
23
|
+
return (
|
|
24
|
+
<Modal
|
|
25
|
+
modalOpen={isOpen}
|
|
26
|
+
hideModal={() => toggleOpen(false)}
|
|
27
|
+
showModal={() => toggleOpen(true)}
|
|
28
|
+
modalHeaderText={title}
|
|
29
|
+
dataQa={dataQa}
|
|
30
|
+
modalBodyText={
|
|
31
|
+
<Box extraStyles="overflow: scroll; max-height: 20rem;">
|
|
32
|
+
<Stack>
|
|
33
|
+
<Paragraph variant="p">{content}</Paragraph>
|
|
34
|
+
{imageType === "Account" ? (
|
|
35
|
+
<Center intrinsic>
|
|
36
|
+
<AccountNumberImage />
|
|
37
|
+
</Center>
|
|
38
|
+
) : imageType === "Routing" ? (
|
|
39
|
+
<Center intrinsic>
|
|
40
|
+
<RoutingNumberImage />
|
|
41
|
+
</Center>
|
|
42
|
+
) : (
|
|
43
|
+
<Fragment />
|
|
44
|
+
)}
|
|
45
|
+
</Stack>
|
|
46
|
+
</Box>
|
|
47
|
+
}
|
|
48
|
+
defaultWrapper={false}
|
|
49
|
+
onlyCloseButton={!acceptText}
|
|
50
|
+
continueButtonText={acceptText}
|
|
51
|
+
continueAction={() => {
|
|
52
|
+
toggleAccepted(true);
|
|
53
|
+
toggleOpen(false);
|
|
54
|
+
}}
|
|
55
|
+
initialFocusSelector={"[name='Close']"}
|
|
67
56
|
>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
)
|
|
57
|
+
<ButtonWithAction
|
|
58
|
+
variant="ghost"
|
|
59
|
+
tabIndex="0"
|
|
60
|
+
onClick={() => toggleOpen(true)}
|
|
61
|
+
onKeyPress={e => e.key === "Enter" && toggleOpen(true)}
|
|
62
|
+
extraStyles="min-width: 0; min-height: 0;margin: 0; padding: 0; text-transform: none;"
|
|
63
|
+
text={
|
|
64
|
+
<Text variant="pS" color="inherit">
|
|
65
|
+
{link}
|
|
66
|
+
</Text>
|
|
67
|
+
}
|
|
68
|
+
/>
|
|
69
|
+
</Modal>
|
|
70
|
+
);
|
|
71
|
+
};
|
|
72
72
|
|
|
73
73
|
export default themeComponent(
|
|
74
74
|
AccountAndRoutingModal,
|
|
@@ -7,8 +7,7 @@ import {
|
|
|
7
7
|
hasLowercaseLetter,
|
|
8
8
|
hasUppercaseLetter,
|
|
9
9
|
hasSpecialCharacter,
|
|
10
|
-
isProbablyEmail
|
|
11
|
-
validName
|
|
10
|
+
isProbablyEmail
|
|
12
11
|
} from "redux-freeform";
|
|
13
12
|
import PasswordRequirements from "../../atoms/password-requirements";
|
|
14
13
|
import { Box } from "../../atoms/layouts";
|
|
@@ -27,12 +26,10 @@ const RegistrationForm = ({
|
|
|
27
26
|
useEffect(() => () => actions.form.clear(), []);
|
|
28
27
|
}
|
|
29
28
|
const firstNameErrorMessages = {
|
|
30
|
-
[required.error]: "First name is required"
|
|
31
|
-
[validName.error]: "First name contains invalid characters"
|
|
29
|
+
[required.error]: "First name is required"
|
|
32
30
|
};
|
|
33
31
|
const lastNameErrorMessages = {
|
|
34
|
-
[required.error]: "Last name is required"
|
|
35
|
-
[validName.error]: "Last name contains invalid characters"
|
|
32
|
+
[required.error]: "Last name is required"
|
|
36
33
|
};
|
|
37
34
|
const emailErrorMessages = {
|
|
38
35
|
[required.error]: "Email is required",
|
|
@@ -7,16 +7,15 @@ import {
|
|
|
7
7
|
hasLowercaseLetter,
|
|
8
8
|
hasUppercaseLetter,
|
|
9
9
|
hasSpecialCharacter,
|
|
10
|
-
isProbablyEmail
|
|
11
|
-
validName
|
|
10
|
+
isProbablyEmail
|
|
12
11
|
} from "redux-freeform";
|
|
13
12
|
|
|
14
13
|
const formConfig = {
|
|
15
14
|
firstName: {
|
|
16
|
-
validators: [required()
|
|
15
|
+
validators: [required()]
|
|
17
16
|
},
|
|
18
17
|
lastName: {
|
|
19
|
-
validators: [required()
|
|
18
|
+
validators: [required()]
|
|
20
19
|
},
|
|
21
20
|
email: {
|
|
22
21
|
validators: [required(), isProbablyEmail()]
|