@@ -284,19 +284,24 @@ const CdcDataBite = (props: CdcDataBiteProps) => {
284284
285285 return typeof label === 'string' ? label . trim ( ) : ''
286286 } , [ trendIndicator ?. downLabel , trendIndicator ?. upLabel , trendResolution . arrowType , trendResolution . state ] )
287+ const resolvedTrendFooterLabel =
288+ typeof trendIndicator ?. trendLabel === 'string' ? trendIndicator . trendLabel . trim ( ) : ''
287289
288290 const renderTrendArrow = ( { wrapperClassName = '' } = { } ) => {
289291 if ( trendResolution . state !== 'resolved' || ! trendResolution . arrowType ) {
290292 return null
291293 }
292294 const ariaLabel = `Trend ${ trendResolution . arrowType } ${ resolvedTrendLabel ? `: ${ resolvedTrendLabel } ` : '' } `
295+ const resolvedWrapperClassName = [ wrapperClassName , resolvedTrendLabel ? 'cove-trend-arrow__wrap--with-label' : '' ]
296+ . filter ( Boolean )
297+ . join ( ' ' )
293298
294299 return (
295300 < TrendArrow
296301 arrowType = { trendResolution . arrowType }
297302 label = { resolvedTrendLabel }
298303 ariaLabel = { ariaLabel }
299- wrapperClassName = { wrapperClassName }
304+ wrapperClassName = { resolvedWrapperClassName }
300305 />
301306 )
302307 }
@@ -634,7 +639,7 @@ const CdcDataBite = (props: CdcDataBiteProps) => {
634639 const showBite = undefined !== dataColumn && undefined !== dataFunction
635640 const isTp5 = showBite && biteStyle === 'tp5'
636641 const hasTrendArrow = trendResolution . state === 'resolved' && ! ! trendResolution . arrowType
637- const shouldUseTrendBelow = Boolean ( hasTrendArrow && resolvedTrendLabel )
642+ const shouldUseTrendBelow = Boolean ( hasTrendArrow && ( resolvedTrendLabel || resolvedTrendFooterLabel ) )
638643 const shouldUseContentBelow = Boolean ( config . visual ?. useWrap || shouldUseTrendBelow )
639644 const tp5Value = isTp5 ? calculateDataBite ( true ) : ''
640645 const tp5BodyLayoutClasses = [
@@ -711,6 +716,9 @@ const CdcDataBite = (props: CdcDataBiteProps) => {
711716 wrapperClassName : 'cove-trend-arrow__wrap--below'
712717 } ) }
713718 </ span >
719+ { resolvedTrendFooterLabel && (
720+ < span className = 'cdc-callout__trend-footer-label' > { resolvedTrendFooterLabel } </ span >
721+ ) }
714722 </ div >
715723 ) }
716724 </ div >
0 commit comments