@cloud-ru/uikit-product-site-csat 0.1.15 → 0.1.17

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 (68) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/components/SiteCsat/SiteCsat.d.ts +17 -0
  3. package/dist/cjs/components/SiteCsat/SiteCsat.js +15 -0
  4. package/dist/cjs/components/SiteCsat/index.d.ts +1 -0
  5. package/dist/cjs/components/SiteCsat/index.js +17 -0
  6. package/dist/cjs/components/SiteCsat/styles.module.css +41 -0
  7. package/dist/cjs/components/SiteCsatPopover/SiteCsatPopover.d.ts +20 -0
  8. package/dist/cjs/components/SiteCsatPopover/SiteCsatPopover.js +27 -0
  9. package/dist/cjs/components/SiteCsatPopover/index.d.ts +1 -0
  10. package/dist/cjs/components/SiteCsatPopover/index.js +17 -0
  11. package/dist/cjs/components/SiteCsatPopover/styles.module.css +23 -0
  12. package/dist/cjs/components/index.d.ts +2 -0
  13. package/dist/cjs/components/index.js +18 -0
  14. package/dist/cjs/helperComponents/ContentDislikeCsat/ContentDislikeCsat.d.ts +18 -0
  15. package/dist/cjs/helperComponents/ContentDislikeCsat/ContentDislikeCsat.js +45 -0
  16. package/dist/cjs/helperComponents/ContentDislikeCsat/index.d.ts +1 -0
  17. package/dist/cjs/helperComponents/ContentDislikeCsat/index.js +17 -0
  18. package/dist/cjs/helperComponents/ContentDislikeCsat/styles.module.css +31 -0
  19. package/dist/cjs/helperComponents/LikeDislikeBlock/LikeDislikeBlock.d.ts +11 -0
  20. package/dist/cjs/helperComponents/LikeDislikeBlock/LikeDislikeBlock.js +20 -0
  21. package/dist/cjs/helperComponents/LikeDislikeBlock/index.d.ts +1 -0
  22. package/dist/cjs/helperComponents/LikeDislikeBlock/index.js +17 -0
  23. package/dist/cjs/helperComponents/LikeDislikeBlock/styles.module.css +17 -0
  24. package/dist/cjs/helperComponents/PopoverReport/PopoverReportContent.d.ts +10 -0
  25. package/dist/cjs/helperComponents/PopoverReport/PopoverReportContent.js +17 -0
  26. package/dist/cjs/helperComponents/PopoverReport/index.d.ts +1 -0
  27. package/dist/cjs/helperComponents/PopoverReport/index.js +17 -0
  28. package/dist/cjs/helperComponents/PopoverReport/styles.module.css +31 -0
  29. package/dist/cjs/helperComponents/index.d.ts +3 -0
  30. package/dist/cjs/helperComponents/index.js +19 -0
  31. package/dist/cjs/index.d.ts +1 -0
  32. package/dist/cjs/index.js +17 -0
  33. package/dist/cjs/types.d.ts +4 -0
  34. package/dist/cjs/types.js +2 -0
  35. package/dist/esm/components/SiteCsat/SiteCsat.d.ts +17 -0
  36. package/dist/esm/components/SiteCsat/SiteCsat.js +9 -0
  37. package/dist/esm/components/SiteCsat/index.d.ts +1 -0
  38. package/dist/esm/components/SiteCsat/index.js +1 -0
  39. package/dist/esm/components/SiteCsat/styles.module.css +41 -0
  40. package/dist/esm/components/SiteCsatPopover/SiteCsatPopover.d.ts +20 -0
  41. package/dist/esm/components/SiteCsatPopover/SiteCsatPopover.js +21 -0
  42. package/dist/esm/components/SiteCsatPopover/index.d.ts +1 -0
  43. package/dist/esm/components/SiteCsatPopover/index.js +1 -0
  44. package/dist/esm/components/SiteCsatPopover/styles.module.css +23 -0
  45. package/dist/esm/components/index.d.ts +2 -0
  46. package/dist/esm/components/index.js +2 -0
  47. package/dist/esm/helperComponents/ContentDislikeCsat/ContentDislikeCsat.d.ts +18 -0
  48. package/dist/esm/helperComponents/ContentDislikeCsat/ContentDislikeCsat.js +39 -0
  49. package/dist/esm/helperComponents/ContentDislikeCsat/index.d.ts +1 -0
  50. package/dist/esm/helperComponents/ContentDislikeCsat/index.js +1 -0
  51. package/dist/esm/helperComponents/ContentDislikeCsat/styles.module.css +31 -0
  52. package/dist/esm/helperComponents/LikeDislikeBlock/LikeDislikeBlock.d.ts +11 -0
  53. package/dist/esm/helperComponents/LikeDislikeBlock/LikeDislikeBlock.js +14 -0
  54. package/dist/esm/helperComponents/LikeDislikeBlock/index.d.ts +1 -0
  55. package/dist/esm/helperComponents/LikeDislikeBlock/index.js +1 -0
  56. package/dist/esm/helperComponents/LikeDislikeBlock/styles.module.css +17 -0
  57. package/dist/esm/helperComponents/PopoverReport/PopoverReportContent.d.ts +10 -0
  58. package/dist/esm/helperComponents/PopoverReport/PopoverReportContent.js +11 -0
  59. package/dist/esm/helperComponents/PopoverReport/index.d.ts +1 -0
  60. package/dist/esm/helperComponents/PopoverReport/index.js +1 -0
  61. package/dist/esm/helperComponents/PopoverReport/styles.module.css +31 -0
  62. package/dist/esm/helperComponents/index.d.ts +3 -0
  63. package/dist/esm/helperComponents/index.js +3 -0
  64. package/dist/esm/index.d.ts +1 -0
  65. package/dist/esm/index.js +1 -0
  66. package/dist/esm/types.d.ts +4 -0
  67. package/dist/esm/types.js +1 -0
  68. package/package.json +6 -5
package/CHANGELOG.md CHANGED
@@ -3,6 +3,28 @@
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
+ ## 0.1.17 (2025-11-13)
7
+
8
+ ### Only dependencies have been changed
9
+ * [@cloud-ru/uikit-product-icons@15.1.3](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/icons/CHANGELOG.md)
10
+ * [@cloud-ru/uikit-product-mobile-modal@0.9.20](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/mobile-modal/CHANGELOG.md)
11
+ * [@cloud-ru/uikit-product-utils@7.0.2](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/utils/CHANGELOG.md)
12
+
13
+
14
+
15
+
16
+
17
+ ## 0.1.16 (2025-11-12)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **PD-3377:** contributors update to publish all packages ([719fd3e](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/719fd3e1249e247443b125c47ea408d92c8395c3))
23
+
24
+
25
+
26
+
27
+
6
28
  ## 0.1.15 (2025-11-12)
7
29
 
8
30
  ### Only dependencies have been changed
@@ -0,0 +1,17 @@
1
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
2
+ import { onSubmitVariables } from '../../types';
3
+ export type SiteCsatProps = WithLayoutType<{
4
+ isLoading?: boolean;
5
+ like?: boolean;
6
+ onSetLike: (flag: boolean) => void;
7
+ label: string;
8
+ dislikeCommentForm?: {
9
+ open: boolean;
10
+ dislikeEnabled?: boolean;
11
+ loadingButton?: boolean;
12
+ onClickForm(): void;
13
+ onSubmit({ textComment, selectedChips }: onSubmitVariables): void;
14
+ onCheckChips?(titleChip: string): void;
15
+ };
16
+ }>;
17
+ export declare function SiteCsat({ isLoading, like, onSetLike, layoutType, label, dislikeCommentForm }: SiteCsatProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SiteCsat = SiteCsat;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const icons_1 = require("@snack-uikit/icons");
9
+ const loaders_1 = require("@snack-uikit/loaders");
10
+ const typography_1 = require("@snack-uikit/typography");
11
+ const helperComponents_1 = require("../../helperComponents");
12
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
13
+ function SiteCsat({ isLoading, like, onSetLike, layoutType, label, dislikeCommentForm }) {
14
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.siteCsatBlock, "data-layout-type": layoutType, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.csatFormBlock, children: [like === undefined || isLoading ? ((0, jsx_runtime_1.jsx)(typography_1.Typography.SansTitleM, { children: label })) : ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.reportSendBlock, children: [(0, jsx_runtime_1.jsx)(icons_1.CheckFilledSVG, { className: styles_module_scss_1.default.checkIcon }), (0, jsx_runtime_1.jsx)(typography_1.Typography.SansTitleM, { children: "\u0421\u043F\u0430\u0441\u0438\u0431\u043E \u0437\u0430 \u043E\u0442\u0437\u044B\u0432" })] })), isLoading ? ((0, jsx_runtime_1.jsx)(loaders_1.Spinner, {})) : ((0, jsx_runtime_1.jsx)(helperComponents_1.LikeDislikeBlock, { dislikeEnabled: dislikeCommentForm === null || dislikeCommentForm === void 0 ? void 0 : dislikeCommentForm.dislikeEnabled, like: like, onSetLike: onSetLike })), like === false && !isLoading && dislikeCommentForm && dislikeCommentForm.open && ((0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyM, { className: styles_module_scss_1.default.textSupport, children: "\u041F\u043E\u0434\u0435\u043B\u0438\u0442\u0435\u0441\u044C, \u0447\u0442\u043E \u0438\u043C\u0435\u043D\u043D\u043E \u043D\u0435 \u0442\u0430\u043A?" }))] }), like === false && !isLoading && dislikeCommentForm && dislikeCommentForm.open && ((0, jsx_runtime_1.jsx)(helperComponents_1.ContentDislikeCsat, { classNameContentContainer: styles_module_scss_1.default.classNameContentContainer, classNameChipsContainer: styles_module_scss_1.default.classNameChipsContainer, onCheckChips: dislikeCommentForm.onCheckChips, onClickForm: dislikeCommentForm.onClickForm, loadingButton: dislikeCommentForm.loadingButton, onSubmit: dislikeCommentForm.onSubmit }))] }));
15
+ }
@@ -0,0 +1 @@
1
+ export * from './SiteCsat';
@@ -0,0 +1,17 @@
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("./SiteCsat"), exports);
@@ -0,0 +1,41 @@
1
+ .siteCsatBlock{
2
+ box-sizing:border-box;
3
+ width:520px;
4
+ display:flex;
5
+ flex-direction:column;
6
+ align-items:center;
7
+ gap:20px;
8
+ }
9
+ .siteCsatBlock[data-layout-type=tablet], .siteCsatBlock[data-layout-type=mobile]{
10
+ width:328px;
11
+ }
12
+
13
+ .csatFormBlock{
14
+ display:flex;
15
+ flex-direction:column;
16
+ align-items:center;
17
+ gap:16px;
18
+ }
19
+
20
+ .reportSendBlock{
21
+ display:flex;
22
+ flex-direction:column;
23
+ align-items:center;
24
+ gap:8px;
25
+ }
26
+
27
+ .checkIcon{
28
+ color:var(--sys-primary-accent-default, #389f74);
29
+ }
30
+
31
+ .textSupport{
32
+ color:var(--sys-neutral-text-support, #6d707f);
33
+ }
34
+
35
+ .classNameContentContainer{
36
+ align-items:center;
37
+ }
38
+
39
+ .classNameChipsContainer{
40
+ justify-content:center;
41
+ }
@@ -0,0 +1,20 @@
1
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
2
+ import { onSubmitVariables } from '../../types';
3
+ export type SiteCsatPopoverProps = WithLayoutType<{
4
+ loading?: boolean;
5
+ like?: boolean;
6
+ onSetLike: (flag: boolean) => void;
7
+ label: string;
8
+ negativeFeedbackForm: {
9
+ open: boolean;
10
+ onSetOpen: (flag: boolean) => void;
11
+ };
12
+ dislikeCommentForm?: {
13
+ dislikeEnabled: boolean;
14
+ loadingButton?: boolean;
15
+ onClickForm(): void;
16
+ onCheckChips?(titleChip: string): void;
17
+ onSubmit({ textComment, selectedChips }: onSubmitVariables): void;
18
+ };
19
+ }>;
20
+ export declare function SiteCsatPopover({ loading, like, onSetLike, layoutType, negativeFeedbackForm, label, dislikeCommentForm, }: SiteCsatPopoverProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.SiteCsatPopover = SiteCsatPopover;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("react");
9
+ const uikit_product_mobile_modal_1 = require("@sbercloud/uikit-product-mobile-modal");
10
+ const loaders_1 = require("@snack-uikit/loaders");
11
+ const popover_1 = require("@snack-uikit/popover");
12
+ const typography_1 = require("@snack-uikit/typography");
13
+ const helperComponents_1 = require("../../helperComponents");
14
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
15
+ function SiteCsatPopover({ loading, like, onSetLike, layoutType, negativeFeedbackForm, label, dislikeCommentForm, }) {
16
+ const isMobile = layoutType === 'mobile';
17
+ const triggerRef = (0, react_1.useRef)(null);
18
+ const handleOpenClosePopover = () => {
19
+ negativeFeedbackForm.onSetOpen(!negativeFeedbackForm.open);
20
+ };
21
+ const popover = dislikeCommentForm && ((0, jsx_runtime_1.jsx)(popover_1.Popover, { tip: (0, jsx_runtime_1.jsx)(helperComponents_1.PopoverReportContent, { onClickForm: dislikeCommentForm.onClickForm, onOpenClosePopover: handleOpenClosePopover, onSubmit: dislikeCommentForm.onSubmit, onCheckChips: dislikeCommentForm.onCheckChips, loadingButton: dislikeCommentForm.loadingButton }), open: negativeFeedbackForm.open, trigger: 'click', placement: 'bottom', triggerRef: triggerRef }));
22
+ const mobileModal = dislikeCommentForm && ((0, jsx_runtime_1.jsxs)(uikit_product_mobile_modal_1.MobileModalCustom, { open: negativeFeedbackForm.open, onClose: handleOpenClosePopover, children: [(0, jsx_runtime_1.jsx)(uikit_product_mobile_modal_1.MobileModalCustom.Header, { title: '\u0421\u043F\u0430\u0441\u0438\u0431\u043E \u0437\u0430 \u043E\u0442\u0437\u044B\u0432!', subtitle: '\u041F\u043E\u0434\u0435\u043B\u0438\u0442\u0435\u0441\u044C, \u0447\u0442\u043E \u0438\u043C\u0435\u043D\u043D\u043E \u043D\u0435 \u0442\u0430\u043A?' }), (0, jsx_runtime_1.jsx)(uikit_product_mobile_modal_1.MobileModalCustom.Body, { content: (0, jsx_runtime_1.jsx)(helperComponents_1.ContentDislikeCsat, { onClickForm: dislikeCommentForm.onClickForm, loadingButton: dislikeCommentForm.loadingButton, onSubmit: dislikeCommentForm.onSubmit, onCheckChips: dislikeCommentForm.onCheckChips, buttonSubmit: {
23
+ size: 'm',
24
+ fullWidth: true,
25
+ } }) })] }));
26
+ return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.siteCsatPopoverBlock, children: [!isMobile && (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyM, { className: styles_module_scss_1.default.label, children: label }), loading ? ((0, jsx_runtime_1.jsx)(loaders_1.Spinner, { className: styles_module_scss_1.default.spinner })) : ((0, jsx_runtime_1.jsx)(helperComponents_1.LikeDislikeBlock, { dislikeEnabled: dislikeCommentForm === null || dislikeCommentForm === void 0 ? void 0 : dislikeCommentForm.dislikeEnabled, className: styles_module_scss_1.default.likeDislikeBlock, onOpenClosePopover: handleOpenClosePopover, triggerRef: triggerRef, like: like, onSetLike: onSetLike }))] }), isMobile ? mobileModal : popover] }));
27
+ }
@@ -0,0 +1 @@
1
+ export * from './SiteCsatPopover';
@@ -0,0 +1,17 @@
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("./SiteCsatPopover"), exports);
@@ -0,0 +1,23 @@
1
+ .siteCsatPopoverBlock{
2
+ max-width:334px;
3
+ display:flex;
4
+ flex-direction:row;
5
+ align-items:center;
6
+ gap:12px;
7
+ }
8
+
9
+ .label{
10
+ color:var(--sys-neutral-text-support, #6d707f);
11
+ }
12
+
13
+ .likeDislikeBlock{
14
+ display:flex;
15
+ flex-direction:row;
16
+ gap:8px;
17
+ }
18
+
19
+ .spinner{
20
+ display:flex;
21
+ justify-content:end;
22
+ width:64px;
23
+ }
@@ -0,0 +1,2 @@
1
+ export * from './SiteCsat';
2
+ export * from './SiteCsatPopover';
@@ -0,0 +1,18 @@
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("./SiteCsat"), exports);
18
+ __exportStar(require("./SiteCsatPopover"), exports);
@@ -0,0 +1,18 @@
1
+ import { Size } from '@snack-uikit/typography';
2
+ import { onSubmitVariables } from '../../types';
3
+ type ButtonSubmit = {
4
+ size: Size;
5
+ fullWidth?: boolean;
6
+ };
7
+ type ContentDislikeCsatProps = {
8
+ onSubmit({ textComment, selectedChips }: onSubmitVariables): void;
9
+ withCheckBoxAgreement?: boolean;
10
+ loadingButton?: boolean;
11
+ onClickForm?: () => void;
12
+ buttonSubmit?: ButtonSubmit;
13
+ classNameContentContainer?: string;
14
+ classNameChipsContainer?: string;
15
+ onCheckChips?(titleChip: string): void;
16
+ };
17
+ export declare function ContentDislikeCsat({ onSubmit, withCheckBoxAgreement, loadingButton, onClickForm, buttonSubmit, onCheckChips, classNameContentContainer, classNameChipsContainer, }: ContentDislikeCsatProps): import("react/jsx-runtime").JSX.Element;
18
+ export {};
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.ContentDislikeCsat = ContentDislikeCsat;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const classnames_1 = __importDefault(require("classnames"));
9
+ const react_1 = require("react");
10
+ const button_1 = require("@snack-uikit/button");
11
+ const chips_1 = require("@snack-uikit/chips");
12
+ const fields_1 = require("@snack-uikit/fields");
13
+ const toggles_1 = require("@snack-uikit/toggles");
14
+ const typography_1 = require("@snack-uikit/typography");
15
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
16
+ const CHIPS = ['Не нашел ответ', 'Неудобный поиск', 'Тяжело найти ответ', 'Другое'];
17
+ const MAX_COMMENT_LENGTH = 1000;
18
+ function ContentDislikeCsat({ onSubmit, withCheckBoxAgreement, loadingButton, onClickForm, buttonSubmit, onCheckChips, classNameContentContainer, classNameChipsContainer, }) {
19
+ const [textAreaValue, setTextAreaValue] = (0, react_1.useState)('');
20
+ const [checkAgree, setCheckAgree] = (0, react_1.useState)(false);
21
+ const [selectedChips, setSelectedChips] = (0, react_1.useState)([]);
22
+ const handleChangeComment = (value) => {
23
+ if (value.length <= MAX_COMMENT_LENGTH) {
24
+ setTextAreaValue(value);
25
+ }
26
+ };
27
+ const handleSubmit = () => {
28
+ onSubmit({
29
+ textComment: textAreaValue,
30
+ selectedChips,
31
+ });
32
+ };
33
+ const handleSelectChips = (text) => {
34
+ if (selectedChips.find(item => item === text)) {
35
+ setSelectedChips(prev => prev.filter(chip => chip !== text));
36
+ }
37
+ else {
38
+ setSelectedChips([...selectedChips, text]);
39
+ }
40
+ };
41
+ return ((0, jsx_runtime_1.jsxs)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.contentBlock, classNameContentContainer), role: 'group', children: [(0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.chipsContainer, classNameChipsContainer), children: CHIPS.map(item => ((0, jsx_runtime_1.jsx)(chips_1.ChipToggle, { label: item, size: 's', onChange: () => {
42
+ onCheckChips && onCheckChips(item);
43
+ handleSelectChips(item);
44
+ }, checked: Boolean(selectedChips.find(chip => chip === item)) }, item))) }), selectedChips.length > 0 && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(fields_1.FieldTextArea, { onFocus: onClickForm, placeholder: '\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439', label: '\u0420\u0430\u0441\u0441\u043A\u0430\u0436\u0438\u0442\u0435 \u043F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435', className: styles_module_scss_1.default.textArea, value: textAreaValue, onChange: handleChangeComment, maxLength: MAX_COMMENT_LENGTH, maxRows: 4, resizable: true }), withCheckBoxAgreement && ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.checkBoxBlock, children: [(0, jsx_runtime_1.jsx)(toggles_1.Checkbox, { checked: checkAgree, onChange: setCheckAgree }), (0, jsx_runtime_1.jsxs)(typography_1.Typography.SansBodyM, { children: ["\u042F \u0434\u0430\u044E", ' ', (0, jsx_runtime_1.jsx)("a", { className: styles_module_scss_1.default.link, target: '_blank', href: 'https://cdn.cloud.ru/docs/legal/security/cybersecurity-pd/pd-processing-consent-materials-mailing.pdf', rel: 'noreferrer', children: "\u0441\u043E\u0433\u043B\u0430\u0441\u0438\u0435" }), ' ', "\u043D\u0430 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0443 \u043C\u043E\u0438\u0445 \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445 \u0438 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435 \u0440\u0435\u043A\u043B\u0430\u043C\u043D\u044B\u0445 \u0438 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0445 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439 \u0432 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0443\u0441\u043B\u043E\u0432\u0438\u044F\u043C\u0438", ' ', (0, jsx_runtime_1.jsx)("a", { className: styles_module_scss_1.default.link, target: '_blank', href: 'https://cdn.cloud.ru/docs/legal/security/cybersecurity-pd/confidentiality-policy.pdf', rel: 'noreferrer', children: "\u043F\u043E\u043B\u0438\u0442\u0438\u043A\u0438 \u043A\u043E\u043D\u0444\u0438\u0434\u0435\u043D\u0446\u0438\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u0438" })] })] })), (0, jsx_runtime_1.jsx)(button_1.ButtonFilled, { fullWidth: buttonSubmit === null || buttonSubmit === void 0 ? void 0 : buttonSubmit.fullWidth, size: buttonSubmit === null || buttonSubmit === void 0 ? void 0 : buttonSubmit.size, loading: loadingButton, onClick: handleSubmit, label: '\u041E\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439' })] }))] }));
45
+ }
@@ -0,0 +1 @@
1
+ export * from './ContentDislikeCsat';
@@ -0,0 +1,17 @@
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("./ContentDislikeCsat"), exports);
@@ -0,0 +1,31 @@
1
+ .contentBlock{
2
+ display:flex;
3
+ flex-direction:column;
4
+ align-items:start;
5
+ gap:20px;
6
+ width:100%;
7
+ }
8
+
9
+ .textArea{
10
+ width:100%;
11
+ }
12
+
13
+ .checkBoxBlock{
14
+ display:flex;
15
+ flex-direction:row;
16
+ gap:12px;
17
+ align-items:start;
18
+ }
19
+
20
+ .link{
21
+ color:inherit;
22
+ text-decoration:underline;
23
+ background-color:transparent;
24
+ cursor:pointer;
25
+ }
26
+
27
+ .chipsContainer{
28
+ display:flex;
29
+ flex-wrap:wrap;
30
+ gap:8px;
31
+ }
@@ -0,0 +1,11 @@
1
+ import { MutableRefObject } from 'react';
2
+ type LikeDislikeBlockProps = {
3
+ like?: boolean;
4
+ dislikeEnabled?: boolean;
5
+ className?: string;
6
+ triggerRef?: MutableRefObject<HTMLButtonElement | null>;
7
+ onOpenClosePopover?: () => void;
8
+ onSetLike: (flag: boolean) => void;
9
+ };
10
+ export declare function LikeDislikeBlock({ like, onSetLike, triggerRef, onOpenClosePopover, className, dislikeEnabled, }: LikeDislikeBlockProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.LikeDislikeBlock = LikeDislikeBlock;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const classnames_1 = __importDefault(require("classnames"));
9
+ const uikit_product_icons_1 = require("@sbercloud/uikit-product-icons");
10
+ const button_1 = require("@snack-uikit/button");
11
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
12
+ function LikeDislikeBlock({ like, onSetLike, triggerRef, onOpenClosePopover, className, dislikeEnabled, }) {
13
+ const handleLike = () => {
14
+ onSetLike(true);
15
+ };
16
+ const handleDislike = () => {
17
+ onSetLike(false);
18
+ };
19
+ return ((0, jsx_runtime_1.jsx)("div", { className: className || styles_module_scss_1.default.likeDislikeBlock, children: like === undefined ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(button_1.ButtonFunction, { onClick: handleLike, icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.LikeOutlineSVG, {}) }), (0, jsx_runtime_1.jsx)(button_1.ButtonFunction, { onClick: handleDislike, icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.DislikeOutlineSVG, {}) })] })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [like && (0, jsx_runtime_1.jsx)(uikit_product_icons_1.LikeFilledSVG, { className: (0, classnames_1.default)(styles_module_scss_1.default.icon, styles_module_scss_1.default.iconDisabled) }), !like && ((0, jsx_runtime_1.jsx)(button_1.ButtonFunction, { onClick: onOpenClosePopover, disabled: !dislikeEnabled, ref: triggerRef, icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.DislikeFilledSVG, {}) }))] })) }));
20
+ }
@@ -0,0 +1 @@
1
+ export * from './LikeDislikeBlock';
@@ -0,0 +1,17 @@
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("./LikeDislikeBlock"), exports);
@@ -0,0 +1,17 @@
1
+ .likeDislikeBlock{
2
+ display:flex;
3
+ flex-direction:row;
4
+ gap:24px;
5
+ }
6
+
7
+ .icon{
8
+ color:var(--sys-neutral-accent-default, #787b8a);
9
+ }
10
+
11
+ .iconDisabled{
12
+ cursor:not-allowed;
13
+ }
14
+
15
+ .iconHover{
16
+ cursor:pointer;
17
+ }
@@ -0,0 +1,10 @@
1
+ import { onSubmitVariables } from '../../types';
2
+ type PopoverReportProps = {
3
+ onSubmit({ textComment, selectedChips }: onSubmitVariables): void;
4
+ onCheckChips?(titleChip: string): void;
5
+ loadingButton?: boolean;
6
+ onOpenClosePopover: () => void;
7
+ onClickForm?: () => void;
8
+ };
9
+ export declare function PopoverReportContent({ onSubmit, onOpenClosePopover, loadingButton, onClickForm, onCheckChips, }: PopoverReportProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PopoverReportContent = PopoverReportContent;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const uikit_product_icons_1 = require("@sbercloud/uikit-product-icons");
9
+ const typography_1 = require("@snack-uikit/typography");
10
+ const ContentDislikeCsat_1 = require("../ContentDislikeCsat");
11
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
12
+ function PopoverReportContent({ onSubmit, onOpenClosePopover, loadingButton, onClickForm, onCheckChips, }) {
13
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.popoverContent, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.popoverTitleBlock, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.popoverTitleDescription, children: [(0, jsx_runtime_1.jsx)(typography_1.Typography.SansTitleM, { className: styles_module_scss_1.default.popoverTitle, children: "\u0421\u043F\u0430\u0441\u0438\u0431\u043E \u0437\u0430 \u043E\u0442\u0437\u044B\u0432!" }), (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyS, { className: styles_module_scss_1.default.popoverDescription, children: "\u041F\u043E\u0434\u0435\u043B\u0438\u0442\u0435\u0441\u044C, \u0447\u0442\u043E \u0438\u043C\u0435\u043D\u043D\u043E \u043D\u0435 \u0442\u0430\u043A?" })] }), (0, jsx_runtime_1.jsx)(uikit_product_icons_1.CloseInterfaceSVG, { className: styles_module_scss_1.default.iconClose, onClick: onOpenClosePopover })] }), (0, jsx_runtime_1.jsx)(ContentDislikeCsat_1.ContentDislikeCsat, { onClickForm: onClickForm, loadingButton: loadingButton, onSubmit: onSubmit, onCheckChips: onCheckChips, buttonSubmit: {
14
+ fullWidth: true,
15
+ size: 's',
16
+ } })] }));
17
+ }
@@ -0,0 +1 @@
1
+ export * from './PopoverReportContent';
@@ -0,0 +1,17 @@
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("./PopoverReportContent"), exports);
@@ -0,0 +1,31 @@
1
+ .popoverContent{
2
+ display:flex;
3
+ flex-direction:column;
4
+ gap:20px;
5
+ width:280px;
6
+ }
7
+
8
+ .popoverTitleBlock{
9
+ display:flex;
10
+ flex-direction:row;
11
+ justify-content:space-between;
12
+ }
13
+
14
+ .popoverTitleDescription{
15
+ display:flex;
16
+ flex-direction:column;
17
+ gap:4px;
18
+ }
19
+
20
+ .iconClose{
21
+ color:var(--sys-neutral-accent-default, #787b8a);
22
+ cursor:pointer;
23
+ }
24
+
25
+ .popoverTitle{
26
+ color:var(--sys-neutral-text-main, #41424e);
27
+ }
28
+
29
+ .popoverDescription{
30
+ color:var(--sys-neutral-text-support, #6d707f);
31
+ }
@@ -0,0 +1,3 @@
1
+ export * from './ContentDislikeCsat';
2
+ export * from './LikeDislikeBlock';
3
+ export * from './PopoverReport';
@@ -0,0 +1,19 @@
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("./ContentDislikeCsat"), exports);
18
+ __exportStar(require("./LikeDislikeBlock"), exports);
19
+ __exportStar(require("./PopoverReport"), exports);
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1,17 @@
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("./components"), exports);
@@ -0,0 +1,4 @@
1
+ export type onSubmitVariables = {
2
+ textComment: string;
3
+ selectedChips: string[];
4
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
2
+ import { onSubmitVariables } from '../../types';
3
+ export type SiteCsatProps = WithLayoutType<{
4
+ isLoading?: boolean;
5
+ like?: boolean;
6
+ onSetLike: (flag: boolean) => void;
7
+ label: string;
8
+ dislikeCommentForm?: {
9
+ open: boolean;
10
+ dislikeEnabled?: boolean;
11
+ loadingButton?: boolean;
12
+ onClickForm(): void;
13
+ onSubmit({ textComment, selectedChips }: onSubmitVariables): void;
14
+ onCheckChips?(titleChip: string): void;
15
+ };
16
+ }>;
17
+ export declare function SiteCsat({ isLoading, like, onSetLike, layoutType, label, dislikeCommentForm }: SiteCsatProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,9 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CheckFilledSVG } from '@snack-uikit/icons';
3
+ import { Spinner } from '@snack-uikit/loaders';
4
+ import { Typography } from '@snack-uikit/typography';
5
+ import { ContentDislikeCsat, LikeDislikeBlock } from '../../helperComponents';
6
+ import styles from './styles.module.css';
7
+ export function SiteCsat({ isLoading, like, onSetLike, layoutType, label, dislikeCommentForm }) {
8
+ return (_jsxs("div", { className: styles.siteCsatBlock, "data-layout-type": layoutType, children: [_jsxs("div", { className: styles.csatFormBlock, children: [like === undefined || isLoading ? (_jsx(Typography.SansTitleM, { children: label })) : (_jsxs("div", { className: styles.reportSendBlock, children: [_jsx(CheckFilledSVG, { className: styles.checkIcon }), _jsx(Typography.SansTitleM, { children: "\u0421\u043F\u0430\u0441\u0438\u0431\u043E \u0437\u0430 \u043E\u0442\u0437\u044B\u0432" })] })), isLoading ? (_jsx(Spinner, {})) : (_jsx(LikeDislikeBlock, { dislikeEnabled: dislikeCommentForm === null || dislikeCommentForm === void 0 ? void 0 : dislikeCommentForm.dislikeEnabled, like: like, onSetLike: onSetLike })), like === false && !isLoading && dislikeCommentForm && dislikeCommentForm.open && (_jsx(Typography.SansBodyM, { className: styles.textSupport, children: "\u041F\u043E\u0434\u0435\u043B\u0438\u0442\u0435\u0441\u044C, \u0447\u0442\u043E \u0438\u043C\u0435\u043D\u043D\u043E \u043D\u0435 \u0442\u0430\u043A?" }))] }), like === false && !isLoading && dislikeCommentForm && dislikeCommentForm.open && (_jsx(ContentDislikeCsat, { classNameContentContainer: styles.classNameContentContainer, classNameChipsContainer: styles.classNameChipsContainer, onCheckChips: dislikeCommentForm.onCheckChips, onClickForm: dislikeCommentForm.onClickForm, loadingButton: dislikeCommentForm.loadingButton, onSubmit: dislikeCommentForm.onSubmit }))] }));
9
+ }
@@ -0,0 +1 @@
1
+ export * from './SiteCsat';
@@ -0,0 +1 @@
1
+ export * from './SiteCsat';
@@ -0,0 +1,41 @@
1
+ .siteCsatBlock{
2
+ box-sizing:border-box;
3
+ width:520px;
4
+ display:flex;
5
+ flex-direction:column;
6
+ align-items:center;
7
+ gap:20px;
8
+ }
9
+ .siteCsatBlock[data-layout-type=tablet], .siteCsatBlock[data-layout-type=mobile]{
10
+ width:328px;
11
+ }
12
+
13
+ .csatFormBlock{
14
+ display:flex;
15
+ flex-direction:column;
16
+ align-items:center;
17
+ gap:16px;
18
+ }
19
+
20
+ .reportSendBlock{
21
+ display:flex;
22
+ flex-direction:column;
23
+ align-items:center;
24
+ gap:8px;
25
+ }
26
+
27
+ .checkIcon{
28
+ color:var(--sys-primary-accent-default, #389f74);
29
+ }
30
+
31
+ .textSupport{
32
+ color:var(--sys-neutral-text-support, #6d707f);
33
+ }
34
+
35
+ .classNameContentContainer{
36
+ align-items:center;
37
+ }
38
+
39
+ .classNameChipsContainer{
40
+ justify-content:center;
41
+ }
@@ -0,0 +1,20 @@
1
+ import { WithLayoutType } from '@sbercloud/uikit-product-utils';
2
+ import { onSubmitVariables } from '../../types';
3
+ export type SiteCsatPopoverProps = WithLayoutType<{
4
+ loading?: boolean;
5
+ like?: boolean;
6
+ onSetLike: (flag: boolean) => void;
7
+ label: string;
8
+ negativeFeedbackForm: {
9
+ open: boolean;
10
+ onSetOpen: (flag: boolean) => void;
11
+ };
12
+ dislikeCommentForm?: {
13
+ dislikeEnabled: boolean;
14
+ loadingButton?: boolean;
15
+ onClickForm(): void;
16
+ onCheckChips?(titleChip: string): void;
17
+ onSubmit({ textComment, selectedChips }: onSubmitVariables): void;
18
+ };
19
+ }>;
20
+ export declare function SiteCsatPopover({ loading, like, onSetLike, layoutType, negativeFeedbackForm, label, dislikeCommentForm, }: SiteCsatPopoverProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useRef } from 'react';
3
+ import { MobileModalCustom } from '@sbercloud/uikit-product-mobile-modal';
4
+ import { Spinner } from '@snack-uikit/loaders';
5
+ import { Popover } from '@snack-uikit/popover';
6
+ import { Typography } from '@snack-uikit/typography';
7
+ import { ContentDislikeCsat, LikeDislikeBlock, PopoverReportContent } from '../../helperComponents';
8
+ import styles from './styles.module.css';
9
+ export function SiteCsatPopover({ loading, like, onSetLike, layoutType, negativeFeedbackForm, label, dislikeCommentForm, }) {
10
+ const isMobile = layoutType === 'mobile';
11
+ const triggerRef = useRef(null);
12
+ const handleOpenClosePopover = () => {
13
+ negativeFeedbackForm.onSetOpen(!negativeFeedbackForm.open);
14
+ };
15
+ const popover = dislikeCommentForm && (_jsx(Popover, { tip: _jsx(PopoverReportContent, { onClickForm: dislikeCommentForm.onClickForm, onOpenClosePopover: handleOpenClosePopover, onSubmit: dislikeCommentForm.onSubmit, onCheckChips: dislikeCommentForm.onCheckChips, loadingButton: dislikeCommentForm.loadingButton }), open: negativeFeedbackForm.open, trigger: 'click', placement: 'bottom', triggerRef: triggerRef }));
16
+ const mobileModal = dislikeCommentForm && (_jsxs(MobileModalCustom, { open: negativeFeedbackForm.open, onClose: handleOpenClosePopover, children: [_jsx(MobileModalCustom.Header, { title: '\u0421\u043F\u0430\u0441\u0438\u0431\u043E \u0437\u0430 \u043E\u0442\u0437\u044B\u0432!', subtitle: '\u041F\u043E\u0434\u0435\u043B\u0438\u0442\u0435\u0441\u044C, \u0447\u0442\u043E \u0438\u043C\u0435\u043D\u043D\u043E \u043D\u0435 \u0442\u0430\u043A?' }), _jsx(MobileModalCustom.Body, { content: _jsx(ContentDislikeCsat, { onClickForm: dislikeCommentForm.onClickForm, loadingButton: dislikeCommentForm.loadingButton, onSubmit: dislikeCommentForm.onSubmit, onCheckChips: dislikeCommentForm.onCheckChips, buttonSubmit: {
17
+ size: 'm',
18
+ fullWidth: true,
19
+ } }) })] }));
20
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: styles.siteCsatPopoverBlock, children: [!isMobile && _jsx(Typography.SansBodyM, { className: styles.label, children: label }), loading ? (_jsx(Spinner, { className: styles.spinner })) : (_jsx(LikeDislikeBlock, { dislikeEnabled: dislikeCommentForm === null || dislikeCommentForm === void 0 ? void 0 : dislikeCommentForm.dislikeEnabled, className: styles.likeDislikeBlock, onOpenClosePopover: handleOpenClosePopover, triggerRef: triggerRef, like: like, onSetLike: onSetLike }))] }), isMobile ? mobileModal : popover] }));
21
+ }
@@ -0,0 +1 @@
1
+ export * from './SiteCsatPopover';
@@ -0,0 +1 @@
1
+ export * from './SiteCsatPopover';
@@ -0,0 +1,23 @@
1
+ .siteCsatPopoverBlock{
2
+ max-width:334px;
3
+ display:flex;
4
+ flex-direction:row;
5
+ align-items:center;
6
+ gap:12px;
7
+ }
8
+
9
+ .label{
10
+ color:var(--sys-neutral-text-support, #6d707f);
11
+ }
12
+
13
+ .likeDislikeBlock{
14
+ display:flex;
15
+ flex-direction:row;
16
+ gap:8px;
17
+ }
18
+
19
+ .spinner{
20
+ display:flex;
21
+ justify-content:end;
22
+ width:64px;
23
+ }
@@ -0,0 +1,2 @@
1
+ export * from './SiteCsat';
2
+ export * from './SiteCsatPopover';
@@ -0,0 +1,2 @@
1
+ export * from './SiteCsat';
2
+ export * from './SiteCsatPopover';
@@ -0,0 +1,18 @@
1
+ import { Size } from '@snack-uikit/typography';
2
+ import { onSubmitVariables } from '../../types';
3
+ type ButtonSubmit = {
4
+ size: Size;
5
+ fullWidth?: boolean;
6
+ };
7
+ type ContentDislikeCsatProps = {
8
+ onSubmit({ textComment, selectedChips }: onSubmitVariables): void;
9
+ withCheckBoxAgreement?: boolean;
10
+ loadingButton?: boolean;
11
+ onClickForm?: () => void;
12
+ buttonSubmit?: ButtonSubmit;
13
+ classNameContentContainer?: string;
14
+ classNameChipsContainer?: string;
15
+ onCheckChips?(titleChip: string): void;
16
+ };
17
+ export declare function ContentDislikeCsat({ onSubmit, withCheckBoxAgreement, loadingButton, onClickForm, buttonSubmit, onCheckChips, classNameContentContainer, classNameChipsContainer, }: ContentDislikeCsatProps): import("react/jsx-runtime").JSX.Element;
18
+ export {};
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import cn from 'classnames';
3
+ import { useState } from 'react';
4
+ import { ButtonFilled } from '@snack-uikit/button';
5
+ import { ChipToggle } from '@snack-uikit/chips';
6
+ import { FieldTextArea } from '@snack-uikit/fields';
7
+ import { Checkbox } from '@snack-uikit/toggles';
8
+ import { Typography } from '@snack-uikit/typography';
9
+ import styles from './styles.module.css';
10
+ const CHIPS = ['Не нашел ответ', 'Неудобный поиск', 'Тяжело найти ответ', 'Другое'];
11
+ const MAX_COMMENT_LENGTH = 1000;
12
+ export function ContentDislikeCsat({ onSubmit, withCheckBoxAgreement, loadingButton, onClickForm, buttonSubmit, onCheckChips, classNameContentContainer, classNameChipsContainer, }) {
13
+ const [textAreaValue, setTextAreaValue] = useState('');
14
+ const [checkAgree, setCheckAgree] = useState(false);
15
+ const [selectedChips, setSelectedChips] = useState([]);
16
+ const handleChangeComment = (value) => {
17
+ if (value.length <= MAX_COMMENT_LENGTH) {
18
+ setTextAreaValue(value);
19
+ }
20
+ };
21
+ const handleSubmit = () => {
22
+ onSubmit({
23
+ textComment: textAreaValue,
24
+ selectedChips,
25
+ });
26
+ };
27
+ const handleSelectChips = (text) => {
28
+ if (selectedChips.find(item => item === text)) {
29
+ setSelectedChips(prev => prev.filter(chip => chip !== text));
30
+ }
31
+ else {
32
+ setSelectedChips([...selectedChips, text]);
33
+ }
34
+ };
35
+ return (_jsxs("div", { className: cn(styles.contentBlock, classNameContentContainer), role: 'group', children: [_jsx("div", { className: cn(styles.chipsContainer, classNameChipsContainer), children: CHIPS.map(item => (_jsx(ChipToggle, { label: item, size: 's', onChange: () => {
36
+ onCheckChips && onCheckChips(item);
37
+ handleSelectChips(item);
38
+ }, checked: Boolean(selectedChips.find(chip => chip === item)) }, item))) }), selectedChips.length > 0 && (_jsxs(_Fragment, { children: [_jsx(FieldTextArea, { onFocus: onClickForm, placeholder: '\u041A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439', label: '\u0420\u0430\u0441\u0441\u043A\u0430\u0436\u0438\u0442\u0435 \u043F\u043E\u0434\u0440\u043E\u0431\u043D\u0435\u0435', className: styles.textArea, value: textAreaValue, onChange: handleChangeComment, maxLength: MAX_COMMENT_LENGTH, maxRows: 4, resizable: true }), withCheckBoxAgreement && (_jsxs("div", { className: styles.checkBoxBlock, children: [_jsx(Checkbox, { checked: checkAgree, onChange: setCheckAgree }), _jsxs(Typography.SansBodyM, { children: ["\u042F \u0434\u0430\u044E", ' ', _jsx("a", { className: styles.link, target: '_blank', href: 'https://cdn.cloud.ru/docs/legal/security/cybersecurity-pd/pd-processing-consent-materials-mailing.pdf', rel: 'noreferrer', children: "\u0441\u043E\u0433\u043B\u0430\u0441\u0438\u0435" }), ' ', "\u043D\u0430 \u043E\u0431\u0440\u0430\u0431\u043E\u0442\u043A\u0443 \u043C\u043E\u0438\u0445 \u043F\u0435\u0440\u0441\u043E\u043D\u0430\u043B\u044C\u043D\u044B\u0445 \u0434\u0430\u043D\u043D\u044B\u0445 \u0438 \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u0438\u0435 \u0440\u0435\u043A\u043B\u0430\u043C\u043D\u044B\u0445 \u0438 \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u043E\u043D\u043D\u044B\u0445 \u0441\u043E\u043E\u0431\u0449\u0435\u043D\u0438\u0439 \u0432 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0443\u0441\u043B\u043E\u0432\u0438\u044F\u043C\u0438", ' ', _jsx("a", { className: styles.link, target: '_blank', href: 'https://cdn.cloud.ru/docs/legal/security/cybersecurity-pd/confidentiality-policy.pdf', rel: 'noreferrer', children: "\u043F\u043E\u043B\u0438\u0442\u0438\u043A\u0438 \u043A\u043E\u043D\u0444\u0438\u0434\u0435\u043D\u0446\u0438\u0430\u043B\u044C\u043D\u043E\u0441\u0442\u0438" })] })] })), _jsx(ButtonFilled, { fullWidth: buttonSubmit === null || buttonSubmit === void 0 ? void 0 : buttonSubmit.fullWidth, size: buttonSubmit === null || buttonSubmit === void 0 ? void 0 : buttonSubmit.size, loading: loadingButton, onClick: handleSubmit, label: '\u041E\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043A\u043E\u043C\u043C\u0435\u043D\u0442\u0430\u0440\u0438\u0439' })] }))] }));
39
+ }
@@ -0,0 +1 @@
1
+ export * from './ContentDislikeCsat';
@@ -0,0 +1 @@
1
+ export * from './ContentDislikeCsat';
@@ -0,0 +1,31 @@
1
+ .contentBlock{
2
+ display:flex;
3
+ flex-direction:column;
4
+ align-items:start;
5
+ gap:20px;
6
+ width:100%;
7
+ }
8
+
9
+ .textArea{
10
+ width:100%;
11
+ }
12
+
13
+ .checkBoxBlock{
14
+ display:flex;
15
+ flex-direction:row;
16
+ gap:12px;
17
+ align-items:start;
18
+ }
19
+
20
+ .link{
21
+ color:inherit;
22
+ text-decoration:underline;
23
+ background-color:transparent;
24
+ cursor:pointer;
25
+ }
26
+
27
+ .chipsContainer{
28
+ display:flex;
29
+ flex-wrap:wrap;
30
+ gap:8px;
31
+ }
@@ -0,0 +1,11 @@
1
+ import { MutableRefObject } from 'react';
2
+ type LikeDislikeBlockProps = {
3
+ like?: boolean;
4
+ dislikeEnabled?: boolean;
5
+ className?: string;
6
+ triggerRef?: MutableRefObject<HTMLButtonElement | null>;
7
+ onOpenClosePopover?: () => void;
8
+ onSetLike: (flag: boolean) => void;
9
+ };
10
+ export declare function LikeDislikeBlock({ like, onSetLike, triggerRef, onOpenClosePopover, className, dislikeEnabled, }: LikeDislikeBlockProps): import("react/jsx-runtime").JSX.Element;
11
+ export {};
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import cn from 'classnames';
3
+ import { DislikeFilledSVG, DislikeOutlineSVG, LikeFilledSVG, LikeOutlineSVG } from '@sbercloud/uikit-product-icons';
4
+ import { ButtonFunction } from '@snack-uikit/button';
5
+ import styles from './styles.module.css';
6
+ export function LikeDislikeBlock({ like, onSetLike, triggerRef, onOpenClosePopover, className, dislikeEnabled, }) {
7
+ const handleLike = () => {
8
+ onSetLike(true);
9
+ };
10
+ const handleDislike = () => {
11
+ onSetLike(false);
12
+ };
13
+ return (_jsx("div", { className: className || styles.likeDislikeBlock, children: like === undefined ? (_jsxs(_Fragment, { children: [_jsx(ButtonFunction, { onClick: handleLike, icon: _jsx(LikeOutlineSVG, {}) }), _jsx(ButtonFunction, { onClick: handleDislike, icon: _jsx(DislikeOutlineSVG, {}) })] })) : (_jsxs(_Fragment, { children: [like && _jsx(LikeFilledSVG, { className: cn(styles.icon, styles.iconDisabled) }), !like && (_jsx(ButtonFunction, { onClick: onOpenClosePopover, disabled: !dislikeEnabled, ref: triggerRef, icon: _jsx(DislikeFilledSVG, {}) }))] })) }));
14
+ }
@@ -0,0 +1 @@
1
+ export * from './LikeDislikeBlock';
@@ -0,0 +1 @@
1
+ export * from './LikeDislikeBlock';
@@ -0,0 +1,17 @@
1
+ .likeDislikeBlock{
2
+ display:flex;
3
+ flex-direction:row;
4
+ gap:24px;
5
+ }
6
+
7
+ .icon{
8
+ color:var(--sys-neutral-accent-default, #787b8a);
9
+ }
10
+
11
+ .iconDisabled{
12
+ cursor:not-allowed;
13
+ }
14
+
15
+ .iconHover{
16
+ cursor:pointer;
17
+ }
@@ -0,0 +1,10 @@
1
+ import { onSubmitVariables } from '../../types';
2
+ type PopoverReportProps = {
3
+ onSubmit({ textComment, selectedChips }: onSubmitVariables): void;
4
+ onCheckChips?(titleChip: string): void;
5
+ loadingButton?: boolean;
6
+ onOpenClosePopover: () => void;
7
+ onClickForm?: () => void;
8
+ };
9
+ export declare function PopoverReportContent({ onSubmit, onOpenClosePopover, loadingButton, onClickForm, onCheckChips, }: PopoverReportProps): import("react/jsx-runtime").JSX.Element;
10
+ export {};
@@ -0,0 +1,11 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { CloseInterfaceSVG } from '@sbercloud/uikit-product-icons';
3
+ import { Typography } from '@snack-uikit/typography';
4
+ import { ContentDislikeCsat } from '../ContentDislikeCsat';
5
+ import styles from './styles.module.css';
6
+ export function PopoverReportContent({ onSubmit, onOpenClosePopover, loadingButton, onClickForm, onCheckChips, }) {
7
+ return (_jsxs("div", { className: styles.popoverContent, children: [_jsxs("div", { className: styles.popoverTitleBlock, children: [_jsxs("div", { className: styles.popoverTitleDescription, children: [_jsx(Typography.SansTitleM, { className: styles.popoverTitle, children: "\u0421\u043F\u0430\u0441\u0438\u0431\u043E \u0437\u0430 \u043E\u0442\u0437\u044B\u0432!" }), _jsx(Typography.SansBodyS, { className: styles.popoverDescription, children: "\u041F\u043E\u0434\u0435\u043B\u0438\u0442\u0435\u0441\u044C, \u0447\u0442\u043E \u0438\u043C\u0435\u043D\u043D\u043E \u043D\u0435 \u0442\u0430\u043A?" })] }), _jsx(CloseInterfaceSVG, { className: styles.iconClose, onClick: onOpenClosePopover })] }), _jsx(ContentDislikeCsat, { onClickForm: onClickForm, loadingButton: loadingButton, onSubmit: onSubmit, onCheckChips: onCheckChips, buttonSubmit: {
8
+ fullWidth: true,
9
+ size: 's',
10
+ } })] }));
11
+ }
@@ -0,0 +1 @@
1
+ export * from './PopoverReportContent';
@@ -0,0 +1 @@
1
+ export * from './PopoverReportContent';
@@ -0,0 +1,31 @@
1
+ .popoverContent{
2
+ display:flex;
3
+ flex-direction:column;
4
+ gap:20px;
5
+ width:280px;
6
+ }
7
+
8
+ .popoverTitleBlock{
9
+ display:flex;
10
+ flex-direction:row;
11
+ justify-content:space-between;
12
+ }
13
+
14
+ .popoverTitleDescription{
15
+ display:flex;
16
+ flex-direction:column;
17
+ gap:4px;
18
+ }
19
+
20
+ .iconClose{
21
+ color:var(--sys-neutral-accent-default, #787b8a);
22
+ cursor:pointer;
23
+ }
24
+
25
+ .popoverTitle{
26
+ color:var(--sys-neutral-text-main, #41424e);
27
+ }
28
+
29
+ .popoverDescription{
30
+ color:var(--sys-neutral-text-support, #6d707f);
31
+ }
@@ -0,0 +1,3 @@
1
+ export * from './ContentDislikeCsat';
2
+ export * from './LikeDislikeBlock';
3
+ export * from './PopoverReport';
@@ -0,0 +1,3 @@
1
+ export * from './ContentDislikeCsat';
2
+ export * from './LikeDislikeBlock';
3
+ export * from './PopoverReport';
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1,4 @@
1
+ export type onSubmitVariables = {
2
+ textComment: string;
3
+ selectedChips: string[];
4
+ };
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloud-ru/uikit-product-site-csat",
3
3
  "title": "Site Csat",
4
- "version": "0.1.15",
4
+ "version": "0.1.17",
5
5
  "sideEffects": [
6
6
  "*.css",
7
7
  "*.woff",
@@ -30,15 +30,16 @@
30
30
  "name": "Akhremenko Grigorii",
31
31
  "url": "https://github.com/AGrigorii"
32
32
  },
33
+ "contributors": [],
33
34
  "license": "Apache-2.0",
34
35
  "publishConfig": {
35
36
  "access": "public"
36
37
  },
37
38
  "scripts": {},
38
39
  "dependencies": {
39
- "@cloud-ru/uikit-product-icons": "15.1.1",
40
- "@cloud-ru/uikit-product-mobile-modal": "0.9.18",
41
- "@cloud-ru/uikit-product-utils": "7.0.0",
40
+ "@cloud-ru/uikit-product-icons": "15.1.3",
41
+ "@cloud-ru/uikit-product-mobile-modal": "0.9.20",
42
+ "@cloud-ru/uikit-product-utils": "7.0.2",
42
43
  "@snack-uikit/button": "0.19.15",
43
44
  "@snack-uikit/chips": "0.28.4",
44
45
  "@snack-uikit/fields": "0.48.7",
@@ -52,5 +53,5 @@
52
53
  "devDependencies": {
53
54
  "@sbercloud/figma-tokens-cloud-platform": "17.7.6"
54
55
  },
55
- "gitHead": "e8bd79bc92b26a8f52611972eec98a867536ccd3"
56
+ "gitHead": "bf479ecf7238ef20b78f20acaef439efa535d1a1"
56
57
  }