@vaadin/avatar 24.4.0-dev.b3e1d14600 → 24.5.0-alpha1

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/README.md CHANGED
@@ -5,7 +5,6 @@ A web component for graphical representation of an object or entity, for example
5
5
  [Documentation + Live Demo ↗](https://vaadin.com/docs/latest/components/avatar)
6
6
 
7
7
  [![npm version](https://badgen.net/npm/v/@vaadin/avatar)](https://www.npmjs.com/package/@vaadin/avatar)
8
- [![Discord](https://img.shields.io/discord/732335336448852018?label=discord)](https://discord.gg/PHmkCKC)
9
8
 
10
9
  ```html
11
10
  <vaadin-avatar></vaadin-avatar>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/avatar",
3
- "version": "24.4.0-dev.b3e1d14600",
3
+ "version": "24.5.0-alpha1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -40,12 +40,12 @@
40
40
  "dependencies": {
41
41
  "@open-wc/dedupe-mixin": "^1.3.0",
42
42
  "@polymer/polymer": "^3.0.0",
43
- "@vaadin/a11y-base": "24.4.0-dev.b3e1d14600",
44
- "@vaadin/component-base": "24.4.0-dev.b3e1d14600",
45
- "@vaadin/tooltip": "24.4.0-dev.b3e1d14600",
46
- "@vaadin/vaadin-lumo-styles": "24.4.0-dev.b3e1d14600",
47
- "@vaadin/vaadin-material-styles": "24.4.0-dev.b3e1d14600",
48
- "@vaadin/vaadin-themable-mixin": "24.4.0-dev.b3e1d14600",
43
+ "@vaadin/a11y-base": "24.5.0-alpha1",
44
+ "@vaadin/component-base": "24.5.0-alpha1",
45
+ "@vaadin/tooltip": "24.5.0-alpha1",
46
+ "@vaadin/vaadin-lumo-styles": "24.5.0-alpha1",
47
+ "@vaadin/vaadin-material-styles": "24.5.0-alpha1",
48
+ "@vaadin/vaadin-themable-mixin": "24.5.0-alpha1",
49
49
  "lit": "^3.0.0"
50
50
  },
51
51
  "devDependencies": {
@@ -57,5 +57,5 @@
57
57
  "web-types.json",
58
58
  "web-types.lit.json"
59
59
  ],
60
- "gitHead": "502d4f5b03f770a83d270d98078cde230254dd0e"
60
+ "gitHead": "57806caac5468532a3b4e3dbdda730cd0fca193a"
61
61
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2020 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2020 - 2024 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 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2024 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 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2024 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';
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright (c) 2017 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2017 - 2024 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 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2020 - 2024 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 - 2023 Vaadin Ltd.
3
+ * Copyright (c) 2020 - 2024 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';
@@ -51,7 +51,13 @@ registerStyles('vaadin-avatar', avatarStyles, { moduleId: 'vaadin-avatar-styles'
51
51
  class Avatar extends AvatarMixin(ElementMixin(ThemableMixin(ControllerMixin(PolymerElement)))) {
52
52
  static get template() {
53
53
  return html`
54
- <img hidden$="[[!__imgVisible]]" src$="[[img]]" aria-hidden="true" on-error="__onImageLoadError" />
54
+ <img
55
+ hidden$="[[!__imgVisible]]"
56
+ src$="[[img]]"
57
+ aria-hidden="true"
58
+ on-error="__onImageLoadError"
59
+ draggable="false"
60
+ />
55
61
  <svg
56
62
  part="icon"
57
63
  hidden$="[[!__iconVisible]]"
@@ -0,0 +1,6 @@
1
+ import '@vaadin/vaadin-lumo-styles/color.js';
2
+ import '@vaadin/vaadin-lumo-styles/sizing.js';
3
+ import '@vaadin/vaadin-lumo-styles/spacing.js';
4
+ import '@vaadin/vaadin-lumo-styles/style.js';
5
+ import '@vaadin/vaadin-lumo-styles/typography.js';
6
+ import '@vaadin/vaadin-lumo-styles/user-colors.js';
@@ -0,0 +1,3 @@
1
+ import '@vaadin/tooltip/theme/lumo/vaadin-tooltip.js';
2
+ import './vaadin-avatar-styles.js';
3
+ import '../../src/vaadin-avatar.js';
@@ -0,0 +1,3 @@
1
+ import '@vaadin/vaadin-material-styles/color.js';
2
+ import '@vaadin/vaadin-material-styles/typography.js';
3
+ import '@vaadin/vaadin-material-styles/user-colors.js';
@@ -0,0 +1,3 @@
1
+ import '@vaadin/tooltip/theme/material/vaadin-tooltip.js';
2
+ import './vaadin-avatar-styles.js';
3
+ import '../../src/vaadin-avatar.js';
package/web-types.json ADDED
@@ -0,0 +1,153 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "name": "@vaadin/avatar",
4
+ "version": "24.5.0-alpha1",
5
+ "description-markup": "markdown",
6
+ "contributions": {
7
+ "html": {
8
+ "elements": [
9
+ {
10
+ "name": "vaadin-avatar",
11
+ "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 exposed for styling:\n\nPart name | Description\n--------- | ---------------\n`abbr` | The abbreviation element\n`icon` | The icon element\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\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
12
+ "attributes": [
13
+ {
14
+ "name": "img",
15
+ "description": "The path to the image",
16
+ "value": {
17
+ "type": [
18
+ "string",
19
+ "null",
20
+ "undefined"
21
+ ]
22
+ }
23
+ },
24
+ {
25
+ "name": "abbr",
26
+ "description": "A shortened form of name that is displayed\nin the avatar when `img` is not provided.",
27
+ "value": {
28
+ "type": [
29
+ "string",
30
+ "null",
31
+ "undefined"
32
+ ]
33
+ }
34
+ },
35
+ {
36
+ "name": "name",
37
+ "description": "Full name of the user\nused for the tooltip of the avatar.",
38
+ "value": {
39
+ "type": [
40
+ "string",
41
+ "null",
42
+ "undefined"
43
+ ]
44
+ }
45
+ },
46
+ {
47
+ "name": "color-index",
48
+ "description": "Color index used for avatar background.",
49
+ "value": {
50
+ "type": [
51
+ "number",
52
+ "null",
53
+ "undefined"
54
+ ]
55
+ }
56
+ },
57
+ {
58
+ "name": "with-tooltip",
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
+ "type": [
62
+ "boolean",
63
+ "null",
64
+ "undefined"
65
+ ]
66
+ }
67
+ },
68
+ {
69
+ "name": "theme",
70
+ "description": "The theme variants to apply to the component.",
71
+ "value": {
72
+ "type": [
73
+ "string",
74
+ "null",
75
+ "undefined"
76
+ ]
77
+ }
78
+ }
79
+ ],
80
+ "js": {
81
+ "properties": [
82
+ {
83
+ "name": "img",
84
+ "description": "The path to the image",
85
+ "value": {
86
+ "type": [
87
+ "string",
88
+ "null",
89
+ "undefined"
90
+ ]
91
+ }
92
+ },
93
+ {
94
+ "name": "abbr",
95
+ "description": "A shortened form of name that is displayed\nin the avatar when `img` is not provided.",
96
+ "value": {
97
+ "type": [
98
+ "string",
99
+ "null",
100
+ "undefined"
101
+ ]
102
+ }
103
+ },
104
+ {
105
+ "name": "name",
106
+ "description": "Full name of the user\nused for the tooltip of the avatar.",
107
+ "value": {
108
+ "type": [
109
+ "string",
110
+ "null",
111
+ "undefined"
112
+ ]
113
+ }
114
+ },
115
+ {
116
+ "name": "colorIndex",
117
+ "description": "Color index used for avatar background.",
118
+ "value": {
119
+ "type": [
120
+ "number",
121
+ "null",
122
+ "undefined"
123
+ ]
124
+ }
125
+ },
126
+ {
127
+ "name": "i18n",
128
+ "description": "The object used to localize this component.\nTo change the default localization, replace the entire\n_i18n_ object or just the property you want to modify.\n\nThe object has the following JSON structure and default values:\n\n```\n{\n // Translation of the anonymous user avatar tooltip.\n anonymous: 'anonymous'\n}\n```",
129
+ "value": {
130
+ "type": [
131
+ "AvatarI18n"
132
+ ]
133
+ }
134
+ },
135
+ {
136
+ "name": "withTooltip",
137
+ "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
+ "value": {
139
+ "type": [
140
+ "boolean",
141
+ "null",
142
+ "undefined"
143
+ ]
144
+ }
145
+ }
146
+ ],
147
+ "events": []
148
+ }
149
+ }
150
+ ]
151
+ }
152
+ }
153
+ }
@@ -0,0 +1,69 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "name": "@vaadin/avatar",
4
+ "version": "24.5.0-alpha1",
5
+ "description-markup": "markdown",
6
+ "framework": "lit",
7
+ "framework-config": {
8
+ "enable-when": {
9
+ "node-packages": [
10
+ "lit"
11
+ ]
12
+ }
13
+ },
14
+ "contributions": {
15
+ "html": {
16
+ "elements": [
17
+ {
18
+ "name": "vaadin-avatar",
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 exposed for styling:\n\nPart name | Description\n--------- | ---------------\n`abbr` | The abbreviation element\n`icon` | The icon element\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\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
20
+ "extension": true,
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
+ {
30
+ "name": ".img",
31
+ "description": "The path to the image",
32
+ "value": {
33
+ "kind": "expression"
34
+ }
35
+ },
36
+ {
37
+ "name": ".abbr",
38
+ "description": "A shortened form of name that is displayed\nin the avatar when `img` is not provided.",
39
+ "value": {
40
+ "kind": "expression"
41
+ }
42
+ },
43
+ {
44
+ "name": ".name",
45
+ "description": "Full name of the user\nused for the tooltip of the avatar.",
46
+ "value": {
47
+ "kind": "expression"
48
+ }
49
+ },
50
+ {
51
+ "name": ".colorIndex",
52
+ "description": "Color index used for avatar background.",
53
+ "value": {
54
+ "kind": "expression"
55
+ }
56
+ },
57
+ {
58
+ "name": ".i18n",
59
+ "description": "The object used to localize this component.\nTo change the default localization, replace the entire\n_i18n_ object or just the property you want to modify.\n\nThe object has the following JSON structure and default values:\n\n```\n{\n // Translation of the anonymous user avatar tooltip.\n anonymous: 'anonymous'\n}\n```",
60
+ "value": {
61
+ "kind": "expression"
62
+ }
63
+ }
64
+ ]
65
+ }
66
+ ]
67
+ }
68
+ }
69
+ }