@vaadin/master-detail-layout 24.8.4 → 25.0.0-alpha10

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/README.md CHANGED
@@ -25,29 +25,6 @@ Once installed, import the component in your application:
25
25
  import '@vaadin/master-detail-layout';
26
26
  ```
27
27
 
28
- ## Themes
29
-
30
- Vaadin components come with two built-in [themes](https://vaadin.com/docs/latest/styling), Lumo and Material.
31
- The [main entrypoint](https://github.com/vaadin/web-components/blob/main/packages/master-detail-layout/vaadin-master-detail-layout.js) of the package uses the Lumo theme.
32
-
33
- To use the Material theme, import the component from the `theme/material` folder:
34
-
35
- ```js
36
- import '@vaadin/master-detail-layout/theme/material/vaadin-master-detail-layout.js';
37
- ```
38
-
39
- You can also import the Lumo version of the component explicitly:
40
-
41
- ```js
42
- import '@vaadin/master-detail-layout/theme/lumo/vaadin-master-detail-layout.js';
43
- ```
44
-
45
- Finally, you can import the un-themed component from the `src` folder to get a minimal starting point:
46
-
47
- ```js
48
- import '@vaadin/master-detail-layout/src/vaadin-master-detail-layout.js';
49
- ```
50
-
51
28
  ## Contributing
52
29
 
53
30
  Read the [contributing guide](https://vaadin.com/docs/latest/contributing) to learn about our development process, how to propose bugfixes and improvements, and how to test your changes to Vaadin components.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vaadin/master-detail-layout",
3
- "version": "24.8.4",
3
+ "version": "25.0.0-alpha10",
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",
@@ -34,21 +36,20 @@
34
36
  "web-component"
35
37
  ],
36
38
  "dependencies": {
37
- "@vaadin/a11y-base": "~24.8.4",
38
- "@vaadin/component-base": "~24.8.4",
39
- "@vaadin/vaadin-lumo-styles": "~24.8.4",
40
- "@vaadin/vaadin-material-styles": "~24.8.4",
41
- "@vaadin/vaadin-themable-mixin": "~24.8.4",
39
+ "@vaadin/a11y-base": "25.0.0-alpha10",
40
+ "@vaadin/component-base": "25.0.0-alpha10",
41
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha10",
42
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha10",
42
43
  "lit": "^3.0.0"
43
44
  },
44
45
  "devDependencies": {
45
- "@vaadin/chai-plugins": "~24.8.4",
46
- "@vaadin/testing-helpers": "^1.1.0",
46
+ "@vaadin/chai-plugins": "25.0.0-alpha10",
47
+ "@vaadin/testing-helpers": "^2.0.0",
47
48
  "sinon": "^18.0.0"
48
49
  },
49
50
  "web-types": [
50
51
  "web-types.json",
51
52
  "web-types.lit.json"
52
53
  ],
53
- "gitHead": "849e54e967563080a685965e2dced02060b3ab23"
54
+ "gitHead": "6cc6c94079e805fa5b2f0af4dbf3b2a7485e57d0"
54
55
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2025 - 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 masterDetailLayoutStyles: CSSResult;
@@ -0,0 +1,165 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2025 - 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 masterDetailLayoutStyles = css`
10
+ /* Layout and positioning styles */
11
+
12
+ :host {
13
+ display: flex;
14
+ box-sizing: border-box;
15
+ height: 100%;
16
+ max-width: 100%;
17
+ max-height: 100%;
18
+ position: relative; /* Keep the positioning context stable across all modes */
19
+ overflow: hidden;
20
+ }
21
+
22
+ :host([hidden]) {
23
+ display: none !important;
24
+ }
25
+
26
+ :host([orientation='vertical']) {
27
+ flex-direction: column;
28
+ }
29
+
30
+ [part='_detail-internal'] {
31
+ display: contents;
32
+ justify-content: end;
33
+ }
34
+
35
+ :host([orientation='vertical']) [part='_detail-internal'] {
36
+ align-items: end;
37
+ }
38
+
39
+ :host(:is([drawer], [stack])) [part='_detail-internal'],
40
+ :host(:is([drawer], [stack])[has-detail]) [part='backdrop'] {
41
+ display: flex;
42
+ position: absolute;
43
+ z-index: 1;
44
+ inset: 0;
45
+ overscroll-behavior: contain;
46
+ }
47
+
48
+ :host(:not([has-detail])) [part='_detail-internal'],
49
+ [part='backdrop'] {
50
+ display: none;
51
+ }
52
+
53
+ :host([orientation='horizontal'][drawer]) [part='detail'] {
54
+ margin-inline-start: 50px;
55
+ }
56
+
57
+ :host([orientation='vertical'][drawer]) [part='detail'] {
58
+ margin-top: 50px;
59
+ }
60
+
61
+ :host(:is([drawer], [stack])[containment='viewport']) :is([part='_detail-internal'], [part='backdrop']) {
62
+ position: fixed;
63
+ }
64
+
65
+ /* Sizing styles */
66
+
67
+ [part] {
68
+ box-sizing: border-box;
69
+ max-width: 100%;
70
+ max-height: 100%;
71
+ }
72
+
73
+ /* No fixed size */
74
+ :host(:not([has-master-size])) [part='master'],
75
+ :host(:not([has-detail-size]):not([drawer], [stack])) [part='detail'] {
76
+ flex-grow: 1;
77
+ flex-basis: 50%;
78
+ }
79
+
80
+ /* Fixed size */
81
+ :host([has-master-size]) [part='master'],
82
+ :host([has-detail-size]) [part='detail'] {
83
+ flex-shrink: 0;
84
+ }
85
+
86
+ :host([orientation='horizontal'][has-master-size][has-detail]) [part='master'] {
87
+ width: var(--_master-size);
88
+ }
89
+
90
+ :host([orientation='vertical'][has-master-size][has-detail]) [part='master'] {
91
+ height: var(--_master-size);
92
+ }
93
+
94
+ :host([orientation='horizontal'][has-detail-size]:not([stack])) [part='detail'] {
95
+ width: var(--_detail-size);
96
+ }
97
+
98
+ :host([orientation='vertical'][has-detail-size]:not([stack])) [part='detail'] {
99
+ height: var(--_detail-size);
100
+ }
101
+
102
+ :host([has-master-size][has-detail-size]) [part='master'] {
103
+ flex-grow: 1;
104
+ flex-basis: var(--_master-size);
105
+ }
106
+
107
+ :host([has-master-size][has-detail-size]:not([drawer], [stack])) [part='detail'] {
108
+ flex-grow: 1;
109
+ flex-basis: var(--_detail-size);
110
+ }
111
+
112
+ /* Min size */
113
+ :host([orientation='horizontal'][has-master-min-size]) [part='master'] {
114
+ min-width: min(100%, var(--_master-min-size));
115
+ }
116
+
117
+ :host([orientation='vertical'][has-master-min-size]) [part='master'] {
118
+ min-height: min(100%, var(--_master-min-size));
119
+ }
120
+
121
+ :host([orientation='horizontal'][has-detail-min-size]) [part='detail'] {
122
+ min-width: min(100%, var(--_detail-min-size));
123
+ }
124
+
125
+ :host([orientation='vertical'][has-detail-min-size]) [part='detail'] {
126
+ min-height: min(100%, var(--_detail-min-size));
127
+ }
128
+
129
+ :host([drawer]) [part='master'],
130
+ :host([stack]) [part] {
131
+ width: 100% !important;
132
+ height: 100% !important;
133
+ min-width: auto !important;
134
+ min-height: auto !important;
135
+ max-width: 100% !important;
136
+ max-height: 100% !important;
137
+ }
138
+
139
+ /* Decorative/visual styles */
140
+
141
+ [part='backdrop'] {
142
+ background: var(--vaadin-master-detail-layout-backdrop, rgba(0, 0, 0, 0.2));
143
+ }
144
+
145
+ :host(:is([drawer], [stack])) [part='detail'] {
146
+ background: var(--vaadin-master-detail-layout-detail-background, var(--vaadin-background-color));
147
+ box-shadow: var(--vaadin-master-detail-layout-detail-shadow, 0 0 20px 0 rgba(0, 0, 0, 0.3));
148
+ }
149
+
150
+ :host([orientation='horizontal']:not([drawer], [stack])) [part='detail'] {
151
+ border-inline-start: var(--vaadin-master-detail-layout-border-width, 1px) solid
152
+ var(--vaadin-master-detail-layout-border-color, var(--vaadin-border-color));
153
+ }
154
+
155
+ :host([orientation='vertical']:not([drawer], [stack])) [part='detail'] {
156
+ border-top: var(--vaadin-master-detail-layout-border-width, 1px) solid
157
+ var(--vaadin-master-detail-layout-border-color, var(--vaadin-border-color));
158
+ }
159
+
160
+ @media (forced-colors: active) {
161
+ :host(:is([drawer], [stack])) [part='detail'] {
162
+ outline: 3px solid;
163
+ }
164
+ }
165
+ `;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2025 - 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 masterDetailLayoutStyles: CSSResult;
@@ -0,0 +1,159 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2025 - 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 masterDetailLayoutStyles = css`
9
+ /* Layout and positioning styles */
10
+
11
+ :host {
12
+ display: flex;
13
+ box-sizing: border-box;
14
+ height: 100%;
15
+ max-width: 100%;
16
+ max-height: 100%;
17
+ position: relative; /* Keep the positioning context stable across all modes */
18
+ overflow: hidden;
19
+ }
20
+
21
+ :host([hidden]) {
22
+ display: none !important;
23
+ }
24
+
25
+ :host([orientation='vertical']) {
26
+ flex-direction: column;
27
+ }
28
+
29
+ [part='_detail-internal'] {
30
+ display: contents;
31
+ justify-content: end;
32
+ }
33
+
34
+ :host([orientation='vertical']) [part='_detail-internal'] {
35
+ align-items: end;
36
+ }
37
+
38
+ :host(:is([drawer], [stack])) [part='_detail-internal'],
39
+ :host(:is([drawer], [stack])[has-detail]) [part='backdrop'] {
40
+ display: flex;
41
+ position: absolute;
42
+ z-index: 1;
43
+ inset: 0;
44
+ overscroll-behavior: contain;
45
+ }
46
+
47
+ :host(:not([has-detail])) [part='_detail-internal'],
48
+ [part='backdrop'] {
49
+ display: none;
50
+ }
51
+
52
+ :host([orientation='horizontal'][drawer]) [part='detail'] {
53
+ margin-inline-start: 50px;
54
+ }
55
+
56
+ :host([orientation='vertical'][drawer]) [part='detail'] {
57
+ margin-top: 50px;
58
+ }
59
+
60
+ :host(:is([drawer], [stack])[containment='viewport']) :is([part='_detail-internal'], [part='backdrop']) {
61
+ position: fixed;
62
+ }
63
+
64
+ /* Sizing styles */
65
+
66
+ [part] {
67
+ box-sizing: border-box;
68
+ max-width: 100%;
69
+ max-height: 100%;
70
+ }
71
+
72
+ /* No fixed size */
73
+ :host(:not([has-master-size])) [part='master'],
74
+ :host(:not([has-detail-size]):not([drawer], [stack])) [part='detail'] {
75
+ flex-grow: 1;
76
+ flex-basis: 50%;
77
+ }
78
+
79
+ /* Fixed size */
80
+ :host([has-master-size]) [part='master'],
81
+ :host([has-detail-size]) [part='detail'] {
82
+ flex-shrink: 0;
83
+ }
84
+
85
+ :host([orientation='horizontal'][has-master-size][has-detail]) [part='master'] {
86
+ width: var(--_master-size);
87
+ }
88
+
89
+ :host([orientation='vertical'][has-master-size][has-detail]) [part='master'] {
90
+ height: var(--_master-size);
91
+ }
92
+
93
+ :host([orientation='horizontal'][has-detail-size]:not([stack])) [part='detail'] {
94
+ width: var(--_detail-size);
95
+ }
96
+
97
+ :host([orientation='vertical'][has-detail-size]:not([stack])) [part='detail'] {
98
+ height: var(--_detail-size);
99
+ }
100
+
101
+ :host([has-master-size][has-detail-size]) [part='master'] {
102
+ flex-grow: 1;
103
+ flex-basis: var(--_master-size);
104
+ }
105
+
106
+ :host([has-master-size][has-detail-size]:not([drawer], [stack])) [part='detail'] {
107
+ flex-grow: 1;
108
+ flex-basis: var(--_detail-size);
109
+ }
110
+
111
+ /* Min size */
112
+ :host([orientation='horizontal'][has-master-min-size]) [part='master'] {
113
+ min-width: min(100%, var(--_master-min-size));
114
+ }
115
+
116
+ :host([orientation='vertical'][has-master-min-size]) [part='master'] {
117
+ min-height: min(100%, var(--_master-min-size));
118
+ }
119
+
120
+ :host([orientation='horizontal'][has-detail-min-size]) [part='detail'] {
121
+ min-width: min(100%, var(--_detail-min-size));
122
+ }
123
+
124
+ :host([orientation='vertical'][has-detail-min-size]) [part='detail'] {
125
+ min-height: min(100%, var(--_detail-min-size));
126
+ }
127
+
128
+ :host([drawer]) [part='master'],
129
+ :host([stack]) [part] {
130
+ width: 100% !important;
131
+ height: 100% !important;
132
+ min-width: auto !important;
133
+ min-height: auto !important;
134
+ max-width: 100% !important;
135
+ max-height: 100% !important;
136
+ }
137
+
138
+ /* Decorative/visual styles */
139
+
140
+ [part='backdrop'] {
141
+ background-color: rgba(0, 0, 0, 0.2);
142
+ }
143
+
144
+ [part='detail'] {
145
+ background: #fff;
146
+ }
147
+
148
+ :host(:is([drawer], [stack])) [part='detail'] {
149
+ box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.3);
150
+ }
151
+
152
+ :host([orientation='horizontal']:not([drawer], [stack])) [part='detail'] {
153
+ border-inline-start: 1px solid rgba(0, 0, 0, 0.1);
154
+ }
155
+
156
+ :host([orientation='vertical']:not([drawer], [stack])) [part='detail'] {
157
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
158
+ }
159
+ `;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2025 - 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 masterDetailLayoutTransitionStyles: CSSResult;
@@ -5,7 +5,7 @@
5
5
  */
6
6
  import { css } from 'lit';
7
7
 
8
- export const transitionStyles = css`
8
+ export const masterDetailLayoutTransitionStyles = css`
9
9
  @media (prefers-reduced-motion: no-preference) {
10
10
  html {
11
11
  --_vaadin-mdl-dir-multiplier: 1;
@@ -40,7 +40,7 @@ export const transitionStyles = 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
 
@@ -0,0 +1,8 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2025 - 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 masterDetailLayoutTransitionStyles: CSSResult;
@@ -0,0 +1,140 @@
1
+ /**
2
+ * @license
3
+ * Copyright (c) 2025 - 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 masterDetailLayoutTransitionStyles = css`
9
+ @media (prefers-reduced-motion: no-preference) {
10
+ html {
11
+ --_vaadin-mdl-dir-multiplier: 1;
12
+ --_vaadin-mdl-stack-master-offset: 20%;
13
+ --_vaadin-mdl-stack-master-clip-path: inset(0 0 0 var(--_vaadin-mdl-stack-master-offset));
14
+ --_vaadin-mdl-easing: cubic-bezier(0.78, 0, 0.22, 1);
15
+ }
16
+
17
+ html[dir='rtl'] {
18
+ --_vaadin-mdl-dir-multiplier: -1;
19
+ --_vaadin-mdl-stack-master-clip-path: inset(0 var(--_vaadin-mdl-stack-master-offset) 0 0);
20
+ }
21
+
22
+ ::view-transition-group(vaadin-mdl-backdrop),
23
+ ::view-transition-group(vaadin-mdl-master),
24
+ ::view-transition-group(vaadin-mdl-detail) {
25
+ animation-duration: 0.4s;
26
+ }
27
+
28
+ ::view-transition-group(vaadin-mdl-master),
29
+ ::view-transition-group(vaadin-mdl-detail) {
30
+ animation-timing-function: var(--_vaadin-mdl-easing);
31
+ }
32
+
33
+ ::view-transition-image-pair(vaadin-mdl-master),
34
+ ::view-transition-image-pair(vaadin-mdl-detail),
35
+ ::view-transition-new(vaadin-mdl-master),
36
+ ::view-transition-new(vaadin-mdl-detail),
37
+ ::view-transition-old(vaadin-mdl-master),
38
+ ::view-transition-old(vaadin-mdl-detail) {
39
+ animation-timing-function: inherit;
40
+ }
41
+
42
+ /* Needed to promote the backdrop on top the master during the transition */
43
+ vaadin-master-detail-layout[transition]::part(backdrop) {
44
+ view-transition-name: vaadin-mdl-backdrop;
45
+ }
46
+
47
+ vaadin-master-detail-layout[transition]:not([transition='replace']):not([drawer], [stack])::part(detail),
48
+ vaadin-master-detail-layout[transition]:is([drawer], [stack])::part(_detail-internal) {
49
+ view-transition-name: vaadin-mdl-detail;
50
+ }
51
+
52
+ ::view-transition-group(vaadin-mdl-detail) {
53
+ clip-path: inset(0);
54
+ }
55
+
56
+ ::view-transition-new(vaadin-mdl-detail),
57
+ ::view-transition-old(vaadin-mdl-detail) {
58
+ animation-name: vaadin-mdl-detail-slide-in;
59
+ }
60
+
61
+ ::view-transition-old(vaadin-mdl-detail) {
62
+ animation-direction: reverse;
63
+ }
64
+
65
+ @keyframes vaadin-mdl-detail-slide-in {
66
+ 0% {
67
+ translate: calc((100% + 30px) * var(--_vaadin-mdl-dir-multiplier));
68
+ }
69
+ }
70
+
71
+ vaadin-master-detail-layout[orientation='horizontal'][stack][has-detail]::part(master) {
72
+ translate: calc(var(--_vaadin-mdl-stack-master-offset) * var(--_vaadin-mdl-dir-multiplier) * -1);
73
+ opacity: 0;
74
+ }
75
+
76
+ vaadin-master-detail-layout[transition]::part(master) {
77
+ view-transition-name: vaadin-mdl-master;
78
+ }
79
+
80
+ vaadin-master-detail-layout[orientation='horizontal'][stack][transition='add']::part(master) {
81
+ view-transition-class: stack-add;
82
+ }
83
+
84
+ vaadin-master-detail-layout[orientation='horizontal'][stack][transition='remove']::part(master) {
85
+ view-transition-class: stack-remove;
86
+ }
87
+
88
+ ::view-transition-new(vaadin-mdl-master),
89
+ ::view-transition-old(vaadin-mdl-master) {
90
+ object-fit: none;
91
+ object-position: max(0%, var(--_vaadin-mdl-dir-multiplier) * -100%) 0;
92
+ }
93
+
94
+ ::view-transition-new(vaadin-mdl-master.stack-remove),
95
+ ::view-transition-old(vaadin-mdl-master.stack-remove) {
96
+ animation-name: vaadin-mdl-master-stack-remove;
97
+ clip-path: var(--_vaadin-mdl-stack-master-clip-path);
98
+ }
99
+
100
+ @keyframes vaadin-mdl-master-stack-remove {
101
+ 100% {
102
+ clip-path: inset(0);
103
+ }
104
+ }
105
+
106
+ ::view-transition-new(vaadin-mdl-master.stack-add),
107
+ ::view-transition-old(vaadin-mdl-master.stack-add) {
108
+ animation-name: vaadin-mdl-master-stack-add;
109
+ clip-path: inset(0);
110
+ }
111
+
112
+ @keyframes vaadin-mdl-master-stack-add {
113
+ 100% {
114
+ clip-path: var(--_vaadin-mdl-stack-master-clip-path);
115
+ }
116
+ }
117
+
118
+ /* prettier-ignore */
119
+ vaadin-master-detail-layout[orientation='vertical']:not([drawer], [stack])[transition]:not([transition='replace'])::part(detail),
120
+ vaadin-master-detail-layout[orientation='vertical']:is([drawer], [stack])[transition]::part(_detail-internal) {
121
+ view-transition-name: vaadin-mdl-detail;
122
+ view-transition-class: vertical;
123
+ }
124
+
125
+ ::view-transition-new(vaadin-mdl-detail.vertical),
126
+ ::view-transition-old(vaadin-mdl-detail.vertical) {
127
+ animation-name: vaadin-mdl-vertical-detail-slide-in;
128
+ }
129
+
130
+ ::view-transition-old(vaadin-mdl-detail.vertical) {
131
+ animation-direction: reverse;
132
+ }
133
+
134
+ @keyframes vaadin-mdl-vertical-detail-slide-in {
135
+ 0% {
136
+ transform: translateY(calc(100% + 30px));
137
+ }
138
+ }
139
+ }
140
+ `;
@@ -3,7 +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 { css, html, LitElement, nothing } from 'lit';
6
+ import { html, LitElement, nothing } from 'lit';
7
7
  import { getFocusableElements } from '@vaadin/a11y-base/src/focus-utils.js';
8
8
  import { defineCustomElement } from '@vaadin/component-base/src/define.js';
9
9
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
@@ -11,7 +11,8 @@ 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
13
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
14
- import { transitionStyles } from './vaadin-master-detail-layout-transition-styles.js';
14
+ import { masterDetailLayoutStyles } from './styles/vaadin-master-detail-layout-core-styles.js';
15
+ import { masterDetailLayoutTransitionStyles } from './styles/vaadin-master-detail-layout-transition-core-styles.js';
15
16
 
16
17
  /**
17
18
  * `<vaadin-master-detail-layout>` is a web component for building UIs with a master
@@ -56,158 +57,7 @@ class MasterDetailLayout extends SlotStylesMixin(ResizeMixin(ElementMixin(Themab
56
57
  }
57
58
 
58
59
  static get styles() {
59
- return css`
60
- /* Layout and positioning styles */
61
-
62
- :host {
63
- display: flex;
64
- box-sizing: border-box;
65
- height: 100%;
66
- max-width: 100%;
67
- max-height: 100%;
68
- position: relative; /* Keep the positioning context stable across all modes */
69
- overflow: hidden;
70
- }
71
-
72
- :host([hidden]) {
73
- display: none !important;
74
- }
75
-
76
- :host([orientation='vertical']) {
77
- flex-direction: column;
78
- }
79
-
80
- [part='_detail-internal'] {
81
- display: contents;
82
- justify-content: end;
83
- }
84
-
85
- :host([orientation='vertical']) [part='_detail-internal'] {
86
- align-items: end;
87
- }
88
-
89
- :host(:is([drawer], [stack])) [part='_detail-internal'],
90
- :host(:is([drawer], [stack])[has-detail]) [part='backdrop'] {
91
- display: flex;
92
- position: absolute;
93
- z-index: 1;
94
- inset: 0;
95
- overscroll-behavior: contain;
96
- }
97
-
98
- :host(:not([has-detail])) [part='_detail-internal'],
99
- [part='backdrop'] {
100
- display: none;
101
- }
102
-
103
- :host([orientation='horizontal'][drawer]) [part='detail'] {
104
- margin-inline-start: 50px;
105
- }
106
-
107
- :host([orientation='vertical'][drawer]) [part='detail'] {
108
- margin-top: 50px;
109
- }
110
-
111
- :host(:is([drawer], [stack])[containment='viewport']) :is([part='_detail-internal'], [part='backdrop']) {
112
- position: fixed;
113
- }
114
-
115
- /* Sizing styles */
116
-
117
- [part] {
118
- box-sizing: border-box;
119
- max-width: 100%;
120
- max-height: 100%;
121
- }
122
-
123
- /* No fixed size */
124
- :host(:not([has-master-size])) [part='master'],
125
- :host(:not([has-detail-size]):not([drawer], [stack])) [part='detail'] {
126
- flex-grow: 1;
127
- flex-basis: 50%;
128
- }
129
-
130
- /* Fixed size */
131
- :host([has-master-size]) [part='master'],
132
- :host([has-detail-size]) [part='detail'] {
133
- flex-shrink: 0;
134
- }
135
-
136
- :host([orientation='horizontal'][has-master-size][has-detail]) [part='master'] {
137
- width: var(--_master-size);
138
- }
139
-
140
- :host([orientation='vertical'][has-master-size][has-detail]) [part='master'] {
141
- height: var(--_master-size);
142
- }
143
-
144
- :host([orientation='horizontal'][has-detail-size]:not([stack])) [part='detail'] {
145
- width: var(--_detail-size);
146
- }
147
-
148
- :host([orientation='vertical'][has-detail-size]:not([stack])) [part='detail'] {
149
- height: var(--_detail-size);
150
- }
151
-
152
- :host([has-master-size][has-detail-size]) [part='master'] {
153
- flex-grow: 1;
154
- flex-basis: var(--_master-size);
155
- }
156
-
157
- :host([has-master-size][has-detail-size]:not([drawer], [stack])) [part='detail'] {
158
- flex-grow: 1;
159
- flex-basis: var(--_detail-size);
160
- }
161
-
162
- /* Min size */
163
- :host([orientation='horizontal'][has-master-min-size]) [part='master'] {
164
- min-width: min(100%, var(--_master-min-size));
165
- }
166
-
167
- :host([orientation='vertical'][has-master-min-size]) [part='master'] {
168
- min-height: min(100%, var(--_master-min-size));
169
- }
170
-
171
- :host([orientation='horizontal'][has-detail-min-size]) [part='detail'] {
172
- min-width: min(100%, var(--_detail-min-size));
173
- }
174
-
175
- :host([orientation='vertical'][has-detail-min-size]) [part='detail'] {
176
- min-height: min(100%, var(--_detail-min-size));
177
- }
178
-
179
- :host([drawer]) [part='master'],
180
- :host([stack]) [part] {
181
- width: 100% !important;
182
- height: 100% !important;
183
- min-width: auto !important;
184
- min-height: auto !important;
185
- max-width: 100% !important;
186
- max-height: 100% !important;
187
- }
188
-
189
- /* Decorative/visual styles */
190
-
191
- [part='backdrop'] {
192
- background-color: rgba(0, 0, 0, 0.2);
193
- }
194
-
195
- [part='detail'] {
196
- background: #fff;
197
- }
198
-
199
- :host(:is([drawer], [stack])) [part='detail'] {
200
- box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.3);
201
- }
202
-
203
- :host([orientation='horizontal']:not([drawer], [stack])) [part='detail'] {
204
- border-inline-start: 1px solid rgba(0, 0, 0, 0.1);
205
- }
206
-
207
- :host([orientation='vertical']:not([drawer], [stack])) [part='detail'] {
208
- border-top: 1px solid rgba(0, 0, 0, 0.1);
209
- }
210
- `;
60
+ return masterDetailLayoutStyles;
211
61
  }
212
62
 
213
63
  static get properties() {
@@ -385,7 +235,7 @@ class MasterDetailLayout extends SlotStylesMixin(ResizeMixin(ElementMixin(Themab
385
235
 
386
236
  /** @override */
387
237
  get slotStyles() {
388
- return [transitionStyles];
238
+ return [masterDetailLayoutTransitionStyles];
389
239
  }
390
240
 
391
241
  /** @protected */
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": "24.8.4",
4
+ "version": "25.0.0-alpha10",
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": "24.8.4",
4
+ "version": "25.0.0-alpha10",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -1,3 +0,0 @@
1
- import '@vaadin/vaadin-material-styles/color.js';
2
- import '@vaadin/vaadin-material-styles/shadow.js';
3
- import '@vaadin/vaadin-material-styles/style.js';
@@ -1,30 +0,0 @@
1
- import '@vaadin/vaadin-material-styles/color.js';
2
- import '@vaadin/vaadin-material-styles/shadow.js';
3
- import '@vaadin/vaadin-material-styles/style.js';
4
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
5
-
6
- registerStyles(
7
- 'vaadin-master-detail-layout',
8
- css`
9
- :host(:is([drawer], [stack])) [part='detail'] {
10
- background-color: var(--material-background-color);
11
- box-shadow:
12
- 0 0 0 1px var(--material-divider-color),
13
- var(--material-shadow-elevation-4dp);
14
- }
15
-
16
- :host([orientation='horizontal']:not([drawer], [stack])) [part='detail'] {
17
- border-inline-start: 1px solid var(--material-divider-color);
18
- }
19
-
20
- :host([orientation='vertical']:not([drawer], [stack])) [part='detail'] {
21
- border-top: 1px solid var(--material-divider-color);
22
- }
23
-
24
- [part='backdrop'] {
25
- background-color: var(--material-secondary-background-color);
26
- opacity: 0.5;
27
- }
28
- `,
29
- { moduleId: 'material-master-detail-layout' },
30
- );
@@ -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';