@patternfly/chatbot 6.5.0-prerelease.27 → 6.5.0-prerelease.29

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 (151) hide show
  1. package/dist/cjs/MarkdownContent/MarkdownContent.d.ts +7 -2
  2. package/dist/cjs/Message/ErrorMessage/ErrorMessage.d.ts +15 -1
  3. package/dist/cjs/Message/ErrorMessage/ErrorMessage.js +5 -3
  4. package/dist/cjs/Message/ErrorMessage/ErrorMessage.test.d.ts +1 -0
  5. package/dist/cjs/Message/ErrorMessage/ErrorMessage.test.js +30 -0
  6. package/dist/cjs/Message/Message.d.ts +2 -0
  7. package/dist/cjs/Message/Message.js +5 -5
  8. package/dist/cjs/Message/MessageAndActions/MessageAndActions.d.ts +14 -0
  9. package/dist/cjs/Message/MessageAndActions/MessageAndActions.js +22 -0
  10. package/dist/cjs/Message/MessageAndActions/MessageAndActions.test.d.ts +1 -0
  11. package/dist/cjs/Message/MessageAndActions/MessageAndActions.test.js +25 -0
  12. package/dist/cjs/Message/MessageAndActions/index.d.ts +1 -0
  13. package/dist/cjs/Message/MessageAndActions/index.js +17 -0
  14. package/dist/cjs/Message/MessageAttachments/MessageAttachmentItem.d.ts +13 -0
  15. package/dist/cjs/Message/MessageAttachments/MessageAttachmentItem.js +22 -0
  16. package/dist/cjs/Message/MessageAttachments/MessageAttachmentItem.test.d.ts +1 -0
  17. package/dist/cjs/Message/MessageAttachments/MessageAttachmentItem.test.js +25 -0
  18. package/dist/cjs/Message/MessageAttachments/MessageAttachmentsContainer.d.ts +13 -0
  19. package/dist/cjs/Message/MessageAttachments/MessageAttachmentsContainer.js +22 -0
  20. package/dist/cjs/Message/MessageAttachments/MessageAttachmentsContainer.test.d.ts +1 -0
  21. package/dist/cjs/Message/MessageAttachments/MessageAttachmentsContainer.test.js +25 -0
  22. package/dist/cjs/Message/MessageAttachments/index.d.ts +2 -0
  23. package/dist/cjs/Message/MessageAttachments/index.js +18 -0
  24. package/dist/cjs/Message/MessageInput.d.ts +1 -1
  25. package/dist/cjs/Message/MessageInput.js +3 -1
  26. package/dist/cjs/Message/MessageLoading.d.ts +13 -4
  27. package/dist/cjs/Message/MessageLoading.js +19 -5
  28. package/dist/cjs/Message/MessageLoading.test.d.ts +1 -0
  29. package/dist/cjs/Message/MessageLoading.test.js +25 -0
  30. package/dist/cjs/Message/QuickResponse/QuickResponse.js +3 -2
  31. package/dist/cjs/Message/QuickResponse/QuickResponse.test.d.ts +1 -0
  32. package/dist/cjs/Message/QuickResponse/QuickResponse.test.js +109 -0
  33. package/dist/cjs/Message/QuickResponse/index.d.ts +1 -0
  34. package/dist/cjs/Message/QuickResponse/index.js +17 -0
  35. package/dist/cjs/Message/QuickStarts/QuickStartTile.d.ts +1 -1
  36. package/dist/cjs/Message/QuickStarts/QuickStartTile.js +3 -2
  37. package/dist/cjs/Message/QuickStarts/index.d.ts +2 -0
  38. package/dist/cjs/Message/QuickStarts/index.js +18 -0
  39. package/dist/cjs/Message/UserFeedback/UserFeedback.d.ts +1 -1
  40. package/dist/cjs/Message/UserFeedback/UserFeedback.js +3 -1
  41. package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.d.ts +1 -1
  42. package/dist/cjs/Message/UserFeedback/UserFeedbackComplete.js +3 -2
  43. package/dist/cjs/Message/UserFeedback/index.d.ts +2 -0
  44. package/dist/cjs/Message/UserFeedback/index.js +18 -0
  45. package/dist/cjs/Message/index.d.ts +8 -0
  46. package/dist/cjs/Message/index.js +8 -0
  47. package/dist/cjs/MessageBar/MessageBar.d.ts +6 -0
  48. package/dist/cjs/MessageBar/MessageBar.js +24 -12
  49. package/dist/cjs/MessageBar/MessageBar.test.js +12 -0
  50. package/dist/cjs/ResponseActions/ResponseActions.d.ts +4 -0
  51. package/dist/cjs/ResponseActions/ResponseActionsGroups.d.ts +13 -0
  52. package/dist/cjs/ResponseActions/ResponseActionsGroups.js +22 -0
  53. package/dist/cjs/ResponseActions/ResponseActionsGroups.test.d.ts +1 -0
  54. package/dist/cjs/ResponseActions/ResponseActionsGroups.test.js +25 -0
  55. package/dist/cjs/ResponseActions/index.d.ts +1 -0
  56. package/dist/cjs/ResponseActions/index.js +1 -0
  57. package/dist/css/main.css +13 -1
  58. package/dist/css/main.css.map +1 -1
  59. package/dist/esm/MarkdownContent/MarkdownContent.d.ts +7 -2
  60. package/dist/esm/Message/ErrorMessage/ErrorMessage.d.ts +15 -1
  61. package/dist/esm/Message/ErrorMessage/ErrorMessage.js +3 -3
  62. package/dist/esm/Message/ErrorMessage/ErrorMessage.test.d.ts +1 -0
  63. package/dist/esm/Message/ErrorMessage/ErrorMessage.test.js +25 -0
  64. package/dist/esm/Message/Message.d.ts +2 -0
  65. package/dist/esm/Message/Message.js +5 -5
  66. package/dist/esm/Message/MessageAndActions/MessageAndActions.d.ts +14 -0
  67. package/dist/esm/Message/MessageAndActions/MessageAndActions.js +18 -0
  68. package/dist/esm/Message/MessageAndActions/MessageAndActions.test.d.ts +1 -0
  69. package/dist/esm/Message/MessageAndActions/MessageAndActions.test.js +20 -0
  70. package/dist/esm/Message/MessageAndActions/index.d.ts +1 -0
  71. package/dist/esm/Message/MessageAndActions/index.js +1 -0
  72. package/dist/esm/Message/MessageAttachments/MessageAttachmentItem.d.ts +13 -0
  73. package/dist/esm/Message/MessageAttachments/MessageAttachmentItem.js +18 -0
  74. package/dist/esm/Message/MessageAttachments/MessageAttachmentItem.test.d.ts +1 -0
  75. package/dist/esm/Message/MessageAttachments/MessageAttachmentItem.test.js +20 -0
  76. package/dist/esm/Message/MessageAttachments/MessageAttachmentsContainer.d.ts +13 -0
  77. package/dist/esm/Message/MessageAttachments/MessageAttachmentsContainer.js +18 -0
  78. package/dist/esm/Message/MessageAttachments/MessageAttachmentsContainer.test.d.ts +1 -0
  79. package/dist/esm/Message/MessageAttachments/MessageAttachmentsContainer.test.js +20 -0
  80. package/dist/esm/Message/MessageAttachments/index.d.ts +2 -0
  81. package/dist/esm/Message/MessageAttachments/index.js +2 -0
  82. package/dist/esm/Message/MessageInput.d.ts +1 -1
  83. package/dist/esm/Message/MessageInput.js +1 -1
  84. package/dist/esm/Message/MessageLoading.d.ts +13 -4
  85. package/dist/esm/Message/MessageLoading.js +16 -4
  86. package/dist/esm/Message/MessageLoading.test.d.ts +1 -0
  87. package/dist/esm/Message/MessageLoading.test.js +20 -0
  88. package/dist/esm/Message/QuickResponse/QuickResponse.js +3 -2
  89. package/dist/esm/Message/QuickResponse/QuickResponse.test.d.ts +1 -0
  90. package/dist/esm/Message/QuickResponse/QuickResponse.test.js +104 -0
  91. package/dist/esm/Message/QuickResponse/index.d.ts +1 -0
  92. package/dist/esm/Message/QuickResponse/index.js +1 -0
  93. package/dist/esm/Message/QuickStarts/QuickStartTile.d.ts +1 -1
  94. package/dist/esm/Message/QuickStarts/QuickStartTile.js +1 -1
  95. package/dist/esm/Message/QuickStarts/index.d.ts +2 -0
  96. package/dist/esm/Message/QuickStarts/index.js +2 -0
  97. package/dist/esm/Message/UserFeedback/UserFeedback.d.ts +1 -1
  98. package/dist/esm/Message/UserFeedback/UserFeedback.js +1 -1
  99. package/dist/esm/Message/UserFeedback/UserFeedbackComplete.d.ts +1 -1
  100. package/dist/esm/Message/UserFeedback/UserFeedbackComplete.js +1 -2
  101. package/dist/esm/Message/UserFeedback/index.d.ts +2 -0
  102. package/dist/esm/Message/UserFeedback/index.js +2 -0
  103. package/dist/esm/Message/index.d.ts +8 -0
  104. package/dist/esm/Message/index.js +8 -0
  105. package/dist/esm/MessageBar/MessageBar.d.ts +6 -0
  106. package/dist/esm/MessageBar/MessageBar.js +24 -12
  107. package/dist/esm/MessageBar/MessageBar.test.js +12 -0
  108. package/dist/esm/ResponseActions/ResponseActions.d.ts +4 -0
  109. package/dist/esm/ResponseActions/ResponseActionsGroups.d.ts +13 -0
  110. package/dist/esm/ResponseActions/ResponseActionsGroups.js +18 -0
  111. package/dist/esm/ResponseActions/ResponseActionsGroups.test.d.ts +1 -0
  112. package/dist/esm/ResponseActions/ResponseActionsGroups.test.js +20 -0
  113. package/dist/esm/ResponseActions/index.d.ts +1 -0
  114. package/dist/esm/ResponseActions/index.js +1 -0
  115. package/dist/tsconfig.tsbuildinfo +1 -1
  116. package/package.json +1 -1
  117. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithCustomStructure.tsx +102 -0
  118. package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +55 -10
  119. package/patternfly-docs/content/extensions/chatbot/examples/UI/ChatbotMessageBarCustomActions.tsx +190 -0
  120. package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +15 -2
  121. package/src/MarkdownContent/MarkdownContent.tsx +7 -2
  122. package/src/Message/ErrorMessage/ErrorMessage.test.tsx +38 -0
  123. package/src/Message/ErrorMessage/ErrorMessage.tsx +17 -2
  124. package/src/Message/Message.tsx +75 -64
  125. package/src/Message/MessageAndActions/MessageAndActions.test.tsx +23 -0
  126. package/src/Message/MessageAndActions/MessageAndActions.tsx +22 -0
  127. package/src/Message/MessageAndActions/index.ts +1 -0
  128. package/src/Message/MessageAttachments/MessageAttachmentItem.test.tsx +23 -0
  129. package/src/Message/MessageAttachments/MessageAttachmentItem.tsx +25 -0
  130. package/src/Message/MessageAttachments/MessageAttachmentsContainer.test.tsx +23 -0
  131. package/src/Message/MessageAttachments/MessageAttachmentsContainer.tsx +25 -0
  132. package/src/Message/MessageAttachments/index.ts +2 -0
  133. package/src/Message/MessageInput.tsx +1 -1
  134. package/src/Message/MessageLoading.test.tsx +23 -0
  135. package/src/Message/MessageLoading.tsx +17 -2
  136. package/src/Message/QuickResponse/QuickResponse.test.tsx +131 -0
  137. package/src/Message/QuickResponse/QuickResponse.tsx +3 -2
  138. package/src/Message/QuickResponse/index.ts +1 -0
  139. package/src/Message/QuickStarts/QuickStartTile.tsx +1 -1
  140. package/src/Message/QuickStarts/index.ts +2 -0
  141. package/src/Message/UserFeedback/UserFeedback.tsx +1 -1
  142. package/src/Message/UserFeedback/UserFeedbackComplete.tsx +1 -4
  143. package/src/Message/UserFeedback/index.ts +2 -0
  144. package/src/Message/index.ts +8 -0
  145. package/src/MessageBar/MessageBar.scss +15 -1
  146. package/src/MessageBar/MessageBar.test.tsx +27 -0
  147. package/src/MessageBar/MessageBar.tsx +86 -50
  148. package/src/ResponseActions/ResponseActions.tsx +6 -0
  149. package/src/ResponseActions/ResponseActionsGroups.test.tsx +23 -0
  150. package/src/ResponseActions/ResponseActionsGroups.tsx +28 -0
  151. package/src/ResponseActions/index.ts +1 -0
@@ -0,0 +1,23 @@
1
+ import '@testing-library/jest-dom';
2
+ import { render, screen } from '@testing-library/react';
3
+ import MessageAndActions from './MessageAndActions';
4
+
5
+ test('Renders with children', () => {
6
+ render(<MessageAndActions>Test content</MessageAndActions>);
7
+ expect(screen.getByText('Test content')).toBeInTheDocument();
8
+ });
9
+
10
+ test('Renders with pf-chatbot__message-and-actions class by default', () => {
11
+ render(<MessageAndActions>Test content</MessageAndActions>);
12
+ expect(screen.getByText('Test content')).toHaveClass('pf-chatbot__message-and-actions', { exact: true });
13
+ });
14
+
15
+ test('Renders with custom className', () => {
16
+ render(<MessageAndActions className="custom-class">Test content</MessageAndActions>);
17
+ expect(screen.getByText('Test content')).toHaveClass('custom-class');
18
+ });
19
+
20
+ test('Spreads additional props', () => {
21
+ render(<MessageAndActions id="test-id">Test content</MessageAndActions>);
22
+ expect(screen.getByText('Test content')).toHaveAttribute('id', 'test-id');
23
+ });
@@ -0,0 +1,22 @@
1
+ import { FunctionComponent, HTMLProps, ReactNode } from 'react';
2
+ import { css } from '@patternfly/react-styles';
3
+
4
+ /**
5
+ * The container that wraps the primary message content and inline actions, such as ToolCall, ToolResponse, DeepThinking, ResponseActions, etc.
6
+ * Attachments should not be rendered inside this container.
7
+ * Use this component when passing children to Message to customize its structure.
8
+ */
9
+ export interface MessageAndActionsProps extends HTMLProps<HTMLDivElement> {
10
+ /** Content to render inside the message and actions container. */
11
+ children: ReactNode;
12
+ /** Additional classes applied to the message and actions container. */
13
+ className?: string;
14
+ }
15
+
16
+ export const MessageAndActions: FunctionComponent<MessageAndActionsProps> = ({ children, className, ...props }) => (
17
+ <div className={css('pf-chatbot__message-and-actions', className)} {...props}>
18
+ {children}
19
+ </div>
20
+ );
21
+
22
+ export default MessageAndActions;
@@ -0,0 +1 @@
1
+ export * from './MessageAndActions';
@@ -0,0 +1,23 @@
1
+ import '@testing-library/jest-dom';
2
+ import { render, screen } from '@testing-library/react';
3
+ import MessageAttachmentItem from './MessageAttachmentItem';
4
+
5
+ test('Renders with children', () => {
6
+ render(<MessageAttachmentItem>Test content</MessageAttachmentItem>);
7
+ expect(screen.getByText('Test content')).toBeInTheDocument();
8
+ });
9
+
10
+ test('Renders with pf-chatbot__message-attachment class by default', () => {
11
+ render(<MessageAttachmentItem>Test content</MessageAttachmentItem>);
12
+ expect(screen.getByText('Test content')).toHaveClass('pf-chatbot__message-attachment', { exact: true });
13
+ });
14
+
15
+ test('Renders with custom className', () => {
16
+ render(<MessageAttachmentItem className="custom-class">Test content</MessageAttachmentItem>);
17
+ expect(screen.getByText('Test content')).toHaveClass('custom-class');
18
+ });
19
+
20
+ test('Spreads additional props', () => {
21
+ render(<MessageAttachmentItem id="test-id">Test content</MessageAttachmentItem>);
22
+ expect(screen.getByText('Test content')).toHaveAttribute('id', 'test-id');
23
+ });
@@ -0,0 +1,25 @@
1
+ import { FunctionComponent, HTMLProps, ReactNode } from 'react';
2
+ import { css } from '@patternfly/react-styles';
3
+
4
+ /**
5
+ * The container for a single message attachment item, typically the FileDetailsLabel component. You must wrap any attachment components in this container.
6
+ * Use this component within MessageAttachmentsContainer when passing children to Message to customize its structure.
7
+ */
8
+ export interface MessageAttachmentItemProps extends HTMLProps<HTMLDivElement> {
9
+ /** Content to render inside a single attachment container */
10
+ children: ReactNode;
11
+ /** Additional classes applied to the attachment container. */
12
+ className?: string;
13
+ }
14
+
15
+ export const MessageAttachmentItem: FunctionComponent<MessageAttachmentItemProps> = ({
16
+ children,
17
+ className,
18
+ ...props
19
+ }) => (
20
+ <div className={css('pf-chatbot__message-attachment', className)} {...props}>
21
+ {children}
22
+ </div>
23
+ );
24
+
25
+ export default MessageAttachmentItem;
@@ -0,0 +1,23 @@
1
+ import '@testing-library/jest-dom';
2
+ import { render, screen } from '@testing-library/react';
3
+ import MessageAttachmentsContainer from './MessageAttachmentsContainer';
4
+
5
+ test('Renders with children', () => {
6
+ render(<MessageAttachmentsContainer>Test content</MessageAttachmentsContainer>);
7
+ expect(screen.getByText('Test content')).toBeInTheDocument();
8
+ });
9
+
10
+ test('Renders with pf-chatbot__message-attachments-container class by default', () => {
11
+ render(<MessageAttachmentsContainer>Test content</MessageAttachmentsContainer>);
12
+ expect(screen.getByText('Test content')).toHaveClass('pf-chatbot__message-attachments-container', { exact: true });
13
+ });
14
+
15
+ test('Renders with custom className', () => {
16
+ render(<MessageAttachmentsContainer className="custom-class">Test content</MessageAttachmentsContainer>);
17
+ expect(screen.getByText('Test content')).toHaveClass('custom-class');
18
+ });
19
+
20
+ test('Spreads additional props', () => {
21
+ render(<MessageAttachmentsContainer id="test-id">Test content</MessageAttachmentsContainer>);
22
+ expect(screen.getByText('Test content')).toHaveAttribute('id', 'test-id');
23
+ });
@@ -0,0 +1,25 @@
1
+ import { FunctionComponent, HTMLProps, ReactNode } from 'react';
2
+ import { css } from '@patternfly/react-styles';
3
+
4
+ /**
5
+ * The container to wrap MessageAttachment components. You must wrap any MessageAttachment components in this container.
6
+ * Use this component when passing children to Message to customize its structure.
7
+ */
8
+ export interface MessageAttachmentsContainerProps extends HTMLProps<HTMLDivElement> {
9
+ /** Content to render inside the attachments container */
10
+ children: ReactNode;
11
+ /** Additional classes applied to the attachments container. */
12
+ className?: string;
13
+ }
14
+
15
+ export const MessageAttachmentsContainer: FunctionComponent<MessageAttachmentsContainerProps> = ({
16
+ children,
17
+ className,
18
+ ...props
19
+ }) => (
20
+ <div className={css('pf-chatbot__message-attachments-container', className)} {...props}>
21
+ {children}
22
+ </div>
23
+ );
24
+
25
+ export default MessageAttachmentsContainer;
@@ -0,0 +1,2 @@
1
+ export * from './MessageAttachmentItem';
2
+ export * from './MessageAttachmentsContainer';
@@ -22,7 +22,7 @@ export interface MessageInputProps extends FormProps {
22
22
  content?: string;
23
23
  }
24
24
 
25
- const MessageInput: FunctionComponent<MessageInputProps> = ({
25
+ export const MessageInput: FunctionComponent<MessageInputProps> = ({
26
26
  editPlaceholder = 'Edit prompt message...',
27
27
  updateWord = 'Update',
28
28
  cancelWord = 'Cancel',
@@ -0,0 +1,23 @@
1
+ import '@testing-library/jest-dom';
2
+ import { render, screen } from '@testing-library/react';
3
+ import MessageLoading from './MessageLoading';
4
+
5
+ test('Renders with pf-chatbot__message-loading class by default', () => {
6
+ render(<MessageLoading data-testid="test-id" />);
7
+ expect(screen.getByTestId('test-id')).toHaveClass('pf-chatbot__message-loading', { exact: true });
8
+ });
9
+
10
+ test('Renders with pf-m-primary class when isPrimary is true', () => {
11
+ render(<MessageLoading data-testid="test-id" isPrimary />);
12
+ expect(screen.getByTestId('test-id')).toHaveClass('pf-chatbot__message-loading pf-m-primary');
13
+ });
14
+
15
+ test('Renders loading word when loadingWord is passed', () => {
16
+ render(<MessageLoading loadingWord="Loading message" />);
17
+ expect(screen.getByText('Loading message')).toBeInTheDocument();
18
+ });
19
+
20
+ test('Spreads additional props', () => {
21
+ render(<MessageLoading data-testid="test-id" id="custom-id" />);
22
+ expect(screen.getByTestId('test-id')).toHaveAttribute('id', 'custom-id');
23
+ });
@@ -2,8 +2,23 @@
2
2
  // Chatbot Main - Message - Processing
3
3
  // ============================================================================
4
4
 
5
- const MessageLoading = ({ loadingWord, isPrimary }) => (
6
- <div className={`pf-chatbot__message-loading ${isPrimary ? 'pf-m-primary' : ''}`}>
5
+ import { FunctionComponent } from 'react';
6
+ import type { HTMLProps } from 'react';
7
+ import { css } from '@patternfly/react-styles';
8
+
9
+ /**
10
+ * MessageLoading displays a loading animation for messages.
11
+ * Use this component when passing children to Message to show a loading state.
12
+ */
13
+ export interface MessageLoadingProps extends HTMLProps<HTMLDivElement> {
14
+ /** Text announced to screen readers during loading. */
15
+ loadingWord?: string;
16
+ /** Flag indicating whether primary styling is applied */
17
+ isPrimary?: boolean;
18
+ }
19
+
20
+ export const MessageLoading: FunctionComponent<MessageLoadingProps> = ({ loadingWord, isPrimary, ...props }) => (
21
+ <div className={css('pf-chatbot__message-loading', isPrimary && 'pf-m-primary')} {...props}>
7
22
  <span className="pf-chatbot__message-loading-dots">
8
23
  <span className="pf-v6-screen-reader">{loadingWord}</span>
9
24
  </span>
@@ -0,0 +1,131 @@
1
+ import { render, screen } from '@testing-library/react';
2
+ import userEvent from '@testing-library/user-event';
3
+ import '@testing-library/jest-dom';
4
+ import QuickResponse from './QuickResponse';
5
+
6
+ test('Renders with quick responses', () => {
7
+ const quickResponses = [
8
+ { id: '1', content: 'Response 1' },
9
+ { id: '2', content: 'Response 2' },
10
+ { id: '3', content: 'Response 3' }
11
+ ];
12
+ render(<QuickResponse quickResponses={quickResponses} />);
13
+
14
+ expect(screen.getByText('Response 1')).toBeVisible();
15
+ expect(screen.getByText('Response 2')).toBeVisible();
16
+ expect(screen.getByText('Response 3')).toBeVisible();
17
+ });
18
+
19
+ test('Renders with compact styling', () => {
20
+ const quickResponses = [{ id: '1', content: 'Compact response' }];
21
+ render(<QuickResponse quickResponses={quickResponses} isCompact />);
22
+
23
+ expect(screen.getByText('Compact response').closest('.pf-v6-c-label')).toHaveClass('pf-m-compact');
24
+ });
25
+
26
+ test('Renders with custom className on response', () => {
27
+ const quickResponses = [{ id: '1', content: 'Custom class response', className: 'custom-response-class' }];
28
+ render(<QuickResponse quickResponses={quickResponses} />);
29
+
30
+ expect(screen.getByText('Custom class response').closest('.pf-v6-c-label')).toHaveClass('custom-response-class');
31
+ });
32
+
33
+ test('Renders with custom container className', () => {
34
+ const quickResponses = [
35
+ { id: '1', content: 'Response 1' },
36
+ { id: '2', content: 'Response 2' }
37
+ ];
38
+ render(
39
+ <QuickResponse
40
+ quickResponses={quickResponses}
41
+ quickResponseContainerProps={{ className: 'custom-container-class' }}
42
+ />
43
+ );
44
+
45
+ expect(screen.getByText('Response 1').closest('.pf-v6-c-label-group')).toHaveClass('custom-container-class');
46
+ });
47
+
48
+ test('Spreads additional custom container props', () => {
49
+ const quickResponses = [
50
+ { id: '1', content: 'Response 1' },
51
+ { id: '2', content: 'Response 2' }
52
+ ];
53
+ render(<QuickResponse quickResponses={quickResponses} quickResponseContainerProps={{ id: 'custom-container-id' }} />);
54
+
55
+ expect(screen.getByText('Response 1').closest('.pf-v6-c-label-group__list')).toHaveAttribute(
56
+ 'id',
57
+ 'custom-container-id'
58
+ );
59
+ });
60
+
61
+ test('Renders with pf-chatbot__message-quick-response--selected class after click', async () => {
62
+ const user = userEvent.setup();
63
+ const quickResponses = [
64
+ { id: '1', content: 'Response 1' },
65
+ { id: '2', content: 'Response 2' }
66
+ ];
67
+ render(<QuickResponse quickResponses={quickResponses} />);
68
+
69
+ await user.click(screen.getByText('Response 1'));
70
+
71
+ expect(screen.getByText('Response 1').closest('.pf-v6-c-label')).toHaveClass(
72
+ 'pf-chatbot__message-quick-response--selected'
73
+ );
74
+ });
75
+
76
+ test('Does not calls onClick handler when not passed', async () => {
77
+ const user = userEvent.setup();
78
+ const handleClick = jest.fn();
79
+ const quickResponses = [{ id: '1', content: 'Clickable response' }];
80
+ render(<QuickResponse quickResponses={quickResponses} />);
81
+
82
+ await user.click(screen.getByText('Clickable response'));
83
+
84
+ expect(handleClick).not.toHaveBeenCalled();
85
+ });
86
+
87
+ test('Calls onClick handler when passed', async () => {
88
+ const user = userEvent.setup();
89
+ const handleClick = jest.fn();
90
+ const quickResponses = [{ id: '1', content: 'Clickable response', onClick: handleClick }];
91
+ render(<QuickResponse quickResponses={quickResponses} />);
92
+
93
+ await user.click(screen.getByText('Clickable response'));
94
+
95
+ expect(handleClick).toHaveBeenCalled();
96
+ });
97
+
98
+ test('Does not call onSelect when not passed', async () => {
99
+ const user = userEvent.setup();
100
+ const handleSelect = jest.fn();
101
+ const quickResponses = [
102
+ { id: '1', content: 'Response 1' },
103
+ { id: '2', content: 'Response 2' }
104
+ ];
105
+ render(<QuickResponse quickResponses={quickResponses} />);
106
+
107
+ await user.click(screen.getByText('Response 2'));
108
+
109
+ expect(handleSelect).not.toHaveBeenCalled();
110
+ });
111
+
112
+ test('Calls onSelect when passed', async () => {
113
+ const user = userEvent.setup();
114
+ const handleSelect = jest.fn();
115
+ const quickResponses = [
116
+ { id: '1', content: 'Response 1' },
117
+ { id: '2', content: 'Response 2' }
118
+ ];
119
+ render(<QuickResponse quickResponses={quickResponses} onSelect={handleSelect} />);
120
+
121
+ await user.click(screen.getByText('Response 2'));
122
+
123
+ expect(handleSelect).toHaveBeenCalledWith('2');
124
+ });
125
+
126
+ test('Spreads additional response props', () => {
127
+ const quickResponses = [{ id: '1', content: 'Response with props', isCompact: true, 'aria-label': 'Test label' }];
128
+ render(<QuickResponse quickResponses={quickResponses} />);
129
+
130
+ expect(screen.getByText('Response with props').closest('.pf-v6-c-label')).toHaveAttribute('aria-label', 'Test label');
131
+ });
@@ -2,6 +2,7 @@ import type { FunctionComponent } from 'react';
2
2
  import { useState } from 'react';
3
3
  import { Label, LabelGroup, LabelGroupProps, LabelProps } from '@patternfly/react-core';
4
4
  import { CheckIcon } from '@patternfly/react-icons';
5
+ import { css } from '@patternfly/react-styles';
5
6
 
6
7
  export interface QuickResponse extends Omit<LabelProps, 'children'> {
7
8
  content: string;
@@ -35,7 +36,7 @@ export const QuickResponse: FunctionComponent<QuickResponseProps> = ({
35
36
  };
36
37
  return (
37
38
  <LabelGroup
38
- className={`pf-chatbot__message-quick-response ${quickResponseContainerProps?.className ? quickResponseContainerProps?.className : ''}`}
39
+ className={css('pf-chatbot__message-quick-response', quickResponseContainerProps?.className)}
39
40
  {...quickResponseContainerProps}
40
41
  >
41
42
  {quickResponses.map(({ id, onClick, content, className, ...props }: QuickResponse) => (
@@ -45,7 +46,7 @@ export const QuickResponse: FunctionComponent<QuickResponseProps> = ({
45
46
  color="blue"
46
47
  key={id}
47
48
  onClick={() => handleQuickResponseClick(id, onClick)}
48
- className={`${id === selectedQuickResponse ? 'pf-chatbot__message-quick-response--selected' : ''} ${className ? className : ''}`}
49
+ className={css(id === selectedQuickResponse && 'pf-chatbot__message-quick-response--selected', className)}
49
50
  isCompact={isCompact}
50
51
  {...props}
51
52
  >
@@ -0,0 +1 @@
1
+ export * from './QuickResponse';
@@ -53,7 +53,7 @@ export interface QuickStartTileProps {
53
53
  isCompact?: boolean;
54
54
  }
55
55
 
56
- const QuickStartTile: FC<QuickStartTileProps> = ({
56
+ export const QuickStartTile: FC<QuickStartTileProps> = ({
57
57
  className,
58
58
  quickStart,
59
59
  onClick,
@@ -0,0 +1,2 @@
1
+ export * from './QuickStartTile';
2
+ export * from './types';
@@ -78,7 +78,7 @@ export interface UserFeedbackProps extends Omit<CardProps, 'onSubmit'>, OUIAProp
78
78
  privacyStatement?: string;
79
79
  }
80
80
 
81
- const UserFeedback: FunctionComponent<UserFeedbackProps> = ({
81
+ export const UserFeedback: FunctionComponent<UserFeedbackProps> = ({
82
82
  className,
83
83
  timestamp,
84
84
  title = 'Why did you choose this rating?',
@@ -2,10 +2,7 @@
2
2
  // Chatbot Main - Messages - Feedback Complete Card
3
3
  // ============================================================================
4
4
  import type { MouseEvent as ReactMouseEvent, FunctionComponent } from 'react';
5
-
6
5
  import { useState, useRef, useEffect } from 'react';
7
-
8
- // Import PatternFly components
9
6
  import { Card, CardBody, CardHeader, CardProps, CardTitle, OUIAProps, useOUIAProps } from '@patternfly/react-core';
10
7
  import CloseButton from './CloseButton';
11
8
 
@@ -48,7 +45,7 @@ export interface UserFeedbackCompleteProps extends Omit<CardProps, 'ref'>, OUIAP
48
45
  timestamp?: string;
49
46
  }
50
47
 
51
- const UserFeedbackComplete: FunctionComponent<UserFeedbackCompleteProps> = ({
48
+ export const UserFeedbackComplete: FunctionComponent<UserFeedbackCompleteProps> = ({
52
49
  className,
53
50
  title = 'Feedback submitted',
54
51
  body = "We've received your response. Thank you for sharing your feedback!",
@@ -0,0 +1,2 @@
1
+ export * from './UserFeedback';
2
+ export * from './UserFeedbackComplete';
@@ -1,4 +1,12 @@
1
1
  export { default } from './Message';
2
2
  export { rehypeCodeBlockToggle } from './Plugins/rehypeCodeBlockToggle';
3
3
 
4
+ export * from './ErrorMessage/ErrorMessage';
5
+ export * from './MessageAndActions';
6
+ export * from './MessageAttachments';
4
7
  export * from './Message';
8
+ export * from './MessageLoading';
9
+ export * from './MessageInput';
10
+ export * from './QuickResponse';
11
+ export * from './QuickStarts';
12
+ export * from './UserFeedback';
@@ -66,6 +66,19 @@
66
66
  padding-block-start: var(--pf-t--global--spacer--xs);
67
67
  padding-block-end: var(--pf-t--global--spacer--xs);
68
68
  gap: var(--pf-t--global--spacer--gap--action-to-action--plain);
69
+
70
+ &.pf-m-grouped {
71
+ flex-basis: 100%;
72
+ justify-content: space-between;
73
+ }
74
+ }
75
+
76
+ &-actions-group {
77
+ display: flex;
78
+ padding-block-start: var(--pf-t--global--spacer--xs);
79
+ padding-block-end: var(--pf-t--global--spacer--xs);
80
+ gap: var(--pf-t--global--spacer--gap--action-to-action--plain);
81
+ align-items: center;
69
82
  }
70
83
 
71
84
  &-input {
@@ -150,7 +163,8 @@
150
163
  }
151
164
 
152
165
  .pf-m-compact {
153
- .pf-chatbot__message-bar-actions {
166
+ .pf-chatbot__message-bar-actions,
167
+ .pf-chatbot__message-bar-actions-group {
154
168
  padding-block-start: var(--pf-t--global--spacer--sm);
155
169
  padding-block-end: var(--pf-t--global--spacer--sm);
156
170
  }
@@ -488,4 +488,31 @@ describe('Message bar', () => {
488
488
 
489
489
  expect(screen.getByRole('textbox').closest('.pf-chatbot__message-bar')).toHaveClass('pf-v6-m-thinking');
490
490
  });
491
+
492
+ it('Renders with flex-basis of auto by default', () => {
493
+ render(<MessageBar onSendMessage={jest.fn} />);
494
+
495
+ expect(screen.getByRole('textbox').closest('.pf-chatbot__message-bar-input')).toHaveAttribute(
496
+ 'style',
497
+ 'flex-basis: auto;'
498
+ );
499
+ });
500
+
501
+ it('Renders with flex-basis of 100% when forceMultilineLayout is true', () => {
502
+ render(<MessageBar forceMultilineLayout onSendMessage={jest.fn} />);
503
+
504
+ expect(screen.getByRole('textbox').closest('.pf-chatbot__message-bar-input')).toHaveAttribute(
505
+ 'style',
506
+ 'flex-basis: 100%;'
507
+ );
508
+ });
509
+
510
+ it('Renders with flex-basis of 100% when additionalActions is truthy', () => {
511
+ render(<MessageBar additionalActions="actions" onSendMessage={jest.fn} />);
512
+
513
+ expect(screen.getByRole('textbox').closest('.pf-chatbot__message-bar-input')).toHaveAttribute(
514
+ 'style',
515
+ 'flex-basis: 100%;'
516
+ );
517
+ });
491
518
  });