@patternfly/chatbot 2.2.0-prerelease.4 → 2.2.0-prerelease.6

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 (61) hide show
  1. package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.d.ts +17 -0
  2. package/dist/cjs/ChatbotHeader/ChatbotHeaderCloseButton.js +14 -0
  3. package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.d.ts +2 -0
  4. package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.js +2 -2
  5. package/dist/cjs/ChatbotHeader/index.d.ts +1 -0
  6. package/dist/cjs/ChatbotHeader/index.js +1 -0
  7. package/dist/cjs/ResponseActions/ResponseActionButton.d.ts +6 -0
  8. package/dist/cjs/ResponseActions/ResponseActionButton.js +10 -2
  9. package/dist/cjs/ResponseActions/ResponseActionButton.test.d.ts +1 -0
  10. package/dist/cjs/ResponseActions/ResponseActionButton.test.js +54 -0
  11. package/dist/cjs/ResponseActions/ResponseActions.d.ts +4 -0
  12. package/dist/cjs/ResponseActions/ResponseActions.js +26 -9
  13. package/dist/cjs/ResponseActions/ResponseActions.test.js +79 -5
  14. package/dist/cjs/Settings/SettingsForm.d.ts +13 -0
  15. package/dist/cjs/Settings/SettingsForm.js +27 -0
  16. package/dist/cjs/Settings/index.d.ts +2 -0
  17. package/dist/cjs/Settings/index.js +23 -0
  18. package/dist/cjs/index.d.ts +2 -0
  19. package/dist/cjs/index.js +4 -1
  20. package/dist/css/main.css +46 -4
  21. package/dist/css/main.css.map +1 -1
  22. package/dist/dynamic/Settings/package.json +1 -0
  23. package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.d.ts +17 -0
  24. package/dist/esm/ChatbotHeader/ChatbotHeaderCloseButton.js +8 -0
  25. package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.d.ts +2 -0
  26. package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.js +2 -2
  27. package/dist/esm/ChatbotHeader/index.d.ts +1 -0
  28. package/dist/esm/ChatbotHeader/index.js +1 -0
  29. package/dist/esm/ResponseActions/ResponseActionButton.d.ts +6 -0
  30. package/dist/esm/ResponseActions/ResponseActionButton.js +10 -2
  31. package/dist/esm/ResponseActions/ResponseActionButton.test.d.ts +1 -0
  32. package/dist/esm/ResponseActions/ResponseActionButton.test.js +49 -0
  33. package/dist/esm/ResponseActions/ResponseActions.d.ts +4 -0
  34. package/dist/esm/ResponseActions/ResponseActions.js +26 -9
  35. package/dist/esm/ResponseActions/ResponseActions.test.js +79 -5
  36. package/dist/esm/Settings/SettingsForm.d.ts +13 -0
  37. package/dist/esm/Settings/SettingsForm.js +20 -0
  38. package/dist/esm/Settings/index.d.ts +2 -0
  39. package/dist/esm/Settings/index.js +2 -0
  40. package/dist/esm/index.d.ts +2 -0
  41. package/dist/esm/index.js +2 -0
  42. package/dist/tsconfig.tsbuildinfo +1 -1
  43. package/package.json +1 -1
  44. package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithCustomResponseActions.tsx +4 -0
  45. package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +13 -2
  46. package/patternfly-docs/content/extensions/chatbot/examples/UI/Settings.tsx +289 -0
  47. package/patternfly-docs/content/extensions/chatbot/examples/UI/UI.md +14 -0
  48. package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.md +2 -2
  49. package/src/ChatbotHeader/ChatbotHeaderCloseButton.tsx +51 -0
  50. package/src/ChatbotHeader/ChatbotHeaderMenu.tsx +5 -2
  51. package/src/ChatbotHeader/index.ts +1 -0
  52. package/src/ResponseActions/ResponseActionButton.test.tsx +52 -0
  53. package/src/ResponseActions/ResponseActionButton.tsx +46 -27
  54. package/src/ResponseActions/ResponseActions.scss +10 -8
  55. package/src/ResponseActions/ResponseActions.test.tsx +103 -5
  56. package/src/ResponseActions/ResponseActions.tsx +54 -7
  57. package/src/Settings/Settings.scss +34 -0
  58. package/src/Settings/SettingsForm.tsx +25 -0
  59. package/src/Settings/index.ts +3 -0
  60. package/src/index.ts +3 -0
  61. package/src/main.scss +1 -0
@@ -11,5 +11,7 @@ export interface ChatbotHeaderMenuProps {
11
11
  menuAriaLabel?: string;
12
12
  /** Ref applied to menu */
13
13
  innerRef?: React.Ref<HTMLButtonElement>;
14
+ /** Content used in tooltip */
15
+ tooltipContent?: string;
14
16
  }
15
17
  export declare const ChatbotHeaderMenu: React.ForwardRefExoticComponent<ChatbotHeaderMenuProps & React.RefAttributes<HTMLButtonElement>>;
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import { Button, Icon, Tooltip } from '@patternfly/react-core';
3
3
  import BarsIcon from '@patternfly/react-icons/dist/esm/icons/bars-icon';
4
- const ChatbotHeaderMenuBase = ({ className, onMenuToggle, tooltipProps, menuAriaLabel = 'Toggle menu', innerRef }) => (React.createElement("div", { className: `pf-chatbot__menu ${className}` },
5
- React.createElement(Tooltip, Object.assign({ content: "Menu", position: "bottom" }, tooltipProps),
4
+ const ChatbotHeaderMenuBase = ({ className, onMenuToggle, tooltipProps, menuAriaLabel = 'Toggle menu', innerRef, tooltipContent = 'Menu' }) => (React.createElement("div", { className: `pf-chatbot__menu ${className}` },
5
+ React.createElement(Tooltip, Object.assign({ content: tooltipContent, position: "bottom" }, tooltipProps),
6
6
  React.createElement(Button, { className: "pf-chatbot__button--toggle-menu", variant: "plain", onClick: onMenuToggle, "aria-label": menuAriaLabel, ref: innerRef, icon: React.createElement(Icon, { size: "xl", isInline: true },
7
7
  React.createElement(BarsIcon, null)) }))));
8
8
  export const ChatbotHeaderMenu = React.forwardRef((props, ref) => (React.createElement(ChatbotHeaderMenuBase, Object.assign({ innerRef: ref }, props))));
@@ -6,3 +6,4 @@ export * from './ChatbotHeaderMenu';
6
6
  export * from './ChatbotHeaderTitle';
7
7
  export * from './ChatbotHeaderOptionsDropdown';
8
8
  export * from './ChatbotHeaderSelectorDropdown';
9
+ export * from './ChatbotHeaderCloseButton';
@@ -6,3 +6,4 @@ export * from './ChatbotHeaderMenu';
6
6
  export * from './ChatbotHeaderTitle';
7
7
  export * from './ChatbotHeaderOptionsDropdown';
8
8
  export * from './ChatbotHeaderSelectorDropdown';
9
+ export * from './ChatbotHeaderCloseButton';
@@ -3,6 +3,8 @@ import { TooltipProps } from '@patternfly/react-core';
3
3
  export interface ResponseActionButtonProps {
4
4
  /** Aria-label for the button. Defaults to the value of the tooltipContent if none provided */
5
5
  ariaLabel?: string;
6
+ /** Aria-label for the button, shown when the button is clicked. Defaults to the value of ariaLabel or tooltipContent if not provided. */
7
+ clickedAriaLabel?: string;
6
8
  /** Icon for the button */
7
9
  icon: React.ReactNode;
8
10
  /** On-click handler for the button */
@@ -13,8 +15,12 @@ export interface ResponseActionButtonProps {
13
15
  isDisabled?: boolean;
14
16
  /** Content shown in the tooltip */
15
17
  tooltipContent?: string;
18
+ /** Content shown in the tooltip when the button is clicked. Defaults to the value of tooltipContent if not provided. */
19
+ clickedTooltipContent?: string;
16
20
  /** Props to control the PF Tooltip component */
17
21
  tooltipProps?: TooltipProps;
22
+ /** Whether button is in clicked state */
23
+ isClicked?: boolean;
18
24
  }
19
25
  export declare const ResponseActionButton: React.FunctionComponent<ResponseActionButtonProps>;
20
26
  export default ResponseActionButton;
@@ -1,5 +1,13 @@
1
1
  import React from 'react';
2
2
  import { Button, Icon, Tooltip } from '@patternfly/react-core';
3
- export const ResponseActionButton = ({ ariaLabel, className, icon, isDisabled, onClick, tooltipContent, tooltipProps }) => (React.createElement(Tooltip, Object.assign({ id: `pf-chatbot__tooltip-response-action-${tooltipContent}`, content: tooltipContent, position: "bottom", entryDelay: (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.entryDelay) || 0, exitDelay: (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.exitDelay) || 0, distance: (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.distance) || 8, animationDuration: (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.animationDuration) || 0 }, tooltipProps),
4
- React.createElement(Button, { variant: "plain", className: `pf-chatbot__button--response-action ${className !== null && className !== void 0 ? className : ''}`, "aria-label": ariaLabel !== null && ariaLabel !== void 0 ? ariaLabel : tooltipContent, icon: React.createElement(Icon, { isInline: true, size: "lg" }, icon), isDisabled: isDisabled, onClick: onClick, size: "sm" })));
3
+ export const ResponseActionButton = ({ ariaLabel, clickedAriaLabel = ariaLabel, className, icon, isDisabled, onClick, tooltipContent, clickedTooltipContent = tooltipContent, tooltipProps, isClicked = false }) => {
4
+ const generateAriaLabel = () => {
5
+ if (ariaLabel) {
6
+ return isClicked ? clickedAriaLabel : ariaLabel;
7
+ }
8
+ return isClicked ? clickedTooltipContent : tooltipContent;
9
+ };
10
+ return (React.createElement(Tooltip, Object.assign({ id: `pf-chatbot__tooltip-response-action-${tooltipContent}`, content: isClicked ? clickedTooltipContent : tooltipContent, "aria-live": "polite", position: "bottom", entryDelay: (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.entryDelay) || 0, exitDelay: (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.exitDelay) || 0, distance: (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.distance) || 8, animationDuration: (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.animationDuration) || 0 }, tooltipProps),
11
+ React.createElement(Button, { variant: "plain", className: `pf-chatbot__button--response-action ${isClicked ? 'pf-chatbot__button--response-action-clicked' : ''} ${className !== null && className !== void 0 ? className : ''}`, "aria-label": generateAriaLabel(), icon: React.createElement(Icon, { isInline: true, size: "lg" }, icon), isDisabled: isDisabled, onClick: onClick, size: "sm" })));
12
+ };
5
13
  export default ResponseActionButton;
@@ -0,0 +1 @@
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,49 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ import React from 'react';
11
+ import { render, screen } from '@testing-library/react';
12
+ import '@testing-library/jest-dom';
13
+ import userEvent from '@testing-library/user-event';
14
+ import { DownloadIcon } from '@patternfly/react-icons';
15
+ import ResponseActionButton from './ResponseActionButton';
16
+ describe('ResponseActionButton', () => {
17
+ it('renders aria-label correctly if not clicked', () => {
18
+ render(React.createElement(ResponseActionButton, { icon: React.createElement(DownloadIcon, null), ariaLabel: "Download", clickedAriaLabel: "Downloaded" }));
19
+ expect(screen.getByRole('button', { name: 'Download' })).toBeTruthy();
20
+ });
21
+ it('renders aria-label correctly if clicked', () => {
22
+ render(React.createElement(ResponseActionButton, { icon: React.createElement(DownloadIcon, null), ariaLabel: "Download", clickedAriaLabel: "Downloaded", isClicked: true }));
23
+ expect(screen.getByRole('button', { name: 'Downloaded' })).toBeTruthy();
24
+ });
25
+ it('renders tooltip correctly if not clicked', () => __awaiter(void 0, void 0, void 0, function* () {
26
+ render(React.createElement(ResponseActionButton, { icon: React.createElement(DownloadIcon, null), tooltipContent: "Download", clickedTooltipContent: "Downloaded" }));
27
+ expect(screen.getByRole('button', { name: 'Download' })).toBeTruthy();
28
+ // clicking here just triggers the tooltip; in this button, the logic is divorced from whether it is actually clicked
29
+ yield userEvent.click(screen.getByRole('button', { name: 'Download' }));
30
+ expect(screen.getByRole('tooltip', { name: 'Download' })).toBeTruthy();
31
+ }));
32
+ it('renders tooltip correctly if clicked', () => __awaiter(void 0, void 0, void 0, function* () {
33
+ render(React.createElement(ResponseActionButton, { icon: React.createElement(DownloadIcon, null), tooltipContent: "Download", clickedTooltipContent: "Downloaded", isClicked: true }));
34
+ expect(screen.getByRole('button', { name: 'Downloaded' })).toBeTruthy();
35
+ // clicking here just triggers the tooltip; in this button, the logic is divorced from whether it is actually clicked
36
+ yield userEvent.click(screen.getByRole('button', { name: 'Downloaded' }));
37
+ expect(screen.getByRole('tooltip', { name: 'Downloaded' })).toBeTruthy();
38
+ }));
39
+ it('if clicked variant for tooltip is not supplied, it uses the default', () => __awaiter(void 0, void 0, void 0, function* () {
40
+ render(React.createElement(ResponseActionButton, { icon: React.createElement(DownloadIcon, null), tooltipContent: "Download", isClicked: true }));
41
+ // clicking here just triggers the tooltip; in this button, the logic is divorced from whether it is actually clicked
42
+ yield userEvent.click(screen.getByRole('button', { name: 'Download' }));
43
+ expect(screen.getByRole('button', { name: 'Download' })).toBeTruthy();
44
+ }));
45
+ it('if clicked variant for aria label is not supplied, it uses the default', () => __awaiter(void 0, void 0, void 0, function* () {
46
+ render(React.createElement(ResponseActionButton, { icon: React.createElement(DownloadIcon, null), ariaLabel: "Download", isClicked: true }));
47
+ expect(screen.getByRole('button', { name: 'Download' })).toBeTruthy();
48
+ }));
49
+ });
@@ -3,6 +3,8 @@ import { TooltipProps } from '@patternfly/react-core';
3
3
  export interface ActionProps {
4
4
  /** Aria-label for the button */
5
5
  ariaLabel?: string;
6
+ /** Aria-label for the button, shown when the button is clicked. */
7
+ clickedAriaLabel?: string;
6
8
  /** On-click handler for the button */
7
9
  onClick?: ((event: MouseEvent | React.MouseEvent<Element, MouseEvent> | KeyboardEvent) => void) | undefined;
8
10
  /** Class name for the button */
@@ -11,6 +13,8 @@ export interface ActionProps {
11
13
  isDisabled?: boolean;
12
14
  /** Content shown in the tooltip */
13
15
  tooltipContent?: string;
16
+ /** Content shown in the tooltip when the button is clicked. */
17
+ clickedTooltipContent?: string;
14
18
  /** Props to control the PF Tooltip component */
15
19
  tooltipProps?: TooltipProps;
16
20
  /** Icon for custom response action */
@@ -13,17 +13,34 @@ import React from 'react';
13
13
  import { ExternalLinkAltIcon, VolumeUpIcon, OutlinedThumbsUpIcon, OutlinedThumbsDownIcon, OutlinedCopyIcon } from '@patternfly/react-icons';
14
14
  import ResponseActionButton from './ResponseActionButton';
15
15
  export const ResponseActions = ({ actions }) => {
16
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
16
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v;
17
+ const [activeButton, setActiveButton] = React.useState();
17
18
  const { positive, negative, copy, share, listen } = actions, additionalActions = __rest(actions, ["positive", "negative", "copy", "share", "listen"]);
18
- return (React.createElement("div", { className: "pf-chatbot__response-actions" },
19
- positive && (React.createElement(ResponseActionButton, { ariaLabel: (_a = positive.ariaLabel) !== null && _a !== void 0 ? _a : 'Good response', onClick: positive.onClick, className: positive.className, isDisabled: positive.isDisabled, tooltipContent: (_b = positive.tooltipContent) !== null && _b !== void 0 ? _b : 'Good response', tooltipProps: positive.tooltipProps, icon: React.createElement(OutlinedThumbsUpIcon, null) })),
20
- negative && (React.createElement(ResponseActionButton, { ariaLabel: (_c = negative.ariaLabel) !== null && _c !== void 0 ? _c : 'Bad response', onClick: negative.onClick, className: negative.className, isDisabled: negative.isDisabled, tooltipContent: (_d = negative.tooltipContent) !== null && _d !== void 0 ? _d : 'Bad response', tooltipProps: negative.tooltipProps, icon: React.createElement(OutlinedThumbsDownIcon, null) })),
21
- copy && (React.createElement(ResponseActionButton, { ariaLabel: (_e = copy.ariaLabel) !== null && _e !== void 0 ? _e : 'Copy', onClick: copy.onClick, className: copy.className, isDisabled: copy.isDisabled, tooltipContent: (_f = copy.tooltipContent) !== null && _f !== void 0 ? _f : 'Copy', tooltipProps: copy.tooltipProps, icon: React.createElement(OutlinedCopyIcon, null) })),
22
- share && (React.createElement(ResponseActionButton, { ariaLabel: (_g = share.ariaLabel) !== null && _g !== void 0 ? _g : 'Share', onClick: share.onClick, className: share.className, isDisabled: share.isDisabled, tooltipContent: (_h = share.tooltipContent) !== null && _h !== void 0 ? _h : 'Share', tooltipProps: share.tooltipProps, icon: React.createElement(ExternalLinkAltIcon, null) })),
23
- listen && (React.createElement(ResponseActionButton, { ariaLabel: (_j = listen.ariaLabel) !== null && _j !== void 0 ? _j : 'Listen', onClick: listen.onClick, className: listen.className, isDisabled: listen.isDisabled, tooltipContent: (_k = listen.tooltipContent) !== null && _k !== void 0 ? _k : 'Listen', tooltipProps: listen.tooltipProps, icon: React.createElement(VolumeUpIcon, null) })),
19
+ const responseActions = React.useRef(null);
20
+ React.useEffect(() => {
21
+ const handleClickOutside = (e) => {
22
+ if (responseActions.current && !responseActions.current.contains(e.target)) {
23
+ setActiveButton(undefined);
24
+ }
25
+ };
26
+ window.addEventListener('click', handleClickOutside);
27
+ return () => {
28
+ window.removeEventListener('click', handleClickOutside);
29
+ };
30
+ }, []);
31
+ const handleClick = (e, id, onClick) => {
32
+ setActiveButton(id);
33
+ onClick && onClick(e);
34
+ };
35
+ return (React.createElement("div", { ref: responseActions, className: "pf-chatbot__response-actions" },
36
+ positive && (React.createElement(ResponseActionButton, { ariaLabel: (_a = positive.ariaLabel) !== null && _a !== void 0 ? _a : 'Good response', clickedAriaLabel: (_b = positive.ariaLabel) !== null && _b !== void 0 ? _b : 'Response recorded', onClick: (e) => handleClick(e, 'positive', positive.onClick), className: positive.className, isDisabled: positive.isDisabled, tooltipContent: (_c = positive.tooltipContent) !== null && _c !== void 0 ? _c : 'Good response', clickedTooltipContent: (_d = positive.clickedTooltipContent) !== null && _d !== void 0 ? _d : 'Response recorded', tooltipProps: positive.tooltipProps, icon: React.createElement(OutlinedThumbsUpIcon, null), isClicked: activeButton === 'positive' })),
37
+ negative && (React.createElement(ResponseActionButton, { ariaLabel: (_e = negative.ariaLabel) !== null && _e !== void 0 ? _e : 'Bad response', clickedAriaLabel: (_f = negative.ariaLabel) !== null && _f !== void 0 ? _f : 'Response recorded', onClick: (e) => handleClick(e, 'negative', negative.onClick), className: negative.className, isDisabled: negative.isDisabled, tooltipContent: (_g = negative.tooltipContent) !== null && _g !== void 0 ? _g : 'Bad response', clickedTooltipContent: (_h = negative.clickedTooltipContent) !== null && _h !== void 0 ? _h : 'Response recorded', tooltipProps: negative.tooltipProps, icon: React.createElement(OutlinedThumbsDownIcon, null), isClicked: activeButton === 'negative' })),
38
+ copy && (React.createElement(ResponseActionButton, { ariaLabel: (_j = copy.ariaLabel) !== null && _j !== void 0 ? _j : 'Copy', clickedAriaLabel: (_k = copy.ariaLabel) !== null && _k !== void 0 ? _k : 'Copied', onClick: (e) => handleClick(e, 'copy', copy.onClick), className: copy.className, isDisabled: copy.isDisabled, tooltipContent: (_l = copy.tooltipContent) !== null && _l !== void 0 ? _l : 'Copy', clickedTooltipContent: (_m = copy.clickedTooltipContent) !== null && _m !== void 0 ? _m : 'Copied', tooltipProps: copy.tooltipProps, icon: React.createElement(OutlinedCopyIcon, null), isClicked: activeButton === 'copy' })),
39
+ share && (React.createElement(ResponseActionButton, { ariaLabel: (_o = share.ariaLabel) !== null && _o !== void 0 ? _o : 'Share', clickedAriaLabel: (_p = share.ariaLabel) !== null && _p !== void 0 ? _p : 'Shared', onClick: (e) => handleClick(e, 'share', share.onClick), className: share.className, isDisabled: share.isDisabled, tooltipContent: (_q = share.tooltipContent) !== null && _q !== void 0 ? _q : 'Share', clickedTooltipContent: (_r = share.clickedTooltipContent) !== null && _r !== void 0 ? _r : 'Shared', tooltipProps: share.tooltipProps, icon: React.createElement(ExternalLinkAltIcon, null), isClicked: activeButton === 'share' })),
40
+ listen && (React.createElement(ResponseActionButton, { ariaLabel: (_s = listen.ariaLabel) !== null && _s !== void 0 ? _s : 'Listen', clickedAriaLabel: (_t = listen.ariaLabel) !== null && _t !== void 0 ? _t : 'Listening', onClick: (e) => handleClick(e, 'listen', listen.onClick), className: listen.className, isDisabled: listen.isDisabled, tooltipContent: (_u = listen.tooltipContent) !== null && _u !== void 0 ? _u : 'Listen', clickedTooltipContent: (_v = listen.clickedTooltipContent) !== null && _v !== void 0 ? _v : 'Listening', tooltipProps: listen.tooltipProps, icon: React.createElement(VolumeUpIcon, null), isClicked: activeButton === 'listen' })),
24
41
  Object.keys(additionalActions).map((action) => {
25
- var _a, _b, _c, _d, _e, _f, _g;
26
- return (React.createElement(ResponseActionButton, { key: action, ariaLabel: (_a = additionalActions[action]) === null || _a === void 0 ? void 0 : _a.ariaLabel, onClick: (_b = additionalActions[action]) === null || _b === void 0 ? void 0 : _b.onClick, className: (_c = additionalActions[action]) === null || _c === void 0 ? void 0 : _c.className, isDisabled: (_d = additionalActions[action]) === null || _d === void 0 ? void 0 : _d.isDisabled, tooltipContent: (_e = additionalActions[action]) === null || _e === void 0 ? void 0 : _e.tooltipContent, tooltipProps: (_f = additionalActions[action]) === null || _f === void 0 ? void 0 : _f.tooltipProps, icon: (_g = additionalActions[action]) === null || _g === void 0 ? void 0 : _g.icon }));
42
+ var _a, _b, _c, _d, _e, _f, _g, _h;
43
+ return (React.createElement(ResponseActionButton, { key: action, ariaLabel: (_a = additionalActions[action]) === null || _a === void 0 ? void 0 : _a.ariaLabel, clickedAriaLabel: (_b = additionalActions[action]) === null || _b === void 0 ? void 0 : _b.clickedAriaLabel, onClick: (e) => { var _a; return handleClick(e, action, (_a = additionalActions[action]) === null || _a === void 0 ? void 0 : _a.onClick); }, className: (_c = additionalActions[action]) === null || _c === void 0 ? void 0 : _c.className, isDisabled: (_d = additionalActions[action]) === null || _d === void 0 ? void 0 : _d.isDisabled, tooltipContent: (_e = additionalActions[action]) === null || _e === void 0 ? void 0 : _e.tooltipContent, tooltipProps: (_f = additionalActions[action]) === null || _f === void 0 ? void 0 : _f.tooltipProps, clickedTooltipContent: (_g = additionalActions[action]) === null || _g === void 0 ? void 0 : _g.clickedTooltipContent, icon: (_h = additionalActions[action]) === null || _h === void 0 ? void 0 : _h.icon, isClicked: activeButton === action }));
27
44
  })));
28
45
  };
29
46
  export default ResponseActions;
@@ -13,25 +13,30 @@ import '@testing-library/jest-dom';
13
13
  import ResponseActions from './ResponseActions';
14
14
  import userEvent from '@testing-library/user-event';
15
15
  import { DownloadIcon, InfoCircleIcon, RedoIcon } from '@patternfly/react-icons';
16
+ import Message from '../Message';
16
17
  const ALL_ACTIONS = [
17
- { type: 'positive', label: 'Good response' },
18
- { type: 'negative', label: 'Bad response' },
19
- { type: 'copy', label: 'Copy' },
20
- { type: 'share', label: 'Share' },
21
- { type: 'listen', label: 'Listen' }
18
+ { type: 'positive', label: 'Good response', clickedLabel: 'Response recorded' },
19
+ { type: 'negative', label: 'Bad response', clickedLabel: 'Response recorded' },
20
+ { type: 'copy', label: 'Copy', clickedLabel: 'Copied' },
21
+ { type: 'share', label: 'Share', clickedLabel: 'Shared' },
22
+ { type: 'listen', label: 'Listen', clickedLabel: 'Listening' }
22
23
  ];
23
24
  const CUSTOM_ACTIONS = [
24
25
  {
25
26
  regenerate: {
26
27
  ariaLabel: 'Regenerate',
28
+ clickedAriaLabel: 'Regenerated',
27
29
  onClick: jest.fn(),
28
30
  tooltipContent: 'Regenerate',
31
+ clickedTooltipContent: 'Regenerated',
29
32
  icon: React.createElement(RedoIcon, null)
30
33
  },
31
34
  download: {
32
35
  ariaLabel: 'Download',
36
+ clickedAriaLabel: 'Downloaded',
33
37
  onClick: jest.fn(),
34
38
  tooltipContent: 'Download',
39
+ clickedTooltipContent: 'Downloaded',
35
40
  icon: React.createElement(DownloadIcon, null)
36
41
  },
37
42
  info: {
@@ -43,6 +48,59 @@ const CUSTOM_ACTIONS = [
43
48
  }
44
49
  ];
45
50
  describe('ResponseActions', () => {
51
+ afterEach(() => {
52
+ jest.clearAllMocks();
53
+ });
54
+ it('should handle click within group of buttons correctly', () => __awaiter(void 0, void 0, void 0, function* () {
55
+ render(React.createElement(ResponseActions, { actions: {
56
+ positive: { onClick: jest.fn() },
57
+ negative: { onClick: jest.fn() },
58
+ copy: { onClick: jest.fn() },
59
+ share: { onClick: jest.fn() },
60
+ listen: { onClick: jest.fn() }
61
+ } }));
62
+ const goodBtn = screen.getByRole('button', { name: 'Good response' });
63
+ const badBtn = screen.getByRole('button', { name: 'Bad response' });
64
+ const copyBtn = screen.getByRole('button', { name: 'Copy' });
65
+ const shareBtn = screen.getByRole('button', { name: 'Share' });
66
+ const listenBtn = screen.getByRole('button', { name: 'Listen' });
67
+ const buttons = [goodBtn, badBtn, copyBtn, shareBtn, listenBtn];
68
+ buttons.forEach((button) => {
69
+ expect(button).toBeTruthy();
70
+ });
71
+ yield userEvent.click(goodBtn);
72
+ expect(screen.getByRole('button', { name: 'Response recorded' })).toHaveClass('pf-chatbot__button--response-action-clicked');
73
+ let unclickedButtons = buttons.filter((button) => button !== goodBtn);
74
+ unclickedButtons.forEach((button) => {
75
+ expect(button).not.toHaveClass('pf-chatbot__button--response-action-clicked');
76
+ });
77
+ yield userEvent.click(badBtn);
78
+ expect(screen.getByRole('button', { name: 'Response recorded' })).toHaveClass('pf-chatbot__button--response-action-clicked');
79
+ unclickedButtons = buttons.filter((button) => button !== badBtn);
80
+ unclickedButtons.forEach((button) => {
81
+ expect(button).not.toHaveClass('pf-chatbot__button--response-action-clicked');
82
+ });
83
+ }));
84
+ it('should handle click outside of group of buttons correctly', () => __awaiter(void 0, void 0, void 0, function* () {
85
+ // using message just so we have something outside the group that's rendered
86
+ render(React.createElement(Message, { name: "Bot", role: "bot", avatar: "", content: "Example with all prebuilt actions", actions: {
87
+ positive: {},
88
+ negative: {}
89
+ } }));
90
+ const goodBtn = screen.getByRole('button', { name: 'Good response' });
91
+ const badBtn = screen.getByRole('button', { name: 'Bad response' });
92
+ expect(goodBtn).toBeTruthy();
93
+ expect(badBtn).toBeTruthy();
94
+ yield userEvent.click(goodBtn);
95
+ expect(screen.getByRole('button', { name: 'Response recorded' })).toHaveClass('pf-chatbot__button--response-action-clicked');
96
+ expect(badBtn).not.toHaveClass('pf-chatbot__button--response-action-clicked');
97
+ yield userEvent.click(badBtn);
98
+ expect(screen.getByRole('button', { name: 'Response recorded' })).toHaveClass('pf-chatbot__button--response-action-clicked');
99
+ expect(goodBtn).not.toHaveClass('pf-chatbot__button--response-action-clicked');
100
+ yield userEvent.click(screen.getByText('Example with all prebuilt actions'));
101
+ expect(goodBtn).not.toHaveClass('pf-chatbot__button--response-action-clicked');
102
+ expect(badBtn).not.toHaveClass('pf-chatbot__button--response-action-clicked');
103
+ }));
46
104
  it('should render buttons correctly', () => {
47
105
  ALL_ACTIONS.forEach(({ type, label }) => {
48
106
  render(React.createElement(ResponseActions, { actions: { [type]: { onClick: jest.fn() } } }));
@@ -57,6 +115,22 @@ describe('ResponseActions', () => {
57
115
  expect(spy).toHaveBeenCalledTimes(1);
58
116
  }));
59
117
  }));
118
+ it('should swap clicked and non-clicked aria labels on click', () => __awaiter(void 0, void 0, void 0, function* () {
119
+ ALL_ACTIONS.forEach((_a) => __awaiter(void 0, [_a], void 0, function* ({ type, label, clickedLabel }) {
120
+ render(React.createElement(ResponseActions, { actions: { [type]: { onClick: jest.fn() } } }));
121
+ expect(screen.getByRole('button', { name: label })).toBeTruthy();
122
+ yield userEvent.click(screen.getByRole('button', { name: label }));
123
+ expect(screen.getByRole('button', { name: clickedLabel })).toBeTruthy();
124
+ }));
125
+ }));
126
+ it('should swap clicked and non-clicked tooltips on click', () => __awaiter(void 0, void 0, void 0, function* () {
127
+ ALL_ACTIONS.forEach((_a) => __awaiter(void 0, [_a], void 0, function* ({ type, label, clickedLabel }) {
128
+ render(React.createElement(ResponseActions, { actions: { [type]: { onClick: jest.fn() } } }));
129
+ expect(screen.getByRole('button', { name: label })).toBeTruthy();
130
+ yield userEvent.click(screen.getByRole('button', { name: label }));
131
+ expect(screen.getByRole('tooltip', { name: clickedLabel })).toBeTruthy();
132
+ }));
133
+ }));
60
134
  it('should be able to change aria labels', () => {
61
135
  const actions = [
62
136
  { type: 'positive', ariaLabel: 'Thumbs up' },
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ export interface SettingsFormProps {
3
+ /** Class applied to form container */
4
+ className?: string;
5
+ /** Array of fields to display in the settings layout */
6
+ fields?: {
7
+ id: string;
8
+ label: string;
9
+ field: React.ReactElement;
10
+ }[];
11
+ }
12
+ export declare const SettingsForm: React.FunctionComponent<SettingsFormProps>;
13
+ export default SettingsForm;
@@ -0,0 +1,20 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import React from 'react';
13
+ export const SettingsForm = (_a) => {
14
+ var { className, fields = [] } = _a, props = __rest(_a, ["className", "fields"]);
15
+ return (React.createElement("div", Object.assign({ className: `pf-chatbot__settings-form-container ${className}` }, props),
16
+ React.createElement("form", { className: "pf-chatbot__settings-form" }, fields.map((field) => (React.createElement("div", { className: "pf-chatbot__settings-form-row", key: field.label },
17
+ React.createElement("label", { className: "pf-chatbot__settings-label", htmlFor: field.id }, field.label),
18
+ field.field))))));
19
+ };
20
+ export default SettingsForm;
@@ -0,0 +1,2 @@
1
+ export { default } from './SettingsForm';
2
+ export * from './SettingsForm';
@@ -0,0 +1,2 @@
1
+ export { default } from './SettingsForm';
2
+ export * from './SettingsForm';
@@ -42,6 +42,8 @@ export { default as PreviewAttachment } from './PreviewAttachment';
42
42
  export * from './PreviewAttachment';
43
43
  export { default as ResponseActions } from './ResponseActions';
44
44
  export * from './ResponseActions';
45
+ export { default as Settings } from './Settings';
46
+ export * from './Settings';
45
47
  export { default as SourceDetailsMenuItem } from './SourceDetailsMenuItem';
46
48
  export * from './SourceDetailsMenuItem';
47
49
  export { default as SourcesCard } from './SourcesCard';
package/dist/esm/index.js CHANGED
@@ -43,6 +43,8 @@ export { default as PreviewAttachment } from './PreviewAttachment';
43
43
  export * from './PreviewAttachment';
44
44
  export { default as ResponseActions } from './ResponseActions';
45
45
  export * from './ResponseActions';
46
+ export { default as Settings } from './Settings';
47
+ export * from './Settings';
46
48
  export { default as SourceDetailsMenuItem } from './SourceDetailsMenuItem';
47
49
  export * from './SourceDetailsMenuItem';
48
50
  export { default as SourcesCard } from './SourcesCard';
@@ -1 +1 @@
1
- {"root":["../src/index.ts","../src/AttachMenu/AttachMenu.tsx","../src/AttachMenu/index.ts","../src/AttachmentEdit/AttachmentEdit.tsx","../src/AttachmentEdit/index.ts","../src/Chatbot/Chatbot.tsx","../src/Chatbot/index.ts","../src/ChatbotAlert/ChatbotAlert.tsx","../src/ChatbotAlert/index.ts","../src/ChatbotContent/ChatbotContent.tsx","../src/ChatbotContent/index.ts","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx","../src/ChatbotConversationHistoryNav/index.ts","../src/ChatbotFooter/ChatbotFooter.tsx","../src/ChatbotFooter/ChatbotFootnote.tsx","../src/ChatbotFooter/index.ts","../src/ChatbotHeader/ChatbotHeader.tsx","../src/ChatbotHeader/ChatbotHeaderActions.tsx","../src/ChatbotHeader/ChatbotHeaderMain.tsx","../src/ChatbotHeader/ChatbotHeaderMenu.tsx","../src/ChatbotHeader/ChatbotHeaderOptionsDropdown.tsx","../src/ChatbotHeader/ChatbotHeaderSelectorDropdown.tsx","../src/ChatbotHeader/ChatbotHeaderTitle.tsx","../src/ChatbotHeader/index.ts","../src/ChatbotModal/ChatbotModal.tsx","../src/ChatbotModal/index.ts","../src/ChatbotPopover/ChatbotPopover.tsx","../src/ChatbotPopover/index.ts","../src/ChatbotToggle/ChatbotToggle.test.tsx","../src/ChatbotToggle/ChatbotToggle.tsx","../src/ChatbotToggle/index.ts","../src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.tsx","../src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.tsx","../src/ChatbotWelcomePrompt/index.ts","../src/CodeModal/CodeModal.tsx","../src/CodeModal/index.ts","../src/FileDetails/FileDetails.test.tsx","../src/FileDetails/FileDetails.tsx","../src/FileDetails/index.ts","../src/FileDetailsLabel/FileDetailsLabel.test.tsx","../src/FileDetailsLabel/FileDetailsLabel.tsx","../src/FileDetailsLabel/index.ts","../src/FileDropZone/FileDropZone.test.tsx","../src/FileDropZone/FileDropZone.tsx","../src/FileDropZone/index.ts","../src/LoadingMessage/LoadingMessage.test.tsx","../src/LoadingMessage/LoadingMessage.tsx","../src/LoadingMessage/index.ts","../src/Message/Message.test.tsx","../src/Message/Message.tsx","../src/Message/MessageLoading.tsx","../src/Message/index.ts","../src/Message/CodeBlockMessage/CodeBlockMessage.tsx","../src/Message/ListMessage/ListItemMessage.tsx","../src/Message/ListMessage/OrderedListMessage.tsx","../src/Message/ListMessage/UnorderedListMessage.tsx","../src/Message/TextMessage/TextMessage.tsx","../src/MessageBar/AttachButton.test.tsx","../src/MessageBar/AttachButton.tsx","../src/MessageBar/MessageBar.test.tsx","../src/MessageBar/MessageBar.tsx","../src/MessageBar/MicrophoneButton.tsx","../src/MessageBar/SendButton.test.tsx","../src/MessageBar/SendButton.tsx","../src/MessageBar/StopButton.test.tsx","../src/MessageBar/StopButton.tsx","../src/MessageBar/index.ts","../src/MessageBox/JumpButton.test.tsx","../src/MessageBox/JumpButton.tsx","../src/MessageBox/MessageBox.tsx","../src/MessageBox/index.ts","../src/PreviewAttachment/PreviewAttachment.tsx","../src/PreviewAttachment/index.ts","../src/ResponseActions/ResponseActionButton.tsx","../src/ResponseActions/ResponseActions.test.tsx","../src/ResponseActions/ResponseActions.tsx","../src/ResponseActions/index.ts","../src/SourceDetailsMenuItem/SourceDetailsMenuItem.tsx","../src/SourceDetailsMenuItem/index.ts","../src/SourcesCard/SourcesCard.test.tsx","../src/SourcesCard/SourcesCard.tsx","../src/SourcesCard/index.ts","../src/TermsOfUse/TermsOfUse.test.tsx","../src/TermsOfUse/TermsOfUse.tsx","../src/TermsOfUse/index.ts"],"version":"5.6.3"}
1
+ {"root":["../src/index.ts","../src/AttachMenu/AttachMenu.tsx","../src/AttachMenu/index.ts","../src/AttachmentEdit/AttachmentEdit.tsx","../src/AttachmentEdit/index.ts","../src/Chatbot/Chatbot.tsx","../src/Chatbot/index.ts","../src/ChatbotAlert/ChatbotAlert.tsx","../src/ChatbotAlert/index.ts","../src/ChatbotContent/ChatbotContent.tsx","../src/ChatbotContent/index.ts","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.test.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryDropdown.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.test.tsx","../src/ChatbotConversationHistoryNav/ChatbotConversationHistoryNav.tsx","../src/ChatbotConversationHistoryNav/index.ts","../src/ChatbotFooter/ChatbotFooter.tsx","../src/ChatbotFooter/ChatbotFootnote.tsx","../src/ChatbotFooter/index.ts","../src/ChatbotHeader/ChatbotHeader.tsx","../src/ChatbotHeader/ChatbotHeaderActions.tsx","../src/ChatbotHeader/ChatbotHeaderCloseButton.tsx","../src/ChatbotHeader/ChatbotHeaderMain.tsx","../src/ChatbotHeader/ChatbotHeaderMenu.tsx","../src/ChatbotHeader/ChatbotHeaderOptionsDropdown.tsx","../src/ChatbotHeader/ChatbotHeaderSelectorDropdown.tsx","../src/ChatbotHeader/ChatbotHeaderTitle.tsx","../src/ChatbotHeader/index.ts","../src/ChatbotModal/ChatbotModal.tsx","../src/ChatbotModal/index.ts","../src/ChatbotPopover/ChatbotPopover.tsx","../src/ChatbotPopover/index.ts","../src/ChatbotToggle/ChatbotToggle.test.tsx","../src/ChatbotToggle/ChatbotToggle.tsx","../src/ChatbotToggle/index.ts","../src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.test.tsx","../src/ChatbotWelcomePrompt/ChatbotWelcomePrompt.tsx","../src/ChatbotWelcomePrompt/index.ts","../src/CodeModal/CodeModal.tsx","../src/CodeModal/index.ts","../src/FileDetails/FileDetails.test.tsx","../src/FileDetails/FileDetails.tsx","../src/FileDetails/index.ts","../src/FileDetailsLabel/FileDetailsLabel.test.tsx","../src/FileDetailsLabel/FileDetailsLabel.tsx","../src/FileDetailsLabel/index.ts","../src/FileDropZone/FileDropZone.test.tsx","../src/FileDropZone/FileDropZone.tsx","../src/FileDropZone/index.ts","../src/LoadingMessage/LoadingMessage.test.tsx","../src/LoadingMessage/LoadingMessage.tsx","../src/LoadingMessage/index.ts","../src/Message/Message.test.tsx","../src/Message/Message.tsx","../src/Message/MessageLoading.tsx","../src/Message/index.ts","../src/Message/CodeBlockMessage/CodeBlockMessage.tsx","../src/Message/ListMessage/ListItemMessage.tsx","../src/Message/ListMessage/OrderedListMessage.tsx","../src/Message/ListMessage/UnorderedListMessage.tsx","../src/Message/TextMessage/TextMessage.tsx","../src/MessageBar/AttachButton.test.tsx","../src/MessageBar/AttachButton.tsx","../src/MessageBar/MessageBar.test.tsx","../src/MessageBar/MessageBar.tsx","../src/MessageBar/MicrophoneButton.tsx","../src/MessageBar/SendButton.test.tsx","../src/MessageBar/SendButton.tsx","../src/MessageBar/StopButton.test.tsx","../src/MessageBar/StopButton.tsx","../src/MessageBar/index.ts","../src/MessageBox/JumpButton.test.tsx","../src/MessageBox/JumpButton.tsx","../src/MessageBox/MessageBox.tsx","../src/MessageBox/index.ts","../src/PreviewAttachment/PreviewAttachment.tsx","../src/PreviewAttachment/index.ts","../src/ResponseActions/ResponseActionButton.test.tsx","../src/ResponseActions/ResponseActionButton.tsx","../src/ResponseActions/ResponseActions.test.tsx","../src/ResponseActions/ResponseActions.tsx","../src/ResponseActions/index.ts","../src/Settings/SettingsForm.tsx","../src/Settings/index.ts","../src/SourceDetailsMenuItem/SourceDetailsMenuItem.tsx","../src/SourceDetailsMenuItem/index.ts","../src/SourcesCard/SourcesCard.test.tsx","../src/SourcesCard/SourcesCard.tsx","../src/SourcesCard/index.ts","../src/TermsOfUse/TermsOfUse.test.tsx","../src/TermsOfUse/TermsOfUse.tsx","../src/TermsOfUse/index.ts"],"version":"5.6.3"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@patternfly/chatbot",
3
- "version": "2.2.0-prerelease.4",
3
+ "version": "2.2.0-prerelease.6",
4
4
  "description": "This library provides React components based on PatternFly 6 that can be used to build chatbots.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -15,16 +15,20 @@ export const CustomActionExample: React.FunctionComponent = () => (
15
15
  actions={{
16
16
  regenerate: {
17
17
  ariaLabel: 'Regenerate',
18
+ clickedAriaLabel: 'Regenerated',
18
19
  // eslint-disable-next-line no-console
19
20
  onClick: () => console.log('Clicked regenerate'),
20
21
  tooltipContent: 'Regenerate',
22
+ clickedTooltipContent: 'Regenerated',
21
23
  icon: <RedoIcon />
22
24
  },
23
25
  download: {
24
26
  ariaLabel: 'Download',
27
+ clickedAriaLabel: 'Downloaded',
25
28
  // eslint-disable-next-line no-console
26
29
  onClick: () => console.log('Clicked download'),
27
30
  tooltipContent: 'Download',
31
+ clickedTooltipContent: 'Downloaded',
28
32
  icon: <DownloadIcon />
29
33
  },
30
34
  info: {
@@ -63,7 +63,7 @@ You can further customize the avatar by applying an additional class or passing
63
63
 
64
64
  ```
65
65
 
66
- ### Messages actions
66
+ ### Message actions
67
67
 
68
68
  You can add actions to a message, to allow users to interact with the message content. These actions can include:
69
69
 
@@ -79,7 +79,18 @@ You can add actions to a message, to allow users to interact with the message co
79
79
 
80
80
  ### Custom message actions
81
81
 
82
- Beyond the standard message actions (positive, negative, copy, share, or listen), you can add custom actions to a bot message by passing an `actions` object to the `<Message>` component. This object can contain the following customizations: `ariaLabel`, `onClick`, `className`, `isDisabled`, `tooltipContent`, `tooltipProps`, and `icon`.
82
+ Beyond the standard message actions (good response, bad response, copy, share, or listen), you can add custom actions to a bot message by passing an `actions` object to the `<Message>` component. This object can contain the following customizations:
83
+
84
+ - `ariaLabel`
85
+ - `onClick`
86
+ - `className`
87
+ - `isDisabled`
88
+ - `tooltipContent`
89
+ - `tooltipContent`
90
+ - `tooltipProps`
91
+ - `icon`
92
+
93
+ You can apply a `clickedAriaLabel` and `clickedTooltipContent` once a button is clicked. If either of these props are omitted, their values will default to the `ariaLabel` or `tooltipContent` supplied.
83
94
 
84
95
  ```js file="./MessageWithCustomResponseActions.tsx"
85
96