@scalar/use-toasts 0.2.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Scalar
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,13 @@
1
+ declare const _default: import("vue").DefineComponent<{
2
+ duration: {
3
+ type: import("vue").PropType<number>;
4
+ required: true;
5
+ };
6
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
7
+ duration: {
8
+ type: import("vue").PropType<number>;
9
+ required: true;
10
+ };
11
+ }>>, {}, {}>;
12
+ export default _default;
13
+ //# sourceMappingURL=FlowProgressRing.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlowProgressRing.vue.d.ts","sourceRoot":"","sources":["../src/FlowProgressRing.vue.ts"],"names":[],"mappings":";;;;;;;;;;;AAkFA,wBAAkD"}
@@ -0,0 +1,44 @@
1
+ import { type Component } from 'vue';
2
+ export type ToastStatus = 'Error';
3
+ type ToastOptions = {
4
+ timeout?: number;
5
+ };
6
+ type BaseToast = {
7
+ id: string;
8
+ options?: ToastOptions;
9
+ };
10
+ type DefaultToastContent = {
11
+ title: string;
12
+ description?: Component | string;
13
+ status?: ToastStatus;
14
+ };
15
+ type CustomToastContent = {
16
+ component: Component;
17
+ };
18
+ export type DefaultToast = DefaultToastContent & BaseToast;
19
+ export type CustomToast = CustomToastContent & BaseToast;
20
+ export type Toast = DefaultToast | CustomToast;
21
+ export type ToastHandle = {
22
+ id: string;
23
+ dismiss: () => void;
24
+ active: () => boolean;
25
+ };
26
+ /** Shows a toast the given options */
27
+ export declare function addToast(contents: DefaultToastContent, options?: ToastOptions): ToastHandle;
28
+ /** Shows a toast with an error status */
29
+ export declare function addErrorToast(message: Component | string): ToastHandle;
30
+ /** Shows a toast with a custom component */
31
+ export declare function addCustomToast(component: Component, options?: ToastOptions): ToastHandle;
32
+ /** Gets access to all the toasts */
33
+ export declare function useToasts(): {
34
+ toasts: readonly Toast[];
35
+ addToast: typeof addToast;
36
+ removeToast: typeof removeToast;
37
+ clearToasts: typeof clearToasts;
38
+ };
39
+ /** Remove a toast by id */
40
+ declare function removeToast(id: string): void;
41
+ /** Clear all toasts */
42
+ declare function clearToasts(): void;
43
+ export {};
44
+ //# sourceMappingURL=FlowToast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlowToast.d.ts","sourceRoot":"","sources":["../src/FlowToast.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,KAAK,CAAA;AAExD,MAAM,MAAM,WAAW,GAAG,OAAO,CAAA;AAEjC,KAAK,YAAY,GAAG;IAClB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,KAAK,SAAS,GAAG;IACf,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,CAAC,EAAE,YAAY,CAAA;CACvB,CAAA;AAED,KAAK,mBAAmB,GAAG;IACzB,KAAK,EAAE,MAAM,CAAA;IACb,WAAW,CAAC,EAAE,SAAS,GAAG,MAAM,CAAA;IAChC,MAAM,CAAC,EAAE,WAAW,CAAA;CACrB,CAAA;AACD,KAAK,kBAAkB,GAAG;IACxB,SAAS,EAAE,SAAS,CAAA;CACrB,CAAA;AAID,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAAG,SAAS,CAAA;AAC1D,MAAM,MAAM,WAAW,GAAG,kBAAkB,GAAG,SAAS,CAAA;AACxD,MAAM,MAAM,KAAK,GAAG,YAAY,GAAG,WAAW,CAAA;AAE9C,MAAM,MAAM,WAAW,GAAG;IACxB,EAAE,EAAE,MAAM,CAAA;IACV,OAAO,EAAE,MAAM,IAAI,CAAA;IACnB,MAAM,EAAE,MAAM,OAAO,CAAA;CACtB,CAAA;AA6BD,sCAAsC;AACtC,wBAAgB,QAAQ,CACtB,QAAQ,EAAE,mBAAmB,EAC7B,OAAO,CAAC,EAAE,YAAY,GACrB,WAAW,CAEb;AAED,yCAAyC;AACzC,wBAAgB,aAAa,CAAC,OAAO,EAAE,SAAS,GAAG,MAAM,eAWxD;AAED,4CAA4C;AAC5C,wBAAgB,cAAc,CAC5B,SAAS,EAAE,SAAS,EACpB,OAAO,CAAC,EAAE,YAAY,GACrB,WAAW,CAEb;AAED,oCAAoC;AACpC,wBAAgB,SAAS;;;;;EAOxB;AAED,2BAA2B;AAC3B,iBAAS,WAAW,CAAC,EAAE,EAAE,MAAM,QAI9B;AAED,uBAAuB;AACvB,iBAAS,WAAW,SAEnB"}
@@ -0,0 +1,14 @@
1
+ import type { Toast } from './FlowToast';
2
+ declare const _default: import("vue").DefineComponent<{
3
+ toast: {
4
+ type: import("vue").PropType<Toast>;
5
+ required: true;
6
+ };
7
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
8
+ toast: {
9
+ type: import("vue").PropType<Toast>;
10
+ required: true;
11
+ };
12
+ }>>, {}, {}>;
13
+ export default _default;
14
+ //# sourceMappingURL=FlowToast.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlowToast.vue.d.ts","sourceRoot":"","sources":["../src/FlowToast.vue.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAe,KAAK,EAAE,MAAM,aAAa,CAAA;;;;;;;;;;;;AA8KrD,wBAAkD"}
@@ -0,0 +1,3 @@
1
+ declare const _default: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}, {}>;
2
+ export default _default;
3
+ //# sourceMappingURL=FlowToastContainer.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlowToastContainer.vue.d.ts","sourceRoot":"","sources":["../src/FlowToastContainer.vue.ts"],"names":[],"mappings":";AAuFA,wBAAkD"}
@@ -0,0 +1,21 @@
1
+ declare const _default: __VLS_WithTemplateSlots<import("vue").DefineComponent<{
2
+ status: {
3
+ type: import("vue").PropType<"Error">;
4
+ };
5
+ }, {}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
6
+ status: {
7
+ type: import("vue").PropType<"Error">;
8
+ };
9
+ }>>, {}, {}>, {
10
+ icon?(_: {}): any;
11
+ title?(_: {}): any;
12
+ description?(_: {}): any;
13
+ timeout?(_: {}): any;
14
+ }>;
15
+ export default _default;
16
+ type __VLS_WithTemplateSlots<T, S> = T & {
17
+ new (): {
18
+ $slots: S;
19
+ };
20
+ };
21
+ //# sourceMappingURL=FlowToastLayout.vue.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"FlowToastLayout.vue.d.ts","sourceRoot":"","sources":["../src/FlowToastLayout.vue.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAwJA,wBAA8G;AAI9G,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAAE,QAAO;QAClD,MAAM,EAAE,CAAC,CAAC;KACT,CAAA;CAAE,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './FlowToast';
2
+ export { default as FlowToastContainer } from './FlowToastContainer.vue';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,0BAA0B,CAAA"}
package/dist/index.js ADDED
@@ -0,0 +1,253 @@
1
+ (function() {
2
+ "use strict";
3
+ try {
4
+ if (typeof document != "undefined") {
5
+ var elementStyle = document.createElement("style");
6
+ elementStyle.appendChild(document.createTextNode(".progress-ring[data-v-6d218ca0] {\n transform: rotate(-90deg);\n transform-origin: 50% 50%;\n animation: linear turn-6d218ca0 reverse forwards;\n}\n@keyframes turn-6d218ca0 {\nfrom {\n stroke-dashoffset: var(--2d61a1b2);\n}\nto {\n stroke-dashoffset: 0;\n}\n}\n\n.toast-layout[data-v-2757e7fa] {\n pointer-events: initial;\n\n padding: 18px;\n background: var(--theme-background-1);\n border-radius: var(--theme-radius-lg);\n font-size: var(--theme-font-size-3);\n display: grid;\n grid-template-columns: auto 1fr auto;\n grid-template-areas:\n 'icon title timeout'\n '. description description';\n align-items: center;\n position: relative;\n\n width: 380px;\n}\n.toast-title[data-v-2757e7fa] {\n grid-area: title;\n font-weight: var(--theme-font-medium);\n display: flex;\n align-items: center;\n}\n.toast-description[data-v-2757e7fa] {\n grid-area: description;\n margin-top: 5px;\n line-height: 1.45;\n color: var(--theme-color-2);\n}\n.toast-icon[data-v-2757e7fa] {\n grid-area: icon;\n display: flex;\n align-items: center;\n justify-content: center;\n margin-right: 10px;\n color: var(--theme-color-2);\n}\n.toast-icon[data-v-2757e7fa] > * {\n width: 14px;\n height: 14px;\n}\n.toast-timeout[data-v-2757e7fa] {\n grid-area: timeout;\n margin-left: 10px;\n width: 16px;\n height: 16px;\n display: flex;\n color: var(--theme-color-ghost);\n}\n.toast-error .toast-icon[data-v-2757e7fa],\n.toast-error .toast-title[data-v-2757e7fa] {\n color: var(--theme-error-color);\n}\n\n.toast[data-v-19dabe84] {\n pointer-events: initial;\n filter: brightness(var(--theme-lifted-brightness));\n\n background: var(--theme-background-1);\n border-radius: var(--theme-radius-lg);\n box-shadow: var(--theme-shadow-2);\n\n width: 380px;\n}\n\n.toast-container[data-v-3e22820b] {\n width: 100vw;\n height: 100vh;\n position: fixed;\n z-index: 10000;\n\n pointer-events: none;\n\n display: flex;\n flex-direction: column;\n align-items: flex-end;\n justify-content: flex-end;\n gap: 12px;\n\n padding: 48px;\n}\n.toasts-move[data-v-3e22820b],\n.toasts-enter-active[data-v-3e22820b],\n.toasts-leave-active[data-v-3e22820b] {\n transition: all 0.5s ease;\n}\n.toasts-enter-from[data-v-3e22820b],\n.toasts-leave-to[data-v-3e22820b] {\n opacity: 0;\n transform: translateX(30px);\n}\n.toast-leave-active[data-v-3e22820b] {\n position: absolute;\n}"));
7
+ document.head.appendChild(elementStyle);
8
+ }
9
+ } catch (e) {
10
+ console.error("vite-plugin-css-injected-by-js", e);
11
+ }
12
+ })();
13
+ import { reactive, readonly, defineComponent, useCssVars, computed, openBlock, createElementBlock, createElementVNode, normalizeStyle, normalizeClass, renderSlot, createCommentVNode, createBlock, resolveDynamicComponent, createSlots, withCtx, createVNode, createTextVNode, toDisplayString, Fragment, TransitionGroup, renderList, unref } from "vue";
14
+ let nanoid = (size = 21) => crypto.getRandomValues(new Uint8Array(size)).reduce((id, byte) => {
15
+ byte &= 63;
16
+ if (byte < 36) {
17
+ id += byte.toString(36);
18
+ } else if (byte < 62) {
19
+ id += (byte - 26).toString(36).toUpperCase();
20
+ } else if (byte > 62) {
21
+ id += "-";
22
+ } else {
23
+ id += "_";
24
+ }
25
+ return id;
26
+ }, "");
27
+ const toasts = reactive([]);
28
+ function createToast(content, options) {
29
+ const id = nanoid();
30
+ toasts.push({ id, ...content, options });
31
+ let timer;
32
+ if (options == null ? void 0 : options.timeout) {
33
+ timer = setTimeout(() => {
34
+ removeToast(id);
35
+ }, options.timeout);
36
+ }
37
+ const dismiss = () => {
38
+ if (timer)
39
+ clearTimeout(timer);
40
+ removeToast(id);
41
+ };
42
+ const active = () => {
43
+ return toasts.some((t) => t.id === id);
44
+ };
45
+ return { id, dismiss, active };
46
+ }
47
+ function addToast(contents, options) {
48
+ return createToast(contents, options);
49
+ }
50
+ function addErrorToast(message) {
51
+ return createToast(
52
+ {
53
+ title: "Something went wrong...",
54
+ description: message,
55
+ status: "Error"
56
+ },
57
+ {
58
+ timeout: 5e3
59
+ }
60
+ );
61
+ }
62
+ function addCustomToast(component, options) {
63
+ return createToast({ component }, options);
64
+ }
65
+ function useToasts() {
66
+ return {
67
+ toasts: readonly(toasts),
68
+ addToast,
69
+ removeToast,
70
+ clearToasts
71
+ };
72
+ }
73
+ function removeToast(id) {
74
+ const idx = toasts.findIndex((t) => t.id === id);
75
+ if (idx < 0)
76
+ return;
77
+ toasts.splice(idx, 1);
78
+ }
79
+ function clearToasts() {
80
+ toasts.splice(0, toasts.length);
81
+ }
82
+ const _hoisted_1$3 = { viewBox: "0 0 24 24" };
83
+ const _hoisted_2$1 = ["stroke-dasharray"];
84
+ const stroke = 2;
85
+ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
86
+ __name: "FlowProgressRing",
87
+ props: {
88
+ duration: {}
89
+ },
90
+ setup(__props) {
91
+ const props = __props;
92
+ useCssVars((_ctx) => ({
93
+ "2d61a1b2": circumference
94
+ }));
95
+ const normalizedRadius = 12 - stroke * 2;
96
+ const circumference = normalizedRadius * 2 * Math.PI;
97
+ const animationDuration = computed(() => `${props.duration}ms`);
98
+ return (_ctx, _cache) => {
99
+ return openBlock(), createElementBlock("svg", _hoisted_1$3, [
100
+ createElementVNode("circle", {
101
+ class: "progress-ring",
102
+ cx: 12,
103
+ cy: 12,
104
+ fill: "transparent",
105
+ r: normalizedRadius,
106
+ stroke: "currentColor",
107
+ "stroke-dasharray": circumference + " " + circumference,
108
+ "stroke-width": stroke,
109
+ style: normalizeStyle({ animationDuration: animationDuration.value })
110
+ }, null, 12, _hoisted_2$1)
111
+ ]);
112
+ };
113
+ }
114
+ });
115
+ const FlowProgressRing_vue_vue_type_style_index_0_scoped_6d218ca0_lang = "";
116
+ const _export_sfc = (sfc, props) => {
117
+ const target = sfc.__vccOpts || sfc;
118
+ for (const [key, val] of props) {
119
+ target[key] = val;
120
+ }
121
+ return target;
122
+ };
123
+ const FlowProgressRing = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__scopeId", "data-v-6d218ca0"]]);
124
+ const _hoisted_1$2 = {
125
+ key: 0,
126
+ class: "toast-icon"
127
+ };
128
+ const _hoisted_2 = { class: "toast-title" };
129
+ const _hoisted_3 = {
130
+ key: 1,
131
+ class: "toast-description text-copy-light"
132
+ };
133
+ const _hoisted_4 = {
134
+ key: 2,
135
+ class: "toast-timeout"
136
+ };
137
+ const _sfc_main$2 = /* @__PURE__ */ defineComponent({
138
+ __name: "FlowToastLayout",
139
+ props: {
140
+ status: {}
141
+ },
142
+ setup(__props) {
143
+ return (_ctx, _cache) => {
144
+ return openBlock(), createElementBlock("div", {
145
+ class: normalizeClass(["toast-layout", { "toast-error": _ctx.status === "Error" }])
146
+ }, [
147
+ _ctx.$slots.icon ? (openBlock(), createElementBlock("div", _hoisted_1$2, [
148
+ renderSlot(_ctx.$slots, "icon", {}, void 0, true)
149
+ ])) : createCommentVNode("", true),
150
+ createElementVNode("div", _hoisted_2, [
151
+ renderSlot(_ctx.$slots, "title", {}, void 0, true)
152
+ ]),
153
+ _ctx.$slots.description ? (openBlock(), createElementBlock("div", _hoisted_3, [
154
+ renderSlot(_ctx.$slots, "description", {}, void 0, true)
155
+ ])) : createCommentVNode("", true),
156
+ _ctx.$slots.timeout ? (openBlock(), createElementBlock("div", _hoisted_4, [
157
+ renderSlot(_ctx.$slots, "timeout", {}, void 0, true)
158
+ ])) : createCommentVNode("", true)
159
+ ], 2);
160
+ };
161
+ }
162
+ });
163
+ const FlowToastLayout_vue_vue_type_style_index_0_scoped_2757e7fa_lang = "";
164
+ const FlowToastLayout = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__scopeId", "data-v-2757e7fa"]]);
165
+ const _hoisted_1$1 = { class: "toast" };
166
+ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
167
+ __name: "FlowToast",
168
+ props: {
169
+ toast: {}
170
+ },
171
+ setup(__props) {
172
+ const isCustom = (t) => {
173
+ return t.component !== void 0;
174
+ };
175
+ return (_ctx, _cache) => {
176
+ var _a, _b;
177
+ return openBlock(), createElementBlock("div", _hoisted_1$1, [
178
+ isCustom(_ctx.toast) ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.toast.component), { key: 0 }, createSlots({ _: 2 }, [
179
+ ((_a = _ctx.toast.options) == null ? void 0 : _a.timeout) ? {
180
+ name: "timeout",
181
+ fn: withCtx(() => [
182
+ createVNode(FlowProgressRing, {
183
+ duration: _ctx.toast.options.timeout
184
+ }, null, 8, ["duration"])
185
+ ]),
186
+ key: "0"
187
+ } : void 0
188
+ ]), 1024)) : createCommentVNode("", true),
189
+ !isCustom(_ctx.toast) ? (openBlock(), createBlock(FlowToastLayout, {
190
+ key: 1,
191
+ status: _ctx.toast.status
192
+ }, createSlots({
193
+ title: withCtx(() => [
194
+ createTextVNode(toDisplayString(_ctx.toast.title), 1)
195
+ ]),
196
+ _: 2
197
+ }, [
198
+ _ctx.toast.description ? {
199
+ name: "description",
200
+ fn: withCtx(() => [
201
+ typeof _ctx.toast.description === "string" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
202
+ createTextVNode(toDisplayString(_ctx.toast.description), 1)
203
+ ], 64)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.toast.description), { key: 1 }))
204
+ ]),
205
+ key: "0"
206
+ } : void 0,
207
+ ((_b = _ctx.toast.options) == null ? void 0 : _b.timeout) ? {
208
+ name: "timeout",
209
+ fn: withCtx(() => [
210
+ createVNode(FlowProgressRing, {
211
+ duration: _ctx.toast.options.timeout
212
+ }, null, 8, ["duration"])
213
+ ]),
214
+ key: "1"
215
+ } : void 0
216
+ ]), 1032, ["status"])) : createCommentVNode("", true)
217
+ ]);
218
+ };
219
+ }
220
+ });
221
+ const FlowToast_vue_vue_type_style_index_0_scoped_19dabe84_lang = "";
222
+ const FlowToast = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-19dabe84"]]);
223
+ const _hoisted_1 = { class: "toast-container" };
224
+ const _sfc_main = /* @__PURE__ */ defineComponent({
225
+ __name: "FlowToastContainer",
226
+ setup(__props) {
227
+ const { toasts: toasts2 } = useToasts();
228
+ return (_ctx, _cache) => {
229
+ return openBlock(), createElementBlock("div", _hoisted_1, [
230
+ createVNode(TransitionGroup, { name: "toasts" }, {
231
+ default: withCtx(() => [
232
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(toasts2), (toast) => {
233
+ return openBlock(), createBlock(FlowToast, {
234
+ key: toast.id,
235
+ toast
236
+ }, null, 8, ["toast"]);
237
+ }), 128))
238
+ ]),
239
+ _: 1
240
+ })
241
+ ]);
242
+ };
243
+ }
244
+ });
245
+ const FlowToastContainer_vue_vue_type_style_index_0_scoped_3e22820b_lang = "";
246
+ const FlowToastContainer = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-3e22820b"]]);
247
+ export {
248
+ FlowToastContainer,
249
+ addCustomToast,
250
+ addErrorToast,
251
+ addToast,
252
+ useToasts
253
+ };
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@scalar/use-toasts",
3
+ "version": "0.2.0",
4
+ "author": "Scalar",
5
+ "license": "MIT",
6
+ "engines": {
7
+ "node": ">=18"
8
+ },
9
+ "type": "module",
10
+ "main": "dist/index.js",
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "dependencies": {
15
+ "nanoid": "4.0.2"
16
+ },
17
+ "devDependencies": {
18
+ "@vitejs/plugin-vue": "4.2.3",
19
+ "tsc-alias": "1.8.6",
20
+ "vite": "4.4.8",
21
+ "vitest": "0.34.1",
22
+ "vue-tsc": "1.8.8",
23
+ "vite-plugin-css-injected-by-js": "^3.3.0"
24
+ },
25
+ "peerDependencies": {
26
+ "vue": "3.3.4"
27
+ },
28
+ "scripts": {
29
+ "build": "vite build && pnpm types:build && tsc-alias -p tsconfig.build.json",
30
+ "dev": "vite",
31
+ "lint:check": "eslint .",
32
+ "lint:fix": "eslint . --fix",
33
+ "preview": "vite preview",
34
+ "test": "vitest",
35
+ "types:build": "vue-tsc -p tsconfig.build.json",
36
+ "types:check": "vue-tsc --noEmit --skipLibCheck"
37
+ }
38
+ }