@thecb/components 5.0.0 → 5.2.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": "5.0.0",
3
+ "version": "5.2.2",
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.1.0"
88
+ "redux-freeform": "^5.2.0"
89
89
  }
90
90
  }
@@ -124,7 +124,7 @@ const ButtonWithAction = ({
124
124
  activeStyles={activeStyles}
125
125
  disabledStyles={disabledStyles}
126
126
  as="button"
127
- onClick={!isLoading && action}
127
+ onClick={isLoading ? undefined : action}
128
128
  borderRadius="2px"
129
129
  theme={themeContext}
130
130
  extraStyles={`margin: 0.5rem; ${extraStyles}`}
@@ -11,15 +11,10 @@ const DropdownIcon = () => (
11
11
  width="12"
12
12
  >
13
13
  <g transform="translate(1 1)">
14
- <g fillRule="evenodd" fill="none" id="Symbols_1548197283918">
15
- <g
16
- fill="#333"
17
- transform="translate(-155 -22)"
18
- id="Dropdown/Closed_1548197283918"
19
- >
14
+ <g fillRule="evenodd" fill="none">
15
+ <g fill="#333" transform="translate(-155 -22)">
20
16
  <polygon
21
17
  points="165.59 22.59 161 27.17 156.41 22.59 155 24 161 30 167 24"
22
- id="Path_1548197283918"
23
18
  vectorEffect="non-scaling-stroke"
24
19
  />
25
20
  </g>
@@ -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
  };
@@ -4,7 +4,8 @@ import {
4
4
  required,
5
5
  hasLength,
6
6
  matchesRegex,
7
- dateAfterToday
7
+ dateAfterToday,
8
+ isValidMonth
8
9
  } from "redux-freeform";
9
10
  import Checkbox from "../../atoms/checkbox";
10
11
  import CountryDropdown from "../../atoms/country-dropdown";
@@ -71,6 +72,7 @@ const PaymentFormCard = ({
71
72
  const expirationDateErrors = {
72
73
  [required.error]: "Expiration date is required",
73
74
  [hasLength.error]: "Expiration date is invalid",
75
+ [isValidMonth.error]: "Expiration month is invalid",
74
76
  [dateAfterToday.error]: "Expiration date is invalid"
75
77
  };
76
78
  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)]