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

feat(ActionRequirement): improve accessibility #851

7 changes: 4 additions & 3 deletions packages/yoga/src/ActionRequirement/web/ActionRequirement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,12 @@ function ActionRequirement(props) {
defineCompoundComponents();
return (
<StyledActionRequirement {...props}>
{illustration && <BoxIllustration>{illustration}</BoxIllustration>}

{illustration && (
<BoxIllustration aria-hidden>{illustration}</BoxIllustration>
)}
<Content>
{titleAsTextDisplay ? (
<Text.Display2>{title}</Text.Display2>
<Text.Display2 as="h1">{title}</Text.Display2>
) : (
<Title>{title}</Title>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Box from '../../Box';
import Button from '../../Button';

export const Title = styled(Text.H4).attrs({
as: 'p',
as: 'h1',
bold: true,
})`
${({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,11 @@ exports[`<ActionRequirement /> should default match snapshot 1`] = `
<div
class="c1"
>
<p
<h1
class="c2"
>
title
</p>
</h1>
<p
class="c3"
color="deep"
Expand Down Expand Up @@ -271,11 +271,11 @@ exports[`<ActionRequirement /> should match snapshot with list 1`] = `
<div
class="c1"
>
<p
<h1
class="c2"
>
title
</p>
</h1>
<p
class="c3"
color="deep"
Expand Down Expand Up @@ -418,11 +418,11 @@ exports[`<ActionRequirement /> should match snapshot with text display 1`] = `
<div
class="c1"
>
<p
<h1
class="c2"
>
title
</p>
</h1>
<p
class="c3"
color="deep"
Expand Down