@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,68 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
:root {
|
|
4
|
+
--footer-margin-xs: 12px;
|
|
5
|
+
--footer-margin-s: 16px;
|
|
6
|
+
--footer-margin-m: 24px;
|
|
7
|
+
--footer-margin-l: 32px;
|
|
8
|
+
--footer-margin-xl: 48px;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.pc-addons-group-links {
|
|
12
|
+
display: flex;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.pc-addons-group-links__group {
|
|
16
|
+
margin: 0;
|
|
17
|
+
padding: 0;
|
|
18
|
+
list-style: none;
|
|
19
|
+
flex: 1;
|
|
20
|
+
width: 100%;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.pc-addons-group-links__group:not(:first-child) {
|
|
24
|
+
margin-left: 8px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.pc-addons-group-links__group-title {
|
|
28
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
29
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
30
|
+
color: var(--g-color-text-primary);
|
|
31
|
+
margin-bottom: var(--footer-margin-s);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.pc-addons-group-links__item-wrapper {
|
|
35
|
+
margin-bottom: var(--footer-margin-s);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.pc-addons-group-links__item-wrapper:last-of-type {
|
|
39
|
+
margin-bottom: 0;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.pc-addons-group-links__item {
|
|
43
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
44
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.pc-addons-group-links__item:focus {
|
|
48
|
+
outline: 2px solid var(--g-color-line-focus);
|
|
49
|
+
outline-offset: 0;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.pc-addons-group-links__item:focus:not(:focus-visible) {
|
|
53
|
+
outline: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.pc-addons-group-links__item_underline:not(:last-child) {
|
|
57
|
+
margin-right: var(--footer-margin-m);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.pc-addons-group-links__item_social:not(:last-child) {
|
|
61
|
+
margin-right: 8px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
@media (max-width: 769px) {
|
|
65
|
+
.pc-addons-group-links__item_underline:not(:last-child) {
|
|
66
|
+
margin-bottom: var(--footer-margin-s);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { EnrichedLinkProps } from '../../../../EnrichedLink/EnrichedLink';
|
|
3
|
+
export interface GroupLinksProps {
|
|
4
|
+
columnGroup: GroupLinkColumn;
|
|
5
|
+
className?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface GroupLinkColumn {
|
|
8
|
+
title?: string;
|
|
9
|
+
items: EnrichedLinkProps[];
|
|
10
|
+
}
|
|
11
|
+
declare const GroupLinks: ({ columnGroup: { title, items }, className }: GroupLinksProps) => React.JSX.Element;
|
|
12
|
+
export default GroupLinks;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const cn_1 = require("../../../../../utils/cn");
|
|
6
|
+
const EnrichedLink_1 = require("../../../../EnrichedLink/EnrichedLink");
|
|
7
|
+
const b = (0, cn_1.block)('group-links');
|
|
8
|
+
const GroupLinks = ({ columnGroup: { title, items }, className }) => {
|
|
9
|
+
return (react_1.default.createElement("div", { className: b(null, className), key: title },
|
|
10
|
+
react_1.default.createElement("ul", { className: b('group') },
|
|
11
|
+
title && react_1.default.createElement("h5", { className: b('group-title') }, title),
|
|
12
|
+
items.map((item) => (react_1.default.createElement("li", { key: item.title, className: b('item-wrapper') },
|
|
13
|
+
react_1.default.createElement(EnrichedLink_1.EnrichedLink, Object.assign({ className: b('item') }, item))))))));
|
|
14
|
+
};
|
|
15
|
+
exports.default = GroupLinks;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./Footer"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./GroupLinks/GroupLinks"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./models"), exports);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ClassNameProps } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
+
import type { EnrichedLinkProps } from '../../../EnrichedLink/EnrichedLink';
|
|
4
|
+
import { LangSwitchProps } from '../../components/LangSwitch';
|
|
5
|
+
import type { GroupLinkColumn } from './GroupLinks/GroupLinks';
|
|
6
|
+
export type FooterType = 'simple' | 'default';
|
|
7
|
+
export type FooterMedia = {
|
|
8
|
+
item: React.ReactNode;
|
|
9
|
+
md?: number;
|
|
10
|
+
position: 'left' | 'right';
|
|
11
|
+
};
|
|
12
|
+
export interface FooterProps extends ClassNameProps {
|
|
13
|
+
type?: FooterType;
|
|
14
|
+
underline?: {
|
|
15
|
+
leftItems?: EnrichedLinkProps[];
|
|
16
|
+
rightItems?: EnrichedLinkProps[];
|
|
17
|
+
copyright?: string;
|
|
18
|
+
langSwitch?: Pick<LangSwitchProps, 'text' | 'showText' | 'items'>;
|
|
19
|
+
};
|
|
20
|
+
columns?: GroupLinkColumn[][];
|
|
21
|
+
customItems?: React.ReactNode;
|
|
22
|
+
media?: FooterMedia;
|
|
23
|
+
}
|
|
@@ -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,18 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { ClassNameProps } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
+
import { NavigationData, SetupRouteChangeHandler } from '../../models';
|
|
4
|
+
export declare const MOBILE_ICON_SIZE = 24;
|
|
5
|
+
export interface CustomElements {
|
|
6
|
+
left?: ReactNode;
|
|
7
|
+
right?: ReactNode;
|
|
8
|
+
actions?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export interface HeaderProps extends ClassNameProps {
|
|
11
|
+
data: NavigationData;
|
|
12
|
+
customElements?: CustomElements;
|
|
13
|
+
renderSearch?: (props: {
|
|
14
|
+
onActiveToggle: (isActive: boolean) => void;
|
|
15
|
+
}) => ReactNode;
|
|
16
|
+
setupRouteChangeHandler?: SetupRouteChangeHandler;
|
|
17
|
+
}
|
|
18
|
+
export declare const Header: ({ data, customElements, setupRouteChangeHandler, renderSearch, className, }: HeaderProps) => React.JSX.Element;
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Header = exports.MOBILE_ICON_SIZE = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const gravity_ui_page_constructor_1 = require("@doyourjob/gravity-ui-page-constructor");
|
|
7
|
+
const icons_1 = require("@gravity-ui/icons");
|
|
8
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
9
|
+
const cn_1 = require("../../../../utils/cn");
|
|
10
|
+
const ButtonsContainer_1 = require("../../components/ButtonsContainer/ButtonsContainer");
|
|
11
|
+
const LangSwitch_1 = require("../../components/LangSwitch");
|
|
12
|
+
const Logo_1 = tslib_1.__importDefault(require("../../components/Logo/Logo"));
|
|
13
|
+
const MobileNavigation_1 = require("../../components/MobileNavigation/MobileNavigation");
|
|
14
|
+
const Navigation_1 = require("../../components/Navigation/Navigation");
|
|
15
|
+
const analytics_1 = require("../../contexts/analytics");
|
|
16
|
+
const mobile_1 = require("../../contexts/mobile");
|
|
17
|
+
const route_change_1 = require("../../contexts/route-change");
|
|
18
|
+
const theme_1 = require("../../contexts/theme");
|
|
19
|
+
const b = (0, cn_1.block)('header');
|
|
20
|
+
exports.MOBILE_ICON_SIZE = 24;
|
|
21
|
+
const Header = ({ data, customElements, setupRouteChangeHandler, renderSearch, className, }) => {
|
|
22
|
+
const { logo, langSwitchItems, buttons: buttonConfigs, navigation } = data;
|
|
23
|
+
const headerRef = (0, react_1.useRef)(null);
|
|
24
|
+
const [withBackground, setWithBackground] = (0, react_1.useState)(false);
|
|
25
|
+
const [withShadow, setWithShadow] = (0, react_1.useState)(true);
|
|
26
|
+
const [isSearchMode, setIsSearchMode] = (0, react_1.useState)(false);
|
|
27
|
+
const [isPopupOpen, setIsPopupOpen] = (0, react_1.useState)(false);
|
|
28
|
+
const [isMobileNavigationOpen, setIsMobileNavigationOpen] = (0, react_1.useState)(false);
|
|
29
|
+
const [pageHasScroll, setPageHasScroll] = (0, react_1.useState)(false);
|
|
30
|
+
const langSwitchActiveItem = (0, react_1.useMemo)(() => langSwitchItems === null || langSwitchItems === void 0 ? void 0 : langSwitchItems.find(({ active }) => active), [langSwitchItems]);
|
|
31
|
+
const { left, right, actions } = customElements || {};
|
|
32
|
+
const analytics = (0, react_1.useContext)(analytics_1.AnalyticsContext);
|
|
33
|
+
const isMobile = (0, react_1.useContext)(mobile_1.MobileContext);
|
|
34
|
+
const theme = (0, react_1.useContext)(theme_1.ThemeContext);
|
|
35
|
+
const buttons = buttonConfigs === null || buttonConfigs === void 0 ? void 0 : buttonConfigs.map((_a) => {
|
|
36
|
+
var { analyticsEvents } = _a, button = tslib_1.__rest(_a, ["analyticsEvents"]);
|
|
37
|
+
return (Object.assign(Object.assign({}, button), { onClick: analyticsEvents
|
|
38
|
+
? () => {
|
|
39
|
+
var _a;
|
|
40
|
+
(_a = analytics === null || analytics === void 0 ? void 0 : analytics.sendEvents) === null || _a === void 0 ? void 0 : _a.call(analytics, Array.isArray(analyticsEvents) ? analyticsEvents : [analyticsEvents]);
|
|
41
|
+
}
|
|
42
|
+
: undefined }));
|
|
43
|
+
});
|
|
44
|
+
const showButtonsContainer = isMobile
|
|
45
|
+
? !navigation && buttons && buttons.length === 1
|
|
46
|
+
: Boolean(buttons);
|
|
47
|
+
const toggleSearch = (0, react_1.useCallback)((isActive) => setIsSearchMode(isActive), []);
|
|
48
|
+
const handleOpenPopup = (0, react_1.useCallback)(() => {
|
|
49
|
+
setIsPopupOpen(true);
|
|
50
|
+
}, []);
|
|
51
|
+
const handleClosePopup = (0, react_1.useCallback)(() => {
|
|
52
|
+
setIsPopupOpen(false);
|
|
53
|
+
}, []);
|
|
54
|
+
const toggleMobileNavigationPopup = (0, react_1.useCallback)((isOpened) => {
|
|
55
|
+
setIsMobileNavigationOpen(isOpened);
|
|
56
|
+
// disable header's shadow on mobile with opened menu and if page was scrolled
|
|
57
|
+
if (isOpened && pageHasScroll) {
|
|
58
|
+
setWithShadow(false);
|
|
59
|
+
}
|
|
60
|
+
}, [pageHasScroll]);
|
|
61
|
+
const onMenuScroll = (0, react_1.useCallback)((scrollTop) => {
|
|
62
|
+
// enable header's shadow on mobile if mobile menu started to scroll
|
|
63
|
+
setWithShadow(scrollTop > 0);
|
|
64
|
+
if (!pageHasScroll) {
|
|
65
|
+
setWithBackground(scrollTop > 0);
|
|
66
|
+
}
|
|
67
|
+
}, [pageHasScroll]);
|
|
68
|
+
(0, react_1.useEffect)(() => {
|
|
69
|
+
const onScroll = () => {
|
|
70
|
+
const scrollTop = window.pageYOffset;
|
|
71
|
+
if (scrollTop === 0 && withBackground) {
|
|
72
|
+
setWithBackground(false);
|
|
73
|
+
}
|
|
74
|
+
else if (scrollTop > 0 && !withBackground) {
|
|
75
|
+
setWithBackground(true);
|
|
76
|
+
}
|
|
77
|
+
if (scrollTop === 0 && pageHasScroll) {
|
|
78
|
+
setPageHasScroll(false);
|
|
79
|
+
}
|
|
80
|
+
else if (scrollTop > 0 && !pageHasScroll) {
|
|
81
|
+
setPageHasScroll(true);
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
window.addEventListener('scroll', onScroll);
|
|
85
|
+
onScroll();
|
|
86
|
+
});
|
|
87
|
+
(0, react_1.useEffect)(() => setupRouteChangeHandler === null || setupRouteChangeHandler === void 0 ? void 0 : setupRouteChangeHandler(() => {
|
|
88
|
+
handleClosePopup();
|
|
89
|
+
setIsMobileNavigationOpen(false);
|
|
90
|
+
}), [setupRouteChangeHandler, handleClosePopup]);
|
|
91
|
+
return (react_1.default.createElement(route_change_1.RouteChangeHandlerContext.Provider, { value: setupRouteChangeHandler },
|
|
92
|
+
react_1.default.createElement("header", { className: b({
|
|
93
|
+
'with-background': withBackground,
|
|
94
|
+
'with-shadow': withShadow,
|
|
95
|
+
search: isSearchMode,
|
|
96
|
+
'open-popup': isPopupOpen,
|
|
97
|
+
'one-row': !navigation,
|
|
98
|
+
}, className), ref: headerRef },
|
|
99
|
+
react_1.default.createElement("div", { className: b('container') },
|
|
100
|
+
react_1.default.createElement("div", { className: b('left') },
|
|
101
|
+
logo && (react_1.default.createElement(Logo_1.default, Object.assign({}, logo, { theme: theme, className: b('logo'), imageClassName: b('logo-img') }))),
|
|
102
|
+
isMobile && (react_1.default.createElement(uikit_1.Button, { view: "flat", size: "l", className: b('back') },
|
|
103
|
+
react_1.default.createElement(uikit_1.Icon, { data: icons_1.ChevronLeft, size: exports.MOBILE_ICON_SIZE }))),
|
|
104
|
+
left),
|
|
105
|
+
react_1.default.createElement("div", { className: b('right') },
|
|
106
|
+
react_1.default.createElement("div", { className: b('icons-container') },
|
|
107
|
+
renderSearch && renderSearch({ onActiveToggle: toggleSearch }),
|
|
108
|
+
langSwitchItems && (react_1.default.createElement(LangSwitch_1.LangSwitch, { text: langSwitchActiveItem === null || langSwitchActiveItem === void 0 ? void 0 : langSwitchActiveItem.title, iconClassName: b('icon'), isSearchMode: isSearchMode, items: langSwitchItems, showText: !isMobile, isMobile: isMobile }))),
|
|
109
|
+
showButtonsContainer && (react_1.default.createElement(ButtonsContainer_1.ButtonsContainer, { buttons: buttons, className: b('buttons') }, actions)),
|
|
110
|
+
right,
|
|
111
|
+
navigation ? (react_1.default.createElement(MobileNavigation_1.MobileNavigation, { toogleOpen: toggleMobileNavigationPopup, isOpened: isMobileNavigationOpen, isSearchOpen: isSearchMode, data: navigation, buttons: buttons, onMenuScroll: onMenuScroll, popupClassName: b('user-popup'), customElements: customElements })) : null)),
|
|
112
|
+
navigation ? (react_1.default.createElement("div", { className: b('scroller') },
|
|
113
|
+
react_1.default.createElement(gravity_ui_page_constructor_1.OverflowScroller, { arrowClassName: b('scroll-arrow'), arrowSize: 14 },
|
|
114
|
+
react_1.default.createElement(Navigation_1.Navigation, { data: navigation, headerRef: headerRef, handleOpenPopup: handleOpenPopup, handleClosePopup: handleClosePopup, withBackground: withBackground })))) : null)));
|
|
115
|
+
};
|
|
116
|
+
exports.Header = Header;
|
|
@@ -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,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Header = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const gravity_ui_page_constructor_1 = require("@doyourjob/gravity-ui-page-constructor");
|
|
7
|
+
const device_1 = require("../../contexts/device");
|
|
8
|
+
const location_1 = require("../../contexts/location");
|
|
9
|
+
const mobile_1 = require("../../contexts/mobile");
|
|
10
|
+
const theme_1 = require("../../contexts/theme");
|
|
11
|
+
const Header_1 = require("./Header");
|
|
12
|
+
const Header = (props) => {
|
|
13
|
+
const { isMobile, theme = gravity_ui_page_constructor_1.Theme.Light, location = {}, analytics = {}, device = {} } = props, rest = tslib_1.__rest(props, ["isMobile", "theme", "location", "analytics", "device"]);
|
|
14
|
+
/* eslint-disable react/jsx-key */
|
|
15
|
+
const context = [
|
|
16
|
+
react_1.default.createElement(theme_1.ThemeContext.Provider, { value: theme }),
|
|
17
|
+
react_1.default.createElement(location_1.LocationContext.Provider, { value: location }),
|
|
18
|
+
react_1.default.createElement(mobile_1.MobileContext.Provider, { value: Boolean(isMobile) }),
|
|
19
|
+
react_1.default.createElement(device_1.DeviceContext.Provider, { value: device }),
|
|
20
|
+
react_1.default.createElement(gravity_ui_page_constructor_1.AnalyticsContext.Provider, { value: analytics }),
|
|
21
|
+
].reduceRight((prev, provider) => react_1.default.cloneElement(provider, {}, prev), react_1.default.createElement(Header_1.Header, Object.assign({}, rest)));
|
|
22
|
+
/* eslint-enable react/jsx-key */
|
|
23
|
+
return react_1.default.createElement(react_1.Fragment, null, context);
|
|
24
|
+
};
|
|
25
|
+
exports.Header = Header;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AnalyticsContext = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
exports.AnalyticsContext = react_1.default.createContext({});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeviceContext = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
exports.DeviceContext = react_1.default.createContext({});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LocationContext = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
exports.LocationContext = react_1.default.createContext({});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MobileContext = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
exports.MobileContext = react_1.default.createContext(false);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavigationSectionContext = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
exports.NavigationSectionContext = react_1.default.createContext(undefined);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RouteChangeHandlerContext = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
exports.RouteChangeHandlerContext = react_1.default.createContext(undefined);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThemeContext = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const gravity_ui_page_constructor_1 = require("@doyourjob/gravity-ui-page-constructor");
|
|
7
|
+
exports.ThemeContext = react_1.default.createContext(gravity_ui_page_constructor_1.Theme.Light);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./containers/Header"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./containers/Footer"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./components/LangSwitch"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./models"), exports);
|