@vaadin/dialog 25.0.0-alpha4 → 25.0.0-alpha5

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-alpha4",
3
+ "version": "25.0.0-alpha5",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -23,6 +23,8 @@
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",
26
28
  "theme",
27
29
  "vaadin-*.d.ts",
28
30
  "vaadin-*.js",
@@ -37,17 +39,17 @@
37
39
  ],
38
40
  "dependencies": {
39
41
  "@open-wc/dedupe-mixin": "^1.3.0",
40
- "@vaadin/component-base": "25.0.0-alpha4",
41
- "@vaadin/lit-renderer": "25.0.0-alpha4",
42
- "@vaadin/overlay": "25.0.0-alpha4",
43
- "@vaadin/vaadin-lumo-styles": "25.0.0-alpha4",
44
- "@vaadin/vaadin-themable-mixin": "25.0.0-alpha4",
42
+ "@vaadin/component-base": "25.0.0-alpha5",
43
+ "@vaadin/lit-renderer": "25.0.0-alpha5",
44
+ "@vaadin/overlay": "25.0.0-alpha5",
45
+ "@vaadin/vaadin-lumo-styles": "25.0.0-alpha5",
46
+ "@vaadin/vaadin-themable-mixin": "25.0.0-alpha5",
45
47
  "lit": "^3.0.0"
46
48
  },
47
49
  "devDependencies": {
48
- "@vaadin/a11y-base": "25.0.0-alpha4",
49
- "@vaadin/chai-plugins": "25.0.0-alpha4",
50
- "@vaadin/test-runner-commands": "25.0.0-alpha4",
50
+ "@vaadin/a11y-base": "25.0.0-alpha5",
51
+ "@vaadin/chai-plugins": "25.0.0-alpha5",
52
+ "@vaadin/test-runner-commands": "25.0.0-alpha5",
51
53
  "@vaadin/testing-helpers": "^2.0.0",
52
54
  "sinon": "^18.0.0"
53
55
  },
@@ -55,5 +57,5 @@
55
57
  "web-types.json",
56
58
  "web-types.lit.json"
57
59
  ],
58
- "gitHead": "ce4421f0daf26027b863b91787a474e4cc264344"
60
+ "gitHead": "7dc87bb2a3cae81ed53259fa10b58f990d50c6fd"
59
61
  }
@@ -0,0 +1,10 @@
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 type { CSSResult } from 'lit';
7
+
8
+ export const dialogOverlayBase: CSSResult;
9
+
10
+ export const dialogOverlayStyles: CSSResult;
@@ -0,0 +1,216 @@
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 '@vaadin/component-base/src/style-props.js';
7
+ import { css } from 'lit';
8
+ import { overlayStyles } from '@vaadin/overlay/src/styles/vaadin-overlay-base-styles.js';
9
+
10
+ export const dialogOverlayBase = css`
11
+ @layer base {
12
+ /* Optical centering */
13
+ :host::before,
14
+ :host::after {
15
+ content: '';
16
+ flex-basis: 0;
17
+ flex-grow: 1;
18
+ }
19
+
20
+ :host::after {
21
+ flex-grow: 1.1;
22
+ }
23
+
24
+ :host {
25
+ cursor: default;
26
+ }
27
+
28
+ [part='overlay']:focus-visible {
29
+ outline: var(--vaadin-focus-ring-width) solid var(--vaadin-focus-ring-color);
30
+ }
31
+
32
+ [part='overlay'] {
33
+ background: var(--vaadin-dialog-background, var(--_vaadin-background));
34
+ background-origin: border-box;
35
+ border: 0;
36
+ box-shadow:
37
+ 0 0 0 var(--vaadin-dialog-border-width, 1px) var(--vaadin-dialog-border-color, rgba(0, 0, 0, 0.1)),
38
+ var(--vaadin-dialog-box-shadow, 0 8px 24px -4px hsl(0 0 0 / 0.3));
39
+ border-radius: var(--vaadin-dialog-border-radius, var(--_vaadin-radius-l));
40
+ width: max-content;
41
+ min-width: min(var(--vaadin-dialog-min-width, 4em), 100%);
42
+ max-width: var(--vaadin-dialog-max-width, 100%);
43
+ max-height: 100%;
44
+ }
45
+
46
+ [part='header'],
47
+ [part='header-content'],
48
+ [part='footer'] {
49
+ display: flex;
50
+ align-items: center;
51
+ flex-wrap: wrap;
52
+ flex: none;
53
+ pointer-events: none;
54
+ z-index: 1;
55
+ gap: var(--vaadin-dialog-toolbar-gap, var(--_vaadin-gap-container-inline));
56
+ }
57
+
58
+ ::slotted(*) {
59
+ pointer-events: auto;
60
+ }
61
+
62
+ [part='header'],
63
+ [part='content'],
64
+ [part='footer'] {
65
+ padding: var(--vaadin-dialog-padding, var(--_vaadin-padding));
66
+ }
67
+
68
+ :host(:is([has-header], [has-title])) [part='content'] {
69
+ padding-top: 0;
70
+ }
71
+
72
+ :host([has-footer]) [part='content'] {
73
+ padding-bottom: 0;
74
+ }
75
+
76
+ [part='header'] {
77
+ flex-wrap: nowrap;
78
+ }
79
+
80
+ ::slotted([slot='header-content']),
81
+ ::slotted([slot='title']),
82
+ ::slotted([slot='footer']) {
83
+ display: contents;
84
+ }
85
+
86
+ ::slotted([slot='title']) {
87
+ font: inherit !important;
88
+ color: inherit !important;
89
+ overflow-wrap: anywhere;
90
+ }
91
+
92
+ [part='title'] {
93
+ color: var(--vaadin-dialog-title-color, var(--_vaadin-color-strong));
94
+ font-weight: var(--vaadin-dialog-title-font-weight, 600);
95
+ font-size: var(--vaadin-dialog-title-font-size, 1em);
96
+ line-height: var(--vaadin-dialog-title-line-height, inherit);
97
+ }
98
+
99
+ [part='header-content'] {
100
+ flex: 1;
101
+ }
102
+
103
+ :host([has-title]) [part='header-content'],
104
+ [part='footer'] {
105
+ justify-content: flex-end;
106
+ }
107
+
108
+ :host(:not([has-title]):not([has-header])) [part='header'],
109
+ :host(:not([has-header])) [part='header-content'],
110
+ :host(:not([has-title])) [part='title'],
111
+ :host(:not([has-footer])) [part='footer'] {
112
+ display: none !important;
113
+ }
114
+ }
115
+ `;
116
+
117
+ const dialogResizableOverlay = css`
118
+ @layer base {
119
+ [part='overlay'] {
120
+ position: relative;
121
+ overflow: visible;
122
+ display: flex;
123
+ }
124
+
125
+ :host([has-bounds-set]) [part='overlay'] {
126
+ min-width: 0;
127
+ max-width: none;
128
+ max-height: none;
129
+ }
130
+
131
+ /* Content part scrolls by default */
132
+ [part='content'] {
133
+ flex: 1;
134
+ min-height: 0;
135
+ }
136
+
137
+ :host([overflow]) [part='content'] {
138
+ overflow: auto;
139
+ overscroll-behavior: contain;
140
+ }
141
+
142
+ .resizer-container {
143
+ display: flex;
144
+ flex-direction: column;
145
+ flex-grow: 1;
146
+ border-radius: inherit;
147
+ max-width: 100%;
148
+ }
149
+
150
+ :host(:not([resizable])) .resizer {
151
+ display: none;
152
+ }
153
+
154
+ .resizer {
155
+ position: absolute;
156
+ height: 16px;
157
+ width: 16px;
158
+ }
159
+
160
+ .resizer.edge {
161
+ height: 8px;
162
+ width: 8px;
163
+ inset: -4px;
164
+ }
165
+
166
+ .resizer.edge.n {
167
+ width: auto;
168
+ bottom: auto;
169
+ cursor: ns-resize;
170
+ }
171
+
172
+ .resizer.ne {
173
+ top: -4px;
174
+ right: -4px;
175
+ cursor: nesw-resize;
176
+ }
177
+
178
+ .resizer.edge.e {
179
+ height: auto;
180
+ left: auto;
181
+ cursor: ew-resize;
182
+ }
183
+
184
+ .resizer.se {
185
+ bottom: -4px;
186
+ right: -4px;
187
+ cursor: nwse-resize;
188
+ }
189
+
190
+ .resizer.edge.s {
191
+ width: auto;
192
+ top: auto;
193
+ cursor: ns-resize;
194
+ }
195
+
196
+ .resizer.sw {
197
+ bottom: -4px;
198
+ left: -4px;
199
+ cursor: nesw-resize;
200
+ }
201
+
202
+ .resizer.edge.w {
203
+ height: auto;
204
+ right: auto;
205
+ cursor: ew-resize;
206
+ }
207
+
208
+ .resizer.nw {
209
+ top: -4px;
210
+ left: -4px;
211
+ cursor: nwse-resize;
212
+ }
213
+ }
214
+ `;
215
+
216
+ export const dialogOverlayStyles = [overlayStyles, dialogOverlayBase, dialogResizableOverlay];
@@ -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 { CSSInjectionMixin } from '@vaadin/vaadin-themable-mixin/css-injection-mixin.js';
11
11
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
12
- import { dialogOverlayStyles } from './styles/vaadin-dialog-overlay-styles.js';
12
+ import { dialogOverlayStyles } from './styles/vaadin-dialog-overlay-core-styles.js';
13
13
  import { DialogOverlayMixin } from './vaadin-dialog-overlay-mixin.js';
14
14
 
15
15
  /**
@@ -72,10 +72,7 @@ export const DialogResizableMixin = (superClass) =>
72
72
  window.addEventListener('touchmove', this._resizeListeners.resize[direction]);
73
73
  window.addEventListener('mouseup', this._resizeListeners.stop[direction]);
74
74
  window.addEventListener('touchend', this._resizeListeners.stop[direction]);
75
- if (this.$.overlay.$.overlay.style.position !== 'absolute' || this.width || this.height) {
76
- this.$.overlay.setBounds(this._originalBounds);
77
- }
78
-
75
+ this.$.overlay.setBounds(this._originalBounds);
79
76
  this.$.overlay.setAttribute('has-bounds-set', '');
80
77
  }
81
78
  }
package/web-types.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/web-types",
3
3
  "name": "@vaadin/dialog",
4
- "version": "25.0.0-alpha4",
4
+ "version": "25.0.0-alpha5",
5
5
  "description-markup": "markdown",
6
6
  "contributions": {
7
7
  "html": {
8
8
  "elements": [
9
9
  {
10
10
  "name": "vaadin-dialog",
11
- "description": "`<vaadin-dialog>` is a Web Component for creating customized modal dialogs.\n\n### Rendering\n\nThe content of the dialog can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `dialog` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `dialog`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\n```html\n<vaadin-dialog id=\"dialog\"></vaadin-dialog>\n```\n```js\nconst dialog = document.querySelector('#dialog');\ndialog.renderer = function(root, dialog) {\n root.textContent = \"Sample dialog\";\n};\n```\n\nRenderer is called on the opening of the dialog.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\n`<vaadin-dialog>` uses `<vaadin-dialog-overlay>` internal\nthemable component as the actual visible dialog overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha4/#/elements/vaadin-overlay) documentation.\nfor `<vaadin-dialog-overlay>` parts.\n\nIn addition to `<vaadin-overlay>` parts, the following parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`header` | Element wrapping title and header content\n`header-content` | Element wrapping the header content slot\n`title` | Element wrapping the title slot\n`footer` | Element wrapping the footer slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|--------------------------------------------\n`has-title` | Set when the element has a title\n`has-header` | Set when the element has header renderer\n`has-footer` | Set when the element has footer renderer\n`overflow` | Set to `top`, `bottom`, none or both\n\nNote: the `theme` attribute value set on `<vaadin-dialog>` is\npropagated to the internal `<vaadin-dialog-overlay>` component.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
11
+ "description": "`<vaadin-dialog>` is a Web Component for creating customized modal dialogs.\n\n### Rendering\n\nThe content of the dialog can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `dialog` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `dialog`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\n```html\n<vaadin-dialog id=\"dialog\"></vaadin-dialog>\n```\n```js\nconst dialog = document.querySelector('#dialog');\ndialog.renderer = function(root, dialog) {\n root.textContent = \"Sample dialog\";\n};\n```\n\nRenderer is called on the opening of the dialog.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\n`<vaadin-dialog>` uses `<vaadin-dialog-overlay>` internal\nthemable component as the actual visible dialog overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha5/#/elements/vaadin-overlay) documentation.\nfor `<vaadin-dialog-overlay>` parts.\n\nIn addition to `<vaadin-overlay>` parts, the following parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`header` | Element wrapping title and header content\n`header-content` | Element wrapping the header content slot\n`title` | Element wrapping the title slot\n`footer` | Element wrapping the footer slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|--------------------------------------------\n`has-title` | Set when the element has a title\n`has-header` | Set when the element has header renderer\n`has-footer` | Set when the element has footer renderer\n`overflow` | Set to `top`, `bottom`, none or both\n\nNote: the `theme` attribute value set on `<vaadin-dialog>` is\npropagated to the internal `<vaadin-dialog-overlay>` component.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
12
12
  "attributes": [
13
13
  {
14
14
  "name": "opened",
@@ -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-alpha4",
4
+ "version": "25.0.0-alpha5",
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-dialog",
19
- "description": "`<vaadin-dialog>` is a Web Component for creating customized modal dialogs.\n\n### Rendering\n\nThe content of the dialog can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `dialog` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `dialog`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\n```html\n<vaadin-dialog id=\"dialog\"></vaadin-dialog>\n```\n```js\nconst dialog = document.querySelector('#dialog');\ndialog.renderer = function(root, dialog) {\n root.textContent = \"Sample dialog\";\n};\n```\n\nRenderer is called on the opening of the dialog.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\n`<vaadin-dialog>` uses `<vaadin-dialog-overlay>` internal\nthemable component as the actual visible dialog overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha4/#/elements/vaadin-overlay) documentation.\nfor `<vaadin-dialog-overlay>` parts.\n\nIn addition to `<vaadin-overlay>` parts, the following parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`header` | Element wrapping title and header content\n`header-content` | Element wrapping the header content slot\n`title` | Element wrapping the title slot\n`footer` | Element wrapping the footer slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|--------------------------------------------\n`has-title` | Set when the element has a title\n`has-header` | Set when the element has header renderer\n`has-footer` | Set when the element has footer renderer\n`overflow` | Set to `top`, `bottom`, none or both\n\nNote: the `theme` attribute value set on `<vaadin-dialog>` is\npropagated to the internal `<vaadin-dialog-overlay>` component.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
19
+ "description": "`<vaadin-dialog>` is a Web Component for creating customized modal dialogs.\n\n### Rendering\n\nThe content of the dialog can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `dialog` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `dialog`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\n```html\n<vaadin-dialog id=\"dialog\"></vaadin-dialog>\n```\n```js\nconst dialog = document.querySelector('#dialog');\ndialog.renderer = function(root, dialog) {\n root.textContent = \"Sample dialog\";\n};\n```\n\nRenderer is called on the opening of the dialog.\nDOM generated during the renderer call can be reused\nin the next renderer call and will be provided with the `root` argument.\nOn first call it will be empty.\n\n### Styling\n\n`<vaadin-dialog>` uses `<vaadin-dialog-overlay>` internal\nthemable component as the actual visible dialog overlay.\n\nSee [`<vaadin-overlay>`](https://cdn.vaadin.com/vaadin-web-components/25.0.0-alpha5/#/elements/vaadin-overlay) documentation.\nfor `<vaadin-dialog-overlay>` parts.\n\nIn addition to `<vaadin-overlay>` parts, the following parts are available for styling:\n\nPart name | Description\n-----------------|-------------------------------------------\n`header` | Element wrapping title and header content\n`header-content` | Element wrapping the header content slot\n`title` | Element wrapping the title slot\n`footer` | Element wrapping the footer slot\n\nThe following state attributes are available for styling:\n\nAttribute | Description\n-----------------|--------------------------------------------\n`has-title` | Set when the element has a title\n`has-header` | Set when the element has header renderer\n`has-footer` | Set when the element has footer renderer\n`overflow` | Set to `top`, `bottom`, none or both\n\nNote: the `theme` attribute value set on `<vaadin-dialog>` is\npropagated to the internal `<vaadin-dialog-overlay>` component.\n\nSee [Styling Components](https://vaadin.com/docs/latest/styling/styling-components) documentation.",
20
20
  "extension": true,
21
21
  "attributes": [
22
22
  {