@@ -11,7 +11,13 @@ import { RefreshIcon } from "@twilio-paste/icons/esm/RefreshIcon";
11
11
import { SendIcon } from "@twilio-paste/icons/esm/SendIcon" ;
12
12
import { ThumbsDownIcon } from "@twilio-paste/icons/esm/ThumbsDownIcon" ;
13
13
import { ThumbsUpIcon } from "@twilio-paste/icons/esm/ThumbsUpIcon" ;
14
- import { UserIcon } from "@twilio-paste/icons/esm/UserIcon" ;
14
+ import {
15
+ SummaryDetail ,
16
+ SummaryDetailContent ,
17
+ SummaryDetailHeading ,
18
+ SummaryDetailHeadingContent ,
19
+ SummaryDetailToggleButton ,
20
+ } from "@twilio-paste/summary-detail" ;
15
21
import { Text } from "@twilio-paste/text" ;
16
22
import { useTheme } from "@twilio-paste/theme" ;
17
23
import * as React from "react" ;
@@ -25,6 +31,8 @@ import {
25
31
AIChatMessageAuthor ,
26
32
AIChatMessageBody ,
27
33
AIChatMessageLoading ,
34
+ AIChatMessageSource ,
35
+ AIChatMessageSourceLink ,
28
36
} from "../src" ;
29
37
30
38
export default {
@@ -234,6 +242,101 @@ export const ExampleAIChatLogAgent = (): React.ReactNode => {
234
242
</ >
235
243
) ;
236
244
} ;
245
+
246
+ export const ExampleAIChatLogSources = ( ) : React . ReactNode => {
247
+ return (
248
+ < >
249
+ < AIChatLog >
250
+ < AIChatMessage variant = "user" >
251
+ < AIChatMessageBody timestamp = "3:42pm" >
252
+ Lorem ipsum dolor, sit amet consectetur adipisicing elit. Deserunt delectus fuga, necessitatibus eligendi
253
+ iure adipisci facilis exercitationem officiis dolorem laborum, ex fugiat quisquam itaque, earum sit nesciunt
254
+ impedit repellat assumenda.
255
+ </ AIChatMessageBody >
256
+ </ AIChatMessage >
257
+
258
+ < AIChatEvent >
259
+ < Text color = "colorTextWeak" fontSize = "fontSize20" fontWeight = "fontWeightSemibold" as = "span" >
260
+ Agent
261
+ </ Text >
262
+ has joined the chat・3:43pm
263
+ </ AIChatEvent >
264
+
265
+ < AIChatMessage variant = "agent" >
266
+ < AIChatMessageAuthor avatarIcon = { CommunityIcon } aria-label = "Agent said" >
267
+ Agent Name
268
+ </ AIChatMessageAuthor >
269
+ < AIChatMessageBody timestamp = "3:44pm" >
270
+ Lorem ipsum dolor, sit amet consectetur adipisicing elit. Deserunt delectus fuga, necessitatibus eligendi
271
+ iure adipisci facilis exercitationem officiis dolorem laborum< AIChatMessageSource > 1</ AIChatMessageSource > ,
272
+ ex fugiat quisquam itaque, earum sit nesciunt impedit repellat assumenda.
273
+ < AIChatMessageSource > 2</ AIChatMessageSource >
274
+ </ AIChatMessageBody >
275
+ < SummaryDetail >
276
+ < SummaryDetailHeading >
277
+ < SummaryDetailToggleButton aria-label = "BOOP" />
278
+ < SummaryDetailHeadingContent >
279
+ < Text as = "p" fontWeight = "fontWeightSemibold" >
280
+ Sources
281
+ </ Text >
282
+ </ SummaryDetailHeadingContent >
283
+ </ SummaryDetailHeading >
284
+ < SummaryDetailContent >
285
+ < Box display = "flex" flexDirection = "column" rowGap = "space20" >
286
+ < AIChatMessageSourceLink number = "1" url = "#" >
287
+ Source title
288
+ </ AIChatMessageSourceLink >
289
+ < AIChatMessageSourceLink number = "2" url = "#" >
290
+ Source title
291
+ </ AIChatMessageSourceLink >
292
+ < AIChatMessageSourceLink number = "3" url = "#" >
293
+ Source title
294
+ </ AIChatMessageSourceLink >
295
+ </ Box >
296
+ </ SummaryDetailContent >
297
+ </ SummaryDetail >
298
+ < AIChatMessageActionGroup >
299
+ < AIChatMessageActionCard aria-label = "Feedback form" >
300
+ Is this helpful?
301
+ < Button variant = "secondary_icon" size = "reset" aria-label = "this is a helpful response" >
302
+ < ThumbsUpIcon decorative = { false } title = "like result" />
303
+ </ Button >
304
+ < Button variant = "secondary_icon" size = "reset" aria-label = "this is not a helpful response" >
305
+ < ThumbsDownIcon decorative = { false } title = "dislike result" />
306
+ </ Button >
307
+ </ AIChatMessageActionCard >
308
+ < AIChatMessageActionCard aria-label = "Rewrite and copy buttons" >
309
+ < Button variant = "secondary_icon" size = "reset" >
310
+ < RefreshIcon decorative />
311
+ Rewrite
312
+ </ Button >
313
+ < Button variant = "secondary_icon" size = "reset" >
314
+ < CopyIcon decorative />
315
+ Copy
316
+ </ Button >
317
+ </ AIChatMessageActionCard >
318
+ </ AIChatMessageActionGroup >
319
+ </ AIChatMessage >
320
+ </ AIChatLog >
321
+ < ChatComposer
322
+ config = { {
323
+ namespace : "customer-chat" ,
324
+ onError : ( e ) => {
325
+ throw e ;
326
+ } ,
327
+ } }
328
+ placeholder = "Chat text"
329
+ ariaLabel = "A placeholder chat composer"
330
+ >
331
+ < Box position = "absolute" top = "space30" right = "space30" >
332
+ < Button variant = "primary_icon" size = "reset" >
333
+ < SendIcon decorative = { false } title = "Send message" />
334
+ </ Button >
335
+ </ Box >
336
+ </ ChatComposer >
337
+ </ >
338
+ ) ;
339
+ } ;
237
340
export const ExampleFullScreenAIChatLog = ( ) : React . ReactNode => {
238
341
return (
239
342
< >
0 commit comments