Skip to content
Snippets Groups Projects
Commit b2c579da authored by Ekaterina Kondareva's avatar Ekaterina Kondareva
Browse files

aria-label for links

parent 3ec53777
No related branches found
No related tags found
No related merge requests found
...@@ -366,6 +366,7 @@ export namespace Components { ...@@ -366,6 +366,7 @@ export namespace Components {
imageAlt: string; imageAlt: string;
imageUrl: string; imageUrl: string;
isExternal: boolean; isExternal: boolean;
scLabel?: string;
textDescription: string; textDescription: string;
textTitle?: string; textTitle?: string;
url?: string; url?: string;
...@@ -1299,6 +1300,7 @@ declare namespace LocalJSX { ...@@ -1299,6 +1300,7 @@ declare namespace LocalJSX {
imageAlt?: string; imageAlt?: string;
imageUrl?: string; imageUrl?: string;
isExternal?: boolean; isExternal?: boolean;
scLabel?: string;
textDescription?: string; textDescription?: string;
textTitle?: string; textTitle?: string;
url?: string; url?: string;
......
...@@ -7,6 +7,8 @@ export interface PhaseValue { ...@@ -7,6 +7,8 @@ export interface PhaseValue {
export interface ProcessBoxLinkValue { export interface ProcessBoxLinkValue {
label: string; label: string;
url: string; url: string;
isExternal: boolean;
ariaLabel: string;
} }
import {Component, ComponentInterface, h, Prop, Watch} from '@stencil/core'; import {Component, ComponentInterface, h, Prop, Watch} from '@stencil/core';
...@@ -45,7 +47,13 @@ export class HyLargeProcessFlowPhase implements ComponentInterface { ...@@ -45,7 +47,13 @@ export class HyLargeProcessFlowPhase implements ComponentInterface {
items = linkItems.map((item, index) => { items = linkItems.map((item, index) => {
let classLinks = index == linkItemsCount - 1 ? 'phase-link last' : 'phase-link'; let classLinks = index == linkItemsCount - 1 ? 'phase-link last' : 'phase-link';
return item ? ( return item ? (
<hy-cta-link class={classLinks} link-content={item.label} sc-label={item.label} url={item.url} /> <hy-cta-link
class={classLinks}
link-content={item.label}
sc-label={item.ariaLabel}
is-external={item.isExternal}
url={item.url}
/>
) : null; ) : null;
}); });
} }
......
...@@ -2,6 +2,7 @@ export interface ShortcutLinkValue { ...@@ -2,6 +2,7 @@ export interface ShortcutLinkValue {
heading: string; heading: string;
url: string; url: string;
isExternal: boolean; isExternal: boolean;
ariaLabel: string;
} }
import {Component, ComponentInterface, h, Host, Prop, Watch} from '@stencil/core'; import {Component, ComponentInterface, h, Host, Prop, Watch} from '@stencil/core';
...@@ -57,7 +58,7 @@ export class HyShortcuts implements ComponentInterface { ...@@ -57,7 +58,7 @@ export class HyShortcuts implements ComponentInterface {
return ( return (
<div class={classLinkWrapper}> <div class={classLinkWrapper}>
<a aria-label={x.heading} class="shortcut-link" href={x.url} target={target}> <a aria-label={x.ariaLabel} class="shortcut-link" href={x.url} target={target}>
<span class={textClassAttributes}>{x.heading}</span> <span class={textClassAttributes}>{x.heading}</span>
<span class={iconClassAttributes}> <span class={iconClassAttributes}>
<hy-icon icon={'hy-icon-arrow-right'} size={28} /> <hy-icon icon={'hy-icon-arrow-right'} size={28} />
......
...@@ -5,6 +5,7 @@ export interface LinkBox { ...@@ -5,6 +5,7 @@ export interface LinkBox {
imageAlt: string; imageAlt: string;
boxUrl: string; boxUrl: string;
isExternal: boolean; isExternal: boolean;
ariaLabel: string;
} }
import {Component, ComponentInterface, Watch, Prop, h, Host} from '@stencil/core'; import {Component, ComponentInterface, Watch, Prop, h, Host} from '@stencil/core';
...@@ -75,6 +76,7 @@ export class LinkBoxList implements ComponentInterface { ...@@ -75,6 +76,7 @@ export class LinkBoxList implements ComponentInterface {
text-description={x.description} text-description={x.description}
url={x.boxUrl} url={x.boxUrl}
is-external={x.isExternal} is-external={x.isExternal}
sc-label={x.ariaLabel}
/> />
); );
})} })}
......
...@@ -14,6 +14,7 @@ export class LinkBox implements ComponentInterface { ...@@ -14,6 +14,7 @@ export class LinkBox implements ComponentInterface {
@Prop() textDescription: string = null; @Prop() textDescription: string = null;
@Prop() url?: string; @Prop() url?: string;
@Prop() isExternal: boolean = false; @Prop() isExternal: boolean = false;
@Prop() scLabel?: string;
@Prop() headerstyle: string = 'common'; @Prop() headerstyle: string = 'common';
@Element() el: HTMLElement; @Element() el: HTMLElement;
...@@ -51,7 +52,7 @@ export class LinkBox implements ComponentInterface { ...@@ -51,7 +52,7 @@ export class LinkBox implements ComponentInterface {
return [ return [
<article> <article>
<a class={classAttributes} href={this.url} target={target}> <a class={classAttributes} href={this.url} target={target} aria-label={this.scLabel}>
{this.imageUrl && ( {this.imageUrl && (
<div class="hy-link-box__image-container" style={aspectRatio}> <div class="hy-link-box__image-container" style={aspectRatio}>
<img aria-hidden="true" src={this.imageUrl} alt={this.imageAlt} /> <img aria-hidden="true" src={this.imageUrl} alt={this.imageAlt} />
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
| `imageAlt` | `image-alt` | | `string` | `null` | | `imageAlt` | `image-alt` | | `string` | `null` |
| `imageUrl` | `image-url` | | `string` | `null` | | `imageUrl` | `image-url` | | `string` | `null` |
| `isExternal` | `is-external` | | `boolean` | `false` | | `isExternal` | `is-external` | | `boolean` | `false` |
| `scLabel` | `sc-label` | | `string` | `undefined` |
| `textDescription` | `text-description` | | `string` | `null` | | `textDescription` | `text-description` | | `string` | `null` |
| `textTitle` | `text-title` | | `string` | `undefined` | | `textTitle` | `text-title` | | `string` | `undefined` |
| `url` | `url` | | `string` | `undefined` | | `url` | `url` | | `string` | `undefined` |
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment