-
Notifications
You must be signed in to change notification settings - Fork 23
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
Add deprecated isReversed prop to Button #5325
Conversation
🦋 Changeset detectedLatest commit: 9e48c68 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
3ff6d0e
to
4ae4a0f
Compare
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.
Just one nit. This will fail linting in the future, so easier if we just fix it now, but I won't block the PR for it.
Co-authored-by: Cassandra <cassandra.tam@cultureamp.com>
36845b9
* add deprecated isReversed props to Button * update type description and how reversed variant is set * Update packages/components/src/__actions__/Button/v3/Button.tsx Co-authored-by: Cassandra <cassandra.tam@cultureamp.com> --------- Co-authored-by: Cassandra <cassandra.tam@cultureamp.com>
Why
The current method to set reversed styles on Button v3 is to use the
ReverseColors
provider that we export from"@kaizen/components/v3/utilities"
.This presents a risk for the codemod, as each instance of Button that was reversed would likely need to be wrapped in a Provider, whereas the intent behind
ReverseColors
is to wrap a parent element to reduce the number of props needed to style reversed color themes.As we can’t predictably say how this could impact renders or their performance we think a safer methods of gradual migration is to add a deprecated
isReversed
prop. This will allow the codemod to run safely and provide type warning to our consumers which is a clearer way to describe the new pattern.What
isReversed
prop and JSdoc deprecated flag to Button v3