ghonchu_rag 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
@@ -8,6 +8,15 @@ A themeable chatbot widget for frontend integration.
8
8
  npm install ghonchu_rag
9
9
  ```
10
10
 
11
+
12
+ ## Styling
13
+
14
+ **Important:** You must import the CSS file for the widget to appear correctly.
15
+
16
+ ```javascript
17
+ import 'ghonchu_rag/dist/styles.css';
18
+ ```
19
+
11
20
  ## Usage
12
21
 
13
22
  ### React
@@ -0,0 +1,419 @@
1
+ /* ===============================
2
+ ROOT VARIABLES
3
+ =============================== */
4
+ :root {
5
+ --ghonchu-bg-start: rgb(20, 15, 10);
6
+ --ghonchu-bg-end: rgb(40, 25, 15);
7
+ --ghonchu-amber-950: #451a03;
8
+ --ghonchu-orange-900: #7c2d12;
9
+ --ghonchu-yellow-900: #713f12;
10
+ --ghonchu-amber-400: #fbbf24;
11
+ --ghonchu-amber-300: #fcd34d;
12
+ --ghonchu-amber-200: #fde68a;
13
+ --ghonchu-amber-600: #d97706;
14
+ --ghonchu-orange-600: #ea580c;
15
+ --ghonchu-glass: rgba(254, 243, 199, 0.1);
16
+ --ghonchu-glass-border: rgba(254, 243, 199, 0.2);
17
+ --ghonchu-glow: var(--ghonchu-amber-400);
18
+ }
19
+
20
+ /* ===============================
21
+ ROOT
22
+ =============================== */
23
+ #ghonchu-widget-root {
24
+ position: fixed;
25
+ bottom: 20px;
26
+ right: 20px;
27
+ z-index: 9999;
28
+ font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
29
+ }
30
+
31
+ /* ===============================
32
+ LAUNCHER
33
+ =============================== */
34
+ .ghonchu-launcher {
35
+ width: 60px;
36
+ height: 60px;
37
+ border-radius: 50%;
38
+ background: linear-gradient(to right, var(--ghonchu-amber-600), var(--ghonchu-orange-600));
39
+ display: flex;
40
+ align-items: center;
41
+ justify-content: center;
42
+ cursor: pointer;
43
+ animation: pulseGlow 2s infinite alternate;
44
+ }
45
+
46
+ @keyframes pulseGlow {
47
+ from {
48
+ box-shadow: 0 0 10px var(--ghonchu-glow);
49
+ }
50
+
51
+ to {
52
+ box-shadow: 0 0 30px var(--ghonchu-glow);
53
+ }
54
+ }
55
+
56
+ /* ===============================
57
+ THEME OVERRIDES
58
+ =============================== */
59
+ .ghonchu-theme-default {
60
+ --ghonchu-glow: #fbbf24;
61
+ }
62
+
63
+ .ghonchu-theme-cyberpunk {
64
+ --ghonchu-glow: #00ffff;
65
+ }
66
+
67
+ .ghonchu-theme-professional {
68
+ --ghonchu-glow: #2563eb;
69
+ }
70
+
71
+ /* ===============================
72
+ CHAT WINDOW
73
+ =============================== */
74
+ .ghonchu-chat-window {
75
+ width: 380px;
76
+ height: 550px;
77
+ max-height: 85vh;
78
+ background: linear-gradient(135deg, var(--ghonchu-amber-950), var(--ghonchu-orange-900), var(--ghonchu-yellow-900));
79
+ border-radius: 20px;
80
+ display: flex;
81
+ flex-direction: column;
82
+ overflow: hidden;
83
+ border: 1px solid var(--ghonchu-glass-border);
84
+ transform-origin: bottom right;
85
+ animation: openChat .25s ease;
86
+ }
87
+
88
+ .ghonchu-chat-window.closing {
89
+ animation: closeChat .2s ease forwards;
90
+ }
91
+
92
+ @keyframes openChat {
93
+ from {
94
+ opacity: 0;
95
+ transform: scale(.8) translateY(20px)
96
+ }
97
+ }
98
+
99
+ @keyframes closeChat {
100
+ to {
101
+ opacity: 0;
102
+ transform: scale(.8) translateY(20px)
103
+ }
104
+ }
105
+
106
+ /* ===============================
107
+ HEADER
108
+ =============================== */
109
+ .ghonchu-header {
110
+ padding: 16px;
111
+ background: var(--ghonchu-glass);
112
+ backdrop-filter: blur(12px);
113
+ }
114
+
115
+ .ghonchu-title {
116
+ font-weight: 700;
117
+ background: linear-gradient(to right, var(--ghonchu-amber-400), var(--ghonchu-orange-600));
118
+ -webkit-background-clip: text;
119
+ -webkit-text-fill-color: transparent;
120
+ }
121
+
122
+ .ghonchu-controls button {
123
+ opacity: 0.8;
124
+ transition: opacity 0.2s;
125
+ color: var(--ghonchu-amber-400);
126
+ }
127
+
128
+ .ghonchu-controls button:hover {
129
+ opacity: 1;
130
+ transform: scale(1.1);
131
+ }
132
+
133
+ .ghonchu-status {
134
+ font-size: 0.9em;
135
+ color: var(--ghonchu-amber-200);
136
+ opacity: 0.9;
137
+ }
138
+
139
+ /* Scrollbar for history */
140
+ .ghonchu-history-view::-webkit-scrollbar {
141
+ width: 6px;
142
+ }
143
+
144
+ .ghonchu-history-view::-webkit-scrollbar-thumb {
145
+ background: var(--ghonchu-amber-600);
146
+ border-radius: 4px;
147
+ }
148
+
149
+ .ghonchu-status {
150
+ font-size: 0.9em;
151
+ color: var(--ghonchu-amber-200);
152
+ opacity: 0.9;
153
+ }
154
+
155
+ /* ===============================
156
+ MESSAGES
157
+ =============================== */
158
+ .ghonchu-messages {
159
+ flex: 1;
160
+ padding: 16px;
161
+ overflow-y: auto;
162
+ display: flex;
163
+ flex-direction: column;
164
+ gap: 12px;
165
+ scroll-behavior: smooth;
166
+ align-items: flex-start;
167
+ }
168
+
169
+ /* ===============================
170
+ ROW
171
+ =============================== */
172
+ .ghonchu-message-wrapper {
173
+ display: flex;
174
+ max-width: 100%;
175
+ }
176
+
177
+ .msg-user-wrapper {
178
+ align-self: flex-end;
179
+ justify-content: flex-end;
180
+ }
181
+
182
+ .msg-bot-wrapper {
183
+ align-self: flex-start;
184
+ justify-content: flex-start;
185
+ }
186
+
187
+ /* ===============================
188
+ BUBBLES
189
+ =============================== */
190
+ .msg-user,
191
+ .msg-bot {
192
+ width: fit-content;
193
+ max-width: 75%;
194
+ border-radius: 16px;
195
+ flex: 0 0 auto;
196
+ }
197
+
198
+ .msg-bot {
199
+ background: var(--ghonchu-glass);
200
+ border: 1px solid var(--ghonchu-glass-border);
201
+ color: white;
202
+ }
203
+
204
+ .msg-user {
205
+ background: linear-gradient(to right, rgba(217, 119, 6, .2), rgba(234, 88, 12, .2));
206
+ border: 1px solid rgba(251, 191, 36, .3);
207
+ color: white;
208
+ }
209
+
210
+ /* ===============================
211
+ INNER MESSAGE
212
+ =============================== */
213
+ .ghonchu-message {
214
+ padding: 12px 16px;
215
+ width: fit-content;
216
+ flex: 0 0 auto;
217
+ animation: messagePop .2s ease;
218
+ }
219
+
220
+ @keyframes messagePop {
221
+ from {
222
+ opacity: 0;
223
+ transform: scale(.95)
224
+ }
225
+ }
226
+
227
+ /* ===============================
228
+ MARKDOWN SUPPORT
229
+ =============================== */
230
+ .ghonchu-message h1,
231
+ .ghonchu-message h2,
232
+ .ghonchu-message h3 {
233
+ margin: 6px 0;
234
+ color: var(--ghonchu-amber-200);
235
+ }
236
+
237
+ .ghonchu-message p {
238
+ margin: 4px 0;
239
+ }
240
+
241
+ .ghonchu-message strong {
242
+ color: var(--ghonchu-amber-400);
243
+ }
244
+
245
+ .ghonchu-message ul,
246
+ .ghonchu-message ol {
247
+ padding-left: 18px;
248
+ margin: 4px 0;
249
+ }
250
+
251
+ .ghonchu-message li {
252
+ margin: 2px 0;
253
+ }
254
+
255
+ .ghonchu-message code {
256
+ background: rgba(0, 0, 0, .3);
257
+ padding: 2px 6px;
258
+ border-radius: 6px;
259
+ font-family: monospace;
260
+ }
261
+
262
+ .ghonchu-message pre {
263
+ background: #000;
264
+ padding: 10px;
265
+ border-radius: 8px;
266
+ overflow: auto;
267
+ margin: 8px 0;
268
+ }
269
+
270
+ .ghonchu-message a {
271
+ color: var(--ghonchu-amber-300);
272
+ text-decoration: underline;
273
+ }
274
+
275
+ /* ===============================
276
+ TYPING DOTS
277
+ =============================== */
278
+ .ghonchu-typing {
279
+ display: flex;
280
+ gap: 6px;
281
+ padding: 12px;
282
+ }
283
+
284
+ .ghonchu-typing span {
285
+ width: 6px;
286
+ height: 6px;
287
+ border-radius: 50%;
288
+ background: var(--ghonchu-amber-400);
289
+ animation: blink 1.4s infinite both;
290
+ }
291
+
292
+ .ghonchu-typing span:nth-child(2) {
293
+ animation-delay: .2s
294
+ }
295
+
296
+ .ghonchu-typing span:nth-child(3) {
297
+ animation-delay: .4s
298
+ }
299
+
300
+ @keyframes blink {
301
+ 0% {
302
+ opacity: .2
303
+ }
304
+
305
+ 20% {
306
+ opacity: 1
307
+ }
308
+
309
+ 100% {
310
+ opacity: .2
311
+ }
312
+ }
313
+
314
+ /* ===============================
315
+ INPUT
316
+ =============================== */
317
+ .ghonchu-input-area {
318
+ padding: 12px;
319
+ display: flex;
320
+ gap: 10px;
321
+ background: var(--ghonchu-glass);
322
+ }
323
+
324
+ .ghonchu-input-area input {
325
+ flex: 1;
326
+ background: rgba(255, 255, 255, .08);
327
+ border-radius: 12px;
328
+ border: 1px solid var(--ghonchu-glass-border);
329
+ color: white;
330
+ padding: 10px;
331
+ outline: none;
332
+ }
333
+
334
+ .ghonchu-input-area input:focus {
335
+ border-color: var(--ghonchu-amber-600);
336
+ }
337
+
338
+ .ghonchu-send {
339
+ width: 52px;
340
+ border-radius: 12px;
341
+ background: linear-gradient(to right, var(--ghonchu-amber-600), var(--ghonchu-orange-600));
342
+ border: none;
343
+ cursor: pointer;
344
+ display: flex;
345
+ align-items: center;
346
+ justify-content: center;
347
+ color: white;
348
+ }
349
+
350
+ .ghonchu-send:hover {
351
+ filter: brightness(1.1);
352
+ }
353
+
354
+ /* ===============================
355
+ MOBILE
356
+ =============================== */
357
+ @media (max-width:600px) {
358
+ .ghonchu-chat-window {
359
+ width: 100vw;
360
+ height: 100vh;
361
+ border-radius: 0;
362
+ max-height: none;
363
+ }
364
+
365
+ #ghonchu-widget-root {
366
+ inset: 0;
367
+ }
368
+ }
369
+
370
+ .msg-user-wrapper .ghonchu-avatar {
371
+ margin-left: 8px;
372
+ }
373
+
374
+ .msg-bot-wrapper .ghonchu-avatar {
375
+ margin-right: 8px;
376
+ }
377
+
378
+ /* ===============================
379
+ PROFESSIONAL THEME – CODE BLOCK POLISH
380
+ =============================== */
381
+
382
+ .ghonchu-theme-professional .ghonchu-message pre {
383
+ background: #0f172a;
384
+ /* soft slate */
385
+ color: #e5e7eb;
386
+ padding: 14px 16px;
387
+ border-radius: 12px;
388
+ font-size: 13px;
389
+ line-height: 1.6;
390
+ overflow-x: auto;
391
+ box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .05);
392
+ }
393
+
394
+ /* Remove weird inner background */
395
+ .ghonchu-theme-professional .ghonchu-message pre code {
396
+ background: transparent;
397
+ padding: 0;
398
+ color: inherit;
399
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
400
+ }
401
+
402
+ /* Inline code */
403
+ .ghonchu-theme-professional .ghonchu-message code:not(pre code) {
404
+ background: #e5e7eb;
405
+ color: #111827;
406
+ padding: 2px 6px;
407
+ border-radius: 6px;
408
+ font-size: 12px;
409
+ }
410
+
411
+ /* Softer scrollbar inside code */
412
+ .ghonchu-theme-professional .ghonchu-message pre::-webkit-scrollbar {
413
+ height: 6px;
414
+ }
415
+
416
+ .ghonchu-theme-professional .ghonchu-message pre::-webkit-scrollbar-thumb {
417
+ background: rgba(255, 255, 255, .25);
418
+ border-radius: 4px;
419
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ghonchu_rag",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "type": "module",
5
5
  "description": "A themeable chatbot widget for frontend integration.",
6
6
  "main": "dist/index.js",
@@ -9,7 +9,7 @@
9
9
  "dist"
10
10
  ],
11
11
  "scripts": {
12
- "build": "tsc",
12
+ "build": "tsc && copy src\\styles.css dist\\styles.css",
13
13
  "test": "echo \"Error: no test specified\" && exit 1"
14
14
  },
15
15
  "keywords": [