@spectrum-web-components/icon
Advanced tools
Comparing version
@@ -7,3 +7,3 @@ { | ||
"kind": "javascript-module", | ||
"path": "sp-icon.ts", | ||
"path": "sp-icon.js", | ||
"declarations": [], | ||
@@ -23,3 +23,3 @@ "exports": [ | ||
"kind": "javascript-module", | ||
"path": "src/Icon.ts", | ||
"path": "src/Icon.js", | ||
"declarations": [ | ||
@@ -122,9 +122,10 @@ { | ||
"type": { | ||
"text": "string | undefined" | ||
"text": "string" | ||
}, | ||
"privacy": "public", | ||
"default": "''", | ||
"attribute": "label", | ||
"inheritedFrom": { | ||
"name": "IconBase", | ||
"module": "src/IconBase.ts" | ||
"module": "src/IconBase.js" | ||
} | ||
@@ -143,3 +144,3 @@ }, | ||
"name": "IconBase", | ||
"module": "src/IconBase.ts" | ||
"module": "src/IconBase.js" | ||
} | ||
@@ -174,4 +175,5 @@ } | ||
"type": { | ||
"text": "string | undefined" | ||
"text": "string" | ||
}, | ||
"default": "''", | ||
"fieldName": "label", | ||
@@ -209,3 +211,3 @@ "inheritedFrom": { | ||
"name": "Icon", | ||
"module": "src/Icon.ts" | ||
"module": "src/Icon.js" | ||
} | ||
@@ -217,3 +219,3 @@ } | ||
"kind": "javascript-module", | ||
"path": "src/IconBase.ts", | ||
"path": "src/IconBase.js", | ||
"declarations": [ | ||
@@ -229,5 +231,6 @@ { | ||
"type": { | ||
"text": "string | undefined" | ||
"text": "string" | ||
}, | ||
"privacy": "public", | ||
"default": "''", | ||
"attribute": "label" | ||
@@ -250,4 +253,5 @@ }, | ||
"type": { | ||
"text": "string | undefined" | ||
"text": "string" | ||
}, | ||
"default": "''", | ||
"fieldName": "label" | ||
@@ -275,3 +279,3 @@ }, | ||
"name": "IconBase", | ||
"module": "src/IconBase.ts" | ||
"module": "src/IconBase.js" | ||
} | ||
@@ -278,0 +282,0 @@ } |
{ | ||
"name": "@spectrum-web-components/icon", | ||
"version": "0.34.1-rc.0+1647bfed5", | ||
"version": "0.35.0", | ||
"publishConfig": { | ||
@@ -74,7 +74,7 @@ "access": "public" | ||
"dependencies": { | ||
"@spectrum-web-components/base": "^0.34.1-rc.0+1647bfed5", | ||
"@spectrum-web-components/iconset": "^0.34.1-rc.0+1647bfed5" | ||
"@spectrum-web-components/base": "^0.35.0", | ||
"@spectrum-web-components/iconset": "^0.35.0" | ||
}, | ||
"devDependencies": { | ||
"@spectrum-css/icon": "^3.0.48" | ||
"@spectrum-css/icon": "^3.0.49" | ||
}, | ||
@@ -87,3 +87,3 @@ "types": "./src/index.d.ts", | ||
], | ||
"gitHead": "1647bfed54cb29f3513343cd0d2c2d9e73e1c508" | ||
"gitHead": "1ee5a6c92838cdf48321276d97f61c20f8476ac1" | ||
} |
@@ -1,7 +0,8 @@ | ||
import { CSSResultArray, SpectrumElement, TemplateResult } from '@spectrum-web-components/base'; | ||
import { CSSResultArray, PropertyValues, SpectrumElement, TemplateResult } from '@spectrum-web-components/base'; | ||
export declare class IconBase extends SpectrumElement { | ||
static get styles(): CSSResultArray; | ||
label?: string; | ||
label: string; | ||
size?: 's' | 'm' | 'l' | 'xl' | 'xxl'; | ||
protected update(changes: PropertyValues): void; | ||
protected render(): TemplateResult; | ||
} |
@@ -20,5 +20,19 @@ "use strict"; | ||
export class IconBase extends SpectrumElement { | ||
constructor() { | ||
super(...arguments); | ||
this.label = ""; | ||
} | ||
static get styles() { | ||
return [iconStyles]; | ||
} | ||
update(changes) { | ||
if (changes.has("label")) { | ||
if (this.label) { | ||
this.removeAttribute("aria-hidden"); | ||
} else { | ||
this.setAttribute("aria-hidden", "true"); | ||
} | ||
} | ||
super.update(changes); | ||
} | ||
render() { | ||
@@ -25,0 +39,0 @@ return html` |
@@ -1,4 +0,4 @@ | ||
"use strict";var u=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var i=(l,t,s,r)=>{for(var e=r>1?void 0:r?c(t,s):t,o=l.length-1,p;o>=0;o--)(p=l[o])&&(e=(r?p(t,s,e):p(e))||e);return r&&e&&u(t,s,e),e};import{html as a,SpectrumElement as n}from"@spectrum-web-components/base";import{property as m}from"@spectrum-web-components/base/src/decorators.js";import S from"./icon.css.js";export class IconBase extends n{static get styles(){return[S]}render(){return a` | ||
"use strict";var a=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var p=(i,r,t,l)=>{for(var e=l>1?void 0:l?d(r,t):r,s=i.length-1,o;s>=0;s--)(o=i[s])&&(e=(l?o(r,t,e):o(e))||e);return l&&e&&a(r,t,e),e};import{html as m,SpectrumElement as b}from"@spectrum-web-components/base";import{property as u}from"@spectrum-web-components/base/src/decorators.js";import c from"./icon.css.js";export class IconBase extends b{constructor(){super(...arguments);this.label=""}static get styles(){return[c]}update(t){t.has("label")&&(this.label?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true")),super.update(t)}render(){return m` | ||
<slot></slot> | ||
`}}i([m()],IconBase.prototype,"label",2),i([m({reflect:!0})],IconBase.prototype,"size",2); | ||
`}}p([u()],IconBase.prototype,"label",2),p([u({reflect:!0})],IconBase.prototype,"size",2); | ||
//# sourceMappingURL=IconBase.js.map |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 6 instances in 1 package
182700
0.92%1204
1.69%1
-88.89%0
-100%+ Added
+ Added
- Removed
- Removed