@@ -4,7 +4,7 @@ import iconDown from '@ui5/webcomponents-icons/dist/down.js';
4
4
import iconUp from '@ui5/webcomponents-icons/dist/up.js' ;
5
5
import { useI18nBundle , useStylesheet } from '@ui5/webcomponents-react-base' ;
6
6
import { clsx } from 'clsx' ;
7
- import type { MouseEventHandler , ReactElement , ReactNode } from 'react' ;
7
+ import type { HTMLAttributes , MouseEventHandler , ReactElement , ReactNode } from 'react' ;
8
8
import { cloneElement , forwardRef , useId } from 'react' ;
9
9
import { DeviationIndicator , ValueColor } from '../../enums/index.js' ;
10
10
import {
@@ -27,6 +27,14 @@ export interface AnalyticalCardHeaderPropTypes extends CommonProps {
27
27
* The title of the card
28
28
*/
29
29
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' ] ;
30
38
/**
31
39
* The subtitle of the card
32
40
*/
@@ -98,6 +106,7 @@ const deviationMap = new Map<AnalyticalCardHeaderPropTypes['trend'], any>([
98
106
export const AnalyticalCardHeader = forwardRef < HTMLDivElement , AnalyticalCardHeaderPropTypes > ( ( props , ref ) => {
99
107
const {
100
108
titleText,
109
+ titleTextLevel = 3 ,
101
110
subtitleText,
102
111
value,
103
112
scale,
@@ -182,7 +191,7 @@ export const AnalyticalCardHeader = forwardRef<HTMLDivElement, AnalyticalCardHea
182
191
< div >
183
192
< div className = { classNames . headerTitles } >
184
193
< 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` } >
186
195
{ titleText }
187
196
</ span >
188
197
{ status && < span className = { classNames . status } > { status } </ span > }
0 commit comments