Skip to content

revert: Remove support for sx from FormControl component (#6681) - #6939

Merged
TylerJDev merged 1 commit into
mainfrom
chore/revert-6681
Oct 3, 2025
Merged

revert: Remove support for sx from FormControl component (#6681)#6939
TylerJDev merged 1 commit into
mainfrom
chore/revert-6681

Conversation

@francinelucca

Copy link
Copy Markdown
Member

This is not going to play well with our useSlots strategy, reverting and will fix up for next release

@francinelucca
francinelucca requested a review from a team as a code ownerOctober 3, 2025 13:41
@changeset-bot

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: eea3868

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actionsgithub-actionsBot added the staff Author is a staff member label Oct 3, 2025

CopilotAI 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.

Pull Request Overview

This PR reverts the removal of sx prop support from the FormControl component and its subcomponents. The revert is necessary because the previous change would conflict with the existing useSlots strategy implementation.

Key Changes

  • Restores sx prop support to FormControl and all its subcomponents (Caption, Label, LeadingVisual, Validation)
  • Reverts from CSS modules back to styled-components for FormControlLeadingVisual
  • Re-adds FormControl to styled-react package exports

Reviewed Changes

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

Show a summary per file
FileDescription
packages/styled-react/src/index.tsxRe-exports FormControl from @primer/react and removes local FormControl implementation
packages/styled-react/src/components/FormControl.tsxRemoves the entire styled-react FormControl wrapper component
packages/react/src/index.tsRemoves FormControl type exports that were added in the reverted change
packages/react/src/experimental/SelectPanel2/SelectPanel.examples.stories.tsxReplaces CSS class usage with sx prop for FormControl styling
packages/react/src/experimental/SelectPanel2/SelectPanel.examples.stories.module.cssRemoves FormControl CSS class definition
packages/react/src/tests/snapshots/exports.test.ts.snapUpdates test snapshot to reflect removed type exports
packages/react/src/FormControl/index.tsRemoves FormControl type exports
packages/react/src/FormControl/FormControlLeadingVisual.tsxReverts from CSS modules to styled-components and adds sx prop support
packages/react/src/FormControl/FormControlLeadingVisual.module.cssRemoves CSS module file
packages/react/src/FormControl/FormControlLabel.tsxAdds sx prop support back to FormControlLabel
packages/react/src/FormControl/FormControlCaption.tsxAdds sx prop support and BoxWithFallback wrapper
packages/react/src/FormControl/FormControl.tsxAdds sx prop support and BoxWithFallback wrappers
packages/react/src/FormControl/FormControl.docs.jsonAdds sx prop documentation for all FormControl components
.changeset/grumpy-lobsters-obey.mdRemoves the changeset for the reverted FormControl changes

@github-actionsgithub-actionsBot added the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Oct 3, 2025
@github-actions

Copy link
Copy Markdown
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!

@TylerJDev
TylerJDev merged commit 503a592 into mainOct 3, 2025
42 of 43 checks passed
@TylerJDev
TylerJDev deleted the chore/revert-6681 branch October 3, 2025 13:50
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: recommendedThis change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpmstaffAuthor is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@francinelucca@TylerJDev