@cloud-ru/uikit-product-page-layout 0.21.3 → 0.21.5

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 (136) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/components/DefaultSubHeader/DefaultSubHeader.d.ts +9 -0
  3. package/dist/cjs/components/DefaultSubHeader/DefaultSubHeader.js +26 -0
  4. package/dist/cjs/components/DefaultSubHeader/index.d.ts +1 -0
  5. package/dist/cjs/components/DefaultSubHeader/index.js +17 -0
  6. package/dist/cjs/components/DefaultSubHeader/styles.module.css +19 -0
  7. package/dist/cjs/components/Headline/Headline.d.ts +11 -0
  8. package/dist/cjs/components/Headline/Headline.js +29 -0
  9. package/dist/cjs/components/Headline/index.d.ts +1 -0
  10. package/dist/cjs/components/Headline/index.js +17 -0
  11. package/dist/cjs/components/Headline/styles.module.css +52 -0
  12. package/dist/cjs/components/PageCatalog/PageCatalog.d.ts +7 -0
  13. package/dist/cjs/components/PageCatalog/PageCatalog.js +26 -0
  14. package/dist/cjs/components/PageCatalog/index.d.ts +1 -0
  15. package/dist/cjs/components/PageCatalog/index.js +17 -0
  16. package/dist/cjs/components/PageCatalog/styles.module.css +16 -0
  17. package/dist/cjs/components/PageForm/PageForm.d.ts +40 -0
  18. package/dist/cjs/components/PageForm/PageForm.js +39 -0
  19. package/dist/cjs/components/PageForm/constants.d.ts +13 -0
  20. package/dist/cjs/components/PageForm/constants.js +16 -0
  21. package/dist/cjs/components/PageForm/hooks.d.ts +8 -0
  22. package/dist/cjs/components/PageForm/hooks.js +21 -0
  23. package/dist/cjs/components/PageForm/index.d.ts +3 -0
  24. package/dist/cjs/components/PageForm/index.js +19 -0
  25. package/dist/cjs/components/PageForm/styles.module.css +61 -0
  26. package/dist/cjs/components/PageForm/types.d.ts +4 -0
  27. package/dist/cjs/components/PageForm/types.js +2 -0
  28. package/dist/cjs/components/PageLoading/PageLoading.d.ts +5 -0
  29. package/dist/cjs/components/PageLoading/PageLoading.js +26 -0
  30. package/dist/cjs/components/PageLoading/index.d.ts +1 -0
  31. package/dist/cjs/components/PageLoading/index.js +17 -0
  32. package/dist/cjs/components/PageLoading/styles.module.css +12 -0
  33. package/dist/cjs/components/PageServices/PageServices.d.ts +18 -0
  34. package/dist/cjs/components/PageServices/PageServices.js +45 -0
  35. package/dist/cjs/components/PageServices/index.d.ts +1 -0
  36. package/dist/cjs/components/PageServices/index.js +17 -0
  37. package/dist/cjs/components/PageServices/styles.module.css +44 -0
  38. package/dist/cjs/components/PageSidebar/PageSidebar.d.ts +19 -0
  39. package/dist/cjs/components/PageSidebar/PageSidebar.js +55 -0
  40. package/dist/cjs/components/PageSidebar/contexts.d.ts +13 -0
  41. package/dist/cjs/components/PageSidebar/contexts.js +21 -0
  42. package/dist/cjs/components/PageSidebar/helperComponents/SidebarSearch/SidebarSearch.d.ts +1 -0
  43. package/dist/cjs/components/PageSidebar/helperComponents/SidebarSearch/SidebarSearch.js +26 -0
  44. package/dist/cjs/components/PageSidebar/helperComponents/SidebarSearch/index.d.ts +1 -0
  45. package/dist/cjs/components/PageSidebar/helperComponents/SidebarSearch/index.js +5 -0
  46. package/dist/cjs/components/PageSidebar/helperComponents/SidebarSearch/styles.module.css +23 -0
  47. package/dist/cjs/components/PageSidebar/helperComponents/SidebarSearchToggle/SidebarSearchToggle.d.ts +1 -0
  48. package/dist/cjs/components/PageSidebar/helperComponents/SidebarSearchToggle/SidebarSearchToggle.js +18 -0
  49. package/dist/cjs/components/PageSidebar/helperComponents/SidebarSearchToggle/index.d.ts +1 -0
  50. package/dist/cjs/components/PageSidebar/helperComponents/SidebarSearchToggle/index.js +5 -0
  51. package/dist/cjs/components/PageSidebar/helperComponents/SidebarTitle/SidebarTitle.d.ts +9 -0
  52. package/dist/cjs/components/PageSidebar/helperComponents/SidebarTitle/SidebarTitle.js +15 -0
  53. package/dist/cjs/components/PageSidebar/helperComponents/SidebarTitle/index.d.ts +1 -0
  54. package/dist/cjs/components/PageSidebar/helperComponents/SidebarTitle/index.js +17 -0
  55. package/dist/cjs/components/PageSidebar/helperComponents/SidebarTitle/styles.module.css +18 -0
  56. package/dist/cjs/components/PageSidebar/hooks/useItemsCreator.d.ts +8 -0
  57. package/dist/cjs/components/PageSidebar/hooks/useItemsCreator.js +95 -0
  58. package/dist/cjs/components/PageSidebar/hooks/useSearchFilter.d.ts +10 -0
  59. package/dist/cjs/components/PageSidebar/hooks/useSearchFilter.js +47 -0
  60. package/dist/cjs/components/PageSidebar/index.d.ts +2 -0
  61. package/dist/cjs/components/PageSidebar/index.js +17 -0
  62. package/dist/cjs/components/PageSidebar/styles.module.css +76 -0
  63. package/dist/cjs/components/PageSidebar/types.d.ts +40 -0
  64. package/dist/cjs/components/PageSidebar/types.js +2 -0
  65. package/dist/cjs/components/index.d.ts +6 -0
  66. package/dist/cjs/components/index.js +22 -0
  67. package/dist/cjs/index.d.ts +1 -0
  68. package/dist/cjs/index.js +17 -0
  69. package/dist/esm/components/DefaultSubHeader/DefaultSubHeader.d.ts +9 -0
  70. package/dist/esm/components/DefaultSubHeader/DefaultSubHeader.js +20 -0
  71. package/dist/esm/components/DefaultSubHeader/index.d.ts +1 -0
  72. package/dist/esm/components/DefaultSubHeader/index.js +1 -0
  73. package/dist/esm/components/DefaultSubHeader/styles.module.css +19 -0
  74. package/dist/esm/components/Headline/Headline.d.ts +11 -0
  75. package/dist/esm/components/Headline/Headline.js +23 -0
  76. package/dist/esm/components/Headline/index.d.ts +1 -0
  77. package/dist/esm/components/Headline/index.js +1 -0
  78. package/dist/esm/components/Headline/styles.module.css +52 -0
  79. package/dist/esm/components/PageCatalog/PageCatalog.d.ts +7 -0
  80. package/dist/esm/components/PageCatalog/PageCatalog.js +20 -0
  81. package/dist/esm/components/PageCatalog/index.d.ts +1 -0
  82. package/dist/esm/components/PageCatalog/index.js +1 -0
  83. package/dist/esm/components/PageCatalog/styles.module.css +16 -0
  84. package/dist/esm/components/PageForm/PageForm.d.ts +40 -0
  85. package/dist/esm/components/PageForm/PageForm.js +33 -0
  86. package/dist/esm/components/PageForm/constants.d.ts +13 -0
  87. package/dist/esm/components/PageForm/constants.js +13 -0
  88. package/dist/esm/components/PageForm/hooks.d.ts +8 -0
  89. package/dist/esm/components/PageForm/hooks.js +17 -0
  90. package/dist/esm/components/PageForm/index.d.ts +3 -0
  91. package/dist/esm/components/PageForm/index.js +3 -0
  92. package/dist/esm/components/PageForm/styles.module.css +61 -0
  93. package/dist/esm/components/PageForm/types.d.ts +4 -0
  94. package/dist/esm/components/PageForm/types.js +1 -0
  95. package/dist/esm/components/PageLoading/PageLoading.d.ts +5 -0
  96. package/dist/esm/components/PageLoading/PageLoading.js +20 -0
  97. package/dist/esm/components/PageLoading/index.d.ts +1 -0
  98. package/dist/esm/components/PageLoading/index.js +1 -0
  99. package/dist/esm/components/PageLoading/styles.module.css +12 -0
  100. package/dist/esm/components/PageServices/PageServices.d.ts +18 -0
  101. package/dist/esm/components/PageServices/PageServices.js +39 -0
  102. package/dist/esm/components/PageServices/index.d.ts +1 -0
  103. package/dist/esm/components/PageServices/index.js +1 -0
  104. package/dist/esm/components/PageServices/styles.module.css +44 -0
  105. package/dist/esm/components/PageSidebar/PageSidebar.d.ts +19 -0
  106. package/dist/esm/components/PageSidebar/PageSidebar.js +49 -0
  107. package/dist/esm/components/PageSidebar/contexts.d.ts +13 -0
  108. package/dist/esm/components/PageSidebar/contexts.js +16 -0
  109. package/dist/esm/components/PageSidebar/helperComponents/SidebarSearch/SidebarSearch.d.ts +1 -0
  110. package/dist/esm/components/PageSidebar/helperComponents/SidebarSearch/SidebarSearch.js +20 -0
  111. package/dist/esm/components/PageSidebar/helperComponents/SidebarSearch/index.d.ts +1 -0
  112. package/dist/esm/components/PageSidebar/helperComponents/SidebarSearch/index.js +1 -0
  113. package/dist/esm/components/PageSidebar/helperComponents/SidebarSearch/styles.module.css +23 -0
  114. package/dist/esm/components/PageSidebar/helperComponents/SidebarSearchToggle/SidebarSearchToggle.d.ts +1 -0
  115. package/dist/esm/components/PageSidebar/helperComponents/SidebarSearchToggle/SidebarSearchToggle.js +15 -0
  116. package/dist/esm/components/PageSidebar/helperComponents/SidebarSearchToggle/index.d.ts +1 -0
  117. package/dist/esm/components/PageSidebar/helperComponents/SidebarSearchToggle/index.js +1 -0
  118. package/dist/esm/components/PageSidebar/helperComponents/SidebarTitle/SidebarTitle.d.ts +9 -0
  119. package/dist/esm/components/PageSidebar/helperComponents/SidebarTitle/SidebarTitle.js +9 -0
  120. package/dist/esm/components/PageSidebar/helperComponents/SidebarTitle/index.d.ts +1 -0
  121. package/dist/esm/components/PageSidebar/helperComponents/SidebarTitle/index.js +1 -0
  122. package/dist/esm/components/PageSidebar/helperComponents/SidebarTitle/styles.module.css +18 -0
  123. package/dist/esm/components/PageSidebar/hooks/useItemsCreator.d.ts +8 -0
  124. package/dist/esm/components/PageSidebar/hooks/useItemsCreator.js +91 -0
  125. package/dist/esm/components/PageSidebar/hooks/useSearchFilter.d.ts +10 -0
  126. package/dist/esm/components/PageSidebar/hooks/useSearchFilter.js +43 -0
  127. package/dist/esm/components/PageSidebar/index.d.ts +2 -0
  128. package/dist/esm/components/PageSidebar/index.js +1 -0
  129. package/dist/esm/components/PageSidebar/styles.module.css +76 -0
  130. package/dist/esm/components/PageSidebar/types.d.ts +40 -0
  131. package/dist/esm/components/PageSidebar/types.js +1 -0
  132. package/dist/esm/components/index.d.ts +6 -0
  133. package/dist/esm/components/index.js +6 -0
  134. package/dist/esm/index.d.ts +1 -0
  135. package/dist/esm/index.js +1 -0
  136. package/package.json +6 -5
@@ -0,0 +1,76 @@
1
+ .wrapper{
2
+ width:256px;
3
+ }
4
+ .wrapper[data-collapsed]{
5
+ width:0;
6
+ }
7
+ .wrapper .body{
8
+ position:absolute;
9
+ height:100%;
10
+ width:256px;
11
+ display:flex;
12
+ transition:left 0.15s 0.35s ease-in-out;
13
+ }
14
+ .wrapper .body[data-hover-off]{
15
+ pointer-events:none;
16
+ transition:left 0.15s ease-in-out;
17
+ }
18
+ .wrapper .body[data-collapsed]{
19
+ left:-256px;
20
+ }
21
+ .wrapper .body[data-collapsed]::before{
22
+ position:absolute;
23
+ content:" ";
24
+ height:100%;
25
+ right:calc(-1 * var(--dimension-050m, 4px));
26
+ width:var(--dimension-050m, 4px);
27
+ }
28
+ .wrapper .body[data-collapsed]:hover{
29
+ transition:left 0.15s ease-in-out;
30
+ left:0;
31
+ }
32
+ .wrapper .body[data-collapsed]:hover::before{
33
+ right:calc(-4 * var(--dimension-050m, 4px));
34
+ width:calc(4 * var(--dimension-050m, 4px));
35
+ }
36
+ .wrapper .content{
37
+ flex-grow:1;
38
+ display:flex;
39
+ overflow:hidden;
40
+ box-sizing:border-box;
41
+ padding:4px 0;
42
+ flex-direction:column;
43
+ background-color:var(--sys-neutral-background, #eeeff3);
44
+ border-right:1px solid var(--sys-neutral-decor-default, #dde0ea);
45
+ }
46
+ .wrapper .content[data-collapsed]{
47
+ box-shadow:var(--box-shadow-elevation-level3, 0px 0px 8px 0px rgba(0, 0, 0, 0.0784313725), 0px 8px 16px 0px rgba(0, 0, 0, 0.0784313725));
48
+ border-right:none;
49
+ margin:4px;
50
+ }
51
+ .wrapper .list{
52
+ flex-grow:1;
53
+ flex-shrink:1;
54
+ overflow-y:auto;
55
+ display:flex;
56
+ flex-direction:column-reverse;
57
+ position:relative;
58
+ }
59
+ .wrapper .searchWrapper{
60
+ position:absolute;
61
+ right:42px;
62
+ top:4px;
63
+ width:204px;
64
+ }
65
+ .wrapper .toggler{
66
+ display:flex;
67
+ justify-content:end;
68
+ flex-shrink:0;
69
+ flex-grow:0;
70
+ padding:0 4px;
71
+ }
72
+ .wrapper .expandButton{
73
+ position:fixed;
74
+ bottom:8px;
75
+ left:8px;
76
+ }
@@ -0,0 +1,40 @@
1
+ import { AnchorHTMLAttributes, MouseEvent, MouseEventHandler, ReactNode } from 'react';
2
+ import { IconPredefinedProps } from '@snack-uikit/icon-predefined';
3
+ import { TooltipProps } from '@snack-uikit/tooltip';
4
+ export type SidebarItemBase = {
5
+ id: string | number;
6
+ label: string;
7
+ 'data-test-id'?: string;
8
+ onClick?(e: MouseEvent<HTMLElement>): void;
9
+ afterContent?: ReactNode;
10
+ disabledReason?: ReactNode;
11
+ disabledReasonPlacement?: TooltipProps['placement'];
12
+ beforeContent?: ReactNode;
13
+ };
14
+ export type SidebarItemWithHref = SidebarItemBase & {
15
+ href: string;
16
+ };
17
+ export type SidebarItemWithItems = SidebarItemBase & {
18
+ /** @default collapse */
19
+ type?: 'collapse' | 'group';
20
+ divider?: boolean;
21
+ items?: SidebarItem[];
22
+ };
23
+ export type SidebarItem = SidebarItemWithHref | SidebarItemWithItems;
24
+ export type Icon = IconPredefinedProps['icon'];
25
+ export type HeaderProps = {
26
+ type: 'title';
27
+ label: string;
28
+ icon: Icon;
29
+ afterContent?: ReactNode;
30
+ } | {
31
+ type: 'back';
32
+ label: string;
33
+ href?: string;
34
+ onClick?: MouseEventHandler;
35
+ };
36
+ export type Documentation = {
37
+ href?: string;
38
+ onClick?: MouseEventHandler;
39
+ target?: AnchorHTMLAttributes<HTMLAnchorElement>['target'];
40
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ export * from './PageCatalog';
2
+ export * from './PageForm';
3
+ export * from './PageLoading';
4
+ export * from './PageServices';
5
+ export * from './DefaultSubHeader';
6
+ export * from './PageSidebar';
@@ -0,0 +1,22 @@
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("./PageCatalog"), exports);
18
+ __exportStar(require("./PageForm"), exports);
19
+ __exportStar(require("./PageLoading"), exports);
20
+ __exportStar(require("./PageServices"), exports);
21
+ __exportStar(require("./DefaultSubHeader"), exports);
22
+ __exportStar(require("./PageSidebar"), 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,9 @@
1
+ import { ReactNode } from 'react';
2
+ import { CopyLineProps } from '@sbercloud/uikit-product-copy-line';
3
+ import { WithSupportProps } from '@sbercloud/uikit-product-utils';
4
+ export type DefaultSubHeaderProps = WithSupportProps<{
5
+ label: string;
6
+ value: CopyLineProps;
7
+ labelTooltip?: ReactNode;
8
+ }>;
9
+ export declare function DefaultSubHeader({ label, labelTooltip, value, ...rest }: DefaultSubHeaderProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
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 { CopyLine } from '@sbercloud/uikit-product-copy-line';
14
+ import { extractSupportProps } from '@sbercloud/uikit-product-utils';
15
+ import { QuestionTooltip } from '@snack-uikit/tooltip';
16
+ import styles from './styles.module.css';
17
+ export function DefaultSubHeader(_a) {
18
+ var { label, labelTooltip, value } = _a, rest = __rest(_a, ["label", "labelTooltip", "value"]);
19
+ return (_jsxs("div", Object.assign({ className: styles.subheader }, extractSupportProps(rest), { children: [_jsxs("div", { className: styles.label, children: [label, labelTooltip && _jsx(QuestionTooltip, { tip: labelTooltip })] }), _jsx(CopyLine, Object.assign({}, value))] })));
20
+ }
@@ -0,0 +1 @@
1
+ export * from './DefaultSubHeader';
@@ -0,0 +1 @@
1
+ export * from './DefaultSubHeader';
@@ -0,0 +1,19 @@
1
+ .subheader{
2
+ display:flex;
3
+ flex-direction:row;
4
+ align-items:center;
5
+ gap:calc(var(--dimension-2m, 16px) - var(--dimension-050m, 4px));
6
+ }
7
+
8
+ .label{
9
+ font-family:var(--sans-body-m-font-family, SB Sans Interface);
10
+ font-weight:var(--sans-body-m-font-weight, Regular);
11
+ line-height:var(--sans-body-m-line-height, 20px);
12
+ font-size:var(--sans-body-m-font-size, 14px);
13
+ letter-spacing:var(--sans-body-m-letter-spacing, 0.1px);
14
+ paragraph-spacing:var(--sans-body-m-paragraph-spacing, 7.7px);
15
+ display:flex;
16
+ flex-direction:row;
17
+ align-items:center;
18
+ gap:var(--dimension-050m, 4px);
19
+ }
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+ import { WithSupportProps } from '@sbercloud/uikit-product-utils';
3
+ export type HeadlineProps = WithSupportProps<{
4
+ title: string;
5
+ beforeHeadline?: ReactNode;
6
+ afterHeadline?: ReactNode;
7
+ actions?: ReactNode;
8
+ subHeader?: ReactNode;
9
+ truncateTitle?: boolean;
10
+ }>;
11
+ export declare function Headline({ title, actions, beforeHeadline, afterHeadline, subHeader, truncateTitle, ...rest }: HeadlineProps): import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,23 @@
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 { extractSupportProps } from '@sbercloud/uikit-product-utils';
14
+ import { TruncateString } from '@snack-uikit/truncate-string';
15
+ import { Typography } from '@snack-uikit/typography';
16
+ import styles from './styles.module.css';
17
+ export function Headline(_a) {
18
+ var { title, actions, beforeHeadline, afterHeadline, subHeader, truncateTitle } = _a, rest = __rest(_a, ["title", "actions", "beforeHeadline", "afterHeadline", "subHeader", "truncateTitle"]);
19
+ const needsRender = Boolean(title || beforeHeadline || afterHeadline || subHeader || actions);
20
+ if (!needsRender)
21
+ return null;
22
+ return (_jsxs("div", Object.assign({ className: styles.headline }, extractSupportProps(rest), { children: [_jsxs("div", { className: styles.headlineLayout, children: [_jsxs("div", { className: styles.titleLayout, children: [beforeHeadline && _jsx("div", { className: styles.prefixButtonWrapper, children: beforeHeadline }), _jsx(Typography.SansHeadlineM, { tag: 'h1', className: styles.title, children: truncateTitle ? _jsx(TruncateString, { variant: 'end', text: title, maxLines: 1 }) : title }), afterHeadline && _jsx("div", { className: styles.statusWrapper, children: afterHeadline })] }), Boolean(actions) && _jsx("div", { className: styles.actions, children: actions })] }), subHeader && _jsx("div", { className: styles.subHeader, children: subHeader })] })));
23
+ }
@@ -0,0 +1 @@
1
+ export * from './Headline';
@@ -0,0 +1 @@
1
+ export * from './Headline';
@@ -0,0 +1,52 @@
1
+ .headline{
2
+ display:flex;
3
+ flex-direction:column;
4
+ }
5
+
6
+ .headlineLayout{
7
+ display:flex;
8
+ flex-direction:row;
9
+ gap:var(--dimension-1m, 8px);
10
+ align-items:flex-start;
11
+ }
12
+
13
+ .titleLayout{
14
+ display:flex;
15
+ flex-direction:row;
16
+ gap:var(--dimension-1m, 8px);
17
+ align-items:flex-start;
18
+ width:100%;
19
+ color:var(--sys-neutral-text-main, #41424e);
20
+ }
21
+
22
+ .title{
23
+ min-width:0;
24
+ }
25
+
26
+ .prefixButtonWrapper{
27
+ display:flex;
28
+ align-items:center;
29
+ height:var(--sans-headline-m-line-height, 36px);
30
+ flex-shrink:0;
31
+ }
32
+
33
+ .statusWrapper{
34
+ display:flex;
35
+ align-items:center;
36
+ height:var(--sans-headline-m-line-height, 36px);
37
+ flex-shrink:0;
38
+ }
39
+
40
+ .actions{
41
+ height:var(--sans-headline-m-line-height, 36px);
42
+ display:flex;
43
+ align-items:center;
44
+ gap:8px;
45
+ flex-shrink:0;
46
+ justify-content:flex-end;
47
+ }
48
+
49
+ .subHeader{
50
+ margin-top:4px;
51
+ color:var(--sys-neutral-text-main, #41424e);
52
+ }
@@ -0,0 +1,7 @@
1
+ import { PropsWithChildren } from 'react';
2
+ import { WithSupportProps } from '@sbercloud/uikit-product-utils';
3
+ import { HeadlineProps } from '../Headline';
4
+ export type PageCatalogProps = WithSupportProps<PropsWithChildren<Pick<HeadlineProps, 'title' | 'actions'> & {
5
+ className?: string;
6
+ }>>;
7
+ export declare function PageCatalog({ children, title, actions, className, ...rest }: PageCatalogProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
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 { extractSupportProps } from '@sbercloud/uikit-product-utils';
15
+ import { Headline } from '../Headline';
16
+ import styles from './styles.module.css';
17
+ export function PageCatalog(_a) {
18
+ var { children, title, actions, className } = _a, rest = __rest(_a, ["children", "title", "actions", "className"]);
19
+ return (_jsxs("div", Object.assign({ className: cn(styles.catalog, className) }, extractSupportProps(rest), { children: [_jsx(Headline, { title: title, actions: actions }), _jsx("div", { className: styles.content, children: children })] })));
20
+ }
@@ -0,0 +1 @@
1
+ export * from './PageCatalog';
@@ -0,0 +1 @@
1
+ export * from './PageCatalog';
@@ -0,0 +1,16 @@
1
+ .catalog{
2
+ display:flex;
3
+ flex-direction:column;
4
+ gap:var(--dimension-3m, 24px);
5
+ padding:var(--dimension-3m, 24px);
6
+ margin:0 auto;
7
+ box-sizing:border-box;
8
+ max-width:min(100%, 1248px);
9
+ min-width:992px;
10
+ }
11
+
12
+ .content{
13
+ display:flex;
14
+ flex-direction:column;
15
+ flex-grow:1;
16
+ }
@@ -0,0 +1,40 @@
1
+ import { PropsWithChildren, ReactNode } from 'react';
2
+ import { WithSupportProps } from '@sbercloud/uikit-product-utils';
3
+ import { ButtonFilledProps, ButtonOutlineProps, ButtonSimpleProps } from '@snack-uikit/button';
4
+ import { TooltipProps } from '@snack-uikit/tooltip';
5
+ import { HeadlineProps } from '../Headline';
6
+ import { ButtonPrimaryVariant, ButtonSecondaryVariant } from './types';
7
+ export type PageFormProps = WithSupportProps<PropsWithChildren<Pick<HeadlineProps, 'title' | 'subHeader'> & {
8
+ className?: string;
9
+ stepper?: ReactNode;
10
+ priceSummary?: {
11
+ total: ReactNode;
12
+ content?: ReactNode;
13
+ };
14
+ sideBlock?: {
15
+ label: string;
16
+ content: ReactNode;
17
+ }[];
18
+ footer?: {
19
+ buttonPrimary: ({
20
+ variant: ButtonPrimaryVariant;
21
+ } | {
22
+ variant: 'custom';
23
+ label: string;
24
+ }) & {
25
+ tooltip?: TooltipProps;
26
+ } & Omit<ButtonFilledProps, 'label'>;
27
+ buttonSecondary?: ({
28
+ variant: ButtonSecondaryVariant;
29
+ } | {
30
+ variant: 'custom';
31
+ label: string;
32
+ }) & {
33
+ tooltip?: TooltipProps;
34
+ } & Omit<ButtonOutlineProps, 'label'>;
35
+ buttonAdditional?: ButtonSimpleProps & {
36
+ tooltip?: TooltipProps;
37
+ };
38
+ };
39
+ }>>;
40
+ export declare function PageForm({ children, stepper, title, subHeader, className, footer, sideBlock, priceSummary, ...rest }: PageFormProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,33 @@
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 { extractSupportProps } from '@sbercloud/uikit-product-utils';
16
+ import { ButtonFilled, ButtonOutline, ButtonSimple, } from '@snack-uikit/button';
17
+ import { Headline } from '../Headline';
18
+ import { useButtonWithTooltip, useGetButtonLabel } from './hooks';
19
+ import styles from './styles.module.css';
20
+ export function PageForm(_a) {
21
+ var _b, _c;
22
+ var { children, stepper, title, subHeader, className, footer, sideBlock, priceSummary } = _a, rest = __rest(_a, ["children", "stepper", "title", "subHeader", "className", "footer", "sideBlock", "priceSummary"]);
23
+ const getButtonLabel = useGetButtonLabel();
24
+ const moreItems = useMemo(() => [priceSummary === null || priceSummary === void 0 ? void 0 : priceSummary.content].concat(sideBlock === null || sideBlock === void 0 ? void 0 : sideBlock.map(item => item.content)).filter(Boolean), [priceSummary === null || priceSummary === void 0 ? void 0 : priceSummary.content, sideBlock]);
25
+ const PrimaryButton = useButtonWithTooltip({ Button: ButtonFilled, tooltip: footer === null || footer === void 0 ? void 0 : footer.buttonPrimary.tooltip });
26
+ const SecondaryButton = useButtonWithTooltip({ Button: ButtonOutline, tooltip: (_b = footer === null || footer === void 0 ? void 0 : footer.buttonSecondary) === null || _b === void 0 ? void 0 : _b.tooltip });
27
+ const AdditionalButton = useButtonWithTooltip({ Button: ButtonSimple, tooltip: (_c = footer === null || footer === void 0 ? void 0 : footer.buttonAdditional) === null || _c === void 0 ? void 0 : _c.tooltip });
28
+ return (_jsxs("div", Object.assign({ className: cn(styles.container, className) }, extractSupportProps(rest), { children: [_jsxs("div", { className: styles.form, children: [_jsx("div", { className: styles.headline, children: _jsx(Headline, { title: title, subHeader: subHeader }) }), stepper, _jsx("div", { className: styles.body, children: children }), footer && (_jsxs("div", { className: styles.footer, children: [footer.buttonSecondary && (_jsx(SecondaryButton, Object.assign({}, footer.buttonSecondary, { size: 'm', appearance: 'neutral', label: footer.buttonSecondary.variant === 'custom'
29
+ ? footer.buttonSecondary.label
30
+ : getButtonLabel(footer.buttonSecondary.variant) }))), _jsxs("div", { className: styles.mainActions, children: [footer.buttonAdditional && _jsx(AdditionalButton, Object.assign({}, footer.buttonAdditional, { size: 'm' })), _jsx(PrimaryButton, Object.assign({}, footer.buttonPrimary, { size: 'm', label: footer.buttonPrimary.variant === 'custom'
31
+ ? footer.buttonPrimary.label
32
+ : getButtonLabel(footer.buttonPrimary.variant) }))] })] }))] }), (moreItems === null || moreItems === void 0 ? void 0 : moreItems.length) > 0 && _jsx("div", { className: styles.sideItems, children: moreItems })] })));
33
+ }
@@ -0,0 +1,13 @@
1
+ export declare const BUTTON_PRIMARY_VARIANT: {
2
+ readonly Continue: "continue";
3
+ readonly Create: "create";
4
+ readonly Save: "save";
5
+ readonly Rent: "rent";
6
+ readonly Send: "send";
7
+ readonly Restore: "restore";
8
+ readonly Add: "add";
9
+ };
10
+ export declare const BUTTON_SECONDARY_VARIANT: {
11
+ readonly Cancel: "cancel";
12
+ readonly Back: "back";
13
+ };
@@ -0,0 +1,13 @@
1
+ export const BUTTON_PRIMARY_VARIANT = {
2
+ Continue: 'continue',
3
+ Create: 'create',
4
+ Save: 'save',
5
+ Rent: 'rent',
6
+ Send: 'send',
7
+ Restore: 'restore',
8
+ Add: 'add',
9
+ };
10
+ export const BUTTON_SECONDARY_VARIANT = {
11
+ Cancel: 'cancel',
12
+ Back: 'back',
13
+ };
@@ -0,0 +1,8 @@
1
+ import { ForwardRefExoticComponent } from 'react';
2
+ import { TooltipProps } from '@snack-uikit/tooltip';
3
+ import { ButtonPrimaryVariant, ButtonSecondaryVariant } from './types';
4
+ export declare function useButtonWithTooltip<T extends Record<string, unknown>>({ Button, tooltip, }: {
5
+ tooltip?: TooltipProps;
6
+ Button: ForwardRefExoticComponent<T>;
7
+ }): ForwardRefExoticComponent<T> | ((props: T) => import("react/jsx-runtime").JSX.Element);
8
+ export declare function useGetButtonLabel(): (variant: ButtonPrimaryVariant | ButtonSecondaryVariant) => string;
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { useLocale } from '@sbercloud/uikit-product-locale';
3
+ import { Tooltip } from '@snack-uikit/tooltip';
4
+ export function useButtonWithTooltip({ Button, tooltip, }) {
5
+ if (tooltip) {
6
+ return function ButtonWithTooltip(props) {
7
+ return (_jsx(Tooltip, Object.assign({}, tooltip, { children: _jsx(Button, Object.assign({}, props)) })));
8
+ };
9
+ }
10
+ return Button;
11
+ }
12
+ export function useGetButtonLabel() {
13
+ const { t } = useLocale('PageLayout');
14
+ return function getButtonLabel(variant) {
15
+ return t(`PageForm.${variant}`);
16
+ };
17
+ }
@@ -0,0 +1,3 @@
1
+ export * from './PageForm';
2
+ export * from './constants';
3
+ export * from './types';
@@ -0,0 +1,3 @@
1
+ export * from './PageForm';
2
+ export * from './constants';
3
+ export * from './types';
@@ -0,0 +1,61 @@
1
+ .container{
2
+ padding:var(--dimension-3m, 24px);
3
+ min-width:-moz-fit-content;
4
+ min-width:fit-content;
5
+ display:flex;
6
+ justify-content:center;
7
+ gap:24px;
8
+ min-height:100%;
9
+ box-sizing:border-box;
10
+ }
11
+
12
+ .form{
13
+ display:flex;
14
+ flex-direction:column;
15
+ gap:32px;
16
+ width:800px;
17
+ background-color:var(--sys-neutral-background1-level, #fdfdfd);
18
+ padding:56px;
19
+ flex-shrink:0;
20
+ border-radius:16px;
21
+ min-height:100%;
22
+ box-sizing:border-box;
23
+ }
24
+
25
+ .headline{
26
+ position:relative;
27
+ }
28
+
29
+ .footer{
30
+ display:flex;
31
+ justify-content:space-between;
32
+ align-items:center;
33
+ }
34
+
35
+ .mainActions{
36
+ display:flex;
37
+ align-items:center;
38
+ margin-left:auto;
39
+ }
40
+
41
+ .sideItems{
42
+ display:flex;
43
+ flex-direction:column;
44
+ gap:16px;
45
+ width:304px;
46
+ position:sticky;
47
+ top:24px;
48
+ align-self:flex-start;
49
+ }
50
+
51
+ .body{
52
+ font-family:var(--sans-body-m-font-family, SB Sans Interface);
53
+ font-weight:var(--sans-body-m-font-weight, Regular);
54
+ line-height:var(--sans-body-m-line-height, 20px);
55
+ font-size:var(--sans-body-m-font-size, 14px);
56
+ letter-spacing:var(--sans-body-m-letter-spacing, 0.1px);
57
+ paragraph-spacing:var(--sans-body-m-paragraph-spacing, 7.7px);
58
+ color:var(--sys-neutral-text-main, #41424e);
59
+ background-color:var(--sys-neutral-background1-level, #fdfdfd);
60
+ flex:1;
61
+ }
@@ -0,0 +1,4 @@
1
+ import { ValueOf } from '@snack-uikit/utils';
2
+ import { BUTTON_PRIMARY_VARIANT, BUTTON_SECONDARY_VARIANT } from './constants';
3
+ export type ButtonPrimaryVariant = ValueOf<typeof BUTTON_PRIMARY_VARIANT>;
4
+ export type ButtonSecondaryVariant = ValueOf<typeof BUTTON_SECONDARY_VARIANT>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ import { WithSupportProps } from '@sbercloud/uikit-product-utils';
2
+ export type PageLoadingProps = WithSupportProps<{
3
+ className?: string;
4
+ }>;
5
+ export declare function PageLoading({ className, ...rest }: PageLoadingProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,20 @@
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 } from "react/jsx-runtime";
13
+ import cn from 'classnames';
14
+ import { extractSupportProps } from '@sbercloud/uikit-product-utils';
15
+ import { Spinner as UISpinner } from '@snack-uikit/loaders';
16
+ import styles from './styles.module.css';
17
+ export function PageLoading(_a) {
18
+ var { className } = _a, rest = __rest(_a, ["className"]);
19
+ return (_jsx("div", Object.assign({ className: cn(styles.wrapper, className) }, extractSupportProps(rest), { children: _jsx(UISpinner, { size: 'm', className: styles.spinner }) })));
20
+ }
@@ -0,0 +1 @@
1
+ export * from './PageLoading';
@@ -0,0 +1 @@
1
+ export * from './PageLoading';
@@ -0,0 +1,12 @@
1
+ .wrapper{
2
+ box-sizing:border-box;
3
+ width:100%;
4
+ height:100%;
5
+ color:var(--sys-neutral-accent-default, #787b8a);
6
+ }
7
+
8
+ .spinner{
9
+ position:fixed;
10
+ top:calc(50% - var(--size-loader-loader-m, 48px) / 2);
11
+ left:calc(50% - var(--size-loader-loader-m, 48px) / 2);
12
+ }