@patternfly/chatbot 6.5.0-prerelease.2 → 6.5.0-prerelease.20

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 (152) hide show
  1. package/dist/cjs/AttachMenu/AttachMenu.d.ts +8 -2
  2. package/dist/cjs/AttachMenu/AttachMenu.js +2 -2
  3. package/dist/cjs/ChatbotFooter/ChatbotFooter.d.ts +5 -2
  4. package/dist/cjs/ChatbotFooter/ChatbotFooter.js +2 -2
  5. package/dist/cjs/ChatbotFooter/ChatbotFooter.test.js +5 -1
  6. package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.js +29 -2
  7. package/dist/cjs/CodeModal/CodeModal.d.ts +2 -0
  8. package/dist/cjs/CodeModal/CodeModal.js +53 -8
  9. package/dist/cjs/FileDetailsLabel/FileDetailsLabel.d.ts +2 -1
  10. package/dist/cjs/Message/CodeBlockMessage/CodeBlockMessage.d.ts +3 -1
  11. package/dist/cjs/Message/CodeBlockMessage/CodeBlockMessage.js +2 -2
  12. package/dist/cjs/Message/Message.d.ts +7 -1
  13. package/dist/cjs/Message/Message.js +11 -8
  14. package/dist/cjs/Message/Message.test.js +36 -0
  15. package/dist/cjs/Message/MessageLoading.d.ts +2 -1
  16. package/dist/cjs/Message/MessageLoading.js +1 -1
  17. package/dist/cjs/Message/TableMessage/TableMessage.d.ts +4 -1
  18. package/dist/cjs/Message/TableMessage/TableMessage.js +2 -2
  19. package/dist/cjs/Message/TextMessage/TextMessage.d.ts +4 -1
  20. package/dist/cjs/Message/TextMessage/TextMessage.js +2 -2
  21. package/dist/cjs/MessageBar/AttachButton.d.ts +2 -0
  22. package/dist/cjs/MessageBar/AttachButton.js +2 -2
  23. package/dist/cjs/MessageBar/AttachButton.test.js +4 -0
  24. package/dist/cjs/MessageBar/MessageBar.d.ts +16 -6
  25. package/dist/cjs/MessageBar/MessageBar.js +6 -5
  26. package/dist/cjs/MessageBar/MessageBar.test.js +62 -0
  27. package/dist/cjs/Onboarding/Onboarding.d.ts +36 -0
  28. package/dist/cjs/Onboarding/Onboarding.js +37 -0
  29. package/dist/cjs/Onboarding/Onboarding.test.d.ts +1 -0
  30. package/dist/cjs/Onboarding/Onboarding.test.js +80 -0
  31. package/dist/cjs/Onboarding/index.d.ts +2 -0
  32. package/dist/cjs/Onboarding/index.js +23 -0
  33. package/dist/cjs/ResponseActions/ResponseActions.d.ts +3 -0
  34. package/dist/cjs/ResponseActions/ResponseActions.js +28 -7
  35. package/dist/cjs/ResponseActions/ResponseActions.test.js +67 -12
  36. package/dist/cjs/__mocks__/monaco-editor.d.ts +11 -0
  37. package/dist/cjs/__mocks__/monaco-editor.js +18 -0
  38. package/dist/cjs/__mocks__/rehype-highlight.d.ts +2 -0
  39. package/dist/cjs/__mocks__/rehype-highlight.js +4 -0
  40. package/dist/cjs/index.d.ts +2 -0
  41. package/dist/cjs/index.js +4 -1
  42. package/dist/css/main.css +219 -21
  43. package/dist/css/main.css.map +1 -1
  44. package/dist/dynamic/Onboarding/package.json +1 -0
  45. package/dist/esm/AttachMenu/AttachMenu.d.ts +8 -2
  46. package/dist/esm/AttachMenu/AttachMenu.js +2 -2
  47. package/dist/esm/ChatbotFooter/ChatbotFooter.d.ts +5 -2
  48. package/dist/esm/ChatbotFooter/ChatbotFooter.js +2 -2
  49. package/dist/esm/ChatbotFooter/ChatbotFooter.test.js +5 -1
  50. package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.js +30 -3
  51. package/dist/esm/CodeModal/CodeModal.d.ts +2 -0
  52. package/dist/esm/CodeModal/CodeModal.js +54 -9
  53. package/dist/esm/FileDetailsLabel/FileDetailsLabel.d.ts +2 -1
  54. package/dist/esm/Message/CodeBlockMessage/CodeBlockMessage.d.ts +3 -1
  55. package/dist/esm/Message/CodeBlockMessage/CodeBlockMessage.js +2 -2
  56. package/dist/esm/Message/Message.d.ts +7 -1
  57. package/dist/esm/Message/Message.js +11 -8
  58. package/dist/esm/Message/Message.test.js +36 -0
  59. package/dist/esm/Message/MessageLoading.d.ts +2 -1
  60. package/dist/esm/Message/MessageLoading.js +1 -1
  61. package/dist/esm/Message/TableMessage/TableMessage.d.ts +4 -1
  62. package/dist/esm/Message/TableMessage/TableMessage.js +2 -2
  63. package/dist/esm/Message/TextMessage/TextMessage.d.ts +4 -1
  64. package/dist/esm/Message/TextMessage/TextMessage.js +2 -2
  65. package/dist/esm/MessageBar/AttachButton.d.ts +2 -0
  66. package/dist/esm/MessageBar/AttachButton.js +2 -2
  67. package/dist/esm/MessageBar/AttachButton.test.js +4 -0
  68. package/dist/esm/MessageBar/MessageBar.d.ts +16 -6
  69. package/dist/esm/MessageBar/MessageBar.js +6 -5
  70. package/dist/esm/MessageBar/MessageBar.test.js +62 -0
  71. package/dist/esm/Onboarding/Onboarding.d.ts +36 -0
  72. package/dist/esm/Onboarding/Onboarding.js +30 -0
  73. package/dist/esm/Onboarding/Onboarding.test.d.ts +1 -0
  74. package/dist/esm/Onboarding/Onboarding.test.js +75 -0
  75. package/dist/esm/Onboarding/index.d.ts +2 -0
  76. package/dist/esm/Onboarding/index.js +2 -0
  77. package/dist/esm/ResponseActions/ResponseActions.d.ts +3 -0
  78. package/dist/esm/ResponseActions/ResponseActions.js +28 -7
  79. package/dist/esm/ResponseActions/ResponseActions.test.js +67 -12
  80. package/dist/esm/__mocks__/monaco-editor.d.ts +11 -0
  81. package/dist/esm/__mocks__/monaco-editor.js +18 -0
  82. package/dist/esm/__mocks__/rehype-highlight.d.ts +2 -0
  83. package/dist/esm/__mocks__/rehype-highlight.js +2 -0
  84. package/dist/esm/index.d.ts +2 -0
  85. package/dist/esm/index.js +2 -0
  86. package/dist/tsconfig.tsbuildinfo +1 -1
  87. package/package.json +14 -2
  88. package/patternfly-docs/content/extensions/chatbot/chatbot.md +57 -0
  89. package/patternfly-docs/content/extensions/chatbot/design-guidelines.md +12 -12
  90. package/patternfly-docs/content/extensions/chatbot/examples/Analytics/Analytics.md +1 -1
  91. package/patternfly-docs/content/extensions/chatbot/examples/Customizing Messages/Customizing Messages.md +1 -1
  92. package/patternfly-docs/content/extensions/chatbot/examples/Messages/BotMessage.tsx +1 -0
  93. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithPersistedActions.tsx +22 -0
  94. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickResponses.tsx +11 -0
  95. package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +18 -4
  96. package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessage.tsx +1 -0
  97. package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessageWithExtraContent.tsx +3 -1
  98. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarIndicatorThinking.tsx +15 -0
  99. package/patternfly-docs/content/extensions/chatbot/examples/UI/CompactOnboarding.tsx +141 -0
  100. package/patternfly-docs/content/extensions/chatbot/examples/UI/Onboarding.tsx +151 -0
  101. package/patternfly-docs/content/extensions/chatbot/examples/UI/RH-Hat-Image.svg +9 -0
  102. package/patternfly-docs/content/extensions/chatbot/examples/UI/Settings.tsx +1 -1
  103. package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +55 -27
  104. package/patternfly-docs/content/extensions/chatbot/examples/demos/AttachmentDemos.md +18 -18
  105. package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.md +29 -21
  106. package/patternfly-docs/content/extensions/chatbot/examples/demos/WhiteEmbeddedChatbot.tsx +451 -0
  107. package/patternfly-docs/patternfly-docs.config.js +2 -1
  108. package/patternfly-docs/patternfly-docs.source.js +1 -1
  109. package/src/AttachMenu/AttachMenu.tsx +26 -11
  110. package/src/Chatbot/Chatbot.scss +23 -1
  111. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss +25 -0
  112. package/src/ChatbotFooter/ChatbotFooter.scss +21 -0
  113. package/src/ChatbotFooter/ChatbotFooter.test.tsx +10 -1
  114. package/src/ChatbotFooter/ChatbotFooter.tsx +10 -3
  115. package/src/ChatbotHeader/ChatbotHeader.scss +19 -0
  116. package/src/ChatbotHeader/ChatbotHeaderMenu.tsx +56 -14
  117. package/src/ChatbotModal/ChatbotModal.scss +3 -0
  118. package/src/CodeModal/CodeModal.tsx +72 -23
  119. package/src/DeepThinking/DeepThinking.scss +1 -1
  120. package/src/FileDetailsLabel/FileDetailsLabel.tsx +2 -2
  121. package/src/Message/CodeBlockMessage/CodeBlockMessage.scss +12 -0
  122. package/src/Message/CodeBlockMessage/CodeBlockMessage.tsx +4 -1
  123. package/src/Message/Message.scss +11 -7
  124. package/src/Message/Message.test.tsx +41 -0
  125. package/src/Message/Message.tsx +28 -13
  126. package/src/Message/MessageLoading.scss +7 -0
  127. package/src/Message/MessageLoading.tsx +2 -2
  128. package/src/Message/TableMessage/TableMessage.scss +6 -1
  129. package/src/Message/TableMessage/TableMessage.tsx +6 -2
  130. package/src/Message/TextMessage/TextMessage.scss +10 -0
  131. package/src/Message/TextMessage/TextMessage.tsx +11 -2
  132. package/src/Message/UserFeedback/UserFeedback.scss +2 -1
  133. package/src/MessageBar/AttachButton.test.tsx +4 -0
  134. package/src/MessageBar/AttachButton.tsx +4 -1
  135. package/src/MessageBar/MessageBar.scss +40 -3
  136. package/src/MessageBar/MessageBar.test.tsx +102 -1
  137. package/src/MessageBar/MessageBar.tsx +44 -11
  138. package/src/Onboarding/Onboarding.scss +101 -0
  139. package/src/Onboarding/Onboarding.test.tsx +148 -0
  140. package/src/Onboarding/Onboarding.tsx +126 -0
  141. package/src/Onboarding/index.ts +3 -0
  142. package/src/ResponseActions/ResponseActions.scss +1 -1
  143. package/src/ResponseActions/ResponseActions.test.tsx +111 -12
  144. package/src/ResponseActions/ResponseActions.tsx +38 -10
  145. package/src/ToolCall/ToolCall.scss +1 -1
  146. package/src/ToolResponse/ToolResponse.scss +3 -3
  147. package/src/__mocks__/monaco-editor.ts +19 -0
  148. package/src/__mocks__/rehype-highlight.ts +3 -0
  149. package/src/index.ts +3 -0
  150. package/src/main.scss +1 -0
  151. package/tsconfig.json +1 -1
  152. package/patternfly-docs/content/extensions/chatbot/about-chatbot.md +0 -44
@@ -180,7 +180,7 @@ export const SettingsDemo: FunctionComponent = () => {
180
180
  },
181
181
  {
182
182
  id: 'archive-all',
183
- label: 'Archive all chat',
183
+ label: 'Archive all chats',
184
184
  field: (
185
185
  // We want to add the id property here as well so the label is coupled
186
186
  // with the button on screen readers.
@@ -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
@@ -53,6 +53,7 @@ import FileDropZone from '@patternfly/chatbot/dist/dynamic/FileDropZone';
53
53
  import { PreviewAttachment } from '@patternfly/chatbot/dist/dynamic/PreviewAttachment';
54
54
  import ChatbotAlert from '@patternfly/chatbot/dist/dynamic/ChatbotAlert';
55
55
  import TermsOfUse from '@patternfly/chatbot/dist/dynamic/TermsOfUse';
56
+ import Onboarding from '@patternfly/chatbot/dist/dynamic/Onboarding';
56
57
  import {
57
58
  ChatbotHeader,
58
59
  ChatbotHeaderCloseButton,
@@ -85,6 +86,7 @@ import PFHorizontalLogoReverse from './PF-HorizontalLogo-Reverse.svg';
85
86
  import userAvatar from '../Messages/user_avatar.svg';
86
87
  import patternflyAvatar from '../Messages/patternfly_avatar.jpg';
87
88
  import termsAndConditionsHeader from './PF-TermsAndConditionsHeader.svg';
89
+ import onboardingHeader from './RH-Hat-Image.svg';
88
90
  import { CloseIcon, SearchIcon, OutlinedCommentsIcon } from '@patternfly/react-icons';
89
91
  import { FunctionComponent, FormEvent, useState, useRef, MouseEvent, isValidElement, cloneElement, Children, ReactNode, Ref, MouseEvent as ReactMouseEvent, CSSProperties, useEffect} from 'react';
90
92
  import FilePreview from '@patternfly/chatbot/dist/dynamic/FilePreview';
@@ -93,7 +95,7 @@ import FilePreview from '@patternfly/chatbot/dist/dynamic/FilePreview';
93
95
 
94
96
  ### Container
95
97
 
96
- The PatternFly ChatBot is a separate window that overlays or is embedded within other UI content. This container can be shown and hidden via [the ChatBot toggle.](/patternfly-ai/chatbot/ui#toggle)
98
+ The PatternFly ChatBot is a separate window that overlays or is embedded within other UI content. This container can be shown and hidden via [the ChatBot toggle.](/extensions/chatbot/ui#toggle)
97
99
 
98
100
  The `<Chatbot>` component is the container that encompasses the ChatBot experience. It adapts to various display modes (overlay/default, docked, fullscreen, and embedded) and supports both light and dark themes.
99
101
 
@@ -105,7 +107,7 @@ The "embedded" display mode is meant to be used within a [PatternFly page](/comp
105
107
 
106
108
  ### Content and message box
107
109
 
108
- The `<ChatbotContent>` component is the container that is placed within the `<Chatbot>`, between the [`<ChatbotHeader>`](/patternfly-ai/chatbot/ui#header) and [`<ChatbotFooter>`.](/patternfly-ai/chatbot/ui#footer)
110
+ The `<ChatbotContent>` component is the container that is placed within the `<Chatbot>`, between the [`<ChatbotHeader>`](/extensions/chatbot/ui#header) and [`<ChatbotFooter>`.](/extensions/chatbot/ui#footer)
109
111
 
110
112
  `<ChatbotContent>` usually contains a `<ChatbotMessageBox>` for displaying messages.
111
113
 
@@ -123,11 +125,11 @@ Your code structure should look like this:
123
125
  </Chatbot>
124
126
  ```
125
127
 
126
- **Note**: When messages update, it is important to announce new messages to users of assistive technology. To do this, make sure to set the `announcement` prop on `<MessageBox>` whenever you display a new message in `<MessageBox>`. You can view this in action in our [basic ChatBot](/patternfly-ai/chatbot/overview/demo#basic-chatbot) and [embedded ChatBot](/patternfly-ai/chatbot/overview/demo#embedded-chatbot) demos.
128
+ **Note**: When messages update, it is important to announce new messages to users of assistive technology. To do this, make sure to set the `announcement` prop on `<MessageBox>` whenever you display a new message in `<MessageBox>`. You can view this in action in our [basic ChatBot](/extensions/chatbot/overview/demo#basic-chatbot) and [embedded ChatBot](/extensions/chatbot/overview/demo#embedded-chatbot) demos.
127
129
 
128
130
  ### Welcome message
129
131
 
130
- To introduce users to the ChatBot experience, display a welcome message before they input their first message. This brief message should follow our [conversation design guidelines](/patternfly-ai/conversation-design) to welcome users to the ChatBot experience and encourage them to interact.
132
+ To introduce users to the ChatBot experience, display a welcome message before they input their first message. This brief message should follow our [conversation design guidelines](/ai/conversation-design) to welcome users to the ChatBot experience and encourage them to interact.
131
133
 
132
134
  This message can be dismissed once a user sends their first message. To change the arrangement of the message within the message box, specify the `position` in the `<MessageBox>` component.
133
135
 
@@ -147,7 +149,7 @@ To provide users with a more specific direction, you can also include optional w
147
149
 
148
150
  To provide page context, we recommend using a "Skip to chatbot" button. This allows you to skip past other content on the page, directly to the ChatBot content, using a [PatternFly skip to content component](/components/skip-to-content). To display this button, you must tab into the main window.
149
151
 
150
- When using default or docked modes, we recommend putting focus on the toggle if the ChatBot is closed, and the ChatBot when it is open. For fullscreen and embedded, we recommend putting the focus on the first focusable item in the ChatBot, such as a menu toggle. This can be seen in our more fully-featured demos for the [default, embedded, and fullscreen ChatBot](/patternfly-ai/chatbot/overview/demo#basic-chatbot) and the [embedded ChatBot](/patternfly-ai/chatbot/overview/demo#embedded-chatbot).
152
+ When using default or docked modes, we recommend putting focus on the toggle if the ChatBot is closed, and the ChatBot when it is open. For fullscreen and embedded, we recommend putting the focus on the first focusable item in the ChatBot, such as a menu toggle. This can be seen in our more fully-featured demos for the [default, embedded, and fullscreen ChatBot](/extensions/chatbot/overview/demo#basic-chatbot) and the [embedded ChatBot](/extensions/chatbot/overview/demo#embedded-chatbot).
151
153
 
152
154
  ```js file="./SkipToContent.tsx" isFullscreen
153
155
 
@@ -226,7 +228,7 @@ There are a variety of options and customizations you can make to the header, to
226
228
  In this example, select the respective checkbox to toggle these features:
227
229
 
228
230
  - **Menu:** Users can select the menu toggle to open a menu of additional options or actions.
229
- - **New chat button:** Used to start a new chat session. The header button can be used in addition to or in place of a new chat button within the [conversation history drawer](/patternfly-ai/chatbot/ui/#drawer-with-search-and-new-chat-button).
231
+ - **New chat button:** Used to start a new chat session. The header button can be used in addition to or in place of a new chat button within the [conversation history drawer](/extensions/chatbot/ui/#drawer-with-search-and-new-chat-button).
230
232
  - **Left-aligned logo**
231
233
  - **Centered logo**
232
234
  - **Selector dropdown:** Users can choose from preselected options in a dropdown menu. For example, they can toggle between AI models.
@@ -283,7 +285,7 @@ To disable the send button in the following example, select the "Disable send bu
283
285
 
284
286
  You can change the behavior of the attach button to open a menu, rather than the default file viewer for your operating system. This menu can display different actions related to attachments.
285
287
 
286
- Attachments can also be added to the ChatBot via [drag and drop.](/patternfly-ai/chatbot/messages#attachment-dropzone)
288
+ Attachments can also be added to the ChatBot via [drag and drop.](/extensions/chatbot/messages#attachment-dropzone)
287
289
 
288
290
  ```js file="./ChatbotMessageBarAttach.tsx"
289
291
 
@@ -314,6 +316,16 @@ To enable the stop button, set `hasStopButton` to `true` and pass in a `handleSt
314
316
 
315
317
  ```
316
318
 
319
+ ### Message bar with AI indicator styles
320
+
321
+ To add a more pronounced AI indicator style to the message bar, pass `hasAiIndicator` to the `<MessageBar>` component. You can also enable a "thinking" animation by passing in `isThinking`.
322
+
323
+ This example shows a simplified method of handling the "thinking" animation: after a user sends a message, the `isThinking` property is set to `true` to trigger the animation, then returns to `false` after 10 seconds to halt the animation.
324
+
325
+ ```ts file="./ChatbotMessageBarIndicatorThinking.tsx" isBeta
326
+
327
+ ```
328
+
317
329
  ## Navigation
318
330
 
319
331
  ### Side nav in a drawer
@@ -342,7 +354,7 @@ The code structure will look like this:
342
354
  </Chatbot>
343
355
  ```
344
356
 
345
- The conversation history drawer looks different depending on the `displayMode` of the parent `<Chatbot>`. (As shown in the [main ChatBot demo](/patternfly-ai/chatbot/overview/demo#basic-chatbot).):
357
+ The conversation history drawer looks different depending on the `displayMode` of the parent `<Chatbot>`. (As shown in the [main ChatBot demo](/extensions/chatbot/overview/demo#basic-chatbot).):
346
358
 
347
359
  - `Default` and `docked` display modes display the conversation history on top of the rest of the ChatBot content, with a PatternFly backdrop between the drawer panel and drawer content.
348
360
  - `Fullscreen` and `embedded` display modes display the conversation history in line with the drawer content.
@@ -414,24 +426,6 @@ The drawer can also be used to display a list of basic menu items.
414
426
 
415
427
  ```
416
428
 
417
- ### Terms of use
418
-
419
- Based on the [PatternFly modal](/components/modal), this modal adapts to the ChatBot display mode and is meant to display terms and conditions for using a ChatBot in your project. The image in the header can be toggled on or off depending on whether the `image` and `altText` props are provided.
420
-
421
- This example also includes an example of how to use [skip to content](/patternfly-ai/chatbot/ui#skip-to-content). When the terms of use modal is open, focus is placed on the terms of use container. When it is closed, focus is placed on the ChatBot. In a real example with a functioning ChatBot toggle, you would also want to place focus on the toggle when appropriate.
422
-
423
- ```js file="./TermsOfUse.tsx" isFullscreen
424
-
425
- ```
426
-
427
- ### Compact terms of use
428
-
429
- To apply compact styling to the terms of use modal, pass `isCompact` to `<TermsOfUse>`. This will remove the header image and adjust the spacing of text, so that there is less white space in the modal.
430
-
431
- ```js file="./TermsOfUseCompact.tsx" isFullscreen
432
-
433
- ```
434
-
435
429
  ### Settings
436
430
 
437
431
  To contain user preference controls and other ChatBot setting options, you can create a separate settings page that can accept any number of buttons, dropdown menus, toggles, labels, and so on. This settings page will render all components appropriately within all 4 display modes.
@@ -459,3 +453,37 @@ Based on the [PatternFly modal](/components/modal), this modal adapts to the Cha
459
453
  ```js file="./ChatbotModal.tsx" isFullscreen
460
454
 
461
455
  ```
456
+
457
+ ### Onboarding
458
+
459
+ You can use the onboarding modal to introduce users to your ChatBot and provide necessary information. The title, image, and body text are customizable.
460
+
461
+ ```js file="./Onboarding.tsx" isFullscreen
462
+
463
+ ```
464
+
465
+ ### Compact onboarding
466
+
467
+ To make the onboarding modal compact, with less spacing, pass `isCompact` to the `<Onboarding>` component.
468
+
469
+ ```js file="./CompactOnboarding.tsx" isFullscreen
470
+
471
+ ```
472
+
473
+ ### Terms of use
474
+
475
+ Based on the [PatternFly modal](/components/modal), this modal adapts to the ChatBot display mode and is meant to display terms and conditions for using a ChatBot in your project. The image in the header can be toggled on or off depending on whether the `image` and `altText` props are provided.
476
+
477
+ This example also includes an example of how to use [skip to content](/extensions/chatbot/ui#skip-to-content). When the terms of use modal is open, focus is placed on the terms of use container. When it is closed, focus is placed on the ChatBot. In a real example with a functioning ChatBot toggle, you would also want to place focus on the toggle when appropriate.
478
+
479
+ ```js file="./TermsOfUse.tsx" isFullscreen
480
+
481
+ ```
482
+
483
+ ### Compact terms of use
484
+
485
+ To apply compact styling to the terms of use modal, pass `isCompact` to `<TermsOfUse>`. This will remove the header image and adjust the spacing of text, so that there is less white space in the modal.
486
+
487
+ ```js file="./TermsOfUseCompact.tsx" isFullscreen
488
+
489
+ ```
@@ -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
@@ -68,7 +68,7 @@ It is also important to announce when new content appears onscreen for accessibi
68
68
 
69
69
  This demo shows auto-scrolling functionality, which automatically scrolls to the bottom of the active chat.
70
70
 
71
- To enable auto-scroll behavior pass the `enableSmartScroll` prop to the [`<MessageBox>`](/patternfly-ai/chatbot/ui#message-box) component.
71
+ To enable auto-scroll behavior pass the `enableSmartScroll` prop to the [`<MessageBox>`](/extensions/chatbot/ui#message-box) component.
72
72
 
73
73
  When enabled:
74
74
 
@@ -88,11 +88,11 @@ When using `ref`, the `<MessageBox>` component exposes the following methods:
88
88
 
89
89
  This demo includes broader ChatBot features, including:
90
90
 
91
- 1. A [`<ChatbotToggle>`](/patternfly-ai/chatbot/ui#toggle) that controls the [`<Chatbot>`](/patternfly-ai/chatbot/ui#container) container.
92
- 2. A `<ChatbotContent>` and [`<MessageBox>`](/patternfly-ai/chatbot/ui#content-and-message-box) with:
91
+ 1. A [`<ChatbotToggle>`](/extensions/chatbot/ui#toggle) that controls the [`<Chatbot>`](/extensions/chatbot/ui#container) container.
92
+ 2. A `<ChatbotContent>` and [`<MessageBox>`](/extensions/chatbot/ui#content-and-message-box) with:
93
93
  - A `<ChatbotWelcomePrompt>`
94
94
  - An initial user message and initial bot message
95
- 3. A [`<ChatbotFooter>`](/patternfly-ai/chatbot/ui#footer) with a [`<ChatbotFootnote>`](/patternfly-ai/chatbot/ui#footnote-with-popover) and a `<MessageBar>`
95
+ 3. A [`<ChatbotFooter>`](/extensions/chatbot/ui#footer) with a [`<ChatbotFootnote>`](/extensions/chatbot/ui#footnote-with-popover) and a `<MessageBar>`
96
96
 
97
97
  ```js file="./ChatbotScrolling.tsx" isFullscreen
98
98
 
@@ -102,24 +102,24 @@ This demo includes broader ChatBot features, including:
102
102
 
103
103
  This demo displays unique attachment features, including:
104
104
 
105
- 1. [`<ChatbotContent>` and `<MessageBox>`](/patternfly-ai/chatbot/ui#content-and-message-box) components that contain:
106
- - An initial [user `<Message>`](/patternfly-ai/chatbot/messages#user-messages) with an attachment.
107
- - The ability to preview or edit the attachment using the [`<PreviewAttachment>` and `<AttachmentEdit>` components.](/patternfly-ai/chatbot/messages##file-attachments)
105
+ 1. [`<ChatbotContent>` and `<MessageBox>`](/extensions/chatbot/ui#content-and-message-box) components that contain:
106
+ - An initial [user `<Message>`](/extensions/chatbot/messages#user-messages) with an attachment.
107
+ - The ability to preview or edit the attachment using the [`<PreviewAttachment>` and `<AttachmentEdit>` components.](/extensions/chatbot/messages##file-attachments)
108
108
  - A [PatternFly `<Alert>`](/components/alert), customized to be sticky within the ChatBot window, which provides success or error messages for attachments.
109
109
  2. `<ChatbotContent>` and `<ChatbotFooter>`, wrapped in a `<FileDropZone>` component to support drag and drop attachments. The footer also:
110
- - Displays attached files, using a [`<FileDetailsLabel>`](/patternfly-ai/chatbot/messages#attachment-label) component.
110
+ - Displays attached files, using a [`<FileDetailsLabel>`](/extensions/chatbot/messages#attachment-label) component.
111
111
  - Demonstrates custom handling of file uploads, using the `handleAttach` in `<MessageBar>` and `handleFileDrop` in `<FileDropZone>`.
112
112
 
113
113
  This demo includes broader ChatBot features, including:
114
114
 
115
- 1. A [`<ChatbotToggle>`](/patternfly-ai/chatbot/ui#toggle) that controls the [`<Chatbot>`](/patternfly-ai/chatbot/ui#container) container.
116
- 2. A [`<ChatbotHeader>`](/patternfly-ai/chatbot/ui#header) that updates based on the display mode, with sub-components (including a `<ChatbotHeaderTitle>`).
115
+ 1. A [`<ChatbotToggle>`](/extensions/chatbot/ui#toggle) that controls the [`<Chatbot>`](/extensions/chatbot/ui#container) container.
116
+ 2. A [`<ChatbotHeader>`](/extensions/chatbot/ui#header) that updates based on the display mode, with sub-components (including a `<ChatbotHeaderTitle>`).
117
117
  3. The ability to swap display modes via the `<ChatbotHeaderOptionsDropdown>`
118
- 4. A `<ChatbotContent>` and [`<MessageBox>`](/patternfly-ai/chatbot/uir#content-and-message-box) with:
118
+ 4. A `<ChatbotContent>` and [`<MessageBox>`](/extensions/chatbot/uir#content-and-message-box) with:
119
119
  - A `<ChatbotWelcomePrompt>`
120
120
  - The ability to preview or edit the attachment.
121
121
  - An initial bot message
122
- 5. A [`<ChatbotFooter>`](/patternfly-ai/chatbot/ui#footer) with a [`<ChatbotFootnote>`](/patternfly-ai/chatbot/ui#footnote-with-popover) and a `<MessageBar>`
122
+ 5. A [`<ChatbotFooter>`](/extensions/chatbot/ui#footer) with a [`<ChatbotFootnote>`](/extensions/chatbot/ui#footnote-with-popover) and a `<MessageBar>`
123
123
 
124
124
  ```js file="./ChatbotAttachment.tsx" isFullscreen
125
125
 
@@ -129,21 +129,21 @@ This demo includes broader ChatBot features, including:
129
129
 
130
130
  This demo displays unique attachment features, including:
131
131
 
132
- 1. [`<ChatbotContent>` and `<MessageBox>`](/patternfly-ai/chatbot/ui#content-and-message-box) components that contain:
132
+ 1. [`<ChatbotContent>` and `<MessageBox>`](/extensions/chatbot/ui#content-and-message-box) components that contain:
133
133
  - A PatternFly [`<Alert>`](/components/alert) to provide success or error messages for attachments.
134
134
  2. `<ChatbotContent>` and `<ChatbotFooter>`, wrapped in a `<FileDropZone>` component to support drag and drop attachments. The footer also:
135
135
 
136
- - Displays attached files, using a [`<FileDetailsLabel>`](/patternfly-ai/chatbot/ui#attachment-label) component.
136
+ - Displays attached files, using a [`<FileDetailsLabel>`](/extensions/chatbot/ui#attachment-label) component.
137
137
  - Demonstrates custom handling of file uploads, using the `handleAttach` in `<MessageBar>` and `handleFileDrop` in `<FileDropZone>`.
138
138
  - Demonstrates how to define the `attachMenuProps` in the `<MessageBar>` to create a menu that allows users to select the source of an item they're attaching.
139
139
 
140
140
  This demo includes broader ChatBot features, including:
141
141
 
142
- 1. A [`<ChatbotToggle>`](/patternfly-ai/chatbot/ui#toggle) that controls the [`<Chatbot>`](/patternfly-ai/chatbot/ui#container) container.
143
- 2. A `<ChatbotContent>` and [`<MessageBox>`](/patternfly-ai/chatbot/ui#content-and-message-box) with:
142
+ 1. A [`<ChatbotToggle>`](/extensions/chatbot/ui#toggle) that controls the [`<Chatbot>`](/extensions/chatbot/ui#container) container.
143
+ 2. A `<ChatbotContent>` and [`<MessageBox>`](/extensions/chatbot/ui#content-and-message-box) with:
144
144
  - A `<ChatbotWelcomePrompt>`
145
145
  - An initial user message and initial bot message
146
- 3. A [`<ChatbotFooter>`](/patternfly-ai/chatbot/ui#footer) with a [`<ChatbotFootnote>`](/patternfly-ai/chatbot/ui#footnote-with-popover) and a `<MessageBar>`
146
+ 3. A [`<ChatbotFooter>`](/extensions/chatbot/ui#footer) with a [`<ChatbotFootnote>`](/extensions/chatbot/ui#footnote-with-popover) and a `<MessageBar>`
147
147
 
148
148
  ```js file="./ChatbotAttachmentMenu.tsx" isFullscreen
149
149
 
@@ -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
@@ -66,24 +66,24 @@ import saveAs from 'file-saver';
66
66
 
67
67
  This demo displays a basic ChatBot, which includes:
68
68
 
69
- 1. The [`<ChatbotToggle>`](/patternfly-ai/chatbot/ui#toggle) that controls the [`<Chatbot>` container.](/patternfly-ai/chatbot/ui#container)
70
- 2. A [`<ChatbotHeader>`](/patternfly-ai/chatbot/ui#header) with all built sub-components laid out, including a `<ChatbotHeaderTitle>` that changes its presentation depending on the display mode.
69
+ 1. The [`<ChatbotToggle>`](/extensions/chatbot/ui#toggle) that controls the [`<Chatbot>` container.](/extensions/chatbot/ui#container)
70
+ 2. A [`<ChatbotHeader>`](/extensions/chatbot/ui#header) with all built sub-components laid out, including a `<ChatbotHeaderTitle>` that changes its presentation depending on the display mode.
71
71
  3. The ability to swap display modes via `<ChatbotHeaderOptionsDropdown>`
72
- 4. [`<ChatbotContent>` and `<MessageBox>`](/patternfly-ai/chatbot/ui#content-and-message-box) with:
72
+ 4. [`<ChatbotContent>` and `<MessageBox>`](/extensions/chatbot/ui#content-and-message-box) with:
73
73
 
74
74
  - A `<ChatbotWelcomePrompt>`
75
- - An initial [user `<Message>`](/patternfly-ai/chatbot/messages#user-messages) and an initial bot message with [message actions.](/patternfly-ai/chatbot/messages#message-actions)
75
+ - An initial [user `<Message>`](/extensions/chatbot/messages#user-messages) and an initial bot message with [message actions.](/extensions/chatbot/messages#message-actions)
76
76
  - Logic for enabling auto-scrolling to the most recent message whenever a new message is sent or received using a `scrollToBottomRef`
77
77
 
78
- 5. A [`<ChatbotFooter>`](/patternfly-ai/chatbot/ui#footer) with a [`<ChatbotFootNote>`](/patternfly-ai/chatbot/ui#footnote-with-popover) and a `<MessageBar>` that contains the abilities of:
78
+ 5. A [`<ChatbotFooter>`](/extensions/chatbot/ui#footer) with a [`<ChatbotFootNote>`](/extensions/chatbot/ui#footnote-with-popover) and a `<MessageBar>` that contains the abilities of:
79
79
 
80
- - [Speech to text.](/patternfly-ai/chatbot/ui#message-bar-with-speech-recognition-and-file-attachment)
80
+ - [Speech to text.](/extensions/chatbot/ui#message-bar-with-speech-recognition-and-file-attachment)
81
81
  - Sending a message to the ChatBot.
82
82
  - Receiving a response from a backend AI tool with a loading message state.
83
83
 
84
- 6. A [`<ChatbotConversationHistoryNav>`](/patternfly-ai/chatbot/ui#navigation) toggled open and closed by the `<ChatbotHeaderMenu`> in the `<ChatbotHeader>`.
84
+ 6. A [`<ChatbotConversationHistoryNav>`](/extensions/chatbot/ui#navigation) toggled open and closed by the `<ChatbotHeaderMenu`> in the `<ChatbotHeader>`.
85
85
 
86
- 7. A "Skip to chatbot" button that allows you to skip to the chatbot content via the [PatternFly skip to content component](/patternfly-ai/chatbot/ui#skip-to-content). To display this button you must tab into the main window.
86
+ 7. A "Skip to chatbot" button that allows you to skip to the chatbot content via the [PatternFly skip to content component](/extensions/chatbot/ui#skip-to-content). To display this button you must tab into the main window.
87
87
 
88
88
  ```js file="./Chatbot.tsx" isFullscreen
89
89
 
@@ -102,17 +102,17 @@ This demo displays a basic compact ChatBot
102
102
  This demo displays an embedded ChatBot. Embedded ChatBots are meant to be placed within a page in your product. This demo includes:
103
103
 
104
104
  1. A [PatternFly page](/components/page) with a sidebar, "Skip to chatbot" button, and masthead. To display the "Skip to chatbot" button you must tab into the main window.
105
- 2. A [`<Chatbot>`](/patternfly-ai/chatbot/ui#container) container.
106
- 3. A [`<ChatbotHeader>`](/patternfly-ai/chatbot/ui#header) with all built sub-components laid out, including a `<ChatbotHeaderTitle>`
107
- 4. [`<ChatbotContent>` and `<MessageBox>`](/patternfly-ai/chatbot/ui#content-and-message-box) with:
105
+ 2. A [`<Chatbot>`](/extensions/chatbot/ui#container) container.
106
+ 3. A [`<ChatbotHeader>`](/extensions/chatbot/ui#header) with all built sub-components laid out, including a `<ChatbotHeaderTitle>`
107
+ 4. [`<ChatbotContent>` and `<MessageBox>`](/extensions/chatbot/ui#content-and-message-box) with:
108
108
  - A `<ChatbotWelcomePrompt>`
109
- - An initial [user `<Message>`](/patternfly-ai/chatbot/messages#user-messages) and an initial bot message with [message actions.](/patternfly-ai/chatbot/messages/#message-actions)
109
+ - An initial [user `<Message>`](/extensions/chatbot/messages#user-messages) and an initial bot message with [message actions.](/extensions/chatbot/messages/#message-actions)
110
110
  - Logic for enabling auto-scrolling to the most recent message whenever a new message is sent or received using a `scrollToBottomRef`
111
- 5. A [`<ChatbotFooter>`](/patternfly-ai/chatbot/ui#footer) with a [`<ChatbotFootNote>`](/patternfly-ai/chatbot/ui#footnote-with-popover) and a `<MessageBar>` that contains the abilities of:
112
- - [Speech to text.](/patternfly-ai/chatbot/ui#message-bar-with-speech-recognition-and-file-attachment)
111
+ 5. A [`<ChatbotFooter>`](/extensions/chatbot/ui#footer) with a [`<ChatbotFootNote>`](/extensions/chatbot/ui#footnote-with-popover) and a `<MessageBar>` that contains the abilities of:
112
+ - [Speech to text.](/extensions/chatbot/ui#message-bar-with-speech-recognition-and-file-attachment)
113
113
  - Sending a message to the ChatBot.
114
114
  - Receiving a response from a backend AI tool with a loading message state.
115
- 6. A [`<ChatbotConversationHistoryNav>`](/patternfly-ai/chatbot/ui#navigation) that can be toggled by the `<ChatbotHeaderMenu`> in the `<ChatbotHeader>`.
115
+ 6. A [`<ChatbotConversationHistoryNav>`](/extensions/chatbot/ui#navigation) that can be toggled by the `<ChatbotHeaderMenu`> in the `<ChatbotHeader>`.
116
116
 
117
117
  ```js file="./EmbeddedChatbot.tsx" isFullscreen
118
118
 
@@ -131,15 +131,23 @@ This demo displays a ChatBot in a static, inline drawer. This demo includes:
131
131
 
132
132
  ```
133
133
 
134
+ ### Primary color background
135
+
136
+ This demo displays an embedded ChatBot with a [primary background color](/design-foundations/colors#background-colors). This example includes the same features as the [Embedded ChatBot demo](/extensions/chatbot/overview/demo/#embedded-chatbot)&mdash;the only differences are that the background color is adjusted via the `isPrimary` prop and some of the sample Messages have changed. You can use the same logic to adjust the background color in any ChatBot layout.
137
+
138
+ ```js file="./WhiteEmbeddedChatbot.tsx" isFullscreen
139
+
140
+ ```
141
+
134
142
  ### Display mode switcher
135
143
 
136
144
  This demo showcases how the ChatBot can be rendered in different display modes to suit various application layouts. It demonstrates how to dynamically change the page structure in response to the user's selection. This demo includes:
137
145
 
138
- 1. The ability to switch between overlay, drawer, and fullscreen modes using the [`<ChatbotHeaderOptionsDropdown>`](/patternfly-ai/chatbot/ui#header-options) in the header.
146
+ 1. The ability to switch between overlay, drawer, and fullscreen modes using the [`<ChatbotHeaderOptionsDropdown>`](/extensions/chatbot/ui#header-options) in the header.
139
147
  2. A conditional page layout that renders the ChatBot for each display mode option:
140
- - **Overlay:** As a floating window on top of the page content.
141
- - **Drawer:** Inside an inline PatternFly `<Drawer>` as a side panel.
142
- - **Fullscreen:** As a top-level component that covers the entire screen for an embedded experience.
148
+ - **Overlay:** As a floating window on top of the page content.
149
+ - **Drawer:** Inside an inline PatternFly `<Drawer>` as a side panel.
150
+ - **Fullscreen:** As a top-level component that covers the entire screen for an embedded experience.
143
151
  3. Logic to show or hide the `<ChatbotToggle>` button, which is only present in the default overlay mode.
144
152
  4. A [basic ChatBot](#basic-chatbot) with a header, welcome prompt, and message bar to populate the different layouts.
145
153
 
@@ -170,7 +178,7 @@ Your code structure should look like this:
170
178
 
171
179
  ### Chat transcripts
172
180
 
173
- This demo illustrates how you could add downloadable transcripts to your ChatBot, which outline conversation details in a Markdown file. This approach allows users to easily share information from a conversation with others.
181
+ This demo illustrates how you could add downloadable transcripts to your ChatBot, which outline conversation details in a Markdown file. This approach allows users to easily share information from a conversation with others.
174
182
 
175
183
  A message transcript includes details from a single chat message. To download a sample message transcript in this demo, click the "Download" action under a bot message.
176
184