Skip to content

Conversation

@francinelucca
Copy link
Member

@francinelucca francinelucca commented Sep 17, 2025

Closes #6769

Current sx usage: 5

sx usages are only in repos other than github-ui; those usages have been added to the tracking issue

Changelog

Removed

Remove support for sx from the CircleBadge component, and associated stories, docs, and tests

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

@changeset-bot
Copy link

changeset-bot bot commented Sep 17, 2025

🦋 Changeset detected

Latest commit: 8b95e0f

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 the staff Author is a staff member label Sep 17, 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 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 17, 2025
@github-actions github-actions bot temporarily deployed to storybook-preview-6865 September 17, 2025 03:52 Inactive
@github-actions github-actions bot requested a deployment to storybook-preview-6865 September 23, 2025 02:07 Abandoned
@github-actions github-actions bot requested a deployment to storybook-preview-6865 September 23, 2025 02:12 Abandoned
@github-actions github-actions bot requested a deployment to storybook-preview-6865 September 23, 2025 02:18 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-6865 September 23, 2025 02:28 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-6865 September 23, 2025 15:43 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 23, 2025
@primer-integration
Copy link

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

@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 24, 2025
@francinelucca
Copy link
Member Author

francinelucca commented Sep 24, 2025

@francinelucca francinelucca marked this pull request as ready for review September 24, 2025 02:09
@francinelucca francinelucca requested a review from a team as a code owner September 24, 2025 02:09
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 support from the Overlay component as part of the migration away from styled-components. The change involves updating the main Overlay component to no longer accept sx props and creating styled-components wrappers in the @primer/styled-react package to maintain backwards compatibility.

  • Remove sx prop support and SxProp type from the main Overlay component
  • Create styled-components wrappers for Overlay, ActionMenu.Overlay, and Autocomplete.Overlay in the styled-react package
  • Update stories, tests, and documentation to reflect the removal of sx support

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/react/src/Overlay/Overlay.tsx Remove sx prop support and SxProp type, replace BoxWithFallback with direct component rendering
packages/styled-react/src/components/Overlay.tsx Create styled-components wrapper for Overlay with sx support
packages/styled-react/src/components/Autocomplete.tsx Create styled-components wrapper for Autocomplete with sx-enabled Overlay
packages/styled-react/src/components/ActionMenu.tsx Create styled-components wrapper for ActionMenu with sx-enabled Overlay
packages/styled-react/src/index.tsx Update exports to include new styled components
packages/react/src/Overlay/Overlay.features.stories.tsx Replace sx usage with style prop
packages/react/src/Overlay/Overlay.dev.stories.tsx Remove SxProps story
packages/react/src/Overlay/Overlay.docs.json Remove sx prop from documentation
e2e/components/Overlay.test.ts Remove SX Props test
.changeset/lazy-gifts-join.md Add changeset for major version bump

Comment on lines +1 to +4
import {Overlay as PrimerOverlay, type OverlayProps as PrimerOverlayProps, sx, type SxProp} from '@primer/react'
import styled from 'styled-components'
import {type ForwardRefComponent} from '../polymorphic'

Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

The sx utility and SxProp type are being imported from @primer/react, but according to the PR changes, sx support is being removed from the main package. These should be imported from a local sx module like in the other styled components.

Suggested change
import {Overlay as PrimerOverlay, type OverlayProps as PrimerOverlayProps, sx, type SxProp} from '@primer/react'
import styled from 'styled-components'
import {type ForwardRefComponent} from '../polymorphic'
import {Overlay as PrimerOverlay, type OverlayProps as PrimerOverlayProps} from '@primer/react'
import styled from 'styled-components'
import {type ForwardRefComponent} from '../polymorphic'
import {sx, type SxProp} from '../sx'

Copilot uses AI. Check for mistakes.
Autocomplete as PrimerAutocomplete,
type AutocompleteOverlayProps as PrimerAutocompleteOverlayProps,
} from '@primer/react'
import {sx, type SxProp} from '../sx'
Copy link

Copilot AI Sep 24, 2025

Choose a reason for hiding this comment

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

[nitpick] Inconsistent import pattern - this file imports sx and SxProp from ../sx, while the Overlay component imports them from @primer/react. All styled components should use the same import source for consistency.

Suggested change
import {sx, type SxProp} from '../sx'
import {sx, type SxProp} from '@primer/react'

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

@francinelucca francinelucca added this pull request to the merge queue Sep 29, 2025
Merged via the queue into main with commit eaf7e58 Sep 29, 2025
42 checks passed
@francinelucca francinelucca deleted the chore/remove-sx-from-overlay branch September 29, 2025 20:57
@primer primer bot mentioned this pull request Sep 29, 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 Overlay component

3 participants