@thecb/components 7.0.0-beta.0 → 7.0.0-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.
package/dist/index.cjs.js CHANGED
@@ -43337,8 +43337,15 @@ var Modal$1 = function Modal(_ref) {
43337
43337
  var _useContext = React.useContext(styled.ThemeContext),
43338
43338
  isMobile = _useContext.isMobile;
43339
43339
 
43340
+ var closeBtnRef = React.useRef(null);
43341
+ var modalBodyTextRef = React.useRef(null);
43340
43342
  return /*#__PURE__*/React__default.createElement(React.Fragment, null, modalOpen && /*#__PURE__*/React__default.createElement(reactAriaModal, {
43341
- focusDialog: true,
43343
+ initialFocus: closeBtnRef || modalBodyTextRef,
43344
+ focusTrapOptions: {
43345
+ delayInitialFocus: false,
43346
+ fallbackFocus: closeBtnRef || modalBodyTextRef
43347
+ } // fallback to resolve unit test errors https://github.com/focus-trap/focus-trap-react/issues/91
43348
+ ,
43342
43349
  onExit: onExit,
43343
43350
  getApplicationNode: getApplicationNode,
43344
43351
  titleText: modalHeaderText,
@@ -43371,6 +43378,7 @@ var Modal$1 = function Modal(_ref) {
43371
43378
  }, /*#__PURE__*/React__default.createElement(Stack, {
43372
43379
  childGap: "1.5rem"
43373
43380
  }, /*#__PURE__*/React__default.createElement(Box, {
43381
+ ref: modalBodyTextRef,
43374
43382
  borderWidthOverride: noBorder && "0 0 2px 0",
43375
43383
  borderColor: !noBorder && SILVER_GREY,
43376
43384
  padding: !noBorder && "0 0 1.5rem 0",
@@ -43434,6 +43442,7 @@ var Modal$1 = function Modal(_ref) {
43434
43442
  }))) : /*#__PURE__*/React__default.createElement(Box, {
43435
43443
  padding: "0.5rem"
43436
43444
  }, /*#__PURE__*/React__default.createElement(ButtonWithAction, {
43445
+ ref: closeBtnRef,
43437
43446
  action: hideModal,
43438
43447
  variant: "primary",
43439
43448
  text: closeButtonText,