payload-canvas 0.6.6 → 0.6.7

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.
@@ -1,944 +1,944 @@
1
- // The AI assistant panel in the inspector. Payload CSS variables only, inside Payload's layer,
2
- // so it follows the admin's light and dark theme. It uses the editor's accent (Payload's success
3
- // color) and Payload's neutral scale. Violet belongs to the AI's presence on the canvas, not here.
4
-
5
- @layer payload-default {
6
- .builder-editor {
7
- --ba-accent: var(--be-accent, var(--theme-success-500));
8
- --ba-accent-soft: color-mix(in srgb, var(--ba-accent) 12%, transparent);
9
- --ba-accent-line: color-mix(in srgb, var(--ba-accent) 35%, transparent);
10
- }
11
-
12
- @keyframes builder-assistant-in {
13
- from {
14
- opacity: 0;
15
- transform: translateY(6px);
16
- }
17
- }
18
-
19
- @keyframes builder-assistant-blink {
20
- 50% {
21
- opacity: 0;
22
- }
23
- }
24
-
25
- @keyframes builder-assistant-dot {
26
- 0%,
27
- 80%,
28
- 100% {
29
- opacity: 0.25;
30
- transform: translateY(0);
31
- }
32
-
33
- 40% {
34
- opacity: 1;
35
- transform: translateY(-2px);
36
- }
37
- }
38
-
39
- @keyframes builder-assistant-spin {
40
- to {
41
- transform: rotate(360deg);
42
- }
43
- }
44
-
45
- .builder-assistant {
46
- display: flex;
47
- flex: 1;
48
- flex-direction: column;
49
- min-height: 0;
50
-
51
- &[hidden] {
52
- display: none;
53
- }
54
- }
55
-
56
- .builder-assistant__sr-only {
57
- position: absolute;
58
- width: 1px;
59
- height: 1px;
60
- overflow: hidden;
61
- clip-path: inset(50%);
62
- white-space: nowrap;
63
- }
64
-
65
- // ---------------------------------------------------------------------------
66
- // Use Claude Code or Codex
67
- // ---------------------------------------------------------------------------
68
-
69
- .builder-assistant__connect-head {
70
- display: flex;
71
- align-items: center;
72
- justify-content: space-between;
73
- gap: 8px;
74
- }
75
-
76
- .builder-assistant__connect .builder-assistant__card-text {
77
- display: block;
78
- }
79
-
80
- .builder-assistant__step {
81
- display: flex;
82
- flex-direction: column;
83
- align-items: stretch;
84
- gap: 6px;
85
- font-size: var(--be-text-m);
86
-
87
- code {
88
- padding: 1px 4px;
89
- border-radius: 4px;
90
- background: var(--theme-elevation-100);
91
- }
92
-
93
- > .builder-assistant__link {
94
- align-self: flex-start;
95
- }
96
- }
97
-
98
- .builder-assistant__tabpanel {
99
- display: flex;
100
- flex-direction: column;
101
- gap: 6px;
102
- min-width: 0;
103
- }
104
-
105
- .builder-assistant__step-title {
106
- font-weight: var(--be-weight-strong);
107
- }
108
-
109
- .builder-assistant__step-text {
110
- color: var(--theme-elevation-800);
111
- line-height: 1.5;
112
- }
113
-
114
- // The box holds the command and its copy button (top right). The command scrolls sideways and
115
- // fades out at the right edge, so a cut line reads as "more to scroll".
116
- .builder-assistant__copy-code {
117
- --ba-code-bg: var(--theme-elevation-100);
118
- position: relative;
119
- align-self: stretch;
120
- border-radius: var(--be-radius);
121
- background: var(--ba-code-bg);
122
-
123
- // Commands never wrap: a broken line would copy wrong and read worse. They scroll sideways.
124
- // The right padding keeps the end of the command clear of the button and the fade.
125
- .builder-assistant__card-code {
126
- min-width: 0;
127
- padding-right: 40px;
128
- overflow-x: auto;
129
- background: none;
130
- white-space: pre;
131
- scrollbar-width: thin;
132
- }
133
-
134
- &::after {
135
- content: '';
136
- position: absolute;
137
- top: 0;
138
- right: 0;
139
- bottom: 0;
140
- width: 56px;
141
- border-radius: 0 var(--be-radius) var(--be-radius) 0;
142
- background: linear-gradient(to right, transparent, var(--ba-code-bg) 70%);
143
- pointer-events: none;
144
- }
145
-
146
- .builder-editor__icon-button {
147
- position: absolute;
148
- top: 2px;
149
- right: 2px;
150
- z-index: 1;
151
- background: var(--ba-code-bg);
152
- }
153
- }
154
-
155
- .builder-assistant__badge {
156
- display: inline-grid;
157
- flex: none;
158
- place-items: center;
159
- width: 22px;
160
- height: 22px;
161
- border-radius: 6px;
162
- background: var(--theme-elevation-100);
163
- color: var(--be-muted);
164
- }
165
-
166
- .builder-assistant__badge--small {
167
- width: 18px;
168
- height: 18px;
169
- border-radius: 5px;
170
- }
171
-
172
- // ---------------------------------------------------------------------------
173
- // Message list
174
- // ---------------------------------------------------------------------------
175
-
176
- .builder-assistant__scroll {
177
- flex: 1;
178
- min-height: 0;
179
- overflow: hidden auto;
180
- overscroll-behavior: contain;
181
- scrollbar-width: thin;
182
- }
183
-
184
- .builder-assistant__log {
185
- display: flex;
186
- flex-direction: column;
187
- gap: 16px;
188
- padding: 16px 12px 20px;
189
- }
190
-
191
- .builder-assistant__user,
192
- .builder-assistant__turn,
193
- .builder-assistant__card,
194
- .builder-assistant__info {
195
- animation: builder-assistant-in 220ms var(--be-ease) both;
196
- }
197
-
198
- .builder-assistant__user {
199
- display: flex;
200
- flex-direction: column;
201
- align-items: flex-end;
202
- gap: 4px;
203
- padding-left: 32px;
204
- }
205
-
206
- .builder-assistant__bubble {
207
- margin: 0;
208
- padding: 8px 12px;
209
- border-radius: 14px 14px 4px;
210
- background: var(--theme-elevation-100);
211
- color: var(--theme-text);
212
- font-size: var(--be-text-m);
213
- line-height: 1.5;
214
- white-space: pre-wrap;
215
- overflow-wrap: anywhere;
216
- }
217
-
218
- .builder-assistant__user--failed .builder-assistant__bubble {
219
- opacity: 0.7;
220
- }
221
-
222
- .builder-assistant__failed-label {
223
- color: var(--be-muted);
224
- font-size: var(--be-text-s);
225
- }
226
-
227
- .builder-assistant__turn {
228
- display: flex;
229
- flex-direction: column;
230
- gap: 8px;
231
- min-width: 0;
232
- }
233
-
234
- .builder-assistant__turn-head {
235
- display: flex;
236
- align-items: center;
237
- gap: 6px;
238
- height: 22px;
239
- color: var(--be-muted);
240
- font-size: var(--be-text-s);
241
- font-weight: var(--be-weight-medium);
242
-
243
- > span:nth-child(2) {
244
- flex: 1;
245
- }
246
- }
247
-
248
- .builder-assistant__copy {
249
- opacity: 0;
250
- transition: opacity 120ms ease;
251
- }
252
-
253
- .builder-assistant__turn:hover .builder-assistant__copy,
254
- .builder-assistant__copy:focus-visible {
255
- opacity: 1;
256
- }
257
-
258
- // Markdown
259
- .builder-assistant__md {
260
- color: var(--theme-text);
261
- font-size: var(--be-text-m);
262
- line-height: 1.6;
263
- overflow-wrap: anywhere;
264
-
265
- > * {
266
- margin: 0;
267
- }
268
-
269
- > * + * {
270
- margin-top: 8px;
271
- }
272
-
273
- ul,
274
- ol {
275
- padding-left: 20px;
276
- }
277
-
278
- li + li {
279
- margin-top: 2px;
280
- }
281
-
282
- li::marker {
283
- color: var(--be-muted);
284
- }
285
-
286
- strong {
287
- font-weight: var(--be-weight-strong);
288
- }
289
-
290
- code {
291
- padding: 1px 4px;
292
- border-radius: 4px;
293
- background: var(--theme-elevation-100);
294
- font-size: var(--be-text-s);
295
- }
296
-
297
- pre {
298
- padding: 8px 10px;
299
- border-radius: var(--be-radius-m);
300
- background: var(--theme-elevation-50);
301
- border: 1px solid var(--be-border-soft);
302
- overflow-x: auto;
303
- white-space: pre;
304
-
305
- code {
306
- padding: 0;
307
- background: none;
308
- }
309
- }
310
-
311
- a {
312
- color: var(--theme-text);
313
- text-decoration: underline;
314
- text-underline-offset: 2px;
315
- }
316
- }
317
-
318
- .builder-assistant__md-heading {
319
- font-weight: var(--be-weight-strong);
320
- }
321
-
322
- // The caret at the end of streaming text.
323
- .builder-assistant__text--streaming .builder-assistant__md {
324
- > p:last-child::after,
325
- > ul:last-child > li:last-child::after,
326
- > ol:last-child > li:last-child::after,
327
- &:empty::after {
328
- content: '';
329
- display: inline-block;
330
- width: 2px;
331
- height: 1.1em;
332
- margin-left: 2px;
333
- border-radius: 1px;
334
- background: var(--theme-text);
335
- vertical-align: text-bottom;
336
- animation: builder-assistant-blink 1s steps(1) infinite;
337
- }
338
- }
339
-
340
- // Tool chips
341
- .builder-assistant__tools {
342
- display: flex;
343
- flex-direction: column;
344
- gap: 4px;
345
- margin: 0;
346
- padding: 0;
347
- list-style: none;
348
- }
349
-
350
- .builder-assistant__chip {
351
- display: flex;
352
- flex-direction: column;
353
- gap: 2px;
354
- min-width: 0;
355
- padding: 5px 8px;
356
- border: 1px solid var(--be-border-soft);
357
- border-radius: var(--be-radius-m);
358
- background: var(--theme-elevation-50);
359
- animation: builder-assistant-in 180ms var(--be-ease) both;
360
- }
361
-
362
- .builder-assistant__chip-row {
363
- display: flex;
364
- align-items: center;
365
- gap: 8px;
366
- min-width: 0;
367
- }
368
-
369
- .builder-assistant__chip-icon {
370
- display: inline-grid;
371
- flex: none;
372
- place-items: center;
373
- width: 16px;
374
- height: 16px;
375
- border-radius: 50%;
376
- background: var(--ba-accent-soft);
377
- color: var(--ba-accent);
378
- }
379
-
380
- .builder-assistant__chip-label {
381
- overflow: hidden;
382
- color: var(--theme-elevation-800);
383
- font-size: var(--be-text-s);
384
- text-overflow: ellipsis;
385
- white-space: nowrap;
386
- }
387
-
388
- .builder-assistant__chip--running {
389
- border-color: var(--theme-elevation-300);
390
-
391
- .builder-assistant__chip-icon {
392
- background: none;
393
- }
394
-
395
- .builder-assistant__chip-label {
396
- color: var(--theme-text);
397
- }
398
- }
399
-
400
- // Started but never ran (the model dropped it, Stop, an error): quiet, not an alarm.
401
- .builder-assistant__chip--cancelled {
402
- border-style: dashed;
403
- background: none;
404
-
405
- .builder-assistant__chip-icon {
406
- background: var(--theme-elevation-100);
407
- color: var(--theme-elevation-600);
408
- }
409
-
410
- .builder-assistant__chip-label {
411
- color: var(--theme-elevation-600);
412
- }
413
- }
414
-
415
- // A failed call the model retried and fixed: as quiet as a call that never ran.
416
- .builder-assistant__chip--retried {
417
- border-style: dashed;
418
- background: none;
419
-
420
- .builder-assistant__chip-icon {
421
- background: var(--theme-elevation-100);
422
- color: var(--theme-elevation-600);
423
- }
424
-
425
- .builder-assistant__chip-label {
426
- color: var(--theme-elevation-700);
427
- }
428
- }
429
-
430
- .builder-assistant__chip--error {
431
- border-color: color-mix(in srgb, var(--theme-error-500) 35%, transparent);
432
-
433
- .builder-assistant__chip-icon {
434
- background: color-mix(in srgb, var(--theme-error-500) 14%, transparent);
435
- color: var(--theme-error-500);
436
- }
437
- }
438
-
439
- .builder-assistant__chip--warn {
440
- border-color: color-mix(in srgb, var(--theme-warning-500) 40%, transparent);
441
-
442
- .builder-assistant__chip-icon {
443
- background: color-mix(in srgb, var(--theme-warning-500) 16%, transparent);
444
- color: var(--theme-warning-500);
445
- }
446
-
447
- .builder-assistant__chip-note {
448
- color: var(--theme-elevation-700);
449
- }
450
- }
451
-
452
- .builder-assistant__chip-image {
453
- display: block;
454
- width: calc(100% - 24px);
455
- max-width: 240px;
456
- max-height: 160px;
457
- margin: 4px 0 2px 24px;
458
- border-radius: var(--be-radius);
459
- background: var(--theme-elevation-100);
460
- object-fit: cover;
461
- }
462
-
463
- // "Show" on a change: pushed to the right end of the chip.
464
- .builder-assistant__chip-show {
465
- flex: none;
466
- margin-left: auto;
467
- }
468
-
469
- // The raw error of a failed call, behind "Details".
470
- .builder-assistant__chip-details {
471
- padding-left: 24px;
472
-
473
- summary {
474
- color: var(--be-muted);
475
- font-size: var(--be-text-s);
476
- font-weight: var(--be-weight-regular);
477
- }
478
- }
479
-
480
- .builder-assistant__chip-detail {
481
- margin: 4px 0 0;
482
- color: var(--theme-elevation-700);
483
- font-size: var(--be-text-s);
484
- line-height: 1.4;
485
- overflow-wrap: anywhere;
486
- }
487
-
488
- .builder-assistant__chip-note {
489
- padding-left: 24px;
490
- color: var(--theme-error-500);
491
- font-size: var(--be-text-s);
492
- line-height: 1.4;
493
- }
494
-
495
- .builder-assistant__spinner {
496
- width: 12px;
497
- height: 12px;
498
- border: 1.5px solid var(--theme-elevation-200);
499
- border-top-color: var(--theme-elevation-700);
500
- border-radius: 50%;
501
- animation: builder-assistant-spin 700ms linear infinite;
502
- }
503
-
504
- .builder-assistant__thinking {
505
- display: inline-flex;
506
- align-items: center;
507
- gap: 8px;
508
- margin: 0;
509
- color: var(--be-muted);
510
- font-size: var(--be-text-m);
511
- }
512
-
513
- .builder-assistant__dots {
514
- display: inline-flex;
515
- gap: 3px;
516
-
517
- span {
518
- width: 4px;
519
- height: 4px;
520
- border-radius: 50%;
521
- background: var(--theme-elevation-500);
522
- animation: builder-assistant-dot 1.2s ease-in-out infinite;
523
- }
524
-
525
- span:nth-child(2) {
526
- animation-delay: 150ms;
527
- }
528
-
529
- span:nth-child(3) {
530
- animation-delay: 300ms;
531
- }
532
- }
533
-
534
- // Notices
535
- .builder-assistant__info {
536
- margin: 0;
537
- color: var(--be-muted);
538
- font-size: var(--be-text-m);
539
- text-align: center;
540
- }
541
-
542
- .builder-assistant__card {
543
- display: flex;
544
- flex-direction: column;
545
- gap: 8px;
546
- padding: 12px;
547
- border: 1px solid var(--be-border);
548
- border-radius: var(--be-radius-m);
549
- background: var(--theme-elevation-50);
550
- }
551
-
552
- .builder-assistant__details {
553
- font-size: var(--be-text-m);
554
-
555
- summary {
556
- width: fit-content;
557
- color: var(--theme-elevation-800);
558
- font-weight: var(--be-weight-medium);
559
- cursor: pointer;
560
-
561
- &:focus-visible {
562
- outline: 2px solid var(--be-accent);
563
- outline-offset: 2px;
564
- }
565
- }
566
- }
567
-
568
- .builder-assistant__details-body {
569
- display: flex;
570
- flex-direction: column;
571
- gap: 8px;
572
- margin-top: 8px;
573
- padding-top: 8px;
574
- border-top: 1px solid var(--be-border-soft);
575
-
576
- .builder-assistant__card-code {
577
- overflow-x: auto;
578
- white-space: pre;
579
- }
580
- }
581
-
582
- .builder-assistant__card--error {
583
- border-color: color-mix(in srgb, var(--theme-error-500) 35%, transparent);
584
- background: color-mix(in srgb, var(--theme-error-500) 6%, var(--theme-bg));
585
-
586
- .builder-assistant__card-text svg {
587
- flex: none;
588
- margin-top: 2px;
589
- color: var(--theme-error-500);
590
- }
591
- }
592
-
593
- .builder-assistant__card-title {
594
- margin: 0;
595
- font-size: var(--be-text-m);
596
- font-weight: var(--be-weight-strong);
597
- }
598
-
599
- .builder-assistant__card-text {
600
- display: flex;
601
- gap: 6px;
602
- margin: 0;
603
- color: var(--theme-elevation-800);
604
- font-size: var(--be-text-m);
605
- line-height: 1.5;
606
-
607
- code {
608
- padding: 1px 4px;
609
- border-radius: 4px;
610
- background: var(--theme-elevation-100);
611
- }
612
- }
613
-
614
- .builder-assistant__card-code {
615
- margin: 0;
616
- padding: 6px 8px;
617
- border-radius: var(--be-radius);
618
- background: var(--theme-elevation-100);
619
- font-family: var(--font-mono, ui-monospace, monospace);
620
- font-size: var(--be-text-s);
621
- }
622
-
623
- .builder-assistant__card-actions {
624
- display: flex;
625
- flex-wrap: wrap;
626
- align-items: center;
627
- gap: 6px 12px;
628
- }
629
-
630
- .builder-assistant__link,
631
- .builder-assistant__ghost {
632
- display: inline-flex;
633
- align-items: center;
634
- gap: 4px;
635
- padding: 0;
636
- border: 0;
637
- background: none;
638
- color: var(--theme-text);
639
- font-size: var(--be-text-m);
640
- font-weight: var(--be-weight-medium);
641
- text-decoration: none;
642
- cursor: pointer;
643
-
644
- &:hover {
645
- color: var(--be-accent-strong);
646
- text-decoration: underline;
647
- }
648
-
649
- &:focus-visible {
650
- outline: 2px solid var(--be-accent);
651
- outline-offset: 2px;
652
- border-radius: var(--be-radius);
653
- }
654
- }
655
-
656
- // ---------------------------------------------------------------------------
657
- // Empty state
658
- // ---------------------------------------------------------------------------
659
-
660
- .builder-assistant__welcome,
661
- .builder-assistant__empty {
662
- display: flex;
663
- flex-direction: column;
664
- align-items: center;
665
- gap: 6px;
666
- padding: 40px 16px 16px;
667
- text-align: center;
668
- animation: builder-assistant-in 260ms var(--be-ease) both;
669
-
670
- .builder-editor__hint {
671
- max-width: 260px;
672
- }
673
- }
674
-
675
- .builder-assistant__mark {
676
- display: grid;
677
- place-items: center;
678
- width: 44px;
679
- height: 44px;
680
- margin-bottom: 6px;
681
- border-radius: 12px;
682
- background: var(--theme-elevation-100);
683
- color: var(--be-muted);
684
- }
685
-
686
- .builder-assistant__empty-title {
687
- margin: 0;
688
- font-size: var(--be-text-l);
689
- font-weight: var(--be-weight-strong);
690
- }
691
-
692
- .builder-assistant__suggestions {
693
- display: flex;
694
- flex-direction: column;
695
- gap: 6px;
696
- width: 100%;
697
- margin-top: 18px;
698
- }
699
-
700
- .builder-assistant__suggestion {
701
- display: flex;
702
- align-items: center;
703
- gap: 8px;
704
- width: 100%;
705
- padding: 8px 10px;
706
- border: 1px solid var(--be-border);
707
- border-radius: var(--be-radius-m);
708
- background: var(--theme-bg);
709
- color: var(--theme-elevation-800);
710
- font-size: var(--be-text-m);
711
- line-height: 1.35;
712
- text-align: left;
713
- cursor: pointer;
714
- transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
715
-
716
- &:hover {
717
- border-color: var(--theme-elevation-300);
718
- background: var(--be-hover);
719
- color: var(--theme-text);
720
- }
721
-
722
- &:focus-visible {
723
- outline: 2px solid var(--be-accent);
724
- outline-offset: 2px;
725
- }
726
- }
727
-
728
- // ---------------------------------------------------------------------------
729
- // Composer
730
- // ---------------------------------------------------------------------------
731
-
732
- .builder-assistant__composer {
733
- display: flex;
734
- flex: none;
735
- flex-direction: column;
736
- gap: 8px;
737
- padding: 10px 12px 10px;
738
- border-top: 1px solid var(--be-border-soft);
739
- }
740
-
741
- .builder-assistant__context {
742
- display: flex;
743
- flex-wrap: wrap;
744
- gap: 4px;
745
- min-width: 0;
746
- }
747
-
748
- .builder-assistant__context-chip {
749
- display: inline-flex;
750
- align-items: center;
751
- gap: 5px;
752
- max-width: 100%;
753
- height: 22px;
754
- padding: 0 8px;
755
- border-radius: 11px;
756
- background: var(--theme-elevation-100);
757
- color: var(--be-muted);
758
- font-size: var(--be-text-s);
759
- font-weight: var(--be-weight-medium);
760
- }
761
-
762
- .builder-assistant__context-chip--selected {
763
- padding-right: 3px;
764
- background: var(--be-accent-soft);
765
- color: var(--theme-text);
766
-
767
- > svg {
768
- color: var(--be-accent-text);
769
- }
770
- }
771
-
772
- .builder-assistant__context-text {
773
- min-width: 0;
774
- overflow: hidden;
775
- text-overflow: ellipsis;
776
- white-space: nowrap;
777
- }
778
-
779
- .builder-assistant__context-clear {
780
- display: inline-grid;
781
- flex: none;
782
- place-items: center;
783
- width: 16px;
784
- height: 16px;
785
- padding: 0;
786
- border: 0;
787
- border-radius: 50%;
788
- background: transparent;
789
- color: var(--be-muted);
790
- cursor: pointer;
791
-
792
- &:hover {
793
- background: var(--theme-elevation-150);
794
- color: var(--theme-text);
795
- }
796
-
797
- &:focus-visible {
798
- outline: 2px solid var(--be-accent);
799
- outline-offset: 1px;
800
- }
801
- }
802
-
803
- .builder-assistant__field {
804
- display: flex;
805
- align-items: flex-end;
806
- gap: 6px;
807
- padding: 6px 6px 6px 10px;
808
- border: 1px solid var(--theme-elevation-150);
809
- border-radius: 10px;
810
- background: var(--theme-input-bg, var(--theme-elevation-0));
811
- transition: border-color 120ms ease, box-shadow 120ms ease;
812
-
813
- &:focus-within {
814
- border-color: var(--ba-accent);
815
- box-shadow: 0 0 0 3px var(--ba-accent-soft);
816
- }
817
-
818
- &[data-disabled] {
819
- background: var(--theme-elevation-50);
820
- }
821
- }
822
-
823
- .builder-assistant__input {
824
- flex: 1;
825
- min-width: 0;
826
- min-height: 24px;
827
- max-height: 168px;
828
- margin: 0;
829
- padding: 3px 0;
830
- border: 0;
831
- background: transparent;
832
- color: var(--theme-text);
833
- font-family: inherit;
834
- font-size: var(--be-text-m);
835
- line-height: 18px;
836
- resize: none;
837
- outline: none;
838
-
839
- &::placeholder {
840
- color: var(--be-subtle);
841
- }
842
-
843
- &:focus-visible {
844
- outline: none;
845
- }
846
-
847
- &:disabled {
848
- cursor: default;
849
- }
850
- }
851
-
852
- // The primary button, as Payload colors it: solid text color on the page color.
853
- .builder-assistant__send {
854
- display: inline-grid;
855
- flex: none;
856
- place-items: center;
857
- width: 28px;
858
- height: 28px;
859
- padding: 0;
860
- border: 0;
861
- border-radius: 8px;
862
- background: var(--theme-elevation-800);
863
- color: var(--theme-elevation-0);
864
- cursor: pointer;
865
- transition: opacity 120ms ease, background-color 120ms ease, transform 120ms ease;
866
-
867
- &:hover:not(:disabled) {
868
- background: var(--theme-text);
869
- }
870
-
871
- &:active:not(:disabled) {
872
- transform: scale(0.94);
873
- }
874
-
875
- &:disabled {
876
- background: var(--theme-elevation-150);
877
- color: var(--be-subtle);
878
- cursor: default;
879
- }
880
-
881
- &:focus-visible {
882
- outline: 2px solid var(--be-accent);
883
- outline-offset: 2px;
884
- }
885
- }
886
-
887
- .builder-assistant__send--stop {
888
- background: var(--theme-elevation-150);
889
- color: var(--theme-text);
890
-
891
- &:hover:not(:disabled) {
892
- background: var(--theme-elevation-250, var(--theme-elevation-200));
893
- }
894
- }
895
-
896
- .builder-assistant__foot {
897
- display: flex;
898
- align-items: center;
899
- justify-content: space-between;
900
- gap: 8px;
901
- min-width: 0;
902
- }
903
-
904
- .builder-assistant__footnote {
905
- display: flex;
906
- flex: 1;
907
- min-width: 0;
908
- flex-wrap: wrap;
909
- align-items: center;
910
- gap: 3px;
911
- margin: 0;
912
- color: var(--be-muted);
913
- font-size: var(--be-text-s);
914
-
915
- kbd {
916
- min-width: 0;
917
- height: 16px;
918
- padding: 0 4px;
919
- border-bottom-width: 1px;
920
- font-size: var(--be-text-s);
921
- }
922
- }
923
-
924
- @media (prefers-reduced-motion: reduce) {
925
- .builder-assistant__user,
926
- .builder-assistant__turn,
927
- .builder-assistant__card,
928
- .builder-assistant__info,
929
- .builder-assistant__chip,
930
- .builder-assistant__welcome,
931
- .builder-assistant__empty {
932
- animation: none;
933
- }
934
-
935
- .builder-assistant__text--streaming .builder-assistant__md > *::after,
936
- .builder-assistant__dots span {
937
- animation: none;
938
- }
939
-
940
- .builder-assistant__spinner {
941
- animation-duration: 2s;
942
- }
943
- }
944
- }
1
+ // The AI assistant panel in the inspector. Payload CSS variables only, inside Payload's layer,
2
+ // so it follows the admin's light and dark theme. It uses the editor's accent (Payload's success
3
+ // color) and Payload's neutral scale. Violet belongs to the AI's presence on the canvas, not here.
4
+
5
+ @layer payload-default {
6
+ .builder-editor {
7
+ --ba-accent: var(--be-accent, var(--theme-success-500));
8
+ --ba-accent-soft: color-mix(in srgb, var(--ba-accent) 12%, transparent);
9
+ --ba-accent-line: color-mix(in srgb, var(--ba-accent) 35%, transparent);
10
+ }
11
+
12
+ @keyframes builder-assistant-in {
13
+ from {
14
+ opacity: 0;
15
+ transform: translateY(6px);
16
+ }
17
+ }
18
+
19
+ @keyframes builder-assistant-blink {
20
+ 50% {
21
+ opacity: 0;
22
+ }
23
+ }
24
+
25
+ @keyframes builder-assistant-dot {
26
+ 0%,
27
+ 80%,
28
+ 100% {
29
+ opacity: 0.25;
30
+ transform: translateY(0);
31
+ }
32
+
33
+ 40% {
34
+ opacity: 1;
35
+ transform: translateY(-2px);
36
+ }
37
+ }
38
+
39
+ @keyframes builder-assistant-spin {
40
+ to {
41
+ transform: rotate(360deg);
42
+ }
43
+ }
44
+
45
+ .builder-assistant {
46
+ display: flex;
47
+ flex: 1;
48
+ flex-direction: column;
49
+ min-height: 0;
50
+
51
+ &[hidden] {
52
+ display: none;
53
+ }
54
+ }
55
+
56
+ .builder-assistant__sr-only {
57
+ position: absolute;
58
+ width: 1px;
59
+ height: 1px;
60
+ overflow: hidden;
61
+ clip-path: inset(50%);
62
+ white-space: nowrap;
63
+ }
64
+
65
+ // ---------------------------------------------------------------------------
66
+ // Use Claude Code or Codex
67
+ // ---------------------------------------------------------------------------
68
+
69
+ .builder-assistant__connect-head {
70
+ display: flex;
71
+ align-items: center;
72
+ justify-content: space-between;
73
+ gap: 8px;
74
+ }
75
+
76
+ .builder-assistant__connect .builder-assistant__card-text {
77
+ display: block;
78
+ }
79
+
80
+ .builder-assistant__step {
81
+ display: flex;
82
+ flex-direction: column;
83
+ align-items: stretch;
84
+ gap: 6px;
85
+ font-size: var(--be-text-m);
86
+
87
+ code {
88
+ padding: 1px 4px;
89
+ border-radius: 4px;
90
+ background: var(--theme-elevation-100);
91
+ }
92
+
93
+ > .builder-assistant__link {
94
+ align-self: flex-start;
95
+ }
96
+ }
97
+
98
+ .builder-assistant__tabpanel {
99
+ display: flex;
100
+ flex-direction: column;
101
+ gap: 6px;
102
+ min-width: 0;
103
+ }
104
+
105
+ .builder-assistant__step-title {
106
+ font-weight: var(--be-weight-strong);
107
+ }
108
+
109
+ .builder-assistant__step-text {
110
+ color: var(--theme-elevation-800);
111
+ line-height: 1.5;
112
+ }
113
+
114
+ // The box holds the command and its copy button (top right). The command scrolls sideways and
115
+ // fades out at the right edge, so a cut line reads as "more to scroll".
116
+ .builder-assistant__copy-code {
117
+ --ba-code-bg: var(--theme-elevation-100);
118
+ position: relative;
119
+ align-self: stretch;
120
+ border-radius: var(--be-radius);
121
+ background: var(--ba-code-bg);
122
+
123
+ // Commands never wrap: a broken line would copy wrong and read worse. They scroll sideways.
124
+ // The right padding keeps the end of the command clear of the button and the fade.
125
+ .builder-assistant__card-code {
126
+ min-width: 0;
127
+ padding-right: 40px;
128
+ overflow-x: auto;
129
+ background: none;
130
+ white-space: pre;
131
+ scrollbar-width: thin;
132
+ }
133
+
134
+ &::after {
135
+ content: '';
136
+ position: absolute;
137
+ top: 0;
138
+ right: 0;
139
+ bottom: 0;
140
+ width: 56px;
141
+ border-radius: 0 var(--be-radius) var(--be-radius) 0;
142
+ background: linear-gradient(to right, transparent, var(--ba-code-bg) 70%);
143
+ pointer-events: none;
144
+ }
145
+
146
+ .builder-editor__icon-button {
147
+ position: absolute;
148
+ top: 2px;
149
+ right: 2px;
150
+ z-index: 1;
151
+ background: var(--ba-code-bg);
152
+ }
153
+ }
154
+
155
+ .builder-assistant__badge {
156
+ display: inline-grid;
157
+ flex: none;
158
+ place-items: center;
159
+ width: 22px;
160
+ height: 22px;
161
+ border-radius: 6px;
162
+ background: var(--theme-elevation-100);
163
+ color: var(--be-muted);
164
+ }
165
+
166
+ .builder-assistant__badge--small {
167
+ width: 18px;
168
+ height: 18px;
169
+ border-radius: 5px;
170
+ }
171
+
172
+ // ---------------------------------------------------------------------------
173
+ // Message list
174
+ // ---------------------------------------------------------------------------
175
+
176
+ .builder-assistant__scroll {
177
+ flex: 1;
178
+ min-height: 0;
179
+ overflow: hidden auto;
180
+ overscroll-behavior: contain;
181
+ scrollbar-width: thin;
182
+ }
183
+
184
+ .builder-assistant__log {
185
+ display: flex;
186
+ flex-direction: column;
187
+ gap: 16px;
188
+ padding: 16px 12px 20px;
189
+ }
190
+
191
+ .builder-assistant__user,
192
+ .builder-assistant__turn,
193
+ .builder-assistant__card,
194
+ .builder-assistant__info {
195
+ animation: builder-assistant-in 220ms var(--be-ease) both;
196
+ }
197
+
198
+ .builder-assistant__user {
199
+ display: flex;
200
+ flex-direction: column;
201
+ align-items: flex-end;
202
+ gap: 4px;
203
+ padding-left: 32px;
204
+ }
205
+
206
+ .builder-assistant__bubble {
207
+ margin: 0;
208
+ padding: 8px 12px;
209
+ border-radius: 14px 14px 4px;
210
+ background: var(--theme-elevation-100);
211
+ color: var(--theme-text);
212
+ font-size: var(--be-text-m);
213
+ line-height: 1.5;
214
+ white-space: pre-wrap;
215
+ overflow-wrap: anywhere;
216
+ }
217
+
218
+ .builder-assistant__user--failed .builder-assistant__bubble {
219
+ opacity: 0.7;
220
+ }
221
+
222
+ .builder-assistant__failed-label {
223
+ color: var(--be-muted);
224
+ font-size: var(--be-text-s);
225
+ }
226
+
227
+ .builder-assistant__turn {
228
+ display: flex;
229
+ flex-direction: column;
230
+ gap: 8px;
231
+ min-width: 0;
232
+ }
233
+
234
+ .builder-assistant__turn-head {
235
+ display: flex;
236
+ align-items: center;
237
+ gap: 6px;
238
+ height: 22px;
239
+ color: var(--be-muted);
240
+ font-size: var(--be-text-s);
241
+ font-weight: var(--be-weight-medium);
242
+
243
+ > span:nth-child(2) {
244
+ flex: 1;
245
+ }
246
+ }
247
+
248
+ .builder-assistant__copy {
249
+ opacity: 0;
250
+ transition: opacity 120ms ease;
251
+ }
252
+
253
+ .builder-assistant__turn:hover .builder-assistant__copy,
254
+ .builder-assistant__copy:focus-visible {
255
+ opacity: 1;
256
+ }
257
+
258
+ // Markdown
259
+ .builder-assistant__md {
260
+ color: var(--theme-text);
261
+ font-size: var(--be-text-m);
262
+ line-height: 1.6;
263
+ overflow-wrap: anywhere;
264
+
265
+ > * {
266
+ margin: 0;
267
+ }
268
+
269
+ > * + * {
270
+ margin-top: 8px;
271
+ }
272
+
273
+ ul,
274
+ ol {
275
+ padding-left: 20px;
276
+ }
277
+
278
+ li + li {
279
+ margin-top: 2px;
280
+ }
281
+
282
+ li::marker {
283
+ color: var(--be-muted);
284
+ }
285
+
286
+ strong {
287
+ font-weight: var(--be-weight-strong);
288
+ }
289
+
290
+ code {
291
+ padding: 1px 4px;
292
+ border-radius: 4px;
293
+ background: var(--theme-elevation-100);
294
+ font-size: var(--be-text-s);
295
+ }
296
+
297
+ pre {
298
+ padding: 8px 10px;
299
+ border-radius: var(--be-radius-m);
300
+ background: var(--theme-elevation-50);
301
+ border: 1px solid var(--be-border-soft);
302
+ overflow-x: auto;
303
+ white-space: pre;
304
+
305
+ code {
306
+ padding: 0;
307
+ background: none;
308
+ }
309
+ }
310
+
311
+ a {
312
+ color: var(--theme-text);
313
+ text-decoration: underline;
314
+ text-underline-offset: 2px;
315
+ }
316
+ }
317
+
318
+ .builder-assistant__md-heading {
319
+ font-weight: var(--be-weight-strong);
320
+ }
321
+
322
+ // The caret at the end of streaming text.
323
+ .builder-assistant__text--streaming .builder-assistant__md {
324
+ > p:last-child::after,
325
+ > ul:last-child > li:last-child::after,
326
+ > ol:last-child > li:last-child::after,
327
+ &:empty::after {
328
+ content: '';
329
+ display: inline-block;
330
+ width: 2px;
331
+ height: 1.1em;
332
+ margin-left: 2px;
333
+ border-radius: 1px;
334
+ background: var(--theme-text);
335
+ vertical-align: text-bottom;
336
+ animation: builder-assistant-blink 1s steps(1) infinite;
337
+ }
338
+ }
339
+
340
+ // Tool chips
341
+ .builder-assistant__tools {
342
+ display: flex;
343
+ flex-direction: column;
344
+ gap: 4px;
345
+ margin: 0;
346
+ padding: 0;
347
+ list-style: none;
348
+ }
349
+
350
+ .builder-assistant__chip {
351
+ display: flex;
352
+ flex-direction: column;
353
+ gap: 2px;
354
+ min-width: 0;
355
+ padding: 5px 8px;
356
+ border: 1px solid var(--be-border-soft);
357
+ border-radius: var(--be-radius-m);
358
+ background: var(--theme-elevation-50);
359
+ animation: builder-assistant-in 180ms var(--be-ease) both;
360
+ }
361
+
362
+ .builder-assistant__chip-row {
363
+ display: flex;
364
+ align-items: center;
365
+ gap: 8px;
366
+ min-width: 0;
367
+ }
368
+
369
+ .builder-assistant__chip-icon {
370
+ display: inline-grid;
371
+ flex: none;
372
+ place-items: center;
373
+ width: 16px;
374
+ height: 16px;
375
+ border-radius: 50%;
376
+ background: var(--ba-accent-soft);
377
+ color: var(--ba-accent);
378
+ }
379
+
380
+ .builder-assistant__chip-label {
381
+ overflow: hidden;
382
+ color: var(--theme-elevation-800);
383
+ font-size: var(--be-text-s);
384
+ text-overflow: ellipsis;
385
+ white-space: nowrap;
386
+ }
387
+
388
+ .builder-assistant__chip--running {
389
+ border-color: var(--theme-elevation-300);
390
+
391
+ .builder-assistant__chip-icon {
392
+ background: none;
393
+ }
394
+
395
+ .builder-assistant__chip-label {
396
+ color: var(--theme-text);
397
+ }
398
+ }
399
+
400
+ // Started but never ran (the model dropped it, Stop, an error): quiet, not an alarm.
401
+ .builder-assistant__chip--cancelled {
402
+ border-style: dashed;
403
+ background: none;
404
+
405
+ .builder-assistant__chip-icon {
406
+ background: var(--theme-elevation-100);
407
+ color: var(--theme-elevation-600);
408
+ }
409
+
410
+ .builder-assistant__chip-label {
411
+ color: var(--theme-elevation-600);
412
+ }
413
+ }
414
+
415
+ // A failed call the model retried and fixed: as quiet as a call that never ran.
416
+ .builder-assistant__chip--retried {
417
+ border-style: dashed;
418
+ background: none;
419
+
420
+ .builder-assistant__chip-icon {
421
+ background: var(--theme-elevation-100);
422
+ color: var(--theme-elevation-600);
423
+ }
424
+
425
+ .builder-assistant__chip-label {
426
+ color: var(--theme-elevation-700);
427
+ }
428
+ }
429
+
430
+ .builder-assistant__chip--error {
431
+ border-color: color-mix(in srgb, var(--theme-error-500) 35%, transparent);
432
+
433
+ .builder-assistant__chip-icon {
434
+ background: color-mix(in srgb, var(--theme-error-500) 14%, transparent);
435
+ color: var(--theme-error-500);
436
+ }
437
+ }
438
+
439
+ .builder-assistant__chip--warn {
440
+ border-color: color-mix(in srgb, var(--theme-warning-500) 40%, transparent);
441
+
442
+ .builder-assistant__chip-icon {
443
+ background: color-mix(in srgb, var(--theme-warning-500) 16%, transparent);
444
+ color: var(--theme-warning-500);
445
+ }
446
+
447
+ .builder-assistant__chip-note {
448
+ color: var(--theme-elevation-700);
449
+ }
450
+ }
451
+
452
+ .builder-assistant__chip-image {
453
+ display: block;
454
+ width: calc(100% - 24px);
455
+ max-width: 240px;
456
+ max-height: 160px;
457
+ margin: 4px 0 2px 24px;
458
+ border-radius: var(--be-radius);
459
+ background: var(--theme-elevation-100);
460
+ object-fit: cover;
461
+ }
462
+
463
+ // "Show" on a change: pushed to the right end of the chip.
464
+ .builder-assistant__chip-show {
465
+ flex: none;
466
+ margin-left: auto;
467
+ }
468
+
469
+ // The raw error of a failed call, behind "Details".
470
+ .builder-assistant__chip-details {
471
+ padding-left: 24px;
472
+
473
+ summary {
474
+ color: var(--be-muted);
475
+ font-size: var(--be-text-s);
476
+ font-weight: var(--be-weight-regular);
477
+ }
478
+ }
479
+
480
+ .builder-assistant__chip-detail {
481
+ margin: 4px 0 0;
482
+ color: var(--theme-elevation-700);
483
+ font-size: var(--be-text-s);
484
+ line-height: 1.4;
485
+ overflow-wrap: anywhere;
486
+ }
487
+
488
+ .builder-assistant__chip-note {
489
+ padding-left: 24px;
490
+ color: var(--theme-error-500);
491
+ font-size: var(--be-text-s);
492
+ line-height: 1.4;
493
+ }
494
+
495
+ .builder-assistant__spinner {
496
+ width: 12px;
497
+ height: 12px;
498
+ border: 1.5px solid var(--theme-elevation-200);
499
+ border-top-color: var(--theme-elevation-700);
500
+ border-radius: 50%;
501
+ animation: builder-assistant-spin 700ms linear infinite;
502
+ }
503
+
504
+ .builder-assistant__thinking {
505
+ display: inline-flex;
506
+ align-items: center;
507
+ gap: 8px;
508
+ margin: 0;
509
+ color: var(--be-muted);
510
+ font-size: var(--be-text-m);
511
+ }
512
+
513
+ .builder-assistant__dots {
514
+ display: inline-flex;
515
+ gap: 3px;
516
+
517
+ span {
518
+ width: 4px;
519
+ height: 4px;
520
+ border-radius: 50%;
521
+ background: var(--theme-elevation-500);
522
+ animation: builder-assistant-dot 1.2s ease-in-out infinite;
523
+ }
524
+
525
+ span:nth-child(2) {
526
+ animation-delay: 150ms;
527
+ }
528
+
529
+ span:nth-child(3) {
530
+ animation-delay: 300ms;
531
+ }
532
+ }
533
+
534
+ // Notices
535
+ .builder-assistant__info {
536
+ margin: 0;
537
+ color: var(--be-muted);
538
+ font-size: var(--be-text-m);
539
+ text-align: center;
540
+ }
541
+
542
+ .builder-assistant__card {
543
+ display: flex;
544
+ flex-direction: column;
545
+ gap: 8px;
546
+ padding: 12px;
547
+ border: 1px solid var(--be-border);
548
+ border-radius: var(--be-radius-m);
549
+ background: var(--theme-elevation-50);
550
+ }
551
+
552
+ .builder-assistant__details {
553
+ font-size: var(--be-text-m);
554
+
555
+ summary {
556
+ width: fit-content;
557
+ color: var(--theme-elevation-800);
558
+ font-weight: var(--be-weight-medium);
559
+ cursor: pointer;
560
+
561
+ &:focus-visible {
562
+ outline: 2px solid var(--be-accent);
563
+ outline-offset: 2px;
564
+ }
565
+ }
566
+ }
567
+
568
+ .builder-assistant__details-body {
569
+ display: flex;
570
+ flex-direction: column;
571
+ gap: 8px;
572
+ margin-top: 8px;
573
+ padding-top: 8px;
574
+ border-top: 1px solid var(--be-border-soft);
575
+
576
+ .builder-assistant__card-code {
577
+ overflow-x: auto;
578
+ white-space: pre;
579
+ }
580
+ }
581
+
582
+ .builder-assistant__card--error {
583
+ border-color: color-mix(in srgb, var(--theme-error-500) 35%, transparent);
584
+ background: color-mix(in srgb, var(--theme-error-500) 6%, var(--theme-bg));
585
+
586
+ .builder-assistant__card-text svg {
587
+ flex: none;
588
+ margin-top: 2px;
589
+ color: var(--theme-error-500);
590
+ }
591
+ }
592
+
593
+ .builder-assistant__card-title {
594
+ margin: 0;
595
+ font-size: var(--be-text-m);
596
+ font-weight: var(--be-weight-strong);
597
+ }
598
+
599
+ .builder-assistant__card-text {
600
+ display: flex;
601
+ gap: 6px;
602
+ margin: 0;
603
+ color: var(--theme-elevation-800);
604
+ font-size: var(--be-text-m);
605
+ line-height: 1.5;
606
+
607
+ code {
608
+ padding: 1px 4px;
609
+ border-radius: 4px;
610
+ background: var(--theme-elevation-100);
611
+ }
612
+ }
613
+
614
+ .builder-assistant__card-code {
615
+ margin: 0;
616
+ padding: 6px 8px;
617
+ border-radius: var(--be-radius);
618
+ background: var(--theme-elevation-100);
619
+ font-family: var(--font-mono, ui-monospace, monospace);
620
+ font-size: var(--be-text-s);
621
+ }
622
+
623
+ .builder-assistant__card-actions {
624
+ display: flex;
625
+ flex-wrap: wrap;
626
+ align-items: center;
627
+ gap: 6px 12px;
628
+ }
629
+
630
+ .builder-assistant__link,
631
+ .builder-assistant__ghost {
632
+ display: inline-flex;
633
+ align-items: center;
634
+ gap: 4px;
635
+ padding: 0;
636
+ border: 0;
637
+ background: none;
638
+ color: var(--theme-text);
639
+ font-size: var(--be-text-m);
640
+ font-weight: var(--be-weight-medium);
641
+ text-decoration: none;
642
+ cursor: pointer;
643
+
644
+ &:hover {
645
+ color: var(--be-accent-strong);
646
+ text-decoration: underline;
647
+ }
648
+
649
+ &:focus-visible {
650
+ outline: 2px solid var(--be-accent);
651
+ outline-offset: 2px;
652
+ border-radius: var(--be-radius);
653
+ }
654
+ }
655
+
656
+ // ---------------------------------------------------------------------------
657
+ // Empty state
658
+ // ---------------------------------------------------------------------------
659
+
660
+ .builder-assistant__welcome,
661
+ .builder-assistant__empty {
662
+ display: flex;
663
+ flex-direction: column;
664
+ align-items: center;
665
+ gap: 6px;
666
+ padding: 40px 16px 16px;
667
+ text-align: center;
668
+ animation: builder-assistant-in 260ms var(--be-ease) both;
669
+
670
+ .builder-editor__hint {
671
+ max-width: 260px;
672
+ }
673
+ }
674
+
675
+ .builder-assistant__mark {
676
+ display: grid;
677
+ place-items: center;
678
+ width: 44px;
679
+ height: 44px;
680
+ margin-bottom: 6px;
681
+ border-radius: 12px;
682
+ background: var(--theme-elevation-100);
683
+ color: var(--be-muted);
684
+ }
685
+
686
+ .builder-assistant__empty-title {
687
+ margin: 0;
688
+ font-size: var(--be-text-l);
689
+ font-weight: var(--be-weight-strong);
690
+ }
691
+
692
+ .builder-assistant__suggestions {
693
+ display: flex;
694
+ flex-direction: column;
695
+ gap: 6px;
696
+ width: 100%;
697
+ margin-top: 18px;
698
+ }
699
+
700
+ .builder-assistant__suggestion {
701
+ display: flex;
702
+ align-items: center;
703
+ gap: 8px;
704
+ width: 100%;
705
+ padding: 8px 10px;
706
+ border: 1px solid var(--be-border);
707
+ border-radius: var(--be-radius-m);
708
+ background: var(--theme-bg);
709
+ color: var(--theme-elevation-800);
710
+ font-size: var(--be-text-m);
711
+ line-height: 1.35;
712
+ text-align: left;
713
+ cursor: pointer;
714
+ transition: border-color 120ms ease, background-color 120ms ease, color 120ms ease;
715
+
716
+ &:hover {
717
+ border-color: var(--theme-elevation-300);
718
+ background: var(--be-hover);
719
+ color: var(--theme-text);
720
+ }
721
+
722
+ &:focus-visible {
723
+ outline: 2px solid var(--be-accent);
724
+ outline-offset: 2px;
725
+ }
726
+ }
727
+
728
+ // ---------------------------------------------------------------------------
729
+ // Composer
730
+ // ---------------------------------------------------------------------------
731
+
732
+ .builder-assistant__composer {
733
+ display: flex;
734
+ flex: none;
735
+ flex-direction: column;
736
+ gap: 8px;
737
+ padding: 10px 12px 10px;
738
+ border-top: 1px solid var(--be-border-soft);
739
+ }
740
+
741
+ .builder-assistant__context {
742
+ display: flex;
743
+ flex-wrap: wrap;
744
+ gap: 4px;
745
+ min-width: 0;
746
+ }
747
+
748
+ .builder-assistant__context-chip {
749
+ display: inline-flex;
750
+ align-items: center;
751
+ gap: 5px;
752
+ max-width: 100%;
753
+ height: 22px;
754
+ padding: 0 8px;
755
+ border-radius: 11px;
756
+ background: var(--theme-elevation-100);
757
+ color: var(--be-muted);
758
+ font-size: var(--be-text-s);
759
+ font-weight: var(--be-weight-medium);
760
+ }
761
+
762
+ .builder-assistant__context-chip--selected {
763
+ padding-right: 3px;
764
+ background: var(--be-accent-soft);
765
+ color: var(--theme-text);
766
+
767
+ > svg {
768
+ color: var(--be-accent-text);
769
+ }
770
+ }
771
+
772
+ .builder-assistant__context-text {
773
+ min-width: 0;
774
+ overflow: hidden;
775
+ text-overflow: ellipsis;
776
+ white-space: nowrap;
777
+ }
778
+
779
+ .builder-assistant__context-clear {
780
+ display: inline-grid;
781
+ flex: none;
782
+ place-items: center;
783
+ width: 16px;
784
+ height: 16px;
785
+ padding: 0;
786
+ border: 0;
787
+ border-radius: 50%;
788
+ background: transparent;
789
+ color: var(--be-muted);
790
+ cursor: pointer;
791
+
792
+ &:hover {
793
+ background: var(--theme-elevation-150);
794
+ color: var(--theme-text);
795
+ }
796
+
797
+ &:focus-visible {
798
+ outline: 2px solid var(--be-accent);
799
+ outline-offset: 1px;
800
+ }
801
+ }
802
+
803
+ .builder-assistant__field {
804
+ display: flex;
805
+ align-items: flex-end;
806
+ gap: 6px;
807
+ padding: 6px 6px 6px 10px;
808
+ border: 1px solid var(--theme-elevation-150);
809
+ border-radius: 10px;
810
+ background: var(--theme-input-bg, var(--theme-elevation-0));
811
+ transition: border-color 120ms ease, box-shadow 120ms ease;
812
+
813
+ &:focus-within {
814
+ border-color: var(--ba-accent);
815
+ box-shadow: 0 0 0 3px var(--ba-accent-soft);
816
+ }
817
+
818
+ &[data-disabled] {
819
+ background: var(--theme-elevation-50);
820
+ }
821
+ }
822
+
823
+ .builder-assistant__input {
824
+ flex: 1;
825
+ min-width: 0;
826
+ min-height: 24px;
827
+ max-height: 168px;
828
+ margin: 0;
829
+ padding: 3px 0;
830
+ border: 0;
831
+ background: transparent;
832
+ color: var(--theme-text);
833
+ font-family: inherit;
834
+ font-size: var(--be-text-m);
835
+ line-height: 18px;
836
+ resize: none;
837
+ outline: none;
838
+
839
+ &::placeholder {
840
+ color: var(--be-subtle);
841
+ }
842
+
843
+ &:focus-visible {
844
+ outline: none;
845
+ }
846
+
847
+ &:disabled {
848
+ cursor: default;
849
+ }
850
+ }
851
+
852
+ // The primary button, as Payload colors it: solid text color on the page color.
853
+ .builder-assistant__send {
854
+ display: inline-grid;
855
+ flex: none;
856
+ place-items: center;
857
+ width: 28px;
858
+ height: 28px;
859
+ padding: 0;
860
+ border: 0;
861
+ border-radius: 8px;
862
+ background: var(--theme-elevation-800);
863
+ color: var(--theme-elevation-0);
864
+ cursor: pointer;
865
+ transition: opacity 120ms ease, background-color 120ms ease, transform 120ms ease;
866
+
867
+ &:hover:not(:disabled) {
868
+ background: var(--theme-text);
869
+ }
870
+
871
+ &:active:not(:disabled) {
872
+ transform: scale(0.94);
873
+ }
874
+
875
+ &:disabled {
876
+ background: var(--theme-elevation-150);
877
+ color: var(--be-subtle);
878
+ cursor: default;
879
+ }
880
+
881
+ &:focus-visible {
882
+ outline: 2px solid var(--be-accent);
883
+ outline-offset: 2px;
884
+ }
885
+ }
886
+
887
+ .builder-assistant__send--stop {
888
+ background: var(--theme-elevation-150);
889
+ color: var(--theme-text);
890
+
891
+ &:hover:not(:disabled) {
892
+ background: var(--theme-elevation-250, var(--theme-elevation-200));
893
+ }
894
+ }
895
+
896
+ .builder-assistant__foot {
897
+ display: flex;
898
+ align-items: center;
899
+ justify-content: space-between;
900
+ gap: 8px;
901
+ min-width: 0;
902
+ }
903
+
904
+ .builder-assistant__footnote {
905
+ display: flex;
906
+ flex: 1;
907
+ min-width: 0;
908
+ flex-wrap: wrap;
909
+ align-items: center;
910
+ gap: 3px;
911
+ margin: 0;
912
+ color: var(--be-muted);
913
+ font-size: var(--be-text-s);
914
+
915
+ kbd {
916
+ min-width: 0;
917
+ height: 16px;
918
+ padding: 0 4px;
919
+ border-bottom-width: 1px;
920
+ font-size: var(--be-text-s);
921
+ }
922
+ }
923
+
924
+ @media (prefers-reduced-motion: reduce) {
925
+ .builder-assistant__user,
926
+ .builder-assistant__turn,
927
+ .builder-assistant__card,
928
+ .builder-assistant__info,
929
+ .builder-assistant__chip,
930
+ .builder-assistant__welcome,
931
+ .builder-assistant__empty {
932
+ animation: none;
933
+ }
934
+
935
+ .builder-assistant__text--streaming .builder-assistant__md > *::after,
936
+ .builder-assistant__dots span {
937
+ animation: none;
938
+ }
939
+
940
+ .builder-assistant__spinner {
941
+ animation-duration: 2s;
942
+ }
943
+ }
944
+ }