@@ -93,14 +93,26 @@ const defaultStyles = ({ menuWidth, size }) => ({
93
93
isDisabled,
94
94
isFocused,
95
95
isSelected,
96
- } ) => ( {
96
+ } ) => {
97
+ const getBackgroundColor = ( ) => {
98
+ if ( isDisabled ) return systemColors . SYNTH_ALERT_BG_NEUTRAL ;
99
+ if ( isSelected || isFocused ) return systemColors . SYNTH_HOVER_STATE ;
100
+ return styles . backgroundColor ;
101
+ } ;
102
+
103
+ const getHoverBackgroundColor = ( ) => {
104
+ if ( isDisabled ) return systemColors . SYNTH_ALERT_BG_NEUTRAL ;
105
+ if ( isSelected ) return systemColors . SYNTH_SELECTED_STATE_GREEN ;
106
+ return systemColors . SYNTH_HOVER_STATE ;
107
+ } ;
108
+
109
+ return {
97
110
...styles ,
98
- backgroundColor : isSelected || isFocused ?
99
- systemColors . SYNTH_HOVER_STATE : styles . backgroundColor ,
100
- color : systemColors . UX_GRAY_900 ,
111
+ backgroundColor : getBackgroundColor ( ) ,
112
+ color : isDisabled ? systemColors . SYNTH_UNSELECTED_NEUTRAL : systemColors . UX_GRAY_900 ,
101
113
fontWeight : fontWeights . light ,
102
114
fontSize : '0.875rem' ,
103
- cursor : 'pointer' ,
115
+ cursor : isDisabled ? 'default' : 'pointer' ,
104
116
105
117
':active' : {
106
118
...styles [ ':active' ] ,
@@ -110,10 +122,10 @@ const defaultStyles = ({ menuWidth, size }) => ({
110
122
111
123
':hover' : {
112
124
...styles [ ':hover' ] ,
113
- backgroundColor : isSelected ?
114
- systemColors . SYNTH_SELECTED_STATE_GREEN : systemColors . SYNTH_HOVER_STATE ,
125
+ backgroundColor : getHoverBackgroundColor ( ) ,
115
126
} ,
116
- } ) ,
127
+ } ;
128
+ } ,
117
129
} ) ;
118
130
119
131
const borderedMultiValueStyles = ( borderedMultiValue ) => borderedMultiValue ? {
0 commit comments