@vaadin/avatar 24.7.0-alpha2 → 24.7.0-alpha4

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.7.0-alpha2",
3
+ "version": "24.7.0-alpha4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -38,22 +38,22 @@
38
38
  "dependencies": {
39
39
  "@open-wc/dedupe-mixin": "^1.3.0",
40
40
  "@polymer/polymer": "^3.0.0",
41
- "@vaadin/a11y-base": "24.7.0-alpha2",
42
- "@vaadin/component-base": "24.7.0-alpha2",
43
- "@vaadin/tooltip": "24.7.0-alpha2",
44
- "@vaadin/vaadin-lumo-styles": "24.7.0-alpha2",
45
- "@vaadin/vaadin-material-styles": "24.7.0-alpha2",
46
- "@vaadin/vaadin-themable-mixin": "24.7.0-alpha2",
41
+ "@vaadin/a11y-base": "24.7.0-alpha4",
42
+ "@vaadin/component-base": "24.7.0-alpha4",
43
+ "@vaadin/tooltip": "24.7.0-alpha4",
44
+ "@vaadin/vaadin-lumo-styles": "24.7.0-alpha4",
45
+ "@vaadin/vaadin-material-styles": "24.7.0-alpha4",
46
+ "@vaadin/vaadin-themable-mixin": "24.7.0-alpha4",
47
47
  "lit": "^3.0.0"
48
48
  },
49
49
  "devDependencies": {
50
- "@vaadin/chai-plugins": "24.7.0-alpha2",
51
- "@vaadin/testing-helpers": "^1.0.0",
50
+ "@vaadin/chai-plugins": "24.7.0-alpha4",
51
+ "@vaadin/testing-helpers": "^1.1.0",
52
52
  "sinon": "^18.0.0"
53
53
  },
54
54
  "web-types": [
55
55
  "web-types.json",
56
56
  "web-types.lit.json"
57
57
  ],
58
- "gitHead": "e2523f9b4abc5a9586fb758166f823dc40c399dd"
58
+ "gitHead": "d7165cebf9dcf6a7e9e22f6353662d33404b4856"
59
59
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2020 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2020 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  const template = document.createElement('template');
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import type { Constructor } from '@open-wc/dedupe-mixin';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { FocusMixin } from '@vaadin/a11y-base/src/focus-mixin.js';
@@ -118,9 +118,9 @@ export const AvatarMixin = (superClass) =>
118
118
  this.__updateVisibility();
119
119
 
120
120
  // By default, if the user hasn't provided a custom role,
121
- // the role attribute is set to "button".
121
+ // the role attribute is set to "img".
122
122
  if (!this.hasAttribute('role')) {
123
- this.setAttribute('role', 'button');
123
+ this.setAttribute('role', 'img');
124
124
  }
125
125
 
126
126
  if (!this.hasAttribute('tabindex')) {
@@ -185,6 +185,14 @@ export const AvatarMixin = (superClass) =>
185
185
  this.__setTooltip(name);
186
186
  }
187
187
  }
188
+
189
+ if (abbr) {
190
+ // By default, generate aria-label attribute containing the abbr value.
191
+ // When no tooltip is set, prefix the aria-label with the name value.
192
+ this.setAttribute('aria-label', !tooltipNode && name ? `${name} (${abbr})` : abbr);
193
+ } else {
194
+ this.removeAttribute('aria-label');
195
+ }
188
196
  }
189
197
 
190
198
  /** @private */
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2020 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2020 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { ControllerMixin } from '@vaadin/component-base/src/controller-mixin.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2020 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2020 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import './vaadin-avatar-icons.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2020 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2020 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  export * from './vaadin-avatar.js';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2020 - 2024 Vaadin Ltd.
3
+ * Copyright (c) 2020 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import './vaadin-avatar-icons.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.7.0-alpha2",
4
+ "version": "24.7.0-alpha4",
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.7.0-alpha2",
4
+ "version": "24.7.0-alpha4",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {