vue-toasts-lite 0.0.1 → 0.1.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/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 scheron
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.
22
+
package/README.md CHANGED
@@ -1,45 +1,165 @@
1
- # vue-toasts-lite
1
+ # Vue Toasts Lite
2
2
 
3
- ## ⚠️ IMPORTANT NOTICE ⚠️
3
+ [![npm version](https://badge.fury.io/js/vue-toasts-lite.svg)](https://www.npmjs.com/package/vue-toasts-lite)
4
+ [![Documentation](https://img.shields.io/badge/docs-available-brightgreen)](https://scheron.github.io/vue-toasts-lite/)
4
5
 
5
- **This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
6
+ A lightweight toast notifications library for Vue 3.
6
7
 
7
- This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
8
+ 📖 **[Check docs](https://scheron.github.io/vue-toasts-lite/)**
8
9
 
9
- ## Purpose
10
+ > ⚠️ **Note**: This is primarily a personal utility library created for my own use. I don't discourage others from using it, but I should mention that I'm not currently using it in production myself. The main purpose of this library is to provide me with a simple and quick way to integrate toast notifications into my personal projects without the need to configure and set up larger, more complex libraries. If you find it useful, feel free to use it, but keep in mind that it's tailored to my personal needs and workflow.
10
11
 
11
- This package exists to:
12
- 1. Configure OIDC trusted publishing for the package name `vue-toasts-lite`
13
- 2. Enable secure, token-less publishing from CI/CD workflows
14
- 3. Establish provenance for packages published under this name
15
12
 
16
- ## What is OIDC Trusted Publishing?
13
+ ## Features
17
14
 
18
- OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
15
+ - 🚀 Lightweight and easy to use
16
+ - 🎨 Multiple toast types (success, error, loading, warn)
17
+ - 📍 Multiple positions (can show in different corners simultaneously)
18
+ - ⚡️ Customizable duration, auto-close, and styling
19
+ - 🎯 TypeScript support
20
+ - 🎯 Promise support
21
+ - 🖱️ Pause on hover
19
22
 
20
- ## Setup Instructions
23
+ ## Installation
21
24
 
22
- To properly configure OIDC trusted publishing for this package:
25
+ ```bash
26
+ npm install vue-toasts-lite
27
+ ```
23
28
 
24
- 1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
25
- 2. Configure the trusted publisher (e.g., GitHub Actions)
26
- 3. Specify the repository and workflow that should be allowed to publish
27
- 4. Use the configured workflow to publish your actual package
29
+ ## Quick Start
28
30
 
29
- ## DO NOT USE THIS PACKAGE
31
+ **Three steps to start using toasts:**
30
32
 
31
- This package is a placeholder for OIDC configuration only. It:
32
- - Contains no executable code
33
- - Provides no functionality
34
- - Should not be installed as a dependency
35
- - Exists only for administrative purposes
33
+ 1. Install the package
34
+ 2. Add `ToastsLiteProvider` to your app
35
+ 3. Call `toasts.success()` from anywhere
36
36
 
37
- ## More Information
37
+ ### 1. Add the provider to your `App.vue`:
38
38
 
39
- For more details about npm's trusted publishing feature, see:
40
- - [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
41
- - [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
39
+ ```vue
40
+ <script setup>
41
+ import { ToastsLiteProvider } from 'vue-toasts-lite'
42
+ import 'vue-toasts-lite/style.css'
43
+ </script>
42
44
 
43
- ---
45
+ <template>
46
+ <div>
47
+ <RouterView />
48
+ <ToastsLiteProvider />
49
+ </div>
50
+ </template>
51
+ ```
44
52
 
45
- **Maintained for OIDC setup purposes only**
53
+ ### 2. Use anywhere in your app:
54
+
55
+ ```vue
56
+ <script setup>
57
+ import { toasts } from 'vue-toasts-lite'
58
+
59
+ toasts.success('Hello!')
60
+ toasts.error('Something went wrong')
61
+ toasts.loading('Loading...')
62
+ toasts.warn('Warning message')
63
+ </script>
64
+ ```
65
+
66
+ ## API
67
+
68
+ ```js
69
+ // Basic methods
70
+ toasts.success(message, options?)
71
+ toasts.error(message, options?)
72
+ toasts.loading(message, options?)
73
+ toasts.warn(message, options?)
74
+
75
+ // Advanced methods
76
+ toasts.add(options) // Create custom toast
77
+ toasts.update(id, options) // Update existing toast
78
+ toasts.remove(id?) // Remove toast(s)
79
+ toasts.clear() // Clear all toasts
80
+ toasts.promise(promise, options) // Handle promise states
81
+ ```
82
+
83
+ ## Options
84
+
85
+ | Option | Type | Default | Description |
86
+ |--------|------|---------|-------------|
87
+ | `message` | `string` | - | Message to display |
88
+ | `type` | `'success' \| 'error' \| 'loading' \| 'warn'` | `'success'` | Toast type |
89
+ | `duration` | `number` | `3000` | Duration in milliseconds |
90
+ | `autoClose` | `boolean` | `true` | Auto-close behavior |
91
+ | `position` | `ToastPosition` | `'top-center'` | Toast position |
92
+ | `id` | `string` | auto | Custom ID |
93
+
94
+ ### Available Positions
95
+
96
+ `top-left`, `top-center`, `top-right`, `bottom-left`, `bottom-center`, `bottom-right`, `middle-center`
97
+
98
+ ## Examples
99
+
100
+ ### Basic Usage
101
+
102
+ ```js
103
+ // With options
104
+ toasts.success('Success!', { duration: 5000, position: 'bottom-right' })
105
+
106
+ // Multiple positions at once
107
+ toasts.success('Top', { position: 'top-center' })
108
+ toasts.error('Bottom', { position: 'bottom-right' })
109
+ ```
110
+
111
+ ### Update Toasts
112
+
113
+ ```js
114
+ const id = toasts.loading('Uploading...')
115
+ // Later
116
+ toasts.update(id, { type: 'success', message: 'Done!' })
117
+ ```
118
+
119
+ ### Promise Support
120
+
121
+ ```js
122
+ await toasts.promise(
123
+ fetchData(),
124
+ {
125
+ loading: 'Loading...',
126
+ success: 'Loaded!',
127
+ error: 'Failed!'
128
+ }
129
+ )
130
+ ```
131
+
132
+ ### Custom Controller
133
+
134
+ ```js
135
+ import { ToastsController } from 'vue-toasts-lite'
136
+
137
+ const notifications = new ToastsController()
138
+ notifications.success('Hello!')
139
+ ```
140
+
141
+ ## Styling
142
+
143
+ Customize colors and appearance with CSS variables:
144
+
145
+ ### CSS Variables
146
+
147
+ ```css
148
+ :root {
149
+ --tl-font-family: system-ui, -apple-system, sans-serif;
150
+ --tl-bg: hsl(0, 0%, 100%);
151
+ --tl-text: hsl(0, 0%, 20%);
152
+ --tl-border: hsl(0, 0%, 85%);
153
+ --tl-shadow: hsla(0, 0%, 0%, 0.1);
154
+ --tl-success: hsl(145, 63%, 42%);
155
+ --tl-error: hsl(0, 79%, 63%);
156
+ --tl-warn: hsl(45, 100%, 51%);
157
+ --tl-icon-color: hsl(0, 0%, 100%);
158
+ --tl-loading-border: hsl(0, 0%, 15%);
159
+ --tl-loading-bg: hsl(0, 0%, 98%);
160
+ }
161
+ ```
162
+
163
+ ## License
164
+
165
+ MIT
@@ -0,0 +1,124 @@
1
+ import { ComponentOptionsMixin } from 'vue';
2
+ import { ComponentProvideOptions } from 'vue';
3
+ import { DefineComponent } from 'vue';
4
+ import { PublicProps } from 'vue';
5
+
6
+ export declare type Id = string;
7
+
8
+ export declare interface Toast {
9
+ add: (options: ToastOptions) => Id;
10
+ update: (id: Id, options: ToastOptions) => Id;
11
+ success: (message: string, options?: ToastSimpleOptions) => Id;
12
+ loading: (message: string, options?: ToastSimpleOptions) => Id;
13
+ error: (message: string, options?: ToastSimpleOptions) => Id;
14
+ warn: (message: string, options?: ToastSimpleOptions) => Id;
15
+ promise: <T>(promise: Promise<T>, options: ToastPromiseOptions) => Promise<Id>;
16
+ remove: (id?: Id) => void;
17
+ clear: () => void;
18
+ onToastsListChange: (callback: (toasts: ToastProps[]) => void) => () => void;
19
+ }
20
+
21
+ export declare type ToastOptions = Partial<ToastProps>;
22
+
23
+ export declare type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right" | "middle-center";
24
+
25
+ export declare type ToastPromiseOptions = {
26
+ loading: string;
27
+ success: string;
28
+ error: string;
29
+ position?: ToastPosition;
30
+ id?: Id;
31
+ };
32
+
33
+ export declare type ToastProps = {
34
+ /** toast id */
35
+ id: Id;
36
+ /** toast type */
37
+ type: ToastType;
38
+ /** toast message */
39
+ message: string;
40
+ /** auto close the toast */
41
+ autoClose: boolean;
42
+ /** duration in milliseconds */
43
+ duration: number;
44
+ /** Position of the toast on the screen. */
45
+ position?: ToastPosition;
46
+ };
47
+
48
+ export declare const toasts: ToastsController;
49
+
50
+ export declare class ToastsController implements Toast {
51
+ private counter;
52
+ private toasts;
53
+ constructor();
54
+ get toastList(): ToastProps[];
55
+ onToastsListChange(callback: (toasts: ToastProps[]) => void): () => void;
56
+ private ID;
57
+ private addOrUpdate;
58
+ /**
59
+ * Add a toast
60
+ * @param options - The options for the toast
61
+ * @returns The id of the toast
62
+ */
63
+ add(options: ToastOptions): string;
64
+ /**
65
+ * Update a toast by id
66
+ * @param id - The id of the toast to update
67
+ * @param options - The options for the toast
68
+ * @returns The id of the toast
69
+ */
70
+ update(id: Id, options: ToastOptions): string;
71
+ /**
72
+ * Remove a toast by id
73
+ * If no id is provided, all current toasts will be removed
74
+ * @param id - The id of the toast to remove
75
+ */
76
+ remove(id?: Id): void;
77
+ /**
78
+ * Remove all current toasts
79
+ */
80
+ clear(): void;
81
+ /**
82
+ * Add a success toast
83
+ * @param message - The message to display in the toast
84
+ * @param options - The options for the toast
85
+ * @returns The id of the toast
86
+ */
87
+ success(message: string, options?: Omit<ToastSimpleOptions, "type">): string;
88
+ /**
89
+ * Add an error toast
90
+ * @param message - The message to display in the toast
91
+ * @param options - The options for the toast
92
+ * @returns The id of the toast
93
+ */
94
+ error(message: string, options?: Omit<ToastSimpleOptions, "type">): string;
95
+ /**
96
+ * Add a warning toast
97
+ * @param message - The message to display in the toast
98
+ * @param options - The options for the toast
99
+ * @returns The id of the toast
100
+ */
101
+ warn(message: string, options?: Omit<ToastSimpleOptions, "type">): string;
102
+ /**
103
+ * Add a loading toast
104
+ * @param message - The message to display in the toast
105
+ * @param options - The options for the toast
106
+ * @returns The id of the toast
107
+ */
108
+ loading(message: string, options?: Omit<ToastSimpleOptions, "type">): string;
109
+ /**
110
+ * Add a promise toast
111
+ * @param promise - The promise to display in the toast
112
+ * @param options - The options for the toast
113
+ * @returns The id of the toast
114
+ */
115
+ promise<T>(promise: Promise<T>, options: ToastPromiseOptions): Promise<string>;
116
+ }
117
+
118
+ export declare type ToastSimpleOptions = Partial<Omit<ToastProps, "message">>;
119
+
120
+ export declare const ToastsLiteProvider: DefineComponent<{}, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, ComponentProvideOptions, true, {}, any>;
121
+
122
+ export declare type ToastType = "success" | "loading" | "error" | "warn";
123
+
124
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1,257 @@
1
+ var L = Object.defineProperty;
2
+ var M = (a, t, e) => t in a ? L(a, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : a[t] = e;
3
+ var f = (a, t, e) => M(a, typeof t != "symbol" ? t + "" : t, e);
4
+ import { defineComponent as w, ref as h, watchEffect as O, createElementBlock as m, openBlock as d, withModifiers as E, normalizeStyle as $, createCommentVNode as U, createElementVNode as v, normalizeClass as C, toDisplayString as D, computed as k, onBeforeUpdate as x, createBlock as g, Teleport as B, Fragment as b, renderList as T, createVNode as P, TransitionGroup as A, withCtx as I, unref as N } from "vue";
5
+ const S = {
6
+ key: 0,
7
+ class: "toasts-lite__icon"
8
+ }, V = { class: "toasts-lite__content" }, z = { class: "toasts-lite__content-message" }, F = /* @__PURE__ */ w({
9
+ __name: "ToastsLiteItem",
10
+ props: {
11
+ id: {},
12
+ type: {},
13
+ message: {},
14
+ autoClose: { type: Boolean },
15
+ duration: {},
16
+ position: {}
17
+ },
18
+ emits: ["close"],
19
+ setup(a, { expose: t, emit: e }) {
20
+ const o = a, n = e, i = h(null), p = h(0), c = h(0);
21
+ function s() {
22
+ i.value && clearTimeout(i.value), n("close");
23
+ }
24
+ function r() {
25
+ i.value && (clearTimeout(i.value), i.value = null, c.value = o.duration - (Date.now() - p.value));
26
+ }
27
+ function u() {
28
+ !i.value && c.value > 0 && (i.value = setTimeout(s, c.value));
29
+ }
30
+ return O(() => {
31
+ i.value && (clearTimeout(i.value), i.value = null), o.autoClose && (p.value = Date.now(), c.value = o.duration, i.value = setTimeout(s, o.duration));
32
+ }), t({
33
+ pause: r,
34
+ resume: u
35
+ }), (l, _) => (d(), m("div", {
36
+ class: "toasts-lite__toast",
37
+ style: $(`--toast-duration: ${a.duration}s;`),
38
+ onClick: E(s, ["prevent"])
39
+ }, [
40
+ ["success", "error", "loading", "warn"].includes(a.type) ? (d(), m("div", S, [
41
+ v("div", {
42
+ class: C(`toasts-lite__${a.type}`)
43
+ }, null, 2)
44
+ ])) : U("", !0),
45
+ v("div", V, [
46
+ v("div", z, D(a.message), 1)
47
+ ])
48
+ ], 4));
49
+ }
50
+ });
51
+ class R extends Map {
52
+ constructor() {
53
+ super(...arguments);
54
+ f(this, "subscribers", []);
55
+ }
56
+ set(e, o) {
57
+ return super.set(e, o), this.notify(), this;
58
+ }
59
+ delete(e) {
60
+ const o = super.delete(e);
61
+ return this.notify(), o;
62
+ }
63
+ clear() {
64
+ super.clear(), this.notify();
65
+ }
66
+ subscribe(e) {
67
+ return this.subscribers.push(e), () => {
68
+ this.subscribers = this.subscribers.filter((o) => o !== e);
69
+ };
70
+ }
71
+ notify() {
72
+ this.subscribers.forEach((e) => e(Array.from(this.values())));
73
+ }
74
+ }
75
+ const j = {
76
+ type: "success",
77
+ message: "Hello from Toasts Lite",
78
+ autoClose: !0,
79
+ duration: 3e3,
80
+ position: "top-center"
81
+ };
82
+ class G {
83
+ constructor() {
84
+ f(this, "counter", 0);
85
+ f(this, "toasts");
86
+ this.toasts = new R();
87
+ }
88
+ get toastList() {
89
+ return Array.from(this.toasts.values());
90
+ }
91
+ onToastsListChange(t) {
92
+ return this.toasts.subscribe(t);
93
+ }
94
+ ID() {
95
+ return `toast:${Date.now().toString(16)}-${this.counter++}`;
96
+ }
97
+ addOrUpdate(t) {
98
+ let { id: e = this.ID(), ...o } = t;
99
+ if (this.toasts.has(e)) {
100
+ const n = this.toasts.get(e);
101
+ return Object.assign(n, o), this.toasts.set(e, n), e;
102
+ }
103
+ return this.toasts.set(e, { id: e, ...j, ...o }), e;
104
+ }
105
+ /**
106
+ * Add a toast
107
+ * @param options - The options for the toast
108
+ * @returns The id of the toast
109
+ */
110
+ add(t) {
111
+ return this.addOrUpdate(t);
112
+ }
113
+ /**
114
+ * Update a toast by id
115
+ * @param id - The id of the toast to update
116
+ * @param options - The options for the toast
117
+ * @returns The id of the toast
118
+ */
119
+ update(t, e) {
120
+ return this.addOrUpdate({ ...e, id: t });
121
+ }
122
+ /**
123
+ * Remove a toast by id
124
+ * If no id is provided, all current toasts will be removed
125
+ * @param id - The id of the toast to remove
126
+ */
127
+ remove(t) {
128
+ t && !this.toasts.has(t) || (t ? this.toasts.delete(t) : this.clear());
129
+ }
130
+ /**
131
+ * Remove all current toasts
132
+ */
133
+ clear() {
134
+ this.toasts.clear();
135
+ }
136
+ /**
137
+ * Add a success toast
138
+ * @param message - The message to display in the toast
139
+ * @param options - The options for the toast
140
+ * @returns The id of the toast
141
+ */
142
+ success(t, e) {
143
+ return this.addOrUpdate({ ...e, message: t, type: "success" });
144
+ }
145
+ /**
146
+ * Add an error toast
147
+ * @param message - The message to display in the toast
148
+ * @param options - The options for the toast
149
+ * @returns The id of the toast
150
+ */
151
+ error(t, e) {
152
+ return this.addOrUpdate({ ...e, message: t, type: "error" });
153
+ }
154
+ /**
155
+ * Add a warning toast
156
+ * @param message - The message to display in the toast
157
+ * @param options - The options for the toast
158
+ * @returns The id of the toast
159
+ */
160
+ warn(t, e) {
161
+ return this.addOrUpdate({ ...e, message: t, type: "warn" });
162
+ }
163
+ /**
164
+ * Add a loading toast
165
+ * @param message - The message to display in the toast
166
+ * @param options - The options for the toast
167
+ * @returns The id of the toast
168
+ */
169
+ loading(t, e) {
170
+ return this.addOrUpdate({ ...e, message: t, type: "loading" });
171
+ }
172
+ /**
173
+ * Add a promise toast
174
+ * @param promise - The promise to display in the toast
175
+ * @param options - The options for the toast
176
+ * @returns The id of the toast
177
+ */
178
+ async promise(t, e) {
179
+ const o = this.loading(e.loading, { position: e.position, id: e.id });
180
+ try {
181
+ return await t, this.success(e.success, { position: e.position, id: o }), o;
182
+ } catch {
183
+ throw this.error(e.error, { position: e.position, id: o }), new Error(e.error);
184
+ }
185
+ }
186
+ }
187
+ const y = new G(), H = ["onMouseenter", "onMouseleave"], K = /* @__PURE__ */ w({
188
+ __name: "ToastsLiteProvider",
189
+ setup(a) {
190
+ const t = [
191
+ "top-left",
192
+ "top-center",
193
+ "top-right",
194
+ "middle-center",
195
+ "bottom-left",
196
+ "bottom-center",
197
+ "bottom-right"
198
+ ], e = h(y.toastList);
199
+ y.onToastsListChange((s) => {
200
+ e.value = s;
201
+ });
202
+ const o = k(() => {
203
+ const s = /* @__PURE__ */ new Map();
204
+ return e.value.forEach((r) => {
205
+ const u = r.position || "top-center";
206
+ s.has(u) || s.set(u, []), s.get(u).push(r);
207
+ }), s;
208
+ }), n = h({});
209
+ x(() => {
210
+ for (const s of t)
211
+ n.value[s] = [];
212
+ });
213
+ function i(s) {
214
+ n.value[s] && n.value[s].forEach((r) => r == null ? void 0 : r.pause());
215
+ }
216
+ function p(s) {
217
+ n.value[s] && n.value[s].forEach((r) => r == null ? void 0 : r.resume());
218
+ }
219
+ function c(s, r) {
220
+ n.value[s] || (n.value[s] = []), r && "pause" in r && "resume" in r && n.value[s].push(r);
221
+ }
222
+ return (s, r) => (d(), g(B, { to: "body" }, [
223
+ (d(), m(b, null, T(t, (u) => v("div", {
224
+ key: u,
225
+ class: C(["toasts-lite__toast-container", `toasts-lite__${u}`]),
226
+ onMouseenter: (l) => i(u),
227
+ onMouseleave: (l) => p(u)
228
+ }, [
229
+ P(A, {
230
+ name: "toasts-lite",
231
+ appear: ""
232
+ }, {
233
+ default: I(() => [
234
+ (d(!0), m(b, null, T(o.value.get(u) || [], (l) => (d(), g(F, {
235
+ id: l.id,
236
+ ref_for: !0,
237
+ ref: (_) => c(u, _),
238
+ key: l.id,
239
+ type: l.type,
240
+ message: l.message,
241
+ "auto-close": l.autoClose,
242
+ duration: l.duration,
243
+ position: l.position,
244
+ onClose: (_) => N(y).remove(l.id)
245
+ }, null, 8, ["id", "type", "message", "auto-close", "duration", "position", "onClose"]))), 128))
246
+ ]),
247
+ _: 2
248
+ }, 1024)
249
+ ], 42, H)), 64))
250
+ ]));
251
+ }
252
+ });
253
+ export {
254
+ G as ToastsController,
255
+ K as ToastsLiteProvider,
256
+ y as toasts
257
+ };
package/dist/style.css ADDED
@@ -0,0 +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;gap:12px;pointer-events:none}.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="3" 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="3" 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="5" stroke="currentColor" ><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="5" stroke="currentColor" ><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__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}
package/package.json CHANGED
@@ -1,10 +1,43 @@
1
1
  {
2
2
  "name": "vue-toasts-lite",
3
- "version": "0.0.1",
4
- "description": "OIDC trusted publishing setup package for vue-toasts-lite",
5
- "keywords": [
6
- "oidc",
7
- "trusted-publishing",
8
- "setup"
9
- ]
3
+ "version": "0.1.1",
4
+ "type": "module",
5
+ "types": "./dist/index.d.ts",
6
+ "author": "scheron",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/scheron/vue-toasts-lite"
10
+ },
11
+ "license": "MIT",
12
+ "description": "Lightweight toast notifications for Vue 3",
13
+ "keywords": [ "vue", "toast", "notification", "vue3" ],
14
+ "files": [
15
+ "dist"
16
+ ],
17
+ "main": "./dist/index.js",
18
+ "module": "./dist/index.js",
19
+ "exports": {
20
+ ".": {
21
+ "types": "./dist/index.d.ts",
22
+ "import": "./dist/index.js"
23
+ },
24
+ "./style.css": "./dist/style.css"
25
+ },
26
+ "scripts": {
27
+ "dev": "vite",
28
+ "build": "vite build",
29
+ "build:example": "cd example && bun run build",
30
+ "preview": "vite preview"
31
+ },
32
+ "peerDependencies": {
33
+ "vue": "^3.0.0"
34
+ },
35
+ "devDependencies": {
36
+ "@types/node": "^25.0.8",
37
+ "@vitejs/plugin-vue": "^5.0.0",
38
+ "typescript": "^5.8.3",
39
+ "vite": "^5.0.0",
40
+ "vite-plugin-dts": "^4.5.4",
41
+ "vue": "^3.0.0"
42
+ }
10
43
  }