@@ -9,6 +9,7 @@ import { CCardBody } from '../card/CCardBody'
9
9
10
10
export interface CWidgetDropdownProps extends HTMLAttributes < HTMLDivElement > {
11
11
action ?: string | ReactNode
12
+ change ?: string | ReactNode
12
13
chart ?: string | ReactNode
13
14
/**
14
15
* A string of all className you want applied to the base component. [docs]
@@ -25,7 +26,7 @@ export interface CWidgetDropdownProps extends HTMLAttributes<HTMLDivElement> {
25
26
}
26
27
27
28
export const CWidgetDropdown = forwardRef < HTMLDivElement , CWidgetDropdownProps > (
28
- ( { action, chart, className, color, title, value, ...rest } , ref ) => {
29
+ ( { action, change , chart, className, color, title, value, ...rest } , ref ) => {
29
30
const _className = classNames (
30
31
{ [ `bg-${ color } ` ] : color , 'text-high-emphasis-inverse' : color } ,
31
32
className ,
@@ -35,7 +36,11 @@ export const CWidgetDropdown = forwardRef<HTMLDivElement, CWidgetDropdownProps>(
35
36
< CCard className = { _className } { ...rest } ref = { ref } >
36
37
< CCardBody className = "pb-0 d-flex justify-content-between align-items-start" >
37
38
< div >
38
- { value && < div className = "fs-4 fw-semibold" > { value } </ div > }
39
+ { value && (
40
+ < div className = "fs-4 fw-semibold" >
41
+ { value } { change && < span className = "fs-6 fw-normal" > { change } </ span > }
42
+ </ div >
43
+ ) }
39
44
{ title && < div > { title } </ div > }
40
45
</ div >
41
46
{ action }
@@ -48,6 +53,7 @@ export const CWidgetDropdown = forwardRef<HTMLDivElement, CWidgetDropdownProps>(
48
53
49
54
CWidgetDropdown . propTypes = {
50
55
action : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . node ] ) ,
56
+ change : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . node ] ) ,
51
57
chart : PropTypes . oneOfType ( [ PropTypes . string , PropTypes . node ] ) ,
52
58
className : PropTypes . string ,
53
59
color : colorPropType ,
0 commit comments