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

docs(button): expose tertiary button and restrict icon button variants #5201

Merged
merged 10 commits into from
Feb 1, 2020
2 changes: 1 addition & 1 deletion packages/components/src/components/button/_button.scss
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
}

&:active {
color: $inverse-01;
color: $active-tertiary;
}

&:disabled,
Expand Down
14 changes: 7 additions & 7 deletions packages/components/src/components/button/button.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports = {
name: 'primary--field',
label: 'Primary Buttons (Field)',
notes: `
"Field" buttons are used in forms, when a button needs to line up horizontally with an input field.
"Field" buttons are used in forms, when a button needs to line up horizontally with an input field.
Field buttons match the height of input elements that they sit next to.
`,
context: {
Expand Down Expand Up @@ -66,7 +66,7 @@ module.exports = {
name: 'secondary--field',
label: 'Secondary Buttons (Field)',
notes: `
"Field" buttons are used in forms, when a button needs to line up horizontally with an input field.
"Field" buttons are used in forms, when a button needs to line up horizontally with an input field.
Field buttons match the height of input elements that they sit next to.
`,
context: {
Expand Down Expand Up @@ -96,13 +96,14 @@ module.exports = {
'Tertiary buttons should be used for tertiary actions on each page.',
context: {
variant: 'tertiary',
hasIconOnly: true,
},
},
{
name: 'tertiary--field',
label: 'Tertiary Buttons (Field)',
notes: `
"Field" buttons are used in forms, when a button needs to line up horizontally with an input field.
"Field" buttons are used in forms, when a button needs to line up horizontally with an input field.
Field buttons match the height of input elements that they sit next to.
`,
context: {
Expand All @@ -122,6 +123,7 @@ module.exports = {
context: {
variant: 'tertiary',
small: true,
hasIconOnly: true,
},
},
{
Expand All @@ -138,13 +140,12 @@ module.exports = {
name: 'danger--field',
label: 'Danger Buttons (Field)',
notes: `
"Field" buttons are used in forms, when a button needs to line up horizontally with an input field.
"Field" buttons are used in forms, when a button needs to line up horizontally with an input field.
Field buttons match the height of input elements that they sit next to.
`,
context: {
variant: 'danger',
field: true,
hasIconOnly: true,
},
},
{
Expand Down Expand Up @@ -172,13 +173,12 @@ module.exports = {
name: 'ghost--field',
label: 'Ghost Buttons (Field)',
notes: `
"Field" buttons are used in forms, when a button needs to line up horizontally with an input field.
"Field" buttons are used in forms, when a button needs to line up horizontally with an input field.
Field buttons match the height of input elements that they sit next to.
`,
context: {
variant: 'ghost',
field: true,
hasIconOnly: true,
},
},
{
Expand Down
11 changes: 10 additions & 1 deletion packages/react/src/components/Button/Button-story.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const iconMap = {
const kinds = {
'Primary button (primary)': 'primary',
'Secondary button (secondary)': 'secondary',
'Tertiary button (tertiary)': 'tertiary',
'Danger button (danger)': 'danger',
'Ghost button (ghost)': 'ghost',
};
Expand Down Expand Up @@ -64,7 +65,15 @@ const props = {
const iconToUse = iconMap[select('Icon (icon)', icons, 'Add16')];
return {
className: 'some-class',
kind: select('Button kind (kind)', kinds, 'primary'),
kind: select(
'Button kind (kind)',
{
'Primary button (primary)': 'primary',
'Secondary button (secondary)': 'secondary',
'Tertiary button (tertiary)': 'tertiary',
},
'primary'
),
disabled: boolean('Disabled (disabled)', false),
size: select('Button size (size)', sizes, 'default'),
renderIcon: !iconToUse || iconToUse.svgData ? undefined : iconToUse,
Expand Down