@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "10.4.2-beta.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.9.0-beta.2"
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
- <Modal
23
- modalOpen={isOpen}
24
- hideModal={() => toggleOpen(false)}
25
- showModal={() => toggleOpen(true)}
26
- modalHeaderText={title}
27
- dataQa={dataQa}
28
- modalBodyText={
29
- <Box extraStyles="overflow: scroll; max-height: 20rem;">
30
- <Stack>
31
- <Paragraph variant="p">{content}</Paragraph>
32
- {imageType === "Account" ? (
33
- <Center intrinsic>
34
- <AccountNumberImage />
35
- </Center>
36
- ) : imageType === "Routing" ? (
37
- <Center intrinsic>
38
- <RoutingNumberImage />
39
- </Center>
40
- ) : (
41
- <Fragment />
42
- )}
43
- </Stack>
44
- </Box>
45
- }
46
- defaultWrapper={false}
47
- onlyCloseButton={!acceptText}
48
- continueButtonText={acceptText}
49
- continueAction={() => {
50
- toggleAccepted(true);
51
- toggleOpen(false);
52
- }}
53
- initialFocusSelector={"[name='Close']"}
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
- {link}
69
- </Text>
70
- </Modal>
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(), validName()]
15
+ validators: [required()]
17
16
  },
18
17
  lastName: {
19
- validators: [required(), validName()]
18
+ validators: [required()]
20
19
  },
21
20
  email: {
22
21
  validators: [required(), isProbablyEmail()]