diff --git a/CHANGELOG.md b/CHANGELOG.md index ef409deed98..e1451858e10 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ ## [`master`](https://github.com/elastic/eui/tree/master) +- Added `isLoading` prop and added `EuiOverlayMask` directly to `EuiConfirmModal` ([#4421](https://github.com/elastic/eui/pull/4421)) + **Bug fixes** - Fixed `id` usage throughout `EuiTreeView` to respect custom ids and stop conflicts in generated ids ([#4435](https://github.com/elastic/eui/pull/4435)) diff --git a/src-docs/src/views/modal/confirm_modal.js b/src-docs/src/views/modal/confirm_modal.js index 7175c36bf99..3260b7f2558 100644 --- a/src-docs/src/views/modal/confirm_modal.js +++ b/src-docs/src/views/modal/confirm_modal.js @@ -3,7 +3,6 @@ import React, { useState } from 'react'; import { EuiButton, EuiConfirmModal, - EuiOverlayMask, EuiFlexGroup, EuiFlexItem, } from '../../../../src/components'; @@ -16,6 +15,10 @@ export default () => { isButtonDisabledModalVisible, setIsButtonDisabledModalVisible, ] = useState(false); + const [ + isConfirmlLoadingModalVisible, + setIsConfirmlLoadingModalVisible, + ] = useState(false); const closeModal = () => setIsModalVisible(false); const showModal = () => setIsModalVisible(true); @@ -29,22 +32,24 @@ export default () => { const closeButtonDisabledModal = () => setIsButtonDisabledModalVisible(false); const showButtonDisabledModal = () => setIsButtonDisabledModalVisible(true); + const closeConfirmLoadingModal = () => + setIsConfirmlLoadingModalVisible(false); + const showConfirmLoadingModal = () => setIsConfirmlLoadingModalVisible(true); + let modal; if (isModalVisible) { modal = ( - - -

You’re about to do something.

-

Are you sure you want to do this?

-
-
+ +

You’re about to do something.

+

Are you sure you want to do this?

+
); } @@ -52,19 +57,17 @@ export default () => { if (isDestroyModalVisible) { destroyModal = ( - - -

You’re about to destroy something.

-

Are you sure you want to do this?

-
-
+ +

You’re about to destroy something.

+

Are you sure you want to do this?

+
); } @@ -72,16 +75,14 @@ export default () => { if (isEmptyModalVisible) { emptyModal = ( - - - + ); } @@ -89,17 +90,31 @@ export default () => { if (isButtonDisabledModalVisible) { buttonDisabledModal = ( - - - + + ); + } + + let confirmLoadingModal; + + if (isConfirmlLoadingModalVisible) { + confirmLoadingModal = ( + ); } @@ -124,11 +139,17 @@ export default () => { Show confirm disabled confirm modal + + + Show confirm loading confirm modal + + {modal} {destroyModal} {emptyModal} {buttonDisabledModal} + {confirmLoadingModal} ); }; diff --git a/src/components/modal/__snapshots__/confirm_modal.test.tsx.snap b/src/components/modal/__snapshots__/confirm_modal.test.tsx.snap index 3df7aedd8c9..954038871b6 100644 --- a/src/components/modal/__snapshots__/confirm_modal.test.tsx.snap +++ b/src/components/modal/__snapshots__/confirm_modal.test.tsx.snap @@ -3,11 +3,15 @@ exports[`EuiConfirmModal renders EuiConfirmModal 1`] = ` Array [