@thecb/components 7.0.0-beta.5 → 7.0.0-beta.8

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