[SUGGESTION NEEDED] feat(button): added icon support#111
[SUGGESTION NEEDED] feat(button): added icon support#111
Conversation
Codecov Report
@@ Coverage Diff @@
## master #111 +/- ##
==========================================
+ Coverage 69.8% 70.09% +0.29%
==========================================
Files 75 76 +1
Lines 1202 1234 +32
Branches 228 240 +12
==========================================
+ Hits 839 865 +26
- Misses 358 364 +6
Partials 5 5
Continue to review full report at Codecov.
|
|
ready for review |
4b0f985 to
008d1ce
Compare
levithomason
left a comment
There was a problem hiding this comment.
I didn't quite finish getting through the components. I will do so tomorrow. Here are some comments for now.
| - Add Avatar component @mnajdova ([#75](https://github.com/stardust-ui/react/pull/75)) | ||
| - Add Menu `shape` property for describing the shape of the component, instead using the type property @mnajdova ([#68](https://github.com/stardust-ui/react/pull/68)) | ||
| - Add Input component @alinais ([#64](https://github.com/stardust-ui/react/pull/64)) | ||
| - Add Icon Button component @Bugaa92 ([#111](https://github.com/stardust-ui/react/pull/111)) |
There was a problem hiding this comment.
Suggest "Add icon prop to the Button component". Some libraries have actual IconButton components.
|
|
||
| const ButtonExampleIcon = () => ( | ||
| <Button type="primary" style={{ minWidth: '32px', padding: 0 }}> | ||
| <Icon name="book" color="white" style={{ margin: 'auto' }} /> |
There was a problem hiding this comment.
No inline styles in doc examples please. Let's show exactly what the components do.
There was a problem hiding this comment.
here is a problem with that - this is file that corresponds to Children API case. In other words, it is where Button component is unaware of its children and, thus, in contrast to shorthand case, cannot introduce any appropriate styles to provide a nice look.
At the same time, we would like the presentation of both Shorthand and Children API cases being consistent with each other, so that Button's look won't suddenly change when user is switching between them for the same example (or do we?). In this case it seems that there are no other means to make these looks consistent other than introducing inline styles.
Another possible option for us could be to remove Children API for this example.
@levithomason, please, let us know about your thoughts.
There was a problem hiding this comment.
@kuzhelov thanks for detailing the reasons for making the style changes in example;
@levithomason Roman explained very well why inline styles were added, what are your thoughts?
| import React from 'react' | ||
| import { Button } from 'stardust' | ||
|
|
||
| const ButtonExampleLabeledIcon = () => ( |
There was a problem hiding this comment.
Labeled icon means something different in Semantic, suggest calling this "Icon and Content". Buttons can have labels and they can style the icon as a label resulting in a "labeled icon button". We can save that for another discussion and PR.
| </Button> | ||
| <Button type="secondary"> | ||
| <span style={{ paddingRight: '10px' }}>Click me right</span> | ||
| <Icon name="coffee" style={{ margin: 'auto' }} /> |
There was a problem hiding this comment.
Reminder, no inline styles.
| <ComponentExample | ||
| title="Default" | ||
| description="A default Button." | ||
| description="A standard button." |
There was a problem hiding this comment.
We should standardize these. I'd propose "default", but would like to hear what the rest of the team thinks.
There was a problem hiding this comment.
my vote is for default - this is consistent with the title
|
|
||
| /** Add an Icon by name, props object, or pass an <Icon />. */ | ||
| icon: customPropTypes.some([ | ||
| PropTypes.bool, |
There was a problem hiding this comment.
Boolean might be cruft here.
here is a problem with that - this is file that corresponds to At the same time, we would like the presentation of both Shorthand and Another possible option for us could be to remove @levithomason, please, let us know about your thoughts. |
dd8dc7d to
ab457b8
Compare
|
Moved to new repo: stardust-ui/react/pull/13 |
Button
A standard button.
TODO
API Proposal
Icon
A button can be made of only an icon.
will output
Labeled Icon
A button can use an icon as a label.
will output
Circular Emphasis
A button can be circular and formatted to show different levels of emphasis.
will output