Skip to content
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

Merged
merged 7 commits into from
Dec 3, 2024

Conversation

mcwinter07
Copy link
Contributor

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

  • Adds isReversed prop and JSdoc deprecated flag to Button v3

Copy link

changeset-bot bot commented Nov 28, 2024

🦋 Changeset detected

Latest commit: 9e48c68

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@kaizen/components Patch

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

@mcwinter07 mcwinter07 marked this pull request as ready for review November 28, 2024 01:14
@mcwinter07 mcwinter07 requested a review from a team as a code owner November 28, 2024 01:14
Copy link
Contributor

github-actions bot commented Nov 28, 2024

✨ Here is your branch preview! ✨

Last updated for commit 9e48c68: Merge branch 'main' into KZN-2861/add-deprecated-isReversed-prop

@mcwinter07 mcwinter07 force-pushed the KZN-2861/add-deprecated-isReversed-prop branch from 3ff6d0e to 4ae4a0f Compare November 28, 2024 03:34
dougmacknz
dougmacknz previously approved these changes Nov 29, 2024
HeartSquared
HeartSquared previously approved these changes Dec 1, 2024
Copy link
Contributor

@HeartSquared HeartSquared left a 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.

packages/components/src/__actions__/Button/v3/Button.tsx Outdated Show resolved Hide resolved
@mcwinter07 mcwinter07 dismissed stale reviews from dougmacknz and HeartSquared via 36845b9 December 2, 2024 22:35
@mcwinter07 mcwinter07 enabled auto-merge (squash) December 3, 2024 04:52
@mcwinter07 mcwinter07 merged commit 92c228f into main Dec 3, 2024
19 checks passed
@mcwinter07 mcwinter07 deleted the KZN-2861/add-deprecated-isReversed-prop branch December 3, 2024 04:53
Zystix pushed a commit that referenced this pull request Dec 4, 2024
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants