forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobals.css
More file actions
433 lines (401 loc) · 15.2 KB
/
Copy pathglobals.css
File metadata and controls
433 lines (401 loc) · 15.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
@import "tailwindcss" prefix(cpk);
@plugin "@tailwindcss/typography";
@source "../**/*.{ts,tsx}";
@source "../../../../node_modules/streamdown/dist/index.js";
@import "tw-animate-css";
@custom-variant dark (&:is(.dark *));
[data-copilotkit] {
--background: oklch(1 0 0);
--foreground: oklch(0.145 0 0);
--card: oklch(1 0 0);
--card-foreground: oklch(0.145 0 0);
--popover: oklch(1 0 0);
--popover-foreground: oklch(0.145 0 0);
--primary: oklch(0.205 0 0);
--primary-foreground: oklch(0.985 0 0);
--secondary: oklch(0.97 0 0);
--secondary-foreground: oklch(0.205 0 0);
--muted: oklch(0.97 0 0);
--muted-foreground: oklch(0.556 0 0);
--accent: oklch(0.97 0 0);
--accent-foreground: oklch(0.205 0 0);
--destructive: oklch(0.577 0.245 27.325);
--destructive-foreground: oklch(0.577 0.245 27.325);
--border: oklch(0.922 0 0);
--input: oklch(0.922 0 0);
--ring: oklch(0.708 0 0);
--chart-1: oklch(0.646 0.222 41.116);
--chart-2: oklch(0.6 0.118 184.704);
--chart-3: oklch(0.398 0.07 227.392);
--chart-4: oklch(0.828 0.189 84.429);
--chart-5: oklch(0.769 0.188 70.08);
--radius: 0.625rem;
--sidebar: oklch(0.985 0 0);
--sidebar-foreground: oklch(0.145 0 0);
--sidebar-primary: oklch(0.205 0 0);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.97 0 0);
--sidebar-accent-foreground: oklch(0.205 0 0);
--sidebar-border: oklch(0.922 0 0);
--sidebar-ring: oklch(0.708 0 0);
}
.dark [data-copilotkit],
[data-copilotkit].dark {
--background: oklch(0.145 0 0);
--foreground: oklch(0.985 0 0);
--card: oklch(0.145 0 0);
--card-foreground: oklch(0.985 0 0);
--popover: oklch(0.145 0 0);
--popover-foreground: oklch(0.985 0 0);
--primary: oklch(0.985 0 0);
--primary-foreground: oklch(0.205 0 0);
--secondary: oklch(0.269 0 0);
--secondary-foreground: oklch(0.985 0 0);
--muted: oklch(0.269 0 0);
--muted-foreground: oklch(0.708 0 0);
--accent: oklch(0.269 0 0);
--accent-foreground: oklch(0.985 0 0);
--destructive: oklch(0.396 0.141 25.723);
--destructive-foreground: oklch(0.637 0.237 25.331);
--border: oklch(0.269 0 0);
--input: oklch(0.269 0 0);
--ring: oklch(0.556 0 0);
--chart-1: oklch(0.488 0.243 264.376);
--chart-2: oklch(0.696 0.17 162.48);
--chart-3: oklch(0.769 0.188 70.08);
--chart-4: oklch(0.627 0.265 303.9);
--chart-5: oklch(0.645 0.246 16.439);
--sidebar: oklch(0.205 0 0);
--sidebar-foreground: oklch(0.985 0 0);
--sidebar-primary: oklch(0.488 0.243 264.376);
--sidebar-primary-foreground: oklch(0.985 0 0);
--sidebar-accent: oklch(0.269 0 0);
--sidebar-accent-foreground: oklch(0.985 0 0);
--sidebar-border: oklch(0.269 0 0);
--sidebar-ring: oklch(0.439 0 0);
}
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-card: var(--card);
--color-card-foreground: var(--card-foreground);
--color-popover: var(--popover);
--color-popover-foreground: var(--popover-foreground);
--color-primary: var(--primary);
--color-primary-foreground: var(--primary-foreground);
--color-secondary: var(--secondary);
--color-secondary-foreground: var(--secondary-foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);
--color-accent: var(--accent);
--color-accent-foreground: var(--accent-foreground);
--color-destructive: var(--destructive);
--color-destructive-foreground: var(--destructive-foreground);
--color-border: var(--border);
--color-input: var(--input);
--color-ring: var(--ring);
--color-chart-1: var(--chart-1);
--color-chart-2: var(--chart-2);
--color-chart-3: var(--chart-3);
--color-chart-4: var(--chart-4);
--color-chart-5: var(--chart-5);
--radius-sm: calc(var(--radius) - 4px);
--radius-md: calc(var(--radius) - 2px);
--radius-lg: var(--radius);
--radius-xl: calc(var(--radius) + 4px);
--color-sidebar: var(--sidebar);
--color-sidebar-foreground: var(--sidebar-foreground);
--color-sidebar-primary: var(--sidebar-primary);
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
--color-sidebar-accent: var(--sidebar-accent);
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
--color-sidebar-border: var(--sidebar-border);
--color-sidebar-ring: var(--sidebar-ring);
}
@theme {
--animate-pulse-cursor: pulse-cursor 0.9s cubic-bezier(0.4, 0, 0.2, 1)
infinite;
@keyframes pulse-cursor {
0%,
100% {
transform: scale(1);
opacity: 1;
}
50% {
transform: scale(1.5);
opacity: 0.8;
}
}
}
@layer base {
* {
@apply cpk:border-border cpk:outline-ring/50;
}
/* Apply foreground/background on CopilotKit roots (replaces body rule) */
[data-copilotkit] {
color: var(--foreground);
background-color: var(--background);
}
/* Mobile viewport support */
@supports (height: 100dvh) {
[data-copilot-sidebar] {
height: 100dvh;
}
}
/* Responsive sidebar width */
@media (min-width: 768px) {
[data-copilot-sidebar] {
width: var(--sidebar-width, 480px) !important;
}
}
/* Mobile optimizations */
@media (max-width: 767px) {
[data-copilot-sidebar] {
width: 100% !important;
}
/* Improve touch scrolling on iOS */
[data-copilot-sidebar] {
-webkit-overflow-scrolling: touch;
}
/* Better scrolling performance */
[data-sidebar-chat] {
touch-action: pan-y;
}
}
}
[data-copilotkit] div[data-streamdown="code-block"] > pre {
@apply cpk:mt-0 cpk:mb-0;
}
/* Minimal scrollbar for WebKit browsers (Chrome, Safari, Edge) */
[data-copilotkit] ::-webkit-scrollbar {
width: 6px;
}
[data-copilotkit] ::-webkit-scrollbar-track {
background: transparent;
}
[data-copilotkit] ::-webkit-scrollbar-thumb {
background: oklch(0.5 0 0);
border-radius: 9999px;
}
[data-copilotkit] ::-webkit-scrollbar-thumb:hover {
background: oklch(0.4 0 0);
}
/* Firefox */
[data-copilotkit] * {
scrollbar-width: thin;
scrollbar-color: oklch(0.5 0 0) transparent;
}
[data-copilotkit] .prose input[type="checkbox"] {
appearance: none;
background-color: #fff;
background-origin: border-box;
border-color: #9b9b9b;
border-width: 1px;
color: #004f99;
display: inline-block;
flex-shrink: 0;
height: 1rem;
padding: 0;
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
-webkit-user-select: none;
user-select: none;
vertical-align: middle;
width: 1rem;
border-radius: 2px;
}
[data-copilotkit] .prose input[type="checkbox"]:checked {
background-color: #004f99;
border-color: #004f99;
background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg viewBox='0 0 16 16' fill='%23fff' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2-2a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E");
background-position: center;
background-repeat: no-repeat;
background-size: 100% 100%;
}
/*
* IntelligenceIndicator — single-element, three-stage design.
*
* Layers (always in the DOM, always at full opacity for layout
* purposes — only individual properties animate):
*
* • `__chrome` — the glassmorphism pill (bg, border, shadow,
* backdrop-blur). Absolute-positioned behind the
* content. Visible while in-progress; fades to 0
* once the icon morph completes.
* • `__content` — icon + label flex row. Stays in place across
* the whole transition. Only its `color` alpha
* drops on settle (0.92 → 0.55).
* • `__icon-path` — single SVG path whose `d` morphs between a
* 270° arc and a checkmark. Both shapes share the
* same 3-segment cubic Bézier topology, which is
* what makes the d interpolate cleanly. The "spin"
* is a marching-dash animation on the stroke, not
* an SVG rotation — so there is no rotation state
* to snap back to identity when the animation is
* removed at status flip.
*
* Stage timing (hard sequence — stage 2 waits for stage 1):
* • Stage 1, icon morph: 0 → 250 ms.
* - d interpolates arc → check
* - stroke-dasharray transitions dashed → solid
* - marching-dash animation is removed (`animation: none`)
* • Stage 2, settle: 250 → 650 ms (transition-delay 250 ms).
* - chrome opacity 1 → 0
* - content color alpha 0.92 → 0.55
*
* Total ~650 ms in production. No moment exists where the icon or
* label is invisible, so the eye never sees a "bump."
*
* Mount-already-finished is handled implicitly: CSS transitions
* don't fire when the target value is the computed value at first
* paint, so a historical-replay turn renders directly in its
* settled state with no animation — which is the desired behavior.
*/
.cpk-intelligence-indicator {
position: relative;
display: inline-flex;
align-items: center;
gap: 0.55rem;
padding: 0.4rem 0.85rem;
/* Opt out of the parent flex-column's default `align-items: stretch`
(the auto-mount lives inside `CopilotChatMessageView`'s
`cpk:flex cpk:flex-col` container). Without this the indicator
would stretch to the full chat width. */
align-self: flex-start;
margin: 0.4rem 0;
white-space: nowrap;
}
/* ─── Chrome layer (bg, border, shadow, backdrop-blur) ──────────────── */
.cpk-intelligence-indicator__chrome {
position: absolute;
inset: 0;
border-radius: 999px;
border: 1px solid rgb(149 153 224 / 0.32);
background: linear-gradient(
135deg,
rgb(255 255 255 / 0.55) 0%,
rgb(238 230 254 / 0.55) 100%
);
-webkit-backdrop-filter: blur(14px) saturate(160%);
backdrop-filter: blur(14px) saturate(160%);
box-shadow:
0 1px 2px rgb(94 100 173 / 0.06),
0 8px 24px rgb(149 153 224 / 0.08),
inset 0 1px 0 rgb(255 255 255 / 0.6);
opacity: 1;
pointer-events: none;
/* Stage 2 — wait 250 ms for the icon morph to complete, then fade. */
transition: opacity 400ms ease-out 250ms;
}
.cpk-intelligence-indicator[data-status="finished"]
.cpk-intelligence-indicator__chrome {
opacity: 0;
}
/* ─── Content layer (icon + label) ──────────────────────────────────── */
.cpk-intelligence-indicator__content {
position: relative;
display: inline-flex;
align-items: center;
gap: 0.55rem;
/* `color` drives both the label text and the icon stroke (which uses
`currentColor`). In-progress is a saturated purple at high alpha
(the active "this is happening now" state); finished transitions
all the way to a neutral slate gray (settled metadata — "a tool
call happened here"). The hue shift, not just an alpha drop, is
what makes the finished state read as a different semantic class
of content rather than just a dimmed version of the active one. */
color: rgb(91 33 182 / 0.92);
font-size: 0.78rem;
font-weight: 500;
letter-spacing: 0.01em;
/* Stage 2 — same 250 ms delay as the chrome fade so they settle in
lock-step. */
transition: color 400ms ease-out 250ms;
}
.cpk-intelligence-indicator[data-status="finished"]
.cpk-intelligence-indicator__content {
/* True-neutral gray (`#737373`, R=G=B) at 0.8 alpha. No hue cast in
either direction (slate would lean blue, stone would lean warm).
The combination of pure-neutral hue + slight transparency reads
as "settled history metadata" without competing with the active
state for attention. */
color: rgb(115 115 115 / 0.8);
}
/* Label — slants on settle to read as italic-like history metadata.
`transform: skewX()` is used instead of `font-style: italic` because:
(a) font-style is a discrete property, so it would snap rather than
transition smoothly with the color shift; (b) real italic glyphs
are slightly wider than upright, causing a layout pop at the snap
moment. A CSS transform applies after layout — no reflow — and
interpolates over the same 400 ms / 250 ms-delay window as the
color, so the slant and the color settle as one motion. For the
sans-serif system fonts used by default, the browser-synthesized
italic is itself a slant on the upright forms, so this approach
matches what `font-style: italic` would have rendered anyway. */
.cpk-intelligence-indicator__label {
display: inline-block;
transform: skewX(0deg);
transition: transform 400ms ease-out 250ms;
}
.cpk-intelligence-indicator[data-status="finished"]
.cpk-intelligence-indicator__label {
transform: skewX(-10deg);
}
.cpk-intelligence-indicator__icon {
display: block;
flex-shrink: 0;
/* The whole SVG rotates while in-progress; the dash pattern on the
path inside is static, so what the viewer sees is one continuous
arc rotating around the SVG's visual center. Rotation is removed
on status flip — the snap back to identity is masked by the
simultaneous d-morph (the shape is changing so rapidly the eye
does not register the angle reset). */
transform-origin: 7px 7px;
animation: cpk-intelligence-spin 0.9s linear infinite;
}
.cpk-intelligence-indicator[data-status="finished"]
.cpk-intelligence-indicator__icon {
animation: none;
}
/* ─── Icon path — d-morph + dashed-to-solid stroke ──────────────────── */
.cpk-intelligence-indicator__icon-path {
fill: none;
stroke: currentColor;
stroke-width: 2.5;
stroke-linecap: round;
stroke-linejoin: round;
/* In-progress shape: a 270° arc (3 cubic Béziers approximating three
quarter-circles, top → right → bottom → left). The fourth quarter
is the visible "gap" in the loader. */
d: path("M 12 3 C 17 3 21 7 21 12 C 21 17 17 21 12 21 C 7 21 3 17 3 12");
/* One continuous arc + one gap, summing to roughly the path length
(~42 units). The static dash pattern shows as a single C-shape
stroke; the rotation on the SVG above makes that C appear to
spin around the center. */
stroke-dasharray: 30 14;
/* Stage 1 — d and stroke-dasharray both interpolate over 250 ms with
the same eased curve so the morph reads as one motion. */
transition:
d 250ms cubic-bezier(0.4, 0, 0.2, 1),
stroke-dasharray 250ms cubic-bezier(0.4, 0, 0.2, 1);
}
.cpk-intelligence-indicator[data-status="finished"]
.cpk-intelligence-indicator__icon-path {
/* Finished shape: a checkmark expressed as 3 cubic Béziers with
collinear control points (so each segment renders as a straight
line). Three segments instead of the natural two so the topology
matches the 270° arc above and the d morph interpolates cleanly. */
d: path(
"M 5 12.5 C 6.33 13.83 7.67 15.17 9 16.5 C 10.67 14.83 12.33 13.17 14 11.5 C 15.67 9.83 17.33 8.17 19 6.5"
);
/* Large first value, zero gap = solid stroke. Interpolates from
`30 14` over 250 ms in lock-step with the d morph, filling in
the gap that was the spinner's "open" portion. */
stroke-dasharray: 100 0;
}
/* ─── Keyframes ─────────────────────────────────────────────────────── */
@keyframes cpk-intelligence-spin {
to {
transform: rotate(360deg);
}
}