@vaadin/login 25.0.0-alpha7 → 25.0.0-alpha9

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.
@@ -28,7 +28,7 @@ const loginOverlayWrapper = css`
28
28
  min-height: calc(var(--lumo-size-m) * 5);
29
29
  }
30
30
 
31
- [part='title'] {
31
+ ::slotted([slot='title']) {
32
32
  font-size: var(--lumo-font-size-xxxl);
33
33
  font-weight: 600;
34
34
  line-height: var(--lumo-line-height-xs);
@@ -57,6 +57,11 @@ const loginOverlayWrapper = css`
57
57
  height: auto;
58
58
  }
59
59
 
60
+ ::slotted(vaadin-login-form-wrapper) {
61
+ min-height: 100%;
62
+ max-width: 100%;
63
+ }
64
+
60
65
  /* Small screen */
61
66
  @media only screen and (max-width: 500px) {
62
67
  [part='overlay'],
@@ -94,7 +99,7 @@ const loginOverlayWrapper = css`
94
99
  }
95
100
 
96
101
  [part='brand'],
97
- [part='form'] {
102
+ [part='form-wrapper'] {
98
103
  flex: auto;
99
104
  flex-basis: 0;
100
105
  box-sizing: border-box;
@@ -104,10 +109,15 @@ const loginOverlayWrapper = css`
104
109
  justify-content: flex-start;
105
110
  }
106
111
 
107
- [part='form'] {
112
+ [part='form-wrapper'] {
108
113
  padding: var(--lumo-space-l);
109
114
  overflow: auto;
110
115
  }
116
+
117
+ ::slotted(vaadin-login-form-wrapper) {
118
+ flex: 1;
119
+ padding: 2px;
120
+ }
111
121
  }
112
122
 
113
123
  /* Landscape really small screen */
@@ -127,7 +137,7 @@ const loginOverlayWrapper = css`
127
137
  box-shadow: none;
128
138
  }
129
139
 
130
- [part='form'] {
140
+ [part='form-wrapper'] {
131
141
  height: 100%;
132
142
  overflow: auto;
133
143
  }
@@ -161,25 +171,3 @@ const loginOverlayWrapper = css`
161
171
  registerStyles('vaadin-login-overlay-wrapper', [overlay, loginOverlayWrapper], {
162
172
  moduleId: 'lumo-login-overlay-wrapper',
163
173
  });
164
-
165
- const loginFormWrapper = css`
166
- :host([theme~='with-overlay']) {
167
- min-height: 100%;
168
- display: flex;
169
- justify-content: center;
170
- max-width: 100%;
171
- }
172
-
173
- /* Landscape small screen */
174
- @media only screen and (max-height: 600px) and (min-width: 600px) and (orientation: landscape) {
175
- :host([theme~='with-overlay']) [part='form'] {
176
- height: 100%;
177
- flex: 1;
178
- padding: 2px;
179
- }
180
- }
181
- `;
182
-
183
- registerStyles('vaadin-login-form-wrapper', [loginFormWrapper], {
184
- moduleId: 'lumo-login-overlay',
185
- });
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/login",
4
- "version": "25.0.0-alpha7",
4
+ "version": "25.0.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-login-form",
11
- "description": "`<vaadin-login-form>` is a Web Component providing an easy way to require users\nto log in into an application. Note that component has no shadowRoot.\n\n```\n<vaadin-login-form></vaadin-login-form>\n```\n\nComponent has to be accessible from the `document` layer in order to allow password managers to work properly with form values.\nUsing `<vaadin-login-overlay>` allows to always attach the component to the document body.\n\n### Styling\n\nThe component doesn't have a shadowRoot, so the `<form>` and input fields can be styled from a global scope.\nUse `<vaadin-login-form-wrapper>` themable component to apply styles.\n\nThe following shadow DOM parts of the `<vaadin-login-form-wrapper>` are available for styling:\n\nPart name | Description\n---------------|---------------------------------------------------------|\n`form` | Container for the entire component's content\n`form-title` | Title of the login form\n`error-message`| Container for error message, contains error-message-title and error-message-description parts. Hidden by default.\n`error-message-title` | Container for error message title\n`error-message-description` | Container for error message description\n`footer` | Container additional information text from `i18n` object\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
11
+ "description": "`<vaadin-login-form>` is a Web Component providing an easy way to require users\nto log in into an application. Note that component has no shadowRoot.\n\n```html\n<vaadin-login-form></vaadin-login-form>\n```\n\nComponent has to be accessible from the `document` layer in order to allow password managers to work properly with form values.\nUsing `<vaadin-login-overlay>` allows to always attach the component to the document body.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------|---------------------------------------------------------|\n`form` | Container for the entire component's content\n`form-title` | Title of the login form\n`error-message`| Container for error message, contains error-message-title and error-message-description parts. Hidden by default.\n`error-message-title` | Container for error message title\n`error-message-description` | Container for error message description\n`footer` | Container additional information text from `i18n` object\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "action",
@@ -170,7 +170,7 @@
170
170
  },
171
171
  {
172
172
  "name": "vaadin-login-overlay",
173
- "description": "`<vaadin-login-overlay>` is a wrapper of the `<vaadin-login-form>` which opens a login form in an overlay and\nhaving an additional `brand` part for application title and description. Using `<vaadin-login-overlay>` allows\npassword managers to work with login form.\n\n```\n<vaadin-login-overlay opened></vaadin-login-overlay>\n```\n\n### Styling\n\nThe component doesn't have a shadowRoot, so the `<form>` and input fields can be styled from a global scope.\nUse `<vaadin-login-overlay-wrapper>` and `<vaadin-login-form-wrapper>` to apply styles.\n\nThe following shadow DOM parts of the `<vaadin-login-overlay-wrapper>` are available for styling:\n\nPart name | Description\n----------------|---------------------------------------------------------|\n`card` | Container for the entire component's content\n`brand` | Container for application title and description\n`form` | Container for the `<vaadin-login-form>` component\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\nSee [`<vaadin-login-form>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha7/#/elements/vaadin-login-form)\ndocumentation for `<vaadin-login-form-wrapper>` stylable parts.",
173
+ "description": "`<vaadin-login-overlay>` is a web component which renders a login form in an overlay and\nprovides an additional `brand` part for application title and description.\n\n```html\n<vaadin-login-overlay opened></vaadin-login-overlay>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-----------------------------|--------------------------------\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container element\n`content` | The overlay content element\n`card` | Container for the brand and form wrapper\n`brand` | Container for application title and description\n`description` | The application description\n`form-wrapper` | The login form wrapper element\n`form` | The login form element\n`form-title` | Title of the login form\n`error-message` | Container for error message\n`error-message-title` | Container for error message title\n`error-message-description` | Container for error message description\n`footer` | Container for the footer element\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
174
174
  "attributes": [
175
175
  {
176
176
  "name": "action",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/login",
4
- "version": "25.0.0-alpha7",
4
+ "version": "25.0.0-alpha9",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -16,7 +16,7 @@
16
16
  "elements": [
17
17
  {
18
18
  "name": "vaadin-login-form",
19
- "description": "`<vaadin-login-form>` is a Web Component providing an easy way to require users\nto log in into an application. Note that component has no shadowRoot.\n\n```\n<vaadin-login-form></vaadin-login-form>\n```\n\nComponent has to be accessible from the `document` layer in order to allow password managers to work properly with form values.\nUsing `<vaadin-login-overlay>` allows to always attach the component to the document body.\n\n### Styling\n\nThe component doesn't have a shadowRoot, so the `<form>` and input fields can be styled from a global scope.\nUse `<vaadin-login-form-wrapper>` themable component to apply styles.\n\nThe following shadow DOM parts of the `<vaadin-login-form-wrapper>` are available for styling:\n\nPart name | Description\n---------------|---------------------------------------------------------|\n`form` | Container for the entire component's content\n`form-title` | Title of the login form\n`error-message`| Container for error message, contains error-message-title and error-message-description parts. Hidden by default.\n`error-message-title` | Container for error message title\n`error-message-description` | Container for error message description\n`footer` | Container additional information text from `i18n` object\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
19
+ "description": "`<vaadin-login-form>` is a Web Component providing an easy way to require users\nto log in into an application. Note that component has no shadowRoot.\n\n```html\n<vaadin-login-form></vaadin-login-form>\n```\n\nComponent has to be accessible from the `document` layer in order to allow password managers to work properly with form values.\nUsing `<vaadin-login-overlay>` allows to always attach the component to the document body.\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n---------------|---------------------------------------------------------|\n`form` | Container for the entire component's content\n`form-title` | Title of the login form\n`error-message`| Container for error message, contains error-message-title and error-message-description parts. Hidden by default.\n`error-message-title` | Container for error message title\n`error-message-description` | Container for error message description\n`footer` | Container additional information text from `i18n` object\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {
@@ -100,7 +100,7 @@
100
100
  },
101
101
  {
102
102
  "name": "vaadin-login-overlay",
103
- "description": "`<vaadin-login-overlay>` is a wrapper of the `<vaadin-login-form>` which opens a login form in an overlay and\nhaving an additional `brand` part for application title and description. Using `<vaadin-login-overlay>` allows\npassword managers to work with login form.\n\n```\n<vaadin-login-overlay opened></vaadin-login-overlay>\n```\n\n### Styling\n\nThe component doesn't have a shadowRoot, so the `<form>` and input fields can be styled from a global scope.\nUse `<vaadin-login-overlay-wrapper>` and `<vaadin-login-form-wrapper>` to apply styles.\n\nThe following shadow DOM parts of the `<vaadin-login-overlay-wrapper>` are available for styling:\n\nPart name | Description\n----------------|---------------------------------------------------------|\n`card` | Container for the entire component's content\n`brand` | Container for application title and description\n`form` | Container for the `<vaadin-login-form>` component\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\nSee [`<vaadin-login-form>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha7/#/elements/vaadin-login-form)\ndocumentation for `<vaadin-login-form-wrapper>` stylable parts.",
103
+ "description": "`<vaadin-login-overlay>` is a web component which renders a login form in an overlay and\nprovides an additional `brand` part for application title and description.\n\n```html\n<vaadin-login-overlay opened></vaadin-login-overlay>\n```\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-----------------------------|--------------------------------\n`backdrop` | Backdrop of the overlay\n`overlay` | The overlay container element\n`content` | The overlay content element\n`card` | Container for the brand and form wrapper\n`brand` | Container for application title and description\n`description` | The application description\n`form-wrapper` | The login form wrapper element\n`form` | The login form element\n`form-title` | Title of the login form\n`error-message` | Container for error message\n`error-message-title` | Container for error message title\n`error-message-description` | Container for error message description\n`footer` | Container for the footer element\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
104
104
  "extension": true,
105
105
  "attributes": [
106
106
  {
@@ -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
- };