flashpop 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.
package/src/toast.css ADDED
@@ -0,0 +1,586 @@
1
+ /**
2
+ * flashpop
3
+ * Modern, lightweight, responsive CSS styles and animations
4
+ */
5
+
6
+ /* ==========================================================================
7
+ CSS Variables & Design Tokens
8
+ ========================================================================== */
9
+ :root {
10
+ --easy-toast-z-index: 9999;
11
+ --easy-toast-font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
12
+ --easy-toast-max-width: 380px;
13
+ --easy-toast-min-width: 280px;
14
+ --easy-toast-radius: 12px;
15
+ --easy-toast-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.08);
16
+
17
+ /* Light Theme Colors */
18
+ --easy-toast-bg-light: #ffffff;
19
+ --easy-toast-text-light: #1e293b;
20
+ --easy-toast-text-secondary-light: #64748b;
21
+ --easy-toast-border-light: #e2e8f0;
22
+
23
+ /* Dark Theme Colors */
24
+ --easy-toast-bg-dark: #1e293b;
25
+ --easy-toast-text-dark: #f8fafc;
26
+ --easy-toast-text-secondary-dark: #94a3b8;
27
+ --easy-toast-border-dark: #334155;
28
+
29
+ /* Variant Colors */
30
+ --easy-toast-color-success: #10b981;
31
+ --easy-toast-color-error: #ef4444;
32
+ --easy-toast-color-warning: #f59e0b;
33
+ --easy-toast-color-info: #3b82f6;
34
+ --easy-toast-color-loading: #6366f1;
35
+ --easy-toast-color-default: #64748b;
36
+ }
37
+
38
+ /* ==========================================================================
39
+ Portal & Container Positioning
40
+ ========================================================================== */
41
+ .easy-toast-portal {
42
+ pointer-events: none;
43
+ position: relative;
44
+ z-index: var(--easy-toast-z-index);
45
+ }
46
+
47
+ .easy-toast-container {
48
+ position: fixed;
49
+ display: flex;
50
+ flex-direction: column;
51
+ gap: 10px;
52
+ z-index: var(--easy-toast-z-index);
53
+ pointer-events: none;
54
+ box-sizing: border-box;
55
+ padding: 16px;
56
+ max-width: 100vw;
57
+ }
58
+
59
+ /* Positions */
60
+ .easy-toast-container--top-left {
61
+ top: 0;
62
+ left: 0;
63
+ align-items: flex-start;
64
+ }
65
+
66
+ .easy-toast-container--top-center {
67
+ top: 0;
68
+ left: 50%;
69
+ transform: translateX(-50%);
70
+ align-items: center;
71
+ }
72
+
73
+ .easy-toast-container--top-right {
74
+ top: 0;
75
+ right: 0;
76
+ align-items: flex-end;
77
+ }
78
+
79
+ .easy-toast-container--bottom-left {
80
+ bottom: 0;
81
+ left: 0;
82
+ align-items: flex-start;
83
+ }
84
+
85
+ .easy-toast-container--bottom-center {
86
+ bottom: 0;
87
+ left: 50%;
88
+ transform: translateX(-50%);
89
+ align-items: center;
90
+ }
91
+
92
+ .easy-toast-container--bottom-right {
93
+ bottom: 0;
94
+ right: 0;
95
+ align-items: flex-end;
96
+ }
97
+
98
+ /* ==========================================================================
99
+ Toast Item Base Styles
100
+ ========================================================================== */
101
+ .easy-toast-item {
102
+ position: relative;
103
+ display: flex;
104
+ flex-direction: column;
105
+ width: var(--easy-toast-max-width);
106
+ max-width: calc(100vw - 32px);
107
+ box-sizing: border-box;
108
+ border-radius: var(--easy-toast-radius);
109
+ box-shadow: var(--easy-toast-shadow);
110
+ pointer-events: auto;
111
+ font-family: var(--easy-toast-font-family);
112
+ overflow: hidden;
113
+ user-select: none;
114
+ cursor: default;
115
+ transition: transform 0.2s ease, box-shadow 0.2s ease;
116
+ }
117
+
118
+ .easy-toast-item:hover {
119
+ box-shadow: 0 14px 30px -5px rgba(0, 0, 0, 0.15), 0 10px 12px -6px rgba(0, 0, 0, 0.1);
120
+ }
121
+
122
+ /* Swipeable & Dragging States */
123
+ .easy-toast--swipeable {
124
+ touch-action: pan-y;
125
+ cursor: grab;
126
+ }
127
+
128
+ .easy-toast--dragging {
129
+ cursor: grabbing !important;
130
+ user-select: none;
131
+ -webkit-user-select: none;
132
+ }
133
+
134
+ .easy-toast--swipe-accept {
135
+ box-shadow: 0 0 0 2px var(--easy-toast-color-success), var(--easy-toast-shadow) !important;
136
+ }
137
+
138
+ .easy-toast--swipe-cancel {
139
+ box-shadow: 0 0 0 2px var(--easy-toast-color-error), var(--easy-toast-shadow) !important;
140
+ }
141
+
142
+ /* Swipe Badges/Hints */
143
+ .easy-toast-swipe-badge {
144
+ position: absolute;
145
+ top: 10px;
146
+ right: 14px;
147
+ font-size: 0.76rem;
148
+ font-weight: 700;
149
+ padding: 4px 10px;
150
+ border-radius: 9999px;
151
+ z-index: 10;
152
+ pointer-events: none;
153
+ animation: easy-toast-badge-pop 0.18s cubic-bezier(0.16, 1, 0.3, 1) forwards;
154
+ letter-spacing: 0.02em;
155
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
156
+ }
157
+
158
+ .easy-toast-swipe-badge--accept {
159
+ background: var(--easy-toast-color-success);
160
+ color: #ffffff;
161
+ }
162
+
163
+ .easy-toast-swipe-badge--cancel {
164
+ background: var(--easy-toast-color-error);
165
+ color: #ffffff;
166
+ }
167
+
168
+ @keyframes easy-toast-badge-pop {
169
+ from {
170
+ opacity: 0;
171
+ transform: scale(0.85);
172
+ }
173
+ to {
174
+ opacity: 1;
175
+ transform: scale(1);
176
+ }
177
+ }
178
+
179
+ .easy-toast-content-wrapper {
180
+ display: flex;
181
+ align-items: flex-start;
182
+ padding: 14px 16px;
183
+ gap: 12px;
184
+ box-sizing: border-box;
185
+ width: 100%;
186
+ }
187
+
188
+ /* Icon */
189
+ .easy-toast-icon-container {
190
+ display: flex;
191
+ align-items: center;
192
+ justify-content: center;
193
+ flex-shrink: 0;
194
+ margin-top: 1px;
195
+ }
196
+
197
+ .easy-toast-icon {
198
+ width: 20px;
199
+ height: 20px;
200
+ }
201
+
202
+ .easy-toast-icon--success {
203
+ color: var(--easy-toast-color-success);
204
+ }
205
+
206
+ .easy-toast-icon--error {
207
+ color: var(--easy-toast-color-error);
208
+ }
209
+
210
+ .easy-toast-icon--warning {
211
+ color: var(--easy-toast-color-warning);
212
+ }
213
+
214
+ .easy-toast-icon--info {
215
+ color: var(--easy-toast-color-info);
216
+ }
217
+
218
+ .easy-toast-icon--loading {
219
+ color: var(--easy-toast-color-loading);
220
+ animation: easy-toast-spin 0.9s linear infinite;
221
+ }
222
+
223
+ .easy-toast-custom-icon {
224
+ display: inline-flex;
225
+ align-items: center;
226
+ justify-content: center;
227
+ }
228
+
229
+ /* Text Container */
230
+ .easy-toast-text-container {
231
+ flex: 1;
232
+ display: flex;
233
+ flex-direction: column;
234
+ gap: 3px;
235
+ min-width: 0;
236
+ word-wrap: break-word;
237
+ }
238
+
239
+ .easy-toast-title {
240
+ font-size: 0.92rem;
241
+ font-weight: 600;
242
+ line-height: 1.3;
243
+ }
244
+
245
+ .easy-toast-message {
246
+ font-size: 0.86rem;
247
+ line-height: 1.4;
248
+ word-break: break-word;
249
+ }
250
+
251
+ /* Action Button */
252
+ .easy-toast-action-container {
253
+ display: flex;
254
+ align-items: center;
255
+ flex-shrink: 0;
256
+ margin-left: 4px;
257
+ }
258
+
259
+ .easy-toast-action-button {
260
+ background: rgba(0, 0, 0, 0.06);
261
+ border: none;
262
+ outline: none;
263
+ font-family: inherit;
264
+ font-size: 0.8rem;
265
+ font-weight: 600;
266
+ padding: 5px 10px;
267
+ border-radius: 6px;
268
+ cursor: pointer;
269
+ transition: background 0.15s ease, transform 0.1s ease;
270
+ white-space: nowrap;
271
+ }
272
+
273
+ .easy-toast-action-button:hover {
274
+ background: rgba(0, 0, 0, 0.12);
275
+ }
276
+
277
+ .easy-toast-action-button:active {
278
+ transform: scale(0.96);
279
+ }
280
+
281
+ /* Close Button */
282
+ .easy-toast-close-button {
283
+ background: transparent;
284
+ border: none;
285
+ outline: none;
286
+ padding: 4px;
287
+ margin-left: 2px;
288
+ margin-top: -2px;
289
+ border-radius: 6px;
290
+ cursor: pointer;
291
+ display: inline-flex;
292
+ align-items: center;
293
+ justify-content: center;
294
+ opacity: 0.55;
295
+ color: inherit;
296
+ transition: opacity 0.15s ease, background 0.15s ease;
297
+ flex-shrink: 0;
298
+ }
299
+
300
+ .easy-toast-close-button:hover {
301
+ opacity: 1;
302
+ background: rgba(0, 0, 0, 0.06);
303
+ }
304
+
305
+ .easy-toast-close-icon {
306
+ width: 14px;
307
+ height: 14px;
308
+ }
309
+
310
+ /* Progress Bar */
311
+ .easy-toast-progress-bar-track {
312
+ position: absolute;
313
+ bottom: 0;
314
+ left: 0;
315
+ right: 0;
316
+ height: 3px;
317
+ background: rgba(0, 0, 0, 0.05);
318
+ overflow: hidden;
319
+ }
320
+
321
+ .easy-toast-progress-bar {
322
+ height: 100%;
323
+ width: 100%;
324
+ background: currentColor;
325
+ transform-origin: left;
326
+ animation: easy-toast-progress-shrink linear forwards;
327
+ }
328
+
329
+ /* ==========================================================================
330
+ Themes: Light (Default)
331
+ ========================================================================== */
332
+ .easy-toast--theme-light {
333
+ background-color: var(--easy-toast-bg-light);
334
+ color: var(--easy-toast-text-light);
335
+ border: 1px solid var(--easy-toast-border-light);
336
+ }
337
+
338
+ .easy-toast--theme-light .easy-toast-message {
339
+ color: var(--easy-toast-text-secondary-light);
340
+ }
341
+
342
+ .easy-toast--theme-light.easy-toast--success .easy-toast-progress-bar {
343
+ background: var(--easy-toast-color-success);
344
+ }
345
+ .easy-toast--theme-light.easy-toast--error .easy-toast-progress-bar {
346
+ background: var(--easy-toast-color-error);
347
+ }
348
+ .easy-toast--theme-light.easy-toast--warning .easy-toast-progress-bar {
349
+ background: var(--easy-toast-color-warning);
350
+ }
351
+ .easy-toast--theme-light.easy-toast--info .easy-toast-progress-bar {
352
+ background: var(--easy-toast-color-info);
353
+ }
354
+ .easy-toast--theme-light.easy-toast--loading .easy-toast-progress-bar {
355
+ background: var(--easy-toast-color-loading);
356
+ }
357
+ .easy-toast--theme-light.easy-toast--default .easy-toast-progress-bar {
358
+ background: var(--easy-toast-color-default);
359
+ }
360
+
361
+ /* ==========================================================================
362
+ Themes: Dark
363
+ ========================================================================== */
364
+ .easy-toast--theme-dark {
365
+ background-color: var(--easy-toast-bg-dark);
366
+ color: var(--easy-toast-text-dark);
367
+ border: 1px solid var(--easy-toast-border-dark);
368
+ }
369
+
370
+ .easy-toast--theme-dark .easy-toast-message {
371
+ color: var(--easy-toast-text-secondary-dark);
372
+ }
373
+
374
+ .easy-toast--theme-dark .easy-toast-action-button {
375
+ background: rgba(255, 255, 255, 0.12);
376
+ color: #ffffff;
377
+ }
378
+
379
+ .easy-toast--theme-dark .easy-toast-action-button:hover {
380
+ background: rgba(255, 255, 255, 0.2);
381
+ }
382
+
383
+ .easy-toast--theme-dark .easy-toast-close-button:hover {
384
+ background: rgba(255, 255, 255, 0.1);
385
+ }
386
+
387
+ .easy-toast--theme-dark .easy-toast-progress-bar-track {
388
+ background: rgba(255, 255, 255, 0.08);
389
+ }
390
+
391
+ .easy-toast--theme-dark.easy-toast--success .easy-toast-progress-bar {
392
+ background: var(--easy-toast-color-success);
393
+ }
394
+ .easy-toast--theme-dark.easy-toast--error .easy-toast-progress-bar {
395
+ background: var(--easy-toast-color-error);
396
+ }
397
+ .easy-toast--theme-dark.easy-toast--warning .easy-toast-progress-bar {
398
+ background: var(--easy-toast-color-warning);
399
+ }
400
+ .easy-toast--theme-dark.easy-toast--info .easy-toast-progress-bar {
401
+ background: var(--easy-toast-color-info);
402
+ }
403
+ .easy-toast--theme-dark.easy-toast--loading .easy-toast-progress-bar {
404
+ background: var(--easy-toast-color-loading);
405
+ }
406
+ .easy-toast--theme-dark.easy-toast--default .easy-toast-progress-bar {
407
+ background: var(--easy-toast-color-default);
408
+ }
409
+
410
+ /* ==========================================================================
411
+ Themes: Colored (Solid background per type)
412
+ ========================================================================== */
413
+ .easy-toast--theme-colored {
414
+ color: #ffffff;
415
+ border: none;
416
+ }
417
+
418
+ .easy-toast--theme-colored .easy-toast-message {
419
+ color: rgba(255, 255, 255, 0.92);
420
+ }
421
+
422
+ .easy-toast--theme-colored .easy-toast-icon {
423
+ color: #ffffff;
424
+ }
425
+
426
+ .easy-toast--theme-colored .easy-toast-action-button {
427
+ background: rgba(255, 255, 255, 0.22);
428
+ color: #ffffff;
429
+ }
430
+
431
+ .easy-toast--theme-colored .easy-toast-action-button:hover {
432
+ background: rgba(255, 255, 255, 0.32);
433
+ }
434
+
435
+ .easy-toast--theme-colored .easy-toast-close-button {
436
+ color: #ffffff;
437
+ }
438
+
439
+ .easy-toast--theme-colored .easy-toast-close-button:hover {
440
+ background: rgba(255, 255, 255, 0.15);
441
+ }
442
+
443
+ .easy-toast--theme-colored .easy-toast-progress-bar-track {
444
+ background: rgba(255, 255, 255, 0.2);
445
+ }
446
+
447
+ .easy-toast--theme-colored .easy-toast-progress-bar {
448
+ background: #ffffff;
449
+ }
450
+
451
+ .easy-toast--theme-colored.easy-toast--success {
452
+ background-color: var(--easy-toast-color-success);
453
+ }
454
+
455
+ .easy-toast--theme-colored.easy-toast--error {
456
+ background-color: var(--easy-toast-color-error);
457
+ }
458
+
459
+ .easy-toast--theme-colored.easy-toast--warning {
460
+ background-color: var(--easy-toast-color-warning);
461
+ }
462
+
463
+ .easy-toast--theme-colored.easy-toast--info {
464
+ background-color: var(--easy-toast-color-info);
465
+ }
466
+
467
+ .easy-toast--theme-colored.easy-toast--loading {
468
+ background-color: var(--easy-toast-color-loading);
469
+ }
470
+
471
+ .easy-toast--theme-colored.easy-toast--default {
472
+ background-color: #475569;
473
+ }
474
+
475
+ /* ==========================================================================
476
+ Animations
477
+ ========================================================================== */
478
+ .easy-toast--enter {
479
+ animation: easy-toast-enter-anim 0.32s cubic-bezier(0.16, 1, 0.3, 1) forwards;
480
+ }
481
+
482
+ .easy-toast--exit {
483
+ animation: easy-toast-exit-anim 0.28s cubic-bezier(0.4, 0, 1, 1) forwards;
484
+ }
485
+
486
+ @keyframes easy-toast-enter-anim {
487
+ from {
488
+ opacity: 0;
489
+ transform: translateY(-16px) scale(0.95);
490
+ }
491
+ to {
492
+ opacity: 1;
493
+ transform: translateY(0) scale(1);
494
+ }
495
+ }
496
+
497
+ @keyframes easy-toast-exit-anim {
498
+ 0% {
499
+ opacity: 1;
500
+ transform: translateY(0) scale(1);
501
+ max-height: 120px;
502
+ margin-bottom: 0;
503
+ }
504
+ 70% {
505
+ opacity: 0;
506
+ transform: translateY(-8px) scale(0.92);
507
+ }
508
+ 100% {
509
+ opacity: 0;
510
+ transform: translateY(-12px) scale(0.9);
511
+ max-height: 0;
512
+ padding-top: 0;
513
+ padding-bottom: 0;
514
+ margin-bottom: -10px;
515
+ }
516
+ }
517
+
518
+ /* Bottom positions entrance animation adjustment */
519
+ .easy-toast-container--bottom-left .easy-toast--enter,
520
+ .easy-toast-container--bottom-center .easy-toast--enter,
521
+ .easy-toast-container--bottom-right .easy-toast--enter {
522
+ animation-name: easy-toast-enter-bottom-anim;
523
+ }
524
+
525
+ @keyframes easy-toast-enter-bottom-anim {
526
+ from {
527
+ opacity: 0;
528
+ transform: translateY(16px) scale(0.95);
529
+ }
530
+ to {
531
+ opacity: 1;
532
+ transform: translateY(0) scale(1);
533
+ }
534
+ }
535
+
536
+ /* Progress bar shrink */
537
+ @keyframes easy-toast-progress-shrink {
538
+ from {
539
+ transform: scaleX(1);
540
+ }
541
+ to {
542
+ transform: scaleX(0);
543
+ }
544
+ }
545
+
546
+ /* Spinner rotation */
547
+ @keyframes easy-toast-spin {
548
+ from {
549
+ transform: rotate(0deg);
550
+ }
551
+ to {
552
+ transform: rotate(360deg);
553
+ }
554
+ }
555
+
556
+ /* ==========================================================================
557
+ Responsive Design & Mobile Viewports
558
+ ========================================================================== */
559
+ @media screen and (max-width: 480px) {
560
+ .easy-toast-container {
561
+ width: 100%;
562
+ left: 0 !important;
563
+ right: 0 !important;
564
+ transform: none !important;
565
+ padding: 12px;
566
+ }
567
+
568
+ .easy-toast-container--top-left,
569
+ .easy-toast-container--top-center,
570
+ .easy-toast-container--top-right {
571
+ top: env(safe-area-inset-top, 0px);
572
+ align-items: stretch;
573
+ }
574
+
575
+ .easy-toast-container--bottom-left,
576
+ .easy-toast-container--bottom-center,
577
+ .easy-toast-container--bottom-right {
578
+ bottom: env(safe-area-inset-bottom, 0px);
579
+ align-items: stretch;
580
+ }
581
+
582
+ .easy-toast-item {
583
+ width: 100%;
584
+ max-width: 100%;
585
+ }
586
+ }