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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/cjs/components/DefaultSubHeader/DefaultSubHeader.d.ts +2 -2
  3. package/dist/cjs/components/DefaultSubHeader/DefaultSubHeader.js +2 -2
  4. package/dist/cjs/components/Headline/Headline.d.ts +1 -1
  5. package/dist/cjs/components/Headline/Headline.js +1 -1
  6. package/dist/cjs/components/PageCatalog/PageCatalog.d.ts +1 -1
  7. package/dist/cjs/components/PageCatalog/PageCatalog.js +1 -1
  8. package/dist/cjs/components/PageForm/PageForm.d.ts +1 -1
  9. package/dist/cjs/components/PageForm/PageForm.js +1 -1
  10. package/dist/cjs/components/PageForm/hooks.js +1 -1
  11. package/dist/cjs/components/PageLoading/PageLoading.d.ts +1 -1
  12. package/dist/cjs/components/PageLoading/PageLoading.js +1 -1
  13. package/dist/cjs/components/PageServices/PageServices.d.ts +1 -1
  14. package/dist/cjs/components/PageSidebar/PageSidebar.js +1 -1
  15. package/dist/cjs/components/PageSidebar/helperComponents/SidebarSearch/SidebarSearch.js +1 -1
  16. package/dist/cjs/components/PageSidebar/helperComponents/SidebarSearchToggle/SidebarSearchToggle.js +2 -2
  17. package/dist/cjs/components/PageSidebar/hooks/useItemsCreator.js +2 -2
  18. package/dist/cjs/components/TreeNavigation/TreeNavigation.d.ts +42 -0
  19. package/dist/cjs/components/TreeNavigation/TreeNavigation.js +23 -0
  20. package/dist/cjs/components/TreeNavigation/helper-components/ConditionalPopover/ConditionalPopover.d.ts +10 -0
  21. package/dist/cjs/components/TreeNavigation/helper-components/ConditionalPopover/ConditionalPopover.js +18 -0
  22. package/dist/cjs/components/TreeNavigation/helper-components/ConditionalPopover/styles.module.css +6 -0
  23. package/dist/cjs/components/TreeNavigation/helper-components/Menu/Menu.d.ts +9 -0
  24. package/dist/cjs/components/TreeNavigation/helper-components/Menu/Menu.js +25 -0
  25. package/dist/cjs/components/TreeNavigation/helper-components/Menu/styles.module.css +12 -0
  26. package/dist/cjs/components/TreeNavigation/helper-components/Menu/utils.d.ts +7 -0
  27. package/dist/cjs/components/TreeNavigation/helper-components/Menu/utils.js +20 -0
  28. package/dist/cjs/components/TreeNavigation/helper-components/index.d.ts +2 -0
  29. package/dist/cjs/components/TreeNavigation/helper-components/index.js +7 -0
  30. package/dist/cjs/components/TreeNavigation/index.d.ts +1 -0
  31. package/dist/cjs/components/TreeNavigation/index.js +17 -0
  32. package/dist/cjs/components/TreeNavigation/styles.module.css +82 -0
  33. package/dist/cjs/components/index.d.ts +1 -0
  34. package/dist/cjs/components/index.js +1 -0
  35. package/dist/esm/components/DefaultSubHeader/DefaultSubHeader.d.ts +2 -2
  36. package/dist/esm/components/DefaultSubHeader/DefaultSubHeader.js +2 -2
  37. package/dist/esm/components/Headline/Headline.d.ts +1 -1
  38. package/dist/esm/components/Headline/Headline.js +1 -1
  39. package/dist/esm/components/PageCatalog/PageCatalog.d.ts +1 -1
  40. package/dist/esm/components/PageCatalog/PageCatalog.js +1 -1
  41. package/dist/esm/components/PageForm/PageForm.d.ts +1 -1
  42. package/dist/esm/components/PageForm/PageForm.js +1 -1
  43. package/dist/esm/components/PageForm/hooks.js +1 -1
  44. package/dist/esm/components/PageLoading/PageLoading.d.ts +1 -1
  45. package/dist/esm/components/PageLoading/PageLoading.js +1 -1
  46. package/dist/esm/components/PageServices/PageServices.d.ts +1 -1
  47. package/dist/esm/components/PageSidebar/PageSidebar.js +1 -1
  48. package/dist/esm/components/PageSidebar/helperComponents/SidebarSearch/SidebarSearch.js +1 -1
  49. package/dist/esm/components/PageSidebar/helperComponents/SidebarSearchToggle/SidebarSearchToggle.js +2 -2
  50. package/dist/esm/components/PageSidebar/hooks/useItemsCreator.js +2 -2
  51. package/dist/esm/components/TreeNavigation/TreeNavigation.d.ts +42 -0
  52. package/dist/esm/components/TreeNavigation/TreeNavigation.js +17 -0
  53. package/dist/esm/components/TreeNavigation/helper-components/ConditionalPopover/ConditionalPopover.d.ts +10 -0
  54. package/dist/esm/components/TreeNavigation/helper-components/ConditionalPopover/ConditionalPopover.js +12 -0
  55. package/dist/esm/components/TreeNavigation/helper-components/ConditionalPopover/styles.module.css +6 -0
  56. package/dist/esm/components/TreeNavigation/helper-components/Menu/Menu.d.ts +9 -0
  57. package/dist/esm/components/TreeNavigation/helper-components/Menu/Menu.js +19 -0
  58. package/dist/esm/components/TreeNavigation/helper-components/Menu/styles.module.css +12 -0
  59. package/dist/esm/components/TreeNavigation/helper-components/Menu/utils.d.ts +7 -0
  60. package/dist/esm/components/TreeNavigation/helper-components/Menu/utils.js +16 -0
  61. package/dist/esm/components/TreeNavigation/helper-components/index.d.ts +2 -0
  62. package/dist/esm/components/TreeNavigation/helper-components/index.js +2 -0
  63. package/dist/esm/components/TreeNavigation/index.d.ts +1 -0
  64. package/dist/esm/components/TreeNavigation/index.js +1 -0
  65. package/dist/esm/components/TreeNavigation/styles.module.css +82 -0
  66. package/dist/esm/components/index.d.ts +1 -0
  67. package/dist/esm/components/index.js +1 -0
  68. package/package.json +8 -6
  69. package/src/components/TreeNavigation/TreeNavigation.tsx +128 -0
  70. package/src/components/TreeNavigation/helper-components/ConditionalPopover/ConditionalPopover.tsx +34 -0
  71. package/src/components/TreeNavigation/helper-components/ConditionalPopover/styles.module.scss +7 -0
  72. package/src/components/TreeNavigation/helper-components/Menu/Menu.tsx +50 -0
  73. package/src/components/TreeNavigation/helper-components/Menu/styles.module.scss +14 -0
  74. package/src/components/TreeNavigation/helper-components/Menu/utils.ts +22 -0
  75. package/src/components/TreeNavigation/helper-components/index.ts +2 -0
  76. package/src/components/TreeNavigation/index.ts +1 -0
  77. package/src/components/TreeNavigation/styles.module.scss +86 -0
  78. package/src/components/index.ts +1 -0
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.22.0 (2025-11-24)
7
+
8
+
9
+ ### Features
10
+
11
+ * **PDS-2935:** add new component TreeNavigation for Page Layout ([ef1a595](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/ef1a595fb34619087d5930de5affe72bff4e867b))
12
+
13
+
14
+
15
+
16
+
17
+ ## 0.21.6 (2025-11-13)
18
+
19
+
20
+ ### Bug Fixes
21
+
22
+ * **PD-3377:** removed contributors ([121640f](https://gitverse.ru/cloud-ru-tech/uikit-product/commits/121640f7b88b20a728a6ad2c39de8841532bb308))
23
+
24
+
25
+
26
+
27
+
6
28
  ## 0.21.5 (2025-11-13)
7
29
 
8
30
  ### Only dependencies have been changed
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- import { CopyLineProps } from '@sbercloud/uikit-product-copy-line';
3
- import { WithSupportProps } from '@sbercloud/uikit-product-utils';
2
+ import { CopyLineProps } from '@cloud-ru/uikit-product-copy-line';
3
+ import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
4
4
  export type DefaultSubHeaderProps = WithSupportProps<{
5
5
  label: string;
6
6
  value: CopyLineProps;
@@ -16,8 +16,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.DefaultSubHeader = DefaultSubHeader;
18
18
  const jsx_runtime_1 = require("react/jsx-runtime");
19
- const uikit_product_copy_line_1 = require("@sbercloud/uikit-product-copy-line");
20
- const uikit_product_utils_1 = require("@sbercloud/uikit-product-utils");
19
+ const uikit_product_copy_line_1 = require("@cloud-ru/uikit-product-copy-line");
20
+ const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
21
21
  const tooltip_1 = require("@snack-uikit/tooltip");
22
22
  const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
23
23
  function DefaultSubHeader(_a) {
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { WithSupportProps } from '@sbercloud/uikit-product-utils';
2
+ import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
3
3
  export type HeadlineProps = WithSupportProps<{
4
4
  title: string;
5
5
  beforeHeadline?: ReactNode;
@@ -16,7 +16,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.Headline = Headline;
18
18
  const jsx_runtime_1 = require("react/jsx-runtime");
19
- const uikit_product_utils_1 = require("@sbercloud/uikit-product-utils");
19
+ const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
20
20
  const truncate_string_1 = require("@snack-uikit/truncate-string");
21
21
  const typography_1 = require("@snack-uikit/typography");
22
22
  const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
@@ -1,5 +1,5 @@
1
1
  import { PropsWithChildren } from 'react';
2
- import { WithSupportProps } from '@sbercloud/uikit-product-utils';
2
+ import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
3
3
  import { HeadlineProps } from '../Headline';
4
4
  export type PageCatalogProps = WithSupportProps<PropsWithChildren<Pick<HeadlineProps, 'title' | 'actions'> & {
5
5
  className?: string;
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.PageCatalog = PageCatalog;
18
18
  const jsx_runtime_1 = require("react/jsx-runtime");
19
19
  const classnames_1 = __importDefault(require("classnames"));
20
- const uikit_product_utils_1 = require("@sbercloud/uikit-product-utils");
20
+ const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
21
21
  const Headline_1 = require("../Headline");
22
22
  const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
23
23
  function PageCatalog(_a) {
@@ -1,5 +1,5 @@
1
1
  import { PropsWithChildren, ReactNode } from 'react';
2
- import { WithSupportProps } from '@sbercloud/uikit-product-utils';
2
+ import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
3
3
  import { ButtonFilledProps, ButtonOutlineProps, ButtonSimpleProps } from '@snack-uikit/button';
4
4
  import { TooltipProps } from '@snack-uikit/tooltip';
5
5
  import { HeadlineProps } from '../Headline';
@@ -18,7 +18,7 @@ exports.PageForm = PageForm;
18
18
  const jsx_runtime_1 = require("react/jsx-runtime");
19
19
  const classnames_1 = __importDefault(require("classnames"));
20
20
  const react_1 = require("react");
21
- const uikit_product_utils_1 = require("@sbercloud/uikit-product-utils");
21
+ const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
22
22
  const button_1 = require("@snack-uikit/button");
23
23
  const Headline_1 = require("../Headline");
24
24
  const hooks_1 = require("./hooks");
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useButtonWithTooltip = useButtonWithTooltip;
4
4
  exports.useGetButtonLabel = useGetButtonLabel;
5
5
  const jsx_runtime_1 = require("react/jsx-runtime");
6
- const uikit_product_locale_1 = require("@sbercloud/uikit-product-locale");
6
+ const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
7
7
  const tooltip_1 = require("@snack-uikit/tooltip");
8
8
  function useButtonWithTooltip({ Button, tooltip, }) {
9
9
  if (tooltip) {
@@ -1,4 +1,4 @@
1
- import { WithSupportProps } from '@sbercloud/uikit-product-utils';
1
+ import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
2
2
  export type PageLoadingProps = WithSupportProps<{
3
3
  className?: string;
4
4
  }>;
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.PageLoading = PageLoading;
18
18
  const jsx_runtime_1 = require("react/jsx-runtime");
19
19
  const classnames_1 = __importDefault(require("classnames"));
20
- const uikit_product_utils_1 = require("@sbercloud/uikit-product-utils");
20
+ const uikit_product_utils_1 = require("@cloud-ru/uikit-product-utils");
21
21
  const loaders_1 = require("@snack-uikit/loaders");
22
22
  const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
23
23
  function PageLoading(_a) {
@@ -1,5 +1,5 @@
1
1
  import { PropsWithChildren } from 'react';
2
- import { WithSupportProps } from '@sbercloud/uikit-product-utils';
2
+ import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
3
3
  import { HeadlineProps } from '../Headline';
4
4
  import { PageSidebarProps } from '../PageSidebar';
5
5
  export type PageServicesProps = WithSupportProps<PropsWithChildren<Pick<HeadlineProps, 'title' | 'actions' | 'subHeader' | 'afterHeadline' | 'beforeHeadline' | 'truncateTitle'> & {
@@ -19,7 +19,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
19
19
  const classnames_1 = __importDefault(require("classnames"));
20
20
  const react_1 = require("react");
21
21
  const uncontrollable_1 = require("uncontrollable");
22
- const uikit_product_icons_1 = require("@sbercloud/uikit-product-icons");
22
+ const uikit_product_icons_1 = require("@cloud-ru/uikit-product-icons");
23
23
  const button_1 = require("@snack-uikit/button");
24
24
  const list_1 = require("@snack-uikit/list");
25
25
  const utils_1 = require("@snack-uikit/utils");
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.SidebarSearch = SidebarSearch;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
8
  const react_1 = require("react");
9
- const uikit_product_locale_1 = require("@sbercloud/uikit-product-locale");
9
+ const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
10
10
  const search_1 = require("@snack-uikit/search");
11
11
  const contexts_1 = require("../../contexts");
12
12
  const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
@@ -2,8 +2,8 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SidebarSearchToggle = SidebarSearchToggle;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const uikit_product_icons_1 = require("@sbercloud/uikit-product-icons");
6
- const uikit_product_locale_1 = require("@sbercloud/uikit-product-locale");
5
+ const uikit_product_icons_1 = require("@cloud-ru/uikit-product-icons");
6
+ const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
7
7
  const button_1 = require("@snack-uikit/button");
8
8
  const tooltip_1 = require("@snack-uikit/tooltip");
9
9
  const contexts_1 = require("../../contexts");
@@ -15,8 +15,8 @@ exports.useTopPinnedContent = useTopPinnedContent;
15
15
  exports.useItemsContent = useItemsContent;
16
16
  const jsx_runtime_1 = require("react/jsx-runtime");
17
17
  const react_1 = require("react");
18
- const uikit_product_icons_1 = require("@sbercloud/uikit-product-icons");
19
- const uikit_product_locale_1 = require("@sbercloud/uikit-product-locale");
18
+ const uikit_product_icons_1 = require("@cloud-ru/uikit-product-icons");
19
+ const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
20
20
  const tooltip_1 = require("@snack-uikit/tooltip");
21
21
  const SidebarSearchToggle_1 = require("../helperComponents/SidebarSearchToggle");
22
22
  const SidebarTitle_1 = require("../helperComponents/SidebarTitle");
@@ -0,0 +1,42 @@
1
+ import { ReactNode } from 'react';
2
+ import { StatusProps } from '@snack-uikit/status';
3
+ import { TreeNodeProps } from '@snack-uikit/tree';
4
+ export type TreeNavigationProps = {
5
+ header: {
6
+ /** Текст заголовка */
7
+ title: string;
8
+ /** Иконка */
9
+ icon?: ReactNode;
10
+ /** Текст описания */
11
+ description?: string;
12
+ /** Статус (цвет, иконка и т.п.) – любой тип, который принимает ваш <Status/> */
13
+ status?: StatusProps;
14
+ /** Раздел для действий */
15
+ actions?: ReactNode;
16
+ };
17
+ menu: {
18
+ /** Заголовок меню */
19
+ menuTitle?: string;
20
+ /** Данные для дерева меню */
21
+ items: TreeNodeProps[];
22
+ /** Управляемый режим: если передан, меню открывается как popover. */
23
+ isMenuOpen?: boolean;
24
+ /** Колбэк, вызываемый при попытке изменить состояние меню.
25
+ * В контролируемом режиме обязателен, в неконтролируемом – опционален.
26
+ */
27
+ onMenuToggle?: (open: boolean) => void;
28
+ /** Открывать меню по умолчанию */
29
+ defaultMenuOpened?: boolean;
30
+ /** Позляет отключить кнопку "Свернуть все"*/
31
+ enableShrinkMenuButton?: boolean;
32
+ /** Открывать пункты меню по умолчанию */
33
+ withDefaultOpenedMenuList?: boolean;
34
+ };
35
+ /** Контентная часть страницы */
36
+ content: ReactNode;
37
+ /** Вариант отображения */
38
+ mode: 'popover' | 'aside';
39
+ /** Класс для контейнера контентной части */
40
+ contentClassName?: string;
41
+ };
42
+ export declare function TreeNavigation({ header: { title, icon, description, status, actions }, menu: { menuTitle, items, enableShrinkMenuButton, withDefaultOpenedMenuList, isMenuOpen, defaultMenuOpened, onMenuToggle, }, content, mode, contentClassName, }: TreeNavigationProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,23 @@
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.TreeNavigation = TreeNavigation;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const classnames_1 = __importDefault(require("classnames"));
9
+ const react_1 = require("react");
10
+ const uncontrollable_1 = require("uncontrollable");
11
+ const uikit_product_icons_1 = require("@cloud-ru/uikit-product-icons");
12
+ const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
13
+ const button_1 = require("@snack-uikit/button");
14
+ const status_1 = require("@snack-uikit/status");
15
+ const typography_1 = require("@snack-uikit/typography");
16
+ const helper_components_1 = require("./helper-components");
17
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
18
+ function TreeNavigation({ header: { title, icon, description, status, actions }, menu: { menuTitle, items, enableShrinkMenuButton, withDefaultOpenedMenuList, isMenuOpen, defaultMenuOpened, onMenuToggle, }, content, mode, contentClassName, }) {
19
+ const [open, setOpen] = (0, uncontrollable_1.useUncontrolledProp)(isMenuOpen, defaultMenuOpened, onMenuToggle);
20
+ const { t } = (0, uikit_product_locale_1.useLocale)('PageLayout');
21
+ const menu = (0, react_1.useMemo)(() => ((0, jsx_runtime_1.jsx)(helper_components_1.Menu, { menuItems: items, menuTitle: menuTitle, enableShrinkMenuButton: enableShrinkMenuButton, withDefaultOpenedMenuList: withDefaultOpenedMenuList })), [items, menuTitle, enableShrinkMenuButton, withDefaultOpenedMenuList]);
22
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.root, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.header, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.titleWrapper, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.titleInner, children: [(0, jsx_runtime_1.jsx)(helper_components_1.ConditionalPopover, { isOpen: Boolean(open), onOpenChange: setOpen, tip: menu, withPopover: mode === 'popover', children: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.innerElement, children: (0, jsx_runtime_1.jsx)(button_1.ButtonSimple, { size: 'xs', "aria-label": open ? t('TreeNavigation.closeMenu') : t('TreeNavigation.openMenu'), icon: open ? (0, jsx_runtime_1.jsx)(uikit_product_icons_1.CloseSVG, {}) : (0, jsx_runtime_1.jsx)(uikit_product_icons_1.BurgerSVG, {}), onClick: () => setOpen(!open) }) }) }), icon && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.innerElement, children: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.icon, children: icon }) })), (0, jsx_runtime_1.jsx)(typography_1.Typography.SansTitleL, { className: styles_module_scss_1.default.title, children: title }), status && ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.innerElement, children: (0, jsx_runtime_1.jsx)(status_1.Status, Object.assign({}, status)) }))] }), description && (0, jsx_runtime_1.jsx)(typography_1.Typography.SansBodyS, { className: styles_module_scss_1.default.description, children: description })] }), actions] }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.body, children: [mode === 'aside' && open && (0, jsx_runtime_1.jsx)("aside", { className: styles_module_scss_1.default.sidebar, children: menu }), (0, jsx_runtime_1.jsx)("div", { className: (0, classnames_1.default)(styles_module_scss_1.default.main, contentClassName), children: content })] })] }));
23
+ }
@@ -0,0 +1,10 @@
1
+ import { ReactNode } from 'react';
2
+ type ConditionalPopoverProps = {
3
+ isOpen: boolean;
4
+ onOpenChange: (value: boolean) => void;
5
+ tip: ReactNode;
6
+ withPopover?: boolean;
7
+ children: ReactNode;
8
+ };
9
+ export declare function ConditionalPopover({ tip, withPopover, isOpen, onOpenChange, children }: ConditionalPopoverProps): string | number | boolean | Iterable<ReactNode> | import("react/jsx-runtime").JSX.Element | null | undefined;
10
+ export {};
@@ -0,0 +1,18 @@
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.ConditionalPopover = ConditionalPopover;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const popover_1 = require("@snack-uikit/popover");
9
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
10
+ function ConditionalPopover({ tip, withPopover, isOpen, onOpenChange, children }) {
11
+ if (withPopover) {
12
+ return ((0, jsx_runtime_1.jsx)(popover_1.Popover, { className: styles_module_scss_1.default.popover, open: isOpen, onOpenChange: () => {
13
+ if (!open)
14
+ onOpenChange(false);
15
+ }, tip: tip, trigger: 'click', placement: 'bottom-start', children: children }));
16
+ }
17
+ return children;
18
+ }
@@ -0,0 +1,6 @@
1
+ .popover{
2
+ max-height:80%;
3
+ }
4
+ .popover > div{
5
+ overflow:auto;
6
+ }
@@ -0,0 +1,9 @@
1
+ import { TreeNodeProps } from '@snack-uikit/tree';
2
+ type MenuProps = {
3
+ menuTitle?: string;
4
+ menuItems: TreeNodeProps[];
5
+ enableShrinkMenuButton?: boolean;
6
+ withDefaultOpenedMenuList?: boolean;
7
+ };
8
+ export declare function Menu({ menuTitle, menuItems, enableShrinkMenuButton, withDefaultOpenedMenuList }: MenuProps): import("react/jsx-runtime").JSX.Element;
9
+ export {};
@@ -0,0 +1,25 @@
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.Menu = Menu;
7
+ const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const react_1 = require("react");
9
+ const uikit_product_icons_1 = require("@cloud-ru/uikit-product-icons");
10
+ const uikit_product_locale_1 = require("@cloud-ru/uikit-product-locale");
11
+ const button_1 = require("@snack-uikit/button");
12
+ const tree_1 = require("@snack-uikit/tree");
13
+ const typography_1 = require("@snack-uikit/typography");
14
+ const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
15
+ const utils_1 = require("./utils");
16
+ function Menu({ menuTitle, menuItems, enableShrinkMenuButton = true, withDefaultOpenedMenuList }) {
17
+ const { t } = (0, uikit_product_locale_1.useLocale)('PageLayout');
18
+ const allExpandedNodes = (0, react_1.useMemo)(() => (0, utils_1.getExpandedNodes)(menuItems), [menuItems]);
19
+ const [expandedNodes, setExpandedNodes] = (0, react_1.useState)(withDefaultOpenedMenuList ? allExpandedNodes : []);
20
+ const isExpanded = expandedNodes.length > 0;
21
+ const handleExpandAll = () => setExpandedNodes((0, utils_1.getExpandedNodes)(menuItems));
22
+ const handleCollapseAll = () => setExpandedNodes([]);
23
+ const showSubheader = Boolean(menuTitle || enableShrinkMenuButton);
24
+ return ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.sidebar, children: [showSubheader && ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.subheader, children: [(0, jsx_runtime_1.jsx)(typography_1.Typography.SansTitleM, { children: menuTitle }), enableShrinkMenuButton && ((0, jsx_runtime_1.jsx)(button_1.ButtonSimple, { label: isExpanded ? t('TreeNavigation.collapseAll') : t('TreeNavigation.expandAll'), icon: (0, jsx_runtime_1.jsx)(uikit_product_icons_1.HorizontalMenuCloseSVG, {}), onClick: isExpanded ? handleCollapseAll : handleExpandAll }))] })), (0, jsx_runtime_1.jsx)(tree_1.Tree, { data: menuItems, selectionMode: 'single', expandedNodes: expandedNodes, onExpand: setExpandedNodes })] }));
25
+ }
@@ -0,0 +1,12 @@
1
+ .sidebar{
2
+ min-width:292px;
3
+ display:flex;
4
+ flex-direction:column;
5
+ gap:12px;
6
+ }
7
+
8
+ .subheader{
9
+ display:flex;
10
+ align-items:center;
11
+ justify-content:space-between;
12
+ }
@@ -0,0 +1,7 @@
1
+ import { TreeNodeProps } from '@snack-uikit/tree';
2
+ /**
3
+ * Рекурсивно собирает все ID узлов дерева для их разворачивания
4
+ * @param nodes - Массив узлов дерева
5
+ * @returns Массив ID всех узлов (включая вложенные)
6
+ */
7
+ export declare const getExpandedNodes: (nodes: TreeNodeProps[]) => string[];
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getExpandedNodes = void 0;
4
+ /**
5
+ * Рекурсивно собирает все ID узлов дерева для их разворачивания
6
+ * @param nodes - Массив узлов дерева
7
+ * @returns Массив ID всех узлов (включая вложенные)
8
+ */
9
+ const getExpandedNodes = (nodes) => {
10
+ if (!nodes || nodes.length === 0) {
11
+ return [];
12
+ }
13
+ const ids = [];
14
+ nodes.forEach(el => {
15
+ const children = el.nested ? (0, exports.getExpandedNodes)(el.nested) : [];
16
+ ids.push(el.id, ...children);
17
+ });
18
+ return ids;
19
+ };
20
+ exports.getExpandedNodes = getExpandedNodes;
@@ -0,0 +1,2 @@
1
+ export { Menu } from './Menu/Menu';
2
+ export { ConditionalPopover } from './ConditionalPopover/ConditionalPopover';
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ConditionalPopover = exports.Menu = void 0;
4
+ var Menu_1 = require("./Menu/Menu");
5
+ Object.defineProperty(exports, "Menu", { enumerable: true, get: function () { return Menu_1.Menu; } });
6
+ var ConditionalPopover_1 = require("./ConditionalPopover/ConditionalPopover");
7
+ Object.defineProperty(exports, "ConditionalPopover", { enumerable: true, get: function () { return ConditionalPopover_1.ConditionalPopover; } });
@@ -0,0 +1 @@
1
+ export * from './TreeNavigation';
@@ -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("./TreeNavigation"), exports);
@@ -0,0 +1,82 @@
1
+ .root{
2
+ display:flex;
3
+ flex-direction:column;
4
+ height:100%;
5
+ width:100%;
6
+ }
7
+
8
+ .header{
9
+ width:100%;
10
+ display:flex;
11
+ justify-content:space-between;
12
+ align-items:flex-start;
13
+ gap:40px;
14
+ padding:8px 24px;
15
+ background-color:var(--sys-neutral-background, #eeeff3);
16
+ border-bottom:1px solid var(--sys-neutral-decor-default, #dde0ea);
17
+ box-sizing:border-box;
18
+ }
19
+
20
+ .description{
21
+ color:var(--sys-neutral-text-support, #6d707f);
22
+ }
23
+
24
+ .body{
25
+ display:flex;
26
+ gap:16px;
27
+ padding:0 24px;
28
+ box-sizing:border-box;
29
+ width:100%;
30
+ }
31
+
32
+ .sidebar{
33
+ border-radius:12px;
34
+ padding:16px;
35
+ height:-moz-max-content;
36
+ height:max-content;
37
+ background:var(--sys-neutral-background1-level, #fdfdfd);
38
+ }
39
+
40
+ .main{
41
+ padding-top:16px;
42
+ width:100%;
43
+ box-sizing:border-box;
44
+ }
45
+
46
+ .titleWrapper{
47
+ display:flex;
48
+ align-items:center;
49
+ flex-wrap:wrap;
50
+ -moz-column-gap:16px;
51
+ column-gap:16px;
52
+ row-gap:8px;
53
+ }
54
+
55
+ .titleInner{
56
+ display:flex;
57
+ gap:8px;
58
+ }
59
+
60
+ .title{
61
+ box-sizing:border-box;
62
+ max-width:100%;
63
+ margin:0;
64
+ padding:0;
65
+ overflow-wrap:break-word;
66
+ }
67
+
68
+ .innerElement{
69
+ display:flex;
70
+ align-items:center;
71
+ justify-content:center;
72
+ height:var(--sans-title-l-line-height, 28px);
73
+ }
74
+
75
+ .icon{
76
+ display:flex;
77
+ align-items:center;
78
+ justify-content:center;
79
+ width:24px;
80
+ height:24px;
81
+ flex-shrink:0;
82
+ }
@@ -4,3 +4,4 @@ export * from './PageLoading';
4
4
  export * from './PageServices';
5
5
  export * from './DefaultSubHeader';
6
6
  export * from './PageSidebar';
7
+ export * from './TreeNavigation';
@@ -20,3 +20,4 @@ __exportStar(require("./PageLoading"), exports);
20
20
  __exportStar(require("./PageServices"), exports);
21
21
  __exportStar(require("./DefaultSubHeader"), exports);
22
22
  __exportStar(require("./PageSidebar"), exports);
23
+ __exportStar(require("./TreeNavigation"), exports);
@@ -1,6 +1,6 @@
1
1
  import { ReactNode } from 'react';
2
- import { CopyLineProps } from '@sbercloud/uikit-product-copy-line';
3
- import { WithSupportProps } from '@sbercloud/uikit-product-utils';
2
+ import { CopyLineProps } from '@cloud-ru/uikit-product-copy-line';
3
+ import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
4
4
  export type DefaultSubHeaderProps = WithSupportProps<{
5
5
  label: string;
6
6
  value: CopyLineProps;
@@ -10,8 +10,8 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
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';
13
+ import { CopyLine } from '@cloud-ru/uikit-product-copy-line';
14
+ import { extractSupportProps } from '@cloud-ru/uikit-product-utils';
15
15
  import { QuestionTooltip } from '@snack-uikit/tooltip';
16
16
  import styles from './styles.module.css';
17
17
  export function DefaultSubHeader(_a) {
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { WithSupportProps } from '@sbercloud/uikit-product-utils';
2
+ import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
3
3
  export type HeadlineProps = WithSupportProps<{
4
4
  title: string;
5
5
  beforeHeadline?: ReactNode;
@@ -10,7 +10,7 @@ var __rest = (this && this.__rest) || function (s, e) {
10
10
  return t;
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
- import { extractSupportProps } from '@sbercloud/uikit-product-utils';
13
+ import { extractSupportProps } from '@cloud-ru/uikit-product-utils';
14
14
  import { TruncateString } from '@snack-uikit/truncate-string';
15
15
  import { Typography } from '@snack-uikit/typography';
16
16
  import styles from './styles.module.css';
@@ -1,5 +1,5 @@
1
1
  import { PropsWithChildren } from 'react';
2
- import { WithSupportProps } from '@sbercloud/uikit-product-utils';
2
+ import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
3
3
  import { HeadlineProps } from '../Headline';
4
4
  export type PageCatalogProps = WithSupportProps<PropsWithChildren<Pick<HeadlineProps, 'title' | 'actions'> & {
5
5
  className?: string;
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import cn from 'classnames';
14
- import { extractSupportProps } from '@sbercloud/uikit-product-utils';
14
+ import { extractSupportProps } from '@cloud-ru/uikit-product-utils';
15
15
  import { Headline } from '../Headline';
16
16
  import styles from './styles.module.css';
17
17
  export function PageCatalog(_a) {
@@ -1,5 +1,5 @@
1
1
  import { PropsWithChildren, ReactNode } from 'react';
2
- import { WithSupportProps } from '@sbercloud/uikit-product-utils';
2
+ import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
3
3
  import { ButtonFilledProps, ButtonOutlineProps, ButtonSimpleProps } from '@snack-uikit/button';
4
4
  import { TooltipProps } from '@snack-uikit/tooltip';
5
5
  import { HeadlineProps } from '../Headline';
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
12
12
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
13
  import cn from 'classnames';
14
14
  import { useMemo } from 'react';
15
- import { extractSupportProps } from '@sbercloud/uikit-product-utils';
15
+ import { extractSupportProps } from '@cloud-ru/uikit-product-utils';
16
16
  import { ButtonFilled, ButtonOutline, ButtonSimple, } from '@snack-uikit/button';
17
17
  import { Headline } from '../Headline';
18
18
  import { useButtonWithTooltip, useGetButtonLabel } from './hooks';
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { useLocale } from '@sbercloud/uikit-product-locale';
2
+ import { useLocale } from '@cloud-ru/uikit-product-locale';
3
3
  import { Tooltip } from '@snack-uikit/tooltip';
4
4
  export function useButtonWithTooltip({ Button, tooltip, }) {
5
5
  if (tooltip) {
@@ -1,4 +1,4 @@
1
- import { WithSupportProps } from '@sbercloud/uikit-product-utils';
1
+ import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
2
2
  export type PageLoadingProps = WithSupportProps<{
3
3
  className?: string;
4
4
  }>;
@@ -11,7 +11,7 @@ var __rest = (this && this.__rest) || function (s, e) {
11
11
  };
12
12
  import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import cn from 'classnames';
14
- import { extractSupportProps } from '@sbercloud/uikit-product-utils';
14
+ import { extractSupportProps } from '@cloud-ru/uikit-product-utils';
15
15
  import { Spinner as UISpinner } from '@snack-uikit/loaders';
16
16
  import styles from './styles.module.css';
17
17
  export function PageLoading(_a) {
@@ -1,5 +1,5 @@
1
1
  import { PropsWithChildren } from 'react';
2
- import { WithSupportProps } from '@sbercloud/uikit-product-utils';
2
+ import { WithSupportProps } from '@cloud-ru/uikit-product-utils';
3
3
  import { HeadlineProps } from '../Headline';
4
4
  import { PageSidebarProps } from '../PageSidebar';
5
5
  export type PageServicesProps = WithSupportProps<PropsWithChildren<Pick<HeadlineProps, 'title' | 'actions' | 'subHeader' | 'afterHeadline' | 'beforeHeadline' | 'truncateTitle'> & {