Skip to content

feat(radio): add RadioGroup component (CUI-17)#1114

Open
JeanMarcMilletScality wants to merge 2 commits into
development/1.0from
improvement/CUI-17-radio-button
Open

feat(radio): add RadioGroup component (CUI-17)#1114
JeanMarcMilletScality wants to merge 2 commits into
development/1.0from
improvement/CUI-17-radio-button

Conversation

@JeanMarcMilletScality
Copy link
Copy Markdown
Contributor

@JeanMarcMilletScality JeanMarcMilletScality commented May 22, 2026

Summary

  • Adds RadioGroup as the public API for radio inputs — options-driven, controlled component that owns selection, shared name, accessible label, and disabled state.
  • Accessible name comes from one of label (renders <fieldset>/<legend>), aria-label, or aria-labelledby — supports FormGroup integration without duplicating the label.
  • Per-option disabledReason shown as a tooltip on hover; group-level disabled cascades to every option.
  • Removes the standalone Radio export (was unused outside the repo); Radio.component.tsx is gone.

Ref: CUI-17

Test plan

  • npx jest --testPathPatterns=radio passes (9 behavioural tests covering label sources, selection, mutual exclusivity, disabled cascade, single-option disable, shared name, disabledReason tooltip)
  • npx tsc --noEmit clean
  • npm run lint clean
  • Storybook (npm run storybook): visit Components/Inputs/Radio and verify RadioGroupExample, Horizontal, AllStates, DisabledGroup, WithDisabledReason, WithoutVisibleLabel, FormGroupExample
  • Verify screen-reader announces the group name in each labelling mode (legend, aria-label, aria-labelledby)

🤖 Generated with Claude Code

Introduces RadioGroup as the public API for radio inputs: an options-driven
component that owns selection, name, accessible label, and disabled state.
Replaces the standalone Radio export.

- Accessible name comes from one of label (fieldset/legend), aria-label, or
  aria-labelledby — supports FormGroup integration without duplicate labels.
- Per-option disabledReason shown as a tooltip on hover.
- Group-level disabled cascades to every option.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 22, 2026

Hello jeanmarcmilletscality,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 22, 2026

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • one peer

Peer approvals must include at least 1 approval from the following list:

Comment thread src/lib/index.ts
Comment thread src/lib/components/radio/RadioGroup.component.tsx Outdated
- Re-export RadioGroupProps and RadioOption types from the package entry so
  consumers can type options arrays and extend the component.
- Switch the RadioLabel styled-component to a transient $disabled prop so it
  no longer leaks an invalid attribute onto the underlying <label>.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Contributor

@ChengYanJin ChengYanJin left a comment

Choose a reason for hiding this comment

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

LGTM

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.

3 participants