@doyourjob/gravity-ui-page-constructor-addons 2.1.34 → 2.1.36
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/build/cjs/components/NewHeader/NewHeader.css +5 -7
- package/build/cjs/components/NewHeader/NewHeader.js +7 -5
- package/build/cjs/components/NewHeader/components/NHBanner/NHBanner.css +42 -0
- package/build/cjs/components/NewHeader/components/NHBanner/NHBanner.d.ts +3 -0
- package/build/cjs/components/NewHeader/components/NHBanner/NHBanner.js +17 -0
- package/build/cjs/components/NewHeader/components/NHDefaultPopup/NHDefaultPopup.css +38 -90
- package/build/cjs/components/NewHeader/components/NHDefaultPopup/NHDefaultPopup.js +28 -33
- package/build/cjs/components/NewHeader/components/NHEventCard/NHEventCard.css +48 -0
- package/build/cjs/components/NewHeader/components/NHEventCard/NHEventCard.d.ts +3 -0
- package/build/cjs/components/NewHeader/components/NHEventCard/NHEventCard.js +15 -0
- package/build/cjs/components/NewHeader/components/NHLogo/NHLogo.css +4 -0
- package/build/cjs/components/NewHeader/components/NHLogo/NHLogo.d.ts +6 -0
- package/build/cjs/components/NewHeader/components/NHLogo/NHLogo.js +12 -0
- package/build/cjs/components/NewHeader/components/NHMobileNavigation/NHMobileNavigation.css +43 -8
- package/build/cjs/components/NewHeader/components/NHMobileNavigation/NHMobileNavigation.d.ts +4 -3
- package/build/cjs/components/NewHeader/components/NHMobileNavigation/NHMobileNavigation.js +19 -12
- package/build/cjs/components/NewHeader/components/NHMobileNavigationItem/NHMobileNavigationItem.css +41 -40
- package/build/cjs/components/NewHeader/components/NHMobileNavigationItem/NHMobileNavigationItem.d.ts +6 -2
- package/build/cjs/components/NewHeader/components/NHMobileNavigationItem/NHMobileNavigationItem.js +15 -11
- package/build/cjs/components/NewHeader/components/NHMobileNavigationItem/components/NHDefaultPopupContent/NHDefaultPopupContent.css +56 -0
- package/build/cjs/components/NewHeader/components/NHMobileNavigationItem/components/NHDefaultPopupContent/NHDefaultPopupContent.d.ts +5 -0
- package/build/cjs/components/NewHeader/components/NHMobileNavigationItem/components/NHDefaultPopupContent/NHDefaultPopupContent.js +32 -0
- package/build/cjs/components/NewHeader/components/NHMobileNavigationPopup/NHMobileNavigationPopup.css +11 -30
- package/build/cjs/components/NewHeader/components/NHMobileNavigationPopup/NHMobileNavigationPopup.js +1 -5
- package/build/cjs/components/NewHeader/components/NHNavigation/NHNavigation.js +1 -4
- package/build/cjs/components/NewHeader/components/NHNavigationItem/NHNavigationItem.js +2 -2
- package/build/cjs/components/NewHeader/components/NHPopupItem/NHPopupItem.css +15 -1
- package/build/cjs/components/NewHeader/components/NHStock/NHStock.css +47 -0
- package/build/cjs/components/NewHeader/components/NHStock/NHStock.d.ts +3 -0
- package/build/cjs/components/NewHeader/components/NHStock/NHStock.js +21 -0
- package/build/cjs/components/NewHeader/components/NHStoryCard/NHStoryCard.css +42 -0
- package/build/cjs/components/NewHeader/components/NHStoryCard/NHStoryCard.d.ts +3 -0
- package/build/cjs/components/NewHeader/components/NHStoryCard/NHStoryCard.js +14 -0
- package/build/cjs/components/NewHeader/models.d.ts +3 -41
- package/build/cjs/components/NewHeader/models.js +0 -1
- package/build/esm/components/NewHeader/NewHeader.css +5 -7
- package/build/esm/components/NewHeader/NewHeader.js +8 -6
- package/build/esm/components/NewHeader/components/NHBanner/NHBanner.css +42 -0
- package/build/esm/components/NewHeader/components/NHBanner/NHBanner.d.ts +4 -0
- package/build/esm/components/NewHeader/components/NHBanner/NHBanner.js +13 -0
- package/build/esm/components/NewHeader/components/NHDefaultPopup/NHDefaultPopup.css +38 -90
- package/build/esm/components/NewHeader/components/NHDefaultPopup/NHDefaultPopup.js +26 -31
- package/build/esm/components/NewHeader/components/NHEventCard/NHEventCard.css +48 -0
- package/build/esm/components/NewHeader/components/NHEventCard/NHEventCard.d.ts +4 -0
- package/build/esm/components/NewHeader/components/NHEventCard/NHEventCard.js +11 -0
- package/build/esm/components/NewHeader/components/NHLogo/NHLogo.css +4 -0
- package/build/esm/components/NewHeader/components/NHLogo/NHLogo.d.ts +7 -0
- package/build/esm/components/NewHeader/components/NHLogo/NHLogo.js +8 -0
- package/build/esm/components/NewHeader/components/NHMobileNavigation/NHMobileNavigation.css +43 -8
- package/build/esm/components/NewHeader/components/NHMobileNavigation/NHMobileNavigation.d.ts +4 -3
- package/build/esm/components/NewHeader/components/NHMobileNavigation/NHMobileNavigation.js +19 -12
- package/build/esm/components/NewHeader/components/NHMobileNavigationItem/NHMobileNavigationItem.css +41 -40
- package/build/esm/components/NewHeader/components/NHMobileNavigationItem/NHMobileNavigationItem.d.ts +6 -2
- package/build/esm/components/NewHeader/components/NHMobileNavigationItem/NHMobileNavigationItem.js +15 -11
- package/build/esm/components/NewHeader/components/NHMobileNavigationItem/components/NHDefaultPopupContent/NHDefaultPopupContent.css +56 -0
- package/build/esm/components/NewHeader/components/NHMobileNavigationItem/components/NHDefaultPopupContent/NHDefaultPopupContent.d.ts +6 -0
- package/build/esm/components/NewHeader/components/NHMobileNavigationItem/components/NHDefaultPopupContent/NHDefaultPopupContent.js +28 -0
- package/build/esm/components/NewHeader/components/NHMobileNavigationPopup/NHMobileNavigationPopup.css +11 -30
- package/build/esm/components/NewHeader/components/NHMobileNavigationPopup/NHMobileNavigationPopup.js +1 -5
- package/build/esm/components/NewHeader/components/NHNavigation/NHNavigation.js +1 -4
- package/build/esm/components/NewHeader/components/NHNavigationItem/NHNavigationItem.js +2 -2
- package/build/esm/components/NewHeader/components/NHPopupItem/NHPopupItem.css +15 -1
- package/build/esm/components/NewHeader/components/NHStock/NHStock.css +47 -0
- package/build/esm/components/NewHeader/components/NHStock/NHStock.d.ts +4 -0
- package/build/esm/components/NewHeader/components/NHStock/NHStock.js +17 -0
- package/build/esm/components/NewHeader/components/NHStoryCard/NHStoryCard.css +42 -0
- package/build/esm/components/NewHeader/components/NHStoryCard/NHStoryCard.d.ts +4 -0
- package/build/esm/components/NewHeader/components/NHStoryCard/NHStoryCard.js +10 -0
- package/build/esm/components/NewHeader/models.d.ts +3 -41
- package/build/esm/components/NewHeader/models.js +0 -1
- package/package.json +1 -1
- package/build/cjs/components/NewHeader/components/NHProductsPopup/NHProductsPopup.css +0 -118
- package/build/cjs/components/NewHeader/components/NHProductsPopup/NHProductsPopup.d.ts +0 -3
- package/build/cjs/components/NewHeader/components/NHProductsPopup/NHProductsPopup.js +0 -43
- package/build/esm/components/NewHeader/components/NHProductsPopup/NHProductsPopup.css +0 -118
- package/build/esm/components/NewHeader/components/NHProductsPopup/NHProductsPopup.d.ts +0 -4
- package/build/esm/components/NewHeader/components/NHProductsPopup/NHProductsPopup.js +0 -39
|
@@ -5,7 +5,6 @@ unpredictable css rules order in build */
|
|
|
5
5
|
--g-color-scroll-handle: var(--g-color-base-generic);
|
|
6
6
|
--g-color-scroll-handle-hover: var(--g-color-line-generic);
|
|
7
7
|
width: 100%;
|
|
8
|
-
z-index: 100;
|
|
9
8
|
background: var(--pc-transparent);
|
|
10
9
|
}
|
|
11
10
|
|
|
@@ -13,6 +12,11 @@ unpredictable css rules order in build */
|
|
|
13
12
|
background: var(--g-color-base-background);
|
|
14
13
|
}
|
|
15
14
|
|
|
15
|
+
.pc-addons-new-header_is-mobile-opened {
|
|
16
|
+
position: fixed;
|
|
17
|
+
top: 0;
|
|
18
|
+
}
|
|
19
|
+
|
|
16
20
|
.pc-addons-new-header__container {
|
|
17
21
|
position: relative;
|
|
18
22
|
width: 100%;
|
|
@@ -37,7 +41,6 @@ unpredictable css rules order in build */
|
|
|
37
41
|
}
|
|
38
42
|
|
|
39
43
|
.pc-addons-new-header__left {
|
|
40
|
-
margin-right: 32px;
|
|
41
44
|
gap: 20px;
|
|
42
45
|
}
|
|
43
46
|
|
|
@@ -137,11 +140,6 @@ unpredictable css rules order in build */
|
|
|
137
140
|
box-shadow: 0 3px 10px var(--g-color-base-generic-hover);
|
|
138
141
|
}
|
|
139
142
|
|
|
140
|
-
.pc-addons-new-header__logo-img {
|
|
141
|
-
display: block;
|
|
142
|
-
height: 36px;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
143
|
.pc-addons-new-header_search .pc-addons-new-header__left,
|
|
146
144
|
.pc-addons-new-header_search .pc-addons-new-header__navigation,
|
|
147
145
|
.pc-addons-new-header_search .pc-addons-new-header__wrap > div:not(.pc-addons-new-header__icons-container) {
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
-
import { Button as PCButton
|
|
2
|
+
import { Button as PCButton } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
3
|
import { block } from '../../utils/cn';
|
|
4
4
|
import { NHLoginButton } from './components/NHLoginButton/NHLoginButton';
|
|
5
|
+
import { NHLogo } from './components/NHLogo/NHLogo';
|
|
5
6
|
import { NHMobileNavigation } from './components/NHMobileNavigation/NHMobileNavigation';
|
|
6
7
|
import { NHNavigation } from './components/NHNavigation/NHNavigation';
|
|
7
8
|
import { RouteChangeHandlerContext } from './contexts/route-change';
|
|
@@ -9,7 +10,7 @@ import './NewHeader.css';
|
|
|
9
10
|
const b = block('new-header');
|
|
10
11
|
export const MOBILE_ICON_SIZE = 24;
|
|
11
12
|
export const NewHeader = ({ data, setupRouteChangeHandler, renderSearch, className, scrollOffset = 0, }) => {
|
|
12
|
-
const { logo, buttons, left, right,
|
|
13
|
+
const { logo, buttons, left, right, login } = data;
|
|
13
14
|
const headerRef = useRef(null);
|
|
14
15
|
const [withBackground, setWithBackground] = useState(false);
|
|
15
16
|
const [isSearchMode, setIsSearchMode] = useState(false);
|
|
@@ -48,11 +49,12 @@ export const NewHeader = ({ data, setupRouteChangeHandler, renderSearch, classNa
|
|
|
48
49
|
return (React.createElement(RouteChangeHandlerContext.Provider, { value: setupRouteChangeHandler },
|
|
49
50
|
React.createElement("header", { className: b({
|
|
50
51
|
search: isSearchMode,
|
|
51
|
-
'
|
|
52
|
+
'is-mobile-opened': isMobileNavigationOpen,
|
|
53
|
+
'with-background': withBackground || isMobileNavigationOpen,
|
|
52
54
|
}, className), ref: headerRef },
|
|
53
55
|
React.createElement("div", { className: b('container') },
|
|
54
56
|
React.createElement("div", { className: b('left') },
|
|
55
|
-
logo &&
|
|
57
|
+
logo && React.createElement(NHLogo, { data: logo }),
|
|
56
58
|
left ? (React.createElement("div", { className: b('navigation') },
|
|
57
59
|
React.createElement(NHNavigation, { data: left, headerRef: headerRef }))) : null),
|
|
58
60
|
React.createElement("div", { className: b('right') },
|
|
@@ -62,7 +64,7 @@ export const NewHeader = ({ data, setupRouteChangeHandler, renderSearch, classNa
|
|
|
62
64
|
renderSearch && (React.createElement("div", { className: b('icons-container') }, renderSearch({ onActiveToggle: toggleSearch }))),
|
|
63
65
|
React.createElement("div", { className: b('buttons') },
|
|
64
66
|
showButtonsContainer &&
|
|
65
|
-
(buttons === null || buttons === void 0 ? void 0 : buttons.map((button) => (React.createElement(PCButton, Object.assign({}, button, { className: b('button'), size: "l", key:
|
|
67
|
+
(buttons === null || buttons === void 0 ? void 0 : buttons.map((button, index) => (React.createElement(PCButton, Object.assign({}, button, { className: b('button'), size: "l", key: index }))))),
|
|
66
68
|
login && React.createElement(NHLoginButton, { data: login, headerRef: headerRef })),
|
|
67
|
-
|
|
69
|
+
React.createElement(NHMobileNavigation, { toogleOpen: toggleMobileNavigationPopup, isOpened: isMobileNavigationOpen, isSearchOpen: isSearchMode, data: data, onMenuScroll: onMenuScroll, popupClassName: b('user-popup') })))))));
|
|
68
70
|
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-addons-nh-banner {
|
|
4
|
+
color: inherit;
|
|
5
|
+
text-decoration: none;
|
|
6
|
+
grid-area: 1/3/3/4;
|
|
7
|
+
border-radius: 16px;
|
|
8
|
+
padding: 16px;
|
|
9
|
+
display: flex;
|
|
10
|
+
gap: 20px;
|
|
11
|
+
background: var(--nh-banner-background, transparent);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.pc-addons-nh-banner_border {
|
|
15
|
+
border: 1px solid var(--g-color-line-generic-solid);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.pc-addons-nh-banner__wrap {
|
|
19
|
+
display: flex;
|
|
20
|
+
flex-direction: column;
|
|
21
|
+
flex: 1;
|
|
22
|
+
gap: 4px;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.pc-addons-nh-banner__title {
|
|
26
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
27
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
28
|
+
color: var(--nh-banner-color, var(--g-color-text-primary));
|
|
29
|
+
font-weight: 600;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.pc-addons-nh-banner__description {
|
|
33
|
+
font-size: var(--g-text-body-1-font-size, var(--pc-text-body-1-font-size));
|
|
34
|
+
line-height: var(--g-text-body-1-line-height, var(--pc-text-body-1-line-height));
|
|
35
|
+
color: var(--nh-banner-color, var(--g-color-text-secondary));
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.pc-addons-nh-banner__image {
|
|
39
|
+
display: block;
|
|
40
|
+
width: 86px;
|
|
41
|
+
aspect-ratio: 1;
|
|
42
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { Image, getLinkProps } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
+
import { block } from '../../../../utils/cn';
|
|
4
|
+
import './NHBanner.css';
|
|
5
|
+
const b = block('nh-banner');
|
|
6
|
+
export const NHBanner = ({ title, description, image, url, background, color, border, }) => {
|
|
7
|
+
const styles = useMemo(() => (Object.assign(Object.assign({}, (background ? { '--nh-banner-background': background } : {})), (color ? { '--nh-banner-color': color } : {}))), [background, color]);
|
|
8
|
+
return (React.createElement("a", Object.assign({ href: url, className: b({ border }), style: styles }, getLinkProps(url)),
|
|
9
|
+
React.createElement(Image, { className: b('image'), src: image }),
|
|
10
|
+
React.createElement("div", { className: b('wrap') },
|
|
11
|
+
React.createElement("div", { className: b('title') }, title),
|
|
12
|
+
React.createElement("div", { className: b('description') }, description))));
|
|
13
|
+
};
|
|
@@ -51,119 +51,67 @@ unpredictable css rules order in build */
|
|
|
51
51
|
gap: 24px;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
.pc-addons-nh-default-
|
|
55
|
-
|
|
56
|
-
gap:
|
|
57
|
-
align-items: flex-start;
|
|
54
|
+
.pc-addons-nh-default-popup__section_side-head {
|
|
55
|
+
flex-direction: row;
|
|
56
|
+
gap: 0;
|
|
58
57
|
}
|
|
59
58
|
|
|
60
|
-
.pc-addons-nh-default-
|
|
61
|
-
width: 100%;
|
|
62
|
-
max-width: 320px;
|
|
63
|
-
flex-shrink: 0;
|
|
64
|
-
border-left: 1px solid var(--g-color-line-generic-solid);
|
|
59
|
+
.pc-addons-nh-default-popup__section-head {
|
|
65
60
|
display: flex;
|
|
66
61
|
flex-direction: column;
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
width: 200px;
|
|
63
|
+
padding-right: 32px;
|
|
64
|
+
flex-shrink: 0;
|
|
65
|
+
gap: 2px;
|
|
69
66
|
}
|
|
70
67
|
|
|
71
|
-
.pc-addons-nh-default-
|
|
72
|
-
display:
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
.pc-addons-nh-default-popup__wrap {
|
|
69
|
+
display: grid;
|
|
70
|
+
gap: 24px 40px;
|
|
71
|
+
align-items: flex-start;
|
|
75
72
|
}
|
|
76
73
|
|
|
77
|
-
.pc-addons-nh-default-
|
|
78
|
-
|
|
79
|
-
text-decoration: none;
|
|
80
|
-
border-radius: 16px;
|
|
81
|
-
display: flex;
|
|
82
|
-
flex-direction: column;
|
|
83
|
-
gap: 12px;
|
|
84
|
-
cursor: pointer;
|
|
85
|
-
transition: opacity 0.2s;
|
|
74
|
+
.pc-addons-nh-default-popup__wrap_mode_run {
|
|
75
|
+
grid-template-columns: repeat(12, 1fr);
|
|
86
76
|
}
|
|
87
77
|
|
|
88
|
-
.pc-addons-nh-default-
|
|
89
|
-
|
|
78
|
+
.pc-addons-nh-default-popup__wrap_mode_run > a {
|
|
79
|
+
grid-column: span 4;
|
|
80
|
+
grid-row: 1;
|
|
90
81
|
}
|
|
91
82
|
|
|
92
|
-
.pc-addons-nh-default-
|
|
93
|
-
display:
|
|
94
|
-
flex-direction: column;
|
|
95
|
-
gap: 4px;
|
|
83
|
+
.pc-addons-nh-default-popup__wrap_mode_run > .pc-addons-nh-default-popup__inner-wrap:empty {
|
|
84
|
+
display: none;
|
|
96
85
|
}
|
|
97
86
|
|
|
98
|
-
.pc-addons-nh-default-
|
|
99
|
-
|
|
100
|
-
line-height: var(--g-text-body-1-line-height, var(--pc-text-body-1-line-height));
|
|
101
|
-
color: var(--g-color-text-secondary);
|
|
87
|
+
.pc-addons-nh-default-popup__wrap_mode_run > a + .pc-addons-nh-default-popup__inner-wrap {
|
|
88
|
+
grid-column: span 8;
|
|
102
89
|
}
|
|
103
90
|
|
|
104
|
-
.pc-addons-nh-default-
|
|
105
|
-
|
|
106
|
-
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
107
|
-
color: var(--g-color-text-primary);
|
|
108
|
-
font-weight: 600;
|
|
91
|
+
.pc-addons-nh-default-popup__wrap_mode_run > .pc-addons-nh-default-popup__inner-wrap:last-child {
|
|
92
|
+
grid-column: span 12;
|
|
109
93
|
}
|
|
110
94
|
|
|
111
|
-
.pc-addons-nh-default-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
95
|
+
.pc-addons-nh-default-popup__inner-wrap {
|
|
96
|
+
display: grid;
|
|
97
|
+
gap: 24px 40px;
|
|
98
|
+
align-items: flex-start;
|
|
99
|
+
grid-template-columns: 1fr 1fr 1fr;
|
|
115
100
|
}
|
|
116
101
|
|
|
117
|
-
.pc-addons-nh-default-
|
|
118
|
-
display: block;
|
|
102
|
+
.pc-addons-nh-default-popup__right {
|
|
119
103
|
width: 100%;
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
.pc-addons-nh-default-popup__stock {
|
|
125
|
-
position: relative;
|
|
126
|
-
padding: 20px;
|
|
104
|
+
max-width: 320px;
|
|
105
|
+
flex-shrink: 0;
|
|
106
|
+
border-left: 1px solid var(--g-color-line-generic-solid);
|
|
127
107
|
display: flex;
|
|
128
108
|
flex-direction: column;
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
overflow: hidden;
|
|
132
|
-
max-height: 300px;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
.pc-addons-nh-default-popup__stock-background {
|
|
136
|
-
position: absolute;
|
|
137
|
-
top: 0;
|
|
138
|
-
left: 0;
|
|
139
|
-
width: 100%;
|
|
140
|
-
height: 100%;
|
|
141
|
-
object-fit: cover;
|
|
142
|
-
display: block;
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
.pc-addons-nh-default-popup__stock-title {
|
|
146
|
-
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
147
|
-
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
148
|
-
color: var(--g-color-text-primary);
|
|
149
|
-
font-weight: 600;
|
|
150
|
-
z-index: 1;
|
|
151
|
-
margin-bottom: 4px;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
.pc-addons-nh-default-popup__stock-value {
|
|
155
|
-
color: var(--g-color-text-primary);
|
|
156
|
-
font-size: 36px;
|
|
157
|
-
line-height: 48px;
|
|
158
|
-
font-weight: 600;
|
|
159
|
-
z-index: 1;
|
|
160
|
-
margin-top: auto;
|
|
109
|
+
padding: 24px 32px;
|
|
110
|
+
gap: 20px;
|
|
161
111
|
}
|
|
162
112
|
|
|
163
|
-
.pc-addons-nh-default-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
z-index: 1;
|
|
168
|
-
margin-top: 4px;
|
|
113
|
+
.pc-addons-nh-default-popup__cards {
|
|
114
|
+
display: flex;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
gap: 24px;
|
|
169
117
|
}
|
|
@@ -1,32 +1,12 @@
|
|
|
1
|
-
import React, {
|
|
2
|
-
import { HeaderStockContext, Image, getLinkProps } from '@doyourjob/gravity-ui-page-constructor';
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
3
2
|
import { block } from '../../../../utils/cn';
|
|
3
|
+
import { NHBanner } from '../NHBanner/NHBanner';
|
|
4
|
+
import { NHEventCard } from '../NHEventCard/NHEventCard';
|
|
4
5
|
import { NHPopupItem } from '../NHPopupItem/NHPopupItem';
|
|
6
|
+
import { NHStock } from '../NHStock/NHStock';
|
|
7
|
+
import { NHStoryCard } from '../NHStoryCard/NHStoryCard';
|
|
5
8
|
import './NHDefaultPopup.css';
|
|
6
9
|
const b = block('nh-default-popup');
|
|
7
|
-
const NHStoryCard = ({ title, description, image, url }) => (React.createElement("a", Object.assign({ href: url, className: b('card') }, getLinkProps(url)),
|
|
8
|
-
React.createElement(Image, { className: b('card-image'), src: image }),
|
|
9
|
-
React.createElement("div", { className: b('card-wrap') },
|
|
10
|
-
React.createElement("div", { className: b('card-title') }, title),
|
|
11
|
-
React.createElement("div", { className: b('card-description') }, description))));
|
|
12
|
-
const NHEventCard = ({ title, caption, description, image, url }) => (React.createElement("a", Object.assign({ href: url, className: b('card') }, getLinkProps(url)),
|
|
13
|
-
React.createElement(Image, { className: b('card-image'), src: image }),
|
|
14
|
-
React.createElement("div", { className: b('card-wrap') },
|
|
15
|
-
React.createElement("div", { className: b('card-caption') }, caption),
|
|
16
|
-
React.createElement("div", { className: b('card-title') }, title),
|
|
17
|
-
React.createElement("div", { className: b('card-description') }, description))));
|
|
18
|
-
const NHStock = ({ title, delayed, image }) => {
|
|
19
|
-
const data = useContext(HeaderStockContext);
|
|
20
|
-
if (!data.price)
|
|
21
|
-
return null;
|
|
22
|
-
return (React.createElement("div", { className: b('stock') },
|
|
23
|
-
image ? (React.createElement("img", { className: b('stock-background'), src: image, alt: "Stock background" })) : null,
|
|
24
|
-
React.createElement("div", { className: b('stock-title') }, title),
|
|
25
|
-
React.createElement("div", { className: b('stock-title') }, data.price.percent),
|
|
26
|
-
React.createElement("div", { className: b('stock-value') }, data.price.price),
|
|
27
|
-
React.createElement("div", { className: b('stock-date') }, data.price.update),
|
|
28
|
-
React.createElement("div", { className: b('stock-date') }, delayed)));
|
|
29
|
-
};
|
|
30
10
|
export const NHDefaultPopup = ({ sections, right, maxWidth, primaryColor, primaryColorHover, }) => {
|
|
31
11
|
const rootStyle = useMemo(() => maxWidth
|
|
32
12
|
? {
|
|
@@ -35,7 +15,7 @@ export const NHDefaultPopup = ({ sections, right, maxWidth, primaryColor, primar
|
|
|
35
15
|
}
|
|
36
16
|
: undefined, [maxWidth]);
|
|
37
17
|
const wrapsStyle = useMemo(() => sections.map((section) => ({
|
|
38
|
-
gridTemplateColumns: `repeat(${section.columns || 3}, 1fr)`,
|
|
18
|
+
gridTemplateColumns: section.mode === 'run' ? undefined : `repeat(${section.columns || 3}, 1fr)`,
|
|
39
19
|
})), [sections]);
|
|
40
20
|
const cards = useMemo(() => {
|
|
41
21
|
if (right === null || right === void 0 ? void 0 : right.stories) {
|
|
@@ -46,12 +26,27 @@ export const NHDefaultPopup = ({ sections, right, maxWidth, primaryColor, primar
|
|
|
46
26
|
}
|
|
47
27
|
return null;
|
|
48
28
|
}, [right]);
|
|
29
|
+
const renderSectionContent = (section, index) => {
|
|
30
|
+
var _a, _b, _c;
|
|
31
|
+
if (section.mode === 'run') {
|
|
32
|
+
return (React.createElement("div", { className: b('wrap', { mode: 'run' }) },
|
|
33
|
+
((_a = section.items) === null || _a === void 0 ? void 0 : _a[0]) && React.createElement(NHPopupItem, Object.assign({}, section.items[0], { column: true })),
|
|
34
|
+
React.createElement("div", { className: b('inner-wrap') }, (_b = section.items) === null || _b === void 0 ? void 0 : _b.slice(1, 4).map((item, cardIndex) => (React.createElement(NHPopupItem, Object.assign({ key: cardIndex }, item, { column: true }))))),
|
|
35
|
+
React.createElement("div", { className: b('inner-wrap') }, (_c = section.items) === null || _c === void 0 ? void 0 : _c.slice(4).map((item, cardIndex) => (React.createElement(NHPopupItem, Object.assign({ key: cardIndex }, item, { column: true })))))));
|
|
36
|
+
}
|
|
37
|
+
return (React.createElement("div", { className: b('wrap'), style: wrapsStyle[index] },
|
|
38
|
+
section.items.map((item, idx) => (React.createElement(NHPopupItem, Object.assign({ key: idx }, item, { imageColor: primaryColor, imageColorHover: primaryColorHover })))),
|
|
39
|
+
section.mode === 'scale' && section.banner && React.createElement(NHBanner, Object.assign({}, section.banner))));
|
|
40
|
+
};
|
|
49
41
|
return (React.createElement("div", { className: b(), style: rootStyle },
|
|
50
|
-
React.createElement("div", { className: b('left') }, sections.map((section, index) =>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
React.createElement("div", { className: b('
|
|
54
|
-
|
|
42
|
+
React.createElement("div", { className: b('left') }, sections.map((section, index) => {
|
|
43
|
+
const hasSideHead = Boolean(section.mode);
|
|
44
|
+
return (React.createElement("div", { key: index, className: b('section', { 'side-head': hasSideHead }) },
|
|
45
|
+
section.title || section.subtitle ? (React.createElement("div", { className: b(hasSideHead ? 'section-head' : 'head') },
|
|
46
|
+
React.createElement("div", { className: b('title') }, section.title),
|
|
47
|
+
React.createElement("div", { className: b('subtitle') }, section.subtitle))) : null,
|
|
48
|
+
renderSectionContent(section, index)));
|
|
49
|
+
})),
|
|
55
50
|
right && (React.createElement("div", { className: b('right') },
|
|
56
51
|
React.createElement("div", { className: b('title') }, right.title),
|
|
57
52
|
cards && React.createElement("div", { className: b('cards') }, cards),
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-addons-nh-event-card {
|
|
4
|
+
color: inherit;
|
|
5
|
+
text-decoration: none;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
gap: 12px;
|
|
9
|
+
cursor: pointer;
|
|
10
|
+
transition: opacity 0.2s;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.pc-addons-nh-event-card:hover {
|
|
14
|
+
opacity: 0.8;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pc-addons-nh-event-card__wrap {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: 4px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.pc-addons-nh-event-card__caption {
|
|
24
|
+
font-size: var(--g-text-body-1-font-size, var(--pc-text-body-1-font-size));
|
|
25
|
+
line-height: var(--g-text-body-1-line-height, var(--pc-text-body-1-line-height));
|
|
26
|
+
color: var(--g-color-text-secondary);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.pc-addons-nh-event-card__title {
|
|
30
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
31
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
32
|
+
color: var(--g-color-text-primary);
|
|
33
|
+
font-weight: 600;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.pc-addons-nh-event-card__description {
|
|
37
|
+
font-size: var(--g-text-body-1-font-size, var(--pc-text-body-1-font-size));
|
|
38
|
+
line-height: var(--g-text-body-1-line-height, var(--pc-text-body-1-line-height));
|
|
39
|
+
color: var(--g-color-text-secondary);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.pc-addons-nh-event-card__image {
|
|
43
|
+
display: block;
|
|
44
|
+
width: 100%;
|
|
45
|
+
aspect-ratio: 16/9;
|
|
46
|
+
object-fit: cover;
|
|
47
|
+
border-radius: 16px;
|
|
48
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Image, getLinkProps } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
+
import { block } from '../../../../utils/cn';
|
|
4
|
+
import './NHEventCard.css';
|
|
5
|
+
const b = block('nh-event-card');
|
|
6
|
+
export const NHEventCard = ({ title, caption, description, image, url }) => (React.createElement("a", Object.assign({ href: url, className: b() }, getLinkProps(url)),
|
|
7
|
+
React.createElement(Image, { className: b('image'), src: image }),
|
|
8
|
+
React.createElement("div", { className: b('wrap') },
|
|
9
|
+
React.createElement("div", { className: b('caption') }, caption),
|
|
10
|
+
React.createElement("div", { className: b('title') }, title),
|
|
11
|
+
React.createElement("div", { className: b('description') }, description))));
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { getLinkProps } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
+
import { block } from '../../../../utils/cn';
|
|
4
|
+
import './NHLogo.css';
|
|
5
|
+
const b = block('nh-logo');
|
|
6
|
+
export const NHLogo = ({ data }) => {
|
|
7
|
+
return (React.createElement("a", Object.assign({ href: data.href, className: b() }, getLinkProps(data.href || '')), data.src && React.createElement("img", { className: b('img'), alt: data.alt, src: data.src })));
|
|
8
|
+
};
|
|
@@ -25,21 +25,56 @@ unpredictable css rules order in build */
|
|
|
25
25
|
color: var(--g-color-text-complementary);
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
.pc-addons-nh-mobile-navigation__icon-icon {
|
|
29
|
-
position: relative;
|
|
30
|
-
top: 3px;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
28
|
.pc-addons-nh-mobile-navigation__icon_hidden {
|
|
34
29
|
display: none;
|
|
35
30
|
}
|
|
36
31
|
|
|
37
|
-
.pc-addons-nh-mobile-
|
|
38
|
-
|
|
32
|
+
.pc-addons-nh-mobile-navigation__nav {
|
|
33
|
+
display: flex;
|
|
34
|
+
flex-direction: column;
|
|
35
|
+
padding: 12px 16px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.pc-addons-nh-mobile-navigation__list {
|
|
39
|
+
margin: 0;
|
|
40
|
+
padding: 0;
|
|
41
|
+
list-style: none;
|
|
42
|
+
display: flex;
|
|
43
|
+
flex-direction: column;
|
|
44
|
+
border-bottom: 1px solid var(--g-color-line-generic);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.pc-addons-nh-mobile-navigation__list > li + li {
|
|
48
|
+
border-top: 1px solid var(--g-color-line-generic);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.pc-addons-nh-mobile-navigation__list + .pc-addons-nh-mobile-navigation__list {
|
|
52
|
+
margin-top: 150px;
|
|
39
53
|
}
|
|
40
54
|
|
|
41
55
|
.pc-addons-nh-mobile-navigation__buttons {
|
|
42
|
-
|
|
56
|
+
display: flex;
|
|
57
|
+
flex-direction: column;
|
|
58
|
+
gap: 16px;
|
|
59
|
+
margin-top: 32px;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.pc-addons-nh-mobile-navigation__button {
|
|
63
|
+
width: 100%;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.pc-addons-nh-mobile-navigation__login-items {
|
|
67
|
+
display: flex;
|
|
68
|
+
flex-direction: column;
|
|
69
|
+
margin-top: 32px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.pc-addons-nh-mobile-navigation__login-item {
|
|
73
|
+
padding: 8px 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.pc-addons-nh-mobile-navigation__login-item + .pc-addons-nh-mobile-navigation__login-item {
|
|
77
|
+
border-top: 1px solid var(--g-color-line-generic);
|
|
43
78
|
}
|
|
44
79
|
|
|
45
80
|
@media (max-width: 1081px) {
|
package/build/esm/components/NewHeader/components/NHMobileNavigation/NHMobileNavigation.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { ButtonProps } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
-
import {
|
|
3
|
+
import { NHLoginPopupData, NHNavigationData } from '../../models';
|
|
4
4
|
import './NHMobileNavigation.css';
|
|
5
5
|
interface MobileNavigationProps {
|
|
6
6
|
isOpened: boolean;
|
|
7
7
|
toogleOpen: (isOpened: boolean) => void;
|
|
8
8
|
isSearchOpen: boolean;
|
|
9
|
-
data
|
|
9
|
+
data?: NHNavigationData;
|
|
10
10
|
onMenuScroll: (scrollTop: number) => void;
|
|
11
11
|
popupClassName?: string;
|
|
12
12
|
buttons?: ButtonProps[];
|
|
13
|
+
login?: NHLoginPopupData;
|
|
13
14
|
}
|
|
14
|
-
export declare const NHMobileNavigation: ({ isOpened, toogleOpen, isSearchOpen, data,
|
|
15
|
+
export declare const NHMobileNavigation: ({ isOpened, toogleOpen, isSearchOpen, data, onMenuScroll, }: MobileNavigationProps) => React.JSX.Element;
|
|
15
16
|
export {};
|
|
@@ -5,17 +5,24 @@ import { Button, Icon } from '@gravity-ui/uikit';
|
|
|
5
5
|
import { block } from '../../../../utils/cn';
|
|
6
6
|
import { NHMobileNavigationItem } from '../NHMobileNavigationItem/NHMobileNavigationItem';
|
|
7
7
|
import { NHMobileNavigationPopup } from '../NHMobileNavigationPopup/NHMobileNavigationPopup';
|
|
8
|
+
import { NHPopupItem } from '../NHPopupItem/NHPopupItem';
|
|
8
9
|
import './NHMobileNavigation.css';
|
|
9
10
|
const b = block('nh-mobile-navigation');
|
|
10
|
-
export const NHMobileNavigation = ({ isOpened, toogleOpen, isSearchOpen, data,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
export const NHMobileNavigation = ({ isOpened, toogleOpen, isSearchOpen, data, onMenuScroll, }) => {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
return (React.createElement("div", { className: b() },
|
|
14
|
+
React.createElement(Button, { view: "flat", size: "l", className: b('icon', { hidden: isSearchOpen }), onClick: (e) => {
|
|
15
|
+
e.stopPropagation();
|
|
16
|
+
toogleOpen(!isOpened);
|
|
17
|
+
} },
|
|
18
|
+
React.createElement(Icon, { data: isOpened ? Xmark : Bars, size: 24 })),
|
|
19
|
+
React.createElement(NHMobileNavigationPopup, { isOpened: isOpened, onClose: () => toogleOpen(false), onMenuScroll: onMenuScroll },
|
|
20
|
+
React.createElement("nav", { className: b('nav') },
|
|
21
|
+
React.createElement("ul", { className: b('list') }, (_a = data === null || data === void 0 ? void 0 : data.left) === null || _a === void 0 ? void 0 : _a.map((item, index) => (React.createElement("li", { className: b('item'), key: index },
|
|
22
|
+
React.createElement(NHMobileNavigationItem, { item: item }))))),
|
|
23
|
+
React.createElement("ul", { className: b('list') }, (_b = data === null || data === void 0 ? void 0 : data.right) === null || _b === void 0 ? void 0 : _b.map((item, index) => (React.createElement("li", { className: b('item'), key: index },
|
|
24
|
+
React.createElement(NHMobileNavigationItem, { item: item }))))),
|
|
25
|
+
(data === null || data === void 0 ? void 0 : data.buttons) && (React.createElement("div", { className: b('buttons') }, data.buttons.map((button, index) => (React.createElement(PCButton, Object.assign({}, button, { size: "l", key: index, className: b('button') })))))),
|
|
26
|
+
(data === null || data === void 0 ? void 0 : data.login) && (React.createElement("div", { className: b('login-items') }, data.login.items.map((item, index) => (React.createElement("div", { key: index, className: b('login-item') },
|
|
27
|
+
React.createElement(NHPopupItem, Object.assign({}, item)))))))))));
|
|
28
|
+
};
|