@@ -11,6 +11,7 @@ import {
1111import { isRTL , __ } from '@wordpress/i18n' ;
1212import { chevronLeft , chevronRight } from '@wordpress/icons' ;
1313import clsx from 'clsx' ;
14+ import { useId } from 'react' ;
1415import { useAnalytics } from '../../app/analytics' ;
1516import { Card , CardBody } from '../../components/card' ;
1617import { isOnboardingUrl , isRelativeUrl } from '../../utils/url' ;
@@ -29,7 +30,7 @@ export interface OverviewCardProps {
2930 value : number ;
3031 max : number ;
3132 label : string ;
32- ariaLabel ?: string ;
33+ ariaValueText ?: string ;
3334 variant ?: ComponentProps < typeof CircularProgressBar > [ 'variant' ] ;
3435 } ;
3536 intent ?: 'activate' | 'upsell' | 'success' | 'warning' | 'error' ;
@@ -75,6 +76,7 @@ export default function OverviewCard( {
7576 onClick,
7677} : OverviewCardProps ) {
7778 const { recordTracksEvent } = useAnalytics ( ) ;
79+ const descriptionId = useId ( ) ;
7880
7981 const renderHeading = ( ) => {
8082 if ( isLoading ) {
@@ -165,6 +167,7 @@ export default function OverviewCard( {
165167 { renderHeading ( ) }
166168 </ Heading >
167169 < Text
170+ id = { descriptionId }
168171 intent = { intent === 'warning' || intent === 'error' ? intent : undefined }
169172 variant = { intent === 'warning' || intent === 'error' ? undefined : 'muted' }
170173 lineHeight = "16px"
@@ -177,7 +180,8 @@ export default function OverviewCard( {
177180 </ VStack >
178181 { progress && (
179182 < CircularProgressBar
180- ariaLabel = { progress . ariaLabel }
183+ ariaLabelledBy = { description ? descriptionId : undefined }
184+ ariaValueText = { progress . ariaValueText }
181185 currentStep = { progress . value }
182186 numberOfSteps = { progress . max }
183187 size = { 80 }
0 commit comments