@aktarulrahul/floater-chatbot 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/README.md CHANGED
@@ -29,7 +29,7 @@ yarn add @aktarulrahul/floater-chatbot
29
29
  ```tsx
30
30
  import React from "react";
31
31
  import { ChatWidget } from "@aktarulrahul/floater-chatbot";
32
- import "@aktarulrahul/floater-chatbot/dist/index.css"; // If CSS is bundled separately
32
+ import "@aktarulrahul/floater-chatbot/dist/index.css"; // Import bundled CSS
33
33
 
34
34
  function App() {
35
35
  return (
@@ -0,0 +1,336 @@
1
+ .chat-widget-container {
2
+ position: fixed;
3
+ z-index: 9999;
4
+ font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen",
5
+ "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue",
6
+ sans-serif;
7
+ font-size: 14px;
8
+ }
9
+
10
+ /* Position variants */
11
+ .chat-widget-bottom-right {
12
+ bottom: 20px;
13
+ right: 20px;
14
+ }
15
+
16
+ .chat-widget-bottom-left {
17
+ bottom: 20px;
18
+ left: 20px;
19
+ }
20
+
21
+ .chat-widget-top-right {
22
+ top: 20px;
23
+ right: 20px;
24
+ }
25
+
26
+ .chat-widget-top-left {
27
+ top: 20px;
28
+ left: 20px;
29
+ }
30
+
31
+ /* Chat Button */
32
+ .chat-widget-button {
33
+ width: 60px;
34
+ height: 60px;
35
+ border-radius: 50%;
36
+ border: none;
37
+ color: white;
38
+ cursor: pointer;
39
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
40
+ display: flex;
41
+ align-items: center;
42
+ justify-content: center;
43
+ transition: transform 0.2s, box-shadow 0.2s;
44
+ }
45
+
46
+ .chat-widget-button:hover {
47
+ transform: scale(1.05);
48
+ box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
49
+ }
50
+
51
+ .chat-widget-button:active {
52
+ transform: scale(0.95);
53
+ }
54
+
55
+ /* Chat Window */
56
+ .chat-widget-window {
57
+ width: 380px;
58
+ height: 600px;
59
+ background: white;
60
+ border-radius: 12px;
61
+ box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
62
+ display: flex;
63
+ flex-direction: column;
64
+ overflow: hidden;
65
+ animation: slideUp 0.3s ease-out;
66
+ }
67
+
68
+ @keyframes slideUp {
69
+ from {
70
+ opacity: 0;
71
+ transform: translateY(20px);
72
+ }
73
+ to {
74
+ opacity: 1;
75
+ transform: translateY(0);
76
+ }
77
+ }
78
+
79
+ /* Header */
80
+ .chat-widget-header {
81
+ padding: 16px 20px;
82
+ color: white;
83
+ display: flex;
84
+ align-items: center;
85
+ justify-content: space-between;
86
+ flex-shrink: 0;
87
+ }
88
+
89
+ .chat-widget-header-content {
90
+ display: flex;
91
+ align-items: center;
92
+ gap: 12px;
93
+ flex: 1;
94
+ }
95
+
96
+ .chat-widget-avatar {
97
+ width: 40px;
98
+ height: 40px;
99
+ border-radius: 50%;
100
+ object-fit: cover;
101
+ }
102
+
103
+ .chat-widget-header-text {
104
+ flex: 1;
105
+ }
106
+
107
+ .chat-widget-title {
108
+ font-weight: 600;
109
+ font-size: 16px;
110
+ margin-bottom: 2px;
111
+ }
112
+
113
+ .chat-widget-subtitle {
114
+ font-size: 12px;
115
+ opacity: 0.9;
116
+ }
117
+
118
+ .chat-widget-close {
119
+ background: rgba(255, 255, 255, 0.2);
120
+ border: none;
121
+ color: white;
122
+ width: 32px;
123
+ height: 32px;
124
+ border-radius: 50%;
125
+ cursor: pointer;
126
+ display: flex;
127
+ align-items: center;
128
+ justify-content: center;
129
+ transition: background 0.2s;
130
+ }
131
+
132
+ .chat-widget-close:hover {
133
+ background: rgba(255, 255, 255, 0.3);
134
+ }
135
+
136
+ /* Messages */
137
+ .chat-widget-messages {
138
+ flex: 1;
139
+ overflow-y: auto;
140
+ padding: 20px;
141
+ display: flex;
142
+ flex-direction: column;
143
+ gap: 12px;
144
+ background: #f8f9fa;
145
+ }
146
+
147
+ .chat-widget-empty {
148
+ display: flex;
149
+ align-items: center;
150
+ justify-content: center;
151
+ height: 100%;
152
+ color: #6c757d;
153
+ text-align: center;
154
+ }
155
+
156
+ .chat-widget-message {
157
+ display: flex;
158
+ gap: 8px;
159
+ align-items: flex-start;
160
+ max-width: 80%;
161
+ }
162
+
163
+ .chat-widget-message-user {
164
+ align-self: flex-end;
165
+ flex-direction: row-reverse;
166
+ margin-left: auto;
167
+ }
168
+
169
+ .chat-widget-message-bot {
170
+ align-self: flex-start;
171
+ }
172
+
173
+ .chat-widget-message-avatar {
174
+ width: 32px;
175
+ height: 32px;
176
+ border-radius: 50%;
177
+ object-fit: cover;
178
+ flex-shrink: 0;
179
+ }
180
+
181
+ .chat-widget-message-content {
182
+ display: flex;
183
+ flex-direction: column;
184
+ gap: 4px;
185
+ }
186
+
187
+ .chat-widget-message-user .chat-widget-message-content {
188
+ align-items: flex-end;
189
+ }
190
+
191
+ .chat-widget-message-bot .chat-widget-message-content {
192
+ align-items: flex-start;
193
+ }
194
+
195
+ .chat-widget-message-text {
196
+ padding: 10px 14px;
197
+ border-radius: 18px;
198
+ word-wrap: break-word;
199
+ line-height: 1.4;
200
+ }
201
+
202
+ .chat-widget-message-user .chat-widget-message-text {
203
+ background: #007bff;
204
+ color: white;
205
+ border-bottom-right-radius: 4px;
206
+ }
207
+
208
+ .chat-widget-message-bot .chat-widget-message-text {
209
+ background: white;
210
+ color: #333;
211
+ border-bottom-left-radius: 4px;
212
+ box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
213
+ }
214
+
215
+ .chat-widget-message-time {
216
+ font-size: 11px;
217
+ color: #6c757d;
218
+ padding: 0 4px;
219
+ }
220
+
221
+ .chat-widget-typing {
222
+ display: flex;
223
+ gap: 4px;
224
+ padding: 10px 14px;
225
+ background: white;
226
+ border-radius: 18px;
227
+ border-bottom-left-radius: 4px;
228
+ }
229
+
230
+ .chat-widget-typing span {
231
+ width: 8px;
232
+ height: 8px;
233
+ border-radius: 50%;
234
+ background: #6c757d;
235
+ animation: typing 1.4s infinite;
236
+ }
237
+
238
+ .chat-widget-typing span:nth-child(2) {
239
+ animation-delay: 0.2s;
240
+ }
241
+
242
+ .chat-widget-typing span:nth-child(3) {
243
+ animation-delay: 0.4s;
244
+ }
245
+
246
+ @keyframes typing {
247
+ 0%,
248
+ 60%,
249
+ 100% {
250
+ transform: translateY(0);
251
+ opacity: 0.7;
252
+ }
253
+ 30% {
254
+ transform: translateY(-10px);
255
+ opacity: 1;
256
+ }
257
+ }
258
+
259
+ /* Input */
260
+ .chat-widget-input-container {
261
+ padding: 16px;
262
+ background: white;
263
+ border-top: 1px solid #e9ecef;
264
+ display: flex;
265
+ gap: 8px;
266
+ flex-shrink: 0;
267
+ }
268
+
269
+ .chat-widget-input {
270
+ flex: 1;
271
+ padding: 10px 14px;
272
+ border: 1px solid #e9ecef;
273
+ border-radius: 20px;
274
+ outline: none;
275
+ font-size: 14px;
276
+ transition: border-color 0.2s;
277
+ }
278
+
279
+ .chat-widget-input:focus {
280
+ border-color: #007bff;
281
+ }
282
+
283
+ .chat-widget-input:disabled {
284
+ background: #f8f9fa;
285
+ cursor: not-allowed;
286
+ }
287
+
288
+ .chat-widget-send {
289
+ width: 40px;
290
+ height: 40px;
291
+ border-radius: 50%;
292
+ border: none;
293
+ color: white;
294
+ cursor: pointer;
295
+ display: flex;
296
+ align-items: center;
297
+ justify-content: center;
298
+ transition: transform 0.2s, opacity 0.2s;
299
+ flex-shrink: 0;
300
+ }
301
+
302
+ .chat-widget-send:hover:not(:disabled) {
303
+ transform: scale(1.05);
304
+ }
305
+
306
+ .chat-widget-send:disabled {
307
+ opacity: 0.5;
308
+ cursor: not-allowed;
309
+ }
310
+
311
+ /* Scrollbar */
312
+ .chat-widget-messages::-webkit-scrollbar {
313
+ width: 6px;
314
+ }
315
+
316
+ .chat-widget-messages::-webkit-scrollbar-track {
317
+ background: transparent;
318
+ }
319
+
320
+ .chat-widget-messages::-webkit-scrollbar-thumb {
321
+ background: #ced4da;
322
+ border-radius: 3px;
323
+ }
324
+
325
+ .chat-widget-messages::-webkit-scrollbar-thumb:hover {
326
+ background: #adb5bd;
327
+ }
328
+
329
+ /* Responsive */
330
+ @media (max-width: 480px) {
331
+ .chat-widget-window {
332
+ width: calc(100vw - 40px);
333
+ height: calc(100vh - 40px);
334
+ max-height: 600px;
335
+ }
336
+ }