@thecb/components 9.2.12-beta.0 → 9.2.13-beta.1

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 (47) hide show
  1. package/dist/index.cjs.js +131 -90
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.d.ts +3 -1
  4. package/dist/index.esm.js +131 -91
  5. package/dist/index.esm.js.map +1 -1
  6. package/package.json +1 -1
  7. package/src/components/atoms/button-with-action/ButtonWithAction.js +76 -70
  8. package/src/components/atoms/checkbox/Checkbox.js +2 -1
  9. package/src/components/atoms/dropdown/Dropdown.js +3 -3
  10. package/src/components/atoms/icons/KebabMenuIcon.d.ts +1 -0
  11. package/src/components/atoms/icons/KebabMenuIcon.js +38 -0
  12. package/src/components/atoms/icons/TrashIcon.js +42 -40
  13. package/src/components/atoms/icons/icons.stories.js +3 -1
  14. package/src/components/atoms/icons/index.d.ts +1 -0
  15. package/src/components/atoms/icons/index.js +3 -1
  16. package/src/components/atoms/layouts/Motion.js +7 -10
  17. package/src/components/atoms/toggle-switch/ToggleSwitch.js +2 -1
  18. package/src/components/molecules/account-and-routing-modal/AccountAndRoutingModal.js +0 -3
  19. package/src/components/molecules/collapsible-section/CollapsibleSection.js +2 -1
  20. package/src/components/molecules/modal/Modal.js +1 -16
  21. package/src/components/molecules/payment-form-ach/PaymentFormACH.js +0 -1
  22. package/src/components/molecules/payment-form-card/PaymentFormCard.js +0 -1
  23. package/src/components/molecules/popover/Popover.js +2 -1
  24. package/src/components/molecules/popup-menu/PopupMenu.js +152 -0
  25. package/src/components/molecules/popup-menu/PopupMenu.stories.js +40 -0
  26. package/src/components/molecules/popup-menu/PopupMenu.styled.js +20 -0
  27. package/src/components/molecules/popup-menu/PopupMenu.theme.js +11 -0
  28. package/src/components/molecules/popup-menu/index.d.ts +25 -0
  29. package/src/components/molecules/popup-menu/index.js +3 -0
  30. package/src/components/molecules/popup-menu/popup-menu-item/PopupMenuItem.js +79 -0
  31. package/src/components/molecules/popup-menu/popup-menu-item/PopupMenuItem.styled.js +27 -0
  32. package/src/components/molecules/popup-menu/popup-menu-item/PopupMenuItem.theme.js +23 -0
  33. package/src/components/molecules/radio-section/RadioSection.js +55 -14
  34. package/src/components/molecules/radio-section/radio-button/RadioButton.js +1 -1
  35. package/src/components/molecules/terms-and-conditions/TermsAndConditions.stories.js +2 -19
  36. package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV1.js +1 -3
  37. package/src/components/molecules/terms-and-conditions/TermsAndConditionsControlV2.js +1 -3
  38. package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.js +1 -5
  39. package/src/components/molecules/terms-and-conditions-modal/TermsAndConditionsModal.stories.js +3 -8
  40. package/src/constants/keyboard.js +7 -0
  41. package/src/util/general.js +10 -0
  42. package/dist/src/apps/checkout/pages/payment/sub-pages/payment-amount/PaymentAmount_old.js +0 -49322
  43. package/src/.DS_Store +0 -0
  44. package/src/components/.DS_Store +0 -0
  45. package/src/components/atoms/.DS_Store +0 -0
  46. package/src/components/atoms/icons/.DS_Store +0 -0
  47. /package/src/components/atoms/icons/{ExternalLinkIcon.js → ExternalLinkicon.js} +0 -0
package/dist/index.cjs.js CHANGED
@@ -6371,6 +6371,15 @@ var titleCaseString = function titleCaseString(string) {
6371
6371
  var kebabCaseString = function kebabCaseString(string) {
6372
6372
  return string === null || string === void 0 ? void 0 : string.replaceAll(" ", "-").toLowerCase();
6373
6373
  };
6374
+ var wrapIndex$1 = function wrapIndex(index, length) {
6375
+ if (index == -1) {
6376
+ return length - 1;
6377
+ } else if (index == length) {
6378
+ return 0;
6379
+ } else {
6380
+ return index;
6381
+ }
6382
+ };
6374
6383
 
6375
6384
  var general = /*#__PURE__*/Object.freeze({
6376
6385
  __proto__: null,
@@ -6391,7 +6400,8 @@ var general = /*#__PURE__*/Object.freeze({
6391
6400
  throttle: throttle,
6392
6401
  titleCaseWord: titleCaseWord,
6393
6402
  titleCaseString: titleCaseString,
6394
- kebabCaseString: kebabCaseString
6403
+ kebabCaseString: kebabCaseString,
6404
+ wrapIndex: wrapIndex$1
6395
6405
  });
6396
6406
 
6397
6407
  var _excluded$1 = ["themeValues", "weight", "color", "textWrap", "extraStyles", "hoverStyles", "onClick", "onKeyPress", "as", "dataQa", "children", "variant"];
@@ -12511,7 +12521,7 @@ var _excluded$f = ["position", "padding", "children"];
12511
12521
  This should be sufficient for most scenarios, but if you need to, you have the ability to make Motion act like all of the other primitives using the props provided.
12512
12522
  */
12513
12523
 
12514
- var Motion = function Motion(_ref) {
12524
+ var Motion = /*#__PURE__*/React.forwardRef(function (_ref, ref) {
12515
12525
  var _ref$position = _ref.position,
12516
12526
  position = _ref$position === void 0 ? "relative" : _ref$position,
12517
12527
  _ref$padding = _ref.padding,
@@ -12521,9 +12531,10 @@ var Motion = function Motion(_ref) {
12521
12531
 
12522
12532
  return /*#__PURE__*/React__default.createElement(MotionWrapper, _extends({
12523
12533
  position: position,
12524
- padding: padding
12534
+ padding: padding,
12535
+ ref: ref
12525
12536
  }, rest), safeChildren(children, /*#__PURE__*/React__default.createElement(React.Fragment, null)));
12526
- };
12537
+ });
12527
12538
 
12528
12539
  var ReelStyled = styled__default.div.withConfig({
12529
12540
  displayName: "Reelstyled__ReelStyled",
@@ -12926,7 +12937,7 @@ var Spinner = function Spinner(_ref) {
12926
12937
  */
12927
12938
 
12928
12939
 
12929
- var ButtonWithAction = function ButtonWithAction(_ref2) {
12940
+ var ButtonWithAction = /*#__PURE__*/React.forwardRef(function (_ref2, ref) {
12930
12941
  var _ref2$action = _ref2.action,
12931
12942
  action = _ref2$action === void 0 ? noop : _ref2$action,
12932
12943
  _ref2$variant = _ref2.variant,
@@ -12957,6 +12968,7 @@ var ButtonWithAction = function ButtonWithAction(_ref2) {
12957
12968
  var activeStyles = "\n outline: none;\n background-color: ".concat(themeValues.activeBackgroundColor, ";\n border-color: ").concat(themeValues.activeBorderColor, ";\n color: ").concat(themeValues.activeColor, ";\n text-decoration: ").concat(variant === "ghost" || variant === "smallGhost" ? "underline" : "none", ";\n ");
12958
12969
  var disabledStyles = "\n background-color: #6D717E;\n border-color: #6D717E;\n color: #FFFFFF;\n cursor: default;\n &:focus {\n box-shadow: 0 0 10px #6D717E;\n outline: none;\n }\n ".concat(extraDisabledStyles, "\n ");
12959
12970
  return /*#__PURE__*/React__default.createElement(Box, _extends({
12971
+ ref: ref,
12960
12972
  variant: variant,
12961
12973
  padding: themeValues.padding,
12962
12974
  minHeight: themeValues.height,
@@ -12985,7 +12997,7 @@ var ButtonWithAction = function ButtonWithAction(_ref2) {
12985
12997
  textWrap: textWrap,
12986
12998
  extraStyles: textExtraStyles
12987
12999
  }, text)));
12988
- };
13000
+ });
12989
13001
 
12990
13002
  var primaryColor = {
12991
13003
  info: "".concat(WHITE),
@@ -15299,7 +15311,8 @@ var ShoppingCartIcon = function ShoppingCartIcon() {
15299
15311
  };
15300
15312
 
15301
15313
  var TrashIcon = function TrashIcon(_ref) {
15302
- var themeValues = _ref.themeValues;
15314
+ var themeValues = _ref.themeValues,
15315
+ iconFill = _ref.iconFill;
15303
15316
  return /*#__PURE__*/React__default.createElement("svg", {
15304
15317
  width: "20px",
15305
15318
  height: "20px",
@@ -15323,12 +15336,12 @@ var TrashIcon = function TrashIcon(_ref) {
15323
15336
  xlinkHref: "#trash-path-1"
15324
15337
  })), /*#__PURE__*/React__default.createElement("use", {
15325
15338
  id: "trash-Mask",
15326
- fill: themeValues.singleIconColor,
15339
+ fill: iconFill !== null && iconFill !== void 0 ? iconFill : themeValues.singleIconColor,
15327
15340
  fillRule: "nonzero",
15328
15341
  xlinkHref: "#trash-path-1"
15329
15342
  }), /*#__PURE__*/React__default.createElement("polygon", {
15330
15343
  id: "trash-Path",
15331
- fill: themeValues.singleIconColor,
15344
+ fill: iconFill !== null && iconFill !== void 0 ? iconFill : themeValues.singleIconColor,
15332
15345
  fillRule: "nonzero",
15333
15346
  mask: "url(#trash-mask-2)",
15334
15347
  points: "0 0 20 0 20 20 0 20"
@@ -18259,6 +18272,34 @@ var PlusCircleIcon = function PlusCircleIcon(_ref) {
18259
18272
  }));
18260
18273
  };
18261
18274
 
18275
+ var KebabMenuIcon = function KebabMenuIcon() {
18276
+ return /*#__PURE__*/React__default.createElement("svg", {
18277
+ xmlns: "http://www.w3.org/2000/svg",
18278
+ width: "21",
18279
+ height: "32",
18280
+ viewBox: "0 0 21 32",
18281
+ fill: "none"
18282
+ }, /*#__PURE__*/React__default.createElement("path", {
18283
+ d: "M0 4C0 1.79086 1.79086 0 4 0L17 0C19.2091 0 21 1.79086 21 4V28C21 30.2091 19.2091 32 17 32H4C1.79086 32 0 30.2091 0 28L0 4Z",
18284
+ fill: "none"
18285
+ }), /*#__PURE__*/React__default.createElement("path", {
18286
+ fillRule: "evenodd",
18287
+ clipRule: "evenodd",
18288
+ d: "M10.5 6C9.39333 6 8.5 6.89333 8.5 8C8.5 9.10667 9.39333 10 10.5 10C11.6067 10 12.5 9.10667 12.5 8C12.5 6.89333 11.6067 6 10.5 6Z",
18289
+ fill: "#3B5BDB"
18290
+ }), /*#__PURE__*/React__default.createElement("path", {
18291
+ fillRule: "evenodd",
18292
+ clipRule: "evenodd",
18293
+ d: "M10.5 14C9.39333 14 8.5 14.8933 8.5 16C8.5 17.1067 9.39333 18 10.5 18C11.6067 18 12.5 17.1067 12.5 16C12.5 14.8933 11.6067 14 10.5 14Z",
18294
+ fill: "#3B5BDB"
18295
+ }), /*#__PURE__*/React__default.createElement("path", {
18296
+ fillRule: "evenodd",
18297
+ clipRule: "evenodd",
18298
+ d: "M10.5 22C9.39333 22 8.5 22.9067 8.5 24C8.5 25.0933 9.40667 26 10.5 26C11.5933 26 12.5 25.0933 12.5 24C12.5 22.9067 11.6067 22 10.5 22Z",
18299
+ fill: "#3B5BDB"
18300
+ }));
18301
+ };
18302
+
18262
18303
  var color$2 = "#15749D";
18263
18304
  var hoverColor$1 = "#116285";
18264
18305
  var activeColor$1 = "#0E506D";
@@ -22085,6 +22126,13 @@ var fallbackValues$d = {
22085
22126
  disabledCheckedStyles: disabledCheckedStyles
22086
22127
  };
22087
22128
 
22129
+ var ARROW_UP = 38;
22130
+ var ARROW_RIGHT = 39;
22131
+ var ARROW_DOWN = 40;
22132
+ var ENTER = 13;
22133
+ var ESCAPE = 27;
22134
+ var SPACEBAR = 32;
22135
+
22088
22136
  var CheckboxContainer = styled__default.div.withConfig({
22089
22137
  displayName: "Checkbox__CheckboxContainer",
22090
22138
  componentId: "sc-36kqbv-0"
@@ -22155,7 +22203,7 @@ var Checkbox = function Checkbox(_ref4) {
22155
22203
  setFocused = _useState2[1];
22156
22204
 
22157
22205
  var handleClick = function handleClick(e, func) {
22158
- if ((e === null || e === void 0 ? void 0 : e.keyCode) === 13) {
22206
+ if (e.keyCode === ENTER) {
22159
22207
  func();
22160
22208
  }
22161
22209
  };
@@ -24061,10 +24109,9 @@ var Dropdown = function Dropdown(_ref13) {
24061
24109
  dataQa: "".concat(ariaLabelledby, "-dropdown")
24062
24110
  }, /*#__PURE__*/React__default.createElement(Box, {
24063
24111
  as: "input",
24064
- "aria-multiline": "false",
24065
24112
  autoComplete: autocompleteValue,
24066
24113
  "aria-controls": "".concat(ariaLabelledby, "_listbox"),
24067
- "aria-activedescendant": "focused_option",
24114
+ "aria-activedescendant": isOpen ? "focused_option" : undefined,
24068
24115
  "aria-owns": "".concat(ariaLabelledby, "_listbox"),
24069
24116
  "aria-haspopup": "listbox",
24070
24117
  "aria-labelledby": ariaLabelledby,
@@ -24128,7 +24175,7 @@ var Dropdown = function Dropdown(_ref13) {
24128
24175
  return handleItemSelection(e, choice, i);
24129
24176
  },
24130
24177
  onKeyDown: function onKeyDown(e) {
24131
- if (e.keyCode === 13) {
24178
+ if (e.keyCode === ENTER) {
24132
24179
  handleItemSelection(e, choice, i);
24133
24180
  }
24134
24181
  },
@@ -25494,7 +25541,7 @@ var Popover = function Popover(_ref) {
25494
25541
  handleTogglePopover(false);
25495
25542
  },
25496
25543
  onKeyDown: function onKeyDown(e) {
25497
- if (e.keyCode === 27) {
25544
+ if (e.keyCode === ESCAPE) {
25498
25545
  handleTogglePopover(false);
25499
25546
  }
25500
25547
  },
@@ -27389,8 +27436,7 @@ var RadioButton$1 = function RadioButton(_ref2) {
27389
27436
  name = _ref2.name,
27390
27437
  _ref2$disabled = _ref2.disabled,
27391
27438
  disabled = _ref2$disabled === void 0 ? false : _ref2$disabled,
27392
- _ref2$ariaDescribedBy = _ref2.ariaDescribedBy,
27393
- ariaDescribedBy = _ref2$ariaDescribedBy === void 0 ? "" : _ref2$ariaDescribedBy,
27439
+ ariaDescribedBy = _ref2.ariaDescribedBy,
27394
27440
  themeValues = _ref2.themeValues,
27395
27441
  _ref2$ariaLabelledBy = _ref2.ariaLabelledBy,
27396
27442
  ariaLabelledBy = _ref2$ariaLabelledBy === void 0 ? "" : _ref2$ariaLabelledBy,
@@ -38306,7 +38352,7 @@ var ToggleSwitch = function ToggleSwitch(_ref6) {
38306
38352
  });
38307
38353
 
38308
38354
  var handleKeyDown = function handleKeyDown(e) {
38309
- if (e.keyCode === 13) {
38355
+ if (e.keyCode === ENTER) {
38310
38356
  onToggle();
38311
38357
  }
38312
38358
  };
@@ -39835,7 +39881,7 @@ var CollapsibleSection = function CollapsibleSection(_ref) {
39835
39881
  extraStyles = _ref$extraStyles === void 0 ? "" : _ref$extraStyles;
39836
39882
 
39837
39883
  var handleKeyDown = function handleKeyDown(e) {
39838
- if (e.keyCode === 13) {
39884
+ if (e.keyCode === ENTER) {
39839
39885
  toggleSection();
39840
39886
  }
39841
39887
  };
@@ -45771,9 +45817,7 @@ var Modal$1 = function Modal(_ref) {
45771
45817
  buttonExtraStyles = _ref.buttonExtraStyles,
45772
45818
  children = _ref.children,
45773
45819
  _ref$dataQa = _ref.dataQa,
45774
- dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
45775
- _ref$initialFocusSele = _ref.initialFocusSelector,
45776
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
45820
+ dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
45777
45821
 
45778
45822
  var _useContext = React.useContext(styled.ThemeContext),
45779
45823
  isMobile = _useContext.isMobile;
@@ -45800,11 +45844,7 @@ var Modal$1 = function Modal(_ref) {
45800
45844
  width: customWidth || "615px",
45801
45845
  overflow: "auto"
45802
45846
  },
45803
- underlayClickExits: underlayClickExits,
45804
- "aria-modal": true,
45805
- initialFocus: initialFocusSelector,
45806
- focusDialog: !initialFocusSelector // Focus the dialogue box itself if no selector for initial focus was provided
45807
-
45847
+ underlayClickExits: underlayClickExits
45808
45848
  }, /*#__PURE__*/React__default.createElement(Box, {
45809
45849
  padding: "0",
45810
45850
  borderRadius: "2px",
@@ -45851,9 +45891,7 @@ var Modal$1 = function Modal(_ref) {
45851
45891
  text: cancelButtonText,
45852
45892
  dataQa: cancelButtonText,
45853
45893
  extraStyles: buttonExtraStyles,
45854
- className: "modal-cancel-button",
45855
- role: "button",
45856
- name: cancelButtonText
45894
+ className: "modal-cancel-button"
45857
45895
  })), /*#__PURE__*/React__default.createElement(Box, {
45858
45896
  width: "100%",
45859
45897
  padding: "0"
@@ -45865,9 +45903,7 @@ var Modal$1 = function Modal(_ref) {
45865
45903
  isLoading: isLoading,
45866
45904
  disabled: isContinueActionDisabled,
45867
45905
  extraStyles: buttonExtraStyles,
45868
- className: "modal-continue-button",
45869
- role: "button",
45870
- name: continueButtonText
45906
+ className: "modal-continue-button"
45871
45907
  }))) : /*#__PURE__*/React__default.createElement(Stack, {
45872
45908
  childGap: "1rem",
45873
45909
  direction: "row",
@@ -45878,9 +45914,7 @@ var Modal$1 = function Modal(_ref) {
45878
45914
  text: cancelButtonText,
45879
45915
  dataQa: cancelButtonText,
45880
45916
  extraStyles: buttonExtraStyles,
45881
- className: "modal-cancel-button",
45882
- role: "button",
45883
- name: cancelButtonText
45917
+ className: "modal-cancel-button"
45884
45918
  }), /*#__PURE__*/React__default.createElement(ButtonWithAction, {
45885
45919
  variant: useDangerButton ? "danger" : "primary",
45886
45920
  action: continueAction,
@@ -45889,9 +45923,7 @@ var Modal$1 = function Modal(_ref) {
45889
45923
  isLoading: isLoading,
45890
45924
  disabled: isContinueActionDisabled,
45891
45925
  extraStyles: buttonExtraStyles,
45892
- className: "modal-continue-button",
45893
- role: "button",
45894
- name: continueButtonText
45926
+ className: "modal-continue-button"
45895
45927
  }))) : /*#__PURE__*/React__default.createElement(Box, {
45896
45928
  padding: "0.5rem"
45897
45929
  }, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
@@ -45900,9 +45932,7 @@ var Modal$1 = function Modal(_ref) {
45900
45932
  text: closeButtonText,
45901
45933
  dataQa: closeButtonText,
45902
45934
  extraStyles: buttonExtraStyles,
45903
- className: "modal-close-button",
45904
- role: "button",
45905
- name: closeButtonText
45935
+ className: "modal-close-button"
45906
45936
  }))))))))), children);
45907
45937
  };
45908
45938
 
@@ -47734,8 +47764,7 @@ var AccountAndRoutingModal = function AccountAndRoutingModal(_ref) {
47734
47764
  continueAction: function continueAction() {
47735
47765
  toggleAccepted(true);
47736
47766
  toggleOpen(false);
47737
- },
47738
- initialFocusSelector: "[name='Close']"
47767
+ }
47739
47768
  }, /*#__PURE__*/React__default.createElement(Text$1, {
47740
47769
  variant: "pS",
47741
47770
  onClick: function onClick() {
@@ -47748,9 +47777,7 @@ var AccountAndRoutingModal = function AccountAndRoutingModal(_ref) {
47748
47777
  color: themeValues.linkColor,
47749
47778
  weight: themeValues.fontWeight,
47750
47779
  hoverStyles: themeValues.modalLinkHoverFocus,
47751
- extraStyles: "cursor: pointer;",
47752
- role: "button",
47753
- className: "modal-trigger"
47780
+ extraStyles: "cursor: pointer;"
47754
47781
  }, link));
47755
47782
  };
47756
47783
 
@@ -47807,9 +47834,7 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
47807
47834
  variant = _ref.variant,
47808
47835
  _ref$linkVariant = _ref.linkVariant,
47809
47836
  linkVariant = _ref$linkVariant === void 0 ? "p" : _ref$linkVariant,
47810
- themeValues = _ref.themeValues,
47811
- _ref$initialFocusSele = _ref.initialFocusSelector,
47812
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
47837
+ themeValues = _ref.themeValues;
47813
47838
  return /*#__PURE__*/React__default.createElement(Modal$1, {
47814
47839
  modalOpen: isOpen,
47815
47840
  hideModal: function hideModal() {
@@ -47835,8 +47860,7 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
47835
47860
  continueAction: function continueAction() {
47836
47861
  toggleAccepted(true);
47837
47862
  toggleOpen(false);
47838
- },
47839
- initialFocusSelector: initialFocusSelector
47863
+ }
47840
47864
  }, /*#__PURE__*/React__default.createElement(Text$1, {
47841
47865
  variant: linkVariant,
47842
47866
  onClick: function onClick() {
@@ -47849,10 +47873,7 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
47849
47873
  color: themeValues.linkColor,
47850
47874
  weight: themeValues.fontWeight,
47851
47875
  hoverStyles: themeValues.modalLinkHoverFocus,
47852
- extraStyles: "display: inline-block; width: fit-content; cursor: pointer",
47853
- role: "button" // This should always be a "button" since it opens a modal
47854
- ,
47855
- className: "modal-trigger"
47876
+ extraStyles: "display: inline-block; width: fit-content; cursor: pointer"
47856
47877
  }, link));
47857
47878
  };
47858
47879
 
@@ -47865,9 +47886,7 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47865
47886
  terms = _ref.terms,
47866
47887
  _ref$error = _ref.error,
47867
47888
  error = _ref$error === void 0 ? false : _ref$error,
47868
- linkVariant = _ref.linkVariant,
47869
- _ref$initialFocusSele = _ref.initialFocusSelector,
47870
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
47889
+ linkVariant = _ref.linkVariant;
47871
47890
 
47872
47891
  var _useState = React.useState(false),
47873
47892
  _useState2 = _slicedToArray(_useState, 2),
@@ -47889,8 +47908,7 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47889
47908
  terms: terms,
47890
47909
  isOpen: showTerms,
47891
47910
  toggleOpen: toggleShowTerms,
47892
- linkVariant: linkVariant,
47893
- initialFocusSelector: initialFocusSelector
47911
+ linkVariant: linkVariant
47894
47912
  })))));
47895
47913
  };
47896
47914
 
@@ -47921,9 +47939,7 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47921
47939
  _ref$checkboxMargin = _ref.checkboxMargin,
47922
47940
  checkboxMargin = _ref$checkboxMargin === void 0 ? "4px 8px 4px 4px" : _ref$checkboxMargin,
47923
47941
  _ref$modalTitle = _ref.modalTitle,
47924
- modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle,
47925
- _ref$initialFocusSele = _ref.initialFocusSelector,
47926
- initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
47942
+ modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle;
47927
47943
 
47928
47944
  var _useState = React.useState(false),
47929
47945
  _useState2 = _slicedToArray(_useState, 2),
@@ -47979,8 +47995,7 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47979
47995
  isOpen: showTerms,
47980
47996
  toggleOpen: toggleTerms,
47981
47997
  linkVariant: modalVariant,
47982
- title: modalTitle,
47983
- initialFocusSelector: initialFocusSelector
47998
+ title: modalTitle
47984
47999
  })), /*#__PURE__*/React__default.createElement("div", {
47985
48000
  "aria-live": "polite",
47986
48001
  "aria-atomic": true
@@ -48181,8 +48196,7 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48181
48196
  version: "v2",
48182
48197
  showCheckbox: false,
48183
48198
  description: "View",
48184
- terms: termsContent,
48185
- initialFocusSelector: ".modal-close-button"
48199
+ terms: termsContent
48186
48200
  })))));
48187
48201
  };
48188
48202
 
@@ -48378,8 +48392,7 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48378
48392
  version: "v2",
48379
48393
  showCheckbox: false,
48380
48394
  description: "View",
48381
- terms: termsContent,
48382
- initialFocusSelector: ".modal-close-button"
48395
+ terms: termsContent
48383
48396
  })))));
48384
48397
  };
48385
48398
 
@@ -48675,6 +48688,7 @@ var fallbackValues$Q = {
48675
48688
  focusStyles: focusStyles
48676
48689
  };
48677
48690
 
48691
+ var _excluded$z = ["themeValues", "isMobile", "supportsTouch", "sections", "openSection", "toggleOpenSection", "staggeredAnimation", "initiallyOpen", "openHeight", "containerStyles", "ariaDescribedBy", "isSectionRequired"];
48678
48692
  /*
48679
48693
  Takes an array of section objects, each object should look like:
48680
48694
  {
@@ -48721,11 +48735,39 @@ var RadioSection = function RadioSection(_ref) {
48721
48735
  containerStyles = _ref$containerStyles === void 0 ? "" : _ref$containerStyles,
48722
48736
  ariaDescribedBy = _ref.ariaDescribedBy,
48723
48737
  _ref$isSectionRequire = _ref.isSectionRequired,
48724
- isSectionRequired = _ref$isSectionRequire === void 0 ? false : _ref$isSectionRequire;
48738
+ isSectionRequired = _ref$isSectionRequire === void 0 ? false : _ref$isSectionRequire,
48739
+ rest = _objectWithoutProperties(_ref, _excluded$z);
48740
+
48741
+ var _useState = React.useState(null),
48742
+ _useState2 = _slicedToArray(_useState, 2),
48743
+ focused = _useState2[0],
48744
+ setFocused = _useState2[1];
48745
+
48746
+ var sectionRefs = React.useRef(_toConsumableArray(Array(sections.length)).map(function () {
48747
+ return /*#__PURE__*/React.createRef();
48748
+ }));
48725
48749
 
48726
- var handleKeyDown = function handleKeyDown(id, e) {
48727
- if ((e === null || e === void 0 ? void 0 : e.keyCode) === 13 || (e === null || e === void 0 ? void 0 : e.keyCode) === 32) {
48750
+ var handleKeyDown = function handleKeyDown(id, e, i) {
48751
+ if (e.currentTarget !== e.target) {
48752
+ return;
48753
+ } // Allow Enter and Space to select a section
48754
+
48755
+
48756
+ if (e.keyCode === ENTER || e.keyCode === SPACEBAR) {
48757
+ e.preventDefault();
48728
48758
  toggleOpenSection(id);
48759
+ } // Allow Up and Down arrow navigation between sections
48760
+
48761
+
48762
+ if (e.keyCode == ARROW_UP || e.keyCode == ARROW_DOWN || e.keyCode == ARROW_LEFT || e.keyCode == ARROW_RIGHT) {
48763
+ var _sectionRefs$current$, _sectionRefs$current$2, _sections$nextIndex, _sections$nextIndex2;
48764
+
48765
+ e.preventDefault();
48766
+ var indexIncrement = e.keyCode == ARROW_RIGHT || e.keyCode == ARROW_DOWN ? 1 : -1;
48767
+ var nextIndex = wrapIndex(i + indexIncrement);
48768
+ sectionRefs === null || sectionRefs === void 0 ? void 0 : (_sectionRefs$current$ = sectionRefs.current[nextIndex]) === null || _sectionRefs$current$ === void 0 ? void 0 : (_sectionRefs$current$2 = _sectionRefs$current$.current) === null || _sectionRefs$current$2 === void 0 ? void 0 : _sectionRefs$current$2.focus();
48769
+ setFocused((_sections$nextIndex = sections[nextIndex]) === null || _sections$nextIndex === void 0 ? void 0 : _sections$nextIndex.id);
48770
+ toggleOpenSection((_sections$nextIndex2 = sections[nextIndex]) === null || _sections$nextIndex2 === void 0 ? void 0 : _sections$nextIndex2.id);
48729
48771
  }
48730
48772
  };
48731
48773
 
@@ -48764,34 +48806,29 @@ var RadioSection = function RadioSection(_ref) {
48764
48806
  var fade = _ref4.fade;
48765
48807
  return fade && "opacity: 0.4;";
48766
48808
  });
48767
-
48768
- var _useState = React.useState(null),
48769
- _useState2 = _slicedToArray(_useState, 2),
48770
- focused = _useState2[0],
48771
- setFocused = _useState2[1];
48772
-
48773
48809
  return /*#__PURE__*/React__default.createElement(Box, {
48774
48810
  padding: "1px",
48775
48811
  border: "1px solid ".concat(themeValues.borderColor),
48776
48812
  borderRadius: "4px",
48777
48813
  extraStyles: containerStyles
48778
- }, /*#__PURE__*/React__default.createElement(Stack, {
48814
+ }, /*#__PURE__*/React__default.createElement(Stack, _extends({
48779
48815
  childGap: "0",
48780
- "aria-role": "radiogroup",
48816
+ role: "radiogroup",
48781
48817
  "aria-required": isSectionRequired
48782
- }, sections.filter(function (section) {
48818
+ }, rest), sections.filter(function (section) {
48783
48819
  return !section.hidden;
48784
- }).map(function (section) {
48820
+ }).map(function (section, i) {
48785
48821
  return /*#__PURE__*/React__default.createElement(Motion, {
48786
48822
  tabIndex: section.hideRadioButton || section.disabled ? "-1" : "0",
48787
- onKeyDown: function onKeyDown(e) {
48788
- return !section.disabled && handleKeyDown(section.id, e);
48823
+ ref: sectionRefs.current[i],
48824
+ onBlur: function onBlur() {
48825
+ return !section.disabled && setFocused(null);
48789
48826
  },
48790
48827
  onFocus: function onFocus() {
48791
48828
  return !section.disabled && setFocused(section.id);
48792
48829
  },
48793
- onBlur: function onBlur() {
48794
- return !section.disabled && setFocused(null);
48830
+ onKeyDown: function onKeyDown(e) {
48831
+ return !section.disabled && handleKeyDown(section.id, e, i);
48795
48832
  },
48796
48833
  hoverStyles: themeValues.focusStyles,
48797
48834
  animate: openSection === section.id ? "open" : "closed",
@@ -48801,7 +48838,9 @@ var RadioSection = function RadioSection(_ref) {
48801
48838
  role: "radio",
48802
48839
  "aria-checked": openSection === section.id,
48803
48840
  "aria-disabled": section.disabled,
48804
- "aria-required": section === null || section === void 0 ? void 0 : section.required
48841
+ "aria-required": section.required,
48842
+ "aria-labelledby": section.id,
48843
+ "aria-describedby": "right-icons-".concat(idString(section))
48805
48844
  }, /*#__PURE__*/React__default.createElement(Stack, {
48806
48845
  childGap: "0"
48807
48846
  }, /*#__PURE__*/React__default.createElement(Box, {
@@ -48840,7 +48879,7 @@ var RadioSection = function RadioSection(_ref) {
48840
48879
  return toggleOpenSection(section.id);
48841
48880
  },
48842
48881
  tabIndex: "-1",
48843
- isRequired: section === null || section === void 0 ? void 0 : section.required
48882
+ isRequired: section.required
48844
48883
  })), section.titleIcon && /*#__PURE__*/React__default.createElement(Cluster, {
48845
48884
  align: "center"
48846
48885
  }, section.titleIcon), /*#__PURE__*/React__default.createElement(Box, {
@@ -48850,9 +48889,10 @@ var RadioSection = function RadioSection(_ref) {
48850
48889
  htmlFor: "radio-input-".concat(idString(section)),
48851
48890
  color: CHARADE_GREY
48852
48891
  }, section.title))), section.rightIcons && /*#__PURE__*/React__default.createElement(Cluster, {
48892
+ id: "right-icons-".concat(idString(section)),
48853
48893
  childGap: "0.5rem",
48854
- "aria-label": (section === null || section === void 0 ? void 0 : section.rightIconsLabel) || null,
48855
- role: (section === null || section === void 0 ? void 0 : section.rightIconsRole) || null
48894
+ "aria-label": section.rightIconsLabel || null,
48895
+ role: section.rightIconsRole || null
48856
48896
  }, section.rightIcons.map(function (icon) {
48857
48897
  return /*#__PURE__*/React__default.createElement(RightIcon, {
48858
48898
  src: icon.img,
@@ -49905,6 +49945,7 @@ exports.ImageBox = ImageBox;
49905
49945
  exports.Imposter = Imposter;
49906
49946
  exports.InternalLink = InternalLink;
49907
49947
  exports.Jumbo = Jumbo$1;
49948
+ exports.KebabMenuIcon = KebabMenuIcon;
49908
49949
  exports.KioskImage = KioskImage;
49909
49950
  exports.LabeledAmount = LabeledAmount$1;
49910
49951
  exports.LineItem = LineItem$1;