@solexllc/usx-react 0.11.0 → 0.12.0
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.
- package/README.md +16 -0
- package/dist/Popover-BzDCTuQM.cjs +984 -0
- package/dist/Popover-LToVWsWc.js +985 -0
- package/dist/chat.cjs +1391 -0
- package/dist/chat.js +1391 -0
- package/dist/index.cjs +4428 -5290
- package/dist/index.js +58 -917
- package/package.json +7 -3
- package/src/chat.js +15 -0
- package/src/components/avatar/Avatar.tsx +54 -16
- package/src/components/avatar/avatar.django-snapshot.html +112 -0
- package/src/components/avatar/avatar.django.html +2 -2
- package/src/components/avatar/avatar.html +25 -0
- package/src/components/avatar/avatar.react-snapshot.html +104 -0
- package/src/components/avatar/config.json +13 -15
- package/src/components/avatar-group/AvatarGroup.tsx +17 -15
- package/src/components/avatar-group/avatar-group.django-snapshot.html +22 -0
- package/src/components/avatar-group/avatar-group.django.html +1 -1
- package/src/components/avatar-group/avatar-group.react-snapshot.html +20 -0
- package/src/components/avatar-group/config.json +2 -2
- package/src/components/back-to-top/BackToTop.tsx +21 -57
- package/src/components/back-to-top/back-to-top.django-snapshot.html +101 -202
- package/src/components/back-to-top/back-to-top.django.html +11 -38
- package/src/components/back-to-top/back-to-top.html +22 -106
- package/src/components/back-to-top/back-to-top.react-snapshot.html +94 -148
- package/src/components/back-to-top/config.json +41 -10
- package/src/components/button/Button.tsx +12 -3
- package/src/components/button/button.django-snapshot.html +18 -0
- package/src/components/button/button.django.html +3 -2
- package/src/components/button/button.react-snapshot.html +16 -0
- package/src/components/button/config.json +11 -2
- package/src/components/callout/callout.django.html +1 -1
- package/src/components/callout/config.json +7 -16
- package/src/components/character-count/CharacterCount.tsx +2 -0
- package/src/components/character-count/character-count.react-snapshot.html +7 -0
- package/src/components/chat/Chat.tsx +575 -0
- package/src/components/chat/README.md +174 -0
- package/src/components/chat/avatarProps.ts +32 -0
- package/src/components/chat/chat.django-snapshot.html +23515 -0
- package/src/components/chat/chat.django.html +75 -0
- package/src/components/chat/chat.html +116 -0
- package/src/components/chat/chat.react-snapshot.html +16895 -0
- package/src/components/chat/config.json +1241 -0
- package/src/components/chat-attachment/ChatAttachment.tsx +39 -0
- package/src/components/chat-attachment/chat-attachment.django.html +24 -0
- package/src/components/chat-attachment/chat-attachment.html +10 -0
- package/src/components/chat-attachment/config.json +27 -0
- package/src/components/chat-attachments/ChatAttachments.tsx +17 -0
- package/src/components/chat-attachments/chat-attachments.django-snapshot.html +58 -0
- package/src/components/chat-attachments/chat-attachments.django.html +10 -0
- package/src/components/chat-attachments/chat-attachments.html +14 -0
- package/src/components/chat-attachments/chat-attachments.react-snapshot.html +46 -0
- package/src/components/chat-attachments/config.json +25 -0
- package/src/components/chat-bubble/ChatBubble.tsx +39 -0
- package/src/components/chat-bubble/ChatFormattedText.tsx +138 -0
- package/src/components/chat-bubble/chat-bubble.django-snapshot.html +128 -0
- package/src/components/chat-bubble/chat-bubble.django.html +19 -0
- package/src/components/chat-bubble/chat-bubble.html +1 -0
- package/src/components/chat-bubble/chat-bubble.react-snapshot.html +118 -0
- package/src/components/chat-bubble/config.json +70 -0
- package/src/components/chat-composer/ChatComposer.tsx +210 -0
- package/src/components/chat-composer/README.md +15 -0
- package/src/components/chat-composer/chat-composer.django-snapshot.html +575 -0
- package/src/components/chat-composer/chat-composer.django.html +77 -0
- package/src/components/chat-composer/chat-composer.html +44 -0
- package/src/components/chat-composer/chat-composer.react-snapshot.html +519 -0
- package/src/components/chat-composer/chat-formatting.django.html +59 -0
- package/src/components/chat-composer/config.json +137 -0
- package/src/components/chat-context/ChatContext.tsx +46 -0
- package/src/components/chat-context/chat-context.django-snapshot.html +35 -0
- package/src/components/chat-context/chat-context.django.html +20 -0
- package/src/components/chat-context/chat-context.html +9 -0
- package/src/components/chat-context/chat-context.react-snapshot.html +30 -0
- package/src/components/chat-context/config.json +36 -0
- package/src/components/chat-controls/ChatControls.tsx +67 -0
- package/src/components/chat-controls/chat-controls.django-snapshot.html +114 -0
- package/src/components/chat-controls/chat-controls.django.html +36 -0
- package/src/components/chat-controls/chat-controls.html +11 -0
- package/src/components/chat-controls/chat-controls.react-snapshot.html +107 -0
- package/src/components/chat-controls/config.json +67 -0
- package/src/components/chat-directory/ChatDirectory.tsx +168 -0
- package/src/components/chat-directory/chat-directory.django-snapshot.html +546 -0
- package/src/components/chat-directory/chat-directory.django.html +14 -0
- package/src/components/chat-directory/chat-directory.html +4 -0
- package/src/components/chat-directory/chat-directory.react-snapshot.html +471 -0
- package/src/components/chat-directory/config.json +242 -0
- package/src/components/chat-directory-item/ChatDirectoryItem.tsx +150 -0
- package/src/components/chat-directory-item/chat-directory-item.django-snapshot.html +281 -0
- package/src/components/chat-directory-item/chat-directory-item.django.html +38 -0
- package/src/components/chat-directory-item/chat-directory-item.html +9 -0
- package/src/components/chat-directory-item/chat-directory-item.react-snapshot.html +249 -0
- package/src/components/chat-directory-item/config.json +103 -0
- package/src/components/chat-history/ChatHistory.tsx +30 -0
- package/src/components/chat-history/chat-history.django-snapshot.html +113 -0
- package/src/components/chat-history/chat-history.django.html +20 -0
- package/src/components/chat-history/chat-history.html +9 -0
- package/src/components/chat-history/chat-history.react-snapshot.html +111 -0
- package/src/components/chat-history/config.json +24 -0
- package/src/components/chat-message/ChatMessage.tsx +148 -0
- package/src/components/chat-message/chat-message.django-snapshot.html +758 -0
- package/src/components/chat-message/chat-message.django.html +56 -0
- package/src/components/chat-message/chat-message.html +12 -0
- package/src/components/chat-message/chat-message.react-snapshot.html +627 -0
- package/src/components/chat-message/config.json +278 -0
- package/src/components/chat-message-actions/ChatMessageActions.tsx +133 -0
- package/src/components/chat-message-actions/chat-message-actions.django-snapshot.html +345 -0
- package/src/components/chat-message-actions/chat-message-actions.django.html +29 -0
- package/src/components/chat-message-actions/chat-message-actions.html +53 -0
- package/src/components/chat-message-actions/chat-message-actions.react-snapshot.html +295 -0
- package/src/components/chat-message-actions/config.json +121 -0
- package/src/components/chat-window/ChatWindow.tsx +133 -0
- package/src/components/chat-window/chat-window.django-snapshot.html +448 -0
- package/src/components/chat-window/chat-window.django.html +39 -0
- package/src/components/chat-window/chat-window.html +26 -0
- package/src/components/chat-window/chat-window.react-snapshot.html +286 -0
- package/src/components/chat-window/config.json +123 -0
- package/src/components/clickable/Clickable.tsx +19 -5
- package/src/components/clickable/clickable.django-snapshot.html +11 -2
- package/src/components/clickable/clickable.django.html +2 -0
- package/src/components/clickable/clickable.react-snapshot.html +10 -2
- package/src/components/clickable/config.json +4 -0
- package/src/components/code/code.django-snapshot.html +25 -18
- package/src/components/code/code.react-snapshot.html +41 -4
- package/src/components/copy-to-clipboard/CopyToClipboard.tsx +2 -7
- package/src/components/copy-to-clipboard/copy-to-clipboard.django-snapshot.html +6 -4
- package/src/components/copy-to-clipboard/copy-to-clipboard.django.html +3 -2
- package/src/components/copy-to-clipboard/copy-to-clipboard.react-snapshot.html +14 -2
- package/src/components/file-list/FileList.tsx +3 -2
- package/src/components/file-list/config.json +5 -0
- package/src/components/file-list/file-list.django-snapshot.html +63 -0
- package/src/components/file-list/file-list.django.html +1 -1
- package/src/components/file-list/file-list.react-snapshot.html +53 -0
- package/src/components/footer/footer.django-snapshot.html +0 -3
- package/src/components/header/header.django-snapshot.html +0 -160
- package/src/components/header/header.django.html +2 -2
- package/src/components/hero/hero.django-snapshot.html +0 -20
- package/src/components/hero/hero.django.html +3 -3
- package/src/components/image/image.django.html +4 -4
- package/src/components/input/Input.tsx +1 -1
- package/src/components/input/config.json +2 -3
- package/src/components/input/input.django-snapshot.html +4 -21
- package/src/components/input/input.django.html +2 -2
- package/src/components/link/Link.tsx +7 -4
- package/src/components/link/config.json +2 -3
- package/src/components/link/link.django-snapshot.html +8 -0
- package/src/components/link/link.django.html +2 -2
- package/src/components/link/link.html +4 -1
- package/src/components/link/link.react-snapshot.html +8 -0
- package/src/components/memorable-date/memorable-date.django-snapshot.html +0 -8
- package/src/components/memorable-date/memorable-date.django.html +2 -2
- package/src/components/misc-banner/misc-banner.django-snapshot.html +12 -12
- package/src/components/misc-banner/misc-banner.django.html +4 -2
- package/src/components/popover/Popover.tsx +60 -9
- package/src/components/popover/PopoverMenu.tsx +33 -15
- package/src/components/popover/config.json +88 -14
- package/src/components/popover/popover-menu.django.html +13 -2
- package/src/components/popover/popover.django-snapshot.html +229 -7
- package/src/components/popover/popover.django.html +3 -2
- package/src/components/popover/popover.react-snapshot.html +127 -4
- package/src/components/process-list/config.json +41 -3
- package/src/components/quote/Quote.tsx +9 -2
- package/src/components/search/Search.tsx +1 -1
- package/src/components/search/config.json +3 -4
- package/src/components/search/search.django-snapshot.html +262 -1684
- package/src/components/search/search.django.html +1 -20
- package/src/components/select/select.django-snapshot.html +7 -7
- package/src/components/select/select.react-snapshot.html +7 -7
- package/src/components/summary/Summary.tsx +4 -2
- package/src/components/summary/config.json +4 -0
- package/src/components/summary/summary.django.html +4 -4
- package/src/components/table/Table.tsx +58 -25
- package/src/components/table/config.json +61 -13
- package/src/components/tag/Tag.tsx +40 -7
- package/src/components/tag/config.json +18 -2
- package/src/components/tag/tag.django-snapshot.html +16 -1
- package/src/components/tag/tag.django.html +12 -6
- package/src/components/tag/tag.html +4 -0
- package/src/components/tag/tag.react-snapshot.html +16 -1
- package/src/components/tag-group/TagGroup.tsx +6 -9
- package/src/components/tag-group/config.json +4 -0
- package/src/components/tag-group/tag-group.django.html +1 -1
|
@@ -0,0 +1,575 @@
|
|
|
1
|
+
<h3 class="site-preview-heading">Default</h3>
|
|
2
|
+
<div>
|
|
3
|
+
<section id="django-example-composer-default" class="usx-chat" style="max-width: 28rem">
|
|
4
|
+
<div data-chat-view="conversation" class="usx-chat__window" style="height: auto">
|
|
5
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
6
|
+
<ol class="usx-chat__messages"></ol>
|
|
7
|
+
<form
|
|
8
|
+
id="django-composer-default-composer"
|
|
9
|
+
class="usx-chat-composer usx-chat__composer"
|
|
10
|
+
method="post"
|
|
11
|
+
>
|
|
12
|
+
<label class="usa-label usx-label usa-sr-only" for="django-composer-default-message">
|
|
13
|
+
Message
|
|
14
|
+
</label>
|
|
15
|
+
|
|
16
|
+
<textarea
|
|
17
|
+
class="usa-textarea usx-textarea"
|
|
18
|
+
id="django-composer-default-message"
|
|
19
|
+
name="message"
|
|
20
|
+
rows="2"
|
|
21
|
+
placeholder="Write a message"
|
|
22
|
+
></textarea>
|
|
23
|
+
|
|
24
|
+
<div class="usx-chat__composer-actions">
|
|
25
|
+
<div class="usx-chat__attach">
|
|
26
|
+
<!-- prettier-ignore -->
|
|
27
|
+
<details
|
|
28
|
+
|
|
29
|
+
class="usx-popover usx-chat__emoji-picker"
|
|
30
|
+
data-side="top"
|
|
31
|
+
data-align="start"
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
>
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
<summary class="usa-button usx-button usa-button--outline" aria-label="Choose emoji" title="Choose emoji">
|
|
38
|
+
|
|
39
|
+
<svg
|
|
40
|
+
class="
|
|
41
|
+
usa-icon usx-icon
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
"
|
|
46
|
+
|
|
47
|
+
aria-hidden="true"
|
|
48
|
+
focusable="false"
|
|
49
|
+
role="img"
|
|
50
|
+
>
|
|
51
|
+
|
|
52
|
+
<use href="img/sprite.svg#sentiment_satisfied"></use>
|
|
53
|
+
|
|
54
|
+
</svg></summary>
|
|
55
|
+
|
|
56
|
+
<div
|
|
57
|
+
id="django-composer-default-emoji-picker"
|
|
58
|
+
class="usx-popover__panel usx-popover__panel--square"
|
|
59
|
+
><ul class="usx-popover__menu"><li><button
|
|
60
|
+
type="button"
|
|
61
|
+
class="usx-popover__menu-item"
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
aria-label="Thumbs up"title=":thumbs_up:"data-usx-chat-emoji="👍"data-usx-chat-emoji-name="thumbs_up"data-usx-chat-emoji-aliases=""
|
|
65
|
+
>
|
|
66
|
+
|
|
67
|
+
👍
|
|
68
|
+
</button></li><li><button
|
|
69
|
+
type="button"
|
|
70
|
+
class="usx-popover__menu-item"
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
aria-label="Smile"title=":smile:"data-usx-chat-emoji="😊"data-usx-chat-emoji-name="smile"data-usx-chat-emoji-aliases=""
|
|
74
|
+
>
|
|
75
|
+
|
|
76
|
+
😊
|
|
77
|
+
</button></li><li><button
|
|
78
|
+
type="button"
|
|
79
|
+
class="usx-popover__menu-item"
|
|
80
|
+
|
|
81
|
+
|
|
82
|
+
aria-label="Celebrate"title=":celebrate:"data-usx-chat-emoji="🎉"data-usx-chat-emoji-name="celebrate"data-usx-chat-emoji-aliases=""
|
|
83
|
+
>
|
|
84
|
+
|
|
85
|
+
🎉
|
|
86
|
+
</button></li></ul>
|
|
87
|
+
</div></details>
|
|
88
|
+
</div>
|
|
89
|
+
|
|
90
|
+
<button
|
|
91
|
+
type="submit"
|
|
92
|
+
class="usa-button usx-button usa-button--primary usx-chat__send"
|
|
93
|
+
disabled
|
|
94
|
+
aria-disabled="true"
|
|
95
|
+
>
|
|
96
|
+
<svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
|
|
97
|
+
<use href="img/sprite.svg#send"></use>
|
|
98
|
+
</svg>
|
|
99
|
+
|
|
100
|
+
Send
|
|
101
|
+
</button>
|
|
102
|
+
</div>
|
|
103
|
+
</form>
|
|
104
|
+
</div>
|
|
105
|
+
</section>
|
|
106
|
+
</div>
|
|
107
|
+
|
|
108
|
+
<h3 class="site-preview-heading">With Formatting</h3>
|
|
109
|
+
<div>
|
|
110
|
+
<section id="django-example-composer-withformatting" class="usx-chat" style="max-width: 28rem">
|
|
111
|
+
<div data-chat-view="conversation" class="usx-chat__window" style="height: auto">
|
|
112
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
113
|
+
<ol class="usx-chat__messages"></ol>
|
|
114
|
+
<form
|
|
115
|
+
id="django-composer-formatting-composer"
|
|
116
|
+
class="usx-chat-composer usx-chat__composer"
|
|
117
|
+
method="post"
|
|
118
|
+
>
|
|
119
|
+
<div
|
|
120
|
+
id="django-composer-formatting-formatting"
|
|
121
|
+
class="usx-chat__formatting"
|
|
122
|
+
aria-label="Message formatting"
|
|
123
|
+
hidden
|
|
124
|
+
>
|
|
125
|
+
<ul
|
|
126
|
+
class="usa-button-group usx-button-group usa-button-group--segmented usx-chat__format-buttons"
|
|
127
|
+
>
|
|
128
|
+
<li class="usa-button-group__item">
|
|
129
|
+
<button
|
|
130
|
+
type="button"
|
|
131
|
+
class="usa-button usx-button usa-button--outline usx-chat__format-button"
|
|
132
|
+
data-usx-chat-format="bold"
|
|
133
|
+
aria-label="Bold"
|
|
134
|
+
title="Bold (Ctrl/⌘+B)"
|
|
135
|
+
>
|
|
136
|
+
<strong>B</strong>
|
|
137
|
+
</button>
|
|
138
|
+
</li>
|
|
139
|
+
|
|
140
|
+
<li class="usa-button-group__item">
|
|
141
|
+
<button
|
|
142
|
+
type="button"
|
|
143
|
+
class="usa-button usx-button usa-button--outline usx-chat__format-button"
|
|
144
|
+
data-usx-chat-format="italic"
|
|
145
|
+
aria-label="Italic"
|
|
146
|
+
title="Italic (Ctrl/⌘+I)"
|
|
147
|
+
>
|
|
148
|
+
<em> I </em>
|
|
149
|
+
</button>
|
|
150
|
+
</li>
|
|
151
|
+
|
|
152
|
+
<li class="usa-button-group__item">
|
|
153
|
+
<button
|
|
154
|
+
type="button"
|
|
155
|
+
class="usa-button usx-button usa-button--outline usx-chat__format-button"
|
|
156
|
+
data-usx-chat-format="underline"
|
|
157
|
+
aria-label="Underline"
|
|
158
|
+
title="Underline (Ctrl/⌘+U)"
|
|
159
|
+
>
|
|
160
|
+
<u> U </u>
|
|
161
|
+
</button>
|
|
162
|
+
</li>
|
|
163
|
+
|
|
164
|
+
<li class="usa-button-group__item">
|
|
165
|
+
<button
|
|
166
|
+
type="button"
|
|
167
|
+
class="usa-button usx-button usa-button--outline usx-chat__format-button"
|
|
168
|
+
data-usx-chat-format="strike"
|
|
169
|
+
aria-label="Strikethrough"
|
|
170
|
+
title="Strikethrough (Ctrl/⌘+Shift+X)"
|
|
171
|
+
>
|
|
172
|
+
<s> S </s>
|
|
173
|
+
</button>
|
|
174
|
+
</li>
|
|
175
|
+
|
|
176
|
+
<li class="usa-button-group__item">
|
|
177
|
+
<button
|
|
178
|
+
type="button"
|
|
179
|
+
class="usa-button usx-button usa-button--outline usx-chat__format-button"
|
|
180
|
+
data-usx-chat-format="ordered"
|
|
181
|
+
aria-label="Numbered list"
|
|
182
|
+
title="Numbered list (Ctrl/⌘+Shift+7)"
|
|
183
|
+
>
|
|
184
|
+
1.
|
|
185
|
+
</button>
|
|
186
|
+
</li>
|
|
187
|
+
|
|
188
|
+
<li class="usa-button-group__item">
|
|
189
|
+
<button
|
|
190
|
+
type="button"
|
|
191
|
+
class="usa-button usx-button usa-button--outline usx-chat__format-button"
|
|
192
|
+
data-usx-chat-format="unordered"
|
|
193
|
+
aria-label="Bulleted list"
|
|
194
|
+
title="Bulleted list (Ctrl/⌘+Shift+8)"
|
|
195
|
+
>
|
|
196
|
+
<svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
|
|
197
|
+
<use href="img/sprite.svg#list"></use>
|
|
198
|
+
</svg>
|
|
199
|
+
</button>
|
|
200
|
+
</li>
|
|
201
|
+
|
|
202
|
+
<li class="usa-button-group__item">
|
|
203
|
+
<button
|
|
204
|
+
type="button"
|
|
205
|
+
class="usa-button usx-button usa-button--outline usx-chat__format-button"
|
|
206
|
+
data-usx-chat-format="quote"
|
|
207
|
+
aria-label="Block quote"
|
|
208
|
+
title="Block quote (Ctrl/⌘+Shift+9)"
|
|
209
|
+
>
|
|
210
|
+
<svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
|
|
211
|
+
<use href="img/sprite.svg#format_quote"></use>
|
|
212
|
+
</svg>
|
|
213
|
+
</button>
|
|
214
|
+
</li>
|
|
215
|
+
|
|
216
|
+
<li class="usa-button-group__item">
|
|
217
|
+
<button
|
|
218
|
+
type="button"
|
|
219
|
+
class="usa-button usx-button usa-button--outline usx-chat__format-button"
|
|
220
|
+
data-usx-chat-format="code"
|
|
221
|
+
aria-label="Code block"
|
|
222
|
+
title="Code block (Ctrl/⌘+Alt+Shift+C)"
|
|
223
|
+
>
|
|
224
|
+
<svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
|
|
225
|
+
<use href="img/sprite.svg#code"></use>
|
|
226
|
+
</svg>
|
|
227
|
+
</button>
|
|
228
|
+
</li>
|
|
229
|
+
</ul>
|
|
230
|
+
</div>
|
|
231
|
+
|
|
232
|
+
<label class="usa-label usx-label usa-sr-only" for="django-composer-formatting-message">
|
|
233
|
+
Message
|
|
234
|
+
</label>
|
|
235
|
+
|
|
236
|
+
<textarea
|
|
237
|
+
class="usa-textarea usx-textarea"
|
|
238
|
+
id="django-composer-formatting-message"
|
|
239
|
+
name="message"
|
|
240
|
+
rows="2"
|
|
241
|
+
placeholder="Write a message"
|
|
242
|
+
></textarea>
|
|
243
|
+
|
|
244
|
+
<div class="usx-chat__composer-actions">
|
|
245
|
+
<div class="usx-chat__attach">
|
|
246
|
+
<ul class="usa-button-group usx-button-group usx-chat__composer-tools">
|
|
247
|
+
<li class="usa-button-group__item">
|
|
248
|
+
<button
|
|
249
|
+
type="button"
|
|
250
|
+
class="usa-button usx-button usa-button--outline"
|
|
251
|
+
data-usx-chat-toggle-formatting=""
|
|
252
|
+
aria-label="Show formatting"
|
|
253
|
+
title="Show formatting"
|
|
254
|
+
aria-expanded="false"
|
|
255
|
+
aria-controls="django-composer-formatting-formatting"
|
|
256
|
+
>
|
|
257
|
+
<svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
|
|
258
|
+
<use href="img/sprite.svg#text_fields"></use>
|
|
259
|
+
</svg>
|
|
260
|
+
</button>
|
|
261
|
+
</li>
|
|
262
|
+
</ul>
|
|
263
|
+
|
|
264
|
+
<!-- prettier-ignore -->
|
|
265
|
+
<details
|
|
266
|
+
|
|
267
|
+
class="usx-popover usx-chat__emoji-picker"
|
|
268
|
+
data-side="top"
|
|
269
|
+
data-align="start"
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
>
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
<summary class="usa-button usx-button usa-button--outline" aria-label="Choose emoji" title="Choose emoji">
|
|
276
|
+
|
|
277
|
+
<svg
|
|
278
|
+
class="
|
|
279
|
+
usa-icon usx-icon
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
"
|
|
284
|
+
|
|
285
|
+
aria-hidden="true"
|
|
286
|
+
focusable="false"
|
|
287
|
+
role="img"
|
|
288
|
+
>
|
|
289
|
+
|
|
290
|
+
<use href="img/sprite.svg#sentiment_satisfied"></use>
|
|
291
|
+
|
|
292
|
+
</svg></summary>
|
|
293
|
+
|
|
294
|
+
<div
|
|
295
|
+
id="django-composer-formatting-emoji-picker"
|
|
296
|
+
class="usx-popover__panel usx-popover__panel--square"
|
|
297
|
+
><ul class="usx-popover__menu"><li><button
|
|
298
|
+
type="button"
|
|
299
|
+
class="usx-popover__menu-item"
|
|
300
|
+
|
|
301
|
+
|
|
302
|
+
aria-label="Thumbs up"title=":thumbs_up:"data-usx-chat-emoji="👍"data-usx-chat-emoji-name="thumbs_up"data-usx-chat-emoji-aliases=""
|
|
303
|
+
>
|
|
304
|
+
|
|
305
|
+
👍
|
|
306
|
+
</button></li><li><button
|
|
307
|
+
type="button"
|
|
308
|
+
class="usx-popover__menu-item"
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
aria-label="Smile"title=":smile:"data-usx-chat-emoji="😊"data-usx-chat-emoji-name="smile"data-usx-chat-emoji-aliases=""
|
|
312
|
+
>
|
|
313
|
+
|
|
314
|
+
😊
|
|
315
|
+
</button></li><li><button
|
|
316
|
+
type="button"
|
|
317
|
+
class="usx-popover__menu-item"
|
|
318
|
+
|
|
319
|
+
|
|
320
|
+
aria-label="Celebrate"title=":celebrate:"data-usx-chat-emoji="🎉"data-usx-chat-emoji-name="celebrate"data-usx-chat-emoji-aliases=""
|
|
321
|
+
>
|
|
322
|
+
|
|
323
|
+
🎉
|
|
324
|
+
</button></li></ul>
|
|
325
|
+
</div></details>
|
|
326
|
+
</div>
|
|
327
|
+
|
|
328
|
+
<button
|
|
329
|
+
type="submit"
|
|
330
|
+
class="usa-button usx-button usa-button--primary usx-chat__send"
|
|
331
|
+
disabled
|
|
332
|
+
aria-disabled="true"
|
|
333
|
+
>
|
|
334
|
+
<svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
|
|
335
|
+
<use href="img/sprite.svg#send"></use>
|
|
336
|
+
</svg>
|
|
337
|
+
|
|
338
|
+
Send
|
|
339
|
+
</button>
|
|
340
|
+
</div>
|
|
341
|
+
</form>
|
|
342
|
+
</div>
|
|
343
|
+
</section>
|
|
344
|
+
</div>
|
|
345
|
+
|
|
346
|
+
<h3 class="site-preview-heading">With Attachments And Emoji</h3>
|
|
347
|
+
<div>
|
|
348
|
+
<section
|
|
349
|
+
id="django-example-composer-withattachmentsandemoji"
|
|
350
|
+
class="usx-chat"
|
|
351
|
+
style="max-width: 28rem"
|
|
352
|
+
>
|
|
353
|
+
<div data-chat-view="conversation" class="usx-chat__window" style="height: auto">
|
|
354
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
355
|
+
<ol class="usx-chat__messages"></ol>
|
|
356
|
+
<form
|
|
357
|
+
id="django-composer-attachments-composer"
|
|
358
|
+
class="usx-chat-composer usx-chat__composer"
|
|
359
|
+
method="post"
|
|
360
|
+
enctype="multipart/form-data"
|
|
361
|
+
>
|
|
362
|
+
<label class="usa-label usx-label usa-sr-only" for="django-composer-attachments-message">
|
|
363
|
+
Message
|
|
364
|
+
</label>
|
|
365
|
+
|
|
366
|
+
<textarea
|
|
367
|
+
class="usa-textarea usx-textarea"
|
|
368
|
+
id="django-composer-attachments-message"
|
|
369
|
+
name="message"
|
|
370
|
+
rows="2"
|
|
371
|
+
placeholder="Write a message"
|
|
372
|
+
></textarea>
|
|
373
|
+
|
|
374
|
+
<div class="usx-chat__composer-actions">
|
|
375
|
+
<div class="usx-chat__attach">
|
|
376
|
+
<ul class="usa-button-group usx-button-group usx-chat__composer-tools">
|
|
377
|
+
<li class="usa-button-group__item">
|
|
378
|
+
<button
|
|
379
|
+
type="button"
|
|
380
|
+
class="usa-button usx-button usa-button--outline"
|
|
381
|
+
data-usx-chat-attach=""
|
|
382
|
+
aria-label="Attach files"
|
|
383
|
+
title="Attach files"
|
|
384
|
+
>
|
|
385
|
+
<svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
|
|
386
|
+
<use href="img/sprite.svg#attach_file"></use>
|
|
387
|
+
</svg>
|
|
388
|
+
</button>
|
|
389
|
+
</li>
|
|
390
|
+
</ul>
|
|
391
|
+
|
|
392
|
+
<!-- prettier-ignore -->
|
|
393
|
+
<details
|
|
394
|
+
|
|
395
|
+
class="usx-popover usx-chat__emoji-picker"
|
|
396
|
+
data-side="top"
|
|
397
|
+
data-align="start"
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
>
|
|
401
|
+
|
|
402
|
+
|
|
403
|
+
<summary class="usa-button usx-button usa-button--outline" aria-label="Choose emoji" title="Choose emoji">
|
|
404
|
+
|
|
405
|
+
<svg
|
|
406
|
+
class="
|
|
407
|
+
usa-icon usx-icon
|
|
408
|
+
|
|
409
|
+
|
|
410
|
+
|
|
411
|
+
"
|
|
412
|
+
|
|
413
|
+
aria-hidden="true"
|
|
414
|
+
focusable="false"
|
|
415
|
+
role="img"
|
|
416
|
+
>
|
|
417
|
+
|
|
418
|
+
<use href="img/sprite.svg#sentiment_satisfied"></use>
|
|
419
|
+
|
|
420
|
+
</svg></summary>
|
|
421
|
+
|
|
422
|
+
<div
|
|
423
|
+
id="django-composer-attachments-emoji-picker"
|
|
424
|
+
class="usx-popover__panel usx-popover__panel--square"
|
|
425
|
+
><ul class="usx-popover__menu"><li><button
|
|
426
|
+
type="button"
|
|
427
|
+
class="usx-popover__menu-item"
|
|
428
|
+
|
|
429
|
+
|
|
430
|
+
aria-label="Thumbs up"title=":thumbs_up:"data-usx-chat-emoji="👍"data-usx-chat-emoji-name="thumbs_up"data-usx-chat-emoji-aliases=""
|
|
431
|
+
>
|
|
432
|
+
|
|
433
|
+
👍
|
|
434
|
+
</button></li><li><button
|
|
435
|
+
type="button"
|
|
436
|
+
class="usx-popover__menu-item"
|
|
437
|
+
|
|
438
|
+
|
|
439
|
+
aria-label="Smile"title=":smile:"data-usx-chat-emoji="😊"data-usx-chat-emoji-name="smile"data-usx-chat-emoji-aliases=""
|
|
440
|
+
>
|
|
441
|
+
|
|
442
|
+
😊
|
|
443
|
+
</button></li><li><button
|
|
444
|
+
type="button"
|
|
445
|
+
class="usx-popover__menu-item"
|
|
446
|
+
|
|
447
|
+
|
|
448
|
+
aria-label="Celebrate"title=":celebrate:"data-usx-chat-emoji="🎉"data-usx-chat-emoji-name="celebrate"data-usx-chat-emoji-aliases=""
|
|
449
|
+
>
|
|
450
|
+
|
|
451
|
+
🎉
|
|
452
|
+
</button></li></ul>
|
|
453
|
+
</div></details>
|
|
454
|
+
|
|
455
|
+
<input
|
|
456
|
+
type="file"
|
|
457
|
+
hidden
|
|
458
|
+
name="attachments"
|
|
459
|
+
multiple
|
|
460
|
+
aria-label="Attach files"
|
|
461
|
+
accept="image/*,.pdf"
|
|
462
|
+
/>
|
|
463
|
+
</div>
|
|
464
|
+
|
|
465
|
+
<button
|
|
466
|
+
type="submit"
|
|
467
|
+
class="usa-button usx-button usa-button--primary usx-chat__send"
|
|
468
|
+
disabled
|
|
469
|
+
aria-disabled="true"
|
|
470
|
+
>
|
|
471
|
+
<svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
|
|
472
|
+
<use href="img/sprite.svg#send"></use>
|
|
473
|
+
</svg>
|
|
474
|
+
|
|
475
|
+
Send
|
|
476
|
+
</button>
|
|
477
|
+
</div>
|
|
478
|
+
</form>
|
|
479
|
+
</div>
|
|
480
|
+
</section>
|
|
481
|
+
</div>
|
|
482
|
+
|
|
483
|
+
<h3 class="site-preview-heading">Thread Reply</h3>
|
|
484
|
+
<div>
|
|
485
|
+
<section id="django-example-composer-threadreply" class="usx-chat" style="max-width: 28rem">
|
|
486
|
+
<div data-chat-view="thread" class="usx-chat__window" style="height: auto">
|
|
487
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
488
|
+
<ol class="usx-chat__messages"></ol>
|
|
489
|
+
<form
|
|
490
|
+
id="django-composer-thread-composer"
|
|
491
|
+
class="usx-chat-composer usx-chat__composer"
|
|
492
|
+
method="post"
|
|
493
|
+
>
|
|
494
|
+
<input type="hidden" name="conversationId" value="conversation-42" />
|
|
495
|
+
|
|
496
|
+
<input type="hidden" name="threadRootId" value="message-7" />
|
|
497
|
+
|
|
498
|
+
<label class="usa-label usx-label usa-sr-only" for="django-composer-thread-message">
|
|
499
|
+
Reply in thread
|
|
500
|
+
</label>
|
|
501
|
+
|
|
502
|
+
<textarea
|
|
503
|
+
class="usa-textarea usx-textarea"
|
|
504
|
+
id="django-composer-thread-message"
|
|
505
|
+
name="message"
|
|
506
|
+
rows="2"
|
|
507
|
+
placeholder="Reply in thread"
|
|
508
|
+
></textarea>
|
|
509
|
+
|
|
510
|
+
<div class="usx-chat__composer-actions">
|
|
511
|
+
<div class="usx-chat__attach"></div>
|
|
512
|
+
|
|
513
|
+
<button
|
|
514
|
+
type="submit"
|
|
515
|
+
class="usa-button usx-button usa-button--primary usx-chat__send"
|
|
516
|
+
disabled
|
|
517
|
+
aria-disabled="true"
|
|
518
|
+
>
|
|
519
|
+
<svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
|
|
520
|
+
<use href="img/sprite.svg#send"></use>
|
|
521
|
+
</svg>
|
|
522
|
+
|
|
523
|
+
Send reply
|
|
524
|
+
</button>
|
|
525
|
+
</div>
|
|
526
|
+
</form>
|
|
527
|
+
</div>
|
|
528
|
+
</section>
|
|
529
|
+
</div>
|
|
530
|
+
|
|
531
|
+
<h3 class="site-preview-heading">Group Message</h3>
|
|
532
|
+
<div>
|
|
533
|
+
<section id="django-example-composer-groupmessage" class="usx-chat" style="max-width: 28rem">
|
|
534
|
+
<div data-chat-view="conversation" class="usx-chat__window" style="height: auto">
|
|
535
|
+
<span class="usx-chat__copy-status usa-sr-only" role="status"></span>
|
|
536
|
+
<ol class="usx-chat__messages"></ol>
|
|
537
|
+
<form
|
|
538
|
+
id="django-composer-group-composer"
|
|
539
|
+
data-usx-chat-require-recipients="true"
|
|
540
|
+
class="usx-chat-composer usx-chat__composer"
|
|
541
|
+
method="post"
|
|
542
|
+
>
|
|
543
|
+
<input type="hidden" name="recipientIds" value="agent" />
|
|
544
|
+
|
|
545
|
+
<input type="hidden" name="recipientIds" value="specialist" />
|
|
546
|
+
|
|
547
|
+
<label class="usa-label usx-label usa-sr-only" for="django-composer-group-message">
|
|
548
|
+
Message
|
|
549
|
+
</label>
|
|
550
|
+
|
|
551
|
+
<textarea
|
|
552
|
+
class="usa-textarea usx-textarea"
|
|
553
|
+
id="django-composer-group-message"
|
|
554
|
+
name="message"
|
|
555
|
+
rows="2"
|
|
556
|
+
placeholder="Write a message"
|
|
557
|
+
>
|
|
558
|
+
Can we review the application together?</textarea
|
|
559
|
+
>
|
|
560
|
+
|
|
561
|
+
<div class="usx-chat__composer-actions">
|
|
562
|
+
<div class="usx-chat__attach"></div>
|
|
563
|
+
|
|
564
|
+
<button type="submit" class="usa-button usx-button usa-button--primary usx-chat__send">
|
|
565
|
+
<svg class="usa-icon usx-icon" aria-hidden="true" focusable="false" role="img">
|
|
566
|
+
<use href="img/sprite.svg#send"></use>
|
|
567
|
+
</svg>
|
|
568
|
+
|
|
569
|
+
Send
|
|
570
|
+
</button>
|
|
571
|
+
</div>
|
|
572
|
+
</form>
|
|
573
|
+
</div>
|
|
574
|
+
</section>
|
|
575
|
+
</div>
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
{% load usx_components %}
|
|
2
|
+
<form id="{{ id }}-composer" {% if requireRecipients %}data-usx-chat-require-recipients="true"{% endif %} class="usx-chat-composer usx-chat__composer" method="post" {% if allowAttachments %} enctype="multipart/form-data" {% endif %}{% if formAction != None %} action="{{ formAction }}" {% endif %} >
|
|
3
|
+
{% if conversationId %}
|
|
4
|
+
<input type="hidden" name="conversationId" value="{{ conversationId }}" />
|
|
5
|
+
{% endif %}
|
|
6
|
+
{% if recipientId and not conversationId %}
|
|
7
|
+
<input type="hidden" name="recipientId" value="{{ recipientId }}" />
|
|
8
|
+
{% endif %}
|
|
9
|
+
{% if not conversationId %}
|
|
10
|
+
{% for recipient in recipientIds %}
|
|
11
|
+
<input type="hidden" name="recipientIds" value="{{ recipient }}" />
|
|
12
|
+
{% endfor %}
|
|
13
|
+
{% endif %}
|
|
14
|
+
{% if isThread and threadRootId %}
|
|
15
|
+
<input type="hidden" name="threadRootId" value="{{ threadRootId }}" />
|
|
16
|
+
{% endif %}
|
|
17
|
+
{% if allowFormatting %}
|
|
18
|
+
{% include 'chat-composer/chat-formatting.django.html' %}
|
|
19
|
+
{% endif %}
|
|
20
|
+
{% dict name='message' rows='2' as composerAttributes %}
|
|
21
|
+
{% if isThread %}
|
|
22
|
+
{% text_area id=id|add:'-message' label='Reply in thread' screenReaderOnlyLabel=True formGroup=False value=value placeholder='Reply in thread' disabled=disabled extraAttributes=composerAttributes %}{% endtext_area %}
|
|
23
|
+
{% else %}
|
|
24
|
+
{% text_area id=id|add:'-message' label='Message' screenReaderOnlyLabel=True formGroup=False value=value placeholder='Write a message' disabled=disabled extraAttributes=composerAttributes %}{% endtext_area %}
|
|
25
|
+
{% endif %}
|
|
26
|
+
<div class="usx-chat__composer-actions">
|
|
27
|
+
<div class="usx-chat__attach">
|
|
28
|
+
{% if allowAttachments or allowFormatting %}
|
|
29
|
+
<ul class="usa-button-group usx-button-group usx-chat__composer-tools">
|
|
30
|
+
{% if allowAttachments %}
|
|
31
|
+
{% dict data_usx_chat_attach='' aria_label='Attach files' title='Attach files' as attachAttrs %}
|
|
32
|
+
<li class="usa-button-group__item">
|
|
33
|
+
{% button variant='outline' disabled=disabled extraAttributes=attachAttrs %}
|
|
34
|
+
{% icon name='attach_file' %}{% endicon %}
|
|
35
|
+
{% endbutton %}
|
|
36
|
+
</li>
|
|
37
|
+
{% endif %}
|
|
38
|
+
{% if allowFormatting %}
|
|
39
|
+
{% dict data_usx_chat_toggle_formatting='' aria_label='Show formatting' title='Show formatting' aria_expanded='false' aria_controls=id|add:'-formatting' as formatAttrs %}
|
|
40
|
+
<li class="usa-button-group__item">
|
|
41
|
+
{% button variant='outline' disabled=disabled extraAttributes=formatAttrs %}
|
|
42
|
+
{% icon name='text_fields' %}{% endicon %}
|
|
43
|
+
{% endbutton %}
|
|
44
|
+
</li>
|
|
45
|
+
{% endif %}
|
|
46
|
+
</ul>
|
|
47
|
+
{% endif %}
|
|
48
|
+
{% if emojiPack and not disabled %}
|
|
49
|
+
{% icon name='sentiment_satisfied' as emojiIcon %}{% endicon %}
|
|
50
|
+
{% dict children=emojiIcon ariaLabel='Choose emoji' title='Choose emoji' className='usa-button usx-button usa-button--outline' as emojiSummary %}
|
|
51
|
+
{% popover id=id|add:'-emoji-picker' side='top' align='start' panelShape='square' className='usx-chat__emoji-picker' summaryProps=emojiSummary menuItems=emojiMenuItems %}{% endpopover %}
|
|
52
|
+
{% endif %}
|
|
53
|
+
{% if allowAttachments %}
|
|
54
|
+
<input type="file" hidden name="attachments" multiple aria-label="Attach files" {% if accept != None %} accept="{{ accept }}" {% endif %}{% if disabled %} disabled{% endif %} />
|
|
55
|
+
{% endif %}
|
|
56
|
+
</div>
|
|
57
|
+
{% if disabled or not hasText or requireRecipients and not recipientIds and not recipientId %}
|
|
58
|
+
{% button type='submit' variant='primary' className='usx-chat__send' disabled=True %}
|
|
59
|
+
{% icon name='send' %}{% endicon %}
|
|
60
|
+
{% if isThread %}
|
|
61
|
+
Send reply
|
|
62
|
+
{% else %}
|
|
63
|
+
Send
|
|
64
|
+
{% endif %}
|
|
65
|
+
{% endbutton %}
|
|
66
|
+
{% else %}
|
|
67
|
+
{% button type='submit' variant='primary' className='usx-chat__send' %}
|
|
68
|
+
{% icon name='send' %}{% endicon %}
|
|
69
|
+
{% if isThread %}
|
|
70
|
+
Send reply
|
|
71
|
+
{% else %}
|
|
72
|
+
Send
|
|
73
|
+
{% endif %}
|
|
74
|
+
{% endbutton %}
|
|
75
|
+
{% endif %}
|
|
76
|
+
</div>
|
|
77
|
+
</form>
|