Skip to content

chore: remove sx from Overlay - #6865

Merged
francinelucca merged 14 commits into
mainfrom
chore/remove-sx-from-overlay
Sep 29, 2025
Merged

chore: remove sx from Overlay#6865
francinelucca merged 14 commits into
mainfrom
chore/remove-sx-from-overlay

Conversation

@francinelucca

@francineluccafrancinelucca commented Sep 17, 2025

Copy link
Copy Markdown
Member

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

changeset-botBot commented Sep 17, 2025

Copy link
Copy Markdown

🦋 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
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 the staff Author is a staff member label Sep 17, 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!

@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 17, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6865 September 17, 2025 03:52 Inactive
@github-actions
github-actionsBot requested a deployment to storybook-preview-6865 September 23, 2025 02:07 Abandoned
@github-actions
github-actionsBot requested a deployment to storybook-preview-6865 September 23, 2025 02:12 Abandoned
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6865 September 23, 2025 15:43 Inactive
@github-actionsgithub-actionsBot 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
Copy Markdown

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

@primer-integration

Copy link
Copy Markdown

🟢 ci completed with status success.

@github-actionsgithub-actionsBot 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

francinelucca commented Sep 24, 2025

Copy link
Copy Markdown
MemberAuthor

@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 ownerSeptember 24, 2025 02:09

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 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
FileDescription
packages/react/src/Overlay/Overlay.tsxRemove sx prop support and SxProp type, replace BoxWithFallback with direct component rendering
packages/styled-react/src/components/Overlay.tsxCreate styled-components wrapper for Overlay with sx support
packages/styled-react/src/components/Autocomplete.tsxCreate styled-components wrapper for Autocomplete with sx-enabled Overlay
packages/styled-react/src/components/ActionMenu.tsxCreate styled-components wrapper for ActionMenu with sx-enabled Overlay
packages/styled-react/src/index.tsxUpdate exports to include new styled components
packages/react/src/Overlay/Overlay.features.stories.tsxReplace sx usage with style prop
packages/react/src/Overlay/Overlay.dev.stories.tsxRemove SxProps story
packages/react/src/Overlay/Overlay.docs.jsonRemove sx prop from documentation
e2e/components/Overlay.test.tsRemove SX Props test
.changeset/lazy-gifts-join.mdAdd 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'

CopilotAISep 24, 2025

Copy link

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{OverlayasPrimerOverlay,typeOverlayPropsasPrimerOverlayProps,sx,typeSxProp}from'@primer/react'
importstyledfrom'styled-components'
import{typeForwardRefComponent}from'../polymorphic'
import{OverlayasPrimerOverlay,typeOverlayPropsasPrimerOverlayProps}from'@primer/react'
importstyledfrom'styled-components'
import{typeForwardRefComponent}from'../polymorphic'
import{sx,typeSxProp}from'../sx'

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

CopilotAISep 24, 2025

Copy link

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,typeSxProp}from'../sx'
import{sx,typeSxProp}from'@primer/react'

Copilot uses AI. Check for mistakes.
@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 29, 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!

@francinelucca
francinelucca added this pull request to the merge queueSep 29, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6865 September 29, 2025 20:53 Inactive
Merged via the queue into main with commit eaf7e58Sep 29, 2025
42 checks passed
@francinelucca
francinelucca deleted the chore/remove-sx-from-overlay branch September 29, 2025 20:57
@primerprimerBot mentioned this pull request Sep 29, 2025
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/ghintegration-tests: recommendedThis change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpmstaffAuthor 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

@francinelucca@jonrohan