vue-toasts-lite 0.1.3 → 0.1.5
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 +27 -4
- package/dist/index.d.ts +27 -2
- package/dist/index.js +62 -37
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,7 +13,7 @@ A lightweight toast notifications library for Vue 3.
|
|
|
13
13
|
## Features
|
|
14
14
|
|
|
15
15
|
- 🚀 Lightweight and easy to use
|
|
16
|
-
- 🎨 Multiple toast types (success, error, loading, warn)
|
|
16
|
+
- 🎨 Multiple toast types (success, error, loading, warn, info)
|
|
17
17
|
- 📍 Multiple positions (can show in different corners simultaneously)
|
|
18
18
|
- ⚡️ Customizable duration, auto-close, and styling
|
|
19
19
|
- 🎯 TypeScript support
|
|
@@ -53,6 +53,7 @@ toasts.success('Hello!')
|
|
|
53
53
|
toasts.error('Something went wrong')
|
|
54
54
|
toasts.loading('Loading...')
|
|
55
55
|
toasts.warn('Warning message')
|
|
56
|
+
toasts.info('Info message')
|
|
56
57
|
</script>
|
|
57
58
|
```
|
|
58
59
|
|
|
@@ -64,6 +65,7 @@ toasts.success(message, options?)
|
|
|
64
65
|
toasts.error(message, options?)
|
|
65
66
|
toasts.loading(message, options?)
|
|
66
67
|
toasts.warn(message, options?)
|
|
68
|
+
toasts.info(message, options?)
|
|
67
69
|
|
|
68
70
|
// Advanced methods
|
|
69
71
|
toasts.add(options) // Create custom toast
|
|
@@ -71,6 +73,10 @@ toasts.update(id, options) // Update existing toast
|
|
|
71
73
|
toasts.remove(id?) // Remove toast(s)
|
|
72
74
|
toasts.clear() // Clear all toasts
|
|
73
75
|
toasts.promise(promise, options) // Handle promise states
|
|
76
|
+
|
|
77
|
+
// Monitoring methods
|
|
78
|
+
toasts.toastList // Get array of all active toasts
|
|
79
|
+
toasts.onToastsListChange(callback) // Subscribe to toast list changes
|
|
74
80
|
```
|
|
75
81
|
|
|
76
82
|
## Options
|
|
@@ -78,7 +84,7 @@ toasts.promise(promise, options) // Handle promise states
|
|
|
78
84
|
| Option | Type | Default | Description |
|
|
79
85
|
|--------|------|---------|-------------|
|
|
80
86
|
| `message` | `string` | - | Message to display |
|
|
81
|
-
| `type` | `'success' \| 'error' \| 'loading' \| 'warn'` | `'success'` | Toast type |
|
|
87
|
+
| `type` | `'success' \| 'error' \| 'loading' \| 'warn' \| 'info'` | `'success'` | Toast type |
|
|
82
88
|
| `duration` | `number` | `3000` | Duration in milliseconds |
|
|
83
89
|
| `autoClose` | `boolean` | `true` | Auto-close behavior |
|
|
84
90
|
| `position` | `ToastPosition` | `'top-center'` | Toast position |
|
|
@@ -122,16 +128,32 @@ await toasts.promise(
|
|
|
122
128
|
)
|
|
123
129
|
```
|
|
124
130
|
|
|
125
|
-
|
|
126
131
|
## Styling
|
|
127
132
|
|
|
128
|
-
Customize colors and appearance with CSS variables
|
|
133
|
+
Customize colors and appearance with CSS variables or by passing custom classes to `ToastsLiteProvider`:
|
|
134
|
+
|
|
135
|
+
### Custom Classes
|
|
136
|
+
|
|
137
|
+
You can pass custom classes to `ToastsLiteProvider`:
|
|
138
|
+
|
|
139
|
+
```vue
|
|
140
|
+
<ToastsLiteProvider
|
|
141
|
+
container-class="custom-container"
|
|
142
|
+
wrapper-class="custom-wrapper"
|
|
143
|
+
item-class="custom-item"
|
|
144
|
+
/>
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
- `container-class` - class for toast container
|
|
148
|
+
- `wrapper-class` - class for toast wrapper
|
|
149
|
+
- `item-class` - class for individual toast items
|
|
129
150
|
|
|
130
151
|
### CSS Variables
|
|
131
152
|
|
|
132
153
|
```css
|
|
133
154
|
:root {
|
|
134
155
|
--tl-font-family: system-ui, -apple-system, sans-serif;
|
|
156
|
+
--tl-font-size: 14px;
|
|
135
157
|
--tl-bg: hsl(0, 0%, 100%);
|
|
136
158
|
--tl-text: hsl(0, 0%, 20%);
|
|
137
159
|
--tl-border: hsl(0, 0%, 85%);
|
|
@@ -139,6 +161,7 @@ Customize colors and appearance with CSS variables:
|
|
|
139
161
|
--tl-success: hsl(145, 63%, 42%);
|
|
140
162
|
--tl-error: hsl(0, 79%, 63%);
|
|
141
163
|
--tl-warn: hsl(45, 100%, 51%);
|
|
164
|
+
--tl-info: hsl(210, 80%, 55%);
|
|
142
165
|
--tl-icon-color: hsl(0, 0%, 100%);
|
|
143
166
|
--tl-loading-border: hsl(0, 0%, 15%);
|
|
144
167
|
--tl-loading-bg: hsl(0, 0%, 98%);
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,15 @@
|
|
|
1
1
|
import { ComponentOptionsMixin } from 'vue';
|
|
2
2
|
import { ComponentProvideOptions } from 'vue';
|
|
3
3
|
import { DefineComponent } from 'vue';
|
|
4
|
+
import { HTMLAttributes } from 'vue';
|
|
4
5
|
import { PublicProps } from 'vue';
|
|
5
6
|
|
|
7
|
+
declare type __VLS_Props = {
|
|
8
|
+
containerClass?: HTMLAttributes["class"];
|
|
9
|
+
wrapperClass?: HTMLAttributes["class"];
|
|
10
|
+
itemClass?: HTMLAttributes["class"];
|
|
11
|
+
};
|
|
12
|
+
|
|
6
13
|
declare type Id = string;
|
|
7
14
|
|
|
8
15
|
declare interface IToastsController {
|
|
@@ -12,6 +19,7 @@ declare interface IToastsController {
|
|
|
12
19
|
loading: (message: string, options?: ToastSimpleOptions) => Id;
|
|
13
20
|
error: (message: string, options?: ToastSimpleOptions) => Id;
|
|
14
21
|
warn: (message: string, options?: ToastSimpleOptions) => Id;
|
|
22
|
+
info: (message: string, options?: ToastSimpleOptions) => Id;
|
|
15
23
|
promise: <T>(promise: Promise<T>, options: ToastPromiseOptions) => Promise<Id>;
|
|
16
24
|
remove: (id?: Id) => void;
|
|
17
25
|
clear: () => void;
|
|
@@ -263,6 +271,23 @@ declare class ToastsController implements IToastsController {
|
|
|
263
271
|
* @see {@link promise} for automatic promise-based state management
|
|
264
272
|
*/
|
|
265
273
|
loading(message: string, options?: Omit<ToastSimpleOptions, "type">): string;
|
|
274
|
+
/**
|
|
275
|
+
* Displays an **info** toast notification.
|
|
276
|
+
*
|
|
277
|
+
* @param message - Text content to display in the toast
|
|
278
|
+
* @param options - Optional configuration (position, duration, autoClose, id)
|
|
279
|
+
* @returns Unique identifier of the created toast
|
|
280
|
+
*
|
|
281
|
+
* @example
|
|
282
|
+
* ```ts
|
|
283
|
+
* // Simple info message
|
|
284
|
+
* toasts.info('New version available')
|
|
285
|
+
*
|
|
286
|
+
* // With custom position
|
|
287
|
+
* toasts.info('Tip: press Cmd+K to search', { position: 'bottom-right' })
|
|
288
|
+
* ```
|
|
289
|
+
*/
|
|
290
|
+
info(message: string, options?: Omit<ToastSimpleOptions, "type">): string;
|
|
266
291
|
/**
|
|
267
292
|
* Displays a **promise** toast that automatically updates based on promise resolution.
|
|
268
293
|
*
|
|
@@ -306,8 +331,8 @@ declare class ToastsController implements IToastsController {
|
|
|
306
331
|
|
|
307
332
|
export declare type ToastSimpleOptions = Partial<Omit<Toast, "message">>;
|
|
308
333
|
|
|
309
|
-
export declare const ToastsLiteProvider: DefineComponent<
|
|
334
|
+
export declare const ToastsLiteProvider: DefineComponent<__VLS_Props, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, false, {}, any>;
|
|
310
335
|
|
|
311
|
-
export declare type ToastType = "success" | "loading" | "error" | "warn";
|
|
336
|
+
export declare type ToastType = "success" | "loading" | "error" | "warn" | "info";
|
|
312
337
|
|
|
313
338
|
export { }
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
var M = Object.defineProperty;
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { ref as
|
|
2
|
+
var U = (r, t, e) => t in r ? M(r, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : r[t] = e;
|
|
3
|
+
var m = (r, t, e) => U(r, typeof t != "symbol" ? t + "" : t, e);
|
|
4
|
+
import { ref as p, defineComponent as D, watch as $, onMounted as L, onUnmounted as k, createElementBlock as y, openBlock as d, withModifiers as A, normalizeStyle as E, createCommentVNode as x, createElementVNode as h, normalizeClass as g, toDisplayString as B, computed as P, createBlock as C, Teleport as I, Fragment as b, renderList as w, unref as v, createVNode as N, TransitionGroup as R, withCtx as S } from "vue";
|
|
5
5
|
class V extends Map {
|
|
6
6
|
constructor() {
|
|
7
7
|
super(...arguments);
|
|
8
|
-
|
|
8
|
+
m(this, "subscribers", []);
|
|
9
9
|
}
|
|
10
10
|
set(e, o) {
|
|
11
11
|
return super.set(e, o), this.notify(), this;
|
|
@@ -26,7 +26,7 @@ class V extends Map {
|
|
|
26
26
|
this.subscribers.forEach((e) => e(Array.from(this.values())));
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
const
|
|
29
|
+
const T = {
|
|
30
30
|
type: "success",
|
|
31
31
|
message: "Hello from Toasts Lite",
|
|
32
32
|
autoClose: !0,
|
|
@@ -35,8 +35,8 @@ const w = {
|
|
|
35
35
|
};
|
|
36
36
|
class j {
|
|
37
37
|
constructor() {
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
m(this, "counter", 0);
|
|
39
|
+
m(this, "toasts");
|
|
40
40
|
this.toasts = new V();
|
|
41
41
|
}
|
|
42
42
|
/**
|
|
@@ -237,6 +237,25 @@ class j {
|
|
|
237
237
|
loading(t, e) {
|
|
238
238
|
return this.addOrUpdate({ ...e, message: t, type: "loading" });
|
|
239
239
|
}
|
|
240
|
+
/**
|
|
241
|
+
* Displays an **info** toast notification.
|
|
242
|
+
*
|
|
243
|
+
* @param message - Text content to display in the toast
|
|
244
|
+
* @param options - Optional configuration (position, duration, autoClose, id)
|
|
245
|
+
* @returns Unique identifier of the created toast
|
|
246
|
+
*
|
|
247
|
+
* @example
|
|
248
|
+
* ```ts
|
|
249
|
+
* // Simple info message
|
|
250
|
+
* toasts.info('New version available')
|
|
251
|
+
*
|
|
252
|
+
* // With custom position
|
|
253
|
+
* toasts.info('Tip: press Cmd+K to search', { position: 'bottom-right' })
|
|
254
|
+
* ```
|
|
255
|
+
*/
|
|
256
|
+
info(t, e) {
|
|
257
|
+
return this.addOrUpdate({ ...e, message: t, type: "info" });
|
|
258
|
+
}
|
|
240
259
|
/**
|
|
241
260
|
* Displays a **promise** toast that automatically updates based on promise resolution.
|
|
242
261
|
*
|
|
@@ -292,17 +311,17 @@ class j {
|
|
|
292
311
|
return this.toasts.set(e, { ...this.mergeWithDefaultOptions(o), id: e }), e;
|
|
293
312
|
}
|
|
294
313
|
mergeWithDefaultOptions(t) {
|
|
295
|
-
const e = Object.assign({},
|
|
296
|
-
for (let o in
|
|
314
|
+
const e = Object.assign({}, T);
|
|
315
|
+
for (let o in T) {
|
|
297
316
|
const n = o, s = t[n];
|
|
298
317
|
s != null && (e[n] = s);
|
|
299
318
|
}
|
|
300
319
|
return e;
|
|
301
320
|
}
|
|
302
321
|
}
|
|
303
|
-
const
|
|
322
|
+
const O = new j();
|
|
304
323
|
function z() {
|
|
305
|
-
const r =
|
|
324
|
+
const r = p(/* @__PURE__ */ new Map());
|
|
306
325
|
function t(n, s, a) {
|
|
307
326
|
r.value.has(n) || r.value.set(n, []);
|
|
308
327
|
const i = r.value.get(n);
|
|
@@ -325,7 +344,7 @@ function z() {
|
|
|
325
344
|
const F = {
|
|
326
345
|
key: 0,
|
|
327
346
|
class: "toasts-lite__icon"
|
|
328
|
-
}, W = { class: "toasts-lite__content" }, G = { class: "toasts-lite__content-message" }, H = /* @__PURE__ */
|
|
347
|
+
}, W = { class: "toasts-lite__content" }, G = { class: "toasts-lite__content-message" }, H = /* @__PURE__ */ D({
|
|
329
348
|
__name: "ToastsLiteItem",
|
|
330
349
|
props: {
|
|
331
350
|
id: {},
|
|
@@ -337,7 +356,7 @@ const F = {
|
|
|
337
356
|
},
|
|
338
357
|
emits: ["close"],
|
|
339
358
|
setup(r, { expose: t, emit: e }) {
|
|
340
|
-
const o = r, n = e, s =
|
|
359
|
+
const o = r, n = e, s = p(null), a = p(0), i = p(0);
|
|
341
360
|
function c() {
|
|
342
361
|
s.value && clearTimeout(s.value), n("close");
|
|
343
362
|
}
|
|
@@ -350,38 +369,43 @@ const F = {
|
|
|
350
369
|
function f() {
|
|
351
370
|
s.value && (clearTimeout(s.value), s.value = null), o.autoClose && (a.value = Date.now(), i.value = o.duration, s.value = setTimeout(c, o.duration));
|
|
352
371
|
}
|
|
353
|
-
return
|
|
372
|
+
return $(
|
|
354
373
|
() => [o.autoClose, o.duration],
|
|
355
374
|
() => {
|
|
356
375
|
f();
|
|
357
376
|
}
|
|
358
|
-
),
|
|
377
|
+
), L(() => {
|
|
359
378
|
f();
|
|
360
379
|
}), k(() => {
|
|
361
380
|
s.value && clearTimeout(s.value);
|
|
362
381
|
}), t({
|
|
363
382
|
pause: u,
|
|
364
383
|
resume: l
|
|
365
|
-
}), (_, J) => (d(),
|
|
384
|
+
}), (_, J) => (d(), y("div", {
|
|
366
385
|
class: "toasts-lite__toast",
|
|
367
386
|
style: E(`--toast-duration: ${r.duration}s;`),
|
|
368
387
|
onClick: A(c, ["prevent"])
|
|
369
388
|
}, [
|
|
370
|
-
["success", "error", "loading", "warn"].includes(r.type) ? (d(),
|
|
371
|
-
|
|
372
|
-
class:
|
|
389
|
+
["success", "error", "loading", "warn", "info"].includes(r.type) ? (d(), y("div", F, [
|
|
390
|
+
h("div", {
|
|
391
|
+
class: g(`toasts-lite__${r.type}`)
|
|
373
392
|
}, null, 2)
|
|
374
393
|
])) : x("", !0),
|
|
375
|
-
|
|
376
|
-
|
|
394
|
+
h("div", W, [
|
|
395
|
+
h("div", G, B(r.message), 1)
|
|
377
396
|
])
|
|
378
397
|
], 4));
|
|
379
398
|
}
|
|
380
|
-
}), q = ["onMouseenter", "onMouseleave"], X = /* @__PURE__ */
|
|
399
|
+
}), q = ["onMouseenter", "onMouseleave"], X = /* @__PURE__ */ D({
|
|
381
400
|
__name: "ToastsLiteProvider",
|
|
401
|
+
props: {
|
|
402
|
+
containerClass: {},
|
|
403
|
+
wrapperClass: {},
|
|
404
|
+
itemClass: {}
|
|
405
|
+
},
|
|
382
406
|
setup(r) {
|
|
383
|
-
const t = ["top-left", "top-center", "top-right", "middle-center", "bottom-left", "bottom-center", "bottom-right"], e =
|
|
384
|
-
|
|
407
|
+
const t = ["top-left", "top-center", "top-right", "middle-center", "bottom-left", "bottom-center", "bottom-right"], e = p([]), { setRef: o, pauseAll: n, resumeAll: s } = z();
|
|
408
|
+
O.onToastsListChange((i) => {
|
|
385
409
|
e.value = i;
|
|
386
410
|
});
|
|
387
411
|
const a = P(() => {
|
|
@@ -391,42 +415,43 @@ const F = {
|
|
|
391
415
|
i.has(u) || i.set(u, []), i.get(u).push(c);
|
|
392
416
|
}), i;
|
|
393
417
|
});
|
|
394
|
-
return (i, c) => (d(),
|
|
395
|
-
(d(),
|
|
418
|
+
return (i, c) => (d(), C(I, { to: "body" }, [
|
|
419
|
+
(d(), y(b, null, w(t, (u) => h("div", {
|
|
396
420
|
key: u,
|
|
397
|
-
class:
|
|
421
|
+
class: g(["toasts-lite__toast-container", [r.containerClass, `toasts-lite__${u}`]])
|
|
398
422
|
}, [
|
|
399
|
-
|
|
400
|
-
class: "toasts-lite__toast-wrapper",
|
|
401
|
-
onMouseenter: (l) =>
|
|
402
|
-
onMouseleave: (l) =>
|
|
423
|
+
h("div", {
|
|
424
|
+
class: g(["toasts-lite__toast-wrapper", r.wrapperClass]),
|
|
425
|
+
onMouseenter: (l) => v(n)(u),
|
|
426
|
+
onMouseleave: (l) => v(s)(u)
|
|
403
427
|
}, [
|
|
404
428
|
N(R, {
|
|
405
429
|
name: "toasts-lite",
|
|
406
430
|
appear: ""
|
|
407
431
|
}, {
|
|
408
432
|
default: S(() => [
|
|
409
|
-
(d(!0),
|
|
433
|
+
(d(!0), y(b, null, w(a.value.get(u) || [], (l, f) => (d(), C(H, {
|
|
410
434
|
id: l.id,
|
|
411
435
|
ref_for: !0,
|
|
412
|
-
ref: (_) =>
|
|
436
|
+
ref: (_) => v(o)(u, f, _),
|
|
413
437
|
key: l.id,
|
|
414
438
|
type: l.type,
|
|
415
439
|
message: l.message,
|
|
416
440
|
"auto-close": l.autoClose,
|
|
417
441
|
duration: l.duration,
|
|
418
442
|
position: l.position,
|
|
419
|
-
|
|
420
|
-
|
|
443
|
+
class: g(r.itemClass),
|
|
444
|
+
onClose: (_) => v(O).remove(l.id)
|
|
445
|
+
}, null, 8, ["id", "type", "message", "auto-close", "duration", "position", "class", "onClose"]))), 128))
|
|
421
446
|
]),
|
|
422
447
|
_: 2
|
|
423
448
|
}, 1024)
|
|
424
|
-
],
|
|
449
|
+
], 42, q)
|
|
425
450
|
], 2)), 64))
|
|
426
451
|
]));
|
|
427
452
|
}
|
|
428
453
|
});
|
|
429
454
|
export {
|
|
430
455
|
X as ToastsLiteProvider,
|
|
431
|
-
|
|
456
|
+
O as toasts
|
|
432
457
|
};
|
package/dist/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
:root{--toasts-lite-font-family: var(--tl-font-family, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif);--toasts-lite-bg: var(--tl-bg, hsl(0, 0%, 100%));--toasts-lite-text: var(--tl-text, hsl(0, 0%, 20%));--toasts-lite-border: var(--tl-border, hsl(0, 0%, 85%));--toasts-lite-shadow: var(--tl-shadow, hsla(0, 0%, 0%, .1));--toasts-lite-success: var(--tl-success, hsl(145, 63%, 42%));--toasts-lite-error: var(--tl-error, hsl(0, 79%, 63%));--toasts-lite-warn: var(--tl-warn, hsl(45, 100%, 51%));--toasts-lite-icon-color: var(--tl-icon-color, hsl(0, 0%, 100%));--toasts-lite-loading-border-main: var(--tl-loading-border, hsl(0, 0%, 15%));--toasts-lite-loading-border-bg: var(--tl-loading-bg, hsl(0, 0%, 98%))}@keyframes scaleAnimation{0%{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}@keyframes loadingRotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.toasts-lite-enter-active,.toasts-lite-leave-active{transition:opacity .3s ease,transform .3s ease}.toasts-lite-enter-from,.toasts-lite-leave-to{opacity:0;transform:translateY(-10px)}.toasts-lite__toast-container{position:fixed;z-index:9999;margin:10px;overflow:visible;display:flex;flex-direction:column;align-items:center;padding-top:12px;pointer-events:none}.toasts-lite__toast-wrapper{display:flex;flex-direction:column;align-items:center;gap:12px;pointer-events:auto}.toasts-lite__toast{font-family:var(--toasts-lite-font-family);display:flex;justify-content:center;align-items:center;background:var(--toasts-lite-bg);color:var(--toasts-lite-text);border:1px solid var(--toasts-lite-border);box-shadow:var(--toasts-lite-shadow) 0 0 10px;min-width:100px;max-width:1200px;padding:10px 20px;border-radius:8px;cursor:pointer;pointer-events:auto;text-overflow:ellipsis}.toasts-lite__icon{margin-right:12px}.toasts-lite__top-left{top:0;left:0}.toasts-lite__top-center{top:0;left:50%;transform:translate(-50%);min-width:80vw}.toasts-lite__top-right{top:0;right:0}.toasts-lite__bottom-left{bottom:0;left:0}.toasts-lite__bottom-center{bottom:0;left:50%;transform:translate(-50%)}.toasts-lite__bottom-right{bottom:0;right:0}.toasts-lite__middle-center{top:50%;left:50%;transform:translate(-50%,-50%)}.toasts-lite__success{width:20px;height:20px;border-radius:10px;background-color:var(--toasts-lite-success);position:relative;opacity:0;animation:scaleAnimation .3s cubic-bezier(.75,.885,.32,1.275) forwards;animation-delay:.1s}.toasts-lite__success:after{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:12px;height:12px;mask-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="
|
|
1
|
+
:root{--toasts-lite-font-family: var(--tl-font-family, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif);--toasts-lite-font-size: var(--tl-font-size, 14px);--toasts-lite-bg: var(--tl-bg, hsl(0, 0%, 100%));--toasts-lite-text: var(--tl-text, hsl(0, 0%, 20%));--toasts-lite-border: var(--tl-border, hsl(0, 0%, 85%));--toasts-lite-shadow: var(--tl-shadow, hsla(0, 0%, 0%, .1));--toasts-lite-success: var(--tl-success, hsl(145, 63%, 42%));--toasts-lite-error: var(--tl-error, hsl(0, 79%, 63%));--toasts-lite-warn: var(--tl-warn, hsl(45, 100%, 51%));--toasts-lite-info: var(--tl-info, hsl(210, 80%, 55%));--toasts-lite-icon-color: var(--tl-icon-color, hsl(0, 0%, 100%));--toasts-lite-loading-border-main: var(--tl-loading-border, hsl(0, 0%, 15%));--toasts-lite-loading-border-bg: var(--tl-loading-bg, hsl(0, 0%, 98%))}@keyframes scaleAnimation{0%{transform:scale(0);opacity:0}to{transform:scale(1);opacity:1}}@keyframes loadingRotate{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.toasts-lite-enter-active,.toasts-lite-leave-active{transition:opacity .3s ease,transform .3s ease}.toasts-lite-enter-from,.toasts-lite-leave-to{opacity:0;transform:translateY(-10px)}.toasts-lite__toast-container{position:fixed;z-index:9999;margin:10px;overflow:visible;display:flex;flex-direction:column;align-items:center;padding-top:12px;pointer-events:none}.toasts-lite__toast-wrapper{display:flex;flex-direction:column;align-items:center;gap:12px;pointer-events:auto}.toasts-lite__toast{font-family:var(--toasts-lite-font-family);font-size:var(--toasts-lite-font-size);display:flex;justify-content:center;align-items:center;background:var(--toasts-lite-bg);color:var(--toasts-lite-text);border:1px solid var(--toasts-lite-border);box-shadow:var(--toasts-lite-shadow) 0 0 10px;min-width:100px;max-width:1200px;padding:10px 20px;border-radius:8px;cursor:pointer;pointer-events:auto;text-overflow:ellipsis}.toasts-lite__icon{margin-right:12px}.toasts-lite__top-left{top:0;left:0}.toasts-lite__top-center{top:0;left:50%;transform:translate(-50%);min-width:80vw}.toasts-lite__top-right{top:0;right:0}.toasts-lite__bottom-left{bottom:0;left:0}.toasts-lite__bottom-center{bottom:0;left:50%;transform:translate(-50%)}.toasts-lite__bottom-right{bottom:0;right:0}.toasts-lite__middle-center{top:50%;left:50%;transform:translate(-50%,-50%)}.toasts-lite__success{width:20px;height:20px;border-radius:10px;background-color:var(--toasts-lite-success);position:relative;opacity:0;animation:scaleAnimation .3s cubic-bezier(.75,.885,.32,1.275) forwards;animation-delay:.1s}.toasts-lite__success:after{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:12px;height:12px;mask-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="4" stroke="black"><path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg>');-webkit-mask-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="4" stroke="black"><path stroke-linecap="round" stroke-linejoin="round" d="m4.5 12.75 6 6 9-13.5" /></svg>');background-color:var(--toasts-lite-icon-color);background-size:100%;background-position:center;background-repeat:no-repeat}.toasts-lite__error{width:20px;height:20px;border-radius:10px;background-color:var(--toasts-lite-error);position:relative;opacity:0;animation:scaleAnimation .3s cubic-bezier(.75,.885,.32,1.275) forwards;animation-delay:.1s}.toasts-lite__error:after{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:12px;height:12px;mask-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="4" stroke="black"><path stroke-linecap="round" stroke-linejoin="round" d="M6 6l12 12M18 6l-12 12" /></svg>');-webkit-mask-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="4" stroke="black"><path stroke-linecap="round" stroke-linejoin="round" d="M6 6l12 12M18 6l-12 12" /></svg>');background-color:var(--toasts-lite-icon-color);background-size:100%;background-position:center;background-repeat:no-repeat}.toasts-lite__warn{width:20px;height:20px;border-radius:10px;background-color:var(--toasts-lite-warn);position:relative;opacity:0;animation:scaleAnimation .3s cubic-bezier(.75,.885,.32,1.275) forwards;animation-delay:.1s}.toasts-lite__warn:after{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:12px;height:12px;mask-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="4" stroke="black" ><path stroke-linecap="round" stroke-linejoin="round" d="M5 12h14" /></svg>');-webkit-mask-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="4" stroke="black" ><path stroke-linecap="round" stroke-linejoin="round" d="M5 12h14" /></svg>');background-color:var(--toasts-lite-icon-color);background-size:100%;background-position:center;background-repeat:no-repeat}.toasts-lite__info{width:20px;height:20px;border-radius:10px;background-color:var(--toasts-lite-info);position:relative;opacity:0;animation:scaleAnimation .3s cubic-bezier(.75,.885,.32,1.275) forwards;animation-delay:.1s}.toasts-lite__info:after{content:"";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:12px;height:12px;mask-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="4" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 12v7M12 5h.01" /></svg>');-webkit-mask-image:url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="4" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" d="M12 12v7M12 5h.01" /></svg>');background-color:var(--toasts-lite-icon-color);background-size:100%;background-position:center;background-repeat:no-repeat}.toasts-lite__loading{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toasts-lite-loading-border-main);border-right-color:var(--toasts-lite-loading-border-bg);animation:loadingRotate 1s linear infinite}
|