diff --git a/CHANGELOG.md b/CHANGELOG.md index 92ebabfa170..4c7e5587681 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,16 @@ **Bug fixes** - Fixed `EuiToolTip` bug which caused the tooltip to hide when moving the mouse around inside of the trigger element ([#557](https://github.com/elastic/eui/pull/557)) +- Added a `buttonColor` prop to `EuiConfirmModal` ([#546](https://github.com/elastic/eui/pull/546)) +- Added ‘baseline’ as option to `EuiFlexGroup`'s `alignItems` prop ([#546](https://github.com/elastic/eui/pull/546)) # [`0.0.33`](https://github.com/elastic/eui/tree/v0.0.33) - Added initial sorting option to `EuiInMemoryTable` ([#547](https://github.com/elastic/eui/pull/547)) +- Horizontally scrolling `EuiTabs` ([#546](https://github.com/elastic/eui/pull/546)) +- Remove padding from both sides of `EuiEmptyButton` ([#546](https://github.com/elastic/eui/pull/546)) +- Added `disabled` prop to placeholder (ellipses) button in pagination ([#546](https://github.com/elastic/eui/pull/546)) +- Converted `.euiHeader__notification` into `EuiHeaderNotification` ([#546](https://github.com/elastic/eui/pull/546)) **Bug fixes** diff --git a/src-docs/src/views/header/header_user_menu.js b/src-docs/src/views/header/header_user_menu.js index 41b882b5007..f1bb8b3380e 100644 --- a/src-docs/src/views/header/header_user_menu.js +++ b/src-docs/src/views/header/header_user_menu.js @@ -8,6 +8,7 @@ import { EuiFlexItem, EuiHeaderAlert, EuiHeaderSectionItemButton, + EuiHeaderNotification, EuiIcon, EuiLink, EuiText, @@ -44,9 +45,7 @@ export default class extends Component { size="m" /> - - 3 - + 3 ); diff --git a/src-docs/src/views/modal/confirm_modal.js b/src-docs/src/views/modal/confirm_modal.js index ff485b1e59a..18090acf76b 100644 --- a/src-docs/src/views/modal/confirm_modal.js +++ b/src-docs/src/views/modal/confirm_modal.js @@ -15,10 +15,14 @@ export class ConfirmModal extends Component { this.state = { isModalVisible: false, + isDestroyModalVisible: false, }; this.closeModal = this.closeModal.bind(this); this.showModal = this.showModal.bind(this); + + this.closeDestroyModal = this.closeDestroyModal.bind(this); + this.showDestroyModal = this.showDestroyModal.bind(this); } closeModal() { @@ -29,6 +33,14 @@ export class ConfirmModal extends Component { this.setState({ isModalVisible: true }); } + closeDestroyModal() { + this.setState({ isDestroyModalVisible: false }); + } + + showDestroyModal() { + this.setState({ isDestroyModalVisible: true }); + } + render() { let modal; @@ -50,13 +62,41 @@ export class ConfirmModal extends Component { ); } + let destroyModal; + + if (this.state.isDestroyModalVisible) { + destroyModal = ( + + +

You’re about to destroy something.

+

Are you sure you want to do this?

+
+
+ ); + } + return (
Show ConfirmModal +   + + + Show dangerous ConfirmModal + + {modal} + {destroyModal}
); } diff --git a/src-docs/src/views/modal/modal.js b/src-docs/src/views/modal/modal.js index e8419989589..d512ae06c69 100644 --- a/src-docs/src/views/modal/modal.js +++ b/src-docs/src/views/modal/modal.js @@ -102,14 +102,12 @@ export class Modal extends Component { Cancel Save diff --git a/src-docs/src/views/modal/modal_example.js b/src-docs/src/views/modal/modal_example.js index 5b8ebaec8d2..ad9cb98f922 100644 --- a/src-docs/src/views/modal/modal_example.js +++ b/src-docs/src/views/modal/modal_example.js @@ -54,27 +54,28 @@ export const ModalExample = { }], text: (

- Use the EuiConfirmModal to ask the user to confirm a decision, - typically one which is destructive and potentially regrettable. + Use the EuiConfirmModal to ask the user to confirm a decision. + The default type is a positive or neutral confirmation. To change the main button color + change the the buttonColor property to any of the button color options.

), props: { EuiConfirmModal }, demo: , + }, { + title: 'Overflow overflow test', + source: [{ + type: GuideSectionTypes.JS, + code: overflowTestSource, }, { - title: 'Overflow overflow test', - source: [{ - type: GuideSectionTypes.JS, - code: overflowTestSource, - }, { - type: GuideSectionTypes.HTML, - code: overflowTestHtml, - }], - text: ( -

+ type: GuideSectionTypes.HTML, + code: overflowTestHtml, + }], + text: ( +

This demo is to test long overflowing body content. -

- ), - props: { EuiConfirmModal }, - demo: , +

+ ), + props: { EuiConfirmModal }, + demo: , }], }; diff --git a/src-docs/src/views/modal/overflow_test.js b/src-docs/src/views/modal/overflow_test.js index cfd511648a2..ff8ec39ee32 100644 --- a/src-docs/src/views/modal/overflow_test.js +++ b/src-docs/src/views/modal/overflow_test.js @@ -125,14 +125,12 @@ export class OverflowTest extends Component { Cancel Save diff --git a/src/components/button/button_empty/_button_empty.scss b/src/components/button/button_empty/_button_empty.scss index 5e06f644b81..c1b0a00a6c0 100644 --- a/src/components/button/button_empty/_button_empty.scss +++ b/src/components/button/button_empty/_button_empty.scss @@ -85,15 +85,21 @@ $buttonTypes: ( } .euiButtonEmpty--flushLeft { + margin-right: $euiSizeS; + .euiButtonEmpty__content { border-left: none; padding-left: 0; + padding-right: 0; } } .euiButtonEmpty--flushRight { + margin-left: $euiSizeS; + .euiButtonEmpty__content { border-right: none; + padding-left: 0; padding-right: 0; } } diff --git a/src/components/flex/__snapshots__/flex_group.test.js.snap b/src/components/flex/__snapshots__/flex_group.test.js.snap index 7ab68d891c0..0e7dc37b817 100644 --- a/src/components/flex/__snapshots__/flex_group.test.js.snap +++ b/src/components/flex/__snapshots__/flex_group.test.js.snap @@ -12,6 +12,12 @@ exports[`EuiFlexGroup is rendered 1`] = ` `; +exports[`EuiFlexGroup props alignItems baseline is rendered 1`] = ` +
+`; + exports[`EuiFlexGroup props alignItems center is rendered 1`] = `
+ Content + +`; diff --git a/src/components/header/_header_notification.scss b/src/components/header/_header_notification.scss new file mode 100644 index 00000000000..26ddc2601f0 --- /dev/null +++ b/src/components/header/_header_notification.scss @@ -0,0 +1,12 @@ + +.euiHeaderNotification { + display: inline-block; + border-radius: $euiBorderRadius; + background: $euiHeaderNotificationBackgroundColor; + color: $euiColorEmptyShade; + font-size: $euiFontSizeXS; + line-height: $euiSize; + height: $euiSize; + min-width: $euiSize; + vertical-align: middle; +} diff --git a/src/components/header/_index.scss b/src/components/header/_index.scss index e7c153c054c..e2e258df940 100644 --- a/src/components/header/_index.scss +++ b/src/components/header/_index.scss @@ -11,6 +11,7 @@ $euiHeaderChildSize: $euiSizeXXL + $euiSizeL; @import 'header_popover'; @import 'header_profile'; @import 'header_logo'; +@import 'header_notification'; @import 'header_alert/index'; @import 'header_breadcrumbs/index'; @import 'header_section/index'; diff --git a/src/components/header/header_notification.js b/src/components/header/header_notification.js new file mode 100644 index 00000000000..a9fe22e87a7 --- /dev/null +++ b/src/components/header/header_notification.js @@ -0,0 +1,15 @@ +import React from 'react'; +import classNames from 'classnames'; + +export const EuiHeaderNotification = ({ children, className, ...rest }) => { + const classes = classNames('euiHeaderNotification', className); + + return ( + + {children} + + ); +}; diff --git a/src/components/header/header_notification.test.js b/src/components/header/header_notification.test.js new file mode 100644 index 00000000000..df6377c23c1 --- /dev/null +++ b/src/components/header/header_notification.test.js @@ -0,0 +1,18 @@ +import React from 'react'; +import { render } from 'enzyme'; +import { requiredProps } from '../../test/required_props'; + +import { EuiHeaderNotification } from './header_notification'; + +describe('EuiHeaderNotification', () => { + test('is rendered', () => { + const component = render( + + Content + + ); + + expect(component) + .toMatchSnapshot(); + }); +}); diff --git a/src/components/header/index.js b/src/components/header/index.js index 2d956a0154d..cc3d92c3869 100644 --- a/src/components/header/index.js +++ b/src/components/header/index.js @@ -16,6 +16,10 @@ export { EuiHeaderLogo, } from './header_logo'; +export { + EuiHeaderNotification, +} from './header_notification'; + export { EuiHeaderSection, EuiHeaderSectionItem, diff --git a/src/components/index.js b/src/components/index.js index 5581642a633..bfb1de5524d 100644 --- a/src/components/index.js +++ b/src/components/index.js @@ -121,6 +121,7 @@ export { EuiHeaderBreadcrumbCollapsed, EuiHeaderBreadcrumbs, EuiHeaderLogo, + EuiHeaderNotification, EuiHeaderSection, EuiHeaderSectionItem, EuiHeaderSectionItemButton, diff --git a/src/components/modal/__snapshots__/confirm_modal.test.js.snap b/src/components/modal/__snapshots__/confirm_modal.test.js.snap index 9dce52f93a1..cf7035a7635 100644 --- a/src/components/modal/__snapshots__/confirm_modal.test.js.snap +++ b/src/components/modal/__snapshots__/confirm_modal.test.js.snap @@ -60,7 +60,7 @@ exports[`renders EuiConfirmModal 1`] = ` class="euiModalFooter" >