Skip to content

Remove Box usage and sx prop from NavList and related components - #6868

Merged
mperrotti merged 20 commits into
mainfrom
mp/rm-box-and-sx-from-listy-components
Sep 26, 2025
Merged

Remove Box usage and sx prop from NavList and related components#6868
mperrotti merged 20 commits into
mainfrom
mp/rm-box-and-sx-from-listy-components

Conversation

@mperrotti

@mperrottimperrotti commented Sep 17, 2025

Copy link
Copy Markdown
Contributor

Relates to https://github.com/github/primer/issues/5424 and https://github.com/github/primer/issues/5425

Closes#6768

Changelog

New

Changed

sx prop was removed from NavList and its subcomponents

Removed

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

CopilotAI review requested due to automatic review settings September 17, 2025 15:10
@mperrotti
mperrotti requested a review from a team as a code ownerSeptember 17, 2025 15:10
@changeset-bot

changeset-botBot commented Sep 17, 2025

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 24be459

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

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!

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 sx prop and Box component usage from NavList and its related components as part of migrating away from the styled-system approach. The changes move styling from JavaScript-based sx props to CSS modules while maintaining backward compatibility through a styled-react wrapper.

Key changes:

  • Removed sx prop support from all NavList components and subcomponents
  • Replaced Box component usage with native HTML elements
  • Migrated inline styles to CSS modules for GroupHeading component

Reviewed Changes

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

Show a summary per file
FileDescription
packages/styled-react/src/components/NavList.tsxAdded wrapper components that re-add sx prop support via Box wrapping for backward compatibility
packages/react/src/NavList/NavList.tsxRemoved sx prop from all components, replaced Box usage with native HTML elements, migrated GroupHeading styles to CSS modules
packages/react/src/NavList/NavList.module.cssAdded CSS module styles for GroupHeading link styling
packages/react/src/NavList/NavList.docs.jsonRemoved sx prop documentation from all NavList components
packages/react/src/ActionList/shared.tsUpdated ActionList types to support modern polymorphic components
packages/react/src/ActionList/List.tsxMigrated ActionList to use modern polymorphic pattern
packages/react/src/ActionList/Item.tsxUpdated ActionList.Item to use modern polymorphic pattern

Comment threadpackages/react/src/NavList/NavList.tsx Outdated
Comment threadpackages/react/src/ActionList/Item.tsx Outdated
@github-actions
github-actionsBot requested a deployment to storybook-preview-6868 September 17, 2025 15:16 Abandoned
@github-actions
github-actionsBot requested a deployment to storybook-preview-6868 September 17, 2025 15:24 Abandoned
@github-actions
github-actionsBot requested a deployment to storybook-preview-6868 September 17, 2025 15:31 Abandoned
@joshblack

Copy link
Copy Markdown
Member

@mperrotti I linked: #6768 to this issue if that's okay! Seems like it would close it if I'm understanding right

@github-actions
github-actionsBottemporarily deployed to storybook-preview-6868 September 24, 2025 19:36 Inactive
@primer-integration

Copy link
Copy Markdown

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

@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 25, 2025
@mperrotti

Copy link
Copy Markdown
ContributorAuthor

This PR will pass integration tests with the following changes to the ref callback type: https://github.com/github/github-ui/pull/3266

@hectahertzhectahertz 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.

🚀

@francinelucca
francinelucca added this pull request to the merge queueSep 26, 2025
@github-merge-queue
github-merge-queueBot removed this pull request from the merge queue due to a conflict with the base branch Sep 26, 2025
@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 26, 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!

@github-actionsgithub-actionsBot removed the integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm label Sep 26, 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!

@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 26, 2025
@mperrotti
mperrotti added this pull request to the merge queueSep 26, 2025
@github-actions
github-actionsBottemporarily deployed to storybook-preview-6868 September 26, 2025 22:46 Inactive
Merged via the queue into main with commit 2053cb3Sep 26, 2025
42 checks passed
@mperrotti
mperrotti deleted the mp/rm-box-and-sx-from-listy-components branch September 26, 2025 22:50
@primerprimerBot mentioned this pull request Sep 26, 2025
llastflowers pushed a commit that referenced this pull request Sep 29, 2025
…6868)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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/tdmpakpm

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove support for sx from the NavList component

4 participants

@mperrotti@joshblack@hectahertz