@spectrum-web-components/avatar 0.9.11 → 0.9.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@
4
4
  "modules": [
5
5
  {
6
6
  "kind": "javascript-module",
7
- "path": "sp-avatar.ts",
7
+ "path": "sp-avatar.js",
8
8
  "declarations": [],
9
9
  "exports": [
10
10
  {
@@ -19,7 +19,7 @@
19
19
  },
20
20
  {
21
21
  "kind": "javascript-module",
22
- "path": "src/Avatar.ts",
22
+ "path": "src/Avatar.js",
23
23
  "declarations": [
24
24
  {
25
25
  "kind": "class",
@@ -102,7 +102,7 @@
102
102
  "name": "Avatar",
103
103
  "declaration": {
104
104
  "name": "Avatar",
105
- "module": "src/Avatar.ts"
105
+ "module": "src/Avatar.js"
106
106
  }
107
107
  }
108
108
  ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/avatar",
3
- "version": "0.9.11",
3
+ "version": "0.9.12",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -20,11 +20,24 @@
20
20
  "module": "./src/index.js",
21
21
  "type": "module",
22
22
  "exports": {
23
- ".": "./src/index.js",
24
- "./src/*": "./src/*",
23
+ ".": {
24
+ "development": "./src/index.dev.js",
25
+ "default": "./src/index.js"
26
+ },
25
27
  "./package.json": "./package.json",
26
- "./sp-avatar": "./sp-avatar.js",
27
- "./sp-avatar.js": "./sp-avatar.js"
28
+ "./src/Avatar.js": {
29
+ "development": "./src/Avatar.dev.js",
30
+ "default": "./src/Avatar.js"
31
+ },
32
+ "./src/avatar.css.js": "./src/avatar.css.js",
33
+ "./src/index.js": {
34
+ "development": "./src/index.dev.js",
35
+ "default": "./src/index.js"
36
+ },
37
+ "./sp-avatar.js": {
38
+ "development": "./sp-avatar.dev.js",
39
+ "default": "./sp-avatar.js"
40
+ }
28
41
  },
29
42
  "scripts": {
30
43
  "test": "echo \"Error: run tests from mono-repo root.\" && exit 1"
@@ -44,7 +57,7 @@
44
57
  "lit-html"
45
58
  ],
46
59
  "dependencies": {
47
- "@spectrum-web-components/base": "^0.5.8",
60
+ "@spectrum-web-components/base": "^0.6.0",
48
61
  "tslib": "^2.0.0"
49
62
  },
50
63
  "devDependencies": {
@@ -55,5 +68,5 @@
55
68
  "sideEffects": [
56
69
  "./sp-*.js"
57
70
  ],
58
- "gitHead": "3be62133721efba844cd7032566a2c49ed6d9875"
71
+ "gitHead": "50cac779bbb0d6735c2061f1eceb86b9daf9b22b"
59
72
  }
@@ -0,0 +1,3 @@
1
+ import { Avatar } from "./src/Avatar.dev.js";
2
+ customElements.define("sp-avatar", Avatar);
3
+ //# sourceMappingURL=sp-avatar.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["sp-avatar.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*/\nimport { Avatar } from './src/Avatar.dev.js'\n\ncustomElements.define('sp-avatar', Avatar);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-avatar': Avatar;\n }\n}\n"],
5
+ "mappings": "AAWA;AAEA,eAAe,OAAO,aAAa,MAAM;",
6
+ "names": []
7
+ }
package/sp-avatar.js CHANGED
@@ -1,14 +1,3 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import { Avatar } from './src/Avatar.js';
13
- customElements.define('sp-avatar', Avatar);
14
- //# sourceMappingURL=sp-avatar.js.map
1
+ import { Avatar } from "./src/Avatar.js";
2
+ customElements.define("sp-avatar", Avatar);
3
+ //# sourceMappingURL=sp-avatar.js.map
package/sp-avatar.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"sp-avatar.js","sourceRoot":"","sources":["sp-avatar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,cAAc,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC","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*/\nimport { Avatar } from './src/Avatar.js';\n\ncustomElements.define('sp-avatar', Avatar);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-avatar': Avatar;\n }\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["sp-avatar.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*/\nimport { Avatar } from './src/Avatar.js';\n\ncustomElements.define('sp-avatar', Avatar);\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'sp-avatar': Avatar;\n }\n}\n"],
5
+ "mappings": "AAWA;AAEA,eAAe,OAAO,aAAa,MAAM;",
6
+ "names": []
7
+ }
@@ -0,0 +1,72 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result)
9
+ __defProp(target, key, result);
10
+ return result;
11
+ };
12
+ import {
13
+ html,
14
+ SpectrumElement
15
+ } from "@spectrum-web-components/base";
16
+ import { property } from "@spectrum-web-components/base/src/decorators.js";
17
+ import { ifDefined } from "@spectrum-web-components/base/src/directives.js";
18
+ import avatarStyles from "./avatar.css.js";
19
+ const validSizes = [50, 75, 100, 200, 300, 400, 500, 600, 700];
20
+ const defaultSize = validSizes[2];
21
+ export class Avatar extends SpectrumElement {
22
+ constructor() {
23
+ super(...arguments);
24
+ this.label = "";
25
+ this.src = "";
26
+ this._size = defaultSize;
27
+ }
28
+ static get styles() {
29
+ return [avatarStyles];
30
+ }
31
+ get size() {
32
+ return this._size;
33
+ }
34
+ set size(value) {
35
+ const size = value;
36
+ const validSize = validSizes.includes(size) ? size : defaultSize;
37
+ if (validSize) {
38
+ this.setAttribute("size", `${validSize}`);
39
+ }
40
+ if (this._size === validSize) {
41
+ return;
42
+ }
43
+ const oldSize = this._size;
44
+ this._size = validSize;
45
+ this.requestUpdate("size", oldSize);
46
+ }
47
+ render() {
48
+ return html`
49
+ <img
50
+ class="image"
51
+ alt=${ifDefined(this.label || void 0)}
52
+ src=${this.src}
53
+ />
54
+ `;
55
+ }
56
+ firstUpdated(changes) {
57
+ super.firstUpdated(changes);
58
+ if (!this.hasAttribute("size")) {
59
+ this.setAttribute("size", `${this.size}`);
60
+ }
61
+ }
62
+ }
63
+ __decorateClass([
64
+ property()
65
+ ], Avatar.prototype, "label", 2);
66
+ __decorateClass([
67
+ property()
68
+ ], Avatar.prototype, "src", 2);
69
+ __decorateClass([
70
+ property({ type: Number, reflect: true })
71
+ ], Avatar.prototype, "size", 1);
72
+ //# sourceMappingURL=Avatar.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["Avatar.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';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport avatarStyles from './avatar.css.js';\n\nexport type AvatarSize = 50 | 75 | 100 | 200 | 300 | 400 | 500 | 600 | 700;\nconst validSizes: AvatarSize[] = [50, 75, 100, 200, 300, 400, 500, 600, 700];\nconst defaultSize = validSizes[2];\n\n/**\n * @element sp-avatar\n */\nexport class Avatar extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [avatarStyles];\n }\n\n @property()\n public label = '';\n\n @property()\n public src = '';\n\n @property({ type: Number, reflect: true })\n public get size(): AvatarSize {\n return this._size;\n }\n\n public set size(value: AvatarSize) {\n const size = value;\n const validSize = (\n validSizes.includes(size) ? size : defaultSize\n ) as AvatarSize;\n if (validSize) {\n this.setAttribute('size', `${validSize}`);\n }\n if (this._size === validSize) {\n return;\n }\n const oldSize = this._size;\n this._size = validSize;\n this.requestUpdate('size', oldSize);\n }\n\n private _size = defaultSize;\n\n protected override render(): TemplateResult {\n return html`\n <img\n class=\"image\"\n alt=${ifDefined(this.label || undefined)}\n src=${this.src}\n />\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n if (!this.hasAttribute('size')) {\n this.setAttribute('size', `${this.size}`);\n }\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAAA;AAOA;AACA;AAEA;AAGA,MAAM,aAA2B,CAAC,IAAI,IAAI,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAG;AAC3E,MAAM,cAAc,WAAW;AAKxB,aAAM,eAAe,gBAAgB;AAAA,EAArC;AAAA;AAMI,iBAAQ;AAGR,eAAM;AAuBL,iBAAQ;AAAA;AAAA,aA/BW,SAAyB;AAChD,WAAO,CAAC,YAAY;AAAA,EACxB;AAAA,MASW,OAAmB;AAC1B,WAAO,KAAK;AAAA,EAChB;AAAA,MAEW,KAAK,OAAmB;AAC/B,UAAM,OAAO;AACb,UAAM,YACF,WAAW,SAAS,IAAI,IAAI,OAAO;AAEvC,QAAI,WAAW;AACX,WAAK,aAAa,QAAQ,GAAG,WAAW;AAAA,IAC5C;AACA,QAAI,KAAK,UAAU,WAAW;AAC1B;AAAA,IACJ;AACA,UAAM,UAAU,KAAK;AACrB,SAAK,QAAQ;AACb,SAAK,cAAc,QAAQ,OAAO;AAAA,EACtC;AAAA,EAImB,SAAyB;AACxC,WAAO;AAAA;AAAA;AAAA,sBAGO,UAAU,KAAK,SAAS,MAAS;AAAA,sBACjC,KAAK;AAAA;AAAA;AAAA,EAGvB;AAAA,EAEmB,aAAa,SAA+B;AAC3D,UAAM,aAAa,OAAO;AAC1B,QAAI,CAAC,KAAK,aAAa,MAAM,GAAG;AAC5B,WAAK,aAAa,QAAQ,GAAG,KAAK,MAAM;AAAA,IAC5C;AAAA,EACJ;AACJ;AA5CW;AAAA,EADP,AAAC,SAAS;AAAA,GACH,AANJ,OAMI;AAGA;AAAA,EADP,AAAC,SAAS;AAAA,GACH,AATJ,OASI;AAGI;AAAA,EADX,AAAC,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GAC9B,AAZR,OAYQ;",
6
+ "names": []
7
+ }
package/src/Avatar.js CHANGED
@@ -1,73 +1,72 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import { __decorate } from "tslib";
13
- import { html, SpectrumElement, } from '@spectrum-web-components/base';
14
- import { property } from '@spectrum-web-components/base/src/decorators.js';
15
- import { ifDefined } from '@spectrum-web-components/base/src/directives.js';
16
- import avatarStyles from './avatar.css.js';
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __decorateClass = (decorators, target, key, kind) => {
4
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
5
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
6
+ if (decorator = decorators[i])
7
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
8
+ if (kind && result)
9
+ __defProp(target, key, result);
10
+ return result;
11
+ };
12
+ import {
13
+ html,
14
+ SpectrumElement
15
+ } from "@spectrum-web-components/base";
16
+ import { property } from "@spectrum-web-components/base/src/decorators.js";
17
+ import { ifDefined } from "@spectrum-web-components/base/src/directives.js";
18
+ import avatarStyles from "./avatar.css.js";
17
19
  const validSizes = [50, 75, 100, 200, 300, 400, 500, 600, 700];
18
20
  const defaultSize = validSizes[2];
19
- /**
20
- * @element sp-avatar
21
- */
22
21
  export class Avatar extends SpectrumElement {
23
- constructor() {
24
- super(...arguments);
25
- this.label = '';
26
- this.src = '';
27
- this._size = defaultSize;
22
+ constructor() {
23
+ super(...arguments);
24
+ this.label = "";
25
+ this.src = "";
26
+ this._size = defaultSize;
27
+ }
28
+ static get styles() {
29
+ return [avatarStyles];
30
+ }
31
+ get size() {
32
+ return this._size;
33
+ }
34
+ set size(value) {
35
+ const size = value;
36
+ const validSize = validSizes.includes(size) ? size : defaultSize;
37
+ if (validSize) {
38
+ this.setAttribute("size", `${validSize}`);
28
39
  }
29
- static get styles() {
30
- return [avatarStyles];
40
+ if (this._size === validSize) {
41
+ return;
31
42
  }
32
- get size() {
33
- return this._size;
34
- }
35
- set size(value) {
36
- const size = value;
37
- const validSize = (validSizes.includes(size) ? size : defaultSize);
38
- if (validSize) {
39
- this.setAttribute('size', `${validSize}`);
40
- }
41
- if (this._size === validSize) {
42
- return;
43
- }
44
- const oldSize = this._size;
45
- this._size = validSize;
46
- this.requestUpdate('size', oldSize);
47
- }
48
- render() {
49
- return html `
43
+ const oldSize = this._size;
44
+ this._size = validSize;
45
+ this.requestUpdate("size", oldSize);
46
+ }
47
+ render() {
48
+ return html`
50
49
  <img
51
50
  class="image"
52
- alt=${ifDefined(this.label || undefined)}
51
+ alt=${ifDefined(this.label || void 0)}
53
52
  src=${this.src}
54
53
  />
55
54
  `;
55
+ }
56
+ firstUpdated(changes) {
57
+ super.firstUpdated(changes);
58
+ if (!this.hasAttribute("size")) {
59
+ this.setAttribute("size", `${this.size}`);
56
60
  }
57
- firstUpdated(changes) {
58
- super.firstUpdated(changes);
59
- if (!this.hasAttribute('size')) {
60
- this.setAttribute('size', `${this.size}`);
61
- }
62
- }
61
+ }
63
62
  }
64
- __decorate([
65
- property()
66
- ], Avatar.prototype, "label", void 0);
67
- __decorate([
68
- property()
69
- ], Avatar.prototype, "src", void 0);
70
- __decorate([
71
- property({ type: Number, reflect: true })
72
- ], Avatar.prototype, "size", null);
73
- //# sourceMappingURL=Avatar.js.map
63
+ __decorateClass([
64
+ property()
65
+ ], Avatar.prototype, "label", 2);
66
+ __decorateClass([
67
+ property()
68
+ ], Avatar.prototype, "src", 2);
69
+ __decorateClass([
70
+ property({ type: Number, reflect: true })
71
+ ], Avatar.prototype, "size", 1);
72
+ //# sourceMappingURL=Avatar.js.map
package/src/Avatar.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"Avatar.js","sourceRoot":"","sources":["Avatar.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;;AAEF,OAAO,EAEH,IAAI,EAEJ,eAAe,GAElB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,iDAAiD,CAAC;AAC3E,OAAO,EAAE,SAAS,EAAE,MAAM,iDAAiD,CAAC;AAE5E,OAAO,YAAY,MAAM,iBAAiB,CAAC;AAG3C,MAAM,UAAU,GAAiB,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAC7E,MAAM,WAAW,GAAG,UAAU,CAAC,CAAC,CAAC,CAAC;AAElC;;GAEG;AACH,MAAM,OAAO,MAAO,SAAQ,eAAe;IAA3C;;QAMW,UAAK,GAAG,EAAE,CAAC;QAGX,QAAG,GAAG,EAAE,CAAC;QAuBR,UAAK,GAAG,WAAW,CAAC;IAkBhC,CAAC;IAjDU,MAAM,KAAc,MAAM;QAC7B,OAAO,CAAC,YAAY,CAAC,CAAC;IAC1B,CAAC;IASD,IAAW,IAAI;QACX,OAAO,IAAI,CAAC,KAAK,CAAC;IACtB,CAAC;IAED,IAAW,IAAI,CAAC,KAAiB;QAC7B,MAAM,IAAI,GAAG,KAAK,CAAC;QACnB,MAAM,SAAS,GAAG,CACd,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,WAAW,CACnC,CAAC;QAChB,IAAI,SAAS,EAAE;YACX,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,SAAS,EAAE,CAAC,CAAC;SAC7C;QACD,IAAI,IAAI,CAAC,KAAK,KAAK,SAAS,EAAE;YAC1B,OAAO;SACV;QACD,MAAM,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC;QAC3B,IAAI,CAAC,KAAK,GAAG,SAAS,CAAC;QACvB,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;IAIkB,MAAM;QACrB,OAAO,IAAI,CAAA;;;sBAGG,SAAS,CAAC,IAAI,CAAC,KAAK,IAAI,SAAS,CAAC;sBAClC,IAAI,CAAC,GAAG;;SAErB,CAAC;IACN,CAAC;IAEkB,YAAY,CAAC,OAAuB;QACnD,KAAK,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC5B,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE;YAC5B,IAAI,CAAC,YAAY,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC;SAC7C;IACL,CAAC;CACJ;AA5CG;IADC,QAAQ,EAAE;qCACO;AAGlB;IADC,QAAQ,EAAE;mCACK;AAGhB;IADC,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;kCAGzC","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';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport avatarStyles from './avatar.css.js';\n\nexport type AvatarSize = 50 | 75 | 100 | 200 | 300 | 400 | 500 | 600 | 700;\nconst validSizes: AvatarSize[] = [50, 75, 100, 200, 300, 400, 500, 600, 700];\nconst defaultSize = validSizes[2];\n\n/**\n * @element sp-avatar\n */\nexport class Avatar extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [avatarStyles];\n }\n\n @property()\n public label = '';\n\n @property()\n public src = '';\n\n @property({ type: Number, reflect: true })\n public get size(): AvatarSize {\n return this._size;\n }\n\n public set size(value: AvatarSize) {\n const size = value;\n const validSize = (\n validSizes.includes(size) ? size : defaultSize\n ) as AvatarSize;\n if (validSize) {\n this.setAttribute('size', `${validSize}`);\n }\n if (this._size === validSize) {\n return;\n }\n const oldSize = this._size;\n this._size = validSize;\n this.requestUpdate('size', oldSize);\n }\n\n private _size = defaultSize;\n\n protected override render(): TemplateResult {\n return html`\n <img\n class=\"image\"\n alt=${ifDefined(this.label || undefined)}\n src=${this.src}\n />\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n if (!this.hasAttribute('size')) {\n this.setAttribute('size', `${this.size}`);\n }\n }\n}\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["Avatar.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';\nimport { ifDefined } from '@spectrum-web-components/base/src/directives.js';\n\nimport avatarStyles from './avatar.css.js';\n\nexport type AvatarSize = 50 | 75 | 100 | 200 | 300 | 400 | 500 | 600 | 700;\nconst validSizes: AvatarSize[] = [50, 75, 100, 200, 300, 400, 500, 600, 700];\nconst defaultSize = validSizes[2];\n\n/**\n * @element sp-avatar\n */\nexport class Avatar extends SpectrumElement {\n public static override get styles(): CSSResultArray {\n return [avatarStyles];\n }\n\n @property()\n public label = '';\n\n @property()\n public src = '';\n\n @property({ type: Number, reflect: true })\n public get size(): AvatarSize {\n return this._size;\n }\n\n public set size(value: AvatarSize) {\n const size = value;\n const validSize = (\n validSizes.includes(size) ? size : defaultSize\n ) as AvatarSize;\n if (validSize) {\n this.setAttribute('size', `${validSize}`);\n }\n if (this._size === validSize) {\n return;\n }\n const oldSize = this._size;\n this._size = validSize;\n this.requestUpdate('size', oldSize);\n }\n\n private _size = defaultSize;\n\n protected override render(): TemplateResult {\n return html`\n <img\n class=\"image\"\n alt=${ifDefined(this.label || undefined)}\n src=${this.src}\n />\n `;\n }\n\n protected override firstUpdated(changes: PropertyValues): void {\n super.firstUpdated(changes);\n if (!this.hasAttribute('size')) {\n this.setAttribute('size', `${this.size}`);\n }\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;AAYA;AAAA;AAAA;AAAA;AAOA;AACA;AAEA;AAGA,MAAM,aAA2B,CAAC,IAAI,IAAI,KAAK,KAAK,KAAK,KAAK,KAAK,KAAK,GAAG;AAC3E,MAAM,cAAc,WAAW;AAKxB,aAAM,eAAe,gBAAgB;AAAA,EAArC;AAAA;AAMI,iBAAQ;AAGR,eAAM;AAuBL,iBAAQ;AAAA;AAAA,aA/BW,SAAyB;AAChD,WAAO,CAAC,YAAY;AAAA,EACxB;AAAA,MASW,OAAmB;AAC1B,WAAO,KAAK;AAAA,EAChB;AAAA,MAEW,KAAK,OAAmB;AAC/B,UAAM,OAAO;AACb,UAAM,YACF,WAAW,SAAS,IAAI,IAAI,OAAO;AAEvC,QAAI,WAAW;AACX,WAAK,aAAa,QAAQ,GAAG,WAAW;AAAA,IAC5C;AACA,QAAI,KAAK,UAAU,WAAW;AAC1B;AAAA,IACJ;AACA,UAAM,UAAU,KAAK;AACrB,SAAK,QAAQ;AACb,SAAK,cAAc,QAAQ,OAAO;AAAA,EACtC;AAAA,EAImB,SAAyB;AACxC,WAAO;AAAA;AAAA;AAAA,sBAGO,UAAU,KAAK,SAAS,MAAS;AAAA,sBACjC,KAAK;AAAA;AAAA;AAAA,EAGvB;AAAA,EAEmB,aAAa,SAA+B;AAC3D,UAAM,aAAa,OAAO;AAC1B,QAAI,CAAC,KAAK,aAAa,MAAM,GAAG;AAC5B,WAAK,aAAa,QAAQ,GAAG,KAAK,MAAM;AAAA,IAC5C;AAAA,EACJ;AACJ;AA5CW;AAAA,EADP,AAAC,SAAS;AAAA,GACH,AANJ,OAMI;AAGA;AAAA,EADP,AAAC,SAAS;AAAA,GACH,AATJ,OASI;AAGI;AAAA,EADX,AAAC,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GAC9B,AAZR,OAYQ;",
6
+ "names": []
7
+ }
@@ -0,0 +1,84 @@
1
+ import { css } from "@spectrum-web-components/base";
2
+ const styles = css`
3
+ :host([size="50"]){--spectrum-avatar-border-radius:var(
4
+ --spectrum-avatar-size-50-border-radius,var(--spectrum-global-dimension-static-percent-50)
5
+ );--spectrum-avatar-border-size:var(
6
+ --spectrum-avatar-size-50-border-size,var(--spectrum-alias-avatar-border-size)
7
+ );--spectrum-avatar-width:var(
8
+ --spectrum-avatar-size-50-width,var(--spectrum-alias-avatar-size-50)
9
+ );--spectrum-avatar-height:var(
10
+ --spectrum-avatar-size-50-height,var(--spectrum-alias-avatar-size-50)
11
+ )}:host([size="75"]){--spectrum-avatar-border-radius:var(
12
+ --spectrum-avatar-size-75-border-radius,var(--spectrum-global-dimension-static-percent-50)
13
+ );--spectrum-avatar-border-size:var(
14
+ --spectrum-avatar-size-75-border-size,var(--spectrum-alias-avatar-border-size)
15
+ );--spectrum-avatar-width:var(
16
+ --spectrum-avatar-size-75-width,var(--spectrum-alias-avatar-size-75)
17
+ );--spectrum-avatar-height:var(
18
+ --spectrum-avatar-size-75-height,var(--spectrum-alias-avatar-size-75)
19
+ )}:host([size="100"]){--spectrum-avatar-border-radius:var(
20
+ --spectrum-avatar-size-100-border-radius,var(--spectrum-global-dimension-static-percent-50)
21
+ );--spectrum-avatar-border-size:var(
22
+ --spectrum-avatar-size-100-border-size,var(--spectrum-alias-avatar-border-size)
23
+ );--spectrum-avatar-width:var(
24
+ --spectrum-avatar-size-100-width,var(--spectrum-alias-avatar-size-100)
25
+ );--spectrum-avatar-height:var(
26
+ --spectrum-avatar-size-100-height,var(--spectrum-alias-avatar-size-100)
27
+ )}:host([size="200"]){--spectrum-avatar-border-radius:var(
28
+ --spectrum-avatar-size-200-border-radius,var(--spectrum-global-dimension-static-percent-50)
29
+ );--spectrum-avatar-border-size:var(
30
+ --spectrum-avatar-size-200-border-size,var(--spectrum-alias-avatar-border-size)
31
+ );--spectrum-avatar-width:var(
32
+ --spectrum-avatar-size-200-width,var(--spectrum-alias-avatar-size-200)
33
+ );--spectrum-avatar-height:var(
34
+ --spectrum-avatar-size-200-height,var(--spectrum-alias-avatar-size-200)
35
+ )}:host([size="300"]){--spectrum-avatar-border-radius:var(
36
+ --spectrum-avatar-size-300-border-radius,var(--spectrum-global-dimension-static-percent-50)
37
+ );--spectrum-avatar-border-size:var(
38
+ --spectrum-avatar-size-300-border-size,var(--spectrum-alias-avatar-border-size)
39
+ );--spectrum-avatar-width:var(
40
+ --spectrum-avatar-size-300-width,var(--spectrum-alias-avatar-size-300)
41
+ );--spectrum-avatar-height:var(
42
+ --spectrum-avatar-size-300-height,var(--spectrum-alias-avatar-size-300)
43
+ )}:host([size="400"]){--spectrum-avatar-border-radius:var(
44
+ --spectrum-avatar-size-400-border-radius,var(--spectrum-global-dimension-static-percent-50)
45
+ );--spectrum-avatar-border-size:var(
46
+ --spectrum-avatar-size-400-border-size,var(--spectrum-alias-avatar-border-size)
47
+ );--spectrum-avatar-width:var(
48
+ --spectrum-avatar-size-400-width,var(--spectrum-alias-avatar-size-400)
49
+ );--spectrum-avatar-height:var(
50
+ --spectrum-avatar-size-400-height,var(--spectrum-alias-avatar-size-400)
51
+ )}:host([size="500"]){--spectrum-avatar-border-radius:var(
52
+ --spectrum-avatar-size-500-border-radius,var(--spectrum-global-dimension-static-percent-50)
53
+ );--spectrum-avatar-border-size:var(
54
+ --spectrum-avatar-size-500-border-size,var(--spectrum-alias-avatar-border-size)
55
+ );--spectrum-avatar-width:var(
56
+ --spectrum-avatar-size-500-width,var(--spectrum-alias-avatar-size-500)
57
+ );--spectrum-avatar-height:var(
58
+ --spectrum-avatar-size-500-height,var(--spectrum-alias-avatar-size-500)
59
+ )}:host([size="600"]){--spectrum-avatar-border-radius:var(
60
+ --spectrum-avatar-size-600-border-radius,var(--spectrum-global-dimension-static-percent-50)
61
+ );--spectrum-avatar-border-size:var(
62
+ --spectrum-avatar-size-600-border-size,var(--spectrum-alias-avatar-border-size)
63
+ );--spectrum-avatar-width:var(
64
+ --spectrum-avatar-size-600-width,var(--spectrum-alias-avatar-size-600)
65
+ );--spectrum-avatar-height:var(
66
+ --spectrum-avatar-size-600-height,var(--spectrum-alias-avatar-size-600)
67
+ )}:host([size="700"]){--spectrum-avatar-border-radius:var(
68
+ --spectrum-avatar-size-700-border-radius,var(--spectrum-global-dimension-static-percent-50)
69
+ );--spectrum-avatar-border-size:var(
70
+ --spectrum-avatar-size-700-border-size,var(--spectrum-alias-avatar-border-size)
71
+ );--spectrum-avatar-width:var(
72
+ --spectrum-avatar-size-700-width,var(--spectrum-alias-avatar-size-700)
73
+ );--spectrum-avatar-height:var(
74
+ --spectrum-avatar-size-700-height,var(--spectrum-alias-avatar-size-700)
75
+ )}:host{-webkit-user-drag:none;border-radius:var(--spectrum-avatar-border-radius);border-width:0;display:inline-block;height:var(--spectrum-avatar-height);position:relative;-webkit-user-select:none;user-select:none;width:var(--spectrum-avatar-width)}:host([dir=ltr]):after{left:0}:host([dir=rtl]):after{right:0}:host([dir=ltr]):after{right:0}:host([dir=rtl]):after{left:0}:host:after{border-radius:var(--spectrum-avatar-border-radius);border-style:solid;border-width:var(--spectrum-avatar-border-size);bottom:0;box-sizing:border-box;content:"";position:absolute;top:0}.image{height:var(--spectrum-avatar-height);width:var(--spectrum-avatar-width)}:host{opacity:var(
76
+ --spectrum-avatar-size-100-opacity,var(--spectrum-global-color-opacity-100)
77
+ )}:host:after{border-color:var(
78
+ --spectrum-avatar-size-100-border-color,var(--spectrum-alias-avatar-border-color-default)
79
+ )}:host([disabled]){opacity:var(
80
+ --spectrum-avatar-size-100-opacity-disabled,var(--spectrum-global-color-opacity-30)
81
+ )}@media (forced-colors:active){:host([disabled]){opacity:1;outline:2px solid GrayText}}:host{overflow:hidden}img{vertical-align:top}
82
+ `;
83
+ export default styles;
84
+ //# sourceMappingURL=avatar.css.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["avatar.css.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 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*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host([size=\"50\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-50-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-50-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-50-width,var(--spectrum-alias-avatar-size-50)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-50-height,var(--spectrum-alias-avatar-size-50)\n)}:host([size=\"75\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-75-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-75-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-75-width,var(--spectrum-alias-avatar-size-75)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-75-height,var(--spectrum-alias-avatar-size-75)\n)}:host([size=\"100\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-100-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-100-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-100-width,var(--spectrum-alias-avatar-size-100)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-100-height,var(--spectrum-alias-avatar-size-100)\n)}:host([size=\"200\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-200-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-200-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-200-width,var(--spectrum-alias-avatar-size-200)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-200-height,var(--spectrum-alias-avatar-size-200)\n)}:host([size=\"300\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-300-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-300-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-300-width,var(--spectrum-alias-avatar-size-300)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-300-height,var(--spectrum-alias-avatar-size-300)\n)}:host([size=\"400\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-400-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-400-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-400-width,var(--spectrum-alias-avatar-size-400)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-400-height,var(--spectrum-alias-avatar-size-400)\n)}:host([size=\"500\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-500-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-500-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-500-width,var(--spectrum-alias-avatar-size-500)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-500-height,var(--spectrum-alias-avatar-size-500)\n)}:host([size=\"600\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-600-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-600-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-600-width,var(--spectrum-alias-avatar-size-600)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-600-height,var(--spectrum-alias-avatar-size-600)\n)}:host([size=\"700\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-700-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-700-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-700-width,var(--spectrum-alias-avatar-size-700)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-700-height,var(--spectrum-alias-avatar-size-700)\n)}:host{-webkit-user-drag:none;border-radius:var(--spectrum-avatar-border-radius);border-width:0;display:inline-block;height:var(--spectrum-avatar-height);position:relative;-webkit-user-select:none;user-select:none;width:var(--spectrum-avatar-width)}:host([dir=ltr]):after{left:0}:host([dir=rtl]):after{right:0}:host([dir=ltr]):after{right:0}:host([dir=rtl]):after{left:0}:host:after{border-radius:var(--spectrum-avatar-border-radius);border-style:solid;border-width:var(--spectrum-avatar-border-size);bottom:0;box-sizing:border-box;content:\"\";position:absolute;top:0}.image{height:var(--spectrum-avatar-height);width:var(--spectrum-avatar-width)}:host{opacity:var(\n--spectrum-avatar-size-100-opacity,var(--spectrum-global-color-opacity-100)\n)}:host:after{border-color:var(\n--spectrum-avatar-size-100-border-color,var(--spectrum-alias-avatar-border-color-default)\n)}:host([disabled]){opacity:var(\n--spectrum-avatar-size-100-opacity-disabled,var(--spectrum-global-color-opacity-30)\n)}@media (forced-colors:active){:host([disabled]){opacity:1;outline:2px solid GrayText}}:host{overflow:hidden}img{vertical-align:top}\n`;\nexport default styles;"],
5
+ "mappings": "AAWA;AACA,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiFf,eAAe;",
6
+ "names": []
7
+ }
package/src/avatar.css.js CHANGED
@@ -1,16 +1,5 @@
1
- /*
2
- Copyright 2022 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- import { css } from '@spectrum-web-components/base';
13
- const styles = css `
1
+ import { css } from "@spectrum-web-components/base";
2
+ const styles = css`
14
3
  :host([size="50"]){--spectrum-avatar-border-radius:var(
15
4
  --spectrum-avatar-size-50-border-radius,var(--spectrum-global-dimension-static-percent-50)
16
5
  );--spectrum-avatar-border-size:var(
@@ -92,4 +81,4 @@ const styles = css `
92
81
  )}@media (forced-colors:active){:host([disabled]){opacity:1;outline:2px solid GrayText}}:host{overflow:hidden}img{vertical-align:top}
93
82
  `;
94
83
  export default styles;
95
- //# sourceMappingURL=avatar.css.js.map
84
+ //# sourceMappingURL=avatar.css.js.map
@@ -1 +1,7 @@
1
- {"version":3,"file":"avatar.css.js","sourceRoot":"","sources":["avatar.css.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,OAAO,EAAE,GAAG,EAAE,MAAM,+BAA+B,CAAC;AACpD,MAAM,MAAM,GAAG,GAAG,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgFjB,CAAC;AACF,eAAe,MAAM,CAAC","sourcesContent":["/*\nCopyright 2022 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*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host([size=\"50\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-50-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-50-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-50-width,var(--spectrum-alias-avatar-size-50)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-50-height,var(--spectrum-alias-avatar-size-50)\n)}:host([size=\"75\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-75-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-75-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-75-width,var(--spectrum-alias-avatar-size-75)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-75-height,var(--spectrum-alias-avatar-size-75)\n)}:host([size=\"100\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-100-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-100-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-100-width,var(--spectrum-alias-avatar-size-100)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-100-height,var(--spectrum-alias-avatar-size-100)\n)}:host([size=\"200\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-200-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-200-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-200-width,var(--spectrum-alias-avatar-size-200)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-200-height,var(--spectrum-alias-avatar-size-200)\n)}:host([size=\"300\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-300-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-300-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-300-width,var(--spectrum-alias-avatar-size-300)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-300-height,var(--spectrum-alias-avatar-size-300)\n)}:host([size=\"400\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-400-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-400-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-400-width,var(--spectrum-alias-avatar-size-400)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-400-height,var(--spectrum-alias-avatar-size-400)\n)}:host([size=\"500\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-500-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-500-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-500-width,var(--spectrum-alias-avatar-size-500)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-500-height,var(--spectrum-alias-avatar-size-500)\n)}:host([size=\"600\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-600-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-600-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-600-width,var(--spectrum-alias-avatar-size-600)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-600-height,var(--spectrum-alias-avatar-size-600)\n)}:host([size=\"700\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-700-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-700-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-700-width,var(--spectrum-alias-avatar-size-700)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-700-height,var(--spectrum-alias-avatar-size-700)\n)}:host{-webkit-user-drag:none;border-radius:var(--spectrum-avatar-border-radius);border-width:0;display:inline-block;height:var(--spectrum-avatar-height);position:relative;-webkit-user-select:none;user-select:none;width:var(--spectrum-avatar-width)}:host([dir=ltr]):after{left:0}:host([dir=rtl]):after{right:0}:host([dir=ltr]):after{right:0}:host([dir=rtl]):after{left:0}:host:after{border-radius:var(--spectrum-avatar-border-radius);border-style:solid;border-width:var(--spectrum-avatar-border-size);bottom:0;box-sizing:border-box;content:\"\";position:absolute;top:0}.image{height:var(--spectrum-avatar-height);width:var(--spectrum-avatar-width)}:host{opacity:var(\n--spectrum-avatar-size-100-opacity,var(--spectrum-global-color-opacity-100)\n)}:host:after{border-color:var(\n--spectrum-avatar-size-100-border-color,var(--spectrum-alias-avatar-border-color-default)\n)}:host([disabled]){opacity:var(\n--spectrum-avatar-size-100-opacity-disabled,var(--spectrum-global-color-opacity-30)\n)}@media (forced-colors:active){:host([disabled]){opacity:1;outline:2px solid GrayText}}:host{overflow:hidden}img{vertical-align:top}\n`;\nexport default styles;"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["avatar.css.ts"],
4
+ "sourcesContent": ["/*\nCopyright 2022 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*/\nimport { css } from '@spectrum-web-components/base';\nconst styles = css`\n:host([size=\"50\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-50-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-50-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-50-width,var(--spectrum-alias-avatar-size-50)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-50-height,var(--spectrum-alias-avatar-size-50)\n)}:host([size=\"75\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-75-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-75-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-75-width,var(--spectrum-alias-avatar-size-75)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-75-height,var(--spectrum-alias-avatar-size-75)\n)}:host([size=\"100\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-100-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-100-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-100-width,var(--spectrum-alias-avatar-size-100)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-100-height,var(--spectrum-alias-avatar-size-100)\n)}:host([size=\"200\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-200-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-200-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-200-width,var(--spectrum-alias-avatar-size-200)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-200-height,var(--spectrum-alias-avatar-size-200)\n)}:host([size=\"300\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-300-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-300-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-300-width,var(--spectrum-alias-avatar-size-300)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-300-height,var(--spectrum-alias-avatar-size-300)\n)}:host([size=\"400\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-400-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-400-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-400-width,var(--spectrum-alias-avatar-size-400)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-400-height,var(--spectrum-alias-avatar-size-400)\n)}:host([size=\"500\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-500-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-500-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-500-width,var(--spectrum-alias-avatar-size-500)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-500-height,var(--spectrum-alias-avatar-size-500)\n)}:host([size=\"600\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-600-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-600-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-600-width,var(--spectrum-alias-avatar-size-600)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-600-height,var(--spectrum-alias-avatar-size-600)\n)}:host([size=\"700\"]){--spectrum-avatar-border-radius:var(\n--spectrum-avatar-size-700-border-radius,var(--spectrum-global-dimension-static-percent-50)\n);--spectrum-avatar-border-size:var(\n--spectrum-avatar-size-700-border-size,var(--spectrum-alias-avatar-border-size)\n);--spectrum-avatar-width:var(\n--spectrum-avatar-size-700-width,var(--spectrum-alias-avatar-size-700)\n);--spectrum-avatar-height:var(\n--spectrum-avatar-size-700-height,var(--spectrum-alias-avatar-size-700)\n)}:host{-webkit-user-drag:none;border-radius:var(--spectrum-avatar-border-radius);border-width:0;display:inline-block;height:var(--spectrum-avatar-height);position:relative;-webkit-user-select:none;user-select:none;width:var(--spectrum-avatar-width)}:host([dir=ltr]):after{left:0}:host([dir=rtl]):after{right:0}:host([dir=ltr]):after{right:0}:host([dir=rtl]):after{left:0}:host:after{border-radius:var(--spectrum-avatar-border-radius);border-style:solid;border-width:var(--spectrum-avatar-border-size);bottom:0;box-sizing:border-box;content:\"\";position:absolute;top:0}.image{height:var(--spectrum-avatar-height);width:var(--spectrum-avatar-width)}:host{opacity:var(\n--spectrum-avatar-size-100-opacity,var(--spectrum-global-color-opacity-100)\n)}:host:after{border-color:var(\n--spectrum-avatar-size-100-border-color,var(--spectrum-alias-avatar-border-color-default)\n)}:host([disabled]){opacity:var(\n--spectrum-avatar-size-100-opacity-disabled,var(--spectrum-global-color-opacity-30)\n)}@media (forced-colors:active){:host([disabled]){opacity:1;outline:2px solid GrayText}}:host{overflow:hidden}img{vertical-align:top}\n`;\nexport default styles;"],
5
+ "mappings": "AAWA;AACA,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAiFf,eAAe;",
6
+ "names": []
7
+ }
@@ -0,0 +1,2 @@
1
+ export * from "./Avatar.dev.js";
2
+ //# sourceMappingURL=index.dev.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.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*/\nexport * from './Avatar.dev.js'\n"],
5
+ "mappings": "AAWA;",
6
+ "names": []
7
+ }
package/src/index.js CHANGED
@@ -1,13 +1,2 @@
1
- /*
2
- Copyright 2020 Adobe. All rights reserved.
3
- This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
- you may not use this file except in compliance with the License. You may obtain a copy
5
- of the License at http://www.apache.org/licenses/LICENSE-2.0
6
-
7
- Unless required by applicable law or agreed to in writing, software distributed under
8
- the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
- OF ANY KIND, either express or implied. See the License for the specific language
10
- governing permissions and limitations under the License.
11
- */
12
- export * from './Avatar.js';
13
- //# sourceMappingURL=index.js.map
1
+ export * from "./Avatar.js";
2
+ //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1,7 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;EAUE;AACF,cAAc,aAAa,CAAC","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*/\nexport * from './Avatar.js';\n"]}
1
+ {
2
+ "version": 3,
3
+ "sources": ["index.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*/\nexport * from './Avatar.js';\n"],
5
+ "mappings": "AAWA;",
6
+ "names": []
7
+ }