@umbraco-ui/uui-toast-notification 0.2.1 → 1.0.0-rc.1
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/custom-elements.json +5 -5
- package/lib/index.js +27 -20
- package/lib/uui-toast-notification.element.d.ts +5 -6
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# uui-toast-notification
|
|
2
2
|
|
|
3
|
-

|
|
3
|
+
[](https://www.npmjs.com/package/@umbraco-ui/uui-toast-notification)
|
|
4
4
|
|
|
5
5
|
Umbraco style toast-notification component.
|
|
6
6
|
|
package/custom-elements.json
CHANGED
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
"path": "./lib/uui-toast-notification.element.ts",
|
|
7
7
|
"attributes": [
|
|
8
8
|
{
|
|
9
|
-
"name": "
|
|
9
|
+
"name": "color",
|
|
10
10
|
"description": "Changes the look of the notification to one of the predefined, symbolic looks. Example set this to danger for errors.",
|
|
11
|
-
"type": "\"\"|\"primary\"|\"positive\"|\"warning\"|\"danger\"",
|
|
11
|
+
"type": "\"\"|\"default\"|\"primary\"|\"positive\"|\"warning\"|\"danger\"",
|
|
12
12
|
"default": "\"\\\"\\\"\""
|
|
13
13
|
},
|
|
14
14
|
{
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"default": "[\"UUITextStyles\",null]"
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
|
-
"name": "
|
|
35
|
-
"attribute": "
|
|
34
|
+
"name": "color",
|
|
35
|
+
"attribute": "color",
|
|
36
36
|
"description": "Changes the look of the notification to one of the predefined, symbolic looks. Example set this to danger for errors.",
|
|
37
|
-
"type": "\"\"|\"primary\"|\"positive\"|\"warning\"|\"danger\"",
|
|
37
|
+
"type": "\"\"|\"default\"|\"primary\"|\"positive\"|\"warning\"|\"danger\"",
|
|
38
38
|
"default": "\"\\\"\\\"\""
|
|
39
39
|
},
|
|
40
40
|
{
|
package/lib/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { defineElement } from '@umbraco-ui/uui-base/lib/registration';
|
|
2
|
-
import { InterfaceLookDefaultValue } from '@umbraco-ui/uui-base/lib/types';
|
|
3
2
|
import { Timer, demandCustomElement } from '@umbraco-ui/uui-base/lib/utils';
|
|
4
3
|
import { UUITextStyles } from '@umbraco-ui/uui-css/lib';
|
|
5
4
|
import { iconRemove } from '@umbraco-ui/uui-icon-registry-essential/lib/svgs';
|
|
@@ -28,7 +27,7 @@ var __decorateClass = (decorators, target, key, kind) => {
|
|
|
28
27
|
let UUIToastNotificationElement = class extends LitElement {
|
|
29
28
|
constructor() {
|
|
30
29
|
super();
|
|
31
|
-
this.
|
|
30
|
+
this.color = "";
|
|
32
31
|
this._autoClose = null;
|
|
33
32
|
this._onOpenTimerComplete = () => {
|
|
34
33
|
if (this._open) {
|
|
@@ -38,8 +37,8 @@ let UUIToastNotificationElement = class extends LitElement {
|
|
|
38
37
|
this._timer = null;
|
|
39
38
|
this._pauseTimer = false;
|
|
40
39
|
this.isOpen = false;
|
|
41
|
-
this._animate = false;
|
|
42
40
|
this._open = false;
|
|
41
|
+
this._animate = false;
|
|
43
42
|
this._requestAnimationUpdate = 0;
|
|
44
43
|
this.addEventListener("keyup", (event) => {
|
|
45
44
|
if (event.key === "Escape") {
|
|
@@ -170,7 +169,8 @@ let UUIToastNotificationElement = class extends LitElement {
|
|
|
170
169
|
<div id="close">
|
|
171
170
|
<uui-button
|
|
172
171
|
.label=${"close"}
|
|
173
|
-
.
|
|
172
|
+
.color=${this.color}
|
|
173
|
+
.look=${this.color ? "primary" : "default"}
|
|
174
174
|
@click=${() => this.open = false}>
|
|
175
175
|
<uui-icon
|
|
176
176
|
name="remove"
|
|
@@ -229,7 +229,7 @@ UUIToastNotificationElement.styles = [
|
|
|
229
229
|
|
|
230
230
|
box-sizing: border-box;
|
|
231
231
|
box-shadow: var(--uui-shadow-depth-1,0 1px 3px rgba(0,0,0,0.12) , 0 1px 2px rgba(0,0,0,0.24));
|
|
232
|
-
background-color: var(--uui-
|
|
232
|
+
background-color: var(--uui-color-surface,#fff);
|
|
233
233
|
padding: var(--uui-size-layout-1,24px);
|
|
234
234
|
padding-right: var(--uui-size-layout-1,24px);
|
|
235
235
|
padding-left: var(--uui-size-layout-3,42px);
|
|
@@ -256,29 +256,36 @@ UUIToastNotificationElement.styles = [
|
|
|
256
256
|
--uui-button-padding-right-factor: 1.5;
|
|
257
257
|
}
|
|
258
258
|
|
|
259
|
-
:host
|
|
260
|
-
background-color: var(--uui-
|
|
261
|
-
color: var(--uui-
|
|
259
|
+
:host #toast > div {
|
|
260
|
+
background-color: var(--uui-color-surface,#fff);
|
|
261
|
+
color: var(--uui-color-text,#060606);
|
|
262
|
+
border-color: var(--uui-color-surface,#fff);
|
|
263
|
+
}
|
|
264
|
+
:host([color='primary']) #toast > div {
|
|
265
|
+
background-color: var(--uui-color-default,#1b264f);
|
|
266
|
+
color: var(--uui-color-default-contrast,#fff);
|
|
267
|
+
border-color: var(--uui-color-default-standalone,rgb(28, 35, 59));
|
|
262
268
|
}
|
|
263
|
-
:host([
|
|
264
|
-
background-color: var(--uui-
|
|
265
|
-
color: var(--uui-
|
|
269
|
+
:host([color='positive']) #toast > div {
|
|
270
|
+
background-color: var(--uui-color-positive,#25aa60);
|
|
271
|
+
color: var(--uui-color-positive-contrast,#fff);
|
|
272
|
+
border-color: var(--uui-color-positive-standalone,rgb(38, 156, 91));
|
|
266
273
|
}
|
|
267
|
-
:host([
|
|
268
|
-
background-color: var(--uui-
|
|
269
|
-
color: var(--uui-
|
|
270
|
-
border-color: var(--uui-
|
|
274
|
+
:host([color='warning']) #toast > div {
|
|
275
|
+
background-color: var(--uui-color-warning,#fad634);
|
|
276
|
+
color: var(--uui-color-warning-contrast,#000);
|
|
277
|
+
border-color: var(--uui-color-warning-standalone,rgb(224, 193, 51));
|
|
271
278
|
}
|
|
272
|
-
:host([
|
|
273
|
-
background-color: var(--uui-
|
|
274
|
-
color: var(--uui-
|
|
275
|
-
border-color: var(--uui-
|
|
279
|
+
:host([color='danger']) #toast > div {
|
|
280
|
+
background-color: var(--uui-color-danger,#d42054);
|
|
281
|
+
color: var(--uui-color-danger-contrast,white);
|
|
282
|
+
border-color: var(--uui-color-danger-standalone,rgb(191, 33, 78));
|
|
276
283
|
}
|
|
277
284
|
`
|
|
278
285
|
];
|
|
279
286
|
__decorateClass([
|
|
280
287
|
property({ reflect: true })
|
|
281
|
-
], UUIToastNotificationElement.prototype, "
|
|
288
|
+
], UUIToastNotificationElement.prototype, "color", 2);
|
|
282
289
|
__decorateClass([
|
|
283
290
|
property({ type: Number })
|
|
284
291
|
], UUIToastNotificationElement.prototype, "autoClose", 1);
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { InterfaceLookType } from '@umbraco-ui/uui-base/lib/types';
|
|
2
1
|
import { LitElement } from 'lit';
|
|
3
2
|
/**
|
|
4
3
|
* @element uui-toast-notification
|
|
@@ -13,11 +12,11 @@ export declare class UUIToastNotificationElement extends LitElement {
|
|
|
13
12
|
static styles: import("lit").CSSResult[];
|
|
14
13
|
/**
|
|
15
14
|
* Changes the look of the notification to one of the predefined, symbolic looks. Example set this to danger for errors.
|
|
16
|
-
* @type {""|"primary"|"positive"|"warning"|"danger"}
|
|
15
|
+
* @type {""|"default"|"primary"|"positive"|"warning"|"danger"}
|
|
17
16
|
* @attr
|
|
18
17
|
* @default ""
|
|
19
18
|
*/
|
|
20
|
-
|
|
19
|
+
color: '' | 'default' | 'positive' | 'warning' | 'danger';
|
|
21
20
|
private _autoClose;
|
|
22
21
|
/**
|
|
23
22
|
* Set an auto-close timer.
|
|
@@ -36,13 +35,13 @@ export declare class UUIToastNotificationElement extends LitElement {
|
|
|
36
35
|
*/
|
|
37
36
|
resumeAutoClose(): void;
|
|
38
37
|
private _onOpenTimerComplete;
|
|
38
|
+
private _toastEl;
|
|
39
39
|
private _timer;
|
|
40
40
|
private _pauseTimer;
|
|
41
|
-
private _toastEl;
|
|
42
|
-
private _animationTimeout?;
|
|
43
41
|
protected isOpen: boolean;
|
|
44
|
-
private _animate;
|
|
45
42
|
private _open;
|
|
43
|
+
private _animate;
|
|
44
|
+
private _animationTimeout?;
|
|
46
45
|
/**
|
|
47
46
|
* define if this toast should open or close.
|
|
48
47
|
* @type boolean
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umbraco-ui/uui-toast-notification",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0-rc.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Umbraco",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"custom-elements.json"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@umbraco-ui/uui-base": "0.
|
|
34
|
-
"@umbraco-ui/uui-button": "0.
|
|
35
|
-
"@umbraco-ui/uui-css": "0.
|
|
36
|
-
"@umbraco-ui/uui-icon": "0.
|
|
37
|
-
"@umbraco-ui/uui-icon-registry-essential": "0.
|
|
33
|
+
"@umbraco-ui/uui-base": "1.0.0-rc.1",
|
|
34
|
+
"@umbraco-ui/uui-button": "1.0.0-rc.1",
|
|
35
|
+
"@umbraco-ui/uui-css": "1.0.0-rc.1",
|
|
36
|
+
"@umbraco-ui/uui-icon": "1.0.0-rc.1",
|
|
37
|
+
"@umbraco-ui/uui-icon-registry-essential": "1.0.0-rc.1"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
40
|
"build": "npm run analyze && tsc --build --force && rollup -c rollup.config.js",
|
|
@@ -45,5 +45,5 @@
|
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"homepage": "https://uui.umbraco.com/?path=/story/uui-toast-notification",
|
|
48
|
-
"gitHead": "
|
|
48
|
+
"gitHead": "127e036dbafa18cc37027591d6548a4cb4700d33"
|
|
49
49
|
}
|