@gravity-ui/aikit 1.3.0 → 1.3.1
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/components/molecules/PromptInputBody/PromptInputBody.d.ts +2 -0
- package/dist/components/molecules/PromptInputBody/PromptInputBody.js +2 -2
- package/dist/components/organisms/PromptInput/PromptInput.scss +4 -0
- package/dist/components/organisms/PromptInput/PromptInputFull.js +1 -1
- package/dist/components/organisms/ToolMessage/index.js +1 -1
- package/package.json +1 -1
|
@@ -12,14 +12,14 @@ const b = block('prompt-input-body');
|
|
|
12
12
|
* @returns React component
|
|
13
13
|
*/
|
|
14
14
|
export const PromptInputBody = forwardRef((props, ref) => {
|
|
15
|
-
const { value, placeholder, maxLength, minRows = 1, maxRows = 15, autoFocus = false, disabledInput = false, onChange, onKeyDown, children, className, qa, } = props;
|
|
15
|
+
const { value, placeholder, maxLength, minRows = 1, maxRows = 15, autoFocus = false, disabledInput = false, onChange, onKeyDown, children, className, inputClassName, qa, } = props;
|
|
16
16
|
// If custom content is provided, render it
|
|
17
17
|
if (children) {
|
|
18
18
|
return (_jsx("div", { className: b(null, className), "data-qa": qa, children: children }));
|
|
19
19
|
}
|
|
20
20
|
// Render default textarea
|
|
21
21
|
return (_jsx("div", { className: b(null, className), "data-qa": qa, children: _jsx(TextArea, { controlRef: ref, size: "l", value: value, placeholder: placeholder, minRows: minRows, maxRows: maxRows, autoFocus: autoFocus, disabled: disabledInput, onUpdate: onChange, onKeyDown: onKeyDown, view: "clear", className: b('textarea'), controlProps: {
|
|
22
|
-
className: b('textarea-control'),
|
|
22
|
+
className: b('textarea-control', inputClassName),
|
|
23
23
|
maxLength,
|
|
24
24
|
} }) }));
|
|
25
25
|
});
|
|
@@ -18,7 +18,7 @@ export function PromptInputFull(props) {
|
|
|
18
18
|
const { value, submitButtonState, handleChange, handleKeyDown, handleSubmit } = hookState;
|
|
19
19
|
const shouldShowHeader = topContent || contextItems.length > 0 || showContextIndicator;
|
|
20
20
|
const shouldShowFooter = true;
|
|
21
|
-
return (_jsxs("div", { className: b({ view: 'full' }, className), "data-qa": qa, children: [shouldShowHeader && (_jsx(PromptInputHeader, { contextItems: contextItems, showContextIndicator: showContextIndicator, contextIndicatorProps: contextIndicatorProps, children: topContent })), _jsx(PromptInputBody, { value: value, placeholder: placeholder, minRows: minRows, maxRows: maxRows, autoFocus: autoFocus, onChange: handleChange, onKeyDown: handleKeyDown }), shouldShowFooter && (_jsx(PromptInputFooter, { submitButton: {
|
|
21
|
+
return (_jsxs("div", { className: b({ view: 'full' }, className), "data-qa": qa, children: [shouldShowHeader && (_jsx(PromptInputHeader, { contextItems: contextItems, showContextIndicator: showContextIndicator, contextIndicatorProps: contextIndicatorProps, children: topContent })), _jsx(PromptInputBody, { value: value, placeholder: placeholder, minRows: minRows, maxRows: maxRows, autoFocus: autoFocus, onChange: handleChange, onKeyDown: handleKeyDown, inputClassName: b('textarea') }), shouldShowFooter && (_jsx(PromptInputFooter, { submitButton: {
|
|
22
22
|
onClick: handleSubmit,
|
|
23
23
|
state: submitButtonState,
|
|
24
24
|
tooltipSend: submitButtonTooltipSend,
|
|
@@ -8,5 +8,5 @@ const b = block('tool-message');
|
|
|
8
8
|
export function ToolMessage(props) {
|
|
9
9
|
const { toolName, className, qa, bodyContent, status, toolIcon, headerContent } = props;
|
|
10
10
|
const { isExpanded, headerActions, footerActions, footerContent, showLoader, isWaiting } = useToolMessage(props);
|
|
11
|
-
return (_jsx(Card, { className: b({ waiting: isWaiting }, className),
|
|
11
|
+
return (_jsx(Card, { className: b({ waiting: isWaiting }, className), qa: qa, children: _jsxs("div", { className: b('container'), children: [_jsx(ToolHeader, { toolName: toolName, actions: headerActions, toolIcon: toolIcon, content: headerContent, status: status }), bodyContent && isExpanded && _jsx("div", { className: b('content'), children: bodyContent }), isWaiting && (_jsx(ToolFooter, { actions: footerActions, content: footerContent, showLoader: showLoader }))] }) }));
|
|
12
12
|
}
|