@gravity-ui/page-constructor 1.8.0-alfa.1 → 1.8.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/CHANGELOG.md +16 -0
- package/README.md +58 -36
- package/build/cjs/blocks/Banner/schema.d.ts +0 -12
- package/build/cjs/blocks/Banner/schema.js +0 -2
- package/build/cjs/blocks/CardLayout/schema.d.ts +0 -8
- package/build/cjs/blocks/CardLayout/schema.js +1 -2
- package/build/cjs/blocks/Companies/schema.d.ts +0 -2
- package/build/cjs/blocks/Companies/schema.js +0 -2
- package/build/cjs/blocks/ContentLayout/schema.d.ts +0 -6
- package/build/cjs/blocks/ExtendedFeatures/ExtendedFeatures.js +2 -2
- package/build/cjs/blocks/ExtendedFeatures/schema.d.ts +0 -7
- package/build/cjs/blocks/ExtendedFeatures/schema.js +1 -4
- package/build/cjs/blocks/Header/schema.d.ts +0 -16
- package/build/cjs/blocks/Header/schema.js +0 -5
- package/build/cjs/blocks/HeaderSlider/schema.d.ts +0 -11
- package/build/cjs/blocks/Icons/schema.d.ts +0 -6
- package/build/cjs/blocks/Icons/schema.js +0 -2
- package/build/cjs/blocks/Info/schema.d.ts +0 -10
- package/build/cjs/blocks/Info/schema.js +0 -2
- package/build/cjs/blocks/LinkTable/schema.d.ts +0 -2
- package/build/cjs/blocks/Media/schema.d.ts +0 -9
- package/build/cjs/blocks/Media/schema.js +1 -3
- package/build/cjs/blocks/Preview/schema.d.ts +0 -2
- package/build/cjs/blocks/Preview/schema.js +0 -4
- package/build/cjs/blocks/PromoFeaturesBlock/schema.d.ts +0 -7
- package/build/cjs/blocks/PromoFeaturesBlock/schema.js +1 -4
- package/build/cjs/blocks/Questions/schema.d.ts +0 -5
- package/build/cjs/blocks/Questions/schema.js +0 -2
- package/build/cjs/blocks/Security/schema.d.ts +0 -2
- package/build/cjs/blocks/Security/schema.js +0 -2
- package/build/cjs/blocks/Simple/schema.d.ts +0 -3
- package/build/cjs/blocks/Simple/schema.js +0 -1
- package/build/cjs/blocks/Slider/schema.d.ts +0 -7
- package/build/cjs/blocks/Slider/schema.js +0 -2
- package/build/cjs/blocks/Table/schema.d.ts +0 -4
- package/build/cjs/blocks/Table/schema.js +0 -3
- package/build/cjs/blocks/Tabs/schema.d.ts +0 -8
- package/build/cjs/blocks/Tabs/schema.js +0 -4
- package/build/cjs/components/Author/schema.d.ts +0 -3
- package/build/cjs/components/Image/schema.d.ts +0 -2
- package/build/cjs/components/Image/schema.js +0 -2
- package/build/cjs/components/OverflowScroller/OverflowScroller.css +2 -0
- package/build/cjs/components/RouterLink/RouterLink.d.ts +1 -0
- package/build/cjs/components/index.d.ts +2 -0
- package/build/cjs/components/index.js +40 -39
- package/build/cjs/components/navigation/components/Header/Header.css +85 -0
- package/build/cjs/components/navigation/components/Header/Header.d.ts +8 -0
- package/build/cjs/components/navigation/components/Header/Header.js +55 -0
- package/build/cjs/components/navigation/components/Logo/Logo.css +23 -0
- package/build/cjs/components/navigation/components/Logo/Logo.d.ts +7 -0
- package/build/cjs/components/navigation/components/Logo/Logo.js +17 -0
- package/build/cjs/components/navigation/components/MobileNavigation/MobileNavigation.css +64 -0
- package/build/cjs/components/navigation/components/MobileNavigation/MobileNavigation.d.ts +13 -0
- package/build/cjs/components/navigation/components/MobileNavigation/MobileNavigation.js +45 -0
- package/build/cjs/components/navigation/components/Navigation/Navigation.css +43 -0
- package/build/cjs/components/navigation/components/Navigation/Navigation.d.ts +18 -0
- package/build/cjs/components/navigation/components/Navigation/Navigation.js +69 -0
- package/build/cjs/components/navigation/components/NavigationItem/NavigationItem.css +40 -0
- package/build/cjs/components/navigation/components/NavigationItem/NavigationItem.d.ts +10 -0
- package/build/cjs/components/navigation/components/NavigationItem/NavigationItem.js +59 -0
- package/build/cjs/components/navigation/components/NavigationPopup/NavigationPopup.css +33 -0
- package/build/cjs/components/navigation/components/NavigationPopup/NavigationPopup.d.ts +10 -0
- package/build/cjs/components/navigation/components/NavigationPopup/NavigationPopup.js +45 -0
- package/build/cjs/components/navigation/components/SocialIcon/SocialIcon.css +20 -0
- package/build/cjs/components/navigation/components/SocialIcon/SocialIcon.d.ts +7 -0
- package/build/cjs/components/navigation/components/SocialIcon/SocialIcon.js +14 -0
- package/build/cjs/components/navigation/components/index.d.ts +7 -0
- package/build/cjs/components/navigation/components/index.js +20 -0
- package/build/cjs/components/navigation/containers/Layout/Layout.css +10 -0
- package/build/cjs/components/navigation/containers/Layout/Layout.d.ts +8 -0
- package/build/cjs/components/navigation/containers/Layout/Layout.js +11 -0
- package/build/cjs/containers/PageConstructor/PageConstructor.d.ts +3 -2
- package/build/cjs/containers/PageConstructor/PageConstructor.js +12 -10
- package/build/cjs/context/locationContext/locationContext.d.ts +1 -0
- package/build/cjs/icons/NavigationArrow.d.ts +2 -0
- package/build/cjs/icons/NavigationArrow.js +9 -0
- package/build/cjs/icons/NavigationClose.d.ts +2 -0
- package/build/cjs/icons/NavigationClose.js +9 -0
- package/build/cjs/icons/NavigationOpen.d.ts +2 -0
- package/build/cjs/icons/NavigationOpen.js +11 -0
- package/build/cjs/icons/index.d.ts +3 -0
- package/build/cjs/icons/index.js +3 -0
- package/build/cjs/models/constructor-items/blocks.d.ts +2 -4
- package/build/cjs/models/index.d.ts +1 -0
- package/build/cjs/models/index.js +1 -0
- package/build/cjs/models/navigation.d.ts +62 -0
- package/build/cjs/models/navigation.js +10 -0
- package/build/cjs/schema/index.d.ts +0 -2
- package/build/cjs/schema/validators/common.d.ts +0 -17
- package/build/cjs/schema/validators/common.js +0 -11
- package/build/cjs/sub-blocks/BackgroundCard/schema.d.ts +0 -5
- package/build/cjs/sub-blocks/BasicCard/schema.d.ts +0 -4
- package/build/cjs/sub-blocks/CardWithImage/schema.d.ts +0 -8
- package/build/cjs/sub-blocks/CardWithImage/schema.js +1 -4
- package/build/cjs/sub-blocks/Content/schema.d.ts +0 -8
- package/build/cjs/sub-blocks/Content/schema.js +1 -3
- package/build/cjs/sub-blocks/MediaCard/schema.d.ts +0 -1
- package/build/cjs/sub-blocks/NewsCard/schema.d.ts +0 -1
- package/build/cjs/sub-blocks/NewsCard/schema.js +0 -1
- package/build/cjs/sub-blocks/Partner/schema.d.ts +0 -1
- package/build/cjs/sub-blocks/Partner/schema.js +0 -1
- package/build/cjs/sub-blocks/PriceDetailed/schema.d.ts +0 -1
- package/build/cjs/sub-blocks/PriceDetailed/schema.js +0 -8
- package/build/cjs/sub-blocks/Quote/schema.d.ts +0 -4
- package/build/cjs/sub-blocks/Quote/schema.js +0 -1
- package/build/cjs/sub-blocks/TutorialCard/schema.d.ts +0 -2
- package/build/cjs/sub-blocks/TutorialCard/schema.js +0 -2
- package/build/cjs/text-transform/blocks.js +0 -1
- package/build/esm/blocks/Banner/schema.d.ts +0 -12
- package/build/esm/blocks/Banner/schema.js +0 -2
- package/build/esm/blocks/CardLayout/schema.d.ts +0 -8
- package/build/esm/blocks/CardLayout/schema.js +1 -2
- package/build/esm/blocks/Companies/schema.d.ts +0 -2
- package/build/esm/blocks/Companies/schema.js +0 -2
- package/build/esm/blocks/ContentLayout/schema.d.ts +0 -6
- package/build/esm/blocks/ExtendedFeatures/ExtendedFeatures.js +2 -2
- package/build/esm/blocks/ExtendedFeatures/schema.d.ts +0 -7
- package/build/esm/blocks/ExtendedFeatures/schema.js +1 -4
- package/build/esm/blocks/Header/schema.d.ts +0 -16
- package/build/esm/blocks/Header/schema.js +0 -5
- package/build/esm/blocks/HeaderSlider/schema.d.ts +0 -11
- package/build/esm/blocks/Icons/schema.d.ts +0 -6
- package/build/esm/blocks/Icons/schema.js +0 -2
- package/build/esm/blocks/Info/schema.d.ts +0 -10
- package/build/esm/blocks/Info/schema.js +0 -2
- package/build/esm/blocks/LinkTable/schema.d.ts +0 -2
- package/build/esm/blocks/Media/schema.d.ts +0 -9
- package/build/esm/blocks/Media/schema.js +1 -3
- package/build/esm/blocks/Preview/schema.d.ts +0 -2
- package/build/esm/blocks/Preview/schema.js +0 -4
- package/build/esm/blocks/PromoFeaturesBlock/schema.d.ts +0 -7
- package/build/esm/blocks/PromoFeaturesBlock/schema.js +1 -4
- package/build/esm/blocks/Questions/schema.d.ts +0 -5
- package/build/esm/blocks/Questions/schema.js +0 -2
- package/build/esm/blocks/Security/schema.d.ts +0 -2
- package/build/esm/blocks/Security/schema.js +0 -2
- package/build/esm/blocks/Simple/schema.d.ts +0 -3
- package/build/esm/blocks/Simple/schema.js +0 -1
- package/build/esm/blocks/Slider/schema.d.ts +0 -7
- package/build/esm/blocks/Slider/schema.js +0 -2
- package/build/esm/blocks/Table/schema.d.ts +0 -4
- package/build/esm/blocks/Table/schema.js +0 -3
- package/build/esm/blocks/Tabs/schema.d.ts +0 -8
- package/build/esm/blocks/Tabs/schema.js +0 -4
- package/build/esm/components/Author/schema.d.ts +0 -3
- package/build/esm/components/Image/schema.d.ts +0 -2
- package/build/esm/components/Image/schema.js +0 -2
- package/build/esm/components/OverflowScroller/OverflowScroller.css +2 -0
- package/build/esm/components/RouterLink/RouterLink.d.ts +1 -0
- package/build/esm/components/index.d.ts +2 -0
- package/build/esm/components/index.js +2 -0
- package/build/esm/components/navigation/components/Header/Header.css +85 -0
- package/build/esm/components/navigation/components/Header/Header.d.ts +9 -0
- package/build/esm/components/navigation/components/Header/Header.js +51 -0
- package/build/esm/components/navigation/components/Logo/Logo.css +23 -0
- package/build/esm/components/navigation/components/Logo/Logo.d.ts +8 -0
- package/build/esm/components/navigation/components/Logo/Logo.js +15 -0
- package/build/esm/components/navigation/components/MobileNavigation/MobileNavigation.css +64 -0
- package/build/esm/components/navigation/components/MobileNavigation/MobileNavigation.d.ts +14 -0
- package/build/esm/components/navigation/components/MobileNavigation/MobileNavigation.js +43 -0
- package/build/esm/components/navigation/components/Navigation/Navigation.css +43 -0
- package/build/esm/components/navigation/components/Navigation/Navigation.d.ts +19 -0
- package/build/esm/components/navigation/components/Navigation/Navigation.js +68 -0
- package/build/esm/components/navigation/components/NavigationItem/NavigationItem.css +40 -0
- package/build/esm/components/navigation/components/NavigationItem/NavigationItem.d.ts +11 -0
- package/build/esm/components/navigation/components/NavigationItem/NavigationItem.js +58 -0
- package/build/esm/components/navigation/components/NavigationPopup/NavigationPopup.css +33 -0
- package/build/esm/components/navigation/components/NavigationPopup/NavigationPopup.d.ts +11 -0
- package/build/esm/components/navigation/components/NavigationPopup/NavigationPopup.js +41 -0
- package/build/esm/components/navigation/components/SocialIcon/SocialIcon.css +20 -0
- package/build/esm/components/navigation/components/SocialIcon/SocialIcon.d.ts +8 -0
- package/build/esm/components/navigation/components/SocialIcon/SocialIcon.js +12 -0
- package/build/esm/components/navigation/components/index.d.ts +7 -0
- package/build/esm/components/navigation/components/index.js +7 -0
- package/build/esm/components/navigation/containers/Layout/Layout.css +10 -0
- package/build/esm/components/navigation/containers/Layout/Layout.d.ts +9 -0
- package/build/esm/components/navigation/containers/Layout/Layout.js +9 -0
- package/build/esm/containers/PageConstructor/PageConstructor.d.ts +3 -2
- package/build/esm/containers/PageConstructor/PageConstructor.js +12 -10
- package/build/esm/context/locationContext/locationContext.d.ts +1 -0
- package/build/esm/icons/NavigationArrow.d.ts +2 -0
- package/build/esm/icons/NavigationArrow.js +4 -0
- package/build/esm/icons/NavigationClose.d.ts +2 -0
- package/build/esm/icons/NavigationClose.js +4 -0
- package/build/esm/icons/NavigationOpen.d.ts +2 -0
- package/build/esm/icons/NavigationOpen.js +6 -0
- package/build/esm/icons/index.d.ts +3 -0
- package/build/esm/icons/index.js +3 -0
- package/build/esm/models/constructor-items/blocks.d.ts +2 -4
- package/build/esm/models/index.d.ts +1 -0
- package/build/esm/models/index.js +1 -0
- package/build/esm/models/navigation.d.ts +62 -0
- package/build/esm/models/navigation.js +7 -0
- package/build/esm/schema/index.d.ts +0 -2
- package/build/esm/schema/validators/common.d.ts +0 -17
- package/build/esm/schema/validators/common.js +0 -11
- package/build/esm/sub-blocks/BackgroundCard/schema.d.ts +0 -5
- package/build/esm/sub-blocks/BasicCard/schema.d.ts +0 -4
- package/build/esm/sub-blocks/CardWithImage/schema.d.ts +0 -8
- package/build/esm/sub-blocks/CardWithImage/schema.js +1 -4
- package/build/esm/sub-blocks/Content/schema.d.ts +0 -8
- package/build/esm/sub-blocks/Content/schema.js +1 -3
- package/build/esm/sub-blocks/MediaCard/schema.d.ts +0 -1
- package/build/esm/sub-blocks/NewsCard/schema.d.ts +0 -1
- package/build/esm/sub-blocks/NewsCard/schema.js +0 -1
- package/build/esm/sub-blocks/Partner/schema.d.ts +0 -1
- package/build/esm/sub-blocks/Partner/schema.js +0 -1
- package/build/esm/sub-blocks/PriceDetailed/schema.d.ts +0 -1
- package/build/esm/sub-blocks/PriceDetailed/schema.js +0 -8
- package/build/esm/sub-blocks/Quote/schema.d.ts +0 -4
- package/build/esm/sub-blocks/Quote/schema.js +0 -1
- package/build/esm/sub-blocks/TutorialCard/schema.d.ts +0 -2
- package/build/esm/sub-blocks/TutorialCard/schema.js +0 -2
- package/build/esm/text-transform/blocks.js +0 -1
- package/package.json +2 -5
- package/server/models/constructor-items/blocks.d.ts +2 -4
- package/server/models/index.d.ts +1 -0
- package/server/models/index.js +1 -0
- package/server/models/navigation.d.ts +62 -0
- package/server/models/navigation.js +10 -0
- package/server/text-transform/blocks.js +0 -1
- package/styles/mixins.scss +38 -0
|
@@ -8,15 +8,12 @@ export declare const tabsItem: {
|
|
|
8
8
|
};
|
|
9
9
|
title: {
|
|
10
10
|
type: string;
|
|
11
|
-
content: string;
|
|
12
11
|
};
|
|
13
12
|
text: {
|
|
14
13
|
type: string;
|
|
15
|
-
content: string;
|
|
16
14
|
};
|
|
17
15
|
caption: {
|
|
18
16
|
type: string;
|
|
19
|
-
content: string;
|
|
20
17
|
};
|
|
21
18
|
media: {
|
|
22
19
|
oneOf: ({
|
|
@@ -110,7 +107,6 @@ export declare const tabsItem: {
|
|
|
110
107
|
};
|
|
111
108
|
text: {
|
|
112
109
|
type: string;
|
|
113
|
-
content: string;
|
|
114
110
|
};
|
|
115
111
|
};
|
|
116
112
|
};
|
|
@@ -165,7 +161,6 @@ export declare const tabsItem: {
|
|
|
165
161
|
properties: {
|
|
166
162
|
text: {
|
|
167
163
|
type: string;
|
|
168
|
-
content: string;
|
|
169
164
|
};
|
|
170
165
|
url: {
|
|
171
166
|
type: string;
|
|
@@ -234,7 +229,6 @@ export declare const TabsBlock: {
|
|
|
234
229
|
properties: {
|
|
235
230
|
text: {
|
|
236
231
|
type: string;
|
|
237
|
-
content: string;
|
|
238
232
|
};
|
|
239
233
|
textSize: {
|
|
240
234
|
type: string;
|
|
@@ -250,7 +244,6 @@ export declare const TabsBlock: {
|
|
|
250
244
|
};
|
|
251
245
|
description: {
|
|
252
246
|
type: string;
|
|
253
|
-
content: string;
|
|
254
247
|
};
|
|
255
248
|
items: {
|
|
256
249
|
type: string;
|
|
@@ -270,7 +263,6 @@ export declare const TabsBlock: {
|
|
|
270
263
|
properties: {
|
|
271
264
|
text: {
|
|
272
265
|
type: string;
|
|
273
|
-
content: string;
|
|
274
266
|
};
|
|
275
267
|
url: {
|
|
276
268
|
type: string;
|
|
@@ -14,15 +14,12 @@ exports.tabsItem = {
|
|
|
14
14
|
},
|
|
15
15
|
title: {
|
|
16
16
|
type: 'string',
|
|
17
|
-
content: 'yfm',
|
|
18
17
|
},
|
|
19
18
|
text: {
|
|
20
19
|
type: 'string',
|
|
21
|
-
content: 'yfm',
|
|
22
20
|
},
|
|
23
21
|
caption: {
|
|
24
22
|
type: 'string',
|
|
25
|
-
content: 'text',
|
|
26
23
|
},
|
|
27
24
|
media: (0, common_1.withTheme)({
|
|
28
25
|
type: 'object',
|
|
@@ -40,7 +37,6 @@ exports.TabsBlock = {
|
|
|
40
37
|
required: ['title', 'items'],
|
|
41
38
|
properties: Object.assign(Object.assign({}, common_1.BlockBaseProps), { title: common_1.TitleProps, description: {
|
|
42
39
|
type: 'string',
|
|
43
|
-
content: 'text',
|
|
44
40
|
}, items: (0, utils_1.filteredArray)(exports.tabsItem) }),
|
|
45
41
|
},
|
|
46
42
|
};
|
|
@@ -10,11 +10,9 @@ export declare const author: {
|
|
|
10
10
|
properties: {
|
|
11
11
|
firstName: {
|
|
12
12
|
type: string;
|
|
13
|
-
content: string;
|
|
14
13
|
};
|
|
15
14
|
secondName: {
|
|
16
15
|
type: string;
|
|
17
|
-
content: string;
|
|
18
16
|
};
|
|
19
17
|
avatar: {
|
|
20
18
|
type: string;
|
|
@@ -22,7 +20,6 @@ export declare const author: {
|
|
|
22
20
|
};
|
|
23
21
|
description: {
|
|
24
22
|
type: string;
|
|
25
|
-
content: string;
|
|
26
23
|
};
|
|
27
24
|
};
|
|
28
25
|
};
|
|
@@ -18,7 +18,6 @@ export declare const ImageDeviceProps: {
|
|
|
18
18
|
};
|
|
19
19
|
alt: {
|
|
20
20
|
type: string;
|
|
21
|
-
content: string;
|
|
22
21
|
};
|
|
23
22
|
disableCompress: {
|
|
24
23
|
type: string;
|
|
@@ -36,7 +35,6 @@ export declare const ImageObjectProps: {
|
|
|
36
35
|
};
|
|
37
36
|
alt: {
|
|
38
37
|
type: string;
|
|
39
|
-
content: string;
|
|
40
38
|
};
|
|
41
39
|
disableCompress: {
|
|
42
40
|
type: string;
|
|
@@ -19,7 +19,6 @@ exports.ImageDeviceProps = {
|
|
|
19
19
|
},
|
|
20
20
|
alt: {
|
|
21
21
|
type: 'string',
|
|
22
|
-
content: 'text',
|
|
23
22
|
},
|
|
24
23
|
disableCompress: {
|
|
25
24
|
type: 'boolean',
|
|
@@ -37,7 +36,6 @@ exports.ImageObjectProps = {
|
|
|
37
36
|
},
|
|
38
37
|
alt: {
|
|
39
38
|
type: 'string',
|
|
40
|
-
content: 'text',
|
|
41
39
|
},
|
|
42
40
|
disableCompress: {
|
|
43
41
|
type: 'boolean',
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
.pc-overflow-scroller__scroller {
|
|
10
10
|
position: absolute;
|
|
11
11
|
z-index: 10;
|
|
12
|
+
top: 0;
|
|
12
13
|
display: flex;
|
|
13
14
|
justify-content: flex-end;
|
|
14
15
|
align-items: center;
|
|
15
16
|
width: 32px;
|
|
17
|
+
height: calc(100% - 1px);
|
|
16
18
|
cursor: pointer;
|
|
17
19
|
color: var(--yc-color-text-secondary);
|
|
18
20
|
background: linear-gradient(to left, var(--yc-color-base-background) 70%, var(--pc-transparent) 100%) no-repeat;
|
|
@@ -33,4 +33,6 @@ export { default as OverflowScroller } from './OverflowScroller/OverflowScroller
|
|
|
33
33
|
export { default as Author } from './Author/Author';
|
|
34
34
|
export { default as RouterLink } from './RouterLink/RouterLink';
|
|
35
35
|
export { default as HTML } from './HTML/HTML';
|
|
36
|
+
export { default as Header } from './navigation/components/Header/Header';
|
|
37
|
+
export * as Navigation from './navigation/components/index';
|
|
36
38
|
export type { RouterLinkProps } from './RouterLink/RouterLink';
|
|
@@ -1,76 +1,77 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.HTML = exports.RouterLink = exports.Author = exports.OverflowScroller = exports.Control = exports.YandexForm = exports.YFMWrapper = exports.VideoBlock = exports.UnpublishedLabel = exports.ToggleArrow = exports.Title = exports.Table = exports.ReactPlayer = exports.OutsideClick = exports.Media = exports.Links = exports.Link = exports.Image = exports.HeightCalculator = exports.HeaderBreadcrumbs = exports.FullWidthBackground = exports.FullscreenImage = exports.Foldable = exports.FileLink = exports.ErrorWrapper = exports.CardBase = exports.Button = exports.BlockHeader = exports.BlockBase = exports.BalancedMasonry = exports.BackLink = exports.BackgroundMedia = exports.BackgroundImage = exports.AnimateBlock = exports.Anchor = void 0;
|
|
3
|
+
exports.Navigation = exports.Header = exports.HTML = exports.RouterLink = exports.Author = exports.OverflowScroller = exports.Control = exports.YandexForm = exports.YFMWrapper = exports.VideoBlock = exports.UnpublishedLabel = exports.ToggleArrow = exports.Title = exports.Table = exports.ReactPlayer = exports.OutsideClick = exports.Media = exports.Links = exports.Link = exports.Image = exports.HeightCalculator = exports.HeaderBreadcrumbs = exports.FullWidthBackground = exports.FullscreenImage = exports.Foldable = exports.FileLink = exports.ErrorWrapper = exports.CardBase = exports.Button = exports.BlockHeader = exports.BlockBase = exports.BalancedMasonry = exports.BackLink = exports.BackgroundMedia = exports.BackgroundImage = exports.AnimateBlock = exports.Anchor = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
7
5
|
var Anchor_1 = require("./Anchor/Anchor");
|
|
8
|
-
Object.defineProperty(exports, "Anchor", { enumerable: true, get: function () { return __importDefault(Anchor_1).default; } });
|
|
6
|
+
Object.defineProperty(exports, "Anchor", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(Anchor_1).default; } });
|
|
9
7
|
var AnimateBlock_1 = require("./AnimateBlock/AnimateBlock");
|
|
10
|
-
Object.defineProperty(exports, "AnimateBlock", { enumerable: true, get: function () { return __importDefault(AnimateBlock_1).default; } });
|
|
8
|
+
Object.defineProperty(exports, "AnimateBlock", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(AnimateBlock_1).default; } });
|
|
11
9
|
var BackgroundImage_1 = require("./BackgroundImage/BackgroundImage");
|
|
12
|
-
Object.defineProperty(exports, "BackgroundImage", { enumerable: true, get: function () { return __importDefault(BackgroundImage_1).default; } });
|
|
10
|
+
Object.defineProperty(exports, "BackgroundImage", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(BackgroundImage_1).default; } });
|
|
13
11
|
var BackgroundMedia_1 = require("./BackgroundMedia/BackgroundMedia");
|
|
14
|
-
Object.defineProperty(exports, "BackgroundMedia", { enumerable: true, get: function () { return __importDefault(BackgroundMedia_1).default; } });
|
|
12
|
+
Object.defineProperty(exports, "BackgroundMedia", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(BackgroundMedia_1).default; } });
|
|
15
13
|
var BackLink_1 = require("./BackLink/BackLink");
|
|
16
|
-
Object.defineProperty(exports, "BackLink", { enumerable: true, get: function () { return __importDefault(BackLink_1).default; } });
|
|
14
|
+
Object.defineProperty(exports, "BackLink", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(BackLink_1).default; } });
|
|
17
15
|
var BalancedMasonry_1 = require("./BalancedMasonry/BalancedMasonry");
|
|
18
|
-
Object.defineProperty(exports, "BalancedMasonry", { enumerable: true, get: function () { return __importDefault(BalancedMasonry_1).default; } });
|
|
16
|
+
Object.defineProperty(exports, "BalancedMasonry", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(BalancedMasonry_1).default; } });
|
|
19
17
|
var BlockBase_1 = require("./BlockBase/BlockBase");
|
|
20
|
-
Object.defineProperty(exports, "BlockBase", { enumerable: true, get: function () { return __importDefault(BlockBase_1).default; } });
|
|
18
|
+
Object.defineProperty(exports, "BlockBase", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(BlockBase_1).default; } });
|
|
21
19
|
var BlockHeader_1 = require("./BlockHeader/BlockHeader");
|
|
22
|
-
Object.defineProperty(exports, "BlockHeader", { enumerable: true, get: function () { return __importDefault(BlockHeader_1).default; } });
|
|
20
|
+
Object.defineProperty(exports, "BlockHeader", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(BlockHeader_1).default; } });
|
|
23
21
|
var Button_1 = require("./Button/Button");
|
|
24
|
-
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return __importDefault(Button_1).default; } });
|
|
22
|
+
Object.defineProperty(exports, "Button", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(Button_1).default; } });
|
|
25
23
|
var CardBase_1 = require("./CardBase/CardBase");
|
|
26
|
-
Object.defineProperty(exports, "CardBase", { enumerable: true, get: function () { return __importDefault(CardBase_1).default; } });
|
|
24
|
+
Object.defineProperty(exports, "CardBase", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(CardBase_1).default; } });
|
|
27
25
|
var ErrorWrapper_1 = require("./ErrorWrapper/ErrorWrapper");
|
|
28
|
-
Object.defineProperty(exports, "ErrorWrapper", { enumerable: true, get: function () { return __importDefault(ErrorWrapper_1).default; } });
|
|
26
|
+
Object.defineProperty(exports, "ErrorWrapper", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(ErrorWrapper_1).default; } });
|
|
29
27
|
var FileLink_1 = require("./FileLink/FileLink");
|
|
30
|
-
Object.defineProperty(exports, "FileLink", { enumerable: true, get: function () { return __importDefault(FileLink_1).default; } });
|
|
28
|
+
Object.defineProperty(exports, "FileLink", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(FileLink_1).default; } });
|
|
31
29
|
var Foldable_1 = require("./Foldable/Foldable");
|
|
32
|
-
Object.defineProperty(exports, "Foldable", { enumerable: true, get: function () { return __importDefault(Foldable_1).default; } });
|
|
30
|
+
Object.defineProperty(exports, "Foldable", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(Foldable_1).default; } });
|
|
33
31
|
var FullscreenImage_1 = require("./FullscreenImage/FullscreenImage");
|
|
34
|
-
Object.defineProperty(exports, "FullscreenImage", { enumerable: true, get: function () { return __importDefault(FullscreenImage_1).default; } });
|
|
32
|
+
Object.defineProperty(exports, "FullscreenImage", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(FullscreenImage_1).default; } });
|
|
35
33
|
var FullWidthBackground_1 = require("./FullWidthBackground/FullWidthBackground");
|
|
36
|
-
Object.defineProperty(exports, "FullWidthBackground", { enumerable: true, get: function () { return __importDefault(FullWidthBackground_1).default; } });
|
|
34
|
+
Object.defineProperty(exports, "FullWidthBackground", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(FullWidthBackground_1).default; } });
|
|
37
35
|
var HeaderBreadcrumbs_1 = require("./HeaderBreadcrumbs/HeaderBreadcrumbs");
|
|
38
|
-
Object.defineProperty(exports, "HeaderBreadcrumbs", { enumerable: true, get: function () { return __importDefault(HeaderBreadcrumbs_1).default; } });
|
|
36
|
+
Object.defineProperty(exports, "HeaderBreadcrumbs", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(HeaderBreadcrumbs_1).default; } });
|
|
39
37
|
var HeightCalculator_1 = require("./HeightCalculator/HeightCalculator");
|
|
40
|
-
Object.defineProperty(exports, "HeightCalculator", { enumerable: true, get: function () { return __importDefault(HeightCalculator_1).default; } });
|
|
38
|
+
Object.defineProperty(exports, "HeightCalculator", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(HeightCalculator_1).default; } });
|
|
41
39
|
var Image_1 = require("./Image/Image");
|
|
42
|
-
Object.defineProperty(exports, "Image", { enumerable: true, get: function () { return __importDefault(Image_1).default; } });
|
|
40
|
+
Object.defineProperty(exports, "Image", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(Image_1).default; } });
|
|
43
41
|
var Link_1 = require("./Link/Link");
|
|
44
|
-
Object.defineProperty(exports, "Link", { enumerable: true, get: function () { return __importDefault(Link_1).default; } });
|
|
42
|
+
Object.defineProperty(exports, "Link", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(Link_1).default; } });
|
|
45
43
|
var Links_1 = require("./Link/Links");
|
|
46
|
-
Object.defineProperty(exports, "Links", { enumerable: true, get: function () { return __importDefault(Links_1).default; } });
|
|
44
|
+
Object.defineProperty(exports, "Links", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(Links_1).default; } });
|
|
47
45
|
var Media_1 = require("./Media/Media");
|
|
48
|
-
Object.defineProperty(exports, "Media", { enumerable: true, get: function () { return __importDefault(Media_1).default; } });
|
|
46
|
+
Object.defineProperty(exports, "Media", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(Media_1).default; } });
|
|
49
47
|
var OutsideClick_1 = require("./OutsideClick/OutsideClick");
|
|
50
|
-
Object.defineProperty(exports, "OutsideClick", { enumerable: true, get: function () { return __importDefault(OutsideClick_1).default; } });
|
|
48
|
+
Object.defineProperty(exports, "OutsideClick", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(OutsideClick_1).default; } });
|
|
51
49
|
var ReactPlayer_1 = require("./ReactPlayer/ReactPlayer");
|
|
52
|
-
Object.defineProperty(exports, "ReactPlayer", { enumerable: true, get: function () { return __importDefault(ReactPlayer_1).default; } });
|
|
50
|
+
Object.defineProperty(exports, "ReactPlayer", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(ReactPlayer_1).default; } });
|
|
53
51
|
var Table_1 = require("./Table/Table");
|
|
54
|
-
Object.defineProperty(exports, "Table", { enumerable: true, get: function () { return __importDefault(Table_1).default; } });
|
|
52
|
+
Object.defineProperty(exports, "Table", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(Table_1).default; } });
|
|
55
53
|
var Title_1 = require("./Title/Title");
|
|
56
|
-
Object.defineProperty(exports, "Title", { enumerable: true, get: function () { return __importDefault(Title_1).default; } });
|
|
54
|
+
Object.defineProperty(exports, "Title", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(Title_1).default; } });
|
|
57
55
|
var ToggleArrow_1 = require("./ToggleArrow/ToggleArrow");
|
|
58
|
-
Object.defineProperty(exports, "ToggleArrow", { enumerable: true, get: function () { return __importDefault(ToggleArrow_1).default; } });
|
|
56
|
+
Object.defineProperty(exports, "ToggleArrow", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(ToggleArrow_1).default; } });
|
|
59
57
|
var UnpublishedLabel_1 = require("./UnpublishedLabel/UnpublishedLabel");
|
|
60
|
-
Object.defineProperty(exports, "UnpublishedLabel", { enumerable: true, get: function () { return __importDefault(UnpublishedLabel_1).default; } });
|
|
58
|
+
Object.defineProperty(exports, "UnpublishedLabel", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(UnpublishedLabel_1).default; } });
|
|
61
59
|
var VideoBlock_1 = require("./VideoBlock/VideoBlock");
|
|
62
|
-
Object.defineProperty(exports, "VideoBlock", { enumerable: true, get: function () { return __importDefault(VideoBlock_1).default; } });
|
|
60
|
+
Object.defineProperty(exports, "VideoBlock", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(VideoBlock_1).default; } });
|
|
63
61
|
var YFMWrapper_1 = require("./YFMWrapper/YFMWrapper");
|
|
64
|
-
Object.defineProperty(exports, "YFMWrapper", { enumerable: true, get: function () { return __importDefault(YFMWrapper_1).default; } });
|
|
62
|
+
Object.defineProperty(exports, "YFMWrapper", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(YFMWrapper_1).default; } });
|
|
65
63
|
var YandexForm_1 = require("./YandexForm/YandexForm");
|
|
66
|
-
Object.defineProperty(exports, "YandexForm", { enumerable: true, get: function () { return __importDefault(YandexForm_1).default; } });
|
|
64
|
+
Object.defineProperty(exports, "YandexForm", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(YandexForm_1).default; } });
|
|
67
65
|
var Control_1 = require("./Control/Control");
|
|
68
|
-
Object.defineProperty(exports, "Control", { enumerable: true, get: function () { return __importDefault(Control_1).default; } });
|
|
66
|
+
Object.defineProperty(exports, "Control", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(Control_1).default; } });
|
|
69
67
|
var OverflowScroller_1 = require("./OverflowScroller/OverflowScroller");
|
|
70
|
-
Object.defineProperty(exports, "OverflowScroller", { enumerable: true, get: function () { return __importDefault(OverflowScroller_1).default; } });
|
|
68
|
+
Object.defineProperty(exports, "OverflowScroller", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(OverflowScroller_1).default; } });
|
|
71
69
|
var Author_1 = require("./Author/Author");
|
|
72
|
-
Object.defineProperty(exports, "Author", { enumerable: true, get: function () { return __importDefault(Author_1).default; } });
|
|
70
|
+
Object.defineProperty(exports, "Author", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(Author_1).default; } });
|
|
73
71
|
var RouterLink_1 = require("./RouterLink/RouterLink");
|
|
74
|
-
Object.defineProperty(exports, "RouterLink", { enumerable: true, get: function () { return __importDefault(RouterLink_1).default; } });
|
|
72
|
+
Object.defineProperty(exports, "RouterLink", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(RouterLink_1).default; } });
|
|
75
73
|
var HTML_1 = require("./HTML/HTML");
|
|
76
|
-
Object.defineProperty(exports, "HTML", { enumerable: true, get: function () { return __importDefault(HTML_1).default; } });
|
|
74
|
+
Object.defineProperty(exports, "HTML", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(HTML_1).default; } });
|
|
75
|
+
var Header_1 = require("./navigation/components/Header/Header");
|
|
76
|
+
Object.defineProperty(exports, "Header", { enumerable: true, get: function () { return (0, tslib_1.__importDefault)(Header_1).default; } });
|
|
77
|
+
exports.Navigation = (0, tslib_1.__importStar)(require("./navigation/components/index"));
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-header {
|
|
4
|
+
position: sticky;
|
|
5
|
+
z-index: 98;
|
|
6
|
+
top: 0;
|
|
7
|
+
display: flex;
|
|
8
|
+
justify-content: center;
|
|
9
|
+
align-items: center;
|
|
10
|
+
height: var(--header-height);
|
|
11
|
+
background-color: var(--yc-color-base-background);
|
|
12
|
+
box-shadow: inset 0 -1px 0 var(--yc-color-line-generic);
|
|
13
|
+
}
|
|
14
|
+
.pc-header__wrapper {
|
|
15
|
+
display: flex;
|
|
16
|
+
justify-content: space-between;
|
|
17
|
+
align-items: center;
|
|
18
|
+
height: var(--header-height);
|
|
19
|
+
}
|
|
20
|
+
@media (min-width: 769px) {
|
|
21
|
+
.pc-header__mobile-menu-button {
|
|
22
|
+
display: none;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
.pc-header__navigation, .pc-header__left, .pc-header__right {
|
|
26
|
+
display: flex;
|
|
27
|
+
align-items: center;
|
|
28
|
+
}
|
|
29
|
+
.pc-header__navigation {
|
|
30
|
+
position: relative;
|
|
31
|
+
margin-right: 20px;
|
|
32
|
+
flex: 1 0 0;
|
|
33
|
+
justify-content: flex-start;
|
|
34
|
+
}
|
|
35
|
+
@media (max-width: 768px) {
|
|
36
|
+
.pc-header__navigation {
|
|
37
|
+
display: none;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
.pc-header__right {
|
|
41
|
+
flex: 0;
|
|
42
|
+
justify-content: flex-end;
|
|
43
|
+
}
|
|
44
|
+
.pc-header__navigation-container {
|
|
45
|
+
display: flex;
|
|
46
|
+
overflow-x: hidden;
|
|
47
|
+
flex: 1 0 0;
|
|
48
|
+
justify-content: space-between;
|
|
49
|
+
align-items: center;
|
|
50
|
+
margin-right: 20px;
|
|
51
|
+
}
|
|
52
|
+
.pc-header__buttons {
|
|
53
|
+
display: flex;
|
|
54
|
+
}
|
|
55
|
+
@media (max-width: 768px) {
|
|
56
|
+
.pc-header__buttons {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
.pc-header__buttons > *:not(:last-child) {
|
|
61
|
+
margin-right: 16px;
|
|
62
|
+
}
|
|
63
|
+
.pc-header__button {
|
|
64
|
+
margin-top: 0;
|
|
65
|
+
}
|
|
66
|
+
.pc-header__logo {
|
|
67
|
+
margin: 0 32px 0 0;
|
|
68
|
+
cursor: pointer;
|
|
69
|
+
}
|
|
70
|
+
@media (max-width: 768px) {
|
|
71
|
+
.pc-header__navigation-container {
|
|
72
|
+
justify-content: flex-end;
|
|
73
|
+
}
|
|
74
|
+
.pc-header__left {
|
|
75
|
+
flex: 1 0 0;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
@media (max-width: 576px) {
|
|
79
|
+
.pc-header__navigation-container {
|
|
80
|
+
margin-right: 12px;
|
|
81
|
+
}
|
|
82
|
+
.pc-header__logo {
|
|
83
|
+
margin-right: 0;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Header = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = (0, tslib_1.__importStar)(require("react"));
|
|
6
|
+
const utils_1 = require("../../../../utils");
|
|
7
|
+
const grid_1 = require("../../../../grid");
|
|
8
|
+
const OutsideClick_1 = (0, tslib_1.__importDefault)(require("../../../OutsideClick/OutsideClick"));
|
|
9
|
+
const Control_1 = (0, tslib_1.__importDefault)(require("../../../Control/Control"));
|
|
10
|
+
const Navigation_1 = (0, tslib_1.__importDefault)(require("../Navigation/Navigation"));
|
|
11
|
+
const MobileNavigation_1 = (0, tslib_1.__importDefault)(require("../MobileNavigation/MobileNavigation"));
|
|
12
|
+
const NavigationItem_1 = (0, tslib_1.__importDefault)(require("../NavigationItem/NavigationItem"));
|
|
13
|
+
const Logo_1 = (0, tslib_1.__importDefault)(require("../Logo/Logo"));
|
|
14
|
+
const icons_1 = require("../../../../icons");
|
|
15
|
+
const b = (0, utils_1.block)('header');
|
|
16
|
+
const ICON_SIZE = 36;
|
|
17
|
+
const MobileMenuButton = ({ isSidebarOpened, onSidebarOpenedChange, }) => {
|
|
18
|
+
const iconProps = {
|
|
19
|
+
icon: isSidebarOpened ? icons_1.NavigationClose : icons_1.NavigationOpen,
|
|
20
|
+
iconSize: ICON_SIZE,
|
|
21
|
+
};
|
|
22
|
+
return (react_1.default.createElement(Control_1.default, Object.assign({ className: b('mobile-menu-button'), onClick: (e) => {
|
|
23
|
+
e.stopPropagation();
|
|
24
|
+
onSidebarOpenedChange(!isSidebarOpened);
|
|
25
|
+
}, size: "l" }, iconProps)));
|
|
26
|
+
};
|
|
27
|
+
const Header = ({ data, logo }) => {
|
|
28
|
+
const { leftItems, rightItems } = data;
|
|
29
|
+
const [isSidebarOpened, setIsSidebarOpened] = (0, react_1.useState)(false);
|
|
30
|
+
const [activeItemIndex, setActiveItemIndex] = (0, react_1.useState)(-1);
|
|
31
|
+
const onActiveItemChange = (0, react_1.useCallback)((index) => {
|
|
32
|
+
setActiveItemIndex(index);
|
|
33
|
+
}, []);
|
|
34
|
+
const onSidebarOpenedChange = (0, react_1.useCallback)((isOpen) => {
|
|
35
|
+
setIsSidebarOpened(isOpen);
|
|
36
|
+
}, []);
|
|
37
|
+
const hideSidebar = (0, react_1.useCallback)(() => {
|
|
38
|
+
setIsSidebarOpened(false);
|
|
39
|
+
}, []);
|
|
40
|
+
return (react_1.default.createElement(grid_1.Grid, { className: b() },
|
|
41
|
+
react_1.default.createElement(grid_1.Row, null,
|
|
42
|
+
react_1.default.createElement(grid_1.Col, null,
|
|
43
|
+
react_1.default.createElement("header", { className: b('wrapper') },
|
|
44
|
+
logo && (react_1.default.createElement("div", { className: b('left') },
|
|
45
|
+
react_1.default.createElement(Logo_1.default, Object.assign({}, logo, { className: b('logo') })))),
|
|
46
|
+
react_1.default.createElement("div", { className: b('navigation-container') },
|
|
47
|
+
react_1.default.createElement(Navigation_1.default, { className: b('navigation'), links: leftItems, activeItemIndex: activeItemIndex, onActiveItemChange: onActiveItemChange })),
|
|
48
|
+
react_1.default.createElement("div", { className: b('right') },
|
|
49
|
+
react_1.default.createElement(MobileMenuButton, { isSidebarOpened: isSidebarOpened, onSidebarOpenedChange: onSidebarOpenedChange }),
|
|
50
|
+
rightItems && (react_1.default.createElement("div", { className: b('buttons') }, rightItems.map((button) => (react_1.default.createElement(NavigationItem_1.default, { key: button.text, data: button, className: b('button') })))))),
|
|
51
|
+
react_1.default.createElement(OutsideClick_1.default, { onOutsideClick: () => onSidebarOpenedChange(false) },
|
|
52
|
+
react_1.default.createElement(MobileNavigation_1.default, { topItems: leftItems, bottomItems: rightItems, isOpened: isSidebarOpened, activeItemIndex: activeItemIndex, onActiveItemChange: onActiveItemChange, onClose: hideSidebar })))))));
|
|
53
|
+
};
|
|
54
|
+
exports.Header = Header;
|
|
55
|
+
exports.default = exports.Header;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.pc-logo {
|
|
2
|
+
margin: 0;
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
/* use this for style redefinitions to awoid problems with
|
|
6
|
+
unpredictable css rules order in build */
|
|
7
|
+
.pc-logo {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
font-weight: var(--yc-text-accent-font-weight);
|
|
11
|
+
font-size: var(--yc-text-header-1-font-size);
|
|
12
|
+
line-height: var(--yc-text-header-1-line-height);
|
|
13
|
+
color: var(--pc-text-header-color);
|
|
14
|
+
font-weight: var(--yc-text-accent-font-weight);
|
|
15
|
+
}
|
|
16
|
+
.pc-logo__icon {
|
|
17
|
+
display: flex;
|
|
18
|
+
margin-right: 8px;
|
|
19
|
+
object-fit: contain;
|
|
20
|
+
}
|
|
21
|
+
.pc-logo__text {
|
|
22
|
+
white-space: nowrap;
|
|
23
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = (0, tslib_1.__importDefault)(require("react"));
|
|
5
|
+
const utils_1 = require("../../../../utils");
|
|
6
|
+
const RouterLink_1 = (0, tslib_1.__importDefault)(require("../../../RouterLink/RouterLink"));
|
|
7
|
+
const utils_2 = require("../../../Media/Image/utils");
|
|
8
|
+
const index_1 = require("../../../index");
|
|
9
|
+
const b = (0, utils_1.block)('logo');
|
|
10
|
+
const Logo = ({ icon, text, className }) => {
|
|
11
|
+
const imageData = (0, utils_2.getMediaImage)(icon);
|
|
12
|
+
return (react_1.default.createElement(RouterLink_1.default, { href: "/", passHref: true },
|
|
13
|
+
react_1.default.createElement("div", { className: b(null, className) },
|
|
14
|
+
imageData && react_1.default.createElement(index_1.Image, Object.assign({ className: b('icon') }, imageData)),
|
|
15
|
+
react_1.default.createElement("span", { className: b('text') }, text))));
|
|
16
|
+
};
|
|
17
|
+
exports.default = Logo;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-mobile-navigation {
|
|
4
|
+
position: fixed;
|
|
5
|
+
z-index: 100;
|
|
6
|
+
top: var(--header-height);
|
|
7
|
+
left: 0;
|
|
8
|
+
width: 100%;
|
|
9
|
+
border-bottom-right-radius: var(--pc-border-radius);
|
|
10
|
+
border-bottom-left-radius: var(--pc-border-radius);
|
|
11
|
+
background-color: var(--yc-color-base-background);
|
|
12
|
+
box-shadow: 0 3px 10px var(--yc-color-sfx-shadow);
|
|
13
|
+
font-size: var(--yc-text-body-2-font-size);
|
|
14
|
+
line-height: var(--yc-text-body-2-line-height);
|
|
15
|
+
}
|
|
16
|
+
@media (min-width: 769px) {
|
|
17
|
+
.pc-mobile-navigation {
|
|
18
|
+
display: none;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
.pc-mobile-navigation__wrapper {
|
|
22
|
+
padding: 32px 48px;
|
|
23
|
+
}
|
|
24
|
+
.pc-mobile-navigation__button {
|
|
25
|
+
margin-top: 24px;
|
|
26
|
+
}
|
|
27
|
+
.pc-mobile-navigation__links {
|
|
28
|
+
position: relative;
|
|
29
|
+
display: flex;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
padding-bottom: 24px;
|
|
32
|
+
margin: 0;
|
|
33
|
+
padding: 0;
|
|
34
|
+
list-style: none;
|
|
35
|
+
}
|
|
36
|
+
.pc-mobile-navigation__links-item:not(:last-child) {
|
|
37
|
+
margin-bottom: 24px;
|
|
38
|
+
}
|
|
39
|
+
.pc-mobile-navigation__dropdown-item:not(:last-child) {
|
|
40
|
+
margin-bottom: 16px;
|
|
41
|
+
}
|
|
42
|
+
.pc-mobile-navigation__popup {
|
|
43
|
+
z-index: 101;
|
|
44
|
+
display: flex;
|
|
45
|
+
flex-direction: column;
|
|
46
|
+
min-width: 220px;
|
|
47
|
+
padding: 16px;
|
|
48
|
+
border: 1px solid var(--yc-color-line-generic);
|
|
49
|
+
border-top-width: 0;
|
|
50
|
+
border-radius: calc(var(--pc-border-radius) / 2);
|
|
51
|
+
background: var(--yc-color-base-float);
|
|
52
|
+
box-shadow: 0 3px 10px var(--yc-color-sfx-shadow);
|
|
53
|
+
}
|
|
54
|
+
@media (min-width: 769px) {
|
|
55
|
+
.pc-mobile-navigation__popup {
|
|
56
|
+
display: none;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
@media (max-width: 576px) {
|
|
60
|
+
.pc-mobile-navigation__wrapper {
|
|
61
|
+
padding-left: 24px;
|
|
62
|
+
padding-right: 24px;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NavigationItem as NavigationItemModel } from '../../../../models/navigation';
|
|
3
|
+
export interface MobileNavigationProps {
|
|
4
|
+
className?: string;
|
|
5
|
+
isOpened?: boolean;
|
|
6
|
+
topItems?: NavigationItemModel[];
|
|
7
|
+
bottomItems?: NavigationItemModel[];
|
|
8
|
+
activeItemIndex: number;
|
|
9
|
+
onClose: () => void;
|
|
10
|
+
onActiveItemChange: (index: number) => void;
|
|
11
|
+
}
|
|
12
|
+
declare const MobileNavigation: React.FC<MobileNavigationProps>;
|
|
13
|
+
export default MobileNavigation;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = (0, tslib_1.__importStar)(require("react"));
|
|
5
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
6
|
+
const utils_1 = require("../../../../utils");
|
|
7
|
+
const Foldable_1 = (0, tslib_1.__importDefault)(require("../../../Foldable/Foldable"));
|
|
8
|
+
const navigation_1 = require("../../../../models/navigation");
|
|
9
|
+
const NavigationItem_1 = (0, tslib_1.__importDefault)(require("../NavigationItem/NavigationItem"));
|
|
10
|
+
const b = (0, utils_1.block)('mobile-navigation');
|
|
11
|
+
const MobileNavigationDropdown = ({ data, onItemClick, onToggle, isOpened = false, }) => {
|
|
12
|
+
const ref = (0, react_1.useRef)(null);
|
|
13
|
+
return (react_1.default.createElement("div", { ref: ref, className: b('dropdown') },
|
|
14
|
+
react_1.default.createElement(NavigationItem_1.default, { data: data, onClick: onToggle, isOpened: isOpened }),
|
|
15
|
+
isOpened && (react_1.default.createElement(uikit_1.Popup, { anchorRef: ref, open: isOpened, className: b('popup') }, data.items.map((item) => (react_1.default.createElement(NavigationItem_1.default, { key: item.text, data: item, className: b('dropdown-item'), onClick: onItemClick })))))));
|
|
16
|
+
};
|
|
17
|
+
const MobileNavigationItem = ({ link, index, isActive, onActiveItemChange, onClose, }) => {
|
|
18
|
+
const toggleActive = (0, react_1.useCallback)((e) => {
|
|
19
|
+
e.stopPropagation();
|
|
20
|
+
if (onActiveItemChange) {
|
|
21
|
+
onActiveItemChange(isActive ? -1 : index);
|
|
22
|
+
}
|
|
23
|
+
}, [isActive, index, onActiveItemChange]);
|
|
24
|
+
const onItemClick = (0, react_1.useCallback)((e) => {
|
|
25
|
+
toggleActive(e);
|
|
26
|
+
onClose();
|
|
27
|
+
}, [toggleActive, onClose]);
|
|
28
|
+
return (react_1.default.createElement("li", { key: index, className: b('links-item') }, link.type === navigation_1.NavigationItemType.Dropdown ? (react_1.default.createElement(MobileNavigationDropdown, { data: link, onToggle: toggleActive, isOpened: isActive, onItemClick: onItemClick })) : (react_1.default.createElement(NavigationItem_1.default, { data: link, onClick: onItemClick }))));
|
|
29
|
+
};
|
|
30
|
+
const MobileNavigation = (props) => {
|
|
31
|
+
if (typeof window === 'undefined') {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
const { isOpened, topItems, bottomItems, activeItemIndex, onActiveItemChange, onClose } = props;
|
|
35
|
+
return (react_1.default.createElement(uikit_1.Portal, null,
|
|
36
|
+
react_1.default.createElement(Foldable_1.default, { key: topItems === null || topItems === void 0 ? void 0 : topItems.length, className: b(), isOpened: Boolean(isOpened) },
|
|
37
|
+
react_1.default.createElement("div", { className: b('wrapper') },
|
|
38
|
+
react_1.default.createElement("nav", null,
|
|
39
|
+
react_1.default.createElement("ul", { className: b('links') }, topItems === null || topItems === void 0 ? void 0 : topItems.map((link, index) => {
|
|
40
|
+
const isActive = index === activeItemIndex;
|
|
41
|
+
return (react_1.default.createElement(MobileNavigationItem, { key: index, link: link, index: index, isActive: isOpened && isActive, onClose: onClose, onActiveItemChange: onActiveItemChange }));
|
|
42
|
+
}))), bottomItems === null || bottomItems === void 0 ? void 0 :
|
|
43
|
+
bottomItems.map((item) => (react_1.default.createElement(NavigationItem_1.default, { key: item.text, data: item, className: b('button') })))))));
|
|
44
|
+
};
|
|
45
|
+
exports.default = MobileNavigation;
|