juice-toast 1.0.0 → 1.0.1

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/README.md CHANGED
@@ -30,7 +30,8 @@ import juiceToast from "./juice-toast.esm.js";
30
30
 
31
31
  ### UMD (Browser)
32
32
  ```html
33
- <script src="juice-toast.umd.js"></script>
33
+ <link rel="stylesheet" href="https://npdn.kyrt.my.id/npm/juice-toast@latest/dist/style.css />
34
+ <script src="https://npnd.kyrt.my.id/npm/juice-toast@latest/dist/juice-toast.umd.js"></script>
34
35
  <script>
35
36
  juiceToast.success("Hello world!");
36
37
  </script>
package/dist/style.css ADDED
@@ -0,0 +1,151 @@
1
+ #juice-toast-root {
2
+ position: fixed;
3
+ left: 50%;
4
+ bottom: 20px;
5
+ transform: translateX(-50%);
6
+ z-index: 9999;
7
+ pointer-events: none;
8
+ display: flex;
9
+ flex-direction: column;
10
+ align-items: center;
11
+ }
12
+
13
+ /* center position */
14
+ #juice-toast-root[data-position="center"] {
15
+ top: 50%;
16
+ bottom: auto;
17
+ transform: translate(-50%, -50%);
18
+ }
19
+
20
+ /* top position */
21
+ #juice-toast-root[data-position="top"] {
22
+ top: 20px;
23
+ bottom: auto;
24
+ transform: translateX(-50%);
25
+ }
26
+
27
+ .juice-toast {
28
+ pointer-events: auto;
29
+ display: flex;
30
+ gap: 12px;
31
+ align-items: flex-start;
32
+ min-width: 220px;
33
+ max-width: 420px;
34
+ padding: 12px 16px;
35
+ margin: 6px 0;
36
+ border-radius: 8px;
37
+ color: #fff;
38
+ font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
39
+ font-size: 14px;
40
+ background: #333;
41
+ opacity: 0;
42
+ transform: translateY(10px);
43
+ transition: opacity .25s ease, transform .25s ease, background .25s ease, color .25s ease, box-shadow .25s ease;
44
+ position: relative;
45
+ box-sizing: border-box;
46
+ overflow: hidden;
47
+ }
48
+
49
+ /* visible */
50
+ .juice-toast.show {
51
+ opacity: 1;
52
+ transform: translateY(0);
53
+ }
54
+
55
+ /* icon */
56
+ .juice-toast .icon {
57
+ width: 28px;
58
+ height: 28px;
59
+ display: inline-flex;
60
+ align-items: center;
61
+ justify-content: center;
62
+ font-size: 16px;
63
+ line-height: 1;
64
+ flex: 0 0 28px;
65
+ }
66
+
67
+ /* content */
68
+ .juice-toast .jt-content {
69
+ display: flex;
70
+ flex-direction: column;
71
+ gap: 4px;
72
+ flex: 1 1 auto;
73
+ }
74
+
75
+ /* title */
76
+ .juice-toast .jt-title {
77
+ font-weight: 700;
78
+ font-size: 13px;
79
+ line-height: 1;
80
+ }
81
+
82
+ /* message */
83
+ .juice-toast .jt-message {
84
+ font-weight: 400;
85
+ font-size: 13px;
86
+ line-height: 1.2;
87
+ opacity: 0.95;
88
+ }
89
+
90
+ /* close button */
91
+ .juice-toast-close {
92
+ position: absolute;
93
+ top: 6px;
94
+ right: 8px;
95
+ cursor: pointer;
96
+ font-size: 16px;
97
+ opacity: .75;
98
+ padding: 4px;
99
+ border-radius: 4px;
100
+ }
101
+ .juice-toast-close:hover { opacity: 1; background: rgba(255,255,255,0.06) }
102
+
103
+ /* small helper for stack center spacing */
104
+ #juice-toast-root > .juice-toast { transform-origin: center; }
105
+
106
+ .icon[data-position="top"] {
107
+ align-self: center;
108
+ margin-bottom: 6px;
109
+ }
110
+
111
+ /* CLICK FEEDBACK */
112
+ .icon-clickable {
113
+ opacity: 0.85;
114
+ }
115
+
116
+ .icon-clickable:hover {
117
+ opacity: 1;
118
+ }
119
+
120
+ /* ANIMATIONS */
121
+ @keyframes jt-spin {
122
+ to { transform: rotate(360deg); }
123
+ }
124
+
125
+ @keyframes jt-pulse {
126
+ 0% { transform: scale(1); }
127
+ 50% { transform: scale(1.2); }
128
+ 100% { transform: scale(1); }
129
+ }
130
+
131
+ @keyframes jt-shake {
132
+ 0% { transform: translateX(0); }
133
+ 25% { transform: translateX(-2px); }
134
+ 50% { transform: translateX(2px); }
135
+ 75% { transform: translateX(-2px); }
136
+ 100% { transform: translateX(0); }
137
+ }
138
+
139
+ .spin { animation: jt-spin .6s linear; }
140
+ .pulse { animation: jt-pulse .4s ease; }
141
+ .shake { animation: jt-shake .4s ease; }
142
+
143
+ @media (prefers-reduced-motion: reduce) {
144
+ .juice-toast,
145
+ .spin,
146
+ .pulse,
147
+ .shake {
148
+ animation: none !important;
149
+ transition: none !important;
150
+ }
151
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "juice-toast",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Lightweight, dependency-free toast notification library",
5
5
  "keywords": [
6
6
  "toast",