@patternfly/chatbot 2.2.0-prerelease.9 → 2.2.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 (459) hide show
  1. package/dist/cjs/AttachmentEdit/AttachmentEdit.test.d.ts +1 -0
  2. package/dist/cjs/AttachmentEdit/AttachmentEdit.test.js +52 -0
  3. package/dist/cjs/Chatbot/Chatbot.d.ts +2 -1
  4. package/dist/cjs/Chatbot/Chatbot.js +1 -0
  5. package/dist/cjs/Chatbot/Chatbot.test.d.ts +1 -0
  6. package/dist/cjs/Chatbot/Chatbot.test.js +28 -0
  7. package/dist/cjs/ChatbotAlert/ChatbotAlert.test.d.ts +1 -0
  8. package/dist/cjs/ChatbotAlert/ChatbotAlert.test.js +27 -0
  9. package/dist/cjs/ChatbotContent/ChatbotContent.test.d.ts +1 -0
  10. package/dist/cjs/ChatbotContent/ChatbotContent.test.js +18 -0
  11. package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.d.ts +3 -3
  12. package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.js +3 -1
  13. package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +27 -4
  14. package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +24 -12
  15. package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +99 -3
  16. package/dist/cjs/ChatbotConversationHistoryNav/EmptyState.d.ts +11 -0
  17. package/dist/cjs/ChatbotConversationHistoryNav/EmptyState.js +29 -0
  18. package/dist/cjs/ChatbotConversationHistoryNav/LoadingState.d.ts +4 -0
  19. package/dist/cjs/ChatbotConversationHistoryNav/LoadingState.js +45 -0
  20. package/dist/cjs/ChatbotFooter/ChatbotFooter.test.d.ts +1 -0
  21. package/dist/cjs/ChatbotFooter/ChatbotFooter.test.js +18 -0
  22. package/dist/cjs/ChatbotFooter/ChatbotFooternote.test.d.ts +1 -0
  23. package/dist/cjs/ChatbotFooter/ChatbotFooternote.test.js +87 -0
  24. package/dist/cjs/ChatbotFooter/ChatbotFootnote.d.ts +1 -1
  25. package/dist/cjs/ChatbotFooter/ChatbotFootnote.js +1 -1
  26. package/dist/cjs/ChatbotHeader/ChatbotHeader.test.d.ts +1 -0
  27. package/dist/cjs/ChatbotHeader/ChatbotHeader.test.js +18 -0
  28. package/dist/cjs/ChatbotHeader/ChatbotHeaderActions.test.d.ts +1 -0
  29. package/dist/cjs/ChatbotHeader/ChatbotHeaderActions.test.js +18 -0
  30. package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.js +3 -1
  31. package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.test.d.ts +1 -0
  32. package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.test.js +20 -0
  33. package/dist/cjs/ChatbotHeader/ChatbotHeaderMain.test.d.ts +1 -0
  34. package/dist/cjs/ChatbotHeader/ChatbotHeaderMain.test.js +18 -0
  35. package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.js +3 -1
  36. package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.d.ts +1 -0
  37. package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.test.js +20 -0
  38. package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +3 -1
  39. package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.d.ts +1 -0
  40. package/dist/cjs/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +43 -0
  41. package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.js +6 -4
  42. package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.d.ts +1 -0
  43. package/dist/cjs/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +41 -0
  44. package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.d.ts +3 -1
  45. package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.js +4 -2
  46. package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.test.d.ts +1 -0
  47. package/dist/cjs/ChatbotHeader/ChatbotHeaderTitle.test.js +55 -0
  48. package/dist/cjs/ChatbotToggle/ChatbotToggle.js +3 -1
  49. package/dist/cjs/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +19 -11
  50. package/dist/cjs/Compare/Compare.d.ts +17 -0
  51. package/dist/cjs/Compare/Compare.js +50 -0
  52. package/dist/cjs/Compare/Compare.test.d.ts +1 -0
  53. package/dist/cjs/Compare/Compare.test.js +20 -0
  54. package/dist/cjs/Compare/index.d.ts +2 -0
  55. package/dist/cjs/Compare/index.js +23 -0
  56. package/dist/cjs/Message/ErrorMessage/ErrorMessage.d.ts +4 -0
  57. package/dist/cjs/Message/ErrorMessage/ErrorMessage.js +26 -0
  58. package/dist/cjs/Message/ImageMessage/ImageMessage.d.ts +4 -0
  59. package/dist/cjs/Message/ImageMessage/ImageMessage.js +25 -0
  60. package/dist/cjs/Message/LinkMessage/LinkMessage.d.ts +4 -0
  61. package/dist/cjs/Message/LinkMessage/LinkMessage.js +30 -0
  62. package/dist/cjs/Message/Message.d.ts +35 -8
  63. package/dist/cjs/Message/Message.js +68 -18
  64. package/dist/cjs/Message/Message.test.js +239 -3
  65. package/dist/cjs/Message/QuickResponse/QuickResponse.d.ts +17 -0
  66. package/dist/cjs/Message/QuickResponse/QuickResponse.js +34 -0
  67. package/dist/cjs/Message/TableMessage/TableMessage.d.ts +20 -0
  68. package/dist/cjs/Message/TableMessage/TableMessage.js +67 -0
  69. package/dist/cjs/Message/TableMessage/TbodyMessage.d.ts +7 -0
  70. package/dist/cjs/Message/TableMessage/TbodyMessage.js +33 -0
  71. package/dist/cjs/Message/TableMessage/TdMessage.d.ts +5 -0
  72. package/dist/cjs/Message/TableMessage/TdMessage.js +26 -0
  73. package/dist/cjs/Message/TableMessage/ThMessage.d.ts +5 -0
  74. package/dist/cjs/Message/TableMessage/ThMessage.js +26 -0
  75. package/dist/cjs/Message/TableMessage/TheadMessage.d.ts +5 -0
  76. package/dist/cjs/Message/TableMessage/TheadMessage.js +26 -0
  77. package/dist/cjs/Message/TableMessage/TrMessage.d.ts +7 -0
  78. package/dist/cjs/Message/TableMessage/TrMessage.js +37 -0
  79. package/dist/cjs/Message/TextMessage/TextMessage.d.ts +2 -1
  80. package/dist/cjs/Message/TextMessage/TextMessage.js +2 -2
  81. package/dist/cjs/Message/UserFeedback/CloseButton.d.ts +10 -0
  82. package/dist/cjs/Message/UserFeedback/CloseButton.js +14 -0
  83. package/dist/cjs/Message/UserFeedback/UserFeedback.d.ts +39 -0
  84. package/dist/cjs/Message/UserFeedback/UserFeedback.js +54 -0
  85. package/dist/cjs/Message/UserFeedback/UserFeedback.test.d.ts +1 -0
  86. package/dist/cjs/Message/UserFeedback/UserFeedback.test.js +133 -0
  87. package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.d.ts +42 -0
  88. package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.js +117 -0
  89. package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.test.d.ts +1 -0
  90. package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.test.js +249 -0
  91. package/dist/cjs/MessageBar/AttachButton.js +4 -2
  92. package/dist/cjs/MessageBar/MessageBar.d.ts +11 -4
  93. package/dist/cjs/MessageBar/MessageBar.js +127 -46
  94. package/dist/cjs/MessageBar/MessageBar.test.js +12 -4
  95. package/dist/cjs/MessageBar/MicrophoneButton.d.ts +1 -1
  96. package/dist/cjs/MessageBar/SendButton.js +3 -1
  97. package/dist/cjs/MessageBar/StopButton.js +3 -1
  98. package/dist/cjs/MessageBox/MessageBox.test.d.ts +1 -0
  99. package/dist/cjs/MessageBox/MessageBox.test.js +22 -0
  100. package/dist/cjs/PreviewAttachment/PreviewAttachment.test.d.ts +1 -0
  101. package/dist/cjs/PreviewAttachment/PreviewAttachment.test.js +28 -0
  102. package/dist/cjs/ResponseActions/ResponseActionButton.d.ts +4 -1
  103. package/dist/cjs/ResponseActions/ResponseActionButton.js +21 -6
  104. package/dist/cjs/ResponseActions/ResponseActions.d.ts +8 -2
  105. package/dist/cjs/ResponseActions/ResponseActions.js +7 -7
  106. package/dist/cjs/ResponseActions/ResponseActions.test.js +2 -2
  107. package/dist/cjs/Settings/SettingsForm.test.d.ts +1 -0
  108. package/dist/cjs/Settings/SettingsForm.test.js +26 -0
  109. package/dist/cjs/__mocks__/rehype-external-links.d.ts +2 -0
  110. package/dist/cjs/__mocks__/rehype-external-links.js +4 -0
  111. package/dist/cjs/__mocks__/rehype-sanitize.d.ts +2 -0
  112. package/dist/cjs/__mocks__/rehype-sanitize.js +4 -0
  113. package/dist/cjs/__mocks__/rehype-unwrap-images.d.ts +2 -0
  114. package/dist/cjs/__mocks__/rehype-unwrap-images.js +4 -0
  115. package/dist/cjs/index.d.ts +4 -0
  116. package/dist/cjs/index.js +7 -1
  117. package/dist/cjs/tracking/console_tracking_provider.d.ts +10 -0
  118. package/dist/cjs/tracking/console_tracking_provider.js +27 -0
  119. package/dist/cjs/tracking/index.d.ts +2 -0
  120. package/dist/cjs/tracking/index.js +23 -0
  121. package/dist/cjs/tracking/posthog_tracking_provider.d.ts +9 -0
  122. package/dist/cjs/tracking/posthog_tracking_provider.js +37 -0
  123. package/dist/cjs/tracking/segment_tracking_provider.d.ts +10 -0
  124. package/dist/cjs/tracking/segment_tracking_provider.js +50 -0
  125. package/dist/cjs/tracking/trackingProviderProxy.d.ts +9 -0
  126. package/dist/cjs/tracking/trackingProviderProxy.js +24 -0
  127. package/dist/cjs/tracking/tracking_api.d.ts +8 -0
  128. package/dist/cjs/tracking/tracking_api.js +2 -0
  129. package/dist/cjs/tracking/tracking_registry.d.ts +4 -0
  130. package/dist/cjs/tracking/tracking_registry.js +33 -0
  131. package/dist/cjs/tracking/tracking_spi.d.ts +9 -0
  132. package/dist/cjs/tracking/tracking_spi.js +2 -0
  133. package/dist/cjs/tracking/umami_tracking_provider.d.ts +14 -0
  134. package/dist/cjs/tracking/umami_tracking_provider.js +44 -0
  135. package/dist/css/main.css +420 -148
  136. package/dist/css/main.css.map +1 -1
  137. package/dist/dynamic/Compare/package.json +1 -0
  138. package/dist/dynamic/tracking/package.json +1 -0
  139. package/dist/esm/AttachmentEdit/AttachmentEdit.test.d.ts +1 -0
  140. package/dist/esm/AttachmentEdit/AttachmentEdit.test.js +47 -0
  141. package/dist/esm/Chatbot/Chatbot.d.ts +2 -1
  142. package/dist/esm/Chatbot/Chatbot.js +1 -0
  143. package/dist/esm/Chatbot/Chatbot.test.d.ts +1 -0
  144. package/dist/esm/Chatbot/Chatbot.test.js +23 -0
  145. package/dist/esm/ChatbotAlert/ChatbotAlert.test.d.ts +1 -0
  146. package/dist/esm/ChatbotAlert/ChatbotAlert.test.js +22 -0
  147. package/dist/esm/ChatbotContent/ChatbotContent.test.d.ts +1 -0
  148. package/dist/esm/ChatbotContent/ChatbotContent.test.js +13 -0
  149. package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.d.ts +3 -3
  150. package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.js +3 -1
  151. package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +27 -4
  152. package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +24 -12
  153. package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +99 -3
  154. package/dist/esm/ChatbotConversationHistoryNav/EmptyState.d.ts +11 -0
  155. package/dist/esm/ChatbotConversationHistoryNav/EmptyState.js +22 -0
  156. package/dist/esm/ChatbotConversationHistoryNav/LoadingState.d.ts +4 -0
  157. package/dist/esm/ChatbotConversationHistoryNav/LoadingState.js +38 -0
  158. package/dist/esm/ChatbotFooter/ChatbotFooter.test.d.ts +1 -0
  159. package/dist/esm/ChatbotFooter/ChatbotFooter.test.js +13 -0
  160. package/dist/esm/ChatbotFooter/ChatbotFooternote.test.d.ts +1 -0
  161. package/dist/esm/ChatbotFooter/ChatbotFooternote.test.js +82 -0
  162. package/dist/esm/ChatbotFooter/ChatbotFootnote.d.ts +1 -1
  163. package/dist/esm/ChatbotFooter/ChatbotFootnote.js +1 -1
  164. package/dist/esm/ChatbotHeader/ChatbotHeader.test.d.ts +1 -0
  165. package/dist/esm/ChatbotHeader/ChatbotHeader.test.js +13 -0
  166. package/dist/esm/ChatbotHeader/ChatbotHeaderActions.test.d.ts +1 -0
  167. package/dist/esm/ChatbotHeader/ChatbotHeaderActions.test.js +13 -0
  168. package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.js +3 -1
  169. package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.test.d.ts +1 -0
  170. package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.test.js +15 -0
  171. package/dist/esm/ChatbotHeader/ChatbotHeaderMain.test.d.ts +1 -0
  172. package/dist/esm/ChatbotHeader/ChatbotHeaderMain.test.js +13 -0
  173. package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.js +3 -1
  174. package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.d.ts +1 -0
  175. package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.test.js +15 -0
  176. package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.js +3 -1
  177. package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.d.ts +1 -0
  178. package/dist/esm/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.js +38 -0
  179. package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.js +6 -4
  180. package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.d.ts +1 -0
  181. package/dist/esm/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.js +36 -0
  182. package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.d.ts +3 -1
  183. package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.js +4 -2
  184. package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.test.d.ts +1 -0
  185. package/dist/esm/ChatbotHeader/ChatbotHeaderTitle.test.js +50 -0
  186. package/dist/esm/ChatbotToggle/ChatbotToggle.js +3 -1
  187. package/dist/esm/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.js +19 -11
  188. package/dist/esm/Compare/Compare.d.ts +17 -0
  189. package/dist/esm/Compare/Compare.js +43 -0
  190. package/dist/esm/Compare/Compare.test.d.ts +1 -0
  191. package/dist/esm/Compare/Compare.test.js +15 -0
  192. package/dist/esm/Compare/index.d.ts +2 -0
  193. package/dist/esm/Compare/index.js +2 -0
  194. package/dist/esm/Message/ErrorMessage/ErrorMessage.d.ts +4 -0
  195. package/dist/esm/Message/ErrorMessage/ErrorMessage.js +21 -0
  196. package/dist/esm/Message/ImageMessage/ImageMessage.d.ts +4 -0
  197. package/dist/esm/Message/ImageMessage/ImageMessage.js +20 -0
  198. package/dist/esm/Message/LinkMessage/LinkMessage.d.ts +4 -0
  199. package/dist/esm/Message/LinkMessage/LinkMessage.js +25 -0
  200. package/dist/esm/Message/Message.d.ts +35 -8
  201. package/dist/esm/Message/Message.js +66 -16
  202. package/dist/esm/Message/Message.test.js +239 -3
  203. package/dist/esm/Message/QuickResponse/QuickResponse.d.ts +17 -0
  204. package/dist/esm/Message/QuickResponse/QuickResponse.js +27 -0
  205. package/dist/esm/Message/TableMessage/TableMessage.d.ts +20 -0
  206. package/dist/esm/Message/TableMessage/TableMessage.js +62 -0
  207. package/dist/esm/Message/TableMessage/TbodyMessage.d.ts +7 -0
  208. package/dist/esm/Message/TableMessage/TbodyMessage.js +28 -0
  209. package/dist/esm/Message/TableMessage/TdMessage.d.ts +5 -0
  210. package/dist/esm/Message/TableMessage/TdMessage.js +21 -0
  211. package/dist/esm/Message/TableMessage/ThMessage.d.ts +5 -0
  212. package/dist/esm/Message/TableMessage/ThMessage.js +21 -0
  213. package/dist/esm/Message/TableMessage/TheadMessage.d.ts +5 -0
  214. package/dist/esm/Message/TableMessage/TheadMessage.js +21 -0
  215. package/dist/esm/Message/TableMessage/TrMessage.d.ts +7 -0
  216. package/dist/esm/Message/TableMessage/TrMessage.js +32 -0
  217. package/dist/esm/Message/TextMessage/TextMessage.d.ts +2 -1
  218. package/dist/esm/Message/TextMessage/TextMessage.js +3 -3
  219. package/dist/esm/Message/UserFeedback/CloseButton.d.ts +10 -0
  220. package/dist/esm/Message/UserFeedback/CloseButton.js +9 -0
  221. package/dist/esm/Message/UserFeedback/UserFeedback.d.ts +39 -0
  222. package/dist/esm/Message/UserFeedback/UserFeedback.js +49 -0
  223. package/dist/esm/Message/UserFeedback/UserFeedback.test.d.ts +1 -0
  224. package/dist/esm/Message/UserFeedback/UserFeedback.test.js +128 -0
  225. package/dist/esm/Message/UserFeedback/UserFeedbackComplete.d.ts +42 -0
  226. package/dist/esm/Message/UserFeedback/UserFeedbackComplete.js +112 -0
  227. package/dist/esm/Message/UserFeedback/UserFeedbackComplete.test.d.ts +1 -0
  228. package/dist/esm/Message/UserFeedback/UserFeedbackComplete.test.js +244 -0
  229. package/dist/esm/MessageBar/AttachButton.js +4 -2
  230. package/dist/esm/MessageBar/MessageBar.d.ts +11 -4
  231. package/dist/esm/MessageBar/MessageBar.js +127 -46
  232. package/dist/esm/MessageBar/MessageBar.test.js +12 -4
  233. package/dist/esm/MessageBar/MicrophoneButton.d.ts +1 -1
  234. package/dist/esm/MessageBar/SendButton.js +3 -1
  235. package/dist/esm/MessageBar/StopButton.js +3 -1
  236. package/dist/esm/MessageBox/MessageBox.test.d.ts +1 -0
  237. package/dist/esm/MessageBox/MessageBox.test.js +17 -0
  238. package/dist/esm/PreviewAttachment/PreviewAttachment.test.d.ts +1 -0
  239. package/dist/esm/PreviewAttachment/PreviewAttachment.test.js +23 -0
  240. package/dist/esm/ResponseActions/ResponseActionButton.d.ts +4 -1
  241. package/dist/esm/ResponseActions/ResponseActionButton.js +18 -3
  242. package/dist/esm/ResponseActions/ResponseActions.d.ts +8 -2
  243. package/dist/esm/ResponseActions/ResponseActions.js +7 -7
  244. package/dist/esm/ResponseActions/ResponseActions.test.js +2 -2
  245. package/dist/esm/Settings/SettingsForm.test.d.ts +1 -0
  246. package/dist/esm/Settings/SettingsForm.test.js +21 -0
  247. package/dist/esm/__mocks__/rehype-external-links.d.ts +2 -0
  248. package/dist/esm/__mocks__/rehype-external-links.js +2 -0
  249. package/dist/esm/__mocks__/rehype-sanitize.d.ts +2 -0
  250. package/dist/esm/__mocks__/rehype-sanitize.js +2 -0
  251. package/dist/esm/__mocks__/rehype-unwrap-images.d.ts +2 -0
  252. package/dist/esm/__mocks__/rehype-unwrap-images.js +2 -0
  253. package/dist/esm/index.d.ts +4 -0
  254. package/dist/esm/index.js +4 -0
  255. package/dist/esm/tracking/console_tracking_provider.d.ts +10 -0
  256. package/dist/esm/tracking/console_tracking_provider.js +23 -0
  257. package/dist/esm/tracking/index.d.ts +2 -0
  258. package/dist/esm/tracking/index.js +2 -0
  259. package/dist/esm/tracking/posthog_tracking_provider.d.ts +9 -0
  260. package/dist/esm/tracking/posthog_tracking_provider.js +33 -0
  261. package/dist/esm/tracking/segment_tracking_provider.d.ts +10 -0
  262. package/dist/esm/tracking/segment_tracking_provider.js +46 -0
  263. package/dist/esm/tracking/trackingProviderProxy.d.ts +9 -0
  264. package/dist/esm/tracking/trackingProviderProxy.js +22 -0
  265. package/dist/esm/tracking/tracking_api.d.ts +8 -0
  266. package/dist/esm/tracking/tracking_api.js +1 -0
  267. package/dist/esm/tracking/tracking_registry.d.ts +4 -0
  268. package/dist/esm/tracking/tracking_registry.js +26 -0
  269. package/dist/esm/tracking/tracking_spi.d.ts +9 -0
  270. package/dist/esm/tracking/tracking_spi.js +1 -0
  271. package/dist/esm/tracking/umami_tracking_provider.d.ts +14 -0
  272. package/dist/esm/tracking/umami_tracking_provider.js +40 -0
  273. package/dist/tsconfig.tsbuildinfo +1 -1
  274. package/package.json +8 -3
  275. package/patternfly-docs/content/extensions/chatbot/about-chatbot.md +8 -2
  276. package/patternfly-docs/content/extensions/chatbot/design-guidelines.md +192 -15
  277. package/patternfly-docs/content/extensions/chatbot/examples/Analytics/Analytics.md +219 -0
  278. package/patternfly-docs/content/extensions/chatbot/examples/Messages/AttachmentError.tsx +2 -2
  279. package/patternfly-docs/content/extensions/chatbot/examples/Messages/BotMessage.tsx +214 -12
  280. package/patternfly-docs/content/extensions/chatbot/examples/Messages/FileDropZone.tsx +2 -1
  281. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithAttachment.tsx +2 -2
  282. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithCustomResponseActions.tsx +1 -1
  283. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedback.tsx +71 -0
  284. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedbackTimeout.tsx +27 -0
  285. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickResponses.tsx +1 -1
  286. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickStart.tsx +2 -2
  287. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithResponseActions.tsx +1 -1
  288. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithSources.tsx +1 -1
  289. package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +49 -8
  290. package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessage.tsx +244 -14
  291. package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessageWithExtraContent.tsx +54 -0
  292. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotFooter.tsx +1 -1
  293. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotFootnote.tsx +5 -5
  294. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderBasic.tsx +1 -1
  295. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawer.tsx +36 -3
  296. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerNavigation.tsx +67 -0
  297. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerResizable.tsx +94 -0
  298. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarAttach.tsx +1 -1
  299. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotWelcomeInteraction.tsx +1 -1
  300. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotWelcomePrompt.tsx +7 -7
  301. package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +21 -6
  302. package/patternfly-docs/content/extensions/chatbot/examples/demos/AttachmentDemos.md +14 -0
  303. package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.md +39 -1
  304. package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.tsx +48 -35
  305. package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachment.tsx +2 -2
  306. package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachmentMenu.tsx +3 -3
  307. package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotInDrawer.tsx +453 -0
  308. package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedChatbot.tsx +11 -11
  309. package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedComparisonChatbot.tsx +206 -0
  310. package/patternfly-docs/content/extensions/chatbot/examples/demos/Feedback.tsx +104 -0
  311. package/patternfly-docs/content/extensions/chatbot/img/ai-action-inpage.svg +85 -0
  312. package/patternfly-docs/content/extensions/chatbot/img/ai-action-message.svg +63 -0
  313. package/patternfly-docs/content/extensions/chatbot/img/analytics-example.svg +127 -0
  314. package/patternfly-docs/content/extensions/chatbot/img/attached-file.svg +24 -29
  315. package/patternfly-docs/content/extensions/chatbot/img/attachment-menu.svg +4 -4
  316. package/patternfly-docs/content/extensions/chatbot/img/attachment-unsent.svg +30 -58
  317. package/patternfly-docs/content/extensions/chatbot/img/chatbot-analytics.svg +51 -0
  318. package/patternfly-docs/content/extensions/chatbot/img/chatbot-elements.svg +11 -12
  319. package/patternfly-docs/content/extensions/chatbot/img/chatbot-quickstarts-tile.svg +58 -0
  320. package/patternfly-docs/content/extensions/chatbot/img/chatbot-settings.svg +83 -0
  321. package/patternfly-docs/content/extensions/chatbot/img/comparison.svg +45 -0
  322. package/patternfly-docs/content/extensions/chatbot/img/conversation-history.svg +6 -29
  323. package/patternfly-docs/content/extensions/chatbot/img/docked.svg +259 -241
  324. package/patternfly-docs/content/extensions/chatbot/img/drawer.svg +255 -0
  325. package/patternfly-docs/content/extensions/chatbot/img/error-state.svg +30 -0
  326. package/patternfly-docs/content/extensions/chatbot/img/feedback-form.svg +88 -0
  327. package/patternfly-docs/content/extensions/chatbot/img/footnote.svg +1 -1
  328. package/patternfly-docs/content/extensions/chatbot/img/fullscreen.svg +25 -16
  329. package/patternfly-docs/content/extensions/chatbot/img/listening-pulse.svg +22 -0
  330. package/patternfly-docs/content/extensions/chatbot/img/listening.svg +1 -1
  331. package/patternfly-docs/content/extensions/chatbot/img/loading-state.svg +28 -0
  332. package/patternfly-docs/content/extensions/chatbot/img/masthead-toggle-notification.svg +49 -0
  333. package/patternfly-docs/content/extensions/chatbot/img/masthead-toggle.svg +75 -0
  334. package/patternfly-docs/content/extensions/chatbot/img/message-bar-elements.svg +3 -3
  335. package/patternfly-docs/content/extensions/chatbot/img/message-elements.svg +84 -142
  336. package/patternfly-docs/content/extensions/chatbot/img/message-feedback.svg +52 -0
  337. package/patternfly-docs/content/extensions/chatbot/img/message-responses.svg +54 -0
  338. package/patternfly-docs/content/extensions/chatbot/img/new-chat-emptystate.svg +27 -0
  339. package/patternfly-docs/content/extensions/chatbot/img/no-results-emptystate.svg +27 -0
  340. package/patternfly-docs/content/extensions/chatbot/img/overlay.svg +54 -39
  341. package/patternfly-docs/content/extensions/chatbot/img/posthog.svg +30 -0
  342. package/patternfly-docs/content/extensions/chatbot/img/segment.svg +36 -0
  343. package/patternfly-docs/content/extensions/chatbot/img/settings-menu.svg +122 -0
  344. package/patternfly-docs/content/extensions/chatbot/img/source-tile.svg +62 -0
  345. package/patternfly-docs/content/extensions/chatbot/img/thank-you-card.svg +81 -0
  346. package/patternfly-docs/content/extensions/chatbot/img/toggle-customizations.svg +12 -0
  347. package/patternfly-docs/content/extensions/chatbot/img/toggle-tooltips.svg +38 -0
  348. package/patternfly-docs/content/extensions/chatbot/img/umami.svg +30 -0
  349. package/patternfly-docs/content/extensions/chatbot/img/welcome-elements.svg +82 -0
  350. package/patternfly-docs/content/extensions/chatbot/img/welcome-message.svg +94 -0
  351. package/src/AttachMenu/AttachMenu.scss +1 -1
  352. package/src/AttachmentEdit/AttachmentEdit.test.tsx +55 -0
  353. package/src/Chatbot/Chatbot.scss +20 -1
  354. package/src/Chatbot/Chatbot.test.tsx +31 -0
  355. package/src/Chatbot/Chatbot.tsx +2 -1
  356. package/src/ChatbotAlert/ChatbotAlert.test.tsx +31 -0
  357. package/src/ChatbotContent/ChatbotContent.scss +1 -0
  358. package/src/ChatbotContent/ChatbotContent.test.tsx +15 -0
  359. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.tsx +10 -4
  360. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss +24 -1
  361. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx +242 -3
  362. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx +94 -26
  363. package/src/ChatbotConversationHistoryNav/EmptyState.tsx +44 -0
  364. package/src/ChatbotConversationHistoryNav/LoadingState.tsx +38 -0
  365. package/src/ChatbotFooter/ChatbotFooter.scss +8 -4
  366. package/src/ChatbotFooter/ChatbotFooter.test.tsx +15 -0
  367. package/src/ChatbotFooter/ChatbotFooternote.test.tsx +84 -0
  368. package/src/ChatbotFooter/ChatbotFootnote.tsx +2 -2
  369. package/src/ChatbotHeader/ChatbotHeader.scss +5 -6
  370. package/src/ChatbotHeader/ChatbotHeader.test.tsx +15 -0
  371. package/src/ChatbotHeader/ChatbotHeaderActions.test.tsx +17 -0
  372. package/src/ChatbotHeader/ChatbotHeaderCloseButton.test.tsx +20 -0
  373. package/src/ChatbotHeader/ChatbotHeaderCloseButton.tsx +7 -1
  374. package/src/ChatbotHeader/ChatbotHeaderMain.test.tsx +17 -0
  375. package/src/ChatbotHeader/ChatbotHeaderMenu.test.tsx +19 -0
  376. package/src/ChatbotHeader/ChatbotHeaderMenu.tsx +7 -1
  377. package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.test.tsx +45 -0
  378. package/src/ChatbotHeader/ChatbotHeaderOptionsDropdown.tsx +8 -1
  379. package/src/ChatbotHeader/ChatbotHeaderSelectorDropdown.test.tsx +43 -0
  380. package/src/ChatbotHeader/ChatbotHeaderSelectorDropdown.tsx +11 -4
  381. package/src/ChatbotHeader/ChatbotHeaderTitle.test.tsx +75 -0
  382. package/src/ChatbotHeader/ChatbotHeaderTitle.tsx +7 -2
  383. package/src/ChatbotModal/ChatbotModal.scss +12 -12
  384. package/src/ChatbotToggle/ChatbotToggle.tsx +6 -1
  385. package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.scss +2 -0
  386. package/src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.tsx +26 -18
  387. package/src/ChatbotWelcomePrompt/__snapshots__/ChatbotWelcomePrompt.test.tsx.snap +2 -2
  388. package/src/CodeModal/CodeModal.scss +7 -4
  389. package/src/Compare/Compare.scss +72 -0
  390. package/src/Compare/Compare.test.tsx +31 -0
  391. package/src/Compare/Compare.tsx +98 -0
  392. package/src/Compare/index.ts +2 -0
  393. package/src/FileDetails/FileDetails.scss +1 -1
  394. package/src/FileDetailsLabel/FileDetailsLabel.scss +2 -2
  395. package/src/Message/CodeBlockMessage/CodeBlockMessage.scss +4 -4
  396. package/src/Message/ErrorMessage/ErrorMessage.tsx +14 -0
  397. package/src/Message/ImageMessage/ImageMessage.scss +9 -0
  398. package/src/Message/ImageMessage/ImageMessage.tsx +14 -0
  399. package/src/Message/LinkMessage/LinkMessage.tsx +34 -0
  400. package/src/Message/ListMessage/ListMessage.scss +6 -6
  401. package/src/Message/Message.scss +4 -26
  402. package/src/Message/Message.test.tsx +313 -3
  403. package/src/Message/Message.tsx +130 -31
  404. package/src/Message/MessageLoading.scss +2 -2
  405. package/src/Message/QuickResponse/QuickResponse.scss +33 -0
  406. package/src/Message/QuickResponse/QuickResponse.tsx +54 -0
  407. package/src/Message/QuickStarts/QuickStartTile.scss +0 -1
  408. package/src/Message/TableMessage/TableMessage.scss +23 -0
  409. package/src/Message/TableMessage/TableMessage.tsx +83 -0
  410. package/src/Message/TableMessage/TbodyMessage.tsx +20 -0
  411. package/src/Message/TableMessage/TdMessage.tsx +11 -0
  412. package/src/Message/TableMessage/ThMessage.tsx +11 -0
  413. package/src/Message/TableMessage/TheadMessage.tsx +11 -0
  414. package/src/Message/TableMessage/TrMessage.tsx +27 -0
  415. package/src/Message/TextMessage/TextMessage.scss +21 -12
  416. package/src/Message/TextMessage/TextMessage.tsx +3 -3
  417. package/src/Message/UserFeedback/CloseButton.tsx +21 -0
  418. package/src/Message/UserFeedback/UserFeedback.scss +53 -0
  419. package/src/Message/UserFeedback/UserFeedback.test.tsx +236 -0
  420. package/src/Message/UserFeedback/UserFeedback.tsx +128 -0
  421. package/src/Message/UserFeedback/UserFeedbackComplete.test.tsx +255 -0
  422. package/src/Message/UserFeedback/UserFeedbackComplete.tsx +211 -0
  423. package/src/MessageBar/AttachButton.scss +19 -3
  424. package/src/MessageBar/AttachButton.tsx +3 -1
  425. package/src/MessageBar/MessageBar.scss +58 -24
  426. package/src/MessageBar/MessageBar.test.tsx +12 -4
  427. package/src/MessageBar/MessageBar.tsx +164 -65
  428. package/src/MessageBar/MicrophoneButton.scss +8 -8
  429. package/src/MessageBar/MicrophoneButton.tsx +1 -1
  430. package/src/MessageBar/SendButton.tsx +2 -0
  431. package/src/MessageBar/StopButton.scss +17 -3
  432. package/src/MessageBar/StopButton.tsx +2 -0
  433. package/src/MessageBox/JumpButton.scss +6 -6
  434. package/src/MessageBox/MessageBox.scss +1 -0
  435. package/src/MessageBox/MessageBox.test.tsx +26 -0
  436. package/src/PreviewAttachment/PreviewAttachment.test.tsx +51 -0
  437. package/src/ResponseActions/ResponseActionButton.tsx +14 -2
  438. package/src/ResponseActions/ResponseActions.scss +2 -2
  439. package/src/ResponseActions/ResponseActions.test.tsx +4 -2
  440. package/src/ResponseActions/ResponseActions.tsx +26 -2
  441. package/src/Settings/Settings.scss +2 -2
  442. package/src/Settings/SettingsForm.test.tsx +28 -0
  443. package/src/SourceDetailsMenuItem/SourceDetailsMenuItem.scss +2 -2
  444. package/src/SourcesCard/SourcesCard.scss +9 -3
  445. package/src/TermsOfUse/TermsOfUse.scss +1 -1
  446. package/src/__mocks__/rehype-external-links.ts +3 -0
  447. package/src/__mocks__/rehype-sanitize.ts +3 -0
  448. package/src/__mocks__/rehype-unwrap-images.tsx +3 -0
  449. package/src/index.ts +6 -0
  450. package/src/main.scss +5 -6
  451. package/src/tracking/console_tracking_provider.ts +30 -0
  452. package/src/tracking/index.ts +3 -0
  453. package/src/tracking/posthog_tracking_provider.ts +42 -0
  454. package/src/tracking/segment_tracking_provider.ts +62 -0
  455. package/src/tracking/trackingProviderProxy.ts +28 -0
  456. package/src/tracking/tracking_api.ts +11 -0
  457. package/src/tracking/tracking_registry.ts +33 -0
  458. package/src/tracking/tracking_spi.ts +14 -0
  459. package/src/tracking/umami_tracking_provider.ts +54 -0
@@ -61,7 +61,7 @@ export const MessageWithSourcesExample: React.FunctionComponent = () => {
61
61
  name="Bot"
62
62
  role="bot"
63
63
  avatar={patternflyAvatar}
64
- content="Example with only one source"
64
+ content="Example with only 1 source"
65
65
  sources={{
66
66
  sources: [
67
67
  {
@@ -14,14 +14,18 @@ propComponents:
14
14
  [
15
15
  'AttachMenu',
16
16
  'AttachmentEdit',
17
- 'FileDetails',
18
- 'FileDetailsLabel',
17
+ 'FileDetailsProps',
18
+ 'FileDetailsLabelProps',
19
19
  'FileDropZone',
20
20
  'PreviewAttachment',
21
21
  'Message',
22
+ 'MessageExtraContent',
22
23
  'PreviewAttachment',
23
24
  'ActionProps',
24
- 'SourcesCardProps'
25
+ 'SourcesCardProps',
26
+ 'UserFeedbackProps',
27
+ 'UserFeedbackCompleteProps',
28
+ 'QuickResponseProps'
25
29
  ]
26
30
  sortValue: 3
27
31
  ---
@@ -52,12 +56,8 @@ The `content` prop of the `<Message>` component is passed to a `<Markdown>` comp
52
56
 
53
57
  Messages from the ChatBot will be marked with an "AI" label to clearly communicate the use of AI to users. The ChatBot can display different `content` types, including plain text, code, or a loading animation (via `isLoading`).
54
58
 
55
- <br />
56
-
57
59
  By default, a date and timestamp is displayed with each message. We recommend using the `timestamp` prop in real ChatBots, since it will allow you to set persistent dates and times on messages, even if the messages re-render. You can update `timestamp` with a different [date and time format](/ux-writing/numerics) as needed.
58
60
 
59
- <br />
60
-
61
61
  You can further customize the avatar by applying an additional class or passing [PatternFly avatar props](/components/avatar) to the `<Message>` component via `avatarProps`.
62
62
 
63
63
  ```js file="./BotMessage.tsx"
@@ -97,9 +97,40 @@ You can apply a `clickedAriaLabel` and `clickedTooltipContent` once a button is
97
97
 
98
98
  ```
99
99
 
100
+ ### Message feedback
101
+
102
+ When a user selects a positive or negative [message action](#message-actions), you can display a message feedback card that acknowledges their response and provides space for additional written feedback. These cards can be manually dismissed via the close button and the thank-you card can be [configured to time out automatically](/patternfly-ai/chatbot/messages#message-feedback-with-timeouts).
103
+
104
+ You can see the full feedback flow [in the message demos](/patternfly-ai/chatbot/messages/demo#message-feedback).
105
+
106
+ The message feedback cards will immediately receive focus by default, but you can remove this behavior by passing `focusOnLoad: false` to the `<Message>` (as shown in the following examples). For better usability, you should generally keep the default focus behavior.
107
+
108
+ The following examples demonstrate:
109
+
110
+ - A basic feedback card. To toggle the text input area, select the **Has text area** checkbox.
111
+ - A thank-you card. To toggle the close button, select the **Has close button** checkbox.
112
+
113
+ ```js file="./MessageWithFeedback.tsx"
114
+
115
+ ```
116
+
117
+ ### Message feedback with timeouts
118
+
119
+ The feedback thank-you message can be configured to time out and automatically close after a period of time. The default time-out period is 8000 ms, but it can be customized via `timeout`.
120
+
121
+ To display the thank-you message in this example, click **Show card**.
122
+
123
+ The card will not dismiss within the default time if a user is hovering over it or if it has keyboard focus. Instead, it will dismiss after they remove focus, via `timeoutAnimation`, which is 3000 ms by default. You can adjust this duration and set an `onTimeout` callback, as well as optional `onMouseEnter` and `onMouseLeave` callbacks.
124
+
125
+ For accessibility purposes, be sure to announce when new content appears onscreen. `isLiveRegion` is set to true by default on `<Message>` so it will make appropriate announcements for you when the thank-you card appears.
126
+
127
+ ```js file="./MessageWithFeedbackTimeout.tsx"
128
+
129
+ ```
130
+
100
131
  ### Messages with quick responses
101
132
 
102
- You can offer convenient, clickable responses to messages in the form of quick actions. Quick actions are [PatternFly labels](/components/label/) in a label group, configured to display up to 5 visible labels.
133
+ You can offer convenient, clickable responses to messages in the form of quick actions. Quick actions are [PatternFly labels](/components/label/) in a label group, configured to display up to 5 visible labels. Only 1 response can be selected at a time.
103
134
 
104
135
  To add quick actions, pass `quickResponses` to `<Message>`. This can be overridden by passing additional `<LabelGroup>` props to `quickResponseContainerProps`, or additional `<Label>` props to `quickResponses`.
105
136
 
@@ -135,6 +166,16 @@ Messages from users have a different background color to differentiate them from
135
166
 
136
167
  ```
137
168
 
169
+ ### Custom message content
170
+
171
+ **Caution:** Take care when using this feature. It can cause you to stray from accessibility and design best practice standards. If you frequently need add the same component via custom message content, reach out to the PatternFly team. If there's a consistent need for a certain component, we can look into adding native support for additional features.
172
+
173
+ You can add custom content to specific parts of a `<Message>` via the `extraContent` prop, including additional components (like timestamps, badges, or custom elements). This prop allows you to create dynamic and reusable elements for various use cases, without changing the default message layout.
174
+
175
+ ```js file="./UserMessageWithExtraContent.tsx"
176
+
177
+ ```
178
+
138
179
  ## File attachments
139
180
 
140
181
  ### Messages with attachments
@@ -2,43 +2,273 @@ import React from 'react';
2
2
 
3
3
  import Message from '@patternfly/chatbot/dist/dynamic/Message';
4
4
  import userAvatar from './user_avatar.svg';
5
+ import { AlertActionLink, Form, FormGroup, Radio } from '@patternfly/react-core';
5
6
 
6
7
  export const UserMessageExample: React.FunctionComponent = () => {
7
- const markdown = `A paragraph with *emphasis* and **strong importance**.
8
+ const [variant, setVariant] = React.useState('code');
8
9
 
9
- > A block quote with ~strikethrough~ and a URL: https://reactjs.org.
10
+ /* eslint-disable indent */
11
+ const renderContent = () => {
12
+ switch (variant) {
13
+ case 'code':
14
+ return code;
15
+ case 'inlineCode':
16
+ return inlineCode;
17
+ case 'heading':
18
+ return heading;
19
+ case 'emphasis':
20
+ return emphasis;
21
+ case 'blockQuotes':
22
+ return blockQuotes;
23
+ case 'orderedList':
24
+ return orderedList;
25
+ case 'unorderedList':
26
+ return unorderedList;
27
+ case 'moreComplexList':
28
+ return moreComplexList;
29
+ case 'link':
30
+ return link;
31
+ case 'table':
32
+ return table;
33
+ case 'image':
34
+ return image;
35
+ default:
36
+ return;
37
+ }
38
+ };
39
+ /* eslint-enable indent */
10
40
 
11
- Here is an inline code - \`() => void\`
41
+ const code = `
42
+ Here is some YAML code:
12
43
 
13
- Here is an ordered list:
44
+ ~~~yaml
45
+ apiVersion: helm.openshift.io/v1beta1/
46
+ kind: HelmChartRepository
47
+ metadata:
48
+ name: azure-sample-repo0oooo00ooo
49
+ spec:
50
+ connectionConfig:
51
+ url: https://raw.githubusercontent.com/Azure-Samples/helm-charts/master/docs
52
+ ~~~
14
53
 
15
- 1. Item 1
16
- 2. Item 3
17
- 3. Item 4
54
+ Here is some JavaScript code:
18
55
 
19
- Here is an unordered list:
56
+ ~~~js
57
+ import React from 'react';
58
+
59
+ const MessageLoading = () => (
60
+ <div className="pf-chatbot__message-loading">
61
+ <span className="pf-chatbot__message-loading-dots">
62
+ <span className="pf-v6-screen-reader">Loading message</span>
63
+ </span>
64
+ </div>
65
+ );
66
+
67
+ export default MessageLoading;
68
+
69
+ ~~~
70
+ `;
71
+
72
+ const heading = `
73
+ # h1 Heading
74
+
75
+ ## h2 Heading
76
+
77
+ ### h3 Heading
78
+
79
+ #### h4 Heading
80
+
81
+ ##### h5 Heading
82
+
83
+ ###### h6 Heading
84
+ `;
85
+
86
+ const emphasis = `
87
+ **Bold text, formatted with double asterisks**
88
+
89
+ __Bold text, formatted with double underscores__
90
+
91
+ *Italic text, formatted with single asterisks*
92
+
93
+ _Italic text, formatted with single underscores_
94
+
95
+ ~~Strikethrough~~
96
+ `;
97
+
98
+ const blockQuotes = `> Blockquotes can also be nested...
99
+ >> ...by using additional greater-than signs (>) right next to each other...
100
+ > > > ...or with spaces between each sign.`;
101
+
102
+ const orderedList = `
103
+ Here is an ordered list:
104
+
105
+ 1. Item 1
106
+ 2. Item 2
107
+ 3. Item 3`;
20
108
 
21
- * Item 1
22
- * Item 2
23
- * Item 3`;
109
+ const unorderedList = `
110
+ Here is an unordered list:
111
+
112
+ * Item 1
113
+ * Item 2
114
+ * Item 3`;
115
+
116
+ const moreComplexList = `You may be wondering whether you can display more complex lists with formatting. In response to your question, I will explain how to spread butter on toast.
117
+
118
+ 1. **Using a \`toaster\`:**
119
+
120
+ - Place \`bread\` in a \`toaster\`
121
+ - Once \`bread\` is lightly browned, remove from \`toaster\`
122
+
123
+ 2. **Using a \`knife\`:**
124
+
125
+ Acquire 1 tablespoon of room temperature \`butter\`. Use \`knife\` to spread butter on \`toast\`. Bon appétit!
126
+ `;
127
+
128
+ const link = `A paragraph with a URL: https://reactjs.org.`;
129
+
130
+ const inlineCode = `Here is an inline code - \`() => void\``;
131
+
132
+ const table = `To customize your table, you can use [PatternFly TableProps](/components/table#table)
133
+
134
+ | Version | GA date | User role
135
+ |-|-|-|
136
+ | 2.5 | September 30, 2024 | Administrator |
137
+ | 2.5 | June 27, 2023 | Editor |
138
+ | 3.0 | April 1, 2025 | Administrator
139
+ `;
140
+
141
+ const image = `![Multi-colored wavy lines on a black background](https://cdn.dribbble.com/userupload/10651749/file/original-8a07b8e39d9e8bf002358c66fce1223e.gif)`;
142
+
143
+ const error = {
144
+ title: 'Could not load chat',
145
+ children: 'Wait a few minutes and check your network settings. If the issue persists: ',
146
+ actionLinks: (
147
+ <React.Fragment>
148
+ <AlertActionLink component="a" href="#">
149
+ Start a new chat
150
+ </AlertActionLink>
151
+ <AlertActionLink component="a" href="#">
152
+ Contact support
153
+ </AlertActionLink>
154
+ </React.Fragment>
155
+ )
156
+ };
24
157
 
25
158
  return (
26
159
  <>
27
160
  <Message
28
161
  name="User"
29
162
  role="user"
30
- content="Example content with updated timestamp text"
163
+ content="This is a user message with an updated timestamp."
31
164
  timestamp="1 hour ago"
32
165
  avatar={userAvatar}
33
166
  />
34
- <Message name="User" role="user" content={markdown} avatar={userAvatar} />
35
167
  <Message
36
168
  name="User"
37
169
  role="user"
38
- content="Example user message with `avatarProps` set to add a border"
170
+ content="This is a user message with `avatarProps` set to add a border."
39
171
  avatar={userAvatar}
40
172
  avatarProps={{ isBordered: true }}
41
173
  />
174
+ <Form>
175
+ <FormGroup role="radiogroup" isInline fieldId="user-message-type" label="Message content type">
176
+ <Radio
177
+ isChecked={variant === 'code'}
178
+ onChange={() => setVariant('code')}
179
+ name="user-message-type"
180
+ label="Code"
181
+ id="user-code"
182
+ />
183
+ <Radio
184
+ isChecked={variant === 'inlineCode'}
185
+ onChange={() => setVariant('inlineCode')}
186
+ name="user-message-type"
187
+ label="Inline code"
188
+ id="user-inline-code"
189
+ />
190
+ <Radio
191
+ isChecked={variant === 'heading'}
192
+ onChange={() => setVariant('heading')}
193
+ name="user-message-type"
194
+ label="Heading"
195
+ id="user-heading"
196
+ />
197
+ <Radio
198
+ isChecked={variant === 'blockQuotes'}
199
+ onChange={() => setVariant('blockQuotes')}
200
+ name="user-message-type"
201
+ label="Block quote"
202
+ id="user-block-quotes"
203
+ />
204
+ <Radio
205
+ isChecked={variant === 'emphasis'}
206
+ onChange={() => setVariant('emphasis')}
207
+ name="user-message-type"
208
+ label="Emphasis"
209
+ id="user-emphasis"
210
+ />
211
+ <Radio
212
+ isChecked={variant === 'link'}
213
+ onChange={() => setVariant('link')}
214
+ name="user-message-type"
215
+ label="Link"
216
+ id="user-link"
217
+ />
218
+ <Radio
219
+ isChecked={variant === 'unorderedList'}
220
+ onChange={() => setVariant('unorderedList')}
221
+ name="user-message-type"
222
+ label="Unordered list"
223
+ id="user-unordered-list"
224
+ />
225
+ <Radio
226
+ isChecked={variant === 'orderedList'}
227
+ onChange={() => setVariant('orderedList')}
228
+ name="user-message-type"
229
+ label="Ordered list"
230
+ id="user-ordered-list"
231
+ />
232
+ <Radio
233
+ isChecked={variant === 'moreComplexList'}
234
+ onChange={() => setVariant('moreComplexList')}
235
+ name="user-message-type"
236
+ label="More complex list"
237
+ id="user-more-complex-list"
238
+ />
239
+ <Radio
240
+ isChecked={variant === 'table'}
241
+ onChange={() => setVariant('table')}
242
+ name="user-message-type"
243
+ label="Table"
244
+ id="user-table"
245
+ />
246
+ <Radio
247
+ isChecked={variant === 'image'}
248
+ onChange={() => setVariant('image')}
249
+ name="user-message-type"
250
+ label="Image"
251
+ id="user-image"
252
+ />
253
+ <Radio
254
+ isChecked={variant === 'error'}
255
+ onChange={() => setVariant('error')}
256
+ name="user-message-error"
257
+ label="Error"
258
+ id="user-error"
259
+ />
260
+ </FormGroup>
261
+ </Form>
262
+ <Message
263
+ name="User"
264
+ role="user"
265
+ content={renderContent()}
266
+ avatar={userAvatar}
267
+ tableProps={
268
+ variant === 'table' ? { 'aria-label': 'App information and user roles for user messages' } : undefined
269
+ }
270
+ error={variant === 'error' ? error : undefined}
271
+ />
42
272
  </>
43
273
  );
44
274
  };
@@ -0,0 +1,54 @@
1
+ import React from 'react';
2
+
3
+ import Message from '@patternfly/chatbot/dist/dynamic/Message';
4
+ import userAvatar from './user_avatar.svg';
5
+ import { Alert, Badge, Button, Card, CardBody, CardFooter, CardTitle } from '@patternfly/react-core';
6
+
7
+ const UserActionEndContent = () => {
8
+ // eslint-disable-next-line no-console
9
+ const onClick = () => console.log('custom button click');
10
+ return (
11
+ <React.Fragment>
12
+ <Button variant="secondary" ouiaId="Secondary" onClick={onClick}>
13
+ End content button
14
+ </Button>
15
+ <Alert variant="danger" title="Danger alert title" ouiaId="DangerAlert" />
16
+ </React.Fragment>
17
+ );
18
+ };
19
+
20
+ const CardInformationAfterMainContent = () => (
21
+ <Card ouiaId="BasicCard">
22
+ <CardTitle>This is content card after main content</CardTitle>
23
+ <CardBody>Body</CardBody>
24
+ <CardFooter>Footer</CardFooter>
25
+ </Card>
26
+ );
27
+
28
+ const BeforeMainContent = () => (
29
+ <div>
30
+ <Badge key={1} isRead>
31
+ 7
32
+ </Badge>
33
+ <Badge key={2} isRead>
34
+ 24
35
+ </Badge>
36
+ </div>
37
+ );
38
+
39
+ export const UserMessageWithExtraContent: React.FunctionComponent = () => (
40
+ <>
41
+ <Message
42
+ avatar={userAvatar}
43
+ name="User"
44
+ role="user"
45
+ content="This is a main message."
46
+ timestamp="1 hour ago"
47
+ extraContent={{
48
+ beforeMainContent: <BeforeMainContent />,
49
+ afterMainContent: <CardInformationAfterMainContent />,
50
+ endContent: <UserActionEndContent />
51
+ }}
52
+ />
53
+ </>
54
+ );
@@ -8,7 +8,7 @@ export const ChatbotFooterExample: React.FunctionComponent = () => {
8
8
  return (
9
9
  <ChatbotFooter>
10
10
  <MessageBar onSendMessage={handleSend} hasMicrophoneButton hasAttachButton />
11
- <ChatbotFootnote label="Lightspeed uses AI. Check for mistakes." />
11
+ <ChatbotFootnote label="ChatBot uses AI. Check for mistakes." />
12
12
  </ChatbotFooter>
13
13
  );
14
14
  };
@@ -3,22 +3,22 @@ import { ChatbotFootnote } from '@patternfly/chatbot/dist/dynamic/ChatbotFooter'
3
3
 
4
4
  export const FootnoteDemo: React.FunctionComponent = () => (
5
5
  <ChatbotFootnote
6
- label="Lightspeed uses AI. Check for mistakes."
6
+ label="ChatBot uses AI. Check for mistakes."
7
7
  popover={{
8
- title: 'Verify accuracy',
9
- description: `While Lightspeed strives for accuracy, there's always a possibility of errors. It's a good practice to verify critical information from reliable sources, especially if it's crucial for decision-making or actions.`,
8
+ title: 'Verify information',
9
+ description: `While ChatBot strives for accuracy, AI is experimental and can make mistakes. We cannot guarantee that all information provided by ChatBot is up to date or without error. You should always verify responses using reliable sources, especially for crucial information and decision making.`,
10
10
  bannerImage: {
11
11
  src: 'https://cdn.dribbble.com/userupload/10651749/file/original-8a07b8e39d9e8bf002358c66fce1223e.gif',
12
12
  alt: 'Example image for footnote popover'
13
13
  },
14
14
  cta: {
15
- label: 'Got it',
15
+ label: 'Dismiss',
16
16
  onClick: () => {
17
17
  alert('Do something!');
18
18
  }
19
19
  },
20
20
  link: {
21
- label: 'Learn more',
21
+ label: 'View AI policy',
22
22
  url: 'https://www.redhat.com/'
23
23
  }
24
24
  }}
@@ -121,7 +121,7 @@ export const BasicDemo: React.FunctionComponent = () => {
121
121
  showAll && setShowAll(!showAll);
122
122
  }}
123
123
  name="basic-inline-radio"
124
- label="With options dropdown"
124
+ label="With settings dropdown"
125
125
  id="options-dropdown"
126
126
  />
127
127
  </FormGroup>
@@ -3,7 +3,7 @@ import { ChatbotDisplayMode } from '@patternfly/chatbot/dist/dynamic/Chatbot';
3
3
  import ChatbotConversationHistoryNav, {
4
4
  Conversation
5
5
  } from '@patternfly/chatbot/dist/dynamic/ChatbotConversationHistoryNav';
6
- import { Checkbox } from '@patternfly/react-core';
6
+ import { Checkbox, EmptyStateStatus, Spinner } from '@patternfly/react-core';
7
7
 
8
8
  const initialConversations: { [key: string]: Conversation[] } = {
9
9
  Today: [{ id: '1', text: 'Red Hat products and services' }],
@@ -31,12 +31,29 @@ const initialConversations: { [key: string]: Conversation[] } = {
31
31
  ]
32
32
  };
33
33
 
34
+ const ERROR = {
35
+ bodyText: (
36
+ <>
37
+ To try again, check your connection and reload this page. If the issue persists,{' '}
38
+ <a href="">contact the support team</a>.
39
+ </>
40
+ ),
41
+ buttonText: 'Reload',
42
+ buttonIcon: <Spinner size="sm" />,
43
+ hasButton: true,
44
+ titleText: 'Could not load chat history',
45
+ status: EmptyStateStatus.danger,
46
+ onClick: () => alert('Clicked Reload')
47
+ };
48
+
34
49
  export const ChatbotHeaderTitleDemo: React.FunctionComponent = () => {
35
50
  const [isOpen, setIsOpen] = React.useState(true);
36
- const [isButtonOrderReversed, setIsbuttonOrderReversed] = React.useState(false);
51
+ const [isButtonOrderReversed, setIsButtonOrderReversed] = React.useState(false);
37
52
  const [conversations, setConversations] = React.useState<Conversation[] | { [key: string]: Conversation[] }>(
38
53
  initialConversations
39
54
  );
55
+ const [isLoading, setIsLoading] = React.useState(false);
56
+ const [hasError, setHasError] = React.useState(false);
40
57
  const displayMode = ChatbotDisplayMode.embedded;
41
58
 
42
59
  const findMatchingItems = (targetValue: string) => {
@@ -70,10 +87,24 @@ export const ChatbotHeaderTitleDemo: React.FunctionComponent = () => {
70
87
  <Checkbox
71
88
  label="Reverse action buttons"
72
89
  isChecked={isButtonOrderReversed}
73
- onChange={() => setIsbuttonOrderReversed(!isButtonOrderReversed)}
90
+ onChange={() => setIsButtonOrderReversed(!isButtonOrderReversed)}
74
91
  id="drawer-actions-visible"
75
92
  name="drawer-actions-visible"
76
93
  ></Checkbox>
94
+ <Checkbox
95
+ label="Show loading state"
96
+ isChecked={isLoading}
97
+ onChange={() => setIsLoading(!isLoading)}
98
+ id="drawer-is-loading"
99
+ name="drawer-is-loading"
100
+ ></Checkbox>
101
+ <Checkbox
102
+ label="Show error state"
103
+ isChecked={hasError}
104
+ onChange={() => setHasError(!hasError)}
105
+ id="drawer-has-error"
106
+ name="drawer-has-error"
107
+ ></Checkbox>
77
108
  <ChatbotConversationHistoryNav
78
109
  displayMode={displayMode}
79
110
  onDrawerToggle={() => setIsOpen(!isOpen)}
@@ -96,6 +127,8 @@ export const ChatbotHeaderTitleDemo: React.FunctionComponent = () => {
96
127
  setConversations(newConversations);
97
128
  }}
98
129
  drawerContent={<div>Drawer content</div>}
130
+ isLoading={isLoading}
131
+ errorState={hasError ? ERROR : undefined}
99
132
  />
100
133
  </>
101
134
  );
@@ -0,0 +1,67 @@
1
+ import React from 'react';
2
+ import { ChatbotDisplayMode } from '@patternfly/chatbot/dist/dynamic/Chatbot';
3
+ import ChatbotConversationHistoryNav, {
4
+ Conversation
5
+ } from '@patternfly/chatbot/dist/dynamic/ChatbotConversationHistoryNav';
6
+ import { Checkbox } from '@patternfly/react-core';
7
+
8
+ const initialConversations: Conversation[] = [
9
+ { id: '1', text: 'Red Hat products and services', noIcon: true },
10
+ {
11
+ id: '2',
12
+ text: 'Enterprise Linux installation and setup',
13
+ noIcon: true
14
+ },
15
+ { id: '3', text: 'Troubleshoot system crash', noIcon: true },
16
+ { id: '4', text: 'Ansible security and updates', noIcon: true },
17
+ { id: '5', text: 'Red Hat certification', noIcon: true },
18
+ { id: '6', text: 'Lightspeed user documentation', noIcon: true },
19
+ { id: '7', text: 'Crashing pod assistance', noIcon: true },
20
+ { id: '8', text: 'OpenShift AI pipelines', noIcon: true },
21
+ { id: '9', text: 'Updating subscription plan', noIcon: true },
22
+ { id: '10', text: 'Red Hat licensing options', noIcon: true },
23
+ { id: '11', text: 'RHEL system performance', noIcon: true },
24
+ { id: '12', text: 'Manage user accounts', noIcon: true }
25
+ ];
26
+
27
+ export const ChatbotHeaderTitleDemo: React.FunctionComponent = () => {
28
+ const [isOpen, setIsOpen] = React.useState(true);
29
+ const [isButtonOrderReversed, setIsButtonOrderReversed] = React.useState(false);
30
+ const [conversations, setConversations] = React.useState<Conversation[] | { [key: string]: Conversation[] }>(
31
+ initialConversations
32
+ );
33
+ const displayMode = ChatbotDisplayMode.embedded;
34
+
35
+ return (
36
+ <>
37
+ <Checkbox
38
+ label="Display drawer"
39
+ isChecked={isOpen}
40
+ onChange={() => {
41
+ setIsOpen(!isOpen);
42
+ setConversations(initialConversations);
43
+ }}
44
+ id="navigation-drawer-visible"
45
+ name="navigation-drawer-visible"
46
+ />
47
+ <Checkbox
48
+ label="Reverse action buttons"
49
+ isChecked={isButtonOrderReversed}
50
+ onChange={() => setIsButtonOrderReversed(!isButtonOrderReversed)}
51
+ id="navigation-drawer-actions-visible"
52
+ name="navigation-drawer-actions-visible"
53
+ ></Checkbox>
54
+ <ChatbotConversationHistoryNav
55
+ displayMode={displayMode}
56
+ onDrawerToggle={() => setIsOpen(!isOpen)}
57
+ isDrawerOpen={isOpen}
58
+ setIsDrawerOpen={setIsOpen}
59
+ // eslint-disable-next-line no-console
60
+ onSelectActiveItem={(e, selectedItem) => console.log(`Selected history item with id ${selectedItem}`)}
61
+ conversations={conversations}
62
+ reverseButtonOrder={isButtonOrderReversed}
63
+ drawerContent={<div>Drawer content</div>}
64
+ />
65
+ </>
66
+ );
67
+ };