Skip to content

Conversation

@mperrotti
Copy link
Contributor

Relates to https://github.com/github/primer/issues/5424

Since this also removed the sx prop from VisuallyHidden, this PR also includes changes to remove the sx prop from CheckboxOrRadioGroupLabel.

If reviewers prefer I open the CheckboxOrRadioGroupLabel changes in a separate PR, just comment below.

Changelog

New

Changed

Removed

  • sx prop has been removed from VisuallyHidden (no sx prop usage found in Primer Query)
  • sx prop has been removed from CheckboxGroup.Label and RadioGroup.Label

Rollout strategy

  • Patch release
  • Minor release
  • Major release; if selected, include a written rollout or migration plan
  • None; if selected, include a brief description as to why

Testing & Reviewing

Merge checklist

@mperrotti mperrotti requested a review from a team as a code owner September 30, 2025 20:51
@changeset-bot
Copy link

changeset-bot bot commented Sep 30, 2025

🦋 Changeset detected

Latest commit: 54dfd4f

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

This PR includes changesets to release 2 packages
Name Type
@primer/react Major
@primer/styled-react Major

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

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR removes the BoxWithFallback usage from VisuallyHidden component and eliminates the sx prop from both VisuallyHidden and checkbox/radio group labels as part of modernizing the component architecture.

  • Refactors VisuallyHidden to use modern polymorphic props instead of BoxWithFallback
  • Removes sx prop support from VisuallyHidden and CheckboxOrRadioGroupLabel
  • Updates styled-react package to maintain sx prop support for CheckboxGroup.Label through wrapper components

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/react/src/_VisuallyHidden.tsx Replaces BoxWithFallback with direct component rendering using modern polymorphic props
packages/react/src/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupLabel.tsx Removes sx prop and SxProp import from the internal label component
packages/styled-react/src/components/CheckboxGroup.tsx Adds new wrapper component to preserve sx prop support in styled-react package
packages/styled-react/src/index.tsx Updates exports to use the new CheckboxGroup wrapper component
packages/react/src/CheckboxGroup/CheckboxGroup.tsx Exports CheckboxGroupProps type
packages/react/src/CheckboxGroup/index.ts Adds CheckboxGroupProps to exports
packages/react/src/index.ts Adds CheckboxGroupProps type export
packages/styled-react/src/__tests__/primer-react.browser.test.tsx Adds test for sx prop support in CheckboxGroup.Label

@github-actions github-actions bot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Sep 30, 2025
@github-actions
Copy link
Contributor

👋 Hi, this pull request contains changes to the source code that github/github depends on. If you are GitHub staff, we recommend testing these changes with github/github using the integration workflow. Thanks!

@primer-integration
Copy link

👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/3595

@github-actions github-actions bot added integration-tests: failing Changes in this PR cause breaking changes in gh/gh and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Sep 30, 2025
@primer-integration
Copy link

🟢 ci completed with status success.

@github-actions github-actions bot added integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh and removed integration-tests: failing Changes in this PR cause breaking changes in gh/gh labels Oct 1, 2025
@francinelucca francinelucca added this pull request to the merge queue Oct 1, 2025
Merged via the queue into main with commit 2eeff36 Oct 1, 2025
43 of 44 checks passed
@francinelucca francinelucca deleted the mp/rm-boxwithfallback-visuallyhidden branch October 1, 2025 00:33
@primer primer bot mentioned this pull request Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: passing Changes in this PR do NOT cause breaking changes in gh/gh

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants