@@ -3,22 +3,30 @@ import { Box } from "@twilio-paste/box";
3
3
import { Button } from "@twilio-paste/button" ;
4
4
import { Checkbox } from "@twilio-paste/checkbox" ;
5
5
import { CustomizationProvider } from "@twilio-paste/customization" ;
6
+ import { AgentIcon } from "@twilio-paste/icons/esm/AgentIcon" ;
6
7
import { AttachIcon } from "@twilio-paste/icons/esm/AttachIcon" ;
8
+ import { DocumentationIcon } from "@twilio-paste/icons/esm/DocumentationIcon" ;
7
9
import { DownloadIcon } from "@twilio-paste/icons/esm/DownloadIcon" ;
10
+ import { EmojiIcon } from "@twilio-paste/icons/esm/EmojiIcon" ;
11
+ import { HistoryIcon } from "@twilio-paste/icons/esm/HistoryIcon" ;
12
+ import { MoreIcon } from "@twilio-paste/icons/esm/MoreIcon" ;
8
13
import { SendIcon } from "@twilio-paste/icons/esm/SendIcon" ;
14
+ import { Menu , MenuButton , MenuItem , MenuSeparator , useMenuState } from "@twilio-paste/menu" ;
9
15
import { useTheme } from "@twilio-paste/theme" ;
16
+ import { Tooltip , useTooltipState } from "@twilio-paste/tooltip" ;
10
17
import * as React from "react" ;
11
18
19
+ import type { ChatComposerProps } from "../src" ;
12
20
import {
13
21
ChatComposer ,
14
22
ChatComposerActionGroup ,
23
+ ChatComposerActionRow ,
15
24
ChatComposerAttachmentCard ,
16
25
ChatComposerAttachmentDescription ,
17
26
ChatComposerAttachmentGroup ,
18
27
ChatComposerAttachmentLink ,
19
28
ChatComposerContainer ,
20
29
} from "../src" ;
21
- import type { ChatComposerProps } from "../src" ;
22
30
23
31
export default {
24
32
title : "Components/Chat Composer/Container" ,
@@ -68,6 +76,144 @@ export const ContainedVariant: StoryFn = () => {
68
76
69
77
ContainedVariant . storyName = "Contained Variant" ;
70
78
79
+ export const ContainedVariantActionRow : StoryFn = ( ) => {
80
+ const tooltip1 = useTooltipState ( ) ;
81
+ const tooltip2 = useTooltipState ( ) ;
82
+ const menu = useMenuState ( ) ;
83
+
84
+ return (
85
+ < ChatComposerContainer variant = "contained" >
86
+ < ChatComposer config = { defaultConfig } ariaLabel = "Basic chat composer" placeholder = "Type here..." />
87
+ < ChatComposerActionGroup >
88
+ < Button variant = "primary_icon" size = "reset" >
89
+ < SendIcon decorative = { false } title = "Send" />
90
+ </ Button >
91
+ </ ChatComposerActionGroup >
92
+ < ChatComposerActionRow >
93
+ < Tooltip state = { tooltip1 } text = "Attach" >
94
+ < Button variant = "secondary" size = "circle_small" >
95
+ < AttachIcon decorative = { false } title = "attach a file to your message" />
96
+ </ Button >
97
+ </ Tooltip >
98
+ < Tooltip state = { tooltip2 } text = "Emoji" >
99
+ < Button variant = "secondary" size = "circle_small" >
100
+ < EmojiIcon decorative = { false } title = "Chat history" />
101
+ </ Button >
102
+ </ Tooltip >
103
+
104
+ < >
105
+ < MenuButton { ...menu } variant = "secondary" size = "circle_small" >
106
+ < MoreIcon decorative = { false } title = "More actions" />
107
+ </ MenuButton >
108
+ < Menu { ...menu } aria-label = "Preferences" >
109
+ < MenuItem { ...menu } >
110
+ < Box display = "flex" alignItems = "center" columnGap = "space20" >
111
+ < HistoryIcon decorative color = "colorTextIcon" /> Chat history
112
+ </ Box >
113
+ </ MenuItem >
114
+ < MenuItem { ...menu } >
115
+ < Box display = "flex" alignItems = "center" columnGap = "space20" >
116
+ < AgentIcon decorative color = "colorTextIcon" /> Contact an agent
117
+ </ Box >
118
+ </ MenuItem >
119
+ < MenuItem { ...menu } >
120
+ < Box display = "flex" alignItems = "center" columnGap = "space20" >
121
+ < DocumentationIcon decorative color = "colorTextIcon" /> Quick Start Guide
122
+ </ Box >
123
+ </ MenuItem >
124
+ < MenuSeparator { ...menu } />
125
+ < MenuItem { ...menu } > Privacy Policy</ MenuItem >
126
+ < MenuItem { ...menu } > Terms of Service</ MenuItem >
127
+ </ Menu >
128
+ </ >
129
+ </ ChatComposerActionRow >
130
+ </ ChatComposerContainer >
131
+ ) ;
132
+ } ;
133
+
134
+ ContainedVariantActionRow . storyName = "Contained Variant with Action Row" ;
135
+
136
+ export const ContainedVariantActionRowWithAttachment : StoryFn = ( ) => {
137
+ const tooltip1 = useTooltipState ( ) ;
138
+ const tooltip2 = useTooltipState ( ) ;
139
+ const menu = useMenuState ( ) ;
140
+
141
+ return (
142
+ < ChatComposerContainer variant = "contained" >
143
+ < ChatComposer config = { defaultConfig } ariaLabel = "Basic chat composer" placeholder = "Type here..." />
144
+ < ChatComposerActionGroup >
145
+ < Button variant = "primary_icon" size = "reset" >
146
+ < SendIcon decorative = { false } title = "Send" />
147
+ </ Button >
148
+ </ ChatComposerActionGroup >
149
+ < ChatComposerActionRow >
150
+ < Tooltip state = { tooltip1 } text = "Attach" >
151
+ < Button variant = "secondary" size = "circle_small" >
152
+ < AttachIcon decorative = { false } title = "attach a file to your message" />
153
+ </ Button >
154
+ </ Tooltip >
155
+ < Tooltip state = { tooltip2 } text = "Emoji" >
156
+ < Button variant = "secondary" size = "circle_small" >
157
+ < EmojiIcon decorative = { false } title = "Chat history" />
158
+ </ Button >
159
+ </ Tooltip >
160
+
161
+ < >
162
+ < MenuButton { ...menu } variant = "secondary" size = "circle_small" >
163
+ < MoreIcon decorative = { false } title = "More actions" />
164
+ </ MenuButton >
165
+ < Menu { ...menu } aria-label = "Preferences" >
166
+ < MenuItem { ...menu } >
167
+ < Box display = "flex" alignItems = "center" columnGap = "space20" >
168
+ < HistoryIcon decorative color = "colorTextIcon" /> Chat history
169
+ </ Box >
170
+ </ MenuItem >
171
+ < MenuItem { ...menu } >
172
+ < Box display = "flex" alignItems = "center" columnGap = "space20" >
173
+ < AgentIcon decorative color = "colorTextIcon" /> Contact an agent
174
+ </ Box >
175
+ </ MenuItem >
176
+ < MenuItem { ...menu } >
177
+ < Box display = "flex" alignItems = "center" columnGap = "space20" >
178
+ < DocumentationIcon decorative color = "colorTextIcon" /> Quick Start Guide
179
+ </ Box >
180
+ </ MenuItem >
181
+ < MenuSeparator { ...menu } />
182
+ < MenuItem { ...menu } > Privacy Policy</ MenuItem >
183
+ < MenuItem { ...menu } > Terms of Service</ MenuItem >
184
+ </ Menu >
185
+ </ >
186
+ </ ChatComposerActionRow >
187
+ < ChatComposerAttachmentGroup >
188
+ < ChatComposerAttachmentCard onDismiss = { ( ) => { } } attachmentIcon = { < DownloadIcon decorative /> } >
189
+ < ChatComposerAttachmentLink href = "www.google.com" > Document-FINAL.doc</ ChatComposerAttachmentLink >
190
+ < ChatComposerAttachmentDescription > 123 MB</ ChatComposerAttachmentDescription >
191
+ </ ChatComposerAttachmentCard >
192
+ < ChatComposerAttachmentCard onDismiss = { ( ) => { } } attachmentIcon = { < DownloadIcon decorative /> } >
193
+ < ChatComposerAttachmentLink href = "www.google.com" > Document-FINAL.doc</ ChatComposerAttachmentLink >
194
+ < ChatComposerAttachmentDescription > 123 MB</ ChatComposerAttachmentDescription >
195
+ </ ChatComposerAttachmentCard >
196
+ < ChatComposerAttachmentCard onDismiss = { ( ) => { } } attachmentIcon = { < DownloadIcon decorative /> } >
197
+ < ChatComposerAttachmentLink href = "www.google.com" > Document-FINAL.doc</ ChatComposerAttachmentLink >
198
+ < ChatComposerAttachmentDescription > 123 MB</ ChatComposerAttachmentDescription >
199
+ </ ChatComposerAttachmentCard >
200
+ < ChatComposerAttachmentCard onDismiss = { ( ) => { } } attachmentIcon = { < DownloadIcon decorative /> } >
201
+ < ChatComposerAttachmentLink href = "www.google.com" > Document-FINAL.doc</ ChatComposerAttachmentLink >
202
+ < ChatComposerAttachmentDescription > 123 MB</ ChatComposerAttachmentDescription >
203
+ </ ChatComposerAttachmentCard >
204
+ < ChatComposerAttachmentCard onDismiss = { ( ) => { } } attachmentIcon = { < DownloadIcon decorative /> } >
205
+ < ChatComposerAttachmentLink href = "www.google.com" > Document-FINAL.doc</ ChatComposerAttachmentLink >
206
+ < ChatComposerAttachmentDescription > 123 MB</ ChatComposerAttachmentDescription >
207
+ </ ChatComposerAttachmentCard >
208
+ < ChatComposerAttachmentCard onDismiss = { ( ) => { } } attachmentIcon = { < DownloadIcon decorative /> } >
209
+ < ChatComposerAttachmentLink href = "www.google.com" > Document-FINAL.doc</ ChatComposerAttachmentLink >
210
+ < ChatComposerAttachmentDescription > 123 MB</ ChatComposerAttachmentDescription >
211
+ </ ChatComposerAttachmentCard >
212
+ </ ChatComposerAttachmentGroup >
213
+ </ ChatComposerContainer >
214
+ ) ;
215
+ } ;
216
+
71
217
export const ContainedVariantWithAttachments : StoryFn = ( ) => {
72
218
return (
73
219
< ChatComposerContainer variant = "contained" >
0 commit comments