@vaadin/avatar 25.0.0-alpha2 → 25.0.0-alpha20

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.0.0-alpha2",
3
+ "version": "25.0.0-alpha20",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,7 +21,6 @@
21
21
  "type": "module",
22
22
  "files": [
23
23
  "src",
24
- "theme",
25
24
  "vaadin-*.d.ts",
26
25
  "vaadin-*.js",
27
26
  "web-types.json",
@@ -36,22 +35,22 @@
36
35
  ],
37
36
  "dependencies": {
38
37
  "@open-wc/dedupe-mixin": "^1.3.0",
39
- "@vaadin/a11y-base": "25.0.0-alpha2",
40
- "@vaadin/component-base": "25.0.0-alpha2",
41
- "@vaadin/tooltip": "25.0.0-alpha2",
42
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha2",
43
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha2",
38
+ "@vaadin/a11y-base": "25.0.0-alpha20",
39
+ "@vaadin/component-base": "25.0.0-alpha20",
40
+ "@vaadin/tooltip": "25.0.0-alpha20",
41
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha20",
44
42
  "lit": "^3.0.0"
45
43
  },
46
44
  "devDependencies": {
47
- "@vaadin/chai-plugins": "25.0.0-alpha2",
48
- "@vaadin/test-runner-commands": "25.0.0-alpha2",
45
+ "@vaadin/chai-plugins": "25.0.0-alpha20",
46
+ "@vaadin/test-runner-commands": "25.0.0-alpha20",
49
47
  "@vaadin/testing-helpers": "^2.0.0",
50
- "sinon": "^18.0.0"
48
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha20",
49
+ "sinon": "^21.0.0"
51
50
  },
52
51
  "web-types": [
53
52
  "web-types.json",
54
53
  "web-types.lit.json"
55
54
  ],
56
- "gitHead": "67ffcd5355cf21ce1b5039c598525109fc4c164b"
55
+ "gitHead": "c948aae591a30b432f3784000d4677674cae56e0"
57
56
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2020 - 2025 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import type { CSSResult } from 'lit';
7
+
8
+ export const avatarStyles: CSSResult;
@@ -0,0 +1,93 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+ import '@vaadin/component-base/src/styles/style-props.js';
7
+ import '@vaadin/component-base/src/styles/user-colors.js';
8
+ import { css } from 'lit';
9
+
10
+ export const avatarStyles = css`
11
+ :host {
12
+ display: inline-block;
13
+ flex: none;
14
+ border-radius: 50%;
15
+ cursor: default;
16
+ color: var(--vaadin-avatar-color, var(--vaadin-text-color-secondary));
17
+ overflow: hidden;
18
+ --_size: var(--vaadin-avatar-size, calc(1lh + var(--vaadin-padding-xs) * 2));
19
+ height: var(--_size);
20
+ width: var(--_size);
21
+ border: var(--vaadin-focus-ring-width) solid transparent;
22
+ margin: calc(var(--vaadin-focus-ring-width) * -1);
23
+ background: var(--vaadin-avatar-background, var(--vaadin-background-container-strong));
24
+ background-clip: content-box;
25
+ vertical-align: middle;
26
+ -webkit-user-select: none;
27
+ user-select: none;
28
+ -webkit-tap-highlight-color: transparent;
29
+ position: relative;
30
+ font-weight: var(--vaadin-avatar-font-weight, 400);
31
+ font-size: var(--vaadin-avatar-font-size, inherit);
32
+ }
33
+
34
+ /* Overlay border on top of image and icon as well */
35
+ :host::before {
36
+ position: absolute;
37
+ content: '';
38
+ inset: 0;
39
+ border-radius: inherit;
40
+ border: var(--vaadin-avatar-border-width, 1px) solid var(--vaadin-avatar-border-color, transparent);
41
+ }
42
+
43
+ :host([role='button']) {
44
+ cursor: var(--vaadin-clickable-cursor);
45
+ }
46
+
47
+ img {
48
+ height: 100%;
49
+ width: 100%;
50
+ object-fit: cover;
51
+ }
52
+
53
+ [part='icon'] {
54
+ height: 100%;
55
+ mask: var(--_vaadin-icon-user) no-repeat center / 74%;
56
+ background: currentColor;
57
+ }
58
+
59
+ [part='abbr'] {
60
+ font-size: 2.75em;
61
+ fill: currentColor;
62
+ }
63
+
64
+ :host([hidden]),
65
+ [hidden] {
66
+ display: none !important;
67
+ }
68
+
69
+ :host([has-color-index]) {
70
+ background-color: var(--vaadin-avatar-user-color);
71
+ color: oklch(from var(--vaadin-avatar-user-color) clamp(0, (0.62 - l) * 1000, 1) 0 0);
72
+ }
73
+
74
+ :host([has-color-index])::before {
75
+ --vaadin-avatar-border-width: 2px;
76
+ --vaadin-avatar-border-color: var(--vaadin-avatar-user-color);
77
+ }
78
+
79
+ :host([focus-ring]) {
80
+ outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
81
+ outline-offset: calc((var(--vaadin-focus-ring-width)) * -1);
82
+ }
83
+
84
+ @media (forced-colors: active) {
85
+ :host {
86
+ border-color: Canvas !important;
87
+ }
88
+
89
+ [part='icon'] {
90
+ background: CanvasText !important;
91
+ }
92
+ }
93
+ `;
@@ -48,7 +48,7 @@ export declare class AvatarMixinClass {
48
48
  * just the individual properties you want to change.
49
49
  *
50
50
  * The object has the following JSON structure and default values:
51
- * ```
51
+ * ```js
52
52
  * {
53
53
  * // Translation of the anonymous user avatar tooltip.
54
54
  * anonymous: 'anonymous'
@@ -96,7 +96,7 @@ export const AvatarMixin = (superClass) =>
96
96
  * just the individual properties you want to change.
97
97
  *
98
98
  * The object has the following JSON structure and default values:
99
- * ```
99
+ * ```js
100
100
  * {
101
101
  * // Translation of the anonymous user avatar tooltip.
102
102
  * anonymous: 'anonymous'
@@ -124,10 +124,6 @@ export const AvatarMixin = (superClass) =>
124
124
  this.setAttribute('role', 'img');
125
125
  }
126
126
 
127
- if (!this.hasAttribute('tabindex')) {
128
- this.setAttribute('tabindex', '0');
129
- }
130
-
131
127
  // Should set `anonymous` if name / abbr is not provided
132
128
  if (!this.name && !this.abbr) {
133
129
  this.__setTooltip();
@@ -198,6 +194,8 @@ export const AvatarMixin = (superClass) =>
198
194
 
199
195
  /** @private */
200
196
  __withTooltipChanged(withTooltip, oldWithTooltip) {
197
+ this.toggleAttribute('has-tooltip', withTooltip);
198
+
201
199
  if (withTooltip) {
202
200
  // Create and attach tooltip
203
201
  const tooltipNode = document.createElement('vaadin-tooltip');
@@ -32,6 +32,7 @@ export { AvatarI18n } from './vaadin-avatar-mixin.js';
32
32
  * `focus-ring` | Set when the avatar is focused using the keyboard.
33
33
  * `focused` | Set when the avatar is focused.
34
34
  * `has-color-index` | Set when the avatar has `colorIndex` and the corresponding custom CSS property exists.
35
+ * `has-tooltip` | Set when the element has a slotted tooltip.
35
36
  *
36
37
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
37
38
  */
@@ -4,16 +4,16 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import '@vaadin/tooltip/src/vaadin-tooltip.js';
7
- import './vaadin-avatar-icons.js';
8
7
  import { html, LitElement } from 'lit';
9
8
  import { ifDefined } from 'lit/directives/if-defined.js';
10
9
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
11
10
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
12
11
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
13
12
  import { TooltipController } from '@vaadin/component-base/src/tooltip-controller.js';
13
+ import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
14
14
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
15
+ import { avatarStyles } from './styles/vaadin-avatar-base-styles.js';
15
16
  import { AvatarMixin } from './vaadin-avatar-mixin.js';
16
- import { avatarStyles } from './vaadin-avatar-styles.js';
17
17
 
18
18
  /**
19
19
  * `<vaadin-avatar>` is a Web Component providing avatar displaying functionality.
@@ -38,6 +38,7 @@ import { avatarStyles } from './vaadin-avatar-styles.js';
38
38
  * `focus-ring` | Set when the avatar is focused using the keyboard.
39
39
  * `focused` | Set when the avatar is focused.
40
40
  * `has-color-index` | Set when the avatar has `colorIndex` and the corresponding custom CSS property exists.
41
+ * `has-tooltip` | Set when the element has a slotted tooltip.
41
42
  *
42
43
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
43
44
  *
@@ -47,7 +48,7 @@ import { avatarStyles } from './vaadin-avatar-styles.js';
47
48
  * @mixes ElementMixin
48
49
  * @mixes ThemableMixin
49
50
  */
50
- class Avatar extends AvatarMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
51
+ class Avatar extends AvatarMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
51
52
  static get is() {
52
53
  return 'vaadin-avatar';
53
54
  }
@@ -56,6 +57,12 @@ class Avatar extends AvatarMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElem
56
57
  return avatarStyles;
57
58
  }
58
59
 
60
+ static get lumoInjector() {
61
+ return {
62
+ includeBaseStyles: true,
63
+ };
64
+ }
65
+
59
66
  /** @protected */
60
67
  render() {
61
68
  return html`
@@ -66,20 +73,10 @@ class Avatar extends AvatarMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElem
66
73
  @error="${this.__onImageLoadError}"
67
74
  draggable="false"
68
75
  />
69
- <svg
70
- part="icon"
71
- ?hidden="${!this.__iconVisible}"
72
- id="avatar-icon"
73
- viewBox="-50 -50 100 100"
74
- preserveAspectRatio="xMidYMid meet"
75
- aria-hidden="true"
76
- >
77
- <text dy=".35em" text-anchor="middle">&#xea01;</text>
78
- </svg>
76
+ <div part="icon" ?hidden="${!this.__iconVisible}" aria-hidden="true"></div>
79
77
  <svg
80
78
  part="abbr"
81
79
  ?hidden="${!this.__abbrVisible}"
82
- id="avatar-abbr"
83
80
  viewBox="-50 -50 100 100"
84
81
  preserveAspectRatio="xMidYMid meet"
85
82
  aria-hidden="true"
package/vaadin-avatar.js CHANGED
@@ -1,2 +1,2 @@
1
- import './theme/lumo/vaadin-avatar.js';
1
+ import './src/vaadin-avatar.js';
2
2
  export * from './src/vaadin-avatar.js';
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/avatar",
4
- "version": "25.0.0-alpha2",
4
+ "version": "25.0.0-alpha20",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
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.",
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`has-tooltip` | Set when the element has a slotted tooltip.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "img",
@@ -81,7 +81,7 @@
81
81
  "properties": [
82
82
  {
83
83
  "name": "i18n",
84
- "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```\n{\n // Translation of the anonymous user avatar tooltip.\n anonymous: 'anonymous'\n}\n```",
84
+ "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```",
85
85
  "value": {
86
86
  "type": [
87
87
  "AvatarI18n"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/avatar",
4
- "version": "25.0.0-alpha2",
4
+ "version": "25.0.0-alpha20",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -16,7 +16,7 @@
16
16
  "elements": [
17
17
  {
18
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.",
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`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
22
  {
@@ -28,7 +28,7 @@
28
28
  },
29
29
  {
30
30
  "name": ".i18n",
31
- "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```\n{\n // Translation of the anonymous user avatar tooltip.\n anonymous: 'anonymous'\n}\n```",
31
+ "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```",
32
32
  "value": {
33
33
  "kind": "expression"
34
34
  }
@@ -1,19 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2020 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- const template = document.createElement('template');
7
-
8
- template.innerHTML = `
9
- <style>
10
- @font-face {
11
- font-family: 'vaadin-avatar-icons';
12
- src: url(data:application/font-woff;charset=utf-8;base64,d09GRgABAAAAAAQAAAsAAAAABnwAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAABHU1VCAAABCAAAADsAAABUIIslek9TLzIAAAFEAAAAQwAAAFZAIUmEY21hcAAAAYgAAABLAAABcOspwa1nbHlmAAAB1AAAAEUAAABMYO4o1WhlYWQAAAIcAAAALgAAADYYaAmGaGhlYQAAAkwAAAAdAAAAJAZsA1VobXR4AAACbAAAAAgAAAAIA+gAAGxvY2EAAAJ0AAAABgAAAAYAJgAAbWF4cAAAAnwAAAAeAAAAIAEOACFuYW1lAAACnAAAAUIAAAKavFDYrHBvc3QAAAPgAAAAHQAAAC52hGZ4eJxjYGRgYOBiMGCwY2BycfMJYeDLSSzJY5BiYGGAAJA8MpsxJzM9kYEDxgPKsYBpDiBmg4gCACY7BUgAeJxjYGT8wjiBgZWBgamKaQ8DA0MPhGZ8wGDIyAQUZWBlZsAKAtJcUxgcXjG+YmQO+p/FEMUcxDANKMwIkgMADiUMJQB4nGNgYGBlYGBgBmIdIGZhYGAMYWBkAAE/oCgjWJyZgQsszsKgBFbDAhJ/xfj/P4wE8lnAJAMjG8Mo4AGTMlAeOKwgmIERADU0CX0AeJxjYGIAAmYJpkgGHgYRBgZGJT1GEztGIzlGET5GKEuU8YuSpZKSpQuI+LfLv21emz9jHJQPJP7dsUywsEiwBACG8g9CAAAAeJxjYGRgYADicIOnh+P5bb4ycDO/AIow3JZ4rIJMM0swRQIpDgYmEA8AKwgJOwAAeJxjYGRgYA76nwUkXzAAAbMEAyMDKmACAE2GAskAAAAAAAAAA+gAAAAAAAAAJgAAeJxjYGRgYGBiEAViBjCLgYELCBkY/oP5DAAKuwEwAAB4nI2Qu07DMBSG//SGaCWEhMSAGDx1QU0vYyemdmDrUDEhuamTpkriyHEj9RF4B56Bh2Bg5mmY+8d4Qh3qo9jf+c45thQAt/hGgGYFuHN7s1q4YvbHbdKD5w555LmLAZ499+hfPPfxhDfPA/p33hB0rmmG+PDcwg2+PLfpfzx3yL+eu7gPHj33MAxmnvtYB6+eB/SftZTbtBjJWlppRmmki2qlkkMmzZnKGbVWpkp1Iabh5Ex1qQplpFVbsTmKqk5m1sYiNjoXC11YlWValEbvVWTDnbXlfDyOvQ8jnaOGZGyRouCfky63/AyzFBE0fYUVFBIckLnKZTOXda15s+GZulxgihCTC2eXnC3cfFNV7BfY4Mi9eT3BjNYiZh6zRyMnLdxs050xNE3panuaiD7Ezk2VmGPMiP/1h+71/ATcWYAhAAB4nGNgYoAALgbsgImRiZGZgaW0OLWIgQEACl4B2QAAAA==) format('woff');
13
- font-weight: normal;
14
- font-style: normal;
15
- }
16
- </style>
17
- `;
18
-
19
- document.head.appendChild(template.content);
@@ -1,60 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
7
-
8
- export const avatarStyles = css`
9
- :host {
10
- display: inline-block;
11
- flex: none;
12
- border-radius: 50%;
13
- overflow: hidden;
14
- height: var(--vaadin-avatar-size, 64px);
15
- width: var(--vaadin-avatar-size, 64px);
16
- border: var(--vaadin-avatar-outline-width) solid transparent;
17
- margin: calc(var(--vaadin-avatar-outline-width) * -1);
18
- background-clip: content-box;
19
- --vaadin-avatar-outline-width: var(--vaadin-focus-ring-width, 2px);
20
- }
21
-
22
- img {
23
- height: 100%;
24
- width: 100%;
25
- object-fit: cover;
26
- }
27
-
28
- [part='icon'] {
29
- font-size: 5.6em;
30
- }
31
-
32
- [part='abbr'] {
33
- font-size: 2.2em;
34
- }
35
-
36
- [part='icon'] > text {
37
- font-family: 'vaadin-avatar-icons';
38
- }
39
-
40
- :host([hidden]) {
41
- display: none !important;
42
- }
43
-
44
- svg[hidden] {
45
- display: none !important;
46
- }
47
-
48
- :host([has-color-index]) {
49
- position: relative;
50
- background-color: var(--vaadin-avatar-user-color);
51
- }
52
-
53
- :host([has-color-index])::before {
54
- position: absolute;
55
- content: '';
56
- inset: 0;
57
- border-radius: inherit;
58
- box-shadow: inset 0 0 0 2px var(--vaadin-avatar-user-color);
59
- }
60
- `;
@@ -1,6 +0,0 @@
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';
@@ -1,80 +0,0 @@
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';
7
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
8
-
9
- const globalStyle = document.createElement('style');
10
- globalStyle.textContent = 'html { --vaadin-avatar-size: var(--lumo-size-m); }';
11
- document.head.appendChild(globalStyle);
12
-
13
- registerStyles(
14
- 'vaadin-avatar',
15
- css`
16
- :host {
17
- color: var(--lumo-secondary-text-color);
18
- background-color: var(--lumo-contrast-10pct);
19
- border-radius: 50%;
20
- outline: none;
21
- cursor: default;
22
- user-select: none;
23
- -webkit-tap-highlight-color: transparent;
24
- -webkit-font-smoothing: antialiased;
25
- -moz-osx-font-smoothing: grayscale;
26
- }
27
-
28
- :host([has-color-index]) {
29
- color: var(--lumo-base-color);
30
- }
31
-
32
- :host([focus-ring]) {
33
- border-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
34
- }
35
-
36
- [part='icon'],
37
- [part='abbr'] {
38
- fill: currentColor;
39
- }
40
-
41
- [part='abbr'] {
42
- font-family: var(--lumo-font-family);
43
- font-size: 2.4375em;
44
- font-weight: 500;
45
- }
46
-
47
- :host([theme~='xlarge']) [part='abbr'] {
48
- font-size: 2.5em;
49
- }
50
-
51
- :host([theme~='large']) [part='abbr'] {
52
- font-size: 2.375em;
53
- }
54
-
55
- :host([theme~='small']) [part='abbr'] {
56
- font-size: 2.75em;
57
- }
58
-
59
- :host([theme~='xsmall']) [part='abbr'] {
60
- font-size: 3em;
61
- }
62
-
63
- :host([theme~='xlarge']) {
64
- --vaadin-avatar-size: var(--lumo-size-xl);
65
- }
66
-
67
- :host([theme~='large']) {
68
- --vaadin-avatar-size: var(--lumo-size-l);
69
- }
70
-
71
- :host([theme~='small']) {
72
- --vaadin-avatar-size: var(--lumo-size-s);
73
- }
74
-
75
- :host([theme~='xsmall']) {
76
- --vaadin-avatar-size: var(--lumo-size-xs);
77
- }
78
- `,
79
- { moduleId: 'lumo-avatar' },
80
- );
@@ -1,3 +0,0 @@
1
- import '@vaadin/tooltip/theme/lumo/vaadin-tooltip.js';
2
- import './vaadin-avatar-styles.js';
3
- import '../../src/vaadin-avatar.js';
@@ -1,3 +0,0 @@
1
- import '@vaadin/tooltip/theme/lumo/vaadin-tooltip.js';
2
- import './vaadin-avatar-styles.js';
3
- import '../../src/vaadin-avatar.js';