[a11y] WCAG 4.1.2 — add label prop to Button primitive and enforce accessible names#3556
Open
rosanusi wants to merge 1 commit into
Open
[a11y] WCAG 4.1.2 — add label prop to Button primitive and enforce accessible names#3556rosanusi wants to merge 1 commit into
rosanusi wants to merge 1 commit into
Conversation
…cessible names Adds a `label` prop to the Button/anchor primitive that renders as `aria-label`, plus a dev-time `onMount` check that warns (prod) or throws (dev) when a button is rendered without any accessible name. Updates seven consumer call-sites and adds the `configure-columns` i18n key. A11y-Audit-Ref: 4.1.2-button-anchor-empty Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
label?: stringprop toBasePropsin the Button primitive (src/lib/holocene/button.svelte) rendered asaria-labelon both the<a>anchor branch and<button>branchonMountcheck that throws (dev) orconsole.errors (prod) when a button is rendered without any accessible name (nolabel,aria-label,aria-labelledby,title, slot text, leading/trailing icon, or count badge)configure-columnsi18n key tosrc/lib/i18n/locales/en/common.tsAffected files
src/lib/holocene/button.sveltesrc/lib/i18n/locales/en/common.tssrc/lib/components/workflow/start-workflow-button.sveltesrc/lib/components/standalone-activities/start-activity-button.sveltesrc/lib/components/workflow/workflows-summary-configurable-table.sveltesrc/lib/pages/schedule-view.sveltesrc/lib/pages/schedules.svelteTest plan
<Button>with no name source — confirm it throws; addlabel="…"— confirm no throw<Button href="…">with no name source — confirm same enforcement fires<Button count={3}>— confirm enforcement does not fire (count provides a numeric name)pnpm checkpasses (no new type errors beyond pre-existing$$_$$slot interop errors on main)A11y-Audit-Ref: 4.1.2-button-anchor-empty
🤖 Generated with Claude Code