Skip to content

chore(_VisuallyHidden): Convert internal component _VisuallyHidden to CSS module styling #6083

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

jonrohan
Copy link
Member

@jonrohan jonrohan commented May 20, 2025

Changelog

New

Changed

Convert internal component _VisuallyHidden to CSS module styling

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

Copy link

changeset-bot bot commented May 20, 2025

🦋 Changeset detected

Latest commit: 9e02a81

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@primer/react Minor

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 staff Author is a staff member integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels May 20, 2025
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 temporarily deployed to storybook-preview-6083 May 20, 2025 18:29 Inactive
Copy link
Contributor

github-actions bot commented May 20, 2025

size-limit report 📦

Path Size
packages/react/dist/browser.esm.js 95.24 KB (-0.03% 🔽)
packages/react/dist/browser.umd.js 95.29 KB (-0.03% 🔽)

@github-actions github-actions bot requested a deployment to storybook-preview-6083 May 20, 2025 18:38 Abandoned
@github-actions github-actions bot temporarily deployed to storybook-preview-6083 May 20, 2025 18:51 Inactive
@github-actions github-actions bot temporarily deployed to storybook-preview-6083 May 20, 2025 19:09 Inactive
@jonrohan jonrohan marked this pull request as ready for review May 20, 2025 21:24
@Copilot Copilot AI review requested due to automatic review settings May 20, 2025 21:24
@jonrohan jonrohan requested a review from a team as a code owner May 20, 2025 21:24
@jonrohan jonrohan requested a review from joshblack May 20, 2025 21:24
Copy link
Contributor

@Copilot 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 replaces the styled‐component implementation of the internal _VisuallyHidden component with a CSS module and updates snapshots to use the new InternalVisuallyHidden class.

  • Migrates _VisuallyHidden from styled.span to a BoxWithFallback + CSS module.
  • Introduces _VisuallyHidden.module.css with the visually‐hidden styles.
  • Regenerates snapshots across several components to reference the new CSS class.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/react/src/_VisuallyHidden.tsx Replaced styled‐component implementation with CSS module and BoxWithFallback.
packages/react/src/_VisuallyHidden.module.css New CSS module defining the .InternalVisuallyHidden styles.
packages/react/src/Token/tests/snapshots/Token.test.tsx.snap Updated snapshot spans to use InternalVisuallyHidden class.
packages/react/src/TextInput/snapshots/TextInput.test.tsx.snap Updated snapshot spans to use InternalVisuallyHidden class.
packages/react/src/CircleBadge/snapshots/CircleBadge.test.tsx.snap Snapshot class names updated (unrelated styled-component change).
.changeset/smooth-steaks-hug.md Adds a changeset for the minor version bump.
Comments suppressed due to low confidence (3)

packages/react/src/_VisuallyHidden.tsx:19

  • [nitpick] There are no unit tests covering the new _VisuallyHidden component; consider adding tests for both visible and hidden states to ensure the CSS module is applied correctly.
<BoxWithFallback as={as} className={clsx(...

packages/react/src/_VisuallyHidden.tsx:11

  • You reference React.ElementType and React.HTMLAttributes but never import React; please add import React from 'react' or import type {React} from 'react' to satisfy the type usage.
function VisuallyHidden({

packages/react/src/CircleBadge/snapshots/CircleBadge.test.tsx.snap:5

  • [nitpick] These CircleBadge snapshot updates seem unrelated to the _VisuallyHidden change—you may want to verify they’re intentional or revert to avoid introducing noisy snapshot diffs.
  class="sc-fUnMCh kvrJCk"

@primer-integration
Copy link

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

@primer-integration
Copy link

🟢 golden-jobs 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: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels May 21, 2025
Co-authored-by: Josh Black <joshblack@github.com>
@jonrohan jonrohan requested a review from joshblack May 21, 2025 16:26
@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 May 21, 2025
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!

Co-authored-by: Josh Black <joshblack@github.com>
@github-actions github-actions bot added integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm and removed integration-tests: recommended This change needs to be tested for breaking changes. See https://arc.net/l/quote/tdmpakpm labels May 21, 2025
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!

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.

2 participants