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

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 (153) 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 +21 -3
  13. package/dist/cjs/Message/Message.js +11 -8
  14. package/dist/cjs/Message/Message.test.js +161 -2
  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 +229 -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 +21 -3
  57. package/dist/esm/Message/Message.js +11 -8
  58. package/dist/esm/Message/Message.test.js +161 -2
  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/MessageWithMultipleActionGroups.tsx +61 -0
  94. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithPersistedActions.tsx +22 -0
  95. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithQuickResponses.tsx +11 -0
  96. package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +36 -4
  97. package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessage.tsx +1 -0
  98. package/patternfly-docs/content/extensions/chatbot/examples/Messages/UserMessageWithExtraContent.tsx +3 -1
  99. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarIndicatorThinking.tsx +15 -0
  100. package/patternfly-docs/content/extensions/chatbot/examples/UI/CompactOnboarding.tsx +141 -0
  101. package/patternfly-docs/content/extensions/chatbot/examples/UI/Onboarding.tsx +151 -0
  102. package/patternfly-docs/content/extensions/chatbot/examples/UI/RH-Hat-Image.svg +9 -0
  103. package/patternfly-docs/content/extensions/chatbot/examples/UI/Settings.tsx +1 -1
  104. package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +55 -27
  105. package/patternfly-docs/content/extensions/chatbot/examples/demos/AttachmentDemos.md +18 -18
  106. package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.md +29 -21
  107. package/patternfly-docs/content/extensions/chatbot/examples/demos/WhiteEmbeddedChatbot.tsx +451 -0
  108. package/patternfly-docs/patternfly-docs.config.js +2 -1
  109. package/patternfly-docs/patternfly-docs.source.js +1 -1
  110. package/src/AttachMenu/AttachMenu.tsx +26 -11
  111. package/src/Chatbot/Chatbot.scss +23 -1
  112. package/src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.scss +25 -0
  113. package/src/ChatbotFooter/ChatbotFooter.scss +21 -0
  114. package/src/ChatbotFooter/ChatbotFooter.test.tsx +10 -1
  115. package/src/ChatbotFooter/ChatbotFooter.tsx +10 -3
  116. package/src/ChatbotHeader/ChatbotHeader.scss +19 -0
  117. package/src/ChatbotHeader/ChatbotHeaderMenu.tsx +56 -14
  118. package/src/ChatbotModal/ChatbotModal.scss +3 -0
  119. package/src/CodeModal/CodeModal.tsx +72 -23
  120. package/src/DeepThinking/DeepThinking.scss +1 -1
  121. package/src/FileDetailsLabel/FileDetailsLabel.tsx +2 -2
  122. package/src/Message/CodeBlockMessage/CodeBlockMessage.scss +12 -0
  123. package/src/Message/CodeBlockMessage/CodeBlockMessage.tsx +4 -1
  124. package/src/Message/Message.scss +11 -7
  125. package/src/Message/Message.test.tsx +239 -2
  126. package/src/Message/Message.tsx +61 -17
  127. package/src/Message/MessageLoading.scss +7 -0
  128. package/src/Message/MessageLoading.tsx +2 -2
  129. package/src/Message/TableMessage/TableMessage.scss +6 -1
  130. package/src/Message/TableMessage/TableMessage.tsx +6 -2
  131. package/src/Message/TextMessage/TextMessage.scss +10 -0
  132. package/src/Message/TextMessage/TextMessage.tsx +11 -2
  133. package/src/Message/UserFeedback/UserFeedback.scss +2 -1
  134. package/src/MessageBar/AttachButton.test.tsx +4 -0
  135. package/src/MessageBar/AttachButton.tsx +4 -1
  136. package/src/MessageBar/MessageBar.scss +40 -3
  137. package/src/MessageBar/MessageBar.test.tsx +102 -1
  138. package/src/MessageBar/MessageBar.tsx +44 -11
  139. package/src/Onboarding/Onboarding.scss +101 -0
  140. package/src/Onboarding/Onboarding.test.tsx +148 -0
  141. package/src/Onboarding/Onboarding.tsx +126 -0
  142. package/src/Onboarding/index.ts +3 -0
  143. package/src/ResponseActions/ResponseActions.scss +12 -1
  144. package/src/ResponseActions/ResponseActions.test.tsx +111 -12
  145. package/src/ResponseActions/ResponseActions.tsx +38 -10
  146. package/src/ToolCall/ToolCall.scss +1 -1
  147. package/src/ToolResponse/ToolResponse.scss +3 -3
  148. package/src/__mocks__/monaco-editor.ts +19 -0
  149. package/src/__mocks__/rehype-highlight.ts +3 -0
  150. package/src/index.ts +3 -0
  151. package/src/main.scss +1 -0
  152. package/tsconfig.json +1 -1
  153. package/patternfly-docs/content/extensions/chatbot/about-chatbot.md +0 -44
@@ -6,8 +6,8 @@ import { DownloadIcon, InfoCircleIcon, RedoIcon } from '@patternfly/react-icons'
6
6
  import Message from '../Message';
7
7
 
8
8
  const ALL_ACTIONS = [
9
- { type: 'positive', label: 'Good response', clickedLabel: 'Response recorded' },
10
- { type: 'negative', label: 'Bad response', clickedLabel: 'Response recorded' },
9
+ { type: 'positive', label: 'Good response', clickedLabel: 'Good response recorded' },
10
+ { type: 'negative', label: 'Bad response', clickedLabel: 'Bad response recorded' },
11
11
  { type: 'copy', label: 'Copy', clickedLabel: 'Copied' },
12
12
  { type: 'edit', label: 'Edit', clickedLabel: 'Editing' },
13
13
  { type: 'share', label: 'Share', clickedLabel: 'Shared' },
@@ -81,7 +81,7 @@ describe('ResponseActions', () => {
81
81
  expect(button).toBeTruthy();
82
82
  });
83
83
  await userEvent.click(goodBtn);
84
- expect(screen.getByRole('button', { name: 'Response recorded' })).toHaveClass(
84
+ expect(screen.getByRole('button', { name: 'Good response recorded' })).toHaveClass(
85
85
  'pf-chatbot__button--response-action-clicked'
86
86
  );
87
87
  let unclickedButtons = buttons.filter((button) => button !== goodBtn);
@@ -89,7 +89,7 @@ describe('ResponseActions', () => {
89
89
  expect(button).not.toHaveClass('pf-chatbot__button--response-action-clicked');
90
90
  });
91
91
  await userEvent.click(badBtn);
92
- expect(screen.getByRole('button', { name: 'Response recorded' })).toHaveClass(
92
+ expect(screen.getByRole('button', { name: 'Bad response recorded' })).toHaveClass(
93
93
  'pf-chatbot__button--response-action-clicked'
94
94
  );
95
95
  unclickedButtons = buttons.filter((button) => button !== badBtn);
@@ -117,13 +117,13 @@ describe('ResponseActions', () => {
117
117
  expect(badBtn).toBeTruthy();
118
118
 
119
119
  await userEvent.click(goodBtn);
120
- expect(screen.getByRole('button', { name: 'Response recorded' })).toHaveClass(
120
+ expect(screen.getByRole('button', { name: 'Good response recorded' })).toHaveClass(
121
121
  'pf-chatbot__button--response-action-clicked'
122
122
  );
123
123
  expect(badBtn).not.toHaveClass('pf-chatbot__button--response-action-clicked');
124
124
 
125
125
  await userEvent.click(badBtn);
126
- expect(screen.getByRole('button', { name: 'Response recorded' })).toHaveClass(
126
+ expect(screen.getByRole('button', { name: 'Bad response recorded' })).toHaveClass(
127
127
  'pf-chatbot__button--response-action-clicked'
128
128
  );
129
129
  expect(goodBtn).not.toHaveClass('pf-chatbot__button--response-action-clicked');
@@ -238,30 +238,30 @@ describe('ResponseActions', () => {
238
238
  });
239
239
 
240
240
  it('should be able to call onClick correctly', async () => {
241
- ALL_ACTIONS.forEach(async ({ type, label }) => {
241
+ for (const { type, label } of ALL_ACTIONS) {
242
242
  const spy = jest.fn();
243
243
  render(<ResponseActions actions={{ [type]: { onClick: spy } }} />);
244
244
  await userEvent.click(screen.getByRole('button', { name: label }));
245
245
  expect(spy).toHaveBeenCalledTimes(1);
246
- });
246
+ }
247
247
  });
248
248
 
249
249
  it('should swap clicked and non-clicked aria labels on click', async () => {
250
- ALL_ACTIONS.forEach(async ({ type, label, clickedLabel }) => {
250
+ for (const { type, label, clickedLabel } of ALL_ACTIONS) {
251
251
  render(<ResponseActions actions={{ [type]: { onClick: jest.fn() } }} />);
252
252
  expect(screen.getByRole('button', { name: label })).toBeTruthy();
253
253
  await userEvent.click(screen.getByRole('button', { name: label }));
254
254
  expect(screen.getByRole('button', { name: clickedLabel })).toBeTruthy();
255
- });
255
+ }
256
256
  });
257
257
 
258
258
  it('should swap clicked and non-clicked tooltips on click', async () => {
259
- ALL_ACTIONS.forEach(async ({ type, label, clickedLabel }) => {
259
+ for (const { type, label, clickedLabel } of ALL_ACTIONS) {
260
260
  render(<ResponseActions actions={{ [type]: { onClick: jest.fn() } }} />);
261
261
  expect(screen.getByRole('button', { name: label })).toBeTruthy();
262
262
  await userEvent.click(screen.getByRole('button', { name: label }));
263
263
  expect(screen.getByRole('tooltip', { name: clickedLabel })).toBeTruthy();
264
- });
264
+ }
265
265
  });
266
266
 
267
267
  it('should be able to change aria labels', () => {
@@ -322,4 +322,103 @@ describe('ResponseActions', () => {
322
322
  expect(screen.getByTestId(action[key])).toBeTruthy();
323
323
  });
324
324
  });
325
+
326
+ // we are testing for the reverse case already above
327
+ it('should not deselect when clicking outside when persistActionSelection is true', async () => {
328
+ render(
329
+ <Message
330
+ name="Bot"
331
+ role="bot"
332
+ avatar=""
333
+ content="Test content"
334
+ actions={{
335
+ positive: {},
336
+ negative: {}
337
+ }}
338
+ persistActionSelection
339
+ />
340
+ );
341
+ const goodBtn = screen.getByRole('button', { name: 'Good response' });
342
+
343
+ await userEvent.click(goodBtn);
344
+ expect(screen.getByRole('button', { name: 'Good response recorded' })).toHaveClass(
345
+ 'pf-chatbot__button--response-action-clicked'
346
+ );
347
+
348
+ await userEvent.click(screen.getByText('Test content'));
349
+
350
+ expect(screen.getByRole('button', { name: 'Good response recorded' })).toHaveClass(
351
+ 'pf-chatbot__button--response-action-clicked'
352
+ );
353
+ });
354
+
355
+ it('should switch selection to another button when persistActionSelection is true', async () => {
356
+ render(
357
+ <Message
358
+ name="Bot"
359
+ role="bot"
360
+ avatar=""
361
+ content="Test content"
362
+ actions={{
363
+ positive: {},
364
+ negative: {}
365
+ }}
366
+ persistActionSelection
367
+ />
368
+ );
369
+ const goodBtn = screen.getByRole('button', { name: 'Good response' });
370
+ const badBtn = screen.getByRole('button', { name: 'Bad response' });
371
+
372
+ await userEvent.click(goodBtn);
373
+ expect(goodBtn).toHaveClass('pf-chatbot__button--response-action-clicked');
374
+
375
+ await userEvent.click(badBtn);
376
+ expect(badBtn).toHaveClass('pf-chatbot__button--response-action-clicked');
377
+ expect(goodBtn).not.toHaveClass('pf-chatbot__button--response-action-clicked');
378
+ });
379
+
380
+ it('should toggle off when clicking the same button when persistActionSelection is true', async () => {
381
+ render(
382
+ <Message
383
+ name="Bot"
384
+ role="bot"
385
+ avatar=""
386
+ content="Test content"
387
+ actions={{
388
+ positive: {},
389
+ negative: {}
390
+ }}
391
+ persistActionSelection
392
+ />
393
+ );
394
+ const goodBtn = screen.getByRole('button', { name: 'Good response' });
395
+
396
+ await userEvent.click(goodBtn);
397
+ expect(goodBtn).toHaveClass('pf-chatbot__button--response-action-clicked');
398
+
399
+ await userEvent.click(goodBtn);
400
+ expect(goodBtn).not.toHaveClass('pf-chatbot__button--response-action-clicked');
401
+ });
402
+
403
+ it('should work with custom actions when persistActionSelection is true', async () => {
404
+ const actions = {
405
+ positive: { 'data-testid': 'positive', onClick: jest.fn() },
406
+ negative: { 'data-testid': 'negative', onClick: jest.fn() },
407
+ custom: {
408
+ 'data-testid': 'custom',
409
+ onClick: jest.fn(),
410
+ ariaLabel: 'Custom',
411
+ tooltipContent: 'Custom action',
412
+ icon: <DownloadIcon />
413
+ }
414
+ };
415
+ render(<ResponseActions actions={actions} persistActionSelection />);
416
+
417
+ const customBtn = screen.getByTestId('custom');
418
+ await userEvent.click(customBtn);
419
+ expect(customBtn).toHaveClass('pf-chatbot__button--response-action-clicked');
420
+
421
+ await userEvent.click(customBtn);
422
+ expect(customBtn).not.toHaveClass('pf-chatbot__button--response-action-clicked');
423
+ });
325
424
  });
@@ -53,11 +53,20 @@ export interface ResponseActionProps {
53
53
  listen?: ActionProps;
54
54
  edit?: ActionProps;
55
55
  };
56
+ /** When true, the selected action will persist even when clicking outside the component.
57
+ * When false (default), clicking outside or clicking another action will deselect the current selection. */
58
+ persistActionSelection?: boolean;
56
59
  }
57
60
 
58
- export const ResponseActions: FunctionComponent<ResponseActionProps> = ({ actions }) => {
61
+ export const ResponseActions: FunctionComponent<ResponseActionProps> = ({
62
+ actions,
63
+ persistActionSelection = false
64
+ }) => {
59
65
  const [activeButton, setActiveButton] = useState<string>();
60
66
  const [clickStatePersisted, setClickStatePersisted] = useState<boolean>(false);
67
+
68
+ const { positive, negative, copy, edit, share, download, listen, ...additionalActions } = actions;
69
+
61
70
  useEffect(() => {
62
71
  // Define the order of precedence for checking initial `isClicked`
63
72
  const actionPrecedence = ['positive', 'negative', 'copy', 'edit', 'share', 'download', 'listen'];
@@ -82,13 +91,21 @@ export const ResponseActions: FunctionComponent<ResponseActionProps> = ({ action
82
91
  // Click state is explicitly controlled by consumer.
83
92
  setClickStatePersisted(true);
84
93
  }
94
+ // If persistActionSelection is true, all selections are persisted
95
+ if (persistActionSelection) {
96
+ setClickStatePersisted(true);
97
+ }
85
98
  setActiveButton(initialActive);
86
- }, [actions]);
99
+ }, [actions, persistActionSelection]);
87
100
 
88
- const { positive, negative, copy, edit, share, download, listen, ...additionalActions } = actions;
89
101
  const responseActions = useRef<HTMLDivElement>(null);
90
102
 
91
103
  useEffect(() => {
104
+ // Only add click outside listener if not persisting selection
105
+ if (persistActionSelection) {
106
+ return;
107
+ }
108
+
92
109
  const handleClickOutside = (e) => {
93
110
  if (responseActions.current && !responseActions.current.contains(e.target) && !clickStatePersisted) {
94
111
  setActiveButton(undefined);
@@ -99,15 +116,26 @@ export const ResponseActions: FunctionComponent<ResponseActionProps> = ({ action
99
116
  return () => {
100
117
  window.removeEventListener('click', handleClickOutside);
101
118
  };
102
- }, [clickStatePersisted]);
119
+ }, [clickStatePersisted, persistActionSelection]);
103
120
 
104
121
  const handleClick = (
105
122
  e: MouseEvent | MouseEvent<Element, MouseEvent> | KeyboardEvent,
106
123
  id: string,
107
124
  onClick?: (event: MouseEvent | MouseEvent<Element, MouseEvent> | KeyboardEvent) => void
108
125
  ) => {
109
- setClickStatePersisted(false);
110
- setActiveButton(id);
126
+ if (persistActionSelection) {
127
+ if (activeButton === id) {
128
+ // Toggle off if clicking the same button
129
+ setActiveButton(undefined);
130
+ } else {
131
+ // Set new active button
132
+ setActiveButton(id);
133
+ }
134
+ setClickStatePersisted(true);
135
+ } else {
136
+ setClickStatePersisted(false);
137
+ setActiveButton(id);
138
+ }
111
139
  onClick && onClick(e);
112
140
  };
113
141
 
@@ -117,12 +145,12 @@ export const ResponseActions: FunctionComponent<ResponseActionProps> = ({ action
117
145
  <ResponseActionButton
118
146
  {...positive}
119
147
  ariaLabel={positive.ariaLabel ?? 'Good response'}
120
- clickedAriaLabel={positive.ariaLabel ?? 'Response recorded'}
148
+ clickedAriaLabel={positive.ariaLabel ?? 'Good response recorded'}
121
149
  onClick={(e) => handleClick(e, 'positive', positive.onClick)}
122
150
  className={positive.className}
123
151
  isDisabled={positive.isDisabled}
124
152
  tooltipContent={positive.tooltipContent ?? 'Good response'}
125
- clickedTooltipContent={positive.clickedTooltipContent ?? 'Response recorded'}
153
+ clickedTooltipContent={positive.clickedTooltipContent ?? 'Good response recorded'}
126
154
  tooltipProps={positive.tooltipProps}
127
155
  icon={<OutlinedThumbsUpIcon />}
128
156
  isClicked={activeButton === 'positive'}
@@ -135,12 +163,12 @@ export const ResponseActions: FunctionComponent<ResponseActionProps> = ({ action
135
163
  <ResponseActionButton
136
164
  {...negative}
137
165
  ariaLabel={negative.ariaLabel ?? 'Bad response'}
138
- clickedAriaLabel={negative.ariaLabel ?? 'Response recorded'}
166
+ clickedAriaLabel={negative.ariaLabel ?? 'Bad response recorded'}
139
167
  onClick={(e) => handleClick(e, 'negative', negative.onClick)}
140
168
  className={negative.className}
141
169
  isDisabled={negative.isDisabled}
142
170
  tooltipContent={negative.tooltipContent ?? 'Bad response'}
143
- clickedTooltipContent={negative.clickedTooltipContent ?? 'Response recorded'}
171
+ clickedTooltipContent={negative.clickedTooltipContent ?? 'Bad response recorded'}
144
172
  tooltipProps={negative.tooltipProps}
145
173
  icon={<OutlinedThumbsDownIcon />}
146
174
  isClicked={activeButton === 'negative'}
@@ -1,6 +1,6 @@
1
1
  .pf-chatbot__tool-call {
2
- --pf-v6-c-card--BorderColor: var(--pf-t--global--border--color--control--read-only);
3
2
  --pf-v6-c-card--BorderRadius: var(--pf-t--global--border--radius--small);
3
+ --pf-v6-c-card--BorderColor: var(--pf-t--global--border--color--default);
4
4
 
5
5
  overflow: unset;
6
6
  row-gap: var(--pf-t--global--spacer--sm);
@@ -1,5 +1,5 @@
1
1
  .pf-chatbot__tool-response {
2
- --pf-v6-c-card--BorderColor: var(--pf-t--global--border--color--control--read-only);
2
+ --pf-v6-c-card--BorderColor: var(--pf-t--global--border--color--default);
3
3
  overflow: unset;
4
4
  }
5
5
 
@@ -25,12 +25,12 @@
25
25
  }
26
26
 
27
27
  .pf-chatbot__tool-response-card {
28
- --pf-v6-c-card--BorderColor: var(--pf-t--global--border--color--control--read-only);
28
+ --pf-v6-c-card--BorderColor: var(--pf-t--global--border--color--default);
29
29
  --pf-v6-c-card--first-child--PaddingBlockStart: var(--pf-t--global--spacer--sm);
30
30
  --pf-v6-c-card__title--not--last-child--PaddingBlockEnd: var(--pf-t--global--spacer--sm);
31
31
  --pf-v6-c-card--c-divider--child--PaddingBlockStart: var(--pf-t--global--spacer--sm);
32
32
 
33
33
  .pf-v6-c-divider {
34
- --pf-v6-c-divider--Color: var(--pf-t--global--border--color--control--read-only);
34
+ --pf-v6-c-divider--Color: var(--pf-t--global--border--color--default);
35
35
  }
36
36
  }
@@ -0,0 +1,19 @@
1
+ const mockEditor = {
2
+ layout: jest.fn(),
3
+ focus: jest.fn(),
4
+ dispose: jest.fn(),
5
+ getModel: jest.fn(),
6
+ updateOptions: jest.fn()
7
+ };
8
+
9
+ const mockModel = {
10
+ updateOptions: jest.fn(),
11
+ dispose: jest.fn()
12
+ };
13
+
14
+ module.exports = {
15
+ editor: {
16
+ create: jest.fn(() => mockEditor),
17
+ getModels: jest.fn(() => [mockModel])
18
+ }
19
+ };
@@ -0,0 +1,3 @@
1
+ const rehypeHighlight = () => (tree) => tree;
2
+
3
+ export default rehypeHighlight;
package/src/index.ts CHANGED
@@ -75,6 +75,9 @@ export * from './MessageBox';
75
75
  export { default as MessageDivider } from './MessageDivider';
76
76
  export * from './MessageDivider';
77
77
 
78
+ export { default as Onboarding } from './Onboarding';
79
+ export * from './Onboarding';
80
+
78
81
  export { default as PreviewAttachment } from './PreviewAttachment';
79
82
  export * from './PreviewAttachment';
80
83
 
package/src/main.scss CHANGED
@@ -31,6 +31,7 @@
31
31
  @import './MessageBox/MessageBox';
32
32
  @import './MessageDivider/MessageDivider';
33
33
  @import './MessageBox/JumpButton';
34
+ @import './Onboarding/Onboarding';
34
35
  @import './ResponseActions/ResponseActions';
35
36
  @import './Settings/Settings';
36
37
  @import './SourcesCard/SourcesCard.scss';
package/tsconfig.json CHANGED
@@ -5,7 +5,7 @@
5
5
  /* Basic Options */
6
6
  // "incremental": true, /* Enable incremental compilation */
7
7
  "target": "es2015" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */,
8
- "module": "es2015" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
8
+ "module": "es2020" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', 'es2020', or 'ESNext'. */,
9
9
  // "lib": [], /* Specify library files to be included in the compilation. */
10
10
  // "allowJs": true, /* Allow javascript files to be compiled. */
11
11
  // "checkJs": true, /* Report errors in .js files. */
@@ -1,44 +0,0 @@
1
- ---
2
- section: PatternFly-AI
3
- subsection: ChatBot
4
- id: Overview
5
- sortValue: 1
6
- source: About
7
- ---
8
-
9
- **Note:** The PatternFly ChatBot extension lives in its own package [`@patternfly/chatbot`](https://www.npmjs.com/package/@patternfly/chatbot)
10
-
11
- It is important to leverage AI in a way that improves the experiences of your users. In alignment with our [AI principles](/patternfly-ai/about-ai#ai-principles) and [ethical design guidelines,](/patternfly-ai/ai-guidelines) we've created this ChatBot extension. The PatternFly ChatBot contains a React implementation of an AI ChatBot, to provide your users with access to convenient and persistent help.
12
-
13
- _Only use this ChatBot when it adds value to your users' experiences._ Don't use it simply for the sake of novelty&mdash;your users will only be excited to interact with a new ChatBot feature if it directly helps them reach their goals.
14
-
15
- ## ChatBot demos
16
-
17
- To illustrate the capabilities of the ChatBot, including more complex interaction patterns, we've created these demos:
18
- - [Basic ChatBot](/patternfly-ai/chatbot/overview/demo#basic-chatbot)
19
- - [Embedded ChatBot](/patternfly-ai/chatbot/overview/demo#embedded-chatbot)
20
- - [Comparing ChatBots](/patternfly-ai/chatbot/overview/demo/#comparing-chatbots)
21
- - [Message feedback](/patternfly-ai/chatbot/messages/demo#message-feedback)
22
- - [ChatBot attachments via file upload](/patternfly-ai/chatbot/messages/demo#attach-via-upload-button-in-message-bar)
23
- - [ChatBot attachments via built-in menu](/patternfly-ai/chatbot/messages/demo#attach-via-menu-of-options-in-message-bar)
24
-
25
- To learn how to write for ChatBot experiences, refer to our [conversation design guidelines](/patternfly-ai/conversation-design/#writing-for-chatbots).
26
-
27
- To learn how to design ChatBot experiences, [refer to the design guidelines](/patternfly-ai/chatbot/overview/design-guidelines).
28
-
29
- Explore our documentation, which covers both ChatBot UI components and message-related components:
30
- - UI
31
- - [Structural elements](/patternfly-ai/chatbot/ui#structure)
32
- - [Toggle](/patternfly-ai/chatbot/ui#toggle)
33
- - [Header](/patternfly-ai/chatbot/ui#header)
34
- - [Footer](/patternfly-ai/chatbot/ui#footer)
35
- - [Navigation](/patternfly-ai/chatbot/ui#navigation)
36
- - [Modals](/patternfly-ai/chatbot/ui#modals)
37
- - Messages
38
- - [Bot and user messages](/patternfly-ai/chatbot/messages)
39
- - [File attachments](/patternfly-ai/chatbot/messages#attachments)
40
- - Analytics support
41
- - [Overview](/patternfly-ai/chatbot/analytics)
42
-
43
-
44
- We will continue to grow and evolve our ChatBot. If you notice a bug or have any suggestions, feel free to file an issue in our [GitHub repository!](https://github.com/patternfly/chatbot/issues) Make sure to check if there is already a pre-existing issue before creating a new one.