@thecb/components 9.3.2 → 9.3.3-beta.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -45810,7 +45810,9 @@ var Modal$1 = function Modal(_ref) {
45810
45810
  buttonExtraStyles = _ref.buttonExtraStyles,
45811
45811
  children = _ref.children,
45812
45812
  _ref$dataQa = _ref.dataQa,
45813
- dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa;
45813
+ dataQa = _ref$dataQa === void 0 ? null : _ref$dataQa,
45814
+ _ref$initialFocusSele = _ref.initialFocusSelector,
45815
+ initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
45814
45816
 
45815
45817
  var _useContext = useContext(ThemeContext),
45816
45818
  isMobile = _useContext.isMobile;
@@ -45837,7 +45839,11 @@ var Modal$1 = function Modal(_ref) {
45837
45839
  width: customWidth || "615px",
45838
45840
  overflow: "auto"
45839
45841
  },
45840
- underlayClickExits: underlayClickExits
45842
+ underlayClickExits: underlayClickExits,
45843
+ "aria-modal": true,
45844
+ initialFocus: initialFocusSelector,
45845
+ focusDialog: !initialFocusSelector // Focus the dialogue box itself if no selector for initial focus was provided
45846
+
45841
45847
  }, /*#__PURE__*/React.createElement(Box, {
45842
45848
  padding: "0",
45843
45849
  borderRadius: "2px",
@@ -45884,7 +45890,9 @@ var Modal$1 = function Modal(_ref) {
45884
45890
  text: cancelButtonText,
45885
45891
  dataQa: cancelButtonText,
45886
45892
  extraStyles: buttonExtraStyles,
45887
- className: "modal-cancel-button"
45893
+ className: "modal-cancel-button",
45894
+ role: "button",
45895
+ name: cancelButtonText
45888
45896
  })), /*#__PURE__*/React.createElement(Box, {
45889
45897
  width: "100%",
45890
45898
  padding: "0"
@@ -45896,7 +45904,9 @@ var Modal$1 = function Modal(_ref) {
45896
45904
  isLoading: isLoading,
45897
45905
  disabled: isContinueActionDisabled,
45898
45906
  extraStyles: buttonExtraStyles,
45899
- className: "modal-continue-button"
45907
+ className: "modal-continue-button",
45908
+ role: "button",
45909
+ name: continueButtonText
45900
45910
  }))) : /*#__PURE__*/React.createElement(Stack, {
45901
45911
  childGap: "1rem",
45902
45912
  direction: "row",
@@ -45907,7 +45917,9 @@ var Modal$1 = function Modal(_ref) {
45907
45917
  text: cancelButtonText,
45908
45918
  dataQa: cancelButtonText,
45909
45919
  extraStyles: buttonExtraStyles,
45910
- className: "modal-cancel-button"
45920
+ className: "modal-cancel-button",
45921
+ role: "button",
45922
+ name: cancelButtonText
45911
45923
  }), /*#__PURE__*/React.createElement(ButtonWithAction, {
45912
45924
  variant: useDangerButton ? "danger" : "primary",
45913
45925
  action: continueAction,
@@ -45916,7 +45928,9 @@ var Modal$1 = function Modal(_ref) {
45916
45928
  isLoading: isLoading,
45917
45929
  disabled: isContinueActionDisabled,
45918
45930
  extraStyles: buttonExtraStyles,
45919
- className: "modal-continue-button"
45931
+ className: "modal-continue-button",
45932
+ role: "button",
45933
+ name: continueButtonText
45920
45934
  }))) : /*#__PURE__*/React.createElement(Box, {
45921
45935
  padding: "0.5rem"
45922
45936
  }, /*#__PURE__*/React.createElement(ButtonWithAction, {
@@ -45925,7 +45939,9 @@ var Modal$1 = function Modal(_ref) {
45925
45939
  text: closeButtonText,
45926
45940
  dataQa: closeButtonText,
45927
45941
  extraStyles: buttonExtraStyles,
45928
- className: "modal-close-button"
45942
+ className: "modal-close-button",
45943
+ role: "button",
45944
+ name: closeButtonText
45929
45945
  }))))))))), children);
45930
45946
  };
45931
45947
 
@@ -47756,7 +47772,8 @@ var AccountAndRoutingModal = function AccountAndRoutingModal(_ref) {
47756
47772
  continueAction: function continueAction() {
47757
47773
  toggleAccepted(true);
47758
47774
  toggleOpen(false);
47759
- }
47775
+ },
47776
+ initialFocusSelector: "[name='Close']"
47760
47777
  }, /*#__PURE__*/React.createElement(Text$1, {
47761
47778
  variant: "pS",
47762
47779
  onClick: function onClick() {
@@ -47769,7 +47786,9 @@ var AccountAndRoutingModal = function AccountAndRoutingModal(_ref) {
47769
47786
  color: themeValues.linkColor,
47770
47787
  weight: themeValues.fontWeight,
47771
47788
  hoverStyles: themeValues.modalLinkHoverFocus,
47772
- extraStyles: "cursor: pointer;"
47789
+ extraStyles: "cursor: pointer;",
47790
+ role: "button",
47791
+ className: "modal-trigger"
47773
47792
  }, link));
47774
47793
  };
47775
47794
 
@@ -47826,7 +47845,9 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
47826
47845
  variant = _ref.variant,
47827
47846
  _ref$linkVariant = _ref.linkVariant,
47828
47847
  linkVariant = _ref$linkVariant === void 0 ? "p" : _ref$linkVariant,
47829
- themeValues = _ref.themeValues;
47848
+ themeValues = _ref.themeValues,
47849
+ _ref$initialFocusSele = _ref.initialFocusSelector,
47850
+ initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
47830
47851
  return /*#__PURE__*/React.createElement(Modal$1, {
47831
47852
  modalOpen: isOpen,
47832
47853
  hideModal: function hideModal() {
@@ -47852,7 +47873,8 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
47852
47873
  continueAction: function continueAction() {
47853
47874
  toggleAccepted(true);
47854
47875
  toggleOpen(false);
47855
- }
47876
+ },
47877
+ initialFocusSelector: initialFocusSelector
47856
47878
  }, /*#__PURE__*/React.createElement(Text$1, {
47857
47879
  variant: linkVariant,
47858
47880
  onClick: function onClick() {
@@ -47865,7 +47887,10 @@ var TermsAndConditionsModal = function TermsAndConditionsModal(_ref) {
47865
47887
  color: themeValues.linkColor,
47866
47888
  weight: themeValues.fontWeight,
47867
47889
  hoverStyles: themeValues.modalLinkHoverFocus,
47868
- extraStyles: "display: inline-block; width: fit-content; cursor: pointer"
47890
+ extraStyles: "display: inline-block; width: fit-content; cursor: pointer",
47891
+ role: "button" // This should always be a "button" since it opens a modal
47892
+ ,
47893
+ className: "modal-trigger"
47869
47894
  }, link));
47870
47895
  };
47871
47896
 
@@ -47878,7 +47903,9 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47878
47903
  terms = _ref.terms,
47879
47904
  _ref$error = _ref.error,
47880
47905
  error = _ref$error === void 0 ? false : _ref$error,
47881
- linkVariant = _ref.linkVariant;
47906
+ linkVariant = _ref.linkVariant,
47907
+ _ref$initialFocusSele = _ref.initialFocusSelector,
47908
+ initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
47882
47909
 
47883
47910
  var _useState = useState(false),
47884
47911
  _useState2 = _slicedToArray(_useState, 2),
@@ -47900,7 +47927,8 @@ var TermsAndConditionsControlV1 = function TermsAndConditionsControlV1(_ref) {
47900
47927
  terms: terms,
47901
47928
  isOpen: showTerms,
47902
47929
  toggleOpen: toggleShowTerms,
47903
- linkVariant: linkVariant
47930
+ linkVariant: linkVariant,
47931
+ initialFocusSelector: initialFocusSelector
47904
47932
  })))));
47905
47933
  };
47906
47934
 
@@ -47931,7 +47959,9 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47931
47959
  _ref$checkboxMargin = _ref.checkboxMargin,
47932
47960
  checkboxMargin = _ref$checkboxMargin === void 0 ? "4px 8px 4px 4px" : _ref$checkboxMargin,
47933
47961
  _ref$modalTitle = _ref.modalTitle,
47934
- modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle;
47962
+ modalTitle = _ref$modalTitle === void 0 ? "Terms and Conditions" : _ref$modalTitle,
47963
+ _ref$initialFocusSele = _ref.initialFocusSelector,
47964
+ initialFocusSelector = _ref$initialFocusSele === void 0 ? "" : _ref$initialFocusSele;
47935
47965
 
47936
47966
  var _useState = useState(false),
47937
47967
  _useState2 = _slicedToArray(_useState, 2),
@@ -47987,7 +48017,8 @@ var TermsAndConditionsControlV2 = function TermsAndConditionsControlV2(_ref) {
47987
48017
  isOpen: showTerms,
47988
48018
  toggleOpen: toggleTerms,
47989
48019
  linkVariant: modalVariant,
47990
- title: modalTitle
48020
+ title: modalTitle,
48021
+ initialFocusSelector: initialFocusSelector
47991
48022
  })), /*#__PURE__*/React.createElement("div", {
47992
48023
  "aria-live": "polite",
47993
48024
  "aria-atomic": true
@@ -48188,7 +48219,8 @@ var PaymentFormACH = function PaymentFormACH(_ref) {
48188
48219
  version: "v2",
48189
48220
  showCheckbox: false,
48190
48221
  description: "View",
48191
- terms: termsContent
48222
+ terms: termsContent,
48223
+ initialFocusSelector: ".modal-close-button"
48192
48224
  })))));
48193
48225
  };
48194
48226
 
@@ -48384,7 +48416,8 @@ var PaymentFormCard = function PaymentFormCard(_ref) {
48384
48416
  version: "v2",
48385
48417
  showCheckbox: false,
48386
48418
  description: "View",
48387
- terms: termsContent
48419
+ terms: termsContent,
48420
+ initialFocusSelector: ".modal-close-button"
48388
48421
  })))));
48389
48422
  };
48390
48423