@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.esm.js CHANGED
@@ -43329,8 +43329,15 @@ 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 modalBodyTextRef = useRef(null);
43332
43334
  return /*#__PURE__*/React.createElement(Fragment$1, null, modalOpen && /*#__PURE__*/React.createElement(reactAriaModal, {
43333
- focusDialog: true,
43335
+ initialFocus: closeBtnRef || modalBodyTextRef,
43336
+ focusTrapOptions: {
43337
+ delayInitialFocus: false,
43338
+ fallbackFocus: closeBtnRef || modalBodyTextRef
43339
+ } // fallback to resolve unit test errors https://github.com/focus-trap/focus-trap-react/issues/91
43340
+ ,
43334
43341
  onExit: onExit,
43335
43342
  getApplicationNode: getApplicationNode,
43336
43343
  titleText: modalHeaderText,
@@ -43363,6 +43370,7 @@ var Modal$1 = function Modal(_ref) {
43363
43370
  }, /*#__PURE__*/React.createElement(Stack, {
43364
43371
  childGap: "1.5rem"
43365
43372
  }, /*#__PURE__*/React.createElement(Box, {
43373
+ ref: modalBodyTextRef,
43366
43374
  borderWidthOverride: noBorder && "0 0 2px 0",
43367
43375
  borderColor: !noBorder && SILVER_GREY,
43368
43376
  padding: !noBorder && "0 0 1.5rem 0",
@@ -43426,6 +43434,7 @@ var Modal$1 = function Modal(_ref) {
43426
43434
  }))) : /*#__PURE__*/React.createElement(Box, {
43427
43435
  padding: "0.5rem"
43428
43436
  }, /*#__PURE__*/React.createElement(ButtonWithAction, {
43437
+ ref: closeBtnRef,
43429
43438
  action: hideModal,
43430
43439
  variant: "primary",
43431
43440
  text: closeButtonText,