@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.cjs.js CHANGED
@@ -46310,15 +46310,17 @@ var Modal$1 = function Modal(_ref) {
46310
46310
  // the `fallbackFocus` option. However, React does not guarantee the ref supplied to
46311
46311
  // this option will be populated on initial render when `focus-trap` is checking
46312
46312
  // these option. When there are no buttons in the modal, this causes an error.
46313
- // Because `focus-trap` cannot be disabled, the ref requires a dummy node to satisfy
46314
- // `focus-trap` until React populates it with the real ref value.
46313
+ // Because `focus-trap` cannot be disabled, the ref itself requires a default value
46314
+ // to satisfy `focus-trap` until React populates it with the real ref value.
46315
46315
  //
46316
46316
  // See:
46317
46317
  // - https://react.dev/reference/react/useRef#caveats
46318
46318
  // - https://github.com/davidtheclark/react-aria-modal/pull/103
46319
- var modalContainerRef = React.useRef( /*#__PURE__*/React__default.createElement("div", null));
46319
+ // - https://github.com/focus-trap/focus-trap?tab=readme-ov-file#createoptions
46320
+ var modalContainerRef = React.useRef("[id='react-aria-modal-dialog']");
46320
46321
  return /*#__PURE__*/React__default.createElement("div", {
46321
46322
  ref: modalContainerRef,
46323
+ tabIndex: "-1",
46322
46324
  "data-qa": dataQa
46323
46325
  }, modalOpen && /*#__PURE__*/React__default.createElement(reactAriaModal, {
46324
46326
  focusTrapOptions: {
@@ -46631,13 +46633,14 @@ var Modal$2 = function Modal(_ref) {
46631
46633
  // the `fallbackFocus` option. However, React does not guarantee the ref supplied to
46632
46634
  // this option will be populated on initial render when `focus-trap` is checking
46633
46635
  // these option. When there are no buttons in the modal, this causes an error.
46634
- // Because `focus-trap` cannot be disabled, the ref requires a dummy node to satisfy
46635
- // `focus-trap` until React populates it with the real ref value.
46636
+ // Because `focus-trap` cannot be disabled, the ref itself requires a default value
46637
+ // to satisfy `focus-trap` until React populates it with the real ref value.
46636
46638
  //
46637
46639
  // See:
46638
46640
  // - https://react.dev/reference/react/useRef#caveats
46639
46641
  // - https://github.com/davidtheclark/react-aria-modal/pull/103
46640
- var modalContainerRef = React.useRef( /*#__PURE__*/React__default.createElement("div", null));
46642
+ // - https://github.com/focus-trap/focus-trap?tab=readme-ov-file#createoptions
46643
+ var modalContainerRef = React.useRef("[id='react-aria-modal-dialog']");
46641
46644
  var hasCloseButton = onlyCloseButton && !noButtons;
46642
46645
  var hasCancelButton = !onlyContinueButton && !onlyCloseButton && !noButtons;
46643
46646
  var hasContinueButton = onlyContinueButton && !noButtons || !onlyCloseButton && !noButtons;
@@ -46705,7 +46708,8 @@ var Modal$2 = function Modal(_ref) {
46705
46708
  cancelAction: cancelAction,
46706
46709
  cancelButtonText: cancelButtonText,
46707
46710
  hideModal: hideModal,
46708
- isMobile: isMobile
46711
+ isMobile: isMobile,
46712
+ key: "cancel"
46709
46713
  }), hasContinueButton && /*#__PURE__*/React__default.createElement(ContinueButton, {
46710
46714
  buttonExtraStyles: buttonExtraStyles,
46711
46715
  continueAction: continueAction,
@@ -46714,12 +46718,14 @@ var Modal$2 = function Modal(_ref) {
46714
46718
  isContinueActionDisabled: isContinueActionDisabled,
46715
46719
  isLoading: isLoading,
46716
46720
  isMobile: isMobile,
46721
+ key: "continue",
46717
46722
  useDangerButton: useDangerButton
46718
46723
  }), hasCloseButton && /*#__PURE__*/React__default.createElement(CloseButton, {
46719
46724
  buttonExtraStyles: buttonExtraStyles,
46720
46725
  closeButtonText: closeButtonText,
46721
46726
  hideModal: hideModal,
46722
- isMobile: isMobile
46727
+ isMobile: isMobile,
46728
+ key: "close"
46723
46729
  })].filter(function (button) {
46724
46730
  return button;
46725
46731
  }))))), children);