@patternfly/chatbot 6.5.0-prerelease.9 → 6.6.0-prerelease.1

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 (315) hide show
  1. package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +9 -1
  2. package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +9 -2
  3. package/dist/cjs/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +38 -0
  4. package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.js +29 -2
  5. package/dist/cjs/CodeModal/CodeModal.d.ts +2 -0
  6. package/dist/cjs/CodeModal/CodeModal.js +53 -12
  7. package/dist/cjs/DeepThinking/DeepThinking.d.ts +13 -0
  8. package/dist/cjs/DeepThinking/DeepThinking.js +31 -3
  9. package/dist/cjs/DeepThinking/DeepThinking.test.js +80 -0
  10. package/dist/cjs/MarkdownContent/MarkdownContent.d.ts +44 -0
  11. package/dist/cjs/MarkdownContent/MarkdownContent.js +181 -0
  12. package/dist/cjs/MarkdownContent/MarkdownContent.test.d.ts +1 -0
  13. package/dist/cjs/MarkdownContent/MarkdownContent.test.js +192 -0
  14. package/dist/cjs/MarkdownContent/index.d.ts +2 -0
  15. package/dist/cjs/MarkdownContent/index.js +23 -0
  16. package/dist/cjs/Message/CodeBlockMessage/CodeBlockMessage.d.ts +3 -1
  17. package/dist/cjs/Message/CodeBlockMessage/CodeBlockMessage.js +15 -4
  18. package/dist/cjs/Message/CodeBlockMessage/CodeBlockMessage.test.d.ts +1 -0
  19. package/dist/cjs/Message/CodeBlockMessage/CodeBlockMessage.test.js +131 -0
  20. package/dist/cjs/Message/ErrorMessage/ErrorMessage.d.ts +15 -1
  21. package/dist/cjs/Message/ErrorMessage/ErrorMessage.js +5 -3
  22. package/dist/cjs/Message/ErrorMessage/ErrorMessage.test.d.ts +1 -0
  23. package/dist/cjs/Message/ErrorMessage/ErrorMessage.test.js +30 -0
  24. package/dist/cjs/Message/LinkMessage/LinkMessage.d.ts +5 -1
  25. package/dist/cjs/Message/LinkMessage/LinkMessage.js +4 -3
  26. package/dist/cjs/Message/ListMessage/OrderedListMessage.d.ts +9 -1
  27. package/dist/cjs/Message/ListMessage/OrderedListMessage.js +2 -1
  28. package/dist/cjs/Message/ListMessage/UnorderedListMessage.d.ts +7 -1
  29. package/dist/cjs/Message/ListMessage/UnorderedListMessage.js +2 -1
  30. package/dist/cjs/Message/Message.d.ts +20 -3
  31. package/dist/cjs/Message/Message.js +7 -160
  32. package/dist/cjs/Message/Message.test.js +129 -2
  33. package/dist/cjs/Message/MessageAndActions/MessageAndActions.d.ts +14 -0
  34. package/dist/cjs/Message/MessageAndActions/MessageAndActions.js +22 -0
  35. package/dist/cjs/Message/MessageAndActions/MessageAndActions.test.d.ts +1 -0
  36. package/dist/cjs/Message/MessageAndActions/MessageAndActions.test.js +25 -0
  37. package/dist/cjs/Message/MessageAndActions/index.d.ts +1 -0
  38. package/dist/cjs/Message/MessageAndActions/index.js +17 -0
  39. package/dist/cjs/Message/MessageAttachments/MessageAttachmentItem.d.ts +13 -0
  40. package/dist/cjs/Message/MessageAttachments/MessageAttachmentItem.js +22 -0
  41. package/dist/cjs/Message/MessageAttachments/MessageAttachmentItem.test.d.ts +1 -0
  42. package/dist/cjs/Message/MessageAttachments/MessageAttachmentItem.test.js +25 -0
  43. package/dist/cjs/Message/MessageAttachments/MessageAttachmentsContainer.d.ts +13 -0
  44. package/dist/cjs/Message/MessageAttachments/MessageAttachmentsContainer.js +22 -0
  45. package/dist/cjs/Message/MessageAttachments/MessageAttachmentsContainer.test.d.ts +1 -0
  46. package/dist/cjs/Message/MessageAttachments/MessageAttachmentsContainer.test.js +25 -0
  47. package/dist/cjs/Message/MessageAttachments/index.d.ts +2 -0
  48. package/dist/cjs/Message/MessageAttachments/index.js +18 -0
  49. package/dist/cjs/Message/MessageInput.d.ts +1 -1
  50. package/dist/cjs/Message/MessageInput.js +3 -1
  51. package/dist/cjs/Message/MessageLoading.d.ts +13 -4
  52. package/dist/cjs/Message/MessageLoading.js +19 -5
  53. package/dist/cjs/Message/MessageLoading.test.d.ts +1 -0
  54. package/dist/cjs/Message/MessageLoading.test.js +25 -0
  55. package/dist/cjs/Message/QuickResponse/QuickResponse.js +3 -2
  56. package/dist/cjs/Message/QuickResponse/QuickResponse.test.d.ts +1 -0
  57. package/dist/cjs/Message/QuickResponse/QuickResponse.test.js +109 -0
  58. package/dist/cjs/Message/QuickResponse/index.d.ts +1 -0
  59. package/dist/cjs/Message/QuickResponse/index.js +17 -0
  60. package/dist/cjs/Message/QuickStarts/QuickStartTile.d.ts +1 -1
  61. package/dist/cjs/Message/QuickStarts/QuickStartTile.js +3 -2
  62. package/dist/cjs/Message/QuickStarts/index.d.ts +2 -0
  63. package/dist/cjs/Message/QuickStarts/index.js +18 -0
  64. package/dist/cjs/Message/TableMessage/TableMessage.d.ts +6 -1
  65. package/dist/cjs/Message/TableMessage/TableMessage.js +3 -2
  66. package/dist/cjs/Message/TextMessage/TextMessage.d.ts +8 -1
  67. package/dist/cjs/Message/TextMessage/TextMessage.js +3 -2
  68. package/dist/cjs/Message/UserFeedback/UserFeedback.d.ts +3 -1
  69. package/dist/cjs/Message/UserFeedback/UserFeedback.js +8 -6
  70. package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.d.ts +1 -1
  71. package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.js +3 -2
  72. package/dist/cjs/Message/UserFeedback/index.d.ts +2 -0
  73. package/dist/cjs/Message/UserFeedback/index.js +18 -0
  74. package/dist/cjs/Message/index.d.ts +8 -0
  75. package/dist/cjs/Message/index.js +8 -0
  76. package/dist/cjs/MessageBar/MessageBar.d.ts +10 -0
  77. package/dist/cjs/MessageBar/MessageBar.js +42 -10
  78. package/dist/cjs/MessageBar/MessageBar.test.js +20 -0
  79. package/dist/cjs/Onboarding/Onboarding.d.ts +36 -0
  80. package/dist/cjs/Onboarding/Onboarding.js +37 -0
  81. package/dist/cjs/Onboarding/Onboarding.test.d.ts +1 -0
  82. package/dist/cjs/Onboarding/Onboarding.test.js +80 -0
  83. package/dist/cjs/Onboarding/index.d.ts +2 -0
  84. package/dist/cjs/Onboarding/index.js +23 -0
  85. package/dist/cjs/ResponseActions/ResponseActions.d.ts +7 -0
  86. package/dist/cjs/ResponseActions/ResponseActions.js +28 -7
  87. package/dist/cjs/ResponseActions/ResponseActions.test.js +67 -12
  88. package/dist/cjs/ResponseActions/ResponseActionsGroups.d.ts +13 -0
  89. package/dist/cjs/ResponseActions/ResponseActionsGroups.js +22 -0
  90. package/dist/cjs/ResponseActions/ResponseActionsGroups.test.d.ts +1 -0
  91. package/dist/cjs/ResponseActions/ResponseActionsGroups.test.js +25 -0
  92. package/dist/cjs/ResponseActions/index.d.ts +1 -0
  93. package/dist/cjs/ResponseActions/index.js +1 -0
  94. package/dist/cjs/ToolCall/ToolCall.d.ts +11 -0
  95. package/dist/cjs/ToolCall/ToolCall.js +24 -3
  96. package/dist/cjs/ToolCall/ToolCall.test.js +57 -0
  97. package/dist/cjs/ToolResponse/ToolResponse.d.ts +17 -0
  98. package/dist/cjs/ToolResponse/ToolResponse.js +49 -3
  99. package/dist/cjs/ToolResponse/ToolResponse.test.js +100 -0
  100. package/dist/cjs/index.d.ts +4 -0
  101. package/dist/cjs/index.js +7 -1
  102. package/dist/css/main.css +276 -30
  103. package/dist/css/main.css.map +1 -1
  104. package/dist/dynamic/MarkdownContent/package.json +1 -0
  105. package/dist/dynamic/Onboarding/package.json +1 -0
  106. package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.d.ts +9 -1
  107. package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.js +10 -3
  108. package/dist/esm/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.js +38 -0
  109. package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.js +30 -3
  110. package/dist/esm/CodeModal/CodeModal.d.ts +2 -0
  111. package/dist/esm/CodeModal/CodeModal.js +54 -13
  112. package/dist/esm/DeepThinking/DeepThinking.d.ts +13 -0
  113. package/dist/esm/DeepThinking/DeepThinking.js +28 -3
  114. package/dist/esm/DeepThinking/DeepThinking.test.js +80 -0
  115. package/dist/esm/MarkdownContent/MarkdownContent.d.ts +44 -0
  116. package/dist/esm/MarkdownContent/MarkdownContent.js +174 -0
  117. package/dist/esm/MarkdownContent/MarkdownContent.test.d.ts +1 -0
  118. package/dist/esm/MarkdownContent/MarkdownContent.test.js +187 -0
  119. package/dist/esm/MarkdownContent/index.d.ts +2 -0
  120. package/dist/esm/MarkdownContent/index.js +2 -0
  121. package/dist/esm/Message/CodeBlockMessage/CodeBlockMessage.d.ts +3 -1
  122. package/dist/esm/Message/CodeBlockMessage/CodeBlockMessage.js +15 -4
  123. package/dist/esm/Message/CodeBlockMessage/CodeBlockMessage.test.d.ts +1 -0
  124. package/dist/esm/Message/CodeBlockMessage/CodeBlockMessage.test.js +126 -0
  125. package/dist/esm/Message/ErrorMessage/ErrorMessage.d.ts +15 -1
  126. package/dist/esm/Message/ErrorMessage/ErrorMessage.js +3 -3
  127. package/dist/esm/Message/ErrorMessage/ErrorMessage.test.d.ts +1 -0
  128. package/dist/esm/Message/ErrorMessage/ErrorMessage.test.js +25 -0
  129. package/dist/esm/Message/LinkMessage/LinkMessage.d.ts +5 -1
  130. package/dist/esm/Message/LinkMessage/LinkMessage.js +4 -3
  131. package/dist/esm/Message/ListMessage/OrderedListMessage.d.ts +9 -1
  132. package/dist/esm/Message/ListMessage/OrderedListMessage.js +2 -1
  133. package/dist/esm/Message/ListMessage/UnorderedListMessage.d.ts +7 -1
  134. package/dist/esm/Message/ListMessage/UnorderedListMessage.js +2 -1
  135. package/dist/esm/Message/Message.d.ts +20 -3
  136. package/dist/esm/Message/Message.js +8 -161
  137. package/dist/esm/Message/Message.test.js +129 -2
  138. package/dist/esm/Message/MessageAndActions/MessageAndActions.d.ts +14 -0
  139. package/dist/esm/Message/MessageAndActions/MessageAndActions.js +18 -0
  140. package/dist/esm/Message/MessageAndActions/MessageAndActions.test.d.ts +1 -0
  141. package/dist/esm/Message/MessageAndActions/MessageAndActions.test.js +20 -0
  142. package/dist/esm/Message/MessageAndActions/index.d.ts +1 -0
  143. package/dist/esm/Message/MessageAndActions/index.js +1 -0
  144. package/dist/esm/Message/MessageAttachments/MessageAttachmentItem.d.ts +13 -0
  145. package/dist/esm/Message/MessageAttachments/MessageAttachmentItem.js +18 -0
  146. package/dist/esm/Message/MessageAttachments/MessageAttachmentItem.test.d.ts +1 -0
  147. package/dist/esm/Message/MessageAttachments/MessageAttachmentItem.test.js +20 -0
  148. package/dist/esm/Message/MessageAttachments/MessageAttachmentsContainer.d.ts +13 -0
  149. package/dist/esm/Message/MessageAttachments/MessageAttachmentsContainer.js +18 -0
  150. package/dist/esm/Message/MessageAttachments/MessageAttachmentsContainer.test.d.ts +1 -0
  151. package/dist/esm/Message/MessageAttachments/MessageAttachmentsContainer.test.js +20 -0
  152. package/dist/esm/Message/MessageAttachments/index.d.ts +2 -0
  153. package/dist/esm/Message/MessageAttachments/index.js +2 -0
  154. package/dist/esm/Message/MessageInput.d.ts +1 -1
  155. package/dist/esm/Message/MessageInput.js +1 -1
  156. package/dist/esm/Message/MessageLoading.d.ts +13 -4
  157. package/dist/esm/Message/MessageLoading.js +16 -4
  158. package/dist/esm/Message/MessageLoading.test.d.ts +1 -0
  159. package/dist/esm/Message/MessageLoading.test.js +20 -0
  160. package/dist/esm/Message/QuickResponse/QuickResponse.js +3 -2
  161. package/dist/esm/Message/QuickResponse/QuickResponse.test.d.ts +1 -0
  162. package/dist/esm/Message/QuickResponse/QuickResponse.test.js +104 -0
  163. package/dist/esm/Message/QuickResponse/index.d.ts +1 -0
  164. package/dist/esm/Message/QuickResponse/index.js +1 -0
  165. package/dist/esm/Message/QuickStarts/QuickStartTile.d.ts +1 -1
  166. package/dist/esm/Message/QuickStarts/QuickStartTile.js +1 -1
  167. package/dist/esm/Message/QuickStarts/index.d.ts +2 -0
  168. package/dist/esm/Message/QuickStarts/index.js +2 -0
  169. package/dist/esm/Message/TableMessage/TableMessage.d.ts +6 -1
  170. package/dist/esm/Message/TableMessage/TableMessage.js +3 -2
  171. package/dist/esm/Message/TextMessage/TextMessage.d.ts +8 -1
  172. package/dist/esm/Message/TextMessage/TextMessage.js +3 -2
  173. package/dist/esm/Message/UserFeedback/UserFeedback.d.ts +3 -1
  174. package/dist/esm/Message/UserFeedback/UserFeedback.js +7 -7
  175. package/dist/esm/Message/UserFeedback/UserFeedbackComplete.d.ts +1 -1
  176. package/dist/esm/Message/UserFeedback/UserFeedbackComplete.js +1 -2
  177. package/dist/esm/Message/UserFeedback/index.d.ts +2 -0
  178. package/dist/esm/Message/UserFeedback/index.js +2 -0
  179. package/dist/esm/Message/index.d.ts +8 -0
  180. package/dist/esm/Message/index.js +8 -0
  181. package/dist/esm/MessageBar/MessageBar.d.ts +10 -0
  182. package/dist/esm/MessageBar/MessageBar.js +42 -10
  183. package/dist/esm/MessageBar/MessageBar.test.js +20 -0
  184. package/dist/esm/Onboarding/Onboarding.d.ts +36 -0
  185. package/dist/esm/Onboarding/Onboarding.js +30 -0
  186. package/dist/esm/Onboarding/Onboarding.test.d.ts +1 -0
  187. package/dist/esm/Onboarding/Onboarding.test.js +75 -0
  188. package/dist/esm/Onboarding/index.d.ts +2 -0
  189. package/dist/esm/Onboarding/index.js +2 -0
  190. package/dist/esm/ResponseActions/ResponseActions.d.ts +7 -0
  191. package/dist/esm/ResponseActions/ResponseActions.js +28 -7
  192. package/dist/esm/ResponseActions/ResponseActions.test.js +67 -12
  193. package/dist/esm/ResponseActions/ResponseActionsGroups.d.ts +13 -0
  194. package/dist/esm/ResponseActions/ResponseActionsGroups.js +18 -0
  195. package/dist/esm/ResponseActions/ResponseActionsGroups.test.d.ts +1 -0
  196. package/dist/esm/ResponseActions/ResponseActionsGroups.test.js +20 -0
  197. package/dist/esm/ResponseActions/index.d.ts +1 -0
  198. package/dist/esm/ResponseActions/index.js +1 -0
  199. package/dist/esm/ToolCall/ToolCall.d.ts +11 -0
  200. package/dist/esm/ToolCall/ToolCall.js +21 -3
  201. package/dist/esm/ToolCall/ToolCall.test.js +57 -0
  202. package/dist/esm/ToolResponse/ToolResponse.d.ts +17 -0
  203. package/dist/esm/ToolResponse/ToolResponse.js +46 -3
  204. package/dist/esm/ToolResponse/ToolResponse.test.js +100 -0
  205. package/dist/esm/index.d.ts +4 -0
  206. package/dist/esm/index.js +4 -0
  207. package/dist/tsconfig.tsbuildinfo +1 -1
  208. package/package.json +13 -3
  209. package/patternfly-docs/content/extensions/chatbot/chatbot.md +57 -0
  210. package/patternfly-docs/content/extensions/chatbot/design-guidelines.md +12 -12
  211. package/patternfly-docs/content/extensions/chatbot/examples/Analytics/Analytics.md +1 -1
  212. package/patternfly-docs/content/extensions/chatbot/examples/Customizing Messages/Customizing Messages.md +1 -1
  213. package/patternfly-docs/content/extensions/chatbot/examples/Messages/BotMessage.tsx +1 -0
  214. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithCustomStructure.tsx +102 -0
  215. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithDeepThinking.tsx +25 -11
  216. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithFeedback.tsx +14 -1
  217. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithMarkdownDeepThinking.tsx +26 -0
  218. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithMarkdownToolCall.tsx +29 -0
  219. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithMarkdownToolResponse.tsx +200 -0
  220. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithMultipleActionGroups.tsx +61 -0
  221. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithPersistedActions.tsx +22 -0
  222. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickResponses.tsx +11 -0
  223. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithToolCall.tsx +14 -1
  224. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithToolResponse.tsx +222 -105
  225. package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +123 -14
  226. package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessage.tsx +1 -0
  227. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotHeaderDrawerWithSearchActions.tsx +198 -0
  228. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarCustomActions.tsx +190 -0
  229. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarIndicatorThinking.tsx +15 -0
  230. package/patternfly-docs/content/extensions/chatbot/examples/UI/CompactOnboarding.tsx +141 -0
  231. package/patternfly-docs/content/extensions/chatbot/examples/UI/Onboarding.tsx +151 -0
  232. package/patternfly-docs/content/extensions/chatbot/examples/UI/RH-Hat-Image.svg +9 -0
  233. package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +81 -30
  234. package/patternfly-docs/content/extensions/chatbot/examples/demos/AttachmentDemos.md +18 -18
  235. package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.md +33 -19
  236. package/patternfly-docs/patternfly-docs.config.js +1 -1
  237. package/patternfly-docs/patternfly-docs.source.js +1 -1
  238. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss +43 -0
  239. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx +95 -0
  240. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx +51 -15
  241. package/src/ChatbotHeader/ChatbotHeaderMenu.tsx +56 -14
  242. package/src/ChatbotModal/ChatbotModal.scss +3 -0
  243. package/src/CodeModal/CodeModal.tsx +71 -26
  244. package/src/DeepThinking/DeepThinking.scss +1 -1
  245. package/src/DeepThinking/DeepThinking.test.tsx +109 -0
  246. package/src/DeepThinking/DeepThinking.tsx +54 -5
  247. package/src/MarkdownContent/MarkdownContent.test.tsx +207 -0
  248. package/src/MarkdownContent/MarkdownContent.tsx +269 -0
  249. package/src/MarkdownContent/index.ts +2 -0
  250. package/src/Message/CodeBlockMessage/CodeBlockMessage.scss +13 -0
  251. package/src/Message/CodeBlockMessage/CodeBlockMessage.test.tsx +171 -0
  252. package/src/Message/CodeBlockMessage/CodeBlockMessage.tsx +17 -4
  253. package/src/Message/ErrorMessage/ErrorMessage.test.tsx +38 -0
  254. package/src/Message/ErrorMessage/ErrorMessage.tsx +17 -2
  255. package/src/Message/LinkMessage/LinkMessage.scss +5 -0
  256. package/src/Message/LinkMessage/LinkMessage.tsx +24 -2
  257. package/src/Message/ListMessage/ListMessage.scss +8 -0
  258. package/src/Message/ListMessage/OrderedListMessage.tsx +16 -2
  259. package/src/Message/ListMessage/UnorderedListMessage.tsx +12 -2
  260. package/src/Message/Message.scss +11 -7
  261. package/src/Message/Message.test.tsx +202 -2
  262. package/src/Message/Message.tsx +129 -241
  263. package/src/Message/MessageAndActions/MessageAndActions.test.tsx +23 -0
  264. package/src/Message/MessageAndActions/MessageAndActions.tsx +22 -0
  265. package/src/Message/MessageAndActions/index.ts +1 -0
  266. package/src/Message/MessageAttachments/MessageAttachmentItem.test.tsx +23 -0
  267. package/src/Message/MessageAttachments/MessageAttachmentItem.tsx +25 -0
  268. package/src/Message/MessageAttachments/MessageAttachmentsContainer.test.tsx +23 -0
  269. package/src/Message/MessageAttachments/MessageAttachmentsContainer.tsx +25 -0
  270. package/src/Message/MessageAttachments/index.ts +2 -0
  271. package/src/Message/MessageInput.tsx +1 -1
  272. package/src/Message/MessageLoading.test.tsx +23 -0
  273. package/src/Message/MessageLoading.tsx +17 -2
  274. package/src/Message/QuickResponse/QuickResponse.scss +3 -1
  275. package/src/Message/QuickResponse/QuickResponse.test.tsx +131 -0
  276. package/src/Message/QuickResponse/QuickResponse.tsx +3 -2
  277. package/src/Message/QuickResponse/index.ts +1 -0
  278. package/src/Message/QuickStarts/QuickStartTile.tsx +1 -1
  279. package/src/Message/QuickStarts/index.ts +2 -0
  280. package/src/Message/TableMessage/TableMessage.scss +13 -1
  281. package/src/Message/TableMessage/TableMessage.tsx +18 -2
  282. package/src/Message/TextMessage/TextMessage.scss +12 -0
  283. package/src/Message/TextMessage/TextMessage.tsx +29 -2
  284. package/src/Message/UserFeedback/UserFeedback.scss +28 -1
  285. package/src/Message/UserFeedback/UserFeedback.tsx +23 -13
  286. package/src/Message/UserFeedback/UserFeedbackComplete.tsx +1 -4
  287. package/src/Message/UserFeedback/index.ts +2 -0
  288. package/src/Message/index.ts +8 -0
  289. package/src/MessageBar/AttachButton.scss +0 -1
  290. package/src/MessageBar/MessageBar.scss +63 -7
  291. package/src/MessageBar/MessageBar.test.tsx +39 -0
  292. package/src/MessageBar/MessageBar.tsx +124 -48
  293. package/src/MessageBar/MicrophoneButton.scss +0 -1
  294. package/src/MessageBar/SendButton.scss +0 -1
  295. package/src/MessageBar/StopButton.scss +0 -1
  296. package/src/Onboarding/Onboarding.scss +101 -0
  297. package/src/Onboarding/Onboarding.test.tsx +148 -0
  298. package/src/Onboarding/Onboarding.tsx +126 -0
  299. package/src/Onboarding/index.ts +3 -0
  300. package/src/ResponseActions/ResponseActions.scss +12 -1
  301. package/src/ResponseActions/ResponseActions.test.tsx +111 -12
  302. package/src/ResponseActions/ResponseActions.tsx +44 -10
  303. package/src/ResponseActions/ResponseActionsGroups.test.tsx +23 -0
  304. package/src/ResponseActions/ResponseActionsGroups.tsx +28 -0
  305. package/src/ResponseActions/index.ts +1 -0
  306. package/src/ToolCall/ToolCall.scss +1 -1
  307. package/src/ToolCall/ToolCall.test.tsx +91 -0
  308. package/src/ToolCall/ToolCall.tsx +49 -4
  309. package/src/ToolResponse/ToolResponse.scss +13 -3
  310. package/src/ToolResponse/ToolResponse.test.tsx +119 -0
  311. package/src/ToolResponse/ToolResponse.tsx +82 -7
  312. package/src/index.ts +6 -0
  313. package/src/main.scss +2 -0
  314. package/tsconfig.json +1 -1
  315. package/patternfly-docs/content/extensions/chatbot/about-chatbot.md +0 -44
@@ -1,5 +1,5 @@
1
1
  ---
2
- section: PatternFly-AI
2
+ section: extensions
3
3
  subsection: ChatBot
4
4
  id: Overview
5
5
  sortValue: 1
@@ -22,7 +22,7 @@ import "./images.css"
22
22
  1. **Attachments:** Details about files that a user has uploaded to the ChatBot.
23
23
  1. **Footer:** A persistent region at the bottom of the ChatBot window that contains the message bar and the footnote.
24
24
  1. **Footnote (optional):** A persistent, short message that contains any legal disclaimers or important information about the ChatBot. Footnotes are optional, but strongly recommended. More details can be found in the [footnote guidelines](#footnotes).
25
- 1. **Toggle:** The button that allows users to open and close the ChatBot window. When the ChatBot is opened, the toggle should appear below the ChatBot window. The toggle shape and icon can be customized as needed, as shown in these [ChatBot toggle examples](/patternfly-ai/chatbot/ui#custom-toggle-icon). More details can be found in the [guidelines for accessing a ChatBot](#accessing-a-chatbot).
25
+ 1. **Toggle:** The button that allows users to open and close the ChatBot window. When the ChatBot is opened, the toggle should appear below the ChatBot window. The toggle shape and icon can be customized as needed, as shown in these [ChatBot toggle examples](/extensions/chatbot/ui#custom-toggle-icon). More details can be found in the [guidelines for accessing a ChatBot](#accessing-a-chatbot).
26
26
 
27
27
  ### Messages
28
28
 
@@ -37,7 +37,7 @@ import "./images.css"
37
37
  1. **Timestamp:** The relative or absolute time that a message was sent.
38
38
  1. **Label:** Labels ChatBot messages as "AI."
39
39
  1. **Quick responses:** Programmable, clickable actions that allow users to quickly answer questions from the ChatBot.
40
- 1. **Message actions:** Actions that allow users to interact with a bot message. These typically include providing feedback, copying, sharing, or reading aloud, but [custom message actions](/patternfly-ai/chatbot/messages#custom-message-actions) are also supported. More details for the feedback actions can be found in the [message feedback](#message-feedback) section.
40
+ 1. **Message actions:** Actions that allow users to interact with a bot message. These typically include providing feedback, copying, sharing, or reading aloud, but [custom message actions](/extensions/chatbot/messages#custom-message-actions) are also supported. More details for the feedback actions can be found in the [message feedback](#message-feedback) section.
41
41
 
42
42
  #### Welcome message
43
43
 
@@ -77,7 +77,7 @@ Selecting the quick start title, or the "Start" link can be configured to launch
77
77
 
78
78
  ### Message actions
79
79
 
80
- To allow users to interact with bot messages, utilize message actions. Refer to [the message actions React example](/patternfly-ai/chatbot/messages#message-actions) for an interactive visual.
80
+ To allow users to interact with bot messages, utilize message actions. Refer to [the message actions React example](/extensions/chatbot/messages#message-actions) for an interactive visual.
81
81
 
82
82
  The following actions can be used for some of the most common interactions:
83
83
 
@@ -91,7 +91,7 @@ The following actions can be used for some of the most common interactions:
91
91
  1. **Download:** Downloads the chat message. [Learn more about downloading chat transcripts](#downloading-chat-transcripts).
92
92
  1. **Listen:** Reads the message content out loud.
93
93
 
94
- You can also use [custom message actions](/patternfly-ai/chatbot/messages#custom-message-actions) as needed for your particular use case. When using custom actions, be sure to add a tooltip that describes the effect that the action will have. For more information, view [our tooltips guidelines](/ux-writing/tooltips).
94
+ You can also use [custom message actions](/extensions/chatbot/messages#custom-message-actions) as needed for your particular use case. When using custom actions, be sure to add a tooltip that describes the effect that the action will have. For more information, view [our tooltips guidelines](/ux-writing/tooltips).
95
95
 
96
96
  #### Message feedback
97
97
 
@@ -133,7 +133,7 @@ To message the ChatBot, users can type directly into the message bar in the foot
133
133
  1. **Use microphone button:** Supports speech recognition to allow users to use voice input. This feature is currently only available in Chrome and Safari.
134
134
  1. **Send button:** Allows users to send a typed message. This button should be disabled until a user has input text.
135
135
 
136
- When a user chooses to use speech input via the microphone button, the button will display a pulsing animation to indicate that the ChatBot is listening to the user (as shown in [this speech recognition example](/patternfly-ai/chatbot/ui#message-bar-with-speech-recognition-and-file-attachment)).
136
+ When a user chooses to use speech input via the microphone button, the button will display a pulsing animation to indicate that the ChatBot is listening to the user (as shown in [this speech recognition example](/extensions/chatbot/ui#message-bar-with-speech-recognition-and-file-attachment)).
137
137
 
138
138
  <div class="ws-docs-content-img">
139
139
  ![Animation phases of the listening button in the message bar.](./img/listening-pulse.svg)
@@ -266,7 +266,7 @@ As much as possible, the suggested prompts should consider the user’s location
266
266
 
267
267
  Instead of automatically initiating what sounds like a request from a user, the ChatBot should ask users to confirm or deny their intent. This differentiates moments where users are simply asking about feasibility, rather than actually making a request.
268
268
 
269
- This can be done using the [quick response](/patternfly-ai/chatbot/messages#messages-with-quick-responses) buttons:
269
+ This can be done using the [quick response](/extensions/chatbot/messages#messages-with-quick-responses) buttons:
270
270
 
271
271
  <div class="ws-docs-content-img">
272
272
  ![Confirmation options from a bot in response to a user's request.](./img/quick-response-confirmation.svg)
@@ -310,7 +310,7 @@ Within the settings menu, users can select their preferences for a variety of Ch
310
310
 
311
311
  ### Attaching files
312
312
 
313
- Using [the attach button](/patternfly-ai/chatbot/overview/design-guidelines#message-bar) in the message bar, users can [attach files](/patternfly-ai/chatbot/messages#file-attachments) to their message to share with the ChatBot.
313
+ Using [the attach button](/extensions/chatbot/overview/design-guidelines#message-bar) in the message bar, users can [attach files](/extensions/chatbot/messages#file-attachments) to their message to share with the ChatBot.
314
314
 
315
315
  The attach button can follow a couple of patterns, including:
316
316
 
@@ -333,7 +333,7 @@ If a message attachment is successful, a label with the file details will be dis
333
333
  ![File attached to user message.](./img/attached-file.svg)
334
334
  </div>
335
335
 
336
- Users can select the file label to either preview or edit their attachment, as shown in these [attachment examples](/patternfly-ai/chatbot/messages#attachment-preview).
336
+ Users can select the file label to either preview or edit their attachment, as shown in these [attachment examples](/extensions/chatbot/messages#attachment-preview).
337
337
 
338
338
  If a message attachment fails, an error message should share the reason for failure:
339
339
 
@@ -351,7 +351,7 @@ Choose the download action location that best works for your ChatBot:
351
351
 
352
352
  #### Download via conversation history drawer
353
353
 
354
- If your ChatBot uses a conversation history drawer, you can provide a download option in the [actions menu linked to a previous conversation](/patternfly-ai/chatbot/ui#drawer-with-conversation-actions).
354
+ If your ChatBot uses a conversation history drawer, you can provide a download option in the [actions menu linked to a previous conversation](/extensions/chatbot/ui#drawer-with-conversation-actions).
355
355
 
356
356
  <div class="ws-docs-content-img">
357
357
  ![Expanded menu for previous chat in the history window, which shows a download option.](./img/download-chat-history.svg)
@@ -415,7 +415,7 @@ There are a few display modes that users can choose when interacting with a Chat
415
415
 
416
416
  ### Layouts
417
417
 
418
- ChatBot supports a side-by-side [comparison layout](/patternfly-ai/chatbot/overview/demo#comparing-chatbots), which allows users to compare 2 chats at once. This can be helpful to let users understand how different models respond to the same prompt.
418
+ ChatBot supports a side-by-side [comparison layout](/extensions/chatbot/overview/demo#comparing-chatbots), which allows users to compare 2 chats at once. This can be helpful to let users understand how different models respond to the same prompt.
419
419
 
420
420
  <div class="ws-docs-content-img">
421
421
  ![2 ChatBots in comparison mode.](./img/comparison.svg)
@@ -429,7 +429,7 @@ Refer to the additional guidelines for [accessing a ChatBot](#accessing-a-chatbo
429
429
 
430
430
  ## Content considerations
431
431
 
432
- For guidance on writing ChatBot content, refer to our [conversation design guidelines](/patternfly-ai/conversation-design).
432
+ For guidance on writing ChatBot content, refer to our [conversation design guidelines](/ai/conversation-design).
433
433
 
434
434
  ## Accessibility
435
435
 
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  # Sidenav top-level section
3
3
  # should be the same for all markdown files
4
- section: PatternFly-AI
4
+ section: extensions
5
5
  subsection: ChatBot
6
6
  # Sidenav secondary level section
7
7
  # should be the same for all markdown files
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  # Sidenav top-level section
3
3
  # should be the same for all markdown files
4
- section: PatternFly-AI
4
+ section: extensions
5
5
  subsection: ChatBot
6
6
  # Sidenav secondary level section
7
7
  # should be the same for all markdown files
@@ -318,6 +318,7 @@ _Italic text, formatted with single underscores_
318
318
  content="This bot has a square avatar. You can further customize the avatar by applying an additional class or passing [PatternFly avatar props](/components/avatar) to the `<Message>` component via `avatarProps`."
319
319
  hasRoundAvatar={false}
320
320
  />
321
+ <Message name="Bot" role="bot" content="This is a message from a bot with no avatar." />
321
322
  <Select
322
323
  id="single-select"
323
324
  isOpen={isOpen}
@@ -0,0 +1,102 @@
1
+ import { FunctionComponent } from 'react';
2
+ import Message, {
3
+ ErrorMessage,
4
+ MessageAndActions,
5
+ MessageAttachmentItem,
6
+ MessageAttachmentsContainer,
7
+ MessageLoading
8
+ } from '@patternfly/chatbot/dist/dynamic/Message';
9
+ import MarkdownContent from '@patternfly/chatbot/dist/dynamic/MarkdownContent';
10
+ import ToolCall from '@patternfly/chatbot/dist/dynamic/ToolCall';
11
+ import ToolResponse from '@patternfly/chatbot/dist/dynamic/ToolResponse';
12
+ import FileDetailsLabel from '@patternfly/chatbot/dist/dynamic/FileDetailsLabel';
13
+ import ResponseActions, { ResponseActionsGroups } from '@patternfly/chatbot/dist/dynamic/ResponseActions';
14
+ import patternflyAvatar from './patternfly_avatar.jpg';
15
+ import userAvatar from './user_avatar.svg';
16
+
17
+ const handlePositiveResponse = () => {
18
+ // Handle positive response
19
+ };
20
+
21
+ const handleNegativeResponse = () => {
22
+ // Handle negative response
23
+ };
24
+
25
+ const handleCopy = () => {
26
+ // Handle copy action
27
+ };
28
+
29
+ const handleDownload = () => {
30
+ // Handle download action
31
+ };
32
+
33
+ const handleListen = () => {
34
+ // Handle listen action
35
+ };
36
+
37
+ export const MessageWithCustomStructure: FunctionComponent = () => (
38
+ <>
39
+ <Message name="Bot" role="bot" avatar={patternflyAvatar}>
40
+ <MessageAndActions>
41
+ <MarkdownContent
42
+ content={`This is a basic message with a more custom, fine-tuned structure. You can pass markdown to the MarkdownContent component, such as **bold content with double asterisks** or _italic content with single underscores_.`}
43
+ />
44
+ <ToolCall titleText="Calling 'awesome_tool'" loadingText="Loading 'awesome_tool'" isLoading={true} />
45
+ <ToolResponse
46
+ toggleContent="Tool response: fetch_user_data"
47
+ subheading="Executed in 0.3 seconds"
48
+ body="Successfully retrieved user data from the database."
49
+ cardTitle="User Data Response"
50
+ cardBody="The tool returned 150 user records matching the specified criteria."
51
+ />
52
+ <ErrorMessage title="An issue placed within this custom structure." />
53
+ <MarkdownContent
54
+ isMarkdownDisabled
55
+ textComponent={`You can also pass plain text without markdown to the MarkdownContent component by passing the isMarkdownDisabled prop. Optionally, you can also use the textComponent prop instead of content.`}
56
+ />
57
+ <ToolCall titleText="Calling 'more_awesome_tool'" loadingText="Loading 'more_awesome_tool'" isLoading={true} />
58
+ <ToolCall titleText="Calling 'even_more_awesome_tool'" loadingText="Loading 'even_more_awesome_tool'" />
59
+ <MarkdownContent content={`You can even place a message loading state in the middle of a message:`} />
60
+ <MessageLoading loadingWord="Loading something in the middle of a custom structured message" />
61
+ <ResponseActionsGroups>
62
+ <ResponseActions
63
+ actions={{
64
+ positive: { onClick: handlePositiveResponse, ariaLabel: 'Good response' },
65
+ negative: { onClick: handleNegativeResponse, ariaLabel: 'Bad response' }
66
+ }}
67
+ persistActionSelection={true}
68
+ />
69
+ <ResponseActions
70
+ actions={{
71
+ copy: { onClick: handleCopy, ariaLabel: 'Copy' },
72
+ download: { onClick: handleDownload, ariaLabel: 'Download' }
73
+ }}
74
+ persistActionSelection={false}
75
+ />
76
+ <ResponseActions
77
+ actions={{
78
+ listen: { onClick: handleListen, ariaLabel: 'Listen' }
79
+ }}
80
+ persistActionSelection={true}
81
+ />
82
+ </ResponseActionsGroups>
83
+ </MessageAndActions>
84
+ </Message>
85
+ <Message name="User" role="user" avatar={userAvatar}>
86
+ <MessageAndActions>
87
+ <MarkdownContent content="This message is in the MessageAndActions container, and the file attachments below are in their own separate MessageAttachmentsContainer!" />
88
+ </MessageAndActions>
89
+ <MessageAttachmentsContainer>
90
+ <MessageAttachmentItem>
91
+ <FileDetailsLabel fileName="project-report.pdf" />
92
+ </MessageAttachmentItem>
93
+ <MessageAttachmentItem>
94
+ <FileDetailsLabel fileName="data-analysis.csv" />
95
+ </MessageAttachmentItem>
96
+ <MessageAttachmentItem>
97
+ <FileDetailsLabel fileName="presentation-slides.pptx" />
98
+ </MessageAttachmentItem>
99
+ </MessageAttachmentsContainer>
100
+ </Message>
101
+ </>
102
+ );
@@ -3,15 +3,29 @@ import Message from '@patternfly/chatbot/dist/dynamic/Message';
3
3
  import patternflyAvatar from './patternfly_avatar.jpg';
4
4
 
5
5
  export const MessageWithDeepThinkingExample: FunctionComponent = () => (
6
- <Message
7
- name="Bot"
8
- role="bot"
9
- avatar={patternflyAvatar}
10
- content="This example has a body description that's within the recommended limit of 2 lines."
11
- deepThinking={{
12
- toggleContent: 'Show thinking',
13
- subheading: 'Thought for 3 seconds',
14
- body: "Here's why I said this."
15
- }}
16
- />
6
+ <>
7
+ <Message
8
+ name="Bot"
9
+ role="bot"
10
+ avatar={patternflyAvatar}
11
+ content="This example has a body description that's within the recommended limit of 2 lines."
12
+ deepThinking={{
13
+ toggleContent: 'Show thinking',
14
+ subheading: 'Thought for 3 seconds',
15
+ body: "Here's why I said this."
16
+ }}
17
+ />
18
+ <Message
19
+ name="Bot"
20
+ role="bot"
21
+ avatar={patternflyAvatar}
22
+ content="This example has deep thinking that is collapsed by default:"
23
+ deepThinking={{
24
+ isDefaultExpanded: false,
25
+ toggleContent: 'Show thinking',
26
+ subheading: 'Thought for 3 seconds',
27
+ body: "Here's why I said this."
28
+ }}
29
+ />
30
+ </>
17
31
  );
@@ -7,8 +7,10 @@ export const MessageWithFeedbackExample: FunctionComponent = () => {
7
7
  const [hasCloseButton, setHasCloseButton] = useState(false);
8
8
  const [hasTextArea, setHasTextArea] = useState(false);
9
9
  const [hasChildren, setHasChildren] = useState(false);
10
+ const [hasPrivacyStatement, setHasPrivacyStatement] = useState(false);
10
11
 
11
- const children = <>Do not share any personal or other sensitive information in your feedback.</>;
12
+ const children = <>This is additional content.</>;
13
+ const privacyStatement = 'Do not share any personal or other sensitive information in your feedback.';
12
14
 
13
15
  return (
14
16
  <>
@@ -33,6 +35,15 @@ export const MessageWithFeedbackExample: FunctionComponent = () => {
33
35
  label="Has additional content"
34
36
  id="has-children"
35
37
  />
38
+ <Checkbox
39
+ isChecked={hasPrivacyStatement}
40
+ onChange={() => {
41
+ setHasPrivacyStatement(!hasPrivacyStatement);
42
+ }}
43
+ name="feedback-card-with-privacy"
44
+ label="Has privacy statement"
45
+ id="has-privacy"
46
+ />
36
47
  </FormGroup>
37
48
  </FlexItem>
38
49
  <FlexItem>
@@ -51,6 +62,7 @@ export const MessageWithFeedbackExample: FunctionComponent = () => {
51
62
  alert(`Selected ${quickResponse} and received the additional feedback: ${additionalFeedback}`),
52
63
  hasTextArea,
53
64
  children: hasChildren ? children : undefined,
65
+ privacyStatement: hasPrivacyStatement ? privacyStatement : undefined,
54
66
  // eslint-disable-next-line no-console
55
67
  onClose: () => console.log('closed feedback form'),
56
68
  focusOnLoad: false
@@ -73,6 +85,7 @@ export const MessageWithFeedbackExample: FunctionComponent = () => {
73
85
  alert(`Selected ${quickResponse} and received the additional feedback: ${additionalFeedback}`),
74
86
  hasTextArea,
75
87
  children: hasChildren ? children : undefined,
88
+ privacyStatement: hasPrivacyStatement ? privacyStatement : undefined,
76
89
  // eslint-disable-next-line no-console
77
90
  onClose: () => console.log('closed feedback form'),
78
91
  focusOnLoad: false
@@ -0,0 +1,26 @@
1
+ import { FunctionComponent } from 'react';
2
+ import Message from '@patternfly/chatbot/dist/dynamic/Message';
3
+ import patternflyAvatar from './patternfly_avatar.jpg';
4
+
5
+ export const MessageWithMarkdownDeepThinkingExample: FunctionComponent = () => (
6
+ <Message
7
+ name="Bot"
8
+ role="bot"
9
+ avatar={patternflyAvatar}
10
+ content="This example shows how to use Markdown formatting in deep thinking content. Note the use of shouldRetainStyles to maintain proper formatting:"
11
+ deepThinking={{
12
+ shouldRetainStyles: true,
13
+ toggleContent: 'Show thinking',
14
+ subheading: '> Thought for 3 seconds',
15
+ isSubheadingMarkdown: true,
16
+ body: `I considered **multiple approaches** to answer your question:
17
+
18
+ 1. *Direct response* - Quick but less comprehensive
19
+ 2. *Research-based* - Thorough but time-consuming
20
+ 3. **Balanced approach** - Combines speed and accuracy
21
+
22
+ I chose option 3 because it provides the best user experience.`,
23
+ isBodyMarkdown: true
24
+ }}
25
+ />
26
+ );
@@ -0,0 +1,29 @@
1
+ import { FunctionComponent } from 'react';
2
+ import Message from '@patternfly/chatbot/dist/dynamic/Message';
3
+ import patternflyAvatar from './patternfly_avatar.jpg';
4
+
5
+ export const MessageWithMarkdownToolCallExample: FunctionComponent = () => (
6
+ <Message
7
+ name="Bot"
8
+ role="bot"
9
+ avatar={patternflyAvatar}
10
+ content="This example shows how to use Markdown formatting in tool call content. Note the use of shouldRetainStyles to maintain proper formatting:"
11
+ toolCall={{
12
+ shouldRetainStyles: true,
13
+ titleText: "Calling 'data_processor'",
14
+ expandableContent: `**Processing data** from the following sources:
15
+
16
+ - Database query results
17
+ - API responses
18
+ - *Local cache*
19
+
20
+ \`\`\`json
21
+ {
22
+ "status": "processing",
23
+ "items": 42
24
+ }
25
+ \`\`\``,
26
+ isExpandableContentMarkdown: true
27
+ }}
28
+ />
29
+ );
@@ -0,0 +1,200 @@
1
+ import { useState, FunctionComponent, MouseEvent as ReactMouseEvent } from 'react';
2
+ import Message from '@patternfly/chatbot/dist/dynamic/Message';
3
+ import patternflyAvatar from './patternfly_avatar.jpg';
4
+ import { CopyIcon, WrenchIcon } from '@patternfly/react-icons';
5
+ import {
6
+ Button,
7
+ DescriptionList,
8
+ DescriptionListDescription,
9
+ DescriptionListGroup,
10
+ DescriptionListTerm,
11
+ ExpandableSection,
12
+ ExpandableSectionVariant,
13
+ Flex,
14
+ FlexItem,
15
+ Label
16
+ } from '@patternfly/react-core';
17
+ export const MessageWithToolResponseExample: FunctionComponent = () => {
18
+ const [isExpanded, setIsExpanded] = useState(false);
19
+ const onToggle = (_event: ReactMouseEvent, isExpanded: boolean) => {
20
+ setIsExpanded(isExpanded);
21
+ };
22
+ const toolResponseBody = `The tool processed **3 database queries** and returned the following results:
23
+
24
+ 1. User data - *42 records*
25
+ 2. Transaction history - *128 records*
26
+ 3. Analytics metrics - *15 data points*
27
+
28
+ \`\`\`json
29
+ {
30
+ "status": "success",
31
+ "execution_time": "0.12s"
32
+ }
33
+ \`\`\``;
34
+ return (
35
+ <Message
36
+ name="Bot"
37
+ role="bot"
38
+ avatar={patternflyAvatar}
39
+ content="This example shows how to use Markdown formatting in tool response content. Note the use of shouldRetainStyles to maintain proper formatting:"
40
+ toolResponse={{
41
+ shouldRetainStyles: true,
42
+ isToggleContentMarkdown: true,
43
+ toggleContent: '**Tool response:** data_query_tool',
44
+ isSubheadingMarkdown: true,
45
+ subheading: '> Completed in 0.12 seconds',
46
+ body: toolResponseBody,
47
+ isBodyMarkdown: true,
48
+ cardTitle: (
49
+ <Flex
50
+ alignItems={{
51
+ default: 'alignItemsCenter'
52
+ }}
53
+ justifyContent={{
54
+ default: 'justifyContentSpaceBetween'
55
+ }}
56
+ >
57
+ <FlexItem>
58
+ <Flex
59
+ direction={{
60
+ default: 'column'
61
+ }}
62
+ gap={{
63
+ default: 'gapXs'
64
+ }}
65
+ >
66
+ <FlexItem
67
+ grow={{
68
+ default: 'grow'
69
+ }}
70
+ >
71
+ <Flex
72
+ gap={{
73
+ default: 'gapXs'
74
+ }}
75
+ >
76
+ <FlexItem>
77
+ <WrenchIcon
78
+ style={{
79
+ color: 'var(--pf-t--global--icon--color--brand--default'
80
+ }}
81
+ />
82
+ </FlexItem>
83
+ <FlexItem>toolName</FlexItem>
84
+ </Flex>
85
+ </FlexItem>
86
+ <FlexItem>
87
+ <Flex
88
+ gap={{
89
+ default: 'gapSm'
90
+ }}
91
+ style={{
92
+ fontSize: '12px',
93
+ fontWeight: '400'
94
+ }}
95
+ >
96
+ <FlexItem>Execution time:</FlexItem>
97
+ <FlexItem>0.12 seconds</FlexItem>
98
+ </Flex>
99
+ </FlexItem>
100
+ </Flex>
101
+ </FlexItem>
102
+ <FlexItem>
103
+ <Button
104
+ variant="plain"
105
+ aria-label="Copy tool response to clipboard"
106
+ icon={
107
+ <CopyIcon
108
+ style={{
109
+ color: 'var(--pf-t--global--icon--color--subtle)'
110
+ }}
111
+ />
112
+ }
113
+ ></Button>
114
+ </FlexItem>
115
+ </Flex>
116
+ ),
117
+ cardBody: (
118
+ <>
119
+ <DescriptionList
120
+ style={{
121
+ '--pf-v6-c-description-list--RowGap': 'var(--pf-t--global--spacer--md)'
122
+ }}
123
+ aria-label="Tool response"
124
+ >
125
+ <DescriptionListGroup
126
+ style={{
127
+ '--pf-v6-c-description-list__group--RowGap': 'var(--pf-t--global--spacer--xs)'
128
+ }}
129
+ >
130
+ <DescriptionListTerm>Parameters</DescriptionListTerm>
131
+ <DescriptionListDescription>
132
+ <Flex
133
+ direction={{
134
+ default: 'column'
135
+ }}
136
+ >
137
+ <FlexItem>Optional description text for parameters.</FlexItem>
138
+ <FlexItem>
139
+ <Flex
140
+ gap={{
141
+ default: 'gapSm'
142
+ }}
143
+ >
144
+ <FlexItem>
145
+ <Label variant="outline" color="blue">
146
+ type
147
+ </Label>
148
+ </FlexItem>
149
+ <FlexItem>
150
+ <Label variant="outline" color="blue">
151
+ properties
152
+ </Label>
153
+ </FlexItem>
154
+ <FlexItem>
155
+ <Label variant="outline" color="blue">
156
+ label
157
+ </Label>
158
+ </FlexItem>
159
+ <FlexItem>
160
+ <Label variant="outline" color="blue">
161
+ label
162
+ </Label>
163
+ </FlexItem>
164
+ </Flex>
165
+ </FlexItem>
166
+ </Flex>
167
+ </DescriptionListDescription>
168
+ </DescriptionListGroup>
169
+ <DescriptionListGroup
170
+ style={{
171
+ '--pf-v6-c-description-list__group--RowGap': 'var(--pf-t--global--spacer--xs)'
172
+ }}
173
+ >
174
+ <DescriptionListTerm>Response</DescriptionListTerm>
175
+ <DescriptionListDescription>
176
+ <ExpandableSection
177
+ variant={ExpandableSectionVariant.truncate}
178
+ toggleTextExpanded="show less of response"
179
+ toggleTextCollapsed="show more of response"
180
+ onToggle={onToggle}
181
+ isExpanded={isExpanded}
182
+ style={{
183
+ '--pf-v6-c-expandable-section__content--Opacity': '1',
184
+ '--pf-v6-c-expandable-section__content--PaddingInlineStart': 0,
185
+ '--pf-v6-c-expandable-section__content--TranslateY': 0,
186
+ '--pf-v6-c-expandable-section--m-expand-top__content--TranslateY': 0
187
+ }}
188
+ >
189
+ Descriptive text about the tool response, including completion status, details on the data that was
190
+ processed, or anything else relevant to the use case.
191
+ </ExpandableSection>
192
+ </DescriptionListDescription>
193
+ </DescriptionListGroup>
194
+ </DescriptionList>
195
+ </>
196
+ )
197
+ }}
198
+ />
199
+ );
200
+ };
@@ -0,0 +1,61 @@
1
+ import { FunctionComponent } from 'react';
2
+
3
+ import Message from '@patternfly/chatbot/dist/dynamic/Message';
4
+ import patternflyAvatar from './patternfly_avatar.jpg';
5
+
6
+ export const MessageWithMultipleActionGroups: FunctionComponent = () => (
7
+ <>
8
+ <Message
9
+ name="Bot"
10
+ role="bot"
11
+ avatar={patternflyAvatar}
12
+ content="This message contains multiple action groups, each with their own selection persistence: \n1. Feedback actions (thumbs up/down) with persistent selections \n2. Utility actions (copy, download) with non-persistent selections \n3. Listen action with persistent selection"
13
+ actions={[
14
+ {
15
+ actions: {
16
+ // eslint-disable-next-line no-console
17
+ positive: { onClick: () => console.log('Good response') },
18
+ // eslint-disable-next-line no-console
19
+ negative: { onClick: () => console.log('Bad response') }
20
+ },
21
+ persistActionSelection: true
22
+ },
23
+ {
24
+ actions: {
25
+ // eslint-disable-next-line no-console
26
+ copy: { onClick: () => console.log('Copy') },
27
+ // eslint-disable-next-line no-console
28
+ download: { onClick: () => console.log('Download') }
29
+ },
30
+ persistActionSelection: false
31
+ },
32
+ {
33
+ actions: {
34
+ // eslint-disable-next-line no-console
35
+ listen: { onClick: () => console.log('Listen') }
36
+ },
37
+ persistActionSelection: true
38
+ }
39
+ ]}
40
+ />
41
+ <Message
42
+ name="Bot"
43
+ role="bot"
44
+ avatar={patternflyAvatar}
45
+ content="This message contains multiple action groups, both of which persist selections."
46
+ actions={[
47
+ {
48
+ // eslint-disable-next-line no-console
49
+ positive: { onClick: () => console.log('Good response') },
50
+ // eslint-disable-next-line no-console
51
+ negative: { onClick: () => console.log('Bad response') }
52
+ },
53
+ {
54
+ // eslint-disable-next-line no-console
55
+ listen: { onClick: () => console.log('Listen') }
56
+ }
57
+ ]}
58
+ persistActionSelection={true}
59
+ />
60
+ </>
61
+ );
@@ -0,0 +1,22 @@
1
+ import { FunctionComponent } from 'react';
2
+
3
+ import Message from '@patternfly/chatbot/dist/dynamic/Message';
4
+ import patternflyAvatar from './patternfly_avatar.jpg';
5
+
6
+ export const MessageWithPersistedActions: FunctionComponent = () => (
7
+ <Message
8
+ name="Bot"
9
+ role="bot"
10
+ avatar={patternflyAvatar}
11
+ content="I updated your account with those settings. You're ready to set up your first dashboard! Click a button and then click outside the message - notice the selection persists."
12
+ actions={{
13
+ // eslint-disable-next-line no-console
14
+ positive: { onClick: () => console.log('Good response') },
15
+ // eslint-disable-next-line no-console
16
+ negative: { onClick: () => console.log('Bad response') },
17
+ // eslint-disable-next-line no-console
18
+ listen: { onClick: () => console.log('Listen') }
19
+ }}
20
+ persistActionSelection
21
+ />
22
+ );