@cloud-ru/ds-uikit-product-header-legacy 0.1.21 → 0.1.22-preview-71f1139f.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/components/HeaderLayout/HeaderLayout.js +1 -12
- package/dist/cjs/components/HeaderLayout/styles.module.css +13 -5
- package/dist/cjs/components/MainMenu/helperComponents/MenuDesktop/MenuDesktop.js +1 -1
- package/dist/cjs/components/MainMenu/helperComponents/MenuDesktop/styles.module.css +9 -7
- package/dist/cjs/components/MainMenu/helperComponents/MenuMobile/MenuMobile.js +1 -11
- package/dist/cjs/components/MainMenu/helperComponents/MenuMobile/styles.module.css +2 -11
- package/dist/cjs/components/MainMenu/helperComponents/NavigationSearch/styles.module.css +1 -0
- package/dist/cjs/components/MainMenu/helperComponents/ServicesCategory/styles.module.css +31 -2
- package/dist/cjs/style.css +56 -25
- package/dist/esm/components/HeaderLayout/HeaderLayout.js +1 -12
- package/dist/esm/components/HeaderLayout/styles.module.css +13 -5
- package/dist/esm/components/MainMenu/helperComponents/MenuDesktop/MenuDesktop.js +1 -1
- package/dist/esm/components/MainMenu/helperComponents/MenuDesktop/styles.module.css +9 -7
- package/dist/esm/components/MainMenu/helperComponents/MenuMobile/MenuMobile.js +1 -11
- package/dist/esm/components/MainMenu/helperComponents/MenuMobile/styles.module.css +2 -11
- package/dist/esm/components/MainMenu/helperComponents/NavigationSearch/styles.module.css +1 -0
- package/dist/esm/components/MainMenu/helperComponents/ServicesCategory/styles.module.css +31 -2
- package/dist/esm/style.css +56 -25
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/tsconfig.esm.tsbuildinfo +1 -1
- package/package.json +18 -19
- package/src/components/HeaderLayout/HeaderLayout.tsx +3 -20
- package/src/components/HeaderLayout/styles.module.scss +18 -6
- package/src/components/MainMenu/helperComponents/MenuDesktop/MenuDesktop.tsx +16 -12
- package/src/components/MainMenu/helperComponents/MenuDesktop/styles.module.scss +10 -9
- package/src/components/MainMenu/helperComponents/MenuMobile/MenuMobile.tsx +71 -83
- package/src/components/MainMenu/helperComponents/MenuMobile/styles.module.scss +3 -15
- package/src/components/MainMenu/helperComponents/NavigationSearch/styles.module.scss +1 -0
- package/src/components/MainMenu/helperComponents/ServicesCategory/styles.module.scss +45 -12
- package/src/components/MainMenu/styles.module.scss +1 -0
|
@@ -6,20 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.HeaderLayout = HeaderLayout;
|
|
7
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
8
|
const divider_1 = require("@cloud-ru/ds-divider");
|
|
9
|
-
const theme_1 = require("@cloud-ru/ds-theme");
|
|
10
9
|
const utils_1 = require("@cloud-ru/ds-utils");
|
|
11
10
|
const classnames_1 = __importDefault(require("classnames"));
|
|
12
|
-
const react_1 = require("react");
|
|
13
11
|
const styles_module_scss_1 = __importDefault(require('./styles.module.css'));
|
|
14
12
|
function HeaderLayout({ menu, logo, select, breadcrumbs, toolbar, className, isMobile = false, ...rest }) {
|
|
15
|
-
|
|
16
|
-
const header = ((0, jsx_runtime_1.jsxs)("header", { ref: headerRef, className: (0, classnames_1.default)(styles_module_scss_1.default.header, className), ...(0, utils_1.extractSupportProps)(rest), children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.top, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.left, children: [menu, logo, !isMobile && select && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(divider_1.Divider, { orientation: 'vertical' }), select] })), !isMobile && breadcrumbs && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(divider_1.Divider, { orientation: 'vertical' }), breadcrumbs] }))] }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.right, children: toolbar })] }), (0, jsx_runtime_1.jsx)(divider_1.Divider, { orientation: 'horizontal' }), isMobile && Boolean(breadcrumbs) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.bottom, children: breadcrumbs }), (0, jsx_runtime_1.jsx)(divider_1.Divider, { orientation: 'horizontal' })] }))] }));
|
|
17
|
-
// Временная фиксация: на mobile прикладная тема переключилась на compact, а шапка сверстана
|
|
18
|
-
// под comfort и на compact ещё не переехала. Провайдер (а не класс на `<header>`) нужен потому,
|
|
19
|
-
// что поверхности шапки — порталы: они переэмитят набор `sn-*` из контекста на своём корне,
|
|
20
|
-
// и класс, поставленный поверх, проиграл бы их собственному.
|
|
21
|
-
if (isMobile) {
|
|
22
|
-
return ((0, jsx_runtime_1.jsx)(theme_1.ChildThemeProvider, { value: { density: theme_1.DENSITY.Comfort }, rootRef: headerRef, children: header }));
|
|
23
|
-
}
|
|
24
|
-
return header;
|
|
13
|
+
return ((0, jsx_runtime_1.jsxs)("header", { className: (0, classnames_1.default)(styles_module_scss_1.default.header, className), "data-mobile": isMobile || undefined, ...(0, utils_1.extractSupportProps)(rest), children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.top, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.left, children: [menu, logo, !isMobile && select && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(divider_1.Divider, { orientation: 'vertical' }), select] })), !isMobile && breadcrumbs && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(divider_1.Divider, { orientation: 'vertical' }), breadcrumbs] }))] }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.right, children: toolbar })] }), (0, jsx_runtime_1.jsx)(divider_1.Divider, { orientation: 'horizontal' }), isMobile && Boolean(breadcrumbs) && ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.bottom, children: breadcrumbs }), (0, jsx_runtime_1.jsx)(divider_1.Divider, { orientation: 'horizontal' })] }))] }));
|
|
25
14
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
.header{
|
|
2
|
-
box-sizing:border-box;
|
|
3
|
-
background-color:var(--sn-theme-color-neutral-background, var(--sn-brand-color-neutral-90, var(--sn-brand-palette-gray-90, #eeeff3)));
|
|
4
|
-
}
|
|
5
|
-
|
|
6
1
|
.top{
|
|
7
2
|
display:flex;
|
|
8
3
|
gap:var(--sn-primitive-dimension-8, 8px);
|
|
@@ -36,4 +31,17 @@
|
|
|
36
31
|
gap:var(--sn-primitive-dimension-8, 8px);
|
|
37
32
|
align-items:center;
|
|
38
33
|
height:100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.header{
|
|
37
|
+
box-sizing:border-box;
|
|
38
|
+
background-color:var(--sn-theme-color-neutral-background, var(--sn-brand-color-neutral-90, var(--sn-brand-palette-gray-90, #eeeff3)));
|
|
39
|
+
}
|
|
40
|
+
.header[data-mobile] .top{
|
|
41
|
+
gap:var(--sn-primitive-dimension-4, 4px);
|
|
42
|
+
padding:0 var(--sn-primitive-dimension-4, 4px);
|
|
43
|
+
}
|
|
44
|
+
.header[data-mobile] .left,
|
|
45
|
+
.header[data-mobile] .right{
|
|
46
|
+
gap:var(--sn-primitive-dimension-4, 4px);
|
|
39
47
|
}
|
|
@@ -59,5 +59,5 @@ function MenuDesktop({ open: openProp, setOpen: setOpenProp, settingItems, platf
|
|
|
59
59
|
const hasBottomItems = Boolean(settingItems?.items.length) || Boolean(sidebarBottomSlot);
|
|
60
60
|
const searchValue = search?.searchValue;
|
|
61
61
|
const showSearch = Boolean(search) && !isInitialEmptyCards && (resultItems.length > 0 || Boolean(searchValue));
|
|
62
|
-
return ((0, jsx_runtime_1.jsx)(drawer_1.DrawerCustom, { open: open, onClose: handleCloseDrawer, position: 'left', width: isNeedRightBlock ? constants_1.DEFAULT_DRAWER_WIDTH : constants_1.LEFT_COLUMN_WIDTH, showButtonClosed: false, className: styles_module_scss_1.default.drawer, "data-test-id": constants_1.TEST_IDS.drawer, children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.menu, "data-test-id": constants_1.TEST_IDS.content, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.left, "data-test-id": constants_1.TEST_IDS.left, children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.leftTop, "data-test-id": constants_1.TEST_IDS.leftTop, children: leftTop }), !isInitialEmptyCards ? ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.leftMain, children: (0, jsx_runtime_1.jsx)(scroll_1.Scroll, { className: styles_module_scss_1.default.leftMainScroll, overflow: { x: 'hidden' }, barHideStrategy: 'never', "data-test-id": constants_1.TEST_IDS.leftNavList, size: 's', children: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.items, children: navGroupItems.map(item => ((0, jsx_runtime_1.jsx)(uikit_product_card_predefined_1.CardServiceLight, { as: 'button', type: 'button', title: item.label, onClick: item.onClick, truncate: { title: 2 }, className: styles_module_scss_1.default.item, "data-test-id": constants_1.TEST_IDS.navGroup(item.id) }, item.id))) }) }) })) : null, !leftTop && isInitialEmptyCards ? (0, jsx_runtime_1.jsx)("div", {}) : null, hasBottomItems ? ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.leftBottom, "data-test-id": constants_1.TEST_IDS.leftBottom, children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.leftBottomDivider, children: (0, jsx_runtime_1.jsx)(divider_1.Divider, {}) }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.leftBottomItems, "data-test-id": constants_1.TEST_IDS.leftBottomItems, children: [settingItems?.items.map(item => ((0, react_1.createElement)(uikit_product_card_predefined_1.CardServiceLight, { ...(item.href ? { href: item.href, as: 'a' } : { as: 'button', type: 'button' }), key: item.id, title: item.label, icon: (0, utils_2.getLinkEmblem)(item), onClick: wrappedSettingClick(item), disabled: item.disabled, className: styles_module_scss_1.default.leftBottomCard, "data-test-id": constants_1.TEST_IDS.setting(item.id) }))), sidebarBottomSlot] })] })) : null] }), isNeedRightBlock ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(divider_1.Divider, { orientation: 'vertical', className: styles_module_scss_1.default.divider, "data-test-id": constants_1.TEST_IDS.divider }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.right, "data-test-id": constants_1.TEST_IDS.right, children: [showSearch && search ? ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.searchWrap, "data-test-id": constants_1.TEST_IDS.search, children: (0, jsx_runtime_1.jsx)(NavigationSearch_1.NavigationSearch, { ref: searchRef, value: search.searchValue, onChange: search.onSearchValueChange, options: search.searchFunctions.map(fn => ({ id: fn.id, label: fn.label })), selectedOption: search.searchFn ?? search.searchFunctions[0]?.id ?? 'fuzzy', onSelectedOptionChange: search.onChangeSearchFn }) })) : null, (0, jsx_runtime_1.jsxs)(scroll_1.Scroll, { paddingAbsolute: true, className: styles_module_scss_1.default.scroll, ref: scrollRef, barHideStrategy: 'never', children: [isInitialEmptyCards && rightTop ? (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.bannersWrap, children: rightTop }) : null, !isInitialEmptyCards ? ((0, jsx_runtime_1.jsx)(Content_1.Content, { onClose: handleCloseDrawer, className: styles_module_scss_1.default.rightContent, searchValue: searchValue, banners: rightTop, favorite: favorite, serviceGroups: resultItems, onLinkChange: onLinkChange })) : null] })] })] })) : null] }) }));
|
|
62
|
+
return ((0, jsx_runtime_1.jsx)(drawer_1.DrawerCustom, { open: open, onClose: handleCloseDrawer, position: 'left', width: isNeedRightBlock ? constants_1.DEFAULT_DRAWER_WIDTH : constants_1.LEFT_COLUMN_WIDTH, showButtonClosed: false, className: styles_module_scss_1.default.drawer, "data-test-id": constants_1.TEST_IDS.drawer, children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.menu, "data-test-id": constants_1.TEST_IDS.content, children: [(0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.left, "data-test-id": constants_1.TEST_IDS.left, children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.leftTop, "data-test-id": constants_1.TEST_IDS.leftTop, children: leftTop }), !isInitialEmptyCards ? ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.leftMain, children: (0, jsx_runtime_1.jsx)(scroll_1.Scroll, { className: styles_module_scss_1.default.leftMainScroll, overflow: { x: 'hidden' }, barHideStrategy: 'never', "data-test-id": constants_1.TEST_IDS.leftNavList, size: 's', children: (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.items, children: navGroupItems.map(item => ((0, jsx_runtime_1.jsx)(uikit_product_card_predefined_1.CardServiceLight, { as: 'button', type: 'button', title: item.label, onClick: item.onClick, truncate: { title: 2 }, className: styles_module_scss_1.default.item, "data-test-id": constants_1.TEST_IDS.navGroup(item.id) }, item.id))) }) }) })) : null, !leftTop && isInitialEmptyCards ? (0, jsx_runtime_1.jsx)("div", {}) : null, hasBottomItems ? ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.leftBottom, "data-test-id": constants_1.TEST_IDS.leftBottom, children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.leftBottomDivider, children: (0, jsx_runtime_1.jsx)(divider_1.Divider, {}) }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.leftBottomItems, "data-test-id": constants_1.TEST_IDS.leftBottomItems, children: [settingItems?.items.length ? ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.leftBottomCards, children: settingItems.items.map(item => ((0, react_1.createElement)(uikit_product_card_predefined_1.CardServiceLight, { ...(item.href ? { href: item.href, as: 'a' } : { as: 'button', type: 'button' }), key: item.id, title: item.label, icon: (0, utils_2.getLinkEmblem)(item), onClick: wrappedSettingClick(item), disabled: item.disabled, className: styles_module_scss_1.default.leftBottomCard, "data-test-id": constants_1.TEST_IDS.setting(item.id) }))) })) : null, sidebarBottomSlot] })] })) : null] }), isNeedRightBlock ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(divider_1.Divider, { orientation: 'vertical', className: styles_module_scss_1.default.divider, "data-test-id": constants_1.TEST_IDS.divider }), (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.right, "data-test-id": constants_1.TEST_IDS.right, children: [showSearch && search ? ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.searchWrap, "data-test-id": constants_1.TEST_IDS.search, children: (0, jsx_runtime_1.jsx)(NavigationSearch_1.NavigationSearch, { ref: searchRef, value: search.searchValue, onChange: search.onSearchValueChange, options: search.searchFunctions.map(fn => ({ id: fn.id, label: fn.label })), selectedOption: search.searchFn ?? search.searchFunctions[0]?.id ?? 'fuzzy', onSelectedOptionChange: search.onChangeSearchFn }) })) : null, (0, jsx_runtime_1.jsxs)(scroll_1.Scroll, { paddingAbsolute: true, className: styles_module_scss_1.default.scroll, ref: scrollRef, barHideStrategy: 'never', children: [isInitialEmptyCards && rightTop ? (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.bannersWrap, children: rightTop }) : null, !isInitialEmptyCards ? ((0, jsx_runtime_1.jsx)(Content_1.Content, { onClose: handleCloseDrawer, className: styles_module_scss_1.default.rightContent, searchValue: searchValue, banners: rightTop, favorite: favorite, serviceGroups: resultItems, onLinkChange: onLinkChange })) : null] })] })] })) : null] }) }));
|
|
63
63
|
}
|
|
@@ -56,9 +56,6 @@
|
|
|
56
56
|
padding-right:var(--sn-primitive-dimension-16, 16px);
|
|
57
57
|
padding-left:var(--sn-primitive-dimension-16, 16px);
|
|
58
58
|
}
|
|
59
|
-
.items > div{
|
|
60
|
-
gap:var(--sn-primitive-dimension-4, 4px);
|
|
61
|
-
}
|
|
62
59
|
|
|
63
60
|
.item{
|
|
64
61
|
flex-shrink:0;
|
|
@@ -75,16 +72,21 @@
|
|
|
75
72
|
|
|
76
73
|
.leftBottomDivider{
|
|
77
74
|
width:100%;
|
|
78
|
-
padding:var(--sn-list-anatomy-size-s-listItem-paddingVertical, var(--sn-density-spacing-control-container-vertical-s, var(--sn-platform-comfort-spacing-control-container-vertical-s, var(--sn-platform-comfort-scale-025-2xs, var(--sn-primitive-dimension-2, 2px))))) var(--sn-list-anatomy-size-s-listItem-paddingHorizontal, var(--sn-density-spacing-control-container-horizontal-s, var(--sn-platform-comfort-spacing-control-container-horizontal-s, var(--sn-platform-comfort-scale-050-2xs, var(--sn-primitive-dimension-4, 4px)))));
|
|
79
75
|
}
|
|
80
76
|
|
|
81
77
|
.leftBottomItems{
|
|
82
78
|
display:flex;
|
|
83
79
|
flex-direction:column;
|
|
84
|
-
gap:var(--sn-primitive-dimension-
|
|
80
|
+
gap:var(--sn-primitive-dimension-16, 16px);
|
|
85
81
|
padding:0 var(--sn-primitive-dimension-16, 16px) var(--sn-primitive-dimension-16, 16px);
|
|
86
82
|
}
|
|
87
83
|
|
|
84
|
+
.leftBottomCards{
|
|
85
|
+
display:flex;
|
|
86
|
+
flex-direction:column;
|
|
87
|
+
gap:var(--sn-primitive-dimension-4, 4px);
|
|
88
|
+
}
|
|
89
|
+
|
|
88
90
|
.leftBottomCard{
|
|
89
91
|
width:100%;
|
|
90
92
|
}
|
|
@@ -107,7 +109,7 @@
|
|
|
107
109
|
.searchWrap{
|
|
108
110
|
flex-shrink:0;
|
|
109
111
|
box-sizing:border-box;
|
|
110
|
-
padding:var(--sn-primitive-dimension-16, 16px) var(--sn-primitive-dimension-16, 16px) 0
|
|
112
|
+
padding:var(--sn-primitive-dimension-16, 16px) var(--sn-primitive-dimension-16, 16px) 0;
|
|
111
113
|
background-color:var(--sn-theme-color-neutral-background, var(--sn-brand-color-neutral-90, var(--sn-brand-palette-gray-90, #eeeff3)));
|
|
112
114
|
}
|
|
113
115
|
|
|
@@ -115,7 +117,7 @@
|
|
|
115
117
|
flex:1 1 auto;
|
|
116
118
|
box-sizing:border-box;
|
|
117
119
|
min-height:0;
|
|
118
|
-
padding:0 var(--sn-primitive-dimension-16, 16px)
|
|
120
|
+
padding:0 var(--sn-primitive-dimension-16, 16px);
|
|
119
121
|
}
|
|
120
122
|
.scroll:only-child{
|
|
121
123
|
padding-top:var(--sn-primitive-dimension-16, 16px);
|
|
@@ -8,10 +8,8 @@ const react_1 = require("react");
|
|
|
8
8
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
9
9
|
const adaptive_1 = require("@cloud-ru/ds-adaptive");
|
|
10
10
|
const divider_1 = require("@cloud-ru/ds-divider");
|
|
11
|
-
const theme_1 = require("@cloud-ru/ds-theme");
|
|
12
11
|
const uikit_product_card_predefined_1 = require("@cloud-ru/ds-uikit-product-card-predefined");
|
|
13
12
|
const utils_1 = require("@cloud-ru/ds-utils");
|
|
14
|
-
const classnames_1 = __importDefault(require("classnames"));
|
|
15
13
|
const react_2 = require("react");
|
|
16
14
|
const locale_1 = require("../../../../locale");
|
|
17
15
|
const shouldBeOpenedInNewTab_1 = require("../../../../utils/shouldBeOpenedInNewTab");
|
|
@@ -52,13 +50,5 @@ function MenuMobile({ open: openProp, setOpen: setOpenProp, settingItems, platfo
|
|
|
52
50
|
const searchValue = search?.searchValue;
|
|
53
51
|
const showSearch = Boolean(search) && !isInitialEmptyCards && (resultItems.length > 0 || Boolean(searchValue));
|
|
54
52
|
const hasBottomItems = Boolean(settingItems?.items.length);
|
|
55
|
-
|
|
56
|
-
// `HeaderLayout`, поэтому объявляем плотность здесь же. Провайдер задаёт контекст (его читают
|
|
57
|
-
// вложенные поверхности, которые переэмитят тему на своём корне), класс — сам дровер: он тему
|
|
58
|
-
// из контекста не переэмитит и иначе остался бы с плотностью приложения.
|
|
59
|
-
const comfortThemeClassName = (0, theme_1.useThemeClassnames)({ density: theme_1.DENSITY.Comfort });
|
|
60
|
-
return (
|
|
61
|
-
// Обёртка провайдера layout-прозрачная (`display: contents`) — меню рендерится порталом,
|
|
62
|
-
// лишний бокс в строке шапки не нужен.
|
|
63
|
-
(0, jsx_runtime_1.jsx)(theme_1.ChildThemeProvider, { value: { density: theme_1.DENSITY.Comfort }, className: styles_module_scss_1.default.densityScope, children: (0, jsx_runtime_1.jsx)(desktopDrawer_1.DesktopDrawerCustom, { open: open, onClose: handleCloseDrawer, position: 'left', width: 's', className: (0, classnames_1.default)(styles_module_scss_1.default.drawerMobile, comfortThemeClassName), closeOnPopstate: true, "data-test-id": constants_1.TEST_IDS.drawerMobile, children: (0, jsx_runtime_1.jsxs)(adaptive_1.AdaptiveProvider, { layoutType: layoutType, children: [(0, jsx_runtime_1.jsx)(desktopDrawer_1.DesktopDrawerCustom.Header, { title: t('mainMenu.navigation'), className: styles_module_scss_1.default.header }), (0, jsx_runtime_1.jsx)(desktopDrawer_1.DesktopDrawerCustom.Body, { bodyPadding: false, className: styles_module_scss_1.default.scrollBody, children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.scrollMobile, children: [leftTop ? (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.leftTop, children: leftTop }) : null, !isInitialEmptyCards ? ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.main, children: [showSearch && search ? ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.searchItem, "data-test-id": constants_1.TEST_IDS.search, children: (0, jsx_runtime_1.jsx)(NavigationSearch_1.NavigationSearch, { ref: searchRef, value: search.searchValue, onChange: search.onSearchValueChange, onBlur: search.onBlur, onFocus: search.onFocus, options: search.searchFunctions.map(fn => ({ id: fn.id, label: fn.label })), selectedOption: search.searchFn ?? search.searchFunctions[0]?.id ?? 'fuzzy', onSelectedOptionChange: search.onChangeSearchFn }) })) : null, (0, jsx_runtime_1.jsx)(Content_1.Content, { isMobile: true, onClose: handleCloseDrawer, onLinkChange: onLinkChange, className: styles_module_scss_1.default.content, searchValue: searchValue, banners: rightTop, favorite: favorite, serviceGroups: resultItems })] })) : null, isInitialEmptyCards && rightTop ? (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.bannersWrap, children: rightTop }) : null, hasBottomItems ? ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.bottom, "data-test-id": constants_1.TEST_IDS.leftBottom, children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.bottomDivider, children: (0, jsx_runtime_1.jsx)(divider_1.Divider, {}) }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.bottomItems, "data-test-id": constants_1.TEST_IDS.leftBottomItems, children: settingItems?.items.map(item => ((0, react_1.createElement)(uikit_product_card_predefined_1.CardServiceLight, { ...(item.href ? { href: item.href, as: 'a' } : { as: 'button', type: 'button' }), key: item.id, title: item.label, icon: (0, utils_2.getLinkEmblem)(item), onClick: wrappedSettingClick(item), disabled: item.disabled, className: styles_module_scss_1.default.bottomCard, "data-test-id": constants_1.TEST_IDS.setting(item.id) }))) })] })) : null] }) })] }) }) }));
|
|
53
|
+
return ((0, jsx_runtime_1.jsx)(desktopDrawer_1.DesktopDrawerCustom, { open: open, onClose: handleCloseDrawer, position: 'left', width: 's', className: styles_module_scss_1.default.drawerMobile, closeOnPopstate: true, "data-test-id": constants_1.TEST_IDS.drawerMobile, children: (0, jsx_runtime_1.jsxs)(adaptive_1.AdaptiveProvider, { layoutType: layoutType, children: [(0, jsx_runtime_1.jsx)(desktopDrawer_1.DesktopDrawerCustom.Header, { title: t('mainMenu.navigation') }), (0, jsx_runtime_1.jsx)(desktopDrawer_1.DesktopDrawerCustom.Body, { className: styles_module_scss_1.default.scrollBody, children: (0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.scrollMobile, children: [leftTop ? (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.leftTop, children: leftTop }) : null, !isInitialEmptyCards ? ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.main, children: [showSearch && search ? ((0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.searchItem, "data-test-id": constants_1.TEST_IDS.search, children: (0, jsx_runtime_1.jsx)(NavigationSearch_1.NavigationSearch, { ref: searchRef, value: search.searchValue, onChange: search.onSearchValueChange, onBlur: search.onBlur, onFocus: search.onFocus, options: search.searchFunctions.map(fn => ({ id: fn.id, label: fn.label })), selectedOption: search.searchFn ?? search.searchFunctions[0]?.id ?? 'fuzzy', onSelectedOptionChange: search.onChangeSearchFn }) })) : null, (0, jsx_runtime_1.jsx)(Content_1.Content, { isMobile: true, onClose: handleCloseDrawer, onLinkChange: onLinkChange, className: styles_module_scss_1.default.content, searchValue: searchValue, banners: rightTop, favorite: favorite, serviceGroups: resultItems })] })) : null, isInitialEmptyCards && rightTop ? (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.bannersWrap, children: rightTop }) : null, hasBottomItems ? ((0, jsx_runtime_1.jsxs)("div", { className: styles_module_scss_1.default.bottom, "data-test-id": constants_1.TEST_IDS.leftBottom, children: [(0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.bottomDivider, children: (0, jsx_runtime_1.jsx)(divider_1.Divider, {}) }), (0, jsx_runtime_1.jsx)("div", { className: styles_module_scss_1.default.bottomItems, "data-test-id": constants_1.TEST_IDS.leftBottomItems, children: settingItems?.items.map(item => ((0, react_1.createElement)(uikit_product_card_predefined_1.CardServiceLight, { ...(item.href ? { href: item.href, as: 'a' } : { as: 'button', type: 'button' }), key: item.id, title: item.label, icon: (0, utils_2.getLinkEmblem)(item), onClick: wrappedSettingClick(item), disabled: item.disabled, className: styles_module_scss_1.default.bottomCard, "data-test-id": constants_1.TEST_IDS.setting(item.id) }))) })] })) : null] }) })] }) }));
|
|
64
54
|
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
.densityScope{
|
|
2
|
-
display:contents;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
1
|
.drawerMobile{
|
|
6
2
|
height:100%;
|
|
7
3
|
min-height:0;
|
|
@@ -19,11 +15,6 @@
|
|
|
19
15
|
gap:var(--sn-primitive-dimension-4, 4px);
|
|
20
16
|
box-sizing:border-box;
|
|
21
17
|
min-height:100%;
|
|
22
|
-
padding:0 var(--sn-primitive-dimension-16, 16px) var(--sn-primitive-dimension-16, 16px);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.header{
|
|
26
|
-
padding-top:var(--sn-primitive-dimension-12, 12px);
|
|
27
18
|
}
|
|
28
19
|
|
|
29
20
|
.leftTop{
|
|
@@ -76,13 +67,13 @@
|
|
|
76
67
|
|
|
77
68
|
.bottomDivider{
|
|
78
69
|
width:100%;
|
|
79
|
-
padding:var(--sn-
|
|
70
|
+
padding:var(--sn-primitive-dimension-2, 2px) 0;
|
|
80
71
|
}
|
|
81
72
|
|
|
82
73
|
.bottomItems{
|
|
83
74
|
display:flex;
|
|
84
75
|
flex-direction:column;
|
|
85
|
-
gap:
|
|
76
|
+
gap:0;
|
|
86
77
|
}
|
|
87
78
|
|
|
88
79
|
.bottomCard{
|
|
@@ -16,9 +16,37 @@
|
|
|
16
16
|
background-color:var(--sn-theme-color-neutral-background1Level, var(--sn-brand-color-neutral-95, var(--sn-brand-palette-gray-95, #fdfdfd)));
|
|
17
17
|
}
|
|
18
18
|
.root[data-highlight]{
|
|
19
|
+
--highlight-border-color-from:hsl(155deg 48% 42% / 100%);
|
|
20
|
+
--highlight-border-color-to:hsl(155deg 48% 42% / 32%);
|
|
21
|
+
--highlight-background-color-from:hsl(0deg 0% 99% / 20%);
|
|
22
|
+
--highlight-background-color-to:hsl(152deg 39% 79% / 12%);
|
|
23
|
+
--highlight-background-color:hsl(0deg 0% 99% / 100%);
|
|
24
|
+
isolation:isolate;
|
|
19
25
|
background-color:transparent;
|
|
20
|
-
|
|
21
|
-
|
|
26
|
+
}
|
|
27
|
+
.root[data-highlight]::before, .root[data-highlight]::after{
|
|
28
|
+
pointer-events:none;
|
|
29
|
+
content:"";
|
|
30
|
+
position:absolute;
|
|
31
|
+
z-index:-1;
|
|
32
|
+
}
|
|
33
|
+
.root[data-highlight]::before{
|
|
34
|
+
inset:0;
|
|
35
|
+
border-radius:inherit;
|
|
36
|
+
opacity:0.64;
|
|
37
|
+
background-image:linear-gradient(90deg, var(--highlight-border-color-from) 0%, var(--highlight-border-color-to) 50%, var(--highlight-border-color-from) 100%);
|
|
38
|
+
}
|
|
39
|
+
.root[data-highlight]::after{
|
|
40
|
+
inset:var(--sn-primitive-strokeWeight-strokeRegular, 1px);
|
|
41
|
+
border-radius:calc(var(--sn-density-radius-2xs, var(--sn-platform-comfort-radius-2xs, var(--sn-primitive-dimension-4, 4px))) - var(--sn-primitive-strokeWeight-strokeRegular, 1px));
|
|
42
|
+
background:linear-gradient(90deg, var(--highlight-background-color-from) 2.29%, var(--highlight-background-color-to) 97.84%), var(--highlight-background-color);
|
|
43
|
+
}
|
|
44
|
+
:global(.sn-dark) .root[data-highlight]{
|
|
45
|
+
--highlight-border-color-from:hsl(153deg 30% 55% / 100%);
|
|
46
|
+
--highlight-border-color-to:hsl(157deg 51% 19% / 100%);
|
|
47
|
+
--highlight-background-color-from:hsl(240deg 14% 16% / 100%);
|
|
48
|
+
--highlight-background-color-to:hsl(157deg 51% 19% / 20%);
|
|
49
|
+
--highlight-background-color:hsl(240deg 14% 16% / 100%);
|
|
22
50
|
}
|
|
23
51
|
|
|
24
52
|
.title{
|
|
@@ -47,6 +75,7 @@
|
|
|
47
75
|
}
|
|
48
76
|
.services[data-mobile]{
|
|
49
77
|
grid-template-columns:minmax(0, 1fr);
|
|
78
|
+
gap:0;
|
|
50
79
|
}
|
|
51
80
|
.services > *{
|
|
52
81
|
min-width:0;
|
package/dist/cjs/style.css
CHANGED
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
.header{
|
|
2
|
-
box-sizing:border-box;
|
|
3
|
-
background-color:var(--sn-theme-color-neutral-background, var(--sn-brand-color-neutral-90, var(--sn-brand-palette-gray-90, #eeeff3)));
|
|
4
|
-
}
|
|
5
|
-
|
|
6
1
|
.top{
|
|
7
2
|
display:flex;
|
|
8
3
|
gap:var(--sn-primitive-dimension-8, 8px);
|
|
@@ -37,6 +32,19 @@
|
|
|
37
32
|
align-items:center;
|
|
38
33
|
height:100%;
|
|
39
34
|
}
|
|
35
|
+
|
|
36
|
+
.header{
|
|
37
|
+
box-sizing:border-box;
|
|
38
|
+
background-color:var(--sn-theme-color-neutral-background, var(--sn-brand-color-neutral-90, var(--sn-brand-palette-gray-90, #eeeff3)));
|
|
39
|
+
}
|
|
40
|
+
.header[data-mobile] .top{
|
|
41
|
+
gap:var(--sn-primitive-dimension-4, 4px);
|
|
42
|
+
padding:0 var(--sn-primitive-dimension-4, 4px);
|
|
43
|
+
}
|
|
44
|
+
.header[data-mobile] .left,
|
|
45
|
+
.header[data-mobile] .right{
|
|
46
|
+
gap:var(--sn-primitive-dimension-4, 4px);
|
|
47
|
+
}
|
|
40
48
|
@charset "UTF-8";
|
|
41
49
|
.logoImg{
|
|
42
50
|
display:block;
|
|
@@ -159,9 +167,6 @@
|
|
|
159
167
|
padding-right:var(--sn-primitive-dimension-16, 16px);
|
|
160
168
|
padding-left:var(--sn-primitive-dimension-16, 16px);
|
|
161
169
|
}
|
|
162
|
-
.items > div{
|
|
163
|
-
gap:var(--sn-primitive-dimension-4, 4px);
|
|
164
|
-
}
|
|
165
170
|
|
|
166
171
|
.item{
|
|
167
172
|
flex-shrink:0;
|
|
@@ -178,16 +183,21 @@
|
|
|
178
183
|
|
|
179
184
|
.leftBottomDivider{
|
|
180
185
|
width:100%;
|
|
181
|
-
padding:var(--sn-list-anatomy-size-s-listItem-paddingVertical, var(--sn-density-spacing-control-container-vertical-s, var(--sn-platform-comfort-spacing-control-container-vertical-s, var(--sn-platform-comfort-scale-025-2xs, var(--sn-primitive-dimension-2, 2px))))) var(--sn-list-anatomy-size-s-listItem-paddingHorizontal, var(--sn-density-spacing-control-container-horizontal-s, var(--sn-platform-comfort-spacing-control-container-horizontal-s, var(--sn-platform-comfort-scale-050-2xs, var(--sn-primitive-dimension-4, 4px)))));
|
|
182
186
|
}
|
|
183
187
|
|
|
184
188
|
.leftBottomItems{
|
|
185
189
|
display:flex;
|
|
186
190
|
flex-direction:column;
|
|
187
|
-
gap:var(--sn-primitive-dimension-
|
|
191
|
+
gap:var(--sn-primitive-dimension-16, 16px);
|
|
188
192
|
padding:0 var(--sn-primitive-dimension-16, 16px) var(--sn-primitive-dimension-16, 16px);
|
|
189
193
|
}
|
|
190
194
|
|
|
195
|
+
.leftBottomCards{
|
|
196
|
+
display:flex;
|
|
197
|
+
flex-direction:column;
|
|
198
|
+
gap:var(--sn-primitive-dimension-4, 4px);
|
|
199
|
+
}
|
|
200
|
+
|
|
191
201
|
.leftBottomCard{
|
|
192
202
|
width:100%;
|
|
193
203
|
}
|
|
@@ -210,7 +220,7 @@
|
|
|
210
220
|
.searchWrap{
|
|
211
221
|
flex-shrink:0;
|
|
212
222
|
box-sizing:border-box;
|
|
213
|
-
padding:var(--sn-primitive-dimension-16, 16px) var(--sn-primitive-dimension-16, 16px) 0
|
|
223
|
+
padding:var(--sn-primitive-dimension-16, 16px) var(--sn-primitive-dimension-16, 16px) 0;
|
|
214
224
|
background-color:var(--sn-theme-color-neutral-background, var(--sn-brand-color-neutral-90, var(--sn-brand-palette-gray-90, #eeeff3)));
|
|
215
225
|
}
|
|
216
226
|
|
|
@@ -218,7 +228,7 @@
|
|
|
218
228
|
flex:1 1 auto;
|
|
219
229
|
box-sizing:border-box;
|
|
220
230
|
min-height:0;
|
|
221
|
-
padding:0 var(--sn-primitive-dimension-16, 16px)
|
|
231
|
+
padding:0 var(--sn-primitive-dimension-16, 16px);
|
|
222
232
|
}
|
|
223
233
|
.scroll:only-child{
|
|
224
234
|
padding-top:var(--sn-primitive-dimension-16, 16px);
|
|
@@ -246,10 +256,6 @@
|
|
|
246
256
|
.bannersWrap{
|
|
247
257
|
padding:var(--sn-primitive-dimension-4, 4px) var(--sn-primitive-dimension-8, 8px) var(--sn-primitive-dimension-8, 8px);
|
|
248
258
|
}
|
|
249
|
-
.densityScope{
|
|
250
|
-
display:contents;
|
|
251
|
-
}
|
|
252
|
-
|
|
253
259
|
.drawerMobile{
|
|
254
260
|
height:100%;
|
|
255
261
|
min-height:0;
|
|
@@ -267,11 +273,6 @@
|
|
|
267
273
|
gap:var(--sn-primitive-dimension-4, 4px);
|
|
268
274
|
box-sizing:border-box;
|
|
269
275
|
min-height:100%;
|
|
270
|
-
padding:0 var(--sn-primitive-dimension-16, 16px) var(--sn-primitive-dimension-16, 16px);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
.header{
|
|
274
|
-
padding-top:var(--sn-primitive-dimension-12, 12px);
|
|
275
276
|
}
|
|
276
277
|
|
|
277
278
|
.leftTop{
|
|
@@ -324,13 +325,13 @@
|
|
|
324
325
|
|
|
325
326
|
.bottomDivider{
|
|
326
327
|
width:100%;
|
|
327
|
-
padding:var(--sn-
|
|
328
|
+
padding:var(--sn-primitive-dimension-2, 2px) 0;
|
|
328
329
|
}
|
|
329
330
|
|
|
330
331
|
.bottomItems{
|
|
331
332
|
display:flex;
|
|
332
333
|
flex-direction:column;
|
|
333
|
-
gap:
|
|
334
|
+
gap:0;
|
|
334
335
|
}
|
|
335
336
|
|
|
336
337
|
.bottomCard{
|
|
@@ -340,6 +341,7 @@
|
|
|
340
341
|
display:flex;
|
|
341
342
|
flex-direction:column;
|
|
342
343
|
align-self:stretch;
|
|
344
|
+
box-sizing:border-box;
|
|
343
345
|
width:100%;
|
|
344
346
|
padding:var(--sn-primitive-dimension-4, 4px);
|
|
345
347
|
}
|
|
@@ -429,9 +431,37 @@
|
|
|
429
431
|
background-color:var(--sn-theme-color-neutral-background1Level, var(--sn-brand-color-neutral-95, var(--sn-brand-palette-gray-95, #fdfdfd)));
|
|
430
432
|
}
|
|
431
433
|
.root[data-highlight]{
|
|
434
|
+
--highlight-border-color-from:hsl(155deg 48% 42% / 100%);
|
|
435
|
+
--highlight-border-color-to:hsl(155deg 48% 42% / 32%);
|
|
436
|
+
--highlight-background-color-from:hsl(0deg 0% 99% / 20%);
|
|
437
|
+
--highlight-background-color-to:hsl(152deg 39% 79% / 12%);
|
|
438
|
+
--highlight-background-color:hsl(0deg 0% 99% / 100%);
|
|
439
|
+
isolation:isolate;
|
|
432
440
|
background-color:transparent;
|
|
433
|
-
|
|
434
|
-
|
|
441
|
+
}
|
|
442
|
+
.root[data-highlight]::before, .root[data-highlight]::after{
|
|
443
|
+
pointer-events:none;
|
|
444
|
+
content:"";
|
|
445
|
+
position:absolute;
|
|
446
|
+
z-index:-1;
|
|
447
|
+
}
|
|
448
|
+
.root[data-highlight]::before{
|
|
449
|
+
inset:0;
|
|
450
|
+
border-radius:inherit;
|
|
451
|
+
opacity:0.64;
|
|
452
|
+
background-image:linear-gradient(90deg, var(--highlight-border-color-from) 0%, var(--highlight-border-color-to) 50%, var(--highlight-border-color-from) 100%);
|
|
453
|
+
}
|
|
454
|
+
.root[data-highlight]::after{
|
|
455
|
+
inset:var(--sn-primitive-strokeWeight-strokeRegular, 1px);
|
|
456
|
+
border-radius:calc(var(--sn-density-radius-2xs, var(--sn-platform-comfort-radius-2xs, var(--sn-primitive-dimension-4, 4px))) - var(--sn-primitive-strokeWeight-strokeRegular, 1px));
|
|
457
|
+
background:linear-gradient(90deg, var(--highlight-background-color-from) 2.29%, var(--highlight-background-color-to) 97.84%), var(--highlight-background-color);
|
|
458
|
+
}
|
|
459
|
+
:global(.sn-dark) .root[data-highlight]{
|
|
460
|
+
--highlight-border-color-from:hsl(153deg 30% 55% / 100%);
|
|
461
|
+
--highlight-border-color-to:hsl(157deg 51% 19% / 100%);
|
|
462
|
+
--highlight-background-color-from:hsl(240deg 14% 16% / 100%);
|
|
463
|
+
--highlight-background-color-to:hsl(157deg 51% 19% / 20%);
|
|
464
|
+
--highlight-background-color:hsl(240deg 14% 16% / 100%);
|
|
435
465
|
}
|
|
436
466
|
|
|
437
467
|
.title{
|
|
@@ -460,6 +490,7 @@
|
|
|
460
490
|
}
|
|
461
491
|
.services[data-mobile]{
|
|
462
492
|
grid-template-columns:minmax(0, 1fr);
|
|
493
|
+
gap:0;
|
|
463
494
|
}
|
|
464
495
|
.services > *{
|
|
465
496
|
min-width:0;
|
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Divider } from '@cloud-ru/ds-divider';
|
|
3
|
-
import { ChildThemeProvider, DENSITY } from '@cloud-ru/ds-theme';
|
|
4
3
|
import { extractSupportProps } from '@cloud-ru/ds-utils';
|
|
5
4
|
import cn from 'classnames';
|
|
6
|
-
import { useRef } from 'react';
|
|
7
5
|
import styles from './styles.module.css';
|
|
8
6
|
export function HeaderLayout({ menu, logo, select, breadcrumbs, toolbar, className, isMobile = false, ...rest }) {
|
|
9
|
-
|
|
10
|
-
const header = (_jsxs("header", { ref: headerRef, className: cn(styles.header, className), ...extractSupportProps(rest), children: [_jsxs("div", { className: styles.top, children: [_jsxs("div", { className: styles.left, children: [menu, logo, !isMobile && select && (_jsxs(_Fragment, { children: [_jsx(Divider, { orientation: 'vertical' }), select] })), !isMobile && breadcrumbs && (_jsxs(_Fragment, { children: [_jsx(Divider, { orientation: 'vertical' }), breadcrumbs] }))] }), _jsx("div", { className: styles.right, children: toolbar })] }), _jsx(Divider, { orientation: 'horizontal' }), isMobile && Boolean(breadcrumbs) && (_jsxs(_Fragment, { children: [_jsx("div", { className: styles.bottom, children: breadcrumbs }), _jsx(Divider, { orientation: 'horizontal' })] }))] }));
|
|
11
|
-
// Временная фиксация: на mobile прикладная тема переключилась на compact, а шапка сверстана
|
|
12
|
-
// под comfort и на compact ещё не переехала. Провайдер (а не класс на `<header>`) нужен потому,
|
|
13
|
-
// что поверхности шапки — порталы: они переэмитят набор `sn-*` из контекста на своём корне,
|
|
14
|
-
// и класс, поставленный поверх, проиграл бы их собственному.
|
|
15
|
-
if (isMobile) {
|
|
16
|
-
return (_jsx(ChildThemeProvider, { value: { density: DENSITY.Comfort }, rootRef: headerRef, children: header }));
|
|
17
|
-
}
|
|
18
|
-
return header;
|
|
7
|
+
return (_jsxs("header", { className: cn(styles.header, className), "data-mobile": isMobile || undefined, ...extractSupportProps(rest), children: [_jsxs("div", { className: styles.top, children: [_jsxs("div", { className: styles.left, children: [menu, logo, !isMobile && select && (_jsxs(_Fragment, { children: [_jsx(Divider, { orientation: 'vertical' }), select] })), !isMobile && breadcrumbs && (_jsxs(_Fragment, { children: [_jsx(Divider, { orientation: 'vertical' }), breadcrumbs] }))] }), _jsx("div", { className: styles.right, children: toolbar })] }), _jsx(Divider, { orientation: 'horizontal' }), isMobile && Boolean(breadcrumbs) && (_jsxs(_Fragment, { children: [_jsx("div", { className: styles.bottom, children: breadcrumbs }), _jsx(Divider, { orientation: 'horizontal' })] }))] }));
|
|
19
8
|
}
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
.header{
|
|
2
|
-
box-sizing:border-box;
|
|
3
|
-
background-color:var(--sn-theme-color-neutral-background, var(--sn-brand-color-neutral-90, var(--sn-brand-palette-gray-90, #eeeff3)));
|
|
4
|
-
}
|
|
5
|
-
|
|
6
1
|
.top{
|
|
7
2
|
display:flex;
|
|
8
3
|
gap:var(--sn-primitive-dimension-8, 8px);
|
|
@@ -36,4 +31,17 @@
|
|
|
36
31
|
gap:var(--sn-primitive-dimension-8, 8px);
|
|
37
32
|
align-items:center;
|
|
38
33
|
height:100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.header{
|
|
37
|
+
box-sizing:border-box;
|
|
38
|
+
background-color:var(--sn-theme-color-neutral-background, var(--sn-brand-color-neutral-90, var(--sn-brand-palette-gray-90, #eeeff3)));
|
|
39
|
+
}
|
|
40
|
+
.header[data-mobile] .top{
|
|
41
|
+
gap:var(--sn-primitive-dimension-4, 4px);
|
|
42
|
+
padding:0 var(--sn-primitive-dimension-4, 4px);
|
|
43
|
+
}
|
|
44
|
+
.header[data-mobile] .left,
|
|
45
|
+
.header[data-mobile] .right{
|
|
46
|
+
gap:var(--sn-primitive-dimension-4, 4px);
|
|
39
47
|
}
|
|
@@ -53,5 +53,5 @@ export function MenuDesktop({ open: openProp, setOpen: setOpenProp, settingItems
|
|
|
53
53
|
const hasBottomItems = Boolean(settingItems?.items.length) || Boolean(sidebarBottomSlot);
|
|
54
54
|
const searchValue = search?.searchValue;
|
|
55
55
|
const showSearch = Boolean(search) && !isInitialEmptyCards && (resultItems.length > 0 || Boolean(searchValue));
|
|
56
|
-
return (_jsx(DrawerCustom, { open: open, onClose: handleCloseDrawer, position: 'left', width: isNeedRightBlock ? DEFAULT_DRAWER_WIDTH : LEFT_COLUMN_WIDTH, showButtonClosed: false, className: styles.drawer, "data-test-id": TEST_IDS.drawer, children: _jsxs("div", { className: styles.menu, "data-test-id": TEST_IDS.content, children: [_jsxs("div", { className: styles.left, "data-test-id": TEST_IDS.left, children: [_jsx("div", { className: styles.leftTop, "data-test-id": TEST_IDS.leftTop, children: leftTop }), !isInitialEmptyCards ? (_jsx("div", { className: styles.leftMain, children: _jsx(Scroll, { className: styles.leftMainScroll, overflow: { x: 'hidden' }, barHideStrategy: 'never', "data-test-id": TEST_IDS.leftNavList, size: 's', children: _jsx("div", { className: styles.items, children: navGroupItems.map(item => (_jsx(CardServiceLight, { as: 'button', type: 'button', title: item.label, onClick: item.onClick, truncate: { title: 2 }, className: styles.item, "data-test-id": TEST_IDS.navGroup(item.id) }, item.id))) }) }) })) : null, !leftTop && isInitialEmptyCards ? _jsx("div", {}) : null, hasBottomItems ? (_jsxs("div", { className: styles.leftBottom, "data-test-id": TEST_IDS.leftBottom, children: [_jsx("div", { className: styles.leftBottomDivider, children: _jsx(Divider, {}) }), _jsxs("div", { className: styles.leftBottomItems, "data-test-id": TEST_IDS.leftBottomItems, children: [settingItems?.items.map(item => (_createElement(CardServiceLight, { ...(item.href ? { href: item.href, as: 'a' } : { as: 'button', type: 'button' }), key: item.id, title: item.label, icon: getLinkEmblem(item), onClick: wrappedSettingClick(item), disabled: item.disabled, className: styles.leftBottomCard, "data-test-id": TEST_IDS.setting(item.id) }))), sidebarBottomSlot] })] })) : null] }), isNeedRightBlock ? (_jsxs(_Fragment, { children: [_jsx(Divider, { orientation: 'vertical', className: styles.divider, "data-test-id": TEST_IDS.divider }), _jsxs("div", { className: styles.right, "data-test-id": TEST_IDS.right, children: [showSearch && search ? (_jsx("div", { className: styles.searchWrap, "data-test-id": TEST_IDS.search, children: _jsx(NavigationSearch, { ref: searchRef, value: search.searchValue, onChange: search.onSearchValueChange, options: search.searchFunctions.map(fn => ({ id: fn.id, label: fn.label })), selectedOption: search.searchFn ?? search.searchFunctions[0]?.id ?? 'fuzzy', onSelectedOptionChange: search.onChangeSearchFn }) })) : null, _jsxs(Scroll, { paddingAbsolute: true, className: styles.scroll, ref: scrollRef, barHideStrategy: 'never', children: [isInitialEmptyCards && rightTop ? _jsx("div", { className: styles.bannersWrap, children: rightTop }) : null, !isInitialEmptyCards ? (_jsx(Content, { onClose: handleCloseDrawer, className: styles.rightContent, searchValue: searchValue, banners: rightTop, favorite: favorite, serviceGroups: resultItems, onLinkChange: onLinkChange })) : null] })] })] })) : null] }) }));
|
|
56
|
+
return (_jsx(DrawerCustom, { open: open, onClose: handleCloseDrawer, position: 'left', width: isNeedRightBlock ? DEFAULT_DRAWER_WIDTH : LEFT_COLUMN_WIDTH, showButtonClosed: false, className: styles.drawer, "data-test-id": TEST_IDS.drawer, children: _jsxs("div", { className: styles.menu, "data-test-id": TEST_IDS.content, children: [_jsxs("div", { className: styles.left, "data-test-id": TEST_IDS.left, children: [_jsx("div", { className: styles.leftTop, "data-test-id": TEST_IDS.leftTop, children: leftTop }), !isInitialEmptyCards ? (_jsx("div", { className: styles.leftMain, children: _jsx(Scroll, { className: styles.leftMainScroll, overflow: { x: 'hidden' }, barHideStrategy: 'never', "data-test-id": TEST_IDS.leftNavList, size: 's', children: _jsx("div", { className: styles.items, children: navGroupItems.map(item => (_jsx(CardServiceLight, { as: 'button', type: 'button', title: item.label, onClick: item.onClick, truncate: { title: 2 }, className: styles.item, "data-test-id": TEST_IDS.navGroup(item.id) }, item.id))) }) }) })) : null, !leftTop && isInitialEmptyCards ? _jsx("div", {}) : null, hasBottomItems ? (_jsxs("div", { className: styles.leftBottom, "data-test-id": TEST_IDS.leftBottom, children: [_jsx("div", { className: styles.leftBottomDivider, children: _jsx(Divider, {}) }), _jsxs("div", { className: styles.leftBottomItems, "data-test-id": TEST_IDS.leftBottomItems, children: [settingItems?.items.length ? (_jsx("div", { className: styles.leftBottomCards, children: settingItems.items.map(item => (_createElement(CardServiceLight, { ...(item.href ? { href: item.href, as: 'a' } : { as: 'button', type: 'button' }), key: item.id, title: item.label, icon: getLinkEmblem(item), onClick: wrappedSettingClick(item), disabled: item.disabled, className: styles.leftBottomCard, "data-test-id": TEST_IDS.setting(item.id) }))) })) : null, sidebarBottomSlot] })] })) : null] }), isNeedRightBlock ? (_jsxs(_Fragment, { children: [_jsx(Divider, { orientation: 'vertical', className: styles.divider, "data-test-id": TEST_IDS.divider }), _jsxs("div", { className: styles.right, "data-test-id": TEST_IDS.right, children: [showSearch && search ? (_jsx("div", { className: styles.searchWrap, "data-test-id": TEST_IDS.search, children: _jsx(NavigationSearch, { ref: searchRef, value: search.searchValue, onChange: search.onSearchValueChange, options: search.searchFunctions.map(fn => ({ id: fn.id, label: fn.label })), selectedOption: search.searchFn ?? search.searchFunctions[0]?.id ?? 'fuzzy', onSelectedOptionChange: search.onChangeSearchFn }) })) : null, _jsxs(Scroll, { paddingAbsolute: true, className: styles.scroll, ref: scrollRef, barHideStrategy: 'never', children: [isInitialEmptyCards && rightTop ? _jsx("div", { className: styles.bannersWrap, children: rightTop }) : null, !isInitialEmptyCards ? (_jsx(Content, { onClose: handleCloseDrawer, className: styles.rightContent, searchValue: searchValue, banners: rightTop, favorite: favorite, serviceGroups: resultItems, onLinkChange: onLinkChange })) : null] })] })] })) : null] }) }));
|
|
57
57
|
}
|
|
@@ -56,9 +56,6 @@
|
|
|
56
56
|
padding-right:var(--sn-primitive-dimension-16, 16px);
|
|
57
57
|
padding-left:var(--sn-primitive-dimension-16, 16px);
|
|
58
58
|
}
|
|
59
|
-
.items > div{
|
|
60
|
-
gap:var(--sn-primitive-dimension-4, 4px);
|
|
61
|
-
}
|
|
62
59
|
|
|
63
60
|
.item{
|
|
64
61
|
flex-shrink:0;
|
|
@@ -75,16 +72,21 @@
|
|
|
75
72
|
|
|
76
73
|
.leftBottomDivider{
|
|
77
74
|
width:100%;
|
|
78
|
-
padding:var(--sn-list-anatomy-size-s-listItem-paddingVertical, var(--sn-density-spacing-control-container-vertical-s, var(--sn-platform-comfort-spacing-control-container-vertical-s, var(--sn-platform-comfort-scale-025-2xs, var(--sn-primitive-dimension-2, 2px))))) var(--sn-list-anatomy-size-s-listItem-paddingHorizontal, var(--sn-density-spacing-control-container-horizontal-s, var(--sn-platform-comfort-spacing-control-container-horizontal-s, var(--sn-platform-comfort-scale-050-2xs, var(--sn-primitive-dimension-4, 4px)))));
|
|
79
75
|
}
|
|
80
76
|
|
|
81
77
|
.leftBottomItems{
|
|
82
78
|
display:flex;
|
|
83
79
|
flex-direction:column;
|
|
84
|
-
gap:var(--sn-primitive-dimension-
|
|
80
|
+
gap:var(--sn-primitive-dimension-16, 16px);
|
|
85
81
|
padding:0 var(--sn-primitive-dimension-16, 16px) var(--sn-primitive-dimension-16, 16px);
|
|
86
82
|
}
|
|
87
83
|
|
|
84
|
+
.leftBottomCards{
|
|
85
|
+
display:flex;
|
|
86
|
+
flex-direction:column;
|
|
87
|
+
gap:var(--sn-primitive-dimension-4, 4px);
|
|
88
|
+
}
|
|
89
|
+
|
|
88
90
|
.leftBottomCard{
|
|
89
91
|
width:100%;
|
|
90
92
|
}
|
|
@@ -107,7 +109,7 @@
|
|
|
107
109
|
.searchWrap{
|
|
108
110
|
flex-shrink:0;
|
|
109
111
|
box-sizing:border-box;
|
|
110
|
-
padding:var(--sn-primitive-dimension-16, 16px) var(--sn-primitive-dimension-16, 16px) 0
|
|
112
|
+
padding:var(--sn-primitive-dimension-16, 16px) var(--sn-primitive-dimension-16, 16px) 0;
|
|
111
113
|
background-color:var(--sn-theme-color-neutral-background, var(--sn-brand-color-neutral-90, var(--sn-brand-palette-gray-90, #eeeff3)));
|
|
112
114
|
}
|
|
113
115
|
|
|
@@ -115,7 +117,7 @@
|
|
|
115
117
|
flex:1 1 auto;
|
|
116
118
|
box-sizing:border-box;
|
|
117
119
|
min-height:0;
|
|
118
|
-
padding:0 var(--sn-primitive-dimension-16, 16px)
|
|
120
|
+
padding:0 var(--sn-primitive-dimension-16, 16px);
|
|
119
121
|
}
|
|
120
122
|
.scroll:only-child{
|
|
121
123
|
padding-top:var(--sn-primitive-dimension-16, 16px);
|
|
@@ -2,10 +2,8 @@ import { createElement as _createElement } from "react";
|
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { AdaptiveProvider, useAdaptiveLayout } from '@cloud-ru/ds-adaptive';
|
|
4
4
|
import { Divider } from '@cloud-ru/ds-divider';
|
|
5
|
-
import { ChildThemeProvider, DENSITY, useThemeClassnames } from '@cloud-ru/ds-theme';
|
|
6
5
|
import { CardServiceLight } from '@cloud-ru/ds-uikit-product-card-predefined';
|
|
7
6
|
import { useValueControl } from '@cloud-ru/ds-utils';
|
|
8
|
-
import cn from 'classnames';
|
|
9
7
|
import { useCallback } from 'react';
|
|
10
8
|
import { headerLegacyLocale } from '../../../../locale/index.js';
|
|
11
9
|
import { shouldBeOpenedInNewTab } from '../../../../utils/shouldBeOpenedInNewTab.js';
|
|
@@ -46,13 +44,5 @@ export function MenuMobile({ open: openProp, setOpen: setOpenProp, settingItems,
|
|
|
46
44
|
const searchValue = search?.searchValue;
|
|
47
45
|
const showSearch = Boolean(search) && !isInitialEmptyCards && (resultItems.length > 0 || Boolean(searchValue));
|
|
48
46
|
const hasBottomItems = Boolean(settingItems?.items.length);
|
|
49
|
-
|
|
50
|
-
// `HeaderLayout`, поэтому объявляем плотность здесь же. Провайдер задаёт контекст (его читают
|
|
51
|
-
// вложенные поверхности, которые переэмитят тему на своём корне), класс — сам дровер: он тему
|
|
52
|
-
// из контекста не переэмитит и иначе остался бы с плотностью приложения.
|
|
53
|
-
const comfortThemeClassName = useThemeClassnames({ density: DENSITY.Comfort });
|
|
54
|
-
return (
|
|
55
|
-
// Обёртка провайдера layout-прозрачная (`display: contents`) — меню рендерится порталом,
|
|
56
|
-
// лишний бокс в строке шапки не нужен.
|
|
57
|
-
_jsx(ChildThemeProvider, { value: { density: DENSITY.Comfort }, className: styles.densityScope, children: _jsx(DesktopDrawerCustom, { open: open, onClose: handleCloseDrawer, position: 'left', width: 's', className: cn(styles.drawerMobile, comfortThemeClassName), closeOnPopstate: true, "data-test-id": TEST_IDS.drawerMobile, children: _jsxs(AdaptiveProvider, { layoutType: layoutType, children: [_jsx(DesktopDrawerCustom.Header, { title: t('mainMenu.navigation'), className: styles.header }), _jsx(DesktopDrawerCustom.Body, { bodyPadding: false, className: styles.scrollBody, children: _jsxs("div", { className: styles.scrollMobile, children: [leftTop ? _jsx("div", { className: styles.leftTop, children: leftTop }) : null, !isInitialEmptyCards ? (_jsxs("div", { className: styles.main, children: [showSearch && search ? (_jsx("div", { className: styles.searchItem, "data-test-id": TEST_IDS.search, children: _jsx(NavigationSearch, { ref: searchRef, value: search.searchValue, onChange: search.onSearchValueChange, onBlur: search.onBlur, onFocus: search.onFocus, options: search.searchFunctions.map(fn => ({ id: fn.id, label: fn.label })), selectedOption: search.searchFn ?? search.searchFunctions[0]?.id ?? 'fuzzy', onSelectedOptionChange: search.onChangeSearchFn }) })) : null, _jsx(Content, { isMobile: true, onClose: handleCloseDrawer, onLinkChange: onLinkChange, className: styles.content, searchValue: searchValue, banners: rightTop, favorite: favorite, serviceGroups: resultItems })] })) : null, isInitialEmptyCards && rightTop ? _jsx("div", { className: styles.bannersWrap, children: rightTop }) : null, hasBottomItems ? (_jsxs("div", { className: styles.bottom, "data-test-id": TEST_IDS.leftBottom, children: [_jsx("div", { className: styles.bottomDivider, children: _jsx(Divider, {}) }), _jsx("div", { className: styles.bottomItems, "data-test-id": TEST_IDS.leftBottomItems, children: settingItems?.items.map(item => (_createElement(CardServiceLight, { ...(item.href ? { href: item.href, as: 'a' } : { as: 'button', type: 'button' }), key: item.id, title: item.label, icon: getLinkEmblem(item), onClick: wrappedSettingClick(item), disabled: item.disabled, className: styles.bottomCard, "data-test-id": TEST_IDS.setting(item.id) }))) })] })) : null] }) })] }) }) }));
|
|
47
|
+
return (_jsx(DesktopDrawerCustom, { open: open, onClose: handleCloseDrawer, position: 'left', width: 's', className: styles.drawerMobile, closeOnPopstate: true, "data-test-id": TEST_IDS.drawerMobile, children: _jsxs(AdaptiveProvider, { layoutType: layoutType, children: [_jsx(DesktopDrawerCustom.Header, { title: t('mainMenu.navigation') }), _jsx(DesktopDrawerCustom.Body, { className: styles.scrollBody, children: _jsxs("div", { className: styles.scrollMobile, children: [leftTop ? _jsx("div", { className: styles.leftTop, children: leftTop }) : null, !isInitialEmptyCards ? (_jsxs("div", { className: styles.main, children: [showSearch && search ? (_jsx("div", { className: styles.searchItem, "data-test-id": TEST_IDS.search, children: _jsx(NavigationSearch, { ref: searchRef, value: search.searchValue, onChange: search.onSearchValueChange, onBlur: search.onBlur, onFocus: search.onFocus, options: search.searchFunctions.map(fn => ({ id: fn.id, label: fn.label })), selectedOption: search.searchFn ?? search.searchFunctions[0]?.id ?? 'fuzzy', onSelectedOptionChange: search.onChangeSearchFn }) })) : null, _jsx(Content, { isMobile: true, onClose: handleCloseDrawer, onLinkChange: onLinkChange, className: styles.content, searchValue: searchValue, banners: rightTop, favorite: favorite, serviceGroups: resultItems })] })) : null, isInitialEmptyCards && rightTop ? _jsx("div", { className: styles.bannersWrap, children: rightTop }) : null, hasBottomItems ? (_jsxs("div", { className: styles.bottom, "data-test-id": TEST_IDS.leftBottom, children: [_jsx("div", { className: styles.bottomDivider, children: _jsx(Divider, {}) }), _jsx("div", { className: styles.bottomItems, "data-test-id": TEST_IDS.leftBottomItems, children: settingItems?.items.map(item => (_createElement(CardServiceLight, { ...(item.href ? { href: item.href, as: 'a' } : { as: 'button', type: 'button' }), key: item.id, title: item.label, icon: getLinkEmblem(item), onClick: wrappedSettingClick(item), disabled: item.disabled, className: styles.bottomCard, "data-test-id": TEST_IDS.setting(item.id) }))) })] })) : null] }) })] }) }));
|
|
58
48
|
}
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
.densityScope{
|
|
2
|
-
display:contents;
|
|
3
|
-
}
|
|
4
|
-
|
|
5
1
|
.drawerMobile{
|
|
6
2
|
height:100%;
|
|
7
3
|
min-height:0;
|
|
@@ -19,11 +15,6 @@
|
|
|
19
15
|
gap:var(--sn-primitive-dimension-4, 4px);
|
|
20
16
|
box-sizing:border-box;
|
|
21
17
|
min-height:100%;
|
|
22
|
-
padding:0 var(--sn-primitive-dimension-16, 16px) var(--sn-primitive-dimension-16, 16px);
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.header{
|
|
26
|
-
padding-top:var(--sn-primitive-dimension-12, 12px);
|
|
27
18
|
}
|
|
28
19
|
|
|
29
20
|
.leftTop{
|
|
@@ -76,13 +67,13 @@
|
|
|
76
67
|
|
|
77
68
|
.bottomDivider{
|
|
78
69
|
width:100%;
|
|
79
|
-
padding:var(--sn-
|
|
70
|
+
padding:var(--sn-primitive-dimension-2, 2px) 0;
|
|
80
71
|
}
|
|
81
72
|
|
|
82
73
|
.bottomItems{
|
|
83
74
|
display:flex;
|
|
84
75
|
flex-direction:column;
|
|
85
|
-
gap:
|
|
76
|
+
gap:0;
|
|
86
77
|
}
|
|
87
78
|
|
|
88
79
|
.bottomCard{
|