reachat 2.0.1 → 2.1.0-alpha.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.
Files changed (32) hide show
  1. package/dist/{CSVFileRenderer-Dy3iLTeu.js → CSVFileRenderer-BAbkFZ2w.js} +2 -2
  2. package/dist/{CSVFileRenderer-Dy3iLTeu.js.map → CSVFileRenderer-BAbkFZ2w.js.map} +1 -1
  3. package/dist/{DefaultFileRenderer-Dxar9MFe.js → DefaultFileRenderer-Bgc4Jadg.js} +2 -2
  4. package/dist/{DefaultFileRenderer-Dxar9MFe.js.map → DefaultFileRenderer-Bgc4Jadg.js.map} +1 -1
  5. package/dist/ImageFileRenderer-C8tVW3I8.js.map +1 -1
  6. package/dist/PDFFileRenderer-DQdFS2l6.js.map +1 -1
  7. package/dist/docs.json +6 -2
  8. package/dist/{index-NuRjkHCl.js → index-unCEyRCC.js} +12 -12
  9. package/dist/index-unCEyRCC.js.map +1 -0
  10. package/dist/index.css +2495 -673
  11. package/dist/index.js +2 -2
  12. package/dist/index.umd.cjs +9 -9
  13. package/dist/index.umd.cjs.map +1 -1
  14. package/dist/stories/Changelog.mdx +8 -0
  15. package/dist/stories/Chat.stories.tsx +265 -0
  16. package/dist/stories/ChatBubble.stories.tsx +267 -0
  17. package/dist/stories/Companion.stories.tsx +435 -0
  18. package/dist/stories/Console.stories.tsx +1154 -0
  19. package/dist/stories/Integration.stories.tsx +312 -0
  20. package/dist/stories/Intro.mdx +41 -0
  21. package/dist/stories/Support.mdx +9 -0
  22. package/dist/stories/assets/chat-voice-fill.svg +5 -0
  23. package/dist/stories/assets/close-fill.svg +5 -0
  24. package/dist/stories/assets/logo.svg +21 -0
  25. package/dist/stories/assets/menu.svg +1 -0
  26. package/dist/stories/assets/paperclip.svg +1 -0
  27. package/dist/stories/assets/placeholder-dark.svg +500 -0
  28. package/dist/stories/assets/placeholder.svg +258 -0
  29. package/dist/stories/assets/search.svg +1 -0
  30. package/dist/stories/examples.ts +267 -0
  31. package/package.json +8 -4
  32. package/dist/index-NuRjkHCl.js.map +0 -1
@@ -0,0 +1,258 @@
1
+ <svg width="588" height="455" viewBox="0 0 588 455" fill="none" xmlns="http://www.w3.org/2000/svg">
2
+ <g opacity="0.9">
3
+ <mask id="mask0_145_3499" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0"
4
+ width="588" height="485">
5
+ <ellipse cx="294" cy="242.198" rx="293.282" ry="241.998" fill="url(#paint0_radial_145_3499)" />
6
+ </mask>
7
+ <g mask="url(#mask0_145_3499)">
8
+ <g filter="url(#filter0_f_145_3499)">
9
+ <rect x="112" y="26.5" width="364" height="382.5" fill="url(#paint1_angular_145_3499)" />
10
+ </g>
11
+ <rect x="129.75" y="330.75" width="328.5" height="62.5" rx="19.25" fill="#F8F8F8"
12
+ fill-opacity="0.01" />
13
+ <rect x="129.75" y="330.75" width="328.5" height="62.5" rx="19.25" stroke="#E2E2EA"
14
+ stroke-width="1.5" />
15
+ <g filter="url(#filter1_bi_145_3499)">
16
+ <rect x="145" y="338" width="48" height="48" rx="10" fill="url(#paint2_linear_145_3499)"
17
+ fill-opacity="0.2" />
18
+ </g>
19
+ <rect x="216.947" y="356" width="56" height="4" rx="2" fill="url(#paint3_linear_145_3499)"
20
+ fill-opacity="0.5" />
21
+ <rect opacity="0.6" x="216.947" y="364" width="104" height="4" rx="2"
22
+ fill="url(#paint4_linear_145_3499)" fill-opacity="0.5" />
23
+ <rect x="129.75" y="258.75" width="328.5" height="62.5" rx="19.25" fill="#F8F8F8"
24
+ fill-opacity="0.01" />
25
+ <rect x="129.75" y="258.75" width="328.5" height="62.5" rx="19.25" stroke="#E2E2EA"
26
+ stroke-width="1.5" />
27
+ <g filter="url(#filter2_bi_145_3499)">
28
+ <rect x="145" y="266" width="48" height="48" rx="10" fill="url(#paint5_linear_145_3499)"
29
+ fill-opacity="0.3" />
30
+ </g>
31
+ <rect x="217" y="284" width="56" height="4" rx="2" fill="url(#paint6_linear_145_3499)"
32
+ fill-opacity="0.5" />
33
+ <rect opacity="0.6" x="217" y="292" width="104" height="4" rx="2"
34
+ fill="url(#paint7_linear_145_3499)" fill-opacity="0.5" />
35
+ <g filter="url(#filter3_d_145_3499)">
36
+ <rect x="129" y="186" width="330" height="64" rx="20" fill="#F8F8F8" fill-opacity="0.01"
37
+ shape-rendering="crispEdges" />
38
+ <rect x="129.75" y="186.75" width="328.5" height="62.5" rx="19.25" stroke="#C6CBD9"
39
+ stroke-width="1.5" shape-rendering="crispEdges" />
40
+ <g filter="url(#filter4_bi_145_3499)">
41
+ <rect x="145" y="194" width="48" height="48" rx="10" fill="url(#paint8_linear_145_3499)"
42
+ fill-opacity="0.3" />
43
+ </g>
44
+ <rect x="217" y="212" width="56" height="4" rx="2" fill="url(#paint9_linear_145_3499)"
45
+ fill-opacity="0.5" />
46
+ <rect opacity="0.6" x="217" y="220" width="104" height="4" rx="2"
47
+ fill="url(#paint10_linear_145_3499)" fill-opacity="0.5" />
48
+ </g>
49
+ <rect x="129.75" y="114.75" width="328.5" height="62.5" rx="19.25" fill="#F8F8F8"
50
+ fill-opacity="0.01" />
51
+ <rect x="129.75" y="114.75" width="328.5" height="62.5" rx="19.25" stroke="#E2E2EA"
52
+ stroke-width="1.5" />
53
+ <g filter="url(#filter5_bi_145_3499)">
54
+ <rect x="145" y="122" width="48" height="48" rx="10" fill="url(#paint11_linear_145_3499)"
55
+ fill-opacity="0.4" />
56
+ </g>
57
+ <rect x="216.947" y="140" width="56" height="4" rx="2" fill="url(#paint12_linear_145_3499)"
58
+ fill-opacity="0.5" />
59
+ <rect opacity="0.6" x="216.947" y="148" width="104" height="4" rx="2"
60
+ fill="url(#paint13_linear_145_3499)" fill-opacity="0.5" />
61
+ <rect x="129.75" y="42.75" width="328.5" height="62.5" rx="19.25" fill="#F8F8F8"
62
+ fill-opacity="0.01" />
63
+ <rect x="129.75" y="42.75" width="328.5" height="62.5" rx="19.25" stroke="#E2E2EA"
64
+ stroke-width="1.5" />
65
+ <g filter="url(#filter6_bi_145_3499)">
66
+ <rect x="145" y="50" width="48" height="48" rx="10" fill="url(#paint14_linear_145_3499)"
67
+ fill-opacity="0.2" />
68
+ </g>
69
+ <rect x="216.947" y="68" width="56" height="4" rx="2" fill="url(#paint15_linear_145_3499)"
70
+ fill-opacity="0.5" />
71
+ <rect opacity="0.6" x="216.947" y="76" width="104" height="4" rx="2"
72
+ fill="url(#paint16_linear_145_3499)" fill-opacity="0.5" />
73
+ <rect x="112.75" y="27.75" width="362.5" height="380.5" rx="19.25" stroke="#E2E2EA"
74
+ stroke-width="1.5" />
75
+ </g>
76
+ </g>
77
+ <defs>
78
+ <filter id="filter0_f_145_3499" x="-12" y="-97.5" width="612" height="630.5"
79
+ filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
80
+ <feFlood flood-opacity="0" result="BackgroundImageFix" />
81
+ <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
82
+ <feGaussianBlur stdDeviation="62" result="effect1_foregroundBlur_145_3499" />
83
+ </filter>
84
+ <filter id="filter1_bi_145_3499" x="85.1316" y="278.132" width="167.737" height="167.737"
85
+ filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
86
+ <feFlood flood-opacity="0" result="BackgroundImageFix" />
87
+ <feGaussianBlur in="BackgroundImageFix" stdDeviation="29.9342" />
88
+ <feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_145_3499" />
89
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_backgroundBlur_145_3499" result="shape" />
90
+ <feColorMatrix in="SourceAlpha" type="matrix"
91
+ values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
92
+ <feOffset dx="1.19737" dy="2.39474" />
93
+ <feGaussianBlur stdDeviation="4.78947" />
94
+ <feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1" />
95
+ <feColorMatrix type="matrix"
96
+ values="0 0 0 0 0.972549 0 0 0 0 0.972549 0 0 0 0 0.972549 0 0 0 0.06 0" />
97
+ <feBlend mode="normal" in2="shape" result="effect2_innerShadow_145_3499" />
98
+ </filter>
99
+ <filter id="filter2_bi_145_3499" x="85.1316" y="206.132" width="167.737" height="167.737"
100
+ filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
101
+ <feFlood flood-opacity="0" result="BackgroundImageFix" />
102
+ <feGaussianBlur in="BackgroundImageFix" stdDeviation="29.9342" />
103
+ <feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_145_3499" />
104
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_backgroundBlur_145_3499" result="shape" />
105
+ <feColorMatrix in="SourceAlpha" type="matrix"
106
+ values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
107
+ <feOffset dx="1.19737" dy="2.39474" />
108
+ <feGaussianBlur stdDeviation="4.78947" />
109
+ <feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1" />
110
+ <feColorMatrix type="matrix"
111
+ values="0 0 0 0 0.972549 0 0 0 0 0.972549 0 0 0 0 0.972549 0 0 0 0.06 0" />
112
+ <feBlend mode="normal" in2="shape" result="effect2_innerShadow_145_3499" />
113
+ </filter>
114
+ <filter id="filter3_d_145_3499" x="113" y="174" width="362" height="96"
115
+ filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
116
+ <feFlood flood-opacity="0" result="BackgroundImageFix" />
117
+ <feColorMatrix in="SourceAlpha" type="matrix"
118
+ values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
119
+ <feOffset dy="4" />
120
+ <feGaussianBlur stdDeviation="8" />
121
+ <feComposite in2="hardAlpha" operator="out" />
122
+ <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.2 0" />
123
+ <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow_145_3499" />
124
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow_145_3499" result="shape" />
125
+ </filter>
126
+ <filter id="filter4_bi_145_3499" x="85.1316" y="134.132" width="167.737" height="167.737"
127
+ filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
128
+ <feFlood flood-opacity="0" result="BackgroundImageFix" />
129
+ <feGaussianBlur in="BackgroundImageFix" stdDeviation="29.9342" />
130
+ <feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_145_3499" />
131
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_backgroundBlur_145_3499" result="shape" />
132
+ <feColorMatrix in="SourceAlpha" type="matrix"
133
+ values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
134
+ <feOffset dx="1.19737" dy="2.39474" />
135
+ <feGaussianBlur stdDeviation="4.78947" />
136
+ <feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1" />
137
+ <feColorMatrix type="matrix"
138
+ values="0 0 0 0 0.972549 0 0 0 0 0.972549 0 0 0 0 0.972549 0 0 0 0.06 0" />
139
+ <feBlend mode="normal" in2="shape" result="effect2_innerShadow_145_3499" />
140
+ </filter>
141
+ <filter id="filter5_bi_145_3499" x="85.1316" y="62.1316" width="167.737" height="167.737"
142
+ filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
143
+ <feFlood flood-opacity="0" result="BackgroundImageFix" />
144
+ <feGaussianBlur in="BackgroundImageFix" stdDeviation="29.9342" />
145
+ <feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_145_3499" />
146
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_backgroundBlur_145_3499" result="shape" />
147
+ <feColorMatrix in="SourceAlpha" type="matrix"
148
+ values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
149
+ <feOffset dx="1.19737" dy="2.39474" />
150
+ <feGaussianBlur stdDeviation="4.78947" />
151
+ <feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1" />
152
+ <feColorMatrix type="matrix"
153
+ values="0 0 0 0 0.972549 0 0 0 0 0.972549 0 0 0 0 0.972549 0 0 0 0.06 0" />
154
+ <feBlend mode="normal" in2="shape" result="effect2_innerShadow_145_3499" />
155
+ </filter>
156
+ <filter id="filter6_bi_145_3499" x="85.1316" y="-9.86842" width="167.737" height="167.737"
157
+ filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB">
158
+ <feFlood flood-opacity="0" result="BackgroundImageFix" />
159
+ <feGaussianBlur in="BackgroundImageFix" stdDeviation="29.9342" />
160
+ <feComposite in2="SourceAlpha" operator="in" result="effect1_backgroundBlur_145_3499" />
161
+ <feBlend mode="normal" in="SourceGraphic" in2="effect1_backgroundBlur_145_3499" result="shape" />
162
+ <feColorMatrix in="SourceAlpha" type="matrix"
163
+ values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha" />
164
+ <feOffset dx="1.19737" dy="2.39474" />
165
+ <feGaussianBlur stdDeviation="4.78947" />
166
+ <feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1" />
167
+ <feColorMatrix type="matrix"
168
+ values="0 0 0 0 0.972549 0 0 0 0 0.972549 0 0 0 0 0.972549 0 0 0 0.06 0" />
169
+ <feBlend mode="normal" in2="shape" result="effect2_innerShadow_145_3499" />
170
+ </filter>
171
+ <radialGradient id="paint0_radial_145_3499" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse"
172
+ gradientTransform="translate(294 242.198) rotate(90) scale(283.542 343.63)">
173
+ <stop stop-color="#D9D9D9" />
174
+ <stop offset="1" stop-color="#02020F" stop-opacity="0" />
175
+ </radialGradient>
176
+ <radialGradient id="paint1_angular_145_3499" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse"
177
+ gradientTransform="translate(294 217.75) rotate(90) scale(191.25 182)">
178
+ <stop offset="0.352013" stop-color="white" stop-opacity="0" />
179
+ <stop offset="0.49798" stop-color="white" stop-opacity="0.15" />
180
+ <stop offset="0.648457" stop-color="white" stop-opacity="0" />
181
+ </radialGradient>
182
+ <linearGradient id="paint2_linear_145_3499" x1="169" y1="338" x2="169" y2="386"
183
+ gradientUnits="userSpaceOnUse">
184
+ <stop stop-color="#36466D" />
185
+ <stop offset="1" stop-color="#2D3A5D" />
186
+ </linearGradient>
187
+ <linearGradient id="paint3_linear_145_3499" x1="244.947" y1="356" x2="244.947" y2="360"
188
+ gradientUnits="userSpaceOnUse">
189
+ <stop stop-color="#36466D" />
190
+ <stop offset="1" stop-color="#2D3A5D" />
191
+ </linearGradient>
192
+ <linearGradient id="paint4_linear_145_3499" x1="268.947" y1="364" x2="268.947" y2="368"
193
+ gradientUnits="userSpaceOnUse">
194
+ <stop stop-color="#36466D" />
195
+ <stop offset="1" stop-color="#2D3A5D" />
196
+ </linearGradient>
197
+ <linearGradient id="paint5_linear_145_3499" x1="169" y1="266" x2="169" y2="314"
198
+ gradientUnits="userSpaceOnUse">
199
+ <stop stop-color="#36466D" />
200
+ <stop offset="1" stop-color="#2D3A5D" />
201
+ </linearGradient>
202
+ <linearGradient id="paint6_linear_145_3499" x1="245" y1="284" x2="245" y2="288"
203
+ gradientUnits="userSpaceOnUse">
204
+ <stop stop-color="#36466D" />
205
+ <stop offset="1" stop-color="#2D3A5D" />
206
+ </linearGradient>
207
+ <linearGradient id="paint7_linear_145_3499" x1="269" y1="292" x2="269" y2="296"
208
+ gradientUnits="userSpaceOnUse">
209
+ <stop stop-color="#36466D" />
210
+ <stop offset="1" stop-color="#2D3A5D" />
211
+ </linearGradient>
212
+ <linearGradient id="paint8_linear_145_3499" x1="169" y1="194" x2="169" y2="242"
213
+ gradientUnits="userSpaceOnUse">
214
+ <stop stop-color="#36466D" />
215
+ <stop offset="1" stop-color="#2D3A5D" />
216
+ </linearGradient>
217
+ <linearGradient id="paint9_linear_145_3499" x1="245" y1="212" x2="245" y2="216"
218
+ gradientUnits="userSpaceOnUse">
219
+ <stop stop-color="#36466D" />
220
+ <stop offset="1" stop-color="#2D3A5D" />
221
+ </linearGradient>
222
+ <linearGradient id="paint10_linear_145_3499" x1="269" y1="220" x2="269" y2="224"
223
+ gradientUnits="userSpaceOnUse">
224
+ <stop stop-color="#36466D" />
225
+ <stop offset="1" stop-color="#2D3A5D" />
226
+ </linearGradient>
227
+ <linearGradient id="paint11_linear_145_3499" x1="169" y1="122" x2="169" y2="170"
228
+ gradientUnits="userSpaceOnUse">
229
+ <stop stop-color="#36466D" />
230
+ <stop offset="1" stop-color="#2D3A5D" />
231
+ </linearGradient>
232
+ <linearGradient id="paint12_linear_145_3499" x1="244.947" y1="140" x2="244.947" y2="144"
233
+ gradientUnits="userSpaceOnUse">
234
+ <stop stop-color="#36466D" />
235
+ <stop offset="1" stop-color="#2D3A5D" />
236
+ </linearGradient>
237
+ <linearGradient id="paint13_linear_145_3499" x1="268.947" y1="148" x2="268.947" y2="152"
238
+ gradientUnits="userSpaceOnUse">
239
+ <stop stop-color="#36466D" />
240
+ <stop offset="1" stop-color="#2D3A5D" />
241
+ </linearGradient>
242
+ <linearGradient id="paint14_linear_145_3499" x1="169" y1="50" x2="169" y2="98"
243
+ gradientUnits="userSpaceOnUse">
244
+ <stop stop-color="#36466D" />
245
+ <stop offset="1" stop-color="#2D3A5D" />
246
+ </linearGradient>
247
+ <linearGradient id="paint15_linear_145_3499" x1="244.947" y1="68" x2="244.947" y2="72"
248
+ gradientUnits="userSpaceOnUse">
249
+ <stop stop-color="#36466D" />
250
+ <stop offset="1" stop-color="#2D3A5D" />
251
+ </linearGradient>
252
+ <linearGradient id="paint16_linear_145_3499" x1="268.947" y1="76" x2="268.947" y2="80"
253
+ gradientUnits="userSpaceOnUse">
254
+ <stop stop-color="#36466D" />
255
+ <stop offset="1" stop-color="#2D3A5D" />
256
+ </linearGradient>
257
+ </defs>
258
+ </svg>
@@ -0,0 +1 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-search"><circle cx="11" cy="11" r="8"/><path d="m21 21-4.3-4.3"/></svg>
@@ -0,0 +1,267 @@
1
+ import { Session } from '@/types';
2
+ import { subHours } from 'date-fns';
3
+
4
+ export const fakeSessions: Session[] = [
5
+ {
6
+ id: '1',
7
+ title: 'Session 1',
8
+ createdAt: new Date(),
9
+ updatedAt: new Date(),
10
+ conversations: [
11
+ {
12
+ id: '1',
13
+ question: 'What is React?',
14
+ response: 'React is a JavaScript library for building user interfaces.',
15
+ createdAt: new Date(),
16
+ updatedAt: new Date()
17
+ },
18
+ {
19
+ id: '2',
20
+ question: 'What is JSX?',
21
+ response: 'JSX is a syntax extension for JavaScript.',
22
+ createdAt: new Date(),
23
+ updatedAt: new Date()
24
+ }
25
+ ]
26
+ },
27
+ {
28
+ id: '2',
29
+ title: 'Session 2',
30
+ createdAt: new Date(),
31
+ updatedAt: new Date(),
32
+ conversations: [
33
+ {
34
+ id: '1',
35
+ question: 'What is TypeScript?',
36
+ response: 'TypeScript is a typed superset of JavaScript.',
37
+ createdAt: new Date(),
38
+ updatedAt: new Date()
39
+ },
40
+ {
41
+ id: '2',
42
+ question: 'What is a component?',
43
+ response: 'A component is a reusable piece of UI.',
44
+ createdAt: new Date(),
45
+ updatedAt: new Date()
46
+ }
47
+ ]
48
+ }
49
+ ];
50
+
51
+ export const sessionsWithFiles: Session[] = [
52
+ {
53
+ id: 'session-files',
54
+ title: 'Session with Files',
55
+ createdAt: new Date(),
56
+ updatedAt: new Date(),
57
+ conversations: [
58
+ {
59
+ id: '1',
60
+ question: 'Here are some files I uploaded',
61
+ response:
62
+ 'Ive received your files. Let me know if you have any questions about them.',
63
+ createdAt: new Date(),
64
+ updatedAt: new Date(),
65
+ files: [
66
+ { name: 'document.pdf', size: 1024000, type: 'application/pdf' },
67
+ {
68
+ name: 'report.docx',
69
+ size: 512000,
70
+ type: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
71
+ }
72
+ ]
73
+ }
74
+ ]
75
+ }
76
+ ];
77
+
78
+ export const sessionWithSources: Session[] = [
79
+ {
80
+ id: 'session-sources',
81
+ title: 'Session with Sources',
82
+ createdAt: subHours(new Date(), 1),
83
+ updatedAt: new Date(),
84
+ conversations: [
85
+ {
86
+ id: 'conversation-1',
87
+ question: 'What are the main causes of climate change?',
88
+ response: `Climate change is primarily caused by human activities that release greenhouse gases into the atmosphere. The main causes include:
89
+
90
+ 1. Burning of fossil fuels (coal, oil, and natural gas)
91
+ 2. Deforestation and land-use changes
92
+ 3. Industrial processes
93
+ 4. Agriculture and livestock farming
94
+
95
+ These activities increase the concentration of greenhouse gases in the atmosphere, leading to the greenhouse effect and global warming.`,
96
+ createdAt: new Date(),
97
+ updatedAt: new Date(),
98
+ sources: [
99
+ {
100
+ title: 'NASA: Causes of Climate Change',
101
+ image:
102
+ 'https://upload.wikimedia.org/wikipedia/commons/thumb/e/e5/NASA_logo.svg/1224px-NASA_logo.svg.png',
103
+ url: 'https://climate.nasa.gov/causes/'
104
+ },
105
+ {
106
+ title:
107
+ 'IPCC: Climate Change 2021: The Physical Science Basis and Global Warming Is the Last War We will Fight',
108
+ url: 'https://www.ipcc.ch/report/ar6/wg1/'
109
+ }
110
+ ]
111
+ }
112
+ ]
113
+ }
114
+ ];
115
+
116
+ export const fakeSessionsWithEmbeds: Session[] = [
117
+ {
118
+ id: '1',
119
+ title: 'Session with Embeds',
120
+ createdAt: new Date(),
121
+ updatedAt: new Date(),
122
+ conversations: [
123
+ {
124
+ id: '1',
125
+ question: 'Can you show me a video about React?',
126
+ response: `
127
+ ## Watch this video
128
+
129
+ https://youtu.be/enTFE2c68FQ
130
+
131
+ https://www.youtube.com/watch?v=enTFE2c68FQ
132
+
133
+ These links showcase a video about React basics. You can click on either link to watch the video.`,
134
+ createdAt: new Date(),
135
+ updatedAt: new Date()
136
+ },
137
+ {
138
+ id: '2',
139
+ question: 'Do you have another video recommendation?',
140
+ response: `
141
+ Certainly! Here's another great video about web development:
142
+
143
+ ## Check out this tutorial
144
+
145
+ https://www.youtube.com/watch?v=dQw4w9WgXcQ
146
+
147
+ This video covers some interesting web development concepts.`,
148
+ createdAt: new Date(),
149
+ updatedAt: new Date()
150
+ }
151
+ ]
152
+ }
153
+ ];
154
+
155
+ export const sessionsWithPartialConversation: Session[] = [
156
+ {
157
+ id: '1',
158
+ title: 'Session with Partial Conversation',
159
+ createdAt: new Date(),
160
+ updatedAt: new Date(),
161
+ conversations: [
162
+ {
163
+ id: '1',
164
+ question: 'What is the capital of France?',
165
+ response: 'The capital of France is Paris.',
166
+ createdAt: new Date(),
167
+ updatedAt: new Date()
168
+ },
169
+ {
170
+ id: '2',
171
+ question: 'What is the largest planet in our solar system?',
172
+ response: null, // No response yet
173
+ createdAt: new Date(),
174
+ updatedAt: new Date()
175
+ }
176
+ ]
177
+ }
178
+ ];
179
+
180
+ export const sessionWithDataDocs: Session[] = [
181
+ {
182
+ id: '1',
183
+ title: 'Session with Partial Conversation',
184
+ createdAt: new Date(),
185
+ updatedAt: new Date(),
186
+ conversations: [
187
+ {
188
+ id: '1',
189
+ question: 'Summarize the contents of the CSV.',
190
+ response: 'The CSV file contains a dataset with the following columns: Name, Age, Occupation, and City.',
191
+ createdAt: new Date(),
192
+ updatedAt: new Date(),
193
+ files: [
194
+ { name: 'sample.csv', size: 1024000, type: 'text/csv' }
195
+ ]
196
+ },
197
+ {
198
+ id: '2',
199
+ question: 'How does this data align with this PDF?',
200
+ response: null, // No response yet
201
+ createdAt: new Date(),
202
+ updatedAt: new Date(),
203
+ files: [
204
+ { name: 'document.pdf', size: 1024000, type: 'application/pdf' },
205
+ ]
206
+ }
207
+ ]
208
+ }
209
+ ];
210
+
211
+ export const sessionWithCSVFiles: Session[] = [
212
+ {
213
+ id: '1',
214
+ title: 'Session with Partial Conversation',
215
+ createdAt: new Date(),
216
+ updatedAt: new Date(),
217
+ conversations: [
218
+ {
219
+ id: '1',
220
+ question: 'Summarize the contents of the CSV.',
221
+ response: 'The CSV file contains a dataset with the following columns: Name, HEX, RGB.',
222
+ createdAt: new Date(),
223
+ updatedAt: new Date(),
224
+ files: [
225
+ { name: 'sample.csv', size: 500, type: 'text/csv', url: 'https://gist.githubusercontent.com/RobVanGroenewoud/ba89ad7684df8cefe5c183adb498cc65/raw/f2eec6d2cb89f5d779e16b28ed0dab89d738ba96/sample.csv' }
226
+ ]
227
+ },
228
+ {
229
+ id: '2',
230
+ question: 'How does this data align with this PDF?',
231
+ response: null, // No response yet
232
+ createdAt: new Date(),
233
+ updatedAt: new Date(),
234
+ files: [
235
+ { name: 'document.pdf', size: 1024000, type: 'application/pdf' },
236
+ ]
237
+ }
238
+ ]
239
+ }
240
+ ];
241
+
242
+ export const chatTemplates = [
243
+ {
244
+ id: '1',
245
+ title: 'Explore Components',
246
+ message: "Can you show me the main components available in Reachat?",
247
+ icon: 'SendPlane'
248
+ },
249
+ {
250
+ id: '2',
251
+ title: 'Customize Chat UI',
252
+ message: "How can I customize the appearance of my Reachat interface?",
253
+ icon: 'SendPlane'
254
+ },
255
+ {
256
+ id: '3',
257
+ title: 'Manage Sessions',
258
+ message: "What are the best practices for managing chat sessions in Reachat?",
259
+ icon: 'SendPlane'
260
+ },
261
+ {
262
+ id: '4',
263
+ title: 'Tailwind Setup',
264
+ message: "How do I properly set up Tailwind CSS with Reachat?",
265
+ icon: 'SendPlane'
266
+ }
267
+ ];
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "reachat",
3
- "version": "2.0.1",
3
+ "version": "2.1.0-alpha.1",
4
4
  "description": "Chat UI for Building LLMs",
5
5
  "scripts": {
6
6
  "build-storybook": "storybook build",
7
- "build": "npm run build:js && npm run build:styles && npm run build:docs",
7
+ "build": "npm run build:js && npm run build:styles && npm run build:docs && npm run rewrite:stories",
8
8
  "build:js": "vite build --mode library",
9
9
  "build:docs": "node scripts/docs.js",
10
10
  "build:styles": "npx @tailwindcss/cli -i ./src/index.css -o ./dist/index.css",
@@ -12,6 +12,7 @@
12
12
  "lint:fix": "eslint --ext js,ts,tsx --fix src",
13
13
  "lint:prettier": "prettier --loglevel warn --write 'src/**/*.{ts,tsx,js,jsx}'",
14
14
  "prettier": "prettier --loglevel warn --write 'src/**/*.{ts,tsx,js,jsx}'",
15
+ "rewrite:stories": "node scripts/stories.cjs",
15
16
  "start": "storybook dev -p 9009",
16
17
  "test": "vitest --passWithNoTests",
17
18
  "test:coverage": "vitest run --coverage --passWithNoTests",
@@ -33,6 +34,7 @@
33
34
  "require": "./dist/index.umd.cjs"
34
35
  },
35
36
  "./docs.json": "./dist/docs.json",
37
+ "./stories/*": "./dist/stories/*",
36
38
  "./index.css": "./dist/index.css"
37
39
  },
38
40
  "browser": "dist/index.js",
@@ -45,9 +47,9 @@
45
47
  "katex": "^0.16.11",
46
48
  "mdast-util-find-and-replace": "^3.0.1",
47
49
  "motion": "^12.4.2",
48
- "reablocks": "^9.0.0",
50
+ "reablocks": "10.0.0-alpha.3",
49
51
  "react-markdown": "^9.0.3",
50
- "react-syntax-highlighter": "^15.5.0",
52
+ "react-syntax-highlighter": "^15.6.1",
51
53
  "reakeys": "^2.0.3",
52
54
  "rehype-katex": "^7.0.0",
53
55
  "remark-gfm": "^4.0.0",
@@ -105,10 +107,12 @@
105
107
  "tailwindcss": "^4.0.0",
106
108
  "tw-colors": "^3.3.1",
107
109
  "typescript": "^4.9.5",
110
+ "typescript-rewrite-paths": "^1.3.1",
108
111
  "vite": "^5.2.2",
109
112
  "vite-plugin-checker": "^0.8.0",
110
113
  "vite-plugin-css-injected-by-js": "^3.5.0",
111
114
  "vite-plugin-dts": "^4.5.0",
115
+ "vite-plugin-static-copy": "^3.1.1",
112
116
  "vite-plugin-svgr": "^4.2.0",
113
117
  "vite-tsconfig-paths": "^4.3.2",
114
118
  "vitest": "^1.4.0"