@biotechusa/pdo-ui 1.0.1 → 1.0.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 +286 -0
- package/dist/toast.d.ts +8 -0
- package/dist/toast.js +92 -0
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -7,6 +7,11 @@
|
|
|
7
7
|
--tw-scale-x: 1;
|
|
8
8
|
--tw-scale-y: 1;
|
|
9
9
|
--tw-scale-z: 1;
|
|
10
|
+
--tw-rotate-x: initial;
|
|
11
|
+
--tw-rotate-y: initial;
|
|
12
|
+
--tw-rotate-z: initial;
|
|
13
|
+
--tw-skew-x: initial;
|
|
14
|
+
--tw-skew-y: initial;
|
|
10
15
|
--tw-border-style: solid;
|
|
11
16
|
--tw-leading: initial;
|
|
12
17
|
--tw-font-weight: initial;
|
|
@@ -525,6 +530,10 @@
|
|
|
525
530
|
z-index: 50;
|
|
526
531
|
}
|
|
527
532
|
|
|
533
|
+
.z-\[calc\(9999-var\(--toast-index\)\)\] {
|
|
534
|
+
z-index: calc(9999 - var(--toast-index));
|
|
535
|
+
}
|
|
536
|
+
|
|
528
537
|
.order-first {
|
|
529
538
|
order: -9999;
|
|
530
539
|
}
|
|
@@ -697,6 +706,10 @@
|
|
|
697
706
|
height: var(--active-tab-height);
|
|
698
707
|
}
|
|
699
708
|
|
|
709
|
+
.h-\(--toast-calc-height\) {
|
|
710
|
+
height: var(--toast-calc-height);
|
|
711
|
+
}
|
|
712
|
+
|
|
700
713
|
.h-1\.5 {
|
|
701
714
|
height: calc(var(--spacing) * 1.5);
|
|
702
715
|
}
|
|
@@ -825,6 +838,10 @@
|
|
|
825
838
|
width: calc(100% - (calc(var(--spacing) * 12)));
|
|
826
839
|
}
|
|
827
840
|
|
|
841
|
+
.w-\[calc\(100\%-var\(--toast-inset\)\*2\)\] {
|
|
842
|
+
width: calc(100% - var(--toast-inset) * 2);
|
|
843
|
+
}
|
|
844
|
+
|
|
828
845
|
.w-fit {
|
|
829
846
|
width: fit-content;
|
|
830
847
|
}
|
|
@@ -845,6 +862,10 @@
|
|
|
845
862
|
max-width: calc(var(--spacing) * 64);
|
|
846
863
|
}
|
|
847
864
|
|
|
865
|
+
.max-w-90 {
|
|
866
|
+
max-width: calc(var(--spacing) * 90);
|
|
867
|
+
}
|
|
868
|
+
|
|
848
869
|
.max-w-92 {
|
|
849
870
|
max-width: calc(var(--spacing) * 92);
|
|
850
871
|
}
|
|
@@ -961,6 +982,10 @@
|
|
|
961
982
|
rotate: 10deg;
|
|
962
983
|
}
|
|
963
984
|
|
|
985
|
+
.transform {
|
|
986
|
+
transform: var(--tw-rotate-x, ) var(--tw-rotate-y, ) var(--tw-rotate-z, ) var(--tw-skew-x, ) var(--tw-skew-y, );
|
|
987
|
+
}
|
|
988
|
+
|
|
964
989
|
.animate-spin {
|
|
965
990
|
animation: var(--animate-spin);
|
|
966
991
|
}
|
|
@@ -1954,6 +1979,11 @@
|
|
|
1954
1979
|
transition-duration: .2s;
|
|
1955
1980
|
}
|
|
1956
1981
|
|
|
1982
|
+
.duration-250 {
|
|
1983
|
+
--tw-duration: .25s;
|
|
1984
|
+
transition-duration: .25s;
|
|
1985
|
+
}
|
|
1986
|
+
|
|
1957
1987
|
.duration-300 {
|
|
1958
1988
|
--tw-duration: .3s;
|
|
1959
1989
|
transition-duration: .3s;
|
|
@@ -2006,10 +2036,38 @@
|
|
|
2006
2036
|
}
|
|
2007
2037
|
}
|
|
2008
2038
|
|
|
2039
|
+
.\[--toast-calc-height\:var\(--toast-frontmost-height\,var\(--toast-height\)\)\] {
|
|
2040
|
+
--toast-calc-height: var(--toast-frontmost-height, var(--toast-height));
|
|
2041
|
+
}
|
|
2042
|
+
|
|
2043
|
+
.\[--toast-gap\:--spacing\(3\)\] {
|
|
2044
|
+
--toast-gap: calc(var(--spacing) * 3);
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2047
|
+
.\[--toast-inset\:--spacing\(4\)\] {
|
|
2048
|
+
--toast-inset: calc(var(--spacing) * 4);
|
|
2049
|
+
}
|
|
2050
|
+
|
|
2051
|
+
.\[--toast-peek\:--spacing\(3\)\] {
|
|
2052
|
+
--toast-peek: calc(var(--spacing) * 3);
|
|
2053
|
+
}
|
|
2054
|
+
|
|
2055
|
+
.\[--toast-scale\:calc\(max\(0\,1-\(var\(--toast-index\)\*\.1\)\)\)\] {
|
|
2056
|
+
--toast-scale: calc(max(0, 1 - (var(--toast-index) * .1)));
|
|
2057
|
+
}
|
|
2058
|
+
|
|
2059
|
+
.\[--toast-shrink\:calc\(1-var\(--toast-scale\)\)\] {
|
|
2060
|
+
--toast-shrink: calc(1 - var(--toast-scale));
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2009
2063
|
.\[background\:linear-gradient\(120deg\,transparent_40\%\,var\(--skeleton-highlight\)\,transparent_60\%\)_var\(--color-muted\)_0_0_\/_200\%_100\%_fixed\] {
|
|
2010
2064
|
background: linear-gradient(120deg, transparent 40%, var(--skeleton-highlight), transparent 60%) var(--color-muted) 0 0 / 200% 100% fixed;
|
|
2011
2065
|
}
|
|
2012
2066
|
|
|
2067
|
+
.\[transition\:transform_\.5s_cubic-bezier\(\.22\,1\,\.36\,1\)\,opacity_\.5s\,height_\.15s\] {
|
|
2068
|
+
transition: transform .5s cubic-bezier(.22, 1, .36, 1), opacity .5s, height .15s;
|
|
2069
|
+
}
|
|
2070
|
+
|
|
2013
2071
|
:is(.\*\:min-h-6 > *) {
|
|
2014
2072
|
min-height: calc(var(--spacing) * 6);
|
|
2015
2073
|
}
|
|
@@ -2494,6 +2552,26 @@
|
|
|
2494
2552
|
border-bottom-left-radius: 0;
|
|
2495
2553
|
}
|
|
2496
2554
|
|
|
2555
|
+
.after\:absolute:after {
|
|
2556
|
+
content: var(--tw-content);
|
|
2557
|
+
position: absolute;
|
|
2558
|
+
}
|
|
2559
|
+
|
|
2560
|
+
.after\:left-0:after {
|
|
2561
|
+
content: var(--tw-content);
|
|
2562
|
+
left: calc(var(--spacing) * 0);
|
|
2563
|
+
}
|
|
2564
|
+
|
|
2565
|
+
.after\:h-\[calc\(var\(--toast-gap\)\+1px\)\]:after {
|
|
2566
|
+
content: var(--tw-content);
|
|
2567
|
+
height: calc(var(--toast-gap) + 1px);
|
|
2568
|
+
}
|
|
2569
|
+
|
|
2570
|
+
.after\:w-full:after {
|
|
2571
|
+
content: var(--tw-content);
|
|
2572
|
+
width: 100%;
|
|
2573
|
+
}
|
|
2574
|
+
|
|
2497
2575
|
.last\:hidden:last-child {
|
|
2498
2576
|
display: none;
|
|
2499
2577
|
}
|
|
@@ -2684,6 +2762,30 @@
|
|
|
2684
2762
|
}
|
|
2685
2763
|
}
|
|
2686
2764
|
|
|
2765
|
+
:where([data-type="error"]) .in-data-\[type\=error\]\:text-destructive {
|
|
2766
|
+
color: var(--destructive);
|
|
2767
|
+
}
|
|
2768
|
+
|
|
2769
|
+
:where([data-type="info"]) .in-data-\[type\=info\]\:text-info {
|
|
2770
|
+
color: var(--info);
|
|
2771
|
+
}
|
|
2772
|
+
|
|
2773
|
+
:where([data-type="loading"]) .in-data-\[type\=loading\]\:animate-spin {
|
|
2774
|
+
animation: var(--animate-spin);
|
|
2775
|
+
}
|
|
2776
|
+
|
|
2777
|
+
:where([data-type="loading"]) .in-data-\[type\=loading\]\:opacity-72 {
|
|
2778
|
+
opacity: .72;
|
|
2779
|
+
}
|
|
2780
|
+
|
|
2781
|
+
:where([data-type="success"]) .in-data-\[type\=success\]\:text-success {
|
|
2782
|
+
color: var(--success);
|
|
2783
|
+
}
|
|
2784
|
+
|
|
2785
|
+
:where([data-type="warning"]) .in-data-\[type\=warning\]\:text-warning {
|
|
2786
|
+
color: var(--warning);
|
|
2787
|
+
}
|
|
2788
|
+
|
|
2687
2789
|
.not-has-disabled\:has-not-focus-visible\:not-has-aria-invalid\:before\:shadow-\[0_1px_--theme\(--color-black\/4\%\)\]:not(:has(:disabled)):has(:not(:focus-visible)):not(:has([aria-invalid="true"])):before {
|
|
2688
2790
|
content: var(--tw-content);
|
|
2689
2791
|
--tw-shadow: 0 1px var(--tw-shadow-color, #0000000a);
|
|
@@ -3027,6 +3129,14 @@
|
|
|
3027
3129
|
}
|
|
3028
3130
|
}
|
|
3029
3131
|
|
|
3132
|
+
.data-behind\:pointer-events-none[data-behind] {
|
|
3133
|
+
pointer-events: none;
|
|
3134
|
+
}
|
|
3135
|
+
|
|
3136
|
+
.data-behind\:opacity-0[data-behind] {
|
|
3137
|
+
opacity: 0;
|
|
3138
|
+
}
|
|
3139
|
+
|
|
3030
3140
|
.data-checked\:translate-x-3[data-checked] {
|
|
3031
3141
|
--tw-translate-x: calc(var(--spacing) * 3);
|
|
3032
3142
|
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
@@ -3095,6 +3205,22 @@
|
|
|
3095
3205
|
opacity: 0;
|
|
3096
3206
|
}
|
|
3097
3207
|
|
|
3208
|
+
.data-ending-style\:not-data-limited\:not-data-swipe-direction\:\[transform\:translateY\(calc\(100\%\+var\(--toast-inset\)\)\)\][data-ending-style]:not([data-limited]):not([data-swipe-direction]) {
|
|
3209
|
+
transform: translateY(calc(100% + var(--toast-inset)));
|
|
3210
|
+
}
|
|
3211
|
+
|
|
3212
|
+
.data-expanded\:pointer-events-auto[data-expanded] {
|
|
3213
|
+
pointer-events: auto;
|
|
3214
|
+
}
|
|
3215
|
+
|
|
3216
|
+
.data-expanded\:h-\(--toast-height\)[data-expanded] {
|
|
3217
|
+
height: var(--toast-height);
|
|
3218
|
+
}
|
|
3219
|
+
|
|
3220
|
+
.data-expanded\:opacity-100[data-expanded] {
|
|
3221
|
+
opacity: 1;
|
|
3222
|
+
}
|
|
3223
|
+
|
|
3098
3224
|
.data-highlighted\:bg-accent[data-highlighted] {
|
|
3099
3225
|
background-color: var(--accent);
|
|
3100
3226
|
}
|
|
@@ -3138,6 +3264,10 @@
|
|
|
3138
3264
|
transition-duration: 0s;
|
|
3139
3265
|
}
|
|
3140
3266
|
|
|
3267
|
+
.data-limited\:opacity-0[data-limited] {
|
|
3268
|
+
opacity: 0;
|
|
3269
|
+
}
|
|
3270
|
+
|
|
3141
3271
|
.data-pressed\:bg-accent[data-pressed] {
|
|
3142
3272
|
background-color: var(--accent);
|
|
3143
3273
|
}
|
|
@@ -3356,6 +3486,117 @@
|
|
|
3356
3486
|
inset-block: calc(var(--spacing) * .5);
|
|
3357
3487
|
}
|
|
3358
3488
|
|
|
3489
|
+
.data-\[position\]\:data-expanded\:\[transform\:translateX\(var\(--toast-swipe-movement-x\)\)_translateY\(var\(--toast-calc-offset-y\)\)\][data-position][data-expanded] {
|
|
3490
|
+
transform: translateX(var(--toast-swipe-movement-x)) translateY(var(--toast-calc-offset-y));
|
|
3491
|
+
}
|
|
3492
|
+
|
|
3493
|
+
.data-\[position\*\=bottom\]\:top-auto[data-position*="bottom"] {
|
|
3494
|
+
top: auto;
|
|
3495
|
+
}
|
|
3496
|
+
|
|
3497
|
+
.data-\[position\*\=bottom\]\:bottom-\(--toast-inset\)[data-position*="bottom"] {
|
|
3498
|
+
bottom: var(--toast-inset);
|
|
3499
|
+
}
|
|
3500
|
+
|
|
3501
|
+
.data-\[position\*\=bottom\]\:bottom-0[data-position*="bottom"] {
|
|
3502
|
+
bottom: calc(var(--spacing) * 0);
|
|
3503
|
+
}
|
|
3504
|
+
|
|
3505
|
+
.data-\[position\*\=bottom\]\:origin-bottom[data-position*="bottom"] {
|
|
3506
|
+
transform-origin: bottom;
|
|
3507
|
+
}
|
|
3508
|
+
|
|
3509
|
+
.data-\[position\*\=bottom\]\:\[transform\:translateX\(var\(--toast-swipe-movement-x\)\)_translateY\(calc\(var\(--toast-swipe-movement-y\)-\(var\(--toast-index\)\*var\(--toast-peek\)\)-\(var\(--toast-shrink\)\*var\(--toast-calc-height\)\)\)\)_scale\(var\(--toast-scale\)\)\][data-position*="bottom"] {
|
|
3510
|
+
transform: translateX(var(--toast-swipe-movement-x)) translateY(calc(var(--toast-swipe-movement-y) - (var(--toast-index) * var(--toast-peek)) - (var(--toast-shrink) * var(--toast-calc-height)))) scale(var(--toast-scale));
|
|
3511
|
+
}
|
|
3512
|
+
|
|
3513
|
+
.data-\[position\*\=bottom\]\:\[--toast-calc-offset-y\:calc\(var\(--toast-offset-y\)\*-1\+var\(--toast-index\)\*var\(--toast-gap\)\*-1\+var\(--toast-swipe-movement-y\)\)\][data-position*="bottom"] {
|
|
3514
|
+
--toast-calc-offset-y: calc(var(--toast-offset-y) * -1 + var(--toast-index) * var(--toast-gap) * -1 + var(--toast-swipe-movement-y));
|
|
3515
|
+
}
|
|
3516
|
+
|
|
3517
|
+
.data-\[position\*\=bottom\]\:after\:bottom-full[data-position*="bottom"]:after {
|
|
3518
|
+
content: var(--tw-content);
|
|
3519
|
+
bottom: 100%;
|
|
3520
|
+
}
|
|
3521
|
+
|
|
3522
|
+
.data-\[position\*\=bottom\]\:data-starting-style\:\[transform\:translateY\(calc\(100\%\+var\(--toast-inset\)\)\)\][data-position*="bottom"][data-starting-style] {
|
|
3523
|
+
transform: translateY(calc(100% + var(--toast-inset)));
|
|
3524
|
+
}
|
|
3525
|
+
|
|
3526
|
+
.data-\[position\*\=center\]\:right-0[data-position*="center"] {
|
|
3527
|
+
right: calc(var(--spacing) * 0);
|
|
3528
|
+
}
|
|
3529
|
+
|
|
3530
|
+
.data-\[position\*\=center\]\:left-0[data-position*="center"] {
|
|
3531
|
+
left: calc(var(--spacing) * 0);
|
|
3532
|
+
}
|
|
3533
|
+
|
|
3534
|
+
.data-\[position\*\=center\]\:left-1\/2[data-position*="center"] {
|
|
3535
|
+
left: 50%;
|
|
3536
|
+
}
|
|
3537
|
+
|
|
3538
|
+
.data-\[position\*\=center\]\:-translate-x-1\/2[data-position*="center"] {
|
|
3539
|
+
--tw-translate-x: calc(calc(1 / 2 * 100%) * -1);
|
|
3540
|
+
translate: var(--tw-translate-x) var(--tw-translate-y);
|
|
3541
|
+
}
|
|
3542
|
+
|
|
3543
|
+
.data-\[position\*\=left\]\:right-auto[data-position*="left"] {
|
|
3544
|
+
right: auto;
|
|
3545
|
+
}
|
|
3546
|
+
|
|
3547
|
+
.data-\[position\*\=left\]\:left-\(--toast-inset\)[data-position*="left"] {
|
|
3548
|
+
left: var(--toast-inset);
|
|
3549
|
+
}
|
|
3550
|
+
|
|
3551
|
+
.data-\[position\*\=left\]\:left-0[data-position*="left"] {
|
|
3552
|
+
left: calc(var(--spacing) * 0);
|
|
3553
|
+
}
|
|
3554
|
+
|
|
3555
|
+
.data-\[position\*\=right\]\:right-\(--toast-inset\)[data-position*="right"] {
|
|
3556
|
+
right: var(--toast-inset);
|
|
3557
|
+
}
|
|
3558
|
+
|
|
3559
|
+
.data-\[position\*\=right\]\:right-0[data-position*="right"] {
|
|
3560
|
+
right: calc(var(--spacing) * 0);
|
|
3561
|
+
}
|
|
3562
|
+
|
|
3563
|
+
.data-\[position\*\=right\]\:left-auto[data-position*="right"] {
|
|
3564
|
+
left: auto;
|
|
3565
|
+
}
|
|
3566
|
+
|
|
3567
|
+
.data-\[position\*\=top\]\:top-\(--toast-inset\)[data-position*="top"] {
|
|
3568
|
+
top: var(--toast-inset);
|
|
3569
|
+
}
|
|
3570
|
+
|
|
3571
|
+
.data-\[position\*\=top\]\:top-0[data-position*="top"] {
|
|
3572
|
+
top: calc(var(--spacing) * 0);
|
|
3573
|
+
}
|
|
3574
|
+
|
|
3575
|
+
.data-\[position\*\=top\]\:bottom-auto[data-position*="top"] {
|
|
3576
|
+
bottom: auto;
|
|
3577
|
+
}
|
|
3578
|
+
|
|
3579
|
+
.data-\[position\*\=top\]\:origin-top[data-position*="top"] {
|
|
3580
|
+
transform-origin: top;
|
|
3581
|
+
}
|
|
3582
|
+
|
|
3583
|
+
.data-\[position\*\=top\]\:\[transform\:translateX\(var\(--toast-swipe-movement-x\)\)_translateY\(calc\(var\(--toast-swipe-movement-y\)\+\(var\(--toast-index\)\*var\(--toast-peek\)\)\+\(var\(--toast-shrink\)\*var\(--toast-calc-height\)\)\)\)_scale\(var\(--toast-scale\)\)\][data-position*="top"] {
|
|
3584
|
+
transform: translateX(var(--toast-swipe-movement-x)) translateY(calc(var(--toast-swipe-movement-y) + (var(--toast-index) * var(--toast-peek)) + (var(--toast-shrink) * var(--toast-calc-height)))) scale(var(--toast-scale));
|
|
3585
|
+
}
|
|
3586
|
+
|
|
3587
|
+
.data-\[position\*\=top\]\:\[--toast-calc-offset-y\:calc\(var\(--toast-offset-y\)\+var\(--toast-index\)\*var\(--toast-gap\)\+var\(--toast-swipe-movement-y\)\)\][data-position*="top"] {
|
|
3588
|
+
--toast-calc-offset-y: calc(var(--toast-offset-y) + var(--toast-index) * var(--toast-gap) + var(--toast-swipe-movement-y));
|
|
3589
|
+
}
|
|
3590
|
+
|
|
3591
|
+
.data-\[position\*\=top\]\:after\:top-full[data-position*="top"]:after {
|
|
3592
|
+
content: var(--tw-content);
|
|
3593
|
+
top: 100%;
|
|
3594
|
+
}
|
|
3595
|
+
|
|
3596
|
+
.data-\[position\*\=top\]\:data-starting-style\:\[transform\:translateY\(calc\(-100\%-var\(--toast-inset\)\)\)\][data-position*="top"][data-starting-style] {
|
|
3597
|
+
transform: translateY(calc(-100% - var(--toast-inset)));
|
|
3598
|
+
}
|
|
3599
|
+
|
|
3359
3600
|
:is(.has-\[\+\[data-slot\=autocomplete-trigger\]\,\+\[data-slot\=autocomplete-clear\]\]\:\*\:data-\[slot\=autocomplete-input\]\:pe-6\.5:has( + [data-slot="autocomplete-trigger"], + [data-slot="autocomplete-clear"]) > *)[data-slot="autocomplete-input"] {
|
|
3360
3601
|
padding-inline-end: calc(var(--spacing) * 6.5);
|
|
3361
3602
|
}
|
|
@@ -3386,6 +3627,22 @@
|
|
|
3386
3627
|
background-color: #0000;
|
|
3387
3628
|
}
|
|
3388
3629
|
|
|
3630
|
+
.data-ending-style\:data-\[swipe-direction\=down\]\:\[transform\:translateY\(calc\(var\(--toast-swipe-movement-y\)\+100\%\+var\(--toast-inset\)\)\)\][data-ending-style][data-swipe-direction="down"], .data-expanded\:data-ending-style\:data-\[swipe-direction\=down\]\:\[transform\:translateY\(calc\(var\(--toast-swipe-movement-y\)\+100\%\+var\(--toast-inset\)\)\)\][data-expanded][data-ending-style][data-swipe-direction="down"] {
|
|
3631
|
+
transform: translateY(calc(var(--toast-swipe-movement-y) + 100% + var(--toast-inset)));
|
|
3632
|
+
}
|
|
3633
|
+
|
|
3634
|
+
.data-ending-style\:data-\[swipe-direction\=left\]\:\[transform\:translateX\(calc\(var\(--toast-swipe-movement-x\)-100\%-var\(--toast-inset\)\)\)_translateY\(var\(--toast-calc-offset-y\)\)\][data-ending-style][data-swipe-direction="left"], .data-expanded\:data-ending-style\:data-\[swipe-direction\=left\]\:\[transform\:translateX\(calc\(var\(--toast-swipe-movement-x\)-100\%-var\(--toast-inset\)\)\)_translateY\(var\(--toast-calc-offset-y\)\)\][data-expanded][data-ending-style][data-swipe-direction="left"] {
|
|
3635
|
+
transform: translateX(calc(var(--toast-swipe-movement-x) - 100% - var(--toast-inset))) translateY(var(--toast-calc-offset-y));
|
|
3636
|
+
}
|
|
3637
|
+
|
|
3638
|
+
.data-ending-style\:data-\[swipe-direction\=right\]\:\[transform\:translateX\(calc\(var\(--toast-swipe-movement-x\)\+100\%\+var\(--toast-inset\)\)\)_translateY\(var\(--toast-calc-offset-y\)\)\][data-ending-style][data-swipe-direction="right"], .data-expanded\:data-ending-style\:data-\[swipe-direction\=right\]\:\[transform\:translateX\(calc\(var\(--toast-swipe-movement-x\)\+100\%\+var\(--toast-inset\)\)\)_translateY\(var\(--toast-calc-offset-y\)\)\][data-expanded][data-ending-style][data-swipe-direction="right"] {
|
|
3639
|
+
transform: translateX(calc(var(--toast-swipe-movement-x) + 100% + var(--toast-inset))) translateY(var(--toast-calc-offset-y));
|
|
3640
|
+
}
|
|
3641
|
+
|
|
3642
|
+
.data-ending-style\:data-\[swipe-direction\=up\]\:\[transform\:translateY\(calc\(var\(--toast-swipe-movement-y\)-100\%-var\(--toast-inset\)\)\)\][data-ending-style][data-swipe-direction="up"], .data-expanded\:data-ending-style\:data-\[swipe-direction\=up\]\:\[transform\:translateY\(calc\(var\(--toast-swipe-movement-y\)-100\%-var\(--toast-inset\)\)\)\][data-expanded][data-ending-style][data-swipe-direction="up"] {
|
|
3643
|
+
transform: translateY(calc(var(--toast-swipe-movement-y) - 100% - var(--toast-inset)));
|
|
3644
|
+
}
|
|
3645
|
+
|
|
3389
3646
|
.data-\[variant\=destructive\]\:text-destructive-foreground[data-variant="destructive"] {
|
|
3390
3647
|
color: var(--destructive-foreground);
|
|
3391
3648
|
}
|
|
@@ -3571,6 +3828,10 @@
|
|
|
3571
3828
|
--sheet-inset: 1rem;
|
|
3572
3829
|
}
|
|
3573
3830
|
|
|
3831
|
+
.sm\:\[--toast-inset\:--spacing\(8\)\] {
|
|
3832
|
+
--toast-inset: calc(var(--spacing) * 8);
|
|
3833
|
+
}
|
|
3834
|
+
|
|
3574
3835
|
.sm\:before\:basis-\[20vh\]:before {
|
|
3575
3836
|
content: var(--tw-content);
|
|
3576
3837
|
flex-basis: 20vh;
|
|
@@ -4697,6 +4958,31 @@
|
|
|
4697
4958
|
initial-value: 1;
|
|
4698
4959
|
}
|
|
4699
4960
|
|
|
4961
|
+
@property --tw-rotate-x {
|
|
4962
|
+
syntax: "*";
|
|
4963
|
+
inherits: false
|
|
4964
|
+
}
|
|
4965
|
+
|
|
4966
|
+
@property --tw-rotate-y {
|
|
4967
|
+
syntax: "*";
|
|
4968
|
+
inherits: false
|
|
4969
|
+
}
|
|
4970
|
+
|
|
4971
|
+
@property --tw-rotate-z {
|
|
4972
|
+
syntax: "*";
|
|
4973
|
+
inherits: false
|
|
4974
|
+
}
|
|
4975
|
+
|
|
4976
|
+
@property --tw-skew-x {
|
|
4977
|
+
syntax: "*";
|
|
4978
|
+
inherits: false
|
|
4979
|
+
}
|
|
4980
|
+
|
|
4981
|
+
@property --tw-skew-y {
|
|
4982
|
+
syntax: "*";
|
|
4983
|
+
inherits: false
|
|
4984
|
+
}
|
|
4985
|
+
|
|
4700
4986
|
@property --tw-border-style {
|
|
4701
4987
|
syntax: "*";
|
|
4702
4988
|
inherits: false;
|
package/dist/toast.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Toast } from "@base-ui-components/react/toast";
|
|
2
|
+
declare const toastManager: import("@base-ui-components/react/toast").ToastManager;
|
|
3
|
+
type ToastPosition = "top-left" | "top-center" | "top-right" | "bottom-left" | "bottom-center" | "bottom-right";
|
|
4
|
+
interface ToastProviderProps extends Toast.Provider.Props {
|
|
5
|
+
position?: ToastPosition;
|
|
6
|
+
}
|
|
7
|
+
declare function ToastProvider({ children, position, ...props }: ToastProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export { ToastProvider, type ToastPosition, toastManager };
|
package/dist/toast.js
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Toast } from "@base-ui-components/react/toast";
|
|
3
|
+
import { CircleAlertIcon, CircleCheckIcon, InfoIcon, LoaderCircleIcon, TriangleAlertIcon } from "lucide-react";
|
|
4
|
+
import { cn } from "./lib/utils.js";
|
|
5
|
+
import { buttonVariants } from "./button.js";
|
|
6
|
+
const toastManager = Toast.createToastManager();
|
|
7
|
+
const TOAST_ICONS = {
|
|
8
|
+
error: CircleAlertIcon,
|
|
9
|
+
info: InfoIcon,
|
|
10
|
+
loading: LoaderCircleIcon,
|
|
11
|
+
success: CircleCheckIcon,
|
|
12
|
+
warning: TriangleAlertIcon
|
|
13
|
+
};
|
|
14
|
+
function ToastProvider({ children, position = "bottom-right", ...props }) {
|
|
15
|
+
return /*#__PURE__*/ jsxs(Toast.Provider, {
|
|
16
|
+
toastManager: toastManager,
|
|
17
|
+
...props,
|
|
18
|
+
children: [
|
|
19
|
+
children,
|
|
20
|
+
/*#__PURE__*/ jsx(ToastList, {
|
|
21
|
+
position: position
|
|
22
|
+
})
|
|
23
|
+
]
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
function ToastList({ position = "bottom-right" }) {
|
|
27
|
+
const { toasts } = Toast.useToastManager();
|
|
28
|
+
const isTop = position.startsWith("top");
|
|
29
|
+
return /*#__PURE__*/ jsx(Toast.Portal, {
|
|
30
|
+
"data-slot": "toast-portal",
|
|
31
|
+
children: /*#__PURE__*/ jsx(Toast.Viewport, {
|
|
32
|
+
className: cn("fixed z-50 mx-auto flex w-[calc(100%-var(--toast-inset)*2)] max-w-90 [--toast-inset:--spacing(4)] sm:[--toast-inset:--spacing(8)]", "data-[position*=top]:top-(--toast-inset)", "data-[position*=bottom]:bottom-(--toast-inset)", "data-[position*=left]:left-(--toast-inset)", "data-[position*=right]:right-(--toast-inset)", "data-[position*=center]:-translate-x-1/2 data-[position*=center]:left-1/2"),
|
|
33
|
+
"data-position": position,
|
|
34
|
+
"data-slot": "toast-viewport",
|
|
35
|
+
children: toasts.map((toast)=>{
|
|
36
|
+
const Icon = toast.type ? TOAST_ICONS[toast.type] : null;
|
|
37
|
+
return /*#__PURE__*/ jsx(Toast.Root, {
|
|
38
|
+
className: cn("absolute z-[calc(9999-var(--toast-index))] h-(--toast-calc-height) w-full select-none rounded-lg border bg-popover bg-clip-padding px-3.5 py-3 text-popover-foreground shadow-lg [transition:transform_.5s_cubic-bezier(.22,1,.36,1),opacity_.5s,height_.15s] before:pointer-events-none before:absolute before:inset-0 before:rounded-[calc(var(--radius-lg)-1px)] before:shadow-[0_1px_--theme(--color-black/4%)] dark:bg-clip-border dark:before:shadow-[0_-1px_--theme(--color-white/8%)]", "data-[position*=right]:right-0 data-[position*=right]:left-auto", "data-[position*=left]:right-auto data-[position*=left]:left-0", "data-[position*=center]:right-0 data-[position*=center]:left-0", "data-[position*=top]:top-0 data-[position*=top]:bottom-auto data-[position*=top]:origin-top", "data-[position*=bottom]:top-auto data-[position*=bottom]:bottom-0 data-[position*=bottom]:origin-bottom", "after:absolute after:left-0 after:h-[calc(var(--toast-gap)+1px)] after:w-full", "data-[position*=top]:after:top-full", "data-[position*=bottom]:after:bottom-full", "[--toast-calc-height:var(--toast-frontmost-height,var(--toast-height))] [--toast-gap:--spacing(3)] [--toast-peek:--spacing(3)] [--toast-scale:calc(max(0,1-(var(--toast-index)*.1)))] [--toast-shrink:calc(1-var(--toast-scale))]", "data-[position*=top]:[--toast-calc-offset-y:calc(var(--toast-offset-y)+var(--toast-index)*var(--toast-gap)+var(--toast-swipe-movement-y))]", "data-[position*=bottom]:[--toast-calc-offset-y:calc(var(--toast-offset-y)*-1+var(--toast-index)*var(--toast-gap)*-1+var(--toast-swipe-movement-y))]", "data-[position*=top]:[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)+(var(--toast-index)*var(--toast-peek))+(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]", "data-[position*=bottom]:[transform:translateX(var(--toast-swipe-movement-x))_translateY(calc(var(--toast-swipe-movement-y)-(var(--toast-index)*var(--toast-peek))-(var(--toast-shrink)*var(--toast-calc-height))))_scale(var(--toast-scale))]", "data-limited:opacity-0", "data-expanded:h-(--toast-height)", "data-[position]:data-expanded:[transform:translateX(var(--toast-swipe-movement-x))_translateY(var(--toast-calc-offset-y))]", "data-[position*=top]:data-starting-style:[transform:translateY(calc(-100%-var(--toast-inset)))]", "data-[position*=bottom]:data-starting-style:[transform:translateY(calc(100%+var(--toast-inset)))]", "data-ending-style:opacity-0", "data-ending-style:not-data-limited:not-data-swipe-direction:[transform:translateY(calc(100%+var(--toast-inset)))]", "data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]", "data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]", "data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]", "data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]", "data-expanded:data-ending-style:data-[swipe-direction=left]:[transform:translateX(calc(var(--toast-swipe-movement-x)-100%-var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]", "data-expanded:data-ending-style:data-[swipe-direction=right]:[transform:translateX(calc(var(--toast-swipe-movement-x)+100%+var(--toast-inset)))_translateY(var(--toast-calc-offset-y))]", "data-expanded:data-ending-style:data-[swipe-direction=up]:[transform:translateY(calc(var(--toast-swipe-movement-y)-100%-var(--toast-inset)))]", "data-expanded:data-ending-style:data-[swipe-direction=down]:[transform:translateY(calc(var(--toast-swipe-movement-y)+100%+var(--toast-inset)))]"),
|
|
39
|
+
"data-position": position,
|
|
40
|
+
swipeDirection: position.includes("center") ? [
|
|
41
|
+
isTop ? "up" : "down"
|
|
42
|
+
] : position.includes("left") ? [
|
|
43
|
+
"left",
|
|
44
|
+
isTop ? "up" : "down"
|
|
45
|
+
] : [
|
|
46
|
+
"right",
|
|
47
|
+
isTop ? "up" : "down"
|
|
48
|
+
],
|
|
49
|
+
toast: toast,
|
|
50
|
+
children: /*#__PURE__*/ jsxs(Toast.Content, {
|
|
51
|
+
className: "flex items-center justify-between gap-1.5 overflow-hidden text-sm transition-opacity duration-250 data-behind:pointer-events-none data-expanded:pointer-events-auto data-behind:opacity-0 data-expanded:opacity-100",
|
|
52
|
+
children: [
|
|
53
|
+
/*#__PURE__*/ jsxs("div", {
|
|
54
|
+
className: "flex gap-2",
|
|
55
|
+
children: [
|
|
56
|
+
Icon && /*#__PURE__*/ jsx("div", {
|
|
57
|
+
className: "mt-.5 [&>svg]:h-[1lh] [&>svg]:w-4 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
58
|
+
"data-slot": "toast-icon",
|
|
59
|
+
children: /*#__PURE__*/ jsx(Icon, {
|
|
60
|
+
className: "in-data-[type=loading]:animate-spin in-data-[type=error]:text-destructive in-data-[type=info]:text-info in-data-[type=success]:text-success in-data-[type=warning]:text-warning in-data-[type=loading]:opacity-72"
|
|
61
|
+
})
|
|
62
|
+
}),
|
|
63
|
+
/*#__PURE__*/ jsxs("div", {
|
|
64
|
+
className: "flex flex-col gap-0.5",
|
|
65
|
+
children: [
|
|
66
|
+
/*#__PURE__*/ jsx(Toast.Title, {
|
|
67
|
+
className: "font-medium",
|
|
68
|
+
"data-slot": "toast-title"
|
|
69
|
+
}),
|
|
70
|
+
/*#__PURE__*/ jsx(Toast.Description, {
|
|
71
|
+
className: "text-muted-foreground",
|
|
72
|
+
"data-slot": "toast-description"
|
|
73
|
+
})
|
|
74
|
+
]
|
|
75
|
+
})
|
|
76
|
+
]
|
|
77
|
+
}),
|
|
78
|
+
toast.actionProps && /*#__PURE__*/ jsx(Toast.Action, {
|
|
79
|
+
className: buttonVariants({
|
|
80
|
+
size: "xs"
|
|
81
|
+
}),
|
|
82
|
+
"data-slot": "toast-action",
|
|
83
|
+
children: toast.actionProps.children
|
|
84
|
+
})
|
|
85
|
+
]
|
|
86
|
+
})
|
|
87
|
+
}, toast.id);
|
|
88
|
+
})
|
|
89
|
+
})
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
export { ToastProvider, toastManager };
|