@thecb/components 9.2.4-beta.10 → 9.2.4-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.
Files changed (24) hide show
  1. package/dist/index.cjs.js +108 -52
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +108 -52
  4. package/dist/index.esm.js.map +1 -1
  5. package/package.json +1 -1
  6. package/src/components/atoms/checkbox/Checkbox.js +3 -1
  7. package/src/components/atoms/checkbox/Checkbox.stories.js +3 -2
  8. package/src/components/atoms/country-dropdown/CountryDropdown.js +3 -1
  9. package/src/components/atoms/country-dropdown/CountryDropdown.stories.js +1 -0
  10. package/src/components/atoms/dropdown/Dropdown.js +7 -3
  11. package/src/components/atoms/form-layouts/FormInput.js +3 -0
  12. package/src/components/atoms/form-select/FormSelect.js +22 -9
  13. package/src/components/atoms/form-select/FormSelect.stories.js +2 -2
  14. package/src/components/atoms/radio-button-with-label/RadioButtonWithLabel.js +12 -7
  15. package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.js +4 -1
  16. package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.stories.js +1 -0
  17. package/src/components/molecules/address-form/AddressForm.js +6 -0
  18. package/src/components/molecules/payment-form-ach/PaymentFormACH.js +6 -0
  19. package/src/components/molecules/payment-form-card/PaymentFormCard.js +6 -0
  20. package/src/components/molecules/radio-group/RadioGroup.js +5 -2
  21. package/src/components/molecules/radio-group/RadioGroup.stories.js +1 -0
  22. package/src/components/molecules/radio-section/RadioSection.js +3 -5
  23. package/src/components/molecules/radio-section/RadioSection.stories.js +0 -1
  24. package/src/components/molecules/radio-section/radio-button/RadioButton.js +3 -2
package/dist/index.esm.js CHANGED
@@ -22126,7 +22126,9 @@ var Checkbox = function Checkbox(_ref4) {
22126
22126
  extraStyles = _ref4.extraStyles,
22127
22127
  textExtraStyles = _ref4.textExtraStyles,
22128
22128
  _ref4$dataQa = _ref4.dataQa,
22129
- dataQa = _ref4$dataQa === void 0 ? null : _ref4$dataQa;
22129
+ dataQa = _ref4$dataQa === void 0 ? null : _ref4$dataQa,
22130
+ _ref4$isRequired = _ref4.isRequired,
22131
+ isRequired = _ref4$isRequired === void 0 ? false : _ref4$isRequired;
22130
22132
 
22131
22133
  var _useState = useState(false),
22132
22134
  _useState2 = _slicedToArray(_useState, 2),
@@ -22180,7 +22182,8 @@ var Checkbox = function Checkbox(_ref4) {
22180
22182
  errorStyles: themeValues.errorStyles,
22181
22183
  disabledStyles: themeValues.disabledStyles,
22182
22184
  disabledCheckedStyles: themeValues.disabledCheckedStyles,
22183
- focusedStyles: themeValues.focusedStyles
22185
+ focusedStyles: themeValues.focusedStyles,
22186
+ "aria-required": isRequired
22184
22187
  }, /*#__PURE__*/React.createElement(CheckboxIcon, {
22185
22188
  viewBox: "0 0 24 24",
22186
22189
  disabled: disabled,
@@ -23791,7 +23794,11 @@ var Dropdown = function Dropdown(_ref13) {
23791
23794
  _ref13$smoothScroll = _ref13.smoothScroll,
23792
23795
  smoothScroll = _ref13$smoothScroll === void 0 ? true : _ref13$smoothScroll,
23793
23796
  _ref13$ariaInvalid = _ref13.ariaInvalid,
23794
- ariaInvalid = _ref13$ariaInvalid === void 0 ? false : _ref13$ariaInvalid;
23797
+ ariaInvalid = _ref13$ariaInvalid === void 0 ? false : _ref13$ariaInvalid,
23798
+ _ref13$isRequired = _ref13.isRequired,
23799
+ isRequired = _ref13$isRequired === void 0 ? false : _ref13$isRequired;
23800
+
23801
+ var required = options.required || isRequired;
23795
23802
 
23796
23803
  var _useState = useState(""),
23797
23804
  _useState2 = _slicedToArray(_useState, 2),
@@ -24040,7 +24047,7 @@ var Dropdown = function Dropdown(_ref13) {
24040
24047
  "aria-labelledby": ariaLabelledby,
24041
24048
  "aria-describedby": ariaDescribedby,
24042
24049
  "aria-expanded": isOpen,
24043
- "aria-required": options.required,
24050
+ "aria-required": required,
24044
24051
  "aria-invalid": ariaInvalid,
24045
24052
  background: isOpen ? themeValues.hoverColor : WHITE,
24046
24053
  borderRadius: "2px",
@@ -24062,7 +24069,6 @@ var Dropdown = function Dropdown(_ref13) {
24062
24069
  },
24063
24070
  padding: "12px",
24064
24071
  placeholder: getSelection(),
24065
- required: options.required,
24066
24072
  role: "combobox",
24067
24073
  themeValues: themeValues,
24068
24074
  title: hasTitles ? getSelection() : null,
@@ -24070,6 +24076,9 @@ var Dropdown = function Dropdown(_ref13) {
24070
24076
  tabIndex: 0,
24071
24077
  value: inputValue,
24072
24078
  width: "100%"
24079
+ /* Non-semantic elements need the aria-* version of the attribute */
24080
+ ,
24081
+ "aria-disabled": disabledValues.includes(inputValue)
24073
24082
  }), /*#__PURE__*/React.createElement(IconWrapper, {
24074
24083
  open: isOpen,
24075
24084
  onClick: _onClick
@@ -24080,7 +24089,8 @@ var Dropdown = function Dropdown(_ref13) {
24080
24089
  widthFitOptions: widthFitOptions,
24081
24090
  tabIndex: 0,
24082
24091
  role: "listbox",
24083
- id: "".concat(ariaLabelledby, "_listbox")
24092
+ id: "".concat(ariaLabelledby, "_listbox"),
24093
+ required: required
24084
24094
  }, /*#__PURE__*/React.createElement(Stack, {
24085
24095
  childGap: "0",
24086
24096
  as: "ul"
@@ -24230,7 +24240,9 @@ var FormSelect = function FormSelect(_ref) {
24230
24240
  _ref$dataQa = _ref.dataQa,
24231
24241
  dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
24232
24242
  _ref$widthFitOptions = _ref.widthFitOptions,
24233
- widthFitOptions = _ref$widthFitOptions === void 0 ? false : _ref$widthFitOptions;
24243
+ widthFitOptions = _ref$widthFitOptions === void 0 ? false : _ref$widthFitOptions,
24244
+ _ref$isRequired = _ref.isRequired,
24245
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
24234
24246
 
24235
24247
  var _useState = useState(false),
24236
24248
  _useState2 = _slicedToArray(_useState, 2),
@@ -24238,6 +24250,17 @@ var FormSelect = function FormSelect(_ref) {
24238
24250
  setOpen = _useState2[1];
24239
24251
 
24240
24252
  var dropdownRef = useRef(null);
24253
+ var required = (options === null || options === void 0 ? void 0 : options.required) || isRequired;
24254
+ var labelId = useMemo(function () {
24255
+ return function (labelTextWhenNoError) {
24256
+ return createIdFromString(labelTextWhenNoError);
24257
+ };
24258
+ }, [labelTextWhenNoError]);
24259
+ var descriptionId = useMemo(function () {
24260
+ return function (field, labelTextWhenNoError) {
24261
+ return field.hasErrors && field.dirty ? labelId(labelTextWhenNoError) + "error-message" : "";
24262
+ };
24263
+ }, [field, labelTextWhenNoError]);
24241
24264
 
24242
24265
  var handleClickAway = function handleClickAway(event) {
24243
24266
  if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
@@ -24253,8 +24276,8 @@ var FormSelect = function FormSelect(_ref) {
24253
24276
  });
24254
24277
  return /*#__PURE__*/React.createElement(SelectContainer, {
24255
24278
  ref: dropdownRef,
24279
+ "aria-role": "group",
24256
24280
  disabled: disabled,
24257
- "aria-disabled": disabled,
24258
24281
  "data-qa": dataQa
24259
24282
  }, /*#__PURE__*/React.createElement(Box, {
24260
24283
  padding: "0",
@@ -24268,10 +24291,10 @@ var FormSelect = function FormSelect(_ref) {
24268
24291
  color: themeValues.labelColor,
24269
24292
  weight: themeValues.fontWeight,
24270
24293
  extraStyles: "word-break: break-word;\n font-family: Public Sans;\n &::first-letter {\n text-transform: uppercase;\n }",
24271
- id: createIdFromString(labelTextWhenNoError)
24294
+ id: labelId(labelTextWhenNoError)
24272
24295
  }, labelTextWhenNoError))), /*#__PURE__*/React.createElement(Dropdown$1, {
24273
- ariaLabelledby: createIdFromString(labelTextWhenNoError),
24274
- ariaDescribedby: createIdFromString(labelTextWhenNoError, "error message"),
24296
+ ariaLabelledby: labelId(labelTextWhenNoError),
24297
+ ariaDescribedby: descriptionId(field, labelTextWhenNoError),
24275
24298
  maxHeight: dropdownMaxHeight,
24276
24299
  widthFitOptions: widthFitOptions,
24277
24300
  hasTitles: hasTitles,
@@ -24292,7 +24315,8 @@ var FormSelect = function FormSelect(_ref) {
24292
24315
  },
24293
24316
  disabled: disabled,
24294
24317
  autocompleteValue: autocompleteValue,
24295
- smoothScroll: smoothScroll
24318
+ smoothScroll: smoothScroll,
24319
+ isRequired: required
24296
24320
  }), /*#__PURE__*/React.createElement(Stack, {
24297
24321
  direction: "row",
24298
24322
  justify: "space-between"
@@ -25064,7 +25088,9 @@ var CountryDropdown = function CountryDropdown(_ref) {
25064
25088
  showErrors = _ref.showErrors,
25065
25089
  onChange = _ref.onChange,
25066
25090
  _ref$dataQa = _ref.dataQa,
25067
- dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
25091
+ dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
25092
+ _ref$isRequired = _ref.isRequired,
25093
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
25068
25094
  return /*#__PURE__*/React.createElement(FormSelect$1, {
25069
25095
  options: options,
25070
25096
  field: field,
@@ -25074,7 +25100,8 @@ var CountryDropdown = function CountryDropdown(_ref) {
25074
25100
  errorMessages: errorMessages,
25075
25101
  showErrors: showErrors,
25076
25102
  onChange: onChange,
25077
- autocompleteValue: "country-name"
25103
+ autocompleteValue: "country-name",
25104
+ isRequired: isRequired
25078
25105
  });
25079
25106
  };
25080
25107
 
@@ -25921,7 +25948,7 @@ var fallbackValues$k = {
25921
25948
  };
25922
25949
 
25923
25950
  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"];
25951
+ _excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa", "isRequired"];
25925
25952
  var InputField = styled.input.withConfig({
25926
25953
  displayName: "FormInput__InputField",
25927
25954
  componentId: "sc-l094r1-0"
@@ -26008,6 +26035,8 @@ var FormInput = function FormInput(_ref15) {
26008
26035
  removeFromValue = _ref15.removeFromValue,
26009
26036
  _ref15$dataQa = _ref15.dataQa,
26010
26037
  dataQa = _ref15$dataQa === void 0 ? null : _ref15$dataQa,
26038
+ _ref15$isRequired = _ref15.isRequired,
26039
+ isRequired = _ref15$isRequired === void 0 ? false : _ref15$isRequired,
26011
26040
  props = _objectWithoutProperties(_ref15, _excluded2);
26012
26041
 
26013
26042
  var _useState = useState(false),
@@ -26094,7 +26123,8 @@ var FormInput = function FormInput(_ref15) {
26094
26123
  $customHeight: customHeight,
26095
26124
  $extraStyles: extraStyles,
26096
26125
  "data-qa": dataQa || labelTextWhenNoError,
26097
- autoComplete: autocompleteValue
26126
+ autoComplete: autocompleteValue,
26127
+ required: isRequired
26098
26128
  }, props)) : /*#__PURE__*/React.createElement(InputField, _extends({
26099
26129
  "aria-labelledby": createIdFromString(labelTextWhenNoError),
26100
26130
  "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
@@ -26113,7 +26143,8 @@ var FormInput = function FormInput(_ref15) {
26113
26143
  $customHeight: customHeight,
26114
26144
  $extraStyles: extraStyles,
26115
26145
  "data-qa": dataQa || labelTextWhenNoError,
26116
- autoComplete: autocompleteValue
26146
+ autoComplete: autocompleteValue,
26147
+ required: isRequired
26117
26148
  }, props))), /*#__PURE__*/React.createElement(Stack, {
26118
26149
  direction: "row",
26119
26150
  justify: "space-between",
@@ -27246,7 +27277,7 @@ var HiddenRadioInput = styled.input.withConfig({
27246
27277
  var Circle = styled.div.withConfig({
27247
27278
  displayName: "RadioButtonWithLabel__Circle",
27248
27279
  componentId: "sc-1m9whwg-1"
27249
- })(["flex-shrink:0;margin-right:8px;width:1.5rem;height 1.5rem;border:", ";border-radius:50%;box-sizing:border-box;padding:2px;:after{content:\"\";width:100%;height:100%;display:block;background:", ";border-radius:50%;transform:scale(0);}"], function (_ref) {
27280
+ })(["flex-shrink:0;margin-right:8px;width:1.5rem;height:1.5rem;border:", ";border-radius:50%;box-sizing:border-box;padding:2px;:after{content:\"\";width:100%;height:100%;display:block;background:", ";border-radius:50%;transform:scale(0);}"], function (_ref) {
27250
27281
  var inactiveBorderColor = _ref.inactiveBorderColor;
27251
27282
  return "1px solid ".concat(inactiveBorderColor);
27252
27283
  }, function (_ref2) {
@@ -27256,12 +27287,12 @@ var Circle = styled.div.withConfig({
27256
27287
  var InputAndLabelContainer = styled(Cluster).withConfig({
27257
27288
  displayName: "RadioButtonWithLabel__InputAndLabelContainer",
27258
27289
  componentId: "sc-1m9whwg-2"
27259
- })(["overflow:visible;", ":checked + label ", ":after{transform:scale(0.85);transition:transform 0.15s;}", ":checked + label ", "{border:", "}", ":focus + label ", "{{box-shadow:", "}"], HiddenRadioInput, Circle, HiddenRadioInput, Circle, function (_ref3) {
27290
+ })(["overflow:visible;", ":checked + label ", ":after{transform:scale(0.85);transition:transform 0.15s;}", ":checked + label ", "{border:", ";}", ":focus + label ", "{box-shadow:", ";}"], HiddenRadioInput, Circle, HiddenRadioInput, Circle, function (_ref3) {
27260
27291
  var activeColor = _ref3.activeColor;
27261
- return "1px solid ".concat(activeColor, ";");
27292
+ return "1px solid " + activeColor;
27262
27293
  }, HiddenRadioInput, Circle, function (_ref4) {
27263
27294
  var activeColor = _ref4.activeColor;
27264
- return "0px 0px 2px 1px ".concat(activeColor, ";");
27295
+ return "0px 0px 2px 1px " + activeColor;
27265
27296
  });
27266
27297
 
27267
27298
  var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
@@ -27279,7 +27310,9 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
27279
27310
  _ref5$handleChange = _ref5.handleChange,
27280
27311
  handleChange = _ref5$handleChange === void 0 ? noop : _ref5$handleChange,
27281
27312
  field = _ref5.field,
27282
- config = _ref5.config;
27313
+ config = _ref5.config,
27314
+ _ref5$isRequired = _ref5.isRequired,
27315
+ isRequired = _ref5$isRequired === void 0 ? false : _ref5$isRequired;
27283
27316
 
27284
27317
  var getDefaultChecked = function getDefaultChecked(value, idx) {
27285
27318
  var selectionExistsInConfig = config === null || config === void 0 ? void 0 : config.map(function (c) {
@@ -27312,7 +27345,8 @@ var RadioButtonWithLabel = function RadioButtonWithLabel(_ref5) {
27312
27345
  setValue(e.target.value);
27313
27346
  handleChange(e);
27314
27347
  },
27315
- defaultChecked: getDefaultChecked(value, index)
27348
+ defaultChecked: getDefaultChecked(value, index),
27349
+ required: isRequired
27316
27350
  }), /*#__PURE__*/React.createElement(Text$1, {
27317
27351
  as: "label",
27318
27352
  htmlFor: id,
@@ -27356,8 +27390,8 @@ var RadioButton$1 = function RadioButton(_ref2) {
27356
27390
  ariaLabelledBy = _ref2$ariaLabelledBy === void 0 ? "" : _ref2$ariaLabelledBy,
27357
27391
  _ref2$ariaLabel = _ref2.ariaLabel,
27358
27392
  ariaLabel = _ref2$ariaLabel === void 0 ? null : _ref2$ariaLabel,
27359
- _ref2$isRequired = _ref2.isRequired,
27360
- isRequired = _ref2$isRequired === void 0 ? false : _ref2$isRequired;
27393
+ _ref2$required = _ref2.required,
27394
+ required = _ref2$required === void 0 ? false : _ref2$required;
27361
27395
  var buttonBorder = {
27362
27396
  onFocused: {
27363
27397
  borderColor: themeValues.activeColor,
@@ -27417,10 +27451,11 @@ var RadioButton$1 = function RadioButton(_ref2) {
27417
27451
  type: "radio",
27418
27452
  id: "radio-".concat(name),
27419
27453
  disabled: disabled,
27454
+ required: required,
27455
+ "aria-required": required,
27420
27456
  onClick: toggleRadio,
27421
27457
  "aria-describedby": ariaDescribedBy,
27422
- tabIndex: "-1",
27423
- required: isRequired
27458
+ tabIndex: "-1"
27424
27459
  }, extraProps)), /*#__PURE__*/React.createElement(Motion, {
27425
27460
  borderWidth: "1px",
27426
27461
  borderStyle: "solid",
@@ -38110,7 +38145,9 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
38110
38145
  field = _ref.field,
38111
38146
  fieldActions = _ref.fieldActions,
38112
38147
  showErrors = _ref.showErrors,
38113
- countryCode = _ref.countryCode;
38148
+ countryCode = _ref.countryCode,
38149
+ _ref$isRequired = _ref.isRequired,
38150
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
38114
38151
  var placeholder = countryCode === "US" ? placeHolderOptionUS : placeHolderOption;
38115
38152
  var options = [placeholder].concat(_toConsumableArray(getOptions(countryCode)));
38116
38153
  return /*#__PURE__*/React.createElement(FormSelect$1, {
@@ -38120,7 +38157,8 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
38120
38157
  labelTextWhenNoError: labelTextWhenNoError,
38121
38158
  errorMessages: errorMessages,
38122
38159
  showErrors: showErrors,
38123
- autocompleteValue: "address-level1"
38160
+ autocompleteValue: "address-level1",
38161
+ isRequired: isRequired
38124
38162
  });
38125
38163
  };
38126
38164
 
@@ -39446,6 +39484,7 @@ var AddressForm = function AddressForm(_ref) {
39446
39484
  labelTextWhenNoError: "Country",
39447
39485
  errorMessages: countryErrorMessages,
39448
39486
  field: fields.country,
39487
+ isRequired: true,
39449
39488
  onChange: function onChange(value) {
39450
39489
  actions.fields.country.set(value); // temporary measure to not dirty fields until
39451
39490
  // we can write a reset function for fields
@@ -39470,7 +39509,8 @@ var AddressForm = function AddressForm(_ref) {
39470
39509
  return e.key === "Enter" && handleSubmit(e);
39471
39510
  },
39472
39511
  autocompleteValue: "address-line1",
39473
- dataQa: "Address"
39512
+ dataQa: "Address",
39513
+ isRequired: true
39474
39514
  }), /*#__PURE__*/React.createElement(FormInput$1, {
39475
39515
  labelTextWhenNoError: "Apt, Suite, Unit, Floor, etc. (Optional)",
39476
39516
  field: fields.street2,
@@ -39480,7 +39520,8 @@ var AddressForm = function AddressForm(_ref) {
39480
39520
  return e.key === "Enter" && handleSubmit(e);
39481
39521
  },
39482
39522
  autocompleteValue: "address-line2",
39483
- dataQa: "Address Line 2"
39523
+ dataQa: "Address Line 2",
39524
+ isRequired: false
39484
39525
  }), /*#__PURE__*/React.createElement(FormInput$1, {
39485
39526
  labelTextWhenNoError: "City",
39486
39527
  errorMessages: cityErrorMessages,
@@ -39491,7 +39532,8 @@ var AddressForm = function AddressForm(_ref) {
39491
39532
  return e.key === "Enter" && handleSubmit(e);
39492
39533
  },
39493
39534
  autocompleteValue: "address-level2",
39494
- dataQa: "City"
39535
+ dataQa: "City",
39536
+ isRequired: true
39495
39537
  }), /*#__PURE__*/React.createElement(FormStateDropdown, {
39496
39538
  labelTextWhenNoError: isUS ? "State" : "State or Province",
39497
39539
  errorMessages: stateProvinceErrorMessages,
@@ -39502,7 +39544,8 @@ var AddressForm = function AddressForm(_ref) {
39502
39544
  onKeyDown: function onKeyDown(e) {
39503
39545
  return e.key === "Enter" && handleSubmit(e);
39504
39546
  },
39505
- dataQa: "State or Province"
39547
+ dataQa: "State or Province",
39548
+ isRequired: true
39506
39549
  }), /*#__PURE__*/React.createElement(FormInput$1, {
39507
39550
  isNum: isUS,
39508
39551
  formatter: isUS ? zipFormat : null,
@@ -39515,7 +39558,8 @@ var AddressForm = function AddressForm(_ref) {
39515
39558
  return e.key === "Enter" && handleSubmit(e);
39516
39559
  },
39517
39560
  autocompleteValue: "postal-code",
39518
- dataQa: "Zip code"
39561
+ dataQa: "Zip code",
39562
+ isRequired: true
39519
39563
  }), showWalletCheckbox && /*#__PURE__*/React.createElement(Checkbox$1, {
39520
39564
  name: "address checkbox",
39521
39565
  title: "Save address to wallet",
@@ -47982,7 +48026,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
47982
48026
  onKeyDown: function onKeyDown(e) {
47983
48027
  return e.key === "Enter" && handleSubmit(e);
47984
48028
  },
47985
- autocompleteValue: "name"
48029
+ autocompleteValue: "name",
48030
+ isRequired: true
47986
48031
  }), /*#__PURE__*/React.createElement(FormInput$1, {
47987
48032
  labelTextWhenNoError: "Routing number",
47988
48033
  dataQa: "Routing number",
@@ -48004,7 +48049,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48004
48049
  },
48005
48050
  onKeyDown: function onKeyDown(e) {
48006
48051
  return e.key === "Enter" && handleSubmit(e);
48007
- }
48052
+ },
48053
+ isRequired: true
48008
48054
  }), /*#__PURE__*/React.createElement(FormInput$1, {
48009
48055
  labelTextWhenNoError: "Confirm routing number",
48010
48056
  dataQa: "Confirm routing number",
@@ -48015,6 +48061,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48015
48061
  onKeyDown: function onKeyDown(e) {
48016
48062
  return e.key === "Enter" && handleSubmit(e);
48017
48063
  },
48064
+ isRequired: true,
48018
48065
  isNum: true
48019
48066
  }), /*#__PURE__*/React.createElement(FormInput$1, {
48020
48067
  labelTextWhenNoError: "Account number",
@@ -48023,6 +48070,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48023
48070
  field: fields.accountNumber,
48024
48071
  fieldActions: actions.fields.accountNumber,
48025
48072
  showErrors: showErrors,
48073
+ isRequired: true,
48026
48074
  isNum: true,
48027
48075
  helperModal: function helperModal() {
48028
48076
  return /*#__PURE__*/React.createElement(AccountAndRoutingModal$1, {
@@ -48041,6 +48089,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48041
48089
  }), /*#__PURE__*/React.createElement(FormInput$1, {
48042
48090
  labelTextWhenNoError: "Confirm account number",
48043
48091
  dataQa: "Confirm account number",
48092
+ isRequired: true,
48044
48093
  errorMessages: confirmAccountNumberErrors,
48045
48094
  field: fields.confirmAccountNumber,
48046
48095
  fieldActions: actions.fields.confirmAccountNumber,
@@ -48051,6 +48100,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48051
48100
  isNum: true
48052
48101
  }), allowBankAccountType && /*#__PURE__*/React.createElement(FormSelect$1, {
48053
48102
  labelTextWhenNoError: "Account type",
48103
+ isRequired: true,
48054
48104
  dataQa: "Account type",
48055
48105
  options: [{
48056
48106
  text: "Select account type",
@@ -48181,6 +48231,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48181
48231
  "aria-label": "Card payment"
48182
48232
  }, /*#__PURE__*/React.createElement(FormInputColumn, null, !hideZipCode && /*#__PURE__*/React.createElement(CountryDropdown, {
48183
48233
  labelTextWhenNoError: "Country",
48234
+ isRequired: true,
48184
48235
  errorMessages: countryErrorMessages,
48185
48236
  field: fields.country,
48186
48237
  onChange: function onChange(value) {
@@ -48203,8 +48254,10 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48203
48254
  onKeyDown: function onKeyDown(e) {
48204
48255
  return e.key === "Enter" && handleSubmit(e);
48205
48256
  },
48206
- autocompleteValue: "cc-name"
48257
+ autocompleteValue: "cc-name",
48258
+ isRequired: true
48207
48259
  }), /*#__PURE__*/React.createElement(FormInput$1, {
48260
+ isRequired: true,
48208
48261
  labelTextWhenNoError: "Credit card number",
48209
48262
  dataQa: "Credit card number",
48210
48263
  errorMessages: creditCardNumberErrors,
@@ -48234,7 +48287,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48234
48287
  isNum: true,
48235
48288
  removeFromValue: /\// // removes "/" from browser autofill
48236
48289
  ,
48237
- autocompleteValue: "cc-exp"
48290
+ autocompleteValue: "cc-exp",
48291
+ isRequired: true
48238
48292
  }), /*#__PURE__*/React.createElement(FormInput$1, {
48239
48293
  labelTextWhenNoError: "CVV",
48240
48294
  dataQa: "CVV",
@@ -48247,7 +48301,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48247
48301
  onKeyDown: function onKeyDown(e) {
48248
48302
  return e.key === "Enter" && handleSubmit(e);
48249
48303
  },
48250
- autocompleteValue: "cc-csc"
48304
+ autocompleteValue: "cc-csc",
48305
+ isRequired: true
48251
48306
  })), !hideZipCode && /*#__PURE__*/React.createElement(Box, {
48252
48307
  padding: isMobile ? "0" : "0 0.5rem 0 0",
48253
48308
  width: isMobile ? "100%" : "50%"
@@ -48263,7 +48318,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48263
48318
  onKeyDown: function onKeyDown(e) {
48264
48319
  return e.key === "Enter" && handleSubmit(e);
48265
48320
  },
48266
- autocompleteValue: "billing postal-code"
48321
+ autocompleteValue: "billing postal-code",
48322
+ isRequired: true
48267
48323
  })), (showWalletCheckbox || showTerms) && /*#__PURE__*/React.createElement(Cluster, {
48268
48324
  childGap: "4px",
48269
48325
  align: "center"
@@ -48511,7 +48567,7 @@ PhoneForm.mapDispatchToProps = mapDispatchToProps$8;
48511
48567
  var DefaultHeading = styled.div.withConfig({
48512
48568
  displayName: "RadioGroup__DefaultHeading",
48513
48569
  componentId: "sc-7lqrl8-0"
48514
- })(["font-size:0.875rem;color:", " margin:0;padding:8px 0px;"], CHARADE_GREY);
48570
+ })(["font-size:0.875rem;color:", ";margin:0;padding:8px 0px;"], CHARADE_GREY);
48515
48571
  var StyledFieldset = styled.fieldset.withConfig({
48516
48572
  displayName: "RadioGroup__StyledFieldset",
48517
48573
  componentId: "sc-7lqrl8-1"
@@ -48532,7 +48588,9 @@ var RadioGroup = function RadioGroup(_ref) {
48532
48588
  _ref$handleChange = _ref.handleChange,
48533
48589
  handleChange = _ref$handleChange === void 0 ? noop : _ref$handleChange,
48534
48590
  field = _ref.field,
48535
- fieldActions = _ref.fieldActions;
48591
+ fieldActions = _ref.fieldActions,
48592
+ _ref$isRequired = _ref.isRequired,
48593
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
48536
48594
 
48537
48595
  var setValue = function setValue(value) {
48538
48596
  return fieldActions.set(value);
@@ -48541,7 +48599,8 @@ var RadioGroup = function RadioGroup(_ref) {
48541
48599
  return /*#__PURE__*/React.createElement(StyledFieldset, {
48542
48600
  role: "radiogroup",
48543
48601
  "aria-labelledby": "radio-group-".concat(groupName, "-heading"),
48544
- $extraStyles: extraStyles
48602
+ $extraStyles: extraStyles,
48603
+ required: isRequired
48545
48604
  }, Heading !== null && Heading, /*#__PURE__*/React.createElement(Stack, {
48546
48605
  childGap: "4px"
48547
48606
  }, config.map(function (c, idx) {
@@ -48554,7 +48613,8 @@ var RadioGroup = function RadioGroup(_ref) {
48554
48613
  handleChange: handleChange,
48555
48614
  field: field,
48556
48615
  config: config,
48557
- "aria-invalid": field.dirty && field.hasErrors
48616
+ "aria-invalid": field.dirty && field.hasErrors,
48617
+ isRequired: isRequired
48558
48618
  }));
48559
48619
  })));
48560
48620
  };
@@ -48616,9 +48676,7 @@ var RadioSection = function RadioSection(_ref) {
48616
48676
  openHeight = _ref$openHeight === void 0 ? "auto" : _ref$openHeight,
48617
48677
  _ref$containerStyles = _ref.containerStyles,
48618
48678
  containerStyles = _ref$containerStyles === void 0 ? "" : _ref$containerStyles,
48619
- ariaDescribedBy = _ref.ariaDescribedBy,
48620
- _ref$isSectionRequire = _ref.isSectionRequired,
48621
- isSectionRequired = _ref$isSectionRequire === void 0 ? false : _ref$isSectionRequire;
48679
+ ariaDescribedBy = _ref.ariaDescribedBy;
48622
48680
 
48623
48681
  var handleKeyDown = function handleKeyDown(id, e) {
48624
48682
  if ((e === null || e === void 0 ? void 0 : e.keyCode) === 13 || (e === null || e === void 0 ? void 0 : e.keyCode) === 32) {
@@ -48674,8 +48732,7 @@ var RadioSection = function RadioSection(_ref) {
48674
48732
  extraStyles: containerStyles
48675
48733
  }, /*#__PURE__*/React.createElement(Stack, {
48676
48734
  childGap: "0",
48677
- role: "radiogroup",
48678
- "aria-required": isSectionRequired
48735
+ role: "radiogroup"
48679
48736
  }, sections.filter(function (section) {
48680
48737
  return !section.hidden;
48681
48738
  }).map(function (section) {
@@ -48697,8 +48754,7 @@ var RadioSection = function RadioSection(_ref) {
48697
48754
  extraStyles: borderStyles,
48698
48755
  role: "radio",
48699
48756
  "aria-checked": openSection === section.id,
48700
- "aria-disabled": section.disabled,
48701
- "aria-required": !!(section !== null && section !== void 0 && section.required)
48757
+ "aria-disabled": section.disabled
48702
48758
  }, /*#__PURE__*/React.createElement(Stack, {
48703
48759
  childGap: "0"
48704
48760
  }, /*#__PURE__*/React.createElement(Box, {
@@ -48737,7 +48793,7 @@ var RadioSection = function RadioSection(_ref) {
48737
48793
  return toggleOpenSection(section.id);
48738
48794
  },
48739
48795
  tabIndex: "-1",
48740
- isRequired: !!(section !== null && section !== void 0 && section.required)
48796
+ required: section === null || section === void 0 ? void 0 : section.required
48741
48797
  })), section.titleIcon && /*#__PURE__*/React.createElement(Cluster, {
48742
48798
  align: "center"
48743
48799
  }, section.titleIcon), /*#__PURE__*/React.createElement(Box, {