@doyourjob/gravity-ui-page-constructor-addons 2.1.8
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/LICENSE +21 -0
- package/README.md +31 -0
- package/build/cjs/components/EnrichedLink/EnrichedLink.css +94 -0
- package/build/cjs/components/EnrichedLink/EnrichedLink.d.ts +17 -0
- package/build/cjs/components/EnrichedLink/EnrichedLink.js +38 -0
- package/build/cjs/components/Navigation/components/ButtonsContainer/ButtonsContainer.css +12 -0
- package/build/cjs/components/Navigation/components/ButtonsContainer/ButtonsContainer.d.ts +15 -0
- package/build/cjs/components/Navigation/components/ButtonsContainer/ButtonsContainer.js +17 -0
- package/build/cjs/components/Navigation/components/LangSwitch/LangSwitch.css +62 -0
- package/build/cjs/components/Navigation/components/LangSwitch/LangSwitchPopup/LangSwitchPopup.css +62 -0
- package/build/cjs/components/Navigation/components/LangSwitch/LangSwitchPopup/LangSwitchPopup.d.ts +7 -0
- package/build/cjs/components/Navigation/components/LangSwitch/LangSwitchPopup/LangSwitchPopup.js +23 -0
- package/build/cjs/components/Navigation/components/LangSwitch/index.d.ts +17 -0
- package/build/cjs/components/Navigation/components/LangSwitch/index.js +27 -0
- package/build/cjs/components/Navigation/components/Logo/Logo.css +53 -0
- package/build/cjs/components/Navigation/components/Logo/Logo.d.ts +9 -0
- package/build/cjs/components/Navigation/components/Logo/Logo.js +15 -0
- package/build/cjs/components/Navigation/components/Logo/i18n/en.json +4 -0
- package/build/cjs/components/Navigation/components/Logo/i18n/index.d.ts +2 -0
- package/build/cjs/components/Navigation/components/Logo/i18n/index.js +8 -0
- package/build/cjs/components/Navigation/components/Logo/i18n/ru.json +4 -0
- package/build/cjs/components/Navigation/components/MobileNavigation/MobileNavigation.css +47 -0
- package/build/cjs/components/Navigation/components/MobileNavigation/MobileNavigation.d.ts +16 -0
- package/build/cjs/components/Navigation/components/MobileNavigation/MobileNavigation.js +26 -0
- package/build/cjs/components/Navigation/components/MobileNavigation/MobileNavigationItem/MobileNavigationItem.css +75 -0
- package/build/cjs/components/Navigation/components/MobileNavigation/MobileNavigationItem/MobileNavigationItem.d.ts +7 -0
- package/build/cjs/components/Navigation/components/MobileNavigation/MobileNavigationItem/MobileNavigationItem.js +45 -0
- package/build/cjs/components/Navigation/components/MobileNavigation/MobileNavigationPopup/MobileNavigationPopup.css +55 -0
- package/build/cjs/components/Navigation/components/MobileNavigation/MobileNavigationPopup/MobileNavigationPopup.d.ts +9 -0
- package/build/cjs/components/Navigation/components/MobileNavigation/MobileNavigationPopup/MobileNavigationPopup.js +47 -0
- package/build/cjs/components/Navigation/components/Navigation/Navigation.css +28 -0
- package/build/cjs/components/Navigation/components/Navigation/Navigation.d.ts +13 -0
- package/build/cjs/components/Navigation/components/Navigation/Navigation.js +74 -0
- package/build/cjs/components/Navigation/components/Navigation/NavigationItem/NavigationItem.css +81 -0
- package/build/cjs/components/Navigation/components/Navigation/NavigationItem/NavigationItem.d.ts +14 -0
- package/build/cjs/components/Navigation/components/Navigation/NavigationItem/NavigationItem.js +57 -0
- package/build/cjs/components/Navigation/components/Navigation/NavigationItemsList/NavigationItemsList.d.ts +12 -0
- package/build/cjs/components/Navigation/components/Navigation/NavigationItemsList/NavigationItemsList.js +11 -0
- package/build/cjs/components/Navigation/components/Navigation/NavigationPopup/NavigationPopup.css +20 -0
- package/build/cjs/components/Navigation/components/Navigation/NavigationPopup/NavigationPopup.d.ts +11 -0
- package/build/cjs/components/Navigation/components/Navigation/NavigationPopup/NavigationPopup.js +20 -0
- package/build/cjs/components/Navigation/components/Navigation/NavigationPopupItem/NavigationPopupItem.css +111 -0
- package/build/cjs/components/Navigation/components/Navigation/NavigationPopupItem/NavigationPopupItem.d.ts +12 -0
- package/build/cjs/components/Navigation/components/Navigation/NavigationPopupItem/NavigationPopupItem.js +46 -0
- package/build/cjs/components/Navigation/components/SearchNotFound/SearchNotFound.css +7 -0
- package/build/cjs/components/Navigation/components/SearchNotFound/SearchNotFound.d.ts +8 -0
- package/build/cjs/components/Navigation/components/SearchNotFound/SearchNotFound.js +22 -0
- package/build/cjs/components/Navigation/components/SearchNotFound/i18n/en.json +4 -0
- package/build/cjs/components/Navigation/components/SearchNotFound/i18n/index.d.ts +2 -0
- package/build/cjs/components/Navigation/components/SearchNotFound/i18n/index.js +8 -0
- package/build/cjs/components/Navigation/components/SearchNotFound/i18n/ru.json +4 -0
- package/build/cjs/components/Navigation/components/SearchResult/SearchResult.css +8 -0
- package/build/cjs/components/Navigation/components/SearchResult/SearchResult.d.ts +10 -0
- package/build/cjs/components/Navigation/components/SearchResult/SearchResult.js +25 -0
- package/build/cjs/components/Navigation/components/SearchResult/i18n/en.json +12 -0
- package/build/cjs/components/Navigation/components/SearchResult/i18n/index.d.ts +2 -0
- package/build/cjs/components/Navigation/components/SearchResult/i18n/index.js +8 -0
- package/build/cjs/components/Navigation/components/SearchResult/i18n/ru.json +11 -0
- package/build/cjs/components/Navigation/components/Tag/Tag.css +21 -0
- package/build/cjs/components/Navigation/components/Tag/Tag.d.ts +6 -0
- package/build/cjs/components/Navigation/components/Tag/Tag.js +22 -0
- package/build/cjs/components/Navigation/components/popups/LargePopup/LargePopup.css +71 -0
- package/build/cjs/components/Navigation/components/popups/LargePopup/LargePopup.d.ts +6 -0
- package/build/cjs/components/Navigation/components/popups/LargePopup/LargePopup.js +78 -0
- package/build/cjs/components/Navigation/components/popups/MediumPopup/MediumPopup.css +6 -0
- package/build/cjs/components/Navigation/components/popups/MediumPopup/MediumPopup.d.ts +7 -0
- package/build/cjs/components/Navigation/components/popups/MediumPopup/MediumPopup.js +16 -0
- package/build/cjs/components/Navigation/components/popups/MediumPopupWithCategories/MediumPopupWithCategories.css +37 -0
- package/build/cjs/components/Navigation/components/popups/MediumPopupWithCategories/MediumPopupWithCategories.d.ts +7 -0
- package/build/cjs/components/Navigation/components/popups/MediumPopupWithCategories/MediumPopupWithCategories.js +54 -0
- package/build/cjs/components/Navigation/components/popups/MediumPopupWithFloors/MediumPopupWithFloors.css +7 -0
- package/build/cjs/components/Navigation/components/popups/MediumPopupWithFloors/MediumPopupWithFloors.d.ts +7 -0
- package/build/cjs/components/Navigation/components/popups/MediumPopupWithFloors/MediumPopupWithFloors.js +18 -0
- package/build/cjs/components/Navigation/components/popups/components/PopupCategory/PopupCategory.css +43 -0
- package/build/cjs/components/Navigation/components/popups/components/PopupCategory/PopupCategory.d.ts +9 -0
- package/build/cjs/components/Navigation/components/popups/components/PopupCategory/PopupCategory.js +13 -0
- package/build/cjs/components/Navigation/components/popups/components/PopupGroup/PopupGroup.css +27 -0
- package/build/cjs/components/Navigation/components/popups/components/PopupGroup/PopupGroup.d.ts +11 -0
- package/build/cjs/components/Navigation/components/popups/components/PopupGroup/PopupGroup.js +21 -0
- package/build/cjs/components/Navigation/components/popups/components/PopupSecondaryGroup/PopupSecondaryGroup.css +17 -0
- package/build/cjs/components/Navigation/components/popups/components/PopupSecondaryGroup/PopupSecondaryGroup.d.ts +8 -0
- package/build/cjs/components/Navigation/components/popups/components/PopupSecondaryGroup/PopupSecondaryGroup.js +20 -0
- package/build/cjs/components/Navigation/components/popups/components/PopupTitle/PopupTitle.d.ts +4 -0
- package/build/cjs/components/Navigation/components/popups/components/PopupTitle/PopupTitle.js +19 -0
- package/build/cjs/components/Navigation/components/popups/components/Search/Search.css +38 -0
- package/build/cjs/components/Navigation/components/popups/components/Search/Search.d.ts +17 -0
- package/build/cjs/components/Navigation/components/popups/components/Search/Search.js +47 -0
- package/build/cjs/components/Navigation/components/popups/components/Search/i18n/en.json +5 -0
- package/build/cjs/components/Navigation/components/popups/components/Search/i18n/index.d.ts +2 -0
- package/build/cjs/components/Navigation/components/popups/components/Search/i18n/index.js +8 -0
- package/build/cjs/components/Navigation/components/popups/components/Search/i18n/ru.json +5 -0
- package/build/cjs/components/Navigation/constants.d.ts +7 -0
- package/build/cjs/components/Navigation/constants.js +11 -0
- package/build/cjs/components/Navigation/containers/Footer/Footer.css +104 -0
- package/build/cjs/components/Navigation/containers/Footer/Footer.d.ts +3 -0
- package/build/cjs/components/Navigation/containers/Footer/Footer.js +58 -0
- package/build/cjs/components/Navigation/containers/Footer/GroupLinks/GroupLinks.css +68 -0
- package/build/cjs/components/Navigation/containers/Footer/GroupLinks/GroupLinks.d.ts +12 -0
- package/build/cjs/components/Navigation/containers/Footer/GroupLinks/GroupLinks.js +15 -0
- package/build/cjs/components/Navigation/containers/Footer/index.d.ts +3 -0
- package/build/cjs/components/Navigation/containers/Footer/index.js +6 -0
- package/build/cjs/components/Navigation/containers/Footer/models.d.ts +23 -0
- package/build/cjs/components/Navigation/containers/Footer/models.js +2 -0
- package/build/cjs/components/Navigation/containers/Footer/variables.css +7 -0
- package/build/cjs/components/Navigation/containers/Header/Header.css +172 -0
- package/build/cjs/components/Navigation/containers/Header/Header.d.ts +18 -0
- package/build/cjs/components/Navigation/containers/Header/Header.js +116 -0
- package/build/cjs/components/Navigation/containers/Header/index.d.ts +15 -0
- package/build/cjs/components/Navigation/containers/Header/index.js +25 -0
- package/build/cjs/components/Navigation/contexts/analytics.d.ts +6 -0
- package/build/cjs/components/Navigation/contexts/analytics.js +6 -0
- package/build/cjs/components/Navigation/contexts/device.d.ts +5 -0
- package/build/cjs/components/Navigation/contexts/device.js +6 -0
- package/build/cjs/components/Navigation/contexts/location.d.ts +9 -0
- package/build/cjs/components/Navigation/contexts/location.js +6 -0
- package/build/cjs/components/Navigation/contexts/mobile.d.ts +3 -0
- package/build/cjs/components/Navigation/contexts/mobile.js +6 -0
- package/build/cjs/components/Navigation/contexts/navigation-section.d.ts +3 -0
- package/build/cjs/components/Navigation/contexts/navigation-section.js +6 -0
- package/build/cjs/components/Navigation/contexts/route-change.d.ts +3 -0
- package/build/cjs/components/Navigation/contexts/route-change.js +6 -0
- package/build/cjs/components/Navigation/contexts/theme.d.ts +4 -0
- package/build/cjs/components/Navigation/contexts/theme.js +7 -0
- package/build/cjs/components/Navigation/index.d.ts +4 -0
- package/build/cjs/components/Navigation/index.js +7 -0
- package/build/cjs/components/Navigation/models.d.ts +89 -0
- package/build/cjs/components/Navigation/models.js +22 -0
- package/build/cjs/components/Navigation/styles/mixins.css +0 -0
- package/build/cjs/components/Navigation/styles/variables.css +14 -0
- package/build/cjs/components/Navigation/utils.d.ts +18 -0
- package/build/cjs/components/Navigation/utils.js +32 -0
- package/build/cjs/components/index.d.ts +2 -0
- package/build/cjs/components/index.js +5 -0
- package/build/cjs/constants.d.ts +3 -0
- package/build/cjs/constants.js +6 -0
- package/build/cjs/context/mobileContext/MobileContext.d.ts +2 -0
- package/build/cjs/context/mobileContext/MobileContext.js +6 -0
- package/build/cjs/context/mobileContext/index.d.ts +1 -0
- package/build/cjs/context/mobileContext/index.js +4 -0
- package/build/cjs/context/theme/ThemeContext.d.ts +10 -0
- package/build/cjs/context/theme/ThemeContext.js +15 -0
- package/build/cjs/context/theme/index.d.ts +3 -0
- package/build/cjs/context/theme/index.js +6 -0
- package/build/cjs/context/theme/useTheme.d.ts +2 -0
- package/build/cjs/context/theme/useTheme.js +11 -0
- package/build/cjs/context/theme/withTheme.d.ts +6 -0
- package/build/cjs/context/theme/withTheme.js +19 -0
- package/build/cjs/hooks/useIsCurrentPage.d.ts +1 -0
- package/build/cjs/hooks/useIsCurrentPage.js +13 -0
- package/build/cjs/hooks/useIsIPhone.d.ts +1 -0
- package/build/cjs/hooks/useIsIPhone.js +10 -0
- package/build/cjs/i18n.d.ts +2 -0
- package/build/cjs/i18n.js +12 -0
- package/build/cjs/index.d.ts +2 -0
- package/build/cjs/index.js +8 -0
- package/build/cjs/models/index.d.ts +3 -0
- package/build/cjs/models/index.js +2 -0
- package/build/cjs/utils/FocusTrap.d.ts +10 -0
- package/build/cjs/utils/FocusTrap.js +105 -0
- package/build/cjs/utils/cn.d.ts +5 -0
- package/build/cjs/utils/cn.js +9 -0
- package/build/cjs/utils/configure.d.ts +12 -0
- package/build/cjs/utils/configure.js +26 -0
- package/build/cjs/utils/registerKeyset.d.ts +5 -0
- package/build/cjs/utils/registerKeyset.js +9 -0
- package/build/esm/components/EnrichedLink/EnrichedLink.css +94 -0
- package/build/esm/components/EnrichedLink/EnrichedLink.d.ts +18 -0
- package/build/esm/components/EnrichedLink/EnrichedLink.js +34 -0
- package/build/esm/components/Navigation/components/ButtonsContainer/ButtonsContainer.css +12 -0
- package/build/esm/components/Navigation/components/ButtonsContainer/ButtonsContainer.d.ts +16 -0
- package/build/esm/components/Navigation/components/ButtonsContainer/ButtonsContainer.js +13 -0
- package/build/esm/components/Navigation/components/LangSwitch/LangSwitch.css +62 -0
- package/build/esm/components/Navigation/components/LangSwitch/LangSwitchPopup/LangSwitchPopup.css +62 -0
- package/build/esm/components/Navigation/components/LangSwitch/LangSwitchPopup/LangSwitchPopup.d.ts +8 -0
- package/build/esm/components/Navigation/components/LangSwitch/LangSwitchPopup/LangSwitchPopup.js +19 -0
- package/build/esm/components/Navigation/components/LangSwitch/index.d.ts +18 -0
- package/build/esm/components/Navigation/components/LangSwitch/index.js +23 -0
- package/build/esm/components/Navigation/components/Logo/Logo.css +53 -0
- package/build/esm/components/Navigation/components/Logo/Logo.d.ts +10 -0
- package/build/esm/components/Navigation/components/Logo/Logo.js +13 -0
- package/build/esm/components/Navigation/components/Logo/i18n/en.json +4 -0
- package/build/esm/components/Navigation/components/Logo/i18n/index.d.ts +2 -0
- package/build/esm/components/Navigation/components/Logo/i18n/index.js +5 -0
- package/build/esm/components/Navigation/components/Logo/i18n/ru.json +4 -0
- package/build/esm/components/Navigation/components/MobileNavigation/MobileNavigation.css +47 -0
- package/build/esm/components/Navigation/components/MobileNavigation/MobileNavigation.d.ts +17 -0
- package/build/esm/components/Navigation/components/MobileNavigation/MobileNavigation.js +22 -0
- package/build/esm/components/Navigation/components/MobileNavigation/MobileNavigationItem/MobileNavigationItem.css +75 -0
- package/build/esm/components/Navigation/components/MobileNavigation/MobileNavigationItem/MobileNavigationItem.d.ts +8 -0
- package/build/esm/components/Navigation/components/MobileNavigation/MobileNavigationItem/MobileNavigationItem.js +41 -0
- package/build/esm/components/Navigation/components/MobileNavigation/MobileNavigationPopup/MobileNavigationPopup.css +55 -0
- package/build/esm/components/Navigation/components/MobileNavigation/MobileNavigationPopup/MobileNavigationPopup.d.ts +10 -0
- package/build/esm/components/Navigation/components/MobileNavigation/MobileNavigationPopup/MobileNavigationPopup.js +43 -0
- package/build/esm/components/Navigation/components/Navigation/Navigation.css +28 -0
- package/build/esm/components/Navigation/components/Navigation/Navigation.d.ts +14 -0
- package/build/esm/components/Navigation/components/Navigation/Navigation.js +70 -0
- package/build/esm/components/Navigation/components/Navigation/NavigationItem/NavigationItem.css +81 -0
- package/build/esm/components/Navigation/components/Navigation/NavigationItem/NavigationItem.d.ts +15 -0
- package/build/esm/components/Navigation/components/Navigation/NavigationItem/NavigationItem.js +53 -0
- package/build/esm/components/Navigation/components/Navigation/NavigationItemsList/NavigationItemsList.d.ts +12 -0
- package/build/esm/components/Navigation/components/Navigation/NavigationItemsList/NavigationItemsList.js +6 -0
- package/build/esm/components/Navigation/components/Navigation/NavigationPopup/NavigationPopup.css +20 -0
- package/build/esm/components/Navigation/components/Navigation/NavigationPopup/NavigationPopup.d.ts +12 -0
- package/build/esm/components/Navigation/components/Navigation/NavigationPopup/NavigationPopup.js +16 -0
- package/build/esm/components/Navigation/components/Navigation/NavigationPopupItem/NavigationPopupItem.css +111 -0
- package/build/esm/components/Navigation/components/Navigation/NavigationPopupItem/NavigationPopupItem.d.ts +13 -0
- package/build/esm/components/Navigation/components/Navigation/NavigationPopupItem/NavigationPopupItem.js +42 -0
- package/build/esm/components/Navigation/components/SearchNotFound/SearchNotFound.css +7 -0
- package/build/esm/components/Navigation/components/SearchNotFound/SearchNotFound.d.ts +9 -0
- package/build/esm/components/Navigation/components/SearchNotFound/SearchNotFound.js +18 -0
- package/build/esm/components/Navigation/components/SearchNotFound/i18n/en.json +4 -0
- package/build/esm/components/Navigation/components/SearchNotFound/i18n/index.d.ts +2 -0
- package/build/esm/components/Navigation/components/SearchNotFound/i18n/index.js +5 -0
- package/build/esm/components/Navigation/components/SearchNotFound/i18n/ru.json +4 -0
- package/build/esm/components/Navigation/components/SearchResult/SearchResult.css +8 -0
- package/build/esm/components/Navigation/components/SearchResult/SearchResult.d.ts +11 -0
- package/build/esm/components/Navigation/components/SearchResult/SearchResult.js +21 -0
- package/build/esm/components/Navigation/components/SearchResult/i18n/en.json +12 -0
- package/build/esm/components/Navigation/components/SearchResult/i18n/index.d.ts +2 -0
- package/build/esm/components/Navigation/components/SearchResult/i18n/index.js +5 -0
- package/build/esm/components/Navigation/components/SearchResult/i18n/ru.json +11 -0
- package/build/esm/components/Navigation/components/Tag/Tag.css +21 -0
- package/build/esm/components/Navigation/components/Tag/Tag.d.ts +7 -0
- package/build/esm/components/Navigation/components/Tag/Tag.js +18 -0
- package/build/esm/components/Navigation/components/popups/LargePopup/LargePopup.css +71 -0
- package/build/esm/components/Navigation/components/popups/LargePopup/LargePopup.d.ts +7 -0
- package/build/esm/components/Navigation/components/popups/LargePopup/LargePopup.js +74 -0
- package/build/esm/components/Navigation/components/popups/MediumPopup/MediumPopup.css +6 -0
- package/build/esm/components/Navigation/components/popups/MediumPopup/MediumPopup.d.ts +8 -0
- package/build/esm/components/Navigation/components/popups/MediumPopup/MediumPopup.js +12 -0
- package/build/esm/components/Navigation/components/popups/MediumPopupWithCategories/MediumPopupWithCategories.css +37 -0
- package/build/esm/components/Navigation/components/popups/MediumPopupWithCategories/MediumPopupWithCategories.d.ts +8 -0
- package/build/esm/components/Navigation/components/popups/MediumPopupWithCategories/MediumPopupWithCategories.js +50 -0
- package/build/esm/components/Navigation/components/popups/MediumPopupWithFloors/MediumPopupWithFloors.css +7 -0
- package/build/esm/components/Navigation/components/popups/MediumPopupWithFloors/MediumPopupWithFloors.d.ts +8 -0
- package/build/esm/components/Navigation/components/popups/MediumPopupWithFloors/MediumPopupWithFloors.js +14 -0
- package/build/esm/components/Navigation/components/popups/components/PopupCategory/PopupCategory.css +43 -0
- package/build/esm/components/Navigation/components/popups/components/PopupCategory/PopupCategory.d.ts +10 -0
- package/build/esm/components/Navigation/components/popups/components/PopupCategory/PopupCategory.js +9 -0
- package/build/esm/components/Navigation/components/popups/components/PopupGroup/PopupGroup.css +27 -0
- package/build/esm/components/Navigation/components/popups/components/PopupGroup/PopupGroup.d.ts +12 -0
- package/build/esm/components/Navigation/components/popups/components/PopupGroup/PopupGroup.js +18 -0
- package/build/esm/components/Navigation/components/popups/components/PopupSecondaryGroup/PopupSecondaryGroup.css +17 -0
- package/build/esm/components/Navigation/components/popups/components/PopupSecondaryGroup/PopupSecondaryGroup.d.ts +9 -0
- package/build/esm/components/Navigation/components/popups/components/PopupSecondaryGroup/PopupSecondaryGroup.js +17 -0
- package/build/esm/components/Navigation/components/popups/components/PopupTitle/PopupTitle.d.ts +4 -0
- package/build/esm/components/Navigation/components/popups/components/PopupTitle/PopupTitle.js +14 -0
- package/build/esm/components/Navigation/components/popups/components/Search/Search.css +38 -0
- package/build/esm/components/Navigation/components/popups/components/Search/Search.d.ts +18 -0
- package/build/esm/components/Navigation/components/popups/components/Search/Search.js +45 -0
- package/build/esm/components/Navigation/components/popups/components/Search/i18n/en.json +5 -0
- package/build/esm/components/Navigation/components/popups/components/Search/i18n/index.d.ts +2 -0
- package/build/esm/components/Navigation/components/popups/components/Search/i18n/index.js +5 -0
- package/build/esm/components/Navigation/components/popups/components/Search/i18n/ru.json +5 -0
- package/build/esm/components/Navigation/constants.d.ts +7 -0
- package/build/esm/components/Navigation/constants.js +8 -0
- package/build/esm/components/Navigation/containers/Footer/Footer.css +104 -0
- package/build/esm/components/Navigation/containers/Footer/Footer.d.ts +4 -0
- package/build/esm/components/Navigation/containers/Footer/Footer.js +54 -0
- package/build/esm/components/Navigation/containers/Footer/GroupLinks/GroupLinks.css +68 -0
- package/build/esm/components/Navigation/containers/Footer/GroupLinks/GroupLinks.d.ts +13 -0
- package/build/esm/components/Navigation/containers/Footer/GroupLinks/GroupLinks.js +13 -0
- package/build/esm/components/Navigation/containers/Footer/index.d.ts +3 -0
- package/build/esm/components/Navigation/containers/Footer/index.js +3 -0
- package/build/esm/components/Navigation/containers/Footer/models.d.ts +23 -0
- package/build/esm/components/Navigation/containers/Footer/models.js +1 -0
- package/build/esm/components/Navigation/containers/Footer/variables.css +7 -0
- package/build/esm/components/Navigation/containers/Header/Header.css +172 -0
- package/build/esm/components/Navigation/containers/Header/Header.d.ts +19 -0
- package/build/esm/components/Navigation/containers/Header/Header.js +113 -0
- package/build/esm/components/Navigation/containers/Header/index.d.ts +15 -0
- package/build/esm/components/Navigation/containers/Header/index.js +21 -0
- package/build/esm/components/Navigation/contexts/analytics.d.ts +6 -0
- package/build/esm/components/Navigation/contexts/analytics.js +2 -0
- package/build/esm/components/Navigation/contexts/device.d.ts +5 -0
- package/build/esm/components/Navigation/contexts/device.js +2 -0
- package/build/esm/components/Navigation/contexts/location.d.ts +9 -0
- package/build/esm/components/Navigation/contexts/location.js +2 -0
- package/build/esm/components/Navigation/contexts/mobile.d.ts +3 -0
- package/build/esm/components/Navigation/contexts/mobile.js +2 -0
- package/build/esm/components/Navigation/contexts/navigation-section.d.ts +3 -0
- package/build/esm/components/Navigation/contexts/navigation-section.js +2 -0
- package/build/esm/components/Navigation/contexts/route-change.d.ts +3 -0
- package/build/esm/components/Navigation/contexts/route-change.js +2 -0
- package/build/esm/components/Navigation/contexts/theme.d.ts +4 -0
- package/build/esm/components/Navigation/contexts/theme.js +3 -0
- package/build/esm/components/Navigation/index.d.ts +4 -0
- package/build/esm/components/Navigation/index.js +4 -0
- package/build/esm/components/Navigation/models.d.ts +89 -0
- package/build/esm/components/Navigation/models.js +19 -0
- package/build/esm/components/Navigation/styles/mixins.css +0 -0
- package/build/esm/components/Navigation/styles/variables.css +14 -0
- package/build/esm/components/Navigation/utils.d.ts +18 -0
- package/build/esm/components/Navigation/utils.js +25 -0
- package/build/esm/components/index.d.ts +2 -0
- package/build/esm/components/index.js +2 -0
- package/build/esm/constants.d.ts +3 -0
- package/build/esm/constants.js +3 -0
- package/build/esm/context/mobileContext/MobileContext.d.ts +2 -0
- package/build/esm/context/mobileContext/MobileContext.js +2 -0
- package/build/esm/context/mobileContext/index.d.ts +1 -0
- package/build/esm/context/mobileContext/index.js +1 -0
- package/build/esm/context/theme/ThemeContext.d.ts +10 -0
- package/build/esm/context/theme/ThemeContext.js +11 -0
- package/build/esm/context/theme/index.d.ts +3 -0
- package/build/esm/context/theme/index.js +3 -0
- package/build/esm/context/theme/useTheme.d.ts +2 -0
- package/build/esm/context/theme/useTheme.js +6 -0
- package/build/esm/context/theme/withTheme.d.ts +6 -0
- package/build/esm/context/theme/withTheme.js +14 -0
- package/build/esm/hooks/useIsCurrentPage.d.ts +1 -0
- package/build/esm/hooks/useIsCurrentPage.js +8 -0
- package/build/esm/hooks/useIsIPhone.d.ts +1 -0
- package/build/esm/hooks/useIsIPhone.js +6 -0
- package/build/esm/i18n.d.ts +2 -0
- package/build/esm/i18n.js +9 -0
- package/build/esm/index.d.ts +2 -0
- package/build/esm/index.js +3 -0
- package/build/esm/models/index.d.ts +3 -0
- package/build/esm/models/index.js +1 -0
- package/build/esm/utils/FocusTrap.d.ts +10 -0
- package/build/esm/utils/FocusTrap.js +99 -0
- package/build/esm/utils/cn.d.ts +5 -0
- package/build/esm/utils/cn.js +6 -0
- package/build/esm/utils/configure.d.ts +12 -0
- package/build/esm/utils/configure.js +20 -0
- package/build/esm/utils/registerKeyset.d.ts +5 -0
- package/build/esm/utils/registerKeyset.js +5 -0
- package/package.json +152 -0
- package/styles/.gitkeep +0 -0
- package/styles/mixins.scss +1 -0
- package/styles/storybook/common.scss +37 -0
- package/styles/storybook/index.scss +20 -0
- package/styles/storybook/palette.scss +75 -0
- package/styles/storybook/typography.scss +139 -0
- package/styles/styles.css +1 -0
- package/styles/styles.scss +1 -0
- package/styles/variables.scss +3 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-addons-header {
|
|
4
|
+
--g-scrollbar-width: 8px;
|
|
5
|
+
--g-color-scroll-handle: var(--g-color-base-generic);
|
|
6
|
+
--g-color-scroll-handle-hover: var(--g-color-line-generic);
|
|
7
|
+
position: relative;
|
|
8
|
+
width: 100%;
|
|
9
|
+
max-width: min(100% - 32px, 1296px);
|
|
10
|
+
margin: 0 auto;
|
|
11
|
+
padding: 12px 32px 0 32px;
|
|
12
|
+
background: var(--pc-transparent);
|
|
13
|
+
border-radius: var(--pc-addons-navigation-border-radius);
|
|
14
|
+
z-index: calc(var(--pc-addons-navigation-popup-z-index) + 1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pc-addons-header_with-background {
|
|
18
|
+
background: var(--g-color-base-background);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.pc-addons-header_with-background.pc-addons-header_with-shadow {
|
|
22
|
+
box-shadow: 0 4px 24px var(--g-color-base-generic);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.pc-addons-header_one-row {
|
|
26
|
+
padding-bottom: 12px;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
.pc-addons-header__container {
|
|
30
|
+
display: flex;
|
|
31
|
+
justify-content: space-between;
|
|
32
|
+
height: 36px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.pc-addons-header__left, .pc-addons-header__right {
|
|
36
|
+
display: flex;
|
|
37
|
+
align-items: center;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.pc-addons-header__left {
|
|
41
|
+
margin-right: 32px;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.pc-addons-header__right {
|
|
45
|
+
justify-content: flex-end;
|
|
46
|
+
width: 100%;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.pc-addons-header__icons-container {
|
|
50
|
+
width: 100%;
|
|
51
|
+
display: flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: flex-end;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.pc-addons-header__buttons {
|
|
57
|
+
display: flex;
|
|
58
|
+
margin-left: 8px;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.pc-addons-header__icon {
|
|
62
|
+
color: var(--g-color-text-hint);
|
|
63
|
+
transition: color 0.2s;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.pc-addons-header__user {
|
|
67
|
+
margin-left: 12px;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
@media (max-width: 768px) {
|
|
71
|
+
.pc-addons-header__user {
|
|
72
|
+
display: none;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
.pc-addons-header__back {
|
|
76
|
+
position: relative;
|
|
77
|
+
left: 2px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.pc-addons-header__back-icon {
|
|
81
|
+
color: var(--g-color-text-hint);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
.pc-addons-header__back {
|
|
85
|
+
display: none;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.pc-addons-header__back:hover:before {
|
|
89
|
+
background: none;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.pc-addons-header__back:hover .pc-addons-header__icon {
|
|
93
|
+
color: var(--g-color-text-complementary);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.pc-addons-header__scroller {
|
|
97
|
+
margin-top: 12px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
@media (max-width: 768px) {
|
|
101
|
+
.pc-addons-header__scroller {
|
|
102
|
+
display: none;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
.pc-addons-header__popup {
|
|
106
|
+
--yc-popup-border-width: 0;
|
|
107
|
+
--yc-popup-border-color: none;
|
|
108
|
+
border-radius: var(--pc-addons-navigation-border-radius);
|
|
109
|
+
box-shadow: 0 3px 10px var(--g-color-base-generic-hover);
|
|
110
|
+
--yc-popover-max-width: 1296px;
|
|
111
|
+
--yc-popover-padding: 20px;
|
|
112
|
+
width: var(--yc-popover-max-width);
|
|
113
|
+
left: 0;
|
|
114
|
+
box-shadow: 0 4px 24px var(--g-color-base-generic-hover), 0 2px 8px var(--g-color-base-generic-hover);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.pc-addons-header__popup_with-background {
|
|
118
|
+
border-radius: 0 0 var(--pc-addons-navigation-border-radius) var(--pc-addons-navigation-border-radius);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.pc-addons-header__scroll-arrow {
|
|
122
|
+
height: var(--pc-addons-arrow-size);
|
|
123
|
+
color: var(--g-color-text-hint);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
.pc-addons-header__user-popup {
|
|
127
|
+
--yc-popup-border-width: 0;
|
|
128
|
+
--yc-popup-border-color: none;
|
|
129
|
+
border-radius: var(--g-border-radius-m);
|
|
130
|
+
box-shadow: 0 3px 10px var(--g-color-base-generic-hover);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@media (max-width: 1081px) {
|
|
134
|
+
.pc-addons-header__left {
|
|
135
|
+
margin-right: 0;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
@media (min-width: 769px) {
|
|
139
|
+
.pc-addons-header__logo-img {
|
|
140
|
+
height: 30px;
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
@media (max-width: 768px) {
|
|
144
|
+
.pc-addons-header {
|
|
145
|
+
max-width: 100%;
|
|
146
|
+
padding: 16px 40px 16px 48px;
|
|
147
|
+
border-top-left-radius: 0;
|
|
148
|
+
border-top-right-radius: 0;
|
|
149
|
+
}
|
|
150
|
+
.pc-addons-header__left {
|
|
151
|
+
margin-right: 12px;
|
|
152
|
+
}
|
|
153
|
+
.pc-addons-header__icons-container {
|
|
154
|
+
flex-direction: row-reverse;
|
|
155
|
+
justify-content: flex-start;
|
|
156
|
+
}
|
|
157
|
+
.pc-addons-header_search .pc-addons-header__logo {
|
|
158
|
+
display: none;
|
|
159
|
+
}
|
|
160
|
+
.pc-addons-header_search .pc-addons-header__back {
|
|
161
|
+
display: block;
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
@media (max-width: 576px) {
|
|
165
|
+
.pc-addons-header {
|
|
166
|
+
padding-left: 24px;
|
|
167
|
+
padding-right: 16px;
|
|
168
|
+
}
|
|
169
|
+
.pc-addons-header__container {
|
|
170
|
+
height: 36px;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ClassNameProps } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
+
import { NavigationData, SetupRouteChangeHandler } from '../../models';
|
|
4
|
+
import './Header.css';
|
|
5
|
+
export declare const MOBILE_ICON_SIZE = 24;
|
|
6
|
+
export interface CustomElements {
|
|
7
|
+
left?: ReactNode;
|
|
8
|
+
right?: ReactNode;
|
|
9
|
+
actions?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export interface HeaderProps extends ClassNameProps {
|
|
12
|
+
data: NavigationData;
|
|
13
|
+
customElements?: CustomElements;
|
|
14
|
+
renderSearch?: (props: {
|
|
15
|
+
onActiveToggle: (isActive: boolean) => void;
|
|
16
|
+
}) => ReactNode;
|
|
17
|
+
setupRouteChangeHandler?: SetupRouteChangeHandler;
|
|
18
|
+
}
|
|
19
|
+
export declare const Header: ({ data, customElements, setupRouteChangeHandler, renderSearch, className, }: HeaderProps) => React.JSX.Element;
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React, { useCallback, useContext, useEffect, useMemo, useRef, useState, } from 'react';
|
|
3
|
+
import { OverflowScroller } from '@doyourjob/gravity-ui-page-constructor';
|
|
4
|
+
import { ChevronLeft } from '@gravity-ui/icons';
|
|
5
|
+
import { Button, Icon } from '@gravity-ui/uikit';
|
|
6
|
+
import { block } from '../../../../utils/cn';
|
|
7
|
+
import { ButtonsContainer } from '../../components/ButtonsContainer/ButtonsContainer';
|
|
8
|
+
import { LangSwitch } from '../../components/LangSwitch';
|
|
9
|
+
import Logo from '../../components/Logo/Logo';
|
|
10
|
+
import { MobileNavigation } from '../../components/MobileNavigation/MobileNavigation';
|
|
11
|
+
import { Navigation } from '../../components/Navigation/Navigation';
|
|
12
|
+
import { AnalyticsContext } from '../../contexts/analytics';
|
|
13
|
+
import { MobileContext } from '../../contexts/mobile';
|
|
14
|
+
import { RouteChangeHandlerContext } from '../../contexts/route-change';
|
|
15
|
+
import { ThemeContext } from '../../contexts/theme';
|
|
16
|
+
import './Header.css';
|
|
17
|
+
const b = block('header');
|
|
18
|
+
export const MOBILE_ICON_SIZE = 24;
|
|
19
|
+
export const Header = ({ data, customElements, setupRouteChangeHandler, renderSearch, className, }) => {
|
|
20
|
+
const { logo, langSwitchItems, buttons: buttonConfigs, navigation } = data;
|
|
21
|
+
const headerRef = useRef(null);
|
|
22
|
+
const [withBackground, setWithBackground] = useState(false);
|
|
23
|
+
const [withShadow, setWithShadow] = useState(true);
|
|
24
|
+
const [isSearchMode, setIsSearchMode] = useState(false);
|
|
25
|
+
const [isPopupOpen, setIsPopupOpen] = useState(false);
|
|
26
|
+
const [isMobileNavigationOpen, setIsMobileNavigationOpen] = useState(false);
|
|
27
|
+
const [pageHasScroll, setPageHasScroll] = useState(false);
|
|
28
|
+
const langSwitchActiveItem = useMemo(() => langSwitchItems === null || langSwitchItems === void 0 ? void 0 : langSwitchItems.find(({ active }) => active), [langSwitchItems]);
|
|
29
|
+
const { left, right, actions } = customElements || {};
|
|
30
|
+
const analytics = useContext(AnalyticsContext);
|
|
31
|
+
const isMobile = useContext(MobileContext);
|
|
32
|
+
const theme = useContext(ThemeContext);
|
|
33
|
+
const buttons = buttonConfigs === null || buttonConfigs === void 0 ? void 0 : buttonConfigs.map((_a) => {
|
|
34
|
+
var { analyticsEvents } = _a, button = __rest(_a, ["analyticsEvents"]);
|
|
35
|
+
return (Object.assign(Object.assign({}, button), { onClick: analyticsEvents
|
|
36
|
+
? () => {
|
|
37
|
+
var _a;
|
|
38
|
+
(_a = analytics === null || analytics === void 0 ? void 0 : analytics.sendEvents) === null || _a === void 0 ? void 0 : _a.call(analytics, Array.isArray(analyticsEvents) ? analyticsEvents : [analyticsEvents]);
|
|
39
|
+
}
|
|
40
|
+
: undefined }));
|
|
41
|
+
});
|
|
42
|
+
const showButtonsContainer = isMobile
|
|
43
|
+
? !navigation && buttons && buttons.length === 1
|
|
44
|
+
: Boolean(buttons);
|
|
45
|
+
const toggleSearch = useCallback((isActive) => setIsSearchMode(isActive), []);
|
|
46
|
+
const handleOpenPopup = useCallback(() => {
|
|
47
|
+
setIsPopupOpen(true);
|
|
48
|
+
}, []);
|
|
49
|
+
const handleClosePopup = useCallback(() => {
|
|
50
|
+
setIsPopupOpen(false);
|
|
51
|
+
}, []);
|
|
52
|
+
const toggleMobileNavigationPopup = useCallback((isOpened) => {
|
|
53
|
+
setIsMobileNavigationOpen(isOpened);
|
|
54
|
+
// disable header's shadow on mobile with opened menu and if page was scrolled
|
|
55
|
+
if (isOpened && pageHasScroll) {
|
|
56
|
+
setWithShadow(false);
|
|
57
|
+
}
|
|
58
|
+
}, [pageHasScroll]);
|
|
59
|
+
const onMenuScroll = useCallback((scrollTop) => {
|
|
60
|
+
// enable header's shadow on mobile if mobile menu started to scroll
|
|
61
|
+
setWithShadow(scrollTop > 0);
|
|
62
|
+
if (!pageHasScroll) {
|
|
63
|
+
setWithBackground(scrollTop > 0);
|
|
64
|
+
}
|
|
65
|
+
}, [pageHasScroll]);
|
|
66
|
+
useEffect(() => {
|
|
67
|
+
const onScroll = () => {
|
|
68
|
+
const scrollTop = window.pageYOffset;
|
|
69
|
+
if (scrollTop === 0 && withBackground) {
|
|
70
|
+
setWithBackground(false);
|
|
71
|
+
}
|
|
72
|
+
else if (scrollTop > 0 && !withBackground) {
|
|
73
|
+
setWithBackground(true);
|
|
74
|
+
}
|
|
75
|
+
if (scrollTop === 0 && pageHasScroll) {
|
|
76
|
+
setPageHasScroll(false);
|
|
77
|
+
}
|
|
78
|
+
else if (scrollTop > 0 && !pageHasScroll) {
|
|
79
|
+
setPageHasScroll(true);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
window.addEventListener('scroll', onScroll);
|
|
83
|
+
onScroll();
|
|
84
|
+
});
|
|
85
|
+
useEffect(() => setupRouteChangeHandler === null || setupRouteChangeHandler === void 0 ? void 0 : setupRouteChangeHandler(() => {
|
|
86
|
+
handleClosePopup();
|
|
87
|
+
setIsMobileNavigationOpen(false);
|
|
88
|
+
}), [setupRouteChangeHandler, handleClosePopup]);
|
|
89
|
+
return (React.createElement(RouteChangeHandlerContext.Provider, { value: setupRouteChangeHandler },
|
|
90
|
+
React.createElement("header", { className: b({
|
|
91
|
+
'with-background': withBackground,
|
|
92
|
+
'with-shadow': withShadow,
|
|
93
|
+
search: isSearchMode,
|
|
94
|
+
'open-popup': isPopupOpen,
|
|
95
|
+
'one-row': !navigation,
|
|
96
|
+
}, className), ref: headerRef },
|
|
97
|
+
React.createElement("div", { className: b('container') },
|
|
98
|
+
React.createElement("div", { className: b('left') },
|
|
99
|
+
logo && (React.createElement(Logo, Object.assign({}, logo, { theme: theme, className: b('logo'), imageClassName: b('logo-img') }))),
|
|
100
|
+
isMobile && (React.createElement(Button, { view: "flat", size: "l", className: b('back') },
|
|
101
|
+
React.createElement(Icon, { data: ChevronLeft, size: MOBILE_ICON_SIZE }))),
|
|
102
|
+
left),
|
|
103
|
+
React.createElement("div", { className: b('right') },
|
|
104
|
+
React.createElement("div", { className: b('icons-container') },
|
|
105
|
+
renderSearch && renderSearch({ onActiveToggle: toggleSearch }),
|
|
106
|
+
langSwitchItems && (React.createElement(LangSwitch, { text: langSwitchActiveItem === null || langSwitchActiveItem === void 0 ? void 0 : langSwitchActiveItem.title, iconClassName: b('icon'), isSearchMode: isSearchMode, items: langSwitchItems, showText: !isMobile, isMobile: isMobile }))),
|
|
107
|
+
showButtonsContainer && (React.createElement(ButtonsContainer, { buttons: buttons, className: b('buttons') }, actions)),
|
|
108
|
+
right,
|
|
109
|
+
navigation ? (React.createElement(MobileNavigation, { toogleOpen: toggleMobileNavigationPopup, isOpened: isMobileNavigationOpen, isSearchOpen: isSearchMode, data: navigation, buttons: buttons, onMenuScroll: onMenuScroll, popupClassName: b('user-popup'), customElements: customElements })) : null)),
|
|
110
|
+
navigation ? (React.createElement("div", { className: b('scroller') },
|
|
111
|
+
React.createElement(OverflowScroller, { arrowClassName: b('scroll-arrow'), arrowSize: 14 },
|
|
112
|
+
React.createElement(Navigation, { data: navigation, headerRef: headerRef, handleOpenPopup: handleOpenPopup, handleClosePopup: handleClosePopup, withBackground: withBackground })))) : null)));
|
|
113
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { AnalyticsContextProps } from '../../contexts/analytics';
|
|
3
|
+
import { DeviceContextProps } from '../../contexts/device';
|
|
4
|
+
import { LocationContextProps } from '../../contexts/location';
|
|
5
|
+
import { MobileContextProps } from '../../contexts/mobile';
|
|
6
|
+
import { ThemeContextProps } from '../../contexts/theme';
|
|
7
|
+
import { HeaderProps as HeaderComponentProps } from './Header';
|
|
8
|
+
export interface HeaderProps extends HeaderComponentProps {
|
|
9
|
+
isMobile?: MobileContextProps;
|
|
10
|
+
location?: LocationContextProps;
|
|
11
|
+
analytics?: AnalyticsContextProps;
|
|
12
|
+
device?: DeviceContextProps;
|
|
13
|
+
theme?: ThemeContextProps;
|
|
14
|
+
}
|
|
15
|
+
export declare const Header: (props: HeaderProps) => React.JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { __rest } from "tslib";
|
|
2
|
+
import React, { Fragment } from 'react';
|
|
3
|
+
import { AnalyticsContext, Theme } from '@doyourjob/gravity-ui-page-constructor';
|
|
4
|
+
import { DeviceContext } from '../../contexts/device';
|
|
5
|
+
import { LocationContext } from '../../contexts/location';
|
|
6
|
+
import { MobileContext } from '../../contexts/mobile';
|
|
7
|
+
import { ThemeContext } from '../../contexts/theme';
|
|
8
|
+
import { Header as HeaderComponent } from './Header';
|
|
9
|
+
export const Header = (props) => {
|
|
10
|
+
const { isMobile, theme = Theme.Light, location = {}, analytics = {}, device = {} } = props, rest = __rest(props, ["isMobile", "theme", "location", "analytics", "device"]);
|
|
11
|
+
/* eslint-disable react/jsx-key */
|
|
12
|
+
const context = [
|
|
13
|
+
React.createElement(ThemeContext.Provider, { value: theme }),
|
|
14
|
+
React.createElement(LocationContext.Provider, { value: location }),
|
|
15
|
+
React.createElement(MobileContext.Provider, { value: Boolean(isMobile) }),
|
|
16
|
+
React.createElement(DeviceContext.Provider, { value: device }),
|
|
17
|
+
React.createElement(AnalyticsContext.Provider, { value: analytics }),
|
|
18
|
+
].reduceRight((prev, provider) => React.cloneElement(provider, {}, prev), React.createElement(HeaderComponent, Object.assign({}, rest)));
|
|
19
|
+
/* eslint-enable react/jsx-key */
|
|
20
|
+
return React.createElement(Fragment, null, context);
|
|
21
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { AnalyticsEvent as PCAnalyticsEvent } from '@doyourjob/gravity-ui-page-constructor';
|
|
2
|
+
import type { ButtonProps, LinkProps } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
+
import { SVGIconData } from '@gravity-ui/uikit/build/esm/components/Icon/types';
|
|
4
|
+
export declare enum AnalyticsEventType {
|
|
5
|
+
ItemClick = "item-click",
|
|
6
|
+
PopupItemClick = "popup-item-click"
|
|
7
|
+
}
|
|
8
|
+
export declare enum NavigationItemType {
|
|
9
|
+
LargePopup = "large-popup",
|
|
10
|
+
MediumPopup = "medium-popup",
|
|
11
|
+
MediumPopupWithCategories = "medium-popup-with-categories",
|
|
12
|
+
MediumPopupWithFloors = "medium-popup-with-floors",
|
|
13
|
+
Link = "link"
|
|
14
|
+
}
|
|
15
|
+
export declare enum NavigationTagColor {
|
|
16
|
+
Green = "green",
|
|
17
|
+
Yellow = "yellow",
|
|
18
|
+
Blue = "blue"
|
|
19
|
+
}
|
|
20
|
+
export interface LogoData {
|
|
21
|
+
href?: string;
|
|
22
|
+
src?: string;
|
|
23
|
+
width?: number;
|
|
24
|
+
title?: string;
|
|
25
|
+
text?: string;
|
|
26
|
+
alt?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface LangSwitchItem {
|
|
29
|
+
title: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
url?: string;
|
|
32
|
+
active?: boolean;
|
|
33
|
+
icon?: SVGIconData;
|
|
34
|
+
}
|
|
35
|
+
export interface NavigationData {
|
|
36
|
+
navigation: NavigationSectionData[];
|
|
37
|
+
logo: LogoData;
|
|
38
|
+
buttons: ButtonProps[];
|
|
39
|
+
langSwitchItems?: LangSwitchItem[];
|
|
40
|
+
}
|
|
41
|
+
export interface AnalyticsEvent extends PCAnalyticsEvent {
|
|
42
|
+
params?: Partial<Record<string, string>>;
|
|
43
|
+
}
|
|
44
|
+
export type SetupRouteChangeHandler = (handler: () => void) => void;
|
|
45
|
+
export interface NavigationTag {
|
|
46
|
+
text: string;
|
|
47
|
+
color?: string;
|
|
48
|
+
textColor?: string;
|
|
49
|
+
size?: 's' | 'm';
|
|
50
|
+
}
|
|
51
|
+
export interface NavigationItem {
|
|
52
|
+
title: string;
|
|
53
|
+
slug: string;
|
|
54
|
+
url: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
icon?: string;
|
|
57
|
+
image?: string | null;
|
|
58
|
+
tag?: NavigationTag;
|
|
59
|
+
}
|
|
60
|
+
export interface CategoryGroupData {
|
|
61
|
+
title?: string;
|
|
62
|
+
items: NavigationItem[];
|
|
63
|
+
imageSize?: 's' | 'xm' | 'm';
|
|
64
|
+
url?: string;
|
|
65
|
+
showItemDescriptions?: 'yes' | 'no';
|
|
66
|
+
showItemIcons?: 'yes' | 'no';
|
|
67
|
+
backgroundColor?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface CategoryData {
|
|
70
|
+
slug: string;
|
|
71
|
+
title: string;
|
|
72
|
+
description?: string;
|
|
73
|
+
groups: CategoryGroupData[];
|
|
74
|
+
}
|
|
75
|
+
export interface CategorizedPopupData {
|
|
76
|
+
categories: Record<string, CategoryData>;
|
|
77
|
+
}
|
|
78
|
+
export interface PopupData {
|
|
79
|
+
groups: CategoryGroupData[];
|
|
80
|
+
}
|
|
81
|
+
export interface NavigationSectionData {
|
|
82
|
+
title: string;
|
|
83
|
+
data?: PopupData | CategorizedPopupData;
|
|
84
|
+
type: NavigationItemType;
|
|
85
|
+
section?: string;
|
|
86
|
+
link?: LinkProps;
|
|
87
|
+
links?: LinkProps[];
|
|
88
|
+
placeholder?: string;
|
|
89
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export var AnalyticsEventType;
|
|
2
|
+
(function (AnalyticsEventType) {
|
|
3
|
+
AnalyticsEventType["ItemClick"] = "item-click";
|
|
4
|
+
AnalyticsEventType["PopupItemClick"] = "popup-item-click";
|
|
5
|
+
})(AnalyticsEventType || (AnalyticsEventType = {}));
|
|
6
|
+
export var NavigationItemType;
|
|
7
|
+
(function (NavigationItemType) {
|
|
8
|
+
NavigationItemType["LargePopup"] = "large-popup";
|
|
9
|
+
NavigationItemType["MediumPopup"] = "medium-popup";
|
|
10
|
+
NavigationItemType["MediumPopupWithCategories"] = "medium-popup-with-categories";
|
|
11
|
+
NavigationItemType["MediumPopupWithFloors"] = "medium-popup-with-floors";
|
|
12
|
+
NavigationItemType["Link"] = "link";
|
|
13
|
+
})(NavigationItemType || (NavigationItemType = {}));
|
|
14
|
+
export var NavigationTagColor;
|
|
15
|
+
(function (NavigationTagColor) {
|
|
16
|
+
NavigationTagColor["Green"] = "green";
|
|
17
|
+
NavigationTagColor["Yellow"] = "yellow";
|
|
18
|
+
NavigationTagColor["Blue"] = "blue";
|
|
19
|
+
})(NavigationTagColor || (NavigationTagColor = {}));
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--pc-addons-navigation-header-height: 64px;
|
|
3
|
+
--pc-addons-navigation-search-input-indent: 10px;
|
|
4
|
+
--pc-addons-navigation-popup-padding: 7px;
|
|
5
|
+
--pc-addons-navigation-popup-z-index: 99;
|
|
6
|
+
--pc-addons-arrow-size: 20px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.g-root {
|
|
10
|
+
--pc-addons-navigation-color-tag-yellow: var(--g-color-base-warning-light);
|
|
11
|
+
--pc-addons-navigation-color-tag-green: var(--g-color-base-positive-light);
|
|
12
|
+
--pc-addons-navigation-color-tag-blue: var(--g-color-base-info-light);
|
|
13
|
+
--pc-addons-navigation-border-radius: var(--pc-border-radius, 24px);
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NavigationItem } from './models';
|
|
2
|
+
export declare const getIconSize: (isMobile?: boolean) => 16 | 24;
|
|
3
|
+
export declare const SERVICES_PREFIX = "services";
|
|
4
|
+
export declare const SOLUTIONS_PREFIX = "solutions";
|
|
5
|
+
export interface MobileLargePopupDataItem {
|
|
6
|
+
id: number;
|
|
7
|
+
description: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
url: string;
|
|
10
|
+
title: string;
|
|
11
|
+
}
|
|
12
|
+
export interface MobileLargePopupData {
|
|
13
|
+
items: MobileLargePopupDataItem[];
|
|
14
|
+
}
|
|
15
|
+
export type NaviationItemsMap = Record<string, NavigationItem[]>;
|
|
16
|
+
export declare const getHeaderHeight: (isMobile: boolean) => 68 | 94;
|
|
17
|
+
export declare function getFlatList(dataByKeys: NaviationItemsMap, key?: keyof NavigationItem): NavigationItem[];
|
|
18
|
+
export declare function applySearch(searchRaw: string, navigationItems: NavigationItem[]): NavigationItem[];
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export const getIconSize = (isMobile) => {
|
|
2
|
+
return isMobile ? 24 : 16;
|
|
3
|
+
};
|
|
4
|
+
export const SERVICES_PREFIX = 'services';
|
|
5
|
+
export const SOLUTIONS_PREFIX = 'solutions';
|
|
6
|
+
export const getHeaderHeight = (isMobile) => {
|
|
7
|
+
return isMobile ? 68 : 94;
|
|
8
|
+
};
|
|
9
|
+
export function getFlatList(dataByKeys, key = 'slug') {
|
|
10
|
+
const navigationItems = {};
|
|
11
|
+
Object.values(dataByKeys).forEach((dataByKey) => {
|
|
12
|
+
dataByKey.forEach((data) => {
|
|
13
|
+
if (data[key]) {
|
|
14
|
+
navigationItems[data[key]] = data;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
return Object.values(navigationItems);
|
|
19
|
+
}
|
|
20
|
+
export function applySearch(searchRaw, navigationItems) {
|
|
21
|
+
const search = searchRaw.toLowerCase();
|
|
22
|
+
return navigationItems.filter(({ title, slug, description }) => (title && title.toLowerCase().includes(search)) ||
|
|
23
|
+
slug.includes(search) ||
|
|
24
|
+
(description && description.toLowerCase().includes(search)));
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MobileContext';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MobileContext';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare enum Theme {
|
|
3
|
+
Light = "light",
|
|
4
|
+
Dark = "dark"
|
|
5
|
+
}
|
|
6
|
+
export interface ThemeContextProps {
|
|
7
|
+
theme: Theme;
|
|
8
|
+
}
|
|
9
|
+
export declare const initialValue: ThemeContextProps;
|
|
10
|
+
export declare const ThemeContext: React.Context<ThemeContextProps>;
|