-
Notifications
You must be signed in to change notification settings - Fork 645
chore: remove sx from Overlay #6865
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 8b95e0f The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
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 |
|
👋 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! |
…t into chore/remove-sx-from-overlay
|
👋 Hi from github/github-ui! Your integration PR is ready: https://github.com/github/github-ui/pull/3154 |
|
🟢 ci completed with status |
There was a problem hiding this 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
sxprop support andSxProptype 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
sxsupport
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 |
| import {Overlay as PrimerOverlay, type OverlayProps as PrimerOverlayProps, sx, type SxProp} from '@primer/react' | ||
| import styled from 'styled-components' | ||
| import {type ForwardRefComponent} from '../polymorphic' | ||
|
|
Copilot
AI
Sep 24, 2025
There was a problem hiding this comment.
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.
| 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' |
| Autocomplete as PrimerAutocomplete, | ||
| type AutocompleteOverlayProps as PrimerAutocompleteOverlayProps, | ||
| } from '@primer/react' | ||
| import {sx, type SxProp} from '../sx' |
Copilot
AI
Sep 24, 2025
There was a problem hiding this comment.
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.
| import {sx, type SxProp} from '../sx' | |
| import {sx, type SxProp} from '@primer/react' |
|
👋 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! |
Closes #6769
Current
sxusage: 5✅
sxusages are only in repos other than github-ui; those usages have been added to the tracking issueChangelog
Removed
Remove support for
sxfrom theCircleBadgecomponent, and associated stories, docs, and testsRollout strategy
Testing & Reviewing
Merge checklist