Skip to content

chore: Adds internal style api v2 to radio group - #5226

Open
vvaliyev wants to merge 2 commits into
mainfrom
style-v2-radio-group
Open

vvaliyev wants to merge 2 commits into
mainfrom
style-v2-radio-group

Conversation

@vvaliyev

@vvaliyev vvaliyev commented Nov 2, 2026 •

Copy link
Copy Markdown
Member

Description

Adds the internal Style API v2 to Radio group: item forwards to RadioButton.control and applies to every radio in items. The group root has no slot; it only lays out the radios.

Changes outside the component: the @property registration of the radio control tokens moves from radio-button/styles.scss to the shared internal/components/radio-button/styles.scss, next to the carrier, so Radio group (and Tiles and Table selection, which render the same control) load it without the public Radio button. Generated docs and mixins are unchanged.

The style-docs snapshot and the VR registration of the dev page follow in one PR for all components.

Tracker section: P3d34KdbCd6o.

Related links, issue #, if available: n/a

How has this been tested?

Unit tests for the forward, dev page radio-group/style-api-v2, build and lint green.

Review checklist

The following items are to be evaluated by the author(s) and the reviewer(s).

Correctness

  • Changes include appropriate documentation updates.
  • Changes are backward-compatible if not indicated, see CONTRIBUTING.md.
  • Changes do not include unsupported browser features, see CONTRIBUTING.md.
  • Changes were manually tested for accessibility, see accessibility guidelines.

Security

Testing

  • Changes are covered with new/existing unit tests?
  • Changes are covered with new/existing integration tests?

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Outdated style-doc snapshots will fail CI, and URL-driven selection and shared control-token registration remain unresolved.

3 open issues
What changed in this PR

Adds internal Style API v2 support to RadioGroup by forwarding an item slot to each radio’s control, while leaving the group root unstyled.

Changes:

  • Adds per-radio class forwarding and style-documentation metadata.
  • Tests slot application, unknown-slot handling, and DOM prop filtering.
  • Adds a styled demo covering disabled, read-only, and horizontal groups.
File Description
src/​radio-group/​styles.scss Declares the item slot’s documentation forward.
src/​radio-group/​internal.tsx Forwards the item class to every radio control.
src/​radio-group/​__tests__/​style-api.test.tsx Tests class forwarding and prop isolation.
pages/​radio-group/​style-api-v2.scss Defines demo styling for radio states.
pages/​radio-group/​style-api-v2.page.tsx Adds interactive Style API examples.

Review effort: Balanced

Comment thread src/radio-group/styles.scss Resolved
Comment thread pages/radio-group/style-api-v2.page.tsx Resolved
@use '../internal/styles/tokens' as awsui;
@use '../internal/styles/style-api' as style-api;

@include style-api.docs-forward('item', 'radio-button', 'control');

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in 9867269

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we register it as control or omit the slot instead?

@codecov

codecov Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 97.76%. Comparing base (8a3001d) to head (9867269).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5226   +/-   ##
=======================================
  Coverage   97.76%   97.76%           
=======================================
  Files        1003     1003           
  Lines       32572    32573    +1     
  Branches    12109    12111    +2     
=======================================
+ Hits        31843    31844    +1     
+ Misses        723      684   -39     
- Partials        6       45   +39     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Two convention issues remain: the duplicated plans fixture should be shared, and the internal style class names prop should use the __ prefix while preserving the public entry point.

1 open issue
2 previously missed issues

In code that hasn't changed since last review

Low severity Extract and reuse the shared plans fixture

pages/​radio-group/​style-api-v2.page.tsx:16

The dev-page convention requires reusing fixtures rather than duplicating them. This is the same plans fixture as pages/radio-button/style-api-v2.page.tsx:19-23; please extract it into a shared fixture and reuse it so the two style API examples do not drift.

Low severity Prefix the internal styleClassNames prop with __

src/​radio-group/​internal.tsx:24

The component-structure convention requires props that are absent from the public RadioGroupProps to use the __ prefix, so their internal status is clear. Please name this internal prop __styleClassNames and adapt the wrapper to map the existing styleClassNames input to it, preserving the Style API entry point.

2 resolved since last review

Review effort: Balanced

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The internal-only prop in src/radio-group/internal.tsx lacks the required __ prefix; it should be renamed to __styleClassNames while preserving the wrapper’s styleClassNames entry point.

2 open issues

Review effort: Balanced

Comment thread src/radio-group/internal.tsx Resolved
@vvaliyev
vvaliyev requested a review from pan-kot November 2, 2026 16:57
@vvaliyev
vvaliyev marked this pull request as ready for review November 2, 2026 16:57
@vvaliyev
vvaliyev requested a review from a team as a code owner November 2, 2026 16:58

This branch was successfully deployed

3 active deployments
dev-pages-react18 — 98672692 Deployed Nov 2, 2026 by vvaliyev via deploy (React 18) / deploy #3097
dev-pages-react16 — 98672692 Deployed Nov 2, 2026 by vvaliyev via deploy (React 16) / deploy #3097
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