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
20 changes: 12 additions & 8 deletions addon/components/au-main-header.gts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export interface AuMainHeaderSignature {
appTitle: string;
brandLink?: string;
contactRoute?: string;
contactLabel?: string;
homeRoute?: string;
};
Blocks: {
Expand All @@ -22,6 +23,11 @@ export interface AuMainHeaderSignature {
}

export default class AuMainHeader extends Component<AuMainHeaderSignature> {
get contactLabel() {
if (this.args.contactLabel) return this.args.contactLabel;
else return 'Contacteer ons';
}

@action
headerLinkFocus() {
document.querySelector<HTMLElement>('#main')?.focus();
Expand Down Expand Up @@ -49,7 +55,10 @@ export default class AuMainHeader extends Component<AuMainHeaderSignature> {
Naar de hoofdinhoud
</a>
</div>
<nav class="au-c-main-header__actions">
<nav
aria-label="Informatie en instellingen"
class="au-c-main-header__actions"
>
<ul class="au-c-list-horizontal">
{{#if @contactRoute}}
<li class="au-c-list-horizontal__item">
Expand All @@ -58,7 +67,7 @@ export default class AuMainHeader extends Component<AuMainHeaderSignature> {
@skin="secondary"
@icon={{QuestionCircleIcon}}
>
Contacteer ons
{{this.contactLabel}}
</AuLink>
</li>
{{/if}}
Expand All @@ -79,12 +88,7 @@ class NavigationNarrator extends Component {
}

<template>
<div
aria-live="assertive"
aria-controls="main"
aria-atomic="true"
aria-relevant="all"
>
<div aria-live="assertive" aria-atomic="true" aria-relevant="all">
<span class="au-u-hidden-visually">
{{this.activeRoute}}
</span>
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 @@ -13,6 +13,11 @@ export default {
control: 'text',
description: 'Pass a route for the contact link',
},
contactLabel: {
control: 'text',
description:
'Set the label for the contact link (default: Contacteer ons)',
},
},
parameters: {
layout: 'padded',
Expand All @@ -26,6 +31,7 @@ const Template = (args) => ({
@appTitle={{this.appTitle}}
@homeRoute={{this.homeRoute}}
@contactRoute={{this.contactRoute}}
@contactLabel={{this.contactLabel}}
>
<AuDropdown @title="Demo dropdown" @alignment="right" role="menu">
<AuButton @skin="link" @icon="logout" role="menuitem">
Expand All @@ -42,4 +48,5 @@ Component.args = {
appTitle: 'App title',
homeRoute: 'home',
contactRoute: 'contact',
contactLabel: 'Contacteer ons',
};
13 changes: 9 additions & 4 deletions stories/5-components/Navigation/AuDropdown.stories.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export default {

const Template = (args) => ({
template: hbs`
{{! template-lint-disable require-context-role }}
<AuDropdown
@title={{this.title}}
@alignment={{this.alignment}}
Expand All @@ -57,20 +58,22 @@ const Template = (args) => ({
@hideText={{this.hideText}}
@alert={{this.alert}}
@onClose={{this.onClose}}
role="menu"
>
<AuButton @skin="link" @icon="switch" role="menuitem">
Switch profile
</AuButton>
<AuButton @skin="link" @icon="logout" role="menuitem">
Afmelden
</AuButton>
</AuDropdown>`,
</AuDropdown>
{{! template-lint-enable require-context-role }}
`,
context: args,
});

const TemplateSeparator = (args) => ({
template: hbs`
{{! template-lint-disable require-context-role }}
Windvis marked this conversation as resolved.
Show resolved Hide resolved
<AuDropdown
@title={{this.title}}
@alignment={{this.alignment}}
Expand All @@ -81,7 +84,6 @@ const TemplateSeparator = (args) => ({
@hideText={{this.hideText}}
@alert={{this.alert}}
@onClose={{this.onClose}}
role="menu"
>
<AuButton @skin="link" role="menuitem">
Agendapunt toevoegen
Expand All @@ -103,9 +105,12 @@ const TemplateSeparator = (args) => ({
<AuButton @alert="true" @skin="link" @icon="bin" role="menuitem">
Verwijder
</AuButton>
</AuDropdown>`,
</AuDropdown>
{{! template-lint-enable require-context-role }}
`,
context: args,
});
/* prettier-ignore-end */

export const Component = Template.bind({});
Component.args = {
Expand Down
2 changes: 1 addition & 1 deletion styles/components/_c-data-table.scss
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@
position: relative;
text-decoration: underline;
text-decoration-color: var(--au-gray-300);
color: var(--au-gray-600);
color: var(--au-gray-700);
transition: color var(--au-transition);

&:hover {
Expand Down
4 changes: 2 additions & 2 deletions styles/components/_c-help-text.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
========================================================================== */

$au-help-text-color: var(--au-gray-900) !default;
$au-help-text-secondary-color: var(--au-gray-600) !default;
$au-help-text-tertiary-color: var(--au-gray-600) !default;
$au-help-text-secondary-color: var(--au-gray-700) !default;
$au-help-text-tertiary-color: var(--au-gray-700) !default;
$au-help-text-warning-color: var(--au-orange-700) !default;
$au-help-text-error-color: var(--au-red-700) !default;
$au-help-text-font-size: var(--au-small) !default;
Expand Down
Loading