@@ -9,9 +9,11 @@ import { inlineGlow } from './shared/animation';
99type Status = 'default' | 'positive' | 'negative' | 'warning' | 'neutral' | 'link' | 'inverse' ;
1010type Size = 'small' | 'large' ;
1111type Alignment = 'left' | 'center' | 'right' ;
12+ type Color = keyof typeof color ;
1213
1314interface CountProps {
1415 status : Status ;
16+ countColor : Color ;
1517}
1618
1719const Count = styled . div < CountProps > `
@@ -55,6 +57,12 @@ const Count = styled.div<CountProps>`
5557 css `
5658 color : rgba (255 , 255 , 255 , 0.7 );
5759 ` } ;
60+ ${ ( props ) =>
61+ props . status === 'default' &&
62+ props . countColor &&
63+ css `
64+ color : ${ color [ props . countColor ] } ;
65+ ` } ;
5866
5967 span {
6068 display: inline-block;
@@ -169,6 +177,7 @@ export interface CardinalProps {
169177 countLink ?: string ;
170178 text : string ;
171179 status ?: Status ;
180+ countColor ?: Color ;
172181 noPlural ?: boolean ;
173182 CountWrapper ?: React . ElementType ;
174183 TextWrapper ?: React . ElementType ;
@@ -187,6 +196,7 @@ export const Cardinal: FunctionComponent<CardinalProps> = ({
187196 text,
188197 noPlural,
189198 status,
199+ countColor,
190200 CountWrapper,
191201 TextWrapper,
192202 alignment,
@@ -220,7 +230,7 @@ export const Cardinal: FunctionComponent<CardinalProps> = ({
220230 { ...events }
221231 { ...props }
222232 >
223- < Count status = { status } >
233+ < Count status = { status } countColor = { countColor } >
224234 < CountWrapper > { countValue } </ CountWrapper >
225235 </ Count >
226236 < Text >
@@ -242,6 +252,7 @@ Cardinal.defaultProps = {
242252 active : false ,
243253 size : 'large' as Size ,
244254 status : 'default' as Status ,
255+ countColor : null ,
245256 count : '000' ,
246257 countLink : null ,
247258 noPlural : false ,
0 commit comments