-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feat(Button): add buttons
shorthand to ButtonGroup
#2361
Conversation
@@ -24,8 +26,6 @@ describe('ButtonGroup', () => { | |||
common.propKeyOnlyToClassName(ButtonGroup, 'negative') | |||
common.propKeyOnlyToClassName(ButtonGroup, 'positive') | |||
common.propKeyOnlyToClassName(ButtonGroup, 'primary') | |||
common.propKeyOnlyToClassName(ButtonGroup, 'primary') | |||
common.propKeyOnlyToClassName(ButtonGroup, 'secondary') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicates 😺
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😱
@@ -34,4 +34,15 @@ describe('ButtonGroup', () => { | |||
|
|||
common.propValueOnlyToClassName(ButtonGroup, 'color', SUI.COLORS) | |||
common.propValueOnlyToClassName(ButtonGroup, 'size', SUI.SIZES) | |||
|
|||
describe('buttons', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@levithomason Should we go with buttons
or items
prop?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think buttons
for consistency. The name should follow the sub-component or child components in this case:
<Breadcrumb sections={...} />
<Feed events={...} />
<Modal actions={...} />
<Button.Group buttons={...} />
The exception is <Card.Group items={...} itemsPerRow={...} />
which was an early exploratory API. However, this will be replaced with standardized width props, #406. It should be: <Card.Group cards={...} widths={...} />
.
b07e6d6
to
04bf130
Compare
04bf130
to
fc4a6a1
Compare
Codecov Report
@@ Coverage Diff @@
## master #2361 +/- ##
=========================================
Coverage ? 99.73%
=========================================
Files ? 152
Lines ? 2664
Branches ? 0
=========================================
Hits ? 2657
Misses ? 7
Partials ? 0
Continue to review full report at Codecov.
|
src/elements/Button/ButtonGroup.js
Outdated
@@ -93,6 +104,9 @@ ButtonGroup.propTypes = { | |||
/** Groups can be less pronounced. */ | |||
basic: PropTypes.bool, | |||
|
|||
/** Shorthand array of props for Button. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't necessarily have to be props
, it can be any shorthand value.
LGTM, I've made one minor update to the doc block for |
Released in |
Fixes #2310.
This PRs adds new shorthand and updates existing docs to latest style.