@vaadin/dashboard 25.0.0-alpha2 → 25.0.0-alpha20

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.
Files changed (48) hide show
  1. package/package.json +10 -11
  2. package/src/styles/vaadin-dashboard-base-styles.d.ts +13 -0
  3. package/src/styles/vaadin-dashboard-base-styles.js +25 -0
  4. package/src/styles/vaadin-dashboard-button-base-styles.d.ts +13 -0
  5. package/src/styles/vaadin-dashboard-button-base-styles.js +24 -0
  6. package/src/styles/vaadin-dashboard-layout-base-styles.d.ts +13 -0
  7. package/src/styles/vaadin-dashboard-layout-base-styles.js +86 -0
  8. package/src/styles/vaadin-dashboard-section-base-styles.d.ts +13 -0
  9. package/src/styles/vaadin-dashboard-section-base-styles.js +64 -0
  10. package/src/styles/vaadin-dashboard-widget-base-styles.d.ts +13 -0
  11. package/src/styles/vaadin-dashboard-widget-base-styles.js +110 -0
  12. package/src/styles/vaadin-dashboard-widget-section-base-styles.js +294 -0
  13. package/src/vaadin-dashboard-button.js +4 -3
  14. package/src/vaadin-dashboard-item-mixin.js +8 -8
  15. package/src/vaadin-dashboard-layout-mixin.js +0 -78
  16. package/src/vaadin-dashboard-layout.js +15 -1
  17. package/src/vaadin-dashboard-section.js +13 -42
  18. package/src/vaadin-dashboard-widget.js +13 -46
  19. package/src/vaadin-dashboard.d.ts +1 -1
  20. package/src/vaadin-dashboard.js +12 -14
  21. package/src/widget-resize-controller.js +3 -1
  22. package/vaadin-dashboard-layout.js +1 -1
  23. package/vaadin-dashboard-section.js +1 -1
  24. package/vaadin-dashboard-widget.js +1 -1
  25. package/vaadin-dashboard.js +1 -1
  26. package/web-types.json +3 -3
  27. package/web-types.lit.json +3 -3
  28. package/src/vaadin-dashboard-styles.js +0 -157
  29. package/theme/lumo/vaadin-dashboard-button-styles.d.ts +0 -2
  30. package/theme/lumo/vaadin-dashboard-button-styles.js +0 -8
  31. package/theme/lumo/vaadin-dashboard-button.d.ts +0 -1
  32. package/theme/lumo/vaadin-dashboard-button.js +0 -1
  33. package/theme/lumo/vaadin-dashboard-layout-styles.d.ts +0 -1
  34. package/theme/lumo/vaadin-dashboard-layout-styles.js +0 -28
  35. package/theme/lumo/vaadin-dashboard-layout.d.ts +0 -2
  36. package/theme/lumo/vaadin-dashboard-layout.js +0 -2
  37. package/theme/lumo/vaadin-dashboard-section-styles.d.ts +0 -5
  38. package/theme/lumo/vaadin-dashboard-section-styles.js +0 -89
  39. package/theme/lumo/vaadin-dashboard-section.d.ts +0 -3
  40. package/theme/lumo/vaadin-dashboard-section.js +0 -3
  41. package/theme/lumo/vaadin-dashboard-styles.d.ts +0 -1
  42. package/theme/lumo/vaadin-dashboard-styles.js +0 -16
  43. package/theme/lumo/vaadin-dashboard-widget-styles.d.ts +0 -9
  44. package/theme/lumo/vaadin-dashboard-widget-styles.js +0 -334
  45. package/theme/lumo/vaadin-dashboard-widget.d.ts +0 -3
  46. package/theme/lumo/vaadin-dashboard-widget.js +0 -3
  47. package/theme/lumo/vaadin-dashboard.d.ts +0 -4
  48. package/theme/lumo/vaadin-dashboard.js +0 -4
@@ -1,334 +0,0 @@
1
- import '@vaadin/vaadin-lumo-styles/color.js';
2
- import '@vaadin/vaadin-lumo-styles/sizing.js';
3
- import '@vaadin/vaadin-lumo-styles/spacing.js';
4
- import '@vaadin/vaadin-lumo-styles/style.js';
5
- import '@vaadin/vaadin-lumo-styles/typography.js';
6
- import '@vaadin/vaadin-lumo-styles/font-icons.js';
7
- import { css, registerStyles } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
8
-
9
- /* Styles shared between widgets and sections */
10
- const dashboardWidgetAndSection = css`
11
- /* stylelint-disable rule-empty-line-before */
12
- /* stylelint-disable length-zero-no-unit */
13
-
14
- :host {
15
- --_widget-background: var(--vaadin-dashboard-widget-background, var(--lumo-base-color));
16
- --_widget-border-radius: var(--vaadin-dashboard-widget-border-radius, var(--lumo-border-radius-l));
17
- --_widget-border-width: var(--vaadin-dashboard-widget-border-width, 1px);
18
- --_widget-border-color: var(--vaadin-dashboard-widget-border-color, var(--lumo-contrast-20pct));
19
- --_widget-shadow: var(--vaadin-dashboard-widget-shadow, 0 0 0 0 transparent);
20
- --_widget-editable-shadow: var(--lumo-box-shadow-s);
21
- --_widget-selected-shadow: 0 2px 4px -1px var(--lumo-primary-color-10pct),
22
- 0 3px 12px -1px var(--lumo-primary-color-50pct);
23
- --_drop-target-background-color: var(
24
- --vaadin-dashboard-drop-target-background-color,
25
- var(--lumo-primary-color-10pct)
26
- );
27
- --_drop-target-border: var(--vaadin-dashboard-drop-target-border, 1px dashed var(--lumo-primary-color-50pct));
28
-
29
- color: var(--lumo-body-text-color);
30
- font-family: var(--lumo-font-family);
31
- font-size: var(--lumo-font-size-m);
32
- line-height: var(--lumo-line-height-m);
33
- --_focus-ring-color: var(--vaadin-focus-ring-color, var(--lumo-primary-color-50pct));
34
- --_focus-ring-width: var(--vaadin-focus-ring-width, 2px);
35
- --_icon-color: var(--lumo-contrast-60pct);
36
- opacity: var(--_widget-opacity);
37
- filter: var(--_widget-filter);
38
- }
39
-
40
- :host([selected]) {
41
- opacity: 1;
42
- z-index: 1;
43
- }
44
-
45
- :host([focused]) {
46
- z-index: 1;
47
- }
48
-
49
- header {
50
- display: flex;
51
- align-items: start;
52
- box-sizing: border-box;
53
- justify-content: space-between;
54
- }
55
-
56
- [part='title'] {
57
- flex: 1;
58
- color: var(--lumo-header-text-color);
59
- white-space: var(--vaadin-dashboard-widget-title-wrap, wrap);
60
- text-overflow: ellipsis;
61
- overflow: hidden;
62
- line-height: var(--lumo-line-height-s);
63
- margin: 0 0 1px;
64
- align-self: safe center;
65
- }
66
-
67
- vaadin-dashboard-button {
68
- font-family: 'lumo-icons';
69
- font-size: var(--lumo-icon-size-m);
70
- margin: 0;
71
- }
72
-
73
- vaadin-dashboard-button .icon::before {
74
- display: block;
75
- content: var(--icon);
76
- }
77
-
78
- /* Common styles for non-mode edit buttons */
79
- [part='move-button'],
80
- [part='resize-button'],
81
- [part='remove-button'] {
82
- color: var(--_icon-color);
83
- padding-inline: 0;
84
- }
85
- :where([part='move-button'], [part='resize-button'], [part='remove-button']):hover {
86
- --_icon-color: var(--lumo-primary-text-color);
87
- }
88
- :host([selected]) {
89
- --_icon-color: var(--lumo-primary-text-color);
90
- }
91
- :host(:is([move-mode], [resize-mode])) {
92
- --_icon-color: var(--lumo-disabled-text-color);
93
- }
94
-
95
- /* Drag handle */
96
- [part~='move-button'] {
97
- cursor: move;
98
- --icon: var(--lumo-icons-drag-handle);
99
- }
100
-
101
- /* Remove button */
102
- [part~='remove-button'] {
103
- cursor: pointer;
104
- --icon: var(--lumo-icons-cross);
105
- margin-inline-start: var(--lumo-space-xs);
106
- }
107
-
108
- /* Mode controls */
109
- .mode-controls vaadin-dashboard-button[focused] {
110
- z-index: 3;
111
- }
112
-
113
- /* Move mode */
114
-
115
- :host(:not([dir='rtl'])) [part~='move-backward-button'],
116
- :host([dir='rtl']) [part~='move-forward-button'] {
117
- border-top-left-radius: 0;
118
- border-bottom-left-radius: 0;
119
- --icon: var(--lumo-icons-angle-left);
120
- }
121
-
122
- :host(:not([dir='rtl'])) [part~='move-forward-button'],
123
- :host([dir='rtl']) [part~='move-backward-button'] {
124
- border-top-right-radius: 0;
125
- border-bottom-right-radius: 0;
126
- --icon: var(--lumo-icons-angle-right);
127
- }
128
-
129
- [part~='move-apply-button'] {
130
- --icon: var(--lumo-icons-checkmark);
131
- font-size: var(--lumo-icon-size-m);
132
- }
133
- `;
134
-
135
- /* Widget styles */
136
- const dashboardWidget = css`
137
- :host {
138
- background: var(--_widget-background);
139
- border-radius: var(--_widget-border-radius);
140
- box-shadow: var(--_widget-shadow);
141
- position: relative;
142
- }
143
-
144
- :host::before {
145
- content: '';
146
- position: absolute;
147
- inset: calc(-1 * var(--_widget-border-width));
148
- border: var(--_widget-border-width) solid var(--_widget-border-color);
149
- border-radius: calc(var(--_widget-border-radius) + var(--_widget-border-width));
150
- pointer-events: none;
151
- }
152
-
153
- /* Widget states */
154
-
155
- :host([editable]) {
156
- --vaadin-dashboard-widget-shadow: var(--_widget-editable-shadow);
157
- --_widget-border-color: var(--lumo-contrast-20pct);
158
- --_widget-border-width: 1px;
159
- }
160
-
161
- :host([focused])::before {
162
- border-width: var(--_focus-ring-width);
163
- border-color: var(--_focus-ring-color);
164
- }
165
-
166
- :host([selected]) {
167
- --vaadin-dashboard-widget-shadow: var(--_widget-selected-shadow);
168
- background: var(--lumo-primary-color-10pct);
169
- }
170
-
171
- :host([dragging]) {
172
- box-shadow: none;
173
- background: var(--_drop-target-background-color);
174
- border: var(--_drop-target-border);
175
- }
176
-
177
- :host([resizing])::after {
178
- background: var(--_drop-target-background-color);
179
- border: var(--_drop-target-border);
180
- }
181
-
182
- /* Widget parts */
183
-
184
- header {
185
- min-height: var(--lumo-size-l);
186
- padding: var(--lumo-space-xs) var(--lumo-space-m);
187
- }
188
-
189
- :host([editable]) header {
190
- padding-inline: var(--lumo-space-xs);
191
- }
192
-
193
- [part='title'] {
194
- font-size: var(--lumo-font-size-l);
195
- font-weight: 600;
196
- }
197
-
198
- #content {
199
- min-height: var(--lumo-size-m);
200
- padding: var(--vaadin-dashboard-widget-padding, 0);
201
- padding-top: 0;
202
- border-radius: inherit;
203
- border-top-left-radius: 0;
204
- border-top-right-radius: 0;
205
- overflow: hidden;
206
- }
207
-
208
- ::slotted([slot='header-content']) {
209
- align-self: center;
210
- }
211
-
212
- :host([resize-mode]) #content,
213
- :host([move-mode]) #content {
214
- opacity: 0.75;
215
- filter: blur(10px);
216
- }
217
-
218
- /* Resize handle */
219
-
220
- [part~='resize-button'] {
221
- --_resize-button-offset: min(var(--_gap), var(--_padding), var(--lumo-space-xs));
222
- position: absolute;
223
- bottom: calc(-1 * var(--_resize-button-offset));
224
- inset-inline-end: calc(-1 * var(--_resize-button-offset));
225
- cursor: nwse-resize;
226
- --icon: var(--lumo-icons-resize-handle);
227
- }
228
-
229
- :host([dir='rtl']) [part~='resize-button'] {
230
- cursor: sw-resize;
231
- }
232
-
233
- :host([dir='rtl']) [part~='resize-button'] .icon::before {
234
- transform: scaleX(-1);
235
- }
236
-
237
- /* Accessible resize mode controls */
238
-
239
- [part~='resize-apply-button'] {
240
- --icon: var(--lumo-icons-checkmark);
241
- font-size: var(--lumo-icon-size-m);
242
- }
243
-
244
- [part~='resize-grow-width-button'],
245
- [part~='resize-shrink-width-button'] {
246
- padding-right: 0;
247
- padding-left: 0;
248
- min-width: var(--lumo-size-s);
249
- }
250
-
251
- [part~='resize-shrink-width-button'] + [part~='resize-grow-width-button'] {
252
- margin-left: 1px;
253
- }
254
-
255
- [part~='resize-grow-height-button'],
256
- [part~='resize-shrink-height-button'] {
257
- height: var(--lumo-size-s);
258
- padding-right: 0;
259
- padding-left: 0;
260
- }
261
-
262
- [part~='resize-shrink-height-button'] + [part~='resize-grow-height-button'] {
263
- margin-top: 1px;
264
- }
265
-
266
- :host(:not([dir='rtl'])) [part~='resize-grow-width-button'],
267
- :host(:not([dir='rtl'])) [part~='resize-shrink-width-button'] {
268
- border-top-right-radius: 0;
269
- border-bottom-right-radius: 0;
270
- }
271
-
272
- :host([dir='rtl']) [part~='resize-grow-width-button'],
273
- :host([dir='rtl']) [part~='resize-shrink-width-button'] {
274
- border-top-left-radius: 0;
275
- border-bottom-left-radius: 0;
276
- }
277
-
278
- :host(:not([dir='rtl'])) [part~='resize-shrink-width-button']:not([hidden]) + [part~='resize-grow-width-button'] {
279
- border-top-left-radius: 0;
280
- border-bottom-left-radius: 0;
281
- }
282
-
283
- :host([dir='rtl']) [part~='resize-shrink-width-button']:not([hidden]) + [part~='resize-grow-width-button'] {
284
- border-top-right-radius: 0;
285
- border-bottom-right-radius: 0;
286
- }
287
-
288
- [part~='resize-grow-height-button'],
289
- [part~='resize-grow-width-button'] {
290
- --icon: var(--lumo-icons-plus);
291
- }
292
-
293
- [part~='resize-shrink-height-button'],
294
- [part~='resize-shrink-width-button'] {
295
- --icon: var(--lumo-icons-minus);
296
- }
297
-
298
- [part~='resize-grow-height-button'],
299
- [part~='resize-shrink-height-button'] {
300
- border-bottom-left-radius: 0;
301
- border-bottom-right-radius: 0;
302
- }
303
-
304
- [part~='resize-shrink-height-button']:not([hidden]) + [part~='resize-grow-height-button'] {
305
- border-top-left-radius: 0;
306
- border-top-right-radius: 0;
307
- }
308
-
309
- /* Windows High Contrast Mode */
310
- @media (forced-colors: active) {
311
- :host {
312
- border: 1px solid;
313
- }
314
- :host([focused]) {
315
- outline: 2px solid;
316
- outline-offset: 1px;
317
- }
318
- :host([selected]) {
319
- outline-width: 1px;
320
- outline-offset: 0px;
321
- outline-color: Highlight;
322
- }
323
- :host([selected][focused]) {
324
- outline-width: 3px;
325
- outline-offset: 0px;
326
- }
327
- }
328
- `;
329
-
330
- registerStyles('vaadin-dashboard-widget', [dashboardWidget, dashboardWidgetAndSection], {
331
- moduleId: 'lumo-dashboard-widget',
332
- });
333
-
334
- export { dashboardWidget, dashboardWidgetAndSection };
@@ -1,3 +0,0 @@
1
- import './vaadin-dashboard-widget-styles.js';
2
- import './vaadin-dashboard-button.js';
3
- import '../../src/vaadin-dashboard-widget.js';
@@ -1,3 +0,0 @@
1
- import './vaadin-dashboard-widget-styles.js';
2
- import './vaadin-dashboard-button.js';
3
- import '../../src/vaadin-dashboard-widget.js';
@@ -1,4 +0,0 @@
1
- import './vaadin-dashboard-section.js';
2
- import './vaadin-dashboard-widget.js';
3
- import './vaadin-dashboard-styles.js';
4
- import '../../src/vaadin-dashboard.js';
@@ -1,4 +0,0 @@
1
- import './vaadin-dashboard-section.js';
2
- import './vaadin-dashboard-widget.js';
3
- import './vaadin-dashboard-styles.js';
4
- import '../../src/vaadin-dashboard.js';