@thecb/components 10.5.0-beta.2 → 10.5.0-beta.3

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
@@ -46302,15 +46302,17 @@ var Modal$1 = function Modal(_ref) {
46302
46302
  // the `fallbackFocus` option. However, React does not guarantee the ref supplied to
46303
46303
  // this option will be populated on initial render when `focus-trap` is checking
46304
46304
  // these option. When there are no buttons in the modal, this causes an error.
46305
- // Because `focus-trap` cannot be disabled, the ref requires a dummy node to satisfy
46306
- // `focus-trap` until React populates it with the real ref value.
46305
+ // Because `focus-trap` cannot be disabled, the ref itself requires a default value
46306
+ // to satisfy `focus-trap` until React populates it with the real ref value.
46307
46307
  //
46308
46308
  // See:
46309
46309
  // - https://react.dev/reference/react/useRef#caveats
46310
46310
  // - https://github.com/davidtheclark/react-aria-modal/pull/103
46311
- var modalContainerRef = useRef( /*#__PURE__*/React.createElement("div", null));
46311
+ // - https://github.com/focus-trap/focus-trap?tab=readme-ov-file#createoptions
46312
+ var modalContainerRef = useRef("[id='react-aria-modal-dialog']");
46312
46313
  return /*#__PURE__*/React.createElement("div", {
46313
46314
  ref: modalContainerRef,
46315
+ tabIndex: "-1",
46314
46316
  "data-qa": dataQa
46315
46317
  }, modalOpen && /*#__PURE__*/React.createElement(reactAriaModal, {
46316
46318
  focusTrapOptions: {
@@ -46623,13 +46625,14 @@ var Modal$2 = function Modal(_ref) {
46623
46625
  // the `fallbackFocus` option. However, React does not guarantee the ref supplied to
46624
46626
  // this option will be populated on initial render when `focus-trap` is checking
46625
46627
  // these option. When there are no buttons in the modal, this causes an error.
46626
- // Because `focus-trap` cannot be disabled, the ref requires a dummy node to satisfy
46627
- // `focus-trap` until React populates it with the real ref value.
46628
+ // Because `focus-trap` cannot be disabled, the ref itself requires a default value
46629
+ // to satisfy `focus-trap` until React populates it with the real ref value.
46628
46630
  //
46629
46631
  // See:
46630
46632
  // - https://react.dev/reference/react/useRef#caveats
46631
46633
  // - https://github.com/davidtheclark/react-aria-modal/pull/103
46632
- var modalContainerRef = useRef( /*#__PURE__*/React.createElement("div", null));
46634
+ // - https://github.com/focus-trap/focus-trap?tab=readme-ov-file#createoptions
46635
+ var modalContainerRef = useRef("[id='react-aria-modal-dialog']");
46633
46636
  var hasCloseButton = onlyCloseButton && !noButtons;
46634
46637
  var hasCancelButton = !onlyContinueButton && !onlyCloseButton && !noButtons;
46635
46638
  var hasContinueButton = onlyContinueButton && !noButtons || !onlyCloseButton && !noButtons;
@@ -46697,7 +46700,8 @@ var Modal$2 = function Modal(_ref) {
46697
46700
  cancelAction: cancelAction,
46698
46701
  cancelButtonText: cancelButtonText,
46699
46702
  hideModal: hideModal,
46700
- isMobile: isMobile
46703
+ isMobile: isMobile,
46704
+ key: "cancel"
46701
46705
  }), hasContinueButton && /*#__PURE__*/React.createElement(ContinueButton, {
46702
46706
  buttonExtraStyles: buttonExtraStyles,
46703
46707
  continueAction: continueAction,
@@ -46706,12 +46710,14 @@ var Modal$2 = function Modal(_ref) {
46706
46710
  isContinueActionDisabled: isContinueActionDisabled,
46707
46711
  isLoading: isLoading,
46708
46712
  isMobile: isMobile,
46713
+ key: "continue",
46709
46714
  useDangerButton: useDangerButton
46710
46715
  }), hasCloseButton && /*#__PURE__*/React.createElement(CloseButton, {
46711
46716
  buttonExtraStyles: buttonExtraStyles,
46712
46717
  closeButtonText: closeButtonText,
46713
46718
  hideModal: hideModal,
46714
- isMobile: isMobile
46719
+ isMobile: isMobile,
46720
+ key: "close"
46715
46721
  })].filter(function (button) {
46716
46722
  return button;
46717
46723
  }))))), children);