fix: [badge] apply default variants and make children optional - #922
Conversation
Move defaultVariants out of variants so CVA applies them, and drop the manual fallbacks. Make children optional. Add outline and dot boolean props.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. Note Currently processing new changes in this PR. This may take a few minutes, please wait... ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe Badge props no longer require Priority: ⬇️ Low Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The Badge changes preserve the configured defaults, make children optional, and align the documented size default. No concrete merge risk remains. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to The reviewed Badge path renders into a span and does not show a new sensitive operation or trust-boundary crossing. The public contract change has limited apparent security impact, but coverage of other consumers is incomplete. Retained concerns Security review detailsSecurity Blast Radius
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Linked Issues checkExplanation The PR satisfies the
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 |
commit: |
Indicator already renders a status dot, and no design or consumer asks for an outline badge. Drop the ref test: ref already reached the span through the props spread.
Summary
defaultVariantsout ofvariantsso CVA applies theaccentandsmalldefaults. This also removes the straydefaultVariantsprop fromBadgeProps.childrenoptional so a badge can be icon only or empty.small.Indicatoralready renders a status dot, and no design or consumer asks for an outline badge.refalready reaches the root span throughComponentProps<'span'>.Closes #598