feat(codemod): add RadioGroup aria-label → label codemod for v0.3.0 - #4683
Merged
Conversation
DropdownMenuRadioGroup (and its ContextMenu/Breadcrumb re-exports, ContextMenuRadioGroup and BreadcrumbMenuRadioGroup) now take a required `label` prop that names the group for assistive tech, replacing the old optional `aria-label` passthrough. Add the codemod that renames the `aria-label` attribute to `label` on those three components so `astryx upgrade` migrates consumers automatically. The rename is component-scoped and import-gated (alias-aware): only elements resolved to one of the three RadioGroup components are touched, and `aria-labelledby` is intentionally left untouched. Registered in the v0.3.0 transform manifest with unit tests.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR No new or modified components detected. Bundle Size SummaryNo component packages changed. Accessibility AuditStatus: No accessibility violations detected. Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
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.
What
Adds the missing codemod for the one breaking change in the upcoming v0.3.0 release that did not yet have one: the
DropdownMenuRadioGrouparia-label→ requiredlabelprop rename.As of v0.3.0,
DropdownMenuRadioGroup(and its re-exportsContextMenuRadioGroupandBreadcrumbMenuRadioGroup) take a requiredlabelprop that names the group for assistive tech — replacing the previous optionalaria-label/aria-labelledbypassthrough.labelis applied as the group'saria-label.Migration
rename-radiogroup-arialabel-to-labelrenames thearia-labelJSX attribute tolabelon those three components, soastryx upgrademigrates consumers automatically.aria-labelon any other element is left alone.aria-labelledbyis intentionally left untouched. When a visible label already exists on the page, consumers keep passingaria-labelledbythrough base props rather than moving tolabel.Why this PR
The other two breaking changes this cycle (the authoring consolidation/removal) already ship codemods in
transforms/v0.3.0/. The RadioGroup prop rename was the only breaking change without one, which the release codemod audit requires before the version bump. Merging this closes that gap so the v0.3.0 version-bump PR can proceed.Testing
aria-labelledbyno-op, non-target components, and the no-import no-op.transforms/v0.3.0/codemod suite: 80 tests passing.