Uh oh!
There was an error while loading. Please reload this page.
Remove BoxWithFallback usage from VisuallyHidden - #6928
Conversation
🦋 Changeset detectedLatest commit: 54dfd4f The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
There was a problem hiding this comment.
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
VisuallyHiddento use modern polymorphic props instead ofBoxWithFallback - Removes
sxprop support fromVisuallyHiddenandCheckboxOrRadioGroupLabel - Updates styled-react package to maintain
sxprop support forCheckboxGroup.Labelthrough 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 |
👋 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! |
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/3595 |
🟢 ci completed with status |
Relates to https://github.com/github/primer/issues/5424
Since this also removed the
sxprop fromVisuallyHidden, this PR also includes changes to remove thesxprop from CheckboxOrRadioGroupLabel.If reviewers prefer I open the CheckboxOrRadioGroupLabel changes in a separate PR, just comment below.
Changelog
New
Changed
Removed
sxprop has been removed from VisuallyHidden (nosxprop usage found in Primer Query)sxprop has been removed from CheckboxGroup.Label and RadioGroup.LabelRollout strategy
Testing & Reviewing
Merge checklist