goey-toast 0.2.0 → 0.2.2

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/dist/index.css CHANGED
@@ -20,6 +20,13 @@
20
20
  [data-goey-toast-css] {
21
21
  --goey-toast: 1;
22
22
  }
23
+ [data-sonner-toast][data-expanded=true] {
24
+ transition:
25
+ transform 0.15s,
26
+ opacity 0.4s,
27
+ height 0.15s,
28
+ box-shadow 0.2s !important;
29
+ }
23
30
  .goey-wrapper {
24
31
  pointer-events: auto;
25
32
  cursor: default;
@@ -51,6 +58,7 @@
51
58
  }
52
59
  .goey-contentExpanded {
53
60
  padding: 7px 10px 16px 10px;
61
+ min-width: 300px;
54
62
  max-width: 380px;
55
63
  }
56
64
  .goey-header {
@@ -94,12 +102,20 @@
94
102
  .goey-titleLoading {
95
103
  color: #555;
96
104
  }
105
+ .goey-timestamp {
106
+ font-size: 11px;
107
+ font-weight: 400;
108
+ color: #999;
109
+ white-space: nowrap;
110
+ line-height: 1;
111
+ padding-left: 6px;
112
+ }
97
113
  .goey-description {
98
114
  font-size: 13px;
99
115
  font-weight: 400;
100
116
  color: #444;
101
117
  line-height: 1.55;
102
- margin-top: 12px;
118
+ margin-top: 16px;
103
119
  overflow: hidden;
104
120
  }
105
121
  .goey-actionWrapper {
@@ -179,78 +195,139 @@
179
195
  .goey-actionInfo:active {
180
196
  background: #64B5F6;
181
197
  }
182
- [data-sonner-toaster][data-theme=dark] .goey-blobSvg {
198
+ .goey-progressWrapper {
199
+ margin-top: 10px;
200
+ overflow: hidden;
201
+ border-radius: 2px;
202
+ height: 3px;
203
+ background: rgba(0, 0, 0, 0.06);
204
+ }
205
+ .goey-progressBar {
206
+ height: 100%;
207
+ border-radius: 2px;
208
+ transform-origin: left center;
209
+ animation: goey-progress-shrink var(--goey-progress-duration, 4000ms) linear forwards;
210
+ animation-play-state: running;
211
+ }
212
+ .goey-progressPaused .goey-progressBar {
213
+ animation-play-state: paused;
214
+ }
215
+ @keyframes goey-progress-shrink {
216
+ from {
217
+ transform: scaleX(1);
218
+ }
219
+ to {
220
+ transform: scaleX(0);
221
+ }
222
+ }
223
+ .goey-progressDefault {
224
+ background: #999;
225
+ }
226
+ .goey-progressSuccess {
227
+ background: #4CAF50;
228
+ }
229
+ .goey-progressError {
230
+ background: #E53935;
231
+ }
232
+ .goey-progressWarning {
233
+ background: #C49000;
234
+ }
235
+ .goey-progressInfo {
236
+ background: #1E88E5;
237
+ }
238
+ .goey-wrapper[data-theme=dark] .goey-blobSvg {
183
239
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3)) drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2));
184
240
  }
185
- [data-sonner-toaster][data-theme=dark] .goey-titleDefault {
241
+ .goey-wrapper[data-theme=dark] .goey-titleDefault {
186
242
  color: #ccc;
187
243
  }
188
- [data-sonner-toaster][data-theme=dark] .goey-titleSuccess {
244
+ .goey-wrapper[data-theme=dark] .goey-titleSuccess {
189
245
  color: #66BB6A;
190
246
  }
191
- [data-sonner-toaster][data-theme=dark] .goey-titleError {
247
+ .goey-wrapper[data-theme=dark] .goey-titleError {
192
248
  color: #EF5350;
193
249
  }
194
- [data-sonner-toaster][data-theme=dark] .goey-titleWarning {
250
+ .goey-wrapper[data-theme=dark] .goey-titleWarning {
195
251
  color: #FFB300;
196
252
  }
197
- [data-sonner-toaster][data-theme=dark] .goey-titleInfo {
253
+ .goey-wrapper[data-theme=dark] .goey-titleInfo {
198
254
  color: #42A5F5;
199
255
  }
200
- [data-sonner-toaster][data-theme=dark] .goey-titleLoading {
256
+ .goey-wrapper[data-theme=dark] .goey-titleLoading {
201
257
  color: #ccc;
202
258
  }
203
- [data-sonner-toaster][data-theme=dark] .goey-description {
204
- color: #aaa;
259
+ .goey-wrapper[data-theme=dark] .goey-timestamp {
260
+ color: #777;
261
+ }
262
+ .goey-wrapper[data-theme=dark] .goey-description {
263
+ color: #e0e0e0;
205
264
  }
206
- [data-sonner-toaster][data-theme=dark] .goey-actionDefault {
265
+ .goey-wrapper[data-theme=dark] .goey-actionDefault {
207
266
  background: #3a3a3a;
208
267
  color: #ccc;
209
268
  }
210
- [data-sonner-toaster][data-theme=dark] .goey-actionDefault:hover {
269
+ .goey-wrapper[data-theme=dark] .goey-actionDefault:hover {
211
270
  background: #444;
212
271
  }
213
- [data-sonner-toaster][data-theme=dark] .goey-actionDefault:active {
272
+ .goey-wrapper[data-theme=dark] .goey-actionDefault:active {
214
273
  background: #4e4e4e;
215
274
  }
216
- [data-sonner-toaster][data-theme=dark] .goey-actionSuccess {
275
+ .goey-wrapper[data-theme=dark] .goey-actionSuccess {
217
276
  background: #1b5e20;
218
277
  color: #66BB6A;
219
278
  }
220
- [data-sonner-toaster][data-theme=dark] .goey-actionSuccess:hover {
279
+ .goey-wrapper[data-theme=dark] .goey-actionSuccess:hover {
221
280
  background: #2e7d32;
222
281
  }
223
- [data-sonner-toaster][data-theme=dark] .goey-actionSuccess:active {
282
+ .goey-wrapper[data-theme=dark] .goey-actionSuccess:active {
224
283
  background: #388e3c;
225
284
  }
226
- [data-sonner-toaster][data-theme=dark] .goey-actionError {
285
+ .goey-wrapper[data-theme=dark] .goey-actionError {
227
286
  background: #b71c1c;
228
287
  color: #EF5350;
229
288
  }
230
- [data-sonner-toaster][data-theme=dark] .goey-actionError:hover {
289
+ .goey-wrapper[data-theme=dark] .goey-actionError:hover {
231
290
  background: #c62828;
232
291
  }
233
- [data-sonner-toaster][data-theme=dark] .goey-actionError:active {
292
+ .goey-wrapper[data-theme=dark] .goey-actionError:active {
234
293
  background: #d32f2f;
235
294
  }
236
- [data-sonner-toaster][data-theme=dark] .goey-actionWarning {
295
+ .goey-wrapper[data-theme=dark] .goey-actionWarning {
237
296
  background: #4a3800;
238
297
  color: #FFB300;
239
298
  }
240
- [data-sonner-toaster][data-theme=dark] .goey-actionWarning:hover {
299
+ .goey-wrapper[data-theme=dark] .goey-actionWarning:hover {
241
300
  background: #5c4600;
242
301
  }
243
- [data-sonner-toaster][data-theme=dark] .goey-actionWarning:active {
302
+ .goey-wrapper[data-theme=dark] .goey-actionWarning:active {
244
303
  background: #6e5400;
245
304
  }
246
- [data-sonner-toaster][data-theme=dark] .goey-actionInfo {
305
+ .goey-wrapper[data-theme=dark] .goey-actionInfo {
247
306
  background: #0d47a1;
248
307
  color: #42A5F5;
249
308
  }
250
- [data-sonner-toaster][data-theme=dark] .goey-actionInfo:hover {
309
+ .goey-wrapper[data-theme=dark] .goey-actionInfo:hover {
251
310
  background: #1565c0;
252
311
  }
253
- [data-sonner-toaster][data-theme=dark] .goey-actionInfo:active {
312
+ .goey-wrapper[data-theme=dark] .goey-actionInfo:active {
254
313
  background: #1976d2;
255
314
  }
315
+ .goey-wrapper[data-theme=dark] .goey-progressWrapper {
316
+ background: rgba(255, 255, 255, 0.1);
317
+ }
318
+ .goey-wrapper[data-theme=dark] .goey-progressDefault {
319
+ background: #888;
320
+ }
321
+ .goey-wrapper[data-theme=dark] .goey-progressSuccess {
322
+ background: #66BB6A;
323
+ }
324
+ .goey-wrapper[data-theme=dark] .goey-progressError {
325
+ background: #EF5350;
326
+ }
327
+ .goey-wrapper[data-theme=dark] .goey-progressWarning {
328
+ background: #FFB300;
329
+ }
330
+ .goey-wrapper[data-theme=dark] .goey-progressInfo {
331
+ background: #42A5F5;
332
+ }
256
333
  /*# sourceMappingURL=index.css.map */
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/GoeyToast.css"],"sourcesContent":["/* Spinner animation */\n.goey-spinnerSpin {\n animation: goey-spin 1s linear infinite;\n}\n\n@keyframes goey-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n}\n\n/* Center position: center the toast within Sonner's container */\n[data-sonner-toast][data-x-position=\"center\"] {\n left: 0 !important;\n right: 0 !important;\n margin-left: auto !important;\n margin-right: auto !important;\n width: fit-content !important;\n}\n\n/* Style detection marker — used by GoeyToaster to verify CSS is loaded */\n[data-goey-toast-css] { --goey-toast: 1; }\n\n/* ============================================\n Wrapper — single container for both states\n ============================================ */\n.goey-wrapper {\n pointer-events: auto;\n cursor: default;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;\n position: relative;\n width: fit-content;\n}\n\n/* SVG background — parametric morph from pill to blob */\n.goey-blobSvg {\n position: absolute;\n top: 0;\n left: 0;\n overflow: visible;\n pointer-events: none;\n filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.06))\n drop-shadow(0 1px 4px rgba(0, 0, 0, 0.04));\n}\n\n/* Content on top of SVG background */\n.goey-content {\n position: relative;\n z-index: 1;\n transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.goey-contentCompact {\n padding: 7px 10px 7px 10px;\n}\n\n.goey-contentExpanded {\n padding: 7px 10px 16px 10px;\n max-width: 380px;\n}\n\n/* ============================================\n Shared\n ============================================ */\n.goey-header {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n color: inherit;\n}\n\n.goey-iconWrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 18px;\n height: 18px;\n line-height: 0;\n}\n\n.goey-title {\n font-size: 12px;\n font-weight: 700;\n line-height: 1;\n white-space: nowrap;\n color: inherit;\n padding: 0 4px 0 2px;\n}\n\n.goey-titleDefault { color: #555; }\n.goey-titleSuccess { color: #4CAF50; }\n.goey-titleError { color: #E53935; }\n.goey-titleWarning { color: #C49000; }\n.goey-titleInfo { color: #1E88E5; }\n.goey-titleLoading { color: #555; }\n\n.goey-description {\n font-size: 13px;\n font-weight: 400;\n color: #444;\n line-height: 1.55;\n margin-top: 12px;\n overflow: hidden;\n}\n\n.goey-actionWrapper {\n margin-top: 12px;\n overflow: hidden;\n}\n\n.goey-actionButton {\n display: block;\n box-sizing: border-box;\n width: 100%;\n border: none;\n border-radius: 999px;\n padding: 10px 20px;\n font-size: 13px;\n font-weight: 700;\n cursor: pointer;\n font-family: inherit;\n text-align: center;\n outline: none;\n -webkit-tap-highlight-color: transparent;\n transition: background 0.15s ease;\n}\n\n.goey-actionButton:focus:not(:focus-visible) {\n outline: none;\n}\n\n.goey-actionButton:focus-visible {\n outline: 2px solid currentColor;\n outline-offset: 2px;\n}\n\n.goey-actionDefault {\n background: #E8E8E8;\n color: #555;\n}\n.goey-actionDefault:hover { background: #DCDCDC; }\n.goey-actionDefault:active { background: #D0D0D0; }\n\n.goey-actionSuccess {\n background: #C8E6C9;\n color: #4CAF50;\n}\n.goey-actionSuccess:hover { background: #A5D6A7; }\n.goey-actionSuccess:active { background: #81C784; }\n\n.goey-actionError {\n background: #FFCDD2;\n color: #E53935;\n}\n.goey-actionError:hover { background: #EF9A9A; }\n.goey-actionError:active { background: #E57373; }\n\n.goey-actionWarning {\n background: #FFECB3;\n color: #C49000;\n}\n.goey-actionWarning:hover { background: #FFE082; }\n.goey-actionWarning:active { background: #FFD54F; }\n\n.goey-actionInfo {\n background: #BBDEFB;\n color: #1E88E5;\n}\n.goey-actionInfo:hover { background: #90CAF9; }\n.goey-actionInfo:active { background: #64B5F6; }\n\n/* ============================================\n Dark mode\n ============================================ */\n\n[data-sonner-toaster][data-theme=\"dark\"] .goey-blobSvg {\n filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3))\n drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2));\n}\n\n[data-sonner-toaster][data-theme=\"dark\"] .goey-titleDefault { color: #ccc; }\n[data-sonner-toaster][data-theme=\"dark\"] .goey-titleSuccess { color: #66BB6A; }\n[data-sonner-toaster][data-theme=\"dark\"] .goey-titleError { color: #EF5350; }\n[data-sonner-toaster][data-theme=\"dark\"] .goey-titleWarning { color: #FFB300; }\n[data-sonner-toaster][data-theme=\"dark\"] .goey-titleInfo { color: #42A5F5; }\n[data-sonner-toaster][data-theme=\"dark\"] .goey-titleLoading { color: #ccc; }\n\n[data-sonner-toaster][data-theme=\"dark\"] .goey-description {\n color: #aaa;\n}\n\n[data-sonner-toaster][data-theme=\"dark\"] .goey-actionDefault {\n background: #3a3a3a;\n color: #ccc;\n}\n[data-sonner-toaster][data-theme=\"dark\"] .goey-actionDefault:hover { background: #444; }\n[data-sonner-toaster][data-theme=\"dark\"] .goey-actionDefault:active { background: #4e4e4e; }\n\n[data-sonner-toaster][data-theme=\"dark\"] .goey-actionSuccess {\n background: #1b5e20;\n color: #66BB6A;\n}\n[data-sonner-toaster][data-theme=\"dark\"] .goey-actionSuccess:hover { background: #2e7d32; }\n[data-sonner-toaster][data-theme=\"dark\"] .goey-actionSuccess:active { background: #388e3c; }\n\n[data-sonner-toaster][data-theme=\"dark\"] .goey-actionError {\n background: #b71c1c;\n color: #EF5350;\n}\n[data-sonner-toaster][data-theme=\"dark\"] .goey-actionError:hover { background: #c62828; }\n[data-sonner-toaster][data-theme=\"dark\"] .goey-actionError:active { background: #d32f2f; }\n\n[data-sonner-toaster][data-theme=\"dark\"] .goey-actionWarning {\n background: #4a3800;\n color: #FFB300;\n}\n[data-sonner-toaster][data-theme=\"dark\"] .goey-actionWarning:hover { background: #5c4600; }\n[data-sonner-toaster][data-theme=\"dark\"] .goey-actionWarning:active { background: #6e5400; }\n\n[data-sonner-toaster][data-theme=\"dark\"] .goey-actionInfo {\n background: #0d47a1;\n color: #42A5F5;\n}\n[data-sonner-toaster][data-theme=\"dark\"] .goey-actionInfo:hover { background: #1565c0; }\n[data-sonner-toaster][data-theme=\"dark\"] .goey-actionInfo:active { background: #1976d2; }\n"],"mappings":";AACA,CAAC;AACC,aAAW,UAAU,GAAG,OAAO;AACjC;AAEA,WAHa;AAIX;AAAO,eAAW,OAAO;AAAO;AAChC;AAAK,eAAW,OAAO;AAAS;AAClC;AAGA,CAAC,kBAAkB,CAAC;AAClB,QAAM;AACN,SAAO;AACP,eAAa;AACb,gBAAc;AACd,SAAO;AACT;AAGA,CAAC;AAAuB,gBAAc;AAAG;AAKzC,CAAC;AACC,kBAAgB;AAChB,UAAQ;AACR;AAAA,IAAa,aAAa;AAAA,IAAE,kBAAkB;AAA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eA4DwD;AAAU,cAAY;AAAS;","names":[]}
1
+ {"version":3,"sources":["../src/components/GoeyToast.css"],"sourcesContent":["/* Spinner animation */\n.goey-spinnerSpin {\n animation: goey-spin 1s linear infinite;\n}\n\n@keyframes goey-spin {\n from { transform: rotate(0deg); }\n to { transform: rotate(360deg); }\n}\n\n/* Center position: center the toast within Sonner's container */\n[data-sonner-toast][data-x-position=\"center\"] {\n left: 0 !important;\n right: 0 !important;\n margin-left: auto !important;\n margin-right: auto !important;\n width: fit-content !important;\n}\n\n/* Style detection marker — used by GoeyToaster to verify CSS is loaded */\n[data-goey-toast-css] { --goey-toast: 1; }\n\n/* When Sonner expands the stack (hover), shorten height/transform CSS transitions\n so our syncSonnerHeights corrections apply quickly (~150ms instead of 400ms).\n Sonner writes stale --offset values from its React state; 400ms correction\n causes visible overlap. 150ms is fast enough to prevent overlap while keeping\n stacking spread and entry animations smooth. */\n[data-sonner-toast][data-expanded=\"true\"] {\n transition: transform 0.15s, opacity 0.4s, height 0.15s, box-shadow 0.2s !important;\n}\n\n\n/* ============================================\n Wrapper — single container for both states\n ============================================ */\n.goey-wrapper {\n pointer-events: auto;\n cursor: default;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif;\n position: relative;\n width: fit-content;\n}\n\n/* SVG background — parametric morph from pill to blob */\n.goey-blobSvg {\n position: absolute;\n top: 0;\n left: 0;\n overflow: visible;\n pointer-events: none;\n filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.06))\n drop-shadow(0 1px 4px rgba(0, 0, 0, 0.04));\n}\n\n/* Content on top of SVG background */\n.goey-content {\n position: relative;\n z-index: 1;\n transition: padding 0.35s cubic-bezier(0.4, 0, 0.2, 1);\n}\n\n.goey-contentCompact {\n padding: 7px 10px 7px 10px;\n}\n\n.goey-contentExpanded {\n padding: 7px 10px 16px 10px;\n min-width: 300px;\n max-width: 380px;\n}\n\n/* ============================================\n Shared\n ============================================ */\n.goey-header {\n display: inline-flex;\n align-items: center;\n gap: 8px;\n color: inherit;\n}\n\n.goey-iconWrapper {\n display: flex;\n align-items: center;\n justify-content: center;\n flex-shrink: 0;\n width: 18px;\n height: 18px;\n line-height: 0;\n}\n\n.goey-title {\n font-size: 12px;\n font-weight: 700;\n line-height: 1;\n white-space: nowrap;\n color: inherit;\n padding: 0 4px 0 2px;\n}\n\n.goey-titleDefault { color: #555; }\n.goey-titleSuccess { color: #4CAF50; }\n.goey-titleError { color: #E53935; }\n.goey-titleWarning { color: #C49000; }\n.goey-titleInfo { color: #1E88E5; }\n.goey-titleLoading { color: #555; }\n\n.goey-timestamp {\n font-size: 11px;\n font-weight: 400;\n color: #999;\n white-space: nowrap;\n line-height: 1;\n padding-left: 6px;\n}\n\n.goey-description {\n font-size: 13px;\n font-weight: 400;\n color: #444;\n line-height: 1.55;\n margin-top: 16px;\n overflow: hidden;\n}\n\n.goey-actionWrapper {\n margin-top: 12px;\n overflow: hidden;\n}\n\n.goey-actionButton {\n display: block;\n box-sizing: border-box;\n width: 100%;\n border: none;\n border-radius: 999px;\n padding: 10px 20px;\n font-size: 13px;\n font-weight: 700;\n cursor: pointer;\n font-family: inherit;\n text-align: center;\n outline: none;\n -webkit-tap-highlight-color: transparent;\n transition: background 0.15s ease;\n}\n\n.goey-actionButton:focus:not(:focus-visible) {\n outline: none;\n}\n\n.goey-actionButton:focus-visible {\n outline: 2px solid currentColor;\n outline-offset: 2px;\n}\n\n.goey-actionDefault {\n background: #E8E8E8;\n color: #555;\n}\n.goey-actionDefault:hover { background: #DCDCDC; }\n.goey-actionDefault:active { background: #D0D0D0; }\n\n.goey-actionSuccess {\n background: #C8E6C9;\n color: #4CAF50;\n}\n.goey-actionSuccess:hover { background: #A5D6A7; }\n.goey-actionSuccess:active { background: #81C784; }\n\n.goey-actionError {\n background: #FFCDD2;\n color: #E53935;\n}\n.goey-actionError:hover { background: #EF9A9A; }\n.goey-actionError:active { background: #E57373; }\n\n.goey-actionWarning {\n background: #FFECB3;\n color: #C49000;\n}\n.goey-actionWarning:hover { background: #FFE082; }\n.goey-actionWarning:active { background: #FFD54F; }\n\n.goey-actionInfo {\n background: #BBDEFB;\n color: #1E88E5;\n}\n.goey-actionInfo:hover { background: #90CAF9; }\n.goey-actionInfo:active { background: #64B5F6; }\n\n/* ============================================\n Progress countdown bar\n ============================================ */\n.goey-progressWrapper {\n margin-top: 10px;\n overflow: hidden;\n border-radius: 2px;\n height: 3px;\n background: rgba(0, 0, 0, 0.06);\n}\n\n.goey-progressBar {\n height: 100%;\n border-radius: 2px;\n transform-origin: left center;\n animation: goey-progress-shrink var(--goey-progress-duration, 4000ms) linear forwards;\n animation-play-state: running;\n}\n\n.goey-progressPaused .goey-progressBar {\n animation-play-state: paused;\n}\n\n@keyframes goey-progress-shrink {\n from { transform: scaleX(1); }\n to { transform: scaleX(0); }\n}\n\n.goey-progressDefault { background: #999; }\n.goey-progressSuccess { background: #4CAF50; }\n.goey-progressError { background: #E53935; }\n.goey-progressWarning { background: #C49000; }\n.goey-progressInfo { background: #1E88E5; }\n\n/* ============================================\n Dark mode\n ============================================ */\n\n.goey-wrapper[data-theme=\"dark\"] .goey-blobSvg {\n filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.3))\n drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2));\n}\n\n.goey-wrapper[data-theme=\"dark\"] .goey-titleDefault { color: #ccc; }\n.goey-wrapper[data-theme=\"dark\"] .goey-titleSuccess { color: #66BB6A; }\n.goey-wrapper[data-theme=\"dark\"] .goey-titleError { color: #EF5350; }\n.goey-wrapper[data-theme=\"dark\"] .goey-titleWarning { color: #FFB300; }\n.goey-wrapper[data-theme=\"dark\"] .goey-titleInfo { color: #42A5F5; }\n.goey-wrapper[data-theme=\"dark\"] .goey-titleLoading { color: #ccc; }\n\n.goey-wrapper[data-theme=\"dark\"] .goey-timestamp {\n color: #777;\n}\n\n.goey-wrapper[data-theme=\"dark\"] .goey-description {\n color: #e0e0e0;\n}\n\n.goey-wrapper[data-theme=\"dark\"] .goey-actionDefault {\n background: #3a3a3a;\n color: #ccc;\n}\n.goey-wrapper[data-theme=\"dark\"] .goey-actionDefault:hover { background: #444; }\n.goey-wrapper[data-theme=\"dark\"] .goey-actionDefault:active { background: #4e4e4e; }\n\n.goey-wrapper[data-theme=\"dark\"] .goey-actionSuccess {\n background: #1b5e20;\n color: #66BB6A;\n}\n.goey-wrapper[data-theme=\"dark\"] .goey-actionSuccess:hover { background: #2e7d32; }\n.goey-wrapper[data-theme=\"dark\"] .goey-actionSuccess:active { background: #388e3c; }\n\n.goey-wrapper[data-theme=\"dark\"] .goey-actionError {\n background: #b71c1c;\n color: #EF5350;\n}\n.goey-wrapper[data-theme=\"dark\"] .goey-actionError:hover { background: #c62828; }\n.goey-wrapper[data-theme=\"dark\"] .goey-actionError:active { background: #d32f2f; }\n\n.goey-wrapper[data-theme=\"dark\"] .goey-actionWarning {\n background: #4a3800;\n color: #FFB300;\n}\n.goey-wrapper[data-theme=\"dark\"] .goey-actionWarning:hover { background: #5c4600; }\n.goey-wrapper[data-theme=\"dark\"] .goey-actionWarning:active { background: #6e5400; }\n\n.goey-wrapper[data-theme=\"dark\"] .goey-actionInfo {\n background: #0d47a1;\n color: #42A5F5;\n}\n.goey-wrapper[data-theme=\"dark\"] .goey-actionInfo:hover { background: #1565c0; }\n.goey-wrapper[data-theme=\"dark\"] .goey-actionInfo:active { background: #1976d2; }\n\n.goey-wrapper[data-theme=\"dark\"] .goey-progressWrapper {\n background: rgba(255, 255, 255, 0.1);\n}\n.goey-wrapper[data-theme=\"dark\"] .goey-progressDefault { background: #888; }\n.goey-wrapper[data-theme=\"dark\"] .goey-progressSuccess { background: #66BB6A; }\n.goey-wrapper[data-theme=\"dark\"] .goey-progressError { background: #EF5350; }\n.goey-wrapper[data-theme=\"dark\"] .goey-progressWarning { background: #FFB300; }\n.goey-wrapper[data-theme=\"dark\"] .goey-progressInfo { background: #42A5F5; }\n"],"mappings":";AACA,CAAC;AACC,aAA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G,EAAE,GAAG,EAAE;AAClC;AACA,CA5PC,YA4PY,CAAC,iBAAmB,CApEhC;AAoEwD,cAAY;AAAM;AAC3E,CA7PC,YA6PY,CAAC,iBAAmB,CApEhC;AAoEwD,cAAY;AAAS;AAC9E,CA9PC,YA8PY,CAAC,iBAAmB,CApEhC;AAoEsD,cAAY;AAAS;AAC5E,CA/PC,YA+PY,CAAC,iBAAmB,CApEhC;AAoEwD,cAAY;AAAS;AAC9E,CAhQC,YAgQY,CAAC,iBAAmB,CApEhC;AAoEqD,cAAY;AAAS;","names":[]}
package/dist/index.d.cts CHANGED
@@ -2,6 +2,31 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
3
  import { ToasterProps, ExternalToast } from 'sonner';
4
4
 
5
+ interface AnimationPreset {
6
+ bounce: number;
7
+ spring: boolean;
8
+ }
9
+ declare const animationPresets: {
10
+ readonly smooth: {
11
+ readonly bounce: 0.1;
12
+ readonly spring: true;
13
+ };
14
+ readonly bouncy: {
15
+ readonly bounce: 0.6;
16
+ readonly spring: true;
17
+ };
18
+ readonly subtle: {
19
+ readonly bounce: 0.05;
20
+ readonly spring: true;
21
+ };
22
+ readonly snappy: {
23
+ readonly bounce: 0.4;
24
+ readonly spring: true;
25
+ };
26
+ };
27
+ type AnimationPresetName = keyof typeof animationPresets;
28
+
29
+ type GoeyToastType = 'default' | 'success' | 'error' | 'warning' | 'info';
5
30
  interface GoeyToastTimings {
6
31
  displayDuration?: number;
7
32
  }
@@ -31,8 +56,12 @@ interface GoeyToastOptions {
31
56
  borderColor?: string;
32
57
  borderWidth?: number;
33
58
  timing?: GoeyToastTimings;
59
+ preset?: AnimationPresetName;
34
60
  spring?: boolean;
35
61
  bounce?: number;
62
+ showProgress?: boolean;
63
+ onDismiss?: (id: string | number) => void;
64
+ onAutoClose?: (id: string | number) => void;
36
65
  }
37
66
  interface GoeyPromiseData<T> {
38
67
  loading: string;
@@ -52,8 +81,21 @@ interface GoeyPromiseData<T> {
52
81
  borderColor?: string;
53
82
  borderWidth?: number;
54
83
  timing?: GoeyToastTimings;
84
+ preset?: AnimationPresetName;
55
85
  spring?: boolean;
56
86
  bounce?: number;
87
+ onDismiss?: (id: string | number) => void;
88
+ onAutoClose?: (id: string | number) => void;
89
+ }
90
+ interface GoeyToastUpdateOptions {
91
+ title?: string;
92
+ description?: ReactNode;
93
+ type?: GoeyToastType;
94
+ action?: GoeyToastAction;
95
+ icon?: ReactNode | null;
96
+ }
97
+ interface DismissFilter {
98
+ type: GoeyToastType | GoeyToastType[];
57
99
  }
58
100
  interface GoeyToasterProps {
59
101
  position?: ToasterProps['position'];
@@ -67,19 +109,28 @@ interface GoeyToasterProps {
67
109
  richColors?: boolean;
68
110
  visibleToasts?: number;
69
111
  dir?: 'ltr' | 'rtl';
112
+ preset?: AnimationPresetName;
70
113
  spring?: boolean;
71
114
  bounce?: number;
115
+ swipeToDismiss?: boolean;
116
+ closeOnEscape?: boolean;
117
+ maxQueue?: number;
118
+ queueOverflow?: 'drop-oldest' | 'drop-newest';
119
+ showProgress?: boolean;
72
120
  }
73
121
 
74
- declare function GoeyToaster({ position, duration, gap, offset, theme, toastOptions, expand, closeButton, richColors, visibleToasts, dir, spring, bounce, }: GoeyToasterProps): react_jsx_runtime.JSX.Element;
122
+ declare function GoeyToaster({ position, duration, gap, offset, theme, toastOptions, expand, closeButton, richColors, visibleToasts, dir, preset, spring, bounce, swipeToDismiss, closeOnEscape, maxQueue, queueOverflow, showProgress, }: GoeyToasterProps): react_jsx_runtime.JSX.Element;
75
123
 
124
+ declare function updateGoeyToast(id: string | number, options: GoeyToastUpdateOptions): void;
125
+ declare function dismissGoeyToast(idOrFilter?: string | number | DismissFilter): void;
76
126
  declare const goeyToast: ((title: string, options?: GoeyToastOptions) => string | number) & {
77
127
  success: (title: string, options?: GoeyToastOptions) => string | number;
78
128
  error: (title: string, options?: GoeyToastOptions) => string | number;
79
129
  warning: (title: string, options?: GoeyToastOptions) => string | number;
80
130
  info: (title: string, options?: GoeyToastOptions) => string | number;
81
- promise: <T>(promise: Promise<T>, data: GoeyPromiseData<T>) => string | number;
82
- dismiss: (id?: number | string) => string | number;
131
+ promise: <T>(promise: Promise<T>, data: GoeyPromiseData<T>) => string;
132
+ dismiss: typeof dismissGoeyToast;
133
+ update: typeof updateGoeyToast;
83
134
  };
84
135
 
85
- export { type GoeyPromiseData, type GoeyToastAction, type GoeyToastClassNames, type GoeyToastOptions, type GoeyToastTimings, GoeyToaster, type GoeyToasterProps, goeyToast };
136
+ export { type AnimationPreset, type AnimationPresetName, type DismissFilter, type GoeyPromiseData, type GoeyToastAction, type GoeyToastClassNames, type GoeyToastOptions, type GoeyToastTimings, type GoeyToastUpdateOptions, GoeyToaster, type GoeyToasterProps, animationPresets, goeyToast };
package/dist/index.d.ts CHANGED
@@ -2,6 +2,31 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { ReactNode } from 'react';
3
3
  import { ToasterProps, ExternalToast } from 'sonner';
4
4
 
5
+ interface AnimationPreset {
6
+ bounce: number;
7
+ spring: boolean;
8
+ }
9
+ declare const animationPresets: {
10
+ readonly smooth: {
11
+ readonly bounce: 0.1;
12
+ readonly spring: true;
13
+ };
14
+ readonly bouncy: {
15
+ readonly bounce: 0.6;
16
+ readonly spring: true;
17
+ };
18
+ readonly subtle: {
19
+ readonly bounce: 0.05;
20
+ readonly spring: true;
21
+ };
22
+ readonly snappy: {
23
+ readonly bounce: 0.4;
24
+ readonly spring: true;
25
+ };
26
+ };
27
+ type AnimationPresetName = keyof typeof animationPresets;
28
+
29
+ type GoeyToastType = 'default' | 'success' | 'error' | 'warning' | 'info';
5
30
  interface GoeyToastTimings {
6
31
  displayDuration?: number;
7
32
  }
@@ -31,8 +56,12 @@ interface GoeyToastOptions {
31
56
  borderColor?: string;
32
57
  borderWidth?: number;
33
58
  timing?: GoeyToastTimings;
59
+ preset?: AnimationPresetName;
34
60
  spring?: boolean;
35
61
  bounce?: number;
62
+ showProgress?: boolean;
63
+ onDismiss?: (id: string | number) => void;
64
+ onAutoClose?: (id: string | number) => void;
36
65
  }
37
66
  interface GoeyPromiseData<T> {
38
67
  loading: string;
@@ -52,8 +81,21 @@ interface GoeyPromiseData<T> {
52
81
  borderColor?: string;
53
82
  borderWidth?: number;
54
83
  timing?: GoeyToastTimings;
84
+ preset?: AnimationPresetName;
55
85
  spring?: boolean;
56
86
  bounce?: number;
87
+ onDismiss?: (id: string | number) => void;
88
+ onAutoClose?: (id: string | number) => void;
89
+ }
90
+ interface GoeyToastUpdateOptions {
91
+ title?: string;
92
+ description?: ReactNode;
93
+ type?: GoeyToastType;
94
+ action?: GoeyToastAction;
95
+ icon?: ReactNode | null;
96
+ }
97
+ interface DismissFilter {
98
+ type: GoeyToastType | GoeyToastType[];
57
99
  }
58
100
  interface GoeyToasterProps {
59
101
  position?: ToasterProps['position'];
@@ -67,19 +109,28 @@ interface GoeyToasterProps {
67
109
  richColors?: boolean;
68
110
  visibleToasts?: number;
69
111
  dir?: 'ltr' | 'rtl';
112
+ preset?: AnimationPresetName;
70
113
  spring?: boolean;
71
114
  bounce?: number;
115
+ swipeToDismiss?: boolean;
116
+ closeOnEscape?: boolean;
117
+ maxQueue?: number;
118
+ queueOverflow?: 'drop-oldest' | 'drop-newest';
119
+ showProgress?: boolean;
72
120
  }
73
121
 
74
- declare function GoeyToaster({ position, duration, gap, offset, theme, toastOptions, expand, closeButton, richColors, visibleToasts, dir, spring, bounce, }: GoeyToasterProps): react_jsx_runtime.JSX.Element;
122
+ declare function GoeyToaster({ position, duration, gap, offset, theme, toastOptions, expand, closeButton, richColors, visibleToasts, dir, preset, spring, bounce, swipeToDismiss, closeOnEscape, maxQueue, queueOverflow, showProgress, }: GoeyToasterProps): react_jsx_runtime.JSX.Element;
75
123
 
124
+ declare function updateGoeyToast(id: string | number, options: GoeyToastUpdateOptions): void;
125
+ declare function dismissGoeyToast(idOrFilter?: string | number | DismissFilter): void;
76
126
  declare const goeyToast: ((title: string, options?: GoeyToastOptions) => string | number) & {
77
127
  success: (title: string, options?: GoeyToastOptions) => string | number;
78
128
  error: (title: string, options?: GoeyToastOptions) => string | number;
79
129
  warning: (title: string, options?: GoeyToastOptions) => string | number;
80
130
  info: (title: string, options?: GoeyToastOptions) => string | number;
81
- promise: <T>(promise: Promise<T>, data: GoeyPromiseData<T>) => string | number;
82
- dismiss: (id?: number | string) => string | number;
131
+ promise: <T>(promise: Promise<T>, data: GoeyPromiseData<T>) => string;
132
+ dismiss: typeof dismissGoeyToast;
133
+ update: typeof updateGoeyToast;
83
134
  };
84
135
 
85
- export { type GoeyPromiseData, type GoeyToastAction, type GoeyToastClassNames, type GoeyToastOptions, type GoeyToastTimings, GoeyToaster, type GoeyToasterProps, goeyToast };
136
+ export { type AnimationPreset, type AnimationPresetName, type DismissFilter, type GoeyPromiseData, type GoeyToastAction, type GoeyToastClassNames, type GoeyToastOptions, type GoeyToastTimings, type GoeyToastUpdateOptions, GoeyToaster, type GoeyToasterProps, animationPresets, goeyToast };