Skip to content

Conversation

@joshblack
Copy link
Member

Closes #6761

Changelog

New

Changed

Removed

  • Remove support for sx from ButtonGroup

Rollout strategy

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

This component has no sx usage in github-ui and can be safely merged in ✅

@joshblack joshblack requested a review from a team as a code owner September 10, 2025 22:04
@changeset-bot
Copy link

changeset-bot bot commented Sep 10, 2025

🦋 Changeset detected

Latest commit: 844f8b5

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

@joshblack joshblack changed the title Feat/remove support for sx from buttongroup feat(ButtonGroup): remove support for sx Sep 10, 2025
@github-actions github-actions bot added the staff Author is a staff member label Sep 10, 2025
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 the deprecated sx prop from the ButtonGroup component as part of the ongoing migration away from the styled-components system to CSS modules. The change includes updating the component's TypeScript interface, replacing the internal BoxWithFallback wrapper with a polymorphic base component, and migrating existing sx usage in stories to standard CSS properties.

Key changes:

  • Removes sx prop support from ButtonGroup component interface
  • Replaces BoxWithFallback with polymorphic component pattern using as prop
  • Updates development stories to use inline styles instead of sx prop

Reviewed Changes

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

File Description
packages/react/src/ButtonGroup/ButtonGroup.tsx Removes sx prop, replaces BoxWithFallback with polymorphic component pattern
packages/react/src/ButtonGroup/ButtonGroup.docs.json Removes deprecated sx prop from component documentation
packages/react/src/ButtonGroup/ButtonGroup.dev.stories.tsx Migrates sx usage to inline styles and removes SxProp story
.changeset/light-colts-burn.md Adds changeset entry for major version bump

Comment on lines +15 to +16
const ButtonGroup = React.forwardRef(function ButtonGroup(
{as: BaseComponent = 'div', children, className, role, ...rest},
Copy link

Copilot AI Sep 10, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The as prop is destructured but not included in the ButtonGroupProps type definition. This creates a mismatch between the component's actual interface and its declared props type, which could confuse consumers and break TypeScript IntelliSense.

Copilot uses AI. Check for mistakes.
@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 10, 2025
@github-actions
Copy link
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
Copy link
Contributor

github-actions bot commented Sep 10, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 88.55 KB (-0.11% 🔽)
packages/react/dist/browser.umd.js 88.76 KB (+0.04% 🔺)

@joshblack joshblack requested a review from a team as a code owner September 10, 2025 22:15
@joshblack joshblack requested a review from mperrotti September 10, 2025 22:15
@github-actions github-actions bot temporarily deployed to storybook-preview-6835 September 10, 2025 22:25 Inactive
@github-actions github-actions bot 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 Sep 16, 2025
@primer-integration
Copy link

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

@primer-integration
Copy link

🟢 ci completed with status success.

@github-actions github-actions bot 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 Sep 16, 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 22, 2025
@francinelucca francinelucca added this pull request to the merge queue Sep 22, 2025
Merged via the queue into main with commit 961c1c4 Sep 22, 2025
42 checks passed
@francinelucca francinelucca deleted the feat/remove-support-for-sx-from-buttongroup branch September 22, 2025 18:38
@primer primer bot mentioned this pull request Sep 22, 2025
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 integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm 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 ButtonGroup component

3 participants