chordia-ui 3.7.0 → 3.7.2

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.
Files changed (36) hide show
  1. package/dist/ChatMessage.cjs.js +15 -0
  2. package/dist/ChatMessage.cjs.js.map +1 -0
  3. package/dist/ChatMessage.es.js +915 -0
  4. package/dist/ChatMessage.es.js.map +1 -0
  5. package/dist/SideDrawer.cjs.js +2 -0
  6. package/dist/SideDrawer.cjs.js.map +1 -0
  7. package/dist/SideDrawer.es.js +358 -0
  8. package/dist/SideDrawer.es.js.map +1 -0
  9. package/dist/Toast.cjs.js +2 -2
  10. package/dist/Toast.cjs.js.map +1 -1
  11. package/dist/Toast.es.js +301 -671
  12. package/dist/Toast.es.js.map +1 -1
  13. package/dist/components/UpdatedInteractionDetails.cjs.js +4 -4
  14. package/dist/components/UpdatedInteractionDetails.cjs.js.map +1 -1
  15. package/dist/components/UpdatedInteractionDetails.es.js +652 -603
  16. package/dist/components/UpdatedInteractionDetails.es.js.map +1 -1
  17. package/dist/components/chat.cjs.js +5 -7
  18. package/dist/components/chat.cjs.js.map +1 -1
  19. package/dist/components/chat.es.js +393 -849
  20. package/dist/components/chat.es.js.map +1 -1
  21. package/dist/components/common.cjs.js +1 -1
  22. package/dist/components/common.es.js +28 -27
  23. package/dist/components/common.es.js.map +1 -1
  24. package/dist/index.cjs.js +1 -1
  25. package/dist/index.es.js +73 -72
  26. package/dist/index.es.js.map +1 -1
  27. package/package.json +1 -1
  28. package/src/components/UpdatedInteractionDetails/UpdatedInteractionContext.jsx +6 -2
  29. package/src/components/UpdatedInteractionDetails/UpdatedInteractionDetails.jsx +190 -139
  30. package/src/components/chat/ChartRenderer.jsx +300 -49
  31. package/src/components/common/AskCompass.jsx +91 -87
  32. package/src/components/common/SideDrawer.jsx +7 -3
  33. package/dist/ChartRenderer.cjs.js +0 -3
  34. package/dist/ChartRenderer.cjs.js.map +0 -1
  35. package/dist/ChartRenderer.es.js +0 -304
  36. package/dist/ChartRenderer.es.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { useState, useRef, useEffect } from 'react';
2
- import { ArrowLeft, ArrowRight, CalendarDays, PhoneIncoming, ClipboardList, FileSignal, Repeat, ChevronDown, ChevronUp, Headset, CircleUser, History, ExternalLink } from 'lucide-react';
2
+ import { ArrowLeft, ArrowRight, CalendarDays, PhoneIncoming, ClipboardList, FileSignal, Repeat, ChevronDown, ChevronRight, Headset, CircleUser, History, ExternalLink, Mail } from 'lucide-react';
3
3
  import UpdatedInteractionContext from './UpdatedInteractionContext';
4
4
  import UpdatedInteractionRecording from './UpdatedInteractionRecording';
5
5
  import UpdatedInteractionScores from './UpdatedInteractionScores';
@@ -8,6 +8,7 @@ import UpdatedInteractionSignals from './UpdatedInteractionSignals';
8
8
  import UpdatedCompassScore from './UpdatedCompassScore';
9
9
  import UpdatedThreads from './UpdatedThreads';
10
10
  import UpdatedGuidance from './UpdatedGuidance';
11
+ import SideDrawer from '../common/SideDrawer';
11
12
 
12
13
  /* Hover tooltip — fixed position to escape overflow containers.
13
14
  Anchored below the trigger. */
@@ -124,7 +125,7 @@ const UpdatedInteractionDetails = ({
124
125
  predictedCsat, // predicted objective number (e.g. compass_score) — shown as "03" top-right
125
126
  predictedLabel = 'Predicted Objective',
126
127
  compassLegends,
127
- // Customer session dropdown
128
+ // Customer session history drawer
128
129
  customerSessions: customerSessionsList,
129
130
  customerSessionCount,
130
131
  onSessionClick,
@@ -152,7 +153,7 @@ const UpdatedInteractionDetails = ({
152
153
  }) => {
153
154
  const [activeTab, setActiveTab] = useState('overview');
154
155
  const [expandedSignals, setExpandedSignals] = useState(new Set());
155
- const [showSessionDropdown, setShowSessionDropdown] = useState(false);
156
+ const [showSessionDrawer, setShowSessionDrawer] = useState(false);
156
157
  const [hoveredSessionIdx, setHoveredSessionIdx] = useState(null);
157
158
  const [internalPlaying, setInternalPlaying] = useState(false);
158
159
  const [internalCurrentTime, setInternalCurrentTime] = useState(0);
@@ -259,6 +260,7 @@ const UpdatedInteractionDetails = ({
259
260
  };
260
261
 
261
262
  const sessionHistory = customerSessionsList || [];
263
+ const hasPastSessions = sessionHistory.length > 1;
262
264
 
263
265
  /* Called from Signals/Guidance "Show in transcript" icon —
264
266
  switches to Signals section, then scrolls/highlights transcript card without playing audio. */
@@ -680,154 +682,61 @@ const UpdatedInteractionDetails = ({
680
682
  </NameTooltip>
681
683
 
682
684
  {/* Repeat icon */}
683
- <Repeat size={16} color="var(--color-input-border, #ACACAD)" strokeWidth={1.5} />
685
+ {/* <Repeat size={16} color="var(--color-input-border, #ACACAD)" strokeWidth={1.5} /> */}
684
686
 
685
- {/* Customer — CircleUser icon + dropdown (only if > 1 session) */}
687
+ {/* Customer — CircleUser icon + side drawer trigger (only if > 1 session) */}
686
688
  {sessionCount > 1 ? (
687
- <div style={{ position: 'relative' }}>
689
+ <div>
688
690
  <NameTooltip text={customerFullName}>
689
691
  <button
690
- onClick={() => setShowSessionDropdown((prev) => !prev)}
692
+ onClick={() => setShowSessionDrawer(true)}
691
693
  style={{
692
- display: 'flex', alignItems: 'center', gap: 4, padding: '8px 0',
693
- background: 'none', border: 'none', cursor: 'pointer',
694
+ display: 'flex',
695
+ alignItems: 'center',
696
+ gap: 16,
697
+ padding: '0 16px',
698
+ height: 34,
699
+ borderRadius: 8,
700
+ background: 'var(--Rail-Surface-2, #E3E1D7)',
701
+ border: 'none',
702
+ cursor: 'pointer',
694
703
  }}
695
704
  >
696
- <CircleUser size={16} color="var(--Grey-Muted, #808183)" strokeWidth={1.5} />
697
- <span style={{ fontSize: 13, fontWeight: 400, color: 'var(--Grey-Strong, #2E3236)', lineHeight: 1.2 }}>
698
- {customerName} ({sessionCount} Sessions)
699
- </span>
700
- {showSessionDropdown
701
- ? <ChevronUp size={16} color="var(--Grey-Muted, #808183)" strokeWidth={1.5} />
702
- : <ChevronDown size={16} color="var(--Grey-Muted, #808183)" strokeWidth={1.5} />
703
- }
705
+ <div style={{ display: 'flex', alignItems: 'center', gap: 4, minWidth: 0 }}>
706
+ <CircleUser size={16} color="var(--Grey-Strong, #2E3236)" strokeWidth={1.5} />
707
+ <span style={{ fontSize: 13, fontWeight: 400, color: 'var(--Grey-Strong, #2E3236)', lineHeight: 1.2, whiteSpace: 'nowrap' }}>
708
+ <span style={{ fontWeight: 600 }}>{customerName}</span>{' '}
709
+ <span>({sessionCount} Sessions)</span>
710
+ </span>
711
+ </div>
712
+ <ChevronRight size={16} color="var(--Grey-Strong, #2E3236)" strokeWidth={1.7} />
704
713
  </button>
705
714
  </NameTooltip>
706
-
707
- {/* Figma node 311-1302: Session history dropdown */}
708
- {showSessionDropdown && (
709
- <div style={{
710
- position: 'absolute',
711
- top: '100%',
712
- right: 0,
713
- marginTop: 4,
714
- width: 264,
715
- background: 'var(--Grey-White, #FFF)',
716
- borderRadius: 4,
717
- border: '1px solid var(--Grey-absent, #D9D9D9)',
718
- boxShadow: '0 4px 16px rgba(0,0,0,0.12)',
719
- zIndex: 50,
720
- overflow: 'hidden',
721
- }}>
722
- {/* Header — Figma node 312-1321: horizontal, gap: 8 */}
723
- <div style={{
724
- display: 'flex', alignItems: 'flex-start', gap: 8,
725
- padding: 16,
726
- }}>
727
- <CircleUser size={16} color="var(--Grey-Muted, #808183)" strokeWidth={1.5} style={{ marginTop: 2, flexShrink: 0 }} />
728
- <div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
729
- <span style={{
730
- fontSize: 16, fontWeight: 600,
731
- color: 'var(--Grey-Strong, #2E3236)',
732
- lineHeight: 1,
733
- }}>
734
- {customerName}
735
- </span>
736
- <span style={{
737
- fontSize: 13, fontWeight: 400,
738
- color: 'var(--Grey-Muted, #808183)',
739
- lineHeight: 1,
740
- }}>
741
- {sessionCount} Sessions in past
742
- </span>
743
- </div>
744
- </div>
745
-
746
- {/* Session list */}
747
- {sessionHistory.slice(0, 5).map((session, i) => (
748
- <div
749
- key={session.id || i}
750
- onClick={() => { if (onSessionClick) onSessionClick(session); setShowSessionDropdown(false); }}
751
- onMouseEnter={() => setHoveredSessionIdx(i)}
752
- onMouseLeave={() => setHoveredSessionIdx(null)}
753
- style={{
754
- display: 'flex',
755
- width: 264,
756
- padding: '12px 16px',
757
- justifyContent: 'space-between',
758
- alignItems: 'center',
759
- background: hoveredSessionIdx === i
760
- ? 'var(--surface-hover, #F3F7F7)'
761
- : 'var(--Grey-White, #FFF)',
762
- borderTop: '1px solid var(--Grey-absent, #D9D9D9)',
763
- cursor: 'pointer',
764
- boxSizing: 'border-box',
765
- transition: 'background 0.15s',
766
- }}
767
- >
768
- <div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
769
- <span style={{
770
- fontSize: 13, fontWeight: 400,
771
- color: 'var(--Grey-Strong, #2E3236)',
772
- lineHeight: 1,
773
- }}>
774
- {session.title}
775
- </span>
776
- <span style={{
777
- fontSize: 12, fontWeight: 400,
778
- color: 'var(--Grey-Muted, #808183)',
779
- lineHeight: 1,
780
- }}>
781
- {session.date}
782
- </span>
783
- </div>
784
- {hoveredSessionIdx === i && (
785
- <ExternalLink size={16} color="var(--Grey-Muted, #808183)" strokeWidth={1} style={{ flexShrink: 0 }} />
786
- )}
787
- </div>
788
- ))}
789
-
790
- {/* View All Sessions button */}
791
- <div style={{
792
- padding: 16,
793
- borderTop: '1px solid var(--Grey-absent, #D9D9D9)',
794
- display: 'flex',
795
- justifyContent: 'center',
796
- }}>
797
- <button
798
- onClick={() => { if (onViewAllSessions) onViewAllSessions(); setShowSessionDropdown(false); }}
799
- style={{
800
- display: 'flex',
801
- height: 32,
802
- padding: '16px 16px 16px 12px',
803
- justifyContent: 'center',
804
- alignItems: 'center',
805
- gap: 6,
806
- background: 'var(--Grey-White, #FFF)',
807
- border: '1px solid var(--Grey-absent, #D9D9D9)',
808
- borderRadius: 10,
809
- cursor: 'pointer',
810
- }}>
811
- <History size={16} color="var(--Grey-Muted, #808183)" strokeWidth={1.5} />
812
- <span style={{
813
- fontSize: 14, fontWeight: 600,
814
- color: 'var(--Grey-Strong, #2E3236)',
815
- }}>
816
- View All Sessions
817
- </span>
818
- </button>
819
- </div>
820
- </div>
821
- )}
822
715
  </div>
823
716
  ) : (
824
717
  <NameTooltip text={customerFullName}>
825
- <div style={{ display: 'flex', alignItems: 'center', gap: 4, padding: '8px 0', cursor: 'pointer' }}>
826
- <CircleUser size={16} color="var(--Grey-Muted, #808183)" strokeWidth={1.5} />
827
- <span style={{ fontSize: 13, fontWeight: 400, color: 'var(--Grey-Strong, #2E3236)', lineHeight: 1.2 }}>
828
- {customerName}
829
- </span>
830
- </div>
718
+ <button
719
+ onClick={() => setShowSessionDrawer(true)}
720
+ style={{
721
+ display: 'flex',
722
+ alignItems: 'center',
723
+ gap: 16,
724
+ padding: '0 16px',
725
+ height: 34,
726
+ borderRadius: 8,
727
+ background: 'var(--Rail-Surface-2, #E3E1D7)',
728
+ border: 'none',
729
+ cursor: 'pointer',
730
+ }}
731
+ >
732
+ <div style={{ display: 'flex', alignItems: 'center', gap: 4, minWidth: 0 }}>
733
+ <CircleUser size={16} color="var(--Grey-Strong, #2E3236)" strokeWidth={1.5} />
734
+ <span style={{ fontSize: 13, fontWeight: 600, color: 'var(--Grey-Strong, #2E3236)', lineHeight: 1.2, whiteSpace: 'nowrap' }}>
735
+ {customerName}
736
+ </span>
737
+ </div>
738
+ <ChevronRight size={16} color="var(--Grey-Strong, #2E3236)" strokeWidth={1.7} />
739
+ </button>
831
740
  </NameTooltip>
832
741
  )}
833
742
  </div>
@@ -995,6 +904,148 @@ const UpdatedInteractionDetails = ({
995
904
  </div>
996
905
  </div>
997
906
 
907
+ <SideDrawer
908
+ open={showSessionDrawer}
909
+ onClose={() => setShowSessionDrawer(false)}
910
+ title={(
911
+ <div style={{ display: 'flex', alignItems: 'center', gap: 10, minWidth: 0 }}>
912
+ <div style={{
913
+ width: 34,
914
+ height: 34,
915
+ borderRadius: '50%',
916
+ background: 'var(--surface-hover, #F3F7F7)',
917
+ display: 'flex',
918
+ alignItems: 'center',
919
+ justifyContent: 'center',
920
+ flexShrink: 0,
921
+ }}>
922
+ <CircleUser size={20} color="var(--Grey-Strong, #2E3236)" strokeWidth={1.7} />
923
+ </div>
924
+ <div style={{ minWidth: 0 }}>
925
+ <div style={{
926
+ fontSize: 16,
927
+ fontWeight: 600,
928
+ color: 'var(--Grey-Strong, #2E3236)',
929
+ lineHeight: 1.2,
930
+ whiteSpace: 'nowrap',
931
+ overflow: 'hidden',
932
+ textOverflow: 'ellipsis',
933
+ }}>
934
+ {customerName}
935
+ </div>
936
+ </div>
937
+ </div>
938
+ )}
939
+ subtitle={hasPastSessions ? (
940
+ <span style={{
941
+ fontSize: 13,
942
+ fontWeight: 400,
943
+ color: 'var(--Grey-Muted, #808183)',
944
+ lineHeight: 1.5,
945
+ }}>
946
+ {sessionCount} Sessions in Past
947
+ </span>
948
+ ) : null}
949
+ width={470}
950
+ height="100vh"
951
+ topOffset={70}
952
+ footer={hasPastSessions ? (
953
+ <div style={{ width: '100%', display: 'flex', justifyContent: 'center' }}>
954
+ <button
955
+ onClick={() => { if (onViewAllSessions) onViewAllSessions(); setShowSessionDrawer(false); }}
956
+ style={{
957
+ display: 'flex',
958
+ height: 32,
959
+ padding: '0 16px 0 12px',
960
+ justifyContent: 'center',
961
+ alignItems: 'center',
962
+ gap: 6,
963
+ background: 'var(--Grey-White, #FFF)',
964
+ border: '1px solid var(--Grey-absent, #D9D9D9)',
965
+ borderRadius: 10,
966
+ cursor: 'pointer',
967
+ }}
968
+ >
969
+ <History size={16} color="var(--Grey-Muted, #808183)" strokeWidth={1.5} />
970
+ <span style={{ fontSize: 14, fontWeight: 600, color: 'var(--Grey-Strong, #2E3236)' }}>
971
+ View All Sessions
972
+ </span>
973
+ </button>
974
+ </div>
975
+ ) : null}
976
+ >
977
+ <div
978
+ style={{
979
+ borderTop: '1px solid var(--Grey-absent, #D9D9D9)',
980
+ maxHeight: '100%',
981
+ overflowY: 'auto',
982
+ }}
983
+ >
984
+ {hasPastSessions ? sessionHistory.map((session, i) => (
985
+ <div
986
+ key={session.id || i}
987
+ onClick={() => { if (onSessionClick) onSessionClick(session); setShowSessionDrawer(false); }}
988
+ onMouseEnter={() => setHoveredSessionIdx(i)}
989
+ onMouseLeave={() => setHoveredSessionIdx(null)}
990
+ style={{
991
+ display: 'flex',
992
+ justifyContent: 'space-between',
993
+ alignItems: 'center',
994
+ gap: 12,
995
+ padding: '16px 12px',
996
+ borderTop: i === 0 ? 'none' : '1px solid var(--Grey-absent, #D9D9D9)',
997
+ background: hoveredSessionIdx === i ? 'var(--surface-hover, #F3F7F7)' : 'var(--Grey-White, #FFF)',
998
+ cursor: 'pointer',
999
+ transition: 'background 0.15s',
1000
+ }}
1001
+ >
1002
+ <div style={{ minWidth: 0 }}>
1003
+ <div style={{ fontSize: 14, display: 'flex', alignItems: 'center', gap: 6, fontWeight: 400, color: 'var(--Grey-Strong, #2E3236)', lineHeight: 1.2, marginBottom: 8, whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>
1004
+ {session.title}
1005
+ </div>
1006
+ {session.status && (
1007
+ <div style={{ fontSize: 13, color: 'var(--Grey-Strong, #2E3236)', marginBottom: 12, lineHeight: 1.2 }}>
1008
+ <span style={{ fontWeight: 400 }}>Status: </span>
1009
+ <span style={{ fontWeight: 400, color: 'var(--Grey-Muted, #808183)' }}>{session.status}</span>
1010
+ </div>
1011
+ )}
1012
+ <div style={{ display: 'flex', alignItems: 'center', gap: 14, flexWrap: 'wrap' }}>
1013
+ <span style={{ display: 'inline-flex', alignItems: 'center', gap: 6, fontSize: 13, fontWeight: 400, color: 'var(--Grey-Muted, #808183)', lineHeight: 1.1 }}>
1014
+ <CalendarDays size={16} color="var(--Grey-Muted, #808183)" strokeWidth={1.8} />
1015
+ {session.date}
1016
+ </span>
1017
+ {(session.agent || session.agent_name) && (
1018
+ <span style={{ display: 'inline-flex', alignItems: 'center', gap: 6, fontSize: 13, fontWeight: 400, color: 'var(--Grey-Muted, #808183)', lineHeight: 1.1 }}>
1019
+ <Headset size={16} color="var(--Grey-Muted, #808183)" strokeWidth={1.8} />
1020
+ {session.agent || session.agent_name}
1021
+ </span>
1022
+ )}
1023
+ </div>
1024
+ </div>
1025
+ {hoveredSessionIdx === i && (
1026
+ <ExternalLink size={20} color="var(--Grey-Muted, #808183)" strokeWidth={1.7} style={{ flexShrink: 0 }} />
1027
+ )}
1028
+ </div>
1029
+ )) : (
1030
+ <div
1031
+ style={{
1032
+ display: 'flex',
1033
+ justifyContent: 'center',
1034
+ alignItems: 'center',
1035
+ minHeight: 140,
1036
+ padding: '24px 12px',
1037
+ color: 'var(--Grey-Muted, #808183)',
1038
+ fontSize: 14,
1039
+ fontStyle: 'italic',
1040
+ textAlign: 'center',
1041
+ }}
1042
+ >
1043
+ No previous sessions available
1044
+ </div>
1045
+ )}
1046
+ </div>
1047
+ </SideDrawer>
1048
+
998
1049
  </div>
999
1050
  );
1000
1051
  };