Skip to content

chore: cleanup remaining sx props - #6959

Merged
francinelucca merged 5 commits into
mainfrom
chore/cleanup-remaining-sx
Oct 7, 2025
Merged

chore: cleanup remaining sx props#6959
francinelucca merged 5 commits into
mainfrom
chore/cleanup-remaining-sx

Conversation

@francinelucca

Copy link
Copy Markdown
Member

Borrowing changes from #6929 that don't have blockers and can be merged now

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

Changelog

Removed

  • sxProp and BoxWithFallback from components that no longer support it

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

Co-authored-by: Mike Perrotti <mperrotti@users.noreply.github.com>
@francinelucca
francinelucca requested a review from a team as a code ownerOctober 7, 2025 16:43
@changeset-bot

changeset-botBot commented Oct 7, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 8dbc374

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

This PR includes changesets to release 2 packages
NameType
@primer/reactPatch
@primer/styled-reactPatch

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

@github-actionsgithub-actionsBot added the staff Author is a staff member label Oct 7, 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 removes the remaining sx prop support from various components as part of the cleanup effort to migrate away from the legacy styled-components system to CSS modules. The changes eliminate SxProp type annotations, remove BoxWithFallback dependencies, and update Storybook configuration to exclude the removed props.

Key changes:

  • Removed sx prop support from internal components and helper utilities
  • Replaced BoxWithFallback usage with native HTML elements in affected components
  • Updated Storybook controls to exclude the removed sx prop from various component stories

Reviewed Changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
packages/react/src/utils/story-helpers.tsxRemoved 'sx' from textInputExcludedControlKeys array
packages/react/src/utils/form-story-helpers.tsxRemoved 'sx' from textInputExcludedControlKeys array
packages/react/src/internal/components/UnstyledTextInput.tsxRemoved SxProp type and BoxWithFallback, replaced with native input element
packages/react/src/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupValidation.tsxRemoved SxProp type and sx prop usage from component
packages/react/src/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroupCaption.tsxRemoved SxProp type and replaced with HTMLSpanElement props
packages/react/src/internal/components/CheckboxOrRadioGroup/CheckboxOrRadioGroup.tsxRemoved SxProp, BoxWithFallback usage, and sx prop; replaced with dynamic component selection
packages/react/src/UnderlineNav/UnderlineNav.stories.tsxRemoved 'sx' from excludedControlKeys array
packages/react/src/RadioGroup/RadioGroup.stories.tsxRemoved 'sx' from Storybook controls exclude list
packages/react/src/Radio/Radio.stories.tsxRemoved 'sx' from excludedControlKeys array
packages/react/src/CheckboxGroup/CheckboxGroup.stories.tsxRemoved 'sx' from Storybook controls exclude list
packages/react/src/AvatarStack/AvatarStack.tsxRemoved BoxWithFallback dependency and replaced with native span element

@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 7, 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!

@github-actions
github-actionsBot requested a deployment to storybook-preview-6959 October 7, 2025 16:48 Abandoned
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6959 October 7, 2025 16:56 Inactive
@primer-integration

Copy link
Copy Markdown

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

@github-actionsgithub-actionsBot 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 Oct 7, 2025
@primer-integration

Copy link
Copy Markdown

🟢 ci completed with status success.

@github-actionsgithub-actionsBot 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 7, 2025
@francinelucca
francinelucca added this pull request to the merge queueOct 7, 2025
Merged via the queue into main with commit 76f1ca3Oct 7, 2025
43 of 45 checks passed
@francinelucca
francinelucca deleted the chore/cleanup-remaining-sx branch October 7, 2025 18:48
@primerprimerBot mentioned this pull request Oct 7, 2025
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

integration-tests: passingChanges in this PR do NOT cause breaking changes in gh/ghstaffAuthor is a staff member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@francinelucca@jonrohan