Skip to content

feat(Dialog): remove support for sx - #6812

Merged
francinelucca merged 20 commits into
mainfrom
6762-remove-sx-from-dialog
Sep 26, 2025
Merged

feat(Dialog): remove support for sx#6812
francinelucca merged 20 commits into
mainfrom
6762-remove-sx-from-dialog

Conversation

@joshblack

Copy link
Copy Markdown
Member

Closes#6762

Changelog

New

Changed

  • Refactor usage of Box internally from @mperrotti's work
  • Update tests in styled-react to account for sx usage in Dialog sub-components

Removed

  • Remove support for sx from Dialog

Rollout strategy

  • Major release; if selected, include a written rollout or migration plan

We will use the @primer/styled-react package to update usage downstream before rolling this change out

CopilotAI review requested due to automatic review settings September 9, 2025 17:04
@joshblack
joshblack requested a review from a team as a code ownerSeptember 9, 2025 17:04
@changeset-bot

changeset-botBot commented Sep 9, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: b0c7810

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

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

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 staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Sep 9, 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!

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 support for the sx prop from the Dialog component and its sub-components as part of a major version release. The change aims to simplify the Dialog API by removing styled-system integration while maintaining backward compatibility through the @primer/styled-react package.

  • Removes sx prop support from Dialog, Dialog.Header, Dialog.Title, Dialog.Subtitle, Dialog.Body, and Dialog.Footer
  • Refactors internal usage of Box component to native HTML elements with CSS modules
  • Creates a styled-react wrapper to maintain sx support for consumers during migration

Reviewed Changes

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

Show a summary per file
FileDescription
packages/styled-react/src/sx.tsAdds utility function for styled-system CSS processing
packages/styled-react/src/index.tsxUpdates exports to include Dialog from styled-react package
packages/styled-react/src/experimental.tsxRe-exports Dialog from local implementation instead of @primer/react
packages/styled-react/src/components/Dialog.tsxImplements Dialog wrapper with sx support using styled-components
packages/styled-react/src/tests/primer-react.browser.test.tsxAdds tests for Dialog sub-components with sx prop support
packages/react/src/Dialog/Dialog.tsxRemoves sx prop and Box usage, replaces with native HTML elements
packages/react/src/Dialog/Dialog.module.cssAdds CSS classes for header layout previously handled by Box
.changeset/sweet-results-smell.mdDocuments breaking change for major version release

Comment threadpackages/styled-react/src/components/Dialog.tsx Outdated
Comment threadpackages/styled-react/src/components/Dialog.tsx Outdated
Comment threadpackages/styled-react/src/components/Dialog.tsx Outdated
Comment threadpackages/react/src/Dialog/Dialog.tsx Outdated
@github-actions

github-actionsBot commented Sep 9, 2025

Copy link
Copy Markdown
Contributor

size-limit report 📦

PathSize
packages/react/dist/browser.esm.js89.44 KB (-0.2% 🔽)
packages/react/dist/browser.umd.js89.6 KB (+0.04% 🔺)

Comment threadpackages/styled-react/src/index.tsx Outdated

@mperrottimperrotti 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 look good overall. Approved assuming you'll:

  • fix the broken "default" story VRT that was broken by removing Dialogsx props
  • remove the Dialog stories that use the sx prop
  • fix the linting errors

@mperrottimperrotti 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.

oops, forgot to select "Approve" radio

@mperrottimperrotti added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Sep 12, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6812 September 12, 2025 17:46 Inactive
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6812 September 22, 2025 17:32 Inactive
@github-actionsgithub-actionsBot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Sep 24, 2025
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

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

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@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 Sep 24, 2025
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actionsgithub-actionsBot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels Sep 24, 2025
@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi, there are new commits since the last successful integration test. We recommend running the integration workflow once more, unless you are sure the new changes do not affect github/github. Thanks!

@github-actions
github-actionsBot requested a deployment to storybook-preview-6812 September 24, 2025 14:01 Abandoned
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6812 September 24, 2025 14:11 Inactive
@github-actionsgithub-actionsBot removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Sep 25, 2025
@primer-integration

Copy link
Copy Markdown

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

@primer-integration

Copy link
Copy Markdown

🟢 ci completed with status success.

@francinelucca
francinelucca added this pull request to the merge queueSep 26, 2025
Merged via the queue into main with commit 0834e9eSep 26, 2025
43 of 44 checks passed
@francinelucca
francinelucca deleted the 6762-remove-sx-from-dialog branch September 26, 2025 21:00
@primerprimerBot mentioned this pull request Sep 26, 2025
llastflowers pushed a commit that referenced this pull request Sep 29, 2025
Co-authored-by: Mike Perrotti <mperrotti@github.com>
Co-authored-by: Jon Rohan <yes@jonrohan.codes>
Co-authored-by: Marie Lucca <francinelucca@github.com>
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.

Remove support for sx from the Dialog component

5 participants

@joshblack@jonrohan@mperrotti@francinelucca