@thecb/components 9.3.0-beta.0 → 9.3.0-beta.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/dist/index.esm.js CHANGED
@@ -22122,7 +22122,9 @@ var Checkbox = function Checkbox(_ref4) {
22122
22122
  extraStyles = _ref4.extraStyles,
22123
22123
  textExtraStyles = _ref4.textExtraStyles,
22124
22124
  _ref4$dataQa = _ref4.dataQa,
22125
- dataQa = _ref4$dataQa === void 0 ? null : _ref4$dataQa;
22125
+ dataQa = _ref4$dataQa === void 0 ? null : _ref4$dataQa,
22126
+ _ref4$isRequired = _ref4.isRequired,
22127
+ isRequired = _ref4$isRequired === void 0 ? false : _ref4$isRequired;
22126
22128
 
22127
22129
  var _useState = useState(false),
22128
22130
  _useState2 = _slicedToArray(_useState, 2),
@@ -22176,7 +22178,8 @@ var Checkbox = function Checkbox(_ref4) {
22176
22178
  errorStyles: themeValues.errorStyles,
22177
22179
  disabledStyles: themeValues.disabledStyles,
22178
22180
  disabledCheckedStyles: themeValues.disabledCheckedStyles,
22179
- focusedStyles: themeValues.focusedStyles
22181
+ focusedStyles: themeValues.focusedStyles,
22182
+ "aria-required": isRequired
22180
22183
  }, /*#__PURE__*/React.createElement(CheckboxIcon, {
22181
22184
  viewBox: "0 0 24 24",
22182
22185
  disabled: disabled,
@@ -24202,7 +24205,8 @@ var FormSelect = function FormSelect(_ref) {
24202
24205
  dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
24203
24206
  _ref$widthFitOptions = _ref.widthFitOptions,
24204
24207
  widthFitOptions = _ref$widthFitOptions === void 0 ? false : _ref$widthFitOptions,
24205
- _ref$isRequired = _ref.isRequired;
24208
+ _ref$isRequired = _ref.isRequired,
24209
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
24206
24210
 
24207
24211
  var _useState = useState(false),
24208
24212
  _useState2 = _slicedToArray(_useState, 2),
@@ -24210,6 +24214,7 @@ var FormSelect = function FormSelect(_ref) {
24210
24214
  setOpen = _useState2[1];
24211
24215
 
24212
24216
  var dropdownRef = useRef(null);
24217
+ var required = (options === null || options === void 0 ? void 0 : options.required) || isRequired;
24213
24218
  var labelId = useMemo(function () {
24214
24219
  return function (labelTextWhenNoError) {
24215
24220
  return createIdFromString(labelTextWhenNoError);
@@ -24275,7 +24280,7 @@ var FormSelect = function FormSelect(_ref) {
24275
24280
  disabled: disabled,
24276
24281
  autocompleteValue: autocompleteValue,
24277
24282
  smoothScroll: smoothScroll,
24278
- required: options === null || options === void 0 ? void 0 : options.required
24283
+ isRequired: required
24279
24284
  }), /*#__PURE__*/React.createElement(Stack, {
24280
24285
  direction: "row",
24281
24286
  justify: "space-between"
@@ -27283,7 +27288,9 @@ var RadioButton$1 = function RadioButton(_ref2) {
27283
27288
  _ref2$ariaLabelledBy = _ref2.ariaLabelledBy,
27284
27289
  ariaLabelledBy = _ref2$ariaLabelledBy === void 0 ? "" : _ref2$ariaLabelledBy,
27285
27290
  _ref2$ariaLabel = _ref2.ariaLabel,
27286
- ariaLabel = _ref2$ariaLabel === void 0 ? null : _ref2$ariaLabel;
27291
+ ariaLabel = _ref2$ariaLabel === void 0 ? null : _ref2$ariaLabel,
27292
+ _ref2$required = _ref2.required,
27293
+ required = _ref2$required === void 0 ? false : _ref2$required;
27287
27294
  var buttonBorder = {
27288
27295
  onFocused: {
27289
27296
  borderColor: themeValues.activeColor,
@@ -27343,6 +27350,8 @@ var RadioButton$1 = function RadioButton(_ref2) {
27343
27350
  type: "radio",
27344
27351
  id: "radio-".concat(name),
27345
27352
  disabled: disabled,
27353
+ required: required,
27354
+ "aria-required": required,
27346
27355
  onClick: toggleRadio,
27347
27356
  "aria-describedby": ariaDescribedBy,
27348
27357
  tabIndex: "-1"
@@ -38048,7 +38057,7 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
38048
38057
  errorMessages: errorMessages,
38049
38058
  showErrors: showErrors,
38050
38059
  autocompleteValue: "address-level1",
38051
- isRequired: (options === null || options === void 0 ? void 0 : options.required) || isRequired
38060
+ isRequired: isRequired
38052
38061
  });
38053
38062
  };
38054
38063
 
@@ -39399,7 +39408,8 @@ var AddressForm = function AddressForm(_ref) {
39399
39408
  return e.key === "Enter" && handleSubmit(e);
39400
39409
  },
39401
39410
  autocompleteValue: "address-line1",
39402
- dataQa: "Address"
39411
+ dataQa: "Address",
39412
+ isRequired: true
39403
39413
  }), /*#__PURE__*/React.createElement(FormInput$1, {
39404
39414
  labelTextWhenNoError: "Apt, Suite, Unit, Floor, etc. (Optional)",
39405
39415
  field: fields.street2,
@@ -39409,7 +39419,8 @@ var AddressForm = function AddressForm(_ref) {
39409
39419
  return e.key === "Enter" && handleSubmit(e);
39410
39420
  },
39411
39421
  autocompleteValue: "address-line2",
39412
- dataQa: "Address Line 2"
39422
+ dataQa: "Address Line 2",
39423
+ isRequired: false
39413
39424
  }), /*#__PURE__*/React.createElement(FormInput$1, {
39414
39425
  labelTextWhenNoError: "City",
39415
39426
  errorMessages: cityErrorMessages,
@@ -39420,7 +39431,8 @@ var AddressForm = function AddressForm(_ref) {
39420
39431
  return e.key === "Enter" && handleSubmit(e);
39421
39432
  },
39422
39433
  autocompleteValue: "address-level2",
39423
- dataQa: "City"
39434
+ dataQa: "City",
39435
+ isRequired: true
39424
39436
  }), /*#__PURE__*/React.createElement(FormStateDropdown, {
39425
39437
  labelTextWhenNoError: isUS ? "State" : "State or Province",
39426
39438
  errorMessages: stateProvinceErrorMessages,
@@ -39431,7 +39443,8 @@ var AddressForm = function AddressForm(_ref) {
39431
39443
  onKeyDown: function onKeyDown(e) {
39432
39444
  return e.key === "Enter" && handleSubmit(e);
39433
39445
  },
39434
- dataQa: "State or Province"
39446
+ dataQa: "State or Province",
39447
+ isRequired: true
39435
39448
  }), /*#__PURE__*/React.createElement(FormInput$1, {
39436
39449
  isNum: isUS,
39437
39450
  formatter: isUS ? zipFormat : null,
@@ -39444,7 +39457,8 @@ var AddressForm = function AddressForm(_ref) {
39444
39457
  return e.key === "Enter" && handleSubmit(e);
39445
39458
  },
39446
39459
  autocompleteValue: "postal-code",
39447
- dataQa: "Zip code"
39460
+ dataQa: "Zip code",
39461
+ isRequired: true
39448
39462
  }), showWalletCheckbox && /*#__PURE__*/React.createElement(Checkbox$1, {
39449
39463
  name: "address checkbox",
39450
39464
  title: "Save address to wallet",
@@ -47729,7 +47743,8 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47729
47743
  title: "Terms and Conditions",
47730
47744
  error: error,
47731
47745
  checked: isChecked,
47732
- onChange: onCheck
47746
+ onChange: onCheck,
47747
+ isRequired: true
47733
47748
  }), /*#__PURE__*/React.createElement(Box, {
47734
47749
  padding: "0 0 0 58px"
47735
47750
  }, /*#__PURE__*/React.createElement(Stack, null, /*#__PURE__*/React.createElement(Box, {
@@ -47842,7 +47857,8 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47842
47857
  checked: isChecked,
47843
47858
  onChange: onCheck,
47844
47859
  checkboxMargin: checkboxMargin,
47845
- extraStyles: "align-self: flex-start;"
47860
+ extraStyles: "align-self: flex-start;",
47861
+ isRequired: true
47846
47862
  }), /*#__PURE__*/React.createElement(Stack, {
47847
47863
  childGap: "0.25rem",
47848
47864
  fullHeight: true
@@ -47948,7 +47964,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
47948
47964
  onKeyDown: function onKeyDown(e) {
47949
47965
  return e.key === "Enter" && handleSubmit(e);
47950
47966
  },
47951
- autocompleteValue: "name"
47967
+ autocompleteValue: "name",
47968
+ isRequired: true
47952
47969
  }), /*#__PURE__*/React.createElement(FormInput$1, {
47953
47970
  labelTextWhenNoError: "Routing number",
47954
47971
  dataQa: "Routing number",
@@ -47970,7 +47987,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
47970
47987
  },
47971
47988
  onKeyDown: function onKeyDown(e) {
47972
47989
  return e.key === "Enter" && handleSubmit(e);
47973
- }
47990
+ },
47991
+ isRequired: true
47974
47992
  }), /*#__PURE__*/React.createElement(FormInput$1, {
47975
47993
  labelTextWhenNoError: "Confirm routing number",
47976
47994
  dataQa: "Confirm routing number",
@@ -47981,6 +47999,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
47981
47999
  onKeyDown: function onKeyDown(e) {
47982
48000
  return e.key === "Enter" && handleSubmit(e);
47983
48001
  },
48002
+ isRequired: true,
47984
48003
  isNum: true
47985
48004
  }), /*#__PURE__*/React.createElement(FormInput$1, {
47986
48005
  labelTextWhenNoError: "Account number",
@@ -47989,6 +48008,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
47989
48008
  field: fields.accountNumber,
47990
48009
  fieldActions: actions.fields.accountNumber,
47991
48010
  showErrors: showErrors,
48011
+ isRequired: true,
47992
48012
  isNum: true,
47993
48013
  helperModal: function helperModal() {
47994
48014
  return /*#__PURE__*/React.createElement(AccountAndRoutingModal$1, {
@@ -48007,6 +48027,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48007
48027
  }), /*#__PURE__*/React.createElement(FormInput$1, {
48008
48028
  labelTextWhenNoError: "Confirm account number",
48009
48029
  dataQa: "Confirm account number",
48030
+ isRequired: true,
48010
48031
  errorMessages: confirmAccountNumberErrors,
48011
48032
  field: fields.confirmAccountNumber,
48012
48033
  fieldActions: actions.fields.confirmAccountNumber,
@@ -48017,6 +48038,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48017
48038
  isNum: true
48018
48039
  }), allowBankAccountType && /*#__PURE__*/React.createElement(FormSelect$1, {
48019
48040
  labelTextWhenNoError: "Account type",
48041
+ isRequired: true,
48020
48042
  dataQa: "Account type",
48021
48043
  options: [{
48022
48044
  text: "Select account type",
@@ -48054,7 +48076,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48054
48076
  version: "v2",
48055
48077
  showCheckbox: false,
48056
48078
  description: "View",
48057
- terms: termsContent
48079
+ terms: termsContent,
48080
+ isRequired: true
48058
48081
  })))));
48059
48082
  };
48060
48083
 
@@ -48170,7 +48193,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48170
48193
  onKeyDown: function onKeyDown(e) {
48171
48194
  return e.key === "Enter" && handleSubmit(e);
48172
48195
  },
48173
- autocompleteValue: "cc-name"
48196
+ autocompleteValue: "cc-name",
48197
+ isRequired: true
48174
48198
  }), /*#__PURE__*/React.createElement(FormInput$1, {
48175
48199
  labelTextWhenNoError: "Credit card number",
48176
48200
  dataQa: "Credit card number",
@@ -48183,7 +48207,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48183
48207
  return e.key === "Enter" && handleSubmit(e);
48184
48208
  },
48185
48209
  isNum: true,
48186
- autocompleteValue: "cc-number"
48210
+ autocompleteValue: "cc-number",
48211
+ isRequired: true
48187
48212
  }), /*#__PURE__*/React.createElement(FormInputRow, {
48188
48213
  breakpoint: isMobile ? "1000rem" : "21rem",
48189
48214
  childGap: isMobile ? "0rem" : "1rem"
@@ -48201,7 +48226,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48201
48226
  isNum: true,
48202
48227
  removeFromValue: /\// // removes "/" from browser autofill
48203
48228
  ,
48204
- autocompleteValue: "cc-exp"
48229
+ autocompleteValue: "cc-exp",
48230
+ isRequired: true
48205
48231
  }), /*#__PURE__*/React.createElement(FormInput$1, {
48206
48232
  labelTextWhenNoError: "CVV",
48207
48233
  dataQa: "CVV",
@@ -48214,7 +48240,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48214
48240
  onKeyDown: function onKeyDown(e) {
48215
48241
  return e.key === "Enter" && handleSubmit(e);
48216
48242
  },
48217
- autocompleteValue: "cc-csc"
48243
+ autocompleteValue: "cc-csc",
48244
+ isRequired: true
48218
48245
  })), !hideZipCode && /*#__PURE__*/React.createElement(Box, {
48219
48246
  padding: isMobile ? "0" : "0 0.5rem 0 0",
48220
48247
  width: isMobile ? "100%" : "50%"
@@ -48230,7 +48257,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48230
48257
  onKeyDown: function onKeyDown(e) {
48231
48258
  return e.key === "Enter" && handleSubmit(e);
48232
48259
  },
48233
- autocompleteValue: "billing postal-code"
48260
+ autocompleteValue: "billing postal-code",
48261
+ isRequired: true
48234
48262
  })), (showWalletCheckbox || showTerms) && /*#__PURE__*/React.createElement(Cluster, {
48235
48263
  childGap: "4px",
48236
48264
  align: "center"
@@ -48246,7 +48274,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48246
48274
  version: "v2",
48247
48275
  showCheckbox: false,
48248
48276
  description: "View",
48249
- terms: termsContent
48277
+ terms: termsContent,
48278
+ isRequired: true
48250
48279
  })))));
48251
48280
  };
48252
48281
 
@@ -48699,7 +48728,8 @@ var RadioSection = function RadioSection(_ref) {
48699
48728
  toggleRadio: section.disabled ? noop : function () {
48700
48729
  return toggleOpenSection(section.id);
48701
48730
  },
48702
- tabIndex: "-1"
48731
+ tabIndex: "-1",
48732
+ required: section === null || section === void 0 ? void 0 : section.required
48703
48733
  })), section.titleIcon && /*#__PURE__*/React.createElement(Cluster, {
48704
48734
  align: "center"
48705
48735
  }, section.titleIcon), /*#__PURE__*/React.createElement(Box, {
@@ -48711,7 +48741,7 @@ var RadioSection = function RadioSection(_ref) {
48711
48741
  }, section.title))), section.rightIcons && /*#__PURE__*/React.createElement(Cluster, {
48712
48742
  childGap: "0.5rem",
48713
48743
  "aria-label": (section === null || section === void 0 ? void 0 : section.rightIconsLabel) || null,
48714
- role: (section === null || section === void 0 ? void 0 : section.rightIconsRole) || null
48744
+ role: (section === null || section === void 0 ? void 0 : section.rightIconsRole) || "group"
48715
48745
  }, section.rightIcons.map(function (icon) {
48716
48746
  return /*#__PURE__*/React.createElement(RightIcon, {
48717
48747
  src: icon.img,