Skip to content
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

va-process-list-item: move status eyebrow into header so that it gets read by screen readers #1437

Merged
merged 5 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ describe('va-process-list-item', () => {
expect(element).toEqualHtml(`
<va-process-list-item class="hydrated usa-process-list__item" role="listitem" header="Heading">
<!---->
<h3 class="usa-process-list__heading" part="header">Heading</h3>
<h3 class="usa-process-list__heading" part="header">
<div>Heading</div>
</h3>
<p>Some content</p>
</va-process-list-item>
`);
Expand All @@ -47,7 +49,9 @@ describe('va-process-list-item', () => {
expect(element).toEqualHtml(`
<va-process-list-item class="hydrated usa-process-list__item" role="listitem" header="Heading" level="1">
<!---->
<h1 class="usa-process-list__heading" part="header">Heading</h1>
<h1 class="usa-process-list__heading" part="header">
<div>Heading</div>
</h1>
<p>Some content</p>
</va-process-list-item>
`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,16 @@ describe('va-process-list', () => {
</mock:shadow-root>
<va-process-list-item class="hydrated usa-process-list__item" header="Step one" role="listitem">
<!---->
<h3 class="usa-process-list__heading" part="header">Step one</h3>
<h3 class="usa-process-list__heading" part="header">
<div>Step one</div>
</h3>
<p>Some content</p>
</va-process-list-item>
<va-process-list-item class="hydrated usa-process-list__item" header="Step two" role="listitem">
<!---->
<h3 class="usa-process-list__heading" part="header">Step two</h3>
<h3 class="usa-process-list__heading" part="header">
<div>Step two</div>
</h3>
<p>Additional content</p>
<ul>
<li>Item one</li>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,26 @@
}

.usa-process-list__heading-eyebrow {
@extend .usa-process-list__heading; // needed for "source Sans Pro" font-family
color: var(--vads-color-base-darker);
text-transform: uppercase;
font-weight: normal;
font-size: var(--vads-font-size-source-sans-normalized);
}

va-process-list-item[pending='true'] .usa-process-list__heading {
color: var(--vads-process-list-color-text-pending-on-light);

.usa-process-list__heading-eyebrow {
color: var(--vads-color-base-darker);
}
}
va-process-list-item[active='true'] .usa-process-list__heading {
color: var(--vads-color-primary);

.usa-process-list__heading-eyebrow {
color: var(--vads-color-base-darker);
}
}

/* h6 remains as Source Sans Pro, everything else uses Bitter */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,13 @@ export class VaProcessListItem {

return (
<Host role="listitem" class='usa-process-list__item'>
{ status ?
<div class="usa-process-list__heading-eyebrow">{statusTextMap[status]}</div>
: null
}
{header ? <HeaderLevel part="header" class='usa-process-list__heading'>{header}</HeaderLevel> : null}
{header || status ? (
// aria-label hack to avoid header being read twice in voiceOver
<HeaderLevel part="header" class='usa-process-list__heading'>
{status ? <div class="usa-process-list__heading-eyebrow">{statusTextMap[status]}</div> : null}
{header ? <div>{header}</div> : null}
</HeaderLevel>
): null}
<slot/>
</Host>
)
Expand Down
Loading