feat(radio): add size variants, orientation prop, and fix CSS issues#739
feat(radio): add size variants, orientation prop, and fix CSS issues#739rohanchkrabrty merged 6 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Warning Rate limit exceeded
Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 10 minutes and 27 seconds. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThe changes add size variants and orientation support to the Radio component. The Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsGit: Failed to clone repository. Please run 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 |
Remove "orientation prop removed" from breaking changes since PR #739 re-adds orientation support on Radio.Group. Add New Features subsection documenting the new size prop and orientation prop. Update the "After" code example and Table of Contents numbering. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
🧹 Nitpick comments (1)
packages/raystack/components/radio/radio.module.css (1)
8-10: Optional: scope.group-horizontalunder.groupfor stronger specificity.Standalone
.group-horizontalworks today because it appears after.groupin the stylesheet, but combining it (e.g.,.group.group-horizontal) makes the override order-independent and clarifies intent.Proposed tweak
-.group-horizontal { +.group.group-horizontal { flex-direction: row; }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/raystack/components/radio/radio.module.css` around lines 8 - 10, The .group-horizontal rule should be made more specific so it reliably overrides .group; change the selector from .group-horizontal to .group.group-horizontal and keep the same properties (flex-direction: row) so the horizontal variant is explicitly scoped to elements that also have the .group class (update any related usages if necessary to ensure elements carry both classes).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@packages/raystack/components/radio/radio.module.css`:
- Around line 8-10: The .group-horizontal rule should be made more specific so
it reliably overrides .group; change the selector from .group-horizontal to
.group.group-horizontal and keep the same properties (flex-direction: row) so
the horizontal variant is explicitly scoped to elements that also have the
.group class (update any related usages if necessary to ensure elements carry
both classes).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 428fb458-eda6-4c62-8cd4-a9124e65695f
📒 Files selected for processing (7)
apps/www/src/content/docs/components/radio/demo.tsapps/www/src/content/docs/components/radio/index.mdxapps/www/src/content/docs/components/radio/props.tsdocs/V1-migration.mdpackages/raystack/components/radio/__tests__/radio.test.tsxpackages/raystack/components/radio/radio.module.csspackages/raystack/components/radio/radio.tsx
#630) - Add size prop (small | large) using CVA, matching Switch component pattern - Add orientation prop (vertical | horizontal) to Radio.Group for layout control - Fix indicator dot using --rs-radius-3 (border-radius token) for width/height, replaced with --rs-space-2 (spacing token) for correct semantic usage - Add CSS comments clarifying display property intent on .group and .radioitem - Scale indicator dot proportionally for each size variant - Add tests for size variants and orientation Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add documentation for the new size prop (large/small) on Radio items and orientation prop (vertical/horizontal) on Radio.Group. Includes new demo examples with tabs for each variant, updated props.ts interfaces, and cleaned up demo code formatting. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Remove "orientation prop removed" from breaking changes since PR #739 re-adds orientation support on Radio.Group. Add New Features subsection documenting the new size prop and orientation prop. Update the "After" code example and Table of Contents numbering. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
d2a9805 to
92ca271
Compare
Summary
sizeprop (small|large) to Radio using CVA, following the same pattern as the Switch component. Default islarge(preserving current 16px size). Small variant uses--rs-space-4(12px).orientationprop (vertical|horizontal) toRadio.Groupfor controlling layout direction. Default isvertical. Implemented as a custom Apsara feature since Base UI's RadioGroup does not natively support orientation.--rs-radius-3(a border-radius token) with--rs-space-2(a spacing token) for the indicator dot width/height, fixing semantic token misuse..radioto.group, add clarifying CSS comments for the display property usage on.group(flex for layout) and.radioitem(inline-flex for centering indicator), and remove fixed dimensions from.radioitembase class (moved to size variants).--rs-space-1.Closes #630
Test plan
tsc --noEmit)🤖 Generated with Claude Code