@thecb/components 7.0.0-beta.6 → 7.0.0-beta.9

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.cjs.js CHANGED
@@ -43297,8 +43297,6 @@ var getApplicationNode = function getApplicationNode() {
43297
43297
  };
43298
43298
 
43299
43299
  var Modal$1 = function Modal(_ref) {
43300
- var _ref2, _ref3;
43301
-
43302
43300
  var hideModal = _ref.hideModal,
43303
43301
  _ref$onExit = _ref.onExit,
43304
43302
  onExit = _ref$onExit === void 0 ? hideModal : _ref$onExit,
@@ -43339,16 +43337,16 @@ var Modal$1 = function Modal(_ref) {
43339
43337
  var _useContext = React.useContext(styled.ThemeContext),
43340
43338
  isMobile = _useContext.isMobile;
43341
43339
 
43342
- var closeBtnRef = React.useRef(null);
43343
- var bodyTextContainerRef = React.useRef(null);
43344
- debugger;
43345
- return /*#__PURE__*/React__default.createElement(React.Fragment, null, modalOpen && /*#__PURE__*/React__default.createElement(reactAriaModal, {
43346
- initialFocus: (_ref2 = closeBtnRef !== null && closeBtnRef !== void 0 ? closeBtnRef : bodyTextContainerRef) !== null && _ref2 !== void 0 ? _ref2 : '#root',
43340
+ var modalContainerRef = React.useRef(null);
43341
+ return /*#__PURE__*/React__default.createElement("div", {
43342
+ ref: modalContainerRef
43343
+ }, modalOpen && /*#__PURE__*/React__default.createElement(reactAriaModal // fallback to resolve Jest unit test errors when tabbable doesn't exist in jsdom https://github.com/focus-trap/focus-trap-react/issues/91
43344
+ , {
43345
+ initialFocus: modalContainerRef === null || modalContainerRef === void 0 ? void 0 : modalContainerRef.current,
43347
43346
  focusTrapOptions: {
43348
43347
  delayInitialFocus: false,
43349
- fallbackFocus: (_ref3 = closeBtnRef !== null && closeBtnRef !== void 0 ? closeBtnRef : bodyTextContainerRef) !== null && _ref3 !== void 0 ? _ref3 : '#root'
43350
- } // fallback to resolve unit test errors https://github.com/focus-trap/focus-trap-react/issues/91
43351
- ,
43348
+ fallbackFocus: modalContainerRef === null || modalContainerRef === void 0 ? void 0 : modalContainerRef.current
43349
+ },
43352
43350
  onExit: onExit,
43353
43351
  getApplicationNode: getApplicationNode,
43354
43352
  titleText: modalHeaderText,
@@ -43381,7 +43379,6 @@ var Modal$1 = function Modal(_ref) {
43381
43379
  }, /*#__PURE__*/React__default.createElement(Stack, {
43382
43380
  childGap: "1.5rem"
43383
43381
  }, /*#__PURE__*/React__default.createElement(Box, {
43384
- ref: bodyTextContainerRef,
43385
43382
  borderWidthOverride: noBorder && "0 0 2px 0",
43386
43383
  borderColor: !noBorder && SILVER_GREY,
43387
43384
  padding: !noBorder && "0 0 1.5rem 0",
@@ -43445,7 +43442,6 @@ var Modal$1 = function Modal(_ref) {
43445
43442
  }))) : /*#__PURE__*/React__default.createElement(Box, {
43446
43443
  padding: "0.5rem"
43447
43444
  }, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
43448
- ref: closeBtnRef,
43449
43445
  action: hideModal,
43450
43446
  variant: "primary",
43451
43447
  text: closeButtonText,