@t007/toast 0.0.4 → 0.0.5
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.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* src/css/index.css */
|
|
1
2
|
:where(:root) {
|
|
2
3
|
--t007-toast-font-family: inherit;
|
|
3
4
|
--t007-toast-info-color: #3498db;
|
|
@@ -20,7 +21,6 @@
|
|
|
20
21
|
--t007-toast-action-button-font-weight: 500;
|
|
21
22
|
--t007-toast-x-color: red;
|
|
22
23
|
}
|
|
23
|
-
|
|
24
24
|
:where(:root, .t007-toast) {
|
|
25
25
|
--t007-toast-type-color: whitesmoke;
|
|
26
26
|
--t007-toast-focus-visible-color: var(--t007-toast-font-color);
|
|
@@ -33,7 +33,6 @@
|
|
|
33
33
|
--t007-toast-action-button-background: rgba(from currentColor r g b / 0.1);
|
|
34
34
|
--t007-toast-action-button-active-background: rgba(from currentColor r g b / 0.2);
|
|
35
35
|
}
|
|
36
|
-
|
|
37
36
|
:where(:root, .t007-toast-container) {
|
|
38
37
|
--t007-toast-unit: 1rem;
|
|
39
38
|
--t007-toast-container-margin-top: calc(var(--t007-toast-unit) / 2);
|
|
@@ -71,7 +70,6 @@
|
|
|
71
70
|
--t007-toast-font-weight: inherit;
|
|
72
71
|
--t007-toast-x-size: calc(var(--t007-toast-unit) * 1.75);
|
|
73
72
|
}
|
|
74
|
-
|
|
75
73
|
@keyframes t007-x-slide-bounce-in {
|
|
76
74
|
from {
|
|
77
75
|
transform: translateX(var(--t-from));
|
|
@@ -194,7 +192,6 @@
|
|
|
194
192
|
transform: rotate(0deg) scale(1) translateZ(0);
|
|
195
193
|
}
|
|
196
194
|
}
|
|
197
|
-
|
|
198
195
|
.t007-toast-container,
|
|
199
196
|
.t007-toast-container *,
|
|
200
197
|
.t007-toast-container *::after,
|
|
@@ -202,12 +199,10 @@
|
|
|
202
199
|
box-sizing: border-box;
|
|
203
200
|
font-family: var(--t007-toast-font-family);
|
|
204
201
|
}
|
|
205
|
-
|
|
206
202
|
.t007-toast-container *:focus-visible {
|
|
207
203
|
outline: var(--t007-toast-focus-visible-outline);
|
|
208
204
|
outline-offset: calc(var(--t007-toast-unit) / 7.5);
|
|
209
205
|
}
|
|
210
|
-
|
|
211
206
|
.t007-toast-container {
|
|
212
207
|
position: var(--t007-toast-container-position);
|
|
213
208
|
margin-top: var(--t007-toast-container-margin-top);
|
|
@@ -215,44 +210,38 @@
|
|
|
215
210
|
margin-left: var(--t007-toast-container-margin-left);
|
|
216
211
|
margin-right: var(--t007-toast-container-margin-right);
|
|
217
212
|
max-width: calc(100% - var(--t007-toast-container-margin-left) - var(--t007-toast-container-margin-right));
|
|
218
|
-
/* remove next block to clip container viewport, clips sliding too */
|
|
219
|
-
/* max-height: calc(100% - var(--t007-toast-container-margin-top) - var(--t007-toast-container-margin-bottom));
|
|
220
|
-
overflow: hidden; */
|
|
221
213
|
display: flex;
|
|
222
214
|
flex-direction: column;
|
|
223
215
|
gap: var(--t007-toast-container-gap);
|
|
224
216
|
z-index: 2147483647;
|
|
225
217
|
contain: layout;
|
|
226
218
|
}
|
|
227
|
-
|
|
228
219
|
.t007-toast-container *:disabled {
|
|
229
220
|
filter: grayscale(100%);
|
|
230
221
|
cursor: not-allowed;
|
|
231
222
|
}
|
|
232
|
-
|
|
233
|
-
.t007-toast-container[data-position^="top-"] {
|
|
223
|
+
.t007-toast-container[data-position^=top-] {
|
|
234
224
|
top: 0;
|
|
235
225
|
}
|
|
236
|
-
.t007-toast-container[data-position^=
|
|
226
|
+
.t007-toast-container[data-position^=bottom-] {
|
|
237
227
|
bottom: 0;
|
|
238
228
|
}
|
|
239
|
-
.t007-toast-container[data-position^=
|
|
229
|
+
.t007-toast-container[data-position^=center-] {
|
|
240
230
|
top: 50%;
|
|
241
231
|
transform: translateY(-50%);
|
|
242
232
|
margin-block: 0;
|
|
243
233
|
}
|
|
244
|
-
.t007-toast-container[data-position
|
|
234
|
+
.t007-toast-container[data-position$=-right] {
|
|
245
235
|
right: 0;
|
|
246
236
|
}
|
|
247
|
-
.t007-toast-container[data-position
|
|
237
|
+
.t007-toast-container[data-position$=-left] {
|
|
248
238
|
left: 0;
|
|
249
239
|
}
|
|
250
|
-
.t007-toast-container[data-position
|
|
240
|
+
.t007-toast-container[data-position$=-center] {
|
|
251
241
|
left: 50%;
|
|
252
242
|
translate: -50%;
|
|
253
243
|
margin-inline: 0;
|
|
254
244
|
}
|
|
255
|
-
|
|
256
245
|
.t007-toast {
|
|
257
246
|
position: relative;
|
|
258
247
|
flex-shrink: 0;
|
|
@@ -280,85 +269,72 @@
|
|
|
280
269
|
backdrop-filter: blur(var(--t007-toast-background-blur));
|
|
281
270
|
overflow: hidden;
|
|
282
271
|
will-change: transform, opacity;
|
|
283
|
-
transition:
|
|
284
|
-
transform 300ms ease,
|
|
285
|
-
opacity 300ms ease;
|
|
272
|
+
transition: transform 300ms ease, opacity 300ms ease;
|
|
286
273
|
animation-timing-function: var(--t007-toast-animation-timing-function);
|
|
287
274
|
animation-fill-mode: forwards;
|
|
288
275
|
animation-duration: var(--t007-toast-animation-duration);
|
|
289
276
|
touch-action: none;
|
|
290
277
|
}
|
|
291
|
-
|
|
292
278
|
.t007-toast:not(:has(.t007-toast-image, .t007-toast-icon:not(:empty))):has(.t007-toast-body) {
|
|
293
279
|
padding-left: max(var(--t007-toast-padding), var(--t007-toast-smart-padding-left));
|
|
294
280
|
}
|
|
295
|
-
|
|
296
281
|
.t007-toast:not(:has(.t007-toast-cancel-button)) {
|
|
297
282
|
padding-right: max(var(--t007-toast-padding), var(--t007-toast-smart-padding-right));
|
|
298
283
|
}
|
|
299
|
-
|
|
300
|
-
.t007-toast:is([data-drag-to-close="mouse"], [data-drag-to-close="true"]) {
|
|
284
|
+
.t007-toast:is([data-drag-to-close=mouse], [data-drag-to-close=true]) {
|
|
301
285
|
cursor: grab;
|
|
302
286
|
}
|
|
303
|
-
.t007-toast:is([data-drag-to-close=
|
|
287
|
+
.t007-toast:is([data-drag-to-close=mouse], [data-drag-to-close=true]):active {
|
|
304
288
|
cursor: grabbing;
|
|
305
289
|
}
|
|
306
|
-
|
|
307
|
-
.t007-toast[data-animation^="slide"] {
|
|
290
|
+
.t007-toast[data-animation^=slide] {
|
|
308
291
|
--t-to: 0;
|
|
309
292
|
}
|
|
310
|
-
|
|
311
|
-
.t007-toast[data-animation="slide-left"] {
|
|
293
|
+
.t007-toast[data-animation=slide-left] {
|
|
312
294
|
--t-from: 100%;
|
|
313
295
|
--t-bounce: -0%;
|
|
314
296
|
}
|
|
315
|
-
.t007-toast[data-animation=
|
|
297
|
+
.t007-toast[data-animation=slide-right] {
|
|
316
298
|
--t-from: -100%;
|
|
317
299
|
--t-bounce: 10%;
|
|
318
300
|
}
|
|
319
|
-
.t007-toast[data-animation=
|
|
301
|
+
.t007-toast[data-animation=slide-up] {
|
|
320
302
|
--t-from: 100%;
|
|
321
303
|
--t-bounce: -10%;
|
|
322
304
|
}
|
|
323
|
-
.t007-toast[data-animation=
|
|
305
|
+
.t007-toast[data-animation=slide-down] {
|
|
324
306
|
--t-from: -100%;
|
|
325
307
|
--t-bounce: 10%;
|
|
326
308
|
}
|
|
327
|
-
|
|
328
|
-
.t007-toast:is([data-animation="slide-left"], [data-animation="slide-right"]) {
|
|
309
|
+
.t007-toast:is([data-animation=slide-left], [data-animation=slide-right]) {
|
|
329
310
|
animation-name: t007-x-slide-bounce-out;
|
|
330
311
|
}
|
|
331
|
-
.t007-toast:is([data-animation=
|
|
312
|
+
.t007-toast:is([data-animation=slide-left], [data-animation=slide-right]).t007-toast-show {
|
|
332
313
|
animation-name: t007-x-slide-bounce-in;
|
|
333
314
|
}
|
|
334
|
-
|
|
335
|
-
.t007-toast:is([data-animation="slide-up"], [data-animation="slide-down"]) {
|
|
315
|
+
.t007-toast:is([data-animation=slide-up], [data-animation=slide-down]) {
|
|
336
316
|
animation-name: t007-y-slide-bounce-out;
|
|
337
317
|
}
|
|
338
|
-
.t007-toast:is([data-animation=
|
|
318
|
+
.t007-toast:is([data-animation=slide-up], [data-animation=slide-down]).t007-toast-show {
|
|
339
319
|
animation-name: t007-y-slide-bounce-in;
|
|
340
320
|
}
|
|
341
|
-
|
|
342
|
-
.t007-toast[data-animation="fade"] {
|
|
321
|
+
.t007-toast[data-animation=fade] {
|
|
343
322
|
animation-name: t007-fade-out;
|
|
344
323
|
}
|
|
345
|
-
.t007-toast[data-animation=
|
|
324
|
+
.t007-toast[data-animation=fade].t007-toast-show {
|
|
346
325
|
animation-name: t007-fade-in;
|
|
347
326
|
}
|
|
348
|
-
|
|
349
|
-
.t007-toast[data-animation="zoom"] {
|
|
327
|
+
.t007-toast[data-animation=zoom] {
|
|
350
328
|
animation-name: t007-zoom-out;
|
|
351
329
|
}
|
|
352
|
-
.t007-toast[data-animation=
|
|
330
|
+
.t007-toast[data-animation=zoom].t007-toast-show {
|
|
353
331
|
animation-name: t007-zoom-in;
|
|
354
332
|
}
|
|
355
|
-
|
|
356
333
|
.t007-toast:is(.info, .success, .error, .warning) {
|
|
357
334
|
--t007-toast-font-color: var(--t007-toast-type-color);
|
|
358
335
|
--t007-toast-progress-background: var(--t007-toast-type-color);
|
|
359
336
|
--t007-toast-progress-backdrop-background: rgb(from var(--t007-toast-type-color) r g b/0);
|
|
360
337
|
}
|
|
361
|
-
|
|
362
338
|
.t007-toast.info {
|
|
363
339
|
--t007-toast-type-color: var(--t007-toast-info-color);
|
|
364
340
|
}
|
|
@@ -371,7 +347,6 @@
|
|
|
371
347
|
.t007-toast.warning {
|
|
372
348
|
--t007-toast-type-color: var(--t007-toast-warning-color);
|
|
373
349
|
}
|
|
374
|
-
|
|
375
350
|
.t007-toast.progress::before,
|
|
376
351
|
.t007-toast.progress::after {
|
|
377
352
|
content: "";
|
|
@@ -381,17 +356,14 @@
|
|
|
381
356
|
height: var(--t007-toast-progress-height);
|
|
382
357
|
transition: width ease;
|
|
383
358
|
}
|
|
384
|
-
|
|
385
359
|
.t007-toast.progress::before {
|
|
386
360
|
width: calc(var(--progress, 0) * 100%);
|
|
387
361
|
background: var(--t007-toast-progress-background);
|
|
388
362
|
}
|
|
389
|
-
|
|
390
363
|
.t007-toast.progress::after {
|
|
391
364
|
width: 100%;
|
|
392
365
|
background: var(--t007-toast-progress-backdrop-background);
|
|
393
366
|
}
|
|
394
|
-
|
|
395
367
|
.t007-toast-image-wrapper {
|
|
396
368
|
position: relative;
|
|
397
369
|
flex: 0 0 var(--t007-toast-image-width);
|
|
@@ -400,7 +372,6 @@
|
|
|
400
372
|
border-radius: var(--t007-toast-image-border-radius);
|
|
401
373
|
overflow: hidden;
|
|
402
374
|
}
|
|
403
|
-
|
|
404
375
|
.t007-toast-image-wrapper:not(:has(.t007-toast-image)) {
|
|
405
376
|
flex: 0 0 var(--t007-toast-icon-width);
|
|
406
377
|
width: var(--t007-toast-icon-width);
|
|
@@ -410,11 +381,9 @@
|
|
|
410
381
|
border-radius: 0;
|
|
411
382
|
overflow: visible;
|
|
412
383
|
}
|
|
413
|
-
|
|
414
384
|
.t007-toast-image-wrapper:not(:has(.t007-toast-image, .t007-toast-icon:not(:empty))) {
|
|
415
385
|
display: none;
|
|
416
386
|
}
|
|
417
|
-
|
|
418
387
|
.t007-toast-icon {
|
|
419
388
|
position: absolute;
|
|
420
389
|
inset: 0;
|
|
@@ -428,17 +397,15 @@
|
|
|
428
397
|
.t007-toast-icon:where(:not(.t007-toast-loader)) {
|
|
429
398
|
animation: t007-icon-expand 300ms ease;
|
|
430
399
|
}
|
|
431
|
-
.t007-toast-icon[data-icon
|
|
400
|
+
.t007-toast-icon[data-icon=\1f44b] {
|
|
432
401
|
transform-origin: bottom center;
|
|
433
|
-
animation: t007-icon-handwave 1800ms ease-in-out 2 1000ms;
|
|
402
|
+
animation: t007-icon-handwave 1800ms ease-in-out 2 1000ms;
|
|
434
403
|
will-change: transform;
|
|
435
404
|
}
|
|
436
|
-
|
|
437
405
|
.t007-toast .t007-toast-icon > svg {
|
|
438
406
|
width: var(--t007-toast-icon-width);
|
|
439
407
|
height: var(--t007-toast-icon-height);
|
|
440
408
|
}
|
|
441
|
-
|
|
442
409
|
.t007-toast-image-wrapper .t007-toast-image {
|
|
443
410
|
min-height: 100%;
|
|
444
411
|
height: 100%;
|
|
@@ -447,11 +414,9 @@
|
|
|
447
414
|
object-fit: var(--t007-toast-image-object-fit);
|
|
448
415
|
background: var(--t007-toast-no-image-background);
|
|
449
416
|
}
|
|
450
|
-
|
|
451
|
-
.t007-toast-image-wrapper [data-loaded="true"] {
|
|
417
|
+
.t007-toast-image-wrapper [data-loaded=true] {
|
|
452
418
|
background: var(--t007-toast-image-background);
|
|
453
419
|
}
|
|
454
|
-
|
|
455
420
|
.t007-toast-body {
|
|
456
421
|
flex-grow: 1;
|
|
457
422
|
height: fit-content;
|
|
@@ -459,7 +424,6 @@
|
|
|
459
424
|
padding: calc(var(--t007-toast-unit) / 7.5);
|
|
460
425
|
overflow: hidden;
|
|
461
426
|
}
|
|
462
|
-
|
|
463
427
|
.t007-toast-body-text {
|
|
464
428
|
display: -webkit-box;
|
|
465
429
|
-webkit-box-orient: vertical;
|
|
@@ -468,7 +432,6 @@
|
|
|
468
432
|
margin: 0;
|
|
469
433
|
z-index: 1;
|
|
470
434
|
}
|
|
471
|
-
|
|
472
435
|
.t007-toast-actions-wrapper {
|
|
473
436
|
width: var(--t007-toast-actions-container-width);
|
|
474
437
|
max-width: var(--t007-toast-actions-container-max-width);
|
|
@@ -477,7 +440,6 @@
|
|
|
477
440
|
flex-wrap: wrap;
|
|
478
441
|
gap: var(--t007-toast-actions-container-gap);
|
|
479
442
|
}
|
|
480
|
-
|
|
481
443
|
.t007-toast-action-button {
|
|
482
444
|
display: flex;
|
|
483
445
|
justify-content: center;
|
|
@@ -496,14 +458,12 @@
|
|
|
496
458
|
color 200ms ease,
|
|
497
459
|
background-color 200ms ease;
|
|
498
460
|
}
|
|
499
|
-
|
|
500
461
|
.t007-toast-action-button:is(:hover, :focus-visible) {
|
|
501
462
|
cursor: pointer;
|
|
502
463
|
opacity: 1;
|
|
503
464
|
color: var(--t007-toast-action-button-active-color);
|
|
504
465
|
background: var(--t007-toast-action-button-active-background);
|
|
505
466
|
}
|
|
506
|
-
|
|
507
467
|
.t007-toast-cancel-button {
|
|
508
468
|
display: flex;
|
|
509
469
|
align-self: start;
|
|
@@ -515,12 +475,10 @@
|
|
|
515
475
|
font-size: var(--t007-toast-x-size);
|
|
516
476
|
opacity: 0.6;
|
|
517
477
|
}
|
|
518
|
-
|
|
519
478
|
.t007-toast-cancel-button:is(:hover, :focus-visible) {
|
|
520
479
|
cursor: pointer;
|
|
521
480
|
opacity: 1;
|
|
522
481
|
}
|
|
523
|
-
|
|
524
482
|
@media (max-width: 36rem) {
|
|
525
483
|
:where(:root) {
|
|
526
484
|
--t007-toast-unit: 0.9rem;
|
package/dist/index.global.js
CHANGED
|
@@ -77,9 +77,9 @@
|
|
|
77
77
|
window.T007_TOAST_JS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/toast@latest`;
|
|
78
78
|
window.T007_INPUT_JS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/input@latest`;
|
|
79
79
|
window.T007_DIALOG_JS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/dialog@latest`;
|
|
80
|
-
window.T007_TOAST_CSS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/toast@latest/
|
|
81
|
-
window.T007_INPUT_CSS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/input@latest/
|
|
82
|
-
window.T007_DIALOG_CSS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/dialog@latest/
|
|
80
|
+
window.T007_TOAST_CSS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/toast@latest/dist/index.css`;
|
|
81
|
+
window.T007_INPUT_CSS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/input@latest/dist/index.css`;
|
|
82
|
+
window.T007_DIALOG_CSS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/dialog@latest/dist/index.css`;
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
// src/index.js
|
package/dist/standalone.js
CHANGED
|
@@ -75,9 +75,9 @@ if (typeof window !== "undefined") {
|
|
|
75
75
|
window.T007_TOAST_JS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/toast@latest`;
|
|
76
76
|
window.T007_INPUT_JS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/input@latest`;
|
|
77
77
|
window.T007_DIALOG_JS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/dialog@latest`;
|
|
78
|
-
window.T007_TOAST_CSS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/toast@latest/
|
|
79
|
-
window.T007_INPUT_CSS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/input@latest/
|
|
80
|
-
window.T007_DIALOG_CSS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/dialog@latest/
|
|
78
|
+
window.T007_TOAST_CSS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/toast@latest/dist/index.css`;
|
|
79
|
+
window.T007_INPUT_CSS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/input@latest/dist/index.css`;
|
|
80
|
+
window.T007_DIALOG_CSS_SRC ??= `https://cdn.jsdelivr.net/npm/@t007/dialog@latest/dist/index.css`;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
// src/index.js
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@t007/toast",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "A lightweight, pure JS toast system.",
|
|
5
5
|
"author": "Oketade Oluwatobiloba <tobioketade007@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -18,28 +18,28 @@
|
|
|
18
18
|
"module": "./dist/index.js",
|
|
19
19
|
"unpkg": "./dist/index.global.js",
|
|
20
20
|
"jsdelivr": "./dist/index.global.js",
|
|
21
|
-
"types": "./
|
|
22
|
-
"style": "./
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"style": "./dist/index.css",
|
|
23
23
|
"sideEffects": [
|
|
24
24
|
"*.css"
|
|
25
25
|
],
|
|
26
26
|
"exports": {
|
|
27
27
|
".": {
|
|
28
|
-
"types": "./
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
29
29
|
"import": "./dist/index.js",
|
|
30
30
|
"default": "./dist/index.js"
|
|
31
31
|
},
|
|
32
32
|
"./standalone": "./dist/standalone.js",
|
|
33
33
|
"./global": "./dist/index.global.js",
|
|
34
|
-
"./style.css": "./
|
|
34
|
+
"./style.css": "./dist/index.css"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"build": "tsup --config ../../tsup.config.ts"
|
|
38
38
|
},
|
|
39
39
|
"files": [
|
|
40
40
|
"dist",
|
|
41
|
-
"./
|
|
42
|
-
"./
|
|
41
|
+
"./dist/index.d.ts",
|
|
42
|
+
"./dist/index.css"
|
|
43
43
|
],
|
|
44
44
|
"keywords": [
|
|
45
45
|
"t007",
|
|
File without changes
|