@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.esm.js CHANGED
@@ -43289,8 +43289,6 @@ var getApplicationNode = function getApplicationNode() {
43289
43289
  };
43290
43290
 
43291
43291
  var Modal$1 = function Modal(_ref) {
43292
- var _ref2, _ref3;
43293
-
43294
43292
  var hideModal = _ref.hideModal,
43295
43293
  _ref$onExit = _ref.onExit,
43296
43294
  onExit = _ref$onExit === void 0 ? hideModal : _ref$onExit,
@@ -43331,16 +43329,16 @@ var Modal$1 = function Modal(_ref) {
43331
43329
  var _useContext = useContext(ThemeContext),
43332
43330
  isMobile = _useContext.isMobile;
43333
43331
 
43334
- var closeBtnRef = useRef(null);
43335
- var bodyTextContainerRef = useRef(null);
43336
- debugger;
43337
- return /*#__PURE__*/React.createElement(Fragment$1, null, modalOpen && /*#__PURE__*/React.createElement(reactAriaModal, {
43338
- initialFocus: (_ref2 = closeBtnRef !== null && closeBtnRef !== void 0 ? closeBtnRef : bodyTextContainerRef) !== null && _ref2 !== void 0 ? _ref2 : '#root',
43332
+ var modalContainerRef = useRef(null);
43333
+ return /*#__PURE__*/React.createElement("div", {
43334
+ ref: modalContainerRef
43335
+ }, modalOpen && /*#__PURE__*/React.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
43336
+ , {
43337
+ initialFocus: modalContainerRef === null || modalContainerRef === void 0 ? void 0 : modalContainerRef.current,
43339
43338
  focusTrapOptions: {
43340
43339
  delayInitialFocus: false,
43341
- fallbackFocus: (_ref3 = closeBtnRef !== null && closeBtnRef !== void 0 ? closeBtnRef : bodyTextContainerRef) !== null && _ref3 !== void 0 ? _ref3 : '#root'
43342
- } // fallback to resolve unit test errors https://github.com/focus-trap/focus-trap-react/issues/91
43343
- ,
43340
+ fallbackFocus: modalContainerRef === null || modalContainerRef === void 0 ? void 0 : modalContainerRef.current
43341
+ },
43344
43342
  onExit: onExit,
43345
43343
  getApplicationNode: getApplicationNode,
43346
43344
  titleText: modalHeaderText,
@@ -43373,7 +43371,6 @@ var Modal$1 = function Modal(_ref) {
43373
43371
  }, /*#__PURE__*/React.createElement(Stack, {
43374
43372
  childGap: "1.5rem"
43375
43373
  }, /*#__PURE__*/React.createElement(Box, {
43376
- ref: bodyTextContainerRef,
43377
43374
  borderWidthOverride: noBorder && "0 0 2px 0",
43378
43375
  borderColor: !noBorder && SILVER_GREY,
43379
43376
  padding: !noBorder && "0 0 1.5rem 0",
@@ -43437,7 +43434,6 @@ var Modal$1 = function Modal(_ref) {
43437
43434
  }))) : /*#__PURE__*/React.createElement(Box, {
43438
43435
  padding: "0.5rem"
43439
43436
  }, /*#__PURE__*/React.createElement(ButtonWithAction, {
43440
- ref: closeBtnRef,
43441
43437
  action: hideModal,
43442
43438
  variant: "primary",
43443
43439
  text: closeButtonText,