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

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 (138) 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/ResponseActions/ResponseActions.d.ts +4 -0
  48. package/dist/cjs/ResponseActions/ResponseActionsGroups.d.ts +13 -0
  49. package/dist/cjs/ResponseActions/ResponseActionsGroups.js +22 -0
  50. package/dist/cjs/ResponseActions/ResponseActionsGroups.test.d.ts +1 -0
  51. package/dist/cjs/ResponseActions/ResponseActionsGroups.test.js +25 -0
  52. package/dist/cjs/ResponseActions/index.d.ts +1 -0
  53. package/dist/cjs/ResponseActions/index.js +1 -0
  54. package/dist/esm/MarkdownContent/MarkdownContent.d.ts +7 -2
  55. package/dist/esm/Message/ErrorMessage/ErrorMessage.d.ts +15 -1
  56. package/dist/esm/Message/ErrorMessage/ErrorMessage.js +3 -3
  57. package/dist/esm/Message/ErrorMessage/ErrorMessage.test.d.ts +1 -0
  58. package/dist/esm/Message/ErrorMessage/ErrorMessage.test.js +25 -0
  59. package/dist/esm/Message/Message.d.ts +2 -0
  60. package/dist/esm/Message/Message.js +5 -5
  61. package/dist/esm/Message/MessageAndActions/MessageAndActions.d.ts +14 -0
  62. package/dist/esm/Message/MessageAndActions/MessageAndActions.js +18 -0
  63. package/dist/esm/Message/MessageAndActions/MessageAndActions.test.d.ts +1 -0
  64. package/dist/esm/Message/MessageAndActions/MessageAndActions.test.js +20 -0
  65. package/dist/esm/Message/MessageAndActions/index.d.ts +1 -0
  66. package/dist/esm/Message/MessageAndActions/index.js +1 -0
  67. package/dist/esm/Message/MessageAttachments/MessageAttachmentItem.d.ts +13 -0
  68. package/dist/esm/Message/MessageAttachments/MessageAttachmentItem.js +18 -0
  69. package/dist/esm/Message/MessageAttachments/MessageAttachmentItem.test.d.ts +1 -0
  70. package/dist/esm/Message/MessageAttachments/MessageAttachmentItem.test.js +20 -0
  71. package/dist/esm/Message/MessageAttachments/MessageAttachmentsContainer.d.ts +13 -0
  72. package/dist/esm/Message/MessageAttachments/MessageAttachmentsContainer.js +18 -0
  73. package/dist/esm/Message/MessageAttachments/MessageAttachmentsContainer.test.d.ts +1 -0
  74. package/dist/esm/Message/MessageAttachments/MessageAttachmentsContainer.test.js +20 -0
  75. package/dist/esm/Message/MessageAttachments/index.d.ts +2 -0
  76. package/dist/esm/Message/MessageAttachments/index.js +2 -0
  77. package/dist/esm/Message/MessageInput.d.ts +1 -1
  78. package/dist/esm/Message/MessageInput.js +1 -1
  79. package/dist/esm/Message/MessageLoading.d.ts +13 -4
  80. package/dist/esm/Message/MessageLoading.js +16 -4
  81. package/dist/esm/Message/MessageLoading.test.d.ts +1 -0
  82. package/dist/esm/Message/MessageLoading.test.js +20 -0
  83. package/dist/esm/Message/QuickResponse/QuickResponse.js +3 -2
  84. package/dist/esm/Message/QuickResponse/QuickResponse.test.d.ts +1 -0
  85. package/dist/esm/Message/QuickResponse/QuickResponse.test.js +104 -0
  86. package/dist/esm/Message/QuickResponse/index.d.ts +1 -0
  87. package/dist/esm/Message/QuickResponse/index.js +1 -0
  88. package/dist/esm/Message/QuickStarts/QuickStartTile.d.ts +1 -1
  89. package/dist/esm/Message/QuickStarts/QuickStartTile.js +1 -1
  90. package/dist/esm/Message/QuickStarts/index.d.ts +2 -0
  91. package/dist/esm/Message/QuickStarts/index.js +2 -0
  92. package/dist/esm/Message/UserFeedback/UserFeedback.d.ts +1 -1
  93. package/dist/esm/Message/UserFeedback/UserFeedback.js +1 -1
  94. package/dist/esm/Message/UserFeedback/UserFeedbackComplete.d.ts +1 -1
  95. package/dist/esm/Message/UserFeedback/UserFeedbackComplete.js +1 -2
  96. package/dist/esm/Message/UserFeedback/index.d.ts +2 -0
  97. package/dist/esm/Message/UserFeedback/index.js +2 -0
  98. package/dist/esm/Message/index.d.ts +8 -0
  99. package/dist/esm/Message/index.js +8 -0
  100. package/dist/esm/ResponseActions/ResponseActions.d.ts +4 -0
  101. package/dist/esm/ResponseActions/ResponseActionsGroups.d.ts +13 -0
  102. package/dist/esm/ResponseActions/ResponseActionsGroups.js +18 -0
  103. package/dist/esm/ResponseActions/ResponseActionsGroups.test.d.ts +1 -0
  104. package/dist/esm/ResponseActions/ResponseActionsGroups.test.js +20 -0
  105. package/dist/esm/ResponseActions/index.d.ts +1 -0
  106. package/dist/esm/ResponseActions/index.js +1 -0
  107. package/dist/tsconfig.tsbuildinfo +1 -1
  108. package/package.json +1 -1
  109. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithCustomStructure.tsx +102 -0
  110. package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +55 -10
  111. package/src/MarkdownContent/MarkdownContent.tsx +7 -2
  112. package/src/Message/ErrorMessage/ErrorMessage.test.tsx +38 -0
  113. package/src/Message/ErrorMessage/ErrorMessage.tsx +17 -2
  114. package/src/Message/Message.tsx +75 -64
  115. package/src/Message/MessageAndActions/MessageAndActions.test.tsx +23 -0
  116. package/src/Message/MessageAndActions/MessageAndActions.tsx +22 -0
  117. package/src/Message/MessageAndActions/index.ts +1 -0
  118. package/src/Message/MessageAttachments/MessageAttachmentItem.test.tsx +23 -0
  119. package/src/Message/MessageAttachments/MessageAttachmentItem.tsx +25 -0
  120. package/src/Message/MessageAttachments/MessageAttachmentsContainer.test.tsx +23 -0
  121. package/src/Message/MessageAttachments/MessageAttachmentsContainer.tsx +25 -0
  122. package/src/Message/MessageAttachments/index.ts +2 -0
  123. package/src/Message/MessageInput.tsx +1 -1
  124. package/src/Message/MessageLoading.test.tsx +23 -0
  125. package/src/Message/MessageLoading.tsx +17 -2
  126. package/src/Message/QuickResponse/QuickResponse.test.tsx +131 -0
  127. package/src/Message/QuickResponse/QuickResponse.tsx +3 -2
  128. package/src/Message/QuickResponse/index.ts +1 -0
  129. package/src/Message/QuickStarts/QuickStartTile.tsx +1 -1
  130. package/src/Message/QuickStarts/index.ts +2 -0
  131. package/src/Message/UserFeedback/UserFeedback.tsx +1 -1
  132. package/src/Message/UserFeedback/UserFeedbackComplete.tsx +1 -4
  133. package/src/Message/UserFeedback/index.ts +2 -0
  134. package/src/Message/index.ts +8 -0
  135. package/src/ResponseActions/ResponseActions.tsx +6 -0
  136. package/src/ResponseActions/ResponseActionsGroups.test.tsx +23 -0
  137. package/src/ResponseActions/ResponseActionsGroups.tsx +28 -0
  138. package/src/ResponseActions/index.ts +1 -0
@@ -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';
@@ -42,6 +42,12 @@ export interface ActionProps extends Omit<ButtonProps, 'ref'> {
42
42
  type ExtendedActionProps = ActionProps & {
43
43
  [key: string]: any;
44
44
  };
45
+
46
+ /**
47
+ * The various actions that can be attached to a bot message for users to interact with.
48
+ * Use this component when passing children to Message to customize its structure.
49
+ */
50
+
45
51
  export interface ResponseActionProps {
46
52
  /** Props for message actions, such as feedback (positive or negative), copy button, share, and listen */
47
53
  actions: Record<string, ExtendedActionProps | undefined> & {
@@ -0,0 +1,23 @@
1
+ import '@testing-library/jest-dom';
2
+ import { render, screen } from '@testing-library/react';
3
+ import ResponseActionsGroups from './ResponseActionsGroups';
4
+
5
+ test('Renders with children', () => {
6
+ render(<ResponseActionsGroups>Test content</ResponseActionsGroups>);
7
+ expect(screen.getByText('Test content')).toBeInTheDocument();
8
+ });
9
+
10
+ test('Renders with pf-chatbot__response-actions-groups class by default', () => {
11
+ render(<ResponseActionsGroups>Test content</ResponseActionsGroups>);
12
+ expect(screen.getByText('Test content')).toHaveClass('pf-chatbot__response-actions-groups', { exact: true });
13
+ });
14
+
15
+ test('Renders with custom className', () => {
16
+ render(<ResponseActionsGroups className="custom-class">Test content</ResponseActionsGroups>);
17
+ expect(screen.getByText('Test content')).toHaveClass('custom-class');
18
+ });
19
+
20
+ test('Spreads additional props', () => {
21
+ render(<ResponseActionsGroups id="test-id">Test content</ResponseActionsGroups>);
22
+ expect(screen.getByText('Test content')).toHaveAttribute('id', 'test-id');
23
+ });
@@ -0,0 +1,28 @@
1
+ // ============================================================================
2
+ // Response Actions Groups - Container for multiple action groups
3
+ // ============================================================================
4
+ import { FunctionComponent, HTMLProps, ReactNode } from 'react';
5
+ import { css } from '@patternfly/react-styles';
6
+
7
+ /**
8
+ * The container for grouping multiple related ResponseActions components, typically used for having different persistence states amongst groups.
9
+ * Use this component when passing children to Message to customize its structure.
10
+ */
11
+ export interface ResponseActionsGroupsProps extends HTMLProps<HTMLDivElement> {
12
+ /** Content to render inside the response actions groups container */
13
+ children: ReactNode;
14
+ /** Additional classes applied to the response actions groups container. */
15
+ className?: string;
16
+ }
17
+
18
+ export const ResponseActionsGroups: FunctionComponent<ResponseActionsGroupsProps> = ({
19
+ children,
20
+ className,
21
+ ...props
22
+ }) => (
23
+ <div className={css('pf-chatbot__response-actions-groups', className)} {...props}>
24
+ {children}
25
+ </div>
26
+ );
27
+
28
+ export default ResponseActionsGroups;
@@ -1,3 +1,4 @@
1
1
  export { default } from './ResponseActions';
2
2
 
3
3
  export * from './ResponseActions';
4
+ export * from './ResponseActionsGroups';