@@ -6,6 +6,7 @@ import type * as Common from '../../core/common/common.js';
66import * as i18n from '../../core/i18n/i18n.js' ;
77import * as Buttons from '../../ui/components/buttons/buttons.js' ;
88import * as VisualLogging from '../../ui/visual_logging/visual_logging.js' ;
9+ import * as IconButton from '../components/icon_button/icon_button.js' ;
910
1011import * as ARIAUtils from './ARIAUtils.js' ;
1112import infobarStyles from './infobar.css.js' ;
@@ -72,8 +73,8 @@ export class Infobar {
7273
7374 this . infoMessage = this . infoContainer . createChild ( 'div' , 'infobar-info-message' ) ;
7475
75- // Icon is in separate file and included via CSS.
76- this . infoMessage . createChild ( 'div' , type + '- icon icon' ) ;
76+ const icon = IconButton . Icon . create ( TYPE_TO_ICON [ type ] , type + '-icon' ) ;
77+ this . infoMessage . appendChild ( icon ) ;
7778
7879 this . infoText = this . infoMessage . createChild ( 'div' , 'infobar-info-text' ) ;
7980 this . infoText . textContent = text ;
@@ -120,6 +121,7 @@ export class Infobar {
120121 this . closeContainer . appendChild ( this . toggleElement ) ;
121122 this . closeButton = this . closeContainer . createChild ( 'dt-close-button' , 'close-button' ) ;
122123 this . closeButton . setTabbable ( true ) ;
124+ this . closeButton . setSize ( Buttons . Button . Size . SMALL ) ;
123125 ARIAUtils . setDescription ( this . closeButton , i18nString ( UIStrings . close ) ) ;
124126 self . onInvokeElement ( this . closeButton , this . dispose . bind ( this ) ) ;
125127
@@ -251,3 +253,10 @@ export const enum Type {
251253 ISSUE = 'issue' ,
252254 ERROR = 'error' ,
253255}
256+
257+ const TYPE_TO_ICON = {
258+ [ Type . WARNING ] : 'warning' ,
259+ [ Type . INFO ] : 'info' ,
260+ [ Type . ISSUE ] : 'issue-text-filled' ,
261+ [ Type . ERROR ] : 'cross-circle' ,
262+ } ;
0 commit comments