@samline/notify 0.2.7 → 1.0.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.
Files changed (46) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +121 -150
  3. package/dist/browser-notify.js +69 -0
  4. package/dist/cc-2Yt7NqMX.mjs +21 -0
  5. package/dist/cc-B6peeNak.mjs +33 -0
  6. package/dist/cc-BWuAzFJ6.js +12 -0
  7. package/dist/cc-CaBHsjUt.js +34 -0
  8. package/dist/cc-DGff5sSY.js +21 -0
  9. package/dist/cc-he3fHS3P.mjs +12 -0
  10. package/dist/notify.d.mts +44 -0
  11. package/dist/notify.d.mts.map +1 -0
  12. package/dist/notify.d.ts +44 -0
  13. package/dist/notify.d.ts.map +1 -0
  14. package/dist/notify.js +90 -0
  15. package/dist/notify.mjs +87 -0
  16. package/dist/react-notify-12s-7LOZlSBi.js +1068 -0
  17. package/dist/react-notify-12s-BjWbwTu8.mjs +1066 -0
  18. package/dist/react.d.mts +66 -0
  19. package/dist/react.d.mts.map +1 -0
  20. package/dist/react.d.ts +66 -0
  21. package/dist/react.d.ts.map +1 -0
  22. package/dist/react.js +18 -0
  23. package/dist/react.mjs +10 -0
  24. package/dist/styles.css +477 -89
  25. package/dist/svelte.d.mts +45 -0
  26. package/dist/svelte.d.mts.map +1 -0
  27. package/dist/svelte.d.ts +45 -0
  28. package/dist/svelte.d.ts.map +1 -0
  29. package/dist/svelte.js +168 -0
  30. package/dist/svelte.mjs +165 -0
  31. package/dist/vue.d.mts +103 -0
  32. package/dist/vue.d.mts.map +1 -0
  33. package/dist/vue.d.ts +103 -0
  34. package/dist/vue.d.ts.map +1 -0
  35. package/dist/vue.js +2099 -0
  36. package/dist/vue.mjs +2096 -0
  37. package/package.json +95 -57
  38. package/dist/index.cjs.js +0 -1249
  39. package/dist/index.esm.js +0 -1242
  40. package/dist/notify.umd.js +0 -1255
  41. package/docs/browser.md +0 -92
  42. package/docs/react.md +0 -275
  43. package/docs/svelte.md +0 -267
  44. package/docs/vanilla.md +0 -256
  45. package/docs/vue.md +0 -301
  46. package/rollup.config.mjs +0 -56
package/dist/styles.css CHANGED
@@ -1,89 +1,477 @@
1
- :root{
2
- --sileo-bg: #0f1724;
3
- --sileo-foreground: #ffffff;
4
- --sileo-success: #16a34a;
5
- --sileo-error: #ef4444;
6
- --sileo-info: #2563eb;
7
- --sileo-warning: #f59e0b;
8
- --sileo-gap: 0.75rem;
9
- }
10
-
11
- .sileo-toaster{
12
- position: fixed;
13
- z-index: 9999;
14
- display: flex;
15
- flex-direction: column;
16
- gap: var(--sileo-gap);
17
- pointer-events: none;
18
- }
19
-
20
- .sileo-toaster[data-position="top-right"]{ top: 1rem; right: 1rem; align-items:flex-end; }
21
- .sileo-toaster[data-position="top-left"]{ top: 1rem; left: 1rem; align-items:flex-start; }
22
- .sileo-toaster[data-position="bottom-right"]{ bottom: 1rem; right: 1rem; align-items:flex-end; }
23
- .sileo-toaster[data-position="bottom-left"]{ bottom: 1rem; left: 1rem; align-items:flex-start; }
24
-
25
- /* Soporte para posiciones centradas */
26
- .sileo-toaster[data-position="top-center"] {
27
- top: 1rem;
28
- left: 50%;
29
- transform: translateX(-50%);
30
- align-items: center;
31
- }
32
- .sileo-toaster[data-position="bottom-center"] {
33
- bottom: 1rem;
34
- left: 50%;
35
- transform: translateX(-50%);
36
- align-items: center;
37
- }
38
-
39
- .sileo-toast{
40
- pointer-events: auto;
41
- min-width: 13.75rem;
42
- max-width: 22.5rem;
43
- background: var(--sileo-bg);
44
- color: var(--sileo-foreground);
45
- padding: 0.75rem 0.875rem;
46
- border-radius: var(--sileo-roundness, 1rem);
47
- box-shadow: 0 0.375rem 1.125rem rgba(2,6,23,0.6);
48
- display: flex;
49
- gap: 0.5rem;
50
- align-items: center;
51
- position: relative;
52
- overflow: hidden;
53
- /* Efecto gooey visual */
54
- backdrop-filter: blur(6px) saturate(1.2);
55
- filter: url(#sileo-gooey);
56
- }
57
-
58
- .sileo-toast[data-type="success"]{ border-left: 0.25rem solid var(--sileo-success); }
59
- .sileo-toast[data-type="error"]{ border-left: 0.25rem solid var(--sileo-error); }
60
- .sileo-toast[data-type="info"]{ border-left: 0.25rem solid var(--sileo-info); }
61
- .sileo-toast[data-type="warning"]{ border-left: 0.25rem solid var(--sileo-warning); }
62
-
63
- .sileo-toast-header{ font-weight: 600; font-size: 0.875rem; }
64
-
65
- /* Badge circular con blur y animación */
66
- .sileo-toast-badge {
67
- width: 2.25rem;
68
- height: 2.25rem;
69
- min-width: 2.25rem;
70
- min-height: 2.25rem;
71
- border-radius: 50%;
72
- background: rgba(255,255,255,0.08);
73
- display: flex;
74
- align-items: center;
75
- justify-content: center;
76
- margin-right: 0.5rem;
77
- box-shadow: 0 0 0.5rem 0.1rem rgba(0,0,0,0.10);
78
- backdrop-filter: blur(2.5px);
79
- animation: sileo-badge-pop 0.38s cubic-bezier(.22,1,.36,1) both;
80
- }
81
-
82
- @keyframes sileo-badge-pop {
83
- 0% { transform: scale(0.7); opacity: 0; }
84
- 60% { transform: scale(1.15); opacity: 1; }
85
- 100% { transform: scale(1); opacity: 1; }
86
- }
87
- .sileo-toast-desc{ font-size: 0.8125rem; opacity: 0.85; margin-top: 0.25rem; }
88
- .sileo-toast-btn{ margin-left: 0.5rem; background: transparent; color: inherit; border: 1px solid rgba(255,255,255,0.08); padding: 0.375rem 0.5rem; border-radius: 0.375rem; cursor: pointer; }
89
- .sileo-toast-close{ position: absolute; right: 0.5rem; top: 0.375rem; background: transparent; border: none; color: inherit; font-size: 1rem; cursor: pointer; }
1
+ /* -------------------------------- Variables ------------------------------- */
2
+
3
+ :root {
4
+ --notify-spring-easing: linear(
5
+ 0,
6
+ 0.002 0.6%,
7
+ 0.007 1.2%,
8
+ 0.015 1.8%,
9
+ 0.026 2.4%,
10
+ 0.041 3.1%,
11
+ 0.06 3.8%,
12
+ 0.108 5.3%,
13
+ 0.157 6.6%,
14
+ 0.214 8%,
15
+ 0.467 13.7%,
16
+ 0.577 16.3%,
17
+ 0.631 17.7%,
18
+ 0.682 19.1%,
19
+ 0.73 20.5%,
20
+ 0.771 21.8%,
21
+ 0.808 23.1%,
22
+ 0.844 24.5%,
23
+ 0.874 25.8%,
24
+ 0.903 27.2%,
25
+ 0.928 28.6%,
26
+ 0.952 30.1%,
27
+ 0.972 31.6%,
28
+ 0.988 33.1%,
29
+ 1.01 35.7%,
30
+ 1.025 38.5%,
31
+ 1.034 41.6%,
32
+ 1.038 45%,
33
+ 1.035 50.1%,
34
+ 1.012 64.2%,
35
+ 1.003 73%,
36
+ 0.999 83.7%,
37
+ 1
38
+ );
39
+
40
+ --notify-duration: 600ms;
41
+ --notify-height: 40px;
42
+ --notify-width: 350px;
43
+
44
+ --notify-state-success: oklch(0.723 0.219 142.136);
45
+ --notify-state-loading: oklch(0.556 0 0);
46
+ --notify-state-error: oklch(0.637 0.237 25.331);
47
+ --notify-state-warning: oklch(0.795 0.184 86.047);
48
+ --notify-state-info: oklch(0.685 0.169 237.323);
49
+ --notify-state-action: oklch(0.623 0.214 259.815);
50
+ }
51
+
52
+ /* ---------------------------------- Toast --------------------------------- */
53
+
54
+ [data-notify-toast] {
55
+ position: relative;
56
+ cursor: pointer;
57
+ pointer-events: auto;
58
+ touch-action: none;
59
+ border: 0;
60
+ background: transparent;
61
+ padding: 0;
62
+ width: var(--notify-width);
63
+ height: var(--_h, var(--notify-height));
64
+ opacity: 0;
65
+ transform: translateZ(0) scale(0.95);
66
+ transform-origin: center;
67
+ contain: layout style;
68
+ overflow: visible;
69
+ }
70
+
71
+ [data-notify-toast][data-state="loading"] {
72
+ cursor: default;
73
+ }
74
+
75
+ [data-notify-toast][data-ready="true"] {
76
+ opacity: 1;
77
+ transform: translateZ(0) scale(1);
78
+ transition:
79
+ transform calc(var(--notify-duration) * 0.66) var(--notify-spring-easing),
80
+ opacity calc(var(--notify-duration) * 0.66) var(--notify-spring-easing),
81
+ margin-bottom calc(var(--notify-duration) * 0.66) var(--notify-spring-easing),
82
+ margin-top calc(var(--notify-duration) * 0.66) var(--notify-spring-easing),
83
+ height var(--notify-duration) var(--notify-spring-easing);
84
+ }
85
+
86
+ /* Entry animation direction */
87
+ [data-notify-viewport][data-position^="top"]
88
+ [data-notify-toast]:not([data-ready="true"]) {
89
+ transform: translateY(-6px) scale(0.95);
90
+ }
91
+
92
+ [data-notify-viewport][data-position^="bottom"]
93
+ [data-notify-toast]:not([data-ready="true"]) {
94
+ transform: translateY(6px) scale(0.95);
95
+ }
96
+
97
+ /* Exit */
98
+ [data-notify-toast][data-ready="true"][data-exiting="true"] {
99
+ opacity: 0;
100
+ pointer-events: none;
101
+ }
102
+
103
+ [data-notify-viewport][data-position^="top"]
104
+ [data-notify-toast][data-ready="true"][data-exiting="true"] {
105
+ transform: translateY(-6px) scale(0.95);
106
+ }
107
+
108
+ [data-notify-viewport][data-position^="bottom"]
109
+ [data-notify-toast][data-ready="true"][data-exiting="true"] {
110
+ transform: translateY(6px) scale(0.95);
111
+ }
112
+
113
+ /* ------------------------------- SVG Canvas ------------------------------- */
114
+
115
+ [data-notify-canvas] {
116
+ position: absolute;
117
+ left: 0;
118
+ right: 0;
119
+ pointer-events: none;
120
+ transform: translateZ(0);
121
+ contain: layout style;
122
+ overflow: visible;
123
+ }
124
+
125
+ [data-sileo-canvas][data-edge="top"] {
126
+ bottom: 0;
127
+ transform: scaleY(-1) translateZ(0);
128
+ }
129
+
130
+ [data-sileo-canvas][data-edge="bottom"] {
131
+ top: 0;
132
+ }
133
+
134
+ [data-notify-svg] {
135
+ overflow: visible;
136
+ }
137
+
138
+ /* --------------------------------- Shapes --------------------------------- */
139
+
140
+ /* --------------------------------- Header --------------------------------- */
141
+
142
+ [data-notify-header] {
143
+ position: absolute;
144
+ z-index: 20;
145
+ display: flex;
146
+ align-items: center;
147
+ padding: 0.5rem;
148
+ height: var(--sileo-height);
149
+ overflow: hidden;
150
+ left: var(--_px, 0px);
151
+ transform: var(--_ht);
152
+ max-width: var(--_pw);
153
+ }
154
+
155
+ [data-notify-toast][data-ready="true"] [data-notify-header] {
156
+ transition:
157
+ transform var(--sileo-duration) var(--sileo-spring-easing),
158
+ left var(--sileo-duration) var(--sileo-spring-easing),
159
+ max-width var(--sileo-duration) var(--sileo-spring-easing);
160
+ }
161
+
162
+ [data-notify-header][data-edge="top"] {
163
+ bottom: 0;
164
+ }
165
+
166
+ [data-notify-header][data-edge="bottom"] {
167
+ top: 0;
168
+ }
169
+
170
+ /* Header inner morphing */
171
+ [data-notify-header-stack] {
172
+ position: relative;
173
+ display: inline-flex;
174
+ align-items: center;
175
+ height: 100%;
176
+ }
177
+
178
+ [data-notify-header-inner] {
179
+ display: flex;
180
+ align-items: center;
181
+ gap: 0.5rem;
182
+ white-space: nowrap;
183
+ opacity: 1;
184
+ filter: blur(0px);
185
+ transform: translateZ(0);
186
+ }
187
+
188
+ [data-notify-header-inner][data-layer="current"] {
189
+ position: relative;
190
+ z-index: 1;
191
+ animation: sileo-header-enter var(--sileo-duration) var(--sileo-spring-easing)
192
+ both;
193
+ }
194
+
195
+ [data-notify-header-inner][data-layer="current"]:not(:only-child),
196
+ [data-notify-header-inner][data-exiting="true"] {
197
+ will-change: opacity, filter;
198
+ }
199
+
200
+ [data-notify-header-inner][data-layer="prev"] {
201
+ position: absolute;
202
+ left: 0;
203
+ top: 0;
204
+ z-index: 0;
205
+ pointer-events: none;
206
+ }
207
+
208
+ [data-notify-header-inner][data-exiting="true"] {
209
+ animation: notify-header-exit calc(var(--notify-duration) * 0.7) ease forwards;
210
+ }
211
+
212
+ /* ---------------------------------- Badge --------------------------------- */
213
+
214
+ [data-notify-badge] {
215
+ display: flex;
216
+ height: 24px;
217
+ width: 24px;
218
+ flex-shrink: 0;
219
+ align-items: center;
220
+ justify-content: center;
221
+ padding: 2px;
222
+ box-sizing: border-box;
223
+ border-radius: 9999px;
224
+ color: var(--sileo-tone, currentColor);
225
+ background-color: var(--sileo-tone-bg, transparent);
226
+ }
227
+
228
+ /* ---------------------------------- Title --------------------------------- */
229
+
230
+ [data-notify-title] {
231
+ font-size: 0.825rem;
232
+ line-height: 1rem;
233
+ font-weight: 500;
234
+ text-transform: capitalize;
235
+ color: var(--sileo-tone, currentColor);
236
+ }
237
+
238
+ /* ------------------------------ State Colors ------------------------------ */
239
+
240
+ :is([data-notify-badge], [data-notify-title], [data-notify-button])[data-state] {
241
+ --_c: var(--notify-state-success);
242
+ }
243
+
244
+ :is(
245
+ [data-notify-badge],
246
+ [data-notify-title],
247
+ [data-notify-button]
248
+ )[data-state="loading"] {
249
+ --_c: var(--notify-state-loading);
250
+ }
251
+
252
+ :is(
253
+ [data-notify-badge],
254
+ [data-notify-title],
255
+ [data-notify-button]
256
+ )[data-state="error"] {
257
+ --_c: var(--notify-state-error);
258
+ }
259
+
260
+ :is(
261
+ [data-notify-badge],
262
+ [data-notify-title],
263
+ [data-notify-button]
264
+ )[data-state="warning"] {
265
+ --_c: var(--notify-state-warning);
266
+ }
267
+
268
+ :is(
269
+ [data-notify-badge],
270
+ [data-notify-title],
271
+ [data-notify-button]
272
+ )[data-state="info"] {
273
+ --_c: var(--notify-state-info);
274
+ }
275
+
276
+ :is(
277
+ [data-notify-badge],
278
+ [data-notify-title],
279
+ [data-notify-button]
280
+ )[data-state="action"] {
281
+ --_c: var(--notify-state-action);
282
+ }
283
+
284
+ :is([data-notify-badge], [data-notify-title])[data-state] {
285
+ --notify-tone: var(--_c);
286
+ --notify-tone-bg: color-mix(in oklch, var(--_c) 20%, transparent);
287
+ }
288
+
289
+ /* --------------------------------- Content -------------------------------- */
290
+
291
+ [data-notify-content] {
292
+ position: absolute;
293
+ left: 0;
294
+ z-index: 10;
295
+ width: 100%;
296
+ pointer-events: none;
297
+ opacity: var(--_co, 0);
298
+ }
299
+
300
+ [data-notify-content]:not([data-visible="true"]) {
301
+ content-visibility: hidden;
302
+ }
303
+
304
+ [data-notify-toast][data-ready="true"] [data-notify-content] {
305
+ transition: opacity calc(var(--notify-duration) * 0.08) ease
306
+ calc(var(--notify-duration) * 0.04);
307
+ }
308
+
309
+ [data-notify-content][data-edge="top"] {
310
+ top: 0;
311
+ }
312
+
313
+ [data-notify-content][data-edge="bottom"] {
314
+ top: var(--sileo-height);
315
+ }
316
+
317
+ [data-notify-content][data-visible="true"] {
318
+ pointer-events: auto;
319
+ }
320
+
321
+ [data-notify-toast][data-ready="true"]
322
+ [data-notify-content][data-visible="true"] {
323
+ transition: opacity calc(var(--notify-duration) * 0.6) ease
324
+ calc(var(--notify-duration) * 0.3);
325
+ }
326
+
327
+ [data-notify-description] {
328
+ width: 100%;
329
+ text-align: left;
330
+ padding: 1rem;
331
+ font-size: 0.875rem;
332
+ line-height: 1.25rem;
333
+ contain: layout style paint;
334
+ content-visibility: auto;
335
+ }
336
+
337
+ /* --------------------------------- Button --------------------------------- */
338
+
339
+ [data-notify-button] {
340
+ display: flex;
341
+ align-items: center;
342
+ justify-content: center;
343
+ height: 1.75rem;
344
+ padding: 0 0.625rem;
345
+ margin-top: 0.75rem;
346
+ border-radius: 9999px;
347
+ border: 0;
348
+ font-size: 0.75rem;
349
+ font-weight: 500;
350
+ cursor: pointer;
351
+ color: var(--sileo-btn-color, currentColor);
352
+ background-color: var(--sileo-btn-bg, transparent);
353
+ transition: background-color 150ms ease;
354
+ }
355
+
356
+ [data-notify-button]:hover {
357
+ background-color: var(--sileo-btn-bg-hover, transparent);
358
+ }
359
+
360
+ [data-notify-button][data-state] {
361
+ --notify-btn-color: var(--_c);
362
+ --notify-btn-bg: color-mix(in oklch, var(--_c) 15%, transparent);
363
+ --notify-btn-bg-hover: color-mix(in oklch, var(--_c) 25%, transparent);
364
+ }
365
+
366
+ /* -------------------------------- Animations ------------------------------ */
367
+
368
+ [data-notify-icon="spin"] {
369
+ animation: notify-spin 1s linear infinite;
370
+ }
371
+
372
+ @keyframes notify-spin {
373
+ to {
374
+ transform: rotate(360deg);
375
+ }
376
+ }
377
+
378
+ @keyframes notify-header-enter {
379
+ from {
380
+ opacity: 0;
381
+ filter: blur(6px);
382
+ }
383
+ to {
384
+ opacity: 1;
385
+ filter: blur(0px);
386
+ }
387
+ }
388
+
389
+ @keyframes notify-header-exit {
390
+ from {
391
+ opacity: 1;
392
+ filter: blur(0px);
393
+ }
394
+ to {
395
+ opacity: 0;
396
+ filter: blur(6px);
397
+ }
398
+ }
399
+
400
+ /* -------------------------------- Viewports ------------------------------- */
401
+
402
+ [data-notify-viewport] {
403
+ position: fixed;
404
+ z-index: 50;
405
+ display: flex;
406
+ gap: 0.75rem;
407
+ padding: 0.75rem;
408
+ pointer-events: none;
409
+ max-width: calc(100vw - 1.5rem);
410
+ contain: layout style;
411
+ }
412
+
413
+ [data-notify-viewport][data-position^="top"]
414
+ [data-notify-toast]:not([data-ready="true"]) {
415
+ margin-bottom: calc(-1 * (var(--notify-height) + 0.75rem));
416
+ }
417
+
418
+ [data-notify-viewport][data-position^="bottom"]
419
+ [data-notify-toast]:not([data-ready="true"]) {
420
+ margin-top: calc(-1 * (var(--notify-height) + 0.75rem));
421
+ }
422
+
423
+ /* Vertical edge */
424
+ [data-notify-viewport][data-position^="top"] {
425
+ top: 0;
426
+ flex-direction: column-reverse;
427
+ }
428
+
429
+ [data-notify-viewport][data-position^="bottom"] {
430
+ bottom: 0;
431
+ flex-direction: column;
432
+ }
433
+
434
+ /* Horizontal alignment */
435
+ [data-notify-viewport][data-position$="left"] {
436
+ left: 0;
437
+ align-items: flex-start;
438
+ }
439
+
440
+ [data-notify-viewport][data-position$="right"] {
441
+ right: 0;
442
+ align-items: flex-end;
443
+ }
444
+
445
+ [data-notify-viewport][data-position$="center"] {
446
+ left: 50%;
447
+ transform: translateX(-50%);
448
+ align-items: center;
449
+ }
450
+
451
+ @media (prefers-reduced-motion: no-preference) {
452
+ [data-notify-toast][data-ready="true"]:hover,
453
+ [data-notify-toast][data-ready="true"][data-exiting="true"] {
454
+ will-change: transform, opacity, height;
455
+ }
456
+ }
457
+
458
+ @media (prefers-reduced-motion: reduce) {
459
+ [data-notify-viewport],
460
+ [data-notify-viewport] *,
461
+ [data-notify-viewport] *::before,
462
+ [data-notify-viewport] *::after {
463
+ animation-duration: 0.01ms;
464
+ animation-iteration-count: 1;
465
+ transition-duration: 0.01ms;
466
+ }
467
+ }
468
+
469
+ /* --------------------------------- Themes -------------------------------- */
470
+
471
+ [data-notify-viewport][data-theme="dark"] [data-notify-description] {
472
+ color: rgba(0, 0, 0, 0.5);
473
+ }
474
+
475
+ [data-notify-viewport][data-theme="light"] [data-notify-description] {
476
+ color: rgba(255, 255, 255, 0.5);
477
+ }
@@ -0,0 +1,45 @@
1
+ import * as svelte_store from 'svelte/store';
2
+
3
+ type NotifyState = "success" | "loading" | "error" | "warning" | "info" | "action";
4
+ interface NotifyStyles {
5
+ title?: string;
6
+ description?: string;
7
+ badge?: string;
8
+ button?: string;
9
+ }
10
+ interface NotifyButton {
11
+ title: string;
12
+ onClick: () => void;
13
+ }
14
+ declare const NOTIFY_POSITIONS: readonly ["top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right"];
15
+ type NotifyPosition = (typeof NOTIFY_POSITIONS)[number];
16
+ interface NotifyOptions {
17
+ title?: string;
18
+ description?: string;
19
+ type?: NotifyState;
20
+ position?: NotifyPosition;
21
+ duration?: number | null;
22
+ icon?: any;
23
+ styles?: NotifyStyles;
24
+ fill?: string;
25
+ roundness?: number;
26
+ autopilot?: boolean | {
27
+ expand?: number;
28
+ collapse?: number;
29
+ };
30
+ button?: NotifyButton;
31
+ }
32
+
33
+ interface NotifyItem extends NotifyOptions {
34
+ id: string;
35
+ instanceId: string;
36
+ exiting?: boolean;
37
+ autoExpandDelayMs?: number;
38
+ autoCollapseDelayMs?: number;
39
+ }
40
+
41
+ declare const notifyToasts: svelte_store.Writable<NotifyItem[]>;
42
+ declare function showNotifyToast(options: NotifyOptions): string;
43
+
44
+ export { notifyToasts, showNotifyToast };
45
+ //# sourceMappingURL=svelte.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svelte.d.mts","sources":["../src/types.ts","../src/core/notify-core.ts","../src/svelte-notify.ts"],"mappings":";;AAAA,KAAK,WAAW;AAChB,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA,UAAU,YAAY;AACtB;AACA;AACA;AACA,cAAc,gBAAgB;AAC9B,KAAK,cAAc,WAAW,gBAAgB;AAC9C,UAAU,aAAa;AACvB;AACA;AACA,WAAW,WAAW;AACtB,eAAe,cAAc;AAC7B;AACA;AACA,aAAa,YAAY;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,YAAY;AACzB;;AC1BA,UAAU,UAAU,SAAS,aAAa;AAC1C;AACA;AACA;AACA;AACA;AACA;;ACLA,cAAc,YAAY,EAAE,YAAY,CAAC,QAAQ,CAACA,UAA6B;AAC/E,iBAAiB,eAAe,UAAU,aAAa;;;;","names":["__core_notify_core.NotifyItem"]}
@@ -0,0 +1,45 @@
1
+ import * as svelte_store from 'svelte/store';
2
+
3
+ type NotifyState = "success" | "loading" | "error" | "warning" | "info" | "action";
4
+ interface NotifyStyles {
5
+ title?: string;
6
+ description?: string;
7
+ badge?: string;
8
+ button?: string;
9
+ }
10
+ interface NotifyButton {
11
+ title: string;
12
+ onClick: () => void;
13
+ }
14
+ declare const NOTIFY_POSITIONS: readonly ["top-left", "top-center", "top-right", "bottom-left", "bottom-center", "bottom-right"];
15
+ type NotifyPosition = (typeof NOTIFY_POSITIONS)[number];
16
+ interface NotifyOptions {
17
+ title?: string;
18
+ description?: string;
19
+ type?: NotifyState;
20
+ position?: NotifyPosition;
21
+ duration?: number | null;
22
+ icon?: any;
23
+ styles?: NotifyStyles;
24
+ fill?: string;
25
+ roundness?: number;
26
+ autopilot?: boolean | {
27
+ expand?: number;
28
+ collapse?: number;
29
+ };
30
+ button?: NotifyButton;
31
+ }
32
+
33
+ interface NotifyItem extends NotifyOptions {
34
+ id: string;
35
+ instanceId: string;
36
+ exiting?: boolean;
37
+ autoExpandDelayMs?: number;
38
+ autoCollapseDelayMs?: number;
39
+ }
40
+
41
+ declare const notifyToasts: svelte_store.Writable<NotifyItem[]>;
42
+ declare function showNotifyToast(options: NotifyOptions): string;
43
+
44
+ export { notifyToasts, showNotifyToast };
45
+ //# sourceMappingURL=svelte.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"svelte.d.ts","sources":["../src/types.ts","../src/core/notify-core.ts","../src/svelte-notify.ts"],"mappings":";;AAAA,KAAK,WAAW;AAChB,UAAU,YAAY;AACtB;AACA;AACA;AACA;AACA;AACA,UAAU,YAAY;AACtB;AACA;AACA;AACA,cAAc,gBAAgB;AAC9B,KAAK,cAAc,WAAW,gBAAgB;AAC9C,UAAU,aAAa;AACvB;AACA;AACA,WAAW,WAAW;AACtB,eAAe,cAAc;AAC7B;AACA;AACA,aAAa,YAAY;AACzB;AACA;AACA;AACA;AACA;AACA;AACA,aAAa,YAAY;AACzB;;AC1BA,UAAU,UAAU,SAAS,aAAa;AAC1C;AACA;AACA;AACA;AACA;AACA;;ACLA,cAAc,YAAY,EAAE,YAAY,CAAC,QAAQ,CAACA,UAA6B;AAC/E,iBAAiB,eAAe,UAAU,aAAa;;;;","names":["__core_notify_core.NotifyItem"]}