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

fix: use role="img" for VegaVisualisation #2684

Merged
merged 1 commit into from
Dec 27, 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
5 changes: 5 additions & 0 deletions .changeset/honest-tables-press.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@utrecht/component-library-react": patch
---

Fix `role="img"` for VegaVizualisation.
10 changes: 5 additions & 5 deletions apps/experiments/scaled-down.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,30 +29,30 @@ <h2>Interactief</h2>
</div>
<h2>Utrecht</h2>
<div class="example-small-root">
<div class="example-small-root__contents" inert aria-hidden="true" role="image">
<div class="example-small-root__contents" inert aria-hidden="true" role="img">
<render-template ref="foo" class="utrecht-theme theme-container"></render-template>
</div>
</div>
<h2>Purmerend</h2>
<div class="example-small-root">
<div class="example-small-root__contents" inert aria-hidden="true" role="image">
<div class="example-small-root__contents" inert aria-hidden="true" role="img">
<render-template ref="foo" class="purmerend-theme theme-container"></render-template>
</div>
</div>
<h2>Rotterdam</h2>
<div class="example-small-root" inert aria-hidden="true" role="image">
<div class="example-small-root" inert aria-hidden="true" role="img">
<div class="example-small-root__contents">
<render-template ref="foo" class="rods-theme theme-container"></render-template>
</div>
</div>
<h2>Rijkshuisstijl</h2>
<div class="example-small-root" inert aria-hidden="true" role="image">
<div class="example-small-root" inert aria-hidden="true" role="img">
<div class="example-small-root__contents">
<render-template ref="foo" class="rijkshuisstijl-theme theme-container"></render-template>
</div>
</div>
<h2>Amsterdam</h2>
<div class="example-small-root" inert aria-hidden="true" role="image">
<div class="example-small-root" inert aria-hidden="true" role="img">
<div class="example-small-root__contents">
<render-template ref="foo" class="ams-theme theme-container"></render-template>
</div>
Expand Down
8 changes: 4 additions & 4 deletions packages/component-library-pdf/src/Logo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('Logo', () => {
id: 'pdf-logo',
render: () => (
<Logo>
<LogoImage role="image" aria-label="logo gemeente Utrecht" />
<LogoImage role="img" aria-label="logo gemeente Utrecht" />
</Logo>
),
});
Expand All @@ -32,12 +32,12 @@ describe('Logo', () => {
expect(sha256).toBe('TODO');
});

it('renders a text alternative for `<svg role="image" aria-label="Text alternative">`', async () => {
it('renders a text alternative for `<svg role="img" aria-label="Text alternative">`', async () => {
const { sha256 } = await renderPdf({
id: 'pdf-logo-svg',
render: () => (
<Logo>
<LogoImage role="image" aria-label="logo gemeente Utrecht" />
<LogoImage role="img" aria-label="logo gemeente Utrecht" />
</Logo>
),
});
Expand All @@ -51,7 +51,7 @@ describe('Logo', () => {
id: 'pdf-logo-caption',
render: () => (
<Logo caption="gemeente Utrecht">
<LogoImage role="image" aria-label="logo gemeente Utrecht" />
<LogoImage role="img" aria-label="logo gemeente Utrecht" />
</Logo>
),
});
Expand Down
2 changes: 1 addition & 1 deletion packages/component-library-react/src/VegaVisualization.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export const VegaVisualization = ({
...restProps
}: VegaVisualizationProps) => {
return (
<div className={clsx('utrecht-vega-visualization', className)} role="image" aria-label={label}>
<div className={clsx('utrecht-vega-visualization', className)} role="img" aria-label={label}>
<div aria-hidden={true}>
<Vega {...restProps} actions={actions} renderer={'svg'} config={{ ...defaultConfig, ...config }} />
</div>
Expand Down
Loading