@spectrum-web-components/icon 0.49.0-beta.0 → 0.49.0-beta.1

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/icon",
3
- "version": "0.49.0-beta.0",
3
+ "version": "0.49.0-beta.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -71,8 +71,8 @@
71
71
  "lit-html"
72
72
  ],
73
73
  "dependencies": {
74
- "@spectrum-web-components/base": "^0.49.0-beta.0",
75
- "@spectrum-web-components/iconset": "^0.49.0-beta.0"
74
+ "@spectrum-web-components/base": "^0.49.0-beta.1",
75
+ "@spectrum-web-components/iconset": "^0.49.0-beta.1"
76
76
  },
77
77
  "devDependencies": {
78
78
  "@spectrum-css/icon": "^7.1.0"
@@ -83,5 +83,5 @@
83
83
  "./sp-*.js",
84
84
  "./**/*.dev.js"
85
85
  ],
86
- "gitHead": "1aa9165b6529e70339c9c632d47335a2c0894f0b"
86
+ "gitHead": "74ee2c5b1276e8e4f768566a1c3c4e263a7eb8b3"
87
87
  }
package/src/IconBase.d.ts CHANGED
@@ -3,6 +3,8 @@ export declare class IconBase extends SpectrumElement {
3
3
  static get styles(): CSSResultArray;
4
4
  label: string;
5
5
  size?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
6
+ private systemResolver;
7
+ spectrumVersion: number;
6
8
  protected update(changes: PropertyValues): void;
7
9
  protected render(): TemplateResult;
8
10
  }
@@ -13,12 +13,21 @@ import {
13
13
  html,
14
14
  SpectrumElement
15
15
  } from "@spectrum-web-components/base";
16
- import { property } from "@spectrum-web-components/base/src/decorators.js";
16
+ import {
17
+ SystemResolutionController,
18
+ systemResolverUpdatedSymbol
19
+ } from "@spectrum-web-components/reactive-controllers/src/SystemContextResolution.js";
20
+ import {
21
+ property,
22
+ state
23
+ } from "@spectrum-web-components/base/src/decorators.js";
17
24
  import iconStyles from "./icon.css.js";
18
25
  export class IconBase extends SpectrumElement {
19
26
  constructor() {
20
27
  super(...arguments);
21
28
  this.label = "";
29
+ this.systemResolver = new SystemResolutionController(this);
30
+ this.spectrumVersion = 1;
22
31
  }
23
32
  static get styles() {
24
33
  return [iconStyles];
@@ -31,6 +40,9 @@ export class IconBase extends SpectrumElement {
31
40
  this.setAttribute("aria-hidden", "true");
32
41
  }
33
42
  }
43
+ if (changes.has(systemResolverUpdatedSymbol)) {
44
+ this.spectrumVersion = this.systemResolver.system === "spectrum-two" ? 2 : 1;
45
+ }
34
46
  super.update(changes);
35
47
  }
36
48
  render() {
@@ -45,4 +57,7 @@ __decorateClass([
45
57
  __decorateClass([
46
58
  property({ reflect: true })
47
59
  ], IconBase.prototype, "size", 2);
60
+ __decorateClass([
61
+ state()
62
+ ], IconBase.prototype, "spectrumVersion", 2);
48
63
  //# sourceMappingURL=IconBase.dev.js.map
@@ -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 { property } 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 @property()\n public label = '';\n\n @property({ reflect: true })\n public size?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\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 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,SAAS,gBAAgB;AAEzB,OAAO,gBAAgB;AAEhB,aAAM,iBAAiB,gBAAgB;AAAA,EAAvC;AAAA;AAMH,SAAO,QAAQ;AAAA;AAAA,EALf,WAA2B,SAAyB;AAChD,WAAO,CAAC,UAAU;AAAA,EACtB;AAAA,EAQmB,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;AACA,UAAM,OAAO,OAAO;AAAA,EACxB;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA;AAAA;AAAA,EAGX;AACJ;AArBW;AAAA,EADN,SAAS;AAAA,GALD,SAMF;AAGA;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GARlB,SASF;",
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 @property()\n public label = '';\n\n @property({ reflect: true })\n public size?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\n\n private systemResolver = new SystemResolutionController(this);\n\n @state()\n public spectrumVersion = 1;\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;AAMH,SAAO,QAAQ;AAKf,SAAQ,iBAAiB,IAAI,2BAA2B,IAAI;AAG5D,SAAO,kBAAkB;AAAA;AAAA,EAbzB,WAA2B,SAAyB;AAChD,WAAO,CAAC,UAAU;AAAA,EACtB;AAAA,EAamB,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;AAhCW;AAAA,EADN,SAAS;AAAA,GALD,SAMF;AAGA;AAAA,EADN,SAAS,EAAE,SAAS,KAAK,CAAC;AAAA,GARlB,SASF;AAKA;AAAA,EADN,MAAM;AAAA,GAbE,SAcF;",
6
6
  "names": []
7
7
  }
package/src/IconBase.js CHANGED
@@ -1,4 +1,4 @@
1
- "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`
1
+ "use strict";var u=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var l=(i,r,e,s)=>{for(var t=s>1?void 0:s?a(r,e):r,o=i.length-1,p;o>=0;o--)(p=i[o])&&(t=(s?p(r,e,t):p(t))||t);return s&&t&&u(r,e,t),t};import{html as d,SpectrumElement as y}from"@spectrum-web-components/base";import{SystemResolutionController as b,systemResolverUpdatedSymbol as c}from"@spectrum-web-components/reactive-controllers/src/SystemContextResolution.js";import{property as m,state as h}from"@spectrum-web-components/base/src/decorators.js";import n from"./icon.css.js";export class IconBase extends y{constructor(){super(...arguments);this.label="";this.systemResolver=new b(this);this.spectrumVersion=1}static get styles(){return[n]}update(e){e.has("label")&&(this.label?this.removeAttribute("aria-hidden"):this.setAttribute("aria-hidden","true")),e.has(c)&&(this.spectrumVersion=this.systemResolver.system==="spectrum-two"?2:1),super.update(e)}render(){return d`
2
2
  <slot></slot>
3
- `}}p([u()],IconBase.prototype,"label",2),p([u({reflect:!0})],IconBase.prototype,"size",2);
3
+ `}}l([m()],IconBase.prototype,"label",2),l([m({reflect:!0})],IconBase.prototype,"size",2),l([h()],IconBase.prototype,"spectrumVersion",2);
4
4
  //# sourceMappingURL=IconBase.js.map
@@ -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 { property } 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 @property()\n public label = '';\n\n @property({ reflect: true })\n public size?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\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 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,OAAS,YAAAC,MAAgB,kDAEzB,OAAOC,MAAgB,gBAEhB,aAAM,iBAAiBF,CAAgB,CAAvC,kCAMH,KAAO,MAAQ,GALf,WAA2B,QAAyB,CAChD,MAAO,CAACE,CAAU,CACtB,CAQmB,OAAOC,EAA+B,CACjDA,EAAQ,IAAI,OAAO,IACf,KAAK,MACL,KAAK,gBAAgB,aAAa,EAElC,KAAK,aAAa,cAAe,MAAM,GAG/C,MAAM,OAAOA,CAAO,CACxB,CAEmB,QAAyB,CACxC,OAAOJ;AAAA;AAAA,SAGX,CACJ,CArBWK,EAAA,CADNH,EAAS,GALD,SAMF,qBAGAG,EAAA,CADNH,EAAS,CAAE,QAAS,EAAK,CAAC,GARlB,SASF",
6
- "names": ["html", "SpectrumElement", "property", "iconStyles", "changes", "__decorateClass"]
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 @property()\n public label = '';\n\n @property({ reflect: true })\n public size?: 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';\n\n private systemResolver = new SystemResolutionController(this);\n\n @state()\n public spectrumVersion = 1;\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,kCAMH,KAAO,MAAQ,GAKf,KAAQ,eAAiB,IAAIC,EAA2B,IAAI,EAG5D,KAAO,gBAAkB,EAbzB,WAA2B,QAAyB,CAChD,MAAO,CAACI,CAAU,CACtB,CAamB,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,CAhCWQ,EAAA,CADNJ,EAAS,GALD,SAMF,qBAGAI,EAAA,CADNJ,EAAS,CAAE,QAAS,EAAK,CAAC,GARlB,SASF,oBAKAI,EAAA,CADNH,EAAM,GAbE,SAcF",
6
+ "names": ["html", "SpectrumElement", "SystemResolutionController", "systemResolverUpdatedSymbol", "property", "state", "iconStyles", "changes", "__decorateClass"]
7
7
  }