@thecb/components 10.5.0-beta.2 → 10.5.0-beta.4
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 +17 -10
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +17 -10
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/molecules/modal/Modal.stories.js +3 -3
- package/src/components/molecules/modal/ModalControlV1.js +5 -4
- package/src/components/molecules/modal/ModalControlV2.js +10 -5
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
|
|
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
|
-
|
|
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
|
|
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
|
-
|
|
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;
|
|
@@ -46664,8 +46667,9 @@ var Modal$2 = function Modal(_ref) {
|
|
|
46664
46667
|
},
|
|
46665
46668
|
dialogStyle: {
|
|
46666
46669
|
borderRadius: CORNER_STANDARD,
|
|
46667
|
-
|
|
46668
|
-
overflow: "auto"
|
|
46670
|
+
margin: SPACING_XS,
|
|
46671
|
+
overflow: "auto",
|
|
46672
|
+
width: isMobile ? "" : customWidth || "615px"
|
|
46669
46673
|
},
|
|
46670
46674
|
underlayClickExits: underlayClickExits,
|
|
46671
46675
|
"aria-modal": true,
|
|
@@ -46705,7 +46709,8 @@ var Modal$2 = function Modal(_ref) {
|
|
|
46705
46709
|
cancelAction: cancelAction,
|
|
46706
46710
|
cancelButtonText: cancelButtonText,
|
|
46707
46711
|
hideModal: hideModal,
|
|
46708
|
-
isMobile: isMobile
|
|
46712
|
+
isMobile: isMobile,
|
|
46713
|
+
key: "cancel"
|
|
46709
46714
|
}), hasContinueButton && /*#__PURE__*/React__default.createElement(ContinueButton, {
|
|
46710
46715
|
buttonExtraStyles: buttonExtraStyles,
|
|
46711
46716
|
continueAction: continueAction,
|
|
@@ -46714,12 +46719,14 @@ var Modal$2 = function Modal(_ref) {
|
|
|
46714
46719
|
isContinueActionDisabled: isContinueActionDisabled,
|
|
46715
46720
|
isLoading: isLoading,
|
|
46716
46721
|
isMobile: isMobile,
|
|
46722
|
+
key: "continue",
|
|
46717
46723
|
useDangerButton: useDangerButton
|
|
46718
46724
|
}), hasCloseButton && /*#__PURE__*/React__default.createElement(CloseButton, {
|
|
46719
46725
|
buttonExtraStyles: buttonExtraStyles,
|
|
46720
46726
|
closeButtonText: closeButtonText,
|
|
46721
46727
|
hideModal: hideModal,
|
|
46722
|
-
isMobile: isMobile
|
|
46728
|
+
isMobile: isMobile,
|
|
46729
|
+
key: "close"
|
|
46723
46730
|
})].filter(function (button) {
|
|
46724
46731
|
return button;
|
|
46725
46732
|
}))))), children);
|