@cossistant/next 0.0.5 → 0.0.6

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cossistant/next",
3
3
  "type": "module",
4
- "version": "0.0.5",
4
+ "version": "0.0.6",
5
5
  "private": false,
6
6
  "author": "Cossistant team",
7
7
  "description": "Next.js-ready SDK for building AI-powered support/chat widgets. Hooks + primitives, WS-driven, TypeScript-first. Next.js-ready, Tailwind optional.",
@@ -56,6 +56,7 @@
56
56
  "import": "./hooks/*.js"
57
57
  },
58
58
  "./support.css": "./support.css",
59
+ "./tailwind.css": "./support.css",
59
60
  "./realtime": {
60
61
  "types": "./realtime/index.d.ts",
61
62
  "import": "./realtime/index.js"
package/tailwind.css ADDED
@@ -0,0 +1,404 @@
1
+ @custom-variant dark (&:is(.dark *));
2
+
3
+ @layer base {
4
+ .cossistant {
5
+ @apply border-co-border;
6
+ @apply scroll-smooth;
7
+
8
+ color-scheme: inherit;
9
+
10
+ /* Typeface tokens */
11
+ --co-font-sans: var(
12
+ --co-theme-font-sans,
13
+ var(--font-sans, "Geist", "Inter", sans-serif)
14
+ );
15
+ --co-font-mono: var(
16
+ --co-theme-font-mono,
17
+ var(--font-mono, "Geist Mono", "Inter Mono", monospace)
18
+ );
19
+
20
+ --co-border-color: var(
21
+ --co-theme-border-color,
22
+ var(--color-border, oklch(92.2% 0 0))
23
+ );
24
+
25
+ /* Core surfaces */
26
+ --co-radius: var(--co-theme-radius, var(--radius, 0.625rem));
27
+ --co-background-base: var(
28
+ --co-theme-background,
29
+ var(--background, oklch(99% 0 0))
30
+ );
31
+ --co-foreground-base: var(
32
+ --co-theme-foreground,
33
+ var(--foreground, oklch(14.5% 0 0))
34
+ );
35
+ --co-popover-base: var(
36
+ --co-theme-popover,
37
+ var(--popover, var(--co-background-base))
38
+ );
39
+ --co-popover-foreground-base: var(
40
+ --co-theme-popover-foreground,
41
+ var(--popover-foreground, var(--co-foreground-base))
42
+ );
43
+ --co-primary-base: var(
44
+ --co-theme-primary,
45
+ var(--primary, oklch(20.5% 0 0))
46
+ );
47
+ --co-primary-foreground-base: var(
48
+ --co-theme-primary-foreground,
49
+ var(--primary-foreground, oklch(98.5% 0 0))
50
+ );
51
+ --co-secondary-base: var(
52
+ --co-theme-secondary,
53
+ var(--secondary, oklch(97% 0 0))
54
+ );
55
+ --co-secondary-foreground-base: var(
56
+ --co-theme-secondary-foreground,
57
+ var(--secondary-foreground, oklch(20.5% 0 0))
58
+ );
59
+ --co-border-base: var(--co-theme-border, var(--border, oklch(92.2% 0 0)));
60
+ --co-input-base: var(--co-theme-input, var(--input, oklch(92.2% 0 0)));
61
+ --co-ring-base: var(--co-theme-ring, var(--ring, var(--co-primary-base)));
62
+ --co-accent-base: var(
63
+ --co-theme-accent,
64
+ var(--accent, var(--co-primary-base))
65
+ );
66
+ --co-accent-foreground-base: var(
67
+ --co-theme-accent-foreground,
68
+ var(--accent-foreground, var(--co-primary-foreground-base))
69
+ );
70
+
71
+ /* Neutral shades derived from the background */
72
+ --co-background-50-mix: color-mix(
73
+ in oklch,
74
+ var(--co-background-base) 98%,
75
+ var(--co-foreground-base)
76
+ );
77
+ --co-background-100-mix: color-mix(
78
+ in oklch,
79
+ var(--co-background-base) 97%,
80
+ var(--co-foreground-base)
81
+ );
82
+ --co-background-200-mix: color-mix(
83
+ in oklch,
84
+ var(--co-background-base) 96%,
85
+ var(--co-foreground-base)
86
+ );
87
+ --co-background-300-mix: color-mix(
88
+ in oklch,
89
+ var(--co-background-base) 95%,
90
+ var(--co-foreground-base)
91
+ );
92
+ --co-background-400-mix: color-mix(
93
+ in oklch,
94
+ var(--co-background-base) 94%,
95
+ var(--co-foreground-base)
96
+ );
97
+ --co-background-500-mix: color-mix(
98
+ in oklch,
99
+ var(--co-background-base) 93%,
100
+ var(--co-foreground-base)
101
+ );
102
+ --co-background-600-mix: color-mix(
103
+ in oklch,
104
+ var(--co-background-base) 92%,
105
+ var(--co-foreground-base)
106
+ );
107
+
108
+ /* Muted tones */
109
+ --co-muted-mix: color-mix(
110
+ in oklch,
111
+ var(--co-background-base) 85%,
112
+ var(--co-foreground-base)
113
+ );
114
+ --co-muted-foreground-mix: color-mix(
115
+ in oklch,
116
+ var(--co-foreground-base) 70%,
117
+ white
118
+ );
119
+
120
+ /* Public tokens consumed by Tailwind theme */
121
+ --co-background: var(--co-background-base);
122
+ --co-background-50: var(
123
+ --co-theme-background-50,
124
+ var(--co-background-50-mix, oklch(92% 0 0))
125
+ );
126
+ --co-background-100: var(
127
+ --co-theme-background-100,
128
+ var(--co-background-100-mix, oklch(93% 0 0))
129
+ );
130
+ --co-background-200: var(
131
+ --co-theme-background-200,
132
+ var(--co-background-200-mix, oklch(94% 0 0))
133
+ );
134
+ --co-background-300: var(
135
+ --co-theme-background-300,
136
+ var(--co-background-300-mix, oklch(95% 0 0))
137
+ );
138
+ --co-background-400: var(
139
+ --co-theme-background-400,
140
+ var(--co-background-400-mix, oklch(96% 0 0))
141
+ );
142
+ --co-background-500: var(
143
+ --co-theme-background-500,
144
+ var(--co-background-500-mix, oklch(97% 0 0))
145
+ );
146
+ --co-background-600: var(
147
+ --co-theme-background-600,
148
+ var(--co-background-600-mix, oklch(98% 0 0))
149
+ );
150
+
151
+ --co-foreground: var(--co-foreground-base);
152
+ --co-popover: var(--co-popover-base);
153
+ --co-popover-foreground: var(--co-popover-foreground-base);
154
+ --co-primary: var(--co-primary-base);
155
+ --co-primary-foreground: var(--co-primary-foreground-base);
156
+ --co-secondary: var(--co-secondary-base);
157
+ --co-secondary-foreground: var(--co-secondary-foreground-base);
158
+ --co-muted: var(
159
+ --co-theme-muted,
160
+ var(--muted, var(--co-muted-mix, oklch(97% 0 0)))
161
+ );
162
+ --co-muted-foreground: var(
163
+ --co-theme-muted-foreground,
164
+ var(--muted-foreground, var(--co-muted-foreground-mix, oklch(55.6% 0 0)))
165
+ );
166
+ --co-border: var(--co-border-base);
167
+ --co-input: var(--co-input-base);
168
+ --co-ring: var(--co-ring-base);
169
+ --co-accent: var(--co-accent-base);
170
+ --co-accent-foreground: var(--co-accent-foreground-base);
171
+
172
+ /* Accent palette */
173
+ --co-pink: var(--co-theme-pink, oklch(76.3% 0.152 354));
174
+ --co-yellow: var(--co-theme-yellow, oklch(86.4% 0.144 99));
175
+ --co-blue: var(--co-theme-blue, oklch(72.5% 0.132 241));
176
+ --co-orange: var(--co-theme-orange, oklch(74.5% 0.166 50));
177
+
178
+ /* Status colors */
179
+ --co-destructive: var(--co-theme-destructive, oklch(57.7% 0.245 27.325));
180
+ --co-destructive-foreground: var(
181
+ --co-theme-destructive-foreground,
182
+ oklch(57.7% 0.245 27.325)
183
+ );
184
+ --co-success: var(--co-theme-success, oklch(71.7% 0.18 142));
185
+ --co-success-foreground: var(
186
+ --co-theme-success-foreground,
187
+ oklch(26.5% 0.052 142.7)
188
+ );
189
+ --co-neutral: var(--co-theme-neutral, oklch(60.8% 0 0));
190
+ --co-neutral-foreground: var(
191
+ --co-theme-neutral-foreground,
192
+ oklch(25.6% 0 0)
193
+ );
194
+ --co-warning: var(--co-theme-warning, oklch(86.4% 0.144 99));
195
+ --co-warning-foreground: var(
196
+ --co-theme-warning-foreground,
197
+ oklch(41.4% 0.071 99)
198
+ );
199
+ }
200
+
201
+ .dark .cossistant,
202
+ .cossistant[data-color-scheme="dark"] {
203
+ /* Provide dark defaults without overriding host tokens */
204
+ --co-background-base: var(
205
+ --co-theme-background,
206
+ var(--background, oklch(15.5% 0 0))
207
+ );
208
+ --co-foreground-base: var(
209
+ --co-theme-foreground,
210
+ var(--foreground, oklch(98.5% 0 0))
211
+ );
212
+ --co-border-color: var(
213
+ --co-theme-border-color,
214
+ var(--color-border, oklch(26.9% 0 0))
215
+ );
216
+ --co-popover-base: var(
217
+ --co-theme-popover,
218
+ var(--popover, oklch(14.5% 0 0))
219
+ );
220
+ --co-popover-foreground-base: var(
221
+ --co-theme-popover-foreground,
222
+ var(--popover-foreground, oklch(98.5% 0 0))
223
+ );
224
+ --co-primary-base: var(
225
+ --co-theme-primary,
226
+ var(--primary, oklch(98.5% 0 0))
227
+ );
228
+ --co-primary-foreground-base: var(
229
+ --co-theme-primary-foreground,
230
+ var(--primary-foreground, oklch(20.5% 0 0))
231
+ );
232
+ --co-secondary-base: var(
233
+ --co-theme-secondary,
234
+ var(--secondary, oklch(26.9% 0 0))
235
+ );
236
+ --co-secondary-foreground-base: var(
237
+ --co-theme-secondary-foreground,
238
+ var(--secondary-foreground, oklch(98.5% 0 0))
239
+ );
240
+ --co-border-base: var(--co-theme-border, var(--border, oklch(26.9% 0 0)));
241
+ --co-input-base: var(--co-theme-input, var(--input, oklch(26.9% 0 0)));
242
+ --co-ring-base: var(--co-theme-ring, var(--ring, var(--co-primary-base)));
243
+ --co-accent-base: var(
244
+ --co-theme-accent,
245
+ var(--accent, var(--co-primary-base))
246
+ );
247
+ --co-accent-foreground-base: var(
248
+ --co-theme-accent-foreground,
249
+ var(--accent-foreground, var(--co-primary-foreground-base))
250
+ );
251
+
252
+ --co-muted-mix: color-mix(
253
+ in oklch,
254
+ var(--co-background-base) 55%,
255
+ var(--co-foreground-base)
256
+ );
257
+ --co-muted-foreground-mix: color-mix(
258
+ in oklch,
259
+ var(--co-foreground-base) 65%,
260
+ white
261
+ );
262
+
263
+ --co-background-50-mix: color-mix(
264
+ in oklch,
265
+ var(--co-background-base) 98%,
266
+ var(--co-foreground-base)
267
+ );
268
+ --co-background-100-mix: color-mix(
269
+ in oklch,
270
+ var(--co-background-base) 96%,
271
+ var(--co-foreground-base)
272
+ );
273
+ --co-background-200-mix: color-mix(
274
+ in oklch,
275
+ var(--co-background-base) 94%,
276
+ var(--co-foreground-base)
277
+ );
278
+ --co-background-300-mix: color-mix(
279
+ in oklch,
280
+ var(--co-background-base) 92%,
281
+ var(--co-foreground-base)
282
+ );
283
+ --co-background-400-mix: color-mix(
284
+ in oklch,
285
+ var(--co-background-base) 90%,
286
+ var(--co-foreground-base)
287
+ );
288
+ --co-background-500-mix: color-mix(
289
+ in oklch,
290
+ var(--co-background-base) 88%,
291
+ var(--co-foreground-base)
292
+ );
293
+ --co-background-600-mix: color-mix(
294
+ in oklch,
295
+ var(--co-background-base) 86%,
296
+ var(--co-foreground-base)
297
+ );
298
+
299
+ --co-pink: var(--co-theme-pink, oklch(84.2% 0.109 354));
300
+ --co-yellow: var(--co-theme-yellow, oklch(90.3% 0.111 99));
301
+ --co-blue: var(--co-theme-blue, oklch(79.8% 0.089 241));
302
+ --co-orange: var(--co-theme-orange, oklch(68.2% 0.194 50));
303
+
304
+ --co-destructive: var(--co-theme-destructive, oklch(39.6% 0.141 25.723));
305
+ --co-destructive-foreground: var(
306
+ --co-theme-destructive-foreground,
307
+ oklch(63.7% 0.237 25.331)
308
+ );
309
+ --co-success: var(--co-theme-success, oklch(60% 0.15 142));
310
+ --co-success-foreground: var(
311
+ --co-theme-success-foreground,
312
+ oklch(85% 0.12 142)
313
+ );
314
+ --co-neutral: var(--co-theme-neutral, oklch(50% 0 0));
315
+ --co-neutral-foreground: var(--co-theme-neutral-foreground, oklch(85% 0 0));
316
+ --co-warning: var(--co-theme-warning, oklch(90.3% 0.111 99));
317
+ --co-warning-foreground: var(
318
+ --co-theme-warning-foreground,
319
+ oklch(85% 0.1 99)
320
+ );
321
+ }
322
+ }
323
+
324
+ @theme inline {
325
+ --font-co-sans: var(--co-font-sans);
326
+ --font-co-mono: var(--co-font-mono);
327
+ --color-co-background: var(--co-background);
328
+ --color-co-background-50: var(--co-background-50);
329
+ --color-co-background-100: var(--co-background-100);
330
+ --color-co-background-200: var(--co-background-200);
331
+ --color-co-background-300: var(--co-background-300);
332
+ --color-co-background-400: var(--co-background-400);
333
+ --color-co-background-500: var(--co-background-500);
334
+ --color-co-background-600: var(--co-background-600);
335
+
336
+ --color-co-foreground: var(--co-foreground);
337
+
338
+ --color-co-primary: var(--co-primary);
339
+ --color-co-primary-foreground: var(--co-primary-foreground);
340
+ --color-co-secondary: var(--co-secondary);
341
+ --color-co-secondary-foreground: var(--co-secondary-foreground);
342
+ --color-co-muted: var(--co-muted);
343
+ --color-co-muted-foreground: var(--co-muted-foreground);
344
+ --color-co-border: var(--co-border);
345
+ --color-co-input: var(--co-input);
346
+ --color-co-ring: var(--co-ring);
347
+ --radius-co: var(--co-radius);
348
+
349
+ /* custom colors */
350
+ --color-co-pink: var(--co-pink);
351
+ --color-co-yellow: var(--co-yellow);
352
+ --color-co-blue: var(--co-blue);
353
+ --color-co-orange: var(--co-orange);
354
+
355
+ /* status colors */
356
+ --color-co-destructive: var(--co-destructive);
357
+ --color-co-destructive-foreground: var(--co-destructive-foreground);
358
+ --color-co-success: var(--co-success);
359
+ --color-co-success-foreground: var(--co-success-foreground);
360
+ --color-co-neutral: var(--co-neutral);
361
+ --color-co-neutral-foreground: var(--co-neutral-foreground);
362
+ --color-co-warning: var(--co-warning);
363
+ --color-co-warning-foreground: var(--co-warning-foreground);
364
+ }
365
+
366
+ @layer utilities {
367
+ .cossistant {
368
+ .animation-delay-0 {
369
+ animation-delay: 0ms;
370
+ }
371
+ .animation-delay-200 {
372
+ animation-delay: 200ms;
373
+ }
374
+ .animation-delay-400 {
375
+ animation-delay: 400ms;
376
+ }
377
+
378
+ @keyframes bounce-dot {
379
+ 0%,
380
+ 80%,
381
+ 100% {
382
+ transform: translateY(0);
383
+ }
384
+ 40% {
385
+ transform: translateY(-6px);
386
+ }
387
+ }
388
+
389
+ .dot-bounce-1 {
390
+ animation: bounce-dot 1.4s infinite;
391
+ animation-delay: 0s;
392
+ }
393
+
394
+ .dot-bounce-2 {
395
+ animation: bounce-dot 1.4s infinite;
396
+ animation-delay: 0.16s;
397
+ }
398
+
399
+ .dot-bounce-3 {
400
+ animation: bounce-dot 1.4s infinite;
401
+ animation-delay: 0.32s;
402
+ }
403
+ }
404
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"use-conversation-timeline-items.d.ts","names":[],"sources":["../../react/src/hooks/use-conversation-timeline-items.ts"],"sourcesContent":[],"mappings":";;AA4BY,KARA,mCAAA,GAQkC;EAC7C,KAAA,CAAA,EAAA,MAAA;EAEQ,MAAA,CAAA,EAAA,MAAA,GAAA,IAAA;EAEM,OAAA,CAAA,EAAA,OAAA;EAAL,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EACK,oBAAA,CAAA,EAAA,OAAA;CAAR;AAEJ,KARS,kCAAA,GACX,8BAOE,GAAA;EADoB,SAAA,EAAA,OAAA;EAAO,KAAA,EAJrB,KAIqB,GAAA,IAAA;EASd,OAAA,EAAA,CAAA,IAEN,CAFM,EAXN,IAWM,CAXD,mCAaL,EAAA,QAAA,GAAA,OAAA,CAAA,EAAA,GAZH,OAaJ,CAbY,oCAasB,GAAA,SAAA,CAAA;uBAZd,QACpB;;;;;;iBAQa,4BAAA,sDAEN,sCACP"}
1
+ {"version":3,"file":"use-conversation-timeline-items.d.ts","names":[],"sources":["../../react/src/hooks/use-conversation-timeline-items.ts"],"sourcesContent":[],"mappings":";;AA4BY,KARA,mCAAA,GAQkC;EAC7C,KAAA,CAAA,EAAA,MAAA;EAEQ,MAAA,CAAA,EAAA,MAAA,GAAA,IAAA;EAEM,OAAA,CAAA,EAAA,OAAA;EAAL,eAAA,CAAA,EAAA,MAAA,GAAA,KAAA;EACK,oBAAA,CAAA,EAAA,OAAA;CAAR;AAEJ,KARS,kCAAA,GACX,8BAOE,GAAA;EADoB,SAAA,EAAA,OAAA;EAAO,KAAA,EAJrB,KAIqB,GAAA,IAAA;EASd,OAAA,EAAA,CAAA,IAEN,CAFM,EAXN,IAWM,CAXD,mCAaL,EAAA,QAAA,GAAA,OAAA,CAAA,EACP,GAbI,OAaJ,CAbY,oCAasB,GAAA,SAAA,CAAA;uBAZd,QACpB;;;;;;iBAQa,4BAAA,sDAEN,sCACP"}
@@ -1 +1 @@
1
- {"version":3,"file":"use-rest-client.d.ts","names":[],"sources":["../../react/src/hooks/private/use-rest-client.ts"],"sourcesContent":[],"mappings":";AAMY,KAAA,eAAA,GAAe;EAWX,MAAA,EAVP,gBAUgB;SATjB;;;;;;;;iBASQ,SAAA,kEAIb"}
1
+ {"version":3,"file":"use-rest-client.d.ts","names":[],"sources":["../../react/src/hooks/private/use-rest-client.ts"],"sourcesContent":[],"mappings":";AAMY,KAAA,eAAA,GAAe;EAWX,MAAA,EAVP,gBAcN;SAbK;;;;;;;;iBASQ,SAAA,kEAIb"}