You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds a guard in ButtonWrapper's styled-component interpolation to return early when theme.sizes.button[$size] is undefined. Also replaces the raw Object.entries call with a safe loop that only emits @media blocks for known breakpoints.
Why is it needed?
The theme.sizes.button only defines entries for S, M, and L. When a Button is rendered with size="XS", the interpolation called Object.entries(undefined) which throws a runtime error and produces invalid CSS output in the stylesheet.
How to test it?
Render a Button with size="XS" (e.g. in a Storybook story or unit test).
Before this fix, the component throws and injects broken CSS.
After this fix, the button renders without a height style (graceful fallback) and no error is thrown.
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does it do?
Adds a guard in
ButtonWrapper's styled-component interpolation to return early whentheme.sizes.button[$size]isundefined. Also replaces the rawObject.entriescall with a safe loop that only emits@mediablocks for known breakpoints.Why is it needed?
The
theme.sizes.buttononly defines entries for S, M, and L. When a Button is rendered with size="XS", the interpolation calledObject.entries(undefined)which throws a runtime error and produces invalid CSS output in the stylesheet.How to test it?
Related issue(s)/PR(s)
Fixes #2006