Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Emotion] Convert EuiModal #6321

Merged
merged 28 commits into from
Nov 18, 2022
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c80c82f
[Emotion] Convert `modal`
elizabetdev Oct 24, 2022
5f8418c
Fix weird bug in Chrome with parent `overflow: hidden` and children w…
elizabetdev Oct 26, 2022
ad14381
Better styles and fixed `euiOverflowShadowStyles`
elizabetdev Oct 26, 2022
d115136
Adding CL
elizabetdev Oct 26, 2022
a19dd98
Added `euiAnimSlideInUp`
elizabetdev Oct 26, 2022
1a6ac92
Removing unnecessary class name
elizabetdev Oct 27, 2022
999cd39
REVERT ME - To test bug with `mask-image`
elizabetdev Oct 27, 2022
37bf45f
Added `shouldRenderCustomStyles()` tests
elizabetdev Oct 27, 2022
17da165
Cleaned up docs code and converted to TS
elizabetdev Oct 27, 2022
05c6860
Adding bug fix in CL
elizabetdev Oct 27, 2022
0dec04e
CL again
elizabetdev Oct 27, 2022
8722ab8
CL again 😭
elizabetdev Oct 27, 2022
ff33864
Changing examples source types to TSX
elizabetdev Oct 27, 2022
70d40a7
Merge remote-tracking branch 'upstream/main' into emotion-convert-modal
elizabetdev Oct 31, 2022
d23c156
Merge remote-tracking branch 'upstream/main' into emotion-convert-modal
elizabetdev Nov 4, 2022
68d5c5f
Reverting example and renaming to `*.tsx`
elizabetdev Nov 4, 2022
efae049
Remove bug fix entry from CL
elizabetdev Nov 4, 2022
692e00d
Merge remote-tracking branch 'upstream/main' into emotion-convert-modal
elizabetdev Nov 17, 2022
2eada08
Merge branch 'main' into emotion-convert-modal
cee-chen Nov 18, 2022
5709a77
DRY out `initialFocus` types/prop docs + add `defaultFocusedButton` p…
cee-chen Nov 18, 2022
d51d28b
[EuiModalHeader] misc cleanup
cee-chen Nov 18, 2022
92b4067
Clean up unnecessary width CSS
cee-chen Nov 18, 2022
334ce8c
Simplify `style` logic + switch to logical property
cee-chen Nov 18, 2022
16ecde8
[opinionated] Rename `defaultMaxWidth` class modifier
cee-chen Nov 18, 2022
2f46f29
Fix `maxWidth` conditional class logic + write unit tests
cee-chen Nov 18, 2022
3d0a929
Use `inset` shorthand
cee-chen Nov 18, 2022
95c5d69
[EuiModal] Fix box-shadows
cee-chen Nov 18, 2022
d73eaf2
Restore `!important`s required for style.width overrides
cee-chen Nov 18, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`EuiFlyoutBody is rendered 1`] = `
data-test-subj="test subject string"
>
<div
class="euiFlyoutBody__overflow css-1fk8opf-noBanner"
class="euiFlyoutBody__overflow css-18yrfj9-noBanner"
tabindex="0"
>
<div
Expand Down
17 changes: 3 additions & 14 deletions src/components/image/image_fullscreen_wrapper.styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -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};
}

Expand All @@ -42,15 +43,3 @@ export const euiImageFullscreenWrapperStyles = (
`,
};
};

const euiImageFullScreen = (size: string) => keyframes`
0% {
opacity: 0;
transform: translateY(${size});
}

100% {
opacity: 1;
transform: translateY(0);
}
`;
1 change: 0 additions & 1 deletion src/components/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
40 changes: 18 additions & 22 deletions src/components/modal/__snapshots__/confirm_modal.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ Array [
>
<div
aria-label="aria-label"
class="euiModal euiModal--maxWidth-default euiModal--confirmation testClass1 testClass2"
class="euiModal euiModal--maxWidth-default euiModal--confirmation testClass1 testClass2 emotion-euiModal-maxWidth-confirmation"
data-test-subj="test subject string"
tabindex="0"
>
<button
aria-label="Closes this modal window"
class="euiButtonIcon euiButtonIcon--xSmall euiModal__closeIcon emotion-euiButtonIcon-empty-text-hoverStyles"
class="euiButtonIcon euiButtonIcon--xSmall euiModal__closeIcon emotion-euiButtonIcon-empty-text-hoverStyles-euiModal__closeIcon"
type="button"
>
<span
Expand All @@ -38,22 +38,20 @@ Array [
/>
</button>
<div
class="euiModalHeader"
class="euiModalHeader emotion-euiModalHeader"
>
<div
class="euiModalHeader__title"
<h1
class="euiTitle euiModalHeader__title emotion-euiTitle-m"
data-test-subj="confirmModalTitleText"
>
<h1>
A confirmation modal
</h1>
</div>
A confirmation modal
</h1>
</div>
<div
class="euiModalBody"
class="euiModalBody emotion-euiModalBody"
>
<div
class="euiModalBody__overflow"
class="euiModalBody__overflow emotion-euiModalBody__overflow"
>
<div
class="euiText emotion-euiText-m"
Expand All @@ -66,7 +64,7 @@ Array [
</div>
</div>
<div
class="euiModalFooter"
class="euiModalFooter emotion-euiModalFooter"
>
<button
class="euiButtonEmpty css-9t7nyf-empty-primary"
Expand Down Expand Up @@ -132,13 +130,13 @@ Array [
>
<div
aria-label="aria-label"
class="euiModal euiModal--maxWidth-default euiModal--confirmation testClass1 testClass2"
class="euiModal euiModal--maxWidth-default euiModal--confirmation testClass1 testClass2 emotion-euiModal-maxWidth-confirmation"
data-test-subj="test subject string"
tabindex="0"
>
<button
aria-label="Closes this modal window"
class="euiButtonIcon euiButtonIcon--xSmall euiModal__closeIcon emotion-euiButtonIcon-empty-text-hoverStyles"
class="euiButtonIcon euiButtonIcon--xSmall euiModal__closeIcon emotion-euiButtonIcon-empty-text-hoverStyles-euiModal__closeIcon"
type="button"
>
<span
Expand All @@ -149,19 +147,17 @@ Array [
/>
</button>
<div
class="euiModalHeader"
class="euiModalHeader emotion-euiModalHeader"
>
<div
class="euiModalHeader__title"
<h1
class="euiTitle euiModalHeader__title emotion-euiTitle-m"
data-test-subj="confirmModalTitleText"
>
<h1>
A confirmation modal
</h1>
</div>
A confirmation modal
</h1>
</div>
<div
class="euiModalFooter"
class="euiModalFooter emotion-euiModalFooter"
>
<button
class="euiButtonEmpty css-9t7nyf-empty-primary"
Expand Down
4 changes: 2 additions & 2 deletions src/components/modal/__snapshots__/modal.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ Array [
>
<div
aria-label="aria-label"
class="euiModal euiModal--maxWidth-default testClass1 testClass2"
class="euiModal euiModal--maxWidth-default testClass1 testClass2 emotion-euiModal-maxWidth"
data-test-subj="test subject string"
tabindex="0"
>
<button
aria-label="Closes this modal window"
class="euiButtonIcon euiButtonIcon--xSmall euiModal__closeIcon emotion-euiButtonIcon-empty-text-hoverStyles"
class="euiButtonIcon euiButtonIcon--xSmall euiModal__closeIcon emotion-euiButtonIcon-empty-text-hoverStyles-euiModal__closeIcon"
type="button"
>
<span
Expand Down
4 changes: 2 additions & 2 deletions src/components/modal/__snapshots__/modal_body.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
exports[`renders EuiModalBody 1`] = `
<div
aria-label="aria-label"
class="euiModalBody testClass1 testClass2"
class="euiModalBody testClass1 testClass2 emotion-euiModalBody"
data-test-subj="test subject string"
>
<div
class="euiModalBody__overflow"
class="euiModalBody__overflow emotion-euiModalBody__overflow"
>
children
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`renders EuiModalFooter 1`] = `
<div
aria-label="aria-label"
class="euiModalFooter testClass1 testClass2"
class="euiModalFooter testClass1 testClass2 emotion-euiModalFooter"
data-test-subj="test subject string"
>
children
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
exports[`renders EuiModalHeader 1`] = `
<div
aria-label="aria-label"
class="euiModalHeader testClass1 testClass2"
class="euiModalHeader testClass1 testClass2 emotion-euiModalHeader"
data-test-subj="test subject string"
>
children
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`renders EuiModalHeaderTitle 1`] = `
<div
<h1
aria-label="aria-label"
class="euiModalHeader__title testClass1 testClass2"
class="euiTitle euiModalHeader__title testClass1 testClass2 emotion-euiTitle-m"
data-test-subj="test subject string"
>
<h1>
children
</h1>
</div>
children
</h1>
`;
1 change: 0 additions & 1 deletion src/components/modal/_index.scss

This file was deleted.

154 changes: 0 additions & 154 deletions src/components/modal/_modal.scss

This file was deleted.

Loading