diff --git a/renderers/angular/src/lib/catalog/default.ts b/renderers/angular/src/lib/catalog/default.ts index 15758ba66..0b4af8d75 100644 --- a/renderers/angular/src/lib/catalog/default.ts +++ b/renderers/angular/src/lib/catalog/default.ts @@ -61,6 +61,7 @@ export const DEFAULT_CATALOG: Catalog = { return [ inputBinding('url', () => properties.url), inputBinding('usageHint', () => properties.usageHint), + inputBinding('altText', () => properties.altText ?? null), ]; }, }, diff --git a/renderers/angular/src/lib/catalog/icon.ts b/renderers/angular/src/lib/catalog/icon.ts index 54309ec14..01f1e774f 100644 --- a/renderers/angular/src/lib/catalog/icon.ts +++ b/renderers/angular/src/lib/catalog/icon.ts @@ -20,6 +20,10 @@ import * as Primitives from '@a2ui/web_core/types/primitives'; @Component({ selector: 'a2ui-icon', + host: { + 'aria-hidden': 'true', + tabindex: '-1', + }, changeDetection: ChangeDetectionStrategy.Eager, styles: ` :host { diff --git a/renderers/angular/src/lib/catalog/image.ts b/renderers/angular/src/lib/catalog/image.ts index 7cd9c9a4a..c604f5f4f 100644 --- a/renderers/angular/src/lib/catalog/image.ts +++ b/renderers/angular/src/lib/catalog/image.ts @@ -40,10 +40,11 @@ import { DynamicComponent } from '../rendering/dynamic-component'; `, template: ` @let resolvedUrl = this.resolvedUrl(); + @let resolvedAltText = this.resolvedAltText(); @if (resolvedUrl) {
- +
} `, @@ -51,8 +52,13 @@ import { DynamicComponent } from '../rendering/dynamic-component'; export class Image extends DynamicComponent { readonly url = input.required(); readonly usageHint = input.required(); + readonly altText = input.required(); protected readonly resolvedUrl = computed(() => this.resolvePrimitive(this.url())); + protected readonly resolvedAltText = computed(() => { + const raw = this.altText(); + return raw ? this.resolvePrimitive(raw) : ''; + }); protected classes = computed(() => { const usageHint = this.usageHint(); diff --git a/renderers/web_core/src/v0_8/types/components.ts b/renderers/web_core/src/v0_8/types/components.ts index d0703d672..35cbf6598 100644 --- a/renderers/web_core/src/v0_8/types/components.ts +++ b/renderers/web_core/src/v0_8/types/components.ts @@ -59,6 +59,7 @@ export interface Image { | "largeFeature" | "header"; fit?: "contain" | "cover" | "fill" | "none" | "scale-down"; + altText?: StringValue; } export interface Icon {