diff --git a/src-docs/src/views/modal/confirm_modal.js b/src-docs/src/views/modal/confirm_modal.tsx similarity index 98% rename from src-docs/src/views/modal/confirm_modal.js rename to src-docs/src/views/modal/confirm_modal.tsx index 8a4ea147576..b79539692f9 100644 --- a/src-docs/src/views/modal/confirm_modal.js +++ b/src-docs/src/views/modal/confirm_modal.tsx @@ -5,7 +5,7 @@ import { EuiConfirmModal, EuiFlexGroup, EuiFlexItem, -} from '../../../../src/components'; +} from '../../../../src'; export default () => { const [isModalVisible, setIsModalVisible] = useState(false); diff --git a/src-docs/src/views/modal/confirm_modal_loading.js b/src-docs/src/views/modal/confirm_modal_loading.tsx similarity index 94% rename from src-docs/src/views/modal/confirm_modal_loading.js rename to src-docs/src/views/modal/confirm_modal_loading.tsx index 7cfc0558271..4a1fd1b1573 100644 --- a/src-docs/src/views/modal/confirm_modal_loading.js +++ b/src-docs/src/views/modal/confirm_modal_loading.tsx @@ -5,16 +5,18 @@ import { EuiConfirmModal, EuiFormRow, EuiFieldText, -} from '../../../../src/components'; +} from '../../../../src'; export default () => { const [isLoading, setIsLoading] = useState(false); - clearTimeout(searchTimeout); + const searchTimeout = setTimeout(() => { // Simulate a remotely-executed search. setIsLoading(false); }, 1200); + clearTimeout(searchTimeout); + const [isModalVisible, setIsModalVisible] = useState(false); const showModal = () => { setIsModalVisible(true); @@ -27,7 +29,7 @@ export default () => { }; const [value, setValue] = useState(''); - const onChange = (e) => { + const onChange = (e: React.ChangeEvent) => { setValue(e.target.value); }; diff --git a/src-docs/src/views/modal/modal.js b/src-docs/src/views/modal/modal.tsx similarity index 100% rename from src-docs/src/views/modal/modal.js rename to src-docs/src/views/modal/modal.tsx diff --git a/src-docs/src/views/modal/modal_example.js b/src-docs/src/views/modal/modal_example.js index 458fc0216f8..a7b648a5428 100644 --- a/src-docs/src/views/modal/modal_example.js +++ b/src-docs/src/views/modal/modal_example.js @@ -131,7 +131,7 @@ export const ModalExample = { { source: [ { - type: GuideSectionTypes.JS, + type: GuideSectionTypes.TSX, code: modalSource, }, ], @@ -167,7 +167,7 @@ export const ModalExample = { title: 'Forms in a modal', source: [ { - type: GuideSectionTypes.JS, + type: GuideSectionTypes.TSX, code: modalFormSource, }, ], @@ -192,7 +192,7 @@ export const ModalExample = { title: 'Confirm modal', source: [ { - type: GuideSectionTypes.JS, + type: GuideSectionTypes.TSX, code: confirmModalSource, }, ], @@ -214,7 +214,7 @@ export const ModalExample = { title: 'Loading and disabling confirm button', source: [ { - type: GuideSectionTypes.JS, + type: GuideSectionTypes.TSX, code: confirmModalLoadingSource, }, ], @@ -236,7 +236,7 @@ export const ModalExample = { title: 'Widths', source: [ { - type: GuideSectionTypes.JS, + type: GuideSectionTypes.TSX, code: modalWidthSource, }, ], diff --git a/src-docs/src/views/modal/modal_form.js b/src-docs/src/views/modal/modal_form.tsx similarity index 91% rename from src-docs/src/views/modal/modal_form.js rename to src-docs/src/views/modal/modal_form.tsx index 70ef6c67ccb..a9b138235c8 100644 --- a/src-docs/src/views/modal/modal_form.js +++ b/src-docs/src/views/modal/modal_form.tsx @@ -1,4 +1,4 @@ -import React, { useState, Fragment } from 'react'; +import React, { useState } from 'react'; import { EuiButton, @@ -15,7 +15,7 @@ import { EuiSwitch, EuiSuperSelect, EuiText, -} from '../../../../src/components'; +} from '../../../../src'; import { useGeneratedHtmlId } from '../../../../src/services'; @@ -39,36 +39,36 @@ export default () => { value: 'option_one', inputDisplay: 'Option one', dropdownDisplay: ( - + <> Option one

Has a short description giving more detail to the option.

-
+ ), }, { value: 'option_two', inputDisplay: 'Option two', dropdownDisplay: ( - + <> Option two

Has a short description giving more detail to the option.

-
+ ), }, { value: 'option_three', inputDisplay: 'Option three', dropdownDisplay: ( - + <> Option three

Has a short description giving more detail to the option.

-
+ ), }, ]; @@ -90,7 +90,7 @@ export default () => { - + @@ -105,7 +105,7 @@ export default () => { ); - const onSuperSelectChange = (value) => { + const onSuperSelectChange = (value: string) => { setSuperSelectValue(value); }; diff --git a/src-docs/src/views/modal/modal_width.js b/src-docs/src/views/modal/modal_width.tsx similarity index 93% rename from src-docs/src/views/modal/modal_width.js rename to src-docs/src/views/modal/modal_width.tsx index 1a92c52c19c..4ba180ea71f 100644 --- a/src-docs/src/views/modal/modal_width.js +++ b/src-docs/src/views/modal/modal_width.tsx @@ -8,8 +8,8 @@ import { EuiModalHeader, EuiModalHeaderTitle, EuiCodeBlock, -} from '../../../../src/components'; -import { EuiSpacer } from '../../../../src/components/spacer'; + EuiSpacer, +} from '../../../../src'; export default () => { const [isModalVisible, setIsModalVisible] = useState(false); diff --git a/src/components/image/image_fullscreen_wrapper.styles.ts b/src/components/image/image_fullscreen_wrapper.styles.ts index 9230791dbd1..698d662aa7e 100644 --- a/src/components/image/image_fullscreen_wrapper.styles.ts +++ b/src/components/image/image_fullscreen_wrapper.styles.ts @@ -6,11 +6,12 @@ * Side Public License, v 1. */ -import { css, keyframes } from '@emotion/react'; +import { css } from '@emotion/react'; import { logicalCSS, logicalTextAlignCSS, euiCanAnimate, + euiAnimSlideInUp, } from '../../global_styling'; import { UseEuiTheme } from '../../services'; @@ -28,7 +29,7 @@ export const euiImageFullscreenWrapperStyles = ( line-height: 0; // Fixes cropping when image is resized by forcing its height to be determined by the image not line-height ${euiCanAnimate} { - animation: ${euiImageFullScreen(euiTheme.size.xxxxl)} + animation: ${euiAnimSlideInUp(euiTheme.size.xxxxl)} ${euiTheme.animation.extraSlow} ${euiTheme.animation.bounce}; } @@ -42,15 +43,3 @@ export const euiImageFullscreenWrapperStyles = ( `, }; }; - -const euiImageFullScreen = (size: string) => keyframes` - 0% { - opacity: 0; - transform: translateY(${size}); - } - - 100% { - opacity: 1; - transform: translateY(0); - } -`; diff --git a/src/components/index.scss b/src/components/index.scss index 12530e2af31..12c8908501b 100644 --- a/src/components/index.scss +++ b/src/components/index.scss @@ -17,7 +17,6 @@ @import 'header/index'; @import 'key_pad_menu/index'; @import 'markdown_editor/index'; -@import 'modal/index'; @import 'notification/index'; @import 'panel/index'; @import 'page/index'; // Page needs to come after Panel for cascade specificity diff --git a/src/components/modal/__snapshots__/confirm_modal.test.tsx.snap b/src/components/modal/__snapshots__/confirm_modal.test.tsx.snap index 4bfb83a1d64..ab79a4d4291 100644 --- a/src/components/modal/__snapshots__/confirm_modal.test.tsx.snap +++ b/src/components/modal/__snapshots__/confirm_modal.test.tsx.snap @@ -12,13 +12,13 @@ Array [ >
-
-

- A confirmation modal -

-
+ A confirmation modal +
-
-

- A confirmation modal -

-
+ A confirmation modal +