@thecb/components 5.0.0 → 5.2.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/dist/index.cjs.js +48 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +48 -3
- package/dist/index.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/components/atoms/icons/CashIcon.js +21 -0
- package/src/components/atoms/icons/index.js +3 -1
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +1 -0
- package/src/components/molecules/payment-form-card/PaymentFormCard.state.js +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thecb/components",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.2.0",
|
|
4
4
|
"description": "Common lib for CityBase react components",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -85,6 +85,6 @@
|
|
|
85
85
|
"ramda": "^0.27.0",
|
|
86
86
|
"react-aria-modal": "^4.0.0",
|
|
87
87
|
"react-pose": "^4.0.10",
|
|
88
|
-
"redux-freeform": "^5.
|
|
88
|
+
"redux-freeform": "^5.2.0"
|
|
89
89
|
}
|
|
90
90
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
const CashIcon = () => {
|
|
4
|
+
return (
|
|
5
|
+
<svg
|
|
6
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
7
|
+
width="36"
|
|
8
|
+
height="24"
|
|
9
|
+
fill="none"
|
|
10
|
+
viewBox="0 0 36 24"
|
|
11
|
+
>
|
|
12
|
+
<rect width="36" height="24" fill="#E8FFEF" rx="1"></rect>
|
|
13
|
+
<path
|
|
14
|
+
fill="#317D4F"
|
|
15
|
+
d="M17.178 5.464v1.372c-1.799.294-3.115 1.407-3.094 3.08.021 1.645 1.05 2.597 2.611 2.884l1.617.308c.924.182 1.365.406 1.365 1.085 0 .609-.553 1.092-1.484 1.092-1.036 0-1.743-.455-1.932-1.267l-2.478.021c.175 1.834 1.414 2.8 3.374 3.038v1.197h2.023V17.07c1.876-.266 3.024-1.33 3.024-2.877 0-1.617-.798-2.751-2.702-3.178l-1.603-.357c-.994-.231-1.267-.497-1.267-1.029 0-.546.511-1.015 1.596-1.015 1.015 0 1.302.511 1.393 1.267l2.415-.014c.05-1.484-1.043-2.695-2.835-3.024V5.464h-2.023z"
|
|
16
|
+
></path>
|
|
17
|
+
</svg>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default CashIcon;
|
|
@@ -54,6 +54,7 @@ import ResetPasswordIcon from "./ResetPasswordIcon";
|
|
|
54
54
|
import PeriscopeFailedIcon from "./PeriscopeFailedIcon";
|
|
55
55
|
import CheckIcon from "./CheckIcon";
|
|
56
56
|
import WarningIconXS from "./WarningIconXS";
|
|
57
|
+
import CashIcon from "./CashIcon";
|
|
57
58
|
|
|
58
59
|
export {
|
|
59
60
|
AccountsIcon,
|
|
@@ -111,5 +112,6 @@ export {
|
|
|
111
112
|
ResetPasswordIcon,
|
|
112
113
|
PeriscopeFailedIcon,
|
|
113
114
|
CheckIcon,
|
|
114
|
-
WarningIconXS
|
|
115
|
+
WarningIconXS,
|
|
116
|
+
CashIcon
|
|
115
117
|
};
|
|
@@ -71,6 +71,7 @@ const PaymentFormCard = ({
|
|
|
71
71
|
const expirationDateErrors = {
|
|
72
72
|
[required.error]: "Expiration date is required",
|
|
73
73
|
[hasLength.error]: "Expiration date is invalid",
|
|
74
|
+
[isValidMonth.error]: "Expiration month is invalid",
|
|
74
75
|
[dateAfterToday.error]: "Expiration date is invalid"
|
|
75
76
|
};
|
|
76
77
|
const cvvErrors = {
|
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
hasLength,
|
|
6
6
|
matchesRegex,
|
|
7
7
|
validateWhen,
|
|
8
|
-
dateAfterToday
|
|
8
|
+
dateAfterToday,
|
|
9
|
+
isValidMonth
|
|
9
10
|
} from "redux-freeform";
|
|
10
11
|
|
|
11
12
|
//TODO: Will make zip code able to have more than 5 digits once we add in the FormattedInput because it will have issues with format of 60606-1111.
|
|
@@ -26,6 +27,7 @@ const formConfig = {
|
|
|
26
27
|
validators: [
|
|
27
28
|
required(),
|
|
28
29
|
hasLength(4, 4),
|
|
30
|
+
isValidMonth(0),
|
|
29
31
|
dateAfterToday("MMYY", "month", true)
|
|
30
32
|
],
|
|
31
33
|
constraints: [onlyIntegers(), hasLength(0, 4)]
|