@mast-ai/react-ui 0.1.0

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.
@@ -0,0 +1,631 @@
1
+ /* @mast-ai/react-ui default stylesheet — import as '@mast-ai/react-ui/styles.css' */
2
+
3
+ /* -------------------------------------------------------------------------- */
4
+ /* Theme tokens */
5
+ /* -------------------------------------------------------------------------- */
6
+
7
+ [data-mast-root] {
8
+ /* Color */
9
+ --mast-bg: #ffffff;
10
+ --mast-bg-subtle: #f9fafb;
11
+ --mast-fg: #111827;
12
+ --mast-fg-muted: #6b7280;
13
+ --mast-border: #e5e7eb;
14
+ --mast-accent: #2563eb;
15
+ --mast-accent-fg: #ffffff;
16
+ --mast-thinking-bg: #fefce8;
17
+ --mast-thinking-fg: #854d0e;
18
+ --mast-tool-bg: #f0fdf4;
19
+ --mast-tool-fg: #166534;
20
+ --mast-tool-pending: #f59e0b;
21
+ --mast-tool-error-bg: #fef2f2;
22
+ --mast-tool-error-fg: #991b1b;
23
+ --mast-tool-cancelled-bg: #f3f4f6;
24
+ --mast-tool-cancelled-fg: #4b5563;
25
+ --mast-user-bubble: #dbeafe;
26
+ --mast-user-fg: #1e3a8a;
27
+ --mast-mention-chip-bg: #dbeafe;
28
+ --mast-mention-chip-fg: #1e3a8a;
29
+ --mast-mention-picker-bg: var(--mast-bg);
30
+ --mast-mention-picker-active-bg: var(--mast-bg-subtle);
31
+ --mast-mention-picker-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
32
+
33
+ /* Typography */
34
+ --mast-font: system-ui, sans-serif;
35
+ --mast-font-mono: ui-monospace, monospace;
36
+ --mast-text-sm: 0.875rem;
37
+ --mast-text-base: 1rem;
38
+
39
+ /* Spacing */
40
+ --mast-gap: 0.75rem;
41
+ --mast-radius: 0.5rem;
42
+ }
43
+
44
+ @media (prefers-color-scheme: dark) {
45
+ [data-mast-root]:not([data-mast-theme='light']) {
46
+ --mast-bg: #111827;
47
+ --mast-bg-subtle: #1f2937;
48
+ --mast-fg: #f9fafb;
49
+ --mast-fg-muted: #9ca3af;
50
+ --mast-border: #374151;
51
+ --mast-accent: #3b82f6;
52
+ --mast-accent-fg: #ffffff;
53
+ --mast-thinking-bg: #1c1917;
54
+ --mast-thinking-fg: #fcd34d;
55
+ --mast-tool-bg: #052e16;
56
+ --mast-tool-fg: #86efac;
57
+ --mast-tool-pending: #fbbf24;
58
+ --mast-tool-error-bg: #450a0a;
59
+ --mast-tool-error-fg: #fecaca;
60
+ --mast-tool-cancelled-bg: #1f2937;
61
+ --mast-tool-cancelled-fg: #d1d5db;
62
+ --mast-user-bubble: #1e3a8a;
63
+ --mast-user-fg: #bfdbfe;
64
+ --mast-mention-chip-bg: #1e3a8a;
65
+ --mast-mention-chip-fg: #bfdbfe;
66
+ --mast-mention-picker-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
67
+ }
68
+ }
69
+
70
+ [data-mast-root][data-mast-theme='dark'] {
71
+ --mast-bg: #111827;
72
+ --mast-bg-subtle: #1f2937;
73
+ --mast-fg: #f9fafb;
74
+ --mast-fg-muted: #9ca3af;
75
+ --mast-border: #374151;
76
+ --mast-accent: #3b82f6;
77
+ --mast-accent-fg: #ffffff;
78
+ --mast-thinking-bg: #1c1917;
79
+ --mast-thinking-fg: #fcd34d;
80
+ --mast-tool-bg: #052e16;
81
+ --mast-tool-fg: #86efac;
82
+ --mast-tool-pending: #fbbf24;
83
+ --mast-tool-error-bg: #450a0a;
84
+ --mast-tool-error-fg: #fecaca;
85
+ --mast-tool-cancelled-bg: #1f2937;
86
+ --mast-tool-cancelled-fg: #d1d5db;
87
+ --mast-user-bubble: #1e3a8a;
88
+ --mast-user-fg: #bfdbfe;
89
+ --mast-mention-chip-bg: #1e3a8a;
90
+ --mast-mention-chip-fg: #bfdbfe;
91
+ --mast-mention-picker-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
92
+ }
93
+
94
+ /* -------------------------------------------------------------------------- */
95
+ /* Utilities */
96
+ /* -------------------------------------------------------------------------- */
97
+
98
+ .mast-visually-hidden {
99
+ position: absolute;
100
+ width: 1px;
101
+ height: 1px;
102
+ padding: 0;
103
+ margin: -1px;
104
+ overflow: hidden;
105
+ clip: rect(0, 0, 0, 0);
106
+ white-space: nowrap;
107
+ border: 0;
108
+ }
109
+
110
+ @keyframes mast-spin {
111
+ from {
112
+ transform: rotate(0deg);
113
+ }
114
+ to {
115
+ transform: rotate(360deg);
116
+ }
117
+ }
118
+
119
+ .mast-spin {
120
+ animation: mast-spin 1s linear infinite;
121
+ }
122
+
123
+ @keyframes mast-pulse {
124
+ 0%,
125
+ 100% {
126
+ opacity: 1;
127
+ }
128
+ 50% {
129
+ opacity: 0.4;
130
+ }
131
+ }
132
+
133
+ /* -------------------------------------------------------------------------- */
134
+ /* ConversationPanel */
135
+ /* -------------------------------------------------------------------------- */
136
+
137
+ [data-mast-root] {
138
+ display: flex;
139
+ flex-direction: column;
140
+ gap: var(--mast-gap);
141
+ height: 100%;
142
+ min-height: 0;
143
+ background: var(--mast-bg);
144
+ color: var(--mast-fg);
145
+ font-family: var(--mast-font);
146
+ font-size: var(--mast-text-base);
147
+ border: 1px solid var(--mast-border);
148
+ border-radius: var(--mast-radius);
149
+ padding: var(--mast-gap);
150
+ box-sizing: border-box;
151
+ }
152
+
153
+ [data-mast-root] * {
154
+ box-sizing: border-box;
155
+ }
156
+
157
+ /* -------------------------------------------------------------------------- */
158
+ /* MessageList */
159
+ /* -------------------------------------------------------------------------- */
160
+
161
+ .mast-message-list {
162
+ flex: 1 1 auto;
163
+ min-height: 0;
164
+ overflow-y: auto;
165
+ padding: var(--mast-gap);
166
+ background: var(--mast-bg-subtle);
167
+ border-radius: var(--mast-radius);
168
+ }
169
+
170
+ /* -------------------------------------------------------------------------- */
171
+ /* UserMessage */
172
+ /* -------------------------------------------------------------------------- */
173
+
174
+ [data-mast-user-message] {
175
+ display: flex;
176
+ justify-content: flex-end;
177
+ margin-bottom: var(--mast-gap);
178
+ }
179
+
180
+ .mast-user-message-bubble {
181
+ background: var(--mast-user-bubble);
182
+ color: var(--mast-user-fg);
183
+ padding: 0.5rem 0.75rem;
184
+ border-radius: var(--mast-radius);
185
+ max-width: 80%;
186
+ white-space: pre-wrap;
187
+ word-wrap: break-word;
188
+ }
189
+
190
+ /* -------------------------------------------------------------------------- */
191
+ /* AssistantMessage */
192
+ /* -------------------------------------------------------------------------- */
193
+
194
+ [data-mast-assistant-message] {
195
+ display: flex;
196
+ flex-direction: column;
197
+ gap: var(--mast-gap);
198
+ margin-bottom: var(--mast-gap);
199
+ color: var(--mast-fg);
200
+ }
201
+
202
+ .mast-assistant-message-text {
203
+ margin: 0;
204
+ white-space: pre-wrap;
205
+ }
206
+
207
+ .mast-assistant-message-markdown {
208
+ line-height: 1.5;
209
+ }
210
+
211
+ .mast-assistant-message-markdown > :first-child {
212
+ margin-top: 0;
213
+ }
214
+
215
+ .mast-assistant-message-markdown > :last-child {
216
+ margin-bottom: 0;
217
+ }
218
+
219
+ .mast-assistant-message-markdown pre {
220
+ background: var(--mast-bg-subtle);
221
+ border: 1px solid var(--mast-border);
222
+ border-radius: var(--mast-radius);
223
+ padding: 0.5rem 0.75rem;
224
+ overflow-x: auto;
225
+ font-family: var(--mast-font-mono);
226
+ font-size: var(--mast-text-sm);
227
+ }
228
+
229
+ .mast-assistant-message-markdown code {
230
+ font-family: var(--mast-font-mono);
231
+ font-size: 0.9em;
232
+ }
233
+
234
+ .mast-assistant-message-markdown :not(pre) > code {
235
+ background: var(--mast-bg-subtle);
236
+ border: 1px solid var(--mast-border);
237
+ border-radius: 0.25rem;
238
+ padding: 0.05rem 0.3rem;
239
+ }
240
+
241
+ /* -------------------------------------------------------------------------- */
242
+ /* ThinkingBlock */
243
+ /* -------------------------------------------------------------------------- */
244
+
245
+ .mast-thinking-block {
246
+ background: var(--mast-thinking-bg);
247
+ color: var(--mast-thinking-fg);
248
+ border: 1px solid var(--mast-border);
249
+ border-radius: var(--mast-radius);
250
+ padding: 0.5rem 0.75rem;
251
+ font-size: var(--mast-text-sm);
252
+ }
253
+
254
+ .mast-thinking-block-summary {
255
+ display: flex;
256
+ align-items: center;
257
+ gap: 0.5rem;
258
+ cursor: pointer;
259
+ list-style: none;
260
+ user-select: none;
261
+ }
262
+
263
+ .mast-thinking-block-summary::-webkit-details-marker {
264
+ display: none;
265
+ }
266
+
267
+ .mast-thinking-block-icon {
268
+ display: inline-flex;
269
+ align-items: center;
270
+ }
271
+
272
+ .mast-thinking-block-label {
273
+ font-weight: 500;
274
+ }
275
+
276
+ .mast-thinking-block-pulse {
277
+ display: inline-block;
278
+ width: 0.5rem;
279
+ height: 0.5rem;
280
+ border-radius: 9999px;
281
+ background: currentColor;
282
+ animation: mast-pulse 1.2s ease-in-out infinite;
283
+ }
284
+
285
+ .mast-thinking-block-content {
286
+ margin-top: 0.5rem;
287
+ white-space: pre-wrap;
288
+ font-family: var(--mast-font-mono);
289
+ font-size: var(--mast-text-sm);
290
+ }
291
+
292
+ /* -------------------------------------------------------------------------- */
293
+ /* ToolCallBlock */
294
+ /* -------------------------------------------------------------------------- */
295
+
296
+ .mast-tool-call-block {
297
+ background: var(--mast-tool-bg);
298
+ color: var(--mast-tool-fg);
299
+ border: 1px solid var(--mast-border);
300
+ border-radius: var(--mast-radius);
301
+ padding: 0.5rem 0.75rem;
302
+ font-size: var(--mast-text-sm);
303
+ display: flex;
304
+ flex-direction: column;
305
+ gap: 0.5rem;
306
+ }
307
+
308
+ .mast-tool-call-block[data-streaming='true'] .mast-tool-call-block-status {
309
+ color: var(--mast-tool-pending);
310
+ }
311
+
312
+ .mast-tool-call-block[data-status='error'] {
313
+ background: var(--mast-tool-error-bg, #fef2f2);
314
+ color: var(--mast-tool-error-fg, #991b1b);
315
+ }
316
+
317
+ .mast-tool-call-block[data-status='error'] .mast-tool-call-block-status {
318
+ color: var(--mast-tool-error-fg, #991b1b);
319
+ }
320
+
321
+ .mast-tool-call-block[data-status='cancelled'] {
322
+ background: var(--mast-tool-cancelled-bg, #f3f4f6);
323
+ color: var(--mast-tool-cancelled-fg, #4b5563);
324
+ }
325
+
326
+ .mast-tool-call-block[data-status='cancelled'] .mast-tool-call-block-status {
327
+ color: var(--mast-tool-cancelled-fg, #4b5563);
328
+ }
329
+
330
+ .mast-tool-call-block-header {
331
+ display: flex;
332
+ align-items: center;
333
+ gap: 0.5rem;
334
+ }
335
+
336
+ .mast-tool-call-block-status,
337
+ .mast-tool-call-block-wrench {
338
+ display: inline-flex;
339
+ align-items: center;
340
+ }
341
+
342
+ .mast-tool-call-block-name {
343
+ font-family: var(--mast-font-mono);
344
+ font-weight: 500;
345
+ }
346
+
347
+ .mast-tool-call-block-sub-output {
348
+ display: flex;
349
+ flex-direction: column;
350
+ gap: 0.5rem;
351
+ }
352
+
353
+ .mast-tool-call-block-sub-text {
354
+ white-space: pre-wrap;
355
+ color: var(--mast-fg);
356
+ }
357
+
358
+ .mast-tool-call-block-nested {
359
+ display: flex;
360
+ flex-direction: column;
361
+ gap: 0.5rem;
362
+ margin-left: 0.75rem;
363
+ padding-left: 0.5rem;
364
+ border-left: 2px solid var(--mast-border);
365
+ }
366
+
367
+ .mast-tool-call-block-args,
368
+ .mast-tool-call-block-result {
369
+ border: 1px solid var(--mast-border);
370
+ border-radius: var(--mast-radius);
371
+ background: var(--mast-bg);
372
+ color: var(--mast-fg);
373
+ padding: 0.25rem 0.5rem;
374
+ }
375
+
376
+ .mast-tool-call-block-args > summary,
377
+ .mast-tool-call-block-result > summary {
378
+ cursor: pointer;
379
+ user-select: none;
380
+ font-size: var(--mast-text-sm);
381
+ color: var(--mast-fg-muted);
382
+ }
383
+
384
+ .mast-tool-call-block-pre {
385
+ margin: 0.5rem 0 0 0;
386
+ padding: 0.5rem;
387
+ background: var(--mast-bg-subtle);
388
+ border-radius: 0.25rem;
389
+ overflow-x: auto;
390
+ font-family: var(--mast-font-mono);
391
+ font-size: var(--mast-text-sm);
392
+ white-space: pre-wrap;
393
+ word-break: break-word;
394
+ }
395
+
396
+ /* -------------------------------------------------------------------------- */
397
+ /* ChatInput */
398
+ /* -------------------------------------------------------------------------- */
399
+
400
+ [data-mast-chat-input] {
401
+ display: flex;
402
+ align-items: flex-end;
403
+ gap: 0.5rem;
404
+ padding: 0.5rem;
405
+ background: var(--mast-bg);
406
+ border: 1px solid var(--mast-border);
407
+ border-radius: var(--mast-radius);
408
+ }
409
+
410
+ .mast-chat-input-textarea {
411
+ flex: 1 1 auto;
412
+ resize: none;
413
+ background: transparent;
414
+ color: var(--mast-fg);
415
+ font: inherit;
416
+ border: none;
417
+ outline: none;
418
+ padding: 0.25rem 0.5rem;
419
+ min-height: 1.5rem;
420
+ line-height: 1.4;
421
+ }
422
+
423
+ .mast-chat-input-textarea::placeholder {
424
+ color: var(--mast-fg-muted);
425
+ }
426
+
427
+ .mast-chat-input-textarea:disabled {
428
+ opacity: 0.6;
429
+ cursor: not-allowed;
430
+ }
431
+
432
+ .mast-chat-input-send,
433
+ .mast-chat-input-cancel {
434
+ display: inline-flex;
435
+ align-items: center;
436
+ justify-content: center;
437
+ width: 2rem;
438
+ height: 2rem;
439
+ flex-shrink: 0;
440
+ background: var(--mast-accent);
441
+ color: var(--mast-accent-fg);
442
+ border: none;
443
+ border-radius: var(--mast-radius);
444
+ cursor: pointer;
445
+ padding: 0;
446
+ }
447
+
448
+ .mast-chat-input-send:disabled {
449
+ opacity: 0.5;
450
+ cursor: not-allowed;
451
+ }
452
+
453
+ .mast-chat-input-cancel {
454
+ background: var(--mast-tool-pending);
455
+ }
456
+
457
+ /* -------------------------------------------------------------------------- */
458
+ /* Inline approval */
459
+ /* -------------------------------------------------------------------------- */
460
+
461
+ .mast-inline-approval {
462
+ display: flex;
463
+ flex-direction: column;
464
+ gap: 0.5rem;
465
+ padding: 0.75rem;
466
+ border: 1px solid var(--mast-tool-pending);
467
+ border-radius: var(--mast-radius);
468
+ background: var(--mast-thinking-bg);
469
+ color: var(--mast-thinking-fg);
470
+ }
471
+
472
+ .mast-inline-approval-header {
473
+ display: flex;
474
+ align-items: center;
475
+ gap: 0.5rem;
476
+ font-size: var(--mast-text-sm);
477
+ }
478
+
479
+ .mast-inline-approval-icon {
480
+ display: inline-flex;
481
+ align-items: center;
482
+ }
483
+
484
+ .mast-inline-approval-name {
485
+ font-family: var(--mast-font-mono);
486
+ font-weight: 600;
487
+ }
488
+
489
+ .mast-inline-approval-label {
490
+ color: var(--mast-fg-muted);
491
+ }
492
+
493
+ .mast-inline-approval-args {
494
+ margin: 0;
495
+ padding: 0.5rem;
496
+ border-radius: 0.25rem;
497
+ background: var(--mast-bg);
498
+ color: var(--mast-fg);
499
+ font-family: var(--mast-font-mono);
500
+ font-size: 0.8125rem;
501
+ overflow-x: auto;
502
+ }
503
+
504
+ .mast-inline-approval-actions {
505
+ display: flex;
506
+ gap: 0.5rem;
507
+ }
508
+
509
+ .mast-inline-approval-button {
510
+ padding: 0.4rem 0.9rem;
511
+ border-radius: 0.375rem;
512
+ border: 1px solid transparent;
513
+ font: inherit;
514
+ cursor: pointer;
515
+ }
516
+
517
+ .mast-inline-approval-approve {
518
+ background: var(--mast-accent);
519
+ color: var(--mast-accent-fg);
520
+ }
521
+
522
+ .mast-inline-approval-reject {
523
+ background: transparent;
524
+ border-color: currentColor;
525
+ color: inherit;
526
+ }
527
+
528
+ /* -------------------------------------------------------------------------- */
529
+ /* Mention picker */
530
+ /* -------------------------------------------------------------------------- */
531
+
532
+ .mast-mention-input .mast-mention-input-field {
533
+ flex: 1 1 auto;
534
+ position: relative;
535
+ min-width: 0;
536
+ }
537
+
538
+ .mast-mention-input-content {
539
+ display: flex;
540
+ flex-wrap: wrap;
541
+ align-items: flex-start;
542
+ gap: 0.25rem;
543
+ width: 100%;
544
+ min-width: 0;
545
+ }
546
+
547
+ .mast-mention-input .mast-mention-input-textarea {
548
+ flex: 1 1 8rem;
549
+ min-width: 8rem;
550
+ }
551
+
552
+ .mast-mention-segment-text {
553
+ white-space: pre-wrap;
554
+ align-self: center;
555
+ font-size: var(--mast-text-base);
556
+ }
557
+
558
+ .mast-mention-chip {
559
+ display: inline-flex;
560
+ align-items: center;
561
+ gap: 0.25rem;
562
+ padding: 0.1rem 0.4rem;
563
+ background: var(--mast-mention-chip-bg);
564
+ color: var(--mast-mention-chip-fg);
565
+ border-radius: 9999px;
566
+ font-size: var(--mast-text-sm);
567
+ font-weight: 500;
568
+ }
569
+
570
+ .mast-mention-chip-remove {
571
+ display: inline-flex;
572
+ align-items: center;
573
+ justify-content: center;
574
+ background: transparent;
575
+ border: none;
576
+ color: inherit;
577
+ font: inherit;
578
+ cursor: pointer;
579
+ padding: 0;
580
+ width: 1rem;
581
+ height: 1rem;
582
+ border-radius: 9999px;
583
+ line-height: 1;
584
+ }
585
+
586
+ .mast-mention-chip-remove:hover,
587
+ .mast-mention-chip-remove:focus-visible {
588
+ background: rgba(0, 0, 0, 0.1);
589
+ }
590
+
591
+ .mast-mention-picker {
592
+ position: absolute;
593
+ bottom: 100%;
594
+ left: 0;
595
+ right: 0;
596
+ margin: 0 0 0.25rem 0;
597
+ padding: 0.25rem;
598
+ list-style: none;
599
+ background: var(--mast-mention-picker-bg);
600
+ border: 1px solid var(--mast-border);
601
+ border-radius: var(--mast-radius);
602
+ box-shadow: var(--mast-mention-picker-shadow);
603
+ max-height: 14rem;
604
+ overflow-y: auto;
605
+ z-index: 10;
606
+ }
607
+
608
+ .mast-mention-picker-item {
609
+ padding: 0.35rem 0.5rem;
610
+ border-radius: 0.25rem;
611
+ cursor: pointer;
612
+ font-size: var(--mast-text-sm);
613
+ color: var(--mast-fg);
614
+ }
615
+
616
+ .mast-mention-picker-item:hover {
617
+ background: var(--mast-mention-picker-active-bg);
618
+ }
619
+
620
+ .mast-mention-picker-active {
621
+ background: var(--mast-mention-picker-active-bg);
622
+ }
623
+
624
+ .mast-mention-picker-item-label {
625
+ font-weight: 500;
626
+ }
627
+
628
+ .mast-mention-picker-item-description {
629
+ font-size: var(--mast-text-sm);
630
+ color: var(--mast-fg-muted);
631
+ }