@vaadin/avatar 25.2.0-alpha9 → 25.2.0-beta1

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": "25.2.0-alpha9",
3
+ "version": "25.2.0-beta1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,18 +36,18 @@
36
36
  ],
37
37
  "dependencies": {
38
38
  "@open-wc/dedupe-mixin": "^1.3.0",
39
- "@vaadin/a11y-base": "25.2.0-alpha9",
40
- "@vaadin/component-base": "25.2.0-alpha9",
41
- "@vaadin/tooltip": "25.2.0-alpha9",
42
- "@vaadin/vaadin-themable-mixin": "25.2.0-alpha9",
39
+ "@vaadin/a11y-base": "25.2.0-beta1",
40
+ "@vaadin/component-base": "25.2.0-beta1",
41
+ "@vaadin/tooltip": "25.2.0-beta1",
42
+ "@vaadin/vaadin-themable-mixin": "25.2.0-beta1",
43
43
  "lit": "^3.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@vaadin/aura": "25.2.0-alpha9",
47
- "@vaadin/chai-plugins": "25.2.0-alpha9",
48
- "@vaadin/test-runner-commands": "25.2.0-alpha9",
46
+ "@vaadin/aura": "25.2.0-beta1",
47
+ "@vaadin/chai-plugins": "25.2.0-beta1",
48
+ "@vaadin/test-runner-commands": "25.2.0-beta1",
49
49
  "@vaadin/testing-helpers": "^2.0.0",
50
- "@vaadin/vaadin-lumo-styles": "25.2.0-alpha9",
50
+ "@vaadin/vaadin-lumo-styles": "25.2.0-beta1",
51
51
  "sinon": "^21.0.2"
52
52
  },
53
53
  "customElements": "custom-elements.json",
@@ -55,5 +55,5 @@
55
55
  "web-types.json",
56
56
  "web-types.lit.json"
57
57
  ],
58
- "gitHead": "a38a03e8a8be45821f39c14054c63634dafe08d0"
58
+ "gitHead": "471a23f60d1eb725f98a33f62cb9664d9c0a4163"
59
59
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2026 Vaadin Ltd.
3
+ * Copyright (c) 2020 - 2026 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/component-base/src/styles/style-props.js';
@@ -12,12 +12,9 @@ const DEFAULT_I18N = {
12
12
 
13
13
  /**
14
14
  * A mixin providing common avatar functionality.
15
- *
16
- * @polymerMixin
17
- * @mixes FocusMixin
18
15
  */
19
16
  export const AvatarMixin = (superClass) =>
20
- class AvatarMixinClass extends I18nMixin(DEFAULT_I18N, FocusMixin(superClass)) {
17
+ class AvatarMixinClass extends I18nMixin(FocusMixin(superClass)) {
21
18
  static get properties() {
22
19
  return {
23
20
  /**
@@ -90,6 +87,10 @@ export const AvatarMixin = (superClass) =>
90
87
  ];
91
88
  }
92
89
 
90
+ static get defaultI18n() {
91
+ return DEFAULT_I18N;
92
+ }
93
+
93
94
  /**
94
95
  * The object used to localize this component. To change the default
95
96
  * localization, replace this with an object that provides all properties, or
@@ -203,7 +204,7 @@ export const AvatarMixin = (superClass) =>
203
204
 
204
205
  /** @private */
205
206
  __i18nChanged(effectiveI18n) {
206
- if (effectiveI18n && effectiveI18n.anonymous) {
207
+ if (effectiveI18n?.anonymous) {
207
208
  if (this.__oldAnonymous && this.__tooltipNode && this.__tooltipNode.text === this.__oldAnonymous) {
208
209
  this.__setTooltip();
209
210
  }
@@ -56,9 +56,6 @@ import { AvatarMixin } from './vaadin-avatar-mixin.js';
56
56
  *
57
57
  * @customElement vaadin-avatar
58
58
  * @extends HTMLElement
59
- * @mixes AvatarMixin
60
- * @mixes ElementMixin
61
- * @mixes ThemableMixin
62
59
  */
63
60
  class Avatar extends AvatarMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
64
61
  static get is() {
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": "25.2.0-alpha9",
4
+ "version": "25.2.0-beta1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -15,9 +15,7 @@
15
15
  "description": "A shortened form of name that is displayed\nin the avatar when `img` is not provided.",
16
16
  "value": {
17
17
  "type": [
18
- "string",
19
- "null",
20
- "undefined"
18
+ "string"
21
19
  ]
22
20
  }
23
21
  },
@@ -26,9 +24,7 @@
26
24
  "description": "Color index used for avatar background.",
27
25
  "value": {
28
26
  "type": [
29
- "number",
30
- "null",
31
- "undefined"
27
+ "number"
32
28
  ]
33
29
  }
34
30
  },
@@ -37,9 +33,7 @@
37
33
  "description": "The path to the image",
38
34
  "value": {
39
35
  "type": [
40
- "string",
41
- "null",
42
- "undefined"
36
+ "string"
43
37
  ]
44
38
  }
45
39
  },
@@ -48,9 +42,7 @@
48
42
  "description": "Full name of the user\nused for the tooltip of the avatar.",
49
43
  "value": {
50
44
  "type": [
51
- "string",
52
- "null",
53
- "undefined"
45
+ "string"
54
46
  ]
55
47
  }
56
48
  },
@@ -70,9 +62,7 @@
70
62
  "description": "When true, the avatar has tooltip shown on hover and focus.\nThe tooltip text is based on the `name` and `abbr` properties.\nWhen neither is provided, `i18n.anonymous` is used instead.",
71
63
  "value": {
72
64
  "type": [
73
- "boolean",
74
- "null",
75
- "undefined"
65
+ "boolean"
76
66
  ]
77
67
  }
78
68
  }
@@ -84,9 +74,7 @@
84
74
  "description": "A shortened form of name that is displayed\nin the avatar when `img` is not provided.",
85
75
  "value": {
86
76
  "type": [
87
- "string",
88
- "null",
89
- "undefined"
77
+ "string"
90
78
  ]
91
79
  }
92
80
  },
@@ -95,9 +83,7 @@
95
83
  "description": "Color index used for avatar background.",
96
84
  "value": {
97
85
  "type": [
98
- "number",
99
- "null",
100
- "undefined"
86
+ "number"
101
87
  ]
102
88
  }
103
89
  },
@@ -106,7 +92,7 @@
106
92
  "description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following JSON structure and default values:\n```js\n{\n // Translation of the anonymous user avatar tooltip.\n anonymous: 'anonymous'\n}\n```",
107
93
  "value": {
108
94
  "type": [
109
- "?"
95
+ "Object"
110
96
  ]
111
97
  }
112
98
  },
@@ -115,9 +101,7 @@
115
101
  "description": "The path to the image",
116
102
  "value": {
117
103
  "type": [
118
- "string",
119
- "null",
120
- "undefined"
104
+ "string"
121
105
  ]
122
106
  }
123
107
  },
@@ -126,9 +110,7 @@
126
110
  "description": "Full name of the user\nused for the tooltip of the avatar.",
127
111
  "value": {
128
112
  "type": [
129
- "string",
130
- "null",
131
- "undefined"
113
+ "string"
132
114
  ]
133
115
  }
134
116
  },
@@ -137,9 +119,7 @@
137
119
  "description": "When true, the avatar has tooltip shown on hover and focus.\nThe tooltip text is based on the `name` and `abbr` properties.\nWhen neither is provided, `i18n.anonymous` is used instead.",
138
120
  "value": {
139
121
  "type": [
140
- "boolean",
141
- "null",
142
- "undefined"
122
+ "boolean"
143
123
  ]
144
124
  }
145
125
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/avatar",
4
- "version": "25.2.0-alpha9",
4
+ "version": "25.2.0-beta1",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -19,13 +19,6 @@
19
19
  "description": "`<vaadin-avatar>` is a Web Component providing avatar displaying functionality.\n\n```html\n<vaadin-avatar img=\"avatars/avatar-1.jpg\"></vaadin-avatar>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n--------- | ---------------\n`abbr` | The abbreviation element\n`icon` | The icon element\n\nThe following custom CSS properties are available for styling:\n\nCustom CSS property | Description\n-------------------------------|-------------\n`--vaadin-avatar-background` | Background color of the avatar\n`--vaadin-avatar-border-color` | Border color of the avatar\n`--vaadin-avatar-border-width` | Border width of the avatar\n`--vaadin-avatar-font-size` | Font size of the avatar\n`--vaadin-avatar-font-weight` | Font weight of the avatar\n`--vaadin-avatar-size` | Size of the avatar\n`--vaadin-avatar-text-color` | Text color of the avatar\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n------------------|-------------\n`focus-ring` | Set when the avatar is focused using the keyboard.\n`focused` | Set when the avatar is focused.\n`has-color-index` | Set when the avatar has `colorIndex` and the corresponding custom CSS property exists.\n`has-tooltip` | Set when the element has a slotted tooltip.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
20
20
  "extension": true,
21
21
  "attributes": [
22
- {
23
- "name": "?withTooltip",
24
- "description": "When true, the avatar has tooltip shown on hover and focus.\nThe tooltip text is based on the `name` and `abbr` properties.\nWhen neither is provided, `i18n.anonymous` is used instead.",
25
- "value": {
26
- "kind": "expression"
27
- }
28
- },
29
22
  {
30
23
  "name": ".abbr",
31
24
  "description": "A shortened form of name that is displayed\nin the avatar when `img` is not provided.",
@@ -60,6 +53,13 @@
60
53
  "value": {
61
54
  "kind": "expression"
62
55
  }
56
+ },
57
+ {
58
+ "name": "?withTooltip",
59
+ "description": "When true, the avatar has tooltip shown on hover and focus.\nThe tooltip text is based on the `name` and `abbr` properties.\nWhen neither is provided, `i18n.anonymous` is used instead.",
60
+ "value": {
61
+ "kind": "expression"
62
+ }
63
63
  }
64
64
  ]
65
65
  }