@thecb/components 4.3.11 → 4.3.15

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/.tool-versions CHANGED
@@ -1 +1 @@
1
- nodejs 15.5.0
1
+ nodejs 15.8.0
package/dist/index.cjs.js CHANGED
@@ -15886,10 +15886,19 @@ function _assertThisInitialized(self) {
15886
15886
  return self;
15887
15887
  }
15888
15888
 
15889
+ function _setPrototypeOf(o, p) {
15890
+ _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
15891
+ o.__proto__ = p;
15892
+ return o;
15893
+ };
15894
+
15895
+ return _setPrototypeOf(o, p);
15896
+ }
15897
+
15889
15898
  function _inheritsLoose(subClass, superClass) {
15890
15899
  subClass.prototype = Object.create(superClass.prototype);
15891
15900
  subClass.prototype.constructor = subClass;
15892
- subClass.__proto__ = superClass;
15901
+ _setPrototypeOf(subClass, superClass);
15893
15902
  }
15894
15903
 
15895
15904
  function _getPrototypeOf(o) {
@@ -15899,15 +15908,6 @@ function _getPrototypeOf(o) {
15899
15908
  return _getPrototypeOf(o);
15900
15909
  }
15901
15910
 
15902
- function _setPrototypeOf(o, p) {
15903
- _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) {
15904
- o.__proto__ = p;
15905
- return o;
15906
- };
15907
-
15908
- return _setPrototypeOf(o, p);
15909
- }
15910
-
15911
15911
  function _isNativeFunction(fn) {
15912
15912
  return Function.toString.call(fn).indexOf("[native code]") !== -1;
15913
15913
  }
@@ -15918,7 +15918,7 @@ function _isNativeReflectConstruct() {
15918
15918
  if (typeof Proxy === "function") return true;
15919
15919
 
15920
15920
  try {
15921
- Date.prototype.toString.call(Reflect.construct(Date, [], function () {}));
15921
+ Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
15922
15922
  return true;
15923
15923
  } catch (e) {
15924
15924
  return false;
@@ -16058,7 +16058,9 @@ var ERRORS = {
16058
16058
  "73": "Please provide a valid CSS variable.\n\n",
16059
16059
  "74": "CSS variable not found and no default was provided.\n\n",
16060
16060
  "75": "important requires a valid style object, got a %s instead.\n\n",
16061
- "76": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n"
16061
+ "76": "fromSize and toSize must be provided as stringified numbers with the same units as minScreen and maxScreen.\n\n",
16062
+ "77": "remToPx expects a value in \"rem\" but you provided it in \"%s\".\n\n",
16063
+ "78": "base must be set in \"px\" or \"%\" but you set it in \"%s\".\n"
16062
16064
  };
16063
16065
  /**
16064
16066
  * super basic version of sprintf
@@ -35063,7 +35065,7 @@ var AddressForm = function AddressForm(_ref) {
35063
35065
  }), /*#__PURE__*/React__default.createElement(FormStateDropdown, {
35064
35066
  labelTextWhenNoError: isUS ? "State" : "State or Province",
35065
35067
  errorMessages: stateProvinceErrorMessages,
35066
- countryCode: fields.country.rawValue,
35068
+ countryCode: fields.country.rawValue || "US",
35067
35069
  field: fields.stateProvince,
35068
35070
  fieldActions: actions.fields.stateProvince,
35069
35071
  showErrors: showErrors,
@@ -37410,6 +37412,7 @@ var InternalUserInfoForm = function InternalUserInfoForm(_ref) {
37410
37412
  selectAgency = _ref.selectAgency,
37411
37413
  roleOptions = _ref.roleOptions,
37412
37414
  clientOptions = _ref.clientOptions,
37415
+ namesDisabled = _ref.namesDisabled,
37413
37416
  emailDisabled = _ref.emailDisabled,
37414
37417
  roleDisabled = _ref.roleDisabled,
37415
37418
  selectionDisabled = _ref.selectionDisabled,
@@ -37443,7 +37446,7 @@ var InternalUserInfoForm = function InternalUserInfoForm(_ref) {
37443
37446
 
37444
37447
  var lastNameErrorMessages = _defineProperty({}, required.error, "Last name is required");
37445
37448
 
37446
- var emailErrorMessages = _defineProperty({}, required.error, "Email is required");
37449
+ var emailErrorMessages = _defineProperty({}, isProbablyEmail.error, "Invalid email address");
37447
37450
 
37448
37451
  var roleErrorMessages = _defineProperty({}, required.error, "Role is required");
37449
37452
 
@@ -37510,7 +37513,8 @@ var InternalUserInfoForm = function InternalUserInfoForm(_ref) {
37510
37513
  showErrors: showErrors,
37511
37514
  onKeyDown: function onKeyDown(e) {
37512
37515
  return e.key === "Enter" && handleSubmit(e);
37513
- }
37516
+ },
37517
+ disabled: namesDisabled
37514
37518
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
37515
37519
  labelTextWhenNoError: "Last Name",
37516
37520
  errorMessages: lastNameErrorMessages,
@@ -37519,7 +37523,8 @@ var InternalUserInfoForm = function InternalUserInfoForm(_ref) {
37519
37523
  showErrors: showErrors,
37520
37524
  onKeyDown: function onKeyDown(e) {
37521
37525
  return e.key === "Enter" && handleSubmit(e);
37522
- }
37526
+ },
37527
+ disabled: namesDisabled
37523
37528
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
37524
37529
  labelTextWhenNoError: "Email",
37525
37530
  errorMessages: emailErrorMessages,
@@ -40358,11 +40363,14 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
40358
40363
  showErrors = _ref.showErrors,
40359
40364
  _ref$handleSubmit = _ref.handleSubmit,
40360
40365
  handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
40361
- isMobile = _ref.isMobile,
40362
40366
  showWalletCheckbox = _ref.showWalletCheckbox,
40363
40367
  saveToWallet = _ref.saveToWallet,
40364
40368
  walletCheckboxMarked = _ref.walletCheckboxMarked,
40365
40369
  deniedCards = _ref.deniedCards;
40370
+
40371
+ var _useContext = React.useContext(styled.ThemeContext),
40372
+ isMobile = _useContext.isMobile;
40373
+
40366
40374
  React.useEffect(function () {
40367
40375
  if (deniedCards) {
40368
40376
  deniedCards.map(function (card) {
@@ -40426,7 +40434,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
40426
40434
  },
40427
40435
  isNum: true
40428
40436
  }), /*#__PURE__*/React__default.createElement(FormInputRow, {
40429
- breakpoint: "20rem"
40437
+ breakpoint: isMobile ? "1000rem" : "21rem",
40438
+ childGap: isMobile ? "0rem" : "1rem"
40430
40439
  }, /*#__PURE__*/React__default.createElement(FormInput$1, {
40431
40440
  labelTextWhenNoError: "Expiration date (MM/YY)",
40432
40441
  errorMessages: expirationDateErrors,
@@ -40471,6 +40480,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
40471
40480
  })));
40472
40481
  };
40473
40482
 
40483
+ var PaymentFormCard$1 = withWindowSize(PaymentFormCard);
40484
+
40474
40485
  var formConfig$8 = {
40475
40486
  country: {
40476
40487
  defaultValue: "US",
@@ -40502,9 +40513,9 @@ var _createFormState$8 = createFormState(formConfig$8),
40502
40513
  mapStateToProps$9 = _createFormState$8.mapStateToProps,
40503
40514
  mapDispatchToProps$8 = _createFormState$8.mapDispatchToProps;
40504
40515
 
40505
- PaymentFormCard.reducer = reducer$8;
40506
- PaymentFormCard.mapStateToProps = mapStateToProps$9;
40507
- PaymentFormCard.mapDispatchToProps = mapDispatchToProps$8;
40516
+ PaymentFormCard$1.reducer = reducer$8;
40517
+ PaymentFormCard$1.mapStateToProps = mapStateToProps$9;
40518
+ PaymentFormCard$1.mapDispatchToProps = mapDispatchToProps$8;
40508
40519
 
40509
40520
  var PhoneForm = function PhoneForm(_ref) {
40510
40521
  var _phoneErrorMessage;
@@ -41864,7 +41875,7 @@ exports.PasswordRequirements = PasswordRequirements;
41864
41875
  exports.PaymentButtonBar = PaymentButtonBar;
41865
41876
  exports.PaymentDetails = PaymentDetails$1;
41866
41877
  exports.PaymentFormACH = PaymentFormACH;
41867
- exports.PaymentFormCard = PaymentFormCard;
41878
+ exports.PaymentFormCard = PaymentFormCard$1;
41868
41879
  exports.PaymentIcon = PaymentIcon;
41869
41880
  exports.PaymentMethodAddIcon = PaymentMethodAddIcon$1;
41870
41881
  exports.PaymentMethodIcon = PaymentMethodIcon$1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "4.3.11",
3
+ "version": "4.3.15",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -91,7 +91,7 @@ const AddressForm = ({
91
91
  <StateProvinceDropdown
92
92
  labelTextWhenNoError={isUS ? "State" : "State or Province"}
93
93
  errorMessages={stateProvinceErrorMessages}
94
- countryCode={fields.country.rawValue}
94
+ countryCode={fields.country.rawValue || "US"}
95
95
  field={fields.stateProvince}
96
96
  fieldActions={actions.fields.stateProvince}
97
97
  showErrors={showErrors}
@@ -1,5 +1,5 @@
1
1
  import React, { useEffect } from "react";
2
- import { required } from "redux-freeform";
2
+ import { required, isProbablyEmail } from "redux-freeform";
3
3
  import { Stack, Box, Cluster } from "../../atoms/layouts";
4
4
  import ButtonWithAction from "../../atoms/button-with-action";
5
5
  import Heading from "../../atoms/heading";
@@ -47,6 +47,7 @@ const InternalUserInfoForm = ({
47
47
  selectAgency,
48
48
  roleOptions,
49
49
  clientOptions,
50
+ namesDisabled,
50
51
  emailDisabled,
51
52
  roleDisabled,
52
53
  selectionDisabled,
@@ -78,7 +79,7 @@ const InternalUserInfoForm = ({
78
79
  [required.error]: "Last name is required"
79
80
  };
80
81
  const emailErrorMessages = {
81
- [required.error]: "Email is required"
82
+ [isProbablyEmail.error]: "Invalid email address"
82
83
  };
83
84
  const roleErrorMessages = {
84
85
  [required.error]: "Role is required"
@@ -151,6 +152,7 @@ const InternalUserInfoForm = ({
151
152
  fieldActions={actions.fields.firstName}
152
153
  showErrors={showErrors}
153
154
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
155
+ disabled={namesDisabled}
154
156
  />
155
157
  <FormInput
156
158
  labelTextWhenNoError="Last Name"
@@ -159,6 +161,7 @@ const InternalUserInfoForm = ({
159
161
  fieldActions={actions.fields.lastName}
160
162
  showErrors={showErrors}
161
163
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
164
+ disabled={namesDisabled}
162
165
  />
163
166
  <FormInput
164
167
  labelTextWhenNoError="Email"
@@ -1,4 +1,5 @@
1
- import React, { useEffect } from "react";
1
+ import React, { useEffect, useContext } from "react";
2
+ import { ThemeContext } from "styled-components";
2
3
  import { required, hasLength, matchesRegex } from "redux-freeform";
3
4
  import Checkbox from "../../atoms/checkbox";
4
5
  import CountryDropdown from "../../atoms/country-dropdown";
@@ -20,6 +21,7 @@ import {
20
21
  FormInputRow
21
22
  } from "../../atoms/form-layouts";
22
23
  import { Box } from "../../atoms/layouts";
24
+ import withWindowSize from "../../withWindowSize";
23
25
 
24
26
  const PaymentFormCard = ({
25
27
  variant = "default",
@@ -29,12 +31,12 @@ const PaymentFormCard = ({
29
31
  actions,
30
32
  showErrors,
31
33
  handleSubmit = noop,
32
- isMobile,
33
34
  showWalletCheckbox,
34
35
  saveToWallet,
35
36
  walletCheckboxMarked,
36
37
  deniedCards
37
38
  }) => {
39
+ const { isMobile } = useContext(ThemeContext);
38
40
  useEffect(() => {
39
41
  if (deniedCards) {
40
42
  deniedCards.map(card =>
@@ -116,7 +118,10 @@ const PaymentFormCard = ({
116
118
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
117
119
  isNum
118
120
  />
119
- <FormInputRow breakpoint="20rem">
121
+ <FormInputRow
122
+ breakpoint={isMobile ? "1000rem" : "21rem"}
123
+ childGap={isMobile ? "0rem" : "1rem"}
124
+ >
120
125
  <FormInput
121
126
  labelTextWhenNoError="Expiration date (MM/YY)"
122
127
  errorMessages={expirationDateErrors}
@@ -172,4 +177,4 @@ const PaymentFormCard = ({
172
177
  );
173
178
  };
174
179
 
175
- export default PaymentFormCard;
180
+ export default withWindowSize(PaymentFormCard);