-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Add size prop to Button and ButtonGroup
#7226
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 `size` prop to Button and ButtonGroupBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Add new SizeSelect and use in Button/ButtonGroup interactive playgroundsBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
160037c to
e5eb6e7
Compare
Add new SizeSelect and use in Button/ButtonGroup interactive playgroundsBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
e5eb6e7 to
1ccfc06
Compare
Add new SizeSelect and use in Button/ButtonGroup interactive playgroundsBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
1ccfc06 to
e900982
Compare
Add new SizeSelect and use in Button/ButtonGroup interactive playgroundsBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
06c27eb to
6e7909c
Compare
Migrate all buttons with `small` propBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
ece77a3 to
19204b3
Compare
Preserve existing class resolution behavior for small/large propsBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Modify sizeClass to handle components without small variantBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Wrap prop validation warning logging logic in logDeprecatedSizeWarningBuild 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. |
Merge branch 'develop' into gdouglas/size-prop-buttonsBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
LintBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
packages/core/src/common/errors.ts
Outdated
| if (large && small) { | ||
| console.warn( | ||
| ns + | ||
| ` <${component}> large and small props are mutually exclusive. Please use size="large" or size="small" instead.`, | ||
| ); | ||
| } else if (large) { | ||
| console.warn(ns + ` <${component}> large is deprecated. Please use size="large" instead.`); | ||
| } else if (small) { | ||
| console.warn(ns + ` <${component}> small is deprecated. Please use size="small" instead.`); | ||
| } |
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 we want to log if these props are non null rather than just true. That way if someone is doing something like <Button small={someBooleanVariable} /> we properly log even when passing false.
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.
Ah, yeah, good call. Added in 5337c00
Check for non-null values in logDeprecatedSizeWarningBuild artifact links for this commit: documentation | landing | table | demoThis is an automated comment from the deploy-preview CircleCI job. |
Part of #7232
Proposed changes:
Adds a new
sizeprop to replace the (now deprecated)smallandlargeprops onButton/AnchorButtonandButtonGroup.