-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add variant
prop to Button and ButtonGroup
#7197
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
Conversation
Add example and docsBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Add deprecation warnings in consoleBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
variant
prop to Buttonvariant
prop to Button and ButtonGroup
Add "variant" prop to ButtonGroup componentBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Move eslint deprecation lines for multi-line declarationBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
723e7cc
to
a71f72a
Compare
Move eslint deprecation lines for multi-line declarationBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
@@ -51,12 +65,12 @@ export const ButtonOutlinedExample: React.FC<ExampleProps> = props => { | |||
const code = dedent` | |||
<Button text="Outlined" outlined={true} /> | |||
<Button text="Primary" outlined={true} intent="primary" /> | |||
<Button text="Disabled" minimal={true} disabled={true} />`; |
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 was a typo in the current Button outlined example (unrelated to the rest of these changes)
Extract ButtonVariant typeBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Organize jsdoc declarationsBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
[Classes.MINIMAL]: minimal || variant === "minimal", | ||
[Classes.OUTLINED]: outlined || variant === "outlined", |
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 bit of code has some unintended side effects. I think that we should make the behavior be that variant
supersedes both outlined
and minimal
. However, if we do the following:
<Button text="Button" variant="minimal" outlined={true} />
We end up with an outlined button instead of a minimal button as would be hoped for. The same issue occurs with ButtonGroup
s.
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.
Technically, this behavior already exists between the minimal
and outlined
props where outlined
overwrites the styles of minimal
if both are applied simultaneously.
<Button text="Button" minimal={true} outlined={true} />
I think it is fair, however, that we wouldn't want to continue this behavior!
a2889bd wraps the logic into a utility function, providing the proper application of classes based on precedence. This technically changes the behavior of the presence of classes (for the case described above), but in practice it doesn't matter much since, as we've established, the outlined
classes overwrite minimal
anyways.
Edit: fd62b36 preserves the existing behavior
Add comments heading up constantsBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Update Button/ButtonGroup interactive examples with new variant selectBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
e96ff83
to
cd08b19
Compare
Refactor variantClass utilityBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
abf4155
to
86746b6
Compare
Simplify types passed to variantClass utilityBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
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.
LGTM! Excited about this change
Invalidated by push of a6e75cf
Add `variant` prop to blocklist of removeNonHTMLPropsBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Update ESLint deprecation ignore statementsBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Remove comment that is no longer relevantBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Invalidated by push of a618564
Remove minimal/outlined from ButtonGroup popover exampleBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Ignore errors constant file in test coverageBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
|
Part of #7202
Proposed changes:
Adds a new
variant
prop to replace the (now deprecated)minimal
andoutlined
props onButton
/AnchorButton
andButtonGroup
.