@cloud-ru/uikit-product-claudia 1.7.0 → 1.8.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.
Files changed (26) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/README.md +3 -1
  3. package/dist/cjs/components/ChatStatusAnnouncement/ChatStatusAnnouncement.d.ts +1 -1
  4. package/dist/cjs/components/ChatStatusAnnouncement/ChatStatusAnnouncement.js +4 -3
  5. package/dist/cjs/components/ChatStatusAnnouncement/types.d.ts +4 -3
  6. package/dist/cjs/components/SshField/SshField.d.ts +4 -0
  7. package/dist/cjs/components/SshField/SshField.js +2 -2
  8. package/dist/esm/components/ChatStatusAnnouncement/ChatStatusAnnouncement.d.ts +1 -1
  9. package/dist/esm/components/ChatStatusAnnouncement/ChatStatusAnnouncement.js +4 -3
  10. package/dist/esm/components/ChatStatusAnnouncement/types.d.ts +4 -3
  11. package/dist/esm/components/SshField/SshField.d.ts +4 -0
  12. package/dist/esm/components/SshField/SshField.js +2 -2
  13. package/package.json +6 -6
  14. package/src/components/ChatStatusAnnouncement/ChatStatusAnnouncement.tsx +6 -2
  15. package/src/components/ChatStatusAnnouncement/types.ts +4 -3
  16. package/src/components/SshField/SshField.tsx +4 -2
  17. package/dist/cjs/components/ChatStatusAnnouncement/helperComponents/TextContent/TextContent.d.ts +0 -7
  18. package/dist/cjs/components/ChatStatusAnnouncement/helperComponents/TextContent/TextContent.js +0 -12
  19. package/dist/cjs/components/ChatStatusAnnouncement/helperComponents/TextContent/index.d.ts +0 -1
  20. package/dist/cjs/components/ChatStatusAnnouncement/helperComponents/TextContent/index.js +0 -17
  21. package/dist/esm/components/ChatStatusAnnouncement/helperComponents/TextContent/TextContent.d.ts +0 -7
  22. package/dist/esm/components/ChatStatusAnnouncement/helperComponents/TextContent/TextContent.js +0 -9
  23. package/dist/esm/components/ChatStatusAnnouncement/helperComponents/TextContent/index.d.ts +0 -1
  24. package/dist/esm/components/ChatStatusAnnouncement/helperComponents/TextContent/index.js +0 -1
  25. package/src/components/ChatStatusAnnouncement/helperComponents/TextContent/TextContent.tsx +0 -18
  26. package/src/components/ChatStatusAnnouncement/helperComponents/TextContent/index.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,29 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 1.8.1 (2025-11-24)
7
+
8
+ ### Only dependencies have been changed
9
+ * [@cloud-ru/uikit-product-icons@15.1.5](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/icons/CHANGELOG.md)
10
+ * [@cloud-ru/uikit-product-mobile-dropdown@0.9.25](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/mobile-dropdown/CHANGELOG.md)
11
+ * [@cloud-ru/uikit-product-mobile-fields@0.11.28](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/mobile-fields/CHANGELOG.md)
12
+ * [@cloud-ru/uikit-product-utils@8.0.0](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/utils/CHANGELOG.md)
13
+
14
+
15
+
16
+
17
+
18
+ # 1.8.0 (2025-11-17)
19
+
20
+
21
+ ### Features
22
+
23
+ * **AINFR-4479:** add onCancel ([e3dbed9](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/e3dbed92b1435c7d53b51d2da1cbf64c86674b5a))
24
+
25
+
26
+
27
+
28
+
6
29
  # 1.7.0 (2025-11-13)
7
30
 
8
31
 
package/README.md CHANGED
@@ -102,8 +102,9 @@
102
102
  |------|------|---------------|-------------|
103
103
  | layoutType* | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
104
104
  | actionLabel* | `string` | - | |
105
- | content* | `ReactNode \| TextItem[]` | - | |
105
+ | content* | `string \| TextItem[]` | - | |
106
106
  | icon | `ReactElement<any, string \| JSXElementConstructor<any>>` | - | |
107
+ | contentClassName | `string` | - | |
107
108
  | onActionClick | `() => void` | - | |
108
109
  | className | `string` | - | CSS-класс |
109
110
  ## IconGiga
@@ -553,6 +554,7 @@
553
554
  | name | type | default value | description |
554
555
  |------|------|---------------|-------------|
555
556
  | layoutType* | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
557
+ | onCancel* | `() => void` | - | Колбек отмены действия |
556
558
  | onSubmit* | `(value: string) => void` | - | Колбек действия при отправке |
557
559
  | className | `string` | - | CSS-класс |
558
560
  | disabled | `boolean` | - | Является ли поле деактивированным |
@@ -1,2 +1,2 @@
1
1
  import { ChatStatusAnnouncementProps } from './types';
2
- export declare function ChatStatusAnnouncement({ content, onActionClick, actionLabel, icon, layoutType, className, }: ChatStatusAnnouncementProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function ChatStatusAnnouncement({ content, contentClassName, onActionClick, actionLabel, icon, layoutType, className, }: ChatStatusAnnouncementProps): import("react/jsx-runtime").JSX.Element;
@@ -9,12 +9,13 @@ const classnames_1 = __importDefault(require("classnames"));
9
9
  const react_1 = require("react");
10
10
  const uikit_product_icons_1 = require("@cloud-ru/uikit-product-icons");
11
11
  const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
12
+ const truncate_string_1 = require("@snack-uikit/truncate-string");
13
+ const typography_1 = require("@snack-uikit/typography");
12
14
  const constants_1 = require("./constants");
13
15
  const AlertButton_1 = require("./helperComponents/AlertButton");
14
- const TextContent_1 = require("./helperComponents/TextContent");
15
16
  const styled_module_scss_1 = __importDefault(require('./styled.module.css'));
16
17
  const utils_1 = require("./utils");
17
- function ChatStatusAnnouncement({ content, onActionClick, actionLabel, icon, layoutType, className, }) {
18
+ function ChatStatusAnnouncement({ content, contentClassName, onActionClick, actionLabel, icon, layoutType, className, }) {
18
19
  const [currentIndex, setCurrentIndex] = (0, react_1.useState)(0);
19
20
  const [isAnimationEnded, setAnimationEnded] = (0, react_1.useState)(false);
20
21
  const [mouseEntered, setMouseEntered] = (0, react_1.useState)(false);
@@ -69,6 +70,6 @@ function ChatStatusAnnouncement({ content, onActionClick, actionLabel, icon, lay
69
70
  ? styled_module_scss_1.default.textBlockPrevious
70
71
  : styled_module_scss_1.default.textBlockNext;
71
72
  const currentTextStyle = index === currentIndex ? styled_module_scss_1.default.textBlockCurrent : currentTextNextOrPreviousStyle;
72
- return ((0, jsx_runtime_1.jsx)(TextContent_1.TextContent, { content: item.content, className: (0, classnames_1.default)(styled_module_scss_1.default.textBlock, currentTextStyle) }, index));
73
+ return ((0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyS, { className: (0, classnames_1.default)(styled_module_scss_1.default.textBlock, currentTextStyle, contentClassName), children: (0, jsx_runtime_1.jsx)(truncate_string_1.TruncateString, { text: String(item.content) }) }, index));
73
74
  }) })] }), (0, jsx_runtime_1.jsx)(AlertButton_1.AlertButton, { onClick: onActionClick, text: actionLabel, layoutType: layoutType })] }));
74
75
  }
@@ -1,12 +1,13 @@
1
- import { ReactElement, ReactNode } from 'react';
1
+ import { ReactElement } from 'react';
2
2
  import { LayoutType } from '@cloud-ru/uikit-product-utils';
3
3
  export type TextItem = {
4
- content: ReactNode;
4
+ content: string;
5
5
  shouldFocusOnHover?: boolean;
6
6
  };
7
7
  export type ChatStatusAnnouncementProps = {
8
8
  icon?: ReactElement;
9
- content: ReactNode | TextItem[];
9
+ content: string | TextItem[];
10
+ contentClassName?: string;
10
11
  actionLabel: string;
11
12
  onActionClick?: () => void;
12
13
  layoutType: LayoutType;
@@ -3,10 +3,14 @@ import { WithLayoutType } from '@cloud-ru/uikit-product-utils';
3
3
  export type SshFieldProps = WithLayoutType<Omit<FieldTextAreaProps, 'placeholder' | 'labelTooltip' | 'label' | 'required' | 'size' | 'spellCheck' | 'footer'> & {
4
4
  /** Колбек действия при отправке */
5
5
  onSubmit(value: string): void;
6
+ /** Колбек отмены действия */
7
+ onCancel(): void;
6
8
  }>;
7
9
  export declare const SshField: import("react").ForwardRefExoticComponent<Omit<FieldTextAreaProps, "label" | "size" | "placeholder" | "footer" | "spellCheck" | "required" | "labelTooltip"> & {
8
10
  /** Колбек действия при отправке */
9
11
  onSubmit(value: string): void;
12
+ /** Колбек отмены действия */
13
+ onCancel(): void;
10
14
  } & {
11
15
  layoutType: import("@cloud-ru/uikit-product-utils").LayoutType;
12
16
  } & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -45,7 +45,7 @@ const isTouchDevice_1 = require("./utils/isTouchDevice");
45
45
  const readFileContent_1 = require("./utils/readFileContent");
46
46
  const validateSSHKey_1 = require("./utils/validateSSHKey");
47
47
  exports.SshField = (0, react_1.forwardRef)((_a, ref) => {
48
- var { onSubmit: handleSubmitProp, value, disabled, className } = _a, props = __rest(_a, ["onSubmit", "value", "disabled", "className"]);
48
+ var { onSubmit: handleSubmitProp, onCancel, value, disabled, className } = _a, props = __rest(_a, ["onSubmit", "onCancel", "value", "disabled", "className"]);
49
49
  const { layoutType, validationState, onChange } = props;
50
50
  const { t } = (0, uikit_product_locale_1.useLocale)('Claudia');
51
51
  const isTouchDevice = (0, isTouchDevice_1.isTouchDevice)(layoutType);
@@ -133,5 +133,5 @@ exports.SshField = (0, react_1.forwardRef)((_a, ref) => {
133
133
  if (isTouchDevice) {
134
134
  return ((0, jsx_runtime_1.jsx)(MobileFieldAi_1.MobileFieldAi, Object.assign({}, props, (0, uikit_product_mobile_fields_1.getAdaptiveFieldProps)(props), { onSubmit: handleSubmit, submitEnabled: isValueValid && !disabled, ref: ref, value: value })));
135
135
  }
136
- return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.wrapper, className), onDragOver: handleDragOver, onDragLeave: handleDragLeave, children: [(0, jsx_runtime_1.jsx)(ChatStatusAnnouncement_1.ChatStatusAnnouncement, { className: styles_module_scss_1.default.chatStatus, layoutType: layoutType, icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.PasswordLockSVG, { size: 16, color: figma_tokens_1.themeVars.sys.neutral.textSupport }), content: t('SshField.chatStatusAnnouncement.content'), actionLabel: t('SshField.chatStatusAnnouncement.cancel'), onActionClick: () => { } }), isDragOver ? ((0, jsx_runtime_1.jsx)(drop_zone_1.DropZone, { description: (0, jsx_runtime_1.jsx)(DropZoneContent_1.DropZoneContent, {}), className: styles_module_scss_1.default.dropZone, mode: 'single', onFilesUpload: (files) => onFileUpload(files[0]) })) : ((0, jsx_runtime_1.jsx)(uikit_product_mobile_fields_1.AdaptiveFieldTextArea, Object.assign({}, props, { ref: ref, value: value, onChange: handleChange, size: 'm', disabled: isLoading, minRows: 2, maxRows: 4, placeholder: t('SshField.placeholder'), className: isValueHidden ? styles_module_scss_1.default.secured : undefined, onKeyDown: handleKeyDown, validationState: showFileError ? 'error' : validationState, hint: showFileError && fileErrorType ? getErrorMessage(fileErrorType) : props.hint, footer: (0, jsx_runtime_1.jsx)(TextAreaActionsFooter_1.TextAreaActionsFooter, { left: (0, jsx_runtime_1.jsx)(button_1.ButtonFunction, { size: 'xs', icon: isValueHidden ? (0, jsx_runtime_1.jsx)(uikit_product_icons_1.EyeSVG, {}) : (0, jsx_runtime_1.jsx)(uikit_product_icons_1.EyeClosedSVG, {}), onClick: () => setIsValueHidden(prev => !prev), disabled: isLoading }), right: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { tip: t('SshField.attachFileTooltip'), hoverDelayOpen: 600, triggerClassName: styles_module_scss_1.default.uploadTooltip, open: isTouchDevice ? false : undefined, children: (0, jsx_runtime_1.jsx)(drop_zone_1.FileUpload, { mode: 'single', onFilesUpload: (files) => onFileUpload(files[0]), children: (0, jsx_runtime_1.jsx)(button_1.ButtonFunction, { disabled: isLoading, size: isTouchDevice ? 's' : 'xs', icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.AttachmentSVG, {}) }) }) }), (0, jsx_runtime_1.jsx)(FieldSubmitButton_1.FieldSubmitButton, { disabled: isLoading, showTooltip: !isTouchDevice, className: isTouchDevice ? styles_module_scss_1.default.mobileSubmitButton : undefined, active: isValueValid && !disabled, handleClick: handleSubmit, size: isTouchDevice ? 's' : 'xs' })] }) }) })))] }));
136
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.wrapper, className), onDragOver: handleDragOver, onDragLeave: handleDragLeave, children: [(0, jsx_runtime_1.jsx)(ChatStatusAnnouncement_1.ChatStatusAnnouncement, { className: styles_module_scss_1.default.chatStatus, layoutType: layoutType, icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.PasswordLockSVG, { size: 16, color: figma_tokens_1.themeVars.sys.neutral.textSupport }), content: t('SshField.chatStatusAnnouncement.content'), actionLabel: t('SshField.chatStatusAnnouncement.cancel'), onActionClick: onCancel }), isDragOver ? ((0, jsx_runtime_1.jsx)(drop_zone_1.DropZone, { description: (0, jsx_runtime_1.jsx)(DropZoneContent_1.DropZoneContent, {}), className: styles_module_scss_1.default.dropZone, mode: 'single', onFilesUpload: (files) => onFileUpload(files[0]) })) : ((0, jsx_runtime_1.jsx)(uikit_product_mobile_fields_1.AdaptiveFieldTextArea, Object.assign({}, props, { ref: ref, value: value, onChange: handleChange, size: 'm', disabled: isLoading, minRows: 2, maxRows: 4, placeholder: t('SshField.placeholder'), className: isValueHidden ? styles_module_scss_1.default.secured : undefined, onKeyDown: handleKeyDown, validationState: showFileError ? 'error' : validationState, hint: showFileError && fileErrorType ? getErrorMessage(fileErrorType) : props.hint, footer: (0, jsx_runtime_1.jsx)(TextAreaActionsFooter_1.TextAreaActionsFooter, { left: (0, jsx_runtime_1.jsx)(button_1.ButtonFunction, { size: 'xs', icon: isValueHidden ? (0, jsx_runtime_1.jsx)(uikit_product_icons_1.EyeSVG, {}) : (0, jsx_runtime_1.jsx)(uikit_product_icons_1.EyeClosedSVG, {}), onClick: () => setIsValueHidden(prev => !prev), disabled: isLoading }), right: (0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { tip: t('SshField.attachFileTooltip'), hoverDelayOpen: 600, triggerClassName: styles_module_scss_1.default.uploadTooltip, open: isTouchDevice ? false : undefined, children: (0, jsx_runtime_1.jsx)(drop_zone_1.FileUpload, { mode: 'single', onFilesUpload: (files) => onFileUpload(files[0]), children: (0, jsx_runtime_1.jsx)(button_1.ButtonFunction, { disabled: isLoading, size: isTouchDevice ? 's' : 'xs', icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.AttachmentSVG, {}) }) }) }), (0, jsx_runtime_1.jsx)(FieldSubmitButton_1.FieldSubmitButton, { disabled: isLoading, showTooltip: !isTouchDevice, className: isTouchDevice ? styles_module_scss_1.default.mobileSubmitButton : undefined, active: isValueValid && !disabled, handleClick: handleSubmit, size: isTouchDevice ? 's' : 'xs' })] }) }) })))] }));
137
137
  });
@@ -1,2 +1,2 @@
1
1
  import { ChatStatusAnnouncementProps } from './types';
2
- export declare function ChatStatusAnnouncement({ content, onActionClick, actionLabel, icon, layoutType, className, }: ChatStatusAnnouncementProps): import("react/jsx-runtime").JSX.Element;
2
+ export declare function ChatStatusAnnouncement({ content, contentClassName, onActionClick, actionLabel, icon, layoutType, className, }: ChatStatusAnnouncementProps): import("react/jsx-runtime").JSX.Element;
@@ -3,12 +3,13 @@ import cn from 'classnames';
3
3
  import { useEffect, useRef, useState } from 'react';
4
4
  import { PlaceholderSVG } from '@cloud-ru/uikit-product-icons';
5
5
  import { LAYOUT_TYPE } from '@cloud-ru/uikit-product-utils';
6
+ import { TruncateString } from '@snack-uikit/truncate-string';
7
+ import { Typography } from '@snack-uikit/typography';
6
8
  import { ANIMATION_INTERVAL } from './constants';
7
9
  import { AlertButton } from './helperComponents/AlertButton';
8
- import { TextContent } from './helperComponents/TextContent';
9
10
  import styles from './styled.module.css';
10
11
  import { getContent, isReactNode } from './utils';
11
- export function ChatStatusAnnouncement({ content, onActionClick, actionLabel, icon, layoutType, className, }) {
12
+ export function ChatStatusAnnouncement({ content, contentClassName, onActionClick, actionLabel, icon, layoutType, className, }) {
12
13
  const [currentIndex, setCurrentIndex] = useState(0);
13
14
  const [isAnimationEnded, setAnimationEnded] = useState(false);
14
15
  const [mouseEntered, setMouseEntered] = useState(false);
@@ -63,6 +64,6 @@ export function ChatStatusAnnouncement({ content, onActionClick, actionLabel, ic
63
64
  ? styles.textBlockPrevious
64
65
  : styles.textBlockNext;
65
66
  const currentTextStyle = index === currentIndex ? styles.textBlockCurrent : currentTextNextOrPreviousStyle;
66
- return (_jsx(TextContent, { content: item.content, className: cn(styles.textBlock, currentTextStyle) }, index));
67
+ return (_jsx(Typography.SansBodyS, { className: cn(styles.textBlock, currentTextStyle, contentClassName), children: _jsx(TruncateString, { text: String(item.content) }) }, index));
67
68
  }) })] }), _jsx(AlertButton, { onClick: onActionClick, text: actionLabel, layoutType: layoutType })] }));
68
69
  }
@@ -1,12 +1,13 @@
1
- import { ReactElement, ReactNode } from 'react';
1
+ import { ReactElement } from 'react';
2
2
  import { LayoutType } from '@cloud-ru/uikit-product-utils';
3
3
  export type TextItem = {
4
- content: ReactNode;
4
+ content: string;
5
5
  shouldFocusOnHover?: boolean;
6
6
  };
7
7
  export type ChatStatusAnnouncementProps = {
8
8
  icon?: ReactElement;
9
- content: ReactNode | TextItem[];
9
+ content: string | TextItem[];
10
+ contentClassName?: string;
10
11
  actionLabel: string;
11
12
  onActionClick?: () => void;
12
13
  layoutType: LayoutType;
@@ -3,10 +3,14 @@ import { WithLayoutType } from '@cloud-ru/uikit-product-utils';
3
3
  export type SshFieldProps = WithLayoutType<Omit<FieldTextAreaProps, 'placeholder' | 'labelTooltip' | 'label' | 'required' | 'size' | 'spellCheck' | 'footer'> & {
4
4
  /** Колбек действия при отправке */
5
5
  onSubmit(value: string): void;
6
+ /** Колбек отмены действия */
7
+ onCancel(): void;
6
8
  }>;
7
9
  export declare const SshField: import("react").ForwardRefExoticComponent<Omit<FieldTextAreaProps, "label" | "size" | "placeholder" | "footer" | "spellCheck" | "required" | "labelTooltip"> & {
8
10
  /** Колбек действия при отправке */
9
11
  onSubmit(value: string): void;
12
+ /** Колбек отмены действия */
13
+ onCancel(): void;
10
14
  } & {
11
15
  layoutType: import("@cloud-ru/uikit-product-utils").LayoutType;
12
16
  } & import("react").RefAttributes<HTMLTextAreaElement>>;
@@ -39,7 +39,7 @@ import { isTouchDevice as isTouchDeviceHelper } from './utils/isTouchDevice';
39
39
  import { readFileContent } from './utils/readFileContent';
40
40
  import { validateFileSize, validateFileType, validateSSHKeyContent } from './utils/validateSSHKey';
41
41
  export const SshField = forwardRef((_a, ref) => {
42
- var { onSubmit: handleSubmitProp, value, disabled, className } = _a, props = __rest(_a, ["onSubmit", "value", "disabled", "className"]);
42
+ var { onSubmit: handleSubmitProp, onCancel, value, disabled, className } = _a, props = __rest(_a, ["onSubmit", "onCancel", "value", "disabled", "className"]);
43
43
  const { layoutType, validationState, onChange } = props;
44
44
  const { t } = useLocale('Claudia');
45
45
  const isTouchDevice = isTouchDeviceHelper(layoutType);
@@ -127,5 +127,5 @@ export const SshField = forwardRef((_a, ref) => {
127
127
  if (isTouchDevice) {
128
128
  return (_jsx(MobileFieldAi, Object.assign({}, props, getAdaptiveFieldProps(props), { onSubmit: handleSubmit, submitEnabled: isValueValid && !disabled, ref: ref, value: value })));
129
129
  }
130
- return (_jsxs("div", { className: cn(styles.wrapper, className), onDragOver: handleDragOver, onDragLeave: handleDragLeave, children: [_jsx(ChatStatusAnnouncement, { className: styles.chatStatus, layoutType: layoutType, icon: _jsx(PasswordLockSVG, { size: 16, color: themeVars.sys.neutral.textSupport }), content: t('SshField.chatStatusAnnouncement.content'), actionLabel: t('SshField.chatStatusAnnouncement.cancel'), onActionClick: () => { } }), isDragOver ? (_jsx(DropZone, { description: _jsx(DropZoneContent, {}), className: styles.dropZone, mode: 'single', onFilesUpload: (files) => onFileUpload(files[0]) })) : (_jsx(AdaptiveFieldTextArea, Object.assign({}, props, { ref: ref, value: value, onChange: handleChange, size: 'm', disabled: isLoading, minRows: 2, maxRows: 4, placeholder: t('SshField.placeholder'), className: isValueHidden ? styles.secured : undefined, onKeyDown: handleKeyDown, validationState: showFileError ? 'error' : validationState, hint: showFileError && fileErrorType ? getErrorMessage(fileErrorType) : props.hint, footer: _jsx(TextAreaActionsFooter, { left: _jsx(ButtonFunction, { size: 'xs', icon: isValueHidden ? _jsx(EyeSVG, {}) : _jsx(EyeClosedSVG, {}), onClick: () => setIsValueHidden(prev => !prev), disabled: isLoading }), right: _jsxs(_Fragment, { children: [_jsx(Tooltip, { tip: t('SshField.attachFileTooltip'), hoverDelayOpen: 600, triggerClassName: styles.uploadTooltip, open: isTouchDevice ? false : undefined, children: _jsx(FileUpload, { mode: 'single', onFilesUpload: (files) => onFileUpload(files[0]), children: _jsx(ButtonFunction, { disabled: isLoading, size: isTouchDevice ? 's' : 'xs', icon: _jsx(AttachmentSVG, {}) }) }) }), _jsx(FieldSubmitButton, { disabled: isLoading, showTooltip: !isTouchDevice, className: isTouchDevice ? styles.mobileSubmitButton : undefined, active: isValueValid && !disabled, handleClick: handleSubmit, size: isTouchDevice ? 's' : 'xs' })] }) }) })))] }));
130
+ return (_jsxs("div", { className: cn(styles.wrapper, className), onDragOver: handleDragOver, onDragLeave: handleDragLeave, children: [_jsx(ChatStatusAnnouncement, { className: styles.chatStatus, layoutType: layoutType, icon: _jsx(PasswordLockSVG, { size: 16, color: themeVars.sys.neutral.textSupport }), content: t('SshField.chatStatusAnnouncement.content'), actionLabel: t('SshField.chatStatusAnnouncement.cancel'), onActionClick: onCancel }), isDragOver ? (_jsx(DropZone, { description: _jsx(DropZoneContent, {}), className: styles.dropZone, mode: 'single', onFilesUpload: (files) => onFileUpload(files[0]) })) : (_jsx(AdaptiveFieldTextArea, Object.assign({}, props, { ref: ref, value: value, onChange: handleChange, size: 'm', disabled: isLoading, minRows: 2, maxRows: 4, placeholder: t('SshField.placeholder'), className: isValueHidden ? styles.secured : undefined, onKeyDown: handleKeyDown, validationState: showFileError ? 'error' : validationState, hint: showFileError && fileErrorType ? getErrorMessage(fileErrorType) : props.hint, footer: _jsx(TextAreaActionsFooter, { left: _jsx(ButtonFunction, { size: 'xs', icon: isValueHidden ? _jsx(EyeSVG, {}) : _jsx(EyeClosedSVG, {}), onClick: () => setIsValueHidden(prev => !prev), disabled: isLoading }), right: _jsxs(_Fragment, { children: [_jsx(Tooltip, { tip: t('SshField.attachFileTooltip'), hoverDelayOpen: 600, triggerClassName: styles.uploadTooltip, open: isTouchDevice ? false : undefined, children: _jsx(FileUpload, { mode: 'single', onFilesUpload: (files) => onFileUpload(files[0]), children: _jsx(ButtonFunction, { disabled: isLoading, size: isTouchDevice ? 's' : 'xs', icon: _jsx(AttachmentSVG, {}) }) }) }), _jsx(FieldSubmitButton, { disabled: isLoading, showTooltip: !isTouchDevice, className: isTouchDevice ? styles.mobileSubmitButton : undefined, active: isValueValid && !disabled, handleClick: handleSubmit, size: isTouchDevice ? 's' : 'xs' })] }) }) })))] }));
131
131
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloud-ru/uikit-product-claudia",
3
3
  "title": "Claudia",
4
- "version": "1.7.0",
4
+ "version": "1.8.1",
5
5
  "sideEffects": [
6
6
  "*.css",
7
7
  "*.woff",
@@ -36,10 +36,10 @@
36
36
  },
37
37
  "scripts": {},
38
38
  "dependencies": {
39
- "@cloud-ru/uikit-product-icons": "15.1.4",
40
- "@cloud-ru/uikit-product-mobile-dropdown": "0.9.24",
41
- "@cloud-ru/uikit-product-mobile-fields": "0.11.27",
42
- "@cloud-ru/uikit-product-utils": "7.0.3",
39
+ "@cloud-ru/uikit-product-icons": "15.1.5",
40
+ "@cloud-ru/uikit-product-mobile-dropdown": "0.9.25",
41
+ "@cloud-ru/uikit-product-mobile-fields": "0.11.28",
42
+ "@cloud-ru/uikit-product-utils": "8.0.0",
43
43
  "@snack-uikit/button": "0.19.16",
44
44
  "@snack-uikit/drop-zone": "0.9.6",
45
45
  "@snack-uikit/dropdown": "0.5.3",
@@ -58,5 +58,5 @@
58
58
  "@cloud-ru/uikit-product-locale": "*",
59
59
  "@snack-uikit/figma-tokens": "*"
60
60
  },
61
- "gitHead": "871be56e967b2421b96a5a0135b509d6ff29b7b7"
61
+ "gitHead": "46b285728ff0dfe51d89b375469a6c05d6f2dba9"
62
62
  }
@@ -3,16 +3,18 @@ import { useEffect, useRef, useState } from 'react';
3
3
 
4
4
  import { PlaceholderSVG } from '@cloud-ru/uikit-product-icons';
5
5
  import { LAYOUT_TYPE } from '@cloud-ru/uikit-product-utils';
6
+ import { TruncateString } from '@snack-uikit/truncate-string';
7
+ import { Typography } from '@snack-uikit/typography';
6
8
 
7
9
  import { ANIMATION_INTERVAL } from './constants';
8
10
  import { AlertButton } from './helperComponents/AlertButton';
9
- import { TextContent } from './helperComponents/TextContent';
10
11
  import styles from './styled.module.scss';
11
12
  import { ChatStatusAnnouncementProps } from './types';
12
13
  import { getContent, isReactNode } from './utils';
13
14
 
14
15
  export function ChatStatusAnnouncement({
15
16
  content,
17
+ contentClassName,
16
18
  onActionClick,
17
19
  actionLabel,
18
20
  icon,
@@ -98,7 +100,9 @@ export function ChatStatusAnnouncement({
98
100
  const currentTextStyle = index === currentIndex ? styles.textBlockCurrent : currentTextNextOrPreviousStyle;
99
101
 
100
102
  return (
101
- <TextContent key={index} content={item.content} className={cn(styles.textBlock, currentTextStyle)} />
103
+ <Typography.SansBodyS key={index} className={cn(styles.textBlock, currentTextStyle, contentClassName)}>
104
+ <TruncateString text={String(item.content)} />
105
+ </Typography.SansBodyS>
102
106
  );
103
107
  })}
104
108
  </div>
@@ -1,15 +1,16 @@
1
- import { ReactElement, ReactNode } from 'react';
1
+ import { ReactElement } from 'react';
2
2
 
3
3
  import { LayoutType } from '@cloud-ru/uikit-product-utils';
4
4
 
5
5
  export type TextItem = {
6
- content: ReactNode;
6
+ content: string;
7
7
  shouldFocusOnHover?: boolean;
8
8
  };
9
9
 
10
10
  export type ChatStatusAnnouncementProps = {
11
11
  icon?: ReactElement;
12
- content: ReactNode | TextItem[];
12
+ content: string | TextItem[];
13
+ contentClassName?: string;
13
14
  actionLabel: string;
14
15
  onActionClick?: () => void;
15
16
  layoutType: LayoutType;
@@ -29,11 +29,13 @@ export type SshFieldProps = WithLayoutType<
29
29
  Omit<FieldTextAreaProps, 'placeholder' | 'labelTooltip' | 'label' | 'required' | 'size' | 'spellCheck' | 'footer'> & {
30
30
  /** Колбек действия при отправке */
31
31
  onSubmit(value: string): void;
32
+ /** Колбек отмены действия */
33
+ onCancel(): void;
32
34
  }
33
35
  >;
34
36
 
35
37
  export const SshField = forwardRef<HTMLTextAreaElement, SshFieldProps>(
36
- ({ onSubmit: handleSubmitProp, value, disabled, className, ...props }, ref) => {
38
+ ({ onSubmit: handleSubmitProp, onCancel, value, disabled, className, ...props }, ref) => {
37
39
  const { layoutType, validationState, onChange } = props;
38
40
  const { t } = useLocale('Claudia');
39
41
  const isTouchDevice = isTouchDeviceHelper(layoutType);
@@ -152,7 +154,7 @@ export const SshField = forwardRef<HTMLTextAreaElement, SshFieldProps>(
152
154
  icon={<PasswordLockSVG size={16} color={themeVars.sys.neutral.textSupport} />}
153
155
  content={t('SshField.chatStatusAnnouncement.content')}
154
156
  actionLabel={t('SshField.chatStatusAnnouncement.cancel')}
155
- onActionClick={() => {}}
157
+ onActionClick={onCancel}
156
158
  />
157
159
  {isDragOver ? (
158
160
  <DropZone
@@ -1,7 +0,0 @@
1
- import { ReactNode } from 'react';
2
- type TextContent = {
3
- content: ReactNode;
4
- className?: string;
5
- };
6
- export declare function TextContent({ content, className }: TextContent): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | null | undefined;
7
- export {};
@@ -1,12 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.TextContent = TextContent;
4
- const jsx_runtime_1 = require("react/jsx-runtime");
5
- const typography_1 = require("@snack-uikit/typography");
6
- const utils_1 = require("../../utils");
7
- function TextContent({ content, className }) {
8
- if ((0, utils_1.isReactNode)(content)) {
9
- return content;
10
- }
11
- return (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyS, { className: className, children: content });
12
- }
@@ -1 +0,0 @@
1
- export * from './TextContent';
@@ -1,17 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./TextContent"), exports);
@@ -1,7 +0,0 @@
1
- import { ReactNode } from 'react';
2
- type TextContent = {
3
- content: ReactNode;
4
- className?: string;
5
- };
6
- export declare function TextContent({ content, className }: TextContent): string | number | boolean | import("react/jsx-runtime").JSX.Element | Iterable<ReactNode> | null | undefined;
7
- export {};
@@ -1,9 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { Typography } from '@snack-uikit/typography';
3
- import { isReactNode } from '../../utils';
4
- export function TextContent({ content, className }) {
5
- if (isReactNode(content)) {
6
- return content;
7
- }
8
- return _jsx(Typography.SansBodyS, { className: className, children: content });
9
- }
@@ -1 +0,0 @@
1
- export * from './TextContent';
@@ -1 +0,0 @@
1
- export * from './TextContent';
@@ -1,18 +0,0 @@
1
- import { ReactNode } from 'react';
2
-
3
- import { Typography } from '@snack-uikit/typography';
4
-
5
- import { isReactNode } from '../../utils';
6
-
7
- type TextContent = {
8
- content: ReactNode;
9
- className?: string;
10
- };
11
-
12
- export function TextContent({ content, className }: TextContent) {
13
- if (isReactNode(content)) {
14
- return content;
15
- }
16
-
17
- return <Typography.SansBodyS className={className}>{content}</Typography.SansBodyS>;
18
- }
@@ -1 +0,0 @@
1
- export * from './TextContent';