feat(Alert): improve icon handling and Storybook controls#15
Merged
garrity-miepub merged 3 commits intomainfrom Jan 28, 2026
Merged
feat(Alert): improve icon handling and Storybook controls#15garrity-miepub merged 3 commits intomainfrom
garrity-miepub merged 3 commits intomainfrom
Conversation
Deploying ui with
|
| Latest commit: |
fd27a94
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://72d61a52.ui-6d0.pages.dev |
| Branch Preview URL: | https://feature-alert-update-fix.ui-6d0.pages.dev |
There was a problem hiding this comment.
Pull request overview
This PR improves the Alert component's icon handling and enhances the Storybook development experience by addressing edge cases with icon rendering and making component controls more interactive.
Changes:
- Strengthened type safety by changing the icon prop from
ReactNodetoReactElement | null - Added
React.isValidElement()checks to handle empty objects from Storybook controls - Replaced inline SVG dismiss button with Lucide's X icon for consistency
- Converted Storybook stories from render functions to args pattern for working controls
- Added icon dropdown selector with Lucide icons in Storybook
- Enhanced variant stories with semantic icons (CheckCircle, AlertTriangle, etc.)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/components/Alert/Alert.tsx | Updated icon prop type to ReactElement | null, added validation checks, replaced inline SVG with Lucide X icon, and changed padding logic from CSS selector to conditional className |
| src/components/Alert/Alert.stories.tsx | Added icon registry for Storybook controls, converted stories to args pattern, added icon control with mapping, and included semantic Lucide icons in variant examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
alert-component.mov