@vaadin/avatar 25.0.0-alpha6 → 25.0.0-alpha8
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 +9 -9
- package/src/styles/vaadin-avatar-base-styles.js +55 -57
- package/src/vaadin-avatar.js +7 -1
- package/web-types.json +1 -1
- package/web-types.lit.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/avatar",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-alpha8",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,16 +38,16 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
41
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
42
|
-
"@vaadin/component-base": "25.0.0-
|
|
43
|
-
"@vaadin/tooltip": "25.0.0-
|
|
44
|
-
"@vaadin/vaadin-lumo-styles": "25.0.0-
|
|
45
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-
|
|
41
|
+
"@vaadin/a11y-base": "25.0.0-alpha8",
|
|
42
|
+
"@vaadin/component-base": "25.0.0-alpha8",
|
|
43
|
+
"@vaadin/tooltip": "25.0.0-alpha8",
|
|
44
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-alpha8",
|
|
45
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha8",
|
|
46
46
|
"lit": "^3.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
50
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
49
|
+
"@vaadin/chai-plugins": "25.0.0-alpha8",
|
|
50
|
+
"@vaadin/test-runner-commands": "25.0.0-alpha8",
|
|
51
51
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
52
52
|
"sinon": "^18.0.0"
|
|
53
53
|
},
|
|
@@ -55,5 +55,5 @@
|
|
|
55
55
|
"web-types.json",
|
|
56
56
|
"web-types.lit.json"
|
|
57
57
|
],
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "ebf53673d5f639d2b1b6f2b31f640f530643ee2f"
|
|
59
59
|
}
|
|
@@ -7,70 +7,68 @@ import '@vaadin/component-base/src/style-props.js';
|
|
|
7
7
|
import { css } from 'lit';
|
|
8
8
|
|
|
9
9
|
export const avatarStyles = css`
|
|
10
|
-
|
|
11
|
-
:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}
|
|
10
|
+
:host {
|
|
11
|
+
display: inline-block;
|
|
12
|
+
flex: none;
|
|
13
|
+
border-radius: 50%;
|
|
14
|
+
cursor: default;
|
|
15
|
+
color: var(--vaadin-avatar-color, var(--vaadin-color-subtle));
|
|
16
|
+
line-height: 0;
|
|
17
|
+
overflow: hidden;
|
|
18
|
+
height: var(--vaadin-avatar-size, 32px);
|
|
19
|
+
width: var(--vaadin-avatar-size, 32px);
|
|
20
|
+
border: var(--vaadin-focus-ring-width) solid transparent;
|
|
21
|
+
margin: calc(var(--vaadin-focus-ring-width) * -1);
|
|
22
|
+
background: var(--vaadin-avatar-background, var(--vaadin-background-container-strong));
|
|
23
|
+
background-clip: content-box;
|
|
24
|
+
vertical-align: middle;
|
|
25
|
+
-webkit-user-select: none;
|
|
26
|
+
user-select: none;
|
|
27
|
+
-webkit-tap-highlight-color: transparent;
|
|
28
|
+
position: relative;
|
|
29
|
+
}
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
:host([role='button']) {
|
|
32
|
+
cursor: var(--vaadin-clickable-cursor);
|
|
33
|
+
}
|
|
35
34
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
35
|
+
img {
|
|
36
|
+
height: 100%;
|
|
37
|
+
width: 100%;
|
|
38
|
+
object-fit: cover;
|
|
39
|
+
}
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
41
|
+
[part='icon'] {
|
|
42
|
+
height: 100%;
|
|
43
|
+
mask: var(--_vaadin-icon-user) no-repeat center / 74%;
|
|
44
|
+
background: currentColor;
|
|
45
|
+
}
|
|
47
46
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
[part='abbr'] {
|
|
48
|
+
font-size: 2.75em;
|
|
49
|
+
fill: currentColor;
|
|
50
|
+
}
|
|
52
51
|
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
52
|
+
:host([hidden]),
|
|
53
|
+
[hidden] {
|
|
54
|
+
display: none !important;
|
|
55
|
+
}
|
|
57
56
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
57
|
+
:host([has-color-index]) {
|
|
58
|
+
background-color: var(--vaadin-avatar-user-color);
|
|
59
|
+
color: oklch(from var(--vaadin-avatar-user-color) clamp(0, (0.62 - l) * 1000, 1) 0 0);
|
|
60
|
+
}
|
|
62
61
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
62
|
+
:host([has-color-index])::before {
|
|
63
|
+
position: absolute;
|
|
64
|
+
content: '';
|
|
65
|
+
inset: 0;
|
|
66
|
+
border-radius: inherit;
|
|
67
|
+
border: 2px solid var(--vaadin-avatar-user-color);
|
|
68
|
+
}
|
|
70
69
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
}
|
|
70
|
+
:host([focus-ring]) {
|
|
71
|
+
outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
|
|
72
|
+
outline-offset: calc((var(--vaadin-focus-ring-width)) * -1);
|
|
75
73
|
}
|
|
76
74
|
`;
|
package/src/vaadin-avatar.js
CHANGED
|
@@ -47,7 +47,7 @@ import { AvatarMixin } from './vaadin-avatar-mixin.js';
|
|
|
47
47
|
* @mixes ElementMixin
|
|
48
48
|
* @mixes ThemableMixin
|
|
49
49
|
*/
|
|
50
|
-
class Avatar extends AvatarMixin(ElementMixin(ThemableMixin(LumoInjectionMixin(
|
|
50
|
+
class Avatar extends AvatarMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))) {
|
|
51
51
|
static get is() {
|
|
52
52
|
return 'vaadin-avatar';
|
|
53
53
|
}
|
|
@@ -56,6 +56,12 @@ class Avatar extends AvatarMixin(ElementMixin(ThemableMixin(LumoInjectionMixin(P
|
|
|
56
56
|
return avatarStyles;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
static get lumoInjector() {
|
|
60
|
+
return {
|
|
61
|
+
includeBaseStyles: true,
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
|
|
59
65
|
/** @protected */
|
|
60
66
|
render() {
|
|
61
67
|
return html`
|
package/web-types.json
CHANGED