react-notify-lite 1.0.0 → 1.0.4
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/styles.css +235 -0
- package/package.json +4 -4
package/dist/styles.css
ADDED
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
/* Toast Container Positioning */
|
|
2
|
+
.toast-container {
|
|
3
|
+
position: fixed;
|
|
4
|
+
z-index: 9999;
|
|
5
|
+
pointer-events: none;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: 10px;
|
|
9
|
+
padding: 20px;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.toast-top-left {
|
|
13
|
+
top: 0;
|
|
14
|
+
left: 0;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.toast-top-right {
|
|
18
|
+
top: 0;
|
|
19
|
+
right: 0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.toast-top-center {
|
|
23
|
+
top: 0;
|
|
24
|
+
left: 50%;
|
|
25
|
+
transform: translateX(-50%);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.toast-bottom-left {
|
|
29
|
+
bottom: 0;
|
|
30
|
+
left: 0;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.toast-bottom-right {
|
|
34
|
+
bottom: 0;
|
|
35
|
+
right: 0;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.toast-bottom-center {
|
|
39
|
+
bottom: 0;
|
|
40
|
+
left: 50%;
|
|
41
|
+
transform: translateX(-50%);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/* Toast Base Styles */
|
|
45
|
+
.toast {
|
|
46
|
+
pointer-events: auto;
|
|
47
|
+
min-width: 300px;
|
|
48
|
+
max-width: 500px;
|
|
49
|
+
padding: 16px;
|
|
50
|
+
border-radius: 8px;
|
|
51
|
+
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
|
|
52
|
+
background: white;
|
|
53
|
+
border-left: 4px solid;
|
|
54
|
+
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
|
|
55
|
+
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
|
|
56
|
+
sans-serif;
|
|
57
|
+
transition: all 0.3s ease;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/* Toast Type Colors */
|
|
61
|
+
.toast-success {
|
|
62
|
+
border-left-color: #10b981;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.toast-error {
|
|
66
|
+
border-left-color: #ef4444;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.toast-warning {
|
|
70
|
+
border-left-color: #f59e0b;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.toast-info {
|
|
74
|
+
border-left-color: #3b82f6;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/* Toast Content */
|
|
78
|
+
.toast-content {
|
|
79
|
+
display: flex;
|
|
80
|
+
align-items: center;
|
|
81
|
+
gap: 12px;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.toast-icon {
|
|
85
|
+
display: inline-flex;
|
|
86
|
+
align-items: center;
|
|
87
|
+
justify-content: center;
|
|
88
|
+
width: 24px;
|
|
89
|
+
height: 24px;
|
|
90
|
+
border-radius: 50%;
|
|
91
|
+
font-size: 14px;
|
|
92
|
+
font-weight: bold;
|
|
93
|
+
flex-shrink: 0;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.toast-success .toast-icon {
|
|
97
|
+
background-color: #10b981;
|
|
98
|
+
color: white;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.toast-error .toast-icon {
|
|
102
|
+
background-color: #ef4444;
|
|
103
|
+
color: white;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.toast-warning .toast-icon {
|
|
107
|
+
background-color: #f59e0b;
|
|
108
|
+
color: white;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.toast-info .toast-icon {
|
|
112
|
+
background-color: #3b82f6;
|
|
113
|
+
color: white;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.toast-message {
|
|
117
|
+
flex: 1;
|
|
118
|
+
color: #1f2937;
|
|
119
|
+
font-size: 14px;
|
|
120
|
+
line-height: 1.5;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.toast-close {
|
|
124
|
+
background: none;
|
|
125
|
+
border: none;
|
|
126
|
+
color: #6b7280;
|
|
127
|
+
font-size: 24px;
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
padding: 0;
|
|
130
|
+
width: 24px;
|
|
131
|
+
height: 24px;
|
|
132
|
+
display: flex;
|
|
133
|
+
align-items: center;
|
|
134
|
+
justify-content: center;
|
|
135
|
+
border-radius: 4px;
|
|
136
|
+
transition: all 0.2s ease;
|
|
137
|
+
flex-shrink: 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.toast-close:hover {
|
|
141
|
+
background-color: #f3f4f6;
|
|
142
|
+
color: #1f2937;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.toast-close:focus {
|
|
146
|
+
outline: none;
|
|
147
|
+
box-shadow: 0 0 0 2px #3b82f6;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/* Animations */
|
|
151
|
+
@keyframes slideInRight {
|
|
152
|
+
from {
|
|
153
|
+
transform: translateX(100%);
|
|
154
|
+
opacity: 0;
|
|
155
|
+
}
|
|
156
|
+
to {
|
|
157
|
+
transform: translateX(0);
|
|
158
|
+
opacity: 1;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
@keyframes slideInLeft {
|
|
163
|
+
from {
|
|
164
|
+
transform: translateX(-100%);
|
|
165
|
+
opacity: 0;
|
|
166
|
+
}
|
|
167
|
+
to {
|
|
168
|
+
transform: translateX(0);
|
|
169
|
+
opacity: 1;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
@keyframes slideInDown {
|
|
174
|
+
from {
|
|
175
|
+
transform: translateY(-100%);
|
|
176
|
+
opacity: 0;
|
|
177
|
+
}
|
|
178
|
+
to {
|
|
179
|
+
transform: translateY(0);
|
|
180
|
+
opacity: 1;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@keyframes slideInUp {
|
|
185
|
+
from {
|
|
186
|
+
transform: translateY(100%);
|
|
187
|
+
opacity: 0;
|
|
188
|
+
}
|
|
189
|
+
to {
|
|
190
|
+
transform: translateY(0);
|
|
191
|
+
opacity: 1;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
@keyframes fadeOut {
|
|
196
|
+
from {
|
|
197
|
+
opacity: 1;
|
|
198
|
+
}
|
|
199
|
+
to {
|
|
200
|
+
opacity: 0;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.toast-enter {
|
|
205
|
+
animation: slideInRight 0.3s ease;
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.toast-top-left .toast-enter,
|
|
209
|
+
.toast-bottom-left .toast-enter {
|
|
210
|
+
animation: slideInLeft 0.3s ease;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
.toast-top-center .toast-enter {
|
|
214
|
+
animation: slideInDown 0.3s ease;
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
.toast-bottom-center .toast-enter {
|
|
218
|
+
animation: slideInUp 0.3s ease;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
.toast-exit {
|
|
222
|
+
animation: fadeOut 0.3s ease;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
/* Responsive */
|
|
226
|
+
@media (max-width: 640px) {
|
|
227
|
+
.toast-container {
|
|
228
|
+
padding: 10px;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.toast {
|
|
232
|
+
min-width: 280px;
|
|
233
|
+
max-width: calc(100vw - 40px);
|
|
234
|
+
}
|
|
235
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-notify-lite",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"description": "A lightweight and customizable React notification library with TypeScript support. Features multiple notification types, 6 positioning options, auto-dismiss, and smooth animations.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.esm.js",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"LICENSE"
|
|
13
13
|
],
|
|
14
14
|
"scripts": {
|
|
15
|
-
"build": "rollup -c",
|
|
15
|
+
"build": "rollup -c && cp src/styles.css dist/styles.css",
|
|
16
16
|
"dev": "rollup -c -w",
|
|
17
17
|
"prepare": "npm run build",
|
|
18
18
|
"prepublishOnly": "npm run build"
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"author": "Harpinder Singh",
|
|
38
38
|
"license": "MIT",
|
|
39
39
|
"peerDependencies": {
|
|
40
|
-
"react": "
|
|
41
|
-
"react-dom": "
|
|
40
|
+
"react": ">=16.8.0",
|
|
41
|
+
"react-dom": ">=16.8.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@rollup/plugin-commonjs": "^25.0.7",
|