@vaadin/avatar-group 25.0.0-alpha9 → 25.0.0-beta2
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 +14 -17
- package/src/styles/vaadin-avatar-group-base-styles.js +6 -14
- package/src/vaadin-avatar-group-menu-item.js +1 -1
- package/src/vaadin-avatar-group-menu.js +1 -1
- package/src/vaadin-avatar-group-mixin.d.ts +1 -3
- package/src/vaadin-avatar-group-mixin.js +5 -9
- package/src/vaadin-avatar-group-overlay.js +2 -2
- package/src/vaadin-avatar-group.d.ts +0 -1
- package/src/vaadin-avatar-group.js +1 -2
- package/vaadin-avatar-group.js +1 -1
- package/web-types.json +4 -26
- package/web-types.lit.json +4 -11
- package/src/styles/vaadin-avatar-group-core-styles.d.ts +0 -8
- package/src/styles/vaadin-avatar-group-core-styles.js +0 -44
- package/src/styles/vaadin-avatar-group-menu-core-styles.js +0 -8
- package/src/styles/vaadin-avatar-group-menu-item-core-styles.js +0 -8
- package/theme/lumo/vaadin-avatar-group-styles.d.ts +0 -3
- package/theme/lumo/vaadin-avatar-group-styles.js +0 -84
- package/theme/lumo/vaadin-avatar-group.d.ts +0 -3
- package/theme/lumo/vaadin-avatar-group.js +0 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/avatar-group",
|
|
3
|
-
"version": "25.0.0-
|
|
3
|
+
"version": "25.0.0-beta2",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -21,9 +21,6 @@
|
|
|
21
21
|
"type": "module",
|
|
22
22
|
"files": [
|
|
23
23
|
"src",
|
|
24
|
-
"!src/styles/*-base-styles.d.ts",
|
|
25
|
-
"!src/styles/*-base-styles.js",
|
|
26
|
-
"theme",
|
|
27
24
|
"vaadin-*.d.ts",
|
|
28
25
|
"vaadin-*.js",
|
|
29
26
|
"web-types.json",
|
|
@@ -38,26 +35,26 @@
|
|
|
38
35
|
],
|
|
39
36
|
"dependencies": {
|
|
40
37
|
"@open-wc/dedupe-mixin": "^1.3.0",
|
|
41
|
-
"@vaadin/a11y-base": "25.0.0-
|
|
42
|
-
"@vaadin/avatar": "25.0.0-
|
|
43
|
-
"@vaadin/component-base": "25.0.0-
|
|
44
|
-
"@vaadin/item": "25.0.0-
|
|
45
|
-
"@vaadin/list-box": "25.0.0-
|
|
46
|
-
"@vaadin/overlay": "25.0.0-
|
|
47
|
-
"@vaadin/tooltip": "25.0.0-
|
|
48
|
-
"@vaadin/vaadin-
|
|
49
|
-
"@vaadin/vaadin-themable-mixin": "25.0.0-alpha9",
|
|
38
|
+
"@vaadin/a11y-base": "25.0.0-beta2",
|
|
39
|
+
"@vaadin/avatar": "25.0.0-beta2",
|
|
40
|
+
"@vaadin/component-base": "25.0.0-beta2",
|
|
41
|
+
"@vaadin/item": "25.0.0-beta2",
|
|
42
|
+
"@vaadin/list-box": "25.0.0-beta2",
|
|
43
|
+
"@vaadin/overlay": "25.0.0-beta2",
|
|
44
|
+
"@vaadin/tooltip": "25.0.0-beta2",
|
|
45
|
+
"@vaadin/vaadin-themable-mixin": "25.0.0-beta2",
|
|
50
46
|
"lit": "^3.0.0"
|
|
51
47
|
},
|
|
52
48
|
"devDependencies": {
|
|
53
|
-
"@vaadin/chai-plugins": "25.0.0-
|
|
54
|
-
"@vaadin/test-runner-commands": "25.0.0-
|
|
49
|
+
"@vaadin/chai-plugins": "25.0.0-beta2",
|
|
50
|
+
"@vaadin/test-runner-commands": "25.0.0-beta2",
|
|
55
51
|
"@vaadin/testing-helpers": "^2.0.0",
|
|
56
|
-
"
|
|
52
|
+
"@vaadin/vaadin-lumo-styles": "25.0.0-beta2",
|
|
53
|
+
"sinon": "^21.0.0"
|
|
57
54
|
},
|
|
58
55
|
"web-types": [
|
|
59
56
|
"web-types.json",
|
|
60
57
|
"web-types.lit.json"
|
|
61
58
|
],
|
|
62
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "e078f8371ae266f05c7ca1ec25686cc489c83f24"
|
|
63
60
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
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
|
-
import '@vaadin/component-base/src/style-props.js';
|
|
6
|
+
import '@vaadin/component-base/src/styles/style-props.js';
|
|
7
7
|
import { css } from 'lit';
|
|
8
8
|
|
|
9
9
|
export const avatarGroupStyles = css`
|
|
@@ -31,16 +31,11 @@ export const avatarGroupStyles = css`
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
::slotted(vaadin-avatar) {
|
|
34
|
+
--_overlap: max(0px, var(--vaadin-avatar-group-overlap, 8px));
|
|
35
|
+
--_gap: max(0px, var(--vaadin-avatar-group-gap, 2px));
|
|
34
36
|
mask-image: url('data:image/svg+xml;utf8,<svg viewBox="0 0 300 300" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M300 0H0V300H300V0ZM150 200C177.614 200 200 177.614 200 150C200 122.386 177.614 100 150 100C122.386 100 100 122.386 100 150C100 177.614 122.386 200 150 200Z" fill="black"/></svg>');
|
|
35
|
-
mask-size: calc(
|
|
36
|
-
mask-position: calc(
|
|
37
|
-
50% +
|
|
38
|
-
(
|
|
39
|
-
var(--vaadin-avatar-size, 32px) - var(--vaadin-avatar-group-overlap, 8px) +
|
|
40
|
-
var(--vaadin-avatar-group-gap, 2px)
|
|
41
|
-
) *
|
|
42
|
-
var(--_d)
|
|
43
|
-
);
|
|
37
|
+
mask-size: calc((100% - var(--vaadin-focus-ring-width) * 2) * 3);
|
|
38
|
+
mask-position: calc(50% + (100% - var(--vaadin-focus-ring-width) * 2 - var(--_overlap)) * var(--_d));
|
|
44
39
|
--_d: var(--_dir);
|
|
45
40
|
}
|
|
46
41
|
|
|
@@ -49,10 +44,7 @@ export const avatarGroupStyles = css`
|
|
|
49
44
|
}
|
|
50
45
|
|
|
51
46
|
::slotted(vaadin-avatar:not(:first-of-type)) {
|
|
52
|
-
margin-inline-start: calc(
|
|
53
|
-
var(--vaadin-avatar-group-overlap, 8px) * -1 - var(--vaadin-focus-ring-width) +
|
|
54
|
-
var(--vaadin-avatar-group-gap, 2px)
|
|
55
|
-
);
|
|
47
|
+
margin-inline-start: calc((var(--vaadin-focus-ring-width) + var(--_overlap) - var(--_gap)) * -1);
|
|
56
48
|
}
|
|
57
49
|
|
|
58
50
|
:host(:not([theme~='reverse'])) ::slotted(vaadin-avatar:last-child),
|
|
@@ -10,7 +10,7 @@ import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
|
10
10
|
import { ItemMixin } from '@vaadin/item/src/vaadin-item-mixin.js';
|
|
11
11
|
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
12
12
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
-
import { avatarGroupMenuItemStyles } from './styles/vaadin-avatar-group-menu-item-
|
|
13
|
+
import { avatarGroupMenuItemStyles } from './styles/vaadin-avatar-group-menu-item-base-styles.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* An element used internally by `<vaadin-avatar-group>`. Not intended to be used separately.
|
|
@@ -10,7 +10,7 @@ import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
|
10
10
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
11
11
|
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
12
12
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
13
|
-
import { avatarGroupMenuStyles } from './styles/vaadin-avatar-group-menu-
|
|
13
|
+
import { avatarGroupMenuStyles } from './styles/vaadin-avatar-group-menu-base-styles.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* An element used internally by `<vaadin-avatar-group>`. Not intended to be used separately.
|
|
@@ -6,7 +6,6 @@
|
|
|
6
6
|
import type { Constructor } from '@open-wc/dedupe-mixin';
|
|
7
7
|
import type { AvatarI18n } from '@vaadin/avatar/src/vaadin-avatar.js';
|
|
8
8
|
import type { I18nMixinClass } from '@vaadin/component-base/src/i18n-mixin.js';
|
|
9
|
-
import type { OverlayClassMixinClass } from '@vaadin/component-base/src/overlay-class-mixin.js';
|
|
10
9
|
import type { ResizeMixinClass } from '@vaadin/component-base/src/resize-mixin.js';
|
|
11
10
|
|
|
12
11
|
export interface AvatarGroupI18n extends AvatarI18n {
|
|
@@ -33,7 +32,6 @@ export declare function AvatarGroupMixin<T extends Constructor<HTMLElement>>(
|
|
|
33
32
|
base: T,
|
|
34
33
|
): Constructor<AvatarGroupMixinClass> &
|
|
35
34
|
Constructor<I18nMixinClass<AvatarGroupI18n>> &
|
|
36
|
-
Constructor<OverlayClassMixinClass> &
|
|
37
35
|
Constructor<ResizeMixinClass> &
|
|
38
36
|
T;
|
|
39
37
|
|
|
@@ -79,7 +77,7 @@ export declare class AvatarGroupMixinClass {
|
|
|
79
77
|
* just the individual properties you want to change.
|
|
80
78
|
*
|
|
81
79
|
* The object has the following JSON structure and default values:
|
|
82
|
-
* ```
|
|
80
|
+
* ```js
|
|
83
81
|
* {
|
|
84
82
|
* // Translation of the anonymous user avatar tooltip.
|
|
85
83
|
* anonymous: 'anonymous',
|
|
@@ -7,7 +7,6 @@ import { html, render } from 'lit';
|
|
|
7
7
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
8
8
|
import { announce } from '@vaadin/a11y-base/src/announce.js';
|
|
9
9
|
import { I18nMixin } from '@vaadin/component-base/src/i18n-mixin.js';
|
|
10
|
-
import { OverlayClassMixin } from '@vaadin/component-base/src/overlay-class-mixin.js';
|
|
11
10
|
import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
|
|
12
11
|
import { SlotController } from '@vaadin/component-base/src/slot-controller.js';
|
|
13
12
|
|
|
@@ -29,10 +28,9 @@ const DEFAULT_I18N = {
|
|
|
29
28
|
* @polymerMixin
|
|
30
29
|
* @mixes I18nMixin
|
|
31
30
|
* @mixes ResizeMixin
|
|
32
|
-
* @mixes OverlayClassMixin
|
|
33
31
|
*/
|
|
34
32
|
export const AvatarGroupMixin = (superClass) =>
|
|
35
|
-
class AvatarGroupMixinClass extends I18nMixin(DEFAULT_I18N, ResizeMixin(
|
|
33
|
+
class AvatarGroupMixinClass extends I18nMixin(DEFAULT_I18N, ResizeMixin(superClass)) {
|
|
36
34
|
static get properties() {
|
|
37
35
|
return {
|
|
38
36
|
/**
|
|
@@ -109,7 +107,7 @@ export const AvatarGroupMixin = (superClass) =>
|
|
|
109
107
|
* just the individual properties you want to change.
|
|
110
108
|
*
|
|
111
109
|
* The object has the following JSON structure and default values:
|
|
112
|
-
* ```
|
|
110
|
+
* ```js
|
|
113
111
|
* {
|
|
114
112
|
* // Translation of the anonymous user avatar tooltip.
|
|
115
113
|
* anonymous: 'anonymous',
|
|
@@ -158,6 +156,7 @@ export const AvatarGroupMixin = (superClass) =>
|
|
|
158
156
|
this._overflowController = new SlotController(this, 'overflow', 'vaadin-avatar', {
|
|
159
157
|
initializer: (overflow) => {
|
|
160
158
|
overflow.setAttribute('role', 'button');
|
|
159
|
+
overflow.setAttribute('tabindex', '0');
|
|
161
160
|
overflow.setAttribute('aria-haspopup', 'menu');
|
|
162
161
|
overflow.setAttribute('aria-expanded', 'false');
|
|
163
162
|
overflow.addEventListener('click', (e) => this._onOverflowClick(e));
|
|
@@ -261,7 +260,6 @@ export const AvatarGroupMixin = (superClass) =>
|
|
|
261
260
|
class="${ifDefined(item.className)}"
|
|
262
261
|
theme="${ifDefined(this._theme)}"
|
|
263
262
|
aria-hidden="true"
|
|
264
|
-
tabindex="-1"
|
|
265
263
|
></vaadin-avatar>
|
|
266
264
|
${item.name || ''}
|
|
267
265
|
</vaadin-avatar-group-menu-item>
|
|
@@ -336,6 +334,7 @@ export const AvatarGroupMixin = (superClass) =>
|
|
|
336
334
|
.i18n="${this.__effectiveI18n}"
|
|
337
335
|
theme="${ifDefined(this._theme)}"
|
|
338
336
|
class="${ifDefined(item.className)}"
|
|
337
|
+
tabindex="0"
|
|
339
338
|
with-tooltip
|
|
340
339
|
></vaadin-avatar>
|
|
341
340
|
`,
|
|
@@ -455,10 +454,7 @@ export const AvatarGroupMixin = (superClass) =>
|
|
|
455
454
|
if (opened) {
|
|
456
455
|
this._openedWithFocusRing = this._overflow.hasAttribute('focus-ring');
|
|
457
456
|
} else if (oldOpened) {
|
|
458
|
-
this._overflow.focus();
|
|
459
|
-
if (this._openedWithFocusRing) {
|
|
460
|
-
this._overflow.setAttribute('focus-ring', '');
|
|
461
|
-
}
|
|
457
|
+
this._overflow.focus({ focusVisible: this._openedWithFocusRing });
|
|
462
458
|
}
|
|
463
459
|
|
|
464
460
|
this._overflow.setAttribute('aria-expanded', opened === true);
|
|
@@ -7,7 +7,7 @@ import { html, LitElement } from 'lit';
|
|
|
7
7
|
import { defineCustomElement } from '@vaadin/component-base/src/define.js';
|
|
8
8
|
import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
|
|
9
9
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
10
|
-
import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-
|
|
10
|
+
import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-base-styles.js';
|
|
11
11
|
import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
|
|
12
12
|
import { PositionMixin } from '@vaadin/overlay/src/vaadin-overlay-position-mixin.js';
|
|
13
13
|
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
@@ -38,7 +38,7 @@ class AvatarGroupOverlay extends PositionMixin(
|
|
|
38
38
|
/** @protected */
|
|
39
39
|
render() {
|
|
40
40
|
return html`
|
|
41
|
-
<div part="overlay" id="overlay"
|
|
41
|
+
<div part="overlay" id="overlay">
|
|
42
42
|
<div part="content" id="content">
|
|
43
43
|
<slot></slot>
|
|
44
44
|
</div>
|
|
@@ -48,7 +48,6 @@ export { AvatarGroupI18n, AvatarGroupItem, AvatarI18n };
|
|
|
48
48
|
* In addition to `<vaadin-avatar-group>` itself, the following internal
|
|
49
49
|
* components are themable:
|
|
50
50
|
*
|
|
51
|
-
* - `<vaadin-avatar-group-overlay>` - has the same API as [`<vaadin-overlay>`](#/elements/vaadin-overlay).
|
|
52
51
|
* - `<vaadin-avatar-group-menu>` - has the same API as [`<vaadin-list-box>`](#/elements/vaadin-list-box).
|
|
53
52
|
* - `<vaadin-avatar-group-menu-item>` - has the same API as [`<vaadin-item>`](#/elements/vaadin-item).
|
|
54
53
|
*/
|
|
@@ -14,7 +14,7 @@ import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
|
|
|
14
14
|
import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
|
|
15
15
|
import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
|
|
16
16
|
import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
17
|
-
import { avatarGroupStyles } from './styles/vaadin-avatar-group-
|
|
17
|
+
import { avatarGroupStyles } from './styles/vaadin-avatar-group-base-styles.js';
|
|
18
18
|
import { AvatarGroupMixin } from './vaadin-avatar-group-mixin.js';
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -55,7 +55,6 @@ import { AvatarGroupMixin } from './vaadin-avatar-group-mixin.js';
|
|
|
55
55
|
* In addition to `<vaadin-avatar-group>` itself, the following internal
|
|
56
56
|
* components are themable:
|
|
57
57
|
*
|
|
58
|
-
* - `<vaadin-avatar-group-overlay>` - has the same API as [`<vaadin-overlay>`](#/elements/vaadin-overlay).
|
|
59
58
|
* - `<vaadin-avatar-group-menu>` - has the same API as [`<vaadin-list-box>`](#/elements/vaadin-list-box).
|
|
60
59
|
* - `<vaadin-avatar-group-menu-item>` - has the same API as [`<vaadin-item>`](#/elements/vaadin-item).
|
|
61
60
|
*
|
package/vaadin-avatar-group.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import './
|
|
1
|
+
import './src/vaadin-avatar-group.js';
|
|
2
2
|
export * from './src/vaadin-avatar-group.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-group",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-beta2",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
8
8
|
"elements": [
|
|
9
9
|
{
|
|
10
10
|
"name": "vaadin-avatar-group",
|
|
11
|
-
"description": "`<vaadin-avatar-group>` is a Web Component providing avatar group displaying functionality.\n\nTo create the avatar group, first add the component to the page:\n\n```html\n<vaadin-avatar-group></vaadin-avatar-group>\n```\n\nAnd then use [`items`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-
|
|
11
|
+
"description": "`<vaadin-avatar-group>` is a Web Component providing avatar group displaying functionality.\n\nTo create the avatar group, first add the component to the page:\n\n```html\n<vaadin-avatar-group></vaadin-avatar-group>\n```\n\nAnd then use [`items`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/elements/vaadin-avatar-group#property-items) property to initialize the structure:\n\n```js\ndocument.querySelector('vaadin-avatar-group').items = [\n {name: 'John Doe'},\n {abbr: 'AB'}\n];\n```\n\n### Styling\n\nThe following shadow DOM parts are exposed for styling:\n\nPart name | Description\n----------- | ---------------\n`container` | The container element\n`overlay` | The overflow avatar menu overlay\n`content` | The overflow avatar menu overlay content\n\nSee the [`<vaadin-avatar>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/elements/vaadin-avatar) documentation for the available\nstate attributes and stylable shadow parts of avatar elements.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Internal components\n\nIn addition to `<vaadin-avatar-group>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-avatar-group-menu>` - has the same API as [`<vaadin-list-box>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/elements/vaadin-list-box).\n- `<vaadin-avatar-group-menu-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/elements/vaadin-item).",
|
|
12
12
|
"attributes": [
|
|
13
13
|
{
|
|
14
14
|
"name": "i18n",
|
|
@@ -19,17 +19,6 @@
|
|
|
19
19
|
]
|
|
20
20
|
}
|
|
21
21
|
},
|
|
22
|
-
{
|
|
23
|
-
"name": "overlay-class",
|
|
24
|
-
"description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
|
|
25
|
-
"value": {
|
|
26
|
-
"type": [
|
|
27
|
-
"string",
|
|
28
|
-
"null",
|
|
29
|
-
"undefined"
|
|
30
|
-
]
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
22
|
{
|
|
34
23
|
"name": "max-items-visible",
|
|
35
24
|
"description": "The maximum number of avatars to display. By default, all the avatars are displayed.\nWhen _maxItemsVisible_ is set, the overflowing avatars are grouped into one avatar with\na dropdown. Setting 0 or 1 has no effect so there are always at least two avatars visible.",
|
|
@@ -57,27 +46,16 @@
|
|
|
57
46
|
"properties": [
|
|
58
47
|
{
|
|
59
48
|
"name": "i18n",
|
|
60
|
-
"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
|
|
49
|
+
"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 // Translation of the avatar group accessible label.\n // {count} is replaced with the actual count of users.\n activeUsers: {\n one: 'Currently one active user',\n many: 'Currently {count} active users'\n },\n // Screen reader announcement when user joins group.\n // {user} is replaced with the name or abbreviation.\n // When neither is set, \"anonymous\" is used instead.\n joined: '{user} joined',\n // Screen reader announcement when user leaves group.\n // {user} is replaced with the name or abbreviation.\n // When neither is set, \"anonymous\" is used instead.\n left: '{user} left'\n}\n```",
|
|
61
50
|
"value": {
|
|
62
51
|
"type": [
|
|
63
52
|
"AvatarGroupI18n"
|
|
64
53
|
]
|
|
65
54
|
}
|
|
66
55
|
},
|
|
67
|
-
{
|
|
68
|
-
"name": "overlayClass",
|
|
69
|
-
"description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
|
|
70
|
-
"value": {
|
|
71
|
-
"type": [
|
|
72
|
-
"string",
|
|
73
|
-
"null",
|
|
74
|
-
"undefined"
|
|
75
|
-
]
|
|
76
|
-
}
|
|
77
|
-
},
|
|
78
56
|
{
|
|
79
57
|
"name": "items",
|
|
80
|
-
"description": "An array containing the items which will be stamped as avatars.\n\nThe items objects allow to configure [`name`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-
|
|
58
|
+
"description": "An array containing the items which will be stamped as avatars.\n\nThe items objects allow to configure [`name`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/elements/vaadin-avatar#property-name),\n[`abbr`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/elements/vaadin-avatar#property-abbr), [`img`](#/elements/vaadin-avatar#property-img)\nand [`colorIndex`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/elements/vaadin-avatar#property-colorIndex) properties on the\nstamped avatars, and set `className` to provide CSS class names.\n\n#### Example\n\n```js\ngroup.items = [\n {\n name: 'User name',\n img: 'url-to-image.png',\n className: 'even'\n },\n {\n abbr: 'JD',\n colorIndex: 1,\n className: 'odd'\n },\n];\n```",
|
|
81
59
|
"value": {
|
|
82
60
|
"type": [
|
|
83
61
|
"Array.<AvatarGroupItem>",
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/avatar-group",
|
|
4
|
-
"version": "25.0.0-
|
|
4
|
+
"version": "25.0.0-beta2",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -16,26 +16,19 @@
|
|
|
16
16
|
"elements": [
|
|
17
17
|
{
|
|
18
18
|
"name": "vaadin-avatar-group",
|
|
19
|
-
"description": "`<vaadin-avatar-group>` is a Web Component providing avatar group displaying functionality.\n\nTo create the avatar group, first add the component to the page:\n\n```html\n<vaadin-avatar-group></vaadin-avatar-group>\n```\n\nAnd then use [`items`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-
|
|
19
|
+
"description": "`<vaadin-avatar-group>` is a Web Component providing avatar group displaying functionality.\n\nTo create the avatar group, first add the component to the page:\n\n```html\n<vaadin-avatar-group></vaadin-avatar-group>\n```\n\nAnd then use [`items`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/elements/vaadin-avatar-group#property-items) property to initialize the structure:\n\n```js\ndocument.querySelector('vaadin-avatar-group').items = [\n {name: 'John Doe'},\n {abbr: 'AB'}\n];\n```\n\n### Styling\n\nThe following shadow DOM parts are exposed for styling:\n\nPart name | Description\n----------- | ---------------\n`container` | The container element\n`overlay` | The overflow avatar menu overlay\n`content` | The overflow avatar menu overlay content\n\nSee the [`<vaadin-avatar>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/elements/vaadin-avatar) documentation for the available\nstate attributes and stylable shadow parts of avatar elements.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Internal components\n\nIn addition to `<vaadin-avatar-group>` itself, the following internal\ncomponents are themable:\n\n- `<vaadin-avatar-group-menu>` - has the same API as [`<vaadin-list-box>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/elements/vaadin-list-box).\n- `<vaadin-avatar-group-menu-item>` - has the same API as [`<vaadin-item>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/elements/vaadin-item).",
|
|
20
20
|
"extension": true,
|
|
21
21
|
"attributes": [
|
|
22
22
|
{
|
|
23
23
|
"name": ".i18n",
|
|
24
|
-
"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
|
|
25
|
-
"value": {
|
|
26
|
-
"kind": "expression"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"name": ".overlayClass",
|
|
31
|
-
"description": "A space-delimited list of CSS class names to set on the overlay element.\nThis property does not affect other CSS class names set manually via JS.\n\nNote, if the CSS class name was set with this property, clearing it will\nremove it from the overlay, even if the same class name was also added\nmanually, e.g. by using `classList.add()` in the `renderer` function.",
|
|
24
|
+
"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 // Translation of the avatar group accessible label.\n // {count} is replaced with the actual count of users.\n activeUsers: {\n one: 'Currently one active user',\n many: 'Currently {count} active users'\n },\n // Screen reader announcement when user joins group.\n // {user} is replaced with the name or abbreviation.\n // When neither is set, \"anonymous\" is used instead.\n joined: '{user} joined',\n // Screen reader announcement when user leaves group.\n // {user} is replaced with the name or abbreviation.\n // When neither is set, \"anonymous\" is used instead.\n left: '{user} left'\n}\n```",
|
|
32
25
|
"value": {
|
|
33
26
|
"kind": "expression"
|
|
34
27
|
}
|
|
35
28
|
},
|
|
36
29
|
{
|
|
37
30
|
"name": ".items",
|
|
38
|
-
"description": "An array containing the items which will be stamped as avatars.\n\nThe items objects allow to configure [`name`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-
|
|
31
|
+
"description": "An array containing the items which will be stamped as avatars.\n\nThe items objects allow to configure [`name`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/elements/vaadin-avatar#property-name),\n[`abbr`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/elements/vaadin-avatar#property-abbr), [`img`](#/elements/vaadin-avatar#property-img)\nand [`colorIndex`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-beta2/#/elements/vaadin-avatar#property-colorIndex) properties on the\nstamped avatars, and set `className` to provide CSS class names.\n\n#### Example\n\n```js\ngroup.items = [\n {\n name: 'User name',\n img: 'url-to-image.png',\n className: 'even'\n },\n {\n abbr: 'JD',\n colorIndex: 1,\n className: 'odd'\n },\n];\n```",
|
|
39
32
|
"value": {
|
|
40
33
|
"kind": "expression"
|
|
41
34
|
}
|
|
@@ -1,44 +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
|
-
import { css } from 'lit';
|
|
7
|
-
|
|
8
|
-
export const avatarGroupStyles = css`
|
|
9
|
-
:host {
|
|
10
|
-
display: block;
|
|
11
|
-
width: 100%; /* prevent collapsing inside non-stretching column flex */
|
|
12
|
-
--vaadin-avatar-group-overlap: 8px;
|
|
13
|
-
/* Deprecated property name (overlap-border), for backwards compatibility */
|
|
14
|
-
--vaadin-avatar-group-overlap-border: var(--vaadin-avatar-group-gap, 2px);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
:host([hidden]) {
|
|
18
|
-
display: none !important;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
[part='container'] {
|
|
22
|
-
display: flex;
|
|
23
|
-
position: relative;
|
|
24
|
-
width: 100%;
|
|
25
|
-
flex-wrap: nowrap;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
::slotted(vaadin-avatar:not(:first-of-type)) {
|
|
29
|
-
mask-image: url('data:image/svg+xml;utf8,<svg viewBox=%220 0 300 300%22 fill=%22none%22 xmlns=%22http://www.w3.org/2000/svg%22><path fill-rule=%22evenodd%22 clip-rule=%22evenodd%22 d=%22M300 0H0V300H300V0ZM150 200C177.614 200 200 177.614 200 150C200 122.386 177.614 100 150 100C122.386 100 100 122.386 100 150C100 177.614 122.386 200 150 200Z%22 fill=%22black%22/></svg>');
|
|
30
|
-
mask-size: calc(300% + var(--vaadin-avatar-group-overlap-border) * 6 - var(--vaadin-avatar-outline-width) * 6);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
::slotted(vaadin-avatar:not([dir='rtl']):not(:first-of-type)) {
|
|
34
|
-
margin-left: calc(var(--vaadin-avatar-group-overlap) * -1 - var(--vaadin-avatar-outline-width));
|
|
35
|
-
mask-position: calc(50% - var(--vaadin-avatar-size) + var(--vaadin-avatar-group-overlap));
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
::slotted(vaadin-avatar[dir='rtl']:not(:first-of-type)) {
|
|
39
|
-
margin-right: calc(var(--vaadin-avatar-group-overlap) * -1);
|
|
40
|
-
mask-position: calc(
|
|
41
|
-
50% + var(--vaadin-avatar-size) - var(--vaadin-avatar-group-overlap) + var(--vaadin-avatar-outline-width)
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
`;
|
|
@@ -1,8 +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
|
-
import { listBoxStyles } from '@vaadin/list-box/src/styles/vaadin-list-box-core-styles.js';
|
|
7
|
-
|
|
8
|
-
export { listBoxStyles as avatarGroupMenuStyles };
|
|
@@ -1,8 +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
|
-
import { itemStyles } from '@vaadin/item/src/styles/vaadin-item-core-styles.js';
|
|
7
|
-
|
|
8
|
-
export const avatarGroupMenuItemStyles = itemStyles;
|
|
@@ -1,84 +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 { item } from '@vaadin/item/theme/lumo/vaadin-item-styles.js';
|
|
5
|
-
import { listBox } from '@vaadin/list-box/theme/lumo/vaadin-list-box-styles.js';
|
|
6
|
-
import { menuOverlayCore } from '@vaadin/vaadin-lumo-styles/mixins/menu-overlay.js';
|
|
7
|
-
import { overlay } from '@vaadin/vaadin-lumo-styles/mixins/overlay.js';
|
|
8
|
-
import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
|
|
9
|
-
|
|
10
|
-
registerStyles(
|
|
11
|
-
'vaadin-avatar-group',
|
|
12
|
-
css`
|
|
13
|
-
:host {
|
|
14
|
-
--vaadin-avatar-size: var(--lumo-size-m);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
:host([theme~='xlarge']) {
|
|
18
|
-
--vaadin-avatar-group-overlap: 12px;
|
|
19
|
-
--vaadin-avatar-group-overlap-border: 3px;
|
|
20
|
-
--vaadin-avatar-size: var(--lumo-size-xl);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
:host([theme~='large']) {
|
|
24
|
-
--vaadin-avatar-group-overlap: 10px;
|
|
25
|
-
--vaadin-avatar-group-overlap-border: 3px;
|
|
26
|
-
--vaadin-avatar-size: var(--lumo-size-l);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
:host([theme~='small']) {
|
|
30
|
-
--vaadin-avatar-group-overlap: 6px;
|
|
31
|
-
--vaadin-avatar-group-overlap-border: 2px;
|
|
32
|
-
--vaadin-avatar-size: var(--lumo-size-s);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
:host([theme~='xsmall']) {
|
|
36
|
-
--vaadin-avatar-group-overlap: 4px;
|
|
37
|
-
--vaadin-avatar-group-overlap-border: 2px;
|
|
38
|
-
--vaadin-avatar-size: var(--lumo-size-xs);
|
|
39
|
-
}
|
|
40
|
-
`,
|
|
41
|
-
{ moduleId: 'lumo-avatar-group' },
|
|
42
|
-
);
|
|
43
|
-
|
|
44
|
-
const avatarGroupOverlay = css`
|
|
45
|
-
:host {
|
|
46
|
-
--_lumo-list-box-item-selected-icon-display: none;
|
|
47
|
-
--_lumo-list-box-item-padding-left: calc(var(--lumo-space-m) + var(--lumo-border-radius-m) / 4);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
[part='overlay'] {
|
|
51
|
-
outline: none;
|
|
52
|
-
}
|
|
53
|
-
`;
|
|
54
|
-
|
|
55
|
-
registerStyles('vaadin-avatar-group-overlay', [overlay, menuOverlayCore, avatarGroupOverlay], {
|
|
56
|
-
moduleId: 'lumo-avatar-group-overlay',
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
registerStyles('vaadin-avatar-group-menu', listBox, { moduleId: 'lumo-avatar-group-menu' });
|
|
60
|
-
|
|
61
|
-
registerStyles(
|
|
62
|
-
'vaadin-avatar-group-menu-item',
|
|
63
|
-
[
|
|
64
|
-
item,
|
|
65
|
-
css`
|
|
66
|
-
:host {
|
|
67
|
-
padding: var(--lumo-space-xs);
|
|
68
|
-
padding-inline-end: var(--lumo-space-m);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
[part='content'] {
|
|
72
|
-
display: flex;
|
|
73
|
-
align-items: center;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
[part='content'] ::slotted(vaadin-avatar) {
|
|
77
|
-
width: var(--lumo-size-xs);
|
|
78
|
-
height: var(--lumo-size-xs);
|
|
79
|
-
margin-inline-end: var(--lumo-space-s);
|
|
80
|
-
}
|
|
81
|
-
`,
|
|
82
|
-
],
|
|
83
|
-
{ moduleId: 'lumo-avatar-group-menu-item' },
|
|
84
|
-
);
|