@thecb/components 4.1.20 → 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
@@ -20593,6 +20593,8 @@ var FormInput = function FormInput(_ref13) {
20593
20593
  errorMessages = _ref13.errorMessages,
20594
20594
  _ref13$isNum = _ref13.isNum,
20595
20595
  isNum = _ref13$isNum === void 0 ? false : _ref13$isNum,
20596
+ _ref13$isEmail = _ref13.isEmail,
20597
+ isEmail = _ref13$isEmail === void 0 ? false : _ref13$isEmail,
20596
20598
  _ref13$helperModal = _ref13.helperModal,
20597
20599
  helperModal = _ref13$helperModal === void 0 ? false : _ref13$helperModal,
20598
20600
  field = _ref13.field,
@@ -20605,7 +20607,7 @@ var FormInput = function FormInput(_ref13) {
20605
20607
  background = _ref13.background,
20606
20608
  customHeight = _ref13.customHeight,
20607
20609
  extraStyles = _ref13.extraStyles,
20608
- 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"]);
20609
20611
 
20610
20612
  var _useState = React.useState(false),
20611
20613
  _useState2 = _slicedToArray(_useState, 2),
@@ -20672,7 +20674,7 @@ var FormInput = function FormInput(_ref13) {
20672
20674
  type: type,
20673
20675
  value: field.rawValue,
20674
20676
  pattern: isNum ? "[0-9]*" : "",
20675
- inputMode: isNum ? "numeric" : "",
20677
+ inputMode: isNum ? "numeric" : isEmail ? "email" : "text",
20676
20678
  field: field,
20677
20679
  formatter: formatter,
20678
20680
  showErrors: showErrors,
@@ -20688,7 +20690,7 @@ var FormInput = function FormInput(_ref13) {
20688
20690
  type: type === "password" && showPassword ? "text" : type,
20689
20691
  value: field.rawValue,
20690
20692
  pattern: isNum ? "[0-9]*" : "",
20691
- inputMode: isNum ? "numeric" : "",
20693
+ inputMode: isNum ? "numeric" : isEmail ? "email" : "text",
20692
20694
  field: field,
20693
20695
  showErrors: showErrors,
20694
20696
  "data-qa": labelTextWhenNoError,
@@ -35000,7 +35002,8 @@ var EmailForm = function EmailForm(_ref) {
35000
35002
  showErrors: showErrors,
35001
35003
  onKeyDown: function onKeyDown(e) {
35002
35004
  return e.key === "Enter" && handleSubmit(e);
35003
- }
35005
+ },
35006
+ isEmail: true
35004
35007
  }), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
35005
35008
  name: "email checkbox",
35006
35009
  title: "Save email address to wallet",
@@ -35051,7 +35054,8 @@ var ForgotPasswordForm = function ForgotPasswordForm(_ref) {
35051
35054
  showErrors: showErrors,
35052
35055
  onKeyDown: function onKeyDown(e) {
35053
35056
  return e.key === "Enter" && handleSubmit(e);
35054
- }
35057
+ },
35058
+ isEmail: true
35055
35059
  });
35056
35060
  };
35057
35061
 
@@ -35154,7 +35158,8 @@ var LoginForm = function LoginForm(_ref) {
35154
35158
  showErrors: showErrors,
35155
35159
  onKeyDown: function onKeyDown(e) {
35156
35160
  return e.key === "Enter" && handleSubmit(e);
35157
- }
35161
+ },
35162
+ isEmail: true
35158
35163
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
35159
35164
  labelTextWhenNoError: "Password",
35160
35165
  errorMessages: passwordErrorMessages,
@@ -38544,6 +38549,7 @@ var PartialAmountForm = function PartialAmountForm(_ref) {
38544
38549
  },
38545
38550
  placeholder: "$0.00",
38546
38551
  formatter: moneyFormat,
38552
+ isNum: true,
38547
38553
  decorator: /*#__PURE__*/React__default.createElement(Text$1, {
38548
38554
  variant: "p"
38549
38555
  }, "Amount owed:", " ", /*#__PURE__*/React__default.createElement(Text$1, {
@@ -39114,6 +39120,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
39114
39120
  field: fields.routingNumber,
39115
39121
  fieldActions: actions.fields.routingNumber,
39116
39122
  showErrors: showErrors,
39123
+ isNum: true,
39117
39124
  helperModal: function helperModal() {
39118
39125
  return /*#__PURE__*/React__default.createElement(AccountAndRoutingModal$1, {
39119
39126
  link: "What is this?",
@@ -39135,13 +39142,15 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
39135
39142
  showErrors: showErrors,
39136
39143
  onKeyDown: function onKeyDown(e) {
39137
39144
  return e.key === "Enter" && handleSubmit(e);
39138
- }
39145
+ },
39146
+ isNum: true
39139
39147
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
39140
39148
  labelTextWhenNoError: "Account number",
39141
39149
  errorMessages: accountNumberErrors,
39142
39150
  field: fields.accountNumber,
39143
39151
  fieldActions: actions.fields.accountNumber,
39144
39152
  showErrors: showErrors,
39153
+ isNum: true,
39145
39154
  helperModal: function helperModal() {
39146
39155
  return /*#__PURE__*/React__default.createElement(AccountAndRoutingModal$1, {
39147
39156
  link: "What is this?",
@@ -39163,7 +39172,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
39163
39172
  showErrors: showErrors,
39164
39173
  onKeyDown: function onKeyDown(e) {
39165
39174
  return e.key === "Enter" && handleSubmit(e);
39166
- }
39175
+ },
39176
+ isNum: true
39167
39177
  }), allowBankAccountType && /*#__PURE__*/React__default.createElement(FormSelect$1, {
39168
39178
  labelTextWhenNoError: "Account type",
39169
39179
  options: [{
@@ -39298,7 +39308,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
39298
39308
  formatter: creditCardFormat,
39299
39309
  onKeyDown: function onKeyDown(e) {
39300
39310
  return e.key === "Enter" && handleSubmit(e);
39301
- }
39311
+ },
39312
+ isNum: true
39302
39313
  }), /*#__PURE__*/React__default.createElement(FormInputRow, {
39303
39314
  breakpoint: "20rem"
39304
39315
  }, /*#__PURE__*/React__default.createElement(FormInput$1, {
@@ -39310,13 +39321,15 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
39310
39321
  formatter: expirationDateFormat,
39311
39322
  onKeyDown: function onKeyDown(e) {
39312
39323
  return e.key === "Enter" && handleSubmit(e);
39313
- }
39324
+ },
39325
+ isNum: true
39314
39326
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
39315
39327
  labelTextWhenNoError: "CVV",
39316
39328
  errorMessages: cvvErrors,
39317
39329
  field: fields.cvv,
39318
39330
  fieldActions: actions.fields.cvv,
39319
39331
  showErrors: showErrors,
39332
+ isNum: true,
39320
39333
  background: checkCardBrand(fields.creditCardNumber.rawValue) == "AMEX" ? "/AmexCVVHint.svg" : "/CVVHint.svg",
39321
39334
  onKeyDown: function onKeyDown(e) {
39322
39335
  return e.key === "Enter" && handleSubmit(e);
@@ -39415,7 +39428,8 @@ var PhoneForm = function PhoneForm(_ref) {
39415
39428
  formatter: src_2(phoneFormats, formatDelimiter),
39416
39429
  onKeyUp: function onKeyUp(e) {
39417
39430
  return e.key === "Enter" && handleSubmit(e);
39418
- }
39431
+ },
39432
+ isNum: true
39419
39433
  }), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
39420
39434
  name: "phone checkbox",
39421
39435
  title: "Save phone number to wallet",
@@ -39696,7 +39710,8 @@ var RegistrationForm = function RegistrationForm(_ref) {
39696
39710
  onKeyDown: function onKeyDown(e) {
39697
39711
  return e.key === "Enter" && handleSubmit(e);
39698
39712
  },
39699
- type: "email"
39713
+ type: "email",
39714
+ isEmail: true
39700
39715
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
39701
39716
  labelTextWhenNoError: "Password",
39702
39717
  errorMessages: passwordErrorMessages,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "4.1.20",
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}
@@ -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"