@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.
@@ -26,6 +26,8 @@ export type PromptInputBodyProps = {
26
26
  children?: ReactNode;
27
27
  /** Additional CSS class */
28
28
  className?: string;
29
+ /** Additional CSS class for input element */
30
+ inputClassName?: string;
29
31
  /** QA/test identifier */
30
32
  qa?: string;
31
33
  };
@@ -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
  });
@@ -22,6 +22,10 @@ $block: '.#{variables.$ns}prompt-input';
22
22
  gap: var(--g-spacing-2);
23
23
  }
24
24
 
25
+ &_view_full &__textarea {
26
+ padding-top: 0;
27
+ }
28
+
25
29
  &__content {
26
30
  display: flex;
27
31
  align-items: flex-end;
@@ -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), "data-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 }))] }) }));
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/aikit",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Gravity UI base kit for building ai assistant chats",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",