@@ -18,7 +18,7 @@ if (typeof window !== "undefined") {
18
18
"replace" in CSSStyleSheet . prototype ;
19
19
}
20
20
21
- export class FraIcon extends HTMLElement {
21
+ export class SvgIcon extends ( globalThis . HTMLElement || { } ) {
22
22
static sheet ?: CSSStyleSheet ;
23
23
24
24
static elementProperties = new Map ( [ [ "name" , { type : String , reflect : true } ] ] ) ;
@@ -44,12 +44,12 @@ export class FraIcon extends HTMLElement {
44
44
}
45
45
46
46
static getStyleSheet ( ) : CSSStyleSheet {
47
- if ( ! FraIcon . sheet ) {
47
+ if ( ! SvgIcon . sheet ) {
48
48
const sheet = new CSSStyleSheet ( ) ;
49
- sheet . replaceSync ( FraIcon . styles ) ;
50
- FraIcon . sheet = sheet ;
49
+ sheet . replaceSync ( SvgIcon . styles ) ;
50
+ SvgIcon . sheet = sheet ;
51
51
}
52
- return FraIcon . sheet ;
52
+ return SvgIcon . sheet ;
53
53
}
54
54
55
55
static get observedAttributes ( ) {
@@ -84,21 +84,21 @@ export class FraIcon extends HTMLElement {
84
84
const shadow = this . attachShadow ( { mode : "open" } ) ;
85
85
86
86
if ( supportsAdoptingStyleSheets ) {
87
- shadow . adoptedStyleSheets = [ FraIcon . getStyleSheet ( ) ] ;
87
+ shadow . adoptedStyleSheets = [ SvgIcon . getStyleSheet ( ) ] ;
88
88
} else {
89
89
const style = document . createElement ( "style" ) ;
90
- style . textContent = FraIcon . styles ;
90
+ style . textContent = SvgIcon . styles ;
91
91
shadow . appendChild ( style ) ;
92
92
}
93
93
}
94
94
}
95
95
96
96
declare global {
97
97
interface HTMLElementTagNameMap {
98
- "svg-icon" : FraIcon ;
98
+ "svg-icon" : SvgIcon ;
99
99
}
100
100
}
101
101
102
102
if ( "customElements" in globalThis && ! customElements . get ( "svg-icon" ) ) {
103
- customElements . define ( "svg-icon" , FraIcon ) ;
103
+ customElements . define ( "svg-icon" , SvgIcon ) ;
104
104
}
0 commit comments