-
Notifications
You must be signed in to change notification settings - Fork 646
Banner: Deprecate icon prop in favor of leadingVisual, fix SecondaryAction styling and playground story
#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
Banner: Deprecate icon prop in favor of leadingVisual, fix SecondaryAction styling and playground story
#7197
Conversation
🦋 Changeset detectedLatest commit: 36b160e 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 |
|
👋 Hi, this pull request contains changes to the source code that github/github-ui depends on. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the |
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/6872 |
|
👋 Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the |
|
🟢 ci completed with status |
|
👋 Hi, there are new commits since the last successful integration test. If you are GitHub staff, test these changes with github/github-ui using the integration workflow. Or, apply the |
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.
Pull Request Overview
This PR deprecates the icon prop in the Banner component in favor of leadingVisual to align with naming conventions across Primer React. It also updates the BannerSecondaryAction to use variant="invisible" instead of variant="link" and improves the Storybook Playground story.
Key Changes
- Deprecated
iconprop with@deprecatedJSDoc annotation and added newleadingVisualprop - Changed
BannerSecondaryActionfromvariant="link"tovariant="invisible" - Added comprehensive test coverage for the new
leadingVisualprop and fallback behavior
Reviewed Changes
Copilot reviewed 6 out of 108 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/Banner/Banner.tsx | Deprecated icon prop, added leadingVisual prop, updated SecondaryAction button variant, and implemented fallback logic |
| packages/react/src/Banner/Banner.test.tsx | Added tests for leadingVisual prop support and precedence over deprecated icon prop |
| packages/react/src/Banner/Banner.stories.tsx | Updated Playground story to support leadingVisual selection with icon mapping |
| packages/react/src/Banner/Banner.features.stories.tsx | Updated CustomIcon story to use leadingVisual instead of deprecated icon |
| packages/react/src/Banner/Banner.docs.json | Updated documentation metadata to mark icon as deprecated and add leadingVisual |
| .playwright/snapshots/components/Banner.test.ts-snapshots/*.png | Updated visual regression test snapshots reflecting the SecondaryAction styling changes |
| .changeset/open-mails-prove.md | Added changeset documenting the deprecation and styling fix |
Closes #5286
This PR deprecates the
iconprop in theBannercomponent in favor ofleadingVisual. It also fixes theSecondaryActionstyling and improves the Storybook Playground selectingleadingVisual.Changelog
iconprop and addleadingVisualinsteadBannerSecondaryActionusesvariant="invisible"instead ofvariant="link"leadingVisualRollout strategy
Testing & Reviewing
Merge checklist