@vaadin/notification 24.4.6 → 24.5.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 +1 -1
- package/package.json +11 -11
- package/src/vaadin-notification.d.ts +7 -0
- package/src/vaadin-notification.js +8 -0
- package/theme/lumo/vaadin-notification-styles.js +31 -7
- package/theme/material/vaadin-notification-styles.js +3 -4
- package/web-types.json +5 -1
- package/web-types.lit.json +8 -1
package/README.md
CHANGED
|
@@ -59,7 +59,7 @@ import '@vaadin/notification/src/vaadin-notification.js';
|
|
|
59
59
|
|
|
60
60
|
## Contributing
|
|
61
61
|
|
|
62
|
-
Read the [contributing guide](https://vaadin.com/docs/latest/contributing
|
|
62
|
+
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.
|
|
63
63
|
|
|
64
64
|
## License
|
|
65
65
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vaadin/notification",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.5.0-alpha10",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -38,22 +38,22 @@
|
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"@polymer/polymer": "^3.0.0",
|
|
41
|
-
"@vaadin/component-base": "
|
|
42
|
-
"@vaadin/lit-renderer": "
|
|
43
|
-
"@vaadin/vaadin-lumo-styles": "
|
|
44
|
-
"@vaadin/vaadin-material-styles": "
|
|
45
|
-
"@vaadin/vaadin-themable-mixin": "
|
|
41
|
+
"@vaadin/component-base": "24.5.0-alpha10",
|
|
42
|
+
"@vaadin/lit-renderer": "24.5.0-alpha10",
|
|
43
|
+
"@vaadin/vaadin-lumo-styles": "24.5.0-alpha10",
|
|
44
|
+
"@vaadin/vaadin-material-styles": "24.5.0-alpha10",
|
|
45
|
+
"@vaadin/vaadin-themable-mixin": "24.5.0-alpha10",
|
|
46
46
|
"lit": "^3.0.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@
|
|
50
|
-
"@vaadin/
|
|
51
|
-
"@vaadin/testing-helpers": "^0.
|
|
52
|
-
"sinon": "^
|
|
49
|
+
"@vaadin/button": "24.5.0-alpha10",
|
|
50
|
+
"@vaadin/chai-plugins": "24.5.0-alpha10",
|
|
51
|
+
"@vaadin/testing-helpers": "^1.0.0",
|
|
52
|
+
"sinon": "^18.0.0"
|
|
53
53
|
},
|
|
54
54
|
"web-types": [
|
|
55
55
|
"web-types.json",
|
|
56
56
|
"web-types.lit.json"
|
|
57
57
|
],
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "6f9c37308031af872a98017bfab4de89aeacda51"
|
|
59
59
|
}
|
|
@@ -27,8 +27,14 @@ export type NotificationRenderer = (root: HTMLElement, notification: Notificatio
|
|
|
27
27
|
*/
|
|
28
28
|
export type NotificationOpenedChangedEvent = CustomEvent<{ value: boolean }>;
|
|
29
29
|
|
|
30
|
+
/**
|
|
31
|
+
* Fired when the notification is closed.
|
|
32
|
+
*/
|
|
33
|
+
export type NotificationClosedEvent = CustomEvent;
|
|
34
|
+
|
|
30
35
|
export interface NotificationCustomEventMap {
|
|
31
36
|
'opened-changed': NotificationOpenedChangedEvent;
|
|
37
|
+
closed: NotificationClosedEvent;
|
|
32
38
|
}
|
|
33
39
|
|
|
34
40
|
export interface NotificationEventMap extends HTMLElementEventMap, NotificationCustomEventMap {}
|
|
@@ -99,6 +105,7 @@ declare class NotificationCard extends ThemableMixin(HTMLElement) {}
|
|
|
99
105
|
* propagated to the internal `<vaadin-notification-card>`.
|
|
100
106
|
*
|
|
101
107
|
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
108
|
+
* @fires {CustomEvent} closed - Fired when the notification is closed.
|
|
102
109
|
*/
|
|
103
110
|
declare class Notification extends OverlayClassMixin(ThemePropertyMixin(ElementMixin(HTMLElement))) {
|
|
104
111
|
/**
|
|
@@ -257,6 +257,7 @@ class NotificationCard extends ThemableMixin(PolymerElement) {
|
|
|
257
257
|
* propagated to the internal `<vaadin-notification-card>`.
|
|
258
258
|
*
|
|
259
259
|
* @fires {CustomEvent} opened-changed - Fired when the `opened` property changes.
|
|
260
|
+
* @fires {CustomEvent} closed - Fired when the notification is closed.
|
|
260
261
|
*
|
|
261
262
|
* @customElement
|
|
262
263
|
* @extends HTMLElement
|
|
@@ -532,6 +533,7 @@ class Notification extends OverlayClassMixin(ThemePropertyMixin(ElementMixin(Pol
|
|
|
532
533
|
}
|
|
533
534
|
this._card.removeAttribute('closing');
|
|
534
535
|
this._container.opened = Boolean(this._container.firstElementChild);
|
|
536
|
+
this.dispatchEvent(new CustomEvent('closed'));
|
|
535
537
|
}
|
|
536
538
|
|
|
537
539
|
/** @private */
|
|
@@ -575,6 +577,12 @@ class Notification extends OverlayClassMixin(ThemePropertyMixin(ElementMixin(Pol
|
|
|
575
577
|
}
|
|
576
578
|
}
|
|
577
579
|
}
|
|
580
|
+
|
|
581
|
+
/**
|
|
582
|
+
* Fired when the notification is closed.
|
|
583
|
+
*
|
|
584
|
+
* @event closed
|
|
585
|
+
*/
|
|
578
586
|
}
|
|
579
587
|
|
|
580
588
|
defineCustomElement(NotificationContainer);
|
|
@@ -15,7 +15,9 @@ registerStyles(
|
|
|
15
15
|
[part='overlay'] {
|
|
16
16
|
background: var(--lumo-base-color) linear-gradient(var(--lumo-contrast-5pct), var(--lumo-contrast-5pct));
|
|
17
17
|
border-radius: var(--lumo-border-radius-l);
|
|
18
|
-
box-shadow:
|
|
18
|
+
box-shadow:
|
|
19
|
+
0 0 0 1px var(--lumo-contrast-10pct),
|
|
20
|
+
var(--lumo-box-shadow-l);
|
|
19
21
|
font-family: var(--lumo-font-family);
|
|
20
22
|
font-size: var(--lumo-font-size-m);
|
|
21
23
|
font-weight: 400;
|
|
@@ -44,25 +46,25 @@ registerStyles(
|
|
|
44
46
|
margin: var(--lumo-space-s) auto;
|
|
45
47
|
}
|
|
46
48
|
|
|
47
|
-
:host([slot
|
|
49
|
+
:host([slot$='stretch']) {
|
|
48
50
|
margin: 0;
|
|
49
51
|
}
|
|
50
52
|
|
|
51
|
-
:host([slot
|
|
53
|
+
:host([slot$='stretch']) [part='overlay'] {
|
|
52
54
|
border-radius: 0;
|
|
53
55
|
}
|
|
54
56
|
|
|
55
57
|
@media (min-width: 421px) {
|
|
56
|
-
:host(:not([slot
|
|
58
|
+
:host(:not([slot$='stretch'])) {
|
|
57
59
|
display: flex;
|
|
58
60
|
}
|
|
59
61
|
|
|
60
|
-
:host([slot
|
|
62
|
+
:host([slot$='end']) {
|
|
61
63
|
justify-content: flex-end;
|
|
62
64
|
}
|
|
63
65
|
|
|
64
66
|
:host([slot^='middle']),
|
|
65
|
-
:host([slot
|
|
67
|
+
:host([slot$='center']) {
|
|
66
68
|
display: flex;
|
|
67
69
|
justify-content: center;
|
|
68
70
|
}
|
|
@@ -132,6 +134,26 @@ registerStyles(
|
|
|
132
134
|
animation: lumo-notification-exit-slide-down 300ms;
|
|
133
135
|
}
|
|
134
136
|
|
|
137
|
+
:host([theme='success']) {
|
|
138
|
+
--_focus-ring-gap-color: var(--lumo-success-color);
|
|
139
|
+
--vaadin-focus-ring-color: var(--lumo-success-contrast-color);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
:host([theme='warning']) {
|
|
143
|
+
--_focus-ring-gap-color: var(--lumo-warning-color);
|
|
144
|
+
--vaadin-focus-ring-color: var(--lumo-warning-contrast-color);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
:host([theme='error']) {
|
|
148
|
+
--_focus-ring-gap-color: var(--lumo-error-color);
|
|
149
|
+
--vaadin-focus-ring-color: var(--lumo-error-contrast-color);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
:host([theme='primary']) {
|
|
153
|
+
--_focus-ring-gap-color: var(--lumo-primary-color);
|
|
154
|
+
--vaadin-focus-ring-color: var(--lumo-primary-contrast-color);
|
|
155
|
+
}
|
|
156
|
+
|
|
135
157
|
:host([theme~='primary']) [part='overlay'] {
|
|
136
158
|
background: var(--lumo-primary-color);
|
|
137
159
|
color: var(--lumo-primary-contrast-color);
|
|
@@ -187,7 +209,9 @@ registerStyles(
|
|
|
187
209
|
:host([theme~='warning']) [part='overlay'] {
|
|
188
210
|
background: var(--lumo-warning-color);
|
|
189
211
|
color: var(--lumo-warning-contrast-color);
|
|
190
|
-
box-shadow:
|
|
212
|
+
box-shadow:
|
|
213
|
+
inset 0 0 0 1px var(--lumo-contrast-20pct),
|
|
214
|
+
var(--lumo-box-shadow-l);
|
|
191
215
|
}
|
|
192
216
|
|
|
193
217
|
:host([theme~='warning']) {
|
|
@@ -30,7 +30,6 @@ const notificationCard = css`
|
|
|
30
30
|
background-color: var(--material-background-color);
|
|
31
31
|
border-radius: 4px;
|
|
32
32
|
box-shadow: var(--material-shadow-elevation-6dp);
|
|
33
|
-
|
|
34
33
|
padding: 14px 16px;
|
|
35
34
|
justify-content: stretch;
|
|
36
35
|
}
|
|
@@ -53,11 +52,11 @@ const notificationCard = css`
|
|
|
53
52
|
margin: -8px 0;
|
|
54
53
|
}
|
|
55
54
|
|
|
56
|
-
:host([slot
|
|
55
|
+
:host([slot$='stretch']) {
|
|
57
56
|
margin: 0 -4px;
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
:host([slot
|
|
59
|
+
:host([slot$='stretch']) [part='overlay'] {
|
|
61
60
|
border-radius: 0;
|
|
62
61
|
}
|
|
63
62
|
|
|
@@ -71,7 +70,7 @@ const notificationCard = css`
|
|
|
71
70
|
margin: auto;
|
|
72
71
|
}
|
|
73
72
|
|
|
74
|
-
:host([slot
|
|
73
|
+
:host([slot$='stretch']) {
|
|
75
74
|
margin: 0 -12px;
|
|
76
75
|
}
|
|
77
76
|
}
|
package/web-types.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/notification",
|
|
4
|
-
"version": "24.
|
|
4
|
+
"version": "24.5.0-alpha10",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"contributions": {
|
|
7
7
|
"html": {
|
|
@@ -112,6 +112,10 @@
|
|
|
112
112
|
}
|
|
113
113
|
],
|
|
114
114
|
"events": [
|
|
115
|
+
{
|
|
116
|
+
"name": "closed",
|
|
117
|
+
"description": "Fired when the notification is closed."
|
|
118
|
+
},
|
|
115
119
|
{
|
|
116
120
|
"name": "opened-changed",
|
|
117
121
|
"description": "Fired when the `opened` property changes."
|
package/web-types.lit.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/web-types",
|
|
3
3
|
"name": "@vaadin/notification",
|
|
4
|
-
"version": "24.
|
|
4
|
+
"version": "24.5.0-alpha10",
|
|
5
5
|
"description-markup": "markdown",
|
|
6
6
|
"framework": "lit",
|
|
7
7
|
"framework-config": {
|
|
@@ -54,6 +54,13 @@
|
|
|
54
54
|
"kind": "expression"
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
|
+
{
|
|
58
|
+
"name": "@closed",
|
|
59
|
+
"description": "Fired when the notification is closed.",
|
|
60
|
+
"value": {
|
|
61
|
+
"kind": "expression"
|
|
62
|
+
}
|
|
63
|
+
},
|
|
57
64
|
{
|
|
58
65
|
"name": "@opened-changed",
|
|
59
66
|
"description": "Fired when the `opened` property changes.",
|