@thecb/components 9.3.1-beta.0 → 9.3.1-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 (50) hide show
  1. package/dist/index.cjs.js +795 -468
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +169 -60
  4. package/dist/index.esm.js +793 -468
  5. package/dist/index.esm.js.map +1 -1
  6. package/package.json +1 -1
  7. package/src/components/atoms/checkbox/Checkbox.js +8 -1
  8. package/src/components/atoms/checkbox/Checkbox.stories.js +1 -0
  9. package/src/components/atoms/country-dropdown/CountryDropdown.js +2 -0
  10. package/src/components/atoms/dropdown/Dropdown.js +78 -41
  11. package/src/components/atoms/dropdown/Dropdown.theme.js +8 -2
  12. package/src/components/atoms/form-layouts/FormInput.js +3 -0
  13. package/src/components/atoms/form-select/FormSelect.js +19 -15
  14. package/src/components/atoms/icons/AccountNumberImage.js +2 -0
  15. package/src/components/atoms/icons/BankIcon.js +2 -0
  16. package/src/components/atoms/icons/CheckmarkIcon.js +2 -0
  17. package/src/components/atoms/icons/GenericCard.js +2 -0
  18. package/src/components/atoms/icons/GenericCardLarge.js +2 -0
  19. package/src/components/atoms/icons/RoutingNumberImage.js +2 -0
  20. package/src/components/atoms/state-province-dropdown/StateProvinceDropdown.js +3 -1
  21. package/src/components/molecules/address-form/AddressForm.js +5 -0
  22. package/src/components/molecules/email-form/EmailForm.js +3 -1
  23. package/src/components/molecules/index.d.ts +1 -0
  24. package/src/components/molecules/index.js +1 -0
  25. package/src/components/molecules/modal/Modal.js +2 -1
  26. package/src/components/molecules/payment-form-ach/PaymentFormACH.js +6 -0
  27. package/src/components/molecules/payment-form-card/PaymentFormCard.js +5 -0
  28. package/src/components/molecules/phone-form/PhoneForm.js +3 -1
  29. package/src/components/molecules/popover/Popover.js +1 -1
  30. package/src/components/molecules/radio-section/RadioSection.js +313 -124
  31. package/src/components/molecules/radio-section/RadioSection.stories.js +45 -10
  32. package/src/components/molecules/radio-section/radio-button/RadioButton.js +3 -1
  33. package/src/components/molecules/terms-and-conditions/TermsAndConditions.stories.js +3 -1
  34. package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV2.js +5 -1
  35. package/src/components/molecules/toast-notification/ToastNotification.js +75 -0
  36. package/src/components/molecules/toast-notification/ToastNotification.stories.js +67 -0
  37. package/src/components/molecules/toast-notification/index.d.ts +18 -0
  38. package/src/components/molecules/toast-notification/index.js +3 -0
  39. package/src/constants/colors.d.ts +1 -0
  40. package/src/constants/colors.js +5 -1
  41. package/src/hooks/index.js +3 -0
  42. package/src/hooks/use-toast-notification/index.d.ts +23 -0
  43. package/src/hooks/use-toast-notification/index.js +38 -0
  44. package/src/index.d.ts +2 -1
  45. package/src/index.js +2 -1
  46. package/src/types/common/ToastVariants.ts +6 -0
  47. package/src/types/common/index.ts +1 -0
  48. package/src/util/index.js +10 -2
  49. /package/src/{util/useOutsideClick.js → hooks/use-outside-click/index.js} +0 -0
  50. /package/src/{util/useScrollTo.js → hooks/use-scroll-to/index.js} +0 -0
package/dist/index.cjs.js CHANGED
@@ -5019,6 +5019,7 @@ var INFO_BLUE = "#E4F4FD";
5019
5019
  var CORNFLOWER_BLUE = "#EBEFFB";
5020
5020
  var HOVER_LIGHT_BLUE = "#EFFAFF";
5021
5021
  var MATISSE_BLUE = "#15749D";
5022
+ var MATISSE_BLUE_DARK = "#105C7D";
5022
5023
  var ROYAL_BLUE = "#3181E3";
5023
5024
  var ROYAL_BLUE_VIVID = "#3B5BDB";
5024
5025
  var ASTRAL_BLUE = "#3176AA";
@@ -5051,7 +5052,8 @@ var FANTASY_RED = "#FCF4F4";
5051
5052
  var COSMOS_RED = "#FFD0D3";
5052
5053
  var BLUSH_RED = "#FFF0F5"; // Second level color constants
5053
5054
 
5054
- var ERROR_COLOR = RAZZMATAZZ_RED; // These colors are sequestered so that the alert component can reference them // by type of alert
5055
+ var ERROR_COLOR = RAZZMATAZZ_RED;
5056
+ var ERROR_BACKGROUND_COLOR = "#FFF4F8"; // These colors are sequestered so that the alert component can reference them // by type of alert
5055
5057
 
5056
5058
  var ALERT_COLORS = {
5057
5059
  warn: {
@@ -5153,6 +5155,7 @@ var colors = /*#__PURE__*/Object.freeze({
5153
5155
  BOSTON_BLUE: BOSTON_BLUE,
5154
5156
  HOVER_LIGHT_BLUE: HOVER_LIGHT_BLUE,
5155
5157
  MATISSE_BLUE: MATISSE_BLUE,
5158
+ MATISSE_BLUE_DARK: MATISSE_BLUE_DARK,
5156
5159
  ROYAL_BLUE: ROYAL_BLUE,
5157
5160
  ROYAL_BLUE_VIVID: ROYAL_BLUE_VIVID,
5158
5161
  ASTRAL_BLUE: ASTRAL_BLUE,
@@ -5182,7 +5185,8 @@ var colors = /*#__PURE__*/Object.freeze({
5182
5185
  RASPBERRY: RASPBERRY,
5183
5186
  ALERT_COLORS: ALERT_COLORS,
5184
5187
  PILL_COLORS: PILL_COLORS,
5185
- ERROR_COLOR: ERROR_COLOR
5188
+ ERROR_COLOR: ERROR_COLOR,
5189
+ ERROR_BACKGROUND_COLOR: ERROR_BACKGROUND_COLOR
5186
5190
  });
5187
5191
 
5188
5192
  var TextSpan = styled__default.span.withConfig({
@@ -13679,7 +13683,9 @@ var AccountNumberImage = function AccountNumberImage() {
13679
13683
  xmlns: "http://www.w3.org/2000/svg",
13680
13684
  width: "371",
13681
13685
  height: "164",
13682
- viewBox: "0 0 371 164"
13686
+ viewBox: "0 0 371 164",
13687
+ role: "img",
13688
+ "aria-label": "A check with the account number highlighted in the bottom center"
13683
13689
  }, /*#__PURE__*/React__default.createElement("g", {
13684
13690
  fill: "none",
13685
13691
  fillRule: "evenodd",
@@ -13760,7 +13766,9 @@ var RoutingNumberImage = function RoutingNumberImage() {
13760
13766
  xmlns: "http://www.w3.org/2000/svg",
13761
13767
  width: "371",
13762
13768
  height: "164",
13763
- viewBox: "0 0 371 164"
13769
+ viewBox: "0 0 371 164",
13770
+ role: "img",
13771
+ "aria-label": "A check with the routing number highlighted in the lower left hand corner"
13764
13772
  }, /*#__PURE__*/React__default.createElement("g", {
13765
13773
  fill: "none",
13766
13774
  fillRule: "evenodd",
@@ -13843,7 +13851,9 @@ var CheckmarkIcon = function CheckmarkIcon() {
13843
13851
  viewBox: "0 0 98 98",
13844
13852
  version: "1.1",
13845
13853
  xmlns: "http://www.w3.org/2000/svg",
13846
- xmlnsXlink: "http://www.w3.org/1999/xlink"
13854
+ xmlnsXlink: "http://www.w3.org/1999/xlink",
13855
+ role: "img",
13856
+ "aria-label": "Successful payment, green checkmark"
13847
13857
  }, /*#__PURE__*/React__default.createElement("g", {
13848
13858
  id: "Cityville-Checkout---Desktop---Logged-In",
13849
13859
  stroke: "none",
@@ -13888,7 +13898,9 @@ var BankIcon = function BankIcon() {
13888
13898
  height: "18",
13889
13899
  viewBox: "0 0 28 18",
13890
13900
  fill: "none",
13891
- xmlns: "http://www.w3.org/2000/svg"
13901
+ xmlns: "http://www.w3.org/2000/svg",
13902
+ role: "img",
13903
+ "aria-label": "Check Payment"
13892
13904
  }, /*#__PURE__*/React__default.createElement("path", {
13893
13905
  d: "M0 2.25C0 1.00736 1.04467 0 2.33333 0H25.6667C26.9553 0 28 1.00736 28 2.25V15.75C28 16.9926 26.9553 18 25.6667 18H2.33333C1.04467 18 0 16.9926 0 15.75V2.25Z",
13894
13906
  fill: "#E4F4FD"
@@ -13935,7 +13947,9 @@ var GenericCard = function GenericCard() {
13935
13947
  height: "18",
13936
13948
  viewBox: "0 0 28 18",
13937
13949
  fill: "none",
13938
- xmlns: "http://www.w3.org/2000/svg"
13950
+ xmlns: "http://www.w3.org/2000/svg",
13951
+ role: "img",
13952
+ "aria-label": "Card Payment"
13939
13953
  }, /*#__PURE__*/React__default.createElement("rect", {
13940
13954
  width: "28",
13941
13955
  height: "18",
@@ -15194,7 +15208,9 @@ var GenericCardLarge = function GenericCardLarge() {
15194
15208
  height: "24",
15195
15209
  viewBox: "0 0 36 24",
15196
15210
  fill: "none",
15197
- xmlns: "http://www.w3.org/2000/svg"
15211
+ xmlns: "http://www.w3.org/2000/svg",
15212
+ role: "img",
15213
+ "aria-label": "Card Payment"
15198
15214
  }, /*#__PURE__*/React__default.createElement("rect", {
15199
15215
  width: "36",
15200
15216
  height: "24",
@@ -22129,6 +22145,7 @@ var Checkbox = function Checkbox(_ref4) {
22129
22145
  checkboxMargin = _ref4$checkboxMargin === void 0 ? "0 16px 0 0" : _ref4$checkboxMargin,
22130
22146
  extraStyles = _ref4.extraStyles,
22131
22147
  textExtraStyles = _ref4.textExtraStyles,
22148
+ labelledById = _ref4.labelledById,
22132
22149
  _ref4$dataQa = _ref4.dataQa,
22133
22150
  dataQa = _ref4$dataQa === void 0 ? null : _ref4$dataQa;
22134
22151
 
@@ -22143,6 +22160,9 @@ var Checkbox = function Checkbox(_ref4) {
22143
22160
  }
22144
22161
  };
22145
22162
 
22163
+ var titleId = title ? "checkboxlabel-".concat(name) : undefined;
22164
+ var ariaLabelledById = labelledById !== null && labelledById !== void 0 ? labelledById : titleId;
22165
+ var ariaLabel = ariaLabelledById ? undefined : name;
22146
22166
  return /*#__PURE__*/React__default.createElement(Box, {
22147
22167
  padding: "0",
22148
22168
  tabIndex: "0",
@@ -22166,7 +22186,8 @@ var Checkbox = function Checkbox(_ref4) {
22166
22186
  id: "checkbox-".concat(name),
22167
22187
  disabled: disabled,
22168
22188
  name: name,
22169
- "aria-label": name,
22189
+ "aria-label": ariaLabel,
22190
+ "aria-labelledby": ariaLabelledById,
22170
22191
  checked: checked,
22171
22192
  onChange: onChange,
22172
22193
  tabIndex: "-1",
@@ -22193,6 +22214,7 @@ var Checkbox = function Checkbox(_ref4) {
22193
22214
  }, /*#__PURE__*/React__default.createElement("polyline", {
22194
22215
  points: "20 6 9 17 4 12"
22195
22216
  })))), title && /*#__PURE__*/React__default.createElement(Text$1, {
22217
+ id: titleId,
22196
22218
  variant: "p",
22197
22219
  weight: themeValues.textFontWeight,
22198
22220
  color: themeValues.textColor,
@@ -23698,9 +23720,11 @@ exportTypedArrayMethod$1('at', function at(index) {
23698
23720
 
23699
23721
  var selectedColor = "".concat(MATISSE_BLUE);
23700
23722
  var hoverColor$3 = "".concat(HOVER_LIGHT_BLUE);
23723
+ var focusColor = "".concat(MATISSE_BLUE_DARK);
23701
23724
  var fallbackValues$f = {
23702
23725
  selectedColor: selectedColor,
23703
- hoverColor: hoverColor$3
23726
+ hoverColor: hoverColor$3,
23727
+ focusColor: focusColor
23704
23728
  };
23705
23729
 
23706
23730
  var IconWrapper = styled__default.div.withConfig({
@@ -23723,7 +23747,7 @@ var DropdownContentWrapper = styled__default.div.withConfig({
23723
23747
  var DropdownItemWrapper = styled__default.li.withConfig({
23724
23748
  displayName: "Dropdown__DropdownItemWrapper",
23725
23749
  componentId: "sc-pn6m0h-2"
23726
- })(["background-color:", ";text-align:start;border-width:0px;border-color:transparent;box-shadow:none;padding:1rem;box-sizing:border-box;width:100%;list-style:none;cursor:", ";&:hover{background-color:", ";}&:focus{background-color:", ";outline:none;}"], function (_ref4) {
23750
+ })(["text-align:start;border-width:2px;border-style:solid;border-color:", ";box-shadow:none;box-sizing:border-box;width:100%;list-style:none;cursor:", ";&:hover{border-color:", ";> *{background:", ";border-color:", ";}}&:focus{outline:none;border-color:", ";> *{background:", ";border-color:white;outline:none;}}"], function (_ref4) {
23727
23751
  var selected = _ref4.selected,
23728
23752
  themeValues = _ref4.themeValues;
23729
23753
  return selected ? themeValues.selectedColor : WHITE;
@@ -23731,44 +23755,71 @@ var DropdownItemWrapper = styled__default.li.withConfig({
23731
23755
  var disabled = _ref5.disabled;
23732
23756
  return disabled ? "default" : "pointer";
23733
23757
  }, function (_ref6) {
23734
- var selected = _ref6.selected,
23735
- disabled = _ref6.disabled,
23758
+ var disabled = _ref6.disabled,
23759
+ selected = _ref6.selected,
23736
23760
  themeValues = _ref6.themeValues;
23737
- return selected ? themeValues.selectedColor : disabled ? WHITE : themeValues.hoverColor;
23761
+ return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
23738
23762
  }, function (_ref7) {
23739
23763
  var selected = _ref7.selected,
23740
23764
  disabled = _ref7.disabled,
23741
23765
  themeValues = _ref7.themeValues;
23742
- return selected ? themeValues.selectedColor : disabled ? WHITE : themeValues.hoverColor;
23766
+ return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
23767
+ }, function (_ref8) {
23768
+ var selected = _ref8.selected,
23769
+ disabled = _ref8.disabled,
23770
+ themeValues = _ref8.themeValues;
23771
+ return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
23772
+ }, function (_ref9) {
23773
+ var themeValues = _ref9.themeValues;
23774
+ return themeValues.selectedColor;
23775
+ }, function (_ref10) {
23776
+ var selected = _ref10.selected,
23777
+ disabled = _ref10.disabled,
23778
+ themeValues = _ref10.themeValues;
23779
+ return selected ? themeValues.focusColor : disabled ? WHITE : themeValues.hoverColor;
23780
+ });
23781
+ var DropdownItemBorder = styled__default.div.withConfig({
23782
+ displayName: "Dropdown__DropdownItemBorder",
23783
+ componentId: "sc-pn6m0h-3"
23784
+ })(["background:", ";border-color:", ";border-width:2px;border-style:solid;padding:12px;"], function (_ref11) {
23785
+ var selected = _ref11.selected,
23786
+ themeValues = _ref11.themeValues;
23787
+ return selected ? themeValues.selectedColor : WHITE;
23788
+ }, function (_ref12) {
23789
+ var selected = _ref12.selected,
23790
+ themeValues = _ref12.themeValues;
23791
+ return selected ? themeValues.selectedColor : WHITE;
23743
23792
  });
23744
23793
 
23745
- var Dropdown = function Dropdown(_ref8) {
23746
- var placeholder = _ref8.placeholder,
23747
- options = _ref8.options,
23748
- value = _ref8.value,
23749
- isOpen = _ref8.isOpen,
23750
- isError = _ref8.isError,
23751
- onSelect = _ref8.onSelect,
23752
- _ref8$disabledValues = _ref8.disabledValues,
23753
- disabledValues = _ref8$disabledValues === void 0 ? [] : _ref8$disabledValues,
23754
- _ref8$onClick = _ref8.onClick,
23755
- _onClick = _ref8$onClick === void 0 ? noop : _ref8$onClick,
23756
- themeValues = _ref8.themeValues,
23757
- maxHeight = _ref8.maxHeight,
23758
- _ref8$widthFitOptions = _ref8.widthFitOptions,
23759
- widthFitOptions = _ref8$widthFitOptions === void 0 ? false : _ref8$widthFitOptions,
23760
- disabled = _ref8.disabled,
23761
- _ref8$hasTitles = _ref8.hasTitles,
23762
- hasTitles = _ref8$hasTitles === void 0 ? false : _ref8$hasTitles,
23763
- _ref8$autoEraseTypeAh = _ref8.autoEraseTypeAhead,
23764
- autoEraseTypeAhead = _ref8$autoEraseTypeAh === void 0 ? true : _ref8$autoEraseTypeAh,
23765
- ariaLabelledby = _ref8.ariaLabelledby,
23766
- ariaDescribedby = _ref8.ariaDescribedby,
23767
- autocompleteValue = _ref8.autocompleteValue,
23768
- _ref8$smoothScroll = _ref8.smoothScroll,
23769
- smoothScroll = _ref8$smoothScroll === void 0 ? true : _ref8$smoothScroll,
23770
- _ref8$ariaInvalid = _ref8.ariaInvalid,
23771
- ariaInvalid = _ref8$ariaInvalid === void 0 ? false : _ref8$ariaInvalid;
23794
+ var Dropdown = function Dropdown(_ref13) {
23795
+ var placeholder = _ref13.placeholder,
23796
+ options = _ref13.options,
23797
+ value = _ref13.value,
23798
+ isOpen = _ref13.isOpen,
23799
+ isError = _ref13.isError,
23800
+ onSelect = _ref13.onSelect,
23801
+ _ref13$disabledValues = _ref13.disabledValues,
23802
+ disabledValues = _ref13$disabledValues === void 0 ? [] : _ref13$disabledValues,
23803
+ _ref13$onClick = _ref13.onClick,
23804
+ _onClick = _ref13$onClick === void 0 ? noop : _ref13$onClick,
23805
+ themeValues = _ref13.themeValues,
23806
+ maxHeight = _ref13.maxHeight,
23807
+ _ref13$widthFitOption = _ref13.widthFitOptions,
23808
+ widthFitOptions = _ref13$widthFitOption === void 0 ? false : _ref13$widthFitOption,
23809
+ disabled = _ref13.disabled,
23810
+ _ref13$hasTitles = _ref13.hasTitles,
23811
+ hasTitles = _ref13$hasTitles === void 0 ? false : _ref13$hasTitles,
23812
+ _ref13$autoEraseTypeA = _ref13.autoEraseTypeAhead,
23813
+ autoEraseTypeAhead = _ref13$autoEraseTypeA === void 0 ? true : _ref13$autoEraseTypeA,
23814
+ ariaLabelledby = _ref13.ariaLabelledby,
23815
+ ariaDescribedby = _ref13.ariaDescribedby,
23816
+ autocompleteValue = _ref13.autocompleteValue,
23817
+ _ref13$smoothScroll = _ref13.smoothScroll,
23818
+ smoothScroll = _ref13$smoothScroll === void 0 ? true : _ref13$smoothScroll,
23819
+ _ref13$ariaInvalid = _ref13.ariaInvalid,
23820
+ ariaInvalid = _ref13$ariaInvalid === void 0 ? false : _ref13$ariaInvalid,
23821
+ _ref13$isRequired = _ref13.isRequired,
23822
+ isRequired = _ref13$isRequired === void 0 ? false : _ref13$isRequired;
23772
23823
 
23773
23824
  var _useState = React.useState(""),
23774
23825
  _useState2 = _slicedToArray(_useState, 2),
@@ -23961,11 +24012,13 @@ var Dropdown = function Dropdown(_ref8) {
23961
24012
  clearTimeout(timer);
23962
24013
  setTimer(setTimeout(function () {
23963
24014
  return setInputValue("");
23964
- }, 3000));
24015
+ }, 20000));
23965
24016
  }
23966
24017
 
23967
24018
  setFilteredOptions(options.filter(function (option) {
23968
- return option.value.toLowerCase().startsWith(inputValue.toLowerCase()) || option.text.toLowerCase().startsWith(inputValue.toLowerCase());
24019
+ var _option$value, _option$value$toLower, _option$text, _option$text$toLowerC;
24020
+
24021
+ return (option === null || option === void 0 ? void 0 : (_option$value = option.value) === null || _option$value === void 0 ? void 0 : (_option$value$toLower = _option$value.toLowerCase()) === null || _option$value$toLower === void 0 ? void 0 : _option$value$toLower.indexOf(inputValue === null || inputValue === void 0 ? void 0 : inputValue.toLowerCase())) >= 0 || ((_option$text = option.text) === null || _option$text === void 0 ? void 0 : (_option$text$toLowerC = _option$text.toLowerCase()) === null || _option$text$toLowerC === void 0 ? void 0 : _option$text$toLowerC.indexOf(inputValue === null || inputValue === void 0 ? void 0 : inputValue.toLowerCase())) >= 0;
23969
24022
  }));
23970
24023
  }, [inputValue]);
23971
24024
  React.useEffect(function () {
@@ -24039,7 +24092,7 @@ var Dropdown = function Dropdown(_ref8) {
24039
24092
  },
24040
24093
  padding: "12px",
24041
24094
  placeholder: getSelection(),
24042
- required: options.required,
24095
+ required: options.required || isRequired,
24043
24096
  role: "combobox",
24044
24097
  themeValues: themeValues,
24045
24098
  title: hasTitles ? getSelection() : null,
@@ -24090,11 +24143,15 @@ var Dropdown = function Dropdown(_ref8) {
24090
24143
  onFocus: function onFocus() {
24091
24144
  return setFocusedRef(optionRefs.current[i]);
24092
24145
  }
24146
+ }, /*#__PURE__*/React__default.createElement(DropdownItemBorder, {
24147
+ disabled: disabledValues.includes(choice.value),
24148
+ selected: choice.value === value,
24149
+ themeValues: themeValues
24093
24150
  }, /*#__PURE__*/React__default.createElement(Text$1, {
24094
24151
  variant: "p",
24095
24152
  color: choice.value === value ? WHITE : disabledValues.includes(choice.value) ? STORM_GREY : MINESHAFT_GREY,
24096
- extraStyles: "padding-left: 16px;\n cursor: ".concat(disabledValues.includes(choice.value) ? "default" : "pointer", ";\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;")
24097
- }, choice.text));
24153
+ extraStyles: "padding-left: 16px;\n cursor: ".concat(disabledValues.includes(choice.value) ? "default" : "pointer", ";\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;")
24154
+ }, choice.text)));
24098
24155
  }))) : /*#__PURE__*/React__default.createElement(React.Fragment, null)));
24099
24156
  };
24100
24157
 
@@ -24203,7 +24260,9 @@ var FormSelect = function FormSelect(_ref) {
24203
24260
  _ref$dataQa = _ref.dataQa,
24204
24261
  dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
24205
24262
  _ref$widthFitOptions = _ref.widthFitOptions,
24206
- widthFitOptions = _ref$widthFitOptions === void 0 ? false : _ref$widthFitOptions;
24263
+ widthFitOptions = _ref$widthFitOptions === void 0 ? false : _ref$widthFitOptions,
24264
+ _ref$isRequired = _ref.isRequired,
24265
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
24207
24266
 
24208
24267
  var _useState = React.useState(false),
24209
24268
  _useState2 = _slicedToArray(_useState, 2),
@@ -24265,11 +24324,12 @@ var FormSelect = function FormSelect(_ref) {
24265
24324
  },
24266
24325
  disabled: disabled,
24267
24326
  autocompleteValue: autocompleteValue,
24268
- smoothScroll: smoothScroll
24327
+ smoothScroll: smoothScroll,
24328
+ isRequired: isRequired
24269
24329
  }), /*#__PURE__*/React__default.createElement(Stack, {
24270
24330
  direction: "row",
24271
24331
  justify: "space-between"
24272
- }, /*#__PURE__*/React__default.createElement(Text$1, {
24332
+ }, field.hasErrors && field.dirty || field.hasErrors && showErrors ? /*#__PURE__*/React__default.createElement(Text$1, {
24273
24333
  color: ERROR_COLOR,
24274
24334
  variant: "pXS",
24275
24335
  weight: themeValues.fontWeight,
@@ -24278,7 +24338,9 @@ var FormSelect = function FormSelect(_ref) {
24278
24338
  "aria-live": "polite",
24279
24339
  "aria-atomic": true,
24280
24340
  "data-qa": createIdFromString(labelTextWhenNoError, "error message")
24281
- }, field.hasErrors && field.dirty || field.hasErrors && showErrors ? errorMessages[field.errors[0]] : "")));
24341
+ }, errorMessages[field.errors[0]]) : /*#__PURE__*/React__default.createElement(Text$1, {
24342
+ extraStyles: "height: ".concat(themeValues.lineHeight, ";")
24343
+ })));
24282
24344
  };
24283
24345
 
24284
24346
  var FormSelect$1 = themeComponent(FormSelect, "FormSelect", fallbackValues$g, "default");
@@ -25034,6 +25096,8 @@ var CountryDropdown = function CountryDropdown(_ref) {
25034
25096
  fieldActions = _ref.fieldActions,
25035
25097
  showErrors = _ref.showErrors,
25036
25098
  onChange = _ref.onChange,
25099
+ _ref$isRequired = _ref.isRequired,
25100
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired,
25037
25101
  _ref$dataQa = _ref.dataQa,
25038
25102
  dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
25039
25103
  return /*#__PURE__*/React__default.createElement(FormSelect$1, {
@@ -25045,7 +25109,8 @@ var CountryDropdown = function CountryDropdown(_ref) {
25045
25109
  errorMessages: errorMessages,
25046
25110
  showErrors: showErrors,
25047
25111
  onChange: onChange,
25048
- autocompleteValue: "country-name"
25112
+ autocompleteValue: "country-name",
25113
+ isRequired: isRequired
25049
25114
  });
25050
25115
  };
25051
25116
 
@@ -25209,6 +25274,346 @@ var DisplayBox = function DisplayBox(_ref) {
25209
25274
 
25210
25275
  var DisplayBox$1 = themeComponent(DisplayBox, "DisplayBox", fallbackValues$i);
25211
25276
 
25277
+ /*
25278
+ Hook that assigns a click event listener to the main document element
25279
+ Returns a ref to attach to another element (like an icon/button that triggers a popover)
25280
+ If a click event gets captured by the document and the assigned element isn't the target
25281
+ hook will run whatever handler is passed (eg a function that closes a popover)
25282
+
25283
+ See popover component for implementation
25284
+
25285
+ */
25286
+
25287
+ var useOutsideClickHook = function useOutsideClickHook(handler) {
25288
+ var ref = React.useRef();
25289
+ React.useEffect(function () {
25290
+ }, [ref]);
25291
+ return ref;
25292
+ };
25293
+
25294
+ /*
25295
+ Hook that takes an ID selector for an element on the screen
25296
+ And optionally values for top position, left position, smooth behavior
25297
+ Finds element on screen and scrolls it to the provided coordinates
25298
+
25299
+ (string, number, number, string, number) => undefined;
25300
+ */
25301
+ var useScrollTo = function useScrollTo(id) {
25302
+ var top = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
25303
+ var left = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
25304
+ var behavior = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "auto";
25305
+ var delay = arguments.length > 4 ? arguments[4] : undefined;
25306
+ var scrollItem;
25307
+
25308
+ if (delay) {
25309
+ setTimeout(function () {
25310
+ var _scrollItem;
25311
+
25312
+ scrollItem = document.getElementById(id);
25313
+ (_scrollItem = scrollItem) === null || _scrollItem === void 0 ? void 0 : _scrollItem.scrollTo({
25314
+ top: top,
25315
+ left: left,
25316
+ behavior: behavior
25317
+ });
25318
+ }, delay);
25319
+ } else {
25320
+ var _scrollItem2;
25321
+
25322
+ scrollItem = document.getElementById(id);
25323
+ (_scrollItem2 = scrollItem) === null || _scrollItem2 === void 0 ? void 0 : _scrollItem2.scrollTo({
25324
+ top: top,
25325
+ left: left,
25326
+ behavior: behavior
25327
+ });
25328
+ }
25329
+ };
25330
+
25331
+ var initialToastState = {
25332
+ isOpen: false,
25333
+ variant: "",
25334
+ message: ""
25335
+ };
25336
+
25337
+ var useToastNotification = function useToastNotification() {
25338
+ var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
25339
+ _ref$timeout = _ref.timeout,
25340
+ timeout = _ref$timeout === void 0 ? 5000 : _ref$timeout;
25341
+
25342
+ var _useState = React.useState(initialToastState),
25343
+ _useState2 = _slicedToArray(_useState, 2),
25344
+ toastState = _useState2[0],
25345
+ setToastState = _useState2[1];
25346
+
25347
+ React.useEffect(function () {
25348
+ if (toastState.isOpen) {
25349
+ setTimeout(function () {
25350
+ setToastState(initialToastState);
25351
+ }, timeout);
25352
+ }
25353
+ }, [timeout, toastState.isOpen]);
25354
+
25355
+ var showToast = function showToast(_ref2) {
25356
+ var message = _ref2.message,
25357
+ variant = _ref2.variant;
25358
+ return setToastState({
25359
+ isOpen: true,
25360
+ variant: variant,
25361
+ message: message
25362
+ });
25363
+ };
25364
+
25365
+ var hideToast = function hideToast() {
25366
+ return setToastState(initialToastState);
25367
+ };
25368
+
25369
+ return {
25370
+ isToastOpen: toastState.isOpen,
25371
+ toastVariant: toastState.variant,
25372
+ toastMessage: toastState.message,
25373
+ showToast: showToast,
25374
+ hideToast: hideToast
25375
+ };
25376
+ };
25377
+
25378
+
25379
+
25380
+ var index$4 = /*#__PURE__*/Object.freeze({
25381
+ __proto__: null,
25382
+ useOutsideClick: useOutsideClickHook,
25383
+ useScrollTo: useScrollTo,
25384
+ useToastNotification: useToastNotification
25385
+ });
25386
+
25387
+ var hoverColor$4 = "#116285";
25388
+ var activeColor$4 = "#0E506D";
25389
+ var popoverTriggerColor = "#15749D";
25390
+ var fallbackValues$j = {
25391
+ hoverColor: hoverColor$4,
25392
+ activeColor: activeColor$4,
25393
+ popoverTriggerColor: popoverTriggerColor
25394
+ };
25395
+
25396
+ var arrowBorder = function arrowBorder(borderColor, direction) {
25397
+ var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "8px";
25398
+ var angle = "".concat(width, " solid transparent");
25399
+ var straight = "".concat(width, " solid ").concat(borderColor);
25400
+
25401
+ if (direction == "down") {
25402
+ return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-top: ").concat(straight);
25403
+ } else if (direction == "up") {
25404
+ return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-bottom: ").concat(straight);
25405
+ } else if (direction == "left") {
25406
+ return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-right: ").concat(straight);
25407
+ } else if (direction == "right") {
25408
+ return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-left: ").concat(straight);
25409
+ }
25410
+ };
25411
+
25412
+ var Popover = function Popover(_ref) {
25413
+ var themeValues = _ref.themeValues,
25414
+ _ref$triggerText = _ref.triggerText,
25415
+ triggerText = _ref$triggerText === void 0 ? "" : _ref$triggerText,
25416
+ _ref$content = _ref.content,
25417
+ content = _ref$content === void 0 ? "" : _ref$content,
25418
+ _ref$hasIcon = _ref.hasIcon,
25419
+ hasIcon = _ref$hasIcon === void 0 ? false : _ref$hasIcon,
25420
+ Icon = _ref.icon,
25421
+ _ref$iconHelpText = _ref.iconHelpText,
25422
+ iconHelpText = _ref$iconHelpText === void 0 ? "" : _ref$iconHelpText,
25423
+ _ref$popoverID = _ref.popoverID,
25424
+ popoverID = _ref$popoverID === void 0 ? 0 : _ref$popoverID,
25425
+ _ref$popoverFocus = _ref.popoverFocus,
25426
+ popoverFocus = _ref$popoverFocus === void 0 ? false : _ref$popoverFocus,
25427
+ extraStyles = _ref.extraStyles,
25428
+ textExtraStyles = _ref.textExtraStyles,
25429
+ _ref$minWidth = _ref.minWidth,
25430
+ minWidth = _ref$minWidth === void 0 ? "250px" : _ref$minWidth,
25431
+ _ref$maxWidth = _ref.maxWidth,
25432
+ maxWidth = _ref$maxWidth === void 0 ? "300px" : _ref$maxWidth,
25433
+ _ref$height = _ref.height,
25434
+ height = _ref$height === void 0 ? "auto" : _ref$height,
25435
+ position = _ref.position,
25436
+ arrowPosition = _ref.arrowPosition,
25437
+ _ref$arrowDirection = _ref.arrowDirection,
25438
+ arrowDirection = _ref$arrowDirection === void 0 ? "down" : _ref$arrowDirection,
25439
+ _ref$transform = _ref.transform,
25440
+ transform = _ref$transform === void 0 ? "none" : _ref$transform,
25441
+ buttonExtraStyles = _ref.buttonExtraStyles,
25442
+ _ref$backgroundColor = _ref.backgroundColor,
25443
+ backgroundColor = _ref$backgroundColor === void 0 ? "white" : _ref$backgroundColor,
25444
+ _ref$borderColor = _ref.borderColor,
25445
+ borderColor = _ref$borderColor === void 0 ? "rgba(255, 255, 255, 0.85)" : _ref$borderColor,
25446
+ popoverExtraStyles = _ref.popoverExtraStyles;
25447
+ var hoverColor = themeValues.hoverColor,
25448
+ activeColor = themeValues.activeColor,
25449
+ popoverTriggerColor = themeValues.popoverTriggerColor;
25450
+
25451
+ var _ref2 = position !== null && position !== void 0 ? position : {},
25452
+ _ref2$top = _ref2.top,
25453
+ top = _ref2$top === void 0 ? "-110px" : _ref2$top,
25454
+ _ref2$right = _ref2.right,
25455
+ right = _ref2$right === void 0 ? "auto" : _ref2$right,
25456
+ _ref2$bottom = _ref2.bottom,
25457
+ bottom = _ref2$bottom === void 0 ? "auto" : _ref2$bottom,
25458
+ _ref2$left = _ref2.left,
25459
+ left = _ref2$left === void 0 ? "-225px" : _ref2$left;
25460
+
25461
+ var _ref3 = arrowPosition !== null && arrowPosition !== void 0 ? arrowPosition : {},
25462
+ _ref3$arrowTop = _ref3.arrowTop,
25463
+ arrowTop = _ref3$arrowTop === void 0 ? "auto" : _ref3$arrowTop,
25464
+ _ref3$arrowRight = _ref3.arrowRight,
25465
+ arrowRight = _ref3$arrowRight === void 0 ? "10px" : _ref3$arrowRight,
25466
+ _ref3$arrowBottom = _ref3.arrowBottom,
25467
+ arrowBottom = _ref3$arrowBottom === void 0 ? "-8px" : _ref3$arrowBottom,
25468
+ _ref3$arrowLeft = _ref3.arrowLeft,
25469
+ arrowLeft = _ref3$arrowLeft === void 0 ? "auto" : _ref3$arrowLeft;
25470
+
25471
+ var _useState = React.useState(false),
25472
+ _useState2 = _slicedToArray(_useState, 2),
25473
+ popoverOpen = _useState2[0],
25474
+ togglePopover = _useState2[1];
25475
+
25476
+ var handleTogglePopover = function handleTogglePopover(popoverState) {
25477
+ if (popoverOpen !== popoverState) {
25478
+ togglePopover(popoverState);
25479
+ }
25480
+ };
25481
+
25482
+ var triggerRef = useOutsideClickHook();
25483
+ return /*#__PURE__*/React__default.createElement(Box, {
25484
+ padding: "0",
25485
+ extraStyles: "position: relative; ".concat(extraStyles)
25486
+ }, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
25487
+ action: function action() {
25488
+ return noop;
25489
+ },
25490
+ onFocus: function onFocus() {
25491
+ handleTogglePopover(true);
25492
+ },
25493
+ onBlur: function onBlur() {
25494
+ handleTogglePopover(false);
25495
+ },
25496
+ onKeyDown: function onKeyDown(e) {
25497
+ if (e.keyCode === 27) {
25498
+ handleTogglePopover(false);
25499
+ }
25500
+ },
25501
+ onTouchStart: function onTouchStart() {
25502
+ return handleTogglePopover(true);
25503
+ },
25504
+ onTouchEnd: function onTouchEnd() {
25505
+ return handleTogglePopover(false);
25506
+ },
25507
+ onMouseEnter: function onMouseEnter() {
25508
+ return handleTogglePopover(true);
25509
+ },
25510
+ onMouseLeave: function onMouseLeave() {
25511
+ return handleTogglePopover(false);
25512
+ },
25513
+ contentOverride: true,
25514
+ variant: "smallGhost",
25515
+ tabIndex: "0",
25516
+ id: "btnPopover".concat(popoverID),
25517
+ "aria-expanded": popoverOpen,
25518
+ "aria-labelledby": "btnPopover".concat(popoverID, "_info Disclosure").concat(popoverID),
25519
+ "aria-describedby": "Disclosure".concat(popoverID),
25520
+ "aria-controls": "Disclosed".concat(popoverID),
25521
+ ref: triggerRef,
25522
+ extraStyles: buttonExtraStyles
25523
+ }, hasIcon && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Icon, null), /*#__PURE__*/React__default.createElement(Box, {
25524
+ padding: "0",
25525
+ srOnly: true
25526
+ }, /*#__PURE__*/React__default.createElement(Text$1, {
25527
+ id: "btnPopover".concat(popoverID, "_info")
25528
+ }, iconHelpText))), !hasIcon && /*#__PURE__*/React__default.createElement(Text$1, {
25529
+ color: popoverTriggerColor,
25530
+ extraStyles: "&:active { color: ".concat(activeColor, "; } &:hover { color: ").concat(hoverColor, " }; ").concat(textExtraStyles)
25531
+ }, triggerText)), /*#__PURE__*/React__default.createElement(Box, {
25532
+ background: backgroundColor,
25533
+ borderRadius: "4px",
25534
+ boxShadow: "0px 2px 14px 0px rgb(246, 246, 249), 0px 3px 8px 0px rgb(202, 206, 216)",
25535
+ id: "Disclosed".concat(popoverID),
25536
+ role: "region",
25537
+ "aria-describedby": "Disclosure".concat(popoverID),
25538
+ tabIndex: popoverFocus && popoverOpen ? "0" : "-1",
25539
+ minWidth: minWidth,
25540
+ maxWidth: maxWidth,
25541
+ extraStyles: "\n display: ".concat(popoverOpen ? "block" : "none", "; \n position: absolute; \n top: ").concat(top, "; \n right: ").concat(right, "; \n bottom: ").concat(bottom, "; \n left: ").concat(left, ";\n height: ").concat(height, ";\n transform: ").concat(transform, ";\n ").concat(popoverExtraStyles, ";\n ")
25542
+ }, /*#__PURE__*/React__default.createElement(Paragraph$1, null, content), /*#__PURE__*/React__default.createElement(Box, {
25543
+ padding: "0",
25544
+ extraStyles: "\n position: absolute;\n content: \"\";\n width: 0;\n height: 0;\n ".concat(arrowBorder(borderColor, arrowDirection, "8px"), ";\n filter: drop-shadow(2px 8px 14px black);\n bottom: ").concat(arrowBottom, ";\n right: ").concat(arrowRight, ";\n top: ").concat(arrowTop, ";\n left: ").concat(arrowLeft, ";\n ")
25545
+ })));
25546
+ };
25547
+
25548
+ var Popover$1 = themeComponent(Popover, "Popover", fallbackValues$j);
25549
+
25550
+ var DisplayCard = function DisplayCard(_ref) {
25551
+ var title = _ref.title,
25552
+ item = _ref.item,
25553
+ buttonText = _ref.buttonText,
25554
+ buttonAction = _ref.buttonAction,
25555
+ url = _ref.url,
25556
+ _ref$link = _ref.link,
25557
+ link = _ref$link === void 0 ? false : _ref$link,
25558
+ helpText = _ref.helpText,
25559
+ _ref$hasPopover = _ref.hasPopover,
25560
+ hasPopover = _ref$hasPopover === void 0 ? false : _ref$hasPopover,
25561
+ _ref$popoverTriggerTe = _ref.popoverTriggerText,
25562
+ popoverTriggerText = _ref$popoverTriggerTe === void 0 ? "" : _ref$popoverTriggerTe,
25563
+ _ref$popoverContent = _ref.popoverContent,
25564
+ popoverContent = _ref$popoverContent === void 0 ? "" : _ref$popoverContent,
25565
+ popoverExtraStyles = _ref.popoverExtraStyles,
25566
+ popoverTextExtraStyles = _ref.popoverTextExtraStyles;
25567
+ return /*#__PURE__*/React__default.createElement(Box, {
25568
+ padding: "0 0 16px"
25569
+ }, /*#__PURE__*/React__default.createElement(Stack, {
25570
+ childGap: "0rem"
25571
+ }, /*#__PURE__*/React__default.createElement(Box, {
25572
+ padding: "0 0 8px 0"
25573
+ }, /*#__PURE__*/React__default.createElement(Cluster, {
25574
+ justify: "space-between",
25575
+ align: "center",
25576
+ overflow: true
25577
+ }, /*#__PURE__*/React__default.createElement(Paragraph$1, {
25578
+ variant: "pL",
25579
+ color: CHARADE_GREY,
25580
+ extraStyles: "letter-spacing: 0.29px"
25581
+ }, title), hasPopover && /*#__PURE__*/React__default.createElement(Popover$1, {
25582
+ triggerText: popoverTriggerText,
25583
+ content: popoverContent,
25584
+ popoverExtraStyles: popoverExtraStyles,
25585
+ popoverTextExtraStyles: popoverTextExtraStyles
25586
+ }))), /*#__PURE__*/React__default.createElement(Box, {
25587
+ padding: "0"
25588
+ }, /*#__PURE__*/React__default.createElement(Box, {
25589
+ padding: "24px",
25590
+ borderSize: "1px",
25591
+ borderRadius: "4px",
25592
+ background: WHITE,
25593
+ boxShadow: "0px 2px 14px 0px rgb(246, 246, 249), 0px 3px 8px 0px rgb(202, 206, 216)"
25594
+ }, /*#__PURE__*/React__default.createElement(Cluster, {
25595
+ justify: "space-between",
25596
+ align: "center"
25597
+ }, /*#__PURE__*/React__default.createElement(Text$1, {
25598
+ color: CHARADE_GREY
25599
+ }, item), link ? /*#__PURE__*/React__default.createElement(ButtonWithLink, {
25600
+ text: buttonText,
25601
+ url: url,
25602
+ variant: "smallGhost",
25603
+ dataQa: buttonText,
25604
+ extraStyles: "min-width: 0;"
25605
+ }) : buttonAction ? /*#__PURE__*/React__default.createElement(ButtonWithAction, {
25606
+ text: buttonText,
25607
+ action: buttonAction,
25608
+ variant: "smallGhost",
25609
+ dataQa: buttonText,
25610
+ extraStyles: "min-width: 0;"
25611
+ }) : helpText ? /*#__PURE__*/React__default.createElement(Text$1, {
25612
+ color: STORM_GREY,
25613
+ extraStyles: "font-style: italic;"
25614
+ }, helpText) : /*#__PURE__*/React__default.createElement(React.Fragment, null))))));
25615
+ };
25616
+
25212
25617
  function _extends$2() {
25213
25618
  _extends$2 = Object.assign || function (target) {
25214
25619
  for (var i = 1; i < arguments.length; i++) {
@@ -25487,344 +25892,6 @@ var FormattedInput = function FormattedInput(_ref) {
25487
25892
  }));
25488
25893
  };
25489
25894
 
25490
- var formatDelimiter = "_";
25491
- var phoneFormats = ["", "_", "__", "(___) ", "(___) _", "(___) __", "(___) ___-", "(___) ___-_", "(___) ___-__", "(___) ___-___", "(___) ___-____"];
25492
- var zipFormats = ["", "_", "__", "___", "____", "_____", "______", "_____-__", "_____-___", "_____-____"];
25493
- var creditCardFormats = ["", "_", "__", "___", "____", "____ _", "____ __", "____ ___", "____ ____", "____ ____ _", "____ ____ __", "____ ____ ___", "____ ____ ____", "____ ____ ____ _", "____ ____ ____ __", "____ ____ ____ ___", "____ ____ ____ ____"];
25494
- var moneyFormats = ["", "$0.0_", "$0.__", "$_.__", "$__.__", "$___.__", "$_,___.__", "$__,___.__", "$___,___.__", "$_,___,___.__", "$__,___,___.__", "$___,___,___.__", "$_,___,___,___.__", "$__,___,___,___.__", "$___,___,___,___.__", "$_,___,___,___,___.__"];
25495
- var expirationDateFormats = ["", "_", "__/", "__/_", "__/__"];
25496
- var zipFormat = createFormat(zipFormats, formatDelimiter);
25497
- var creditCardFormat = createFormat(creditCardFormats, formatDelimiter);
25498
- var expirationDateFormat = createFormat(expirationDateFormats, formatDelimiter);
25499
- var phoneFormat = createFormat(phoneFormats, formatDelimiter);
25500
- var moneyFormat = createFormat(moneyFormats, formatDelimiter);
25501
- var renderCardStatus = function renderCardStatus(expirationStatus, expireDate) {
25502
- var textAlign = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "right";
25503
- var as = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "span";
25504
- var ACTIVE = "ACTIVE";
25505
- var EXPIRING_SOON = "EXPIRING_SOON";
25506
- var EXPIRED = "EXPIRED";
25507
- var textMargin = textAlign === "right" ? "auto" : "0";
25508
-
25509
- switch (expirationStatus) {
25510
- case ACTIVE:
25511
- return /*#__PURE__*/React__default.createElement(Text$1, {
25512
- as: as,
25513
- variant: "pXS",
25514
- color: ASH_GREY,
25515
- extraStyles: "text-align: ".concat(textAlign, "; margin: ").concat(textMargin, ";")
25516
- }, "Exp Date ", expireDate);
25517
-
25518
- case EXPIRING_SOON:
25519
- return /*#__PURE__*/React__default.createElement(Text$1, {
25520
- as: as,
25521
- variant: "pXS",
25522
- color: FIRE_YELLOW,
25523
- extraStyles: "text-align: ".concat(textAlign, "; margin: ").concat(textMargin, ";")
25524
- }, "Expiring Soon ", expireDate);
25525
-
25526
- case EXPIRED:
25527
- return /*#__PURE__*/React__default.createElement(Text$1, {
25528
- as: as,
25529
- variant: "pXS",
25530
- color: ASH_GREY,
25531
- extraStyles: "text-align: ".concat(textAlign, "; margin: ").concat(textMargin, ";")
25532
- }, "Expired");
25533
- }
25534
- };
25535
-
25536
- var formats = /*#__PURE__*/Object.freeze({
25537
- __proto__: null,
25538
- formatDelimiter: formatDelimiter,
25539
- phoneFormats: phoneFormats,
25540
- moneyFormats: moneyFormats,
25541
- expirationDateFormats: expirationDateFormats,
25542
- zipFormat: zipFormat,
25543
- creditCardFormat: creditCardFormat,
25544
- expirationDateFormat: expirationDateFormat,
25545
- phoneFormat: phoneFormat,
25546
- moneyFormat: moneyFormat,
25547
- renderCardStatus: renderCardStatus
25548
- });
25549
-
25550
- var useFocusInvalidInput = function useFocusInvalidInput(hasErrors) {
25551
- var resetHasErrors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
25552
- // Only move focus when "hasErrors" is true
25553
- // "hasErrors" is managed by container page of form
25554
- // typically set to "true" on attempted form submission, if errors exist
25555
- // Reset errors, if provided, resets the error state tracking in order to properly re-run
25556
- React.useEffect(function () {
25557
- if (hasErrors) {
25558
- var _inputsWithErrors$;
25559
-
25560
- var inputsWithErrors = document.querySelectorAll("input[aria-invalid=true]");
25561
- inputsWithErrors === null || inputsWithErrors === void 0 ? void 0 : (_inputsWithErrors$ = inputsWithErrors[0]) === null || _inputsWithErrors$ === void 0 ? void 0 : _inputsWithErrors$.focus();
25562
- }
25563
-
25564
- return function () {
25565
- return resetHasErrors(false);
25566
- };
25567
- });
25568
- };
25569
-
25570
- /*
25571
- Hook that assigns a click event listener to the main document element
25572
- Returns a ref to attach to another element (like an icon/button that triggers a popover)
25573
- If a click event gets captured by the document and the assigned element isn't the target
25574
- hook will run whatever handler is passed (eg a function that closes a popover)
25575
-
25576
- See popover component for implementation
25577
-
25578
- */
25579
-
25580
- var useOutsideClickHook = function useOutsideClickHook(handler) {
25581
- var ref = React.useRef();
25582
- React.useEffect(function () {
25583
- }, [ref]);
25584
- return ref;
25585
- };
25586
-
25587
-
25588
-
25589
- var index$4 = /*#__PURE__*/Object.freeze({
25590
- __proto__: null,
25591
- formats: formats,
25592
- general: general,
25593
- theme: themeUtils,
25594
- useFocusInvalidInput: useFocusInvalidInput,
25595
- useOutsideClick: useOutsideClickHook
25596
- });
25597
-
25598
- var hoverColor$4 = "#116285";
25599
- var activeColor$4 = "#0E506D";
25600
- var popoverTriggerColor = "#15749D";
25601
- var fallbackValues$j = {
25602
- hoverColor: hoverColor$4,
25603
- activeColor: activeColor$4,
25604
- popoverTriggerColor: popoverTriggerColor
25605
- };
25606
-
25607
- var arrowBorder = function arrowBorder(borderColor, direction) {
25608
- var width = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "8px";
25609
- var angle = "".concat(width, " solid transparent");
25610
- var straight = "".concat(width, " solid ").concat(borderColor);
25611
-
25612
- if (direction == "down") {
25613
- return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-top: ").concat(straight);
25614
- } else if (direction == "up") {
25615
- return "border-left: ".concat(angle, "; border-right: ").concat(angle, "; border-bottom: ").concat(straight);
25616
- } else if (direction == "left") {
25617
- return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-right: ").concat(straight);
25618
- } else if (direction == "right") {
25619
- return "border-top: ".concat(angle, "; border-bottom: ").concat(angle, "; border-left: ").concat(straight);
25620
- }
25621
- };
25622
-
25623
- var Popover = function Popover(_ref) {
25624
- var themeValues = _ref.themeValues,
25625
- _ref$triggerText = _ref.triggerText,
25626
- triggerText = _ref$triggerText === void 0 ? "" : _ref$triggerText,
25627
- _ref$content = _ref.content,
25628
- content = _ref$content === void 0 ? "" : _ref$content,
25629
- _ref$hasIcon = _ref.hasIcon,
25630
- hasIcon = _ref$hasIcon === void 0 ? false : _ref$hasIcon,
25631
- Icon = _ref.icon,
25632
- _ref$iconHelpText = _ref.iconHelpText,
25633
- iconHelpText = _ref$iconHelpText === void 0 ? "" : _ref$iconHelpText,
25634
- _ref$popoverID = _ref.popoverID,
25635
- popoverID = _ref$popoverID === void 0 ? 0 : _ref$popoverID,
25636
- _ref$popoverFocus = _ref.popoverFocus,
25637
- popoverFocus = _ref$popoverFocus === void 0 ? false : _ref$popoverFocus,
25638
- extraStyles = _ref.extraStyles,
25639
- textExtraStyles = _ref.textExtraStyles,
25640
- _ref$minWidth = _ref.minWidth,
25641
- minWidth = _ref$minWidth === void 0 ? "250px" : _ref$minWidth,
25642
- _ref$maxWidth = _ref.maxWidth,
25643
- maxWidth = _ref$maxWidth === void 0 ? "300px" : _ref$maxWidth,
25644
- _ref$height = _ref.height,
25645
- height = _ref$height === void 0 ? "auto" : _ref$height,
25646
- position = _ref.position,
25647
- arrowPosition = _ref.arrowPosition,
25648
- _ref$arrowDirection = _ref.arrowDirection,
25649
- arrowDirection = _ref$arrowDirection === void 0 ? "down" : _ref$arrowDirection,
25650
- _ref$transform = _ref.transform,
25651
- transform = _ref$transform === void 0 ? "none" : _ref$transform,
25652
- buttonExtraStyles = _ref.buttonExtraStyles,
25653
- _ref$backgroundColor = _ref.backgroundColor,
25654
- backgroundColor = _ref$backgroundColor === void 0 ? "white" : _ref$backgroundColor,
25655
- _ref$borderColor = _ref.borderColor,
25656
- borderColor = _ref$borderColor === void 0 ? "rgba(255, 255, 255, 0.85)" : _ref$borderColor,
25657
- popoverExtraStyles = _ref.popoverExtraStyles;
25658
- var hoverColor = themeValues.hoverColor,
25659
- activeColor = themeValues.activeColor,
25660
- popoverTriggerColor = themeValues.popoverTriggerColor;
25661
-
25662
- var _ref2 = position !== null && position !== void 0 ? position : {},
25663
- _ref2$top = _ref2.top,
25664
- top = _ref2$top === void 0 ? "-110px" : _ref2$top,
25665
- _ref2$right = _ref2.right,
25666
- right = _ref2$right === void 0 ? "auto" : _ref2$right,
25667
- _ref2$bottom = _ref2.bottom,
25668
- bottom = _ref2$bottom === void 0 ? "auto" : _ref2$bottom,
25669
- _ref2$left = _ref2.left,
25670
- left = _ref2$left === void 0 ? "-225px" : _ref2$left;
25671
-
25672
- var _ref3 = arrowPosition !== null && arrowPosition !== void 0 ? arrowPosition : {},
25673
- _ref3$arrowTop = _ref3.arrowTop,
25674
- arrowTop = _ref3$arrowTop === void 0 ? "auto" : _ref3$arrowTop,
25675
- _ref3$arrowRight = _ref3.arrowRight,
25676
- arrowRight = _ref3$arrowRight === void 0 ? "10px" : _ref3$arrowRight,
25677
- _ref3$arrowBottom = _ref3.arrowBottom,
25678
- arrowBottom = _ref3$arrowBottom === void 0 ? "-8px" : _ref3$arrowBottom,
25679
- _ref3$arrowLeft = _ref3.arrowLeft,
25680
- arrowLeft = _ref3$arrowLeft === void 0 ? "auto" : _ref3$arrowLeft;
25681
-
25682
- var _useState = React.useState(false),
25683
- _useState2 = _slicedToArray(_useState, 2),
25684
- popoverOpen = _useState2[0],
25685
- togglePopover = _useState2[1];
25686
-
25687
- var handleTogglePopover = function handleTogglePopover(popoverState) {
25688
- if (popoverOpen !== popoverState) {
25689
- togglePopover(popoverState);
25690
- }
25691
- };
25692
-
25693
- var triggerRef = useOutsideClickHook();
25694
- return /*#__PURE__*/React__default.createElement(Box, {
25695
- padding: "0",
25696
- extraStyles: "position: relative; ".concat(extraStyles)
25697
- }, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
25698
- action: function action() {
25699
- return noop;
25700
- },
25701
- onFocus: function onFocus() {
25702
- handleTogglePopover(true);
25703
- },
25704
- onBlur: function onBlur() {
25705
- handleTogglePopover(false);
25706
- },
25707
- onKeyDown: function onKeyDown(e) {
25708
- if (e.keyCode === 27) {
25709
- handleTogglePopover(false);
25710
- }
25711
- },
25712
- onTouchStart: function onTouchStart() {
25713
- return handleTogglePopover(true);
25714
- },
25715
- onTouchEnd: function onTouchEnd() {
25716
- return handleTogglePopover(false);
25717
- },
25718
- onMouseEnter: function onMouseEnter() {
25719
- return handleTogglePopover(true);
25720
- },
25721
- onMouseLeave: function onMouseLeave() {
25722
- return handleTogglePopover(false);
25723
- },
25724
- contentOverride: true,
25725
- variant: "smallGhost",
25726
- tabIndex: "0",
25727
- id: "btnPopover".concat(popoverID),
25728
- "aria-expanded": popoverOpen,
25729
- "aria-labelledby": "btnPopover".concat(popoverID, "_info Disclosure").concat(popoverID),
25730
- "aria-describedby": "Disclosure".concat(popoverID),
25731
- "aria-controls": "Disclosed".concat(popoverID),
25732
- ref: triggerRef,
25733
- extraStyles: buttonExtraStyles
25734
- }, hasIcon && /*#__PURE__*/React__default.createElement(React__default.Fragment, null, /*#__PURE__*/React__default.createElement(Icon, null), /*#__PURE__*/React__default.createElement(Box, {
25735
- padding: "0",
25736
- srOnly: true
25737
- }, /*#__PURE__*/React__default.createElement(Text$1, {
25738
- id: "btnPopover".concat(popoverID, "_info")
25739
- }, iconHelpText))), !hasIcon && /*#__PURE__*/React__default.createElement(Text$1, {
25740
- color: popoverTriggerColor,
25741
- extraStyles: "&:active { color: ".concat(activeColor, "; } &:hover { color: ").concat(hoverColor, " }; ").concat(textExtraStyles)
25742
- }, triggerText)), /*#__PURE__*/React__default.createElement(Box, {
25743
- background: backgroundColor,
25744
- borderRadius: "4px",
25745
- boxShadow: "0px 2px 14px 0px rgb(246, 246, 249), 0px 3px 8px 0px rgb(202, 206, 216)",
25746
- id: "Disclosed".concat(popoverID),
25747
- role: "region",
25748
- "aria-describedby": "Disclosure".concat(popoverID),
25749
- tabIndex: popoverFocus && popoverOpen ? "0" : "-1",
25750
- minWidth: minWidth,
25751
- maxWidth: maxWidth,
25752
- extraStyles: "\n display: ".concat(popoverOpen ? "block" : "none", "; \n position: absolute; \n top: ").concat(top, "; \n right: ").concat(right, "; \n bottom: ").concat(bottom, "; \n left: ").concat(left, ";\n height: ").concat(height, ";\n transform: ").concat(transform, ";\n ").concat(popoverExtraStyles, ";\n ")
25753
- }, /*#__PURE__*/React__default.createElement(Paragraph$1, null, content), /*#__PURE__*/React__default.createElement(Box, {
25754
- padding: "0",
25755
- extraStyles: "\n position: absolute;\n content: \"\";\n width: 0;\n height: 0;\n ".concat(arrowBorder(borderColor, arrowDirection, "8px"), ";\n filter: drop-shadow(2px 8px 14px black);\n bottom: ").concat(arrowBottom, ";\n right: ").concat(arrowRight, ";\n top: ").concat(arrowTop, ";\n left: ").concat(arrowLeft, ";\n ")
25756
- })));
25757
- };
25758
-
25759
- var Popover$1 = themeComponent(Popover, "Popover", fallbackValues$j);
25760
-
25761
- var DisplayCard = function DisplayCard(_ref) {
25762
- var title = _ref.title,
25763
- item = _ref.item,
25764
- buttonText = _ref.buttonText,
25765
- buttonAction = _ref.buttonAction,
25766
- url = _ref.url,
25767
- _ref$link = _ref.link,
25768
- link = _ref$link === void 0 ? false : _ref$link,
25769
- helpText = _ref.helpText,
25770
- _ref$hasPopover = _ref.hasPopover,
25771
- hasPopover = _ref$hasPopover === void 0 ? false : _ref$hasPopover,
25772
- _ref$popoverTriggerTe = _ref.popoverTriggerText,
25773
- popoverTriggerText = _ref$popoverTriggerTe === void 0 ? "" : _ref$popoverTriggerTe,
25774
- _ref$popoverContent = _ref.popoverContent,
25775
- popoverContent = _ref$popoverContent === void 0 ? "" : _ref$popoverContent,
25776
- popoverExtraStyles = _ref.popoverExtraStyles,
25777
- popoverTextExtraStyles = _ref.popoverTextExtraStyles;
25778
- return /*#__PURE__*/React__default.createElement(Box, {
25779
- padding: "0 0 16px"
25780
- }, /*#__PURE__*/React__default.createElement(Stack, {
25781
- childGap: "0rem"
25782
- }, /*#__PURE__*/React__default.createElement(Box, {
25783
- padding: "0 0 8px 0"
25784
- }, /*#__PURE__*/React__default.createElement(Cluster, {
25785
- justify: "space-between",
25786
- align: "center",
25787
- overflow: true
25788
- }, /*#__PURE__*/React__default.createElement(Paragraph$1, {
25789
- variant: "pL",
25790
- color: CHARADE_GREY,
25791
- extraStyles: "letter-spacing: 0.29px"
25792
- }, title), hasPopover && /*#__PURE__*/React__default.createElement(Popover$1, {
25793
- triggerText: popoverTriggerText,
25794
- content: popoverContent,
25795
- popoverExtraStyles: popoverExtraStyles,
25796
- popoverTextExtraStyles: popoverTextExtraStyles
25797
- }))), /*#__PURE__*/React__default.createElement(Box, {
25798
- padding: "0"
25799
- }, /*#__PURE__*/React__default.createElement(Box, {
25800
- padding: "24px",
25801
- borderSize: "1px",
25802
- borderRadius: "4px",
25803
- background: WHITE,
25804
- boxShadow: "0px 2px 14px 0px rgb(246, 246, 249), 0px 3px 8px 0px rgb(202, 206, 216)"
25805
- }, /*#__PURE__*/React__default.createElement(Cluster, {
25806
- justify: "space-between",
25807
- align: "center"
25808
- }, /*#__PURE__*/React__default.createElement(Text$1, {
25809
- color: CHARADE_GREY
25810
- }, item), link ? /*#__PURE__*/React__default.createElement(ButtonWithLink, {
25811
- text: buttonText,
25812
- url: url,
25813
- variant: "smallGhost",
25814
- dataQa: buttonText,
25815
- extraStyles: "min-width: 0;"
25816
- }) : buttonAction ? /*#__PURE__*/React__default.createElement(ButtonWithAction, {
25817
- text: buttonText,
25818
- action: buttonAction,
25819
- variant: "smallGhost",
25820
- dataQa: buttonText,
25821
- extraStyles: "min-width: 0;"
25822
- }) : helpText ? /*#__PURE__*/React__default.createElement(Text$1, {
25823
- color: STORM_GREY,
25824
- extraStyles: "font-style: italic;"
25825
- }, helpText) : /*#__PURE__*/React__default.createElement(React.Fragment, null))))));
25826
- };
25827
-
25828
25895
  var linkColor$2 = {
25829
25896
  "default": "".concat(MATISSE_BLUE),
25830
25897
  disabled: "".concat(MATISSE_BLUE)
@@ -25890,7 +25957,7 @@ var fallbackValues$k = {
25890
25957
  };
25891
25958
 
25892
25959
  var _excluded$p = ["showErrors", "themeValues"],
25893
- _excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa"];
25960
+ _excluded2 = ["type", "labelTextWhenNoError", "errorMessages", "isNum", "isEmail", "helperModal", "field", "fieldActions", "showErrors", "formatter", "decorator", "themeValues", "background", "customHeight", "autocompleteValue", "extraStyles", "removeFromValue", "dataQa", "isRequired"];
25894
25961
  var InputField = styled__default.input.withConfig({
25895
25962
  displayName: "FormInput__InputField",
25896
25963
  componentId: "sc-l094r1-0"
@@ -25977,6 +26044,8 @@ var FormInput = function FormInput(_ref15) {
25977
26044
  removeFromValue = _ref15.removeFromValue,
25978
26045
  _ref15$dataQa = _ref15.dataQa,
25979
26046
  dataQa = _ref15$dataQa === void 0 ? null : _ref15$dataQa,
26047
+ _ref15$isRequired = _ref15.isRequired,
26048
+ isRequired = _ref15$isRequired === void 0 ? false : _ref15$isRequired,
25980
26049
  props = _objectWithoutProperties(_ref15, _excluded2);
25981
26050
 
25982
26051
  var _useState = React.useState(false),
@@ -26063,7 +26132,8 @@ var FormInput = function FormInput(_ref15) {
26063
26132
  $customHeight: customHeight,
26064
26133
  $extraStyles: extraStyles,
26065
26134
  "data-qa": dataQa || labelTextWhenNoError,
26066
- autoComplete: autocompleteValue
26135
+ autoComplete: autocompleteValue,
26136
+ required: isRequired
26067
26137
  }, props)) : /*#__PURE__*/React__default.createElement(InputField, _extends({
26068
26138
  "aria-labelledby": createIdFromString(labelTextWhenNoError),
26069
26139
  "aria-describedby": createIdFromString(labelTextWhenNoError, "error message"),
@@ -26082,7 +26152,8 @@ var FormInput = function FormInput(_ref15) {
26082
26152
  $customHeight: customHeight,
26083
26153
  $extraStyles: extraStyles,
26084
26154
  "data-qa": dataQa || labelTextWhenNoError,
26085
- autoComplete: autocompleteValue
26155
+ autoComplete: autocompleteValue,
26156
+ required: isRequired
26086
26157
  }, props))), /*#__PURE__*/React__default.createElement(Stack, {
26087
26158
  direction: "row",
26088
26159
  justify: "space-between",
@@ -26291,6 +26362,66 @@ var fallbackValues$n = {
26291
26362
  autopayTextColor: autopayTextColor$1
26292
26363
  };
26293
26364
 
26365
+ var formatDelimiter = "_";
26366
+ var phoneFormats = ["", "_", "__", "(___) ", "(___) _", "(___) __", "(___) ___-", "(___) ___-_", "(___) ___-__", "(___) ___-___", "(___) ___-____"];
26367
+ var zipFormats = ["", "_", "__", "___", "____", "_____", "______", "_____-__", "_____-___", "_____-____"];
26368
+ var creditCardFormats = ["", "_", "__", "___", "____", "____ _", "____ __", "____ ___", "____ ____", "____ ____ _", "____ ____ __", "____ ____ ___", "____ ____ ____", "____ ____ ____ _", "____ ____ ____ __", "____ ____ ____ ___", "____ ____ ____ ____"];
26369
+ var moneyFormats = ["", "$0.0_", "$0.__", "$_.__", "$__.__", "$___.__", "$_,___.__", "$__,___.__", "$___,___.__", "$_,___,___.__", "$__,___,___.__", "$___,___,___.__", "$_,___,___,___.__", "$__,___,___,___.__", "$___,___,___,___.__", "$_,___,___,___,___.__"];
26370
+ var expirationDateFormats = ["", "_", "__/", "__/_", "__/__"];
26371
+ var zipFormat = createFormat(zipFormats, formatDelimiter);
26372
+ var creditCardFormat = createFormat(creditCardFormats, formatDelimiter);
26373
+ var expirationDateFormat = createFormat(expirationDateFormats, formatDelimiter);
26374
+ var phoneFormat = createFormat(phoneFormats, formatDelimiter);
26375
+ var moneyFormat = createFormat(moneyFormats, formatDelimiter);
26376
+ var renderCardStatus = function renderCardStatus(expirationStatus, expireDate) {
26377
+ var textAlign = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "right";
26378
+ var as = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "span";
26379
+ var ACTIVE = "ACTIVE";
26380
+ var EXPIRING_SOON = "EXPIRING_SOON";
26381
+ var EXPIRED = "EXPIRED";
26382
+ var textMargin = textAlign === "right" ? "auto" : "0";
26383
+
26384
+ switch (expirationStatus) {
26385
+ case ACTIVE:
26386
+ return /*#__PURE__*/React__default.createElement(Text$1, {
26387
+ as: as,
26388
+ variant: "pXS",
26389
+ color: ASH_GREY,
26390
+ extraStyles: "text-align: ".concat(textAlign, "; margin: ").concat(textMargin, ";")
26391
+ }, "Exp Date ", expireDate);
26392
+
26393
+ case EXPIRING_SOON:
26394
+ return /*#__PURE__*/React__default.createElement(Text$1, {
26395
+ as: as,
26396
+ variant: "pXS",
26397
+ color: FIRE_YELLOW,
26398
+ extraStyles: "text-align: ".concat(textAlign, "; margin: ").concat(textMargin, ";")
26399
+ }, "Expiring Soon ", expireDate);
26400
+
26401
+ case EXPIRED:
26402
+ return /*#__PURE__*/React__default.createElement(Text$1, {
26403
+ as: as,
26404
+ variant: "pXS",
26405
+ color: ASH_GREY,
26406
+ extraStyles: "text-align: ".concat(textAlign, "; margin: ").concat(textMargin, ";")
26407
+ }, "Expired");
26408
+ }
26409
+ };
26410
+
26411
+ var formats = /*#__PURE__*/Object.freeze({
26412
+ __proto__: null,
26413
+ formatDelimiter: formatDelimiter,
26414
+ phoneFormats: phoneFormats,
26415
+ moneyFormats: moneyFormats,
26416
+ expirationDateFormats: expirationDateFormats,
26417
+ zipFormat: zipFormat,
26418
+ creditCardFormat: creditCardFormat,
26419
+ expirationDateFormat: expirationDateFormat,
26420
+ phoneFormat: phoneFormat,
26421
+ moneyFormat: moneyFormat,
26422
+ renderCardStatus: renderCardStatus
26423
+ });
26424
+
26294
26425
  var CreditCardWrapper = styled__default.div.withConfig({
26295
26426
  displayName: "FormattedCreditCard__CreditCardWrapper",
26296
26427
  componentId: "sc-s0ta5l-0"
@@ -27264,7 +27395,9 @@ var RadioButton$1 = function RadioButton(_ref2) {
27264
27395
  _ref2$ariaLabelledBy = _ref2.ariaLabelledBy,
27265
27396
  ariaLabelledBy = _ref2$ariaLabelledBy === void 0 ? "" : _ref2$ariaLabelledBy,
27266
27397
  _ref2$ariaLabel = _ref2.ariaLabel,
27267
- ariaLabel = _ref2$ariaLabel === void 0 ? null : _ref2$ariaLabel;
27398
+ ariaLabel = _ref2$ariaLabel === void 0 ? null : _ref2$ariaLabel,
27399
+ _ref2$isRequired = _ref2.isRequired,
27400
+ isRequired = _ref2$isRequired === void 0 ? false : _ref2$isRequired;
27268
27401
  var buttonBorder = {
27269
27402
  onFocused: {
27270
27403
  borderColor: themeValues.activeColor,
@@ -27326,7 +27459,8 @@ var RadioButton$1 = function RadioButton(_ref2) {
27326
27459
  disabled: disabled,
27327
27460
  onClick: toggleRadio,
27328
27461
  "aria-describedby": ariaDescribedBy,
27329
- tabIndex: "-1"
27462
+ tabIndex: "-1",
27463
+ required: isRequired
27330
27464
  }, extraProps)), /*#__PURE__*/React__default.createElement(Motion, {
27331
27465
  borderWidth: "1px",
27332
27466
  borderStyle: "solid",
@@ -38016,7 +38150,9 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
38016
38150
  field = _ref.field,
38017
38151
  fieldActions = _ref.fieldActions,
38018
38152
  showErrors = _ref.showErrors,
38019
- countryCode = _ref.countryCode;
38153
+ countryCode = _ref.countryCode,
38154
+ _ref$isRequired = _ref.isRequired,
38155
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
38020
38156
  var placeholder = countryCode === "US" ? placeHolderOptionUS : placeHolderOption;
38021
38157
  var options = [placeholder].concat(_toConsumableArray(getOptions(countryCode)));
38022
38158
  return /*#__PURE__*/React__default.createElement(FormSelect$1, {
@@ -38026,7 +38162,8 @@ var FormStateDropdown = function FormStateDropdown(_ref) {
38026
38162
  labelTextWhenNoError: labelTextWhenNoError,
38027
38163
  errorMessages: errorMessages,
38028
38164
  showErrors: showErrors,
38029
- autocompleteValue: "address-level1"
38165
+ autocompleteValue: "address-level1",
38166
+ isRequired: isRequired
38030
38167
  });
38031
38168
  };
38032
38169
 
@@ -39365,7 +39502,8 @@ var AddressForm = function AddressForm(_ref) {
39365
39502
  }
39366
39503
  },
39367
39504
  showErrors: showErrors,
39368
- dataQa: "Country"
39505
+ dataQa: "Country",
39506
+ isRequired: true
39369
39507
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
39370
39508
  labelTextWhenNoError: "Address",
39371
39509
  errorMessages: street1ErrorMessages,
@@ -39376,7 +39514,8 @@ var AddressForm = function AddressForm(_ref) {
39376
39514
  return e.key === "Enter" && handleSubmit(e);
39377
39515
  },
39378
39516
  autocompleteValue: "address-line1",
39379
- dataQa: "Address"
39517
+ dataQa: "Address",
39518
+ isRequired: true
39380
39519
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
39381
39520
  labelTextWhenNoError: "Apt, Suite, Unit, Floor, etc. (Optional)",
39382
39521
  field: fields.street2,
@@ -39397,7 +39536,8 @@ var AddressForm = function AddressForm(_ref) {
39397
39536
  return e.key === "Enter" && handleSubmit(e);
39398
39537
  },
39399
39538
  autocompleteValue: "address-level2",
39400
- dataQa: "City"
39539
+ dataQa: "City",
39540
+ isRequired: true
39401
39541
  }), /*#__PURE__*/React__default.createElement(FormStateDropdown, {
39402
39542
  labelTextWhenNoError: isUS ? "State" : "State or Province",
39403
39543
  errorMessages: stateProvinceErrorMessages,
@@ -39408,7 +39548,8 @@ var AddressForm = function AddressForm(_ref) {
39408
39548
  onKeyDown: function onKeyDown(e) {
39409
39549
  return e.key === "Enter" && handleSubmit(e);
39410
39550
  },
39411
- dataQa: "State or Province"
39551
+ dataQa: "State or Province",
39552
+ isRequired: true
39412
39553
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
39413
39554
  isNum: isUS,
39414
39555
  formatter: isUS ? zipFormat : null,
@@ -39421,7 +39562,8 @@ var AddressForm = function AddressForm(_ref) {
39421
39562
  return e.key === "Enter" && handleSubmit(e);
39422
39563
  },
39423
39564
  autocompleteValue: "postal-code",
39424
- dataQa: "Zip code"
39565
+ dataQa: "Zip code",
39566
+ isRequired: true
39425
39567
  }), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
39426
39568
  name: "address checkbox",
39427
39569
  title: "Save address to wallet",
@@ -40324,7 +40466,9 @@ var EmailForm = function EmailForm(_ref) {
40324
40466
  handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
40325
40467
  showWalletCheckbox = _ref.showWalletCheckbox,
40326
40468
  saveToWallet = _ref.saveToWallet,
40327
- walletCheckboxMarked = _ref.walletCheckboxMarked;
40469
+ walletCheckboxMarked = _ref.walletCheckboxMarked,
40470
+ _ref$isRequired = _ref.isRequired,
40471
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
40328
40472
 
40329
40473
  if (clearOnDismount) {
40330
40474
  React.useEffect(function () {
@@ -40353,7 +40497,8 @@ var EmailForm = function EmailForm(_ref) {
40353
40497
  },
40354
40498
  isEmail: true,
40355
40499
  autocompleteValue: "email",
40356
- dataQa: "Email address"
40500
+ dataQa: "Email address",
40501
+ isRequired: isRequired
40357
40502
  }), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
40358
40503
  name: "email checkbox",
40359
40504
  title: "Save email address to wallet",
@@ -45650,7 +45795,8 @@ var Modal$1 = function Modal(_ref) {
45650
45795
  alignItems: "center"
45651
45796
  },
45652
45797
  dialogStyle: {
45653
- width: customWidth || "615px"
45798
+ width: customWidth || "615px",
45799
+ overflow: "auto"
45654
45800
  },
45655
45801
  underlayClickExits: underlayClickExits
45656
45802
  }, /*#__PURE__*/React__default.createElement(Box, {
@@ -47720,42 +47866,7 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47720
47866
  })))));
47721
47867
  };
47722
47868
 
47723
- /*
47724
- Hook that takes an ID selector for an element on the screen
47725
- And optionally values for top position, left position, smooth behavior
47726
- Finds element on screen and scrolls it to the provided coordinates
47727
-
47728
- (string, number, number, string, number) => undefined;
47729
- */
47730
- var useScrollTo = function useScrollTo(id) {
47731
- var top = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
47732
- var left = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
47733
- var behavior = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : "auto";
47734
- var delay = arguments.length > 4 ? arguments[4] : undefined;
47735
- var scrollItem;
47736
-
47737
- if (delay) {
47738
- setTimeout(function () {
47739
- var _scrollItem;
47740
-
47741
- scrollItem = document.getElementById(id);
47742
- (_scrollItem = scrollItem) === null || _scrollItem === void 0 ? void 0 : _scrollItem.scrollTo({
47743
- top: top,
47744
- left: left,
47745
- behavior: behavior
47746
- });
47747
- }, delay);
47748
- } else {
47749
- var _scrollItem2;
47750
-
47751
- scrollItem = document.getElementById(id);
47752
- (_scrollItem2 = scrollItem) === null || _scrollItem2 === void 0 ? void 0 : _scrollItem2.scrollTo({
47753
- top: top,
47754
- left: left,
47755
- behavior: behavior
47756
- });
47757
- }
47758
- };
47869
+ var TermsAndConditionsTitleDivId = "terms-and-conditions-title";
47759
47870
 
47760
47871
  var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47761
47872
  var _ref$showCheckbox = _ref.showCheckbox,
@@ -47819,7 +47930,8 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47819
47930
  checked: isChecked,
47820
47931
  onChange: onCheck,
47821
47932
  checkboxMargin: checkboxMargin,
47822
- extraStyles: "align-self: flex-start;"
47933
+ extraStyles: "align-self: flex-start;",
47934
+ labelledById: TermsAndConditionsTitleDivId
47823
47935
  }), /*#__PURE__*/React__default.createElement(Stack, {
47824
47936
  childGap: "0.25rem",
47825
47937
  fullHeight: true
@@ -47827,7 +47939,8 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47827
47939
  justify: "flex-start",
47828
47940
  align: "center",
47829
47941
  nowrap: true,
47830
- extraStyles: "padding-right: 2px; > div > * { margin: 4px 2px; };"
47942
+ extraStyles: "padding-right: 2px; > div > * { margin: 4px 2px; };",
47943
+ id: TermsAndConditionsTitleDivId
47831
47944
  }, description && /*#__PURE__*/React__default.createElement(Text$1, {
47832
47945
  color: CHARADE_GREY
47833
47946
  }, description), terms && /*#__PURE__*/React__default.createElement(TermsAndConditionsModal$1, {
@@ -47925,7 +48038,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
47925
48038
  onKeyDown: function onKeyDown(e) {
47926
48039
  return e.key === "Enter" && handleSubmit(e);
47927
48040
  },
47928
- autocompleteValue: "name"
48041
+ autocompleteValue: "name",
48042
+ isRequired: true
47929
48043
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
47930
48044
  labelTextWhenNoError: "Routing number",
47931
48045
  dataQa: "Routing number",
@@ -47947,7 +48061,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
47947
48061
  },
47948
48062
  onKeyDown: function onKeyDown(e) {
47949
48063
  return e.key === "Enter" && handleSubmit(e);
47950
- }
48064
+ },
48065
+ isRequired: true
47951
48066
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
47952
48067
  labelTextWhenNoError: "Confirm routing number",
47953
48068
  dataQa: "Confirm routing number",
@@ -47958,7 +48073,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
47958
48073
  onKeyDown: function onKeyDown(e) {
47959
48074
  return e.key === "Enter" && handleSubmit(e);
47960
48075
  },
47961
- isNum: true
48076
+ isNum: true,
48077
+ isRequired: true
47962
48078
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
47963
48079
  labelTextWhenNoError: "Account number",
47964
48080
  dataQa: "Account number",
@@ -47980,7 +48096,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
47980
48096
  },
47981
48097
  onKeyDown: function onKeyDown(e) {
47982
48098
  return e.key === "Enter" && handleSubmit(e);
47983
- }
48099
+ },
48100
+ isRequired: true
47984
48101
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
47985
48102
  labelTextWhenNoError: "Confirm account number",
47986
48103
  dataQa: "Confirm account number",
@@ -47991,6 +48108,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
47991
48108
  onKeyDown: function onKeyDown(e) {
47992
48109
  return e.key === "Enter" && handleSubmit(e);
47993
48110
  },
48111
+ isRequired: true,
47994
48112
  isNum: true
47995
48113
  }), allowBankAccountType && /*#__PURE__*/React__default.createElement(FormSelect$1, {
47996
48114
  labelTextWhenNoError: "Account type",
@@ -48008,7 +48126,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48008
48126
  fieldActions: actions.fields.accountType,
48009
48127
  showErrors: showErrors,
48010
48128
  errorMessages: accountTypeErrors,
48011
- field: fields.accountType
48129
+ field: fields.accountType,
48130
+ isRequired: true
48012
48131
  }), !hideDefaultPayment && /*#__PURE__*/React__default.createElement(Checkbox$1, {
48013
48132
  title: "Save as Default Payment Method",
48014
48133
  dataQa: "default-payment-ach",
@@ -48146,7 +48265,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48146
48265
  onKeyDown: function onKeyDown(e) {
48147
48266
  return e.key === "Enter" && handleSubmit(e);
48148
48267
  },
48149
- autocompleteValue: "cc-name"
48268
+ autocompleteValue: "cc-name",
48269
+ isRequired: true
48150
48270
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
48151
48271
  labelTextWhenNoError: "Credit card number",
48152
48272
  dataQa: "Credit card number",
@@ -48159,7 +48279,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48159
48279
  return e.key === "Enter" && handleSubmit(e);
48160
48280
  },
48161
48281
  isNum: true,
48162
- autocompleteValue: "cc-number"
48282
+ autocompleteValue: "cc-number",
48283
+ isRequired: true
48163
48284
  }), /*#__PURE__*/React__default.createElement(FormInputRow, {
48164
48285
  breakpoint: isMobile ? "1000rem" : "21rem",
48165
48286
  childGap: isMobile ? "0rem" : "1rem"
@@ -48177,7 +48298,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48177
48298
  isNum: true,
48178
48299
  removeFromValue: /\// // removes "/" from browser autofill
48179
48300
  ,
48180
- autocompleteValue: "cc-exp"
48301
+ autocompleteValue: "cc-exp",
48302
+ isRequired: true
48181
48303
  }), /*#__PURE__*/React__default.createElement(FormInput$1, {
48182
48304
  labelTextWhenNoError: "CVV",
48183
48305
  dataQa: "CVV",
@@ -48190,7 +48312,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48190
48312
  onKeyDown: function onKeyDown(e) {
48191
48313
  return e.key === "Enter" && handleSubmit(e);
48192
48314
  },
48193
- autocompleteValue: "cc-csc"
48315
+ autocompleteValue: "cc-csc",
48316
+ isRequired: true
48194
48317
  })), !hideZipCode && /*#__PURE__*/React__default.createElement(Box, {
48195
48318
  padding: isMobile ? "0" : "0 0.5rem 0 0",
48196
48319
  width: isMobile ? "100%" : "50%"
@@ -48206,7 +48329,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48206
48329
  onKeyDown: function onKeyDown(e) {
48207
48330
  return e.key === "Enter" && handleSubmit(e);
48208
48331
  },
48209
- autocompleteValue: "billing postal-code"
48332
+ autocompleteValue: "billing postal-code",
48333
+ isRequired: true
48210
48334
  })), (showWalletCheckbox || showTerms) && /*#__PURE__*/React__default.createElement(Cluster, {
48211
48335
  childGap: "4px",
48212
48336
  align: "center"
@@ -48399,7 +48523,9 @@ var PhoneForm = function PhoneForm(_ref) {
48399
48523
  handleSubmit = _ref$handleSubmit === void 0 ? noop : _ref$handleSubmit,
48400
48524
  showWalletCheckbox = _ref.showWalletCheckbox,
48401
48525
  saveToWallet = _ref.saveToWallet,
48402
- walletCheckboxMarked = _ref.walletCheckboxMarked;
48526
+ walletCheckboxMarked = _ref.walletCheckboxMarked,
48527
+ _ref$isRequired = _ref.isRequired,
48528
+ isRequired = _ref$isRequired === void 0 ? false : _ref$isRequired;
48403
48529
 
48404
48530
  if (clearOnDismount) {
48405
48531
  React.useEffect(function () {
@@ -48426,7 +48552,8 @@ var PhoneForm = function PhoneForm(_ref) {
48426
48552
  },
48427
48553
  autocompleteValue: "tel-national",
48428
48554
  dataQa: "Phone number",
48429
- isNum: true
48555
+ isNum: true,
48556
+ isRequired: isRequired
48430
48557
  }), showWalletCheckbox && /*#__PURE__*/React__default.createElement(Checkbox$1, {
48431
48558
  name: "phone checkbox",
48432
48559
  title: "Save phone number to wallet",
@@ -48560,8 +48687,12 @@ var RadioSection = function RadioSection(_ref) {
48560
48687
  _ref$containerStyles = _ref.containerStyles,
48561
48688
  containerStyles = _ref$containerStyles === void 0 ? "" : _ref$containerStyles,
48562
48689
  ariaDescribedBy = _ref.ariaDescribedBy,
48563
- _ref$ariaLabel = _ref.ariaLabel,
48564
- ariaLabel = _ref$ariaLabel === void 0 ? "Please select an option." : _ref$ariaLabel;
48690
+ _ref$isSectionRequire = _ref.isSectionRequired,
48691
+ isSectionRequired = _ref$isSectionRequire === void 0 ? false : _ref$isSectionRequire,
48692
+ _ref$legendText = _ref.legendText,
48693
+ legendText = _ref$legendText === void 0 ? "" : _ref$legendText,
48694
+ _ref$sectionGroups = _ref.sectionGroups,
48695
+ sectionGroups = _ref$sectionGroups === void 0 ? null : _ref$sectionGroups;
48565
48696
 
48566
48697
  var handleKeyDown = function handleKeyDown(id, e) {
48567
48698
  if ((e === null || e === void 0 ? void 0 : e.keyCode) === 13 || (e === null || e === void 0 ? void 0 : e.keyCode) === 32) {
@@ -48616,10 +48747,125 @@ var RadioSection = function RadioSection(_ref) {
48616
48747
  borderRadius: "4px",
48617
48748
  extraStyles: containerStyles
48618
48749
  }, /*#__PURE__*/React__default.createElement(Stack, {
48619
- childGap: "0",
48750
+ childGap: "0"
48751
+ }, /*#__PURE__*/React__default.createElement("fieldset", {
48620
48752
  role: "radiogroup",
48621
- "aria-label": ariaLabel
48622
- }, sections.filter(function (section) {
48753
+ tabIndex: "0",
48754
+ "aria-required": isSectionRequired,
48755
+ style: {
48756
+ padding: 0,
48757
+ margin: 0,
48758
+ border: 0
48759
+ }
48760
+ }, /*#__PURE__*/React__default.createElement(Box, {
48761
+ as: "legend",
48762
+ srOnly: true,
48763
+ padding: "0",
48764
+ margin: "0"
48765
+ }, legendText), sectionGroups && sectionGroups.map(function (sectionGroup) {
48766
+ var prependedItem = "";
48767
+
48768
+ if (sectionGroups.indexOf(sectionGroup) !== 0) {
48769
+ prependedItem = /*#__PURE__*/React__default.createElement(SolidDivider$1, null);
48770
+ }
48771
+
48772
+ return /*#__PURE__*/React__default.createElement(React__default.Fragment, null, prependedItem, sectionGroup.filter(function (unfilteredSection) {
48773
+ return !unfilteredSection.hidden;
48774
+ }).map(function (section) {
48775
+ return /*#__PURE__*/React__default.createElement(Motion, {
48776
+ tabIndex: section.hideRadioButton || section.disabled ? "-1" : "0",
48777
+ onKeyDown: function onKeyDown(e) {
48778
+ return !section.disabled && handleKeyDown(section.id, e);
48779
+ },
48780
+ onFocus: function onFocus() {
48781
+ return !section.disabled && setFocused(section.id);
48782
+ },
48783
+ onBlur: function onBlur() {
48784
+ return !section.disabled && setFocused(null);
48785
+ },
48786
+ hoverStyles: themeValues.focusStyles,
48787
+ animate: openSection === section.id ? "open" : "closed",
48788
+ initial: initiallyOpen ? "open" : "closed",
48789
+ key: "item-".concat(section.id),
48790
+ extraStyles: borderStyles,
48791
+ role: "radio",
48792
+ "aria-checked": openSection === section.id,
48793
+ "aria-disabled": section.disabled,
48794
+ "aria-required": section === null || section === void 0 ? void 0 : section.required
48795
+ }, /*#__PURE__*/React__default.createElement(Stack, {
48796
+ childGap: "0"
48797
+ }, /*#__PURE__*/React__default.createElement(Box, {
48798
+ padding: section.hideRadioButton ? "1.5rem" : "1.25rem 1.5rem",
48799
+ background: section.disabled ? themeValues.headingDisabledColor : themeValues.headingBackgroundColor,
48800
+ onClick: isMobile && supportsTouch || section.disabled ? noop : function () {
48801
+ return toggleOpenSection(section.id);
48802
+ },
48803
+ onTouchEnd: isMobile && supportsTouch && !section.disabled ? function () {
48804
+ return toggleOpenSection(section.id);
48805
+ } : noop,
48806
+ key: "header-".concat(section.id),
48807
+ borderSize: "0px",
48808
+ borderColor: themeValues.borderColor,
48809
+ borderWidthOverride: openSection === section.id && !!section.content ? "0px 0px 1px 0px" : "",
48810
+ extraStyles: !section.disabled ? "cursor: pointer;" : "",
48811
+ dataQa: section.dataQa ? section.dataQa : section.id
48812
+ }, /*#__PURE__*/React__default.createElement(Cluster, {
48813
+ justify: "space-between",
48814
+ align: "center",
48815
+ childGap: "1px",
48816
+ nowrap: true
48817
+ }, /*#__PURE__*/React__default.createElement(Cluster, {
48818
+ justify: "flex-start",
48819
+ align: "center",
48820
+ nowrap: true
48821
+ }, !section.hideRadioButton && /*#__PURE__*/React__default.createElement(Box, {
48822
+ padding: "0"
48823
+ }, /*#__PURE__*/React__default.createElement(RadioButton$2, {
48824
+ id: "radio-input-".concat(idString(section)),
48825
+ name: idString(section),
48826
+ ariaDescribedBy: ariaDescribedBy,
48827
+ radioOn: openSection === section.id,
48828
+ radioFocused: focused === section.id,
48829
+ toggleRadio: section.disabled ? noop : function () {
48830
+ return toggleOpenSection(section.id);
48831
+ },
48832
+ isRequired: section === null || section === void 0 ? void 0 : section.required
48833
+ })), section.titleIcon && /*#__PURE__*/React__default.createElement(Cluster, {
48834
+ align: "center"
48835
+ }, section.titleIcon), /*#__PURE__*/React__default.createElement(Box, {
48836
+ padding: section.titleIcon ? "0 0 0 8px" : "0"
48837
+ }, /*#__PURE__*/React__default.createElement(Text$1, {
48838
+ as: "label",
48839
+ htmlFor: "radio-input-".concat(idString(section)),
48840
+ color: CHARADE_GREY
48841
+ }, section.title))), section.rightIcons && /*#__PURE__*/React__default.createElement(Cluster, {
48842
+ childGap: "0.5rem",
48843
+ "aria-label": (section === null || section === void 0 ? void 0 : section.rightIconsLabel) || null,
48844
+ role: (section === null || section === void 0 ? void 0 : section.rightIconsRole) || null
48845
+ }, section.rightIcons.map(function (icon) {
48846
+ return /*#__PURE__*/React__default.createElement(RightIcon, {
48847
+ src: icon.img,
48848
+ key: icon.img,
48849
+ fade: !icon.enabled,
48850
+ isMobile: isMobile,
48851
+ alt: icon.altText,
48852
+ "aria-disabled": !icon.enabled
48853
+ });
48854
+ })), section.rightTitleContent && /*#__PURE__*/React__default.createElement(React.Fragment, null, section.rightTitleContent))), /*#__PURE__*/React__default.createElement(AnimatePresence, {
48855
+ initial: false
48856
+ }, openSection === section.id && /*#__PURE__*/React__default.createElement(Motion, {
48857
+ key: "content-".concat(section.id),
48858
+ padding: "0",
48859
+ background: themeValues.bodyBackgroundColor,
48860
+ layoutTransition: true,
48861
+ initial: "closed",
48862
+ animate: "open",
48863
+ exit: "closed",
48864
+ variants: wrapper,
48865
+ extraStyles: "transform-origin: 100% 0;"
48866
+ }, section.content))));
48867
+ }));
48868
+ }), sections && sections.filter(function (section) {
48623
48869
  return !section.hidden;
48624
48870
  }).map(function (section) {
48625
48871
  return /*#__PURE__*/React__default.createElement(Motion, {
@@ -48637,10 +48883,7 @@ var RadioSection = function RadioSection(_ref) {
48637
48883
  animate: openSection === section.id ? "open" : "closed",
48638
48884
  initial: initiallyOpen ? "open" : "closed",
48639
48885
  key: "item-".concat(section.id),
48640
- extraStyles: borderStyles,
48641
- role: "radio",
48642
- "aria-checked": openSection === section.id,
48643
- "aria-disabled": section.disabled
48886
+ extraStyles: borderStyles
48644
48887
  }, /*#__PURE__*/React__default.createElement(Stack, {
48645
48888
  childGap: "0"
48646
48889
  }, /*#__PURE__*/React__default.createElement(Box, {
@@ -48657,7 +48900,12 @@ var RadioSection = function RadioSection(_ref) {
48657
48900
  borderColor: themeValues.borderColor,
48658
48901
  borderWidthOverride: openSection === section.id && !!section.content ? "0px 0px 1px 0px" : "",
48659
48902
  extraStyles: !section.disabled ? "cursor: pointer;" : "",
48660
- dataQa: section.dataQa ? section.dataQa : section.id
48903
+ dataQa: section.dataQa ? section.dataQa : section.id,
48904
+ role: "radio",
48905
+ "aria-checked": openSection === section.id,
48906
+ "aria-disabled": section.disabled,
48907
+ "aria-required": section === null || section === void 0 ? void 0 : section.required,
48908
+ tabIndex: "0"
48661
48909
  }, /*#__PURE__*/React__default.createElement(Cluster, {
48662
48910
  justify: "space-between",
48663
48911
  align: "center",
@@ -48678,7 +48926,7 @@ var RadioSection = function RadioSection(_ref) {
48678
48926
  toggleRadio: section.disabled ? noop : function () {
48679
48927
  return toggleOpenSection(section.id);
48680
48928
  },
48681
- tabIndex: "-1"
48929
+ isRequired: section === null || section === void 0 ? void 0 : section.required
48682
48930
  })), section.titleIcon && /*#__PURE__*/React__default.createElement(Cluster, {
48683
48931
  align: "center"
48684
48932
  }, section.titleIcon), /*#__PURE__*/React__default.createElement(Box, {
@@ -48713,7 +48961,7 @@ var RadioSection = function RadioSection(_ref) {
48713
48961
  variants: wrapper,
48714
48962
  extraStyles: "transform-origin: 100% 0;"
48715
48963
  }, section.content))));
48716
- })));
48964
+ }))));
48717
48965
  };
48718
48966
 
48719
48967
  var RadioSection$1 = themeComponent(RadioSection, "RadioSection", fallbackValues$Q);
@@ -49197,6 +49445,51 @@ var Timeout = function Timeout(_ref) {
49197
49445
 
49198
49446
  var Timeout$1 = withWindowSize(Timeout);
49199
49447
 
49448
+ var VARIANTS = {
49449
+ SUCCESS: "success",
49450
+ ERROR: "error"
49451
+ };
49452
+
49453
+ var ToastNotification = function ToastNotification(_ref) {
49454
+ var _ref$variant = _ref.variant,
49455
+ variant = _ref$variant === void 0 ? VARIANTS.SUCCESS : _ref$variant,
49456
+ _ref$message = _ref.message,
49457
+ message = _ref$message === void 0 ? "" : _ref$message,
49458
+ toastOpen = _ref.toastOpen,
49459
+ closeToastNotification = _ref.closeToastNotification,
49460
+ extraStyles = _ref.extraStyles,
49461
+ _ref$minWidth = _ref.minWidth,
49462
+ minWidth = _ref$minWidth === void 0 ? "112px" : _ref$minWidth,
49463
+ _ref$maxWidth = _ref.maxWidth,
49464
+ maxWidth = _ref$maxWidth === void 0 ? "350px" : _ref$maxWidth,
49465
+ _ref$height = _ref.height,
49466
+ height = _ref$height === void 0 ? "56px" : _ref$height,
49467
+ _ref$childGap = _ref.childGap,
49468
+ childGap = _ref$childGap === void 0 ? "1rem" : _ref$childGap,
49469
+ backgroundColor = _ref.backgroundColor;
49470
+ return /*#__PURE__*/React__default.createElement(Box, {
49471
+ onClick: closeToastNotification,
49472
+ background: backgroundColor ? backgroundColor : variant === VARIANTS.SUCCESS ? HINT_GREEN : variant === VARIANTS.ERROR ? ERROR_BACKGROUND_COLOR : WHITE,
49473
+ minWidth: minWidth,
49474
+ minHeight: height && parseInt(height) < 100 ? height : "100px",
49475
+ height: height ? height : "auto",
49476
+ tabIndex: toastOpen ? "-1" : "0",
49477
+ padding: "0rem 1rem",
49478
+ borderRadius: "4px",
49479
+ boxShadow: generateShadows().standard.base,
49480
+ extraStyles: "\n display: ".concat(toastOpen ? "block" : "none", ";\n position: fixed; bottom: 4rem; left: 4rem;\n ").concat(extraStyles, ";\n cursor: pointer;\n ")
49481
+ }, /*#__PURE__*/React__default.createElement(Cluster, {
49482
+ align: "center",
49483
+ childGap: childGap
49484
+ }, variant === VARIANTS.SUCCESS && /*#__PURE__*/React__default.createElement(SuccessfulIconMedium, null), variant === VARIANTS.ERROR && /*#__PURE__*/React__default.createElement(ErroredIcon, null), /*#__PURE__*/React__default.createElement(Box, {
49485
+ padding: "1rem 0",
49486
+ maxWidth: maxWidth
49487
+ }, /*#__PURE__*/React__default.createElement(Paragraph$1, {
49488
+ weight: FONT_WEIGHT_SEMIBOLD,
49489
+ extraStyles: "word-break: break-word;"
49490
+ }, message)), /*#__PURE__*/React__default.createElement(IconQuitLarge, null)));
49491
+ };
49492
+
49200
49493
  var fontWeight$9 = "600";
49201
49494
  var fontColor$1 = WHITE;
49202
49495
  var textAlign$1 = "left";
@@ -49569,6 +49862,38 @@ var SidebarStackContent = function SidebarStackContent(_ref) {
49569
49862
 
49570
49863
  var SidebarStackContent$1 = withWindowSize(themeComponent(SidebarStackContent, "Global", fallbackValues$U));
49571
49864
 
49865
+ var useFocusInvalidInput = function useFocusInvalidInput(hasErrors) {
49866
+ var resetHasErrors = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : function () {};
49867
+ // Only move focus when "hasErrors" is true
49868
+ // "hasErrors" is managed by container page of form
49869
+ // typically set to "true" on attempted form submission, if errors exist
49870
+ // Reset errors, if provided, resets the error state tracking in order to properly re-run
49871
+ React.useEffect(function () {
49872
+ if (hasErrors) {
49873
+ var _inputsWithErrors$;
49874
+
49875
+ var inputsWithErrors = document.querySelectorAll("input[aria-invalid=true]");
49876
+ inputsWithErrors === null || inputsWithErrors === void 0 ? void 0 : (_inputsWithErrors$ = inputsWithErrors[0]) === null || _inputsWithErrors$ === void 0 ? void 0 : _inputsWithErrors$.focus();
49877
+ }
49878
+
49879
+ return function () {
49880
+ return resetHasErrors(false);
49881
+ };
49882
+ });
49883
+ };
49884
+
49885
+
49886
+
49887
+ var index$6 = /*#__PURE__*/Object.freeze({
49888
+ __proto__: null,
49889
+ formats: formats,
49890
+ general: general,
49891
+ theme: themeUtils,
49892
+ useFocusInvalidInput: useFocusInvalidInput,
49893
+ useOutsideClick: useOutsideClickHook,
49894
+ useToastNotification: useToastNotification
49895
+ });
49896
+
49572
49897
  exports.AccountNumberImage = AccountNumberImage;
49573
49898
  exports.AccountsAddIcon = AccountsAddIcon$1;
49574
49899
  exports.AccountsIcon = AccountsIcon$1;
@@ -49762,6 +50087,7 @@ exports.Text = Text$1;
49762
50087
  exports.Timeout = Timeout$1;
49763
50088
  exports.TimeoutImage = TimeoutImage;
49764
50089
  exports.Title = Title$1;
50090
+ exports.ToastNotification = ToastNotification;
49765
50091
  exports.ToggleSwitch = ToggleSwitch$1;
49766
50092
  exports.TrashIcon = TrashIcon$1;
49767
50093
  exports.TypeaheadInput = TypeaheadInput;
@@ -49779,6 +50105,7 @@ exports.cardRegistry = cardRegistry;
49779
50105
  exports.constants = index$5;
49780
50106
  exports.createPartialAmountFormState = createPartialAmountFormState;
49781
50107
  exports.createPartialAmountFormValidators = createPartialAmountFormValidators;
49782
- exports.util = index$4;
50108
+ exports.hooks = index$4;
50109
+ exports.util = index$6;
49783
50110
  exports.withWindowSize = withWindowSize;
49784
50111
  //# sourceMappingURL=index.cjs.js.map