@thecb/components 9.2.2 → 9.2.3

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.esm.js CHANGED
@@ -23791,7 +23791,9 @@ var Dropdown = function Dropdown(_ref13) {
23791
23791
  _ref13$smoothScroll = _ref13.smoothScroll,
23792
23792
  smoothScroll = _ref13$smoothScroll === void 0 ? true : _ref13$smoothScroll,
23793
23793
  _ref13$ariaInvalid = _ref13.ariaInvalid,
23794
- ariaInvalid = _ref13$ariaInvalid === void 0 ? false : _ref13$ariaInvalid;
23794
+ ariaInvalid = _ref13$ariaInvalid === void 0 ? false : _ref13$ariaInvalid,
23795
+ _ref13$isRequired = _ref13.isRequired,
23796
+ isRequired = _ref13$isRequired === void 0 ? false : _ref13$isRequired;
23795
23797
 
23796
23798
  var _useState = useState(""),
23797
23799
  _useState2 = _slicedToArray(_useState, 2),
@@ -24062,7 +24064,7 @@ var Dropdown = function Dropdown(_ref13) {
24062
24064
  },
24063
24065
  padding: "12px",
24064
24066
  placeholder: getSelection(),
24065
- required: options.required,
24067
+ required: options.required || isRequired,
24066
24068
  role: "combobox",
24067
24069
  themeValues: themeValues,
24068
24070
  title: hasTitles ? getSelection() : null,
@@ -24230,7 +24232,9 @@ var FormSelect = function FormSelect(_ref) {
24230
24232
  _ref$dataQa = _ref.dataQa,
24231
24233
  dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
24232
24234
  _ref$widthFitOptions = _ref.widthFitOptions,
24233
- widthFitOptions = _ref$widthFitOptions === void 0 ? false : _ref$widthFitOptions;
24235
+ widthFitOptions = _ref$widthFitOptions === void 0 ? false : _ref$widthFitOptions,
24236
+ _ref$isRequired = _ref.isRequired,
24237
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
24234
24238
 
24235
24239
  var _useState = useState(false),
24236
24240
  _useState2 = _slicedToArray(_useState, 2),
@@ -24292,7 +24296,8 @@ var FormSelect = function FormSelect(_ref) {
24292
24296
  },
24293
24297
  disabled: disabled,
24294
24298
  autocompleteValue: autocompleteValue,
24295
- smoothScroll: smoothScroll
24299
+ smoothScroll: smoothScroll,
24300
+ isRequired: isRequired
24296
24301
  }), /*#__PURE__*/React.createElement(Stack, {
24297
24302
  direction: "row",
24298
24303
  justify: "space-between"
@@ -25063,6 +25068,8 @@ var CountryDropdown = function CountryDropdown(_ref) {
25063
25068
  fieldActions = _ref.fieldActions,
25064
25069
  showErrors = _ref.showErrors,
25065
25070
  onChange = _ref.onChange,
25071
+ _ref$isRequired = _ref.isRequired,
25072
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired,
25066
25073
  _ref$dataQa = _ref.dataQa,
25067
25074
  dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
25068
25075
  return /*#__PURE__*/React.createElement(FormSelect$1, {
@@ -25074,7 +25081,8 @@ var CountryDropdown = function CountryDropdown(_ref) {
25074
25081
  errorMessages: errorMessages,
25075
25082
  showErrors: showErrors,
25076
25083
  onChange: onChange,
25077
- autocompleteValue: "country-name"
25084
+ autocompleteValue: "country-name",
25085
+ isRequired: isRequired
25078
25086
  });
25079
25087
  };
25080
25088
 
@@ -25921,7 +25929,7 @@ var fallbackValues$k = {
25921
25929
  };
25922
25930
 
25923
25931
  var _excluded$p = ["showErrors", "themeValues"],
25924
- _excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa"];
25932
+ _excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa", "isRequired"];
25925
25933
  var InputField = styled.input.withConfig({
25926
25934
  displayName: "FormInput__InputField",
25927
25935
  componentId: "sc-l094r1-0"
@@ -26008,6 +26016,8 @@ var FormInput = function FormInput(_ref15) {
26008
26016
  removeFromValue = _ref15.removeFromValue,
26009
26017
  _ref15$dataQa = _ref15.dataQa,
26010
26018
  dataQa = _ref15$dataQa === void 0 ? null : _ref15$dataQa,
26019
+ _ref15$isRequired = _ref15.isRequired,
26020
+ isRequired = _ref15$isRequired === void 0 ? false : _ref15$isRequired,
26011
26021
  props = _objectWithoutProperties(_ref15, _excluded2);
26012
26022
 
26013
26023
  var _useState = useState(false),
@@ -26094,7 +26104,8 @@ var FormInput = function FormInput(_ref15) {
26094
26104
  $customHeight: customHeight,
26095
26105
  $extraStyles: extraStyles,
26096
26106
  "data-qa": dataQa || labelTextWhenNoError,
26097
- autoComplete: autocompleteValue
26107
+ autoComplete: autocompleteValue,
26108
+ required: isRequired
26098
26109
  }, props)) : /*#__PURE__*/React.createElement(InputField, _extends({
26099
26110
  "aria-labelledby": createIdFromString(labelTextWhenNoError),
26100
26111
  "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
@@ -26113,7 +26124,8 @@ var FormInput = function FormInput(_ref15) {
26113
26124
  $customHeight: customHeight,
26114
26125
  $extraStyles: extraStyles,
26115
26126
  "data-qa": dataQa || labelTextWhenNoError,
26116
- autoComplete: autocompleteValue
26127
+ autoComplete: autocompleteValue,
26128
+ required: isRequired
26117
26129
  }, props))), /*#__PURE__*/React.createElement(Stack, {
26118
26130
  direction: "row",
26119
26131
  justify: "space-between",
@@ -27355,7 +27367,9 @@ var RadioButton$1 = function RadioButton(_ref2) {
27355
27367
  _ref2$ariaLabelledBy = _ref2.ariaLabelledBy,
27356
27368
  ariaLabelledBy = _ref2$ariaLabelledBy === void 0 ? "" : _ref2$ariaLabelledBy,
27357
27369
  _ref2$ariaLabel = _ref2.ariaLabel,
27358
- ariaLabel = _ref2$ariaLabel === void 0 ? null : _ref2$ariaLabel;
27370
+ ariaLabel = _ref2$ariaLabel === void 0 ? null : _ref2$ariaLabel,
27371
+ _ref2$isRequired = _ref2.isRequired,
27372
+ isRequired = _ref2$isRequired === void 0 ? false : _ref2$isRequired;
27359
27373
  var buttonBorder = {
27360
27374
  onFocused: {
27361
27375
  borderColor: themeValues.activeColor,
@@ -27417,7 +27431,8 @@ var RadioButton$1 = function RadioButton(_ref2) {
27417
27431
  disabled: disabled,
27418
27432
  onClick: toggleRadio,
27419
27433
  "aria-describedby": ariaDescribedBy,
27420
- tabIndex: "-1"
27434
+ tabIndex: "-1",
27435
+ required: isRequired
27421
27436
  }, extraProps)), /*#__PURE__*/React.createElement(Motion, {
27422
27437
  borderWidth: "1px",
27423
27438
  borderStyle: "solid",
@@ -38107,7 +38122,9 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
38107
38122
  field = _ref.field,
38108
38123
  fieldActions = _ref.fieldActions,
38109
38124
  showErrors = _ref.showErrors,
38110
- countryCode = _ref.countryCode;
38125
+ countryCode = _ref.countryCode,
38126
+ _ref$isRequired = _ref.isRequired,
38127
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
38111
38128
  var placeholder = countryCode === "US" ? placeHolderOptionUS : placeHolderOption;
38112
38129
  var options = [placeholder].concat(_toConsumableArray(getOptions(countryCode)));
38113
38130
  return /*#__PURE__*/React.createElement(FormSelect$1, {
@@ -38117,7 +38134,8 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
38117
38134
  labelTextWhenNoError: labelTextWhenNoError,
38118
38135
  errorMessages: errorMessages,
38119
38136
  showErrors: showErrors,
38120
- autocompleteValue: "address-level1"
38137
+ autocompleteValue: "address-level1",
38138
+ isRequired: isRequired
38121
38139
  });
38122
38140
  };
38123
38141
 
@@ -39456,7 +39474,8 @@ var AddressForm = function AddressForm(_ref) {
39456
39474
  }
39457
39475
  },
39458
39476
  showErrors: showErrors,
39459
- dataQa: "Country"
39477
+ dataQa: "Country",
39478
+ isRequired: true
39460
39479
  }), /*#__PURE__*/React.createElement(FormInput$1, {
39461
39480
  labelTextWhenNoError: "Address",
39462
39481
  errorMessages: street1ErrorMessages,
@@ -39467,7 +39486,8 @@ var AddressForm = function AddressForm(_ref) {
39467
39486
  return e.key === "Enter" && handleSubmit(e);
39468
39487
  },
39469
39488
  autocompleteValue: "address-line1",
39470
- dataQa: "Address"
39489
+ dataQa: "Address",
39490
+ isRequired: true
39471
39491
  }), /*#__PURE__*/React.createElement(FormInput$1, {
39472
39492
  labelTextWhenNoError: "Apt, Suite, Unit, Floor, etc. (Optional)",
39473
39493
  field: fields.street2,
@@ -39488,7 +39508,8 @@ var AddressForm = function AddressForm(_ref) {
39488
39508
  return e.key === "Enter" && handleSubmit(e);
39489
39509
  },
39490
39510
  autocompleteValue: "address-level2",
39491
- dataQa: "City"
39511
+ dataQa: "City",
39512
+ isRequired: true
39492
39513
  }), /*#__PURE__*/React.createElement(FormStateDropdown, {
39493
39514
  labelTextWhenNoError: isUS ? "State" : "State or Province",
39494
39515
  errorMessages: stateProvinceErrorMessages,
@@ -39499,7 +39520,8 @@ var AddressForm = function AddressForm(_ref) {
39499
39520
  onKeyDown: function onKeyDown(e) {
39500
39521
  return e.key === "Enter" && handleSubmit(e);
39501
39522
  },
39502
- dataQa: "State or Province"
39523
+ dataQa: "State or Province",
39524
+ isRequired: true
39503
39525
  }), /*#__PURE__*/React.createElement(FormInput$1, {
39504
39526
  isNum: isUS,
39505
39527
  formatter: isUS ? zipFormat : null,
@@ -39512,7 +39534,8 @@ var AddressForm = function AddressForm(_ref) {
39512
39534
  return e.key === "Enter" && handleSubmit(e);
39513
39535
  },
39514
39536
  autocompleteValue: "postal-code",
39515
- dataQa: "Zip code"
39537
+ dataQa: "Zip code",
39538
+ isRequired: true
39516
39539
  }), showWalletCheckbox && /*#__PURE__*/React.createElement(Checkbox$1, {
39517
39540
  name: "address checkbox",
39518
39541
  title: "Save address to wallet",
@@ -40415,7 +40438,9 @@ var EmailForm = function EmailForm(_ref) {
40415
40438
  handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
40416
40439
  showWalletCheckbox = _ref.showWalletCheckbox,
40417
40440
  saveToWallet = _ref.saveToWallet,
40418
- walletCheckboxMarked = _ref.walletCheckboxMarked;
40441
+ walletCheckboxMarked = _ref.walletCheckboxMarked,
40442
+ _ref$isRequired = _ref.isRequired,
40443
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
40419
40444
 
40420
40445
  if (clearOnDismount) {
40421
40446
  useEffect$1(function () {
@@ -40444,7 +40469,8 @@ var EmailForm = function EmailForm(_ref) {
40444
40469
  },
40445
40470
  isEmail: true,
40446
40471
  autocompleteValue: "email",
40447
- dataQa: "Email address"
40472
+ dataQa: "Email address",
40473
+ isRequired: isRequired
40448
40474
  }), showWalletCheckbox && /*#__PURE__*/React.createElement(Checkbox$1, {
40449
40475
  name: "email checkbox",
40450
40476
  title: "Save email address to wallet",
@@ -47979,7 +48005,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
47979
48005
  onKeyDown: function onKeyDown(e) {
47980
48006
  return e.key === "Enter" && handleSubmit(e);
47981
48007
  },
47982
- autocompleteValue: "name"
48008
+ autocompleteValue: "name",
48009
+ isRequired: true
47983
48010
  }), /*#__PURE__*/React.createElement(FormInput$1, {
47984
48011
  labelTextWhenNoError: "Routing number",
47985
48012
  dataQa: "Routing number",
@@ -48001,7 +48028,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48001
48028
  },
48002
48029
  onKeyDown: function onKeyDown(e) {
48003
48030
  return e.key === "Enter" && handleSubmit(e);
48004
- }
48031
+ },
48032
+ isRequired: true
48005
48033
  }), /*#__PURE__*/React.createElement(FormInput$1, {
48006
48034
  labelTextWhenNoError: "Confirm routing number",
48007
48035
  dataQa: "Confirm routing number",
@@ -48012,7 +48040,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48012
48040
  onKeyDown: function onKeyDown(e) {
48013
48041
  return e.key === "Enter" && handleSubmit(e);
48014
48042
  },
48015
- isNum: true
48043
+ isNum: true,
48044
+ isRequired: true
48016
48045
  }), /*#__PURE__*/React.createElement(FormInput$1, {
48017
48046
  labelTextWhenNoError: "Account number",
48018
48047
  dataQa: "Account number",
@@ -48034,7 +48063,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48034
48063
  },
48035
48064
  onKeyDown: function onKeyDown(e) {
48036
48065
  return e.key === "Enter" && handleSubmit(e);
48037
- }
48066
+ },
48067
+ isRequired: true
48038
48068
  }), /*#__PURE__*/React.createElement(FormInput$1, {
48039
48069
  labelTextWhenNoError: "Confirm account number",
48040
48070
  dataQa: "Confirm account number",
@@ -48045,6 +48075,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48045
48075
  onKeyDown: function onKeyDown(e) {
48046
48076
  return e.key === "Enter" && handleSubmit(e);
48047
48077
  },
48078
+ isRequired: true,
48048
48079
  isNum: true
48049
48080
  }), allowBankAccountType && /*#__PURE__*/React.createElement(FormSelect$1, {
48050
48081
  labelTextWhenNoError: "Account type",
@@ -48062,7 +48093,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48062
48093
  fieldActions: actions.fields.accountType,
48063
48094
  showErrors: showErrors,
48064
48095
  errorMessages: accountTypeErrors,
48065
- field: fields.accountType
48096
+ field: fields.accountType,
48097
+ isRequired: true
48066
48098
  }), !hideDefaultPayment && /*#__PURE__*/React.createElement(Checkbox$1, {
48067
48099
  title: "Save as Default Payment Method",
48068
48100
  dataQa: "default-payment-ach",
@@ -48200,7 +48232,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48200
48232
  onKeyDown: function onKeyDown(e) {
48201
48233
  return e.key === "Enter" && handleSubmit(e);
48202
48234
  },
48203
- autocompleteValue: "cc-name"
48235
+ autocompleteValue: "cc-name",
48236
+ isRequired: true
48204
48237
  }), /*#__PURE__*/React.createElement(FormInput$1, {
48205
48238
  labelTextWhenNoError: "Credit card number",
48206
48239
  dataQa: "Credit card number",
@@ -48213,7 +48246,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48213
48246
  return e.key === "Enter" && handleSubmit(e);
48214
48247
  },
48215
48248
  isNum: true,
48216
- autocompleteValue: "cc-number"
48249
+ autocompleteValue: "cc-number",
48250
+ isRequired: true
48217
48251
  }), /*#__PURE__*/React.createElement(FormInputRow, {
48218
48252
  breakpoint: isMobile ? "1000rem" : "21rem",
48219
48253
  childGap: isMobile ? "0rem" : "1rem"
@@ -48231,7 +48265,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48231
48265
  isNum: true,
48232
48266
  removeFromValue: /\// // removes "/" from browser autofill
48233
48267
  ,
48234
- autocompleteValue: "cc-exp"
48268
+ autocompleteValue: "cc-exp",
48269
+ isRequired: true
48235
48270
  }), /*#__PURE__*/React.createElement(FormInput$1, {
48236
48271
  labelTextWhenNoError: "CVV",
48237
48272
  dataQa: "CVV",
@@ -48244,7 +48279,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48244
48279
  onKeyDown: function onKeyDown(e) {
48245
48280
  return e.key === "Enter" && handleSubmit(e);
48246
48281
  },
48247
- autocompleteValue: "cc-csc"
48282
+ autocompleteValue: "cc-csc",
48283
+ isRequired: true
48248
48284
  })), !hideZipCode && /*#__PURE__*/React.createElement(Box, {
48249
48285
  padding: isMobile ? "0" : "0 0.5rem 0 0",
48250
48286
  width: isMobile ? "100%" : "50%"
@@ -48260,7 +48296,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48260
48296
  onKeyDown: function onKeyDown(e) {
48261
48297
  return e.key === "Enter" && handleSubmit(e);
48262
48298
  },
48263
- autocompleteValue: "billing postal-code"
48299
+ autocompleteValue: "billing postal-code",
48300
+ isRequired: true
48264
48301
  })), (showWalletCheckbox || showTerms) && /*#__PURE__*/React.createElement(Cluster, {
48265
48302
  childGap: "4px",
48266
48303
  align: "center"
@@ -48453,7 +48490,9 @@ var PhoneForm = function PhoneForm(_ref) {
48453
48490
  handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
48454
48491
  showWalletCheckbox = _ref.showWalletCheckbox,
48455
48492
  saveToWallet = _ref.saveToWallet,
48456
- walletCheckboxMarked = _ref.walletCheckboxMarked;
48493
+ walletCheckboxMarked = _ref.walletCheckboxMarked,
48494
+ _ref$isRequired = _ref.isRequired,
48495
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
48457
48496
 
48458
48497
  if (clearOnDismount) {
48459
48498
  useEffect$1(function () {
@@ -48480,7 +48519,8 @@ var PhoneForm = function PhoneForm(_ref) {
48480
48519
  },
48481
48520
  autocompleteValue: "tel-national",
48482
48521
  dataQa: "Phone number",
48483
- isNum: true
48522
+ isNum: true,
48523
+ isRequired: isRequired
48484
48524
  }), showWalletCheckbox && /*#__PURE__*/React.createElement(Checkbox$1, {
48485
48525
  name: "phone checkbox",
48486
48526
  title: "Save phone number to wallet",
@@ -48613,7 +48653,9 @@ var RadioSection = function RadioSection(_ref) {
48613
48653
  openHeight = _ref$openHeight === void 0 ? "auto" : _ref$openHeight,
48614
48654
  _ref$containerStyles = _ref.containerStyles,
48615
48655
  containerStyles = _ref$containerStyles === void 0 ? "" : _ref$containerStyles,
48616
- ariaDescribedBy = _ref.ariaDescribedBy;
48656
+ ariaDescribedBy = _ref.ariaDescribedBy,
48657
+ _ref$isSectionRequire = _ref.isSectionRequired,
48658
+ isSectionRequired = _ref$isSectionRequire === void 0 ? false : _ref$isSectionRequire;
48617
48659
 
48618
48660
  var handleKeyDown = function handleKeyDown(id, e) {
48619
48661
  if ((e === null || e === void 0 ? void 0 : e.keyCode) === 13 || (e === null || e === void 0 ? void 0 : e.keyCode) === 32) {
@@ -48669,7 +48711,8 @@ var RadioSection = function RadioSection(_ref) {
48669
48711
  extraStyles: containerStyles
48670
48712
  }, /*#__PURE__*/React.createElement(Stack, {
48671
48713
  childGap: "0",
48672
- role: "radiogroup"
48714
+ "aria-role": "radiogroup",
48715
+ "aria-required": isSectionRequired
48673
48716
  }, sections.filter(function (section) {
48674
48717
  return !section.hidden;
48675
48718
  }).map(function (section) {
@@ -48691,7 +48734,8 @@ var RadioSection = function RadioSection(_ref) {
48691
48734
  extraStyles: borderStyles,
48692
48735
  role: "radio",
48693
48736
  "aria-checked": openSection === section.id,
48694
- "aria-disabled": section.disabled
48737
+ "aria-disabled": section.disabled,
48738
+ "aria-required": section === null || section === void 0 ? void 0 : section.required
48695
48739
  }, /*#__PURE__*/React.createElement(Stack, {
48696
48740
  childGap: "0"
48697
48741
  }, /*#__PURE__*/React.createElement(Box, {
@@ -48729,7 +48773,8 @@ var RadioSection = function RadioSection(_ref) {
48729
48773
  toggleRadio: section.disabled ? noop : function () {
48730
48774
  return toggleOpenSection(section.id);
48731
48775
  },
48732
- tabIndex: "-1"
48776
+ tabIndex: "-1",
48777
+ isRequired: section === null || section === void 0 ? void 0 : section.required
48733
48778
  })), section.titleIcon && /*#__PURE__*/React.createElement(Cluster, {
48734
48779
  align: "center"
48735
48780
  }, section.titleIcon), /*#__PURE__*/React.createElement(Box, {