@@ -7,37 +7,36 @@ import { Text } from '../Text';
77import { Element } from '../Element' ;
88
99// Svg used for the icon
10- const svg = color =>
10+ const svg = ( color : string ) =>
1111 `"data:image/svg+xml,%3Csvg width='8' height='24' viewBox='0 0 8 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M4.00006 17L1 13L7 13L4.00006 17Z' fill='%23${
1212 color . split ( '#' ) [ 1 ]
1313 } '/%3E%3Cpath d='M3.99994 7L7 11H1L3.99994 7Z' fill='%23${
1414 color . split ( '#' ) [ 1 ]
1515 } '/%3E%3C/svg%3E%0A"`;
1616
17- export const SelectComponent = styled . select < { icon ?: boolean } > ( props =>
18- css ( {
19- width : '100%' ,
20- height : 6 ,
21- paddingX : 2 ,
22- paddingLeft : props . icon ? 6 : 2 ,
23- fontSize : 3 ,
24- borderRadius : 'small' ,
25- backgroundColor : 'input.background' ,
26- border : '1px solid' ,
27- borderColor : 'input.border' ,
28- color : 'input.placeholderForeground' ,
29- appearance : 'none' ,
30- backgroundImage : `url(${ svg (
31- props . theme . colors . input . placeholderForeground
32- ) } )`,
33- backgroundPosition : 'calc(100% - 8px) center' ,
34- backgroundRepeat : 'no-repeat' ,
17+ export const SelectComponent = styled . select < { icon ?: boolean } > (
18+ ( { icon, theme } ) =>
19+ css ( {
20+ width : '100%' ,
21+ height : 6 ,
22+ paddingX : 2 ,
23+ paddingLeft : icon ? 6 : 2 ,
24+ fontSize : 3 ,
25+ borderRadius : 'small' ,
26+ backgroundColor : 'input.background' ,
27+ border : '1px solid' ,
28+ borderColor : 'input.border' ,
29+ color : 'input.placeholderForeground' ,
30+ appearance : 'none' ,
31+ backgroundImage : `url(${ svg ( theme . colors . input . placeholderForeground ) } )` ,
32+ backgroundPosition : 'calc(100% - 8px) center' ,
33+ backgroundRepeat : 'no-repeat' ,
3534
36- ':hover' : {
37- color : 'input.foreground' ,
38- backgroundImage : `url(${ svg ( props . theme . colors . input . foreground ) } )` ,
39- } ,
40- } )
35+ ':hover' : {
36+ color : 'input.foreground' ,
37+ backgroundImage : `url(${ svg ( theme . colors . input . foreground ) } )` ,
38+ } ,
39+ } )
4140) ;
4241
4342const IconWrapper = styled ( Element ) (
0 commit comments