@@ -14,13 +14,7 @@ const iconName1 = document.createElement('td');
1414iconName1 . textContent = 'select-element' ;
1515row1 . appendChild ( iconName1 ) ;
1616
17- const icon = new IconButton . Icon . Icon ( ) ;
18- const name = 'select-element' ;
19- icon . data = {
20- iconName : name ,
21- color : 'rgb(110, 110, 110)' ,
22- width : '20px' ,
23- } ;
17+ const icon = IconButton . Icon . create ( 'select-element' ) ;
2418const icon1 = document . createElement ( 'td' ) ;
2519icon1 . appendChild ( icon ) ;
2620row1 . appendChild ( icon1 ) ;
@@ -37,14 +31,8 @@ const iconName2 = document.createElement('td');
3731iconName2 . textContent = 'issue-exclamation-filled' ;
3832row2 . appendChild ( iconName2 ) ;
3933
40- const otherIcon = new IconButton . Icon . Icon ( ) ;
41- const otherPath = 'issue-exclamation-filled' ;
42- otherIcon . data = {
43- iconPath : otherPath ,
44- width : '20px' ,
45- height : '20px' ,
46- color : 'var(--icon-link)' ,
47- } ;
34+ const otherIcon = IconButton . Icon . create ( 'issue-exclamation-filled' ) ;
35+ otherIcon . style . color = 'var(--icon-link)' ;
4836const icon2 = document . createElement ( 'td' ) ;
4937icon2 . appendChild ( otherIcon ) ;
5038row2 . appendChild ( icon2 ) ;
@@ -56,9 +44,7 @@ const iconName3 = document.createElement('td');
5644iconName3 . textContent = 'select-element' ;
5745row3 . appendChild ( iconName3 ) ;
5846
59- const otherIcon2 = new IconButton . Icon . Icon ( ) ;
60- otherIcon2 . classList . add ( 'custom-color' ) ;
61- otherIcon2 . name = 'select-element' ;
47+ const otherIcon2 = IconButton . Icon . create ( 'select-element' , 'custom-color' ) ;
6248const icon3 = document . createElement ( 'td' ) ;
6349icon3 . appendChild ( otherIcon2 ) ;
6450row3 . appendChild ( icon3 ) ;
@@ -70,14 +56,7 @@ iconTable?.appendChild(row3);
7056 const span1 = document . createElement ( 'span' ) ;
7157 span1 . textContent = 'Some text' ;
7258 div . appendChild ( span1 ) ;
73- const otherIcon3 = new IconButton . Icon . Icon ( ) ;
74- otherIcon3 . classList . add ( 'custom-color' ) ;
75- otherIcon3 . data = {
76- iconName : 'select-element' ,
77- width : '20px' ,
78- height : '20px' ,
79- color : 'var(--icon-default)' ,
80- } ;
59+ const otherIcon3 = IconButton . Icon . create ( 'select-element' , 'custom-color' ) ;
8160 div . appendChild ( otherIcon3 ) ;
8261 const span2 = document . createElement ( 'span' ) ;
8362 span2 . textContent = 'with a large icon' ;
@@ -90,14 +69,9 @@ iconTable?.appendChild(row3);
9069 const span1 = document . createElement ( 'span' ) ;
9170 span1 . textContent = 'Some text' ;
9271 div . appendChild ( span1 ) ;
93- const otherIcon3 = new IconButton . Icon . Icon ( ) ;
94- otherIcon3 . classList . add ( 'custom-color' ) ;
95- otherIcon3 . data = {
96- iconName : 'select-element' ,
97- width : '14px' ,
98- height : '14px' ,
99- color : 'var(--icon-default)' ,
100- } ;
72+ const otherIcon3 = IconButton . Icon . create ( 'select-element' , 'custom-color' ) ;
73+ otherIcon3 . style . width = '14px' ;
74+ otherIcon3 . style . height = '14px' ;
10175 div . appendChild ( otherIcon3 ) ;
10276 const span2 = document . createElement ( 'span' ) ;
10377 span2 . textContent = 'with a small icon' ;
0 commit comments