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

Added maxWidth prop to EuiFlyout #1090

Merged
merged 5 commits into from
Aug 7, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
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
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
- Added `!default` to border SASS props ([#1079](https://github.com/elastic/eui/pull/1079))
- Added `repositionOnScroll` prop to `EuiPopover` which enables repositioning the popover when the window is scrolled. ([#1064](https://github.com/elastic/eui/pull/1064))
- Allow `_` and `*` characters to be used in `EuiSearchBar` query terms ([#1058](https://github.com/elastic/eui/pull/1058))
- Added `maxWidth` prop `EuiFlyout` ([#1090](https://github.com/elastic/eui/pull/1090))
- Added `string` to allowed `restrictWidth` prop type of `EuiPage` and `EuiPageBody` ([#1090](https://github.com/elastic/eui/pull/1090))

**Bug fixes**

- `EuiMutationObserver`'s `children` prop is no longer marked as required ([#1076](https://github.com/elastic/eui/pull/1076))
- Fixed large drop shadows so they work on darker backgrounds ([#1079](https://github.com/elastic/eui/pull/1079))
- Added `resize-observer-polyfill` as a dependency (was previously a devDependency) ([#1085](https://github.com/elastic/eui/pull/1085))
- Fixed `EuiBasicTable` to inform its parent about a selection change triggered by a different set of `items` ([#1086](https://github.com/elastic/eui/pull/1086))
- Fixed wrong class name being added to `EuiPageBody` when `restrictWidth !== false` ([#1090](https://github.com/elastic/eui/pull/1090))

## [`3.3.0`](https://github.com/elastic/eui/tree/v3.3.0)

Expand Down
99 changes: 52 additions & 47 deletions src-docs/src/views/flyout/flyout_example.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,9 @@ import React from 'react';

import { renderToHtml } from '../../services';

import {
GuideSectionTypes,
} from '../../components';
import { GuideSectionTypes } from '../../components';

import {
EuiCode,
EuiFlyout,
EuiFlyoutHeader,
EuiFlyoutFooter,
} from '../../../../src/components';
import { EuiCode, EuiFlyout, EuiFlyoutHeader, EuiFlyoutFooter } from '../../../../src/components';

import { Flyout } from './flyout';
const flyoutSource = require('!!raw-loader!./flyout');
Expand All @@ -29,36 +22,43 @@ export const FlyoutExample = {
title: 'Flyout',
sections: [
{
source: [{
type: GuideSectionTypes.JS,
code: flyoutSource,
}, {
type: GuideSectionTypes.HTML,
code: flyoutHtml,
}],
source: [
{
type: GuideSectionTypes.JS,
code: flyoutSource,
},
{
type: GuideSectionTypes.HTML,
code: flyoutHtml,
},
],
text: (
<div>
<p>
<EuiCode>EuiFlyout</EuiCode> is a fixed position panel that pops in
from the right side of the screen. It should be used any time you
need to perform quick, individual actions to a larger page or list.
<EuiCode>EuiFlyout</EuiCode> is a fixed position panel that pops in from the right side
of the screen. It should be used any time you need to perform quick, individual actions
to a larger page or list.
</p>

<ul>
<li>
<EuiCode>size</EuiCode> accepts <EuiCode>s / m / l</EuiCode> and
defines the width of the panel.
<EuiCode>size</EuiCode> accepts <EuiCode>s / m / l</EuiCode> and defines the width of
the panel.
</li>
<li>
<EuiCode>ownFocus</EuiCode> is a boolean that
when <EuiCode>true</EuiCode> will lock the mouse / keyboard focus
to within the flyout. It is off by default.
<EuiCode>ownFocus</EuiCode> is a boolean that when <EuiCode>true</EuiCode> will lock
the mouse / keyboard focus to within the flyout. It is off by default.
</li>
<li>
<EuiCode>maxWidth</EuiCode> accepts a boolean or number. When set to{' '}
<EuiCode>true</EuiCode>, it adds a predefined maxWidth or you can pass an integer set
the max width to a custom pixel value or a string to set it to a custom measurement.
</li>
</ul>

<p>
Notice how these examples use <EuiCode>aria-labelledby</EuiCode> to
announce the flyout to screen readers when the user opens it.
Notice how these examples use <EuiCode>aria-labelledby</EuiCode> to announce the flyout
to screen readers when the user opens it.
</p>
</div>
),
Expand All @@ -67,39 +67,44 @@ export const FlyoutExample = {
},
{
title: 'More complicated Flyout',
source: [{
type: GuideSectionTypes.JS,
code: flyoutComplicatedSource,
}, {
type: GuideSectionTypes.HTML,
code: flyoutComplicatedHtml,
}],
source: [
{
type: GuideSectionTypes.JS,
code: flyoutComplicatedSource,
},
{
type: GuideSectionTypes.HTML,
code: flyoutComplicatedHtml,
},
],
text: (
<p>
In this example we use <EuiCode>EuiFlyoutHeader</EuiCode> and
<EuiCode>EuiFlyoutFooter</EuiCode> to allow for fixed position navigation
and actions within a flyout. Note that any content
within <EuiCode>EuiContentBody</EuiCode> will automatcially overflow.
<EuiCode>EuiFlyoutFooter</EuiCode> to allow for fixed position navigation and actions
within a flyout. Note that any content within <EuiCode>EuiContentBody</EuiCode> will
automatcially overflow.
</p>
),
props: { EuiFlyoutFooter },
demo: <FlyoutComplicated />,
},
{
title: 'Flyout sizing and focus',
source: [{
type: GuideSectionTypes.JS,
code: flyoutSizeSource,
}, {
type: GuideSectionTypes.HTML,
code: flyoutSizeHtml,
}],
source: [
{
type: GuideSectionTypes.JS,
code: flyoutSizeSource,
},
{
type: GuideSectionTypes.HTML,
code: flyoutSizeHtml,
},
],
text: (
<p>
In this example, we set <EuiCode>size</EuiCode> to <EuiCode>s</EuiCode> and
apply the <EuiCode>ownFocus</EuiCode> prop. The latter not only traps the
focus of our flyout, but also adds background overlay to reinforce your
boundries.
In this example, we set <EuiCode>size</EuiCode> to <EuiCode>s</EuiCode> and apply the{' '}
<EuiCode>ownFocus</EuiCode> prop. The latter not only traps the focus of our flyout, but
also adds background overlay to reinforce your boundries.
</p>
),
demo: <FlyoutSize />,
Expand Down
Loading