Skip to content

refactor(core): consolidate inline visually-hidden styles into VisuallyHidden primitive#3491

Draft
cixzhang wants to merge 1 commit into
mainfrom
navi/refactor/vh-consolidate
Draft

refactor(core): consolidate inline visually-hidden styles into VisuallyHidden primitive#3491
cixzhang wants to merge 1 commit into
mainfrom
navi/refactor/vh-consolidate

Conversation

@cixzhang

@cixzhang cixzhang commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

What

Consolidates five inline visually-hidden style blocks into the shared VisuallyHidden primitive. Each of these was a screen-reader-only element that is always hidden (loading/status announcements, new-tab context, an always-hidden label), so it maps cleanly onto the primitive with no behavior change.

  • Button — loading-state live region (role="status" aria-live="polite")
  • Link — new-tab announcement text
  • ProgressBar — the always-hidden label branch (the conditional isLabelHidden usage that mixes with styles.label is intentionally left untouched, so its local style block stays)
  • Switch — loading announcement (role="status")
  • TextArea — character-counter live region (aria-live="polite")

How

  • Replaced each <span {...stylex.props(styles.visuallyHidden|srOnly)}> with <VisuallyHidden>, forwarding the same role / aria-live / id props (all pass through BaseProps).
  • Removed the now-unused local clip-style block from each file (kept in ProgressBar, which still needs it for the conditional label case).

Verification

  • pnpm -F @astryxdesign/core typecheck — pass (exit 0)
  • ESLint on all five changed files — clean (exit 0)
  • Vitest for Button / Link / ProgressBar / Switch / TextArea — 193 tests passed

@vercel

vercel Bot commented Jul 3, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
astryx Ready Ready Preview, Comment Jul 3, 2026 6:22am

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jul 3, 2026
@github-actions

github-actions Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

PR Analysis Report

📚 Storybook Preview

View Storybook for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

🧪 Sandbox Preview

View Sandbox for this PR
GitHub Pages may take up to a minute to hydrate after deploy.

No new or modified components detected.

Bundle Size Summary

Package Size (ESM) Size (CJS) Gzipped
@astryxdesign/core N/A 4.6KB 0B

Accessibility Audit

Status: No accessibility violations detected.


Generated by PR Enrichment workflow | Storybook | Sandbox | View full report

github-actions Bot added a commit that referenced this pull request Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants