vue-toastflow 1.2.0-beta.2 โ 1.2.0-beta.3
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 +74 -72
- package/dist/src/components/Toast.vue.d.mts +50 -0
- package/dist/src/components/ToastButtonsGroup.vue.d.mts +8 -0
- package/dist/src/components/ToastContainer.vue.d.mts +28 -0
- package/dist/src/components/ToastContainer.vue.d.ts +5 -5
- package/dist/src/components/ToastProgress.vue.d.mts +13 -0
- package/dist/src/components/ToastProgress.vue.d.ts +5 -1
- package/dist/src/components/ToastSlotProvider.vue.d.mts +38 -0
- package/dist/src/components/ToastSlotProvider.vue.d.ts +38 -0
- package/dist/src/components/icons/ArrowPath.vue.d.mts +2 -0
- package/dist/src/components/icons/Bell.vue.d.mts +2 -0
- package/dist/src/components/icons/CheckCircle.vue.d.mts +2 -0
- package/dist/src/components/icons/InfoCircle.vue.d.mts +2 -0
- package/dist/src/components/icons/QuestionMarkCircle.vue.d.mts +2 -0
- package/dist/src/components/icons/XCircle.vue.d.mts +2 -0
- package/dist/src/components/icons/XMark.vue.d.mts +2 -0
- package/dist/src/index.d.mts +14 -0
- package/dist/src/index.d.ts +1 -0
- package/dist/src/plugin.d.mts +7 -0
- package/dist/src/plugin.d.ts +5 -1
- package/dist/src/symbols.d.mts +3 -0
- package/dist/src/toast-ui.d.mts +159 -0
- package/dist/src/toast-ui.d.ts +159 -0
- package/dist/src/toast.d.mts +47 -0
- package/dist/toastflow.es.js +1018 -721
- package/dist/toastflow.umd.js +901 -2
- package/dist/vue-toastflow.css +603 -0
- package/package.json +5 -6
- package/src/components/Toast.vue +36 -1609
- package/src/components/ToastContainer.vue +424 -481
- package/src/components/ToastProgress.vue +42 -67
- package/src/components/ToastSlotProvider.vue +65 -0
- package/src/env.d.ts +5 -1
- package/src/index.ts +1 -2
- package/src/plugin.ts +35 -1
- package/src/styles.css +603 -0
- package/src/toast-ui.ts +1477 -0
- package/src/toast.ts +132 -132
package/README.md
CHANGED
|
@@ -1,72 +1,74 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="../../assets/banner.png" alt="Toastflow" width="100%" />
|
|
3
|
-
</p>
|
|
4
|
-
|
|
5
|
-
<h1 align="center">๐ข vue-toastflow</h1>
|
|
6
|
-
|
|
7
|
-
<p align="center">
|
|
8
|
-
<strong>Vue 3 renderer for Toastflow</strong> โ components, programmatic API, and beautiful defaults.
|
|
9
|
-
</p>
|
|
10
|
-
|
|
11
|
-
<p align="center">
|
|
12
|
-
<a href="https://www.npmjs.com/package/vue-toastflow"><img src="https://img.shields.io/npm/v/vue-toastflow?color=43b883&style=flat-square" alt="npm version" /></a>
|
|
13
|
-
<a href="https://www.npmjs.com/package/vue-toastflow"><img src="https://img.shields.io/npm/dm/vue-toastflow?style=flat-square" alt="npm downloads" /></a>
|
|
14
|
-
<a href="../../LICENSE"><img src="https://img.shields.io/github/license/adrianjanocko/toastflow?style=flat-square" alt="License" /></a>
|
|
15
|
-
</p>
|
|
16
|
-
|
|
17
|
-
<p align="center">
|
|
18
|
-
<a href="https://
|
|
19
|
-
</p>
|
|
20
|
-
|
|
21
|
-
---
|
|
22
|
-
|
|
23
|
-
> ๐ Using **Nuxt**? Install [`nuxt-toastflow`](https://www.npmjs.com/package/nuxt-toastflow) instead โ it wraps this package with auto-imports and SSR support.
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
|
30
|
-
|
|
|
31
|
-
|
|
|
32
|
-
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
import {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="../../assets/banner.png" alt="Toastflow" width="100%" />
|
|
3
|
+
</p>
|
|
4
|
+
|
|
5
|
+
<h1 align="center">๐ข vue-toastflow</h1>
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<strong>Vue 3 renderer for Toastflow</strong> โ components, programmatic API, and beautiful defaults.
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://www.npmjs.com/package/vue-toastflow"><img src="https://img.shields.io/npm/v/vue-toastflow?color=43b883&style=flat-square" alt="npm version" /></a>
|
|
13
|
+
<a href="https://www.npmjs.com/package/vue-toastflow"><img src="https://img.shields.io/npm/dm/vue-toastflow?style=flat-square" alt="npm downloads" /></a>
|
|
14
|
+
<a href="../../LICENSE"><img src="https://img.shields.io/github/license/adrianjanocko/toastflow?style=flat-square" alt="License" /></a>
|
|
15
|
+
</p>
|
|
16
|
+
|
|
17
|
+
<p align="center">
|
|
18
|
+
<a href="https://www.toastflow.top/docs">๐ Docs</a> ยท <a href="https://www.toastflow.top/">๐ฎ Playground</a> ยท <a href="https://www.toastflow.top/docs/more/comparisons">โ๏ธ Comparisons</a>
|
|
19
|
+
</p>
|
|
20
|
+
|
|
21
|
+
---
|
|
22
|
+
|
|
23
|
+
> ๐ Using **Nuxt**? Install [`nuxt-toastflow`](https://www.npmjs.com/package/nuxt-toastflow) instead โ it wraps this package with auto-imports and SSR support.
|
|
24
|
+
|
|
25
|
+
> `createToastflow()` injects Toastflow's default CSS by default. Pass `createToastflow(config, { css: false })` to disable that and import `vue-toastflow/styles.css` manually only when you want the shipped styles.
|
|
26
|
+
|
|
27
|
+
## ๐ฆ What's Included
|
|
28
|
+
|
|
29
|
+
| | Feature |
|
|
30
|
+
| :-: | :------------------------------------------------------- |
|
|
31
|
+
| ๐ | `createToastflow` plugin |
|
|
32
|
+
| ๐ฏ | `toast` programmatic API |
|
|
33
|
+
| ๐งฑ | `<ToastContainer />` ยท `<Toast />` ยท `<ToastProgress />` |
|
|
34
|
+
| ๐จ | Default styles and icon components |
|
|
35
|
+
|
|
36
|
+
## ๐ Quick Start
|
|
37
|
+
|
|
38
|
+
**1. Install**
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
pnpm add vue-toastflow
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**2. Register the plugin**
|
|
45
|
+
|
|
46
|
+
```ts
|
|
47
|
+
// main.ts
|
|
48
|
+
import { createApp } from "vue";
|
|
49
|
+
import App from "./App.vue";
|
|
50
|
+
import { createToastflow } from "vue-toastflow";
|
|
51
|
+
|
|
52
|
+
createApp(App).use(createToastflow()).mount("#app");
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
**3. Use it โจ**
|
|
56
|
+
|
|
57
|
+
```vue
|
|
58
|
+
<!-- App.vue -->
|
|
59
|
+
<script setup lang="ts">
|
|
60
|
+
import { ToastContainer, toast } from "vue-toastflow";
|
|
61
|
+
|
|
62
|
+
toast.success({ title: "Saved", description: "Your changes are live." });
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<template>
|
|
66
|
+
<ToastContainer />
|
|
67
|
+
</template>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
> ๐ก See the full [Vue Quick Start](https://www.toastflow.top/docs/vue/quick-start) guide for theming, slots, events, and more.
|
|
71
|
+
|
|
72
|
+
## ๐ License
|
|
73
|
+
|
|
74
|
+
[MIT](../../LICENSE) โ made with โค๏ธ by [@adrianjanocko](https://github.com/adrianjanocko)
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ToastInstance, ToastStandaloneInstance } from 'toastflow-core';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
toast: ToastStandaloneInstance | ToastInstance;
|
|
4
|
+
progressResetKey?: number;
|
|
5
|
+
duplicateKey?: number;
|
|
6
|
+
updateKey?: number;
|
|
7
|
+
bumpAnimationClass?: string;
|
|
8
|
+
clearAllAnimationClass?: string;
|
|
9
|
+
updateAnimationClass?: string;
|
|
10
|
+
};
|
|
11
|
+
declare function __VLS_template(): {
|
|
12
|
+
attrs: Partial<{}>;
|
|
13
|
+
slots: {
|
|
14
|
+
icon?(_: {
|
|
15
|
+
toast: ToastInstance;
|
|
16
|
+
}): any;
|
|
17
|
+
default?(_: {
|
|
18
|
+
toast: ToastInstance;
|
|
19
|
+
}): any;
|
|
20
|
+
'created-at'?(_: {
|
|
21
|
+
toast: ToastInstance;
|
|
22
|
+
formatted: string;
|
|
23
|
+
}): any;
|
|
24
|
+
'created-at'?(_: {
|
|
25
|
+
toast: ToastInstance;
|
|
26
|
+
formatted: string;
|
|
27
|
+
}): any;
|
|
28
|
+
progress?(_: {
|
|
29
|
+
toast: ToastInstance;
|
|
30
|
+
}): any;
|
|
31
|
+
'close-icon'?(_: {
|
|
32
|
+
toast: ToastInstance;
|
|
33
|
+
}): any;
|
|
34
|
+
};
|
|
35
|
+
refs: {};
|
|
36
|
+
rootEl: HTMLDivElement;
|
|
37
|
+
};
|
|
38
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
39
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
40
|
+
dismiss: (id: string) => any;
|
|
41
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
42
|
+
onDismiss?: ((id: string) => any) | undefined;
|
|
43
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
44
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
45
|
+
export default _default;
|
|
46
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
47
|
+
new (): {
|
|
48
|
+
$slots: S;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ToastButton } from 'toastflow-core';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
buttons: ToastButton[];
|
|
4
|
+
classes: Array<string | undefined>;
|
|
5
|
+
onButtonClick: (button: ToastButton, event: MouseEvent) => void;
|
|
6
|
+
};
|
|
7
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ToastId, ToastInstance } from 'toastflow-core';
|
|
2
|
+
declare function __VLS_template(): {
|
|
3
|
+
attrs: Partial<{}>;
|
|
4
|
+
slots: {
|
|
5
|
+
default?(_: {
|
|
6
|
+
toast: ToastInstance;
|
|
7
|
+
progressResetKey: number | undefined;
|
|
8
|
+
duplicateKey: number | undefined;
|
|
9
|
+
updateKey: number | undefined;
|
|
10
|
+
bumpAnimationClass: string | undefined;
|
|
11
|
+
clearAllAnimationClass: string | undefined;
|
|
12
|
+
updateAnimationClass: string | undefined;
|
|
13
|
+
dismiss: (id: ToastId) => void;
|
|
14
|
+
ui: import('..').ToastUI;
|
|
15
|
+
}): any;
|
|
16
|
+
};
|
|
17
|
+
refs: {};
|
|
18
|
+
rootEl: HTMLDivElement;
|
|
19
|
+
};
|
|
20
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
21
|
+
declare const __VLS_component: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
22
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
25
|
+
new (): {
|
|
26
|
+
$slots: S;
|
|
27
|
+
};
|
|
28
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { ToastId, ToastInstance } from 'toastflow-core';
|
|
2
|
-
declare function handleDismiss(id: ToastId): void;
|
|
3
2
|
declare function __VLS_template(): {
|
|
4
3
|
attrs: Partial<{}>;
|
|
5
4
|
slots: {
|
|
6
5
|
default?(_: {
|
|
7
6
|
toast: ToastInstance;
|
|
8
|
-
progressResetKey: number;
|
|
9
|
-
duplicateKey: number;
|
|
10
|
-
updateKey: number;
|
|
7
|
+
progressResetKey: number | undefined;
|
|
8
|
+
duplicateKey: number | undefined;
|
|
9
|
+
updateKey: number | undefined;
|
|
11
10
|
bumpAnimationClass: string | undefined;
|
|
12
11
|
clearAllAnimationClass: string | undefined;
|
|
13
12
|
updateAnimationClass: string | undefined;
|
|
14
|
-
dismiss:
|
|
13
|
+
dismiss: (id: ToastId) => void;
|
|
14
|
+
ui: import('..').ToastUI;
|
|
15
15
|
}): any;
|
|
16
16
|
};
|
|
17
17
|
refs: {};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ToastProgressAlignment, ToastType } from 'toastflow-core';
|
|
2
|
+
type ToastSlotProps = Record<string, unknown>;
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
type?: ToastType;
|
|
5
|
+
progressAlignment?: ToastProgressAlignment;
|
|
6
|
+
trackProps?: ToastSlotProps;
|
|
7
|
+
barProps?: ToastSlotProps;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
10
|
+
type: ToastType;
|
|
11
|
+
progressAlignment: ToastProgressAlignment;
|
|
12
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
13
|
+
export default _default;
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { ToastProgressAlignment, ToastType } from 'toastflow-core';
|
|
2
|
+
type ToastSlotProps = Record<string, unknown>;
|
|
2
3
|
type __VLS_Props = {
|
|
3
|
-
type
|
|
4
|
+
type?: ToastType;
|
|
4
5
|
progressAlignment?: ToastProgressAlignment;
|
|
6
|
+
trackProps?: ToastSlotProps;
|
|
7
|
+
barProps?: ToastSlotProps;
|
|
5
8
|
};
|
|
6
9
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
10
|
+
type: ToastType;
|
|
7
11
|
progressAlignment: ToastProgressAlignment;
|
|
8
12
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
9
13
|
export default _default;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ToastId, ToastInstance, ToastStandaloneInstance } from 'toastflow-core';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
toast: ToastStandaloneInstance | ToastInstance;
|
|
4
|
+
progressResetKey?: number;
|
|
5
|
+
duplicateKey?: number;
|
|
6
|
+
updateKey?: number;
|
|
7
|
+
bumpAnimationClass?: string;
|
|
8
|
+
clearAllAnimationClass?: string;
|
|
9
|
+
updateAnimationClass?: string;
|
|
10
|
+
};
|
|
11
|
+
declare function dismiss(id: ToastId): void;
|
|
12
|
+
declare function __VLS_template(): {
|
|
13
|
+
attrs: Partial<{}>;
|
|
14
|
+
slots: {
|
|
15
|
+
default?(_: {
|
|
16
|
+
toast: ToastInstance;
|
|
17
|
+
progressResetKey: number | undefined;
|
|
18
|
+
duplicateKey: number | undefined;
|
|
19
|
+
updateKey: number | undefined;
|
|
20
|
+
bumpAnimationClass: string | undefined;
|
|
21
|
+
clearAllAnimationClass: string | undefined;
|
|
22
|
+
updateAnimationClass: string | undefined;
|
|
23
|
+
dismiss: typeof dismiss;
|
|
24
|
+
ui: import('..').ToastUI;
|
|
25
|
+
}): any;
|
|
26
|
+
};
|
|
27
|
+
refs: {};
|
|
28
|
+
rootEl: any;
|
|
29
|
+
};
|
|
30
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
31
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
35
|
+
new (): {
|
|
36
|
+
$slots: S;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ToastId, ToastInstance, ToastStandaloneInstance } from 'toastflow-core';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
toast: ToastStandaloneInstance | ToastInstance;
|
|
4
|
+
progressResetKey?: number;
|
|
5
|
+
duplicateKey?: number;
|
|
6
|
+
updateKey?: number;
|
|
7
|
+
bumpAnimationClass?: string;
|
|
8
|
+
clearAllAnimationClass?: string;
|
|
9
|
+
updateAnimationClass?: string;
|
|
10
|
+
};
|
|
11
|
+
declare function dismiss(id: ToastId): void;
|
|
12
|
+
declare function __VLS_template(): {
|
|
13
|
+
attrs: Partial<{}>;
|
|
14
|
+
slots: {
|
|
15
|
+
default?(_: {
|
|
16
|
+
toast: ToastInstance;
|
|
17
|
+
progressResetKey: number | undefined;
|
|
18
|
+
duplicateKey: number | undefined;
|
|
19
|
+
updateKey: number | undefined;
|
|
20
|
+
bumpAnimationClass: string | undefined;
|
|
21
|
+
clearAllAnimationClass: string | undefined;
|
|
22
|
+
updateAnimationClass: string | undefined;
|
|
23
|
+
dismiss: typeof dismiss;
|
|
24
|
+
ui: import('..').ToastUI;
|
|
25
|
+
}): any;
|
|
26
|
+
};
|
|
27
|
+
refs: {};
|
|
28
|
+
rootEl: any;
|
|
29
|
+
};
|
|
30
|
+
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
31
|
+
declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
32
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
33
|
+
export default _default;
|
|
34
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
35
|
+
new (): {
|
|
36
|
+
$slots: S;
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, SVGSVGElement>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from 'toastflow-core';
|
|
2
|
+
export * from './plugin';
|
|
3
|
+
export * from './toast';
|
|
4
|
+
export type { ToastUI } from './toast-ui';
|
|
5
|
+
export { default as ToastContainer } from './components/ToastContainer.vue';
|
|
6
|
+
export { default as Toast } from './components/Toast.vue';
|
|
7
|
+
export { default as ToastProgress } from './components/ToastProgress.vue';
|
|
8
|
+
export { default as ArrowPath } from './components/icons/ArrowPath.vue';
|
|
9
|
+
export { default as Bell } from './components/icons/Bell.vue';
|
|
10
|
+
export { default as CheckCircle } from './components/icons/CheckCircle.vue';
|
|
11
|
+
export { default as InfoCircle } from './components/icons/InfoCircle.vue';
|
|
12
|
+
export { default as QuestionMarkCircle } from './components/icons/QuestionMarkCircle.vue';
|
|
13
|
+
export { default as XCircle } from './components/icons/XCircle.vue';
|
|
14
|
+
export { default as XMark } from './components/icons/XMark.vue';
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from 'toastflow-core';
|
|
2
2
|
export * from './plugin';
|
|
3
3
|
export * from './toast';
|
|
4
|
+
export type { ToastUI } from './toast-ui';
|
|
4
5
|
export { default as ToastContainer } from './components/ToastContainer.vue';
|
|
5
6
|
export { default as Toast } from './components/Toast.vue';
|
|
6
7
|
export { default as ToastProgress } from './components/ToastProgress.vue';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Plugin } from 'vue';
|
|
2
|
+
import { ToastConfig } from 'toastflow-core';
|
|
3
|
+
export interface ToastflowPluginOptions {
|
|
4
|
+
css?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function injectToastflowStyles(): void;
|
|
7
|
+
export declare function createToastflow(config?: Partial<ToastConfig>, options?: ToastflowPluginOptions): Plugin;
|
package/dist/src/plugin.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { Plugin } from 'vue';
|
|
2
2
|
import { ToastConfig } from 'toastflow-core';
|
|
3
|
-
export
|
|
3
|
+
export interface ToastflowPluginOptions {
|
|
4
|
+
css?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function injectToastflowStyles(): void;
|
|
7
|
+
export declare function createToastflow(config?: Partial<ToastConfig>, options?: ToastflowPluginOptions): Plugin;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { Component, CSSProperties, ComputedRef, Ref } from 'vue';
|
|
2
|
+
import { ToastButton, ToastId, ToastInstance, ToastStandaloneInstance, ToastStore, ToastType } from 'toastflow-core';
|
|
3
|
+
type ToastSlotProps = Record<string, unknown>;
|
|
4
|
+
type ToastButtonsPlacement = "left" | "right" | "top" | "bottom";
|
|
5
|
+
export interface ToastUI {
|
|
6
|
+
wrapperProps: ToastSlotProps;
|
|
7
|
+
rootProps: ToastSlotProps;
|
|
8
|
+
closeProps: ToastSlotProps;
|
|
9
|
+
getWrapperProps: (props?: ToastSlotProps) => ToastSlotProps;
|
|
10
|
+
getRootProps: (props?: ToastSlotProps) => ToastSlotProps;
|
|
11
|
+
getCloseProps: (props?: ToastSlotProps) => ToastSlotProps;
|
|
12
|
+
getButtonProps: (button: ToastButton, props?: ToastSlotProps) => ToastSlotProps;
|
|
13
|
+
actions: {
|
|
14
|
+
dismiss: () => void;
|
|
15
|
+
pause: () => void;
|
|
16
|
+
resume: () => void;
|
|
17
|
+
onClick: (event: MouseEvent) => void;
|
|
18
|
+
onCloseClick: () => void;
|
|
19
|
+
onButtonClick: (button: ToastButton, event: MouseEvent) => void;
|
|
20
|
+
onMouseEnter: () => void;
|
|
21
|
+
onMouseLeave: () => void;
|
|
22
|
+
onPointerDown: (event: PointerEvent) => void;
|
|
23
|
+
onPointerMove: (event: PointerEvent) => void;
|
|
24
|
+
onPointerUp: (event: PointerEvent) => void;
|
|
25
|
+
onPointerCancel: (event: PointerEvent) => void;
|
|
26
|
+
};
|
|
27
|
+
a11y: {
|
|
28
|
+
role: string;
|
|
29
|
+
ariaLive: string;
|
|
30
|
+
titleLabel: string;
|
|
31
|
+
descriptionLabel: string;
|
|
32
|
+
toastLabel: string;
|
|
33
|
+
createdAtLabel: string;
|
|
34
|
+
};
|
|
35
|
+
state: {
|
|
36
|
+
isHovered: boolean;
|
|
37
|
+
isBumped: boolean;
|
|
38
|
+
isUpdated: boolean;
|
|
39
|
+
isSwipeEnabled: boolean;
|
|
40
|
+
};
|
|
41
|
+
classes: {
|
|
42
|
+
wrapper: string;
|
|
43
|
+
root: Array<string | false | undefined>;
|
|
44
|
+
accent: string;
|
|
45
|
+
icon: string;
|
|
46
|
+
close: string;
|
|
47
|
+
buttons: Array<string | undefined>;
|
|
48
|
+
};
|
|
49
|
+
styles: {
|
|
50
|
+
wrapper: CSSProperties;
|
|
51
|
+
root: CSSProperties;
|
|
52
|
+
progress: CSSProperties;
|
|
53
|
+
};
|
|
54
|
+
icon: {
|
|
55
|
+
show: boolean;
|
|
56
|
+
component: Component;
|
|
57
|
+
wrapperProps: ToastSlotProps;
|
|
58
|
+
componentProps: ToastSlotProps;
|
|
59
|
+
};
|
|
60
|
+
createdAt: {
|
|
61
|
+
show: boolean;
|
|
62
|
+
inline: boolean;
|
|
63
|
+
floating: boolean;
|
|
64
|
+
formatted: string;
|
|
65
|
+
ariaLabel: string;
|
|
66
|
+
};
|
|
67
|
+
buttons: {
|
|
68
|
+
items: ToastButton[];
|
|
69
|
+
has: boolean;
|
|
70
|
+
placement: ToastButtonsPlacement;
|
|
71
|
+
groupProps: ToastSlotProps;
|
|
72
|
+
getGroupProps: (props?: ToastSlotProps) => ToastSlotProps;
|
|
73
|
+
};
|
|
74
|
+
progress: {
|
|
75
|
+
show: boolean;
|
|
76
|
+
key: number;
|
|
77
|
+
wrapperProps: ToastSlotProps;
|
|
78
|
+
trackProps: ToastSlotProps;
|
|
79
|
+
barProps: ToastSlotProps;
|
|
80
|
+
getWrapperProps: (props?: ToastSlotProps) => ToastSlotProps;
|
|
81
|
+
getTrackProps: (props?: ToastSlotProps) => ToastSlotProps;
|
|
82
|
+
getBarProps: (props?: ToastSlotProps) => ToastSlotProps;
|
|
83
|
+
componentProps: {
|
|
84
|
+
key: number;
|
|
85
|
+
type: ToastType;
|
|
86
|
+
progressAlignment: ToastInstance["progressAlignment"];
|
|
87
|
+
};
|
|
88
|
+
};
|
|
89
|
+
layout: {
|
|
90
|
+
hasOutsideButtons: boolean;
|
|
91
|
+
showMetaLeft: boolean;
|
|
92
|
+
showMetaRight: boolean;
|
|
93
|
+
showMetaTop: boolean;
|
|
94
|
+
showMetaBottom: boolean;
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
interface UseToastUIOptions {
|
|
98
|
+
toast: Ref<ToastStandaloneInstance | ToastInstance>;
|
|
99
|
+
store: ToastStore;
|
|
100
|
+
progressResetKey?: Ref<number | undefined>;
|
|
101
|
+
duplicateKey?: Ref<number | undefined>;
|
|
102
|
+
updateKey?: Ref<number | undefined>;
|
|
103
|
+
onDismiss?: (id: ToastId) => void;
|
|
104
|
+
bumpAnimationClass?: Ref<string | undefined>;
|
|
105
|
+
clearAllAnimationClass?: Ref<string | undefined>;
|
|
106
|
+
updateAnimationClass?: Ref<string | undefined>;
|
|
107
|
+
}
|
|
108
|
+
export declare function useToastUI({ toast: toastProp, store, progressResetKey, duplicateKey, updateKey, onDismiss, bumpAnimationClass, clearAllAnimationClass, updateAnimationClass, }: UseToastUIOptions): {
|
|
109
|
+
toast: ComputedRef<ToastInstance>;
|
|
110
|
+
accentClass: ComputedRef<string>;
|
|
111
|
+
iconWrapperClass: ComputedRef<string>;
|
|
112
|
+
closeWrapperClass: ComputedRef<string>;
|
|
113
|
+
defaultIconComponent: ComputedRef<Component>;
|
|
114
|
+
role: ComputedRef<"alert" | "status">;
|
|
115
|
+
ariaLive: ComputedRef<"assertive" | "polite">;
|
|
116
|
+
hasCreatedAt: ComputedRef<boolean>;
|
|
117
|
+
createdAtText: ComputedRef<string>;
|
|
118
|
+
createdAtAriaLabel: ComputedRef<string>;
|
|
119
|
+
titleAriaLabel: ComputedRef<string>;
|
|
120
|
+
descriptionAriaLabel: ComputedRef<string>;
|
|
121
|
+
toastAriaLabel: ComputedRef<string>;
|
|
122
|
+
duration: ComputedRef<number | undefined>;
|
|
123
|
+
progressStyle: ComputedRef<CSSProperties>;
|
|
124
|
+
showProgressBar: ComputedRef<boolean>;
|
|
125
|
+
progressKeyLocal: Ref<number, number>;
|
|
126
|
+
isBumped: Ref<boolean, boolean>;
|
|
127
|
+
isUpdated: Ref<boolean, boolean>;
|
|
128
|
+
isHovered: Ref<boolean, boolean>;
|
|
129
|
+
handleMouseEnter: () => void;
|
|
130
|
+
handleMouseLeave: () => void;
|
|
131
|
+
handlePointerDown: (event: PointerEvent) => void;
|
|
132
|
+
handlePointerMove: (event: PointerEvent) => void;
|
|
133
|
+
handlePointerUp: (event: PointerEvent) => void;
|
|
134
|
+
handlePointerCancel: (event: PointerEvent) => void;
|
|
135
|
+
isSwipeEnabled: ComputedRef<boolean>;
|
|
136
|
+
swipeStyle: ComputedRef<CSSProperties>;
|
|
137
|
+
handleClick: (event: MouseEvent) => void;
|
|
138
|
+
handleCloseClick: () => void;
|
|
139
|
+
dismissCurrent: () => void;
|
|
140
|
+
pause: () => void;
|
|
141
|
+
resume: () => void;
|
|
142
|
+
hasButtons: ComputedRef<boolean>;
|
|
143
|
+
buttons: ComputedRef<ToastButton[]>;
|
|
144
|
+
buttonsPlacement: ComputedRef<ToastButtonsPlacement>;
|
|
145
|
+
buttonsClasses: ComputedRef<(string | undefined)[]>;
|
|
146
|
+
buttonsVarsStyle: ComputedRef<CSSProperties>;
|
|
147
|
+
handleButtonClick: (button: ToastButton, event: MouseEvent) => void;
|
|
148
|
+
toastStyle: ComputedRef<CSSProperties>;
|
|
149
|
+
showIconElement: ComputedRef<boolean>;
|
|
150
|
+
showMetaLeft: ComputedRef<boolean>;
|
|
151
|
+
showMetaRight: ComputedRef<boolean>;
|
|
152
|
+
showMetaTop: ComputedRef<boolean>;
|
|
153
|
+
showMetaBottom: ComputedRef<boolean>;
|
|
154
|
+
hasOutsideButtons: ComputedRef<boolean>;
|
|
155
|
+
showInlineCreatedAt: ComputedRef<boolean>;
|
|
156
|
+
showFloatingCreatedAt: ComputedRef<boolean>;
|
|
157
|
+
ui: ComputedRef<ToastUI>;
|
|
158
|
+
};
|
|
159
|
+
export {};
|