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

Make "m" the default size of EuiButton #1742

Merged
merged 10 commits into from
Mar 20, 2019
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## [`master`](https://github.com/elastic/eui/tree/master)

No public interface changes since `9.4.2`.
- Changed `EuiButton` to use "m" as it's default `size` prop ([#1742](https://github.com/elastic/eui/pull/1742))

## [`9.4.2`](https://github.com/elastic/eui/tree/v9.4.2)

Expand Down
15 changes: 15 additions & 0 deletions src/components/button/__snapshots__/button.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,21 @@ exports[`EuiButton props size l is rendered 1`] = `
</button>
`;

exports[`EuiButton props size m is rendered 1`] = `
<button
class="euiButton euiButton--primary"
type="button"
>
<span
class="euiButton__content"
>
<span
class="euiButton__text"
/>
</span>
</button>
`;

exports[`EuiButton props size s is rendered 1`] = `
<button
class="euiButton euiButton--primary euiButton--small"
Expand Down
2 changes: 2 additions & 0 deletions src/components/button/button.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const COLORS = Object.keys(colorToClassNameMap);

const sizeToClassNameMap = {
s: 'euiButton--small',
m: null,
l: 'euiButton--large',
};

Expand Down Expand Up @@ -198,6 +199,7 @@ EuiButton.propTypes = {
};

EuiButton.defaultProps = {
size: 'm',
type: 'button',
iconSide: 'left',
color: 'primary',
Expand Down
2 changes: 1 addition & 1 deletion src/components/button/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ declare module '@elastic/eui' {
| 'warning'
| 'danger'
| 'ghost';
export type ButtonSize = 's' | 'l';
export type ButtonSize = 's' | 'm' | 'l';

export interface EuiButtonProps {
iconType?: IconType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ exports[`EuiSuperUpdateButton is rendered 1`] = `
isDisabled={false}
isLoading={false}
onClick={[Function]}
size="m"
textProps={
Object {
"className": "euiSuperUpdateButton__text",
Expand Down Expand Up @@ -41,6 +42,7 @@ exports[`EuiSuperUpdateButton isDisabled 1`] = `
isDisabled={true}
isLoading={false}
onClick={[Function]}
size="m"
textProps={
Object {
"className": "euiSuperUpdateButton__text",
Expand All @@ -67,6 +69,7 @@ exports[`EuiSuperUpdateButton isLoading 1`] = `
isDisabled={false}
isLoading={true}
onClick={[Function]}
size="m"
textProps={
Object {
"className": "euiSuperUpdateButton__text",
Expand Down Expand Up @@ -94,6 +97,7 @@ exports[`EuiSuperUpdateButton needsUpdate 1`] = `
isDisabled={false}
isLoading={false}
onClick={[Function]}
size="m"
textProps={
Object {
"className": "euiSuperUpdateButton__text",
Expand Down