@@ -4,7 +4,7 @@ import iconDown from '@ui5/webcomponents-icons/dist/down.js';
44import iconUp from '@ui5/webcomponents-icons/dist/up.js' ;
55import { useI18nBundle , useStylesheet } from '@ui5/webcomponents-react-base' ;
66import { clsx } from 'clsx' ;
7- import type { MouseEventHandler , ReactElement , ReactNode } from 'react' ;
7+ import type { HTMLAttributes , MouseEventHandler , ReactElement , ReactNode } from 'react' ;
88import { cloneElement , forwardRef , useId } from 'react' ;
99import { DeviationIndicator , ValueColor } from '../../enums/index.js' ;
1010import {
@@ -27,6 +27,14 @@ export interface AnalyticalCardHeaderPropTypes extends CommonProps {
2727 * The title of the card
2828 */
2929 titleText ?: string ;
30+ /**
31+ * Determines the ARIA level of the `titleText`.
32+ *
33+ * __Note:__ Defining a `titleTextLevel` will apply the `aria-level` attribute with a value from 1 to 6.
34+ *
35+ * @default 3
36+ */
37+ titleTextLevel ?: HTMLAttributes < HTMLSpanElement > [ 'aria-level' ] ;
3038 /**
3139 * The subtitle of the card
3240 */
@@ -98,6 +106,7 @@ const deviationMap = new Map<AnalyticalCardHeaderPropTypes['trend'], any>([
98106export const AnalyticalCardHeader = forwardRef < HTMLDivElement , AnalyticalCardHeaderPropTypes > ( ( props , ref ) => {
99107 const {
100108 titleText,
109+ titleTextLevel = 3 ,
101110 subtitleText,
102111 value,
103112 scale,
@@ -182,7 +191,7 @@ export const AnalyticalCardHeader = forwardRef<HTMLDivElement, AnalyticalCardHea
182191 < div >
183192 < div className = { classNames . headerTitles } >
184193 < div className = { classNames . headerFirstLine } >
185- < span role = "heading" aria-level = { 3 } className = { classNames . headerText } id = { `${ headerId } -title` } >
194+ < span role = "heading" aria-level = { titleTextLevel } className = { classNames . headerText } id = { `${ headerId } -title` } >
186195 { titleText }
187196 </ span >
188197 { status && < span className = { classNames . status } > { status } </ span > }
0 commit comments