@vaadin/login 24.8.0-alpha9 → 25.0.0-alpha1

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.
Files changed (37) hide show
  1. package/README.md +0 -26
  2. package/package.json +13 -16
  3. package/src/vaadin-login-form-wrapper.js +34 -32
  4. package/src/vaadin-login-form.js +41 -34
  5. package/src/vaadin-login-overlay-mixin.js +1 -0
  6. package/src/vaadin-login-overlay-wrapper.js +13 -11
  7. package/src/vaadin-login-overlay.js +36 -21
  8. package/theme/lumo/vaadin-login-overlay.d.ts +1 -4
  9. package/theme/lumo/vaadin-login-overlay.js +1 -4
  10. package/web-types.json +2 -2
  11. package/web-types.lit.json +2 -2
  12. package/src/vaadin-lit-login-form-wrapper.js +0 -86
  13. package/src/vaadin-lit-login-form.d.ts +0 -6
  14. package/src/vaadin-lit-login-form.js +0 -112
  15. package/src/vaadin-lit-login-overlay-wrapper.js +0 -52
  16. package/src/vaadin-lit-login-overlay.d.ts +0 -6
  17. package/src/vaadin-lit-login-overlay.js +0 -83
  18. package/theme/lumo/vaadin-lit-login-form.d.ts +0 -5
  19. package/theme/lumo/vaadin-lit-login-form.js +0 -5
  20. package/theme/lumo/vaadin-lit-login-overlay.d.ts +0 -3
  21. package/theme/lumo/vaadin-lit-login-overlay.js +0 -3
  22. package/theme/material/vaadin-lit-login-form.d.ts +0 -5
  23. package/theme/material/vaadin-lit-login-form.js +0 -5
  24. package/theme/material/vaadin-lit-login-overlay.d.ts +0 -3
  25. package/theme/material/vaadin-lit-login-overlay.js +0 -3
  26. package/theme/material/vaadin-login-form-wrapper-styles.d.ts +0 -1
  27. package/theme/material/vaadin-login-form-wrapper-styles.js +0 -109
  28. package/theme/material/vaadin-login-form.d.ts +0 -5
  29. package/theme/material/vaadin-login-form.js +0 -5
  30. package/theme/material/vaadin-login-overlay-styles.d.ts +0 -1
  31. package/theme/material/vaadin-login-overlay-styles.js +0 -352
  32. package/theme/material/vaadin-login-overlay.d.ts +0 -6
  33. package/theme/material/vaadin-login-overlay.js +0 -6
  34. package/vaadin-lit-login-form.d.ts +0 -1
  35. package/vaadin-lit-login-form.js +0 -3
  36. package/vaadin-lit-login-overlay.d.ts +0 -1
  37. package/vaadin-lit-login-overlay.js +0 -3
@@ -1,112 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import '@vaadin/button/src/vaadin-lit-button.js';
7
- import '@vaadin/text-field/src/vaadin-lit-text-field.js';
8
- import '@vaadin/password-field/src/vaadin-lit-password-field.js';
9
- import './vaadin-lit-login-form-wrapper.js';
10
- import { html, LitElement } from 'lit';
11
- import { ifDefined } from 'lit/directives/if-defined.js';
12
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
13
- import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
14
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
15
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
16
- import { LoginFormMixin } from './vaadin-login-form-mixin.js';
17
-
18
- /**
19
- * LitElement based version of `<vaadin-login-form>` web component.
20
- *
21
- * ## Disclaimer
22
- *
23
- * This component is an experiment and not yet a part of Vaadin platform.
24
- * There is no ETA regarding specific Vaadin version where it'll land.
25
- * Feel free to try this code in your apps as per Apache 2.0 license.
26
- */
27
- class LoginForm extends LoginFormMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
28
- static get is() {
29
- return 'vaadin-login-form';
30
- }
31
-
32
- /**
33
- * @protected
34
- * @override
35
- */
36
- createRenderRoot() {
37
- return this;
38
- }
39
-
40
- /** @protected */
41
- render() {
42
- return html`
43
- <style>
44
- vaadin-login-form-wrapper > form > * {
45
- width: 100%;
46
- }
47
- </style>
48
- <vaadin-login-form-wrapper
49
- id="vaadinLoginFormWrapper"
50
- theme="${ifDefined(this._theme)}"
51
- .error="${this.error}"
52
- .i18n="${this.__effectiveI18n}"
53
- .headingLevel="${this.headingLevel}"
54
- >
55
- <form method="POST" action="${ifDefined(this.action)}" @formdata="${this._onFormData}" slot="form">
56
- <input id="csrf" type="hidden" />
57
- <vaadin-text-field
58
- name="username"
59
- .label="${this.__effectiveI18n.form.username}"
60
- .errorMessage="${this.__effectiveI18n.errorMessage.username}"
61
- id="vaadinLoginUsername"
62
- required
63
- @keydown="${this._handleInputKeydown}"
64
- autocapitalize="none"
65
- autocorrect="off"
66
- spellcheck="false"
67
- autocomplete="username"
68
- manual-validation
69
- >
70
- <input type="text" slot="input" @keyup="${this._handleInputKeyup}" />
71
- </vaadin-text-field>
72
-
73
- <vaadin-password-field
74
- name="password"
75
- .label="${this.__effectiveI18n.form.password}"
76
- .errorMessage="${this.__effectiveI18n.errorMessage.password}"
77
- id="vaadinLoginPassword"
78
- required
79
- @keydown="${this._handleInputKeydown}"
80
- spellcheck="false"
81
- autocomplete="current-password"
82
- manual-validation
83
- >
84
- <input type="password" slot="input" @keyup="${this._handleInputKeyup}" />
85
- </vaadin-password-field>
86
- </form>
87
-
88
- <vaadin-button
89
- slot="submit"
90
- theme="primary contained submit"
91
- @click="${this.submit}"
92
- .disabled="${this.disabled}"
93
- >
94
- ${this.__effectiveI18n.form.submit}
95
- </vaadin-button>
96
-
97
- <vaadin-button
98
- slot="forgot-password"
99
- theme="tertiary small"
100
- @click="${this._onForgotPasswordClick}"
101
- ?hidden="${this.noForgotPassword}"
102
- >
103
- ${this.__effectiveI18n.form.forgotPassword}
104
- </vaadin-button>
105
- </vaadin-login-form-wrapper>
106
- `;
107
- }
108
- }
109
-
110
- defineCustomElement(LoginForm);
111
-
112
- export { LoginForm };
@@ -1,52 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import { html, LitElement } from 'lit';
7
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
8
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
9
- import { overlayStyles } from '@vaadin/overlay/src/vaadin-overlay-styles.js';
10
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
11
- import { LoginOverlayWrapperMixin } from './vaadin-login-overlay-wrapper-mixin.js';
12
- import { loginOverlayWrapperStyles } from './vaadin-login-overlay-wrapper-styles.js';
13
-
14
- /**
15
- * An element used internally by `<vaadin-login-overlay>`. Not intended to be used separately.
16
- *
17
- * @extends HTMLElement
18
- * @private
19
- */
20
- class LoginOverlayWrapper extends LoginOverlayWrapperMixin(ThemableMixin(PolylitMixin(LitElement))) {
21
- static get is() {
22
- return 'vaadin-login-overlay-wrapper';
23
- }
24
-
25
- static get styles() {
26
- return [overlayStyles, loginOverlayWrapperStyles];
27
- }
28
-
29
- /** @protected */
30
- render() {
31
- return html`
32
- <div id="backdrop" part="backdrop" ?hidden="${!this.withBackdrop}"></div>
33
- <div part="overlay" id="overlay" tabindex="0">
34
- <div part="content" id="content">
35
- <section part="card">
36
- <div part="brand">
37
- <slot name="title">
38
- <div part="title" role="heading" aria-level="${this.headingLevel}">${this.title}</div>
39
- </slot>
40
- <p part="description">${this.description}</p>
41
- </div>
42
- <div part="form">
43
- <slot></slot>
44
- </div>
45
- </section>
46
- </div>
47
- </div>
48
- `;
49
- }
50
- }
51
-
52
- defineCustomElement(LoginOverlayWrapper);
@@ -1,6 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- export * from './vaadin-login-overlay.js';
@@ -1,83 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
- * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
- */
6
- import './vaadin-lit-login-form.js';
7
- import './vaadin-lit-login-overlay-wrapper.js';
8
- import { html, LitElement } from 'lit';
9
- import { ifDefined } from 'lit/directives/if-defined.js';
10
- import { defineCustomElement } from '@vaadin/component-base/src/define.js';
11
- import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
12
- import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
13
- import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
14
- import { LoginOverlayMixin } from './vaadin-login-overlay-mixin.js';
15
-
16
- /**
17
- * LitElement based version of `<vaadin-login-overlay>` web component.
18
- *
19
- * ## Disclaimer
20
- *
21
- * This component is an experiment and not yet a part of Vaadin platform.
22
- * There is no ETA regarding specific Vaadin version where it'll land.
23
- * Feel free to try this code in your apps as per Apache 2.0 license.
24
- */
25
- class LoginOverlay extends LoginOverlayMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement)))) {
26
- static get is() {
27
- return 'vaadin-login-overlay';
28
- }
29
-
30
- /** @protected */
31
- render() {
32
- return html`
33
- <vaadin-login-overlay-wrapper
34
- id="vaadinLoginOverlayWrapper"
35
- .opened="${this.opened}"
36
- .title="${this.title}"
37
- .description="${this.description}"
38
- .headingLevel="${this.headingLevel}"
39
- role="dialog"
40
- focus-trap
41
- with-backdrop
42
- theme="${ifDefined(this._theme)}"
43
- @vaadin-overlay-escape-press="${this._preventClosingLogin}"
44
- @vaadin-overlay-outside-click="${this._preventClosingLogin}"
45
- @opened-changed="${this._onOpenedChanged}"
46
- >
47
- <vaadin-login-form
48
- theme="with-overlay"
49
- id="vaadinLoginForm"
50
- .action="${this.action}"
51
- .disabled="${this.disabled}"
52
- .error="${this.error}"
53
- .noAutofocus="${this.noAutofocus}"
54
- .noForgotPassword="${this.noForgotPassword}"
55
- .headingLevel="${this.__computeHeadingLevel(this.headingLevel)}"
56
- .i18n="${this.__effectiveI18n}"
57
- @login="${this._retargetEvent}"
58
- @forgot-password="${this._retargetEvent}"
59
- @disabled-changed="${this._onDisabledChanged}"
60
- ></vaadin-login-form>
61
- </vaadin-login-overlay-wrapper>
62
-
63
- <div hidden>
64
- <slot name="custom-form-area"></slot>
65
- <slot name="footer"></slot>
66
- </div>
67
- `;
68
- }
69
-
70
- /** @private */
71
- _onOpenedChanged(event) {
72
- this.opened = event.detail.value;
73
- }
74
-
75
- /** @private */
76
- _onDisabledChanged(event) {
77
- this.disabled = event.detail.value;
78
- }
79
- }
80
-
81
- defineCustomElement(LoginOverlay);
82
-
83
- export { LoginOverlay };
@@ -1,5 +0,0 @@
1
- import '@vaadin/button/theme/lumo/vaadin-button-styles.js';
2
- import '@vaadin/text-field/theme/lumo/vaadin-text-field-styles.js';
3
- import '@vaadin/password-field/theme/lumo/vaadin-password-field-styles.js';
4
- import './vaadin-login-form-wrapper-styles.js';
5
- import '../../src/vaadin-lit-login-form.js';
@@ -1,5 +0,0 @@
1
- import '@vaadin/button/theme/lumo/vaadin-button-styles.js';
2
- import '@vaadin/text-field/theme/lumo/vaadin-text-field-styles.js';
3
- import '@vaadin/password-field/theme/lumo/vaadin-password-field-styles.js';
4
- import './vaadin-login-form-wrapper-styles.js';
5
- import '../../src/vaadin-lit-login-form.js';
@@ -1,3 +0,0 @@
1
- import './vaadin-login-overlay-styles.js';
2
- import './vaadin-lit-login-form.js';
3
- import '../../src/vaadin-lit-login-overlay.js';
@@ -1,3 +0,0 @@
1
- import './vaadin-login-overlay-styles.js';
2
- import './vaadin-lit-login-form.js';
3
- import '../../src/vaadin-lit-login-overlay.js';
@@ -1,5 +0,0 @@
1
- import '@vaadin/button/theme/material/vaadin-button-styles.js';
2
- import '@vaadin/text-field/theme/material/vaadin-text-field-styles.js';
3
- import '@vaadin/password-field/theme/material/vaadin-password-field-styles.js';
4
- import './vaadin-login-form-wrapper-styles.js';
5
- import '../../src/vaadin-lit-login-form.js';
@@ -1,5 +0,0 @@
1
- import '@vaadin/button/theme/material/vaadin-button-styles.js';
2
- import '@vaadin/text-field/theme/material/vaadin-text-field-styles.js';
3
- import '@vaadin/password-field/theme/material/vaadin-password-field-styles.js';
4
- import './vaadin-login-form-wrapper-styles.js';
5
- import '../../src/vaadin-lit-login-form.js';
@@ -1,3 +0,0 @@
1
- import './vaadin-login-overlay-styles.js';
2
- import './vaadin-lit-login-form.js';
3
- import '../../src/vaadin-lit-login-overlay.js';
@@ -1,3 +0,0 @@
1
- import './vaadin-login-overlay-styles.js';
2
- import './vaadin-lit-login-form.js';
3
- import '../../src/vaadin-lit-login-overlay.js';
@@ -1 +0,0 @@
1
- import '@vaadin/vaadin-material-styles/color.js';
@@ -1,109 +0,0 @@
1
- import '@vaadin/vaadin-material-styles/color.js';
2
- import { typography } from '@vaadin/vaadin-material-styles/typography.js';
3
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
4
-
5
- const loginFormWrapper = css`
6
- :host {
7
- background: var(--material-background-color) linear-gradient(hsla(0, 0%, 100%, 0.3), hsla(0, 0%, 100%, 0.3));
8
- }
9
-
10
- [part='form'] {
11
- padding: 1.5rem;
12
- flex: 1;
13
- display: flex;
14
- flex-direction: column;
15
- box-sizing: border-box;
16
- justify-content: center;
17
- }
18
-
19
- [part='form-title'] {
20
- margin-top: calc(var(--material-h3-font-size) - var(--material-h4-font-size));
21
- font-size: var(--material-h5-font-size);
22
- font-weight: 300;
23
- line-height: 1.1;
24
- letter-spacing: -0.01em;
25
- text-indent: -0.07em;
26
- }
27
-
28
- ::slotted([slot='submit']) {
29
- margin-top: 3em;
30
- margin-bottom: 2em;
31
- flex-grow: 0;
32
- }
33
-
34
- @media only screen and (max-width: 1023px) {
35
- ::slotted([slot='submit']) {
36
- margin-top: 2.5em;
37
- margin-bottom: 1em;
38
- }
39
- }
40
-
41
- ::slotted([slot='forgot-password']) {
42
- margin: 0.5rem auto;
43
- padding-bottom: 12px;
44
- padding-top: 12px;
45
- text-transform: none;
46
- }
47
-
48
- [part='error-message'] {
49
- background-color: hsla(3, 100%, 60%, 0.1);
50
- padding: 1rem;
51
- border-radius: 0.25em;
52
- margin-top: 1rem;
53
- margin-bottom: 0.5rem;
54
- color: var(--material-error-text-color);
55
- }
56
-
57
- :host(:not([dir='rtl'])) [part='error-message'] {
58
- padding-left: 2.25rem;
59
- }
60
-
61
- :host([dir='rtl']) [part='error-message'] {
62
- padding-right: 2.25rem;
63
- }
64
-
65
- [part='error-message']::before {
66
- content: '!';
67
- font-size: 1.3em;
68
- font-weight: 500;
69
- position: absolute;
70
- width: 2.25rem;
71
- height: 1em;
72
- line-height: 1;
73
- text-align: center;
74
- }
75
-
76
- /* Visual centering */
77
- :host(:not([dir='rtl'])) [part='error-message']::before {
78
- margin-left: calc(2.25rem * -0.95);
79
- }
80
-
81
- :host([dir='rtl']) [part='error-message']::before {
82
- margin-right: calc(2.25rem * -0.95);
83
- }
84
-
85
- [part='error-message-title'] {
86
- display: block;
87
- margin: 0 0 0.25em;
88
- color: inherit;
89
- line-height: 1.1;
90
- text-indent: -0.025em;
91
- }
92
-
93
- [part='error-message'] p {
94
- font-size: var(--material-small-font-size);
95
- line-height: 1.375;
96
- margin: 0;
97
- opacity: 0.9;
98
- }
99
-
100
- [part='footer'] {
101
- font-size: var(--material-small-font-size);
102
- line-height: 1.375;
103
- color: var(--material-secondary-text-color);
104
- }
105
- `;
106
-
107
- registerStyles('vaadin-login-form-wrapper', [typography, loginFormWrapper], {
108
- moduleId: 'material-login-form-wrapper',
109
- });
@@ -1,5 +0,0 @@
1
- import '@vaadin/button/theme/material/vaadin-button.js';
2
- import '@vaadin/text-field/theme/material/vaadin-text-field.js';
3
- import '@vaadin/password-field/theme/material/vaadin-password-field.js';
4
- import './vaadin-login-form-wrapper-styles.js';
5
- import '../../src/vaadin-login-form.js';
@@ -1,5 +0,0 @@
1
- import '@vaadin/button/theme/material/vaadin-button.js';
2
- import '@vaadin/text-field/theme/material/vaadin-text-field.js';
3
- import '@vaadin/password-field/theme/material/vaadin-password-field.js';
4
- import './vaadin-login-form-wrapper-styles.js';
5
- import '../../src/vaadin-login-form.js';
@@ -1 +0,0 @@
1
- import '@vaadin/vaadin-material-styles/color.js';