@patternfly/chatbot 6.8.0-prerelease.4 → 6.8.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.
- package/dist/cjs/ChatbotHeader/ChatbotHeaderMenu.js +2 -5
- package/dist/cjs/FileDetailsLabel/FileDetailsLabel.js +1 -1
- package/dist/cjs/FileDropZone/FileDropZone.js +1 -1
- package/dist/cjs/ImagePreview/ImagePreview.js +1 -1
- package/dist/cjs/Message/CodeBlockMessage/CodeBlockMessage.js +1 -2
- package/dist/cjs/Message/Message.test.js +1 -20
- package/dist/cjs/Message/QuickResponse/QuickResponse.js +1 -1
- package/dist/cjs/Message/QuickStarts/QuickStartTile.js +4 -6
- package/dist/cjs/MessageBar/AttachButton.js +2 -2
- package/dist/cjs/MessageBar/MessageBar.test.js +1 -1
- package/dist/cjs/MessageBar/MicrophoneButton.js +2 -4
- package/dist/cjs/MessageBox/JumpButton.js +2 -4
- package/dist/cjs/SourcesCardBase/SourcesCardBase.js +5 -5
- package/dist/css/main.css +0 -13
- package/dist/css/main.css.map +1 -1
- package/dist/esm/ChatbotHeader/ChatbotHeaderMenu.js +2 -2
- package/dist/esm/FileDetailsLabel/FileDetailsLabel.js +2 -2
- package/dist/esm/FileDropZone/FileDropZone.js +2 -2
- package/dist/esm/ImagePreview/ImagePreview.js +2 -2
- package/dist/esm/Message/CodeBlockMessage/CodeBlockMessage.js +2 -3
- package/dist/esm/Message/Message.test.js +1 -20
- package/dist/esm/Message/QuickResponse/QuickResponse.js +2 -2
- package/dist/esm/Message/QuickStarts/QuickStartTile.js +4 -6
- package/dist/esm/MessageBar/AttachButton.js +2 -2
- package/dist/esm/MessageBar/MessageBar.test.js +2 -2
- package/dist/esm/MessageBar/MicrophoneButton.js +2 -4
- package/dist/esm/MessageBox/JumpButton.js +2 -4
- package/dist/esm/SourcesCardBase/SourcesCardBase.js +7 -7
- package/package.json +1 -5
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/MessageWithSources.tsx +3 -3
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/Messages.md +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/explore-pipeline-quickstart.ts +0 -3
- package/patternfly-docs/content/extensions/chatbot/examples/demos/AttachmentDemos.md +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/demos/Chatbot.md +1 -1
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotAttachmentMenu.tsx +13 -7
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotDisplayMode.tsx +7 -2
- package/patternfly-docs/content/extensions/chatbot/examples/demos/ChatbotInDrawer.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedChatbot.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedComparisonChatbot.tsx +2 -2
- package/patternfly-docs/content/extensions/chatbot/examples/demos/WhiteEmbeddedChatbot.tsx +2 -2
- package/src/ChatbotHeader/ChatbotHeaderMenu.tsx +2 -2
- package/src/FileDetailsLabel/FileDetailsLabel.tsx +2 -2
- package/src/FileDropZone/FileDropZone.tsx +2 -2
- package/src/ImagePreview/ImagePreview.tsx +6 -2
- package/src/Message/CodeBlockMessage/CodeBlockMessage.tsx +2 -3
- package/src/Message/Message.test.tsx +8 -5
- package/src/Message/QuickResponse/QuickResponse.tsx +2 -2
- package/src/Message/QuickStarts/QuickStartTile.tsx +9 -6
- package/src/MessageBar/AttachButton.tsx +2 -2
- package/src/MessageBar/MessageBar.test.tsx +6 -6
- package/src/MessageBar/MicrophoneButton.tsx +2 -7
- package/src/MessageBox/JumpButton.tsx +2 -6
- package/src/SourcesCard/SourcesCard.scss +0 -13
- package/src/SourcesCardBase/SourcesCardBase.tsx +7 -32
- package/src/index.ts +0 -3
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/AttachMenu.tsx +0 -149
- package/patternfly-docs/content/extensions/chatbot/examples/Messages/PaperclipIcon.svg +0 -10
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import RocketIcon from '@patternfly/react-icons/dist/js/icons/rocket-icon';
|
|
3
|
-
import OutlinedBookmarkIcon from '@patternfly/react-icons/dist/js/icons/outlined-bookmark-icon';
|
|
4
2
|
import { Card, CardBody, CardHeader, CardFooter, CardTitle, Icon, Button, Flex, Stack, Label, pluralize } from '@patternfly/react-core';
|
|
5
|
-
import OutlinedClockIcon from '@patternfly/react-icons/dist/js/icons/outlined-clock-icon';
|
|
6
3
|
import QuickStartTileHeader from './QuickStartTileHeader';
|
|
7
4
|
import QuickStartTileDescription from './QuickStartTileDescription';
|
|
8
5
|
import FallbackImg from './FallbackImg';
|
|
6
|
+
import { RhUiBookmarkIcon, RhUiClockIcon, RhUiRocketFillIcon } from '@patternfly/react-icons';
|
|
9
7
|
export const camelize = (str) => str.replace(/(?:^\w|[A-Z]|\b\w|\s+)/g, function (match, index) {
|
|
10
8
|
if (+match === 0) {
|
|
11
9
|
return '';
|
|
@@ -19,7 +17,7 @@ export const QuickStartTile = ({ className, quickStart, onClick, onSelectQuickSt
|
|
|
19
17
|
quickStartIcon = _jsx(Icon, { size: "2xl", children: icon });
|
|
20
18
|
}
|
|
21
19
|
else {
|
|
22
|
-
quickStartIcon = (_jsx(Icon, { size: "2xl", children: _jsx(FallbackImg, { src: icon, alt: "", className: "pfext-catalog-item-icon__img", fallback: _jsx(
|
|
20
|
+
quickStartIcon = (_jsx(Icon, { size: "2xl", children: _jsx(FallbackImg, { src: icon, alt: "", className: "pfext-catalog-item-icon__img", fallback: _jsx(RhUiRocketFillIcon, {}) }) }));
|
|
23
21
|
}
|
|
24
22
|
const onSelect = () => {
|
|
25
23
|
if (!link) {
|
|
@@ -30,10 +28,10 @@ export const QuickStartTile = ({ className, quickStart, onClick, onSelectQuickSt
|
|
|
30
28
|
}
|
|
31
29
|
onClick && onClick();
|
|
32
30
|
};
|
|
33
|
-
const ActionIcon = (action === null || action === void 0 ? void 0 : action.icon) ||
|
|
31
|
+
const ActionIcon = (action === null || action === void 0 ? void 0 : action.icon) || RhUiBookmarkIcon;
|
|
34
32
|
const additionalAction = action ? (_jsx(Button, Object.assign({ "aria-label": action['aria-label'], icon: _jsx(ActionIcon, {}), variant: "plain", onClick: action.onClick }, action.buttonProps))) : undefined;
|
|
35
33
|
return (_jsxs(Card, { className: `pf-chatbot__quickstarts-tile ${className ? className : ''}`, id: `${id}-chatbot-qs-tile`, style: { height: '100%' }, "data-testid": `chatbot-qs-card-${camelize(displayName)}`, isCompact: isCompact, children: [_jsx(CardHeader, Object.assign({}, (action && {
|
|
36
34
|
actions: { actions: additionalAction }
|
|
37
|
-
}), { children: quickStartIcon })), _jsx(CardTitle, { children: _jsx(QuickStartTileHeader, { name: displayName, onSelect: onSelect, quickStartId: id }) }), _jsx(CardBody, { children: _jsxs(Stack, { hasGutter: true, children: [_jsxs(Flex, { spaceItems: { default: 'spaceItemsSm' }, children: [type && _jsx(Label, { color: type.color, children: type.text }), durationMinutes && (_jsx(Label, { variant: "outline", "data-test": "duration", icon: _jsx(
|
|
35
|
+
}), { children: quickStartIcon })), _jsx(CardTitle, { children: _jsx(QuickStartTileHeader, { name: displayName, onSelect: onSelect, quickStartId: id }) }), _jsx(CardBody, { children: _jsxs(Stack, { hasGutter: true, children: [_jsxs(Flex, { spaceItems: { default: 'spaceItemsSm' }, children: [type && _jsx(Label, { color: type.color, children: type.text }), durationMinutes && (_jsx(Label, { variant: "outline", "data-test": "duration", icon: _jsx(RhUiClockIcon, {}), children: pluralize(durationMinutes, minuteWord, minuteWordPlural) }))] }), _jsx(QuickStartTileDescription, { description: description, prerequisites: prerequisites, prerequisiteWord: prerequisiteWord, prerequisiteWordPlural: prerequisiteWordPlural, quickStartButtonAriaLabel: quickStartButtonAriaLabel })] }) }), _jsx(CardFooter, { children: _jsx(Button, { variant: "link", isInline: true, onClick: onSelect, children: _jsx("span", { className: "pf-v6-c-button__text", children: "Start" }) }) })] }));
|
|
38
36
|
};
|
|
39
37
|
export default QuickStartTile;
|
|
@@ -14,9 +14,9 @@ import { forwardRef } from 'react';
|
|
|
14
14
|
// Import PatternFly components
|
|
15
15
|
import { Button, Icon, Tooltip } from '@patternfly/react-core';
|
|
16
16
|
import { useDropzone } from 'react-dropzone';
|
|
17
|
-
import {
|
|
17
|
+
import { RhUiPaperClipIcon } from '@patternfly/react-icons';
|
|
18
18
|
const AttachButtonBase = (_a) => {
|
|
19
|
-
var { onAttachAccepted, onClick, isDisabled, className, tooltipProps, innerRef, tooltipContent = 'Attach', inputTestId, isCompact, allowedFileTypes, minSize, maxSize, maxFiles, isAttachmentDisabled, onAttach, onAttachRejected, validator, dropzoneProps, icon = _jsx(
|
|
19
|
+
var { onAttachAccepted, onClick, isDisabled, className, tooltipProps, innerRef, tooltipContent = 'Attach', inputTestId, isCompact, allowedFileTypes, minSize, maxSize, maxFiles, isAttachmentDisabled, onAttach, onAttachRejected, validator, dropzoneProps, icon = _jsx(RhUiPaperClipIcon, {}) } = _a, props = __rest(_a, ["onAttachAccepted", "onClick", "isDisabled", "className", "tooltipProps", "innerRef", "tooltipContent", "inputTestId", "isCompact", "allowedFileTypes", "minSize", "maxSize", "maxFiles", "isAttachmentDisabled", "onAttach", "onAttachRejected", "validator", "dropzoneProps", "icon"]);
|
|
20
20
|
const { open, getInputProps } = useDropzone(Object.assign({ multiple: true, onDropAccepted: onAttachAccepted, accept: allowedFileTypes, minSize,
|
|
21
21
|
maxSize,
|
|
22
22
|
maxFiles, disabled: isAttachmentDisabled, onDrop: onAttach, onDropRejected: onAttachRejected, validator }, dropzoneProps));
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
11
11
|
import '@testing-library/jest-dom';
|
|
12
12
|
import { DropdownGroup, DropdownItem, DropdownList } from '@patternfly/react-core';
|
|
13
|
-
import {
|
|
13
|
+
import { RhUiAttentionBellIcon, RhUiCalendarIcon, RhUiClipboardIcon, RhUiCodeIcon } from '@patternfly/react-icons';
|
|
14
14
|
import { render, screen } from '@testing-library/react';
|
|
15
15
|
import userEvent from '@testing-library/user-event';
|
|
16
16
|
import { createRef } from 'react';
|
|
@@ -18,7 +18,7 @@ import SourceDetailsMenuItem from '../SourceDetailsMenuItem';
|
|
|
18
18
|
import { MessageBar } from './MessageBar';
|
|
19
19
|
const ATTACH_MENU_ITEMS = [
|
|
20
20
|
_jsx(DropdownList, { children: _jsx(DropdownItem, { className: "pf-chatbot-source-details-dropdown-item", value: "auth-operator Pod", id: "0", children: _jsx(SourceDetailsMenuItem, { icon: _jsxs("svg", { width: "24", height: "25", viewBox: "0 0 24 25", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [_jsx("path", { d: "M0 12.5C0 5.87258 5.37258 0.5 12 0.5C18.6274 0.5 24 5.87258 24 12.5C24 19.1274 18.6274 24.5 12 24.5C5.37258 24.5 0 19.1274 0 12.5Z", fill: "currentColor" }), _jsx("g", { clipPath: "url(#clip0_3280_27488)", children: _jsx("path", { d: "M8.25 8.75C8.25 7.92266 8.92266 7.25 9.75 7.25H12C14.0719 7.25 15.75 8.92812 15.75 11C15.75 13.0719 14.0719 14.75 12 14.75H9.75V17C9.75 17.4148 9.41484 17.75 9 17.75C8.58516 17.75 8.25 17.4148 8.25 17V14V8.75ZM9.75 13.25H12C13.2422 13.25 14.25 12.2422 14.25 11C14.25 9.75781 13.2422 8.75 12 8.75H9.75V13.25Z", fill: "white" }) }), _jsx("defs", { children: _jsx("clipPath", { id: "clip0_3280_27488", children: _jsx("rect", { width: "7.5", height: "12", fill: "white", transform: "translate(8.25 6.5)" }) }) })] }), name: "auth-operator", type: "Pod" }) }) }, "list-1"),
|
|
21
|
-
_jsx(DropdownGroup, { children: _jsxs(DropdownList, { children: [_jsx(DropdownItem, { value: "Alerts", id: "1", icon: _jsx(
|
|
21
|
+
_jsx(DropdownGroup, { children: _jsxs(DropdownList, { children: [_jsx(DropdownItem, { value: "Alerts", id: "1", icon: _jsx(RhUiAttentionBellIcon, {}), children: "Alerts" }), _jsx(DropdownItem, { value: "Events", id: "2", icon: _jsx(RhUiCalendarIcon, {}), children: "Events" }), _jsx(DropdownItem, { value: "Logs", id: "3", icon: _jsx(RhUiClipboardIcon, {}), children: "Logs" }), _jsx(DropdownItem, { value: "YAML - Status", id: "4", icon: _jsx(RhUiCodeIcon, {}), children: "YAML - Status" }), _jsx(DropdownItem, { value: "YAML - All contents", id: "5", icon: _jsx(RhUiCodeIcon, {}), children: "YAML - All contents" })] }) }, "group2")
|
|
22
22
|
];
|
|
23
23
|
const originalSpeechRecognition = window.SpeechRecognition;
|
|
24
24
|
const mockSpeechRecognition = () => {
|
|
@@ -11,10 +11,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import { useState, useCallback, useEffect } from 'react';
|
|
14
|
-
// Import PatternFly components
|
|
15
14
|
import { Button, Tooltip, Icon } from '@patternfly/react-core';
|
|
16
|
-
|
|
17
|
-
import { MicrophoneIcon } from '@patternfly/react-icons/dist/esm/icons/microphone-icon';
|
|
15
|
+
import { RhUiMicrophoneFillIcon } from '@patternfly/react-icons';
|
|
18
16
|
export const MicrophoneButton = (_a) => {
|
|
19
17
|
var { isListening, onIsListeningChange, onSpeechRecognition, className, tooltipProps, tooltipContent = { active: 'Stop listening', inactive: 'Use microphone' }, language = 'en-US', isCompact } = _a, props = __rest(_a, ["isListening", "onIsListeningChange", "onSpeechRecognition", "className", "tooltipProps", "tooltipContent", "language", "isCompact"]);
|
|
20
18
|
// Microphone
|
|
@@ -60,6 +58,6 @@ export const MicrophoneButton = (_a) => {
|
|
|
60
58
|
if (!speechRecognition) {
|
|
61
59
|
return null;
|
|
62
60
|
}
|
|
63
|
-
return (_jsx(Tooltip, Object.assign({ aria: "none", "aria-live": "polite", id: "pf-chatbot__tooltip--use-microphone", content: isListening ? tooltipContent.active : tooltipContent.inactive, position: (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.position) || 'top', 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, { children: _jsx(Button, Object.assign({ variant: "plain", className: `pf-chatbot__button--microphone ${isListening ? 'pf-chatbot__button--microphone--active' : ''} ${isCompact ? 'pf-m-compact' : ''} ${className !== null && className !== void 0 ? className : ''}`, "aria-label": props['aria-label'] || (isListening ? 'Stop listening' : 'Use microphone'), "aria-pressed": isListening, onClick: isListening ? stopListening : startListening, icon: _jsx(Icon, { iconSize: isCompact ? 'lg' : 'xl', isInline: true, children: _jsx(
|
|
61
|
+
return (_jsx(Tooltip, Object.assign({ aria: "none", "aria-live": "polite", id: "pf-chatbot__tooltip--use-microphone", content: isListening ? tooltipContent.active : tooltipContent.inactive, position: (tooltipProps === null || tooltipProps === void 0 ? void 0 : tooltipProps.position) || 'top', 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, { children: _jsx(Button, Object.assign({ variant: "plain", className: `pf-chatbot__button--microphone ${isListening ? 'pf-chatbot__button--microphone--active' : ''} ${isCompact ? 'pf-m-compact' : ''} ${className !== null && className !== void 0 ? className : ''}`, "aria-label": props['aria-label'] || (isListening ? 'Stop listening' : 'Use microphone'), "aria-pressed": isListening, onClick: isListening ? stopListening : startListening, icon: _jsx(Icon, { iconSize: isCompact ? 'lg' : 'xl', isInline: true, children: _jsx(RhUiMicrophoneFillIcon, {}) }), size: isCompact ? 'sm' : undefined }, props)) })));
|
|
64
62
|
};
|
|
65
63
|
export default MicrophoneButton;
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
// Import PatternFly components
|
|
3
2
|
import { Button, Tooltip, Icon } from '@patternfly/react-core';
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const JumpButton = ({ position, isHidden, onClick, jumpButtonProps, jumpButtonTooltipProps }) => isHidden ? null : (_jsx(Tooltip, Object.assign({ id: `pf-chatbot__tooltip--jump-${position}`, content: `Back to ${position}`, position: "top" }, jumpButtonTooltipProps, { children: _jsx(Button, Object.assign({ variant: "plain", className: `pf-chatbot__jump pf-chatbot__jump--${position}`, "aria-label": `Back to ${position}`, onClick: onClick }, jumpButtonProps, { children: _jsx(Icon, { iconSize: "lg", isInline: true, children: position === 'top' ? _jsx(ArrowUpIcon, {}) : _jsx(ArrowDownIcon, {}) }) })) })));
|
|
3
|
+
import { RhMicronsArrowDownIcon, RhMicronsArrowUpIcon } from '@patternfly/react-icons';
|
|
4
|
+
const JumpButton = ({ position, isHidden, onClick, jumpButtonProps, jumpButtonTooltipProps }) => isHidden ? null : (_jsx(Tooltip, Object.assign({ id: `pf-chatbot__tooltip--jump-${position}`, content: `Back to ${position}`, position: "top" }, jumpButtonTooltipProps, { children: _jsx(Button, Object.assign({ variant: "plain", className: `pf-chatbot__jump pf-chatbot__jump--${position}`, "aria-label": `Back to ${position}`, onClick: onClick }, jumpButtonProps, { children: _jsx(Icon, { iconSize: "lg", isInline: true, children: position === 'top' ? _jsx(RhMicronsArrowUpIcon, {}) : _jsx(RhMicronsArrowDownIcon, {}) }) })) })));
|
|
7
5
|
export default JumpButton;
|
|
@@ -12,8 +12,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { useState } from 'react';
|
|
14
14
|
// Import PatternFly components
|
|
15
|
-
import { Button, ButtonVariant, Card, CardBody, CardFooter, CardTitle, ExpandableSection, ExpandableSectionVariant,
|
|
16
|
-
import {
|
|
15
|
+
import { Button, ButtonVariant, Card, CardBody, CardFooter, CardTitle, ExpandableSection, ExpandableSectionVariant, Truncate } from '@patternfly/react-core';
|
|
16
|
+
import { RhMicronsCaretLeftIcon, RhMicronsCaretRightIcon, RhMicronsExternalLinkIcon } from '@patternfly/react-icons';
|
|
17
17
|
const SourcesCardBase = (_a) => {
|
|
18
18
|
var _b;
|
|
19
19
|
var { className, isDisabled, paginationAriaLabel = 'Pagination', sources, toNextPageAriaLabel = 'Go to next page', toPreviousPageAriaLabel = 'Go to previous page', onNextClick, onPreviousClick, onSetPage, showMoreWords = 'show more', showLessWords = 'show less', isCompact, cardTitleProps, cardBodyProps, cardFooterProps, layout = 'paginated', cardMaxWidth = '400px' } = _a, props = __rest(_a, ["className", "isDisabled", "paginationAriaLabel", "sources", "toNextPageAriaLabel", "toPreviousPageAriaLabel", "onNextClick", "onPreviousClick", "onSetPage", "showMoreWords", "showLessWords", "isCompact", "cardTitleProps", "cardBodyProps", "cardFooterProps", "layout", "cardMaxWidth"]);
|
|
@@ -34,23 +34,23 @@ const SourcesCardBase = (_a) => {
|
|
|
34
34
|
};
|
|
35
35
|
const renderUncontrolledSourceCard = (source, index) => {
|
|
36
36
|
var _a;
|
|
37
|
-
return (_jsx("li", { className: "pf-chatbot__sources-list-item", style: { '--pf-chatbot-sources-card-max-width': cardMaxWidth }, children: _jsxs(Card, Object.assign({ isFullHeight: true, isCompact: isCompact, className: "pf-chatbot__sources-card" }, props, { children: [_jsx(CardTitle, Object.assign({ className: "pf-chatbot__sources-card-title" }, cardTitleProps, { children: _jsxs("div", { className: "pf-chatbot__sources-card-title-container", children: [_jsx(Button, Object.assign({ component: "a", variant: ButtonVariant.link, href: source.link, icon: source.isExternal ? _jsx(
|
|
37
|
+
return (_jsx("li", { className: "pf-chatbot__sources-list-item", style: { '--pf-chatbot-sources-card-max-width': cardMaxWidth }, children: _jsxs(Card, Object.assign({ isFullHeight: true, isCompact: isCompact, className: "pf-chatbot__sources-card" }, props, { children: [_jsx(CardTitle, Object.assign({ className: "pf-chatbot__sources-card-title" }, cardTitleProps, { children: _jsxs("div", { className: "pf-chatbot__sources-card-title-container", children: [_jsx(Button, Object.assign({ component: "a", variant: ButtonVariant.link, href: source.link, icon: source.isExternal ? _jsx(RhMicronsExternalLinkIcon, {}) : undefined, iconPosition: "end", isInline: true, rel: source.isExternal ? 'noreferrer' : undefined, target: source.isExternal ? '_blank' : undefined, onClick: (_a = source.onClick) !== null && _a !== void 0 ? _a : undefined }, source.titleProps, { children: renderTitle(source.title, index, source.truncateProps) })), source.subtitle && _jsx("span", { className: "pf-chatbot__sources-card-subtitle", children: source.subtitle })] }) })), source.body && (_jsx(CardBody, Object.assign({ className: `pf-chatbot__sources-card-body ${source.footer ? 'pf-chatbot__compact-sources-card-body' : undefined}` }, cardBodyProps, { children: source.hasShowMore ? (
|
|
38
38
|
// prevents extra VO announcements of button text - parent Message has aria-live
|
|
39
39
|
_jsx("div", { "aria-live": "off", children: _jsx(ExpandableSection, { variant: ExpandableSectionVariant.truncate, toggleTextCollapsed: showMoreWords, toggleTextExpanded: showLessWords, truncateMaxLines: 2, children: source.body }) })) : (_jsx("div", { className: "pf-chatbot__sources-card-body-text", children: source.body })) }))), source.footer && (_jsx(CardFooter, Object.assign({ className: "pf-chatbot__sources-card-footer" }, cardFooterProps, { children: source.footer })))] })) }, index));
|
|
40
40
|
};
|
|
41
41
|
if (layout === 'wrap') {
|
|
42
42
|
return (_jsx("div", { className: "pf-chatbot__sources-card-base pf-m-wrap", children: _jsx("ul", { className: "pf-chatbot__sources-list", role: "list", children: sources.map((source, index) => renderUncontrolledSourceCard(source, index)) }) }));
|
|
43
43
|
}
|
|
44
|
-
return (_jsx("div", { className: "pf-chatbot__sources-card-base", children: _jsxs(Card, Object.assign({ isCompact: isCompact, className: "pf-chatbot__sources-card" }, props, { children: [_jsx(CardTitle, Object.assign({ className: "pf-chatbot__sources-card-title" }, cardTitleProps, { children: _jsxs("div", { className: "pf-chatbot__sources-card-title-container", children: [_jsx(Button, Object.assign({ component: "a", variant: ButtonVariant.link, href: sources[page - 1].link, icon: sources[page - 1].isExternal ? _jsx(
|
|
44
|
+
return (_jsx("div", { className: "pf-chatbot__sources-card-base", children: _jsxs(Card, Object.assign({ isCompact: isCompact, className: "pf-chatbot__sources-card" }, props, { children: [_jsx(CardTitle, Object.assign({ className: "pf-chatbot__sources-card-title" }, cardTitleProps, { children: _jsxs("div", { className: "pf-chatbot__sources-card-title-container", children: [_jsx(Button, Object.assign({ component: "a", variant: ButtonVariant.link, href: sources[page - 1].link, icon: sources[page - 1].isExternal ? _jsx(RhMicronsExternalLinkIcon, {}) : undefined, iconPosition: "end", isInline: true, rel: sources[page - 1].isExternal ? 'noreferrer' : undefined, target: sources[page - 1].isExternal ? '_blank' : undefined, onClick: (_b = sources[page - 1].onClick) !== null && _b !== void 0 ? _b : undefined }, sources[page - 1].titleProps, { children: renderTitle(sources[page - 1].title, undefined, sources[page - 1].truncateProps) })), sources[page - 1].subtitle && (_jsx("span", { className: "pf-chatbot__sources-card-subtitle", children: sources[page - 1].subtitle }))] }) })), sources[page - 1].body && (_jsx(CardBody, Object.assign({ className: `pf-chatbot__sources-card-body ${sources[page - 1].footer ? 'pf-chatbot__compact-sources-card-body' : undefined}` }, cardBodyProps, { children: sources[page - 1].hasShowMore ? (
|
|
45
45
|
// prevents extra VO announcements of button text - parent Message has aria-live
|
|
46
|
-
_jsx("div", { "aria-live": "off", children: _jsx(ExpandableSection, { variant: ExpandableSectionVariant.truncate, toggleText: isExpanded ? showLessWords : showMoreWords, onToggle: onToggle, isExpanded: isExpanded, truncateMaxLines: 2, children: sources[page - 1].body }) })) : (_jsx("div", { className: "pf-chatbot__sources-card-body-text", children: sources[page - 1].body })) }))), sources[page - 1].footer ? (_jsx(CardFooter, Object.assign({ className: "pf-chatbot__sources-card-footer" }, cardFooterProps, { children: sources[page - 1].footer }))) : (sources.length > 1 && (_jsx(CardFooter, Object.assign({ className: "pf-chatbot__sources-card-footer-container" }, cardFooterProps, { children: _jsx("div", { className: "pf-chatbot__sources-card-footer", children: _jsxs("nav", { className: `pf-chatbot__sources-card-footer-buttons ${className}`, "aria-label": paginationAriaLabel, children: [_jsx(Button, { variant: ButtonVariant.plain, isDisabled: isDisabled || page === 1, "data-action": "previous", onClick: (event) => {
|
|
46
|
+
_jsx("div", { "aria-live": "off", children: _jsx(ExpandableSection, { variant: ExpandableSectionVariant.truncate, toggleText: isExpanded ? showLessWords : showMoreWords, onToggle: onToggle, isExpanded: isExpanded, truncateMaxLines: 2, children: sources[page - 1].body }) })) : (_jsx("div", { className: "pf-chatbot__sources-card-body-text", children: sources[page - 1].body })) }))), sources[page - 1].footer ? (_jsx(CardFooter, Object.assign({ className: "pf-chatbot__sources-card-footer" }, cardFooterProps, { children: sources[page - 1].footer }))) : (sources.length > 1 && (_jsx(CardFooter, Object.assign({ className: "pf-chatbot__sources-card-footer-container" }, cardFooterProps, { children: _jsx("div", { className: "pf-chatbot__sources-card-footer", children: _jsxs("nav", { className: `pf-chatbot__sources-card-footer-buttons ${className}`, "aria-label": paginationAriaLabel, children: [_jsx(Button, { variant: ButtonVariant.plain, isCircle: true, isDisabled: isDisabled || page === 1, "data-action": "previous", onClick: (event) => {
|
|
47
47
|
const newPage = page >= 1 ? page - 1 : 1;
|
|
48
48
|
onPreviousClick && onPreviousClick(event, newPage);
|
|
49
49
|
handleNewPage(event, newPage);
|
|
50
|
-
}, "aria-label": toPreviousPageAriaLabel, children: _jsx(
|
|
50
|
+
}, "aria-label": toPreviousPageAriaLabel, children: _jsx(RhMicronsCaretLeftIcon, {}) }), _jsxs("span", { "aria-hidden": "true", children: [page, "/", sources.length] }), _jsx(Button, { variant: ButtonVariant.plain, isCircle: true, isDisabled: isDisabled || page === sources.length, "aria-label": toNextPageAriaLabel, "data-action": "next", onClick: (event) => {
|
|
51
51
|
const newPage = page + 1 <= sources.length ? page + 1 : sources.length;
|
|
52
52
|
onNextClick && onNextClick(event, newPage);
|
|
53
53
|
handleNewPage(event, newPage);
|
|
54
|
-
}, children: _jsx(
|
|
54
|
+
}, children: _jsx(RhMicronsCaretRightIcon, {}) })] }) }) }))))] })) }));
|
|
55
55
|
};
|
|
56
56
|
export default SourcesCardBase;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/chatbot",
|
|
3
|
-
"version": "6.8.0-prerelease.
|
|
3
|
+
"version": "6.8.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",
|
|
@@ -88,9 +88,5 @@
|
|
|
88
88
|
"victory-stack": "^37.1.1",
|
|
89
89
|
"victory-tooltip": "^37.1.1",
|
|
90
90
|
"victory-voronoi-container": "^37.1.1"
|
|
91
|
-
},
|
|
92
|
-
"overrides": {
|
|
93
|
-
"puppeteer": "^23.6.1",
|
|
94
|
-
"puppeteer-cluster": "^0.24.0"
|
|
95
91
|
}
|
|
96
92
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { FunctionComponent, MouseEvent as ReactMouseEvent, KeyboardEvent as ReactKeyboardEvent } from 'react';
|
|
2
2
|
import Message from '@patternfly/chatbot/dist/dynamic/Message';
|
|
3
3
|
import { Button, Flex, FlexItem, Label, Popover } from '@patternfly/react-core';
|
|
4
|
-
import {
|
|
4
|
+
import { RhUiQuestionMarkCircleIcon } from '@patternfly/react-icons';
|
|
5
5
|
|
|
6
6
|
export const MessageWithSourcesExample: FunctionComponent = () => {
|
|
7
7
|
const onSetPage = (_event: ReactMouseEvent | ReactKeyboardEvent | MouseEvent, newPage: number) => {
|
|
@@ -51,7 +51,7 @@ export const MessageWithSourcesExample: FunctionComponent = () => {
|
|
|
51
51
|
headerContent={
|
|
52
52
|
<Flex gap={{ default: 'gapXs' }}>
|
|
53
53
|
<FlexItem>
|
|
54
|
-
<
|
|
54
|
+
<RhUiQuestionMarkCircleIcon />
|
|
55
55
|
</FlexItem>
|
|
56
56
|
<FlexItem>Why this confidence score?</FlexItem>
|
|
57
57
|
</Flex>
|
|
@@ -64,7 +64,7 @@ export const MessageWithSourcesExample: FunctionComponent = () => {
|
|
|
64
64
|
</>
|
|
65
65
|
}
|
|
66
66
|
>
|
|
67
|
-
<Button variant="link" icon={<
|
|
67
|
+
<Button variant="link" icon={<RhUiQuestionMarkCircleIcon />}>
|
|
68
68
|
Learn about this score
|
|
69
69
|
</Button>
|
|
70
70
|
</Popover>
|
|
@@ -50,7 +50,7 @@ import ResponseActions, { ResponseActionsGroups } from '@patternfly/chatbot/dist
|
|
|
50
50
|
import ToolResponse from '@patternfly/chatbot/dist/dynamic/ToolResponse';
|
|
51
51
|
import { rehypeCodeBlockToggle } from '@patternfly/chatbot/dist/esm/Message/Plugins/rehypeCodeBlockToggle';
|
|
52
52
|
import SourcesCard from '@patternfly/chatbot/dist/dynamic/SourcesCard';
|
|
53
|
-
import { RhUiArrowCircleDownFillIcon, RhUiArrowRightIcon, RhUiCheckCircleFillIcon, RhUiCopyFillIcon, RhUiExportIcon, RhMicronsInformationFillIcon, OutlinedQuestionCircleIcon, RhUiRedoIcon, RhUiBuildFillIcon } from '@patternfly/react-icons';
|
|
53
|
+
import { RhUiArrowCircleDownFillIcon, RhUiArrowRightIcon, RhUiCheckCircleFillIcon, RhUiCopyFillIcon, RhUiExportIcon, RhMicronsInformationFillIcon, OutlinedQuestionCircleIcon, RhUiRedoIcon, RhUiBuildFillIcon, RhUiQuestionMarkCircleIcon } from '@patternfly/react-icons';
|
|
54
54
|
import patternflyAvatar from './patternfly_avatar.jpg';
|
|
55
55
|
import AttachmentEdit from '@patternfly/chatbot/dist/dynamic/AttachmentEdit';
|
|
56
56
|
import FileDetails from '@patternfly/chatbot/dist/dynamic/FileDetails';
|
package/patternfly-docs/content/extensions/chatbot/examples/Messages/explore-pipeline-quickstart.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import userAvatar from './user_avatar.svg';
|
|
2
|
-
|
|
3
1
|
export const explorePipelinesQuickStart = {
|
|
4
2
|
apiVersion: 'console.openshift.io/v1',
|
|
5
3
|
kind: 'QuickStarts',
|
|
@@ -10,7 +8,6 @@ export const explorePipelinesQuickStart = {
|
|
|
10
8
|
version: 4.7,
|
|
11
9
|
displayName: `Installing the Pipelines Operator`,
|
|
12
10
|
durationMinutes: 10,
|
|
13
|
-
icon: userAvatar,
|
|
14
11
|
description: `Install the OpenShift® Pipelines Operator to build Pipelines using Tekton.`,
|
|
15
12
|
prerequisites: [''],
|
|
16
13
|
introduction: `OpenShift® Pipelines is a cloud-native, continuous integration and continuous delivery (CI/CD) solution based on Kubernetes resources. It uses Tekton building blocks to automate deployments across multiple Kubernetes distributions by abstracting away the underlying implementation details.
|
|
@@ -24,7 +24,7 @@ import FileDetailsLabel from '@patternfly/chatbot/dist/dynamic/FileDetailsLabel'
|
|
|
24
24
|
import SourceDetailsMenuItem from '@patternfly/chatbot/dist/dynamic/SourceDetailsMenuItem';
|
|
25
25
|
import PreviewAttachment from '@patternfly/chatbot/dist/dynamic/PreviewAttachment';
|
|
26
26
|
import AttachmentEdit from '@patternfly/chatbot/dist/dynamic/AttachmentEdit';
|
|
27
|
-
import {
|
|
27
|
+
import { RhUiAttentionBellIcon, RhUiCalendarIcon, RhUiClipboardIcon, RhUiCodeIcon, RhUiUploadIcon } from '@patternfly/react-icons';
|
|
28
28
|
import { useDropzone } from 'react-dropzone';
|
|
29
29
|
import PFHorizontalLogoColor from '../UI/PF-HorizontalLogo-Color.svg';
|
|
30
30
|
import PFHorizontalLogoReverse from '../UI/PF-HorizontalLogo-Reverse.svg';
|
|
@@ -48,7 +48,7 @@ ChatbotHeaderOptionsDropdown,
|
|
|
48
48
|
ChatbotHeaderCloseButton,
|
|
49
49
|
} from '@patternfly/chatbot/dist/dynamic/ChatbotHeader';
|
|
50
50
|
|
|
51
|
-
import { RhUiExpandIcon, RhUiOpenDrawerRightIcon, RhUiRestoreWindowIcon } from '@patternfly/react-icons';
|
|
51
|
+
import { RhUiExpandIcon, RhUiOpenDrawerRightIcon, RhUiMenuBarsIcon, RhUiRestoreWindowIcon } from '@patternfly/react-icons';
|
|
52
52
|
import { BarsIcon } from '@patternfly/react-icons/dist/esm/icons/bars-icon';
|
|
53
53
|
import { RhUiBuildFillIcon, RhUiCopyFillIcon } from '@patternfly/react-icons';
|
|
54
54
|
import {
|
|
@@ -11,7 +11,13 @@ import SourceDetailsMenuItem from '@patternfly/chatbot/dist/dynamic/SourceDetail
|
|
|
11
11
|
import ChatbotAlert from '@patternfly/chatbot/dist/dynamic/ChatbotAlert';
|
|
12
12
|
import { Divider, DropdownGroup, DropdownItem, DropdownList, DropEvent } from '@patternfly/react-core';
|
|
13
13
|
import FileDetailsLabel from '@patternfly/chatbot/dist/dynamic/FileDetailsLabel';
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
RhUiAttentionBellIcon,
|
|
16
|
+
RhUiCalendarIcon,
|
|
17
|
+
RhUiClipboardIcon,
|
|
18
|
+
RhUiCodeIcon,
|
|
19
|
+
RhUiUploadIcon
|
|
20
|
+
} from '@patternfly/react-icons';
|
|
15
21
|
import { useDropzone } from 'react-dropzone';
|
|
16
22
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
17
23
|
import '@patternfly/react-core/dist/styles/base.css';
|
|
@@ -48,19 +54,19 @@ const initialMenuItems = [
|
|
|
48
54
|
</DropdownList>,
|
|
49
55
|
<DropdownGroup key="attachment-menu-example-initial-group">
|
|
50
56
|
<DropdownList>
|
|
51
|
-
<DropdownItem value="Alerts" id="1" icon={<
|
|
57
|
+
<DropdownItem value="Alerts" id="1" icon={<RhUiAttentionBellIcon />}>
|
|
52
58
|
Alerts
|
|
53
59
|
</DropdownItem>
|
|
54
|
-
<DropdownItem value="Events" id="2" icon={<
|
|
60
|
+
<DropdownItem value="Events" id="2" icon={<RhUiCalendarIcon />}>
|
|
55
61
|
Events
|
|
56
62
|
</DropdownItem>
|
|
57
|
-
<DropdownItem value="Logs" id="3" icon={<
|
|
63
|
+
<DropdownItem value="Logs" id="3" icon={<RhUiClipboardIcon />}>
|
|
58
64
|
Logs
|
|
59
65
|
</DropdownItem>
|
|
60
|
-
<DropdownItem value="YAML - Status" id="4" icon={<
|
|
66
|
+
<DropdownItem value="YAML - Status" id="4" icon={<RhUiCodeIcon />}>
|
|
61
67
|
YAML - Status
|
|
62
68
|
</DropdownItem>
|
|
63
|
-
<DropdownItem value="YAML - All contents" id="5" icon={<
|
|
69
|
+
<DropdownItem value="YAML - All contents" id="5" icon={<RhUiCodeIcon />}>
|
|
64
70
|
YAML - All contents
|
|
65
71
|
</DropdownItem>
|
|
66
72
|
</DropdownList>
|
|
@@ -150,7 +156,7 @@ export const AttachmentMenuDemo: FunctionComponent = () => {
|
|
|
150
156
|
key="upload"
|
|
151
157
|
value="upload"
|
|
152
158
|
id="upload"
|
|
153
|
-
icon={<
|
|
159
|
+
icon={<RhUiUploadIcon />}
|
|
154
160
|
>
|
|
155
161
|
Upload from computer
|
|
156
162
|
</DropdownItem>
|
|
@@ -43,7 +43,12 @@ import ChatbotHeader, {
|
|
|
43
43
|
} from '@patternfly/chatbot/dist/dynamic/ChatbotHeader';
|
|
44
44
|
import PFIconLogoColor from '../UI/PF-IconLogo-Color.svg';
|
|
45
45
|
import PFIconLogoReverse from '../UI/PF-IconLogo-Reverse.svg';
|
|
46
|
-
import {
|
|
46
|
+
import {
|
|
47
|
+
RhUiMenuBarsIcon,
|
|
48
|
+
RhUiExpandIcon,
|
|
49
|
+
RhUiOpenDrawerRightIcon,
|
|
50
|
+
RhUiRestoreWindowIcon
|
|
51
|
+
} from '@patternfly/react-icons';
|
|
47
52
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
48
53
|
import '@patternfly/react-core/dist/styles/base.css';
|
|
49
54
|
import '@patternfly/chatbot/dist/css/main.css';
|
|
@@ -260,7 +265,7 @@ export const ChatbotDisplayModeDemo: FunctionComponent = () => {
|
|
|
260
265
|
onSidebarToggle={() => setIsSidebarOpen(!isSidebarOpen)}
|
|
261
266
|
id="fill-nav-toggle"
|
|
262
267
|
>
|
|
263
|
-
<
|
|
268
|
+
<RhUiMenuBarsIcon />
|
|
264
269
|
</PageToggleButton>
|
|
265
270
|
</MastheadToggle>
|
|
266
271
|
<MastheadBrand>
|
|
@@ -39,7 +39,7 @@ import ChatbotHeader, {
|
|
|
39
39
|
} from '@patternfly/chatbot/dist/dynamic/ChatbotHeader';
|
|
40
40
|
import PFIconLogoColor from '../UI/PF-IconLogo-Color.svg';
|
|
41
41
|
import PFIconLogoReverse from '../UI/PF-IconLogo-Reverse.svg';
|
|
42
|
-
import {
|
|
42
|
+
import { RhUiMenuBarsIcon } from '@patternfly/react-icons';
|
|
43
43
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
44
44
|
import '@patternfly/react-core/dist/styles/base.css';
|
|
45
45
|
import '@patternfly/chatbot/dist/css/main.css';
|
|
@@ -290,7 +290,7 @@ export const EmbeddedChatbotDemo: FunctionComponent = () => {
|
|
|
290
290
|
onSidebarToggle={() => setIsSidebarOpen(!isSidebarOpen)}
|
|
291
291
|
id="fill-nav-toggle"
|
|
292
292
|
>
|
|
293
|
-
<
|
|
293
|
+
<RhUiMenuBarsIcon />
|
|
294
294
|
</PageToggleButton>
|
|
295
295
|
</MastheadToggle>
|
|
296
296
|
<MastheadBrand>
|
|
@@ -37,7 +37,7 @@ import ChatbotHeader, {
|
|
|
37
37
|
|
|
38
38
|
import PFHorizontalLogoColor from '../UI/PF-HorizontalLogo-Color.svg';
|
|
39
39
|
import PFHorizontalLogoReverse from '../UI/PF-HorizontalLogo-Reverse.svg';
|
|
40
|
-
import {
|
|
40
|
+
import { RhUiMenuBarsIcon } from '@patternfly/react-icons';
|
|
41
41
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
42
42
|
import '@patternfly/react-core/dist/styles/base.css';
|
|
43
43
|
import '@patternfly/chatbot/dist/css/main.css';
|
|
@@ -282,7 +282,7 @@ export const EmbeddedChatbotDemo: FunctionComponent = () => {
|
|
|
282
282
|
onSidebarToggle={() => setIsSidebarOpen(!isSidebarOpen)}
|
|
283
283
|
id="fill-nav-toggle"
|
|
284
284
|
>
|
|
285
|
-
<
|
|
285
|
+
<RhUiMenuBarsIcon />
|
|
286
286
|
</PageToggleButton>
|
|
287
287
|
</MastheadToggle>
|
|
288
288
|
<MastheadBrand>
|
package/patternfly-docs/content/extensions/chatbot/examples/demos/EmbeddedComparisonChatbot.tsx
CHANGED
|
@@ -20,7 +20,7 @@ import MessageBox from '@patternfly/chatbot/dist/dynamic/MessageBox';
|
|
|
20
20
|
import Message, { MessageProps } from '@patternfly/chatbot/dist/dynamic/Message';
|
|
21
21
|
import ChatbotHeader, { ChatbotHeaderMain, ChatbotHeaderTitle } from '@patternfly/chatbot/dist/dynamic/ChatbotHeader';
|
|
22
22
|
import Compare from '@patternfly/chatbot/dist/dynamic/Compare';
|
|
23
|
-
import {
|
|
23
|
+
import { RhUiMenuBarsIcon } from '@patternfly/react-icons';
|
|
24
24
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
25
25
|
import '@patternfly/react-core/dist/styles/base.css';
|
|
26
26
|
import '@patternfly/chatbot/dist/css/main.css';
|
|
@@ -155,7 +155,7 @@ export const EmbeddedComparisonChatbotDemo: FunctionComponent = () => {
|
|
|
155
155
|
onSidebarToggle={() => setIsSidebarOpen(!isSidebarOpen)}
|
|
156
156
|
id="fill-nav-toggle"
|
|
157
157
|
>
|
|
158
|
-
<
|
|
158
|
+
<RhUiMenuBarsIcon />
|
|
159
159
|
</PageToggleButton>
|
|
160
160
|
</MastheadToggle>
|
|
161
161
|
<MastheadBrand>
|
|
@@ -37,7 +37,7 @@ import ChatbotHeader, {
|
|
|
37
37
|
|
|
38
38
|
import PFHorizontalLogoColor from '../UI/PF-HorizontalLogo-Color.svg';
|
|
39
39
|
import PFHorizontalLogoReverse from '../UI/PF-HorizontalLogo-Reverse.svg';
|
|
40
|
-
import {
|
|
40
|
+
import { RhUiMenuBarsIcon } from '@patternfly/react-icons';
|
|
41
41
|
import userAvatar from '../Messages/user_avatar.svg';
|
|
42
42
|
import '@patternfly/react-core/dist/styles/base.css';
|
|
43
43
|
import '@patternfly/chatbot/dist/css/main.css';
|
|
@@ -296,7 +296,7 @@ export const EmbeddedChatbotDemo: FunctionComponent = () => {
|
|
|
296
296
|
onSidebarToggle={() => setIsSidebarOpen(!isSidebarOpen)}
|
|
297
297
|
id="fill-nav-toggle"
|
|
298
298
|
>
|
|
299
|
-
<
|
|
299
|
+
<RhUiMenuBarsIcon />
|
|
300
300
|
</PageToggleButton>
|
|
301
301
|
</MastheadToggle>
|
|
302
302
|
<MastheadBrand>
|
|
@@ -2,7 +2,7 @@ import type { Ref, FunctionComponent } from 'react';
|
|
|
2
2
|
import { forwardRef, useEffect, useMemo, useRef, useState } from 'react';
|
|
3
3
|
|
|
4
4
|
import { Button, ButtonProps, Icon, Tooltip, TooltipProps } from '@patternfly/react-core';
|
|
5
|
-
import
|
|
5
|
+
import { RhUiMenuBarsIcon } from '@patternfly/react-icons/dist/esm/icons/rh-ui-menu-bars-icon';
|
|
6
6
|
|
|
7
7
|
export interface ChatbotHeaderMenuProps extends ButtonProps {
|
|
8
8
|
/** Callback function to attach to menu toggle on top right of chatbot header. */
|
|
@@ -69,7 +69,7 @@ const ChatbotHeaderMenuBase: FunctionComponent<ChatbotHeaderMenuProps> = ({
|
|
|
69
69
|
ref={innerRef ?? buttonRef}
|
|
70
70
|
icon={
|
|
71
71
|
<Icon size={isCompact ? 'lg' : 'xl'} isInline>
|
|
72
|
-
<
|
|
72
|
+
<RhUiMenuBarsIcon />
|
|
73
73
|
</Icon>
|
|
74
74
|
}
|
|
75
75
|
size={isCompact ? 'sm' : undefined}
|
|
@@ -2,7 +2,7 @@ import { PropsWithChildren } from 'react';
|
|
|
2
2
|
import { Button, Label, LabelProps } from '@patternfly/react-core';
|
|
3
3
|
import FileDetails from '../FileDetails';
|
|
4
4
|
import { Spinner } from '@patternfly/react-core';
|
|
5
|
-
import {
|
|
5
|
+
import { RhMicronsCloseIcon } from '@patternfly/react-icons';
|
|
6
6
|
|
|
7
7
|
export interface FileDetailsLabelProps extends Omit<LabelProps, 'onClose' | 'onClick'> {
|
|
8
8
|
/** Name of file, including extension */
|
|
@@ -40,7 +40,7 @@ export const FileDetailsLabel = ({
|
|
|
40
40
|
spinnerTestId,
|
|
41
41
|
fileSize,
|
|
42
42
|
hasTruncation = true,
|
|
43
|
-
closeButtonIcon = <
|
|
43
|
+
closeButtonIcon = <RhMicronsCloseIcon />,
|
|
44
44
|
...props
|
|
45
45
|
}: PropsWithChildren<FileDetailsLabelProps>) => {
|
|
46
46
|
const handleClose = (event) => {
|
|
@@ -2,7 +2,7 @@ import { MultipleFileUpload, MultipleFileUploadMain } from '@patternfly/react-co
|
|
|
2
2
|
import type { FunctionComponent } from 'react';
|
|
3
3
|
import { useState } from 'react';
|
|
4
4
|
import { ChatbotDisplayMode } from '../Chatbot';
|
|
5
|
-
import {
|
|
5
|
+
import { RhUiUploadIcon } from '@patternfly/react-icons';
|
|
6
6
|
import { Accept, DropEvent, FileError, FileRejection } from 'react-dropzone';
|
|
7
7
|
|
|
8
8
|
export interface FileDropZoneProps {
|
|
@@ -59,7 +59,7 @@ const FileDropZone: FunctionComponent<FileDropZoneProps> = ({
|
|
|
59
59
|
const renderDropZone = () => (
|
|
60
60
|
<>
|
|
61
61
|
<MultipleFileUploadMain
|
|
62
|
-
titleIcon={<
|
|
62
|
+
titleIcon={<RhUiUploadIcon />}
|
|
63
63
|
titleText="Drag and drop your file here"
|
|
64
64
|
infoText={infoText}
|
|
65
65
|
isUploadButtonHidden
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
import { ChatbotDisplayMode } from '../Chatbot';
|
|
21
21
|
import ChatbotModal, { ChatbotModalProps } from '../ChatbotModal';
|
|
22
22
|
import FileDetailsLabel, { FileDetailsLabelProps } from '../FileDetailsLabel';
|
|
23
|
-
import {
|
|
23
|
+
import { RhUiTrashFillIcon } from '@patternfly/react-icons';
|
|
24
24
|
|
|
25
25
|
export interface ImagePreviewProps extends Omit<ChatbotModalProps, 'children'> {
|
|
26
26
|
/** Class applied to modal */
|
|
@@ -121,7 +121,11 @@ const ImagePreview: FunctionComponent<ImagePreviewProps> = ({
|
|
|
121
121
|
fileSize={images[page - 1].fileSize}
|
|
122
122
|
hasTruncation={false}
|
|
123
123
|
onClose={onCloseFileDetailsLabel}
|
|
124
|
-
closeButtonIcon={
|
|
124
|
+
closeButtonIcon={
|
|
125
|
+
<Icon size="md">
|
|
126
|
+
<RhUiTrashFillIcon />
|
|
127
|
+
</Icon>
|
|
128
|
+
}
|
|
125
129
|
{...fileDetailsLabelProps}
|
|
126
130
|
/>
|
|
127
131
|
</StackItem>
|
|
@@ -17,9 +17,8 @@ import {
|
|
|
17
17
|
getUniqueId
|
|
18
18
|
} from '@patternfly/react-core';
|
|
19
19
|
|
|
20
|
-
import { CheckIcon } from '@patternfly/react-icons/dist/esm/icons/check-icon';
|
|
21
20
|
import { css } from '@patternfly/react-styles';
|
|
22
|
-
import { RhUiCopyFillIcon } from '@patternfly/react-icons';
|
|
21
|
+
import { RhMicronsCheckmarkIcon, RhUiCopyFillIcon } from '@patternfly/react-icons';
|
|
23
22
|
|
|
24
23
|
export interface CodeBlockMessageProps {
|
|
25
24
|
/** Content rendered in code block */
|
|
@@ -142,7 +141,7 @@ const CodeBlockMessage = ({
|
|
|
142
141
|
className="pf-chatbot__button--copy"
|
|
143
142
|
onClick={(event) => handleCopy(event, children)}
|
|
144
143
|
>
|
|
145
|
-
{copied ? <
|
|
144
|
+
{copied ? <RhMicronsCheckmarkIcon /> : <RhUiCopyFillIcon />}
|
|
146
145
|
</Button>
|
|
147
146
|
<Tooltip id={tooltipID} content="Copy" position="top" triggerRef={buttonRef} />
|
|
148
147
|
</CodeBlockAction>
|
|
@@ -11,6 +11,7 @@ import { DeepThinkingProps } from '../DeepThinking';
|
|
|
11
11
|
|
|
12
12
|
// Mock the icon components
|
|
13
13
|
jest.mock('@patternfly/react-icons', () => ({
|
|
14
|
+
...jest.requireActual('@patternfly/react-icons'),
|
|
14
15
|
RhUiLikeIcon: () => <div>RhUiLikeIcon</div>,
|
|
15
16
|
RhUiLikeFillIcon: () => <div>RhUiLikeFillIcon</div>,
|
|
16
17
|
RhUiDislikeIcon: () => <div>RhUiDislikeIcon</div>,
|
|
@@ -24,11 +25,13 @@ jest.mock('@patternfly/react-icons', () => ({
|
|
|
24
25
|
RhUiExportIcon: () => <div>RhUiExportIcon</div>,
|
|
25
26
|
RhUiExportFillIcon: () => <div>RhUiExportFillIcon</div>,
|
|
26
27
|
RhMicronsInformationFillIcon: () => <div>RhMicronsInformationFillIcon</div>,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
RhUiBackwardsIcon: () => <div>RhUiBackwardsIcon</div>,
|
|
29
|
+
RhMicronsExternalLinkIcon: () => <div>RhMicronsExternalLinkIcon</div>,
|
|
30
|
+
RhMicronsCheckmarkIcon: () => <div>RhMicronsCheckmarkIcon</div>,
|
|
31
|
+
RhMicronsCloseIcon: () => <div>RhMicronsCloseIcon</div>,
|
|
32
|
+
RhUiBookmarkIcon: () => <div>RhUiBookmarkIcon</div>,
|
|
33
|
+
RhUiClockIcon: () => <div>RhUiClockIcon</div>,
|
|
34
|
+
RhUiRocketFillIcon: () => <div>RhUiRocketFillIcon</div>
|
|
32
35
|
}));
|
|
33
36
|
|
|
34
37
|
const ALL_ACTIONS = [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { FunctionComponent } from 'react';
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { Label, LabelGroup, LabelGroupProps, LabelProps } from '@patternfly/react-core';
|
|
4
|
-
import {
|
|
4
|
+
import { RhMicronsCheckmarkIcon } from '@patternfly/react-icons';
|
|
5
5
|
import { css } from '@patternfly/react-styles';
|
|
6
6
|
|
|
7
7
|
export interface QuickResponse extends Omit<LabelProps, 'children'> {
|
|
@@ -42,7 +42,7 @@ export const QuickResponse: FunctionComponent<QuickResponseProps> = ({
|
|
|
42
42
|
{quickResponses.map(({ id, onClick, content, className, ...props }: QuickResponse) => (
|
|
43
43
|
<Label
|
|
44
44
|
variant={id === selectedQuickResponse ? undefined : 'outline'}
|
|
45
|
-
icon={id === selectedQuickResponse ? <
|
|
45
|
+
icon={id === selectedQuickResponse ? <RhMicronsCheckmarkIcon /> : undefined}
|
|
46
46
|
color="blue"
|
|
47
47
|
key={id}
|
|
48
48
|
onClick={() => handleQuickResponseClick(id, onClick)}
|