feat(Banner): add pill variant#12440
Conversation
WalkthroughThe PR adds pill-shaped variants to the Banner component. ChangesBanner pill variant
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/react-core/src/components/Banner/examples/BannerPill.tsx (1)
12-19: 💤 Low valueAvoid duplicating visible text in
screenReaderText.
screenReaderText="Success pill banner"duplicates the visible "Success pill banner" content, so assistive tech announces it twice. Per the Banner docs,screenReaderTextshould convey the status/severity (e.g.,"Success"), not repeat the visible label.♻️ Suggested change
- <Banner isPill screenReaderText="Success pill banner" status="success"> + <Banner isPill screenReaderText="Success" status="success">🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/react-core/src/components/Banner/examples/BannerPill.tsx` around lines 12 - 19, The Banner currently passes screenReaderText="Success pill banner" which duplicates the visible label; change the screenReaderText prop on the Banner component to a concise status word (e.g., "Success") so assistive tech does not announce the visible content twice—update the Banner usage in BannerPill.tsx (the Banner component instance) to set screenReaderText to "Success" (or another short severity token) and keep the visible children unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@packages/react-core/src/components/Banner/examples/BannerPill.tsx`:
- Around line 12-19: The Banner currently passes screenReaderText="Success pill
banner" which duplicates the visible label; change the screenReaderText prop on
the Banner component to a concise status word (e.g., "Success") so assistive
tech does not announce the visible content twice—update the Banner usage in
BannerPill.tsx (the Banner component instance) to set screenReaderText to
"Success" (or another short severity token) and keep the visible children
unchanged.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 973ddabc-0c3b-4d6c-95ec-ae8dda1d694e
📒 Files selected for processing (4)
packages/react-core/src/components/Banner/Banner.tsxpackages/react-core/src/components/Banner/__tests__/Banner.test.tsxpackages/react-core/src/components/Banner/examples/Banner.mdpackages/react-core/src/components/Banner/examples/BannerPill.tsx
|
Preview: https://pf-react-pr-12440.surge.sh A11y report: https://pf-react-pr-12440-a11y.surge.sh |
What: Closes #12393
Adds
isPillprop.Adds example & test.
Summary by CodeRabbit