@vaadin/master-detail-layout 25.0.0-alpha8 → 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/master-detail-layout",
3
- "version": "25.0.0-alpha8",
3
+ "version": "25.0.0-beta1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -21,7 +21,6 @@
21
21
  "type": "module",
22
22
  "files": [
23
23
  "src",
24
- "theme",
25
24
  "vaadin-*.d.ts",
26
25
  "vaadin-*.js",
27
26
  "web-types.json",
@@ -34,20 +33,20 @@
34
33
  "web-component"
35
34
  ],
36
35
  "dependencies": {
37
- "@vaadin/a11y-base": "25.0.0-alpha8",
38
- "@vaadin/component-base": "25.0.0-alpha8",
39
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha8",
40
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha8",
36
+ "@vaadin/a11y-base": "25.0.0-beta1",
37
+ "@vaadin/component-base": "25.0.0-beta1",
38
+ "@vaadin/vaadin-themable-mixin": "25.0.0-beta1",
41
39
  "lit": "^3.0.0"
42
40
  },
43
41
  "devDependencies": {
44
- "@vaadin/chai-plugins": "25.0.0-alpha8",
42
+ "@vaadin/chai-plugins": "25.0.0-beta1",
45
43
  "@vaadin/testing-helpers": "^2.0.0",
46
- "sinon": "^18.0.0"
44
+ "@vaadin/vaadin-lumo-styles": "25.0.0-beta1",
45
+ "sinon": "^21.0.0"
47
46
  },
48
47
  "web-types": [
49
48
  "web-types.json",
50
49
  "web-types.lit.json"
51
50
  ],
52
- "gitHead": "ebf53673d5f639d2b1b6f2b31f640f530643ee2f"
51
+ "gitHead": "1d20cf54e582d1f2e209126d4586f8b4c01c50e0"
53
52
  }
@@ -3,6 +3,7 @@
3
3
  * Copyright (c) 2025 - 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/styles/style-props.js';
6
7
  import { css } from 'lit';
7
8
 
8
9
  export const masterDetailLayoutStyles = css`
@@ -138,22 +139,32 @@ export const masterDetailLayoutStyles = css`
138
139
  /* Decorative/visual styles */
139
140
 
140
141
  [part='backdrop'] {
141
- background-color: rgba(0, 0, 0, 0.2);
142
- }
143
-
144
- [part='detail'] {
145
- background: #fff;
142
+ background: var(--vaadin-overlay-backdrop-background, rgba(0, 0, 0, 0.2));
143
+ forced-color-adjust: none;
146
144
  }
147
145
 
148
146
  :host(:is([drawer], [stack])) [part='detail'] {
149
- box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.3);
147
+ background: var(--vaadin-master-detail-layout-detail-background, var(--vaadin-background-color));
148
+ box-shadow: var(--vaadin-master-detail-layout-detail-shadow, 0 0 20px 0 rgba(0, 0, 0, 0.3));
150
149
  }
151
150
 
152
151
  :host([orientation='horizontal']:not([drawer], [stack])) [part='detail'] {
153
- border-inline-start: 1px solid rgba(0, 0, 0, 0.1);
152
+ border-inline-start: var(--vaadin-master-detail-layout-border-width, 1px) solid
153
+ var(--vaadin-master-detail-layout-border-color, var(--vaadin-border-color-secondary));
154
154
  }
155
155
 
156
156
  :host([orientation='vertical']:not([drawer], [stack])) [part='detail'] {
157
- border-top: 1px solid rgba(0, 0, 0, 0.1);
157
+ border-top: var(--vaadin-master-detail-layout-border-width, 1px) solid
158
+ var(--vaadin-master-detail-layout-border-color, var(--vaadin-border-color-secondary));
159
+ }
160
+
161
+ @media (forced-colors: active) {
162
+ :host(:is([drawer], [stack])) [part='detail'] {
163
+ outline: 3px solid !important;
164
+ }
165
+
166
+ [part='detail'] {
167
+ background: Canvas !important;
168
+ }
158
169
  }
159
170
  `;
@@ -40,7 +40,7 @@ export const masterDetailLayoutTransitionStyles = css`
40
40
  }
41
41
 
42
42
  /* Needed to promote the backdrop on top the master during the transition */
43
- vaadin-master-detail-layout[transition]:not([transition='replace'])::part(backdrop) {
43
+ vaadin-master-detail-layout[transition]::part(backdrop) {
44
44
  view-transition-name: vaadin-mdl-backdrop;
45
45
  }
46
46
 
@@ -88,7 +88,14 @@ export const masterDetailLayoutTransitionStyles = css`
88
88
  ::view-transition-new(vaadin-mdl-master),
89
89
  ::view-transition-old(vaadin-mdl-master) {
90
90
  object-fit: none;
91
- object-position: max(0%, var(--_vaadin-mdl-dir-multiplier) * -100%) 0;
91
+ object-position: 0% 0;
92
+ width: 100%;
93
+ height: 100%;
94
+ }
95
+
96
+ :dir(rtl)::view-transition-new(vaadin-mdl-master),
97
+ :dir(rtl)::view-transition-old(vaadin-mdl-master) {
98
+ object-position: 100% 0;
92
99
  }
93
100
 
94
101
  ::view-transition-new(vaadin-mdl-master.stack-remove),
@@ -10,10 +10,9 @@ import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
10
10
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
11
11
  import { ResizeMixin } from '@vaadin/component-base/src/resize-mixin.js';
12
12
  import { SlotStylesMixin } from '@vaadin/component-base/src/slot-styles-mixin.js';
13
- import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
14
13
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
15
- import { masterDetailLayoutStyles } from './styles/vaadin-master-detail-layout-core-styles.js';
16
- import { masterDetailLayoutTransitionStyles } from './styles/vaadin-master-detail-layout-transition-core-styles.js';
14
+ import { masterDetailLayoutStyles } from './styles/vaadin-master-detail-layout-base-styles.js';
15
+ import { masterDetailLayoutTransitionStyles } from './styles/vaadin-master-detail-layout-transition-base-styles.js';
17
16
 
18
17
  /**
19
18
  * `<vaadin-master-detail-layout>` is a web component for building UIs with a master
@@ -52,9 +51,7 @@ import { masterDetailLayoutTransitionStyles } from './styles/vaadin-master-detai
52
51
  * @mixes ResizeMixin
53
52
  * @mixes SlotStylesMixin
54
53
  */
55
- class MasterDetailLayout extends SlotStylesMixin(
56
- ResizeMixin(ElementMixin(ThemableMixin(PolylitMixin(LumoInjectionMixin(LitElement))))),
57
- ) {
54
+ class MasterDetailLayout extends SlotStylesMixin(ResizeMixin(ElementMixin(ThemableMixin(PolylitMixin(LitElement))))) {
58
55
  static get is() {
59
56
  return 'vaadin-master-detail-layout';
60
57
  }
@@ -63,12 +60,6 @@ class MasterDetailLayout extends SlotStylesMixin(
63
60
  return masterDetailLayoutStyles;
64
61
  }
65
62
 
66
- static get lumoInjector() {
67
- return {
68
- includeBaseStyles: true,
69
- };
70
- }
71
-
72
63
  static get properties() {
73
64
  return {
74
65
  /**
@@ -300,9 +291,9 @@ class MasterDetailLayout extends SlotStylesMixin(
300
291
 
301
292
  /** @private */
302
293
  __onDetailKeydown(event) {
303
- if (event.key === 'Escape') {
294
+ if (event.key === 'Escape' && !event.defaultPrevented) {
304
295
  // Prevent firing on parent layout when using nested layouts
305
- event.stopPropagation();
296
+ event.preventDefault();
306
297
  this.dispatchEvent(new CustomEvent('detail-escape-press'));
307
298
  }
308
299
  }
@@ -532,8 +523,10 @@ class MasterDetailLayout extends SlotStylesMixin(
532
523
  * @protected
533
524
  */
534
525
  async _finishTransition() {
535
- // Detect new layout mode after DOM has been updated
536
- this.__detectLayoutMode();
526
+ // Detect new layout mode after DOM has been updated.
527
+ // The detection is wrapped in queueMicroTask in order to allow custom Lit elements to render before measurement.
528
+ // https://github.com/vaadin/web-components/issues/8969
529
+ queueMicrotask(() => this.__detectLayoutMode());
537
530
 
538
531
  if (!this.__transition) {
539
532
  return Promise.resolve();
@@ -1,3 +1,3 @@
1
- import './theme/lumo/vaadin-master-detail-layout.js';
1
+ import './src/vaadin-master-detail-layout.js';
2
2
 
3
3
  export * from './src/vaadin-master-detail-layout.js';
package/web-types.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/master-detail-layout",
4
- "version": "25.0.0-alpha8",
4
+ "version": "25.0.0-beta1",
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/master-detail-layout",
4
- "version": "25.0.0-alpha8",
4
+ "version": "25.0.0-beta1",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -1,2 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/color.js';
2
- import '@vaadin/vaadin-lumo-styles/style.js';
@@ -1,24 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/color.js';
2
- import '@vaadin/vaadin-lumo-styles/style.js';
3
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
4
-
5
- registerStyles(
6
- 'vaadin-master-detail-layout',
7
- css`
8
- :host(:is([drawer], [stack])) [part='detail'] {
9
- background-color: var(--lumo-base-color);
10
- box-shadow:
11
- 0 0 0 1px var(--lumo-shade-5pct),
12
- var(--lumo-box-shadow-m);
13
- }
14
-
15
- [part='detail'] {
16
- border-color: var(--lumo-contrast-10pct);
17
- }
18
-
19
- [part='backdrop'] {
20
- background-color: var(--lumo-shade-20pct);
21
- }
22
- `,
23
- { moduleId: 'lumo-master-detail-layout' },
24
- );
@@ -1,2 +0,0 @@
1
- import './vaadin-master-detail-layout-styles.js';
2
- import '../../src/vaadin-master-detail-layout.js';
@@ -1,2 +0,0 @@
1
- import './vaadin-master-detail-layout-styles.js';
2
- import '../../src/vaadin-master-detail-layout.js';