@@ -4,60 +4,65 @@ import { css } from '@emotion/core';
4
4
import { AngleDownIcon , AngleRightIcon } from '../../icons' ;
5
5
import vars from '../../../../materials/custom-properties' ;
6
6
7
- const sizeIconContainer = '24px ' ;
8
- const sizeIconContainerSmall = '16px ' ;
7
+ const sizeIconContainer = '22px ' ;
8
+ const sizeIconContainerSmall = '14px ' ;
9
9
10
10
const getArrowTheme = ( { tone, isDisabled } ) => {
11
11
if ( isDisabled ) return 'grey' ;
12
12
if ( tone === 'urgent' ) return 'white' ;
13
13
return 'black' ;
14
14
} ;
15
15
16
- const HeaderIcon = props => (
17
- < div
18
- css = { [
19
- css `
20
- display : flex;
21
- align-items : center;
22
- justify-content : center;
23
- height : ${ props . size === 'small'
24
- ? sizeIconContainerSmall
25
- : sizeIconContainer } ;
26
- width : ${ props . size === 'small'
27
- ? sizeIconContainerSmall
28
- : sizeIconContainer } ;
29
- border-radius : 50% ;
30
- flex-shrink : 0 ;
31
- box-shadow : ${ vars . shadow7 } ;
32
- background-color : ${ props . tone === 'urgent'
33
- ? vars . colorWarning
34
- : vars . colorSurface } ;
35
- ` ,
36
- props . isDisabled &&
16
+ const HeaderIcon = props => {
17
+ const backgroundColor =
18
+ props . tone === 'urgent' ? vars . colorWarning : vars . colorSurface ;
19
+ return (
20
+ < div
21
+ css = { [
37
22
css `
38
- box-shadow : none;
23
+ display : flex;
24
+ align-items : center;
25
+ justify-content : center;
26
+ height : ${ props . size === 'small'
27
+ ? sizeIconContainerSmall
28
+ : sizeIconContainer } ;
29
+ width : ${ props . size === 'small'
30
+ ? sizeIconContainerSmall
31
+ : sizeIconContainer } ;
32
+ border-radius : 50% ;
33
+ flex-shrink : 0 ;
34
+ box-shadow : ${ vars . shadow7 } ;
35
+ background-color : ${ backgroundColor } ;
36
+ border : 1px solid ${ backgroundColor } ;
39
37
` ,
40
- ] }
41
- >
42
- { props . isClosed ? (
43
- < AngleRightIcon
44
- theme = { getArrowTheme ( {
45
- tone : props . tone ,
46
- isDisabled : props . isDisabled ,
47
- } ) }
48
- size = { props . size }
49
- />
50
- ) : (
51
- < AngleDownIcon
52
- theme = { getArrowTheme ( {
53
- tone : props . tone ,
54
- isDisabled : props . isDisabled ,
55
- } ) }
56
- size = { props . size }
57
- />
58
- ) }
59
- </ div >
60
- ) ;
38
+ props . isDisabled &&
39
+ css `
40
+ box-shadow : none;
41
+ border : 1px solid ${ vars . colorNeutral } ;
42
+ background-color : ${ vars . colorAccent98 } ;
43
+ ` ,
44
+ ] }
45
+ >
46
+ { props . isClosed ? (
47
+ < AngleRightIcon
48
+ theme = { getArrowTheme ( {
49
+ tone : props . tone ,
50
+ isDisabled : props . isDisabled ,
51
+ } ) }
52
+ size = { props . size }
53
+ />
54
+ ) : (
55
+ < AngleDownIcon
56
+ theme = { getArrowTheme ( {
57
+ tone : props . tone ,
58
+ isDisabled : props . isDisabled ,
59
+ } ) }
60
+ size = { props . size }
61
+ />
62
+ ) }
63
+ </ div >
64
+ ) ;
65
+ } ;
61
66
62
67
HeaderIcon . displayName = 'HeaderIcon' ;
63
68
HeaderIcon . propTypes = {
0 commit comments