@vaadin/login 22.0.0-alpha9 → 22.0.0

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
@@ -1,65 +1,57 @@
1
- # <vaadin-login>
1
+ # @vaadin/login
2
2
 
3
- [Live Demo ↗](https://vaadin.com/components/vaadin-login/html-examples)
4
- |
5
- [API documentation ↗](https://vaadin.com/components/vaadin-login/html-api)
3
+ A web component for displaying a login form, either inline, or as an overlay.
6
4
 
7
- [Vaadin Login](https://vaadin.com/components/vaadin-login) consists of two components:
8
-
9
- <vaadin-login-overlay> is a Web Component providing a painless login experience, part of the [Vaadin components](https://vaadin.com/components). Component shows the <vaadin-login-form> inside of an overlay.
5
+ [Documentation + Live Demo ↗](https://vaadin.com/docs/latest/ds/components/login)
10
6
 
11
7
  [![npm version](https://badgen.net/npm/v/@vaadin/login)](https://www.npmjs.com/package/@vaadin/login)
12
- [![Published on Vaadin Directory](https://img.shields.io/badge/Vaadin%20Directory-published-00b4f0.svg)](https://vaadin.com/directory/component/vaadinvaadin-login)
13
8
  [![Discord](https://img.shields.io/discord/732335336448852018?label=discord)](https://discord.gg/PHmkCKC)
14
9
 
15
10
  ```html
16
11
  <vaadin-login-overlay opened></vaadin-login-overlay>
17
12
  ```
18
13
 
19
- [<img src="https://raw.githubusercontent.com/vaadin/vaadin-login/master/screenshot.png" width="700" alt="Screenshot of vaadin-login-overlay">](https://vaadin.com/components/vaadin-login)
20
-
21
- &lt;vaadin-login-form&gt; is a Web Component providing a form to require users to log in into an application.
22
-
23
- ```html
24
- <vaadin-login-form></vaadin-login-form>
25
- ```
14
+ [<img src="https://raw.githubusercontent.com/vaadin/web-components/master/packages/login/screenshot.png" width="456" alt="Screenshot of vaadin-login-overlay">](https://vaadin.com/docs/latest/ds/components/login)
26
15
 
27
16
  ## Installation
28
17
 
29
- Install `vaadin-login`:
18
+ Install the component:
30
19
 
31
20
  ```sh
32
- npm i @vaadin/login --save
21
+ npm i @vaadin/login
33
22
  ```
34
23
 
35
- Once installed, import it in your application:
24
+ Once installed, import the component in your application:
36
25
 
37
26
  ```js
38
- import '@vaadin/login/vaadin-login-overlay.js';
27
+ import '@vaadin/login';
39
28
  ```
40
29
 
41
- ## Getting started
42
-
43
- Vaadin components use the Lumo theme by default.
44
-
45
- To use the Material theme, import the correspondent file from the `theme/material` folder.
30
+ ## Themes
46
31
 
47
- ## Entry points
32
+ Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/ds/customization/using-themes), Lumo and Material.
33
+ The [main entrypoint](https://github.com/vaadin/web-components/blob/master/packages/list-box/vaadin-list-box.js) of the package uses Lumo theme.
48
34
 
49
- - The component with the Lumo theme:
35
+ To use the Material theme, import the components from the `theme/material` folder:
50
36
 
51
- `theme/lumo/vaadin-login-overlay.js`
52
- `theme/lumo/vaadin-login-form.js`
37
+ ```js
38
+ import '@vaadin/login/theme/material/vaadin-login-overlay.js';
39
+ import '@vaadin/login/theme/material/vaadin-login-form.js';
40
+ ```
53
41
 
54
- - The component with the Material theme:
42
+ You can also import the Lumo version of the components explicitly:
55
43
 
56
- `theme/material/vaadin-login-overlay.js`
57
- `theme/material/vaadin-login-form.js`
44
+ ```js
45
+ import '@vaadin/login/theme/lumo/vaadin-login-overlay.js';
46
+ import '@vaadin/login/theme/lumo/vaadin-login-form.js';
47
+ ```
58
48
 
59
- - Aliases for lumo themed components:
49
+ Finally, you can import the un-themed components from the `src` folder to get a minimal starting point:
60
50
 
61
- `vaadin-login-overlay.js`
62
- `vaadin-login-form.js`
51
+ ```js
52
+ import '@vaadin/login/src/vaadin-login-overlay.js';
53
+ import '@vaadin/login/src/vaadin-login-form.js';
54
+ ```
63
55
 
64
56
  ## Contributing
65
57
 
@@ -69,4 +61,5 @@ Read the [contributing guide](https://vaadin.com/docs/latest/guide/contributing/
69
61
 
70
62
  Apache License 2.0
71
63
 
72
- Vaadin collects development time usage statistics to improve this product. For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
64
+ Vaadin collects usage statistics at development time to improve this product.
65
+ For details and to opt-out, see https://github.com/vaadin/vaadin-usage-statistics.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/login",
3
- "version": "22.0.0-alpha9",
3
+ "version": "22.0.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -32,20 +32,21 @@
32
32
  "polymer"
33
33
  ],
34
34
  "dependencies": {
35
+ "@open-wc/dedupe-mixin": "^1.3.0",
35
36
  "@polymer/polymer": "^3.0.0",
36
- "@vaadin/button": "22.0.0-alpha9",
37
- "@vaadin/component-base": "22.0.0-alpha9",
38
- "@vaadin/password-field": "22.0.0-alpha9",
39
- "@vaadin/text-field": "22.0.0-alpha9",
40
- "@vaadin/vaadin-lumo-styles": "22.0.0-alpha9",
41
- "@vaadin/vaadin-material-styles": "22.0.0-alpha9",
42
- "@vaadin/vaadin-overlay": "22.0.0-alpha9",
43
- "@vaadin/vaadin-themable-mixin": "22.0.0-alpha9"
37
+ "@vaadin/button": "^22.0.0",
38
+ "@vaadin/component-base": "^22.0.0",
39
+ "@vaadin/password-field": "^22.0.0",
40
+ "@vaadin/text-field": "^22.0.0",
41
+ "@vaadin/vaadin-lumo-styles": "^22.0.0",
42
+ "@vaadin/vaadin-material-styles": "^22.0.0",
43
+ "@vaadin/vaadin-overlay": "^22.0.0",
44
+ "@vaadin/vaadin-themable-mixin": "^22.0.0"
44
45
  },
45
46
  "devDependencies": {
46
47
  "@esm-bundle/chai": "^4.3.4",
47
- "@vaadin/testing-helpers": "^0.3.0",
48
+ "@vaadin/testing-helpers": "^0.3.2",
48
49
  "sinon": "^9.2.1"
49
50
  },
50
- "gitHead": "6e8c899dc65918f97e3c0acb2076122c4b2ef274"
51
+ "gitHead": "b668e9b1a975227fbe34beb70d1cd5b03dce2348"
51
52
  }
@@ -4,10 +4,10 @@
4
4
  * Copyright (C) 2020 Vaadin Ltd
5
5
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
6
6
  */
7
- import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
7
+ import '@vaadin/button/src/vaadin-button.js';
8
+ import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
8
9
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
9
10
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10
- import '@vaadin/button/src/vaadin-button.js';
11
11
  import { LoginMixin } from './vaadin-login-mixin.js';
12
12
 
13
13
  /**
@@ -4,12 +4,12 @@
4
4
  * Copyright (C) 2020 Vaadin Ltd
5
5
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
6
6
  */
7
- import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
8
- import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
9
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10
7
  import '@vaadin/text-field/src/vaadin-text-field.js';
11
8
  import '@vaadin/password-field/src/vaadin-password-field.js';
12
9
  import './vaadin-login-form-wrapper.js';
10
+ import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
11
+ import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
12
+ import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
13
13
  import { LoginMixin } from './vaadin-login-mixin.js';
14
14
 
15
15
  /**
@@ -91,6 +91,7 @@ class LoginForm extends LoginMixin(ElementMixin(ThemableMixin(PolymerElement)))
91
91
  required
92
92
  on-keydown="_handleInputKeydown"
93
93
  spellcheck="false"
94
+ autocomplete="current-password"
94
95
  >
95
96
  <input type="password" slot="input" on-keyup="_handleInputKeyup" />
96
97
  </vaadin-password-field>
@@ -3,6 +3,7 @@
3
3
  * Copyright (c) 2021 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
+ import { Constructor } from '@open-wc/dedupe-mixin';
6
7
 
7
8
  export interface LoginI18n {
8
9
  form: {
@@ -23,13 +24,9 @@ export interface LoginI18n {
23
24
  additionalInformation?: string;
24
25
  }
25
26
 
26
- declare function LoginMixin<T extends new (...args: any[]) => {}>(base: T): T & LoginMixinConstructor;
27
+ export declare function LoginMixin<T extends Constructor<HTMLElement>>(base: T): T & Constructor<LoginMixinClass>;
27
28
 
28
- interface LoginMixinConstructor {
29
- new (...args: any[]): LoginMixin;
30
- }
31
-
32
- interface LoginMixin {
29
+ export declare class LoginMixinClass {
33
30
  /**
34
31
  * If set, a synchronous POST call will be fired to the path defined.
35
32
  * The `login` event is also dispatched, so `event.preventDefault()` can be called to prevent the POST call.
@@ -91,7 +88,5 @@ interface LoginMixin {
91
88
  */
92
89
  i18n: LoginI18n;
93
90
 
94
- _retargetEvent(e: Event): void;
91
+ protected _retargetEvent(e: Event): void;
95
92
  }
96
-
97
- export { LoginMixin, LoginMixinConstructor };
@@ -4,12 +4,12 @@
4
4
  * Copyright (C) 2020 Vaadin Ltd
5
5
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
6
6
  */
7
- import { PolymerElement, html } from '@polymer/polymer/polymer-element.js';
7
+ import './vaadin-login-form.js';
8
+ import './vaadin-login-overlay-wrapper.js';
9
+ import { html, PolymerElement } from '@polymer/polymer/polymer-element.js';
8
10
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
9
11
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
10
12
  import { LoginMixin } from './vaadin-login-mixin.js';
11
- import './vaadin-login-form.js';
12
- import './vaadin-login-overlay-wrapper.js';
13
13
 
14
14
  /**
15
15
  * `<vaadin-login-overlay>` is a wrapper of the `<vaadin-login-form>` which opens a login form in an overlay and
@@ -1,5 +1,5 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
1
  import '@vaadin/vaadin-lumo-styles/spacing.js';
2
+ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
3
3
 
4
4
  registerStyles(
5
5
  'vaadin-login-form',
@@ -1,7 +1,7 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
- import { color } from '@vaadin/vaadin-lumo-styles/color.js';
3
1
  import '@vaadin/vaadin-lumo-styles/spacing.js';
2
+ import { color } from '@vaadin/vaadin-lumo-styles/color.js';
4
3
  import { typography } from '@vaadin/vaadin-lumo-styles/typography.js';
4
+ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
5
5
 
6
6
  const loginFormWrapper = css`
7
7
  :host {
@@ -1,8 +1,8 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
- import { color } from '@vaadin/vaadin-lumo-styles/color.js';
3
1
  import '@vaadin/vaadin-lumo-styles/spacing.js';
4
- import { typography } from '@vaadin/vaadin-lumo-styles/typography.js';
5
2
  import './vaadin-login-form-wrapper-styles.js';
3
+ import { color } from '@vaadin/vaadin-lumo-styles/color.js';
4
+ import { typography } from '@vaadin/vaadin-lumo-styles/typography.js';
5
+ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
6
6
 
7
7
  const loginOverlayWrapper = css`
8
8
  :host {
@@ -1,4 +1,4 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
1
+ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
2
2
 
3
3
  registerStyles(
4
4
  'vaadin-login-form',
@@ -1,6 +1,6 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
1
  import '@vaadin/vaadin-material-styles/color.js';
3
2
  import { typography } from '@vaadin/vaadin-material-styles/typography.js';
3
+ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
4
4
 
5
5
  const loginFormWrapper = css`
6
6
  :host {
@@ -1,8 +1,8 @@
1
- import { registerStyles, css } from '@vaadin/vaadin-themable-mixin/register-styles.js';
2
- import { typography } from '@vaadin/vaadin-material-styles/typography.js';
3
- import { overlay } from '@vaadin/vaadin-material-styles/mixins/overlay.js';
4
1
  import '@vaadin/vaadin-material-styles/color.js';
5
2
  import './vaadin-login-form-styles.js';
3
+ import { overlay } from '@vaadin/vaadin-material-styles/mixins/overlay.js';
4
+ import { typography } from '@vaadin/vaadin-material-styles/typography.js';
5
+ import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
6
6
 
7
7
  const loginOverlayWrapper = css`
8
8
  :host {