@vaadin/login 25.0.0-alpha1 → 25.0.0-alpha11

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 (31) hide show
  1. package/package.json +14 -14
  2. package/src/styles/vaadin-login-form-wrapper-base-styles.js +65 -0
  3. package/src/styles/vaadin-login-overlay-wrapper-base-styles.js +55 -0
  4. package/src/title-controller.d.ts +11 -0
  5. package/src/title-controller.js +100 -0
  6. package/src/vaadin-login-form-mixin.js +93 -17
  7. package/src/vaadin-login-form-wrapper.js +16 -24
  8. package/src/vaadin-login-form.d.ts +2 -5
  9. package/src/vaadin-login-form.js +27 -69
  10. package/src/vaadin-login-overlay-mixin.d.ts +1 -2
  11. package/src/vaadin-login-overlay-mixin.js +58 -85
  12. package/src/vaadin-login-overlay-wrapper.js +30 -11
  13. package/src/vaadin-login-overlay.d.ts +29 -19
  14. package/src/vaadin-login-overlay.js +61 -45
  15. package/vaadin-login-form.js +1 -1
  16. package/vaadin-login-overlay.js +1 -1
  17. package/web-types.json +7 -3
  18. package/web-types.lit.json +10 -3
  19. package/src/vaadin-login-form-wrapper-styles.js +0 -32
  20. package/src/vaadin-login-overlay-wrapper-mixin.js +0 -78
  21. package/src/vaadin-login-overlay-wrapper-styles.js +0 -35
  22. package/theme/lumo/vaadin-login-form-wrapper-styles.d.ts +0 -1
  23. package/theme/lumo/vaadin-login-form-wrapper-styles.js +0 -94
  24. package/theme/lumo/vaadin-login-form.d.ts +0 -5
  25. package/theme/lumo/vaadin-login-form.js +0 -5
  26. package/theme/lumo/vaadin-login-overlay-styles.d.ts +0 -2
  27. package/theme/lumo/vaadin-login-overlay-styles.js +0 -188
  28. package/theme/lumo/vaadin-login-overlay.d.ts +0 -3
  29. package/theme/lumo/vaadin-login-overlay.js +0 -3
  30. /package/src/{vaadin-login-form-wrapper-styles.d.ts → styles/vaadin-login-form-wrapper-base-styles.d.ts} +0 -0
  31. /package/src/{vaadin-login-overlay-wrapper-styles.d.ts → styles/vaadin-login-overlay-wrapper-base-styles.d.ts} +0 -0
@@ -1,32 +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 { css } from 'lit';
7
-
8
- export const loginFormWrapperStyles = css`
9
- :host {
10
- overflow: hidden;
11
- display: inline-block;
12
- }
13
-
14
- :host([hidden]) {
15
- display: none !important;
16
- }
17
-
18
- [part='form'] {
19
- flex: 1;
20
- display: flex;
21
- flex-direction: column;
22
- box-sizing: border-box;
23
- }
24
-
25
- [part='form-title'] {
26
- margin: 0;
27
- }
28
-
29
- [part='error-message'] {
30
- position: relative;
31
- }
32
- `;
@@ -1,78 +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 { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
7
- import { SlotObserver } from '@vaadin/component-base/src/slot-observer.js';
8
- import { generateUniqueId } from '@vaadin/component-base/src/unique-id-utils.js';
9
- import { OverlayMixin } from '@vaadin/overlay/src/vaadin-overlay-mixin.js';
10
-
11
- /**
12
- * @polymerMixin
13
- * @mixes DirMixin
14
- * @mixes OverlayMixin
15
- */
16
- export const LoginOverlayWrapperMixin = (superClass) =>
17
- class LoginOverlayWrapperMixin extends OverlayMixin(DirMixin(superClass)) {
18
- static get properties() {
19
- return {
20
- /**
21
- * Title of the application.
22
- */
23
- title: {
24
- type: String,
25
- observer: '_titleChanged',
26
- },
27
-
28
- /**
29
- * Application description. Displayed under the title.
30
- */
31
- description: {
32
- type: String,
33
- },
34
-
35
- /**
36
- * Used to customize the `aria-level` attribute on the heading element.
37
- */
38
- headingLevel: {
39
- type: Number,
40
- },
41
- };
42
- }
43
-
44
- /** @protected */
45
- ready() {
46
- super.ready();
47
-
48
- // Use slot observer instead of slot controller since the latter
49
- // does not work well with teleporting (it removes custom title).
50
- const slot = this.shadowRoot.querySelector('slot[name="title"]');
51
- this._titleSlotObserver = new SlotObserver(slot, () => {
52
- const title = slot.assignedElements({ flatten: true })[0];
53
- if (!title) {
54
- return;
55
- }
56
-
57
- // Only set ID on the custom slotted title and link it using
58
- // aria-labelledby as the default title is in the shadow DOM.
59
- if (title.getAttribute('part') === 'title') {
60
- this.setAttribute('aria-label', this.title);
61
- this.removeAttribute('aria-labelledby');
62
- } else {
63
- if (!title.id) {
64
- title.id = `login-overlay-title-${generateUniqueId()}`;
65
- }
66
- this.removeAttribute('aria-label');
67
- this.setAttribute('aria-labelledby', title.id);
68
- }
69
- });
70
- }
71
-
72
- /** @private */
73
- _titleChanged(title) {
74
- if (title && this.hasAttribute('aria-label')) {
75
- this.setAttribute('aria-label', title);
76
- }
77
- }
78
- };
@@ -1,35 +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 { css } from 'lit';
7
-
8
- export const loginOverlayWrapperStyles = css`
9
- [part='overlay'] {
10
- outline: none;
11
- }
12
-
13
- [part='card'] {
14
- max-width: 100%;
15
- box-sizing: border-box;
16
- overflow: hidden;
17
- display: flex;
18
- flex-direction: column;
19
- }
20
-
21
- [part='brand'] {
22
- box-sizing: border-box;
23
- overflow: hidden;
24
- flex-grow: 1;
25
- flex-shrink: 0;
26
- display: flex;
27
- flex-direction: column;
28
- justify-content: flex-end;
29
- }
30
-
31
- [part='title'] {
32
- color: inherit;
33
- margin: 0;
34
- }
35
- `;
@@ -1 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/spacing.js';
@@ -1,94 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/spacing.js';
2
- import { color } from '@vaadin/vaadin-lumo-styles/color.js';
3
- import { typography } from '@vaadin/vaadin-lumo-styles/typography.js';
4
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
5
-
6
- const loginFormWrapper = css`
7
- :host {
8
- max-width: calc(var(--lumo-size-m) * 10);
9
- background: var(--lumo-base-color) linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct));
10
- }
11
-
12
- [part='form'] {
13
- padding: var(--lumo-space-l);
14
- }
15
-
16
- [part='form-title'] {
17
- margin-top: calc(var(--lumo-font-size-xxxl) - var(--lumo-font-size-xxl));
18
- color: var(--lumo-header-text-color);
19
- font-size: var(--lumo-font-size-xxl);
20
- font-weight: 600;
21
- line-height: var(--lumo-line-height-xs);
22
- }
23
-
24
- ::slotted([slot='submit']) {
25
- margin-top: var(--lumo-space-l);
26
- margin-bottom: var(--lumo-space-s);
27
- }
28
-
29
- ::slotted([slot='forgot-password']) {
30
- margin: var(--lumo-space-s) auto;
31
- }
32
-
33
- [part='error-message'] {
34
- background-color: var(--lumo-error-color-10pct);
35
- padding: var(--lumo-space-m);
36
- border-radius: var(--lumo-border-radius-m);
37
- margin-top: var(--lumo-space-m);
38
- margin-bottom: var(--lumo-space-s);
39
- color: var(--lumo-error-text-color);
40
- }
41
-
42
- :host(:not([dir='rtl'])) [part='error-message'] {
43
- padding-left: var(--lumo-size-m);
44
- }
45
-
46
- :host([dir='rtl']) [part='error-message'] {
47
- padding-right: var(--lumo-size-m);
48
- }
49
-
50
- [part='error-message']::before {
51
- content: var(--lumo-icons-error);
52
- font-family: lumo-icons;
53
- font-size: var(--lumo-icon-size-m);
54
- position: absolute;
55
- width: var(--lumo-size-m);
56
- height: 1em;
57
- line-height: 1;
58
- text-align: center;
59
- }
60
-
61
- :host(:not([dir='rtl'])) [part='error-message']::before {
62
- /* Visual centering */
63
- margin-left: calc(var(--lumo-size-m) * -0.95);
64
- }
65
-
66
- :host([dir='rtl']) [part='error-message']::before {
67
- /* Visual centering */
68
- margin-right: calc(var(--lumo-size-m) * -0.95);
69
- }
70
-
71
- [part='error-message-title'] {
72
- display: block;
73
- margin: 0 0 0.25em;
74
- color: inherit;
75
- line-height: var(--lumo-line-height-xs);
76
- }
77
-
78
- [part='error-message-description'] {
79
- font-size: var(--lumo-font-size-s);
80
- line-height: var(--lumo-line-height-s);
81
- margin: 0;
82
- opacity: 0.9;
83
- }
84
-
85
- [part='footer'] {
86
- font-size: var(--lumo-font-size-xs);
87
- line-height: var(--lumo-line-height-s);
88
- color: var(--lumo-secondary-text-color);
89
- }
90
- `;
91
-
92
- registerStyles('vaadin-login-form-wrapper', [color, typography, loginFormWrapper], {
93
- moduleId: 'lumo-login-form-wrapper',
94
- });
@@ -1,5 +0,0 @@
1
- import '@vaadin/button/theme/lumo/vaadin-button.js';
2
- import '@vaadin/text-field/theme/lumo/vaadin-text-field.js';
3
- import '@vaadin/password-field/theme/lumo/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/lumo/vaadin-button.js';
2
- import '@vaadin/text-field/theme/lumo/vaadin-text-field.js';
3
- import '@vaadin/password-field/theme/lumo/vaadin-password-field.js';
4
- import './vaadin-login-form-wrapper-styles.js';
5
- import '../../src/vaadin-login-form.js';
@@ -1,2 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/spacing.js';
2
- import './vaadin-login-form-wrapper-styles.js';
@@ -1,188 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/spacing.js';
2
- import './vaadin-login-form-wrapper-styles.js';
3
- import { color } from '@vaadin/vaadin-lumo-styles/color.js';
4
- import { overlay } from '@vaadin/vaadin-lumo-styles/mixins/overlay.js';
5
- import { typography } from '@vaadin/vaadin-lumo-styles/typography.js';
6
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
7
-
8
- const loginOverlayWrapper = css`
9
- :host {
10
- inset: 0;
11
- }
12
-
13
- [part='backdrop'] {
14
- background: var(--lumo-base-color) linear-gradient(var(--lumo-shade-5pct), var(--lumo-shade-5pct));
15
- }
16
-
17
- [part='overlay'] {
18
- background: none;
19
- border-radius: 0;
20
- box-shadow: none;
21
- width: 100%;
22
- height: 100%;
23
- }
24
-
25
- [part='brand'] {
26
- padding: var(--lumo-space-l) var(--lumo-space-xl) var(--lumo-space-l) var(--lumo-space-l);
27
- background-color: var(--lumo-primary-color);
28
- color: var(--lumo-primary-contrast-color);
29
- min-height: calc(var(--lumo-size-m) * 5);
30
- }
31
-
32
- [part='title'] {
33
- font-size: var(--lumo-font-size-xxxl);
34
- font-weight: 600;
35
- line-height: var(--lumo-line-height-xs);
36
- }
37
-
38
- [part='description'] {
39
- line-height: var(--lumo-line-height-s);
40
- color: var(--lumo-tint-70pct);
41
- margin-bottom: 0;
42
- }
43
-
44
- [part='content'] {
45
- height: 100%;
46
- display: flex;
47
- align-items: center;
48
- justify-content: center;
49
- padding: 0;
50
- }
51
-
52
- [part='card'] {
53
- width: calc(var(--lumo-size-m) * 10);
54
- background: var(--lumo-base-color) linear-gradient(var(--lumo-tint-5pct), var(--lumo-tint-5pct));
55
- border-radius: var(--lumo-border-radius-l);
56
- box-shadow: var(--lumo-box-shadow-s);
57
- margin: var(--lumo-space-s);
58
- height: auto;
59
- }
60
-
61
- /* Small screen */
62
- @media only screen and (max-width: 500px) {
63
- [part='overlay'],
64
- [part='content'] {
65
- height: 100%;
66
- }
67
-
68
- [part='content'] {
69
- min-height: 100%;
70
- background: var(--lumo-base-color);
71
- align-items: flex-start;
72
- }
73
-
74
- [part='card'],
75
- [part='overlay'] {
76
- width: 100%;
77
- border-radius: 0;
78
- box-shadow: none;
79
- margin: 0;
80
- }
81
-
82
- /* RTL styles */
83
- :host([dir='rtl']) [part='brand'] {
84
- padding: var(--lumo-space-l) var(--lumo-space-l) var(--lumo-space-l) var(--lumo-space-xl);
85
- }
86
- }
87
-
88
- /* Landscape small screen */
89
- @media only screen and (max-height: 600px) and (min-width: 600px) and (orientation: landscape) {
90
- [part='card'] {
91
- flex-direction: row;
92
- align-items: stretch;
93
- max-width: calc(var(--lumo-size-m) * 16);
94
- width: 100%;
95
- }
96
-
97
- [part='brand'],
98
- [part='form'] {
99
- flex: auto;
100
- flex-basis: 0;
101
- box-sizing: border-box;
102
- }
103
-
104
- [part='brand'] {
105
- justify-content: flex-start;
106
- }
107
-
108
- [part='form'] {
109
- padding: var(--lumo-space-l);
110
- overflow: auto;
111
- }
112
- }
113
-
114
- /* Landscape really small screen */
115
- @media only screen and (max-height: 500px) and (min-width: 600px) and (orientation: landscape),
116
- only screen and (max-width: 600px) and (min-width: 600px) and (orientation: landscape) {
117
- [part='content'] {
118
- height: 100vh;
119
- }
120
-
121
- [part='card'] {
122
- margin: 0;
123
- width: 100%;
124
- max-width: none;
125
- height: 100%;
126
- flex: auto;
127
- border-radius: 0;
128
- box-shadow: none;
129
- }
130
-
131
- [part='form'] {
132
- height: 100%;
133
- overflow: auto;
134
- -webkit-overflow-scrolling: touch;
135
- }
136
- }
137
-
138
- /* Handle iPhone X notch */
139
- @media only screen and (device-width: 375px) and (device-height: 812px) and (-webkit-device-pixel-ratio: 3) {
140
- [part='card'] {
141
- padding-right: env(safe-area-inset-right);
142
- padding-left: env(safe-area-inset-left);
143
- }
144
-
145
- [part='brand'] {
146
- margin-left: calc(env(safe-area-inset-left) * -1);
147
- padding-left: calc(var(--lumo-space-l) + env(safe-area-inset-left));
148
- }
149
-
150
- /* RTL styles */
151
- :host([dir='rtl']) [part='card'] {
152
- padding-left: env(safe-area-inset-right);
153
- padding-right: env(safe-area-inset-left);
154
- }
155
-
156
- :host([dir='rtl']) [part='brand'] {
157
- margin-right: calc(env(safe-area-inset-left) * -1);
158
- padding-right: calc(var(--lumo-space-l) + env(safe-area-inset-left));
159
- }
160
- }
161
- `;
162
-
163
- registerStyles('vaadin-login-overlay-wrapper', [color, typography, overlay, loginOverlayWrapper], {
164
- moduleId: 'lumo-login-overlay-wrapper',
165
- });
166
-
167
- const loginFormWrapper = css`
168
- :host([theme~='with-overlay']) {
169
- min-height: 100%;
170
- display: flex;
171
- justify-content: center;
172
- max-width: 100%;
173
- }
174
-
175
- /* Landscape small screen */
176
- @media only screen and (max-height: 600px) and (min-width: 600px) and (orientation: landscape) {
177
- :host([theme~='with-overlay']) [part='form'] {
178
- height: 100%;
179
- -webkit-overflow-scrolling: touch;
180
- flex: 1;
181
- padding: 2px;
182
- }
183
- }
184
- `;
185
-
186
- registerStyles('vaadin-login-form-wrapper', [loginFormWrapper], {
187
- moduleId: 'lumo-login-overlay',
188
- });
@@ -1,3 +0,0 @@
1
- import './vaadin-login-overlay-styles.js';
2
- import './vaadin-login-form.js';
3
- import '../../src/vaadin-login-overlay.js';
@@ -1,3 +0,0 @@
1
- import './vaadin-login-overlay-styles.js';
2
- import './vaadin-login-form.js';
3
- import '../../src/vaadin-login-overlay.js';