This repository was archived by the owner on Mar 4, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +23
-38
lines changed
docs/src/examples/components/Icon/Variations
src/themes/teams/components/Icon Expand file tree Collapse file tree 3 files changed +23
-38
lines changed Original file line number Diff line number Diff line change @@ -16,27 +16,17 @@ const IconExampleColor = () => (
16
16
< Icon name = "call" bordered variables = { { outline : true } } />
17
17
< Icon name = "call-video" bordered variables = { { outline : true } } />
18
18
</ div >
19
- < Text
20
- content = {
21
- < span >
22
- USING THE < code > color</ code > VARIABLE:
23
- </ span >
24
- }
25
- weight = "bold"
26
- />
19
+ < Text weight = "bold" >
20
+ USING THE < code > color</ code > VARIABLE:
21
+ </ Text >
27
22
< div >
28
23
< Icon name = "calendar" bordered variables = { { color : 'violet' } } />
29
24
< Icon name = "call" bordered variables = { { color : 'yellowgreen' } } />
30
25
< Icon name = "call-video" bordered variables = { { color : 'cornflowerblue' } } />
31
26
</ div >
32
- < Text
33
- content = {
34
- < span >
35
- USING THE < code > borderColor</ code > VARIABLE:
36
- </ span >
37
- }
38
- weight = "bold"
39
- />
27
+ < Text weight = "bold" >
28
+ USING THE < code > borderColor</ code > VARIABLE:
29
+ </ Text >
40
30
< div >
41
31
< Icon
42
32
name = "calendar"
@@ -54,14 +44,9 @@ const IconExampleColor = () => (
54
44
variables = { { color : 'cornflowerblue' , borderColor : 'orangered' } }
55
45
/>
56
46
</ div >
57
- < Text
58
- content = {
59
- < span >
60
- USING THE < code > color</ code > PROP:
61
- </ span >
62
- }
63
- weight = "bold"
64
- />
47
+ < Text weight = "bold" >
48
+ USING THE < code > color</ code > PROP:
49
+ </ Text >
65
50
< div >
66
51
< ProviderConsumer
67
52
render = { ( { siteVariables : { emphasisColors, naturalColors } } ) =>
Original file line number Diff line number Diff line change @@ -10,15 +10,15 @@ import { pxToRem } from '../../utils'
10
10
import { getStyle as getSvgStyle } from './svg'
11
11
import { IconVariables , IconSizeModifier } from './iconVariables'
12
12
13
- const sizes = new Map ( [
14
- [ ' smallest' , 7 ] ,
15
- [ ' smaller' , 10 ] ,
16
- [ ' small' , 12 ] ,
17
- [ ' medium' , 16 ] ,
18
- [ ' large' , 20 ] ,
19
- [ ' larger' , 32 ] ,
20
- [ ' largest' , 40 ] ,
21
- ] )
13
+ const sizes : { [ key in IconSize ] : number } = {
14
+ smallest : 7 ,
15
+ smaller : 10 ,
16
+ small : 12 ,
17
+ medium : 16 ,
18
+ large : 20 ,
19
+ larger : 32 ,
20
+ largest : 40 ,
21
+ }
22
22
23
23
const getDefaultFontIcon = ( iconName : string ) => {
24
24
return callable ( fontAwesomeIcons ( iconName ) . icon ) ( )
@@ -75,8 +75,9 @@ const getPaddedStyle = (): ICSSInJSStyle => ({
75
75
76
76
const getIconSize = ( size : IconSize , sizeModifier : IconSizeModifier ) : number => {
77
77
if ( ! sizeModifier ) {
78
- return sizes . get ( size )
78
+ return sizes [ size ]
79
79
}
80
+
80
81
const modifiedSizes = {
81
82
large : {
82
83
x : 24 ,
Original file line number Diff line number Diff line change @@ -14,10 +14,10 @@ export interface IconVariables {
14
14
redColor ?: string
15
15
disabledColor : string
16
16
17
- outline ?: boolean
18
17
horizontalSpace : string
19
18
margin : string
20
- sizeModifier : IconSizeModifier
19
+ outline ?: boolean
20
+ sizeModifier ?: IconSizeModifier
21
21
}
22
22
23
23
const colorVariant = 500
@@ -32,8 +32,7 @@ export default (siteVars): IconVariables => ({
32
32
redColor : siteVars . red ,
33
33
disabledColor : siteVars . gray06 ,
34
34
35
- outline : undefined ,
36
35
horizontalSpace : pxToRem ( 10 ) ,
37
36
margin : `0 ${ pxToRem ( 8 ) } 0 0` ,
38
- sizeModifier : undefined ,
37
+ outline : undefined ,
39
38
} )
You can’t perform that action at this time.
0 commit comments