Skip to content

Commit

Permalink
Add visually hidden text to summary list examples
Browse files Browse the repository at this point in the history
  • Loading branch information
edwardhorsford committed Jun 11, 2024
1 parent 41d858c commit 1af4ab1
Showing 1 changed file with 19 additions and 4 deletions.
23 changes: 19 additions & 4 deletions stories/Content Presentation/SummaryList.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,18 @@ export const Standard: Story = {
<SummaryList.Key>Name</SummaryList.Key>
<SummaryList.Value>Sarah Philips</SummaryList.Value>
<SummaryList.Actions>
<a href="stories#">Change</a>
<a href="#">
Change<span class="nhsuk-u-visually-hidden"> name</span>

Check failure on line 33 in stories/Content Presentation/SummaryList.stories.tsx

View workflow job for this annotation

GitHub Actions / build

Unknown property 'class' found, use 'className' instead
</a>
</SummaryList.Actions>
</SummaryList.Row>
<SummaryList.Row>
<SummaryList.Key>Date of birth</SummaryList.Key>
<SummaryList.Value>5 January 1978</SummaryList.Value>
<SummaryList.Actions>
<a href="stories#">Change</a>
<a href="#">
Change<span class="nhsuk-u-visually-hidden"> date of birth</span>

Check failure on line 42 in stories/Content Presentation/SummaryList.stories.tsx

View workflow job for this annotation

GitHub Actions / build

Unknown property 'class' found, use 'className' instead
</a>
</SummaryList.Actions>
</SummaryList.Row>
<SummaryList.Row>
Expand All @@ -49,7 +53,9 @@ export const Standard: Story = {
SE23 6FH
</SummaryList.Value>
<SummaryList.Actions>
<a href="stories#">Change</a>
<a href="#">
Change<span class="nhsuk-u-visually-hidden"> contact information</span>

Check failure on line 57 in stories/Content Presentation/SummaryList.stories.tsx

View workflow job for this annotation

GitHub Actions / build

Unknown property 'class' found, use 'className' instead
</a>
</SummaryList.Actions>
</SummaryList.Row>
<SummaryList.Row>
Expand All @@ -59,11 +65,20 @@ export const Standard: Story = {
<BodyText>[email protected]</BodyText>
</SummaryList.Value>
<SummaryList.Actions>
<a href="stories#">Change</a>
<a href="#">
Change<span class="nhsuk-u-visually-hidden"> contact details</span>

Check failure on line 69 in stories/Content Presentation/SummaryList.stories.tsx

View workflow job for this annotation

GitHub Actions / build

Unknown property 'class' found, use 'className' instead
</a>
</SummaryList.Actions>
</SummaryList.Row>
</SummaryList>
),
parameters: {
docs: {
description: {
story: 'Change links must include visually hidden text. This means a screen reader user will hear a meaningful action, like "Change name" or "Change date of birth".'
}
}
}
};

export const SummaryListWithoutActions: Story = {
Expand Down

0 comments on commit 1af4ab1

Please sign in to comment.