@thecb/components 4.1.19 → 4.1.21

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 CHANGED
@@ -14181,9 +14181,7 @@ var WalletIcon = function WalletIcon(_ref) {
14181
14181
  var themeValues = _ref.themeValues;
14182
14182
  return /*#__PURE__*/React__default.createElement("svg", {
14183
14183
  xmlns: "http://www.w3.org/2000/svg",
14184
- width: "299",
14185
- height: "151",
14186
- viewBox: "0 0 299 151"
14184
+ viewBox: "0 0 299 160"
14187
14185
  }, /*#__PURE__*/React__default.createElement("g", {
14188
14186
  fill: "none",
14189
14187
  fillRule: "evenodd",
@@ -20595,6 +20593,8 @@ var FormInput = function FormInput(_ref13) {
20595
20593
  errorMessages = _ref13.errorMessages,
20596
20594
  _ref13$isNum = _ref13.isNum,
20597
20595
  isNum = _ref13$isNum === void 0 ? false : _ref13$isNum,
20596
+ _ref13$isEmail = _ref13.isEmail,
20597
+ isEmail = _ref13$isEmail === void 0 ? false : _ref13$isEmail,
20598
20598
  _ref13$helperModal = _ref13.helperModal,
20599
20599
  helperModal = _ref13$helperModal === void 0 ? false : _ref13$helperModal,
20600
20600
  field = _ref13.field,
@@ -20607,7 +20607,7 @@ var FormInput = function FormInput(_ref13) {
20607
20607
  background = _ref13.background,
20608
20608
  customHeight = _ref13.customHeight,
20609
20609
  extraStyles = _ref13.extraStyles,
20610
- props = _objectWithoutProperties(_ref13, ["type", "labelTextWhenNoError", "errorMessages", "isNum", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "extraStyles"]);
20610
+ props = _objectWithoutProperties(_ref13, ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "extraStyles"]);
20611
20611
 
20612
20612
  var _useState = React.useState(false),
20613
20613
  _useState2 = _slicedToArray(_useState, 2),
@@ -20674,7 +20674,7 @@ var FormInput = function FormInput(_ref13) {
20674
20674
  type: type,
20675
20675
  value: field.rawValue,
20676
20676
  pattern: isNum ? "[0-9]*" : "",
20677
- inputMode: isNum ? "numeric" : "",
20677
+ inputMode: isNum ? "numeric" : isEmail ? "email" : "text",
20678
20678
  field: field,
20679
20679
  formatter: formatter,
20680
20680
  showErrors: showErrors,
@@ -20690,7 +20690,7 @@ var FormInput = function FormInput(_ref13) {
20690
20690
  type: type === "password" && showPassword ? "text" : type,
20691
20691
  value: field.rawValue,
20692
20692
  pattern: isNum ? "[0-9]*" : "",
20693
- inputMode: isNum ? "numeric" : "",
20693
+ inputMode: isNum ? "numeric" : isEmail ? "email" : "text",
20694
20694
  field: field,
20695
20695
  showErrors: showErrors,
20696
20696
  "data-qa": labelTextWhenNoError,
@@ -35002,7 +35002,8 @@ var EmailForm = function EmailForm(_ref) {
35002
35002
  showErrors: showErrors,
35003
35003
  onKeyDown: function onKeyDown(e) {
35004
35004
  return e.key === "Enter" && handleSubmit(e);
35005
- }
35005
+ },
35006
+ isEmail: true
35006
35007
  }), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
35007
35008
  name: "email checkbox",
35008
35009
  title: "Save email address to wallet",
@@ -35053,7 +35054,8 @@ var ForgotPasswordForm = function ForgotPasswordForm(_ref) {
35053
35054
  showErrors: showErrors,
35054
35055
  onKeyDown: function onKeyDown(e) {
35055
35056
  return e.key === "Enter" && handleSubmit(e);
35056
- }
35057
+ },
35058
+ isEmail: true
35057
35059
  });
35058
35060
  };
35059
35061
 
@@ -35156,7 +35158,8 @@ var LoginForm = function LoginForm(_ref) {
35156
35158
  showErrors: showErrors,
35157
35159
  onKeyDown: function onKeyDown(e) {
35158
35160
  return e.key === "Enter" && handleSubmit(e);
35159
- }
35161
+ },
35162
+ isEmail: true
35160
35163
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
35161
35164
  labelTextWhenNoError: "Password",
35162
35165
  errorMessages: passwordErrorMessages,
@@ -38546,6 +38549,7 @@ var PartialAmountForm = function PartialAmountForm(_ref) {
38546
38549
  },
38547
38550
  placeholder: "$0.00",
38548
38551
  formatter: moneyFormat,
38552
+ isNum: true,
38549
38553
  decorator: /*#__PURE__*/React__default.createElement(Text$1, {
38550
38554
  variant: "p"
38551
38555
  }, "Amount owed:", " ", /*#__PURE__*/React__default.createElement(Text$1, {
@@ -39116,6 +39120,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
39116
39120
  field: fields.routingNumber,
39117
39121
  fieldActions: actions.fields.routingNumber,
39118
39122
  showErrors: showErrors,
39123
+ isNum: true,
39119
39124
  helperModal: function helperModal() {
39120
39125
  return /*#__PURE__*/React__default.createElement(AccountAndRoutingModal$1, {
39121
39126
  link: "What is this?",
@@ -39137,13 +39142,15 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
39137
39142
  showErrors: showErrors,
39138
39143
  onKeyDown: function onKeyDown(e) {
39139
39144
  return e.key === "Enter" && handleSubmit(e);
39140
- }
39145
+ },
39146
+ isNum: true
39141
39147
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
39142
39148
  labelTextWhenNoError: "Account number",
39143
39149
  errorMessages: accountNumberErrors,
39144
39150
  field: fields.accountNumber,
39145
39151
  fieldActions: actions.fields.accountNumber,
39146
39152
  showErrors: showErrors,
39153
+ isNum: true,
39147
39154
  helperModal: function helperModal() {
39148
39155
  return /*#__PURE__*/React__default.createElement(AccountAndRoutingModal$1, {
39149
39156
  link: "What is this?",
@@ -39165,7 +39172,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
39165
39172
  showErrors: showErrors,
39166
39173
  onKeyDown: function onKeyDown(e) {
39167
39174
  return e.key === "Enter" && handleSubmit(e);
39168
- }
39175
+ },
39176
+ isNum: true
39169
39177
  }), allowBankAccountType && /*#__PURE__*/React__default.createElement(FormSelect$1, {
39170
39178
  labelTextWhenNoError: "Account type",
39171
39179
  options: [{
@@ -39300,7 +39308,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
39300
39308
  formatter: creditCardFormat,
39301
39309
  onKeyDown: function onKeyDown(e) {
39302
39310
  return e.key === "Enter" && handleSubmit(e);
39303
- }
39311
+ },
39312
+ isNum: true
39304
39313
  }), /*#__PURE__*/React__default.createElement(FormInputRow, {
39305
39314
  breakpoint: "20rem"
39306
39315
  }, /*#__PURE__*/React__default.createElement(FormInput$1, {
@@ -39312,13 +39321,15 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
39312
39321
  formatter: expirationDateFormat,
39313
39322
  onKeyDown: function onKeyDown(e) {
39314
39323
  return e.key === "Enter" && handleSubmit(e);
39315
- }
39324
+ },
39325
+ isNum: true
39316
39326
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
39317
39327
  labelTextWhenNoError: "CVV",
39318
39328
  errorMessages: cvvErrors,
39319
39329
  field: fields.cvv,
39320
39330
  fieldActions: actions.fields.cvv,
39321
39331
  showErrors: showErrors,
39332
+ isNum: true,
39322
39333
  background: checkCardBrand(fields.creditCardNumber.rawValue) == "AMEX" ? "/AmexCVVHint.svg" : "/CVVHint.svg",
39323
39334
  onKeyDown: function onKeyDown(e) {
39324
39335
  return e.key === "Enter" && handleSubmit(e);
@@ -39417,7 +39428,8 @@ var PhoneForm = function PhoneForm(_ref) {
39417
39428
  formatter: src_2(phoneFormats, formatDelimiter),
39418
39429
  onKeyUp: function onKeyUp(e) {
39419
39430
  return e.key === "Enter" && handleSubmit(e);
39420
- }
39431
+ },
39432
+ isNum: true
39421
39433
  }), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
39422
39434
  name: "phone checkbox",
39423
39435
  title: "Save phone number to wallet",
@@ -39698,7 +39710,8 @@ var RegistrationForm = function RegistrationForm(_ref) {
39698
39710
  onKeyDown: function onKeyDown(e) {
39699
39711
  return e.key === "Enter" && handleSubmit(e);
39700
39712
  },
39701
- type: "email"
39713
+ type: "email",
39714
+ isEmail: true
39702
39715
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
39703
39716
  labelTextWhenNoError: "Password",
39704
39717
  errorMessages: passwordErrorMessages,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "4.1.19",
3
+ "version": "4.1.21",
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,7 @@ const FormInput = ({
85
85
  labelTextWhenNoError = "",
86
86
  errorMessages,
87
87
  isNum = false,
88
+ isEmail = false,
88
89
  helperModal = false,
89
90
  field,
90
91
  fieldActions,
@@ -176,7 +177,7 @@ const FormInput = ({
176
177
  type={type}
177
178
  value={field.rawValue}
178
179
  pattern={isNum ? "[0-9]*" : ""}
179
- inputMode={isNum ? "numeric" : ""}
180
+ inputMode={isNum ? "numeric" : isEmail ? "email" : "text"}
180
181
  field={field}
181
182
  formatter={formatter}
182
183
  showErrors={showErrors}
@@ -193,7 +194,7 @@ const FormInput = ({
193
194
  type={type === "password" && showPassword ? "text" : type}
194
195
  value={field.rawValue}
195
196
  pattern={isNum ? "[0-9]*" : ""}
196
- inputMode={isNum ? "numeric" : ""}
197
+ inputMode={isNum ? "numeric" : isEmail ? "email" : "text"}
197
198
  field={field}
198
199
  showErrors={showErrors}
199
200
  data-qa={labelTextWhenNoError}
@@ -4,12 +4,7 @@ import { themeComponent } from "../../../util/themeUtils";
4
4
 
5
5
  const WalletIcon = ({ themeValues }) => {
6
6
  return (
7
- <svg
8
- xmlns="http://www.w3.org/2000/svg"
9
- width="299"
10
- height="151"
11
- viewBox="0 0 299 151"
12
- >
7
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 299 160">
13
8
  <g fill="none" fillRule="evenodd" stroke="none" strokeWidth="1">
14
9
  <g>
15
10
  <path
@@ -45,6 +45,7 @@ const EmailForm = ({
45
45
  fieldActions={actions.fields.email}
46
46
  showErrors={showErrors}
47
47
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
48
+ isEmail
48
49
  />
49
50
  {showWalletCheckbox && (
50
51
  <Checkbox
@@ -26,6 +26,7 @@ const ForgotPasswordForm = ({
26
26
  fieldActions={actions.fields.email}
27
27
  showErrors={showErrors}
28
28
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
29
+ isEmail
29
30
  />
30
31
  );
31
32
  };
@@ -30,6 +30,7 @@ const LoginForm = ({
30
30
  fieldActions={actions.fields.email}
31
31
  showErrors={showErrors}
32
32
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
33
+ isEmail
33
34
  />
34
35
  <FormInput
35
36
  labelTextWhenNoError="Password"
@@ -57,6 +57,7 @@ const PartialAmountForm = ({
57
57
  style={{ textAlign: "right" }}
58
58
  placeholder="$0.00"
59
59
  formatter={moneyFormat}
60
+ isNum
60
61
  decorator={
61
62
  <Text variant="p">
62
63
  Amount owed:{" "}
@@ -77,6 +77,7 @@ const PaymentFormACH = ({
77
77
  field={fields.routingNumber}
78
78
  fieldActions={actions.fields.routingNumber}
79
79
  showErrors={showErrors}
80
+ isNum
80
81
  helperModal={() => (
81
82
  <AccountAndRoutingModal
82
83
  link="What is this?"
@@ -97,6 +98,7 @@ const PaymentFormACH = ({
97
98
  fieldActions={actions.fields.confirmRoutingNumber}
98
99
  showErrors={showErrors}
99
100
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
101
+ isNum
100
102
  />
101
103
  <FormInput
102
104
  labelTextWhenNoError="Account number"
@@ -104,6 +106,7 @@ const PaymentFormACH = ({
104
106
  field={fields.accountNumber}
105
107
  fieldActions={actions.fields.accountNumber}
106
108
  showErrors={showErrors}
109
+ isNum
107
110
  helperModal={() => (
108
111
  <AccountAndRoutingModal
109
112
  link="What is this?"
@@ -124,6 +127,7 @@ const PaymentFormACH = ({
124
127
  fieldActions={actions.fields.confirmAccountNumber}
125
128
  showErrors={showErrors}
126
129
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
130
+ isNum
127
131
  />
128
132
  {allowBankAccountType && (
129
133
  <FormSelect
@@ -94,6 +94,7 @@ const PaymentFormCard = ({
94
94
  showErrors={showErrors}
95
95
  formatter={creditCardFormat}
96
96
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
97
+ isNum
97
98
  />
98
99
  <FormInputRow breakpoint="20rem">
99
100
  <FormInput
@@ -104,6 +105,7 @@ const PaymentFormCard = ({
104
105
  showErrors={showErrors}
105
106
  formatter={expirationDateFormat}
106
107
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
108
+ isNum
107
109
  />
108
110
  <FormInput
109
111
  labelTextWhenNoError="CVV"
@@ -111,6 +113,7 @@ const PaymentFormCard = ({
111
113
  field={fields.cvv}
112
114
  fieldActions={actions.fields.cvv}
113
115
  showErrors={showErrors}
116
+ isNum
114
117
  background={
115
118
  checkCardBrand(fields.creditCardNumber.rawValue) == "AMEX"
116
119
  ? "/AmexCVVHint.svg"
@@ -40,6 +40,7 @@ const PhoneForm = ({
40
40
  showErrors={showErrors}
41
41
  formatter={createFormat(phoneFormats, formatDelimiter)}
42
42
  onKeyUp={e => e.key === "Enter" && handleSubmit(e)}
43
+ isNum
43
44
  />
44
45
  {showWalletCheckbox && (
45
46
  <Checkbox
@@ -76,6 +76,7 @@ const RegistrationForm = ({
76
76
  showErrors={showErrors}
77
77
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
78
78
  type="email"
79
+ isEmail
79
80
  />
80
81
  <FormInput
81
82
  labelTextWhenNoError="Password"