@vaadin/dialog 25.0.0-alpha10 → 25.0.0-alpha11

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/dialog",
3
- "version": "25.0.0-alpha10",
3
+ "version": "25.0.0-alpha11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -23,9 +23,6 @@
23
23
  "lit.d.ts",
24
24
  "lit.js",
25
25
  "src",
26
- "!src/styles/*-base-styles.d.ts",
27
- "!src/styles/*-base-styles.js",
28
- "theme",
29
26
  "vaadin-*.d.ts",
30
27
  "vaadin-*.js",
31
28
  "web-types.json",
@@ -39,23 +36,23 @@
39
36
  ],
40
37
  "dependencies": {
41
38
  "@open-wc/dedupe-mixin": "^1.3.0",
42
- "@vaadin/component-base": "25.0.0-alpha10",
43
- "@vaadin/lit-renderer": "25.0.0-alpha10",
44
- "@vaadin/overlay": "25.0.0-alpha10",
45
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha10",
46
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha10",
39
+ "@vaadin/component-base": "25.0.0-alpha11",
40
+ "@vaadin/lit-renderer": "25.0.0-alpha11",
41
+ "@vaadin/overlay": "25.0.0-alpha11",
42
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha11",
47
43
  "lit": "^3.0.0"
48
44
  },
49
45
  "devDependencies": {
50
- "@vaadin/a11y-base": "25.0.0-alpha10",
51
- "@vaadin/chai-plugins": "25.0.0-alpha10",
52
- "@vaadin/test-runner-commands": "25.0.0-alpha10",
46
+ "@vaadin/a11y-base": "25.0.0-alpha11",
47
+ "@vaadin/chai-plugins": "25.0.0-alpha11",
48
+ "@vaadin/test-runner-commands": "25.0.0-alpha11",
53
49
  "@vaadin/testing-helpers": "^2.0.0",
50
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha11",
54
51
  "sinon": "^18.0.0"
55
52
  },
56
53
  "web-types": [
57
54
  "web-types.json",
58
55
  "web-types.lit.json"
59
56
  ],
60
- "gitHead": "6cc6c94079e805fa5b2f0af4dbf3b2a7485e57d0"
57
+ "gitHead": "abfd315ba5a7484a613e0768635a4e8fe945a44b"
61
58
  }
@@ -3,7 +3,7 @@
3
3
  * Copyright (c) 2017 - 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
  import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-base-styles.js';
9
9
 
@@ -36,6 +36,7 @@ export declare class DialogBaseMixinClass {
36
36
  * The `role` attribute value to be set on the dialog. Defaults to "dialog".
37
37
  *
38
38
  * @attr {string} overlay-role
39
+ * @deprecated Use standard `role` attribute on the dialog instead
39
40
  */
40
41
  overlayRole: string;
41
42
 
@@ -80,6 +80,7 @@ export const DialogBaseMixin = (superClass) =>
80
80
  * The `role` attribute value to be set on the dialog. Defaults to "dialog".
81
81
  *
82
82
  * @attr {string} overlay-role
83
+ * @deprecated Use standard `role` attribute on the dialog instead
83
84
  */
84
85
  overlayRole: {
85
86
  type: String,
@@ -68,7 +68,9 @@ export const DialogOverlayMixin = (superClass) =>
68
68
 
69
69
  // Update overflow attribute on resize
70
70
  this.__resizeObserver = new ResizeObserver(() => {
71
- this.__updateOverflow();
71
+ requestAnimationFrame(() => {
72
+ this.__updateOverflow();
73
+ });
72
74
  });
73
75
  this.__resizeObserver.observe(this.$.resizerContainer);
74
76
 
@@ -76,6 +78,11 @@ export const DialogOverlayMixin = (superClass) =>
76
78
  this.$.content.addEventListener('scroll', () => {
77
79
  this.__updateOverflow();
78
80
  });
81
+
82
+ // Update overflow attribute on content change
83
+ this.shadowRoot.addEventListener('slotchange', () => {
84
+ this.__updateOverflow();
85
+ });
79
86
  }
80
87
 
81
88
  /** @private */
@@ -230,18 +237,14 @@ export const DialogOverlayMixin = (superClass) =>
230
237
  __updateOverflow() {
231
238
  let overflow = '';
232
239
 
233
- // Only set "overflow" attribute if the dialog has a header, title or footer.
234
- // Check for state attributes as extending components might not use renderers.
235
- if (this.hasAttribute('has-header') || this.hasAttribute('has-footer') || this.headerTitle) {
236
- const content = this.$.content;
240
+ const content = this.$.content;
237
241
 
238
- if (content.scrollTop > 0) {
239
- overflow += ' top';
240
- }
242
+ if (content.scrollTop > 0) {
243
+ overflow += ' top';
244
+ }
241
245
 
242
- if (content.scrollTop < content.scrollHeight - content.clientHeight) {
243
- overflow += ' bottom';
244
- }
246
+ if (content.scrollTop < content.scrollHeight - content.clientHeight) {
247
+ overflow += ' bottom';
245
248
  }
246
249
 
247
250
  const value = overflow.trim();
@@ -9,7 +9,7 @@ import { DirMixin } from '@vaadin/component-base/src/dir-mixin.js';
9
9
  import { PolylitMixin } from '@vaadin/component-base/src/polylit-mixin.js';
10
10
  import { LumoInjectionMixin } from '@vaadin/vaadin-themable-mixin/lumo-injection-mixin.js';
11
11
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
- import { dialogOverlayStyles } from './styles/vaadin-dialog-overlay-core-styles.js';
12
+ import { dialogOverlayStyles } from './styles/vaadin-dialog-overlay-base-styles.js';
13
13
  import { DialogOverlayMixin } from './vaadin-dialog-overlay-mixin.js';
14
14
 
15
15
  /**
package/vaadin-dialog.js CHANGED
@@ -1,2 +1,2 @@
1
- import './theme/lumo/vaadin-dialog.js';
1
+ import './src/vaadin-dialog.js';
2
2
  export * from './src/vaadin-dialog.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/dialog",
4
- "version": "25.0.0-alpha10",
4
+ "version": "25.0.0-alpha11",
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/dialog",
4
- "version": "25.0.0-alpha10",
4
+ "version": "25.0.0-alpha11",
5
5
  "description-markup": "markdown",
6
6
  "framework": "lit",
7
7
  "framework-config": {
@@ -1,10 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2021 - 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 dialogOverlayBase: CSSResult;
9
-
10
- export const dialogOverlayStyles: CSSResult;
@@ -1,184 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright (c) 2017 - 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
- import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-core-styles.js';
8
-
9
- export const dialogOverlayBase = css`
10
- [part='header'],
11
- [part='header-content'],
12
- [part='footer'] {
13
- display: flex;
14
- align-items: center;
15
- flex-wrap: wrap;
16
- flex: none;
17
- pointer-events: none;
18
- z-index: 1;
19
- }
20
-
21
- [part='header'] {
22
- flex-wrap: nowrap;
23
- }
24
-
25
- ::slotted([slot='header-content']),
26
- ::slotted([slot='title']),
27
- ::slotted([slot='footer']) {
28
- display: contents;
29
- pointer-events: auto;
30
- }
31
-
32
- ::slotted([slot='title']) {
33
- font: inherit !important;
34
- overflow-wrap: anywhere;
35
- }
36
-
37
- [part='header-content'] {
38
- flex: 1;
39
- }
40
-
41
- :host([has-title]) [part='header-content'],
42
- [part='footer'] {
43
- justify-content: flex-end;
44
- }
45
-
46
- :host(:not([has-title]):not([has-header])) [part='header'],
47
- :host(:not([has-header])) [part='header-content'],
48
- :host(:not([has-title])) [part='title'],
49
- :host(:not([has-footer])) [part='footer'] {
50
- display: none !important;
51
- }
52
-
53
- :host(:is([has-title], [has-header], [has-footer])) [part='content'] {
54
- height: auto;
55
- }
56
-
57
- @media (min-height: 320px) {
58
- :host(:is([has-title], [has-header], [has-footer])) .resizer-container {
59
- overflow: hidden;
60
- display: flex;
61
- flex-direction: column;
62
- }
63
-
64
- :host(:is([has-title], [has-header], [has-footer])) [part='content'] {
65
- flex: 1;
66
- overflow: auto;
67
- }
68
- }
69
-
70
- /*
71
- NOTE(platosha): Make some min-width to prevent collapsing of the content
72
- taking the parent width, e. g., <vaadin-grid> and such.
73
- */
74
- [part='content'] {
75
- min-width: 12em; /* matches the default <vaadin-text-field> width */
76
- }
77
-
78
- :host([has-bounds-set]) [part='overlay'] {
79
- max-width: none;
80
- }
81
-
82
- @media (forced-colors: active) {
83
- [part='overlay'] {
84
- outline: 3px solid !important;
85
- }
86
- }
87
- `;
88
-
89
- const dialogResizableOverlay = css`
90
- [part='overlay'] {
91
- position: relative;
92
- overflow: visible;
93
- max-height: 100%;
94
- display: flex;
95
- }
96
-
97
- [part='content'] {
98
- box-sizing: border-box;
99
- height: 100%;
100
- }
101
-
102
- .resizer-container {
103
- overflow: auto;
104
- flex-grow: 1;
105
- border-radius: inherit; /* prevent child elements being drawn outside part=overlay */
106
- }
107
-
108
- [part='overlay'][style] .resizer-container {
109
- min-height: 100%;
110
- width: 100%;
111
- }
112
-
113
- :host(:not([resizable])) .resizer {
114
- display: none;
115
- }
116
-
117
- :host([resizable]) [part='title'] {
118
- cursor: move;
119
- -webkit-user-select: none;
120
- user-select: none;
121
- }
122
-
123
- .resizer {
124
- position: absolute;
125
- height: 16px;
126
- width: 16px;
127
- }
128
-
129
- .resizer.edge {
130
- height: 8px;
131
- width: 8px;
132
- inset: -4px;
133
- }
134
-
135
- .resizer.edge.n {
136
- width: auto;
137
- bottom: auto;
138
- cursor: ns-resize;
139
- }
140
-
141
- .resizer.ne {
142
- top: -4px;
143
- right: -4px;
144
- cursor: nesw-resize;
145
- }
146
-
147
- .resizer.edge.e {
148
- height: auto;
149
- left: auto;
150
- cursor: ew-resize;
151
- }
152
-
153
- .resizer.se {
154
- bottom: -4px;
155
- right: -4px;
156
- cursor: nwse-resize;
157
- }
158
-
159
- .resizer.edge.s {
160
- width: auto;
161
- top: auto;
162
- cursor: ns-resize;
163
- }
164
-
165
- .resizer.sw {
166
- bottom: -4px;
167
- left: -4px;
168
- cursor: nesw-resize;
169
- }
170
-
171
- .resizer.edge.w {
172
- height: auto;
173
- right: auto;
174
- cursor: ew-resize;
175
- }
176
-
177
- .resizer.nw {
178
- top: -4px;
179
- left: -4px;
180
- cursor: nwse-resize;
181
- }
182
- `;
183
-
184
- export const dialogOverlayStyles = [overlayStyles, dialogOverlayBase, dialogResizableOverlay];
@@ -1,3 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/spacing.js';
2
- declare const dialogOverlay: import("lit").CSSResult;
3
- export { dialogOverlay };
@@ -1,109 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/spacing.js';
2
- import { overlay } from '@vaadin/vaadin-lumo-styles/mixins/overlay.js';
3
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
4
-
5
- const dialogOverlay = css`
6
- /* Optical centering */
7
- :host::before,
8
- :host::after {
9
- content: '';
10
- flex-basis: 0;
11
- flex-grow: 1;
12
- }
13
-
14
- :host::after {
15
- flex-grow: 1.1;
16
- }
17
-
18
- [part='overlay'] {
19
- border-radius: var(--lumo-border-radius-l);
20
- box-shadow:
21
- 0 0 0 1px var(--lumo-shade-5pct),
22
- var(--lumo-box-shadow-xl);
23
- background-image: none;
24
- outline: none;
25
- -webkit-tap-highlight-color: transparent;
26
- }
27
-
28
- [part='content'] {
29
- padding: var(--lumo-space-l);
30
- }
31
-
32
- :host(:is([has-header], [has-title])) [part='header'] + [part='content'] {
33
- padding-top: 0;
34
- }
35
-
36
- [part='header'],
37
- [part='header-content'],
38
- [part='footer'] {
39
- gap: var(--lumo-space-xs) var(--lumo-space-s);
40
- line-height: var(--lumo-line-height-s);
41
- }
42
-
43
- [part='header'] {
44
- padding: var(--lumo-space-m);
45
- background-color: var(--lumo-base-color);
46
- border-radius: var(--lumo-border-radius-l) var(--lumo-border-radius-l) 0 0; /* Needed for Safari */
47
- }
48
-
49
- [part='footer'] {
50
- padding: var(--lumo-space-s) var(--lumo-space-m);
51
- background-color: var(--lumo-contrast-5pct);
52
- border-radius: 0 0 var(--lumo-border-radius-l) var(--lumo-border-radius-l); /* Needed for Safari */
53
- }
54
-
55
- [part='title'] {
56
- font-size: var(--lumo-font-size-xl);
57
- font-weight: 600;
58
- color: var(--lumo-header-text-color);
59
- margin-inline-start: calc(var(--lumo-space-l) - var(--lumo-space-m));
60
- }
61
-
62
- /* No padding */
63
- :host([theme~='no-padding']) [part='content'] {
64
- padding: 0 !important;
65
- }
66
-
67
- @media (min-height: 320px) {
68
- :host([overflow~='top']) [part='header'] {
69
- box-shadow: 0 1px 0 0 var(--lumo-contrast-10pct);
70
- }
71
- }
72
-
73
- /* Animations */
74
-
75
- :host([opening]),
76
- :host([closing]) {
77
- animation: 0.25s lumo-overlay-dummy-animation;
78
- }
79
-
80
- :host([opening]) [part='overlay'] {
81
- animation: 0.12s 0.05s vaadin-dialog-enter cubic-bezier(0.215, 0.61, 0.355, 1) both;
82
- }
83
-
84
- @keyframes vaadin-dialog-enter {
85
- 0% {
86
- opacity: 0;
87
- transform: scale(0.95);
88
- }
89
- }
90
-
91
- :host([closing]) [part='overlay'] {
92
- animation: 0.1s 0.03s vaadin-dialog-exit cubic-bezier(0.55, 0.055, 0.675, 0.19) both;
93
- }
94
-
95
- :host([closing]) [part='backdrop'] {
96
- animation-delay: 0.05s;
97
- }
98
-
99
- @keyframes vaadin-dialog-exit {
100
- 100% {
101
- opacity: 0;
102
- transform: scale(1.02);
103
- }
104
- }
105
- `;
106
-
107
- registerStyles('vaadin-dialog-overlay', [overlay, dialogOverlay], { moduleId: 'lumo-dialog' });
108
-
109
- export { dialogOverlay };
@@ -1,2 +0,0 @@
1
- import './vaadin-dialog-styles.js';
2
- import '../../src/vaadin-dialog.js';
@@ -1,2 +0,0 @@
1
- import './vaadin-dialog-styles.js';
2
- import '../../src/vaadin-dialog.js';