Skip to content

Conversation

@joshblack
Copy link
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

Copilot AI review requested due to automatic review settings September 9, 2025 17:04
@joshblack joshblack requested a review from a team as a code owner September 9, 2025 17:04
@joshblack joshblack requested a review from jonrohan September 9, 2025 17:04
@changeset-bot
Copy link

changeset-bot bot commented Sep 9, 2025

🦋 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
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

@github-actions github-actions bot 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
Contributor

github-actions bot commented Sep 9, 2025

👋 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!

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 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
File Description
packages/styled-react/src/sx.ts Adds utility function for styled-system CSS processing
packages/styled-react/src/index.tsx Updates exports to include Dialog from styled-react package
packages/styled-react/src/experimental.tsx Re-exports Dialog from local implementation instead of @primer/react
packages/styled-react/src/components/Dialog.tsx Implements Dialog wrapper with sx support using styled-components
packages/styled-react/src/tests/primer-react.browser.test.tsx Adds tests for Dialog sub-components with sx prop support
packages/react/src/Dialog/Dialog.tsx Removes sx prop and Box usage, replaces with native HTML elements
packages/react/src/Dialog/Dialog.module.css Adds CSS classes for header layout previously handled by Box
.changeset/sweet-results-smell.md Documents breaking change for major version release

@github-actions
Copy link
Contributor

github-actions bot commented Sep 9, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 89.44 KB (-0.2% 🔽)
packages/react/dist/browser.umd.js 89.6 KB (+0.04% 🔺)

Copy link
Contributor

@mperrotti mperrotti left a comment

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 Dialog sx props
  • remove the Dialog stories that use the sx prop
  • fix the linting errors

Copy link
Contributor

@mperrotti mperrotti left a comment

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

@mperrotti mperrotti added the update snapshots 🤖 Command that updates VRT snapshots on the pull request label Sep 12, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-6812 September 12, 2025 17:46 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-6812 September 22, 2025 17:32 Inactive
@github-actions github-actions bot 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
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-actions bot 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
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-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 24, 2025
@github-actions
Copy link
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-actions bot 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
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-actions bot requested a deployment to storybook-preview-6812 September 24, 2025 14:01 Abandoned
@github-actions github-actions bot 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

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

@primer-integration
Copy link

🟢 ci completed with status success.

@francinelucca francinelucca added this pull request to the merge queue Sep 26, 2025
Merged via the queue into main with commit 0834e9e Sep 26, 2025
43 of 44 checks passed
@francinelucca francinelucca deleted the 6762-remove-sx-from-dialog branch September 26, 2025 21:00
@primer primer bot mentioned this pull request Sep 26, 2025
llastflowers pushed a commit that referenced this pull request Sep 29, 2025
Co-authored-by: Mike Perrotti <[email protected]>
Co-authored-by: Jon Rohan <[email protected]>
Co-authored-by: Marie Lucca <[email protected]>
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 staff Author 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