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

buttonType and default of type button #54

Merged
merged 7 commits into from
Oct 26, 2017
Merged
Show file tree
Hide file tree
Changes from 5 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 .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "airbnb"
}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ docs/build/
dist
lib
package-lock.json
.eslintcache
6 changes: 6 additions & 0 deletions build/scripts/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

eslint \
--cache \
--ignore-pattern **/test/* **/*.test.js \
./src .docs/src
2 changes: 1 addition & 1 deletion docs/src/views/accordion/accordion_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const buttonContent = (
);

const extraAction = (
<EuiButtonIcon iconType="cross" type="danger" className="euiAccordionForm__extraAction" />
<EuiButtonIcon iconType="cross" color="danger" className="euiAccordionForm__extraAction" />
);

export default () => (
Expand Down
4 changes: 2 additions & 2 deletions docs/src/views/advanced_settings/advanced_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -511,10 +511,10 @@ export default class extends Component {
<EuiFlexItem grow={false}>
<EuiFlexGroup justifyContent="flexEnd" gutterSize="small">
<EuiFlexItem grow={false}>
<EuiButtonEmpty type="ghost" size="small" iconType="check">Save</EuiButtonEmpty>
<EuiButtonEmpty color="ghost" size="small" iconType="check">Save</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButtonEmpty type="ghost" size="small" iconType="cross">Discard</EuiButtonEmpty>
<EuiButtonEmpty color="ghost" size="small" iconType="cross">Discard</EuiButtonEmpty>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
Expand Down
12 changes: 6 additions & 6 deletions docs/src/views/badge/badge.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,37 +6,37 @@ import {

export default () => (
<div>
<EuiBadge type="default">
<EuiBadge color="default">
Default
</EuiBadge>

&nbsp;&nbsp;

<EuiBadge type="primary">
<EuiBadge color="primary">
Primary
</EuiBadge>

&nbsp;&nbsp;

<EuiBadge type="secondary">
<EuiBadge color="secondary">
Secondary
</EuiBadge>

&nbsp;&nbsp;

<EuiBadge type="accent">
<EuiBadge color="accent">
Accent
</EuiBadge>

&nbsp;&nbsp;

<EuiBadge type="warning">
<EuiBadge color="warning">
Warning
</EuiBadge>

&nbsp;&nbsp;

<EuiBadge type="danger">
<EuiBadge color="danger">
Danger
</EuiBadge>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/src/views/badge/badge_with_icon.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export default () => (

&nbsp;&nbsp;

<EuiBadge type="primary" iconType="user" iconSide="right">
<EuiBadge color="primary" iconType="user" iconSide="right">
Secondary
</EuiBadge>
</div>
Expand Down
10 changes: 5 additions & 5 deletions docs/src/views/bottom_bar/bottom_bar.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default class extends Component {

render() {
const button = (
<EuiButton type="primary" onClick={this.onButtonClick.bind(this)}>
<EuiButton color="primary" onClick={this.onButtonClick.bind(this)}>
Toggle appearance of the bottom bar
</EuiButton>
);
Expand All @@ -41,20 +41,20 @@ export default class extends Component {
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize="small">
<EuiFlexItem>
<EuiButton type="ghost" size="small" iconType="help">Help</EuiButton>
<EuiButton color="ghost" size="small" iconType="help">Help</EuiButton>
</EuiFlexItem>
<EuiFlexItem>
<EuiButton type="ghost" size="small" iconType="user">Add user</EuiButton>
<EuiButton color="ghost" size="small" iconType="user">Add user</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiFlexGroup gutterSize="small">
<EuiFlexItem>
<EuiButtonEmpty type="ghost" size="small" iconType="cross">Discard</EuiButtonEmpty>
<EuiButtonEmpty color="ghost" size="small" iconType="cross">Discard</EuiButtonEmpty>
</EuiFlexItem>
<EuiFlexItem>
<EuiButton type="primary" fill size="small" iconType="check">Save</EuiButton>
<EuiButton color="primary" fill size="small" iconType="check">Save</EuiButton>
</EuiFlexItem>
</EuiFlexGroup>
</EuiFlexItem>
Expand Down
24 changes: 12 additions & 12 deletions docs/src/views/button/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default () => (
<br/><br/>

<EuiButton
type="secondary"
color="secondary"
onClick={() => window.alert('Button clicked')}
>
Secondary
Expand All @@ -52,7 +52,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButton
type="secondary"
color="secondary"
fill
onClick={() => window.alert('Button clicked')}
>
Expand All @@ -62,7 +62,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButton
type="secondary"
color="secondary"
size="small"
onClick={() => window.alert('Button clicked')}
>
Expand All @@ -72,7 +72,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButton
type="secondary"
color="secondary"
size="small"
fill
onClick={() => window.alert('Button clicked')}
Expand All @@ -83,7 +83,7 @@ export default () => (
<br/><br/>

<EuiButton
type="warning"
color="warning"
onClick={() => window.alert('Button clicked')}
>
Warning
Expand All @@ -92,7 +92,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButton
type="warning"
color="warning"
fill
onClick={() => window.alert('Button clicked')}
>
Expand All @@ -102,7 +102,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButton
type="warning"
color="warning"
size="small"
onClick={() => window.alert('Button clicked')}
>
Expand All @@ -112,7 +112,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButton
type="warning"
color="warning"
size="small"
fill
onClick={() => window.alert('Button clicked')}
Expand All @@ -123,7 +123,7 @@ export default () => (
<br/><br/>

<EuiButton
type="danger"
color="danger"
onClick={() => window.alert('Button clicked')}
>
Danger
Expand All @@ -132,7 +132,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButton
type="danger"
color="danger"
fill
onClick={() => window.alert('Button clicked')}
>
Expand All @@ -142,7 +142,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButton
type="danger"
color="danger"
size="small"
onClick={() => window.alert('Button clicked')}
>
Expand All @@ -152,7 +152,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButton
type="danger"
color="danger"
size="small"
fill
onClick={() => window.alert('Button clicked')}
Expand Down
36 changes: 18 additions & 18 deletions docs/src/views/button/button_empty.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export default () => (
<br/><br/>

<EuiButtonEmpty
type="danger"
color="danger"
onClick={() => window.alert('Button clicked')}
>
Danger
Expand All @@ -73,7 +73,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButtonEmpty
type="danger"
color="danger"
size="small"
onClick={() => window.alert('Button clicked')}
>
Expand All @@ -83,7 +83,7 @@ export default () => (
<br/><br/>

<EuiButtonEmpty
type="danger"
color="danger"
onClick={() => window.alert('Button clicked')}
iconType="arrowDown"
>
Expand All @@ -93,7 +93,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButtonEmpty
type="danger"
color="danger"
size="small"
onClick={() => window.alert('Button clicked')}
iconType="arrowDown"
Expand All @@ -104,7 +104,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButtonEmpty
type="danger"
color="danger"
onClick={() => window.alert('Button clicked')}
iconType="arrowDown"
iconSide="right"
Expand All @@ -115,7 +115,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButtonEmpty
type="danger"
color="danger"
size="small"
onClick={() => window.alert('Button clicked')}
iconType="arrowDown"
Expand All @@ -127,7 +127,7 @@ export default () => (
<br/><br/>

<EuiButtonEmpty
type="text"
color="text"
onClick={() => window.alert('Button clicked')}
>
Text
Expand All @@ -136,7 +136,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButtonEmpty
type="text"
color="text"
size="small"
onClick={() => window.alert('Button clicked')}
>
Expand All @@ -146,7 +146,7 @@ export default () => (
<br/><br/>

<EuiButtonEmpty
type="text"
color="text"
onClick={() => window.alert('Button clicked')}
iconType="arrowDown"
>
Expand All @@ -156,7 +156,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButtonEmpty
type="text"
color="text"
size="small"
onClick={() => window.alert('Button clicked')}
iconType="arrowDown"
Expand All @@ -167,7 +167,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButtonEmpty
type="text"
color="text"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm this is a little weird. I don't think most people will naturally associate a particular color or appearance with "text". Can we find a better name... "default" maybe? @snide Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine. "primary" isn't a color either.

onClick={() => window.alert('Button clicked')}
iconType="arrowDown"
iconSide="right"
Expand All @@ -178,7 +178,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButtonEmpty
type="text"
color="text"
size="small"
onClick={() => window.alert('Button clicked')}
iconType="arrowDown"
Expand All @@ -190,7 +190,7 @@ export default () => (
<br/><br/>

<EuiButtonEmpty
type="danger"
color="danger"
onClick={() => window.alert('Button clicked')}
isDisabled
>
Expand All @@ -200,7 +200,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButtonEmpty
type="danger"
color="danger"
size="small"
onClick={() => window.alert('Button clicked')}
isDisabled
Expand All @@ -211,7 +211,7 @@ export default () => (
<br/><br/>

<EuiButtonEmpty
type="danger"
color="danger"
onClick={() => window.alert('Button clicked')}
iconType="arrowDown"
isDisabled
Expand All @@ -222,7 +222,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButtonEmpty
type="danger"
color="danger"
size="small"
onClick={() => window.alert('Button clicked')}
iconType="arrowDown"
Expand All @@ -234,7 +234,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButtonEmpty
type="danger"
color="danger"
onClick={() => window.alert('Button clicked')}
iconType="arrowDown"
iconSide="right"
Expand All @@ -246,7 +246,7 @@ export default () => (
&nbsp;&nbsp;

<EuiButtonEmpty
type="danger"
color="danger"
size="small"
onClick={() => window.alert('Button clicked')}
iconType="arrowDown"
Expand Down
Loading