@@ -4,14 +4,17 @@ import { getArgTypes } from '../../docs/config/utils';
4
4
import { iconTypes } from './types' ;
5
5
import './icon.stories.scss' ;
6
6
7
- const Template : Story = ( { icon, color, size } ) => {
8
- return html `< b2b-icon icon ="${ icon } " color ="${ color } " size ="${ size } " /> ` ;
7
+ const Template : Story = ( { icon, color, variant } ) => {
8
+ return html `< b2b-icon
9
+ icon ="${ icon } "
10
+ color ="${ color } "
11
+ variant ="${ variant } " /> ` ;
9
12
} ;
10
13
11
14
const defaultArgs = {
12
15
icon : 'b2b_icon-edit' ,
13
16
color : 'primary' ,
14
- size : '100' ,
17
+ variant : '100' ,
15
18
} ;
16
19
17
20
export const story010Primary = Template . bind ( { } ) ;
@@ -31,46 +34,46 @@ story030Inverse.parameters = {
31
34
} ,
32
35
} ;
33
36
34
- export const story035Inherit : Story = ( { icon, color, size } ) => {
37
+ export const story035Inherit : Story = ( { icon, color, variant } ) => {
35
38
return html ` < div style ="color: red; ">
36
- < b2b-icon icon ="${ icon } " color ="${ color } " size ="${ size } " />
39
+ < b2b-icon icon ="${ icon } " color ="${ color } " variant ="${ variant } " />
37
40
</ div > ` ;
38
41
} ;
39
42
story035Inherit . args = { ...defaultArgs , color : 'inherit' } ;
40
43
story035Inherit . storyName = 'Inherit' ;
41
44
42
45
export const story040Size50 = Template . bind ( { } ) ;
43
- story040Size50 . args = { ...defaultArgs , size : '50' } ;
44
- story040Size50 . storyName = 'Size 50' ;
46
+ story040Size50 . args = {
47
+ ...defaultArgs ,
48
+ variant : '50' ,
49
+ icon : 'b2b_icon-info-50' ,
50
+ } ;
51
+ story040Size50 . storyName = 'Variant 50' ;
45
52
46
53
export const story050Size100 = Template . bind ( { } ) ;
47
54
story050Size100 . args = defaultArgs ;
48
- story050Size100 . storyName = 'Size 100' ;
49
-
50
- export const story060Size200 = Template . bind ( { } ) ;
51
- story060Size200 . args = { ...defaultArgs , size : '200' } ;
52
- story060Size200 . storyName = 'Size 200' ;
55
+ story050Size100 . storyName = 'Variant 100' ;
53
56
54
- export const story070AllIcons : Story = ( { color, size } ) => {
57
+ export const story070AllIcons : Story = ( { color, variant } ) => {
55
58
// not using a self-closing tag as that messes up with the display order of the icon and paragraph
56
59
const icons = iconTypes . map ( icon => {
57
60
return html `
58
61
< div class ="icon-container ">
59
62
< b2b-icon
60
63
icon ="${ icon } "
61
64
color ="${ color || defaultArgs . color } "
62
- size ="${ size || 200 } "> </ b2b-icon >
65
+ variant ="${ variant || 100 } "> </ b2b-icon >
63
66
< p > ${ icon } </ p >
64
67
</ div >
65
68
` ;
66
69
} ) ;
67
70
return html `< div class ="icons-grid-container "> ${ icons } </ div > ` ;
68
71
} ;
69
- story070AllIcons . args = { color : 'primary' , size : '200 ' } ;
72
+ story070AllIcons . args = { color : 'primary' , variant : '100 ' } ;
70
73
story070AllIcons . storyName = 'All Icons' ;
71
74
72
75
const controls = {
73
- size : 'radio' ,
76
+ variant : 'radio' ,
74
77
color : 'radio' ,
75
78
icon : 'select' ,
76
79
} ;
@@ -79,6 +82,6 @@ const iconArgs = getArgTypes('b2b-icon', controls);
79
82
80
83
export default {
81
84
title : 'Components/Assets/Icon' ,
82
- argTypes : iconArgs ,
85
+ argTypes : { ... iconArgs , size : { controls : false } } ,
83
86
viewMode : 'docs' ,
84
87
} as Meta ;
0 commit comments