@cloud-ru/uikit-product-error-pages 0.13.7 → 0.13.9

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 CHANGED
@@ -3,6 +3,27 @@
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.13.9 (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-utils@7.0.2](https://gitverse.ru/cloud-ru-tech/uikit-product/-/blob/master/packages/utils/CHANGELOG.md)
11
+
12
+
13
+
14
+
15
+
16
+ ## 0.13.8 (2025-11-12)
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * **PD-3377:** contributors update to publish all packages ([719fd3e](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/719fd3e1249e247443b125c47ea408d92c8395c3))
22
+
23
+
24
+
25
+
26
+
6
27
  ## 0.13.7 (2025-11-12)
7
28
 
8
29
  ### Only dependencies have been changed
@@ -0,0 +1,15 @@
1
+ import { WithSupportProps } from '@sbercloud/uikit-product-utils';
2
+ import { ErrorType, LogoVariant } from './constants';
3
+ export type ErrorPageProps = WithSupportProps<{
4
+ className?: string;
5
+ mainPageUrl?: string;
6
+ onSupportCenterClick?(): void;
7
+ logoVariant?: LogoVariant;
8
+ errorType?: ErrorType;
9
+ showMainButton?: boolean;
10
+ }>;
11
+ export declare function ErrorPage({ className, mainPageUrl, onSupportCenterClick, logoVariant, errorType, showMainButton, ...rest }: ErrorPageProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare namespace ErrorPage {
13
+ var logoVariants: typeof LogoVariant;
14
+ var errorTypes: typeof ErrorType;
15
+ }
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ var __importDefault = (this && this.__importDefault) || function (mod) {
14
+ return (mod && mod.__esModule) ? mod : { "default": mod };
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.ErrorPage = ErrorPage;
18
+ const jsx_runtime_1 = require("react/jsx-runtime");
19
+ const classnames_1 = __importDefault(require("classnames"));
20
+ const react_1 = require("react");
21
+ const uikit_product_icons_1 = require("@sbercloud/uikit-product-icons");
22
+ const uikit_product_locale_1 = require("@sbercloud/uikit-product-locale");
23
+ const uikit_product_utils_1 = require("@sbercloud/uikit-product-utils");
24
+ const button_1 = require("@snack-uikit/button");
25
+ const link_1 = require("@snack-uikit/link");
26
+ const tag_1 = require("@snack-uikit/tag");
27
+ const utils_1 = require("@snack-uikit/utils");
28
+ const constants_1 = require("./constants");
29
+ const hooks_1 = require("./hooks");
30
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
31
+ function ErrorPage(_a) {
32
+ var { className, mainPageUrl = '/', onSupportCenterClick, logoVariant = constants_1.LogoVariant.None, errorType = constants_1.ErrorType.FrontendError, showMainButton = true } = _a, rest = __rest(_a, ["className", "mainPageUrl", "onSupportCenterClick", "logoVariant", "errorType", "showMainButton"]);
33
+ const { t } = (0, uikit_product_locale_1.useLocale)('ErrorPage');
34
+ const content = (0, hooks_1.useGetContentByErrorType)(errorType);
35
+ const button = (0, hooks_1.useGetButtonPropsByErrorType)(errorType, mainPageUrl);
36
+ const hasMainPageLink = [constants_1.ErrorType.FrontendError].includes(errorType);
37
+ const hasBackLink = [constants_1.ErrorType.FrontendError, constants_1.ErrorType.PageUnavailable].includes(errorType);
38
+ const logo = (0, react_1.useMemo)(() => {
39
+ switch (logoVariant) {
40
+ case constants_1.LogoVariant.MLSpace:
41
+ return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.logo, children: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.MlSpaceFullLogoSVG, {}) }));
42
+ case constants_1.LogoVariant.Cloud:
43
+ return ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.logo, children: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.CloudFullLogoSVG, {}) }));
44
+ case constants_1.LogoVariant.None:
45
+ default:
46
+ return null;
47
+ }
48
+ }, [logoVariant]);
49
+ return ((0, jsx_runtime_1.jsxs)("div", Object.assign({ className: (0, classnames_1.default)(styles_module_scss_1.default.wrapper, className) }, (0, uikit_product_utils_1.extractSupportProps)(rest), { children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.leftSide, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.textContainer, children: [logo, (0, jsx_runtime_1.jsxs)("h1", { className: styles_module_scss_1.default.title, "data-user": true, children: [content.title, content.statusCode && ((0, jsx_runtime_1.jsx)(tag_1.Tag, { className: styles_module_scss_1.default.statusCode, appearance: 'neutral', size: 's', label: String(content.statusCode) }))] }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.actionWrapper, children: [(0, jsx_runtime_1.jsx)("span", { className: styles_module_scss_1.default.actionsTitle, children: content.text }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.actionsLink, children: [hasMainPageLink && (0, jsx_runtime_1.jsx)(link_1.Link, { size: 'm', href: mainPageUrl, target: '_self', text: t('mainPageLink') }), hasBackLink && ((0, jsx_runtime_1.jsx)(link_1.Link, { size: 'm', onClick: () => (0, utils_1.isBrowser)() && window.history.back(), target: '_self', text: t('backLink') }))] })] })] }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.buttonContainer, children: [onSupportCenterClick && ((0, jsx_runtime_1.jsx)(button_1.ButtonOutline, { size: 'm', className: styles_module_scss_1.default.button, label: t('supportCenterButton'), onClick: onSupportCenterClick, icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.MailInterfaceSVG, {}) })), showMainButton && ((0, jsx_runtime_1.jsx)(button_1.ButtonFilled, { size: 'm', className: styles_module_scss_1.default.button, label: button.text, href: button.href, target: button.href && '_self', onClick: button.onClick, icon: button.icon }))] })] }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.rightSide, children: (0, jsx_runtime_1.jsxs)("svg", { className: styles_module_scss_1.default.pic, viewBox: '0 0 863 520', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', children: [(0, jsx_runtime_1.jsx)("path", { d: 'M721.711 93H94.2882C86.397 93 80 99.8168 80 108.226V446.774C80 455.183 86.397 462 94.2882 462H721.711C729.602 462 735.999 455.183 735.999 446.774V108.226C735.999 99.8168 729.602 93 721.711 93Z', fill: `var(${constants_1.COLORS.svgBackground})`, stroke: `var(${constants_1.COLORS.svgStroke})`, strokeWidth: '2', strokeMiterlimit: '10' }), (0, jsx_runtime_1.jsx)("path", { d: 'M735.999 165H81.7061', stroke: `var(${constants_1.COLORS.svgStroke})`, strokeWidth: '2', strokeMiterlimit: '10' }), (0, jsx_runtime_1.jsx)("path", { d: 'M126.81 129C126.81 135.079 121.902 140 115.857 140C109.812 140 104.905 135.079 104.905 129C104.905 122.921 109.812 118 115.857 118C121.902 118 126.81 122.921 126.81 129Z', stroke: `var(${constants_1.COLORS.svgStroke})`, strokeWidth: '2' }), (0, jsx_runtime_1.jsx)("path", { d: 'M158.681 129C158.681 135.079 153.773 140 147.729 140C141.684 140 136.776 135.079 136.776 129C136.776 122.921 141.684 118 147.729 118C153.773 118 158.681 122.921 158.681 129Z', stroke: `var(${constants_1.COLORS.svgStroke})`, strokeWidth: '2' }), (0, jsx_runtime_1.jsx)("path", { d: 'M190.557 129C190.557 135.079 185.649 140 179.605 140C173.56 140 168.652 135.079 168.652 129C168.652 122.921 173.56 118 179.605 118C185.649 118 190.557 122.921 190.557 129Z', stroke: `var(${constants_1.COLORS.svgStroke})`, strokeWidth: '2' }), (0, jsx_runtime_1.jsx)("path", { d: 'M22.0427 284.986L116.584 256.508C116.925 256.415 117.286 256.426 117.621 256.539C117.957 256.652 118.251 256.863 118.468 257.144C118.685 257.425 118.814 257.765 118.839 258.12C118.864 258.476 118.785 258.83 118.61 259.14L67.8006 344.25C67.6327 344.526 67.3933 344.75 67.108 344.899C66.8227 345.047 66.5024 345.115 66.1819 345.093C65.8613 345.072 65.5527 344.963 65.2893 344.778C65.0259 344.593 64.8177 344.338 64.6874 344.043L54.9955 322.218C54.8828 321.975 54.7176 321.759 54.5117 321.588C54.3059 321.417 54.0646 321.294 53.8056 321.229C53.5466 321.164 53.2765 321.158 53.0148 321.211C52.7532 321.265 52.5067 321.376 52.2934 321.538L16.6093 349.484C16.2343 349.771 15.7621 349.898 15.2948 349.837C14.8276 349.777 14.4029 349.533 14.1129 349.159L9.14941 342.742L4.36224 336.531C4.07866 336.159 3.95338 335.688 4.01394 335.222C4.0745 334.757 4.3159 334.334 4.68526 334.047L40.3693 306.101C40.6056 305.935 40.7986 305.714 40.9319 305.456C41.0651 305.199 41.1347 304.913 41.1347 304.623C41.1347 304.332 41.0651 304.046 40.9319 303.789C40.7986 303.532 40.6056 303.31 40.3693 303.144L21.426 287.914C21.2068 287.709 21.0442 287.45 20.9539 287.163C20.8636 286.875 20.8488 286.569 20.9109 286.274C20.973 285.98 21.11 285.706 21.3083 285.48C21.5067 285.255 21.7597 285.084 22.0427 284.986Z', fill: `var(${constants_1.COLORS.svgBackground})`, stroke: `var(${constants_1.COLORS.svgStroke})`, strokeWidth: '2', strokeLinecap: 'round' }), (0, jsx_runtime_1.jsx)("path", { d: 'M148.586 311.289L124.086 283.727', stroke: `var(${constants_1.COLORS.svgStroke})`, strokeWidth: '2', strokeLinecap: 'round' }), (0, jsx_runtime_1.jsx)("path", { d: 'M159.336 300.565L130.242 279.127', stroke: `var(${constants_1.COLORS.svgStroke})`, strokeWidth: '2', strokeLinecap: 'round' }), (0, jsx_runtime_1.jsx)("path", { d: 'M166.969 286.789L133.281 273.008', stroke: `var(${constants_1.COLORS.svgStroke})`, strokeWidth: '2', strokeLinecap: 'round' }), (0, jsx_runtime_1.jsx)("path", { d: 'M390.619 52.8901L157.466 483.672C155.767 486.812 154.919 490.334 155.006 493.894C155.093 497.454 156.112 500.932 157.964 503.987C159.815 507.041 162.436 509.57 165.57 511.325C168.704 513.08 172.245 514.001 175.847 514H642.153C645.755 514.001 649.296 513.08 652.43 511.325C655.564 509.57 658.185 507.041 660.036 503.987C661.888 500.932 662.907 497.454 662.994 493.894C663.081 490.334 662.233 486.812 660.534 483.672L427.41 52.8901C425.627 49.5993 422.974 46.8484 419.735 44.9306C416.495 43.0129 412.79 42 409.015 42C405.239 42 401.534 43.0129 398.294 44.9306C395.055 46.8484 392.402 49.5993 390.619 52.8901Z', fill: `var(${constants_1.COLORS.svgBackground})`, stroke: `var(${constants_1.COLORS.svgStroke})`, strokeWidth: '2', strokeLinecap: 'round' }), (0, jsx_runtime_1.jsx)("path", { d: 'M408.107 376C405.042 375.986 402.075 374.935 399.7 373.022C397.324 371.109 395.683 368.449 395.05 365.485L368.005 235.997C366.644 229.996 366.665 223.77 368.067 217.779C369.469 211.787 372.215 206.184 376.104 201.384C379.992 196.583 384.922 192.708 390.53 190.045C396.137 187.383 402.279 186 408.5 186C414.721 186 420.863 187.383 426.47 190.045C432.078 192.708 437.008 196.583 440.896 201.384C444.785 206.184 447.531 211.787 448.933 217.779C450.335 223.77 450.356 229.996 448.995 235.997L422.095 364.708C421.422 367.887 419.666 370.743 417.12 372.798C414.575 374.853 411.393 375.983 408.107 376Z', fill: `var(${constants_1.COLORS.svgExclamationMark})` }), (0, jsx_runtime_1.jsx)("path", { d: 'M408 454C402.66 454 397.44 452.416 393 449.45C388.559 446.483 385.099 442.266 383.055 437.332C381.012 432.399 380.477 426.97 381.519 421.733C382.561 416.495 385.132 411.684 388.908 407.908C392.684 404.132 397.495 401.561 402.733 400.519C407.97 399.477 413.399 400.012 418.332 402.055C423.266 404.099 427.483 407.559 430.45 412C433.416 416.44 435 421.66 435 427C434.992 434.158 432.145 441.021 427.083 446.083C422.021 451.145 415.158 453.992 408 454Z', fill: `var(${constants_1.COLORS.svgExclamationMark})` }), (0, jsx_runtime_1.jsx)("path", { fillRule: 'evenodd', clipRule: 'evenodd', d: 'M758.622 69.709C758.622 65.2907 762.204 61.709 766.622 61.709H777.378C781.796 61.709 785.378 65.2907 785.378 69.709V75.6192C785.378 79.4239 788.076 82.6524 791.712 83.7722C795.74 85.0126 799.606 86.623 803.269 88.5639C806.631 90.3449 810.821 89.9691 813.511 87.279L817.695 83.0952C820.819 79.971 825.884 79.971 829.009 83.0952L836.614 90.7003C839.738 93.8245 839.738 98.8899 836.614 102.014L832.43 106.198C829.74 108.888 829.364 113.078 831.145 116.44C833.086 120.103 834.697 123.969 835.937 127.997C837.057 131.633 840.285 134.331 844.09 134.331H850C854.418 134.331 858 137.913 858 142.331V153.087C858 157.505 854.418 161.087 850 161.087H844.09C840.285 161.087 837.057 163.785 835.937 167.421C834.697 171.449 833.086 175.315 831.145 178.978C829.364 182.34 829.74 186.53 832.43 189.22L836.614 193.404C839.738 196.528 839.738 201.593 836.614 204.718L829.009 212.323C825.884 215.447 820.819 215.447 817.695 212.323L813.511 208.139C810.821 205.449 806.631 205.073 803.269 206.854C799.606 208.795 795.74 210.405 791.712 211.646C788.076 212.766 785.378 215.994 785.378 219.799V225.709C785.378 230.127 781.796 233.709 777.378 233.709H766.622C762.204 233.709 758.622 230.127 758.622 225.709V219.799C758.622 215.994 755.924 212.766 752.288 211.646C748.26 210.405 744.395 208.795 740.731 206.854C737.369 205.073 733.179 205.449 730.489 208.139L726.305 212.323C723.181 215.447 718.116 215.447 714.992 212.323L707.386 204.718C704.262 201.593 704.262 196.528 707.386 193.404L711.57 189.22C714.26 186.53 714.636 182.34 712.855 178.978C710.914 175.315 709.303 171.449 708.063 167.421C706.943 163.785 703.715 161.087 699.91 161.087H694C689.582 161.087 686 157.505 686 153.087V142.331C686 137.913 689.582 134.331 694 134.331H699.91C703.715 134.331 706.943 131.633 708.063 127.997C709.303 123.969 710.914 120.103 712.855 116.44C714.636 113.078 714.26 108.888 711.57 106.198L707.386 102.014C704.262 98.8899 704.262 93.8246 707.386 90.7004L714.992 83.0952C718.116 79.971 723.181 79.971 726.305 83.0952L730.489 87.279C733.179 89.9691 737.369 90.3449 740.731 88.5639C744.395 86.623 748.26 85.0126 752.288 83.7722C755.924 82.6524 758.622 79.4239 758.622 75.6192V69.709ZM772 181.153C753.529 181.153 738.556 166.18 738.556 147.709C738.556 129.238 753.529 114.265 772 114.265C790.471 114.265 805.444 129.238 805.444 147.709C805.444 166.18 790.471 181.153 772 181.153Z', fill: `var(${constants_1.COLORS.svgBackground})`, stroke: `var(${constants_1.COLORS.svgStroke})`, strokeWidth: '2', strokeMiterlimit: '10', className: styles_module_scss_1.default.rotateSmall }), (0, jsx_runtime_1.jsx)("path", { fillRule: 'evenodd', clipRule: 'evenodd', d: 'M646 8C646 5.79102 647.791 4 650 4H662C664.209 4 666 5.79102 666 8V14.4608C666 18.2656 668.708 21.4784 672.304 22.7186C674.226 23.3813 676.095 24.1579 677.903 25.0403C681.322 26.7089 685.507 26.3511 688.197 23.6611L692.77 19.0889C694.332 17.5264 696.864 17.5264 698.427 19.0889L706.912 27.5732C708.474 29.1357 708.474 31.6689 706.912 33.2305L702.34 37.8025C699.649 40.4926 699.292 44.6783 700.96 48.0973C701.842 49.9049 702.619 51.7737 703.281 53.6955C704.521 57.2925 707.734 60 711.539 60H718C720.209 60 722 61.791 722 64V76C722 78.209 720.209 80 718 80H711.539C707.734 80 704.521 82.7075 703.281 86.3045C702.619 88.2261 701.842 90.0947 700.96 91.9021C699.292 95.3209 699.649 99.5063 702.339 102.196L706.912 106.77C708.474 108.331 708.474 110.864 706.912 112.426L698.427 120.911C696.864 122.474 694.332 122.474 692.77 120.911L688.198 116.339C685.508 113.649 681.322 113.292 677.903 114.96C676.095 115.843 674.226 116.619 672.305 117.282C668.708 118.522 666 121.734 666 125.539V132C666 134.209 664.209 136 662 136H650C647.791 136 646 134.209 646 132V125.539C646 121.734 643.292 118.522 639.696 117.281C637.774 116.619 635.905 115.842 634.097 114.96C630.679 113.291 626.493 113.649 623.803 116.339L619.23 120.912C617.668 122.474 615.136 122.474 613.574 120.912L605.088 112.427C603.526 110.864 603.526 108.332 605.088 106.77L609.661 102.197C612.351 99.5074 612.709 95.3217 611.04 91.9027C610.158 90.0951 609.381 88.2263 608.719 86.3045C607.479 82.7075 604.266 80 600.461 80H594C591.791 80 590 78.209 590 76V64C590 61.791 591.791 60 594 60H600.461C604.266 60 607.479 57.2925 608.719 53.6955C609.381 51.7737 610.158 49.9049 611.04 48.0973C612.709 44.6783 612.351 40.4926 609.661 37.8025L605.088 33.2305C603.526 31.668 603.526 29.1357 605.088 27.5732L613.574 19.0879C615.136 17.5264 617.668 17.5264 619.23 19.0879L623.803 23.6605C626.493 26.3503 630.679 26.708 634.098 25.0396C635.905 24.1574 637.774 23.381 639.696 22.7185C643.292 21.4784 646 18.2656 646 14.4609V8ZM656 95C642.193 95 631 83.8066 631 70C631 56.1934 642.193 45 656 45C669.807 45 681 56.1934 681 70C681 83.8066 669.807 95 656 95Z', fill: `var(${constants_1.COLORS.svgBackground})`, stroke: `var(${constants_1.COLORS.svgStroke})`, strokeWidth: '2', strokeMiterlimit: '10', className: styles_module_scss_1.default.rotateBig })] }) })] })));
50
+ }
51
+ ErrorPage.logoVariants = constants_1.LogoVariant;
52
+ ErrorPage.errorTypes = constants_1.ErrorType;
@@ -0,0 +1,17 @@
1
+ export declare enum LogoVariant {
2
+ MLSpace = "MLSpace",
3
+ Cloud = "Cloud",
4
+ None = "None"
5
+ }
6
+ export declare enum ErrorType {
7
+ FrontendError = "FrontendError",
8
+ PageUnavailable = "PageUnavailable",
9
+ PageNotFound = "PageNotFound",
10
+ Offline = "Offline",
11
+ Redirect = "Redirect"
12
+ }
13
+ export declare const COLORS: {
14
+ svgExclamationMark: string;
15
+ svgStroke: string;
16
+ svgBackground: string;
17
+ };
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.COLORS = exports.ErrorType = exports.LogoVariant = void 0;
4
+ var LogoVariant;
5
+ (function (LogoVariant) {
6
+ LogoVariant["MLSpace"] = "MLSpace";
7
+ LogoVariant["Cloud"] = "Cloud";
8
+ LogoVariant["None"] = "None";
9
+ })(LogoVariant || (exports.LogoVariant = LogoVariant = {}));
10
+ var ErrorType;
11
+ (function (ErrorType) {
12
+ ErrorType["FrontendError"] = "FrontendError";
13
+ ErrorType["PageUnavailable"] = "PageUnavailable";
14
+ ErrorType["PageNotFound"] = "PageNotFound";
15
+ ErrorType["Offline"] = "Offline";
16
+ ErrorType["Redirect"] = "Redirect";
17
+ })(ErrorType || (exports.ErrorType = ErrorType = {}));
18
+ exports.COLORS = {
19
+ svgExclamationMark: '--svgExclamationMark',
20
+ svgStroke: '--svgStroke',
21
+ svgBackground: '--svgBackground',
22
+ };
@@ -0,0 +1,26 @@
1
+ import { ErrorType } from './constants';
2
+ export declare function useGetContentByErrorType(errorType: ErrorType): {
3
+ title: string;
4
+ text: string;
5
+ statusCode: number;
6
+ } | {
7
+ title: string;
8
+ text: string;
9
+ statusCode?: undefined;
10
+ };
11
+ export declare function useGetButtonPropsByErrorType(errorType: ErrorType, mainPageUrl?: string): {
12
+ text: string;
13
+ icon: import("react/jsx-runtime").JSX.Element;
14
+ href: string | undefined;
15
+ onClick?: undefined;
16
+ } | {
17
+ text: string;
18
+ href: string | undefined;
19
+ icon?: undefined;
20
+ onClick?: undefined;
21
+ } | {
22
+ text: string;
23
+ icon: import("react/jsx-runtime").JSX.Element;
24
+ onClick: () => false | void;
25
+ href?: undefined;
26
+ };
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.useGetContentByErrorType = useGetContentByErrorType;
4
+ exports.useGetButtonPropsByErrorType = useGetButtonPropsByErrorType;
5
+ const jsx_runtime_1 = require("react/jsx-runtime");
6
+ const react_1 = require("react");
7
+ const uikit_product_icons_1 = require("@sbercloud/uikit-product-icons");
8
+ const uikit_product_locale_1 = require("@sbercloud/uikit-product-locale");
9
+ const utils_1 = require("@snack-uikit/utils");
10
+ const constants_1 = require("./constants");
11
+ function useGetContentByErrorType(errorType) {
12
+ const { t } = (0, uikit_product_locale_1.useLocale)('ErrorPage');
13
+ return (0, react_1.useMemo)(() => {
14
+ switch (errorType) {
15
+ case constants_1.ErrorType.PageUnavailable:
16
+ return {
17
+ title: t('pageUnavailableTitle'),
18
+ text: t('actionRedirectTitle'),
19
+ statusCode: 403,
20
+ };
21
+ case constants_1.ErrorType.PageNotFound:
22
+ return {
23
+ title: t('pageNotFoundTitle'),
24
+ text: t('actionRedirectTitle'),
25
+ statusCode: 404,
26
+ };
27
+ case constants_1.ErrorType.Offline:
28
+ return {
29
+ title: t('offlineTitle'),
30
+ text: t('offlineText'),
31
+ };
32
+ case constants_1.ErrorType.Redirect:
33
+ return {
34
+ title: t('redirectTitle'),
35
+ text: t('redirectText'),
36
+ };
37
+ case constants_1.ErrorType.FrontendError:
38
+ default:
39
+ return {
40
+ title: t('frontendErrorTitle'),
41
+ text: t('actionRedirectTitle'),
42
+ };
43
+ }
44
+ }, [errorType, t]);
45
+ }
46
+ function useGetButtonPropsByErrorType(errorType, mainPageUrl) {
47
+ const { t } = (0, uikit_product_locale_1.useLocale)('ErrorPage');
48
+ return (0, react_1.useMemo)(() => {
49
+ switch (errorType) {
50
+ case constants_1.ErrorType.PageNotFound:
51
+ case constants_1.ErrorType.PageUnavailable:
52
+ return {
53
+ text: t('mainPageLink'),
54
+ icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.HomeOutlineInterfaceSVG, {}),
55
+ href: mainPageUrl,
56
+ };
57
+ case constants_1.ErrorType.Redirect:
58
+ return {
59
+ text: t('redirectButton'),
60
+ href: mainPageUrl,
61
+ };
62
+ default:
63
+ return {
64
+ text: t('refreshButton'),
65
+ icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.RefreshInterfaceSVG, {}),
66
+ onClick: () => (0, utils_1.isBrowser)() && window.location.reload(),
67
+ };
68
+ }
69
+ }, [errorType, mainPageUrl, t]);
70
+ }
@@ -0,0 +1 @@
1
+ export * from './ErrorPage';
@@ -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("./ErrorPage"), exports);
@@ -0,0 +1,180 @@
1
+ .wrapper{
2
+ --svgExclamationMark:var(--sys-primary-accent-default, #389f74);
3
+ --svgStroke:var(--sys-neutral-decor-activated, #b6bac7);
4
+ --svgBackground:var(--sys-neutral-background1-level, #fdfdfd);
5
+ height:100%;
6
+ border-radius:var(--dimension-1m, 8px);
7
+ box-sizing:border-box;
8
+ padding:var(--dimension-6m, 48px);
9
+ gap:var(--dimension-6m, 48px);
10
+ display:flex;
11
+ flex-direction:column;
12
+ justify-content:space-between;
13
+ background-color:var(--sys-neutral-background1-level, #fdfdfd);
14
+ }
15
+ @media (max-width: 767px){
16
+ .wrapper{
17
+ padding:var(--dimension-3m, 24px);
18
+ gap:var(--dimension-3m, 24px);
19
+ }
20
+ }
21
+
22
+ .statusCode{
23
+ vertical-align:top;
24
+ margin-left:var(--dimension-1m, 8px);
25
+ }
26
+
27
+ .leftSide{
28
+ display:flex;
29
+ flex-direction:column;
30
+ gap:var(--dimension-3m, 24px);
31
+ }
32
+ @media (max-width: 767px){
33
+ .leftSide{
34
+ height:100%;
35
+ justify-content:space-between;
36
+ }
37
+ }
38
+
39
+ .textContainer{
40
+ display:flex;
41
+ flex-direction:column;
42
+ gap:var(--dimension-3m, 24px);
43
+ }
44
+
45
+ .logo{
46
+ height:var(--dimension-3m, 24px);
47
+ margin-bottom:var(--dimension-3m, 24px);
48
+ display:inline-flex;
49
+ }
50
+ .logo svg{
51
+ height:100%;
52
+ }
53
+
54
+ .actionsLink{
55
+ display:flex;
56
+ flex-direction:row;
57
+ gap:var(--dimension-2m, 16px);
58
+ }
59
+
60
+ .buttonContainer{
61
+ display:flex;
62
+ flex-direction:row;
63
+ gap:var(--dimension-1m, 8px);
64
+ }
65
+ .buttonContainer * > path{
66
+ fill:currentColor;
67
+ }
68
+ @media (max-width: 767px){
69
+ .buttonContainer{
70
+ flex-direction:column;
71
+ }
72
+ }
73
+
74
+ .rightSide{
75
+ align-self:flex-end;
76
+ justify-self:center;
77
+ width:50%;
78
+ min-width:500px;
79
+ max-width:862px;
80
+ min-height:0;
81
+ display:flex;
82
+ flex-direction:column;
83
+ justify-content:flex-end;
84
+ align-items:flex-end;
85
+ }
86
+ @media (max-width: 1023px){
87
+ .rightSide{
88
+ justify-content:flex-start;
89
+ align-items:center;
90
+ min-width:0;
91
+ max-width:none;
92
+ width:100%;
93
+ }
94
+ }
95
+ @media (max-width: 767px){
96
+ .rightSide{
97
+ display:none;
98
+ }
99
+ }
100
+
101
+ @keyframes rotating{
102
+ from{
103
+ transform:rotate(0deg);
104
+ }
105
+ to{
106
+ transform:rotate(-360deg);
107
+ }
108
+ }
109
+ .rotateSmall{
110
+ transform-origin:center;
111
+ transform-box:fill-box;
112
+ animation:rotating 10s linear infinite;
113
+ }
114
+
115
+ .rotateBig{
116
+ transform-origin:center;
117
+ transform-box:fill-box;
118
+ animation:rotating 10s linear infinite;
119
+ animation-direction:reverse;
120
+ }
121
+
122
+ @media (max-width: 767px){
123
+ .button{
124
+ width:100%;
125
+ }
126
+ }
127
+
128
+ .pic{
129
+ max-width:863px;
130
+ max-height:520px;
131
+ }
132
+ @media (max-width: 1023px){
133
+ .pic{
134
+ max-height:100%;
135
+ max-width:100%;
136
+ }
137
+ }
138
+
139
+ .title{
140
+ font-family:var(--sans-display-s-font-family, SB Sans Interface);
141
+ font-weight:var(--sans-display-s-font-weight, Semibold);
142
+ line-height:var(--sans-display-s-line-height, 48px);
143
+ font-size:var(--sans-display-s-font-size, 40px);
144
+ letter-spacing:var(--sans-display-s-letter-spacing, -0.5px);
145
+ paragraph-spacing:var(--sans-display-s-paragraph-spacing, 22px);
146
+ box-sizing:border-box;
147
+ max-width:100%;
148
+ margin:0;
149
+ padding:0;
150
+ overflow-wrap:break-word;
151
+ }
152
+ @media (max-width: 767px){
153
+ .title{
154
+ font-family:var(--sans-headline-m-font-family, SB Sans Interface);
155
+ font-weight:var(--sans-headline-m-font-weight, Semibold);
156
+ line-height:var(--sans-headline-m-line-height, 36px);
157
+ font-size:var(--sans-headline-m-font-size, 28px);
158
+ letter-spacing:var(--sans-headline-m-letter-spacing, -0.5px);
159
+ paragraph-spacing:var(--sans-headline-m-paragraph-spacing, 15.4px);
160
+ }
161
+ }
162
+
163
+ .actionsTitle{
164
+ font-family:var(--sans-body-l-font-family, SB Sans Interface);
165
+ font-weight:var(--sans-body-l-font-weight, Regular);
166
+ line-height:var(--sans-body-l-line-height, 24px);
167
+ font-size:var(--sans-body-l-font-size, 16px);
168
+ letter-spacing:var(--sans-body-l-letter-spacing, 0.1px);
169
+ paragraph-spacing:var(--sans-body-l-paragraph-spacing, 8.8px);
170
+ }
171
+ @media (max-width: 767px){
172
+ .actionsTitle{
173
+ font-family:var(--sans-body-m-font-family, SB Sans Interface);
174
+ font-weight:var(--sans-body-m-font-weight, Regular);
175
+ line-height:var(--sans-body-m-line-height, 20px);
176
+ font-size:var(--sans-body-m-font-size, 14px);
177
+ letter-spacing:var(--sans-body-m-letter-spacing, 0.1px);
178
+ paragraph-spacing:var(--sans-body-m-paragraph-spacing, 7.7px);
179
+ }
180
+ }
@@ -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,15 @@
1
+ import { WithSupportProps } from '@sbercloud/uikit-product-utils';
2
+ import { ErrorType, LogoVariant } from './constants';
3
+ export type ErrorPageProps = WithSupportProps<{
4
+ className?: string;
5
+ mainPageUrl?: string;
6
+ onSupportCenterClick?(): void;
7
+ logoVariant?: LogoVariant;
8
+ errorType?: ErrorType;
9
+ showMainButton?: boolean;
10
+ }>;
11
+ export declare function ErrorPage({ className, mainPageUrl, onSupportCenterClick, logoVariant, errorType, showMainButton, ...rest }: ErrorPageProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare namespace ErrorPage {
13
+ var logoVariants: typeof LogoVariant;
14
+ var errorTypes: typeof ErrorType;
15
+ }
@@ -0,0 +1,46 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ import cn from 'classnames';
14
+ import { useMemo } from 'react';
15
+ import { CloudFullLogoSVG, MailInterfaceSVG, MlSpaceFullLogoSVG } from '@sbercloud/uikit-product-icons';
16
+ import { useLocale } from '@sbercloud/uikit-product-locale';
17
+ import { extractSupportProps } from '@sbercloud/uikit-product-utils';
18
+ import { ButtonFilled, ButtonOutline } from '@snack-uikit/button';
19
+ import { Link } from '@snack-uikit/link';
20
+ import { Tag } from '@snack-uikit/tag';
21
+ import { isBrowser } from '@snack-uikit/utils';
22
+ import { COLORS, ErrorType, LogoVariant } from './constants';
23
+ import { useGetButtonPropsByErrorType, useGetContentByErrorType } from './hooks';
24
+ import styles from './styles.module.css';
25
+ export function ErrorPage(_a) {
26
+ var { className, mainPageUrl = '/', onSupportCenterClick, logoVariant = LogoVariant.None, errorType = ErrorType.FrontendError, showMainButton = true } = _a, rest = __rest(_a, ["className", "mainPageUrl", "onSupportCenterClick", "logoVariant", "errorType", "showMainButton"]);
27
+ const { t } = useLocale('ErrorPage');
28
+ const content = useGetContentByErrorType(errorType);
29
+ const button = useGetButtonPropsByErrorType(errorType, mainPageUrl);
30
+ const hasMainPageLink = [ErrorType.FrontendError].includes(errorType);
31
+ const hasBackLink = [ErrorType.FrontendError, ErrorType.PageUnavailable].includes(errorType);
32
+ const logo = useMemo(() => {
33
+ switch (logoVariant) {
34
+ case LogoVariant.MLSpace:
35
+ return (_jsx("div", { className: styles.logo, children: _jsx(MlSpaceFullLogoSVG, {}) }));
36
+ case LogoVariant.Cloud:
37
+ return (_jsx("div", { className: styles.logo, children: _jsx(CloudFullLogoSVG, {}) }));
38
+ case LogoVariant.None:
39
+ default:
40
+ return null;
41
+ }
42
+ }, [logoVariant]);
43
+ return (_jsxs("div", Object.assign({ className: cn(styles.wrapper, className) }, extractSupportProps(rest), { children: [_jsxs("div", { className: styles.leftSide, children: [_jsxs("div", { className: styles.textContainer, children: [logo, _jsxs("h1", { className: styles.title, "data-user": true, children: [content.title, content.statusCode && (_jsx(Tag, { className: styles.statusCode, appearance: 'neutral', size: 's', label: String(content.statusCode) }))] }), _jsxs("div", { className: styles.actionWrapper, children: [_jsx("span", { className: styles.actionsTitle, children: content.text }), _jsxs("div", { className: styles.actionsLink, children: [hasMainPageLink && _jsx(Link, { size: 'm', href: mainPageUrl, target: '_self', text: t('mainPageLink') }), hasBackLink && (_jsx(Link, { size: 'm', onClick: () => isBrowser() && window.history.back(), target: '_self', text: t('backLink') }))] })] })] }), _jsxs("div", { className: styles.buttonContainer, children: [onSupportCenterClick && (_jsx(ButtonOutline, { size: 'm', className: styles.button, label: t('supportCenterButton'), onClick: onSupportCenterClick, icon: _jsx(MailInterfaceSVG, {}) })), showMainButton && (_jsx(ButtonFilled, { size: 'm', className: styles.button, label: button.text, href: button.href, target: button.href && '_self', onClick: button.onClick, icon: button.icon }))] })] }), _jsx("div", { className: styles.rightSide, children: _jsxs("svg", { className: styles.pic, viewBox: '0 0 863 520', fill: 'none', xmlns: 'http://www.w3.org/2000/svg', children: [_jsx("path", { d: 'M721.711 93H94.2882C86.397 93 80 99.8168 80 108.226V446.774C80 455.183 86.397 462 94.2882 462H721.711C729.602 462 735.999 455.183 735.999 446.774V108.226C735.999 99.8168 729.602 93 721.711 93Z', fill: `var(${COLORS.svgBackground})`, stroke: `var(${COLORS.svgStroke})`, strokeWidth: '2', strokeMiterlimit: '10' }), _jsx("path", { d: 'M735.999 165H81.7061', stroke: `var(${COLORS.svgStroke})`, strokeWidth: '2', strokeMiterlimit: '10' }), _jsx("path", { d: 'M126.81 129C126.81 135.079 121.902 140 115.857 140C109.812 140 104.905 135.079 104.905 129C104.905 122.921 109.812 118 115.857 118C121.902 118 126.81 122.921 126.81 129Z', stroke: `var(${COLORS.svgStroke})`, strokeWidth: '2' }), _jsx("path", { d: 'M158.681 129C158.681 135.079 153.773 140 147.729 140C141.684 140 136.776 135.079 136.776 129C136.776 122.921 141.684 118 147.729 118C153.773 118 158.681 122.921 158.681 129Z', stroke: `var(${COLORS.svgStroke})`, strokeWidth: '2' }), _jsx("path", { d: 'M190.557 129C190.557 135.079 185.649 140 179.605 140C173.56 140 168.652 135.079 168.652 129C168.652 122.921 173.56 118 179.605 118C185.649 118 190.557 122.921 190.557 129Z', stroke: `var(${COLORS.svgStroke})`, strokeWidth: '2' }), _jsx("path", { d: 'M22.0427 284.986L116.584 256.508C116.925 256.415 117.286 256.426 117.621 256.539C117.957 256.652 118.251 256.863 118.468 257.144C118.685 257.425 118.814 257.765 118.839 258.12C118.864 258.476 118.785 258.83 118.61 259.14L67.8006 344.25C67.6327 344.526 67.3933 344.75 67.108 344.899C66.8227 345.047 66.5024 345.115 66.1819 345.093C65.8613 345.072 65.5527 344.963 65.2893 344.778C65.0259 344.593 64.8177 344.338 64.6874 344.043L54.9955 322.218C54.8828 321.975 54.7176 321.759 54.5117 321.588C54.3059 321.417 54.0646 321.294 53.8056 321.229C53.5466 321.164 53.2765 321.158 53.0148 321.211C52.7532 321.265 52.5067 321.376 52.2934 321.538L16.6093 349.484C16.2343 349.771 15.7621 349.898 15.2948 349.837C14.8276 349.777 14.4029 349.533 14.1129 349.159L9.14941 342.742L4.36224 336.531C4.07866 336.159 3.95338 335.688 4.01394 335.222C4.0745 334.757 4.3159 334.334 4.68526 334.047L40.3693 306.101C40.6056 305.935 40.7986 305.714 40.9319 305.456C41.0651 305.199 41.1347 304.913 41.1347 304.623C41.1347 304.332 41.0651 304.046 40.9319 303.789C40.7986 303.532 40.6056 303.31 40.3693 303.144L21.426 287.914C21.2068 287.709 21.0442 287.45 20.9539 287.163C20.8636 286.875 20.8488 286.569 20.9109 286.274C20.973 285.98 21.11 285.706 21.3083 285.48C21.5067 285.255 21.7597 285.084 22.0427 284.986Z', fill: `var(${COLORS.svgBackground})`, stroke: `var(${COLORS.svgStroke})`, strokeWidth: '2', strokeLinecap: 'round' }), _jsx("path", { d: 'M148.586 311.289L124.086 283.727', stroke: `var(${COLORS.svgStroke})`, strokeWidth: '2', strokeLinecap: 'round' }), _jsx("path", { d: 'M159.336 300.565L130.242 279.127', stroke: `var(${COLORS.svgStroke})`, strokeWidth: '2', strokeLinecap: 'round' }), _jsx("path", { d: 'M166.969 286.789L133.281 273.008', stroke: `var(${COLORS.svgStroke})`, strokeWidth: '2', strokeLinecap: 'round' }), _jsx("path", { d: 'M390.619 52.8901L157.466 483.672C155.767 486.812 154.919 490.334 155.006 493.894C155.093 497.454 156.112 500.932 157.964 503.987C159.815 507.041 162.436 509.57 165.57 511.325C168.704 513.08 172.245 514.001 175.847 514H642.153C645.755 514.001 649.296 513.08 652.43 511.325C655.564 509.57 658.185 507.041 660.036 503.987C661.888 500.932 662.907 497.454 662.994 493.894C663.081 490.334 662.233 486.812 660.534 483.672L427.41 52.8901C425.627 49.5993 422.974 46.8484 419.735 44.9306C416.495 43.0129 412.79 42 409.015 42C405.239 42 401.534 43.0129 398.294 44.9306C395.055 46.8484 392.402 49.5993 390.619 52.8901Z', fill: `var(${COLORS.svgBackground})`, stroke: `var(${COLORS.svgStroke})`, strokeWidth: '2', strokeLinecap: 'round' }), _jsx("path", { d: 'M408.107 376C405.042 375.986 402.075 374.935 399.7 373.022C397.324 371.109 395.683 368.449 395.05 365.485L368.005 235.997C366.644 229.996 366.665 223.77 368.067 217.779C369.469 211.787 372.215 206.184 376.104 201.384C379.992 196.583 384.922 192.708 390.53 190.045C396.137 187.383 402.279 186 408.5 186C414.721 186 420.863 187.383 426.47 190.045C432.078 192.708 437.008 196.583 440.896 201.384C444.785 206.184 447.531 211.787 448.933 217.779C450.335 223.77 450.356 229.996 448.995 235.997L422.095 364.708C421.422 367.887 419.666 370.743 417.12 372.798C414.575 374.853 411.393 375.983 408.107 376Z', fill: `var(${COLORS.svgExclamationMark})` }), _jsx("path", { d: 'M408 454C402.66 454 397.44 452.416 393 449.45C388.559 446.483 385.099 442.266 383.055 437.332C381.012 432.399 380.477 426.97 381.519 421.733C382.561 416.495 385.132 411.684 388.908 407.908C392.684 404.132 397.495 401.561 402.733 400.519C407.97 399.477 413.399 400.012 418.332 402.055C423.266 404.099 427.483 407.559 430.45 412C433.416 416.44 435 421.66 435 427C434.992 434.158 432.145 441.021 427.083 446.083C422.021 451.145 415.158 453.992 408 454Z', fill: `var(${COLORS.svgExclamationMark})` }), _jsx("path", { fillRule: 'evenodd', clipRule: 'evenodd', d: 'M758.622 69.709C758.622 65.2907 762.204 61.709 766.622 61.709H777.378C781.796 61.709 785.378 65.2907 785.378 69.709V75.6192C785.378 79.4239 788.076 82.6524 791.712 83.7722C795.74 85.0126 799.606 86.623 803.269 88.5639C806.631 90.3449 810.821 89.9691 813.511 87.279L817.695 83.0952C820.819 79.971 825.884 79.971 829.009 83.0952L836.614 90.7003C839.738 93.8245 839.738 98.8899 836.614 102.014L832.43 106.198C829.74 108.888 829.364 113.078 831.145 116.44C833.086 120.103 834.697 123.969 835.937 127.997C837.057 131.633 840.285 134.331 844.09 134.331H850C854.418 134.331 858 137.913 858 142.331V153.087C858 157.505 854.418 161.087 850 161.087H844.09C840.285 161.087 837.057 163.785 835.937 167.421C834.697 171.449 833.086 175.315 831.145 178.978C829.364 182.34 829.74 186.53 832.43 189.22L836.614 193.404C839.738 196.528 839.738 201.593 836.614 204.718L829.009 212.323C825.884 215.447 820.819 215.447 817.695 212.323L813.511 208.139C810.821 205.449 806.631 205.073 803.269 206.854C799.606 208.795 795.74 210.405 791.712 211.646C788.076 212.766 785.378 215.994 785.378 219.799V225.709C785.378 230.127 781.796 233.709 777.378 233.709H766.622C762.204 233.709 758.622 230.127 758.622 225.709V219.799C758.622 215.994 755.924 212.766 752.288 211.646C748.26 210.405 744.395 208.795 740.731 206.854C737.369 205.073 733.179 205.449 730.489 208.139L726.305 212.323C723.181 215.447 718.116 215.447 714.992 212.323L707.386 204.718C704.262 201.593 704.262 196.528 707.386 193.404L711.57 189.22C714.26 186.53 714.636 182.34 712.855 178.978C710.914 175.315 709.303 171.449 708.063 167.421C706.943 163.785 703.715 161.087 699.91 161.087H694C689.582 161.087 686 157.505 686 153.087V142.331C686 137.913 689.582 134.331 694 134.331H699.91C703.715 134.331 706.943 131.633 708.063 127.997C709.303 123.969 710.914 120.103 712.855 116.44C714.636 113.078 714.26 108.888 711.57 106.198L707.386 102.014C704.262 98.8899 704.262 93.8246 707.386 90.7004L714.992 83.0952C718.116 79.971 723.181 79.971 726.305 83.0952L730.489 87.279C733.179 89.9691 737.369 90.3449 740.731 88.5639C744.395 86.623 748.26 85.0126 752.288 83.7722C755.924 82.6524 758.622 79.4239 758.622 75.6192V69.709ZM772 181.153C753.529 181.153 738.556 166.18 738.556 147.709C738.556 129.238 753.529 114.265 772 114.265C790.471 114.265 805.444 129.238 805.444 147.709C805.444 166.18 790.471 181.153 772 181.153Z', fill: `var(${COLORS.svgBackground})`, stroke: `var(${COLORS.svgStroke})`, strokeWidth: '2', strokeMiterlimit: '10', className: styles.rotateSmall }), _jsx("path", { fillRule: 'evenodd', clipRule: 'evenodd', d: 'M646 8C646 5.79102 647.791 4 650 4H662C664.209 4 666 5.79102 666 8V14.4608C666 18.2656 668.708 21.4784 672.304 22.7186C674.226 23.3813 676.095 24.1579 677.903 25.0403C681.322 26.7089 685.507 26.3511 688.197 23.6611L692.77 19.0889C694.332 17.5264 696.864 17.5264 698.427 19.0889L706.912 27.5732C708.474 29.1357 708.474 31.6689 706.912 33.2305L702.34 37.8025C699.649 40.4926 699.292 44.6783 700.96 48.0973C701.842 49.9049 702.619 51.7737 703.281 53.6955C704.521 57.2925 707.734 60 711.539 60H718C720.209 60 722 61.791 722 64V76C722 78.209 720.209 80 718 80H711.539C707.734 80 704.521 82.7075 703.281 86.3045C702.619 88.2261 701.842 90.0947 700.96 91.9021C699.292 95.3209 699.649 99.5063 702.339 102.196L706.912 106.77C708.474 108.331 708.474 110.864 706.912 112.426L698.427 120.911C696.864 122.474 694.332 122.474 692.77 120.911L688.198 116.339C685.508 113.649 681.322 113.292 677.903 114.96C676.095 115.843 674.226 116.619 672.305 117.282C668.708 118.522 666 121.734 666 125.539V132C666 134.209 664.209 136 662 136H650C647.791 136 646 134.209 646 132V125.539C646 121.734 643.292 118.522 639.696 117.281C637.774 116.619 635.905 115.842 634.097 114.96C630.679 113.291 626.493 113.649 623.803 116.339L619.23 120.912C617.668 122.474 615.136 122.474 613.574 120.912L605.088 112.427C603.526 110.864 603.526 108.332 605.088 106.77L609.661 102.197C612.351 99.5074 612.709 95.3217 611.04 91.9027C610.158 90.0951 609.381 88.2263 608.719 86.3045C607.479 82.7075 604.266 80 600.461 80H594C591.791 80 590 78.209 590 76V64C590 61.791 591.791 60 594 60H600.461C604.266 60 607.479 57.2925 608.719 53.6955C609.381 51.7737 610.158 49.9049 611.04 48.0973C612.709 44.6783 612.351 40.4926 609.661 37.8025L605.088 33.2305C603.526 31.668 603.526 29.1357 605.088 27.5732L613.574 19.0879C615.136 17.5264 617.668 17.5264 619.23 19.0879L623.803 23.6605C626.493 26.3503 630.679 26.708 634.098 25.0396C635.905 24.1574 637.774 23.381 639.696 22.7185C643.292 21.4784 646 18.2656 646 14.4609V8ZM656 95C642.193 95 631 83.8066 631 70C631 56.1934 642.193 45 656 45C669.807 45 681 56.1934 681 70C681 83.8066 669.807 95 656 95Z', fill: `var(${COLORS.svgBackground})`, stroke: `var(${COLORS.svgStroke})`, strokeWidth: '2', strokeMiterlimit: '10', className: styles.rotateBig })] }) })] })));
44
+ }
45
+ ErrorPage.logoVariants = LogoVariant;
46
+ ErrorPage.errorTypes = ErrorType;
@@ -0,0 +1,17 @@
1
+ export declare enum LogoVariant {
2
+ MLSpace = "MLSpace",
3
+ Cloud = "Cloud",
4
+ None = "None"
5
+ }
6
+ export declare enum ErrorType {
7
+ FrontendError = "FrontendError",
8
+ PageUnavailable = "PageUnavailable",
9
+ PageNotFound = "PageNotFound",
10
+ Offline = "Offline",
11
+ Redirect = "Redirect"
12
+ }
13
+ export declare const COLORS: {
14
+ svgExclamationMark: string;
15
+ svgStroke: string;
16
+ svgBackground: string;
17
+ };
@@ -0,0 +1,19 @@
1
+ export var LogoVariant;
2
+ (function (LogoVariant) {
3
+ LogoVariant["MLSpace"] = "MLSpace";
4
+ LogoVariant["Cloud"] = "Cloud";
5
+ LogoVariant["None"] = "None";
6
+ })(LogoVariant || (LogoVariant = {}));
7
+ export var ErrorType;
8
+ (function (ErrorType) {
9
+ ErrorType["FrontendError"] = "FrontendError";
10
+ ErrorType["PageUnavailable"] = "PageUnavailable";
11
+ ErrorType["PageNotFound"] = "PageNotFound";
12
+ ErrorType["Offline"] = "Offline";
13
+ ErrorType["Redirect"] = "Redirect";
14
+ })(ErrorType || (ErrorType = {}));
15
+ export const COLORS = {
16
+ svgExclamationMark: '--svgExclamationMark',
17
+ svgStroke: '--svgStroke',
18
+ svgBackground: '--svgBackground',
19
+ };
@@ -0,0 +1,26 @@
1
+ import { ErrorType } from './constants';
2
+ export declare function useGetContentByErrorType(errorType: ErrorType): {
3
+ title: string;
4
+ text: string;
5
+ statusCode: number;
6
+ } | {
7
+ title: string;
8
+ text: string;
9
+ statusCode?: undefined;
10
+ };
11
+ export declare function useGetButtonPropsByErrorType(errorType: ErrorType, mainPageUrl?: string): {
12
+ text: string;
13
+ icon: import("react/jsx-runtime").JSX.Element;
14
+ href: string | undefined;
15
+ onClick?: undefined;
16
+ } | {
17
+ text: string;
18
+ href: string | undefined;
19
+ icon?: undefined;
20
+ onClick?: undefined;
21
+ } | {
22
+ text: string;
23
+ icon: import("react/jsx-runtime").JSX.Element;
24
+ onClick: () => false | void;
25
+ href?: undefined;
26
+ };
@@ -0,0 +1,66 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { HomeOutlineInterfaceSVG, RefreshInterfaceSVG } from '@sbercloud/uikit-product-icons';
4
+ import { useLocale } from '@sbercloud/uikit-product-locale';
5
+ import { isBrowser } from '@snack-uikit/utils';
6
+ import { ErrorType } from './constants';
7
+ export function useGetContentByErrorType(errorType) {
8
+ const { t } = useLocale('ErrorPage');
9
+ return useMemo(() => {
10
+ switch (errorType) {
11
+ case ErrorType.PageUnavailable:
12
+ return {
13
+ title: t('pageUnavailableTitle'),
14
+ text: t('actionRedirectTitle'),
15
+ statusCode: 403,
16
+ };
17
+ case ErrorType.PageNotFound:
18
+ return {
19
+ title: t('pageNotFoundTitle'),
20
+ text: t('actionRedirectTitle'),
21
+ statusCode: 404,
22
+ };
23
+ case ErrorType.Offline:
24
+ return {
25
+ title: t('offlineTitle'),
26
+ text: t('offlineText'),
27
+ };
28
+ case ErrorType.Redirect:
29
+ return {
30
+ title: t('redirectTitle'),
31
+ text: t('redirectText'),
32
+ };
33
+ case ErrorType.FrontendError:
34
+ default:
35
+ return {
36
+ title: t('frontendErrorTitle'),
37
+ text: t('actionRedirectTitle'),
38
+ };
39
+ }
40
+ }, [errorType, t]);
41
+ }
42
+ export function useGetButtonPropsByErrorType(errorType, mainPageUrl) {
43
+ const { t } = useLocale('ErrorPage');
44
+ return useMemo(() => {
45
+ switch (errorType) {
46
+ case ErrorType.PageNotFound:
47
+ case ErrorType.PageUnavailable:
48
+ return {
49
+ text: t('mainPageLink'),
50
+ icon: _jsx(HomeOutlineInterfaceSVG, {}),
51
+ href: mainPageUrl,
52
+ };
53
+ case ErrorType.Redirect:
54
+ return {
55
+ text: t('redirectButton'),
56
+ href: mainPageUrl,
57
+ };
58
+ default:
59
+ return {
60
+ text: t('refreshButton'),
61
+ icon: _jsx(RefreshInterfaceSVG, {}),
62
+ onClick: () => isBrowser() && window.location.reload(),
63
+ };
64
+ }
65
+ }, [errorType, mainPageUrl, t]);
66
+ }
@@ -0,0 +1 @@
1
+ export * from './ErrorPage';
@@ -0,0 +1 @@
1
+ export * from './ErrorPage';
@@ -0,0 +1,180 @@
1
+ .wrapper{
2
+ --svgExclamationMark:var(--sys-primary-accent-default, #389f74);
3
+ --svgStroke:var(--sys-neutral-decor-activated, #b6bac7);
4
+ --svgBackground:var(--sys-neutral-background1-level, #fdfdfd);
5
+ height:100%;
6
+ border-radius:var(--dimension-1m, 8px);
7
+ box-sizing:border-box;
8
+ padding:var(--dimension-6m, 48px);
9
+ gap:var(--dimension-6m, 48px);
10
+ display:flex;
11
+ flex-direction:column;
12
+ justify-content:space-between;
13
+ background-color:var(--sys-neutral-background1-level, #fdfdfd);
14
+ }
15
+ @media (max-width: 767px){
16
+ .wrapper{
17
+ padding:var(--dimension-3m, 24px);
18
+ gap:var(--dimension-3m, 24px);
19
+ }
20
+ }
21
+
22
+ .statusCode{
23
+ vertical-align:top;
24
+ margin-left:var(--dimension-1m, 8px);
25
+ }
26
+
27
+ .leftSide{
28
+ display:flex;
29
+ flex-direction:column;
30
+ gap:var(--dimension-3m, 24px);
31
+ }
32
+ @media (max-width: 767px){
33
+ .leftSide{
34
+ height:100%;
35
+ justify-content:space-between;
36
+ }
37
+ }
38
+
39
+ .textContainer{
40
+ display:flex;
41
+ flex-direction:column;
42
+ gap:var(--dimension-3m, 24px);
43
+ }
44
+
45
+ .logo{
46
+ height:var(--dimension-3m, 24px);
47
+ margin-bottom:var(--dimension-3m, 24px);
48
+ display:inline-flex;
49
+ }
50
+ .logo svg{
51
+ height:100%;
52
+ }
53
+
54
+ .actionsLink{
55
+ display:flex;
56
+ flex-direction:row;
57
+ gap:var(--dimension-2m, 16px);
58
+ }
59
+
60
+ .buttonContainer{
61
+ display:flex;
62
+ flex-direction:row;
63
+ gap:var(--dimension-1m, 8px);
64
+ }
65
+ .buttonContainer * > path{
66
+ fill:currentColor;
67
+ }
68
+ @media (max-width: 767px){
69
+ .buttonContainer{
70
+ flex-direction:column;
71
+ }
72
+ }
73
+
74
+ .rightSide{
75
+ align-self:flex-end;
76
+ justify-self:center;
77
+ width:50%;
78
+ min-width:500px;
79
+ max-width:862px;
80
+ min-height:0;
81
+ display:flex;
82
+ flex-direction:column;
83
+ justify-content:flex-end;
84
+ align-items:flex-end;
85
+ }
86
+ @media (max-width: 1023px){
87
+ .rightSide{
88
+ justify-content:flex-start;
89
+ align-items:center;
90
+ min-width:0;
91
+ max-width:none;
92
+ width:100%;
93
+ }
94
+ }
95
+ @media (max-width: 767px){
96
+ .rightSide{
97
+ display:none;
98
+ }
99
+ }
100
+
101
+ @keyframes rotating{
102
+ from{
103
+ transform:rotate(0deg);
104
+ }
105
+ to{
106
+ transform:rotate(-360deg);
107
+ }
108
+ }
109
+ .rotateSmall{
110
+ transform-origin:center;
111
+ transform-box:fill-box;
112
+ animation:rotating 10s linear infinite;
113
+ }
114
+
115
+ .rotateBig{
116
+ transform-origin:center;
117
+ transform-box:fill-box;
118
+ animation:rotating 10s linear infinite;
119
+ animation-direction:reverse;
120
+ }
121
+
122
+ @media (max-width: 767px){
123
+ .button{
124
+ width:100%;
125
+ }
126
+ }
127
+
128
+ .pic{
129
+ max-width:863px;
130
+ max-height:520px;
131
+ }
132
+ @media (max-width: 1023px){
133
+ .pic{
134
+ max-height:100%;
135
+ max-width:100%;
136
+ }
137
+ }
138
+
139
+ .title{
140
+ font-family:var(--sans-display-s-font-family, SB Sans Interface);
141
+ font-weight:var(--sans-display-s-font-weight, Semibold);
142
+ line-height:var(--sans-display-s-line-height, 48px);
143
+ font-size:var(--sans-display-s-font-size, 40px);
144
+ letter-spacing:var(--sans-display-s-letter-spacing, -0.5px);
145
+ paragraph-spacing:var(--sans-display-s-paragraph-spacing, 22px);
146
+ box-sizing:border-box;
147
+ max-width:100%;
148
+ margin:0;
149
+ padding:0;
150
+ overflow-wrap:break-word;
151
+ }
152
+ @media (max-width: 767px){
153
+ .title{
154
+ font-family:var(--sans-headline-m-font-family, SB Sans Interface);
155
+ font-weight:var(--sans-headline-m-font-weight, Semibold);
156
+ line-height:var(--sans-headline-m-line-height, 36px);
157
+ font-size:var(--sans-headline-m-font-size, 28px);
158
+ letter-spacing:var(--sans-headline-m-letter-spacing, -0.5px);
159
+ paragraph-spacing:var(--sans-headline-m-paragraph-spacing, 15.4px);
160
+ }
161
+ }
162
+
163
+ .actionsTitle{
164
+ font-family:var(--sans-body-l-font-family, SB Sans Interface);
165
+ font-weight:var(--sans-body-l-font-weight, Regular);
166
+ line-height:var(--sans-body-l-line-height, 24px);
167
+ font-size:var(--sans-body-l-font-size, 16px);
168
+ letter-spacing:var(--sans-body-l-letter-spacing, 0.1px);
169
+ paragraph-spacing:var(--sans-body-l-paragraph-spacing, 8.8px);
170
+ }
171
+ @media (max-width: 767px){
172
+ .actionsTitle{
173
+ font-family:var(--sans-body-m-font-family, SB Sans Interface);
174
+ font-weight:var(--sans-body-m-font-weight, Regular);
175
+ line-height:var(--sans-body-m-line-height, 20px);
176
+ font-size:var(--sans-body-m-font-size, 14px);
177
+ letter-spacing:var(--sans-body-m-letter-spacing, 0.1px);
178
+ paragraph-spacing:var(--sans-body-m-paragraph-spacing, 7.7px);
179
+ }
180
+ }
@@ -0,0 +1 @@
1
+ export * from './components';
@@ -0,0 +1 @@
1
+ export * from './components';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cloud-ru/uikit-product-error-pages",
3
3
  "title": "Error Pages",
4
- "version": "0.13.7",
4
+ "version": "0.13.9",
5
5
  "sideEffects": [
6
6
  "*.css",
7
7
  "*.woff",
@@ -30,14 +30,15 @@
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-utils": "7.0.0",
40
+ "@cloud-ru/uikit-product-icons": "15.1.3",
41
+ "@cloud-ru/uikit-product-utils": "7.0.2",
41
42
  "@snack-uikit/button": "0.19.7",
42
43
  "@snack-uikit/link": "0.15.9",
43
44
  "@snack-uikit/tag": "0.12.4",
@@ -47,5 +48,5 @@
47
48
  "peerDependencies": {
48
49
  "@cloud-ru/uikit-product-locale": "*"
49
50
  },
50
- "gitHead": "e8bd79bc92b26a8f52611972eec98a867536ccd3"
51
+ "gitHead": "bf479ecf7238ef20b78f20acaef439efa535d1a1"
51
52
  }