@@ -40,7 +40,8 @@ export interface NotificationBadgeProps extends DOMProps, AriaLabelingProps, Sty
4040}
4141
4242interface NotificationBadgeContextProps extends Partial < NotificationBadgeProps > {
43- isDisabled ?: boolean
43+ isDisabled ?: boolean ,
44+ staticColor ?: 'black' | 'white' | 'auto'
4445}
4546
4647export const NotificationBadgeContext = createContext < ContextValue < Partial < NotificationBadgeContextProps > , DOMRefValue < HTMLDivElement > > > ( null ) ;
@@ -53,6 +54,7 @@ const badge = style({
5354 font : 'control' ,
5455 color : {
5556 default : 'white' ,
57+ isStaticColor : 'auto' ,
5658 forcedColors : 'ButtonText'
5759 } ,
5860 fontSize : {
@@ -76,6 +78,7 @@ const badge = style({
7678 alignItems : 'center' ,
7779 backgroundColor : {
7880 default : 'accent' ,
81+ isStaticColor : 'transparent-overlay-1000' ,
7982 forcedColors : 'ButtonFace'
8083 } ,
8184 height : {
@@ -102,7 +105,7 @@ const badge = style({
102105 isIndicatorOnly : 'square' ,
103106 isSingleDigit : 'square'
104107 } ,
105- width : 'fit ' ,
108+ width : 'max ' ,
106109 paddingX : {
107110 isDoubleDigit : 'edge-to-text'
108111 } ,
@@ -119,6 +122,7 @@ export const NotificationBadge = forwardRef(function Badge(props: NotificationBa
119122 size = 'S' ,
120123 value,
121124 isDisabled = false ,
125+ staticColor,
122126 ...otherProps
123127 } = props as NotificationBadgeContextProps ;
124128 let domRef = useDOMRef ( ref ) ;
@@ -159,7 +163,7 @@ export const NotificationBadge = forwardRef(function Badge(props: NotificationBa
159163 { ...filterDOMProps ( otherProps , { labelable : true } ) }
160164 role = { ariaLabel && 'img' }
161165 aria-label = { ariaLabel }
162- className = { ( props . UNSAFE_className || '' ) + badge ( { size, isIndicatorOnly, isSingleDigit, isDoubleDigit, isDisabled} , props . styles ) }
166+ className = { ( props . UNSAFE_className || '' ) + badge ( { size, isIndicatorOnly, isSingleDigit, isDoubleDigit, isDisabled, isStaticColor : ! ! staticColor } , props . styles ) }
163167 style = { props . UNSAFE_style }
164168 ref = { domRef } >
165169 { formattedValue }
0 commit comments