@@ -44,7 +44,6 @@ export const enum ToggleType {
4444type ButtonType = 'button' | 'submit' | 'reset' ;
4545
4646interface ButtonState {
47- iconUrl ?: string ;
4847 variant : Variant ;
4948 size ?: Size ;
5049 reducedFocusRing ?: boolean ;
@@ -66,7 +65,6 @@ interface ButtonState {
6665
6766interface CommonButtonData {
6867 variant : Variant ;
69- iconUrl ?: string ;
7068 iconName ?: string ;
7169 toggledIconName ?: string ;
7270 toggleType ?: ToggleType ;
@@ -86,9 +84,6 @@ interface CommonButtonData {
8684}
8785
8886export type ButtonData = CommonButtonData & ( | {
89- variant : Variant . PRIMARY_TOOLBAR | Variant . TOOLBAR | Variant . ICON ,
90- iconUrl : string ,
91- } | {
9287 variant : Variant . PRIMARY_TOOLBAR | Variant . TOOLBAR | Variant . ICON ,
9388 iconName : string ,
9489} | {
@@ -130,7 +125,6 @@ export class Button extends HTMLElement {
130125 */
131126 set data ( data : ButtonData ) {
132127 this . #props. variant = data . variant ;
133- this . #props. iconUrl = data . iconUrl ;
134128 this . #props. iconName = data . iconName ;
135129 this . #props. toggledIconName = data . toggledIconName ;
136130 this . #props. toggleOnClick = data . toggleOnClick !== undefined ? data . toggleOnClick : true ;
@@ -157,11 +151,6 @@ export class Button extends HTMLElement {
157151 this . #render( ) ;
158152 }
159153
160- set iconUrl ( iconUrl : string | undefined ) {
161- this . #props. iconUrl = iconUrl ;
162- this . #render( ) ;
163- }
164-
165154 set iconName ( iconName : string | undefined ) {
166155 this . #props. iconName = iconName ;
167156 this . #render( ) ;
@@ -322,25 +311,22 @@ export class Button extends HTMLElement {
322311 throw new Error ( 'Button requires a variant to be defined' ) ;
323312 }
324313 if ( this . #isToolbarVariant( ) ) {
325- if ( ! this . #props. iconUrl && ! this . #props . iconName ) {
314+ if ( ! this . #props. iconName ) {
326315 throw new Error ( 'Toolbar button requires an icon' ) ;
327316 }
328317 if ( ! isEmpty ) {
329318 throw new Error ( 'Toolbar button does not accept children' ) ;
330319 }
331320 }
332321 if ( this . #props. variant === Variant . ICON ) {
333- if ( ! this . #props. iconUrl && ! this . #props . iconName ) {
322+ if ( ! this . #props. iconName ) {
334323 throw new Error ( 'Icon button requires an icon' ) ;
335324 }
336325 if ( ! isEmpty ) {
337326 throw new Error ( 'Icon button does not accept children' ) ;
338327 }
339328 }
340- if ( this . #props. iconName && this . #props. iconUrl ) {
341- throw new Error ( 'Both iconName and iconUrl are provided.' ) ;
342- }
343- const hasIcon = Boolean ( this . #props. iconUrl ) || Boolean ( this . #props. iconName ) ;
329+ const hasIcon = Boolean ( this . #props. iconName ) ;
344330 const classes = {
345331 primary : this . #props. variant === Variant . PRIMARY ,
346332 tonal : this . #props. variant === Variant . TONAL ,
@@ -380,7 +366,7 @@ export class Button extends HTMLElement {
380366 @keydown=${ this . #onKeydown}
381367 > ${ hasIcon
382368 ? html `
383- < devtools-icon name =${ ifDefined ( this . #props. toggled ? this . #props. toggledIconName : this . #props. iconName || this . #props . iconUrl ) } >
369+ < devtools-icon name =${ ifDefined ( this . #props. toggled ? this . #props. toggledIconName : this . #props. iconName ) } >
384370 </ devtools-icon > `
385371 : '' }
386372 ${ this . #props. longClickable ? html `< devtools-icon name =${ 'triangle-bottom-right' } class ="long-click"
0 commit comments