@gravity-ui/aikit 0.4.5 → 0.5.0

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.
@@ -14,7 +14,7 @@ export function PromptInputFull(props) {
14
14
  const { hookState, headerProps = {}, bodyProps = {}, footerProps = {}, className, qa } = props;
15
15
  const { topContent, contextItems = [], showContextIndicator = false, contextIndicatorProps, } = headerProps;
16
16
  const { placeholder = 'Plan, code, build and test anything', minRows = 1, maxRows = 15, autoFocus = false, } = bodyProps;
17
- const { bottomContent, showSettings = false, onSettingsClick, showAttachment = false, onAttachmentClick, showMicrophone = false, onMicrophoneClick, submitButtonTooltipSend, submitButtonTooltipCancel, } = footerProps;
17
+ const { bottomContent, showSettings = false, onSettingsClick, showAttachment = false, onAttachmentClick, showMicrophone = false, onMicrophoneClick, submitButtonTooltipSend, submitButtonTooltipCancel, submitButtonQa, } = footerProps;
18
18
  const { value, submitButtonState, handleChange, handleKeyDown, handleSubmit } = hookState;
19
19
  const shouldShowHeader = topContent || contextItems.length > 0 || showContextIndicator;
20
20
  const shouldShowFooter = true;
@@ -23,6 +23,6 @@ export function PromptInputFull(props) {
23
23
  state: submitButtonState,
24
24
  tooltipSend: submitButtonTooltipSend,
25
25
  tooltipCancel: submitButtonTooltipCancel,
26
- qa: 'submit-button-full',
26
+ qa: submitButtonQa || 'submit-button-full',
27
27
  }, showSettings: showSettings, onSettingsClick: onSettingsClick, showAttachment: showAttachment, onAttachmentClick: onAttachmentClick, showMicrophone: showMicrophone, onMicrophoneClick: onMicrophoneClick, children: bottomContent }))] }));
28
28
  }
@@ -12,13 +12,13 @@ const b = block('prompt-input');
12
12
  export function PromptInputSimple(props) {
13
13
  const { hookState, bodyProps = {}, footerProps = {}, className, qa } = props;
14
14
  const { placeholder = 'Plan, code, build and test anything', minRows = 1, maxRows = 15, autoFocus = false, } = bodyProps;
15
- const { bottomContent, showAttachment = false, onAttachmentClick, showMicrophone = false, onMicrophoneClick, submitButtonTooltipSend, submitButtonTooltipCancel, } = footerProps;
15
+ const { bottomContent, showAttachment = false, onAttachmentClick, showMicrophone = false, onMicrophoneClick, submitButtonTooltipSend, submitButtonTooltipCancel, submitButtonQa, } = footerProps;
16
16
  const { value, submitButtonState, handleChange, handleKeyDown, handleSubmit } = hookState;
17
17
  return (_jsx("div", { className: b({ view: 'simple' }, className), "data-qa": qa, children: _jsxs("div", { className: b('content'), children: [_jsx(PromptInputBody, { value: value, placeholder: placeholder, minRows: minRows, maxRows: maxRows, autoFocus: autoFocus, onChange: handleChange, onKeyDown: handleKeyDown }), _jsx(PromptInputFooter, { submitButton: {
18
18
  onClick: handleSubmit,
19
19
  state: submitButtonState,
20
20
  tooltipSend: submitButtonTooltipSend,
21
21
  tooltipCancel: submitButtonTooltipCancel,
22
- qa: 'submit-button-simple',
22
+ qa: submitButtonQa || 'submit-button-simple',
23
23
  }, showAttachment: showAttachment, onAttachmentClick: onAttachmentClick, showMicrophone: showMicrophone, onMicrophoneClick: onMicrophoneClick, buttonSize: "l", children: bottomContent })] }) }));
24
24
  }
@@ -58,6 +58,8 @@ export type PromptInputFooterConfig = {
58
58
  submitButtonTooltipSend?: string;
59
59
  /** Custom tooltip for submit button in cancelable state */
60
60
  submitButtonTooltipCancel?: string;
61
+ /** QA/test identifier for submit button */
62
+ submitButtonQa?: string;
61
63
  };
62
64
  /**
63
65
  * Props for the suggestions section of PromptInput
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravity-ui/aikit",
3
- "version": "0.4.5",
3
+ "version": "0.5.0",
4
4
  "description": "Gravity UI base kit for building ai assistant chats",
5
5
  "license": "MIT",
6
6
  "main": "./dist/index.js",