@tagit/ai-client-react 0.1.3-beta.1 → 0.3.0-beta.1

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.
@@ -264,6 +264,8 @@
264
264
  min-height: 0;
265
265
  overflow: hidden;
266
266
  background: var(--tagIt-chat-panel-body-bg);
267
+ display: flex;
268
+ flex-direction: column;
267
269
  }
268
270
 
269
271
  .tagIt-chat-theme-dark {
@@ -273,7 +275,7 @@
273
275
  --tagIt-chat-muted: #9aa8c0;
274
276
  --tagIt-chat-border: #22324f;
275
277
  --tagIt-chat-primary: #60a5fa;
276
- --tagIt-chat-primary-contrast: #081225;
278
+ --tagIt-chat-primary-contrast: #ffffff;
277
279
  --tagIt-chat-tab-bg: #1d4ed8;
278
280
  --tagIt-chat-tab-text: #eaf2ff;
279
281
  --tagIt-chat-panel-header-bg: #111b30;
@@ -282,7 +284,7 @@
282
284
  --tagIt-chat-panel-footer-prompt-bg: #0f172a;
283
285
  --tagIt-chat-panel-footer-send-bg: #60a5fa;
284
286
  --tagIt-chat-panel-footer-send-text: #081225;
285
- --tagIt-chat-user-bubble-bg: #1d4ed8;
287
+ --tagIt-chat-user-bubble-bg: #2563eb;
286
288
  --tagIt-chat-assistant-bubble-bg: #1e293b;
287
289
  --tagIt-chat-scrim: rgba(3, 8, 18, 0.62);
288
290
  }
@@ -312,6 +314,31 @@
312
314
  border-right: 1px solid var(--tagIt-chat-border);
313
315
  }
314
316
 
317
+ .tagIt-chat-widget-inline.tagIt-chat-widget-dock-viewport {
318
+ position: fixed;
319
+ top: 0;
320
+ right: 0;
321
+ bottom: 0;
322
+ z-index: 80;
323
+ width: min(100vw, var(--tagIt-chat-panel-width));
324
+ max-width: 100vw;
325
+ height: 100dvh;
326
+ overflow: visible;
327
+ }
328
+
329
+ .tagIt-chat-widget-inline.tagIt-chat-widget-dock-viewport.tagIt-chat-side-left {
330
+ left: 0;
331
+ right: auto;
332
+ }
333
+
334
+ .tagIt-chat-widget-inline.tagIt-chat-widget-dock-viewport.tagIt-chat-widget-open {
335
+ width: min(100vw, var(--tagIt-chat-panel-width));
336
+ }
337
+
338
+ .tagIt-chat-widget-inline.tagIt-chat-widget-dock-viewport.tagIt-chat-widget-closed {
339
+ width: 0;
340
+ }
341
+
315
342
  .tagIt-chat-widget-inline .tagIt-chat-panel {
316
343
  position: absolute;
317
344
  top: 0;
@@ -390,3 +417,593 @@
390
417
  display: none;
391
418
  }
392
419
  }
420
+
421
+ /* =============================================================
422
+ Self-contained conversation surface
423
+ ============================================================= */
424
+
425
+ .tagIt-chat-conversation {
426
+ display: flex;
427
+ flex-direction: column;
428
+ height: 100%;
429
+ max-width: 100%;
430
+ background: var(--tagIt-chat-panel-body-bg, transparent);
431
+ position: relative;
432
+ min-height: 0;
433
+ }
434
+
435
+ .tagIt-chat-viewport {
436
+ flex: 1;
437
+ overflow-y: auto;
438
+ padding: 16px;
439
+ display: flex;
440
+ flex-direction: column;
441
+ gap: 16px;
442
+ -webkit-overflow-scrolling: touch;
443
+ }
444
+
445
+ .tagIt-chat-viewport::-webkit-scrollbar {
446
+ width: 8px;
447
+ }
448
+
449
+ .tagIt-chat-viewport::-webkit-scrollbar-track {
450
+ background: color-mix(in srgb, var(--tagIt-chat-border) 30%, transparent);
451
+ }
452
+
453
+ .tagIt-chat-viewport::-webkit-scrollbar-thumb {
454
+ background: color-mix(in srgb, var(--tagIt-chat-border) 80%, var(--tagIt-chat-text));
455
+ border-radius: 999px;
456
+ }
457
+
458
+ .tagIt-chat-viewport::-webkit-scrollbar-thumb:hover {
459
+ background: color-mix(in srgb, var(--tagIt-chat-border) 60%, var(--tagIt-chat-text));
460
+ }
461
+
462
+ .tagIt-chat-empty {
463
+ display: flex;
464
+ flex-direction: column;
465
+ align-items: center;
466
+ justify-content: center;
467
+ flex: 1;
468
+ min-height: 60%;
469
+ text-align: center;
470
+ padding: 24px;
471
+ }
472
+
473
+ .tagIt-chat-empty-icon {
474
+ font-size: 40px;
475
+ margin-bottom: 12px;
476
+ line-height: 1;
477
+ }
478
+
479
+ .tagIt-chat-empty-title {
480
+ font-size: 18px;
481
+ font-weight: 600;
482
+ margin: 0 0 6px;
483
+ color: var(--tagIt-chat-text);
484
+ }
485
+
486
+ .tagIt-chat-empty-subtitle {
487
+ font-size: 14px;
488
+ margin: 0;
489
+ color: var(--tagIt-chat-muted);
490
+ }
491
+
492
+ .tagIt-chat-message {
493
+ display: flex;
494
+ flex-direction: column;
495
+ width: 100%;
496
+ }
497
+
498
+ .tagIt-chat-message[data-role="user"] .tagIt-chat-message-body {
499
+ display: flex;
500
+ justify-content: flex-end;
501
+ }
502
+
503
+ .tagIt-chat-message[data-role="user"] .tagIt-chat-message-bubble {
504
+ max-width: 80%;
505
+ background: var(--tagIt-chat-user-bubble-bg);
506
+ color: var(--tagIt-chat-primary-contrast);
507
+ border-radius: 18px 18px 4px 18px;
508
+ padding: 8px 14px;
509
+ font-size: 14px;
510
+ line-height: 1.5;
511
+ word-break: break-word;
512
+ white-space: pre-wrap;
513
+ }
514
+
515
+ .tagIt-chat-message[data-role="assistant"] .tagIt-chat-message-body {
516
+ width: 100%;
517
+ }
518
+
519
+ .tagIt-chat-assistant-content {
520
+ font-size: 14px;
521
+ line-height: 1.6;
522
+ white-space: pre-wrap;
523
+ word-break: break-word;
524
+ color: var(--tagIt-chat-text);
525
+ }
526
+
527
+ .tagIt-chat-md-root {
528
+ color: var(--tagIt-chat-text);
529
+ }
530
+
531
+ .tagIt-chat-md-streaming {
532
+ white-space: pre-wrap;
533
+ word-break: break-word;
534
+ line-height: 1.65;
535
+ }
536
+
537
+ .tagIt-chat-md-root > *:first-child {
538
+ margin-top: 0;
539
+ }
540
+
541
+ .tagIt-chat-md-root > *:last-child {
542
+ margin-bottom: 0;
543
+ }
544
+
545
+ .tagIt-chat-md-root p {
546
+ margin: 0 0 3px;
547
+ line-height: 1.5;
548
+ }
549
+
550
+ .tagIt-chat-md-root h1,
551
+ .tagIt-chat-md-root h2,
552
+ .tagIt-chat-md-root h3,
553
+ .tagIt-chat-md-root h4 {
554
+ margin: 6px 0 2px;
555
+ line-height: 1.2;
556
+ color: var(--tagIt-chat-text);
557
+ }
558
+
559
+ .tagIt-chat-md-root h1 { font-size: 1.25rem; }
560
+ .tagIt-chat-md-root h2 { font-size: 1.15rem; }
561
+ .tagIt-chat-md-root h3 { font-size: 1.05rem; }
562
+ .tagIt-chat-md-root h4 { font-size: 1rem; }
563
+
564
+ .tagIt-chat-md-root ul,
565
+ .tagIt-chat-md-root ol {
566
+ margin: 0 0 3px 16px;
567
+ padding: 0;
568
+ }
569
+
570
+ .tagIt-chat-md-root li {
571
+ margin-bottom: 1px;
572
+ }
573
+
574
+ .tagIt-chat-md-root li > p {
575
+ margin: 0;
576
+ }
577
+
578
+ .tagIt-chat-md-root h1 + *,
579
+ .tagIt-chat-md-root h2 + *,
580
+ .tagIt-chat-md-root h3 + *,
581
+ .tagIt-chat-md-root h4 + * {
582
+ margin-top: 0;
583
+ }
584
+
585
+ .tagIt-chat-md-root blockquote {
586
+ margin: 4px 0;
587
+ padding: 4px 10px;
588
+ border-left: 3px solid color-mix(in srgb, var(--tagIt-chat-primary) 50%, transparent);
589
+ background: color-mix(in srgb, var(--tagIt-chat-border) 30%, transparent);
590
+ border-radius: 8px;
591
+ }
592
+
593
+ .tagIt-chat-md-root table {
594
+ width: 100%;
595
+ border-collapse: collapse;
596
+ margin: 4px 0;
597
+ font-size: 13px;
598
+ }
599
+
600
+ .tagIt-chat-md-root th,
601
+ .tagIt-chat-md-root td {
602
+ border: 1px solid color-mix(in srgb, var(--tagIt-chat-border) 75%, transparent);
603
+ padding: 4px 8px;
604
+ text-align: left;
605
+ }
606
+
607
+ .tagIt-chat-md-root th {
608
+ background: color-mix(in srgb, var(--tagIt-chat-border) 35%, transparent);
609
+ }
610
+
611
+ .tagIt-chat-md-root a {
612
+ color: var(--tagIt-chat-primary);
613
+ text-decoration: underline;
614
+ text-underline-offset: 2px;
615
+ }
616
+
617
+ .tagIt-chat-md-inline-code {
618
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
619
+ font-size: 0.9em;
620
+ padding: 1px 5px;
621
+ border-radius: 6px;
622
+ background: color-mix(in srgb, var(--tagIt-chat-border) 40%, transparent);
623
+ }
624
+
625
+ .tagIt-chat-md-code-block {
626
+ position: relative;
627
+ margin: 6px 0;
628
+ padding: 8px 12px;
629
+ border-radius: 10px;
630
+ background: color-mix(in srgb, var(--tagIt-chat-border) 30%, transparent);
631
+ overflow-x: auto;
632
+ }
633
+
634
+ .tagIt-chat-md-code-block .hljs {
635
+ background: transparent;
636
+ color: var(--tagIt-chat-text);
637
+ padding: 0;
638
+ }
639
+
640
+ .tagIt-chat-md-copy-btn {
641
+ position: absolute;
642
+ top: 6px;
643
+ right: 8px;
644
+ display: flex;
645
+ align-items: center;
646
+ justify-content: center;
647
+ width: 26px;
648
+ height: 26px;
649
+ padding: 0;
650
+ border-radius: 6px;
651
+ border: 1px solid color-mix(in srgb, var(--tagIt-chat-border) 80%, transparent);
652
+ background: color-mix(in srgb, var(--tagIt-chat-border) 40%, transparent);
653
+ color: var(--tagIt-chat-text);
654
+ cursor: pointer;
655
+ opacity: 0;
656
+ transition: opacity 0.15s, background 0.15s;
657
+ }
658
+
659
+ .tagIt-chat-md-code-block:hover .tagIt-chat-md-copy-btn,
660
+ .tagIt-chat-md-copy-btn:focus-visible {
661
+ opacity: 1;
662
+ }
663
+
664
+ .tagIt-chat-md-copy-btn[data-copied] {
665
+ opacity: 1;
666
+ color: #22c55e;
667
+ }
668
+
669
+ .tagIt-chat-md-code-block code {
670
+ font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
671
+ font-size: 12px;
672
+ }
673
+
674
+ .tagIt-chat-chart-wrap {
675
+ margin: 12px 0;
676
+ padding: 10px;
677
+ border-radius: 10px;
678
+ border: 1px solid color-mix(in srgb, var(--tagIt-chat-border) 70%, transparent);
679
+ background: color-mix(in srgb, var(--tagIt-chat-bg) 70%, var(--tagIt-chat-border));
680
+ min-width: 0;
681
+ overflow: hidden;
682
+ }
683
+
684
+ .tagIt-chat-chart-wrap :where(.recharts-wrapper) {
685
+ font-size: 12px;
686
+ }
687
+
688
+ .tagIt-chat-chart-wrap :where(.recharts-legend-wrapper) {
689
+ white-space: normal !important;
690
+ word-break: break-word;
691
+ }
692
+
693
+ .tagIt-chat-chart-wrap :where(.recharts-legend-item-text) {
694
+ white-space: normal !important;
695
+ }
696
+
697
+ @keyframes tagItChatBlinkCursor {
698
+ 0%, 100% { opacity: 1; transform: scale(1); }
699
+ 50% { opacity: 0.2; transform: scale(0.8); }
700
+ }
701
+
702
+ .tagIt-chat-streaming-cursor {
703
+ display: inline-block;
704
+ width: 7px;
705
+ height: 7px;
706
+ border-radius: 50%;
707
+ background-color: var(--tagIt-chat-primary);
708
+ margin-left: 4px;
709
+ vertical-align: middle;
710
+ animation: tagItChatBlinkCursor 1s ease-in-out infinite;
711
+ }
712
+
713
+ .tagIt-chat-tool-calls {
714
+ margin-top: 10px;
715
+ padding-top: 8px;
716
+ border-top: 1px solid color-mix(in srgb, var(--tagIt-chat-border) 75%, transparent);
717
+ display: flex;
718
+ flex-direction: column;
719
+ gap: 4px;
720
+ }
721
+
722
+ .tagIt-chat-tool-call {
723
+ display: flex;
724
+ align-items: center;
725
+ gap: 8px;
726
+ font-size: 12px;
727
+ padding: 4px 8px;
728
+ background: color-mix(in srgb, var(--tagIt-chat-border) 35%, transparent);
729
+ border-radius: 4px;
730
+ }
731
+
732
+ .tagIt-chat-tool-name {
733
+ font-weight: 600;
734
+ font-family: monospace;
735
+ color: var(--tagIt-chat-text);
736
+ }
737
+
738
+ .tagIt-chat-tool-status {
739
+ font-size: 10px;
740
+ padding: 2px 6px;
741
+ border-radius: 3px;
742
+ text-transform: uppercase;
743
+ font-weight: 500;
744
+ }
745
+
746
+ .tagIt-chat-tool-status-pending {
747
+ background: #ffd700;
748
+ color: #333;
749
+ }
750
+
751
+ .tagIt-chat-tool-status-success {
752
+ background: #90ee90;
753
+ color: #333;
754
+ }
755
+
756
+ .tagIt-chat-tool-status-error {
757
+ background: #ff6b6b;
758
+ color: white;
759
+ }
760
+
761
+ .tagIt-chat-typing-indicator {
762
+ display: flex;
763
+ gap: 5px;
764
+ align-items: center;
765
+ padding: 4px 0;
766
+ }
767
+
768
+ .tagIt-chat-typing-indicator span {
769
+ display: inline-block;
770
+ width: 8px;
771
+ height: 8px;
772
+ border-radius: 50%;
773
+ background: var(--tagIt-chat-muted);
774
+ animation: tagItChatTypingBounce 1.4s infinite ease-in-out;
775
+ }
776
+
777
+ .tagIt-chat-typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
778
+ .tagIt-chat-typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
779
+
780
+ @keyframes tagItChatTypingBounce {
781
+ 0%,
782
+ 60%,
783
+ 100% {
784
+ transform: translateY(0);
785
+ opacity: 0.4;
786
+ }
787
+ 30% {
788
+ transform: translateY(-8px);
789
+ opacity: 1;
790
+ }
791
+ }
792
+
793
+ .tagIt-chat-error-row {
794
+ display: flex;
795
+ align-items: center;
796
+ gap: 10px;
797
+ padding: 10px 12px;
798
+ background: color-mix(in srgb, #ef4444 10%, transparent);
799
+ border: 1px solid color-mix(in srgb, #ef4444 30%, transparent);
800
+ border-radius: 8px;
801
+ font-size: 13px;
802
+ }
803
+
804
+ .tagIt-chat-error-text {
805
+ flex: 1;
806
+ color: color-mix(in srgb, #ef4444 85%, var(--tagIt-chat-text));
807
+ }
808
+
809
+ .tagIt-chat-error-retry {
810
+ flex-shrink: 0;
811
+ padding: 4px 12px;
812
+ border-radius: 6px;
813
+ font-size: 12px;
814
+ font-weight: 500;
815
+ background: transparent;
816
+ border: 1px solid color-mix(in srgb, #ef4444 50%, transparent);
817
+ color: color-mix(in srgb, #ef4444 85%, var(--tagIt-chat-text));
818
+ cursor: pointer;
819
+ transition: background 0.15s;
820
+ }
821
+
822
+ .tagIt-chat-error-retry:hover {
823
+ background: color-mix(in srgb, #ef4444 15%, transparent);
824
+ }
825
+
826
+ .tagIt-chat-viewport-slack {
827
+ flex-shrink: 0;
828
+ min-height: 40%;
829
+ }
830
+
831
+ .tagIt-chat-scroll-to-bottom-anchor {
832
+ position: relative;
833
+ height: 0;
834
+ flex-shrink: 0;
835
+ }
836
+
837
+ .tagIt-chat-scroll-to-bottom-wrap {
838
+ position: absolute;
839
+ bottom: 12px;
840
+ left: 50%;
841
+ transform: translateX(-50%);
842
+ z-index: 10;
843
+ opacity: 0;
844
+ pointer-events: none;
845
+ transition: opacity 0.2s ease;
846
+ }
847
+
848
+ .tagIt-chat-scroll-to-bottom-wrap[data-visible] {
849
+ opacity: 1;
850
+ pointer-events: auto;
851
+ }
852
+
853
+ .tagIt-chat-scroll-to-bottom {
854
+ display: flex;
855
+ align-items: center;
856
+ justify-content: center;
857
+ width: 36px;
858
+ height: 36px;
859
+ border-radius: 50%;
860
+ background: var(--tagIt-chat-bg, white);
861
+ color: var(--tagIt-chat-text);
862
+ border: 1px solid var(--tagIt-chat-border);
863
+ font-size: 16px;
864
+ cursor: pointer;
865
+ box-shadow: 0 2px 8px color-mix(in srgb, var(--tagIt-chat-text) 20%, transparent);
866
+ transition: transform 0.15s ease, box-shadow 0.15s ease;
867
+ }
868
+
869
+ .tagIt-chat-scroll-to-bottom:hover {
870
+ transform: translateY(-1px);
871
+ box-shadow: 0 4px 12px color-mix(in srgb, var(--tagIt-chat-text) 25%, transparent);
872
+ }
873
+
874
+ .tagIt-chat-input-form {
875
+ padding: 10px 12px;
876
+ border-top: 1px solid var(--tagIt-chat-border);
877
+ background: var(--tagIt-chat-panel-footer-bg);
878
+ flex-shrink: 0;
879
+ }
880
+
881
+ .tagIt-chat-input-wrap {
882
+ position: relative;
883
+ display: flex;
884
+ flex-direction: column;
885
+ border: 1px solid var(--tagIt-chat-border);
886
+ border-radius: 14px;
887
+ background: var(--tagIt-chat-panel-footer-prompt-bg);
888
+ transition: border-color 0.2s;
889
+ }
890
+
891
+ .tagIt-chat-input-wrap:focus-within {
892
+ border-color: var(--tagIt-chat-primary);
893
+ }
894
+
895
+ .tagIt-chat-input {
896
+ flex: 1;
897
+ min-width: 0;
898
+ border: none;
899
+ border-radius: 14px 14px 0 0;
900
+ padding: 10px 14px 4px;
901
+ font-size: 14px;
902
+ font-family: inherit;
903
+ background: transparent;
904
+ color: var(--tagIt-chat-text);
905
+ outline: none;
906
+ resize: none;
907
+ min-height: 66px;
908
+ max-height: 200px;
909
+ overflow-y: auto;
910
+ line-height: 1.5;
911
+ }
912
+
913
+ .tagIt-chat-input::placeholder {
914
+ color: var(--tagIt-chat-muted);
915
+ }
916
+
917
+ .tagIt-chat-input:disabled {
918
+ background: color-mix(in srgb, var(--tagIt-chat-panel-footer-prompt-bg) 84%, var(--tagIt-chat-border));
919
+ color: var(--tagIt-chat-muted);
920
+ cursor: not-allowed;
921
+ }
922
+
923
+ .tagIt-chat-input-actions {
924
+ display: flex;
925
+ justify-content: flex-end;
926
+ padding: 6px 8px;
927
+ }
928
+
929
+ .tagIt-chat-send-button {
930
+ padding: 8px 18px;
931
+ border-radius: 20px;
932
+ font-size: 14px;
933
+ font-weight: 500;
934
+ background: var(--tagIt-chat-primary);
935
+ color: var(--tagIt-chat-primary-contrast);
936
+ border: none;
937
+ cursor: pointer;
938
+ transition: opacity 0.15s;
939
+ }
940
+
941
+ .tagIt-chat-send-button:hover:not(:disabled) {
942
+ opacity: 0.9;
943
+ }
944
+
945
+ .tagIt-chat-send-button:disabled {
946
+ opacity: 0.4;
947
+ cursor: not-allowed;
948
+ }
949
+
950
+ .tagIt-chat-stop-button {
951
+ padding: 8px 18px;
952
+ border-radius: 20px;
953
+ font-size: 14px;
954
+ font-weight: 500;
955
+ background: transparent;
956
+ color: var(--tagIt-chat-text);
957
+ border: 1px solid var(--tagIt-chat-border);
958
+ cursor: pointer;
959
+ transition: background 0.15s;
960
+ }
961
+
962
+ .tagIt-chat-stop-button:hover {
963
+ background: color-mix(in srgb, var(--tagIt-chat-border) 50%, transparent);
964
+ }
965
+
966
+ .tagIt-chat-message-actions {
967
+ display: flex;
968
+ gap: 4px;
969
+ margin-top: 6px;
970
+ opacity: 0;
971
+ transition: opacity 0.15s;
972
+ }
973
+
974
+ .tagIt-chat-message:hover .tagIt-chat-message-actions,
975
+ .tagIt-chat-message-actions:focus-within {
976
+ opacity: 1;
977
+ }
978
+
979
+ .tagIt-chat-message[data-role="user"] .tagIt-chat-message-actions {
980
+ justify-content: flex-end;
981
+ }
982
+
983
+ .tagIt-chat-message-action-btn {
984
+ display: flex;
985
+ align-items: center;
986
+ justify-content: center;
987
+ width: 26px;
988
+ height: 26px;
989
+ padding: 0;
990
+ font-size: 11px;
991
+ font-family: inherit;
992
+ line-height: 1;
993
+ border-radius: 6px;
994
+ border: 1px solid color-mix(in srgb, var(--tagIt-chat-border) 80%, transparent);
995
+ background: color-mix(in srgb, var(--tagIt-chat-border) 35%, transparent);
996
+ color: var(--tagIt-chat-muted);
997
+ cursor: pointer;
998
+ transition: background 0.12s, color 0.12s;
999
+ }
1000
+
1001
+ .tagIt-chat-message-action-btn:hover,
1002
+ .tagIt-chat-message-action-btn:focus-visible {
1003
+ background: color-mix(in srgb, var(--tagIt-chat-border) 60%, transparent);
1004
+ color: var(--tagIt-chat-text);
1005
+ }
1006
+
1007
+ .tagIt-chat-message-action-btn[data-copied] {
1008
+ color: #22c55e;
1009
+ }