@doyourjob/gravity-ui-page-constructor-addons 2.1.33 → 2.1.35
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 +3 -6
- package/build/cjs/components/NewHeader/NewHeader.js +6 -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 -88
- 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 +9 -43
- package/build/cjs/components/NewHeader/models.js +0 -1
- package/build/esm/components/NewHeader/NewHeader.css +3 -6
- package/build/esm/components/NewHeader/NewHeader.js +7 -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 -88
- package/build/esm/components/NewHeader/components/NHDefaultPopup/NHDefaultPopup.js +27 -32
- 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 +9 -43
- 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,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
|
+
};
|
package/build/esm/components/NewHeader/components/NHMobileNavigationItem/NHMobileNavigationItem.css
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/* use this for style redefinitions to awoid problems with
|
|
2
2
|
unpredictable css rules order in build */
|
|
3
3
|
.pc-addons-nh-mobile-navigation-item {
|
|
4
|
+
padding: 16px 8px 16px 0;
|
|
5
|
+
cursor: pointer;
|
|
4
6
|
display: flex;
|
|
5
7
|
justify-content: space-between;
|
|
6
|
-
|
|
7
|
-
padding: 12px 0;
|
|
8
|
+
align-items: center;
|
|
8
9
|
}
|
|
9
10
|
|
|
10
11
|
.pc-addons-nh-mobile-navigation-item_type_link {
|
|
@@ -12,64 +13,64 @@ unpredictable css rules order in build */
|
|
|
12
13
|
text-decoration: none;
|
|
13
14
|
display: block;
|
|
14
15
|
color: var(--g-color-text-primary);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
display: flex;
|
|
19
|
-
justify-content: center;
|
|
20
|
-
align-items: center;
|
|
21
|
-
width: 20px;
|
|
22
|
-
height: 20px;
|
|
23
|
-
min-width: 20px;
|
|
16
|
+
font-weight: 500;
|
|
17
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
18
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
24
19
|
}
|
|
25
20
|
|
|
26
21
|
.pc-addons-nh-mobile-navigation-item__text {
|
|
27
|
-
|
|
22
|
+
font-weight: 500;
|
|
23
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
24
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
25
|
+
color: var(--g-color-text-primary);
|
|
28
26
|
}
|
|
29
27
|
|
|
30
|
-
.pc-addons-nh-mobile-navigation-
|
|
31
|
-
|
|
32
|
-
background-color: var(--g-color-base-generic);
|
|
33
|
-
border-radius: var(--g-border-radius-l);
|
|
28
|
+
.pc-addons-nh-mobile-navigation-item__arrow {
|
|
29
|
+
color: var(--g-color-text-secondary);
|
|
34
30
|
}
|
|
35
31
|
|
|
36
|
-
.pc-addons-nh-mobile-navigation-
|
|
37
|
-
|
|
32
|
+
.pc-addons-nh-mobile-navigation-item__content {
|
|
33
|
+
padding: 32px 0 40px;
|
|
34
|
+
display: flex;
|
|
35
|
+
flex-direction: column;
|
|
36
|
+
gap: 40px;
|
|
37
|
+
background: var(--g-color-base-background);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
.pc-addons-nh-mobile-navigation-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
.pc-addons-nh-mobile-navigation-item__section {
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
gap: 20px;
|
|
44
44
|
}
|
|
45
45
|
|
|
46
|
-
.pc-addons-nh-mobile-navigation-
|
|
46
|
+
.pc-addons-nh-mobile-navigation-item__section-title {
|
|
47
47
|
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
48
48
|
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
49
|
-
margin: 0;
|
|
50
|
-
padding: 10px 0;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
.pc-addons-nh-mobile-navigation-item__list-item {
|
|
54
|
-
color: inherit;
|
|
55
|
-
text-decoration: none;
|
|
56
|
-
display: block;
|
|
57
49
|
color: var(--g-color-text-primary);
|
|
58
|
-
|
|
50
|
+
font-weight: 500;
|
|
59
51
|
}
|
|
60
52
|
|
|
61
|
-
.pc-addons-nh-mobile-navigation-
|
|
62
|
-
|
|
63
|
-
|
|
53
|
+
.pc-addons-nh-mobile-navigation-item__section-items {
|
|
54
|
+
display: grid;
|
|
55
|
+
grid-template-columns: 1fr;
|
|
56
|
+
gap: 20px;
|
|
64
57
|
}
|
|
65
58
|
|
|
59
|
+
@media (min-width: 577px) {
|
|
60
|
+
.pc-addons-nh-mobile-navigation-item__section-items {
|
|
61
|
+
gap: 24px 40px;
|
|
62
|
+
grid-template-columns: 1fr 1fr;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
66
65
|
.pc-addons-nh-mobile-navigation-item__list-link {
|
|
67
66
|
color: inherit;
|
|
68
67
|
text-decoration: none;
|
|
69
|
-
|
|
68
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
69
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
70
|
+
color: var(--g-color-text-primary);
|
|
71
|
+
padding: 12px 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.pc-addons-nh-mobile-navigation-item__list-link:hover {
|
|
70
75
|
color: var(--g-color-text-link);
|
|
71
|
-
text-decoration: none;
|
|
72
|
-
cursor: pointer;
|
|
73
|
-
display: block;
|
|
74
|
-
padding: 10px 0;
|
|
75
76
|
}
|
package/build/esm/components/NewHeader/components/NHMobileNavigationItem/NHMobileNavigationItem.d.ts
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { NHNavigationItemData } from '../../models';
|
|
3
3
|
import './NHMobileNavigationItem.css';
|
|
4
|
-
|
|
4
|
+
interface NHMobileNavigationItemProps {
|
|
5
|
+
item?: NHNavigationItemData;
|
|
6
|
+
}
|
|
7
|
+
export declare const NHMobileNavigationItem: ({ item }: NHMobileNavigationItemProps) => React.JSX.Element | null;
|
|
8
|
+
export {};
|
package/build/esm/components/NewHeader/components/NHMobileNavigationItem/NHMobileNavigationItem.js
CHANGED
|
@@ -1,26 +1,30 @@
|
|
|
1
1
|
import React, { Fragment, useCallback, useState } from 'react';
|
|
2
2
|
import { Foldable, ToggleArrow, getLinkProps } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
3
|
import { block } from '../../../../utils/cn';
|
|
4
|
+
import { NHNavigationItemType } from '../../models';
|
|
5
|
+
import { NHDefaultPopupContent } from './components/NHDefaultPopupContent/NHDefaultPopupContent';
|
|
4
6
|
import './NHMobileNavigationItem.css';
|
|
5
7
|
const b = block('nh-mobile-navigation-item');
|
|
6
|
-
export const NHMobileNavigationItem = (
|
|
8
|
+
export const NHMobileNavigationItem = ({ item }) => {
|
|
7
9
|
const [isOpened, setIsOpened] = useState(false);
|
|
8
10
|
const toggleOpen = useCallback(() => {
|
|
9
11
|
setIsOpened(!isOpened);
|
|
10
12
|
}, [isOpened]);
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
const handleKeyDown = useCallback((e) => {
|
|
14
|
+
if (e.key === 'Enter' || e.key === ' ') {
|
|
15
|
+
toggleOpen();
|
|
16
|
+
}
|
|
17
|
+
}, [toggleOpen]);
|
|
18
|
+
if (item) {
|
|
19
|
+
if (item.type === NHNavigationItemType.Link) {
|
|
20
|
+
return (React.createElement("a", Object.assign({ href: item.data.url, className: b({ type: 'link' }) }, getLinkProps(item.data.url || '', undefined, item.data.target)), item.title));
|
|
21
|
+
}
|
|
15
22
|
return (React.createElement(Fragment, null,
|
|
16
|
-
React.createElement("div", { className: b(
|
|
17
|
-
React.createElement("div", { className: b('text') },
|
|
23
|
+
React.createElement("div", { className: b(), onClick: toggleOpen, role: "button", tabIndex: 0, onKeyDown: handleKeyDown },
|
|
24
|
+
React.createElement("div", { className: b('text') }, item.title),
|
|
18
25
|
React.createElement("div", { className: b('arrow') },
|
|
19
26
|
React.createElement(ToggleArrow, { size: 12, type: "vertical", open: isOpened, iconType: "navigation" }))),
|
|
20
|
-
React.createElement(Foldable, { isOpened: isOpened },
|
|
21
|
-
itemTitle && React.createElement("h5", { className: b('list-title') }, itemTitle),
|
|
22
|
-
React.createElement("ul", { className: b('list-items') }, items.map((linkItem) => (React.createElement("li", { className: b('li'), key: linkItem.title },
|
|
23
|
-
React.createElement("a", Object.assign({ href: linkItem.url, className: b('list-item') }, getLinkProps(linkItem.url || '')), linkItem.title)))))))))));
|
|
27
|
+
React.createElement(Foldable, { isOpened: isOpened }, item.type === NHNavigationItemType.NHDefaultPopup && (React.createElement(NHDefaultPopupContent, { data: item.data })))));
|
|
24
28
|
}
|
|
25
29
|
return null;
|
|
26
30
|
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-addons-nh-default-popup-content {
|
|
4
|
+
padding: 32px 0 40px;
|
|
5
|
+
display: flex;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
gap: 40px;
|
|
8
|
+
background: var(--g-color-base-background);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.pc-addons-nh-default-popup-content__section, .pc-addons-nh-default-popup-content__section-items {
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
gap: 20px;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pc-addons-nh-default-popup-content__banner-container {
|
|
18
|
+
margin-top: 16px;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.pc-addons-nh-default-popup-content__section-title {
|
|
22
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
23
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
24
|
+
color: var(--g-color-text-primary);
|
|
25
|
+
font-weight: 500;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.pc-addons-nh-default-popup-content__section-items {
|
|
29
|
+
display: grid;
|
|
30
|
+
grid-template-columns: 1fr;
|
|
31
|
+
gap: 20px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
@media (min-width: 577px) {
|
|
35
|
+
.pc-addons-nh-default-popup-content__section-items {
|
|
36
|
+
gap: 24px 40px;
|
|
37
|
+
grid-template-columns: 1fr 1fr;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
.pc-addons-nh-default-popup-content__right-section {
|
|
41
|
+
display: flex;
|
|
42
|
+
flex-direction: column;
|
|
43
|
+
gap: 20px;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.pc-addons-nh-default-popup-content__right-items {
|
|
47
|
+
display: grid;
|
|
48
|
+
grid-template-columns: 1fr;
|
|
49
|
+
gap: 20px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@media (min-width: 577px) {
|
|
53
|
+
.pc-addons-nh-default-popup-content__right-items {
|
|
54
|
+
grid-template-columns: 1fr 1fr;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { block } from '../../../../../../utils/cn';
|
|
3
|
+
import { NHBanner } from '../../../NHBanner/NHBanner';
|
|
4
|
+
import { NHEventCard } from '../../../NHEventCard/NHEventCard';
|
|
5
|
+
import { NHPopupItem } from '../../../NHPopupItem/NHPopupItem';
|
|
6
|
+
import { NHStock } from '../../../NHStock/NHStock';
|
|
7
|
+
import { NHStoryCard } from '../../../NHStoryCard/NHStoryCard';
|
|
8
|
+
import './NHDefaultPopupContent.css';
|
|
9
|
+
const b = block('nh-default-popup-content');
|
|
10
|
+
export const NHDefaultPopupContent = ({ data }) => {
|
|
11
|
+
var _a, _b;
|
|
12
|
+
return (React.createElement("div", { className: b() },
|
|
13
|
+
data.sections.map((section, idx) => {
|
|
14
|
+
const isRun = section.mode === 'run';
|
|
15
|
+
const hasSideHead = Boolean(section.mode);
|
|
16
|
+
return (React.createElement("div", { key: idx, className: b('section') },
|
|
17
|
+
section.title && React.createElement("div", { className: b('section-title') }, section.title),
|
|
18
|
+
React.createElement("div", { className: b('section-items') }, section.items.map((item, index) => (React.createElement(NHPopupItem, Object.assign({ key: index, imageColor: hasSideHead && !isRun ? data.primaryColor : undefined, imageColorHover: hasSideHead && !isRun ? data.primaryColorHover : undefined }, item, { column: isRun }))))),
|
|
19
|
+
section.banner && (React.createElement("div", { className: b('banner-container') },
|
|
20
|
+
React.createElement(NHBanner, Object.assign({}, section.banner))))));
|
|
21
|
+
}),
|
|
22
|
+
data.right && (React.createElement("div", { className: b('right-section') },
|
|
23
|
+
data.right.title && React.createElement("div", { className: b('section-title') }, data.right.title),
|
|
24
|
+
React.createElement("div", { className: b('right-items') }, (_a = data.right.stories) === null || _a === void 0 ? void 0 :
|
|
25
|
+
_a.map((story, i) => (React.createElement(NHStoryCard, Object.assign({ key: i }, story)))), (_b = data.right.events) === null || _b === void 0 ? void 0 :
|
|
26
|
+
_b.map((event, i) => (React.createElement(NHEventCard, Object.assign({ key: i }, event)))),
|
|
27
|
+
data.right.stock && React.createElement(NHStock, Object.assign({}, data.right.stock)))))));
|
|
28
|
+
};
|
|
@@ -3,53 +3,34 @@ unpredictable css rules order in build */
|
|
|
3
3
|
.pc-addons-nh-mobile-navigation-popup {
|
|
4
4
|
width: 100%;
|
|
5
5
|
position: fixed;
|
|
6
|
-
top:
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
top: 64px;
|
|
7
|
+
left: 0;
|
|
8
|
+
z-index: 1000;
|
|
9
|
+
height: calc(100vh - 64px);
|
|
9
10
|
background-color: var(--g-color-base-background);
|
|
10
|
-
|
|
11
|
-
box-shadow: 0 3px 10px var(--g-color-base-generic);
|
|
11
|
+
box-shadow: none;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
.pc-addons-nh-mobile-navigation-popup__transition-enter {
|
|
15
|
-
transform: translateY(-
|
|
16
|
-
opacity: 0;
|
|
15
|
+
transform: translateY(-100%);
|
|
17
16
|
}
|
|
18
17
|
|
|
19
18
|
.pc-addons-nh-mobile-navigation-popup__transition-enter-active {
|
|
20
19
|
transform: translateY(0);
|
|
21
|
-
|
|
22
|
-
transition: transform 0.4s, opacity 0.4s;
|
|
20
|
+
transition: transform 0.4s ease-out;
|
|
23
21
|
}
|
|
24
22
|
|
|
25
23
|
.pc-addons-nh-mobile-navigation-popup__transition-exit {
|
|
26
24
|
transform: translateY(0);
|
|
27
|
-
opacity: 1;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
.pc-addons-nh-mobile-navigation-popup__transition-exit .pc-addons-nh-mobile-navigation-popup__container {
|
|
31
|
-
opacity: 0;
|
|
32
25
|
}
|
|
33
26
|
|
|
34
27
|
.pc-addons-nh-mobile-navigation-popup__transition-exit-active {
|
|
35
|
-
transform: translateY(-
|
|
36
|
-
|
|
37
|
-
transition: transform 0.4s, opacity 0.4s;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.pc-addons-nh-mobile-navigation-popup__no-scroll {
|
|
41
|
-
overflow: hidden;
|
|
28
|
+
transform: translateY(-100%);
|
|
29
|
+
transition: transform 0.4s ease-in;
|
|
42
30
|
}
|
|
43
31
|
|
|
44
32
|
.pc-addons-nh-mobile-navigation-popup__container {
|
|
45
|
-
padding:
|
|
46
|
-
overflow:
|
|
33
|
+
padding: 0;
|
|
34
|
+
overflow-y: auto;
|
|
47
35
|
height: 100%;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
@media (max-width: 576px) {
|
|
51
|
-
.pc-addons-nh-mobile-navigation-popup__container {
|
|
52
|
-
padding-left: 24px;
|
|
53
|
-
padding-right: 24px;
|
|
54
|
-
}
|
|
55
36
|
}
|
package/build/esm/components/NewHeader/components/NHMobileNavigationPopup/NHMobileNavigationPopup.js
CHANGED
|
@@ -7,12 +7,9 @@ import { block } from '../../../../utils/cn';
|
|
|
7
7
|
import './NHMobileNavigationPopup.css';
|
|
8
8
|
const b = block('nh-mobile-navigation-popup');
|
|
9
9
|
const TRANSITION_TIME = 400;
|
|
10
|
-
const POPUP_MARGIN = 80;
|
|
11
|
-
const HEADER_HEIGHT = 68;
|
|
12
10
|
export const NHMobileNavigationPopup = ({ isOpened, onClose, children, onMenuScroll, }) => {
|
|
13
11
|
const [body, setBody] = useState();
|
|
14
12
|
const ref = useRef(null);
|
|
15
|
-
const [containerHeight, setContainerHeight] = useState(0);
|
|
16
13
|
const handleScroll = useCallback(() => {
|
|
17
14
|
var _a;
|
|
18
15
|
const containerScrollTop = (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.scrollTop;
|
|
@@ -23,7 +20,6 @@ export const NHMobileNavigationPopup = ({ isOpened, onClose, children, onMenuScr
|
|
|
23
20
|
useBodyScrollLock({ enabled: isOpened });
|
|
24
21
|
useEffect(() => {
|
|
25
22
|
setBody(document.body);
|
|
26
|
-
setContainerHeight((window === null || window === void 0 ? void 0 : window.innerHeight) - POPUP_MARGIN - HEADER_HEIGHT);
|
|
27
23
|
const element = ref.current;
|
|
28
24
|
if (element) {
|
|
29
25
|
element.addEventListener('scroll', handleScroll);
|
|
@@ -39,5 +35,5 @@ export const NHMobileNavigationPopup = ({ isOpened, onClose, children, onMenuScr
|
|
|
39
35
|
}
|
|
40
36
|
return ReactDOM.createPortal(React.createElement(CSSTransition, { in: isOpened, classNames: b('transition'), unmountOnExit: true, timeout: TRANSITION_TIME },
|
|
41
37
|
React.createElement(OutsideClick, { className: b(), onOutsideClick: onClose },
|
|
42
|
-
React.createElement("div", { ref: ref, className: b('container')
|
|
38
|
+
React.createElement("div", { ref: ref, className: b('container') }, children))), body);
|
|
43
39
|
};
|
|
@@ -5,14 +5,11 @@ import { NHNavigationItemType } from '../../models';
|
|
|
5
5
|
import { NHDefaultPopup } from '../NHDefaultPopup/NHDefaultPopup';
|
|
6
6
|
import { NHNavigationItem } from '../NHNavigationItem/NHNavigationItem';
|
|
7
7
|
import { NHNavigationPopup } from '../NHNavigationPopup/NHNavigationPopup';
|
|
8
|
-
import { NHProductsPopup } from '../NHProductsPopup/NHProductsPopup';
|
|
9
8
|
import './NHNavigation.css';
|
|
10
9
|
const b = block('nh-navigation');
|
|
11
10
|
const tooltipPrefixId = 'navigation-item-key';
|
|
12
11
|
const getPopupContent = (sectionData) => {
|
|
13
12
|
switch (sectionData.type) {
|
|
14
|
-
case NHNavigationItemType.NHProductsPopup:
|
|
15
|
-
return React.createElement(NHProductsPopup, Object.assign({}, sectionData.data));
|
|
16
13
|
case NHNavigationItemType.NHDefaultPopup:
|
|
17
14
|
return React.createElement(NHDefaultPopup, Object.assign({}, sectionData.data));
|
|
18
15
|
default:
|
|
@@ -50,5 +47,5 @@ export const NHNavigation = ({ data, headerRef, setupRouteChangeHandler }) => {
|
|
|
50
47
|
};
|
|
51
48
|
}, [onEscapeKeyDown]);
|
|
52
49
|
return (React.createElement("nav", null,
|
|
53
|
-
React.createElement("ul", { className: b() }, data.map((item, i) => (React.createElement(NHNavigationItem, { key:
|
|
50
|
+
React.createElement("ul", { className: b() }, data.map((item, i) => (React.createElement(NHNavigationItem, { key: i, item: item, handleActiveTab: handleActiveTab, index: i, isActive: activeTab === i, tooltipId: `${tooltipPrefixId}-${i}` }, activeTab === i && item.type !== NHNavigationItemType.Link && (React.createElement(NHNavigationPopup, { headerRef: headerRef, id: `${tooltipPrefixId}-${i}` }, getPopupContent(item)))))))));
|
|
54
51
|
};
|
|
@@ -18,11 +18,11 @@ export const NHNavigationItem = ({ item, isActive, handleActiveTab, index, child
|
|
|
18
18
|
handleMouseLeave();
|
|
19
19
|
}), [handleMouseLeave, setupRouteChangeHandler]);
|
|
20
20
|
if (item.type === NHNavigationItemType.Link) {
|
|
21
|
-
return (React.createElement("li", {
|
|
21
|
+
return (React.createElement("li", { className: b({ disable: !((_a = item.data) === null || _a === void 0 ? void 0 : _a.url) }), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
|
22
22
|
React.createElement("a", Object.assign({ className: b('text', { active: isActive }), href: (_b = item.data) === null || _b === void 0 ? void 0 : _b.url }, getLinkProps(((_c = item.data) === null || _c === void 0 ? void 0 : _c.url) || '', undefined, (_d = item.data) === null || _d === void 0 ? void 0 : _d.target)), item.title),
|
|
23
23
|
children));
|
|
24
24
|
}
|
|
25
|
-
return (React.createElement("li", {
|
|
25
|
+
return (React.createElement("li", { className: b({}), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
|
26
26
|
React.createElement("button", { className: b('text', { active: isActive, cursor: 'default' }), onClick: handleMouseEnter, "aria-expanded": isActive, "aria-controls": tooltipId },
|
|
27
27
|
item.title,
|
|
28
28
|
React.createElement(Icon, { className: b('icon'), data: isActive ? ChevronUp : ChevronDown, size: 16 })),
|
|
@@ -30,6 +30,20 @@ unpredictable css rules order in build */
|
|
|
30
30
|
align-self: initial;
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
@media (max-width: 769px) {
|
|
34
|
+
.pc-addons-nh-navigation-popup-item_column {
|
|
35
|
+
flex-direction: row;
|
|
36
|
+
}
|
|
37
|
+
.pc-addons-nh-navigation-popup-item_column .pc-addons-nh-navigation-popup-item__image {
|
|
38
|
+
width: 30px;
|
|
39
|
+
height: 30px;
|
|
40
|
+
}
|
|
41
|
+
.pc-addons-nh-navigation-popup-item_column .pc-addons-nh-navigation-popup-item__image-container {
|
|
42
|
+
padding: 5px;
|
|
43
|
+
border-radius: 0;
|
|
44
|
+
border: none;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
33
47
|
.pc-addons-nh-navigation-popup-item:hover .pc-addons-nh-navigation-popup-item__description, .pc-addons-nh-navigation-popup-item:active .pc-addons-nh-navigation-popup-item__description {
|
|
34
48
|
color: var(--g-color-text-primary);
|
|
35
49
|
}
|
|
@@ -55,7 +69,7 @@ unpredictable css rules order in build */
|
|
|
55
69
|
position: relative;
|
|
56
70
|
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
57
71
|
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
58
|
-
font-weight:
|
|
72
|
+
font-weight: 500;
|
|
59
73
|
color: var(--g-color-text-primary);
|
|
60
74
|
}
|
|
61
75
|
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-addons-nh-stock {
|
|
4
|
+
position: relative;
|
|
5
|
+
padding: 20px;
|
|
6
|
+
display: flex;
|
|
7
|
+
flex-direction: column;
|
|
8
|
+
border-radius: 8px;
|
|
9
|
+
overflow: hidden;
|
|
10
|
+
min-height: 240px;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.pc-addons-nh-stock__background {
|
|
14
|
+
position: absolute;
|
|
15
|
+
top: 0;
|
|
16
|
+
left: 0;
|
|
17
|
+
width: 100%;
|
|
18
|
+
height: 100%;
|
|
19
|
+
object-fit: cover;
|
|
20
|
+
display: block;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.pc-addons-nh-stock__title {
|
|
24
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
25
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
26
|
+
color: var(--g-color-text-primary);
|
|
27
|
+
font-weight: 600;
|
|
28
|
+
z-index: 1;
|
|
29
|
+
margin-bottom: 4px;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.pc-addons-nh-stock__value {
|
|
33
|
+
color: var(--g-color-text-primary);
|
|
34
|
+
font-size: 36px;
|
|
35
|
+
line-height: 48px;
|
|
36
|
+
font-weight: 600;
|
|
37
|
+
z-index: 1;
|
|
38
|
+
margin-top: auto;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.pc-addons-nh-stock__date {
|
|
42
|
+
font-size: var(--g-text-body-1-font-size, var(--pc-text-body-1-font-size));
|
|
43
|
+
line-height: var(--g-text-body-1-line-height, var(--pc-text-body-1-line-height));
|
|
44
|
+
color: var(--g-color-text-secondary);
|
|
45
|
+
z-index: 1;
|
|
46
|
+
margin-top: 4px;
|
|
47
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React, { useContext } from 'react';
|
|
2
|
+
import { HeaderStockContext } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
+
import { block } from '../../../../utils/cn';
|
|
4
|
+
import './NHStock.css';
|
|
5
|
+
const b = block('nh-stock');
|
|
6
|
+
export const NHStock = ({ title, delayed, image }) => {
|
|
7
|
+
const data = useContext(HeaderStockContext);
|
|
8
|
+
if (!data.price)
|
|
9
|
+
return null;
|
|
10
|
+
return (React.createElement("div", { className: b() },
|
|
11
|
+
image ? React.createElement("img", { className: b('background'), src: image, alt: "Stock background" }) : null,
|
|
12
|
+
React.createElement("div", { className: b('title') }, title),
|
|
13
|
+
React.createElement("div", { className: b('title') }, data.price.percent),
|
|
14
|
+
React.createElement("div", { className: b('value') }, data.price.price),
|
|
15
|
+
React.createElement("div", { className: b('date') }, data.price.update),
|
|
16
|
+
React.createElement("div", { className: b('date') }, delayed)));
|
|
17
|
+
};
|
|
@@ -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-story-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-story-card:hover {
|
|
14
|
+
opacity: 0.8;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pc-addons-nh-story-card__wrap {
|
|
18
|
+
display: flex;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
gap: 4px;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.pc-addons-nh-story-card__title {
|
|
24
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
25
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
26
|
+
color: var(--g-color-text-primary);
|
|
27
|
+
font-weight: 600;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.pc-addons-nh-story-card__description {
|
|
31
|
+
font-size: var(--g-text-body-1-font-size, var(--pc-text-body-1-font-size));
|
|
32
|
+
line-height: var(--g-text-body-1-line-height, var(--pc-text-body-1-line-height));
|
|
33
|
+
color: var(--g-color-text-secondary);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.pc-addons-nh-story-card__image {
|
|
37
|
+
display: block;
|
|
38
|
+
width: 100%;
|
|
39
|
+
aspect-ratio: 16/9;
|
|
40
|
+
object-fit: cover;
|
|
41
|
+
border-radius: 16px;
|
|
42
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Image, getLinkProps } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
+
import { block } from '../../../../utils/cn';
|
|
4
|
+
import './NHStoryCard.css';
|
|
5
|
+
const b = block('nh-story-card');
|
|
6
|
+
export const NHStoryCard = ({ title, 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('title') }, title),
|
|
10
|
+
React.createElement("div", { className: b('description') }, description))));
|