@vaadin/vaadin-avatar 22.0.0-alpha1 → 22.0.0-alpha10

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
@@ -7,10 +7,7 @@
7
7
  [API documentation ↗](https://vaadin.com/components/vaadin-avatar/html-api)
8
8
 
9
9
  [![npm version](https://badgen.net/npm/v/@vaadin/vaadin-avatar)](https://www.npmjs.com/package/@vaadin/vaadin-avatar)
10
- [![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/vaadin/vaadin-avatar)
11
- [![Build Status](https://travis-ci.org/vaadin/vaadin-avatar.svg?branch=master)](https://travis-ci.org/vaadin/vaadin-avatar)
12
10
  [![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-avatar)
13
- [![Stars on vaadin.com/directory](https://img.shields.io/vaadin-directory/star/vaadin-avatar-directory-urlidentifier.svg)](https://vaadin.com/directory/component/vaadinvaadin-avatar)
14
11
  [![Discord](https://img.shields.io/discord/732335336448852018?label=discord)](https://discord.gg/PHmkCKC)
15
12
 
16
13
  ```html
@@ -20,16 +17,15 @@
20
17
  <vaadin-avatar-group max="2"></vaadin-avatar-group>
21
18
  <script>
22
19
  document.querySelector('vaadin-avatar-group').items = [
23
- {name: 'Foo Bar', colorIndex: 1},
24
- {colorIndex: 2},
25
- {name: 'Foo Bar', colorIndex: 3}
20
+ { name: 'Foo Bar', colorIndex: 1 },
21
+ { colorIndex: 2 },
22
+ { name: 'Foo Bar', colorIndex: 3 }
26
23
  ];
27
24
  </script>
28
25
  ```
29
26
 
30
27
  [<img src="https://raw.githubusercontent.com/vaadin/vaadin-avatar/master/screenshot.png" width="200" alt="Screenshot of vaadin-avatar">](https://vaadin.com/components/vaadin-avatar)
31
28
 
32
-
33
29
  ## Installation
34
30
 
35
31
  Install `vaadin-avatar`:
@@ -68,46 +64,9 @@ To use the Material theme, import the correspondent file from the `theme/materia
68
64
  `vaadin-avatar.js`
69
65
  `vaadin-avatar-group.js`
70
66
 
71
-
72
- ## Running API docs and tests in a browser
73
-
74
- 1. Fork the `vaadin-avatar` repository and clone it locally.
75
-
76
- 1. Make sure you have [node.js](https://nodejs.org/) 12.x installed.
77
-
78
- 1. Make sure you have [npm](https://www.npmjs.com/) installed.
79
-
80
- 1. When in the `vaadin-avatar` directory, run `npm install` to install dependencies.
81
-
82
- 1. Run `npm start`, browser will automatically open the component API documentation.
83
-
84
- 1. You can also open visual tests, for example:
85
-
86
- - http://127.0.0.1:3000/test/visual/default.html
87
-
88
-
89
- ## Running tests from the command line
90
-
91
- 1. When in the `vaadin-avatar` directory, run `npm test`
92
-
93
- ## Debugging tests in the browser
94
-
95
- 1. Run `npm run debug`, then choose manual mode (M) and open the link in browser.
96
-
97
- ## Following the coding style
98
-
99
- We are using [ESLint](http://eslint.org/) for linting JavaScript code. You can check if your code is following our standards by running `npm run lint`, which will automatically lint all `.js` files.
100
-
101
-
102
- ## Big Thanks
103
-
104
- Cross-browser Testing Platform and Open Source <3 Provided by [Sauce Labs](https://saucelabs.com).
105
-
106
-
107
67
  ## Contributing
108
68
 
109
- To contribute to the component, please read [the guideline](https://github.com/vaadin/vaadin-core/blob/master/CONTRIBUTING.md) first.
110
-
69
+ Read the [contributing guide](https://vaadin.com/docs/latest/guide/contributing/overview) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
111
70
 
112
71
  ## License
113
72
 
package/package.json CHANGED
@@ -1,10 +1,29 @@
1
1
  {
2
2
  "name": "@vaadin/vaadin-avatar",
3
- "version": "22.0.0-alpha1",
3
+ "version": "22.0.0-alpha10",
4
+ "publishConfig": {
5
+ "access": "public"
6
+ },
4
7
  "description": "vaadin-avatar",
8
+ "license": "Apache-2.0",
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "https://github.com/vaadin/web-components.git",
12
+ "directory": "packages/vaadin-avatar"
13
+ },
14
+ "author": "Vaadin Ltd",
15
+ "homepage": "https://vaadin.com/components",
16
+ "bugs": {
17
+ "url": "https://github.com/vaadin/vaadin-avatar/issues"
18
+ },
5
19
  "main": "vaadin-avatar-group.js",
6
20
  "module": "vaadin-avatar-group.js",
7
- "repository": "vaadin/vaadin-avatar",
21
+ "files": [
22
+ "src",
23
+ "theme",
24
+ "vaadin-*.d.ts",
25
+ "vaadin-*.js"
26
+ ],
8
27
  "keywords": [
9
28
  "Vaadin",
10
29
  "vaadin-avatar",
@@ -12,37 +31,14 @@
12
31
  "web-component",
13
32
  "polymer"
14
33
  ],
15
- "author": "Vaadin Ltd",
16
- "license": "Apache-2.0",
17
- "bugs": {
18
- "url": "https://github.com/vaadin/vaadin-avatar/issues"
19
- },
20
- "homepage": "https://vaadin.com/components",
21
- "files": [
22
- "vaadin-*.d.ts",
23
- "vaadin-*.js",
24
- "src",
25
- "theme"
26
- ],
27
34
  "dependencies": {
28
- "@polymer/iron-a11y-announcer": "^3.0.0",
29
- "@polymer/iron-resizable-behavior": "^3.0.0",
30
- "@polymer/polymer": "^3.0.0",
31
- "@vaadin/vaadin-element-mixin": "^22.0.0-alpha1",
32
- "@vaadin/vaadin-item": "^22.0.0-alpha1",
33
- "@vaadin/vaadin-list-box": "^22.0.0-alpha1",
34
- "@vaadin/vaadin-lumo-styles": "^22.0.0-alpha1",
35
- "@vaadin/vaadin-material-styles": "^22.0.0-alpha1",
36
- "@vaadin/vaadin-overlay": "^22.0.0-alpha1",
37
- "@vaadin/vaadin-themable-mixin": "^22.0.0-alpha1"
35
+ "@vaadin/avatar": "22.0.0-alpha10",
36
+ "@vaadin/avatar-group": "22.0.0-alpha10"
38
37
  },
39
38
  "devDependencies": {
40
- "@esm-bundle/chai": "^4.1.5",
41
- "@vaadin/testing-helpers": "^0.2.1",
39
+ "@esm-bundle/chai": "^4.3.4",
40
+ "@vaadin/testing-helpers": "^0.3.0",
42
41
  "sinon": "^9.2.1"
43
42
  },
44
- "publishConfig": {
45
- "access": "public"
46
- },
47
- "gitHead": "c9694d6549bff1f7fffb9ece26178e57fc228a51"
43
+ "gitHead": "6d3055383b9c3c8306ea34c6f2e2087e63c49348"
48
44
  }
@@ -1,115 +1,18 @@
1
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
2
-
3
- import { ElementMixin } from '@vaadin/vaadin-element-mixin/vaadin-element-mixin.js';
4
-
5
- import { AvatarGroupItem, AvatarGroupI18n } from './interfaces';
6
-
7
1
  /**
8
- * `<vaadin-avatar-group>` is a Web Component providing avatar group displaying functionality.
9
- *
10
- * To create the avatar group, first add the component to the page:
11
- *
12
- * ```
13
- * <vaadin-avatar-group></vaadin-avatar-group>
14
- * ```
15
- *
16
- * And then use [`items`](#/elements/vaadin-avatar-group#property-items) property to initialize the structure:
17
- *
18
- * ```
19
- * document.querySelector('vaadin-avatar-group').items = [
20
- * {name: 'John Doe'},
21
- * {abbr: 'AB'}
22
- * ];
23
- * ```
24
- *
25
- * ### Styling
26
- *
27
- * The following shadow DOM parts are exposed for styling:
28
- *
29
- * Part name | Description
30
- * ----------- | ---------------
31
- * `container` | The container element
32
- * `avatar` | Individual avatars
33
- *
34
- * See [Styling Components](https://vaadin.com/docs/latest/ds/customization/styling-components) documentation.
35
- *
36
- * ### Internal components
37
- *
38
- * In addition to `<vaadin-avatar-group>` itself, the following internal
39
- * components are themable:
40
- *
41
- * - `<vaadin-avatar-group-list-box>` - has the same API as [`<vaadin-list-box>`](#/elements/vaadin-list-box).
42
- * - `<vaadin-avatar-group-overlay>` - has the same API as [`<vaadin-overlay>`](#/elements/vaadin-overlay).
2
+ * @license
3
+ * Copyright (c) 2021 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
43
5
  */
44
- declare class AvatarGroupElement extends ElementMixin(ThemableMixin(HTMLElement)) {
45
- readonly _avatars: HTMLElement[];
46
-
47
- /**
48
- * An array containing the items which will be stamped as avatars.
49
- *
50
- * The items objects allow to configure [`name`](#/elements/vaadin-avatar#property-name),
51
- * [`abbr`](#/elements/vaadin-avatar#property-abbr), [`img`](#/elements/vaadin-avatar#property-img)
52
- * and [`colorIndex`](#/elements/vaadin-avatar#property-colorIndex) properties on the
53
- * stamped avatars.
54
- *
55
- * #### Example
56
- *
57
- * ```js
58
- * group.items = [
59
- * {
60
- * name: 'User name',
61
- * img: 'url-to-image.png'
62
- * },
63
- * {
64
- * abbr: 'JD',
65
- * colorIndex: 1
66
- * },
67
- * ];
68
- * ```
69
- */
70
- items: AvatarGroupItem[] | undefined;
71
-
72
- /**
73
- * The maximum number of avatars to display. By default, all the avatars are displayed.
74
- * When _maxItemsVisible_ is set, the overflowing avatars are grouped into one avatar with
75
- * a dropdown. Setting 0 or 1 has no effect so there are always at least two avatars visible.
76
- */
77
- maxItemsVisible: number | null | undefined;
6
+ import { AvatarGroup } from '@vaadin/avatar-group/src/vaadin-avatar-group.js';
78
7
 
79
- /**
80
- * The object used to localize this component.
81
- * To change the default localization, replace the entire
82
- * _i18n_ object or just the property you want to modify.
83
- *
84
- * The object has the following JSON structure and default values:
85
- * ```
86
- * {
87
- * // Translation of the anonymous user avatar title.
88
- * anonymous: 'anonymous',
89
- * // Translation of the avatar group accessible label.
90
- * // {count} is replaced with the actual count of users.
91
- * activeUsers: {
92
- * one: 'Currently one active user',
93
- * many: 'Currently {count} active users'
94
- * },
95
- * // Screen reader announcement when user joins group.
96
- * // {user} is replaced with the name or abbreviation.
97
- * // When neither is set, "anonymous" is used instead.
98
- * joined: '{user} joined',
99
- * // Screen reader announcement when user leaves group.
100
- * // {user} is replaced with the name or abbreviation.
101
- * // When neither is set, "anonymous" is used instead.
102
- * left: '{user} left'
103
- * }
104
- * ```
105
- */
106
- i18n: AvatarGroupI18n;
107
- }
8
+ /**
9
+ * @deprecated Import `AvatarGroup` from `@vaadin/avatar-group` instead.
10
+ */
11
+ export type AvatarGroupElement = AvatarGroup;
108
12
 
109
- declare global {
110
- interface HTMLElementTagNameMap {
111
- 'vaadin-avatar-group': AvatarGroupElement;
112
- }
113
- }
13
+ /**
14
+ * @deprecated Import `AvatarGroup` from `@vaadin/avatar-group` instead.
15
+ */
16
+ export const AvatarGroupElement: typeof AvatarGroup;
114
17
 
115
- export { AvatarGroupElement };
18
+ export * from '@vaadin/avatar-group/src/vaadin-avatar-group.js';