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

Accessibility update / Tested for frontend-subsidiepunt #508

Merged
merged 10 commits into from
Sep 5, 2024
8 changes: 7 additions & 1 deletion addon/components/au-main-header.gts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export interface AuMainHeaderSignature {
contactRoute?: string;
contactLabel?: string;
homeRoute?: string;
navigationAriaLabel?: string;
};
Blocks: {
default: [];
Expand All @@ -28,6 +29,11 @@ export default class AuMainHeader extends Component<AuMainHeaderSignature> {
else return 'Contacteer ons';
}

get navigationAriaLabel() {
if (this.args.navigationAriaLabel) return this.args.navigationAriaLabel;
else return 'Informatie en instellingen';
}

@action
headerLinkFocus() {
document.querySelector<HTMLElement>('#main')?.focus();
Expand Down Expand Up @@ -56,7 +62,7 @@ export default class AuMainHeader extends Component<AuMainHeaderSignature> {
</a>
</div>
<nav
aria-label="Informatie en instellingen"
aria-label="{{this.navigationAriaLabel}}"
Dietr marked this conversation as resolved.
Show resolved Hide resolved
class="au-c-main-header__actions"
>
<ul class="au-c-list-horizontal">
Expand Down
7 changes: 7 additions & 0 deletions stories/5-components/Brand/AuMainHeader.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ export default {
description:
'Set the label for the contact link (default: Contacteer ons)',
},
navigationAriaLabel: {
control: 'text',
description:
'Set the aria-label for the navigation (default: Informatie en instellingen)',
},
},
parameters: {
layout: 'padded',
Expand All @@ -32,6 +37,7 @@ const Template = (args) => ({
@homeRoute={{this.homeRoute}}
@contactRoute={{this.contactRoute}}
@contactLabel={{this.contactLabel}}
@navigationAriaLabel={{this.navigationAriaLabel}}
>
<AuDropdown @title="Demo dropdown" @alignment="right" role="menu">
<AuButton @skin="link" @icon="logout" role="menuitem">
Expand All @@ -49,4 +55,5 @@ Component.args = {
homeRoute: 'home',
contactRoute: 'contact',
contactLabel: 'Contacteer ons',
navigationAriaLabel: 'Informatie en instellingen',
};
Loading