Skip to content

Commit d1d996f

Browse files
committed
provide an argument for the main header nav aria-label
1 parent ad9a376 commit d1d996f

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

addon/components/au-main-header.gts

+7-1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ export interface AuMainHeaderSignature {
1515
contactRoute?: string;
1616
contactLabel?: string;
1717
homeRoute?: string;
18+
navigationAriaLabel?: string;
1819
};
1920
Blocks: {
2021
default: [];
@@ -28,6 +29,11 @@ export default class AuMainHeader extends Component<AuMainHeaderSignature> {
2829
else return 'Contacteer ons';
2930
}
3031

32+
get navigationAriaLabel() {
33+
if (this.args.navigationAriaLabel) return this.args.navigationAriaLabel;
34+
else return 'Informatie en instellingen';
35+
}
36+
3137
@action
3238
headerLinkFocus() {
3339
document.querySelector<HTMLElement>('#main')?.focus();
@@ -56,7 +62,7 @@ export default class AuMainHeader extends Component<AuMainHeaderSignature> {
5662
</a>
5763
</div>
5864
<nav
59-
aria-label="Informatie en instellingen"
65+
aria-label="{{this.navigationAriaLabel}}"
6066
class="au-c-main-header__actions"
6167
>
6268
<ul class="au-c-list-horizontal">

stories/5-components/Brand/AuMainHeader.stories.js

+7
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ export default {
1818
description:
1919
'Set the label for the contact link (default: Contacteer ons)',
2020
},
21+
navigationAriaLabel: {
22+
control: 'text',
23+
description:
24+
'Set the aria-label for the navigation (default: Informatie en instellingen)',
25+
},
2126
},
2227
parameters: {
2328
layout: 'padded',
@@ -32,6 +37,7 @@ const Template = (args) => ({
3237
@homeRoute={{this.homeRoute}}
3338
@contactRoute={{this.contactRoute}}
3439
@contactLabel={{this.contactLabel}}
40+
@navigationAriaLabel={{this.navigationAriaLabel}}
3541
>
3642
<AuDropdown @title="Demo dropdown" @alignment="right" role="menu">
3743
<AuButton @skin="link" @icon="logout" role="menuitem">
@@ -49,4 +55,5 @@ Component.args = {
4955
homeRoute: 'home',
5056
contactRoute: 'contact',
5157
contactLabel: 'Contacteer ons',
58+
navigationAriaLabel: 'Informatie en instellingen',
5259
};

0 commit comments

Comments
 (0)