10
10
* governing permissions and limitations under the License.
11
11
*/
12
12
13
- import { BackgroundColorValue , BorderColorValue , BorderRadiusValue , BorderSizeValue , ColorValue , DimensionValue , Direction , StyleProps , ViewStyleProps } from '@react-types/shared' ;
13
+ import { BackgroundColorValue , BorderColorValue , BorderRadiusValue , BorderSizeValue , ColorValue , DimensionValue , Direction , IconColorValue , StyleProps , ViewStyleProps } from '@react-types/shared' ;
14
14
import { CSSProperties , HTMLAttributes } from 'react' ;
15
15
import { useLocale } from '@react-aria/i18n' ;
16
16
@@ -110,6 +110,11 @@ const borderStyleProps = {
110
110
borderBottomWidth : 'borderBottomStyle'
111
111
} ;
112
112
113
+ export const iconStyleProps : StyleHandlers = {
114
+ ...baseStyleProps ,
115
+ color : [ 'color' , iconColorValue ]
116
+ } ;
117
+
113
118
function rtl ( ltr : string , rtl : string ) {
114
119
return ( direction : Direction ) => (
115
120
direction === 'rtl' ? rtl : ltr
@@ -134,6 +139,10 @@ function colorValue(value: ColorValue, type: ColorType = 'default') {
134
139
return `var(--spectrum-global-color-${ value } , var(--spectrum-semantic-${ value } -color-${ type } ))` ;
135
140
}
136
141
142
+ function iconColorValue ( value : IconColorValue ) {
143
+ return `var(--spectrum-semantic-${ value } -color-icon)` ;
144
+ }
145
+
137
146
function backgroundColorValue ( value : BackgroundColorValue ) {
138
147
return `var(--spectrum-alias-background-color-${ value } , ${ colorValue ( value as ColorValue , 'background' ) } )` ;
139
148
}
0 commit comments