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