Skip to content

Commit

Permalink
guidelines cleanup, make toasts active
Browse files Browse the repository at this point in the history
  • Loading branch information
snide committed Mar 8, 2018
1 parent 66eb731 commit 3e88b85
Show file tree
Hide file tree
Showing 5 changed files with 43 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src-docs/src/components/guide_page/guide_page_chrome.js
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export class GuidePageChrome extends Component {
<EuiSpacer size="m" />

<EuiFieldSearch
placeholder="Search..."
placeholder="Search"
value={this.state.search}
onChange={this.onSearchChange}
/>
Expand Down
1 change: 0 additions & 1 deletion src-docs/src/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,6 @@ const navigation = [{
}, {
name: 'Toasts',
component: ToastGuidelines,
hidden: true,
}, {
name: 'Writing',
component: WritingGuidelines,
Expand Down
4 changes: 2 additions & 2 deletions src-docs/src/views/guidelines/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ export default() => (
>
<EuiImage
alt="button placement in form"
url="https://i.imgur.com/m4vtsdx.png"
url="https://i.imgur.com/2nvcgEU.png"
/>
</GuideRuleExample>

Expand All @@ -209,7 +209,7 @@ export default() => (
>
<EuiImage
alt="form buttons go on the left, not right"
url="https://i.imgur.com/6XCOBPH.png"
url="https://i.imgur.com/Y1rOaoN.png"
/>
</GuideRuleExample>

Expand Down
49 changes: 31 additions & 18 deletions src-docs/src/views/guidelines/toasts.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ export default () => (

<EuiHorizontalRule/>

<GuideRuleTitle>Toasts can have one action</GuideRuleTitle>
<GuideRuleTitle>Toasts should only contain a single action</GuideRuleTitle>

<GuideRule
description="A toast can have a single action, styled as a standard button.
Expand All @@ -248,16 +248,20 @@ export default () => (
panel={false}
type="do"
frame
text="Do. Use only one action per toast and favor a one-word label."
text="Do. Use only one action per toast and favor a one-word label.
Align actions to the right, which follows our button guidelines for
usage within restricted width containers."
>
<EuiToast
style={{ maxWidth: 300 }}
color="success"
title="Your report is complete"
>
<EuiButton size="s">
Download
</EuiButton>
<div style={{ textAlign: 'right' }}>
<EuiButton size="s">
Download
</EuiButton>
</div>

</EuiToast>
</GuideRuleExample>
Expand All @@ -266,19 +270,26 @@ export default () => (
type="dont"
panel={false}
frame
text="Dont use multiple actions. This message is better in a confirmation modal."
text="Don&apos;t use multiple actions. Don&apos;t align buttons in toasts to the left.
This message is better in a confirmation modal."
>
<EuiToast
style={{ maxWidth: 300 }}
title="All messages will be deleted"
color="danger"
>
<EuiButton size="s">
Cancel
</EuiButton>&nbsp;&nbsp;
<EuiButton size="s" color="danger">
Delete
</EuiButton>
<EuiFlexGroup justifyContent="flexEnd" gutterSize="s">
<EuiFlexItem grow={false}>
<EuiButton size="s">
Cancel
</EuiButton>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton size="s" color="danger">
Delete
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
</EuiToast>
</GuideRuleExample>
</GuideRule>
Expand Down Expand Up @@ -368,9 +379,11 @@ export default () => (
color="danger"
title="There was a problem with your node"
>
<EuiButton size="s">
Learn more
</EuiButton>
<div style={{ textAlign: 'right' }}>
<EuiButton size="s">
Learn more
</EuiButton>
</div>
</EuiToast>
<EuiSpacer />

Expand All @@ -386,7 +399,7 @@ export default () => (

<EuiHorizontalRule/>

<GuideRuleTitle>Writing minimal messages</GuideRuleTitle>
<GuideRuleTitle>Keep messages as short as possible</GuideRuleTitle>

<GuideRule
description="For common actions such as create, add, delete, remove, and save,
Expand Down Expand Up @@ -414,7 +427,7 @@ export default () => (
type="dont"
panel={false}
frame
text="Dont use the generic &quot;Your object.&quot;"
text="Don&apos;t use the generic &quot;Your object.&quot;"
>
<EuiToast
color="success"
Expand Down Expand Up @@ -445,7 +458,7 @@ export default () => (
type="dont"
panel={false}
frame
text="Dont include &quot;successfully.&quot;"
text="Don&apos;t include &quot;successfully.&quot;"
>
<EuiToast
color="success"
Expand Down
12 changes: 9 additions & 3 deletions src-docs/src/views/toast/success.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import {
EuiButton,
EuiLink,
EuiToast,
EuiFlexGroup,
EuiFlexItem,
} from '../../../../src/components';

export default () => (
Expand All @@ -22,8 +24,12 @@ export default () => (
And some other stuff on another line, just for kicks. And <EuiLink href="#">here&rsquo;s a link</EuiLink>.
</p>

<EuiButton>
Download report
</EuiButton>
<EuiFlexGroup justifyContent="flexEnd" gutterSize="s">
<EuiFlexItem grow={false}>
<EuiButton size="s">
Download report
</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
</EuiToast>
);

0 comments on commit 3e88b85

Please sign in to comment.