@thecb/components 10.3.1 → 10.3.2-beta.0

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.3.1",
3
+ "version": "10.3.2-beta.0",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
package/src/.DS_Store CHANGED
Binary file
Binary file
Binary file
@@ -7,7 +7,8 @@ import {
7
7
  hasLowercaseLetter,
8
8
  hasUppercaseLetter,
9
9
  hasSpecialCharacter,
10
- isProbablyEmail
10
+ isProbablyEmail,
11
+ matchesRegex
11
12
  } from "redux-freeform";
12
13
  import PasswordRequirements from "../../atoms/password-requirements";
13
14
  import { Box } from "../../atoms/layouts";
@@ -26,10 +27,12 @@ const RegistrationForm = ({
26
27
  useEffect(() => () => actions.form.clear(), []);
27
28
  }
28
29
  const firstNameErrorMessages = {
29
- [required.error]: "First name is required"
30
+ [required.error]: "First name is required",
31
+ [matchesRegex.error]: "First name must contain at least one letter"
30
32
  };
31
33
  const lastNameErrorMessages = {
32
- [required.error]: "Last name is required"
34
+ [required.error]: "Last name is required",
35
+ [matchesRegex.error]: "Last name must contain at least one letter"
33
36
  };
34
37
  const emailErrorMessages = {
35
38
  [required.error]: "Email is required",
@@ -7,15 +7,16 @@ import {
7
7
  hasLowercaseLetter,
8
8
  hasUppercaseLetter,
9
9
  hasSpecialCharacter,
10
- isProbablyEmail
10
+ isProbablyEmail,
11
+ matchesRegex
11
12
  } from "redux-freeform";
12
13
 
13
14
  const formConfig = {
14
15
  firstName: {
15
- validators: [required()]
16
+ validators: [required(), matchesRegex(/\w+/i)]
16
17
  },
17
18
  lastName: {
18
- validators: [required()]
19
+ validators: [required(), matchesRegex(/\w+/i)]
19
20
  },
20
21
  email: {
21
22
  validators: [required(), isProbablyEmail()]