@vaadin/app-layout 25.0.0-alpha2 → 25.0.0-alpha4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/app-layout",
3
- "version": "25.0.0-alpha2",
3
+ "version": "25.0.0-alpha4",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,6 +21,8 @@
21
21
  "type": "module",
22
22
  "files": [
23
23
  "src",
24
+ "!src/styles/*-base-styles.d.ts",
25
+ "!src/styles/*-base-styles.js",
24
26
  "theme",
25
27
  "vaadin-*.d.ts",
26
28
  "vaadin-*.js",
@@ -35,16 +37,16 @@
35
37
  ],
36
38
  "dependencies": {
37
39
  "@open-wc/dedupe-mixin": "^1.3.0",
38
- "@vaadin/a11y-base": "25.0.0-alpha2",
39
- "@vaadin/button": "25.0.0-alpha2",
40
- "@vaadin/component-base": "25.0.0-alpha2",
41
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha2",
42
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha2",
40
+ "@vaadin/a11y-base": "25.0.0-alpha4",
41
+ "@vaadin/button": "25.0.0-alpha4",
42
+ "@vaadin/component-base": "25.0.0-alpha4",
43
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha4",
44
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha4",
43
45
  "lit": "^3.0.0"
44
46
  },
45
47
  "devDependencies": {
46
- "@vaadin/chai-plugins": "25.0.0-alpha2",
47
- "@vaadin/test-runner-commands": "25.0.0-alpha2",
48
+ "@vaadin/chai-plugins": "25.0.0-alpha4",
49
+ "@vaadin/test-runner-commands": "25.0.0-alpha4",
48
50
  "@vaadin/testing-helpers": "^2.0.0",
49
51
  "sinon": "^18.0.0"
50
52
  },
@@ -52,5 +54,5 @@
52
54
  "web-types.json",
53
55
  "web-types.lit.json"
54
56
  ],
55
- "gitHead": "67ffcd5355cf21ce1b5039c598525109fc4c164b"
57
+ "gitHead": "ce4421f0daf26027b863b91787a474e4cc264344"
56
58
  }
@@ -1,3 +1,9 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2000 - 2025 Vaadin Ltd.
4
+ * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
+ */
6
+
1
7
  const template = document.createElement('template');
2
8
 
3
9
  template.innerHTML = `
@@ -0,0 +1,193 @@
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/component-base/src/style-props.js';
7
+ import { css } from 'lit';
8
+
9
+ export const appLayoutStyles = css`
10
+ @layer base {
11
+ :host {
12
+ display: block;
13
+ box-sizing: border-box;
14
+ height: 100%;
15
+ --vaadin-app-layout-transition-duration: 0s;
16
+ transition: padding var(--vaadin-app-layout-transition-duration);
17
+ --_vaadin-app-layout-drawer-width: var(--vaadin-app-layout-drawer-width, auto);
18
+ --vaadin-app-layout-touch-optimized: false;
19
+ --vaadin-app-layout-navbar-offset-top: var(--_vaadin-app-layout-navbar-offset-size);
20
+ --vaadin-app-layout-navbar-offset-bottom: var(--_vaadin-app-layout-navbar-offset-size-bottom);
21
+ padding-block: var(--vaadin-app-layout-navbar-offset-top) var(--vaadin-app-layout-navbar-offset-bottom);
22
+ padding-inline-start: var(--vaadin-app-layout-navbar-offset-left);
23
+ }
24
+
25
+ :host([hidden]),
26
+ [hidden] {
27
+ display: none !important;
28
+ }
29
+
30
+ @media (prefers-reduced-motion: no-preference) {
31
+ :host(:not([no-anim])) {
32
+ --vaadin-app-layout-transition-duration: 200ms;
33
+ }
34
+ }
35
+
36
+ :host([drawer-opened]) {
37
+ --vaadin-app-layout-drawer-offset-left: var(--_vaadin-app-layout-drawer-offset-size);
38
+ }
39
+
40
+ :host([overlay]) {
41
+ --vaadin-app-layout-drawer-offset-left: 0;
42
+ --vaadin-app-layout-navbar-offset-left: 0;
43
+ }
44
+
45
+ :host(:not([no-scroll])) [content] {
46
+ overflow: auto;
47
+ }
48
+
49
+ [content] {
50
+ height: 100%;
51
+ }
52
+
53
+ @media (pointer: coarse) and (max-width: 800px) and (min-height: 500px) {
54
+ :host {
55
+ --vaadin-app-layout-touch-optimized: true;
56
+ }
57
+ }
58
+
59
+ [part='navbar'] {
60
+ position: fixed;
61
+ display: flex;
62
+ align-items: center;
63
+ top: 0;
64
+ inset-inline: 0;
65
+ transition: inset-inline-start var(--vaadin-app-layout-transition-duration);
66
+ padding-top: max(var(--vaadin-app-layout-navbar-padding-top, var(--_vaadin-padding)), var(--safe-area-inset-top));
67
+ padding-bottom: var(--vaadin-app-layout-navbar-padding-bottom, var(--_vaadin-padding));
68
+ padding-inline-start: max(
69
+ var(--vaadin-app-layout-navbar-padding-inline-start, var(--_vaadin-padding)),
70
+ var(--safe-area-inset-left)
71
+ );
72
+ /* stylelint-disable-next-line declaration-block-no-redundant-longhand-properties */
73
+ padding-inline-end: max(
74
+ var(--vaadin-app-layout-navbar-padding-inline-end, var(--_vaadin-padding)),
75
+ var(--safe-area-inset-right)
76
+ );
77
+ z-index: 1;
78
+ gap: var(--vaadin-app-layout-navbar-gap, var(--_vaadin-gap-container-inline));
79
+ background: var(--vaadin-app-layout-navbar-background, var(--_vaadin-background-container));
80
+ }
81
+
82
+ :host([primary-section='drawer'][drawer-opened]:not([overlay])) [part='navbar'] {
83
+ inset-inline-start: var(--vaadin-app-layout-drawer-offset-left, 0);
84
+ }
85
+
86
+ :host([primary-section='drawer']) [part='drawer'] {
87
+ top: 0;
88
+ }
89
+
90
+ [part='navbar'][bottom] {
91
+ top: auto;
92
+ bottom: 0;
93
+ padding-top: var(--vaadin-app-layout-navbar-padding-top, var(--_vaadin-padding));
94
+ padding-bottom: max(
95
+ var(--vaadin-app-layout-navbar-padding-bottom, var(--_vaadin-padding)),
96
+ var(--safe-area-inset-bottom)
97
+ );
98
+ }
99
+
100
+ [part='drawer'] {
101
+ overflow: auto;
102
+ overscroll-behavior: contain;
103
+ position: fixed;
104
+ top: var(--vaadin-app-layout-navbar-offset-top, 0);
105
+ bottom: var(--vaadin-app-layout-navbar-offset-bottom, var(--vaadin-viewport-offset-bottom, 0));
106
+ inset-inline: var(--vaadin-app-layout-navbar-offset-left, 0) auto;
107
+ transition:
108
+ transform var(--vaadin-app-layout-transition-duration),
109
+ visibility var(--vaadin-app-layout-transition-duration);
110
+ transform: translateX(-100%);
111
+ max-width: 90%;
112
+ width: var(--_vaadin-app-layout-drawer-width);
113
+ box-sizing: border-box;
114
+ padding: var(--safe-area-inset-top) 0 var(--safe-area-inset-bottom) var(--safe-area-inset-left);
115
+ outline: none;
116
+ /* The drawer should be inaccessible by the tabbing navigation when it is closed. */
117
+ visibility: hidden;
118
+ display: flex;
119
+ flex-direction: column;
120
+ background: var(--vaadin-app-layout-drawer-background, var(--_vaadin-background));
121
+ }
122
+
123
+ :host([drawer-opened]) [part='drawer'] {
124
+ /* The drawer should be accessible by the tabbing navigation when it is opened. */
125
+ visibility: visible;
126
+ transform: translateX(0%);
127
+ touch-action: manipulation;
128
+ }
129
+
130
+ [part='backdrop'] {
131
+ background: var(--vaadin-overlay-backdrop-background, rgba(0, 0, 0, 0.5));
132
+ }
133
+
134
+ :host(:not([drawer-opened])) [part='backdrop'] {
135
+ opacity: 0 !important;
136
+ }
137
+
138
+ :host([overlay]) [part='backdrop'] {
139
+ position: fixed;
140
+ inset: 0;
141
+ pointer-events: none;
142
+ transition: opacity var(--vaadin-app-layout-transition-duration);
143
+ -webkit-tap-highlight-color: transparent;
144
+ }
145
+
146
+ :host([overlay]) [part='drawer'] {
147
+ top: 0;
148
+ bottom: 0;
149
+ box-shadow: var(--vaadin-overlay-box-shadow, 0 8px 24px -4px hsl(0 0 0 / 0.3));
150
+ }
151
+
152
+ :host([overlay]) [part='drawer'],
153
+ :host([overlay]) [part='backdrop'] {
154
+ z-index: 2;
155
+ }
156
+
157
+ :host([drawer-opened][overlay]) [part='backdrop'] {
158
+ pointer-events: auto;
159
+ touch-action: manipulation;
160
+ }
161
+
162
+ :host([dir='rtl']) [part='drawer'] {
163
+ transform: translateX(100%);
164
+ }
165
+
166
+ :host([dir='rtl'][drawer-opened]) [part='drawer'] {
167
+ transform: translateX(0%);
168
+ }
169
+
170
+ :host([drawer-opened]:not([overlay])) {
171
+ padding-inline-start: var(--vaadin-app-layout-drawer-offset-left);
172
+ }
173
+
174
+ @media (max-width: 800px), (max-height: 600px) {
175
+ :host {
176
+ --vaadin-app-layout-drawer-overlay: true;
177
+ --_vaadin-app-layout-drawer-width: var(--vaadin-app-layout-drawer-width, 20em);
178
+ }
179
+ }
180
+
181
+ /* If a vaadin-scroller is used in the drawer, allow it to take all remaining space and contain scrolling */
182
+ [part='drawer'] ::slotted(vaadin-scroller) {
183
+ flex: 1;
184
+ overscroll-behavior: contain;
185
+ }
186
+
187
+ @media (forced-colors: active) {
188
+ :host([overlay]) [part='drawer'] {
189
+ border: 3px solid;
190
+ }
191
+ }
192
+ }
193
+ `;
@@ -0,0 +1,8 @@
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 type { CSSResult } from 'lit';
7
+
8
+ export const appLayoutStyles: CSSResult;
@@ -3,15 +3,15 @@
3
3
  * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
6
+ import { css } from 'lit';
7
7
 
8
8
  export const appLayoutStyles = css`
9
9
  :host {
10
10
  display: block;
11
11
  box-sizing: border-box;
12
12
  height: 100%;
13
- --vaadin-app-layout-transition: 200ms;
14
- transition: padding var(--vaadin-app-layout-transition);
13
+ --vaadin-app-layout-transition-duration: 200ms;
14
+ transition: padding var(--vaadin-app-layout-transition-duration);
15
15
  --_vaadin-app-layout-drawer-width: var(--vaadin-app-layout-drawer-width, 16em);
16
16
  --vaadin-app-layout-touch-optimized: false;
17
17
  --vaadin-app-layout-navbar-offset-top: var(--_vaadin-app-layout-navbar-offset-size);
@@ -26,7 +26,7 @@ export const appLayoutStyles = css`
26
26
  }
27
27
 
28
28
  :host([no-anim]) {
29
- --vaadin-app-layout-transition: none !important;
29
+ --vaadin-app-layout-transition-duration: 0s !important;
30
30
  }
31
31
 
32
32
  :host([drawer-opened]) {
@@ -58,7 +58,7 @@ export const appLayoutStyles = css`
58
58
  align-items: center;
59
59
  top: 0;
60
60
  inset-inline: 0;
61
- transition: inset-inline-start var(--vaadin-app-layout-transition);
61
+ transition: inset-inline-start var(--vaadin-app-layout-transition-duration);
62
62
  padding-top: var(--safe-area-inset-top);
63
63
  padding-left: var(--safe-area-inset-left);
64
64
  padding-right: var(--safe-area-inset-right);
@@ -86,8 +86,8 @@ export const appLayoutStyles = css`
86
86
  bottom: var(--vaadin-app-layout-navbar-offset-bottom, var(--vaadin-viewport-offset-bottom, 0));
87
87
  inset-inline: var(--vaadin-app-layout-navbar-offset-left, 0) auto;
88
88
  transition:
89
- transform var(--vaadin-app-layout-transition),
90
- visibility var(--vaadin-app-layout-transition);
89
+ transform var(--vaadin-app-layout-transition-duration),
90
+ visibility var(--vaadin-app-layout-transition-duration);
91
91
  transform: translateX(-100%);
92
92
  max-width: 90%;
93
93
  width: var(--_vaadin-app-layout-drawer-width);
@@ -120,7 +120,7 @@ export const appLayoutStyles = css`
120
120
  position: fixed;
121
121
  inset: 0;
122
122
  pointer-events: none;
123
- transition: opacity var(--vaadin-app-layout-transition);
123
+ transition: opacity var(--vaadin-app-layout-transition-duration);
124
124
  -webkit-tap-highlight-color: transparent;
125
125
  }
126
126
 
@@ -0,0 +1,29 @@
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/component-base/src/style-props.js';
7
+ import { css } from 'lit';
8
+
9
+ export const drawerToggle = css`
10
+ @layer base {
11
+ [part='icon'] {
12
+ background: currentColor;
13
+ display: block;
14
+ height: var(--vaadin-icon-size, 1lh);
15
+ mask-image: var(--_vaadin-icon-menu);
16
+ width: var(--vaadin-icon-size, 1lh);
17
+ }
18
+
19
+ [hidden] {
20
+ display: none !important;
21
+ }
22
+
23
+ @media (forced-colors: active) {
24
+ [part='icon'] {
25
+ background: CanvasText;
26
+ }
27
+ }
28
+ }
29
+ `;
@@ -0,0 +1,8 @@
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 type { CSSResult } from 'lit';
7
+
8
+ export const drawerToggle: CSSResult;
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2018 - 2025 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { css } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
6
+ import { css } from 'lit';
7
7
 
8
8
  export const drawerToggle = css`
9
9
  :host {
@@ -363,8 +363,8 @@ export const AppLayoutMixin = (superclass) =>
363
363
  /**
364
364
  * Returns a promise that resolves when the drawer opening/closing CSS transition ends.
365
365
  *
366
- * The method relies on the `--vaadin-app-layout-transition` CSS variable to detect whether
367
- * the drawer has a CSS transition that needs to be awaited. If the CSS variable equals `none`,
366
+ * The method relies on the `--vaadin-app-layout-transition-duration` CSS variable to detect whether
367
+ * the drawer has a CSS transition that needs to be awaited. If the CSS variable equals `0s`,
368
368
  * the promise resolves immediately.
369
369
  *
370
370
  * @return {Promise}
@@ -372,7 +372,7 @@ export const AppLayoutMixin = (superclass) =>
372
372
  */
373
373
  __drawerTransitionComplete() {
374
374
  return new Promise((resolve) => {
375
- if (this._getCustomPropertyValue('--vaadin-app-layout-transition') === 'none') {
375
+ if (this._getCustomPropertyValue('--vaadin-app-layout-transition-duration') === '0s') {
376
376
  resolve();
377
377
  return;
378
378
  }
@@ -10,8 +10,8 @@ import { defineCustomElement } from '@vaadin/component-base/src/define.js';
10
10
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
11
11
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
12
12
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
13
+ import { appLayoutStyles } from './styles/vaadin-app-layout-core-styles.js';
13
14
  import { AppLayoutMixin } from './vaadin-app-layout-mixin.js';
14
- import { appLayoutStyles } from './vaadin-app-layout-styles.js';
15
15
 
16
16
  /**
17
17
  * `<vaadin-app-layout>` is a Web Component providing a quick and easy way to get a common application layout structure done.
@@ -4,14 +4,14 @@
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
6
  import { html, LitElement } from 'lit';
7
- import { buttonStyles } from '@vaadin/button/src/vaadin-button-core-styles.js';
7
+ import { buttonStyles } from '@vaadin/button/src/styles/vaadin-button-core-styles.js';
8
8
  import { ButtonMixin } from '@vaadin/button/src/vaadin-button-mixin.js';
9
9
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
10
10
  import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
11
11
  import { isEmptyTextNode } from '@vaadin/component-base/src/dom-utils.js';
12
12
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
13
13
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
14
- import { drawerToggle } from './vaadin-drawer-toggle-styles.js';
14
+ import { drawerToggle } from './styles/vaadin-drawer-toggle-core-styles.js';
15
15
 
16
16
  /**
17
17
  * The Drawer Toggle component controls the drawer in App Layout component.
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/app-layout",
4
- "version": "25.0.0-alpha2",
4
+ "version": "25.0.0-alpha4",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/app-layout",
4
- "version": "25.0.0-alpha2",
4
+ "version": "25.0.0-alpha4",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {