@@ -40,7 +40,8 @@ export interface NotificationBadgeProps extends DOMProps, AriaLabelingProps, Sty
40
40
}
41
41
42
42
interface NotificationBadgeContextProps extends Partial < NotificationBadgeProps > {
43
- isDisabled ?: boolean
43
+ isDisabled ?: boolean ,
44
+ staticColor ?: 'black' | 'white' | 'auto'
44
45
}
45
46
46
47
export const NotificationBadgeContext = createContext < ContextValue < Partial < NotificationBadgeContextProps > , DOMRefValue < HTMLDivElement > > > ( null ) ;
@@ -53,6 +54,7 @@ const badge = style({
53
54
font : 'control' ,
54
55
color : {
55
56
default : 'white' ,
57
+ isStaticColor : 'auto' ,
56
58
forcedColors : 'ButtonText'
57
59
} ,
58
60
fontSize : {
@@ -76,6 +78,7 @@ const badge = style({
76
78
alignItems : 'center' ,
77
79
backgroundColor : {
78
80
default : 'accent' ,
81
+ isStaticColor : 'transparent-overlay-1000' ,
79
82
forcedColors : 'ButtonFace'
80
83
} ,
81
84
height : {
@@ -102,7 +105,7 @@ const badge = style({
102
105
isIndicatorOnly : 'square' ,
103
106
isSingleDigit : 'square'
104
107
} ,
105
- width : 'fit ' ,
108
+ width : 'max ' ,
106
109
paddingX : {
107
110
isDoubleDigit : 'edge-to-text'
108
111
} ,
@@ -119,6 +122,7 @@ export const NotificationBadge = forwardRef(function Badge(props: NotificationBa
119
122
size = 'S' ,
120
123
value,
121
124
isDisabled = false ,
125
+ staticColor,
122
126
...otherProps
123
127
} = props as NotificationBadgeContextProps ;
124
128
let domRef = useDOMRef ( ref ) ;
@@ -159,7 +163,7 @@ export const NotificationBadge = forwardRef(function Badge(props: NotificationBa
159
163
{ ...filterDOMProps ( otherProps , { labelable : true } ) }
160
164
role = { ariaLabel && 'img' }
161
165
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 ) }
163
167
style = { props . UNSAFE_style }
164
168
ref = { domRef } >
165
169
{ formattedValue }
0 commit comments