@cookified/toastify 1.0.0 → 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.
@@ -1,19 +1,73 @@
1
- // src/toastify/Toaster.tsx
2
- import { AnimatePresence, motion as motion4 } from "motion/react";
3
- import { useEffect, useRef, useState } from "react";
1
+ "use client";
2
+ import { motion, AnimatePresence } from 'motion/react';
3
+ import { useState, useRef, useEffect } from 'react';
4
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
4
5
 
5
- // src/toastify/Toast.tsx
6
- import { Check, Loader2, X } from "lucide-react";
7
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
6
+ // src/toastify/Toaster.tsx
7
+ function CheckIcon() {
8
+ return /* @__PURE__ */ jsx(
9
+ "svg",
10
+ {
11
+ width: "12",
12
+ height: "12",
13
+ viewBox: "0 0 24 24",
14
+ fill: "none",
15
+ stroke: "currentColor",
16
+ strokeWidth: 2.5,
17
+ strokeLinecap: "round",
18
+ strokeLinejoin: "round",
19
+ "aria-hidden": "true",
20
+ children: /* @__PURE__ */ jsx("polyline", { points: "20 6 9 17 4 12" })
21
+ }
22
+ );
23
+ }
24
+ function XIcon() {
25
+ return /* @__PURE__ */ jsxs(
26
+ "svg",
27
+ {
28
+ width: "12",
29
+ height: "12",
30
+ viewBox: "0 0 24 24",
31
+ fill: "none",
32
+ stroke: "currentColor",
33
+ strokeWidth: 2.5,
34
+ strokeLinecap: "round",
35
+ strokeLinejoin: "round",
36
+ "aria-hidden": "true",
37
+ children: [
38
+ /* @__PURE__ */ jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
39
+ /* @__PURE__ */ jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
40
+ ]
41
+ }
42
+ );
43
+ }
44
+ function LoaderIcon() {
45
+ return /* @__PURE__ */ jsx(
46
+ "svg",
47
+ {
48
+ width: "12",
49
+ height: "12",
50
+ viewBox: "0 0 24 24",
51
+ fill: "none",
52
+ stroke: "currentColor",
53
+ strokeWidth: 2.5,
54
+ strokeLinecap: "round",
55
+ strokeLinejoin: "round",
56
+ className: "toastify-spin animate-spin",
57
+ "aria-hidden": "true",
58
+ children: /* @__PURE__ */ jsx("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" })
59
+ }
60
+ );
61
+ }
8
62
  function DefaultToastIcon({ type }) {
9
- const badgeClasses = "flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-neutral-900 text-white shadow-xs dark:bg-white dark:text-neutral-950";
63
+ const badgeClasses = "toastify-badge flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-neutral-900 text-white shadow-xs dark:bg-white dark:text-neutral-950";
10
64
  switch (type) {
11
65
  case "loading":
12
- return /* @__PURE__ */ jsx("span", { className: badgeClasses, children: /* @__PURE__ */ jsx(Loader2, { size: 12, strokeWidth: 2.5, className: "animate-spin" }) });
66
+ return /* @__PURE__ */ jsx("span", { className: badgeClasses, children: /* @__PURE__ */ jsx(LoaderIcon, {}) });
13
67
  case "success":
14
- return /* @__PURE__ */ jsx("span", { className: badgeClasses, children: /* @__PURE__ */ jsx(Check, { size: 12, strokeWidth: 2.5 }) });
68
+ return /* @__PURE__ */ jsx("span", { className: badgeClasses, children: /* @__PURE__ */ jsx(CheckIcon, {}) });
15
69
  case "error":
16
- return /* @__PURE__ */ jsx("span", { className: badgeClasses, children: /* @__PURE__ */ jsx(X, { size: 12, strokeWidth: 2.5 }) });
70
+ return /* @__PURE__ */ jsx("span", { className: badgeClasses, children: /* @__PURE__ */ jsx(XIcon, {}) });
17
71
  case "warning":
18
72
  return /* @__PURE__ */ jsx("span", { className: badgeClasses, children: /* @__PURE__ */ jsxs(
19
73
  "svg",
@@ -74,14 +128,14 @@ function Toast({
74
128
  className: `toastify-toast flex h-14 w-full select-none items-center justify-between gap-3 rounded-md border border-neutral-200/90 bg-white px-3.5 shadow-md shadow-neutral-950/5 dark:border-neutral-800/90 dark:bg-neutral-900 dark:shadow-neutral-950/40 ${globalOptions?.className ?? ""} ${toast2.className ?? ""}`,
75
129
  style: { ...globalOptions?.style, ...toast2.style },
76
130
  children: [
77
- /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-1 items-center gap-3", children: [
131
+ /* @__PURE__ */ jsxs("div", { className: "toastify-content flex min-w-0 flex-1 items-center gap-3", children: [
78
132
  icon,
79
- /* @__PURE__ */ jsxs("div", { className: "flex min-w-0 flex-col justify-center", children: [
80
- /* @__PURE__ */ jsx("div", { className: "truncate text-[13px] font-medium leading-4 text-neutral-900 dark:text-neutral-100", children: toast2.title }),
81
- toast2.description && /* @__PURE__ */ jsx("div", { className: "mt-0.5 truncate text-[12px] leading-4 text-neutral-500 dark:text-neutral-400", children: toast2.description })
133
+ /* @__PURE__ */ jsxs("div", { className: "toastify-text-group flex min-w-0 flex-col justify-center", children: [
134
+ /* @__PURE__ */ jsx("div", { className: "toastify-title truncate text-[13px] font-medium leading-4 text-neutral-900 dark:text-neutral-100", children: toast2.title }),
135
+ toast2.description && /* @__PURE__ */ jsx("div", { className: "toastify-description mt-0.5 truncate text-[12px] leading-4 text-neutral-500 dark:text-neutral-400", children: toast2.description })
82
136
  ] })
83
137
  ] }),
84
- /* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [
138
+ /* @__PURE__ */ jsxs("div", { className: "toastify-actions flex shrink-0 items-center gap-2", children: [
85
139
  toast2.cancel && /* @__PURE__ */ jsx(
86
140
  "button",
87
141
  {
@@ -95,7 +149,7 @@ function Toast({
95
149
  }
96
150
  onDismiss();
97
151
  },
98
- className: "cursor-pointer rounded px-2 py-1 text-xs font-medium text-neutral-600 transition-colors hover:bg-neutral-100 hover:text-neutral-900 dark:text-neutral-400 dark:hover:bg-neutral-800 dark:hover:text-neutral-100",
152
+ className: "toastify-btn-cancel cursor-pointer rounded px-2 py-1 text-xs font-medium text-neutral-600 transition-colors hover:bg-neutral-100 hover:text-neutral-900 dark:text-neutral-400 dark:hover:bg-neutral-800 dark:hover:text-neutral-100",
99
153
  children: toast2.cancel.label
100
154
  }
101
155
  ),
@@ -112,7 +166,7 @@ function Toast({
112
166
  }
113
167
  onDismiss();
114
168
  },
115
- className: "cursor-pointer rounded px-2.5 py-1 text-xs font-medium bg-neutral-900 text-white transition-all hover:bg-neutral-800 shadow-[inset_0_-2px_4px_rgba(0,0,0,0.5),0_1px_2px_rgba(0,0,0,0.08)] active:shadow-[inset_0_2px_4px_rgba(0,0,0,0.4)] dark:bg-neutral-100 dark:text-neutral-900 dark:hover:bg-neutral-200 dark:shadow-[inset_0_-2px_4px_rgba(0,0,0,0.22),0_1px_2px_rgba(0,0,0,0.15)] dark:active:shadow-[inset_0_2px_4px_rgba(0,0,0,0.25)]",
169
+ className: "toastify-btn-action cursor-pointer rounded px-2.5 py-1 text-xs font-medium bg-neutral-900 text-white transition-all hover:bg-neutral-800 shadow-[inset_0_-2px_4px_rgba(0,0,0,0.5),0_1px_2px_rgba(0,0,0,0.08)] active:shadow-[inset_0_2px_4px_rgba(0,0,0,0.4)] dark:bg-neutral-100 dark:text-neutral-900 dark:hover:bg-neutral-200 dark:shadow-[inset_0_-2px_4px_rgba(0,0,0,0.22),0_1px_2px_rgba(0,0,0,0.15)] dark:active:shadow-[inset_0_2px_4px_rgba(0,0,0,0.25)]",
116
170
  children: toast2.action.label
117
171
  }
118
172
  )
@@ -122,18 +176,12 @@ function Toast({
122
176
  );
123
177
  }
124
178
 
125
- // src/toastify/animations/FadeAnimation.tsx
126
- import { motion } from "motion/react";
127
-
128
179
  // src/toastify/animations/constants.ts
129
180
  var defaultSpring = {
130
181
  stiffness: 220,
131
182
  damping: 26,
132
183
  mass: 1
133
184
  };
134
-
135
- // src/toastify/animations/FadeAnimation.tsx
136
- import { jsx as jsx2 } from "react/jsx-runtime";
137
185
  function FadeAnimation({
138
186
  index,
139
187
  position,
@@ -145,7 +193,7 @@ function FadeAnimation({
145
193
  const isTop = position.startsWith("top");
146
194
  const stackStep = 66;
147
195
  const targetY = isTop ? index * stackStep : -index * stackStep;
148
- return /* @__PURE__ */ jsx2(
196
+ return /* @__PURE__ */ jsx(
149
197
  motion.article,
150
198
  {
151
199
  role: "status",
@@ -185,7 +233,7 @@ function FadeAnimation({
185
233
  onDismiss();
186
234
  }
187
235
  },
188
- className: "absolute h-14 w-full select-none cursor-grab active:cursor-grabbing",
236
+ className: "toastify-item absolute h-14 w-full select-none cursor-grab active:cursor-grabbing",
189
237
  style: {
190
238
  [isTop ? "top" : "bottom"]: 0,
191
239
  left: 0,
@@ -195,10 +243,6 @@ function FadeAnimation({
195
243
  }
196
244
  );
197
245
  }
198
-
199
- // src/toastify/animations/FolderStackAnimation.tsx
200
- import { motion as motion2 } from "motion/react";
201
- import { jsx as jsx3 } from "react/jsx-runtime";
202
246
  function FolderStackAnimation({
203
247
  index,
204
248
  isHovered,
@@ -219,8 +263,8 @@ function FolderStackAnimation({
219
263
  const targetScale = collapsed ? Math.max(0.88, 1 - index * 0.05) : 1;
220
264
  const targetOpacity = !isVisible ? 0 : collapsed ? index === 0 ? 1 : index === 1 ? 0.94 : 0.84 : 1;
221
265
  const exitX = isCenter ? 0 : isLeft ? -36 : 36;
222
- return /* @__PURE__ */ jsx3(
223
- motion2.article,
266
+ return /* @__PURE__ */ jsx(
267
+ motion.article,
224
268
  {
225
269
  role: "status",
226
270
  "aria-live": "polite",
@@ -259,7 +303,7 @@ function FolderStackAnimation({
259
303
  onDismiss();
260
304
  }
261
305
  },
262
- className: "absolute h-14 w-full select-none cursor-grab active:cursor-grabbing",
306
+ className: "toastify-item absolute h-14 w-full select-none cursor-grab active:cursor-grabbing",
263
307
  style: {
264
308
  [isTop ? "top" : "bottom"]: 0,
265
309
  left: 0,
@@ -270,10 +314,6 @@ function FolderStackAnimation({
270
314
  }
271
315
  );
272
316
  }
273
-
274
- // src/toastify/animations/SlideAnimation.tsx
275
- import { motion as motion3 } from "motion/react";
276
- import { jsx as jsx4 } from "react/jsx-runtime";
277
317
  function SlideAnimation({
278
318
  index,
279
319
  position,
@@ -290,8 +330,8 @@ function SlideAnimation({
290
330
  const entryX = isCenter ? 0 : isLeft ? -120 : 120;
291
331
  const exitX = isCenter ? 0 : isLeft ? -140 : 140;
292
332
  const initialY = isCenter ? isTop ? targetY - 30 : targetY + 30 : targetY;
293
- return /* @__PURE__ */ jsx4(
294
- motion3.article,
333
+ return /* @__PURE__ */ jsx(
334
+ motion.article,
295
335
  {
296
336
  role: "status",
297
337
  "aria-live": "polite",
@@ -330,7 +370,7 @@ function SlideAnimation({
330
370
  onDismiss();
331
371
  }
332
372
  },
333
- className: "absolute h-14 w-full select-none cursor-grab active:cursor-grabbing",
373
+ className: "toastify-item absolute h-14 w-full select-none cursor-grab active:cursor-grabbing",
334
374
  style: {
335
375
  [isTop ? "top" : "bottom"]: 0,
336
376
  left: 0,
@@ -340,24 +380,21 @@ function SlideAnimation({
340
380
  }
341
381
  );
342
382
  }
343
-
344
- // src/toastify/animations/index.tsx
345
- import { jsx as jsx5 } from "react/jsx-runtime";
346
383
  function ToastAnimation({
347
384
  animation = "stack",
348
385
  ...props
349
386
  }) {
350
387
  if (typeof animation === "function") {
351
388
  const CustomAnimation = animation;
352
- return /* @__PURE__ */ jsx5(CustomAnimation, { ...props });
389
+ return /* @__PURE__ */ jsx(CustomAnimation, { ...props });
353
390
  }
354
391
  if (animation === "slide") {
355
- return /* @__PURE__ */ jsx5(SlideAnimation, { ...props });
392
+ return /* @__PURE__ */ jsx(SlideAnimation, { ...props });
356
393
  }
357
394
  if (animation === "fade") {
358
- return /* @__PURE__ */ jsx5(FadeAnimation, { ...props });
395
+ return /* @__PURE__ */ jsx(FadeAnimation, { ...props });
359
396
  }
360
- return /* @__PURE__ */ jsx5(FolderStackAnimation, { ...props });
397
+ return /* @__PURE__ */ jsx(FolderStackAnimation, { ...props });
361
398
  }
362
399
 
363
400
  // src/toastify/store.ts
@@ -550,15 +587,328 @@ var toast = Object.assign(toastFn, {
550
587
  }
551
588
  });
552
589
 
553
- // src/toastify/Toaster.tsx
554
- import { jsx as jsx6 } from "react/jsx-runtime";
590
+ // src/toastify/styles.ts
591
+ var toastifyStyles = `
592
+ /* Toastify Standalone CSS */
593
+ @keyframes toastify-spin {
594
+ from {
595
+ transform: rotate(0deg);
596
+ }
597
+ to {
598
+ transform: rotate(360deg);
599
+ }
600
+ }
601
+
602
+ .toastify-spin {
603
+ animation: toastify-spin 1s linear infinite;
604
+ }
605
+
606
+ .toastify-toaster {
607
+ position: fixed;
608
+ z-index: 9999;
609
+ width: 356px;
610
+ max-width: calc(100vw - 32px);
611
+ box-sizing: border-box;
612
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
613
+ margin: 0;
614
+ padding: 0;
615
+ }
616
+
617
+ .toastify-toaster *,
618
+ .toastify-toaster *::before,
619
+ .toastify-toaster *::after {
620
+ box-sizing: border-box;
621
+ }
622
+
623
+ /* Positions */
624
+ .toastify-pos-top-left {
625
+ top: 24px;
626
+ left: 24px;
627
+ }
628
+ .toastify-pos-top-center {
629
+ top: 24px;
630
+ left: 0;
631
+ right: 0;
632
+ margin-left: auto;
633
+ margin-right: auto;
634
+ }
635
+ .toastify-pos-top-right {
636
+ top: 24px;
637
+ right: 24px;
638
+ }
639
+ .toastify-pos-bottom-left {
640
+ bottom: 24px;
641
+ left: 24px;
642
+ }
643
+ .toastify-pos-bottom-center {
644
+ bottom: 24px;
645
+ left: 0;
646
+ right: 0;
647
+ margin-left: auto;
648
+ margin-right: auto;
649
+ }
650
+ .toastify-pos-bottom-right {
651
+ bottom: 24px;
652
+ right: 24px;
653
+ }
654
+
655
+ .toastify-pointer-auto {
656
+ pointer-events: auto;
657
+ }
658
+ .toastify-pointer-none {
659
+ pointer-events: none;
660
+ }
661
+
662
+ /* Toast List Container */
663
+ .toastify-list {
664
+ position: relative;
665
+ width: 100%;
666
+ height: 100%;
667
+ display: flex;
668
+ }
669
+ .toastify-list-col {
670
+ flex-direction: column;
671
+ }
672
+ .toastify-list-col-reverse {
673
+ flex-direction: column-reverse;
674
+ }
675
+
676
+ /* Individual Toast Item wrapper */
677
+ .toastify-item {
678
+ position: absolute;
679
+ height: 56px;
680
+ width: 100%;
681
+ user-select: none;
682
+ cursor: grab;
683
+ }
684
+ .toastify-item:active {
685
+ cursor: grabbing;
686
+ }
687
+
688
+ /* Toast Card with Tactile Micro-bevels */
689
+ .toastify-toast {
690
+ display: flex;
691
+ height: 56px;
692
+ width: 100%;
693
+ user-select: none;
694
+ align-items: center;
695
+ justify-content: space-between;
696
+ gap: 12px;
697
+ border-radius: 8px;
698
+ padding: 0 14px;
699
+ box-sizing: border-box;
700
+ transition: background-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
701
+ border-color 0.2s cubic-bezier(0.16, 1, 0.3, 1),
702
+ box-shadow 0.2s cubic-bezier(0.16, 1, 0.3, 1),
703
+ color 0.2s cubic-bezier(0.16, 1, 0.3, 1);
704
+
705
+ /* Light theme default */
706
+ background-color: #ffffff;
707
+ border: 1px solid rgba(229, 231, 235, 0.9);
708
+ color: #111827;
709
+ box-shadow: 0 4px 12px -2px rgba(0, 0, 0, 0.08), 0 2px 6px -1px rgba(0, 0, 0, 0.04);
710
+ }
711
+
712
+ /* Dark theme overrides */
713
+ .toastify-toaster.dark .toastify-toast,
714
+ [data-theme="dark"] .toastify-toast,
715
+ .dark .toastify-toast {
716
+ background-color: #171717;
717
+ border: 1px solid rgba(38, 38, 38, 0.9);
718
+ color: #f5f5f5;
719
+ box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.4), 0 2px 6px -1px rgba(0, 0, 0, 0.25);
720
+ }
721
+
722
+ /* System dark theme preference when theme="system" */
723
+ @media (prefers-color-scheme: dark) {
724
+ .toastify-toaster.system .toastify-toast {
725
+ background-color: #171717;
726
+ border: 1px solid rgba(38, 38, 38, 0.9);
727
+ color: #f5f5f5;
728
+ box-shadow: 0 4px 14px -2px rgba(0, 0, 0, 0.4), 0 2px 6px -1px rgba(0, 0, 0, 0.25);
729
+ }
730
+ .toastify-toaster.system .toastify-badge {
731
+ background-color: #ffffff;
732
+ color: #0a0a0a;
733
+ }
734
+ .toastify-toaster.system .toastify-title {
735
+ color: #f5f5f5;
736
+ }
737
+ .toastify-toaster.system .toastify-description {
738
+ color: #a3a3a3;
739
+ }
740
+ .toastify-toaster.system .toastify-btn-cancel {
741
+ color: #a3a3a3;
742
+ }
743
+ .toastify-toaster.system .toastify-btn-cancel:hover {
744
+ background-color: #262626;
745
+ color: #f5f5f5;
746
+ }
747
+ .toastify-toaster.system .toastify-btn-action {
748
+ background-color: #f5f5f5;
749
+ color: #171717;
750
+ box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.22), 0 1px 2px rgba(0, 0, 0, 0.15);
751
+ }
752
+ .toastify-toaster.system .toastify-btn-action:hover {
753
+ background-color: #e5e5e5;
754
+ }
755
+ }
756
+
757
+ /* Badge Icon Wrapper */
758
+ .toastify-badge {
759
+ display: flex;
760
+ height: 20px;
761
+ width: 20px;
762
+ flex-shrink: 0;
763
+ align-items: center;
764
+ justify-content: center;
765
+ border-radius: 9999px;
766
+ background-color: #171717;
767
+ color: #ffffff;
768
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
769
+ }
770
+
771
+ .toastify-toaster.dark .toastify-badge,
772
+ [data-theme="dark"] .toastify-badge,
773
+ .dark .toastify-badge {
774
+ background-color: #ffffff;
775
+ color: #0a0a0a;
776
+ }
777
+
778
+ /* Content Area */
779
+ .toastify-content {
780
+ display: flex;
781
+ min-width: 0;
782
+ flex: 1 1 0%;
783
+ align-items: center;
784
+ gap: 12px;
785
+ }
786
+
787
+ .toastify-text-group {
788
+ display: flex;
789
+ min-width: 0;
790
+ flex-direction: column;
791
+ justify-content: center;
792
+ }
793
+
794
+ .toastify-title {
795
+ overflow: hidden;
796
+ text-overflow: ellipsis;
797
+ white-space: nowrap;
798
+ font-size: 13px;
799
+ font-weight: 500;
800
+ line-height: 16px;
801
+ color: #171717;
802
+ }
803
+
804
+ .toastify-toaster.dark .toastify-title,
805
+ [data-theme="dark"] .toastify-title,
806
+ .dark .toastify-title {
807
+ color: #f5f5f5;
808
+ }
809
+
810
+ .toastify-description {
811
+ margin-top: 2px;
812
+ overflow: hidden;
813
+ text-overflow: ellipsis;
814
+ white-space: nowrap;
815
+ font-size: 12px;
816
+ line-height: 16px;
817
+ color: #737373;
818
+ }
819
+
820
+ .toastify-toaster.dark .toastify-description,
821
+ [data-theme="dark"] .toastify-description,
822
+ .dark .toastify-description {
823
+ color: #a3a3a3;
824
+ }
825
+
826
+ /* Action Area */
827
+ .toastify-actions {
828
+ display: flex;
829
+ flex-shrink: 0;
830
+ align-items: center;
831
+ gap: 8px;
832
+ }
833
+
834
+ .toastify-btn-cancel {
835
+ cursor: pointer;
836
+ border: none;
837
+ background: transparent;
838
+ border-radius: 4px;
839
+ padding: 4px 8px;
840
+ font-size: 12px;
841
+ font-weight: 500;
842
+ color: #525252;
843
+ transition: background-color 0.15s, color 0.15s;
844
+ }
845
+
846
+ .toastify-btn-cancel:hover {
847
+ background-color: #f5f5f5;
848
+ color: #171717;
849
+ }
850
+
851
+ .toastify-toaster.dark .toastify-btn-cancel,
852
+ [data-theme="dark"] .toastify-btn-cancel,
853
+ .dark .toastify-btn-cancel {
854
+ color: #a3a3a3;
855
+ }
856
+
857
+ .toastify-toaster.dark .toastify-btn-cancel:hover,
858
+ [data-theme="dark"] .toastify-btn-cancel:hover,
859
+ .dark .toastify-btn-cancel:hover {
860
+ background-color: #262626;
861
+ color: #f5f5f5;
862
+ }
863
+
864
+ .toastify-btn-action {
865
+ cursor: pointer;
866
+ border: none;
867
+ border-radius: 4px;
868
+ padding: 4px 10px;
869
+ font-size: 12px;
870
+ font-weight: 500;
871
+ background-color: #171717;
872
+ color: #ffffff;
873
+ transition: background-color 0.15s, box-shadow 0.15s;
874
+ box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.5), 0 1px 2px rgba(0, 0, 0, 0.08);
875
+ }
876
+
877
+ .toastify-btn-action:hover {
878
+ background-color: #262626;
879
+ }
880
+
881
+ .toastify-btn-action:active {
882
+ box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
883
+ }
884
+
885
+ .toastify-toaster.dark .toastify-btn-action,
886
+ [data-theme="dark"] .toastify-btn-action,
887
+ .dark .toastify-btn-action {
888
+ background-color: #f5f5f5;
889
+ color: #171717;
890
+ box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.22), 0 1px 2px rgba(0, 0, 0, 0.15);
891
+ }
892
+
893
+ .toastify-toaster.dark .toastify-btn-action:hover,
894
+ [data-theme="dark"] .toastify-btn-action:hover,
895
+ .dark .toastify-btn-action:hover {
896
+ background-color: #e5e5e5;
897
+ }
898
+
899
+ .toastify-toaster.dark .toastify-btn-action:active,
900
+ [data-theme="dark"] .toastify-btn-action:active,
901
+ .dark .toastify-btn-action:active {
902
+ box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.25);
903
+ }
904
+ `;
555
905
  var positionClasses = {
556
- "top-left": "top-6 left-6",
557
- "top-center": "top-6 left-0 right-0 mx-auto",
558
- "top-right": "top-6 right-6",
559
- "bottom-left": "bottom-6 left-6",
560
- "bottom-center": "bottom-6 left-0 right-0 mx-auto",
561
- "bottom-right": "bottom-6 right-6"
906
+ "top-left": "toastify-pos-top-left top-6 left-6",
907
+ "top-center": "toastify-pos-top-center top-6 left-0 right-0 mx-auto",
908
+ "top-right": "toastify-pos-top-right top-6 right-6",
909
+ "bottom-left": "toastify-pos-bottom-left bottom-6 left-6",
910
+ "bottom-center": "toastify-pos-bottom-center bottom-6 left-0 right-0 mx-auto",
911
+ "bottom-right": "toastify-pos-bottom-right bottom-6 right-6"
562
912
  };
563
913
  function ToasterItem({
564
914
  toast: toast2,
@@ -606,7 +956,7 @@ function ToasterItem({
606
956
  }
607
957
  };
608
958
  }, [isHovered, itemDuration]);
609
- return /* @__PURE__ */ jsx6(
959
+ return /* @__PURE__ */ jsx(
610
960
  ToastAnimation,
611
961
  {
612
962
  animation,
@@ -618,7 +968,7 @@ function ToasterItem({
618
968
  isDismissing,
619
969
  onDismiss: handleDismiss,
620
970
  springConfig,
621
- children: /* @__PURE__ */ jsx6(
971
+ children: /* @__PURE__ */ jsx(
622
972
  Toast,
623
973
  {
624
974
  toast: toast2,
@@ -643,6 +993,7 @@ function Toaster({
643
993
  animation = "stack",
644
994
  springConfig,
645
995
  icons,
996
+ unstyled = false,
646
997
  toastOptions
647
998
  }) {
648
999
  const [toasts2, setToasts] = useState([]);
@@ -676,67 +1027,65 @@ function Toaster({
676
1027
  }
677
1028
  };
678
1029
  }, []);
679
- return /* @__PURE__ */ jsx6(
680
- motion4.div,
681
- {
682
- "data-toastify-toaster": "true",
683
- role: "region",
684
- "aria-label": "Notifications",
685
- "aria-live": "polite",
686
- tabIndex: -1,
687
- className: `toastify-toaster fixed z-50 w-[356px] max-w-[calc(100vw-32px)] ${hasToasts ? "pointer-events-auto" : "pointer-events-none"} ${positionClasses[position]} ${theme === "dark" ? "dark" : ""} ${className ?? ""}`,
688
- style,
689
- animate: {
690
- height: containerHeight
691
- },
692
- transition: {
693
- type: "spring",
694
- stiffness: 220,
695
- damping: 26,
696
- mass: 1,
697
- ...springConfig
698
- },
699
- onMouseEnter: handleMouseEnter,
700
- onMouseLeave: handleMouseLeave,
701
- children: /* @__PURE__ */ jsx6(
702
- "div",
703
- {
704
- className: `relative w-full h-full flex ${isTop ? "flex-col" : "flex-col-reverse"}`,
705
- children: /* @__PURE__ */ jsx6(AnimatePresence, { children: toasts2.slice(0, visibleToasts).map((toastItem, index) => /* @__PURE__ */ jsx6(
706
- ToasterItem,
707
- {
708
- toast: toastItem,
709
- index,
710
- totalToasts: toasts2.length,
711
- isHovered,
712
- position,
713
- duration,
714
- autoClose,
715
- closeOnClick,
716
- animation,
717
- springConfig,
718
- icons,
719
- toastOptions,
720
- onDismiss: () => toastStore.remove(toastItem.id)
721
- },
722
- toastItem.id
723
- )) })
724
- }
725
- )
726
- }
727
- );
1030
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
1031
+ !unstyled && /* @__PURE__ */ jsx(
1032
+ "style",
1033
+ {
1034
+ "data-toastify-styles": "",
1035
+ dangerouslySetInnerHTML: { __html: toastifyStyles }
1036
+ }
1037
+ ),
1038
+ /* @__PURE__ */ jsx(
1039
+ motion.div,
1040
+ {
1041
+ "data-toastify-toaster": "true",
1042
+ role: "region",
1043
+ "aria-label": "Notifications",
1044
+ "aria-live": "polite",
1045
+ tabIndex: -1,
1046
+ className: `toastify-toaster fixed z-50 w-[356px] max-w-[calc(100vw-32px)] ${hasToasts ? "toastify-pointer-auto pointer-events-auto" : "toastify-pointer-none pointer-events-none"} ${positionClasses[position]} ${theme === "dark" ? "dark" : theme === "system" ? "system" : ""} ${className ?? ""}`,
1047
+ style,
1048
+ animate: {
1049
+ height: containerHeight
1050
+ },
1051
+ transition: {
1052
+ type: "spring",
1053
+ stiffness: 220,
1054
+ damping: 26,
1055
+ mass: 1,
1056
+ ...springConfig
1057
+ },
1058
+ onMouseEnter: handleMouseEnter,
1059
+ onMouseLeave: handleMouseLeave,
1060
+ children: /* @__PURE__ */ jsx(
1061
+ "div",
1062
+ {
1063
+ className: `toastify-list relative w-full h-full flex ${isTop ? "toastify-list-col flex-col" : "toastify-list-col-reverse flex-col-reverse"}`,
1064
+ children: /* @__PURE__ */ jsx(AnimatePresence, { children: toasts2.slice(0, visibleToasts).map((toastItem, index) => /* @__PURE__ */ jsx(
1065
+ ToasterItem,
1066
+ {
1067
+ toast: toastItem,
1068
+ index,
1069
+ totalToasts: toasts2.length,
1070
+ isHovered,
1071
+ position,
1072
+ duration,
1073
+ autoClose,
1074
+ closeOnClick,
1075
+ animation,
1076
+ springConfig,
1077
+ icons,
1078
+ toastOptions,
1079
+ onDismiss: () => toastStore.remove(toastItem.id)
1080
+ },
1081
+ toastItem.id
1082
+ )) })
1083
+ }
1084
+ )
1085
+ }
1086
+ )
1087
+ ] });
728
1088
  }
729
1089
  var ToastContainer = Toaster;
730
- export {
731
- DefaultToastIcon,
732
- FadeAnimation,
733
- FolderStackAnimation,
734
- SlideAnimation,
735
- Toast,
736
- ToastAnimation,
737
- ToastContainer,
738
- Toaster,
739
- defaultSpring,
740
- toast,
741
- toastStore
742
- };
1090
+
1091
+ export { DefaultToastIcon, FadeAnimation, FolderStackAnimation, SlideAnimation, Toast, ToastAnimation, ToastContainer, Toaster, defaultSpring, toast, toastStore, toastifyStyles };