@spectrum-web-components/icon 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- package/custom-elements.json +0 -42
- package/package.json +4 -4
- package/src/IconBase.d.ts +0 -1
- package/src/IconBase.dev.js +0 -15
- package/src/IconBase.dev.js.map +2 -2
- package/src/IconBase.js +2 -2
- package/src/IconBase.js.map +3 -3
package/custom-elements.json
CHANGED
@@ -167,20 +167,6 @@
|
|
167
167
|
"module": "src/IconBase.js"
|
168
168
|
}
|
169
169
|
},
|
170
|
-
{
|
171
|
-
"kind": "method",
|
172
|
-
"name": "requestSystemContext",
|
173
|
-
"privacy": "private",
|
174
|
-
"return": {
|
175
|
-
"type": {
|
176
|
-
"text": "void"
|
177
|
-
}
|
178
|
-
},
|
179
|
-
"inheritedFrom": {
|
180
|
-
"name": "IconBase",
|
181
|
-
"module": "src/IconBase.js"
|
182
|
-
}
|
183
|
-
},
|
184
170
|
{
|
185
171
|
"kind": "field",
|
186
172
|
"name": "systemResolver",
|
@@ -198,16 +184,6 @@
|
|
198
184
|
"type": {
|
199
185
|
"text": "Event"
|
200
186
|
}
|
201
|
-
},
|
202
|
-
{
|
203
|
-
"name": "sp-system-context",
|
204
|
-
"type": {
|
205
|
-
"text": "CustomEvent"
|
206
|
-
},
|
207
|
-
"inheritedFrom": {
|
208
|
-
"name": "IconBase",
|
209
|
-
"module": "src/IconBase.ts"
|
210
|
-
}
|
211
187
|
}
|
212
188
|
],
|
213
189
|
"attributes": [
|
@@ -315,16 +291,6 @@
|
|
315
291
|
"attribute": "size",
|
316
292
|
"reflects": true
|
317
293
|
},
|
318
|
-
{
|
319
|
-
"kind": "method",
|
320
|
-
"name": "requestSystemContext",
|
321
|
-
"privacy": "private",
|
322
|
-
"return": {
|
323
|
-
"type": {
|
324
|
-
"text": "void"
|
325
|
-
}
|
326
|
-
}
|
327
|
-
},
|
328
294
|
{
|
329
295
|
"kind": "field",
|
330
296
|
"name": "systemResolver",
|
@@ -332,14 +298,6 @@
|
|
332
298
|
"default": "new SystemResolutionController(this)"
|
333
299
|
}
|
334
300
|
],
|
335
|
-
"events": [
|
336
|
-
{
|
337
|
-
"name": "sp-system-context",
|
338
|
-
"type": {
|
339
|
-
"text": "CustomEvent"
|
340
|
-
}
|
341
|
-
}
|
342
|
-
],
|
343
301
|
"attributes": [
|
344
302
|
{
|
345
303
|
"name": "label",
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@spectrum-web-components/icon",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.1",
|
4
4
|
"publishConfig": {
|
5
5
|
"access": "public"
|
6
6
|
},
|
@@ -81,8 +81,8 @@
|
|
81
81
|
"lit-html"
|
82
82
|
],
|
83
83
|
"dependencies": {
|
84
|
-
"@spectrum-web-components/base": "^1.0.
|
85
|
-
"@spectrum-web-components/iconset": "^1.0.
|
84
|
+
"@spectrum-web-components/base": "^1.0.1",
|
85
|
+
"@spectrum-web-components/iconset": "^1.0.1"
|
86
86
|
},
|
87
87
|
"devDependencies": {
|
88
88
|
"@spectrum-css/icon": "^8.0.0-s2-foundations.17"
|
@@ -93,5 +93,5 @@
|
|
93
93
|
"./sp-*.js",
|
94
94
|
"./**/*.dev.js"
|
95
95
|
],
|
96
|
-
"gitHead": "
|
96
|
+
"gitHead": "b359bc0242712be118c5e3e2cc05f88707d3eeb1"
|
97
97
|
}
|
package/src/IconBase.d.ts
CHANGED
@@ -7,7 +7,6 @@ export declare class IconBase extends SpectrumElement {
|
|
7
7
|
size?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
|
8
8
|
connectedCallback(): void;
|
9
9
|
disconnectedCallback(): void;
|
10
|
-
private requestSystemContext;
|
11
10
|
private systemResolver;
|
12
11
|
protected update(changes: PropertyValues): void;
|
13
12
|
protected render(): TemplateResult;
|
package/src/IconBase.dev.js
CHANGED
@@ -35,7 +35,6 @@ export class IconBase extends SpectrumElement {
|
|
35
35
|
}
|
36
36
|
connectedCallback() {
|
37
37
|
super.connectedCallback();
|
38
|
-
this.requestSystemContext();
|
39
38
|
}
|
40
39
|
disconnectedCallback() {
|
41
40
|
super.disconnectedCallback();
|
@@ -44,20 +43,6 @@ export class IconBase extends SpectrumElement {
|
|
44
43
|
this.unsubscribeSystemContext = null;
|
45
44
|
}
|
46
45
|
}
|
47
|
-
requestSystemContext() {
|
48
|
-
this.dispatchEvent(
|
49
|
-
new CustomEvent("sp-system-context", {
|
50
|
-
detail: {
|
51
|
-
callback: (system, unsubscribe) => {
|
52
|
-
this.spectrumVersion = system === "spectrum-two" ? 2 : 1;
|
53
|
-
this.unsubscribeSystemContext = unsubscribe;
|
54
|
-
}
|
55
|
-
},
|
56
|
-
bubbles: true,
|
57
|
-
composed: true
|
58
|
-
})
|
59
|
-
);
|
60
|
-
}
|
61
46
|
update(changes) {
|
62
47
|
if (changes.has("label")) {
|
63
48
|
if (this.label) {
|
package/src/IconBase.dev.js.map
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["IconBase.ts"],
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n SystemResolutionController,\n systemResolverUpdatedSymbol,\n} from '@spectrum-web-components/reactive-controllers/src/SystemContextResolution.js';\n\nimport {\n property,\n state,\n} from '@spectrum-web-components/base/src/decorators.js';\n\nimport iconStyles from './icon.css.js';\n\
|
5
|
-
"mappings": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EAEA;AAAA,OAEG;AACP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAEP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAEP,OAAO,gBAAgB;
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n SystemResolutionController,\n systemResolverUpdatedSymbol,\n} from '@spectrum-web-components/reactive-controllers/src/SystemContextResolution.js';\n\nimport {\n property,\n state,\n} from '@spectrum-web-components/base/src/decorators.js';\n\nimport iconStyles from './icon.css.js';\n\nexport class IconBase extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [iconStyles];\n }\n\n private unsubscribeSystemContext: (() => void) | null = null;\n\n @state()\n public spectrumVersion = 1;\n\n @property()\n public label = '';\n\n @property({ reflect: true })\n public size?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\n\n public override connectedCallback(): void {\n super.connectedCallback();\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this.unsubscribeSystemContext) {\n this.unsubscribeSystemContext();\n this.unsubscribeSystemContext = null;\n }\n }\n\n private systemResolver = new SystemResolutionController(this);\n\n protected override update(changes: PropertyValues): void {\n if (changes.has('label')) {\n if (this.label) {\n this.removeAttribute('aria-hidden');\n } else {\n this.setAttribute('aria-hidden', 'true');\n }\n }\n\n if (changes.has(systemResolverUpdatedSymbol)) {\n this.spectrumVersion =\n this.systemResolver.system === 'spectrum-two' ? 2 : 1;\n }\n\n super.update(changes);\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n}\n"],
|
5
|
+
"mappings": ";;;;;;;;;;;AAYA;AAAA,EAEI;AAAA,EAEA;AAAA,OAEG;AACP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAEP;AAAA,EACI;AAAA,EACA;AAAA,OACG;AAEP,OAAO,gBAAgB;AAEhB,aAAM,iBAAiB,gBAAgB;AAAA,EAAvC;AAAA;AAKH,SAAQ,2BAAgD;AAGxD,SAAO,kBAAkB;AAGzB,SAAO,QAAQ;AAiBf,SAAQ,iBAAiB,IAAI,2BAA2B,IAAI;AAAA;AAAA,EA3B5D,WAA2B,SAAyB;AAChD,WAAO,CAAC,UAAU;AAAA,EACtB;AAAA,EAagB,oBAA0B;AACtC,UAAM,kBAAkB;AAAA,EAC5B;AAAA,EAEgB,uBAA6B;AACzC,UAAM,qBAAqB;AAC3B,QAAI,KAAK,0BAA0B;AAC/B,WAAK,yBAAyB;AAC9B,WAAK,2BAA2B;AAAA,IACpC;AAAA,EACJ;AAAA,EAImB,OAAO,SAA+B;AACrD,QAAI,QAAQ,IAAI,OAAO,GAAG;AACtB,UAAI,KAAK,OAAO;AACZ,aAAK,gBAAgB,aAAa;AAAA,MACtC,OAAO;AACH,aAAK,aAAa,eAAe,MAAM;AAAA,MAC3C;AAAA,IACJ;AAEA,QAAI,QAAQ,IAAI,2BAA2B,GAAG;AAC1C,WAAK,kBACD,KAAK,eAAe,WAAW,iBAAiB,IAAI;AAAA,IAC5D;AAEA,UAAM,OAAO,OAAO;AAAA,EACxB;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA;AAAA;AAAA,EAGX;AACJ;AA5CW;AAAA,EADN,MAAM;AAAA,GAPE,SAQF;AAGA;AAAA,EADN,SAAS;AAAA,GAVD,SAWF;AAGA;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GAblB,SAcF;",
|
6
6
|
"names": []
|
7
7
|
}
|
package/src/IconBase.js
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
"use strict";var
|
1
|
+
"use strict";var c=Object.defineProperty;var m=Object.getOwnPropertyDescriptor;var l=(i,r,e,s)=>{for(var t=s>1?void 0:s?m(r,e):r,o=i.length-1,u;o>=0;o--)(u=i[o])&&(t=(s?u(r,e,t):u(t))||t);return s&&t&&c(r,e,t),t};import{html as n,SpectrumElement as a}from"@spectrum-web-components/base";import{SystemResolutionController as d,systemResolverUpdatedSymbol as b}from"@spectrum-web-components/reactive-controllers/src/SystemContextResolution.js";import{property as p,state as y}from"@spectrum-web-components/base/src/decorators.js";import v from"./icon.css.js";export class IconBase extends a{constructor(){super(...arguments);this.unsubscribeSystemContext=null;this.spectrumVersion=1;this.label="";this.systemResolver=new d(this)}static get styles(){return[v]}connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback(),this.unsubscribeSystemContext&&(this.unsubscribeSystemContext(),this.unsubscribeSystemContext=null)}update(e){e.has("label")&&(this.label?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true")),e.has(b)&&(this.spectrumVersion=this.systemResolver.system==="spectrum-two"?2:1),super.update(e)}render(){return n`
|
2
2
|
<slot></slot>
|
3
|
-
`}}
|
3
|
+
`}}l([y()],IconBase.prototype,"spectrumVersion",2),l([p()],IconBase.prototype,"label",2),l([p({reflect:!0})],IconBase.prototype,"size",2);
|
4
4
|
//# sourceMappingURL=IconBase.js.map
|
package/src/IconBase.js.map
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
3
|
"sources": ["IconBase.ts"],
|
4
|
-
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n SystemResolutionController,\n systemResolverUpdatedSymbol,\n} from '@spectrum-web-components/reactive-controllers/src/SystemContextResolution.js';\n\nimport {\n property,\n state,\n} from '@spectrum-web-components/base/src/decorators.js';\n\nimport iconStyles from './icon.css.js';\n\
|
5
|
-
"mappings": "qNAYA,OAEI,QAAAA,EAEA,mBAAAC,MAEG,gCACP,OACI,8BAAAC,EACA,+BAAAC,MACG,+EAEP,OACI,YAAAC,EACA,SAAAC,MACG,kDAEP,OAAOC,MAAgB,
|
6
|
-
"names": ["html", "SpectrumElement", "SystemResolutionController", "systemResolverUpdatedSymbol", "property", "state", "iconStyles", "
|
4
|
+
"sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n CSSResultArray,\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport {\n SystemResolutionController,\n systemResolverUpdatedSymbol,\n} from '@spectrum-web-components/reactive-controllers/src/SystemContextResolution.js';\n\nimport {\n property,\n state,\n} from '@spectrum-web-components/base/src/decorators.js';\n\nimport iconStyles from './icon.css.js';\n\nexport class IconBase extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [iconStyles];\n }\n\n private unsubscribeSystemContext: (() => void) | null = null;\n\n @state()\n public spectrumVersion = 1;\n\n @property()\n public label = '';\n\n @property({ reflect: true })\n public size?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\n\n public override connectedCallback(): void {\n super.connectedCallback();\n }\n\n public override disconnectedCallback(): void {\n super.disconnectedCallback();\n if (this.unsubscribeSystemContext) {\n this.unsubscribeSystemContext();\n this.unsubscribeSystemContext = null;\n }\n }\n\n private systemResolver = new SystemResolutionController(this);\n\n protected override update(changes: PropertyValues): void {\n if (changes.has('label')) {\n if (this.label) {\n this.removeAttribute('aria-hidden');\n } else {\n this.setAttribute('aria-hidden', 'true');\n }\n }\n\n if (changes.has(systemResolverUpdatedSymbol)) {\n this.spectrumVersion =\n this.systemResolver.system === 'spectrum-two' ? 2 : 1;\n }\n\n super.update(changes);\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n}\n"],
|
5
|
+
"mappings": "qNAYA,OAEI,QAAAA,EAEA,mBAAAC,MAEG,gCACP,OACI,8BAAAC,EACA,+BAAAC,MACG,+EAEP,OACI,YAAAC,EACA,SAAAC,MACG,kDAEP,OAAOC,MAAgB,gBAEhB,aAAM,iBAAiBL,CAAgB,CAAvC,kCAKH,KAAQ,yBAAgD,KAGxD,KAAO,gBAAkB,EAGzB,KAAO,MAAQ,GAiBf,KAAQ,eAAiB,IAAIC,EAA2B,IAAI,EA3B5D,WAA2B,QAAyB,CAChD,MAAO,CAACI,CAAU,CACtB,CAagB,mBAA0B,CACtC,MAAM,kBAAkB,CAC5B,CAEgB,sBAA6B,CACzC,MAAM,qBAAqB,EACvB,KAAK,2BACL,KAAK,yBAAyB,EAC9B,KAAK,yBAA2B,KAExC,CAImB,OAAOC,EAA+B,CACjDA,EAAQ,IAAI,OAAO,IACf,KAAK,MACL,KAAK,gBAAgB,aAAa,EAElC,KAAK,aAAa,cAAe,MAAM,GAI3CA,EAAQ,IAAIJ,CAA2B,IACvC,KAAK,gBACD,KAAK,eAAe,SAAW,eAAiB,EAAI,GAG5D,MAAM,OAAOI,CAAO,CACxB,CAEmB,QAAyB,CACxC,OAAOP;AAAA;AAAA,SAGX,CACJ,CA5CWQ,EAAA,CADNH,EAAM,GAPE,SAQF,+BAGAG,EAAA,CADNJ,EAAS,GAVD,SAWF,qBAGAI,EAAA,CADNJ,EAAS,CAAE,QAAS,EAAK,CAAC,GAblB,SAcF",
|
6
|
+
"names": ["html", "SpectrumElement", "SystemResolutionController", "systemResolverUpdatedSymbol", "property", "state", "iconStyles", "changes", "__decorateClass"]
|
7
7
|
}
|