@vaadin/notification 23.2.0-dev.8a7678b70 → 23.2.0-rc1

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/notification",
3
- "version": "23.2.0-dev.8a7678b70",
3
+ "version": "23.2.0-rc1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -25,7 +25,9 @@
25
25
  "src",
26
26
  "theme",
27
27
  "vaadin-*.d.ts",
28
- "vaadin-*.js"
28
+ "vaadin-*.js",
29
+ "web-types.json",
30
+ "web-types.lit.json"
29
31
  ],
30
32
  "keywords": [
31
33
  "Vaadin",
@@ -36,19 +38,23 @@
36
38
  ],
37
39
  "dependencies": {
38
40
  "@polymer/polymer": "^3.0.0",
39
- "@vaadin/component-base": "23.2.0-dev.8a7678b70",
40
- "@vaadin/lit-renderer": "23.2.0-dev.8a7678b70",
41
- "@vaadin/vaadin-lumo-styles": "23.2.0-dev.8a7678b70",
42
- "@vaadin/vaadin-material-styles": "23.2.0-dev.8a7678b70",
43
- "@vaadin/vaadin-themable-mixin": "23.2.0-dev.8a7678b70",
41
+ "@vaadin/component-base": "23.2.0-rc1",
42
+ "@vaadin/lit-renderer": "23.2.0-rc1",
43
+ "@vaadin/vaadin-lumo-styles": "23.2.0-rc1",
44
+ "@vaadin/vaadin-material-styles": "23.2.0-rc1",
45
+ "@vaadin/vaadin-themable-mixin": "23.2.0-rc1",
44
46
  "lit": "^2.0.0"
45
47
  },
46
48
  "devDependencies": {
47
49
  "@esm-bundle/chai": "^4.3.4",
48
- "@vaadin/button": "23.2.0-dev.8a7678b70",
49
- "@vaadin/polymer-legacy-adapter": "23.2.0-dev.8a7678b70",
50
+ "@vaadin/button": "23.2.0-rc1",
51
+ "@vaadin/polymer-legacy-adapter": "23.2.0-rc1",
50
52
  "@vaadin/testing-helpers": "^0.3.2",
51
53
  "sinon": "^13.0.2"
52
54
  },
53
- "gitHead": "85b403f96d8282f262322b56c0ff4289f843d02a"
55
+ "web-types": [
56
+ "web-types.json",
57
+ "web-types.lit.json"
58
+ ],
59
+ "gitHead": "e78a1f2fe6f42d78cefa3f48085b09a3033c9588"
54
60
  }
@@ -3,10 +3,10 @@
3
3
  * Copyright (c) 2017 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { TemplateResult } from 'lit';
7
- import { DirectiveResult } from 'lit/directive.js';
6
+ import type { TemplateResult } from 'lit';
7
+ import type { DirectiveResult } from 'lit/directive.js';
8
8
  import { LitRendererDirective } from '@vaadin/lit-renderer';
9
- import { Notification } from '../vaadin-notification.js';
9
+ import type { Notification } from '../vaadin-notification.js';
10
10
 
11
11
  export type NotificationLitRenderer = (notification: Notification) => TemplateResult;
12
12
 
@@ -3,21 +3,21 @@
3
3
  * Copyright (c) 2017 - 2022 Vaadin Ltd.
4
4
  * This program is available under Apache License Version 2.0, available at https://vaadin.com/license/
5
5
  */
6
- import { TemplateResult } from 'lit';
6
+ import type { TemplateResult } from 'lit';
7
7
  import { ElementMixin } from '@vaadin/component-base/src/element-mixin.js';
8
8
  import { ThemableMixin } from '@vaadin/vaadin-themable-mixin/vaadin-themable-mixin.js';
9
9
  import { ThemePropertyMixin } from '@vaadin/vaadin-themable-mixin/vaadin-theme-property-mixin.js';
10
10
 
11
11
  export type NotificationPosition =
12
- | 'top-stretch'
13
- | 'top-start'
14
- | 'top-center'
15
- | 'top-end'
16
- | 'middle'
17
- | 'bottom-start'
18
12
  | 'bottom-center'
19
13
  | 'bottom-end'
20
- | 'bottom-stretch';
14
+ | 'bottom-start'
15
+ | 'bottom-stretch'
16
+ | 'middle'
17
+ | 'top-center'
18
+ | 'top-end'
19
+ | 'top-start'
20
+ | 'top-stretch';
21
21
 
22
22
  export type NotificationRenderer = (root: HTMLElement, notification?: Notification) => void;
23
23
 
@@ -121,7 +121,7 @@ declare class Notification extends ThemePropertyMixin(ElementMixin(HTMLElement))
121
121
  * @param contents the contents to show, either as a string or a Lit template.
122
122
  * @param options optional options for customizing the notification.
123
123
  */
124
- static show(contents: string | TemplateResult, options?: ShowOptions): Notification;
124
+ static show(contents: TemplateResult | string, options?: ShowOptions): Notification;
125
125
 
126
126
  /**
127
127
  * The duration in milliseconds to show the notification.
@@ -171,13 +171,13 @@ declare class Notification extends ThemePropertyMixin(ElementMixin(HTMLElement))
171
171
  addEventListener<K extends keyof NotificationEventMap>(
172
172
  type: K,
173
173
  listener: (this: Notification, ev: NotificationEventMap[K]) => void,
174
- options?: boolean | AddEventListenerOptions,
174
+ options?: AddEventListenerOptions | boolean,
175
175
  ): void;
176
176
 
177
177
  removeEventListener<K extends keyof NotificationEventMap>(
178
178
  type: K,
179
179
  listener: (this: Notification, ev: NotificationEventMap[K]) => void,
180
- options?: boolean | EventListenerOptions,
180
+ options?: EventListenerOptions | boolean,
181
181
  ): void;
182
182
  }
183
183
 
package/web-types.json ADDED
@@ -0,0 +1,103 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "name": "@vaadin/notification",
4
+ "version": "23.2.0-rc1",
5
+ "description-markup": "markdown",
6
+ "contributions": {
7
+ "html": {
8
+ "elements": [
9
+ {
10
+ "name": "vaadin-notification",
11
+ "description": "`<vaadin-notification>` is a Web Component providing accessible and customizable notifications (toasts).\n\n### Rendering\n\nThe content of the notification can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `notification` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `notification`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\n```html\n<vaadin-notification id=\"notification\"></vaadin-notification>\n```\n```js\nconst notification = document.querySelector('#notification');\nnotification.renderer = function(root, notification) {\n root.textContent = \"Your work has been saved\";\n};\n```\n\nRenderer is called on the opening of the notification.\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-notification>` uses `<vaadin-notification-card>` internal\nthemable component as the actual visible notification cards.\n\nThe following shadow DOM parts of the `<vaadin-notification-card>` are available for styling:\n\nPart name | Description\n----------------|----------------\n`overlay` | The notification container\n`content` | The content of the notification\n\nSee [Styling Components](https://vaadin.com/docs/latest/ds/customization/styling-components) documentation.\n\nNote: the `theme` attribute value set on `<vaadin-notification>` is\npropagated to the internal `<vaadin-notification-card>`.",
12
+ "attributes": [
13
+ {
14
+ "name": "duration",
15
+ "description": "The duration in milliseconds to show the notification.\nSet to `0` or a negative number to disable the notification auto-closing.",
16
+ "value": {
17
+ "type": [
18
+ "number"
19
+ ]
20
+ }
21
+ },
22
+ {
23
+ "name": "opened",
24
+ "description": "True if the notification is currently displayed.",
25
+ "value": {
26
+ "type": [
27
+ "boolean"
28
+ ]
29
+ }
30
+ },
31
+ {
32
+ "name": "position",
33
+ "description": "Alignment of the notification in the viewport\nValid values are `top-stretch|top-start|top-center|top-end|middle|bottom-start|bottom-center|bottom-end|bottom-stretch`",
34
+ "value": {
35
+ "type": [
36
+ "NotificationPosition"
37
+ ]
38
+ }
39
+ },
40
+ {
41
+ "name": "theme",
42
+ "description": "The theme variants to apply to the component.",
43
+ "value": {
44
+ "type": [
45
+ "string",
46
+ "null",
47
+ "undefined"
48
+ ]
49
+ }
50
+ }
51
+ ],
52
+ "js": {
53
+ "properties": [
54
+ {
55
+ "name": "duration",
56
+ "description": "The duration in milliseconds to show the notification.\nSet to `0` or a negative number to disable the notification auto-closing.",
57
+ "value": {
58
+ "type": [
59
+ "number"
60
+ ]
61
+ }
62
+ },
63
+ {
64
+ "name": "opened",
65
+ "description": "True if the notification is currently displayed.",
66
+ "value": {
67
+ "type": [
68
+ "boolean"
69
+ ]
70
+ }
71
+ },
72
+ {
73
+ "name": "position",
74
+ "description": "Alignment of the notification in the viewport\nValid values are `top-stretch|top-start|top-center|top-end|middle|bottom-start|bottom-center|bottom-end|bottom-stretch`",
75
+ "value": {
76
+ "type": [
77
+ "NotificationPosition"
78
+ ]
79
+ }
80
+ },
81
+ {
82
+ "name": "renderer",
83
+ "description": "Custom function for rendering the content of the notification.\nReceives two arguments:\n\n- `root` The `<vaadin-notification-card>` DOM element. Append\n your content to it.\n- `notification` The reference to the `<vaadin-notification>` element.",
84
+ "value": {
85
+ "type": [
86
+ "NotificationRenderer",
87
+ "undefined"
88
+ ]
89
+ }
90
+ }
91
+ ],
92
+ "events": [
93
+ {
94
+ "name": "opened-changed",
95
+ "description": "Fired when the `opened` property changes."
96
+ }
97
+ ]
98
+ }
99
+ }
100
+ ]
101
+ }
102
+ }
103
+ }
@@ -0,0 +1,62 @@
1
+ {
2
+ "$schema": "https://json.schemastore.org/web-types",
3
+ "name": "@vaadin/notification",
4
+ "version": "23.2.0-rc1",
5
+ "description-markup": "markdown",
6
+ "framework": "lit",
7
+ "framework-config": {
8
+ "enable-when": {
9
+ "node-packages": [
10
+ "lit"
11
+ ]
12
+ }
13
+ },
14
+ "contributions": {
15
+ "html": {
16
+ "elements": [
17
+ {
18
+ "name": "vaadin-notification",
19
+ "description": "`<vaadin-notification>` is a Web Component providing accessible and customizable notifications (toasts).\n\n### Rendering\n\nThe content of the notification can be populated by using the renderer callback function.\n\nThe renderer function provides `root`, `notification` arguments.\nGenerate DOM content, append it to the `root` element and control the state\nof the host element by accessing `notification`. Before generating new content,\nusers are able to check if there is already content in `root` for reusing it.\n\n```html\n<vaadin-notification id=\"notification\"></vaadin-notification>\n```\n```js\nconst notification = document.querySelector('#notification');\nnotification.renderer = function(root, notification) {\n root.textContent = \"Your work has been saved\";\n};\n```\n\nRenderer is called on the opening of the notification.\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-notification>` uses `<vaadin-notification-card>` internal\nthemable component as the actual visible notification cards.\n\nThe following shadow DOM parts of the `<vaadin-notification-card>` are available for styling:\n\nPart name | Description\n----------------|----------------\n`overlay` | The notification container\n`content` | The content of the notification\n\nSee [Styling Components](https://vaadin.com/docs/latest/ds/customization/styling-components) documentation.\n\nNote: the `theme` attribute value set on `<vaadin-notification>` is\npropagated to the internal `<vaadin-notification-card>`.",
20
+ "extension": true,
21
+ "attributes": [
22
+ {
23
+ "name": "?opened",
24
+ "description": "True if the notification is currently displayed.",
25
+ "value": {
26
+ "kind": "expression"
27
+ }
28
+ },
29
+ {
30
+ "name": ".duration",
31
+ "description": "The duration in milliseconds to show the notification.\nSet to `0` or a negative number to disable the notification auto-closing.",
32
+ "value": {
33
+ "kind": "expression"
34
+ }
35
+ },
36
+ {
37
+ "name": ".position",
38
+ "description": "Alignment of the notification in the viewport\nValid values are `top-stretch|top-start|top-center|top-end|middle|bottom-start|bottom-center|bottom-end|bottom-stretch`",
39
+ "value": {
40
+ "kind": "expression"
41
+ }
42
+ },
43
+ {
44
+ "name": ".renderer",
45
+ "description": "Custom function for rendering the content of the notification.\nReceives two arguments:\n\n- `root` The `<vaadin-notification-card>` DOM element. Append\n your content to it.\n- `notification` The reference to the `<vaadin-notification>` element.",
46
+ "value": {
47
+ "kind": "expression"
48
+ }
49
+ },
50
+ {
51
+ "name": "@opened-changed",
52
+ "description": "Fired when the `opened` property changes.",
53
+ "value": {
54
+ "kind": "expression"
55
+ }
56
+ }
57
+ ]
58
+ }
59
+ ]
60
+ }
61
+ }
62
+ }