@cloud-ru/uikit-product-claudia 1.6.4 → 1.7.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.
- package/CHANGELOG.md +23 -0
- package/README.md +3 -2
- package/dist/cjs/components/ButtonClaudia/ButtonClaudia.d.ts +1 -1
- package/dist/cjs/components/ButtonClaudia/ButtonClaudia.js +1 -1
- package/dist/cjs/components/ButtonGiga/ButtonGigaFunction/ButtonGigaFunction.d.ts +1 -1
- package/dist/cjs/components/ButtonGiga/ButtonGigaFunction/ButtonGigaFunction.js +1 -1
- package/dist/cjs/components/ButtonGiga/ButtonGigaMama/ButtonGigaMama.d.ts +1 -1
- package/dist/cjs/components/ButtonGiga/ButtonGigaMama/ButtonGigaMama.js +1 -1
- package/dist/cjs/components/ButtonGiga/ButtonGigaOutline/ButtonGigaOutline.d.ts +1 -1
- package/dist/cjs/components/ButtonGiga/ButtonGigaOutline/ButtonGigaOutline.js +1 -1
- package/dist/cjs/components/ChatStatusAnnouncement/ChatStatusAnnouncement.js +2 -2
- package/dist/cjs/components/ChatStatusAnnouncement/helperComponents/AlertButton/AlertButton.d.ts +1 -1
- package/dist/cjs/components/ChatStatusAnnouncement/helperComponents/AlertButton/AlertButton.js +1 -1
- package/dist/cjs/components/ChatStatusAnnouncement/types.d.ts +1 -1
- package/dist/cjs/components/RecommendPannel/RecommendPanel.d.ts +5 -4
- package/dist/cjs/components/RecommendPannel/RecommendPanel.js +5 -4
- package/dist/cjs/components/RecommendPannel/helperComponents/AiAssistantChip/AiAssistantChip.d.ts +12 -0
- package/dist/cjs/components/RecommendPannel/helperComponents/AiAssistantChip/AiAssistantChip.js +20 -0
- package/dist/cjs/components/RecommendPannel/helperComponents/AiAssistantChip/index.d.ts +1 -0
- package/dist/cjs/components/RecommendPannel/helperComponents/{ClaudiaChip → AiAssistantChip}/index.js +1 -1
- package/dist/cjs/components/RecommendPannel/helperComponents/Chip/Chip.d.ts +1 -1
- package/dist/cjs/components/RecommendPannel/helperComponents/Chip/Chip.js +1 -1
- package/dist/cjs/components/RecommendPannel/helperComponents/CloseChip/CloseChip.d.ts +1 -1
- package/dist/cjs/components/RecommendPannel/helperComponents/CloseChip/CloseChip.js +3 -3
- package/dist/cjs/components/RecommendPannel/helperComponents/DropdownChip/DropdownChip.d.ts +1 -1
- package/dist/cjs/components/RecommendPannel/helperComponents/DropdownChip/DropdownChip.js +2 -2
- package/dist/cjs/components/SshField/SshField.d.ts +4 -4
- package/dist/cjs/components/SshField/SshField.js +5 -5
- package/dist/cjs/components/SshField/components/MobileFieldAi/MobileFieldAi.d.ts +2 -2
- package/dist/cjs/components/SshField/components/MobileFieldAi/MobileFieldAi.js +2 -2
- package/dist/cjs/components/SshField/helperComponents/DropZoneContent/DropZoneContent.js +1 -1
- package/dist/cjs/components/SshField/helperComponents/FieldSubmitButton/FieldSubmitButton.js +2 -2
- package/dist/cjs/components/SshField/utils/isTouchDevice.d.ts +1 -1
- package/dist/esm/components/ButtonClaudia/ButtonClaudia.d.ts +1 -1
- package/dist/esm/components/ButtonClaudia/ButtonClaudia.js +1 -1
- package/dist/esm/components/ButtonGiga/ButtonGigaFunction/ButtonGigaFunction.d.ts +1 -1
- package/dist/esm/components/ButtonGiga/ButtonGigaFunction/ButtonGigaFunction.js +1 -1
- package/dist/esm/components/ButtonGiga/ButtonGigaMama/ButtonGigaMama.d.ts +1 -1
- package/dist/esm/components/ButtonGiga/ButtonGigaMama/ButtonGigaMama.js +1 -1
- package/dist/esm/components/ButtonGiga/ButtonGigaOutline/ButtonGigaOutline.d.ts +1 -1
- package/dist/esm/components/ButtonGiga/ButtonGigaOutline/ButtonGigaOutline.js +1 -1
- package/dist/esm/components/ChatStatusAnnouncement/ChatStatusAnnouncement.js +2 -2
- package/dist/esm/components/ChatStatusAnnouncement/helperComponents/AlertButton/AlertButton.d.ts +1 -1
- package/dist/esm/components/ChatStatusAnnouncement/helperComponents/AlertButton/AlertButton.js +1 -1
- package/dist/esm/components/ChatStatusAnnouncement/types.d.ts +1 -1
- package/dist/esm/components/RecommendPannel/RecommendPanel.d.ts +5 -4
- package/dist/esm/components/RecommendPannel/RecommendPanel.js +5 -4
- package/dist/esm/components/RecommendPannel/helperComponents/AiAssistantChip/AiAssistantChip.d.ts +12 -0
- package/dist/esm/components/RecommendPannel/helperComponents/AiAssistantChip/AiAssistantChip.js +17 -0
- package/dist/esm/components/RecommendPannel/helperComponents/AiAssistantChip/index.d.ts +1 -0
- package/dist/esm/components/RecommendPannel/helperComponents/AiAssistantChip/index.js +1 -0
- package/dist/esm/components/RecommendPannel/helperComponents/Chip/Chip.d.ts +1 -1
- package/dist/esm/components/RecommendPannel/helperComponents/Chip/Chip.js +1 -1
- package/dist/esm/components/RecommendPannel/helperComponents/CloseChip/CloseChip.d.ts +1 -1
- package/dist/esm/components/RecommendPannel/helperComponents/CloseChip/CloseChip.js +3 -3
- package/dist/esm/components/RecommendPannel/helperComponents/DropdownChip/DropdownChip.d.ts +1 -1
- package/dist/esm/components/RecommendPannel/helperComponents/DropdownChip/DropdownChip.js +2 -2
- package/dist/esm/components/SshField/SshField.d.ts +4 -4
- package/dist/esm/components/SshField/SshField.js +4 -4
- package/dist/esm/components/SshField/components/MobileFieldAi/MobileFieldAi.d.ts +2 -2
- package/dist/esm/components/SshField/components/MobileFieldAi/MobileFieldAi.js +2 -2
- package/dist/esm/components/SshField/helperComponents/DropZoneContent/DropZoneContent.js +1 -1
- package/dist/esm/components/SshField/helperComponents/FieldSubmitButton/FieldSubmitButton.js +2 -2
- package/dist/esm/components/SshField/utils/isTouchDevice.d.ts +1 -1
- package/package.json +9 -8
- package/src/components/RecommendPannel/RecommendPanel.tsx +26 -7
- package/src/components/RecommendPannel/helperComponents/AiAssistantChip/AiAssistantChip.tsx +58 -0
- package/src/components/RecommendPannel/helperComponents/AiAssistantChip/index.ts +1 -0
- package/src/components/SshField/SshField.tsx +1 -1
- package/dist/cjs/components/RecommendPannel/helperComponents/ClaudiaChip/ClaudiaChip.d.ts +0 -11
- package/dist/cjs/components/RecommendPannel/helperComponents/ClaudiaChip/ClaudiaChip.js +0 -18
- package/dist/cjs/components/RecommendPannel/helperComponents/ClaudiaChip/index.d.ts +0 -1
- package/dist/esm/components/RecommendPannel/helperComponents/ClaudiaChip/ClaudiaChip.d.ts +0 -11
- package/dist/esm/components/RecommendPannel/helperComponents/ClaudiaChip/ClaudiaChip.js +0 -15
- package/dist/esm/components/RecommendPannel/helperComponents/ClaudiaChip/index.d.ts +0 -1
- package/dist/esm/components/RecommendPannel/helperComponents/ClaudiaChip/index.js +0 -1
- package/src/components/RecommendPannel/helperComponents/ClaudiaChip/ClaudiaChip.tsx +0 -40
- package/src/components/RecommendPannel/helperComponents/ClaudiaChip/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.7.0 (2025-11-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **RM-3714:** replace claudia button by giga for recommend panel ([9114db7](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/9114db7e67cc17a4e134b3d3b7a12055b6d5edae))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## 1.6.5 (2025-11-13)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **PD-3377:** removed contributors ([121640f](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/121640f7b88b20a728a6ad2c39de8841532bb308))
|
|
23
|
+
* **PD-3377:** replaced tokens import to snack-uikit scoped package ([dd13d3b](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/dd13d3b7134a4b0d4696830dcd78c0e790700d09))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
6
29
|
## 1.6.4 (2025-11-13)
|
|
7
30
|
|
|
8
31
|
### Only dependencies have been changed
|
package/README.md
CHANGED
|
@@ -545,8 +545,9 @@
|
|
|
545
545
|
| layoutType | enum LayoutType: `"mobile"`, `"tablet"`, `"desktop"`, `"desktopSmall"` | - | |
|
|
546
546
|
| onCloseClick | `() => void` | - | |
|
|
547
547
|
| onCloseChipLabel | `ReactNode` | - | |
|
|
548
|
-
|
|
|
549
|
-
|
|
|
548
|
+
| onAiAssistantClick | `() => void` | - | |
|
|
549
|
+
| docsUrl | `string` | https://cloud.ru/docs/ai_assistant_cloudia/ug/index | |
|
|
550
|
+
| dataTestId | `string` | recommend-panel | |
|
|
550
551
|
## SshField
|
|
551
552
|
### Props
|
|
552
553
|
| name | type | default value | description |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WithSupportProps } from '@
|
|
1
|
+
import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
|
|
2
2
|
import { CommonButtonProps } from './types';
|
|
3
3
|
export type ButtonClaudiaProps = WithSupportProps<Omit<CommonButtonProps, 'appearance' | 'iconPosition'>>;
|
|
4
4
|
export declare const ButtonClaudia: import("react").ForwardRefExoticComponent<{
|
|
@@ -18,7 +18,7 @@ exports.ButtonClaudia = void 0;
|
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const classnames_1 = __importDefault(require("classnames"));
|
|
20
20
|
const react_1 = require("react");
|
|
21
|
-
const uikit_product_utils_1 = require("@
|
|
21
|
+
const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
|
|
22
22
|
const constants_1 = require("./constants");
|
|
23
23
|
const helperComponents_1 = require("./helperComponents");
|
|
24
24
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WithSupportProps } from '@
|
|
1
|
+
import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
|
|
2
2
|
import { CommonButtonProps } from './types';
|
|
3
3
|
export type ButtonGigaFunctionProps = WithSupportProps<Omit<CommonButtonProps, 'appearance'>>;
|
|
4
4
|
export declare const ButtonGigaFunction: import("react").ForwardRefExoticComponent<{
|
|
@@ -18,7 +18,7 @@ exports.ButtonGigaFunction = void 0;
|
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const classnames_1 = __importDefault(require("classnames"));
|
|
20
20
|
const react_1 = require("react");
|
|
21
|
-
const uikit_product_utils_1 = require("@
|
|
21
|
+
const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
|
|
22
22
|
const constants_1 = require("../constants");
|
|
23
23
|
const helperComponents_1 = require("../helperComponents");
|
|
24
24
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WithSupportProps } from '@
|
|
1
|
+
import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
|
|
2
2
|
import { CommonButtonProps } from '../helperComponents/ButtonPrivate/types';
|
|
3
3
|
export type ButtonGigaMamaProps = WithSupportProps<Omit<CommonButtonProps, 'appearance' | 'size' | 'iconPosition'>>;
|
|
4
4
|
export declare const ButtonGigaMama: import("react").ForwardRefExoticComponent<{
|
|
@@ -18,7 +18,7 @@ exports.ButtonGigaMama = void 0;
|
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const classnames_1 = __importDefault(require("classnames"));
|
|
20
20
|
const react_1 = require("react");
|
|
21
|
-
const uikit_product_utils_1 = require("@
|
|
21
|
+
const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
|
|
22
22
|
const constants_1 = require("../constants");
|
|
23
23
|
const helperComponents_1 = require("../helperComponents");
|
|
24
24
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WithSupportProps } from '@
|
|
1
|
+
import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
|
|
2
2
|
import { CommonButtonProps } from './types';
|
|
3
3
|
export type ButtonGigaOutlineProps = WithSupportProps<Omit<CommonButtonProps, 'appearance'>>;
|
|
4
4
|
export declare const ButtonGigaOutline: import("react").ForwardRefExoticComponent<{
|
|
@@ -18,7 +18,7 @@ exports.ButtonGigaOutline = void 0;
|
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const classnames_1 = __importDefault(require("classnames"));
|
|
20
20
|
const react_1 = require("react");
|
|
21
|
-
const uikit_product_utils_1 = require("@
|
|
21
|
+
const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
|
|
22
22
|
const constants_1 = require("../constants");
|
|
23
23
|
const helperComponents_1 = require("../helperComponents");
|
|
24
24
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
@@ -7,8 +7,8 @@ exports.ChatStatusAnnouncement = ChatStatusAnnouncement;
|
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const classnames_1 = __importDefault(require("classnames"));
|
|
9
9
|
const react_1 = require("react");
|
|
10
|
-
const uikit_product_icons_1 = require("@
|
|
11
|
-
const uikit_product_utils_1 = require("@
|
|
10
|
+
const uikit_product_icons_1 = require("@cloud-ru/uikit-product-icons");
|
|
11
|
+
const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
|
|
12
12
|
const constants_1 = require("./constants");
|
|
13
13
|
const AlertButton_1 = require("./helperComponents/AlertButton");
|
|
14
14
|
const TextContent_1 = require("./helperComponents/TextContent");
|
package/dist/cjs/components/ChatStatusAnnouncement/helperComponents/AlertButton/AlertButton.js
CHANGED
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.AlertButton = AlertButton;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const uikit_product_utils_1 = require("@
|
|
8
|
+
const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
|
|
9
9
|
const typography_1 = require("@snack-uikit/typography");
|
|
10
10
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
11
11
|
function AlertButton({ text, onClick, layoutType }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { LayoutType } from '@
|
|
2
|
+
import { LayoutType } from '@cloud-ru/uikit-product-utils';
|
|
3
3
|
import { ChipProps, ChipType, Size } from './types';
|
|
4
4
|
export type RecommendPanelProps = {
|
|
5
5
|
chips: ChipProps[];
|
|
@@ -8,7 +8,8 @@ export type RecommendPanelProps = {
|
|
|
8
8
|
layoutType?: LayoutType;
|
|
9
9
|
onCloseClick?: () => void;
|
|
10
10
|
onCloseChipLabel?: ReactNode;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
onAiAssistantClick?: () => void;
|
|
12
|
+
docsUrl?: string;
|
|
13
|
+
dataTestId?: string;
|
|
13
14
|
};
|
|
14
|
-
export declare function RecommendPanel({ chips, type, size, layoutType, onCloseClick, onCloseChipLabel,
|
|
15
|
+
export declare function RecommendPanel({ chips, type, size, layoutType, onCloseClick, onCloseChipLabel, onAiAssistantClick, docsUrl, dataTestId, }: RecommendPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -6,15 +6,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.RecommendPanel = RecommendPanel;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("react");
|
|
9
|
-
const uikit_product_utils_1 = require("@
|
|
9
|
+
const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
|
|
10
|
+
const AiAssistantChip_1 = require("./helperComponents/AiAssistantChip");
|
|
10
11
|
const Chip_1 = require("./helperComponents/Chip");
|
|
11
|
-
const ClaudiaChip_1 = require("./helperComponents/ClaudiaChip");
|
|
12
12
|
const CloseChip_1 = require("./helperComponents/CloseChip");
|
|
13
13
|
const DropdownChip_1 = require("./helperComponents/DropdownChip");
|
|
14
14
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
15
15
|
const types_1 = require("./types");
|
|
16
16
|
const gitVisibleChipsCount_1 = require("./utils/gitVisibleChipsCount");
|
|
17
|
-
|
|
17
|
+
const AI_ASSISTANT_DOCUMENTATION_URL = 'https://cloud.ru/docs/ai_assistant_cloudia/ug/index';
|
|
18
|
+
function RecommendPanel({ chips, type = types_1.CHIP_TYPE.Default, size = types_1.SIZE.S, layoutType, onCloseClick, onCloseChipLabel, onAiAssistantClick, docsUrl = AI_ASSISTANT_DOCUMENTATION_URL, dataTestId = 'recommend-panel', }) {
|
|
18
19
|
const [containerWidth, setContainerWidth] = (0, react_1.useState)(0);
|
|
19
20
|
const [isCloseIconVisible, setCloseIconVisible] = (0, react_1.useState)(false);
|
|
20
21
|
const [chipWidths, setChipWidths] = (0, react_1.useState)([]);
|
|
@@ -70,5 +71,5 @@ function RecommendPanel({ chips, type = types_1.CHIP_TYPE.Default, size = types_
|
|
|
70
71
|
return;
|
|
71
72
|
setCloseIconVisible(false);
|
|
72
73
|
};
|
|
73
|
-
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.container, ref: containerRef, onMouseEnter: showCloseIcon, onMouseLeave: hideCloseIcon, children: [(0, jsx_runtime_1.jsx)(
|
|
74
|
+
return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.container, ref: containerRef, onMouseEnter: showCloseIcon, onMouseLeave: hideCloseIcon, "data-test-id": dataTestId, children: [(0, jsx_runtime_1.jsx)(AiAssistantChip_1.AiAssistantChip, { layoutType: layoutType, onClick: onAiAssistantClick, size: size, "data-test-id": `${dataTestId}__ai-assistant-chip`, docsUrl: docsUrl }), visibleChips.map((chip, index) => ((0, jsx_runtime_1.jsx)(Chip_1.Chip, { ref: chipElement => (allChipsRefs.current[index] = chipElement), label: chip.label, size: size, type: type, layoutType: layoutType, onClick: chip.onClick, "data-test-id": `${dataTestId}__chip-${chip.id}` }, chip.id))), hasHiddenChips && ((0, jsx_runtime_1.jsx)(DropdownChip_1.DropdownChip, { layoutType: layoutType, type: type, size: size, label: `+${hiddenChips.length}`, dropdownItems: hiddenChips, "data-test-id": `${dataTestId}__dropdown-chip` })), onCloseClick && onCloseChipLabel && ((0, jsx_runtime_1.jsx)(CloseChip_1.CloseChip, { size: size, layoutType: layoutType, content: onCloseChipLabel, onClick: onCloseClick, isVisible: isCloseIconVisible, "data-test-id": `${dataTestId}__close-chip` }))] }));
|
|
74
75
|
}
|
package/dist/cjs/components/RecommendPannel/helperComponents/AiAssistantChip/AiAssistantChip.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MouseEventHandler } from 'react';
|
|
2
|
+
import { LayoutType } from '@cloud-ru/uikit-product-utils';
|
|
3
|
+
import { Size } from '../../types';
|
|
4
|
+
type AiAssistantChipProps = {
|
|
5
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
6
|
+
size: Size;
|
|
7
|
+
layoutType?: LayoutType;
|
|
8
|
+
docsUrl?: string;
|
|
9
|
+
dataTestId?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const AiAssistantChip: import("react").ForwardRefExoticComponent<AiAssistantChipProps & import("react").RefAttributes<HTMLElement | HTMLButtonElement>>;
|
|
12
|
+
export {};
|
package/dist/cjs/components/RecommendPannel/helperComponents/AiAssistantChip/AiAssistantChip.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AiAssistantChip = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
|
|
7
|
+
const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
|
|
8
|
+
const link_1 = require("@snack-uikit/link");
|
|
9
|
+
const tooltip_1 = require("@snack-uikit/tooltip");
|
|
10
|
+
const typography_1 = require("@snack-uikit/typography");
|
|
11
|
+
const ButtonGiga_1 = require("../../../ButtonGiga");
|
|
12
|
+
const IconGiga_1 = require("../../../IconGiga");
|
|
13
|
+
const types_1 = require("../../types");
|
|
14
|
+
exports.AiAssistantChip = (0, react_1.forwardRef)(({ onClick, size, layoutType, docsUrl, dataTestId }, ref) => {
|
|
15
|
+
const isMobile = layoutType === uikit_product_utils_1.LAYOUT_TYPE.Mobile || size === types_1.SIZE.M;
|
|
16
|
+
const totalSize = isMobile ? types_1.SIZE.M : size;
|
|
17
|
+
const { t } = (0, uikit_product_locale_1.useLocale)('Claudia');
|
|
18
|
+
const tooltipContent = ((0, jsx_runtime_1.jsxs)("div", { children: [(0, jsx_runtime_1.jsx)(typography_1.Typography.SansLabelM, { tag: 'p', "data-test-id": `${dataTestId}__tooltip-title`, children: t('AiAssistantChip.tooltipTitle') }), (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyS, { tag: 'p', "data-test-id": `${dataTestId}__tooltip-description`, children: t('AiAssistantChip.tooltipDescription') }), (0, jsx_runtime_1.jsx)(link_1.Link, { text: t('AiAssistantChip.documentationLink'), appearance: 'invert-neutral', textMode: 'accent', target: '_blank', href: docsUrl, "data-test-id": `${dataTestId}__documentation-link` })] }));
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { triggerRef: ref, tip: tooltipContent, placement: 'top', "data-test-id": dataTestId, children: (0, jsx_runtime_1.jsx)(ButtonGiga_1.ButtonGigaOutline, { size: totalSize, "data-mobile": isMobile, onClick: onClick, icon: (0, jsx_runtime_1.jsx)(IconGiga_1.IconGiga, { size: 24 }) }) }));
|
|
20
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AiAssistantChip';
|
|
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./AiAssistantChip"), exports);
|
|
@@ -7,7 +7,7 @@ exports.Chip = void 0;
|
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const classnames_1 = __importDefault(require("classnames"));
|
|
9
9
|
const react_1 = require("react");
|
|
10
|
-
const uikit_product_utils_1 = require("@
|
|
10
|
+
const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
|
|
11
11
|
const truncate_string_1 = require("@snack-uikit/truncate-string");
|
|
12
12
|
const typography_1 = require("@snack-uikit/typography");
|
|
13
13
|
const types_1 = require("../../types");
|
|
@@ -6,9 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.CloseChip = CloseChip;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("react");
|
|
9
|
-
const uikit_product_icons_1 = require("@
|
|
10
|
-
const uikit_product_mobile_dropdown_1 = require("@
|
|
11
|
-
const uikit_product_utils_1 = require("@
|
|
9
|
+
const uikit_product_icons_1 = require("@cloud-ru/uikit-product-icons");
|
|
10
|
+
const uikit_product_mobile_dropdown_1 = require("@cloud-ru/uikit-product-mobile-dropdown");
|
|
11
|
+
const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
|
|
12
12
|
const dropdown_1 = require("@snack-uikit/dropdown");
|
|
13
13
|
const typography_1 = require("@snack-uikit/typography");
|
|
14
14
|
const hooks_1 = require("../../hooks");
|
|
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.DropdownChip = DropdownChip;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const react_1 = require("react");
|
|
9
|
-
const uikit_product_mobile_dropdown_1 = require("@
|
|
10
|
-
const uikit_product_utils_1 = require("@
|
|
9
|
+
const uikit_product_mobile_dropdown_1 = require("@cloud-ru/uikit-product-mobile-dropdown");
|
|
10
|
+
const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
|
|
11
11
|
const dropdown_1 = require("@snack-uikit/dropdown");
|
|
12
12
|
const truncate_string_1 = require("@snack-uikit/truncate-string");
|
|
13
13
|
const typography_1 = require("@snack-uikit/typography");
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { FieldTextAreaProps } from '@
|
|
2
|
-
import { WithLayoutType } from '@
|
|
1
|
+
import { FieldTextAreaProps } from '@cloud-ru/uikit-product-mobile-fields';
|
|
2
|
+
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
6
|
}>;
|
|
7
|
-
export declare const SshField: import("react").ForwardRefExoticComponent<Omit<FieldTextAreaProps, "label" | "size" | "placeholder" | "
|
|
7
|
+
export declare const SshField: import("react").ForwardRefExoticComponent<Omit<FieldTextAreaProps, "label" | "size" | "placeholder" | "footer" | "spellCheck" | "required" | "labelTooltip"> & {
|
|
8
8
|
/** Колбек действия при отправке */
|
|
9
9
|
onSubmit(value: string): void;
|
|
10
10
|
} & {
|
|
11
|
-
layoutType: import("@
|
|
11
|
+
layoutType: import("@cloud-ru/uikit-product-utils").LayoutType;
|
|
12
12
|
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -27,12 +27,12 @@ exports.SshField = void 0;
|
|
|
27
27
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
28
28
|
const classnames_1 = __importDefault(require("classnames"));
|
|
29
29
|
const react_1 = require("react");
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const uikit_product_mobile_fields_1 = require("@sbercloud/uikit-product-mobile-fields");
|
|
30
|
+
const uikit_product_icons_1 = require("@cloud-ru/uikit-product-icons");
|
|
31
|
+
const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
|
|
32
|
+
const uikit_product_mobile_fields_1 = require("@cloud-ru/uikit-product-mobile-fields");
|
|
34
33
|
const button_1 = require("@snack-uikit/button");
|
|
35
34
|
const drop_zone_1 = require("@snack-uikit/drop-zone");
|
|
35
|
+
const figma_tokens_1 = require("@snack-uikit/figma-tokens");
|
|
36
36
|
const tooltip_1 = require("@snack-uikit/tooltip");
|
|
37
37
|
const ChatStatusAnnouncement_1 = require("../ChatStatusAnnouncement");
|
|
38
38
|
const MobileFieldAi_1 = require("./components/MobileFieldAi");
|
|
@@ -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:
|
|
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' })] }) }) })))] }));
|
|
137
137
|
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FieldTextAreaProps } from '@
|
|
2
|
-
export declare const MobileFieldAi: import("react").ForwardRefExoticComponent<Omit<FieldTextAreaProps, "label" | "size" | "placeholder" | "
|
|
1
|
+
import { FieldTextAreaProps } from '@cloud-ru/uikit-product-mobile-fields';
|
|
2
|
+
export declare const MobileFieldAi: import("react").ForwardRefExoticComponent<Omit<FieldTextAreaProps, "label" | "size" | "placeholder" | "footer" | "spellCheck" | "required" | "labelTooltip"> & {
|
|
3
3
|
onSubmit(): void;
|
|
4
4
|
submitEnabled: boolean;
|
|
5
5
|
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -17,8 +17,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
exports.MobileFieldAi = void 0;
|
|
18
18
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
19
19
|
const react_1 = require("react");
|
|
20
|
-
const uikit_product_icons_1 = require("@
|
|
21
|
-
const uikit_product_locale_1 = require("@
|
|
20
|
+
const uikit_product_icons_1 = require("@cloud-ru/uikit-product-icons");
|
|
21
|
+
const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
|
|
22
22
|
const button_1 = require("@snack-uikit/button");
|
|
23
23
|
const drop_zone_1 = require("@snack-uikit/drop-zone");
|
|
24
24
|
const scroll_1 = require("@snack-uikit/scroll");
|
|
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.DropZoneContent = DropZoneContent;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
-
const uikit_product_locale_1 = require("@
|
|
8
|
+
const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
|
|
9
9
|
const typography_1 = require("@snack-uikit/typography");
|
|
10
10
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
11
11
|
function DropZoneContent() {
|
package/dist/cjs/components/SshField/helperComponents/FieldSubmitButton/FieldSubmitButton.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FieldSubmitButton = FieldSubmitButton;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const uikit_product_icons_1 = require("@
|
|
6
|
-
const uikit_product_locale_1 = require("@
|
|
5
|
+
const uikit_product_icons_1 = require("@cloud-ru/uikit-product-icons");
|
|
6
|
+
const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
|
|
7
7
|
const button_1 = require("@snack-uikit/button");
|
|
8
8
|
const tooltip_1 = require("@snack-uikit/tooltip");
|
|
9
9
|
function FieldSubmitButton({ active, handleClick, size = 'xs', className, fullWidth, showTooltip = true, disabled, }) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LayoutType } from '@
|
|
1
|
+
import { LayoutType } from '@cloud-ru/uikit-product-utils';
|
|
2
2
|
export declare function isTouchDevice(layoutType: LayoutType): boolean;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WithSupportProps } from '@
|
|
1
|
+
import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
|
|
2
2
|
import { CommonButtonProps } from './types';
|
|
3
3
|
export type ButtonClaudiaProps = WithSupportProps<Omit<CommonButtonProps, 'appearance' | 'iconPosition'>>;
|
|
4
4
|
export declare const ButtonClaudia: import("react").ForwardRefExoticComponent<{
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import cn from 'classnames';
|
|
14
14
|
import { forwardRef } from 'react';
|
|
15
|
-
import { extractSupportProps } from '@
|
|
15
|
+
import { extractSupportProps } from '@cloud-ru/uikit-product-utils';
|
|
16
16
|
import { HTML_TYPE, SIZE, TARGET } from './constants';
|
|
17
17
|
import { ButtonPrivate } from './helperComponents';
|
|
18
18
|
import styles from './styles.module.css';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WithSupportProps } from '@
|
|
1
|
+
import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
|
|
2
2
|
import { CommonButtonProps } from './types';
|
|
3
3
|
export type ButtonGigaFunctionProps = WithSupportProps<Omit<CommonButtonProps, 'appearance'>>;
|
|
4
4
|
export declare const ButtonGigaFunction: import("react").ForwardRefExoticComponent<{
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import cn from 'classnames';
|
|
14
14
|
import { forwardRef } from 'react';
|
|
15
|
-
import { extractSupportProps } from '@
|
|
15
|
+
import { extractSupportProps } from '@cloud-ru/uikit-product-utils';
|
|
16
16
|
import { HTML_TYPE, ICON_POSITION, SIZE, TARGET } from '../constants';
|
|
17
17
|
import { ButtonPrivate } from '../helperComponents';
|
|
18
18
|
import styles from './styles.module.css';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WithSupportProps } from '@
|
|
1
|
+
import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
|
|
2
2
|
import { CommonButtonProps } from '../helperComponents/ButtonPrivate/types';
|
|
3
3
|
export type ButtonGigaMamaProps = WithSupportProps<Omit<CommonButtonProps, 'appearance' | 'size' | 'iconPosition'>>;
|
|
4
4
|
export declare const ButtonGigaMama: import("react").ForwardRefExoticComponent<{
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import cn from 'classnames';
|
|
14
14
|
import { forwardRef } from 'react';
|
|
15
|
-
import { extractSupportProps } from '@
|
|
15
|
+
import { extractSupportProps } from '@cloud-ru/uikit-product-utils';
|
|
16
16
|
import { HTML_TYPE, TARGET } from '../constants';
|
|
17
17
|
import { ButtonPrivate } from '../helperComponents';
|
|
18
18
|
import styles from './styles.module.css';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { WithSupportProps } from '@
|
|
1
|
+
import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
|
|
2
2
|
import { CommonButtonProps } from './types';
|
|
3
3
|
export type ButtonGigaOutlineProps = WithSupportProps<Omit<CommonButtonProps, 'appearance'>>;
|
|
4
4
|
export declare const ButtonGigaOutline: import("react").ForwardRefExoticComponent<{
|
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
13
|
import cn from 'classnames';
|
|
14
14
|
import { forwardRef } from 'react';
|
|
15
|
-
import { extractSupportProps } from '@
|
|
15
|
+
import { extractSupportProps } from '@cloud-ru/uikit-product-utils';
|
|
16
16
|
import { HTML_TYPE, ICON_POSITION, SIZE, TARGET } from '../constants';
|
|
17
17
|
import { ButtonPrivate } from '../helperComponents';
|
|
18
18
|
import styles from './styles.module.css';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { useEffect, useRef, useState } from 'react';
|
|
4
|
-
import { PlaceholderSVG } from '@
|
|
5
|
-
import { LAYOUT_TYPE } from '@
|
|
4
|
+
import { PlaceholderSVG } from '@cloud-ru/uikit-product-icons';
|
|
5
|
+
import { LAYOUT_TYPE } from '@cloud-ru/uikit-product-utils';
|
|
6
6
|
import { ANIMATION_INTERVAL } from './constants';
|
|
7
7
|
import { AlertButton } from './helperComponents/AlertButton';
|
|
8
8
|
import { TextContent } from './helperComponents/TextContent';
|
package/dist/esm/components/ChatStatusAnnouncement/helperComponents/AlertButton/AlertButton.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { LAYOUT_TYPE } from '@
|
|
2
|
+
import { LAYOUT_TYPE } from '@cloud-ru/uikit-product-utils';
|
|
3
3
|
import { Typography } from '@snack-uikit/typography';
|
|
4
4
|
import styles from './styles.module.css';
|
|
5
5
|
export function AlertButton({ text, onClick, layoutType }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { LayoutType } from '@
|
|
2
|
+
import { LayoutType } from '@cloud-ru/uikit-product-utils';
|
|
3
3
|
import { ChipProps, ChipType, Size } from './types';
|
|
4
4
|
export type RecommendPanelProps = {
|
|
5
5
|
chips: ChipProps[];
|
|
@@ -8,7 +8,8 @@ export type RecommendPanelProps = {
|
|
|
8
8
|
layoutType?: LayoutType;
|
|
9
9
|
onCloseClick?: () => void;
|
|
10
10
|
onCloseChipLabel?: ReactNode;
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
onAiAssistantClick?: () => void;
|
|
12
|
+
docsUrl?: string;
|
|
13
|
+
dataTestId?: string;
|
|
13
14
|
};
|
|
14
|
-
export declare function RecommendPanel({ chips, type, size, layoutType, onCloseClick, onCloseChipLabel,
|
|
15
|
+
export declare function RecommendPanel({ chips, type, size, layoutType, onCloseClick, onCloseChipLabel, onAiAssistantClick, docsUrl, dataTestId, }: RecommendPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useRef, useState } from 'react';
|
|
3
|
-
import { LAYOUT_TYPE } from '@
|
|
3
|
+
import { LAYOUT_TYPE } from '@cloud-ru/uikit-product-utils';
|
|
4
|
+
import { AiAssistantChip } from './helperComponents/AiAssistantChip';
|
|
4
5
|
import { Chip } from './helperComponents/Chip';
|
|
5
|
-
import { ClaudiaChip } from './helperComponents/ClaudiaChip';
|
|
6
6
|
import { CloseChip } from './helperComponents/CloseChip';
|
|
7
7
|
import { DropdownChip } from './helperComponents/DropdownChip';
|
|
8
8
|
import styles from './styles.module.css';
|
|
9
9
|
import { CHIP_TYPE, SIZE } from './types';
|
|
10
10
|
import { getVisibleChipsCount } from './utils/gitVisibleChipsCount';
|
|
11
|
-
|
|
11
|
+
const AI_ASSISTANT_DOCUMENTATION_URL = 'https://cloud.ru/docs/ai_assistant_cloudia/ug/index';
|
|
12
|
+
export function RecommendPanel({ chips, type = CHIP_TYPE.Default, size = SIZE.S, layoutType, onCloseClick, onCloseChipLabel, onAiAssistantClick, docsUrl = AI_ASSISTANT_DOCUMENTATION_URL, dataTestId = 'recommend-panel', }) {
|
|
12
13
|
const [containerWidth, setContainerWidth] = useState(0);
|
|
13
14
|
const [isCloseIconVisible, setCloseIconVisible] = useState(false);
|
|
14
15
|
const [chipWidths, setChipWidths] = useState([]);
|
|
@@ -64,5 +65,5 @@ export function RecommendPanel({ chips, type = CHIP_TYPE.Default, size = SIZE.S,
|
|
|
64
65
|
return;
|
|
65
66
|
setCloseIconVisible(false);
|
|
66
67
|
};
|
|
67
|
-
return (_jsxs("div", { className: styles.container, ref: containerRef, onMouseEnter: showCloseIcon, onMouseLeave: hideCloseIcon, children: [_jsx(
|
|
68
|
+
return (_jsxs("div", { className: styles.container, ref: containerRef, onMouseEnter: showCloseIcon, onMouseLeave: hideCloseIcon, "data-test-id": dataTestId, children: [_jsx(AiAssistantChip, { layoutType: layoutType, onClick: onAiAssistantClick, size: size, "data-test-id": `${dataTestId}__ai-assistant-chip`, docsUrl: docsUrl }), visibleChips.map((chip, index) => (_jsx(Chip, { ref: chipElement => (allChipsRefs.current[index] = chipElement), label: chip.label, size: size, type: type, layoutType: layoutType, onClick: chip.onClick, "data-test-id": `${dataTestId}__chip-${chip.id}` }, chip.id))), hasHiddenChips && (_jsx(DropdownChip, { layoutType: layoutType, type: type, size: size, label: `+${hiddenChips.length}`, dropdownItems: hiddenChips, "data-test-id": `${dataTestId}__dropdown-chip` })), onCloseClick && onCloseChipLabel && (_jsx(CloseChip, { size: size, layoutType: layoutType, content: onCloseChipLabel, onClick: onCloseClick, isVisible: isCloseIconVisible, "data-test-id": `${dataTestId}__close-chip` }))] }));
|
|
68
69
|
}
|
package/dist/esm/components/RecommendPannel/helperComponents/AiAssistantChip/AiAssistantChip.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { MouseEventHandler } from 'react';
|
|
2
|
+
import { LayoutType } from '@cloud-ru/uikit-product-utils';
|
|
3
|
+
import { Size } from '../../types';
|
|
4
|
+
type AiAssistantChipProps = {
|
|
5
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
6
|
+
size: Size;
|
|
7
|
+
layoutType?: LayoutType;
|
|
8
|
+
docsUrl?: string;
|
|
9
|
+
dataTestId?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare const AiAssistantChip: import("react").ForwardRefExoticComponent<AiAssistantChipProps & import("react").RefAttributes<HTMLElement | HTMLButtonElement>>;
|
|
12
|
+
export {};
|
package/dist/esm/components/RecommendPannel/helperComponents/AiAssistantChip/AiAssistantChip.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from 'react';
|
|
3
|
+
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
4
|
+
import { LAYOUT_TYPE } from '@cloud-ru/uikit-product-utils';
|
|
5
|
+
import { Link } from '@snack-uikit/link';
|
|
6
|
+
import { Tooltip } from '@snack-uikit/tooltip';
|
|
7
|
+
import { Typography } from '@snack-uikit/typography';
|
|
8
|
+
import { ButtonGigaOutline } from '../../../ButtonGiga';
|
|
9
|
+
import { IconGiga } from '../../../IconGiga';
|
|
10
|
+
import { SIZE } from '../../types';
|
|
11
|
+
export const AiAssistantChip = forwardRef(({ onClick, size, layoutType, docsUrl, dataTestId }, ref) => {
|
|
12
|
+
const isMobile = layoutType === LAYOUT_TYPE.Mobile || size === SIZE.M;
|
|
13
|
+
const totalSize = isMobile ? SIZE.M : size;
|
|
14
|
+
const { t } = useLocale('Claudia');
|
|
15
|
+
const tooltipContent = (_jsxs("div", { children: [_jsx(Typography.SansLabelM, { tag: 'p', "data-test-id": `${dataTestId}__tooltip-title`, children: t('AiAssistantChip.tooltipTitle') }), _jsx(Typography.SansBodyS, { tag: 'p', "data-test-id": `${dataTestId}__tooltip-description`, children: t('AiAssistantChip.tooltipDescription') }), _jsx(Link, { text: t('AiAssistantChip.documentationLink'), appearance: 'invert-neutral', textMode: 'accent', target: '_blank', href: docsUrl, "data-test-id": `${dataTestId}__documentation-link` })] }));
|
|
16
|
+
return (_jsx(Tooltip, { triggerRef: ref, tip: tooltipContent, placement: 'top', "data-test-id": dataTestId, children: _jsx(ButtonGigaOutline, { size: totalSize, "data-mobile": isMobile, onClick: onClick, icon: _jsx(IconGiga, { size: 24 }) }) }));
|
|
17
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AiAssistantChip';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AiAssistantChip';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import cn from 'classnames';
|
|
3
3
|
import { forwardRef } from 'react';
|
|
4
|
-
import { LAYOUT_TYPE } from '@
|
|
4
|
+
import { LAYOUT_TYPE } from '@cloud-ru/uikit-product-utils';
|
|
5
5
|
import { TruncateString } from '@snack-uikit/truncate-string';
|
|
6
6
|
import { Typography } from '@snack-uikit/typography';
|
|
7
7
|
import { CHIP_TYPE, SIZE } from '../../types';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, useState } from 'react';
|
|
3
|
-
import { MoreInterfaceSVG } from '@
|
|
4
|
-
import { MobileDropdown } from '@
|
|
5
|
-
import { LAYOUT_TYPE } from '@
|
|
3
|
+
import { MoreInterfaceSVG } from '@cloud-ru/uikit-product-icons';
|
|
4
|
+
import { MobileDropdown } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
5
|
+
import { LAYOUT_TYPE } from '@cloud-ru/uikit-product-utils';
|
|
6
6
|
import { Dropdown } from '@snack-uikit/dropdown';
|
|
7
7
|
import { Typography } from '@snack-uikit/typography';
|
|
8
8
|
import { useOutsideClick } from '../../hooks';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useRef, useState } from 'react';
|
|
3
|
-
import { MobileDropdown } from '@
|
|
4
|
-
import { LAYOUT_TYPE } from '@
|
|
3
|
+
import { MobileDropdown } from '@cloud-ru/uikit-product-mobile-dropdown';
|
|
4
|
+
import { LAYOUT_TYPE } from '@cloud-ru/uikit-product-utils';
|
|
5
5
|
import { Dropdown } from '@snack-uikit/dropdown';
|
|
6
6
|
import { TruncateString } from '@snack-uikit/truncate-string';
|
|
7
7
|
import { Typography } from '@snack-uikit/typography';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { FieldTextAreaProps } from '@
|
|
2
|
-
import { WithLayoutType } from '@
|
|
1
|
+
import { FieldTextAreaProps } from '@cloud-ru/uikit-product-mobile-fields';
|
|
2
|
+
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
6
|
}>;
|
|
7
|
-
export declare const SshField: import("react").ForwardRefExoticComponent<Omit<FieldTextAreaProps, "label" | "size" | "placeholder" | "
|
|
7
|
+
export declare const SshField: import("react").ForwardRefExoticComponent<Omit<FieldTextAreaProps, "label" | "size" | "placeholder" | "footer" | "spellCheck" | "required" | "labelTooltip"> & {
|
|
8
8
|
/** Колбек действия при отправке */
|
|
9
9
|
onSubmit(value: string): void;
|
|
10
10
|
} & {
|
|
11
|
-
layoutType: import("@
|
|
11
|
+
layoutType: import("@cloud-ru/uikit-product-utils").LayoutType;
|
|
12
12
|
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -21,12 +21,12 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
22
|
import cn from 'classnames';
|
|
23
23
|
import { forwardRef, useState } from 'react';
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import { AdaptiveFieldTextArea, getAdaptiveFieldProps, } from '@sbercloud/uikit-product-mobile-fields';
|
|
24
|
+
import { AttachmentSVG, EyeClosedSVG, EyeSVG, PasswordLockSVG } from '@cloud-ru/uikit-product-icons';
|
|
25
|
+
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
26
|
+
import { AdaptiveFieldTextArea, getAdaptiveFieldProps, } from '@cloud-ru/uikit-product-mobile-fields';
|
|
28
27
|
import { ButtonFunction } from '@snack-uikit/button';
|
|
29
28
|
import { DropZone, FileUpload } from '@snack-uikit/drop-zone';
|
|
29
|
+
import { themeVars } from '@snack-uikit/figma-tokens';
|
|
30
30
|
import { Tooltip } from '@snack-uikit/tooltip';
|
|
31
31
|
import { ChatStatusAnnouncement } from '../ChatStatusAnnouncement';
|
|
32
32
|
import { MobileFieldAi } from './components/MobileFieldAi';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FieldTextAreaProps } from '@
|
|
2
|
-
export declare const MobileFieldAi: import("react").ForwardRefExoticComponent<Omit<FieldTextAreaProps, "label" | "size" | "placeholder" | "
|
|
1
|
+
import { FieldTextAreaProps } from '@cloud-ru/uikit-product-mobile-fields';
|
|
2
|
+
export declare const MobileFieldAi: import("react").ForwardRefExoticComponent<Omit<FieldTextAreaProps, "label" | "size" | "placeholder" | "footer" | "spellCheck" | "required" | "labelTooltip"> & {
|
|
3
3
|
onSubmit(): void;
|
|
4
4
|
submitEnabled: boolean;
|
|
5
5
|
} & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -11,8 +11,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
11
11
|
};
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import { forwardRef } from 'react';
|
|
14
|
-
import { AttachmentSVG } from '@
|
|
15
|
-
import { useLocale } from '@
|
|
14
|
+
import { AttachmentSVG } from '@cloud-ru/uikit-product-icons';
|
|
15
|
+
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
16
16
|
import { ButtonFunction } from '@snack-uikit/button';
|
|
17
17
|
import { FileUpload } from '@snack-uikit/drop-zone';
|
|
18
18
|
import { Scroll } from '@snack-uikit/scroll';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useLocale } from '@
|
|
2
|
+
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
3
3
|
import { Typography } from '@snack-uikit/typography';
|
|
4
4
|
import styles from './styles.module.css';
|
|
5
5
|
export function DropZoneContent() {
|
package/dist/esm/components/SshField/helperComponents/FieldSubmitButton/FieldSubmitButton.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { ArrowUpSVG } from '@
|
|
3
|
-
import { useLocale } from '@
|
|
2
|
+
import { ArrowUpSVG } from '@cloud-ru/uikit-product-icons';
|
|
3
|
+
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
4
4
|
import { ButtonFilled } from '@snack-uikit/button';
|
|
5
5
|
import { Tooltip } from '@snack-uikit/tooltip';
|
|
6
6
|
export function FieldSubmitButton({ active, handleClick, size = 'xs', className, fullWidth, showTooltip = true, disabled, }) {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { LayoutType } from '@
|
|
1
|
+
import { LayoutType } from '@cloud-ru/uikit-product-utils';
|
|
2
2
|
export declare function isTouchDevice(layoutType: LayoutType): boolean;
|
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.
|
|
4
|
+
"version": "1.7.0",
|
|
5
5
|
"sideEffects": [
|
|
6
6
|
"*.css",
|
|
7
7
|
"*.woff",
|
|
@@ -30,21 +30,21 @@
|
|
|
30
30
|
"name": "Akhremenko Grigorii",
|
|
31
31
|
"url": "https://github.com/AGrigorii"
|
|
32
32
|
},
|
|
33
|
-
"contributors": [],
|
|
34
33
|
"license": "Apache-2.0",
|
|
35
34
|
"publishConfig": {
|
|
36
35
|
"access": "public"
|
|
37
36
|
},
|
|
38
37
|
"scripts": {},
|
|
39
38
|
"dependencies": {
|
|
40
|
-
"@cloud-ru/uikit-product-icons": "15.1.
|
|
41
|
-
"@cloud-ru/uikit-product-mobile-dropdown": "0.9.
|
|
42
|
-
"@cloud-ru/uikit-product-mobile-fields": "0.11.
|
|
43
|
-
"@cloud-ru/uikit-product-utils": "7.0.
|
|
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",
|
|
44
43
|
"@snack-uikit/button": "0.19.16",
|
|
45
44
|
"@snack-uikit/drop-zone": "0.9.6",
|
|
46
45
|
"@snack-uikit/dropdown": "0.5.3",
|
|
47
46
|
"@snack-uikit/input-private": "4.8.3",
|
|
47
|
+
"@snack-uikit/link": "0.17.12",
|
|
48
48
|
"@snack-uikit/loaders": "0.9.9",
|
|
49
49
|
"@snack-uikit/scroll": "0.10.5",
|
|
50
50
|
"@snack-uikit/tooltip": "0.18.5",
|
|
@@ -55,7 +55,8 @@
|
|
|
55
55
|
"react-textarea-autosize": "8.5.9"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@cloud-ru/uikit-product-locale": "*"
|
|
58
|
+
"@cloud-ru/uikit-product-locale": "*",
|
|
59
|
+
"@snack-uikit/figma-tokens": "*"
|
|
59
60
|
},
|
|
60
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "871be56e967b2421b96a5a0135b509d6ff29b7b7"
|
|
61
62
|
}
|
|
@@ -2,8 +2,8 @@ import { ReactNode, useEffect, useRef, useState } from 'react';
|
|
|
2
2
|
|
|
3
3
|
import { LAYOUT_TYPE, LayoutType } from '@cloud-ru/uikit-product-utils';
|
|
4
4
|
|
|
5
|
+
import { AiAssistantChip } from './helperComponents/AiAssistantChip';
|
|
5
6
|
import { Chip } from './helperComponents/Chip';
|
|
6
|
-
import { ClaudiaChip } from './helperComponents/ClaudiaChip';
|
|
7
7
|
import { CloseChip } from './helperComponents/CloseChip';
|
|
8
8
|
import { DropdownChip } from './helperComponents/DropdownChip';
|
|
9
9
|
import styles from './styles.module.scss';
|
|
@@ -17,10 +17,13 @@ export type RecommendPanelProps = {
|
|
|
17
17
|
layoutType?: LayoutType;
|
|
18
18
|
onCloseClick?: () => void;
|
|
19
19
|
onCloseChipLabel?: ReactNode;
|
|
20
|
-
|
|
21
|
-
|
|
20
|
+
onAiAssistantClick?: () => void;
|
|
21
|
+
docsUrl?: string;
|
|
22
|
+
dataTestId?: string;
|
|
22
23
|
};
|
|
23
24
|
|
|
25
|
+
const AI_ASSISTANT_DOCUMENTATION_URL = 'https://cloud.ru/docs/ai_assistant_cloudia/ug/index';
|
|
26
|
+
|
|
24
27
|
export function RecommendPanel({
|
|
25
28
|
chips,
|
|
26
29
|
type = CHIP_TYPE.Default,
|
|
@@ -28,8 +31,9 @@ export function RecommendPanel({
|
|
|
28
31
|
layoutType,
|
|
29
32
|
onCloseClick,
|
|
30
33
|
onCloseChipLabel,
|
|
31
|
-
|
|
32
|
-
|
|
34
|
+
onAiAssistantClick,
|
|
35
|
+
docsUrl = AI_ASSISTANT_DOCUMENTATION_URL,
|
|
36
|
+
dataTestId = 'recommend-panel',
|
|
33
37
|
}: RecommendPanelProps) {
|
|
34
38
|
const [containerWidth, setContainerWidth] = useState(0);
|
|
35
39
|
const [isCloseIconVisible, setCloseIconVisible] = useState(false);
|
|
@@ -95,8 +99,20 @@ export function RecommendPanel({
|
|
|
95
99
|
};
|
|
96
100
|
|
|
97
101
|
return (
|
|
98
|
-
<div
|
|
99
|
-
|
|
102
|
+
<div
|
|
103
|
+
className={styles.container}
|
|
104
|
+
ref={containerRef}
|
|
105
|
+
onMouseEnter={showCloseIcon}
|
|
106
|
+
onMouseLeave={hideCloseIcon}
|
|
107
|
+
data-test-id={dataTestId}
|
|
108
|
+
>
|
|
109
|
+
<AiAssistantChip
|
|
110
|
+
layoutType={layoutType}
|
|
111
|
+
onClick={onAiAssistantClick}
|
|
112
|
+
size={size}
|
|
113
|
+
data-test-id={`${dataTestId}__ai-assistant-chip`}
|
|
114
|
+
docsUrl={docsUrl}
|
|
115
|
+
/>
|
|
100
116
|
{visibleChips.map((chip, index) => (
|
|
101
117
|
<Chip
|
|
102
118
|
ref={chipElement => (allChipsRefs.current[index] = chipElement)}
|
|
@@ -106,6 +122,7 @@ export function RecommendPanel({
|
|
|
106
122
|
type={type}
|
|
107
123
|
layoutType={layoutType}
|
|
108
124
|
onClick={chip.onClick}
|
|
125
|
+
data-test-id={`${dataTestId}__chip-${chip.id}`}
|
|
109
126
|
/>
|
|
110
127
|
))}
|
|
111
128
|
{hasHiddenChips && (
|
|
@@ -115,6 +132,7 @@ export function RecommendPanel({
|
|
|
115
132
|
size={size}
|
|
116
133
|
label={`+${hiddenChips.length}`}
|
|
117
134
|
dropdownItems={hiddenChips}
|
|
135
|
+
data-test-id={`${dataTestId}__dropdown-chip`}
|
|
118
136
|
/>
|
|
119
137
|
)}
|
|
120
138
|
{onCloseClick && onCloseChipLabel && (
|
|
@@ -124,6 +142,7 @@ export function RecommendPanel({
|
|
|
124
142
|
content={onCloseChipLabel}
|
|
125
143
|
onClick={onCloseClick}
|
|
126
144
|
isVisible={isCloseIconVisible}
|
|
145
|
+
data-test-id={`${dataTestId}__close-chip`}
|
|
127
146
|
/>
|
|
128
147
|
)}
|
|
129
148
|
</div>
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { forwardRef, MouseEventHandler, RefObject } from 'react';
|
|
2
|
+
|
|
3
|
+
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
4
|
+
import { LAYOUT_TYPE, LayoutType } from '@cloud-ru/uikit-product-utils';
|
|
5
|
+
import { Link } from '@snack-uikit/link';
|
|
6
|
+
import { Tooltip } from '@snack-uikit/tooltip';
|
|
7
|
+
import { Typography } from '@snack-uikit/typography';
|
|
8
|
+
|
|
9
|
+
import { ButtonGigaOutline } from '../../../ButtonGiga';
|
|
10
|
+
import { IconGiga } from '../../../IconGiga';
|
|
11
|
+
import { SIZE, Size } from '../../types';
|
|
12
|
+
|
|
13
|
+
type AiAssistantChipProps = {
|
|
14
|
+
onClick?: MouseEventHandler<HTMLElement>;
|
|
15
|
+
size: Size;
|
|
16
|
+
layoutType?: LayoutType;
|
|
17
|
+
docsUrl?: string;
|
|
18
|
+
dataTestId?: string;
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export const AiAssistantChip = forwardRef<HTMLElement | HTMLButtonElement, AiAssistantChipProps>(
|
|
22
|
+
({ onClick, size, layoutType, docsUrl, dataTestId }, ref) => {
|
|
23
|
+
const isMobile = layoutType === LAYOUT_TYPE.Mobile || size === SIZE.M;
|
|
24
|
+
const totalSize = isMobile ? SIZE.M : size;
|
|
25
|
+
|
|
26
|
+
const { t } = useLocale('Claudia');
|
|
27
|
+
|
|
28
|
+
const tooltipContent = (
|
|
29
|
+
<div>
|
|
30
|
+
<Typography.SansLabelM tag='p' data-test-id={`${dataTestId}__tooltip-title`}>
|
|
31
|
+
{t('AiAssistantChip.tooltipTitle')}
|
|
32
|
+
</Typography.SansLabelM>
|
|
33
|
+
<Typography.SansBodyS tag='p' data-test-id={`${dataTestId}__tooltip-description`}>
|
|
34
|
+
{t('AiAssistantChip.tooltipDescription')}
|
|
35
|
+
</Typography.SansBodyS>
|
|
36
|
+
<Link
|
|
37
|
+
text={t('AiAssistantChip.documentationLink')}
|
|
38
|
+
appearance='invert-neutral'
|
|
39
|
+
textMode='accent'
|
|
40
|
+
target='_blank'
|
|
41
|
+
href={docsUrl}
|
|
42
|
+
data-test-id={`${dataTestId}__documentation-link`}
|
|
43
|
+
></Link>
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
return (
|
|
48
|
+
<Tooltip
|
|
49
|
+
triggerRef={ref as RefObject<HTMLElement>}
|
|
50
|
+
tip={tooltipContent}
|
|
51
|
+
placement='top'
|
|
52
|
+
data-test-id={dataTestId}
|
|
53
|
+
>
|
|
54
|
+
<ButtonGigaOutline size={totalSize} data-mobile={isMobile} onClick={onClick} icon={<IconGiga size={24} />} />
|
|
55
|
+
</Tooltip>
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AiAssistantChip';
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import cn from 'classnames';
|
|
2
2
|
import { DragEvent, forwardRef, KeyboardEventHandler, useState } from 'react';
|
|
3
3
|
|
|
4
|
-
import { themeVars } from '@sbercloud/figma-tokens-cloud-platform';
|
|
5
4
|
import { AttachmentSVG, EyeClosedSVG, EyeSVG, PasswordLockSVG } from '@cloud-ru/uikit-product-icons';
|
|
6
5
|
import { useLocale } from '@cloud-ru/uikit-product-locale';
|
|
7
6
|
import {
|
|
@@ -12,6 +11,7 @@ import {
|
|
|
12
11
|
import { WithLayoutType } from '@cloud-ru/uikit-product-utils';
|
|
13
12
|
import { ButtonFunction } from '@snack-uikit/button';
|
|
14
13
|
import { DropZone, FileUpload } from '@snack-uikit/drop-zone';
|
|
14
|
+
import { themeVars } from '@snack-uikit/figma-tokens';
|
|
15
15
|
import { Tooltip } from '@snack-uikit/tooltip';
|
|
16
16
|
|
|
17
17
|
import { ChatStatusAnnouncement } from '../ChatStatusAnnouncement';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { MouseEventHandler, ReactNode } from 'react';
|
|
2
|
-
import { LayoutType } from '@sbercloud/uikit-product-utils';
|
|
3
|
-
import { Size } from '../../types';
|
|
4
|
-
type ClaudiaChipProps = {
|
|
5
|
-
onClick?: MouseEventHandler<HTMLElement>;
|
|
6
|
-
size: Size;
|
|
7
|
-
tooltip?: ReactNode;
|
|
8
|
-
layoutType?: LayoutType;
|
|
9
|
-
};
|
|
10
|
-
export declare const ClaudiaChip: import("react").ForwardRefExoticComponent<ClaudiaChipProps & import("react").RefAttributes<HTMLElement | HTMLButtonElement>>;
|
|
11
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ClaudiaChip = void 0;
|
|
4
|
-
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
const uikit_product_icons_1 = require("@sbercloud/uikit-product-icons");
|
|
7
|
-
const uikit_product_utils_1 = require("@sbercloud/uikit-product-utils");
|
|
8
|
-
const tooltip_1 = require("@snack-uikit/tooltip");
|
|
9
|
-
const ButtonClaudia_1 = require("../../../ButtonClaudia");
|
|
10
|
-
const types_1 = require("../../types");
|
|
11
|
-
exports.ClaudiaChip = (0, react_1.forwardRef)(({ onClick, size, tooltip, layoutType }, ref) => {
|
|
12
|
-
const isMobile = layoutType === uikit_product_utils_1.LAYOUT_TYPE.Mobile || size === types_1.SIZE.M;
|
|
13
|
-
const totalSize = isMobile ? types_1.SIZE.M : size;
|
|
14
|
-
if (!tooltip) {
|
|
15
|
-
return ((0, jsx_runtime_1.jsx)(ButtonClaudia_1.ButtonClaudia, { size: totalSize, "data-mobile": isMobile, ref: ref, onClick: onClick, icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.AgentClaudiaSVG, { size: 24 }) }));
|
|
16
|
-
}
|
|
17
|
-
return ((0, jsx_runtime_1.jsx)(tooltip_1.Tooltip, { triggerRef: ref, tip: tooltip, children: (0, jsx_runtime_1.jsx)(ButtonClaudia_1.ButtonClaudia, { size: totalSize, "data-mobile": isMobile, onClick: onClick, icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.AgentClaudiaSVG, { size: 24 }) }) }));
|
|
18
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ClaudiaChip';
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { MouseEventHandler, ReactNode } from 'react';
|
|
2
|
-
import { LayoutType } from '@sbercloud/uikit-product-utils';
|
|
3
|
-
import { Size } from '../../types';
|
|
4
|
-
type ClaudiaChipProps = {
|
|
5
|
-
onClick?: MouseEventHandler<HTMLElement>;
|
|
6
|
-
size: Size;
|
|
7
|
-
tooltip?: ReactNode;
|
|
8
|
-
layoutType?: LayoutType;
|
|
9
|
-
};
|
|
10
|
-
export declare const ClaudiaChip: import("react").ForwardRefExoticComponent<ClaudiaChipProps & import("react").RefAttributes<HTMLElement | HTMLButtonElement>>;
|
|
11
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef } from 'react';
|
|
3
|
-
import { AgentClaudiaSVG } from '@sbercloud/uikit-product-icons';
|
|
4
|
-
import { LAYOUT_TYPE } from '@sbercloud/uikit-product-utils';
|
|
5
|
-
import { Tooltip } from '@snack-uikit/tooltip';
|
|
6
|
-
import { ButtonClaudia } from '../../../ButtonClaudia';
|
|
7
|
-
import { SIZE } from '../../types';
|
|
8
|
-
export const ClaudiaChip = forwardRef(({ onClick, size, tooltip, layoutType }, ref) => {
|
|
9
|
-
const isMobile = layoutType === LAYOUT_TYPE.Mobile || size === SIZE.M;
|
|
10
|
-
const totalSize = isMobile ? SIZE.M : size;
|
|
11
|
-
if (!tooltip) {
|
|
12
|
-
return (_jsx(ButtonClaudia, { size: totalSize, "data-mobile": isMobile, ref: ref, onClick: onClick, icon: _jsx(AgentClaudiaSVG, { size: 24 }) }));
|
|
13
|
-
}
|
|
14
|
-
return (_jsx(Tooltip, { triggerRef: ref, tip: tooltip, children: _jsx(ButtonClaudia, { size: totalSize, "data-mobile": isMobile, onClick: onClick, icon: _jsx(AgentClaudiaSVG, { size: 24 }) }) }));
|
|
15
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ClaudiaChip';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ClaudiaChip';
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { forwardRef, MouseEventHandler, ReactNode, RefObject } from 'react';
|
|
2
|
-
|
|
3
|
-
import { AgentClaudiaSVG } from '@cloud-ru/uikit-product-icons';
|
|
4
|
-
import { LAYOUT_TYPE, LayoutType } from '@cloud-ru/uikit-product-utils';
|
|
5
|
-
import { Tooltip } from '@snack-uikit/tooltip';
|
|
6
|
-
|
|
7
|
-
import { ButtonClaudia } from '../../../ButtonClaudia';
|
|
8
|
-
import { SIZE, Size } from '../../types';
|
|
9
|
-
|
|
10
|
-
type ClaudiaChipProps = {
|
|
11
|
-
onClick?: MouseEventHandler<HTMLElement>;
|
|
12
|
-
size: Size;
|
|
13
|
-
tooltip?: ReactNode;
|
|
14
|
-
layoutType?: LayoutType;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
export const ClaudiaChip = forwardRef<HTMLElement | HTMLButtonElement, ClaudiaChipProps>(
|
|
18
|
-
({ onClick, size, tooltip, layoutType }, ref) => {
|
|
19
|
-
const isMobile = layoutType === LAYOUT_TYPE.Mobile || size === SIZE.M;
|
|
20
|
-
const totalSize = isMobile ? SIZE.M : size;
|
|
21
|
-
|
|
22
|
-
if (!tooltip) {
|
|
23
|
-
return (
|
|
24
|
-
<ButtonClaudia
|
|
25
|
-
size={totalSize}
|
|
26
|
-
data-mobile={isMobile}
|
|
27
|
-
ref={ref as RefObject<HTMLButtonElement>}
|
|
28
|
-
onClick={onClick}
|
|
29
|
-
icon={<AgentClaudiaSVG size={24} />}
|
|
30
|
-
/>
|
|
31
|
-
);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
return (
|
|
35
|
-
<Tooltip triggerRef={ref as RefObject<HTMLElement>} tip={tooltip}>
|
|
36
|
-
<ButtonClaudia size={totalSize} data-mobile={isMobile} onClick={onClick} icon={<AgentClaudiaSVG size={24} />} />
|
|
37
|
-
</Tooltip>
|
|
38
|
-
);
|
|
39
|
-
},
|
|
40
|
-
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './ClaudiaChip';
|