@vaadin/app-layout 25.0.0-alpha9 → 25.0.0-beta1

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-alpha9",
3
+ "version": "25.0.0-beta1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,9 +21,6 @@
21
21
  "type": "module",
22
22
  "files": [
23
23
  "src",
24
- "!src/styles/*-base-styles.d.ts",
25
- "!src/styles/*-base-styles.js",
26
- "theme",
27
24
  "vaadin-*.d.ts",
28
25
  "vaadin-*.js",
29
26
  "web-types.json",
@@ -37,22 +34,22 @@
37
34
  ],
38
35
  "dependencies": {
39
36
  "@open-wc/dedupe-mixin": "^1.3.0",
40
- "@vaadin/a11y-base": "25.0.0-alpha9",
41
- "@vaadin/button": "25.0.0-alpha9",
42
- "@vaadin/component-base": "25.0.0-alpha9",
43
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha9",
44
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha9",
37
+ "@vaadin/a11y-base": "25.0.0-beta1",
38
+ "@vaadin/button": "25.0.0-beta1",
39
+ "@vaadin/component-base": "25.0.0-beta1",
40
+ "@vaadin/vaadin-themable-mixin": "25.0.0-beta1",
45
41
  "lit": "^3.0.0"
46
42
  },
47
43
  "devDependencies": {
48
- "@vaadin/chai-plugins": "25.0.0-alpha9",
49
- "@vaadin/test-runner-commands": "25.0.0-alpha9",
44
+ "@vaadin/chai-plugins": "25.0.0-beta1",
45
+ "@vaadin/test-runner-commands": "25.0.0-beta1",
50
46
  "@vaadin/testing-helpers": "^2.0.0",
51
- "sinon": "^18.0.0"
47
+ "@vaadin/vaadin-lumo-styles": "25.0.0-beta1",
48
+ "sinon": "^21.0.0"
52
49
  },
53
50
  "web-types": [
54
51
  "web-types.json",
55
52
  "web-types.lit.json"
56
53
  ],
57
- "gitHead": "bbe4720721e0955ffc87a79b412bee38b1f0eb1e"
54
+ "gitHead": "1d20cf54e582d1f2e209126d4586f8b4c01c50e0"
58
55
  }
@@ -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 '@vaadin/component-base/src/style-props.js';
6
+ import '@vaadin/component-base/src/styles/style-props.js';
7
7
  import { css } from 'lit';
8
8
 
9
9
  export const appLayoutStyles = css`
@@ -55,30 +55,30 @@ export const appLayoutStyles = css`
55
55
  }
56
56
  }
57
57
 
58
- [part='navbar'] {
58
+ [part~='navbar'] {
59
59
  position: fixed;
60
60
  display: flex;
61
61
  align-items: center;
62
62
  top: 0;
63
63
  inset-inline: 0;
64
64
  transition: inset-inline-start var(--vaadin-app-layout-transition-duration);
65
- padding-top: max(var(--vaadin-app-layout-navbar-padding-top, var(--vaadin-padding)), var(--safe-area-inset-top));
66
- padding-bottom: var(--vaadin-app-layout-navbar-padding-bottom, var(--vaadin-padding));
65
+ padding-top: max(var(--vaadin-app-layout-navbar-padding-top, var(--vaadin-padding-s)), var(--safe-area-inset-top));
66
+ padding-bottom: var(--vaadin-app-layout-navbar-padding-bottom, var(--vaadin-padding-s));
67
67
  padding-inline-start: max(
68
- var(--vaadin-app-layout-navbar-padding-inline-start, var(--vaadin-padding)),
68
+ var(--vaadin-app-layout-navbar-padding-inline-start, var(--vaadin-padding-s)),
69
69
  var(--safe-area-inset-left)
70
70
  );
71
71
  /* stylelint-disable-next-line declaration-block-no-redundant-longhand-properties */
72
72
  padding-inline-end: max(
73
- var(--vaadin-app-layout-navbar-padding-inline-end, var(--vaadin-padding)),
73
+ var(--vaadin-app-layout-navbar-padding-inline-end, var(--vaadin-padding-s)),
74
74
  var(--safe-area-inset-right)
75
75
  );
76
76
  z-index: 1;
77
- gap: var(--vaadin-app-layout-navbar-gap, var(--vaadin-gap-container-inline));
77
+ gap: var(--vaadin-app-layout-navbar-gap, var(--vaadin-gap-s));
78
78
  background: var(--vaadin-app-layout-navbar-background, var(--vaadin-background-container));
79
79
  }
80
80
 
81
- :host([primary-section='drawer'][drawer-opened]:not([overlay])) [part='navbar'] {
81
+ :host([primary-section='drawer'][drawer-opened]:not([overlay])) [part~='navbar'] {
82
82
  inset-inline-start: var(--vaadin-app-layout-drawer-offset-left, 0);
83
83
  }
84
84
 
@@ -86,12 +86,12 @@ export const appLayoutStyles = css`
86
86
  top: 0;
87
87
  }
88
88
 
89
- [part='navbar'][bottom] {
89
+ [part~='navbar-bottom'] {
90
90
  top: auto;
91
91
  bottom: 0;
92
- padding-top: var(--vaadin-app-layout-navbar-padding-top, var(--vaadin-padding));
92
+ padding-top: var(--vaadin-app-layout-navbar-padding-top, var(--vaadin-padding-s));
93
93
  padding-bottom: max(
94
- var(--vaadin-app-layout-navbar-padding-bottom, var(--vaadin-padding)),
94
+ var(--vaadin-app-layout-navbar-padding-bottom, var(--vaadin-padding-s)),
95
95
  var(--safe-area-inset-bottom)
96
96
  );
97
97
  }
@@ -116,7 +116,7 @@ export const appLayoutStyles = css`
116
116
  visibility: hidden;
117
117
  display: flex;
118
118
  flex-direction: column;
119
- background: var(--vaadin-app-layout-drawer-background, var(--vaadin-background-color));
119
+ background: var(--vaadin-app-layout-drawer-background, transparent);
120
120
  }
121
121
 
122
122
  :host([drawer-opened]) [part='drawer'] {
@@ -127,7 +127,8 @@ export const appLayoutStyles = css`
127
127
  }
128
128
 
129
129
  [part='backdrop'] {
130
- background: var(--vaadin-overlay-backdrop-background, rgba(0, 0, 0, 0.5));
130
+ background: var(--vaadin-overlay-backdrop-background, rgba(0, 0, 0, 0.2));
131
+ forced-color-adjust: none;
131
132
  }
132
133
 
133
134
  :host(:not([drawer-opened])) [part='backdrop'] {
@@ -145,7 +146,8 @@ export const appLayoutStyles = css`
145
146
  :host([overlay]) [part='drawer'] {
146
147
  top: 0;
147
148
  bottom: 0;
148
- box-shadow: var(--vaadin-overlay-box-shadow, 0 8px 24px -4px rgba(0, 0, 0, 0.3));
149
+ box-shadow: var(--vaadin-overlay-shadow, 0 8px 24px -4px rgba(0, 0, 0, 0.3));
150
+ background: var(--vaadin-app-layout-drawer-background, var(--vaadin-background-color));
149
151
  }
150
152
 
151
153
  :host([overlay]) [part='drawer'],
@@ -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 '@vaadin/component-base/src/style-props.js';
6
+ import '@vaadin/component-base/src/styles/style-props.js';
7
7
  import { css } from 'lit';
8
8
 
9
9
  export const drawerToggle = css`
@@ -11,7 +11,7 @@ export const drawerToggle = css`
11
11
  background: currentColor;
12
12
  display: block;
13
13
  height: var(--vaadin-icon-size, 1lh);
14
- mask-image: var(--_vaadin-icon-menu);
14
+ mask: var(--_vaadin-icon-menu) 50% / var(--vaadin-icon-visual-size, 100%) no-repeat;
15
15
  width: var(--vaadin-icon-size, 1lh);
16
16
  }
17
17
 
@@ -21,7 +21,7 @@ export declare class AppLayoutMixinClass {
21
21
  * just the individual properties you want to change.
22
22
  *
23
23
  * The object has the following structure and default values:
24
- * ```
24
+ * ```js
25
25
  * {
26
26
  * drawer: 'Drawer'
27
27
  * }
@@ -105,7 +105,7 @@ export const AppLayoutMixin = (superclass) =>
105
105
  * just the individual properties you want to change.
106
106
  *
107
107
  * The object has the following structure and default values:
108
- * ```
108
+ * ```js
109
109
  * {
110
110
  * drawer: 'Drawer'
111
111
  * }
@@ -208,6 +208,18 @@ export const AppLayoutMixin = (superclass) =>
208
208
  window.removeEventListener('keydown', this.__onDrawerKeyDown);
209
209
  }
210
210
 
211
+ /** @private */
212
+ __onNavbarSlotChange() {
213
+ this._updateTouchOptimizedMode();
214
+ this.toggleAttribute('has-navbar', !!this.querySelector('[slot="navbar"]'));
215
+ }
216
+
217
+ /** @private */
218
+ __onDrawerSlotChange() {
219
+ this._updateDrawerSize();
220
+ this.toggleAttribute('has-drawer', !!this.querySelector('[slot="drawer"]'));
221
+ }
222
+
211
223
  /**
212
224
  * A callback for the `primarySection` property observer.
213
225
  *
@@ -432,7 +444,6 @@ export const AppLayoutMixin = (superclass) =>
432
444
  const toggle = this.querySelector('vaadin-drawer-toggle');
433
445
  if (toggle) {
434
446
  toggle.focus();
435
- toggle.setAttribute('focus-ring', 'focus');
436
447
  }
437
448
  }
438
449
 
@@ -55,27 +55,36 @@ export type AppLayoutEventMap = AppLayoutCustomEventMap & HTMLElementEventMap;
55
55
  * For best results, the component should be added to the root level of your application (i.e., as a direct child of `<body>`).
56
56
  *
57
57
  * The page should include a viewport meta tag which contains `viewport-fit=cover`, like the following:
58
- * ```
58
+ * ```html
59
59
  * <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
60
60
  * ```
61
+ *
61
62
  * This causes the viewport to be scaled to fill the device display.
62
- * To ensure that important content is displayed, use the provided css variables.
63
- * ```
64
- * --safe-area-inset-top
65
- * --safe-area-inset-right
66
- * --safe-area-inset-bottom
67
- * --safe-area-inset-left
68
- * ```
63
+ * To ensure that important content is displayed, use the provided css variables:
64
+ *
65
+ * - `--safe-area-inset-top`
66
+ * - `--safe-area-inset-right`
67
+ * - `--safe-area-inset-bottom`
68
+ * - `--safe-area-inset-left`
69
69
  *
70
70
  * ### Styling
71
71
  *
72
- * The following Shadow DOM parts of the `<vaadin-app-layout>` are available for styling:
72
+ * The following shadow DOM parts are available for styling:
73
+ *
74
+ * Part name | Description
75
+ * -----------------|---------------------------------------------------------|
76
+ * `backdrop` | Backdrop covering the layout when drawer is open as an overlay
77
+ * `navbar` | Container for the navigation bar
78
+ * `navbar-top` | Container for the top navigation bar
79
+ * `navbar-bottom` | Container for the bottom navigation bar
80
+ * `drawer` | Container for the drawer area
81
+ *
82
+ * The following state attributes are available for styling:
73
83
  *
74
- * Part name | Description
75
- * --------------|---------------------------------------------------------|
76
- * `backdrop` | Backdrop covering the layout when drawer is open as an overlay
77
- * `navbar` | Container for the navigation bar
78
- * `drawer` | Container for the drawer area
84
+ * Attribute | Description
85
+ * ---------------|-------------
86
+ * `has-drawer` | Set when the element has light DOM content in the drawer slot.
87
+ * `has-navbar` | Set when the element has light DOM content in the navbar slot.
79
88
  *
80
89
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
81
90
  *
@@ -11,7 +11,7 @@ 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 { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
13
13
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
14
- import { appLayoutStyles } from './styles/vaadin-app-layout-core-styles.js';
14
+ import { appLayoutStyles } from './styles/vaadin-app-layout-base-styles.js';
15
15
  import { AppLayoutMixin } from './vaadin-app-layout-mixin.js';
16
16
 
17
17
  /**
@@ -35,30 +35,39 @@ import { AppLayoutMixin } from './vaadin-app-layout-mixin.js';
35
35
  * For best results, the component should be added to the root level of your application (i.e., as a direct child of `<body>`).
36
36
  *
37
37
  * The page should include a viewport meta tag which contains `viewport-fit=cover`, like the following:
38
- * ```
38
+ * ```html
39
39
  * <meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
40
40
  * ```
41
+ *
41
42
  * This causes the viewport to be scaled to fill the device display.
42
- * To ensure that important content is displayed, use the provided css variables.
43
- * ```
44
- * --safe-area-inset-top
45
- * --safe-area-inset-right
46
- * --safe-area-inset-bottom
47
- * --safe-area-inset-left
48
- * ```
43
+ * To ensure that important content is displayed, use the provided css variables:
44
+ *
45
+ * - `--safe-area-inset-top`
46
+ * - `--safe-area-inset-right`
47
+ * - `--safe-area-inset-bottom`
48
+ * - `--safe-area-inset-left`
49
49
  *
50
50
  * ### Styling
51
51
  *
52
- * The following Shadow DOM parts of the `<vaadin-app-layout>` are available for styling:
52
+ * The following shadow DOM parts are available for styling:
53
53
  *
54
- * Part name | Description
55
- * --------------|---------------------------------------------------------|
56
- * `backdrop` | Backdrop covering the layout when drawer is open as an overlay
57
- * `navbar` | Container for the navigation bar
58
- * `drawer` | Container for the drawer area
54
+ * Part name | Description
55
+ * -----------------|---------------------------------------------------------|
56
+ * `backdrop` | Backdrop covering the layout when drawer is open as an overlay
57
+ * `navbar` | Container for the navigation bar
58
+ * `navbar-top` | Container for the top navigation bar
59
+ * `navbar-bottom` | Container for the bottom navigation bar
60
+ * `drawer` | Container for the drawer area
59
61
  *
60
62
  * See [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.
61
63
  *
64
+ * The following state attributes are available for styling:
65
+ *
66
+ * Attribute | Description
67
+ * ---------------|-------------
68
+ * `has-drawer` | Set when the element has light DOM content in the drawer slot.
69
+ * `has-navbar` | Set when the element has light DOM content in the navbar slot.
70
+ *
62
71
  * ### Component's slots
63
72
  *
64
73
  * The following slots are available to be set
@@ -120,21 +129,21 @@ class AppLayout extends AppLayoutMixin(ElementMixin(ThemableMixin(PolylitMixin(L
120
129
  /** @protected */
121
130
  render() {
122
131
  return html`
123
- <div part="navbar" id="navbarTop">
124
- <slot name="navbar" @slotchange="${this._updateTouchOptimizedMode}"></slot>
132
+ <div part="navbar navbar-top" id="navbarTop">
133
+ <slot name="navbar" @slotchange="${this.__onNavbarSlotChange}"></slot>
125
134
  </div>
126
135
  <div part="backdrop" @click="${this._onBackdropClick}" @touchend="${this._onBackdropTouchend}"></div>
127
136
  <div part="drawer" id="drawer">
128
- <slot name="drawer" id="drawerSlot" @slotchange="${this._updateDrawerSize}"></slot>
137
+ <slot name="drawer" id="drawerSlot" @slotchange="${this.__onDrawerSlotChange}"></slot>
129
138
  </div>
130
139
  <div content>
131
140
  <slot></slot>
132
141
  </div>
133
- <div part="navbar" id="navbarBottom" bottom hidden>
142
+ <div part="navbar navbar-bottom" id="navbarBottom" hidden>
134
143
  <slot name="navbar-bottom"></slot>
135
144
  </div>
136
145
  <div hidden>
137
- <slot id="touchSlot" name="navbar touch-optimized" @slotchange="${this._updateTouchOptimizedMode}"></slot>
146
+ <slot id="touchSlot" name="navbar touch-optimized" @slotchange="${this.__onNavbarSlotChange}"></slot>
138
147
  </div>
139
148
  `;
140
149
  }
@@ -4,7 +4,7 @@
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/styles/vaadin-button-core-styles.js';
7
+ import { buttonStyles } from '@vaadin/button/src/styles/vaadin-button-base-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';
@@ -12,7 +12,7 @@ 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 { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
14
14
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
15
- import { drawerToggle } from './styles/vaadin-drawer-toggle-core-styles.js';
15
+ import { drawerToggle } from './styles/vaadin-drawer-toggle-base-styles.js';
16
16
 
17
17
  /**
18
18
  * The Drawer Toggle component controls the drawer in App Layout component.
@@ -1,2 +1,2 @@
1
- import './theme/lumo/vaadin-app-layout.js';
1
+ import './src/vaadin-app-layout.js';
2
2
  export * from './src/vaadin-app-layout.js';
@@ -1,2 +1,2 @@
1
- import './theme/lumo/vaadin-drawer-toggle.js';
1
+ import './src/vaadin-drawer-toggle.js';
2
2
  export * from './src/vaadin-drawer-toggle.js';
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/app-layout",
4
- "version": "25.0.0-alpha9",
4
+ "version": "25.0.0-beta1",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-app-layout",
11
- "description": "`<vaadin-app-layout>` is a Web Component providing a quick and easy way to get a common application layout structure done.\n\n```html\n<vaadin-app-layout primary-section=\"navbar|drawer\">\n <vaadin-drawer-toggle slot=\"navbar [touch-optimized]\"></vaadin-drawer-toggle>\n <h3 slot=\"navbar [touch-optimized]\">Company Name</h3>\n <vaadin-tabs orientation=\"vertical\" slot=\"drawer\">\n <vaadin-tab>Menu item 1</vaadin-tab>\n </vaadin-tabs>\n <!-- Everything else will be the page content -->\n <div>\n <h3>Page title</h3>\n <p>Page content</p>\n </div>\n</vaadin-app-layout>\n```\n\nFor best results, the component should be added to the root level of your application (i.e., as a direct child of `<body>`).\n\nThe page should include a viewport meta tag which contains `viewport-fit=cover`, like the following:\n```\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, viewport-fit=cover\">\n```\nThis causes the viewport to be scaled to fill the device display.\nTo ensure that important content is displayed, use the provided css variables.\n```\n--safe-area-inset-top\n--safe-area-inset-right\n--safe-area-inset-bottom\n--safe-area-inset-left\n```\n\n### Styling\n\nThe following Shadow DOM parts of the `<vaadin-app-layout>` are available for styling:\n\nPart name | Description\n--------------|---------------------------------------------------------|\n`backdrop` | Backdrop covering the layout when drawer is open as an overlay\n`navbar` | Container for the navigation bar\n`drawer` | Container for the drawer area\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Component's slots\n\nThe following slots are available to be set\n\nSlot name | Description\n-------------------|---------------------------------------------------|\nno name | Default container for the page content\n`navbar ` | Container for the top navbar area\n`drawer` | Container for an application menu\n`touch-optimized` | Container for the bottom navbar area (only visible for mobile devices)\n\n#### Touch optimized\n\nApp Layout has a pseudo-slot `touch-optimized` in order to give more control of the presentation of\nelements with `slot[navbar]`. Internally, when the user is interacting with App Layout from a\ntouchscreen device, the component will search for elements with `slot[navbar touch-optimized]` and move\nthem to the bottom of the page.\n\n### Navigation\n\nAs the drawer opens as an overlay in small devices, it makes sense to close it once a navigation happens.\nIf you are using Vaadin Router, this will happen automatically unless you change the `closeDrawerOn` event name.\n\nIn order to do so, there are two options:\n- If the `vaadin-app-layout` instance is available, then `drawerOpened` can be set to `false`\n- If not, a custom event `close-overlay-drawer` can be dispatched either by calling\n `window.dispatchEvent(new CustomEvent('close-overlay-drawer'))` or by calling\n `AppLayout.dispatchCloseOverlayDrawerEvent()`\n\n### Scrolling areas\n\nBy default, the component will act with the \"body scrolling\", so on mobile (iOS Safari and Android Chrome),\nthe toolbars will collapse when a scroll happens.\n\nTo use the \"content scrolling\", in case of the content of the page relies on a pre-defined height (for instance,\nit has a `height:100%`), then the developer can set `height: 100%` to both `html` and `body`.\nThat will make the `[content]` element of app layout scrollable.\nOn this case, the toolbars on mobile device won't collapse.",
11
+ "description": "`<vaadin-app-layout>` is a Web Component providing a quick and easy way to get a common application layout structure done.\n\n```html\n<vaadin-app-layout primary-section=\"navbar|drawer\">\n <vaadin-drawer-toggle slot=\"navbar [touch-optimized]\"></vaadin-drawer-toggle>\n <h3 slot=\"navbar [touch-optimized]\">Company Name</h3>\n <vaadin-tabs orientation=\"vertical\" slot=\"drawer\">\n <vaadin-tab>Menu item 1</vaadin-tab>\n </vaadin-tabs>\n <!-- Everything else will be the page content -->\n <div>\n <h3>Page title</h3>\n <p>Page content</p>\n </div>\n</vaadin-app-layout>\n```\n\nFor best results, the component should be added to the root level of your application (i.e., as a direct child of `<body>`).\n\nThe page should include a viewport meta tag which contains `viewport-fit=cover`, like the following:\n```html\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, viewport-fit=cover\">\n```\n\nThis causes the viewport to be scaled to fill the device display.\nTo ensure that important content is displayed, use the provided css variables:\n\n- `--safe-area-inset-top`\n- `--safe-area-inset-right`\n- `--safe-area-inset-bottom`\n- `--safe-area-inset-left`\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-----------------|---------------------------------------------------------|\n`backdrop` | Backdrop covering the layout when drawer is open as an overlay\n`navbar` | Container for the navigation bar\n`navbar-top` | Container for the top navigation bar\n`navbar-bottom` | Container for the bottom navigation bar\n`drawer` | Container for the drawer area\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------|-------------\n`has-drawer` | Set when the element has light DOM content in the drawer slot.\n`has-navbar` | Set when the element has light DOM content in the navbar slot.\n\n### Component's slots\n\nThe following slots are available to be set\n\nSlot name | Description\n-------------------|---------------------------------------------------|\nno name | Default container for the page content\n`navbar ` | Container for the top navbar area\n`drawer` | Container for an application menu\n`touch-optimized` | Container for the bottom navbar area (only visible for mobile devices)\n\n#### Touch optimized\n\nApp Layout has a pseudo-slot `touch-optimized` in order to give more control of the presentation of\nelements with `slot[navbar]`. Internally, when the user is interacting with App Layout from a\ntouchscreen device, the component will search for elements with `slot[navbar touch-optimized]` and move\nthem to the bottom of the page.\n\n### Navigation\n\nAs the drawer opens as an overlay in small devices, it makes sense to close it once a navigation happens.\nIf you are using Vaadin Router, this will happen automatically unless you change the `closeDrawerOn` event name.\n\nIn order to do so, there are two options:\n- If the `vaadin-app-layout` instance is available, then `drawerOpened` can be set to `false`\n- If not, a custom event `close-overlay-drawer` can be dispatched either by calling\n `window.dispatchEvent(new CustomEvent('close-overlay-drawer'))` or by calling\n `AppLayout.dispatchCloseOverlayDrawerEvent()`\n\n### Scrolling areas\n\nBy default, the component will act with the \"body scrolling\", so on mobile (iOS Safari and Android Chrome),\nthe toolbars will collapse when a scroll happens.\n\nTo use the \"content scrolling\", in case of the content of the page relies on a pre-defined height (for instance,\nit has a `height:100%`), then the developer can set `height: 100%` to both `html` and `body`.\nThat will make the `[content]` element of app layout scrollable.\nOn this case, the toolbars on mobile device won't collapse.",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "i18n",
@@ -62,7 +62,7 @@
62
62
  "properties": [
63
63
  {
64
64
  "name": "i18n",
65
- "description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following structure and default values:\n```\n{\n drawer: 'Drawer'\n}\n```",
65
+ "description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following structure and default values:\n```js\n{\n drawer: 'Drawer'\n}\n```",
66
66
  "value": {
67
67
  "type": [
68
68
  "AppLayoutI18n"
@@ -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-alpha9",
4
+ "version": "25.0.0-beta1",
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-app-layout",
19
- "description": "`<vaadin-app-layout>` is a Web Component providing a quick and easy way to get a common application layout structure done.\n\n```html\n<vaadin-app-layout primary-section=\"navbar|drawer\">\n <vaadin-drawer-toggle slot=\"navbar [touch-optimized]\"></vaadin-drawer-toggle>\n <h3 slot=\"navbar [touch-optimized]\">Company Name</h3>\n <vaadin-tabs orientation=\"vertical\" slot=\"drawer\">\n <vaadin-tab>Menu item 1</vaadin-tab>\n </vaadin-tabs>\n <!-- Everything else will be the page content -->\n <div>\n <h3>Page title</h3>\n <p>Page content</p>\n </div>\n</vaadin-app-layout>\n```\n\nFor best results, the component should be added to the root level of your application (i.e., as a direct child of `<body>`).\n\nThe page should include a viewport meta tag which contains `viewport-fit=cover`, like the following:\n```\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, viewport-fit=cover\">\n```\nThis causes the viewport to be scaled to fill the device display.\nTo ensure that important content is displayed, use the provided css variables.\n```\n--safe-area-inset-top\n--safe-area-inset-right\n--safe-area-inset-bottom\n--safe-area-inset-left\n```\n\n### Styling\n\nThe following Shadow DOM parts of the `<vaadin-app-layout>` are available for styling:\n\nPart name | Description\n--------------|---------------------------------------------------------|\n`backdrop` | Backdrop covering the layout when drawer is open as an overlay\n`navbar` | Container for the navigation bar\n`drawer` | Container for the drawer area\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\n### Component's slots\n\nThe following slots are available to be set\n\nSlot name | Description\n-------------------|---------------------------------------------------|\nno name | Default container for the page content\n`navbar ` | Container for the top navbar area\n`drawer` | Container for an application menu\n`touch-optimized` | Container for the bottom navbar area (only visible for mobile devices)\n\n#### Touch optimized\n\nApp Layout has a pseudo-slot `touch-optimized` in order to give more control of the presentation of\nelements with `slot[navbar]`. Internally, when the user is interacting with App Layout from a\ntouchscreen device, the component will search for elements with `slot[navbar touch-optimized]` and move\nthem to the bottom of the page.\n\n### Navigation\n\nAs the drawer opens as an overlay in small devices, it makes sense to close it once a navigation happens.\nIf you are using Vaadin Router, this will happen automatically unless you change the `closeDrawerOn` event name.\n\nIn order to do so, there are two options:\n- If the `vaadin-app-layout` instance is available, then `drawerOpened` can be set to `false`\n- If not, a custom event `close-overlay-drawer` can be dispatched either by calling\n `window.dispatchEvent(new CustomEvent('close-overlay-drawer'))` or by calling\n `AppLayout.dispatchCloseOverlayDrawerEvent()`\n\n### Scrolling areas\n\nBy default, the component will act with the \"body scrolling\", so on mobile (iOS Safari and Android Chrome),\nthe toolbars will collapse when a scroll happens.\n\nTo use the \"content scrolling\", in case of the content of the page relies on a pre-defined height (for instance,\nit has a `height:100%`), then the developer can set `height: 100%` to both `html` and `body`.\nThat will make the `[content]` element of app layout scrollable.\nOn this case, the toolbars on mobile device won't collapse.",
19
+ "description": "`<vaadin-app-layout>` is a Web Component providing a quick and easy way to get a common application layout structure done.\n\n```html\n<vaadin-app-layout primary-section=\"navbar|drawer\">\n <vaadin-drawer-toggle slot=\"navbar [touch-optimized]\"></vaadin-drawer-toggle>\n <h3 slot=\"navbar [touch-optimized]\">Company Name</h3>\n <vaadin-tabs orientation=\"vertical\" slot=\"drawer\">\n <vaadin-tab>Menu item 1</vaadin-tab>\n </vaadin-tabs>\n <!-- Everything else will be the page content -->\n <div>\n <h3>Page title</h3>\n <p>Page content</p>\n </div>\n</vaadin-app-layout>\n```\n\nFor best results, the component should be added to the root level of your application (i.e., as a direct child of `<body>`).\n\nThe page should include a viewport meta tag which contains `viewport-fit=cover`, like the following:\n```html\n<meta name=\"viewport\" content=\"width=device-width, initial-scale=1, viewport-fit=cover\">\n```\n\nThis causes the viewport to be scaled to fill the device display.\nTo ensure that important content is displayed, use the provided css variables:\n\n- `--safe-area-inset-top`\n- `--safe-area-inset-right`\n- `--safe-area-inset-bottom`\n- `--safe-area-inset-left`\n\n### Styling\n\nThe following shadow DOM parts are available for styling:\n\nPart name | Description\n-----------------|---------------------------------------------------------|\n`backdrop` | Backdrop covering the layout when drawer is open as an overlay\n`navbar` | Container for the navigation bar\n`navbar-top` | Container for the top navigation bar\n`navbar-bottom` | Container for the bottom navigation bar\n`drawer` | Container for the drawer area\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n---------------|-------------\n`has-drawer` | Set when the element has light DOM content in the drawer slot.\n`has-navbar` | Set when the element has light DOM content in the navbar slot.\n\n### Component's slots\n\nThe following slots are available to be set\n\nSlot name | Description\n-------------------|---------------------------------------------------|\nno name | Default container for the page content\n`navbar ` | Container for the top navbar area\n`drawer` | Container for an application menu\n`touch-optimized` | Container for the bottom navbar area (only visible for mobile devices)\n\n#### Touch optimized\n\nApp Layout has a pseudo-slot `touch-optimized` in order to give more control of the presentation of\nelements with `slot[navbar]`. Internally, when the user is interacting with App Layout from a\ntouchscreen device, the component will search for elements with `slot[navbar touch-optimized]` and move\nthem to the bottom of the page.\n\n### Navigation\n\nAs the drawer opens as an overlay in small devices, it makes sense to close it once a navigation happens.\nIf you are using Vaadin Router, this will happen automatically unless you change the `closeDrawerOn` event name.\n\nIn order to do so, there are two options:\n- If the `vaadin-app-layout` instance is available, then `drawerOpened` can be set to `false`\n- If not, a custom event `close-overlay-drawer` can be dispatched either by calling\n `window.dispatchEvent(new CustomEvent('close-overlay-drawer'))` or by calling\n `AppLayout.dispatchCloseOverlayDrawerEvent()`\n\n### Scrolling areas\n\nBy default, the component will act with the \"body scrolling\", so on mobile (iOS Safari and Android Chrome),\nthe toolbars will collapse when a scroll happens.\n\nTo use the \"content scrolling\", in case of the content of the page relies on a pre-defined height (for instance,\nit has a `height:100%`), then the developer can set `height: 100%` to both `html` and `body`.\nThat will make the `[content]` element of app layout scrollable.\nOn this case, the toolbars on mobile device won't collapse.",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {
@@ -28,7 +28,7 @@
28
28
  },
29
29
  {
30
30
  "name": ".i18n",
31
- "description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following structure and default values:\n```\n{\n drawer: 'Drawer'\n}\n```",
31
+ "description": "The object used to localize this component. To change the default\nlocalization, replace this with an object that provides all properties, or\njust the individual properties you want to change.\n\nThe object has the following structure and default values:\n```js\n{\n drawer: 'Drawer'\n}\n```",
32
32
  "value": {
33
33
  "kind": "expression"
34
34
  }
@@ -1,8 +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 type { CSSResult } from 'lit';
7
-
8
- export const appLayoutStyles: CSSResult;
@@ -1,166 +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 appLayoutStyles = css`
9
- :host {
10
- display: block;
11
- box-sizing: border-box;
12
- height: 100%;
13
- --vaadin-app-layout-transition-duration: 200ms;
14
- transition: padding var(--vaadin-app-layout-transition-duration);
15
- --_vaadin-app-layout-drawer-width: var(--vaadin-app-layout-drawer-width, 16em);
16
- --vaadin-app-layout-touch-optimized: false;
17
- --vaadin-app-layout-navbar-offset-top: var(--_vaadin-app-layout-navbar-offset-size);
18
- --vaadin-app-layout-navbar-offset-bottom: var(--_vaadin-app-layout-navbar-offset-size-bottom);
19
- padding-block: var(--vaadin-app-layout-navbar-offset-top) var(--vaadin-app-layout-navbar-offset-bottom);
20
- padding-inline-start: var(--vaadin-app-layout-navbar-offset-left);
21
- }
22
-
23
- :host([hidden]),
24
- [hidden] {
25
- display: none !important;
26
- }
27
-
28
- :host([no-anim]) {
29
- --vaadin-app-layout-transition-duration: 0s !important;
30
- }
31
-
32
- :host([drawer-opened]) {
33
- --vaadin-app-layout-drawer-offset-left: var(--_vaadin-app-layout-drawer-offset-size);
34
- }
35
-
36
- :host([overlay]) {
37
- --vaadin-app-layout-drawer-offset-left: 0;
38
- --vaadin-app-layout-navbar-offset-left: 0;
39
- }
40
-
41
- :host(:not([no-scroll])) [content] {
42
- overflow: auto;
43
- }
44
-
45
- [content] {
46
- height: 100%;
47
- }
48
-
49
- @media (pointer: coarse) and (max-width: 800px) and (min-height: 500px) {
50
- :host {
51
- --vaadin-app-layout-touch-optimized: true;
52
- }
53
- }
54
-
55
- [part='navbar'] {
56
- position: fixed;
57
- display: flex;
58
- align-items: center;
59
- top: 0;
60
- inset-inline: 0;
61
- transition: inset-inline-start var(--vaadin-app-layout-transition-duration);
62
- padding-top: var(--safe-area-inset-top);
63
- padding-left: var(--safe-area-inset-left);
64
- padding-right: var(--safe-area-inset-right);
65
- z-index: 1;
66
- }
67
-
68
- :host([primary-section='drawer'][drawer-opened]:not([overlay])) [part='navbar'] {
69
- inset-inline-start: var(--vaadin-app-layout-drawer-offset-left, 0);
70
- }
71
-
72
- :host([primary-section='drawer']) [part='drawer'] {
73
- top: 0;
74
- }
75
-
76
- [part='navbar'][bottom] {
77
- top: auto;
78
- bottom: 0;
79
- padding-bottom: var(--safe-area-inset-bottom);
80
- }
81
-
82
- [part='drawer'] {
83
- overflow: auto;
84
- position: fixed;
85
- top: var(--vaadin-app-layout-navbar-offset-top, 0);
86
- bottom: var(--vaadin-app-layout-navbar-offset-bottom, var(--vaadin-viewport-offset-bottom, 0));
87
- inset-inline: var(--vaadin-app-layout-navbar-offset-left, 0) auto;
88
- transition:
89
- transform var(--vaadin-app-layout-transition-duration),
90
- visibility var(--vaadin-app-layout-transition-duration);
91
- transform: translateX(-100%);
92
- max-width: 90%;
93
- width: var(--_vaadin-app-layout-drawer-width);
94
- box-sizing: border-box;
95
- padding: var(--safe-area-inset-top) 0 var(--safe-area-inset-bottom) var(--safe-area-inset-left);
96
- outline: none;
97
- /* The drawer should be inaccessible by the tabbing navigation when it is closed. */
98
- visibility: hidden;
99
- display: flex;
100
- flex-direction: column;
101
- }
102
-
103
- :host([drawer-opened]) [part='drawer'] {
104
- /* The drawer should be accessible by the tabbing navigation when it is opened. */
105
- visibility: visible;
106
- transform: translateX(0%);
107
- touch-action: manipulation;
108
- }
109
-
110
- [part='backdrop'] {
111
- background-color: #000;
112
- opacity: 0.3;
113
- }
114
-
115
- :host(:not([drawer-opened])) [part='backdrop'] {
116
- opacity: 0;
117
- }
118
-
119
- :host([overlay]) [part='backdrop'] {
120
- position: fixed;
121
- inset: 0;
122
- pointer-events: none;
123
- transition: opacity var(--vaadin-app-layout-transition-duration);
124
- -webkit-tap-highlight-color: transparent;
125
- }
126
-
127
- :host([overlay]) [part='drawer'] {
128
- top: 0;
129
- bottom: 0;
130
- }
131
-
132
- :host([overlay]) [part='drawer'],
133
- :host([overlay]) [part='backdrop'] {
134
- z-index: 2;
135
- }
136
-
137
- :host([drawer-opened][overlay]) [part='backdrop'] {
138
- pointer-events: auto;
139
- touch-action: manipulation;
140
- }
141
-
142
- :host([dir='rtl']) [part='drawer'] {
143
- transform: translateX(100%);
144
- }
145
-
146
- :host([dir='rtl'][drawer-opened]) [part='drawer'] {
147
- transform: translateX(0%);
148
- }
149
-
150
- :host([drawer-opened]:not([overlay])) {
151
- padding-inline-start: var(--vaadin-app-layout-drawer-offset-left);
152
- }
153
-
154
- @media (max-width: 800px), (max-height: 600px) {
155
- :host {
156
- --vaadin-app-layout-drawer-overlay: true;
157
- --_vaadin-app-layout-drawer-width: var(--vaadin-app-layout-drawer-width, 20em);
158
- }
159
- }
160
-
161
- /* If a vaadin-scroller is used in the drawer, allow it to take all remaining space and contain scrolling */
162
- [part='drawer'] ::slotted(vaadin-scroller) {
163
- flex: 1;
164
- overscroll-behavior: contain;
165
- }
166
- `;
@@ -1,8 +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 type { CSSResult } from 'lit';
7
-
8
- export const drawerToggle: CSSResult;
@@ -1,43 +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 drawerToggle = css`
9
- :host {
10
- display: inline-flex;
11
- align-items: center;
12
- justify-content: center;
13
- cursor: default;
14
- position: relative;
15
- outline: none;
16
- height: 24px;
17
- width: 24px;
18
- padding: 4px;
19
- }
20
-
21
- [part='icon'],
22
- [part='icon']::after,
23
- [part='icon']::before {
24
- position: absolute;
25
- top: 8px;
26
- height: 3px;
27
- width: 24px;
28
- background-color: #000;
29
- }
30
-
31
- [part='icon']::after,
32
- [part='icon']::before {
33
- content: '';
34
- }
35
-
36
- [part='icon']::after {
37
- top: 6px;
38
- }
39
-
40
- [part='icon']::before {
41
- top: 12px;
42
- }
43
- `;
@@ -1,3 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/color.js';
2
- import '@vaadin/vaadin-lumo-styles/spacing.js';
3
- import '@vaadin/vaadin-lumo-styles/typography.js';
@@ -1,56 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/color.js';
2
- import '@vaadin/vaadin-lumo-styles/spacing.js';
3
- import '@vaadin/vaadin-lumo-styles/typography.js';
4
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
5
-
6
- registerStyles(
7
- 'vaadin-app-layout',
8
- css`
9
- [part='navbar'],
10
- [part='drawer'] {
11
- background-color: var(--lumo-base-color);
12
- background-clip: padding-box;
13
- }
14
-
15
- [part='navbar'] {
16
- min-height: var(--lumo-size-xl);
17
- border-bottom: 1px solid var(--lumo-contrast-10pct);
18
- }
19
-
20
- [part='navbar'][bottom] {
21
- border-bottom: none;
22
- border-top: 1px solid var(--lumo-contrast-10pct);
23
- }
24
-
25
- [part='drawer'] {
26
- border-inline-end: 1px solid var(--lumo-contrast-10pct);
27
- }
28
-
29
- :host([overlay]) [part='drawer'] {
30
- border-inline-end: none;
31
- box-shadow: var(--lumo-box-shadow-s);
32
- }
33
-
34
- :host([primary-section='navbar']) [part='navbar'] {
35
- border: none;
36
- background-image: linear-gradient(var(--lumo-contrast-5pct), var(--lumo-contrast-5pct));
37
- }
38
-
39
- :host([primary-section='drawer']:not([overlay])) [part='drawer'] {
40
- background-image: linear-gradient(var(--lumo-shade-5pct), var(--lumo-shade-5pct));
41
- }
42
-
43
- [part='backdrop'] {
44
- background-color: var(--lumo-shade-20pct);
45
- opacity: 1;
46
- }
47
-
48
- [part] ::slotted(h2),
49
- [part] ::slotted(h3),
50
- [part] ::slotted(h4) {
51
- margin-top: var(--lumo-space-xs) !important;
52
- margin-bottom: var(--lumo-space-xs) !important;
53
- }
54
- `,
55
- { moduleId: 'lumo-app-layout' },
56
- );
@@ -1,2 +0,0 @@
1
- import './vaadin-app-layout-styles.js';
2
- import '../../src/vaadin-app-layout.js';
@@ -1,2 +0,0 @@
1
- import './vaadin-app-layout-styles.js';
2
- import '../../src/vaadin-app-layout.js';
@@ -1 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/font-icons.js';
@@ -1,36 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/font-icons.js';
2
- import { button } from '@vaadin/button/theme/lumo/vaadin-button-styles.js';
3
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
4
-
5
- const drawerToggle = css`
6
- :host {
7
- width: var(--lumo-size-l);
8
- height: var(--lumo-size-l);
9
- min-width: auto;
10
- margin: 0 var(--lumo-space-s);
11
- padding: 0;
12
- background: transparent;
13
- }
14
-
15
- [part='icon'],
16
- [part='icon']::after,
17
- [part='icon']::before {
18
- position: inherit;
19
- height: auto;
20
- width: auto;
21
- background: transparent;
22
- top: auto;
23
- }
24
-
25
- [part='icon']::before {
26
- font-family: lumo-icons;
27
- font-size: var(--lumo-icon-size-m);
28
- content: var(--lumo-icons-menu);
29
- }
30
-
31
- :host([slot~='navbar']) {
32
- color: var(--lumo-secondary-text-color);
33
- }
34
- `;
35
-
36
- registerStyles('vaadin-drawer-toggle', [button, drawerToggle], { moduleId: 'lumo-drawer-toggle' });
@@ -1,2 +0,0 @@
1
- import './vaadin-drawer-toggle-styles.js';
2
- import '../../src/vaadin-drawer-toggle.js';
@@ -1,2 +0,0 @@
1
- import './vaadin-drawer-toggle-styles.js';
2
- import '../../src/vaadin-drawer-toggle.js';