-
Notifications
You must be signed in to change notification settings - Fork 649
Add Alert status variant to StateLabel component #7472
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: dbd9dcf 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 |
Co-authored-by: HiroAgustin <1458873+HiroAgustin@users.noreply.github.com>
Co-authored-by: HiroAgustin <1458873+HiroAgustin@users.noreply.github.com>
|
👋 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 |
Co-authored-by: HiroAgustin <1458873+HiroAgustin@users.noreply.github.com>
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/11655 |
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 adds a new "Alert status" variant to the StateLabel component with three distinct alert states: opened, fixed, and dismissed. The changes introduce shield-based icons to visually represent security alert states alongside the existing issue and pull request status variants.
Changes:
- Added three new alert status types (
alertOpened,alertFixed,alertDismissed) with corresponding shield icons (ShieldIcon, ShieldCheckIcon, ShieldSlashIcon) - Implemented CSS styling that reuses existing design tokens for consistency (open-emphasis for opened, done-emphasis for fixed, draft-emphasis for dismissed)
- Updated component documentation, tests, and Storybook stories to include the new alert variants
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/react/src/StateLabel/StateLabel.tsx | Added shield icon imports and mapped three new alert statuses to icons and aria labels |
| packages/react/src/StateLabel/StateLabel.module.css | Added CSS rules for the three alert status variants using existing color tokens |
| packages/react/src/StateLabel/tests/StateLabel.test.tsx | Added snapshot tests and accessibility tests for all three alert statuses |
| packages/react/src/StateLabel/tests/snapshots/StateLabel.test.tsx.snap | Generated snapshots for the three new alert status renders |
| packages/react/src/StateLabel/StateLabel.features.stories.tsx | Added three new Storybook stories demonstrating each alert status |
| packages/react/src/StateLabel/StateLabel.docs.json | Updated documentation with new story IDs and added alert statuses to the type definition |
| .changeset/brave-panthers-wave.md | Added changeset documenting the minor version bump for the new feature |
Summary
This PR adds a third variant named "Alert status" to the StateLabel component, alongside the existing "Issue status" and "Pull request status" variants.
Changes Made
Component Updates
alertOpened: ShieldIcon with 'Alert' labelalertFixed: ShieldCheckIcon with 'Alert' labelalertDismissed: ShieldSlashIcon with 'Alert' labelStyling
alertOpened: open-emphasis colors (green) - same as issueOpened and pullOpenedalertFixed: done-emphasis colors (purple) - same as issueClosed and pullClosedalertDismissed: draft-emphasis colors (gray) - same as issueDraftDocumentation & Stories
Tests
Changeset
.changeset/brave-panthers-wave.md: Added changeset for minor version bumpVisual Examples
Usage
Validation
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.