@doyourjob/gravity-ui-page-constructor-addons 2.1.25-dev.0 → 2.1.25
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/Navigation/components/Navigation/Navigation.d.ts +2 -2
- package/build/cjs/components/Navigation/components/Navigation/NavigationItem/NavigationItem.d.ts +2 -2
- package/build/cjs/components/Navigation/components/Navigation/NavigationItem/NavigationItem.js +2 -2
- package/build/cjs/components/index.d.ts +0 -1
- package/build/cjs/components/index.js +0 -1
- package/build/esm/components/Navigation/components/Navigation/Navigation.d.ts +2 -2
- package/build/esm/components/Navigation/components/Navigation/NavigationItem/NavigationItem.d.ts +2 -2
- package/build/esm/components/Navigation/components/Navigation/NavigationItem/NavigationItem.js +2 -2
- package/build/esm/components/index.d.ts +0 -1
- package/build/esm/components/index.js +0 -1
- package/package.json +1 -1
- package/build/cjs/components/NewHeader/NewHeader.css +0 -162
- package/build/cjs/components/NewHeader/NewHeader.d.ts +0 -13
- package/build/cjs/components/NewHeader/NewHeader.js +0 -79
- package/build/cjs/components/NewHeader/components/CompanyPopup/CompanyPopup.css +0 -30
- package/build/cjs/components/NewHeader/components/CompanyPopup/CompanyPopup.d.ts +0 -3
- package/build/cjs/components/NewHeader/components/CompanyPopup/CompanyPopup.js +0 -20
- package/build/cjs/components/NewHeader/components/InvestorPopup/InvestorPopup.css +0 -79
- package/build/cjs/components/NewHeader/components/InvestorPopup/InvestorPopup.d.ts +0 -3
- package/build/cjs/components/NewHeader/components/InvestorPopup/InvestorPopup.js +0 -22
- package/build/cjs/components/NewHeader/components/LoginButton/LoginButton.d.ts +0 -10
- package/build/cjs/components/NewHeader/components/LoginButton/LoginButton.js +0 -46
- package/build/cjs/components/NewHeader/components/LoginPopup/LoginPopup.css +0 -45
- package/build/cjs/components/NewHeader/components/LoginPopup/LoginPopup.d.ts +0 -3
- package/build/cjs/components/NewHeader/components/LoginPopup/LoginPopup.js +0 -12
- package/build/cjs/components/NewHeader/components/MediumPopup/MediumPopup.css +0 -8
- package/build/cjs/components/NewHeader/components/MediumPopup/MediumPopup.d.ts +0 -3
- package/build/cjs/components/NewHeader/components/MediumPopup/MediumPopup.js +0 -17
- package/build/cjs/components/NewHeader/components/MobileNavigation/MobileNavigation.css +0 -47
- package/build/cjs/components/NewHeader/components/MobileNavigation/MobileNavigation.d.ts +0 -14
- package/build/cjs/components/NewHeader/components/MobileNavigation/MobileNavigation.js +0 -25
- package/build/cjs/components/NewHeader/components/MobileNavigationItem/MobileNavigationItem.css +0 -75
- package/build/cjs/components/NewHeader/components/MobileNavigationItem/MobileNavigationItem.d.ts +0 -3
- package/build/cjs/components/NewHeader/components/MobileNavigationItem/MobileNavigationItem.js +0 -30
- package/build/cjs/components/NewHeader/components/MobileNavigationPopup/MobileNavigationPopup.css +0 -55
- package/build/cjs/components/NewHeader/components/MobileNavigationPopup/MobileNavigationPopup.d.ts +0 -9
- package/build/cjs/components/NewHeader/components/MobileNavigationPopup/MobileNavigationPopup.js +0 -47
- package/build/cjs/components/NewHeader/components/Navigation/Navigation.css +0 -23
- package/build/cjs/components/NewHeader/components/Navigation/Navigation.d.ts +0 -10
- package/build/cjs/components/NewHeader/components/Navigation/Navigation.js +0 -74
- package/build/cjs/components/NewHeader/components/NavigationItem/NavigationItem.css +0 -81
- package/build/cjs/components/NewHeader/components/NavigationItem/NavigationItem.d.ts +0 -12
- package/build/cjs/components/NewHeader/components/NavigationItem/NavigationItem.js +0 -29
- package/build/cjs/components/NewHeader/components/NavigationPopup/NavigationPopup.css +0 -10
- package/build/cjs/components/NewHeader/components/NavigationPopup/NavigationPopup.d.ts +0 -9
- package/build/cjs/components/NewHeader/components/NavigationPopup/NavigationPopup.js +0 -18
- package/build/cjs/components/NewHeader/components/PopupItem/PopupItem.css +0 -111
- package/build/cjs/components/NewHeader/components/PopupItem/PopupItem.d.ts +0 -12
- package/build/cjs/components/NewHeader/components/PopupItem/PopupItem.js +0 -28
- package/build/cjs/components/NewHeader/components/ProductsPopup/ProductsPopup.css +0 -113
- package/build/cjs/components/NewHeader/components/ProductsPopup/ProductsPopup.d.ts +0 -3
- package/build/cjs/components/NewHeader/components/ProductsPopup/ProductsPopup.js +0 -65
- package/build/cjs/components/NewHeader/components/ResourcesPopup/ResourcesPopup.css +0 -191
- package/build/cjs/components/NewHeader/components/ResourcesPopup/ResourcesPopup.d.ts +0 -3
- package/build/cjs/components/NewHeader/components/ResourcesPopup/ResourcesPopup.js +0 -42
- package/build/cjs/components/NewHeader/components/SolutionsPopup/SolutionsPopup.css +0 -49
- package/build/cjs/components/NewHeader/components/SolutionsPopup/SolutionsPopup.d.ts +0 -3
- package/build/cjs/components/NewHeader/components/SolutionsPopup/SolutionsPopup.js +0 -20
- package/build/cjs/components/NewHeader/components/Tag/Tag.css +0 -21
- package/build/cjs/components/NewHeader/components/Tag/Tag.d.ts +0 -6
- package/build/cjs/components/NewHeader/components/Tag/Tag.js +0 -22
- package/build/cjs/components/NewHeader/components/WhyPopup/WhyPopup.css +0 -81
- package/build/cjs/components/NewHeader/components/WhyPopup/WhyPopup.d.ts +0 -3
- package/build/cjs/components/NewHeader/components/WhyPopup/WhyPopup.js +0 -21
- package/build/cjs/components/NewHeader/constants.d.ts +0 -7
- package/build/cjs/components/NewHeader/constants.js +0 -11
- package/build/cjs/components/NewHeader/contexts/route-change.d.ts +0 -3
- package/build/cjs/components/NewHeader/contexts/route-change.js +0 -6
- package/build/cjs/components/NewHeader/models.d.ts +0 -199
- package/build/cjs/components/NewHeader/models.js +0 -20
- package/build/cjs/components/NewHeader/styles/mixins.css +0 -0
- package/build/cjs/components/NewHeader/styles/variables.css +0 -5
- package/build/esm/components/NewHeader/NewHeader.css +0 -162
- package/build/esm/components/NewHeader/NewHeader.d.ts +0 -14
- package/build/esm/components/NewHeader/NewHeader.js +0 -75
- package/build/esm/components/NewHeader/components/CompanyPopup/CompanyPopup.css +0 -30
- package/build/esm/components/NewHeader/components/CompanyPopup/CompanyPopup.d.ts +0 -4
- package/build/esm/components/NewHeader/components/CompanyPopup/CompanyPopup.js +0 -16
- package/build/esm/components/NewHeader/components/InvestorPopup/InvestorPopup.css +0 -79
- package/build/esm/components/NewHeader/components/InvestorPopup/InvestorPopup.d.ts +0 -4
- package/build/esm/components/NewHeader/components/InvestorPopup/InvestorPopup.js +0 -18
- package/build/esm/components/NewHeader/components/LoginButton/LoginButton.d.ts +0 -10
- package/build/esm/components/NewHeader/components/LoginButton/LoginButton.js +0 -41
- package/build/esm/components/NewHeader/components/LoginPopup/LoginPopup.css +0 -45
- package/build/esm/components/NewHeader/components/LoginPopup/LoginPopup.d.ts +0 -4
- package/build/esm/components/NewHeader/components/LoginPopup/LoginPopup.js +0 -8
- package/build/esm/components/NewHeader/components/MediumPopup/MediumPopup.css +0 -8
- package/build/esm/components/NewHeader/components/MediumPopup/MediumPopup.d.ts +0 -4
- package/build/esm/components/NewHeader/components/MediumPopup/MediumPopup.js +0 -13
- package/build/esm/components/NewHeader/components/MobileNavigation/MobileNavigation.css +0 -47
- package/build/esm/components/NewHeader/components/MobileNavigation/MobileNavigation.d.ts +0 -15
- package/build/esm/components/NewHeader/components/MobileNavigation/MobileNavigation.js +0 -21
- package/build/esm/components/NewHeader/components/MobileNavigationItem/MobileNavigationItem.css +0 -75
- package/build/esm/components/NewHeader/components/MobileNavigationItem/MobileNavigationItem.d.ts +0 -4
- package/build/esm/components/NewHeader/components/MobileNavigationItem/MobileNavigationItem.js +0 -26
- package/build/esm/components/NewHeader/components/MobileNavigationPopup/MobileNavigationPopup.css +0 -55
- package/build/esm/components/NewHeader/components/MobileNavigationPopup/MobileNavigationPopup.d.ts +0 -10
- package/build/esm/components/NewHeader/components/MobileNavigationPopup/MobileNavigationPopup.js +0 -43
- package/build/esm/components/NewHeader/components/Navigation/Navigation.css +0 -23
- package/build/esm/components/NewHeader/components/Navigation/Navigation.d.ts +0 -11
- package/build/esm/components/NewHeader/components/Navigation/Navigation.js +0 -70
- package/build/esm/components/NewHeader/components/NavigationItem/NavigationItem.css +0 -81
- package/build/esm/components/NewHeader/components/NavigationItem/NavigationItem.d.ts +0 -13
- package/build/esm/components/NewHeader/components/NavigationItem/NavigationItem.js +0 -25
- package/build/esm/components/NewHeader/components/NavigationPopup/NavigationPopup.css +0 -10
- package/build/esm/components/NewHeader/components/NavigationPopup/NavigationPopup.d.ts +0 -10
- package/build/esm/components/NewHeader/components/NavigationPopup/NavigationPopup.js +0 -14
- package/build/esm/components/NewHeader/components/PopupItem/PopupItem.css +0 -111
- package/build/esm/components/NewHeader/components/PopupItem/PopupItem.d.ts +0 -13
- package/build/esm/components/NewHeader/components/PopupItem/PopupItem.js +0 -24
- package/build/esm/components/NewHeader/components/ProductsPopup/ProductsPopup.css +0 -113
- package/build/esm/components/NewHeader/components/ProductsPopup/ProductsPopup.d.ts +0 -4
- package/build/esm/components/NewHeader/components/ProductsPopup/ProductsPopup.js +0 -61
- package/build/esm/components/NewHeader/components/ResourcesPopup/ResourcesPopup.css +0 -191
- package/build/esm/components/NewHeader/components/ResourcesPopup/ResourcesPopup.d.ts +0 -4
- package/build/esm/components/NewHeader/components/ResourcesPopup/ResourcesPopup.js +0 -38
- package/build/esm/components/NewHeader/components/SolutionsPopup/SolutionsPopup.css +0 -49
- package/build/esm/components/NewHeader/components/SolutionsPopup/SolutionsPopup.d.ts +0 -4
- package/build/esm/components/NewHeader/components/SolutionsPopup/SolutionsPopup.js +0 -16
- package/build/esm/components/NewHeader/components/Tag/Tag.css +0 -21
- package/build/esm/components/NewHeader/components/Tag/Tag.d.ts +0 -7
- package/build/esm/components/NewHeader/components/Tag/Tag.js +0 -18
- package/build/esm/components/NewHeader/components/WhyPopup/WhyPopup.css +0 -81
- package/build/esm/components/NewHeader/components/WhyPopup/WhyPopup.d.ts +0 -4
- package/build/esm/components/NewHeader/components/WhyPopup/WhyPopup.js +0 -17
- package/build/esm/components/NewHeader/constants.d.ts +0 -7
- package/build/esm/components/NewHeader/constants.js +0 -8
- package/build/esm/components/NewHeader/contexts/route-change.d.ts +0 -3
- package/build/esm/components/NewHeader/contexts/route-change.js +0 -2
- package/build/esm/components/NewHeader/models.d.ts +0 -199
- package/build/esm/components/NewHeader/models.js +0 -17
- package/build/esm/components/NewHeader/styles/mixins.css +0 -0
- package/build/esm/components/NewHeader/styles/variables.css +0 -5
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
|
-
import { block } from '../../../../utils/cn';
|
|
3
|
-
import { NO_MENU_TAB_SELECTED, SWITCH_MENU_TAB_TIMEOUT } from '../../constants';
|
|
4
|
-
import { NavigationItemType, } from '../../models';
|
|
5
|
-
import { CompanyPopup } from '../CompanyPopup/CompanyPopup';
|
|
6
|
-
import { InvestorPopup } from '../InvestorPopup/InvestorPopup';
|
|
7
|
-
import { MediumPopup } from '../MediumPopup/MediumPopup';
|
|
8
|
-
import { NavigationItem } from '../NavigationItem/NavigationItem';
|
|
9
|
-
import { NavigationPopup } from '../NavigationPopup/NavigationPopup';
|
|
10
|
-
import { ProductsPopup } from '../ProductsPopup/ProductsPopup';
|
|
11
|
-
import { ResourcesPopup } from '../ResourcesPopup/ResourcesPopup';
|
|
12
|
-
import { SolutionsPopup } from '../SolutionsPopup/SolutionsPopup';
|
|
13
|
-
import { WhyPopup } from '../WhyPopup/WhyPopup';
|
|
14
|
-
import './Navigation.css';
|
|
15
|
-
const b = block('navigation');
|
|
16
|
-
const tooltipPrefixId = 'navigation-item-key';
|
|
17
|
-
const getPopupContent = (sectionData) => {
|
|
18
|
-
const { type, data } = sectionData;
|
|
19
|
-
switch (type) {
|
|
20
|
-
case NavigationItemType.MediumPopup:
|
|
21
|
-
return React.createElement(MediumPopup, Object.assign({}, data));
|
|
22
|
-
case NavigationItemType.ProductsPopup:
|
|
23
|
-
return React.createElement(ProductsPopup, Object.assign({}, data));
|
|
24
|
-
case NavigationItemType.SolutionsPopup:
|
|
25
|
-
return React.createElement(SolutionsPopup, Object.assign({}, data));
|
|
26
|
-
case NavigationItemType.WhyPopup:
|
|
27
|
-
return React.createElement(WhyPopup, Object.assign({}, data));
|
|
28
|
-
case NavigationItemType.ResourcesPopup:
|
|
29
|
-
return React.createElement(ResourcesPopup, Object.assign({}, data));
|
|
30
|
-
case NavigationItemType.CompanyPopup:
|
|
31
|
-
return React.createElement(CompanyPopup, Object.assign({}, data));
|
|
32
|
-
case NavigationItemType.InvestorPopup:
|
|
33
|
-
return React.createElement(InvestorPopup, Object.assign({}, data));
|
|
34
|
-
default:
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
export const Navigation = ({ data, headerRef, setupRouteChangeHandler }) => {
|
|
39
|
-
const [activeTab, setActiveTab] = useState(NO_MENU_TAB_SELECTED);
|
|
40
|
-
const [pretendentActiveTab, setPretendentAciveTab] = useState(NO_MENU_TAB_SELECTED);
|
|
41
|
-
const [previouslyFocusedElement, setPreviouslyFocusedElement] = useState(null);
|
|
42
|
-
const handleActiveTab = useCallback((currentIndex) => {
|
|
43
|
-
setPreviouslyFocusedElement(document.activeElement);
|
|
44
|
-
setPretendentAciveTab(currentIndex);
|
|
45
|
-
}, []);
|
|
46
|
-
const onEscapeKeyDown = useCallback((event) => {
|
|
47
|
-
if (event.key === 'Escape') {
|
|
48
|
-
setActiveTab(NO_MENU_TAB_SELECTED);
|
|
49
|
-
setPretendentAciveTab(NO_MENU_TAB_SELECTED);
|
|
50
|
-
previouslyFocusedElement === null || previouslyFocusedElement === void 0 ? void 0 : previouslyFocusedElement.focus({ preventScroll: true });
|
|
51
|
-
}
|
|
52
|
-
}, [previouslyFocusedElement]);
|
|
53
|
-
useEffect(() => setupRouteChangeHandler === null || setupRouteChangeHandler === void 0 ? void 0 : setupRouteChangeHandler(() => {
|
|
54
|
-
handleActiveTab(NO_MENU_TAB_SELECTED);
|
|
55
|
-
}), [setupRouteChangeHandler, handleActiveTab]);
|
|
56
|
-
useEffect(() => {
|
|
57
|
-
const timerId = setTimeout(() => {
|
|
58
|
-
setActiveTab(pretendentActiveTab);
|
|
59
|
-
}, SWITCH_MENU_TAB_TIMEOUT);
|
|
60
|
-
return () => clearTimeout(timerId);
|
|
61
|
-
}, [activeTab, pretendentActiveTab]);
|
|
62
|
-
useEffect(() => {
|
|
63
|
-
document.addEventListener('keydown', onEscapeKeyDown);
|
|
64
|
-
return () => {
|
|
65
|
-
document.removeEventListener('keydown', onEscapeKeyDown);
|
|
66
|
-
};
|
|
67
|
-
}, [onEscapeKeyDown]);
|
|
68
|
-
return (React.createElement("nav", null,
|
|
69
|
-
React.createElement("ul", { className: b() }, data.map((item, i) => (React.createElement(NavigationItem, { key: item.title, item: item, handleActiveTab: handleActiveTab, index: i, isActive: activeTab === i, tooltipId: `${tooltipPrefixId}-${i}` }, activeTab === i && item.type !== NavigationItemType.Link && (React.createElement(NavigationPopup, { headerRef: headerRef, id: `${tooltipPrefixId}-${i}` }, getPopupContent(item)))))))));
|
|
70
|
-
};
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/* use this for style redefinitions to awoid problems with
|
|
2
|
-
unpredictable css rules order in build */
|
|
3
|
-
.pc-addons-navigation-item {
|
|
4
|
-
white-space: nowrap;
|
|
5
|
-
color: var(--g-color-text-primary);
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
.pc-addons-navigation-item:hover .pc-addons-navigation-item__text {
|
|
9
|
-
color: var(--g-color-text-link);
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.pc-addons-navigation-item_disable {
|
|
13
|
-
pointer-events: none;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
.pc-addons-navigation-item__popup {
|
|
17
|
-
--yc-popup-border-width: 0;
|
|
18
|
-
--yc-popup-border-color: none;
|
|
19
|
-
border-radius: var(--pc-border-radius, 24px);
|
|
20
|
-
box-shadow: 0 3px 10px var(--g-color-base-generic-hover);
|
|
21
|
-
--yc-popover-max-width: 1296px;
|
|
22
|
-
--yc-popover-padding: 20px;
|
|
23
|
-
width: var(--yc-popover-max-width);
|
|
24
|
-
left: 0;
|
|
25
|
-
box-shadow: 0 4px 24px var(--g-color-base-generic-hover), 0 2px 8px var(--g-color-base-generic-hover);
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.pc-addons-navigation-item__text {
|
|
29
|
-
display: inline-block;
|
|
30
|
-
margin: 0;
|
|
31
|
-
padding: 0;
|
|
32
|
-
font: inherit;
|
|
33
|
-
border: none;
|
|
34
|
-
outline: none;
|
|
35
|
-
color: inherit;
|
|
36
|
-
background: none;
|
|
37
|
-
cursor: pointer;
|
|
38
|
-
color: inherit;
|
|
39
|
-
text-decoration: none;
|
|
40
|
-
display: block;
|
|
41
|
-
margin: 0 12px;
|
|
42
|
-
padding-bottom: 12px;
|
|
43
|
-
border-bottom: 2px solid transparent;
|
|
44
|
-
color: var(--g-color-text-primary);
|
|
45
|
-
position: relative;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.pc-addons-navigation-item__text:focus::before {
|
|
49
|
-
content: "";
|
|
50
|
-
width: 100%;
|
|
51
|
-
height: calc(100% - 12px - 2px);
|
|
52
|
-
position: absolute;
|
|
53
|
-
outline: 2px solid var(--g-color-line-focus);
|
|
54
|
-
border-radius: var(--g-focus-border-radius);
|
|
55
|
-
left: 0;
|
|
56
|
-
right: 0;
|
|
57
|
-
top: 2px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.pc-addons-navigation-item__text:focus:not(:focus-visible)::before {
|
|
61
|
-
display: none;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
.pc-addons-navigation-item__text_active {
|
|
65
|
-
color: var(--g-color-text-link);
|
|
66
|
-
border-color: var(--g-color-text-link);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
.pc-addons-navigation-item__text_cursor_default {
|
|
70
|
-
cursor: default;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.pc-addons-navigation-item:first-child .pc-addons-navigation-item__text {
|
|
74
|
-
margin-left: 0;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
@media (max-width: 1296px) {
|
|
78
|
-
.pc-addons-navigation-item__popup {
|
|
79
|
-
--yc-popover-max-width: calc(100% - 32px);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import type { FC, ReactNode } from 'react';
|
|
2
|
-
import { NavigationItemData } from '../../models';
|
|
3
|
-
import './NavigationItem.css';
|
|
4
|
-
interface NavigationItemOwnProps {
|
|
5
|
-
index: number;
|
|
6
|
-
item: NavigationItemData;
|
|
7
|
-
isActive: boolean;
|
|
8
|
-
handleActiveTab: (currentIndex: number) => void;
|
|
9
|
-
children?: ReactNode;
|
|
10
|
-
tooltipId?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare const NavigationItem: FC<NavigationItemOwnProps>;
|
|
13
|
-
export {};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React, { useCallback, useContext, useEffect } from 'react';
|
|
2
|
-
import { getLinkProps } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
-
import { block } from '../../../../utils/cn';
|
|
4
|
-
import { NO_MENU_TAB_SELECTED } from '../../constants';
|
|
5
|
-
import { RouteChangeHandlerContext } from '../../contexts/route-change';
|
|
6
|
-
import { NavigationItemType } from '../../models';
|
|
7
|
-
import './NavigationItem.css';
|
|
8
|
-
const b = block('navigation-item');
|
|
9
|
-
export const NavigationItem = ({ item, isActive, handleActiveTab, index, children, tooltipId, }) => {
|
|
10
|
-
var _a, _b, _c, _d;
|
|
11
|
-
const setupRouteChangeHandler = useContext(RouteChangeHandlerContext);
|
|
12
|
-
const handleMouseEnter = useCallback(() => handleActiveTab(index), [handleActiveTab, index]);
|
|
13
|
-
const handleMouseLeave = useCallback(() => handleActiveTab(NO_MENU_TAB_SELECTED), [handleActiveTab]);
|
|
14
|
-
useEffect(() => setupRouteChangeHandler === null || setupRouteChangeHandler === void 0 ? void 0 : setupRouteChangeHandler(() => {
|
|
15
|
-
handleMouseLeave();
|
|
16
|
-
}), [handleMouseLeave, setupRouteChangeHandler]);
|
|
17
|
-
if (item.type === NavigationItemType.Link) {
|
|
18
|
-
return (React.createElement("li", { key: item.title, className: b({ disable: !((_a = item.data) === null || _a === void 0 ? void 0 : _a.url) }), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
|
19
|
-
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),
|
|
20
|
-
children));
|
|
21
|
-
}
|
|
22
|
-
return (React.createElement("li", { key: item.title, className: b({}), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
|
23
|
-
React.createElement("button", { className: b('text', { active: isActive, cursor: 'default' }), onClick: handleMouseEnter, "aria-expanded": isActive, "aria-controls": tooltipId }, item.title),
|
|
24
|
-
children));
|
|
25
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { RefObject } from 'react';
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import './NavigationPopup.css';
|
|
4
|
-
interface NavigationPopupProps {
|
|
5
|
-
headerRef?: RefObject<HTMLDivElement>;
|
|
6
|
-
children: React.ReactNode;
|
|
7
|
-
id?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare const NavigationPopup: ({ headerRef, children, id }: NavigationPopupProps) => React.ReactPortal | null;
|
|
10
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import ReactDOM from 'react-dom';
|
|
3
|
-
import { FocusTrap } from '../../../../utils/FocusTrap';
|
|
4
|
-
import { block } from '../../../../utils/cn';
|
|
5
|
-
import './NavigationPopup.css';
|
|
6
|
-
const b = block('navigation-popup');
|
|
7
|
-
export const NavigationPopup = ({ headerRef, children, id }) => {
|
|
8
|
-
return (headerRef === null || headerRef === void 0 ? void 0 : headerRef.current)
|
|
9
|
-
? ReactDOM.createPortal(React.createElement(FocusTrap, { enabled: true },
|
|
10
|
-
React.createElement("div", {
|
|
11
|
-
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
12
|
-
tabIndex: 0, className: b(), id: id }, children)), headerRef.current)
|
|
13
|
-
: null;
|
|
14
|
-
};
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
/* use this for style redefinitions to awoid problems with
|
|
2
|
-
unpredictable css rules order in build */
|
|
3
|
-
.pc-addons-navigation-popup-item {
|
|
4
|
-
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
5
|
-
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
6
|
-
margin-bottom: 2px;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.pc-addons-navigation-popup-item__content {
|
|
10
|
-
outline: none;
|
|
11
|
-
color: inherit;
|
|
12
|
-
text-decoration: none;
|
|
13
|
-
display: flex;
|
|
14
|
-
border-radius: var(--g-border-radius-xl);
|
|
15
|
-
height: 100%;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.utilityfocus .pc-addons-navigation-popup-item__content:focus {
|
|
19
|
-
outline: 2px solid #ffdb4d;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.pc-addons-navigation-popup-item__content:focus {
|
|
23
|
-
outline: 2px solid var(--g-color-line-focus);
|
|
24
|
-
outline-offset: -2px;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
.pc-addons-navigation-popup-item__content:focus:not(:focus-visible) {
|
|
28
|
-
outline: 0;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
.pc-addons-navigation-popup-item__content_padding_default {
|
|
32
|
-
padding: 12px;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
.pc-addons-navigation-popup-item__content_padding_s {
|
|
36
|
-
padding: 6px 12px;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
.pc-addons-navigation-popup-item__content:hover, .pc-addons-navigation-popup-item__content:active {
|
|
40
|
-
color: var(--g-color-base-brand);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
.pc-addons-navigation-popup-item__content_hover:hover, .pc-addons-navigation-popup-item__content_hover:active {
|
|
44
|
-
color: inherit;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
.pc-addons-navigation-popup-item__content_hover:hover {
|
|
48
|
-
background-color: var(--g-color-base-simple-hover);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.pc-addons-navigation-popup-item__content_disable {
|
|
52
|
-
pointer-events: none;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
.pc-addons-navigation-popup-item__icon {
|
|
56
|
-
color: var(--g-color-base-brand);
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
.pc-addons-navigation-popup-item__icon-container {
|
|
60
|
-
position: absolute;
|
|
61
|
-
width: 20px;
|
|
62
|
-
height: 20px;
|
|
63
|
-
display: flex;
|
|
64
|
-
justify-content: center;
|
|
65
|
-
align-items: center;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.pc-addons-navigation-popup-item__container_with-margin {
|
|
69
|
-
margin-left: 28px;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.pc-addons-navigation-popup-item__description {
|
|
73
|
-
font-size: var(--g-text-body-1-font-size, var(--pc-text-body-1-font-size));
|
|
74
|
-
line-height: var(--g-text-body-1-line-height, var(--pc-text-body-1-line-height));
|
|
75
|
-
display: block;
|
|
76
|
-
margin-top: 2px;
|
|
77
|
-
color: var(--g-color-text-secondary);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.pc-addons-navigation-popup-item__tag {
|
|
81
|
-
position: relative;
|
|
82
|
-
top: -2px;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
.pc-addons-navigation-popup-item__image {
|
|
86
|
-
display: block;
|
|
87
|
-
position: relative;
|
|
88
|
-
top: 2px;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
.pc-addons-navigation-popup-item__image_size_m {
|
|
92
|
-
width: 18px;
|
|
93
|
-
height: 18px;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
.pc-addons-navigation-popup-item__image_size_xm {
|
|
97
|
-
width: 16px;
|
|
98
|
-
height: 16px;
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
.pc-addons-navigation-popup-item__image_size_s {
|
|
102
|
-
width: 14px;
|
|
103
|
-
height: 14px;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
.pc-addons-navigation-popup-item__image-container {
|
|
107
|
-
display: flex;
|
|
108
|
-
justify-content: center;
|
|
109
|
-
min-width: 20px;
|
|
110
|
-
margin-right: 8px;
|
|
111
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import type { GridColumnSizesType } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
-
import { PopupItemData } from '../../models';
|
|
4
|
-
import './PopupItem.css';
|
|
5
|
-
export interface PopupItemProps extends Partial<PopupItemData> {
|
|
6
|
-
hover?: boolean;
|
|
7
|
-
sizes?: GridColumnSizesType;
|
|
8
|
-
className?: string;
|
|
9
|
-
padding?: 'default' | 's';
|
|
10
|
-
imageSize?: 's' | 'xm' | 'm';
|
|
11
|
-
target?: string;
|
|
12
|
-
}
|
|
13
|
-
export declare const PopupItem: (props: PopupItemProps) => React.JSX.Element;
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Col, HTML, Image, getLinkProps } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
-
import { Icon } from '@gravity-ui/uikit';
|
|
4
|
-
import { block } from '../../../../utils/cn';
|
|
5
|
-
import { DefaultCategorizedItemSizes } from '../../constants';
|
|
6
|
-
import { NavigationTag } from '../Tag/Tag';
|
|
7
|
-
import './PopupItem.css';
|
|
8
|
-
const b = block('navigation-popup-item');
|
|
9
|
-
export const PopupItem = (props) => {
|
|
10
|
-
const { icon, url, target, title, tag, description, image, imageSize = 'm', hover, className, sizes = DefaultCategorizedItemSizes, padding = 'default', } = props;
|
|
11
|
-
const navigationTag = tag && React.createElement(NavigationTag, Object.assign({ className: b('tag'), size: "s" }, tag));
|
|
12
|
-
return (React.createElement(Col, { className: b(null, className), sizes: sizes },
|
|
13
|
-
React.createElement("a", Object.assign({ className: b('content', { hover, padding, disable: !url }), href: url }, getLinkProps(url || '', undefined, target)),
|
|
14
|
-
icon && (React.createElement("div", { className: b('icon-container') },
|
|
15
|
-
React.createElement(Icon, { className: b('icon'), data: icon, size: 16 }))),
|
|
16
|
-
image && (React.createElement("div", { className: b('image-container') },
|
|
17
|
-
React.createElement(Image, { className: b('image', { size: imageSize }), src: image }))),
|
|
18
|
-
React.createElement("div", { className: b('container', { 'with-margin': Boolean(icon) }) },
|
|
19
|
-
React.createElement("div", { className: b('title-tag-wrapper') },
|
|
20
|
-
React.createElement("span", { className: b('title') }, title),
|
|
21
|
-
"\u00A0",
|
|
22
|
-
navigationTag),
|
|
23
|
-
description && React.createElement(HTML, { className: b('description') }, description)))));
|
|
24
|
-
};
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
/* use this for style redefinitions to awoid problems with
|
|
2
|
-
unpredictable css rules order in build */
|
|
3
|
-
.pc-addons-products-popup {
|
|
4
|
-
background: var(--g-color-base-float);
|
|
5
|
-
box-shadow: 0 4px 24px var(--g-color-base-generic), 0 2px 8px var(--g-color-base-generic);
|
|
6
|
-
max-height: calc(100vh - 64px - 64px);
|
|
7
|
-
overflow: auto;
|
|
8
|
-
max-width: 1200px;
|
|
9
|
-
width: 100%;
|
|
10
|
-
border-radius: var(--pc-border-radius, 24px);
|
|
11
|
-
scrollbar-width: none;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
.pc-addons-products-popup::-webkit-scrollbar {
|
|
15
|
-
display: none;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.pc-addons-products-popup__container {
|
|
19
|
-
padding: 0;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.pc-addons-products-popup > div + div {
|
|
23
|
-
border-top: 1px solid #e4ebf0;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
.pc-addons-products-popup__wrap {
|
|
27
|
-
padding: 24px;
|
|
28
|
-
gap: 24px;
|
|
29
|
-
display: flex;
|
|
30
|
-
flex-direction: column;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.pc-addons-products-popup__title {
|
|
34
|
-
font-size: var(--g-text-header-1-font-size, var(--pc-text-header-1-font-size));
|
|
35
|
-
line-height: var(--g-text-header-1-line-height, var(--pc-text-header-1-line-height));
|
|
36
|
-
padding: 24px;
|
|
37
|
-
max-width: 108px;
|
|
38
|
-
font-weight: 600;
|
|
39
|
-
background-color: #e0e0e0;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
.pc-addons-products-popup__subtitle {
|
|
43
|
-
font-size: var(--g-text-header-1-font-size, var(--pc-text-header-1-font-size));
|
|
44
|
-
line-height: var(--g-text-header-1-line-height, var(--pc-text-header-1-line-height));
|
|
45
|
-
font-weight: 700;
|
|
46
|
-
color: #e0e0e0;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
.pc-addons-products-popup__powered-card {
|
|
50
|
-
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
51
|
-
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
52
|
-
font-weight: 500;
|
|
53
|
-
background-color: #f2f6f9;
|
|
54
|
-
border-radius: 16px;
|
|
55
|
-
padding: 16px;
|
|
56
|
-
display: flex;
|
|
57
|
-
gap: 24px;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
.pc-addons-products-popup__powered-card-wrap {
|
|
61
|
-
display: flex;
|
|
62
|
-
flex-direction: column;
|
|
63
|
-
justify-content: center;
|
|
64
|
-
flex: 1;
|
|
65
|
-
gap: 20px;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.pc-addons-products-popup__powered-card-description {
|
|
69
|
-
color: #9fb1bd;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
.pc-addons-products-popup__powered-card-container-image {
|
|
73
|
-
flex: 1;
|
|
74
|
-
max-width: 140px;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
.pc-addons-products-popup__powered-card-image {
|
|
78
|
-
width: 100%;
|
|
79
|
-
aspect-ratio: 1;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
.pc-addons-products-popup__run-card {
|
|
83
|
-
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
84
|
-
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
85
|
-
font-weight: 500;
|
|
86
|
-
border-radius: 16px;
|
|
87
|
-
background-color: #f2f6f9;
|
|
88
|
-
padding: 16px;
|
|
89
|
-
display: flex;
|
|
90
|
-
flex-direction: column;
|
|
91
|
-
gap: 20px;
|
|
92
|
-
height: 100%;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.pc-addons-products-popup__run-card_border {
|
|
96
|
-
border: 1px solid #e4ebf0;
|
|
97
|
-
background-color: transparent;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
.pc-addons-products-popup__run-card-wrap {
|
|
101
|
-
display: flex;
|
|
102
|
-
flex-direction: column;
|
|
103
|
-
flex: 1;
|
|
104
|
-
gap: 4px;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
.pc-addons-products-popup__run-card-description {
|
|
108
|
-
color: #9fb1bd;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
.pc-addons-products-popup__run-card-image {
|
|
112
|
-
height: 40px;
|
|
113
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { Col, Grid, GridColumnSize, Image, Row } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
-
import { block } from '../../../../utils/cn';
|
|
4
|
-
import { PopupItem } from '../PopupItem/PopupItem';
|
|
5
|
-
import './ProductsPopup.css';
|
|
6
|
-
const b = block('products-popup');
|
|
7
|
-
const PoweredCard = ({ title, description, image }) => {
|
|
8
|
-
return (React.createElement("div", { className: b('powered-card') },
|
|
9
|
-
React.createElement("div", { className: b('powered-card-wrap') },
|
|
10
|
-
React.createElement("div", { className: b('powered-card-title') }, title),
|
|
11
|
-
React.createElement("div", { className: b('powered-card-description') }, description)),
|
|
12
|
-
React.createElement(Image, { className: b('powered-card-image'), containerClassName: b('powered-card-container-image'), src: image })));
|
|
13
|
-
};
|
|
14
|
-
const RunCard = ({ title, description, image, border }) => {
|
|
15
|
-
return (React.createElement("div", { className: b('run-card', { border: border }) },
|
|
16
|
-
React.createElement(Image, { className: b('run-card-image'), src: image }),
|
|
17
|
-
React.createElement("div", { className: b('run-card-wrap') },
|
|
18
|
-
React.createElement("div", { className: b('run-card-title') }, title),
|
|
19
|
-
React.createElement("div", { className: b('run-card-description') }, description))));
|
|
20
|
-
};
|
|
21
|
-
export const ProductsPopup = ({ sections, poweredCard }) => (React.createElement(Grid, { className: b(), containerClass: b('container') }, sections.map((section, index) => {
|
|
22
|
-
var _a, _b, _c;
|
|
23
|
-
const isScaleSection = index === 2; // "Scale" section is usually the 3rd one
|
|
24
|
-
const isRunSection = section.runCards && section.runCards.length > 0;
|
|
25
|
-
let content;
|
|
26
|
-
if (isRunSection) {
|
|
27
|
-
content = (React.createElement(Col, null,
|
|
28
|
-
React.createElement(Row, null, (_a = section.runCards) === null || _a === void 0 ? void 0 : _a.map((card, cardIndex) => (React.createElement(Col, { key: `${card.title}-${cardIndex}`, sizes: {
|
|
29
|
-
[GridColumnSize.Md]: 3,
|
|
30
|
-
[GridColumnSize.All]: 12,
|
|
31
|
-
} },
|
|
32
|
-
React.createElement(RunCard, Object.assign({}, card))))))));
|
|
33
|
-
}
|
|
34
|
-
else if (isScaleSection) {
|
|
35
|
-
content = (React.createElement(React.Fragment, null,
|
|
36
|
-
React.createElement(Col, { sizes: {
|
|
37
|
-
[GridColumnSize.Md]: 8,
|
|
38
|
-
[GridColumnSize.All]: 12,
|
|
39
|
-
} },
|
|
40
|
-
React.createElement(Row, null, (_b = section.items) === null || _b === void 0 ? void 0 : _b.map((item, itemIndex) => (React.createElement(PopupItem, Object.assign({ key: `${item.title}-${itemIndex}` }, item, { hover: true, sizes: {
|
|
41
|
-
[GridColumnSize.Md]: 6,
|
|
42
|
-
[GridColumnSize.All]: 12,
|
|
43
|
-
} })))))),
|
|
44
|
-
React.createElement(Col, { sizes: {
|
|
45
|
-
[GridColumnSize.Md]: 4,
|
|
46
|
-
[GridColumnSize.All]: 12,
|
|
47
|
-
} }, poweredCard && React.createElement(PoweredCard, Object.assign({}, poweredCard)))));
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
content = (_c = section.items) === null || _c === void 0 ? void 0 : _c.map((item, itemIndex) => (React.createElement(PopupItem, Object.assign({ key: `${item.title}-${itemIndex}` }, item, { hover: true, sizes: {
|
|
51
|
-
[GridColumnSize.Md]: 4,
|
|
52
|
-
[GridColumnSize.All]: 12,
|
|
53
|
-
} }))));
|
|
54
|
-
}
|
|
55
|
-
return (React.createElement(Row, { key: section.title },
|
|
56
|
-
React.createElement(Col, { className: b('title') }, section.title),
|
|
57
|
-
React.createElement(Col, { className: b('wrap') },
|
|
58
|
-
React.createElement(Row, null,
|
|
59
|
-
React.createElement(Col, { className: b('subtitle') }, section.subtitle)),
|
|
60
|
-
React.createElement(Row, null, content))));
|
|
61
|
-
})));
|