@vaadin/avatar 24.6.0-alpha3 → 24.6.0-alpha5

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/avatar",
3
- "version": "24.6.0-alpha3",
3
+ "version": "24.6.0-alpha5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,8 +21,6 @@
21
21
  "type": "module",
22
22
  "files": [
23
23
  "src",
24
- "!src/vaadin-lit-avatar.d.ts",
25
- "!src/vaadin-lit-avatar.js",
26
24
  "theme",
27
25
  "vaadin-*.d.ts",
28
26
  "vaadin-*.js",
@@ -40,16 +38,16 @@
40
38
  "dependencies": {
41
39
  "@open-wc/dedupe-mixin": "^1.3.0",
42
40
  "@polymer/polymer": "^3.0.0",
43
- "@vaadin/a11y-base": "24.6.0-alpha3",
44
- "@vaadin/component-base": "24.6.0-alpha3",
45
- "@vaadin/tooltip": "24.6.0-alpha3",
46
- "@vaadin/vaadin-lumo-styles": "24.6.0-alpha3",
47
- "@vaadin/vaadin-material-styles": "24.6.0-alpha3",
48
- "@vaadin/vaadin-themable-mixin": "24.6.0-alpha3",
41
+ "@vaadin/a11y-base": "24.6.0-alpha5",
42
+ "@vaadin/component-base": "24.6.0-alpha5",
43
+ "@vaadin/tooltip": "24.6.0-alpha5",
44
+ "@vaadin/vaadin-lumo-styles": "24.6.0-alpha5",
45
+ "@vaadin/vaadin-material-styles": "24.6.0-alpha5",
46
+ "@vaadin/vaadin-themable-mixin": "24.6.0-alpha5",
49
47
  "lit": "^3.0.0"
50
48
  },
51
49
  "devDependencies": {
52
- "@vaadin/chai-plugins": "24.6.0-alpha3",
50
+ "@vaadin/chai-plugins": "24.6.0-alpha5",
53
51
  "@vaadin/testing-helpers": "^1.0.0",
54
52
  "sinon": "^18.0.0"
55
53
  },
@@ -57,5 +55,5 @@
57
55
  "web-types.json",
58
56
  "web-types.lit.json"
59
57
  ],
60
- "gitHead": "f917e587caaf86b3d55598233811409b0f34ff69"
58
+ "gitHead": "cbfa46fe276f254dcaa99a622710d56df7f0a539"
61
59
  }
@@ -0,0 +1,6 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2020 - 2024 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ export * from './vaadin-avatar.js';
@@ -0,0 +1,80 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2020 - 2024 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import './vaadin-avatar-icons.js';
7
+ import { html, LitElement } from 'lit';
8
+ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
+ import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
10
+ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
11
+ import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
12
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
13
+ import { AvatarMixin } from './vaadin-avatar-mixin.js';
14
+ import { avatarStyles } from './vaadin-avatar-styles.js';
15
+
16
+ /**
17
+ * LitElement based version of `<vaadin-avatar>` web component.
18
+ *
19
+ * ## Disclaimer
20
+ *
21
+ * This component is an experiment and not yet a part of Vaadin platform.
22
+ * There is no ETA regarding specific Vaadin version where it'll land.
23
+ * Feel free to try this code in your apps as per Apache 2.0 license.
24
+ */
25
+ class Avatar extends AvatarMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
26
+ static get is() {
27
+ return 'vaadin-avatar';
28
+ }
29
+
30
+ static get styles() {
31
+ return avatarStyles;
32
+ }
33
+
34
+ /** @protected */
35
+ ready() {
36
+ super.ready();
37
+
38
+ this._tooltipController = new TooltipController(this);
39
+ this.addController(this._tooltipController);
40
+ }
41
+
42
+ /** @protected */
43
+ render() {
44
+ return html`
45
+ <img
46
+ ?hidden="${!this.__imgVisible}"
47
+ src="${this.img}"
48
+ aria-hidden="true"
49
+ @error="${this.__onImageLoadError}"
50
+ draggable="false"
51
+ />
52
+ <svg
53
+ part="icon"
54
+ ?hidden="${!this.__iconVisible}"
55
+ id="avatar-icon"
56
+ viewBox="-50 -50 100 100"
57
+ preserveAspectRatio="xMidYMid meet"
58
+ aria-hidden="true"
59
+ >
60
+ <text dy=".35em" text-anchor="middle">&#xea01;</text>
61
+ </svg>
62
+ <svg
63
+ part="abbr"
64
+ ?hidden="${!this.__abbrVisible}"
65
+ id="avatar-abbr"
66
+ viewBox="-50 -50 100 100"
67
+ preserveAspectRatio="xMidYMid meet"
68
+ aria-hidden="true"
69
+ >
70
+ <text dy=".35em" text-anchor="middle">${this.abbr}</text>
71
+ </svg>
72
+
73
+ <slot name="tooltip"></slot>
74
+ `;
75
+ }
76
+ }
77
+
78
+ defineCustomElement(Avatar);
79
+
80
+ export { Avatar };
@@ -0,0 +1,3 @@
1
+ import '@vaadin/tooltip/theme/lumo/vaadin-lit-tooltip.js';
2
+ import './vaadin-avatar-styles.js';
3
+ import '../../src/vaadin-lit-avatar.js';
@@ -0,0 +1,3 @@
1
+ import '@vaadin/tooltip/theme/lumo/vaadin-lit-tooltip.js';
2
+ import './vaadin-avatar-styles.js';
3
+ import '../../src/vaadin-lit-avatar.js';
@@ -0,0 +1,3 @@
1
+ import '@vaadin/tooltip/theme/material/vaadin-lit-tooltip.js';
2
+ import './vaadin-avatar-styles.js';
3
+ import '../../src/vaadin-lit-avatar.js';
@@ -0,0 +1,3 @@
1
+ import '@vaadin/tooltip/theme/material/vaadin-lit-tooltip.js';
2
+ import './vaadin-avatar-styles.js';
3
+ import '../../src/vaadin-lit-avatar.js';
@@ -0,0 +1 @@
1
+ export * from './src/vaadin-avatar.js';
@@ -0,0 +1,2 @@
1
+ import './theme/lumo/vaadin-lit-avatar.js';
2
+ export * from './src/vaadin-lit-avatar.js';
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/avatar",
4
- "version": "24.6.0-alpha3",
4
+ "version": "24.6.0-alpha5",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/avatar",
4
- "version": "24.6.0-alpha3",
4
+ "version": "24.6.0-alpha5",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {