Skip to content

fix(Tabs,RadioGroup): align radio/tabs size mapping#1110

Merged
tenphi merged 5 commits intomainfrom
cursor/tabs-radio-sizes-inconsistency-5701
Apr 3, 2026
Merged

fix(Tabs,RadioGroup): align radio/tabs size mapping#1110
tenphi merged 5 commits intomainfrom
cursor/tabs-radio-sizes-inconsistency-5701

Conversation

@tenphi
Copy link
Copy Markdown
Member

@tenphi tenphi commented Apr 3, 2026

Describe changes

Aligns size handling between Tabs type="radio" and Radio.Tabs so both use the same two API sizes with identical Item button mappings:

API size Item button size Total height
large (default) medium (32px) 40px (32 + 2×4 padding)
medium xsmall (24px) 32px (24 + 2×4 padding)

Changes:

  • Radio.tsx — Changed default size for tabs mode from 'small' to 'large'; updated size mapping to medium → xsmall, large → medium (matching RADIO_SIZE_MAP).
  • types.ts — Updated JSDoc comments on RADIO_SIZE_MAP, TabStyleProps.size, and CubeTabsProps.size to document the correct mapping.
  • Tabs.stories.tsx — Added RadioTypeSizes story showing both large and medium radio sizes.
  • RadioGroup.stories.tsx — Simplified TabsGroupSizes story to only show large and medium sizes.
  • Tabs.docs.mdx — Updated size documentation note.
Checklist
  • Pipeline is passed
  • Tests are added (including unit tests and stories in the storybook)
  • Tests are passed successfully
  • If you're adding a new component/new props, add stories that describe how this component/prop works
  • Changeset(s) is(are) added
  • You have passed the threshold of the library size
  • Commit message follows commit guidelines

Closes: N/A

Other information

The RADIO_SIZE_MAP values (medium → xsmall, large → medium) were already correct in the original code. The key fix is in Radio.tsx where the tabs-mode default size was 'small' instead of 'large', and the mapping now matches Tabs type="radio" exactly.

Open in Web Open in Cursor 

cursoragent and others added 2 commits April 3, 2026 10:47
- RADIO_SIZE_MAP: medium -> small (28px), large -> medium (32px)
- Radio.tsx tabs default size: large instead of small
- Radio.tsx tabs mapping: medium -> small, large -> medium
- Updated JSDoc comments and docs

Co-authored-by: Andrey Yamanov <tenphi@gmail.com>
- RADIO_SIZE_MAP: medium -> xsmall (24px button, 32px total),
  large -> medium (32px button, 40px total)
- Radio.tsx tabs default: large (was small)
- Radio.tsx tabs mapping: medium -> xsmall, large -> medium
- Simplified stories to show only large/medium sizes
- Updated docs and JSDoc comments

Co-authored-by: Andrey Yamanov <tenphi@gmail.com>
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 3, 2026

🦋 Changeset detected

Latest commit: 43d586a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cube-dev/ui-kit Patch

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

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 3, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cube-ui-kit Ready Ready Preview, Comment Apr 3, 2026 2:44pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 3, 2026

📦 NPM canary release

Deployed canary version 0.0.0-canary-60792f3.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 3, 2026

🧪 Storybook is successfully deployed!

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 3, 2026

🏋️ Size limit report

Name Size Passed?
All 362.04 KB (-0.01% 🔽👏) Yes 🎉
Tree shaking (just a Button) 102.19 KB (0% 🟰) Yes 🎉

Click here if you want to find out what is changed in this build

Co-authored-by: Andrey Yamanov <tenphi@gmail.com>
Comment thread src/components/fields/RadioGroup/Radio.tsx Outdated
TabButton fell back to 'medium' regardless of type, producing 32px
tabs vs 40px from Radio.Tabs. Use the same conditional default.

Made-with: Cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Comment thread src/components/fields/RadioGroup/Radio.tsx
…IO_SIZE_MAP consistently

Both components now default to 'medium' and use the shared
RADIO_SIZE_MAP for size remapping, eliminating divergent fallback
behavior for unsupported sizes.

Made-with: Cursor
@tenphi tenphi merged commit a8f59f1 into main Apr 3, 2026
16 checks passed
@tenphi tenphi deleted the cursor/tabs-radio-sizes-inconsistency-5701 branch April 3, 2026 15:01
@github-actions github-actions Bot mentioned this pull request Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants