@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,75 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-addons-mobile-navigation-item {
|
|
4
|
+
display: flex;
|
|
5
|
+
justify-content: space-between;
|
|
6
|
+
position: relative;
|
|
7
|
+
padding: 12px 0;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.pc-addons-mobile-navigation-item_type_link {
|
|
11
|
+
color: inherit;
|
|
12
|
+
text-decoration: none;
|
|
13
|
+
display: block;
|
|
14
|
+
color: var(--g-color-text-primary);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
.pc-addons-mobile-navigation-item__arrow {
|
|
18
|
+
display: flex;
|
|
19
|
+
justify-content: center;
|
|
20
|
+
align-items: center;
|
|
21
|
+
width: var(--pc-addons-arrow-size);
|
|
22
|
+
height: var(--pc-addons-arrow-size);
|
|
23
|
+
min-width: var(--pc-addons-arrow-size);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.pc-addons-mobile-navigation-item__text {
|
|
27
|
+
padding-right: 20px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.pc-addons-mobile-navigation-item__list {
|
|
31
|
+
padding: 10px 20px;
|
|
32
|
+
background-color: var(--g-color-base-generic);
|
|
33
|
+
border-radius: var(--g-border-radius-l);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.pc-addons-mobile-navigation-item__list:not(:first-child) {
|
|
37
|
+
margin-top: 12px;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.pc-addons-mobile-navigation-item__list-items {
|
|
41
|
+
margin: 0;
|
|
42
|
+
padding: 0;
|
|
43
|
+
list-style: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.pc-addons-mobile-navigation-item__list-title {
|
|
47
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
48
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
49
|
+
margin: 0;
|
|
50
|
+
padding: 10px 0;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.pc-addons-mobile-navigation-item__list-item {
|
|
54
|
+
color: inherit;
|
|
55
|
+
text-decoration: none;
|
|
56
|
+
display: block;
|
|
57
|
+
color: var(--g-color-text-primary);
|
|
58
|
+
padding: 10px 0;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.pc-addons-mobile-navigation-item__list-item:hover, .pc-addons-mobile-navigation-item__list-item:active {
|
|
62
|
+
--pc-text-header-color: inherit;
|
|
63
|
+
color: inherit;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.pc-addons-mobile-navigation-item__list-link {
|
|
67
|
+
color: inherit;
|
|
68
|
+
text-decoration: none;
|
|
69
|
+
outline: none;
|
|
70
|
+
color: var(--g-color-text-link);
|
|
71
|
+
text-decoration: none;
|
|
72
|
+
cursor: pointer;
|
|
73
|
+
display: block;
|
|
74
|
+
padding: 10px 0;
|
|
75
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { NavigationSectionData } from '../../../models';
|
|
3
|
+
interface MobileNavigationProps {
|
|
4
|
+
data: NavigationSectionData;
|
|
5
|
+
}
|
|
6
|
+
export declare const MobileNavigationItem: ({ data }: MobileNavigationProps) => React.JSX.Element;
|
|
7
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MobileNavigationItem = 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 cn_1 = require("../../../../../utils/cn");
|
|
8
|
+
const location_1 = require("../../../contexts/location");
|
|
9
|
+
const models_1 = require("../../../models");
|
|
10
|
+
const b = (0, cn_1.block)('mobile-navigation-item');
|
|
11
|
+
const MobileNavigationItem = ({ data }) => {
|
|
12
|
+
const { hostname } = (0, react_1.useContext)(location_1.LocationContext) || {};
|
|
13
|
+
const { type, link, title, links } = data;
|
|
14
|
+
const linkProps = link && (0, gravity_ui_page_constructor_1.getLinkProps)(link === null || link === void 0 ? void 0 : link.url, hostname, link === null || link === void 0 ? void 0 : link.target);
|
|
15
|
+
const [isOpened, setIsOpened] = (0, react_1.useState)(false);
|
|
16
|
+
const toggleOpen = (0, react_1.useCallback)(() => {
|
|
17
|
+
setIsOpened(!isOpened);
|
|
18
|
+
}, [isOpened]);
|
|
19
|
+
const sectionItemsData = (0, react_1.useMemo)(() => !link && pickData(data), [data, link]);
|
|
20
|
+
return link ? (react_1.default.createElement("a", Object.assign({}, linkProps, { href: link.url, className: b({ type }) }), title)) : (react_1.default.createElement(react_1.Fragment, null,
|
|
21
|
+
react_1.default.createElement("div", { className: b({ opened: isOpened }), onClick: toggleOpen },
|
|
22
|
+
react_1.default.createElement("div", { className: b('text') }, title),
|
|
23
|
+
react_1.default.createElement("div", { className: b('arrow') },
|
|
24
|
+
react_1.default.createElement(gravity_ui_page_constructor_1.ToggleArrow, { size: 12, type: "vertical", open: isOpened, iconType: "navigation" }))),
|
|
25
|
+
react_1.default.createElement(gravity_ui_page_constructor_1.Foldable, { isOpened: isOpened }, sectionItemsData &&
|
|
26
|
+
sectionItemsData.map(({ title: itemTitle, items }) => (react_1.default.createElement("div", { className: b('list'), key: items[0].title },
|
|
27
|
+
itemTitle && react_1.default.createElement("h5", { className: b('list-title') }, itemTitle),
|
|
28
|
+
react_1.default.createElement("ul", { className: b('list-items') }, items.map((linkItem) => (react_1.default.createElement("li", { className: b('li'), key: linkItem.title },
|
|
29
|
+
react_1.default.createElement("a", { href: linkItem.url, className: b('list-item') }, linkItem.title))))), links === null || links === void 0 ? void 0 :
|
|
30
|
+
links.map((itemLink) => (react_1.default.createElement("a", { href: itemLink.url, className: b('list-link'), key: itemLink.url }, itemLink.text)))))))));
|
|
31
|
+
};
|
|
32
|
+
exports.MobileNavigationItem = MobileNavigationItem;
|
|
33
|
+
function pickData({ type, data }) {
|
|
34
|
+
if (type === models_1.NavigationItemType.LargePopup) {
|
|
35
|
+
return [
|
|
36
|
+
{
|
|
37
|
+
items: Object.values(data.categories).map(({ groups }) => ({
|
|
38
|
+
title: groups[0].title,
|
|
39
|
+
url: groups[0].url,
|
|
40
|
+
})),
|
|
41
|
+
},
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
return data.groups;
|
|
45
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-addons-mobile-navigation-popup {
|
|
4
|
+
width: 100%;
|
|
5
|
+
position: fixed;
|
|
6
|
+
top: 0;
|
|
7
|
+
z-index: var(--pc-addons-navigation-popup-z-index);
|
|
8
|
+
padding: calc(var(--pc-addons-navigation-header-height) - 16px) 0 32px;
|
|
9
|
+
background-color: var(--g-color-base-background);
|
|
10
|
+
border-radius: 0 0 var(--pc-addons-navigation-border-radius) var(--pc-addons-navigation-border-radius);
|
|
11
|
+
box-shadow: 0 3px 10px var(--g-color-base-generic);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.pc-addons-mobile-navigation-popup__transition-enter {
|
|
15
|
+
transform: translateY(-30px);
|
|
16
|
+
opacity: 0;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.pc-addons-mobile-navigation-popup__transition-enter-active {
|
|
20
|
+
transform: translateY(0);
|
|
21
|
+
opacity: 1;
|
|
22
|
+
transition: transform 0.4s, opacity 0.4s;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.pc-addons-mobile-navigation-popup__transition-exit {
|
|
26
|
+
transform: translateY(0);
|
|
27
|
+
opacity: 1;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.pc-addons-mobile-navigation-popup__transition-exit .pc-addons-mobile-navigation-popup__container {
|
|
31
|
+
opacity: 0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.pc-addons-mobile-navigation-popup__transition-exit-active {
|
|
35
|
+
transform: translateY(-30px);
|
|
36
|
+
opacity: 0;
|
|
37
|
+
transition: transform 0.4s, opacity 0.4s;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
.pc-addons-mobile-navigation-popup__no-scroll {
|
|
41
|
+
overflow: hidden;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.pc-addons-mobile-navigation-popup__container {
|
|
45
|
+
padding: 4px 48px 0;
|
|
46
|
+
overflow: scroll;
|
|
47
|
+
height: 100%;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
@media (max-width: 576px) {
|
|
51
|
+
.pc-addons-mobile-navigation-popup__container {
|
|
52
|
+
padding-left: 24px;
|
|
53
|
+
padding-right: 24px;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface MobileNavigationPopupProps {
|
|
3
|
+
isOpened: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
onMenuScroll: (scrollTop: number) => void;
|
|
7
|
+
}
|
|
8
|
+
export declare const MobileNavigationPopup: ({ isOpened, onClose, children, onMenuScroll, }: MobileNavigationPopupProps) => React.ReactPortal | null;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MobileNavigationPopup = 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 uikit_1 = require("@gravity-ui/uikit");
|
|
8
|
+
const react_dom_1 = tslib_1.__importDefault(require("react-dom"));
|
|
9
|
+
const react_transition_group_1 = require("react-transition-group");
|
|
10
|
+
const cn_1 = require("../../../../../utils/cn");
|
|
11
|
+
const b = (0, cn_1.block)('mobile-navigation-popup');
|
|
12
|
+
const TRANSITION_TIME = 400;
|
|
13
|
+
const POPUP_MARGIN = 80;
|
|
14
|
+
const HEADER_HEIGHT = 68;
|
|
15
|
+
const MobileNavigationPopup = ({ isOpened, onClose, children, onMenuScroll, }) => {
|
|
16
|
+
const [body, setBody] = (0, react_1.useState)();
|
|
17
|
+
const ref = (0, react_1.useRef)(null);
|
|
18
|
+
const [containerHeight, setContainerHeight] = (0, react_1.useState)(0);
|
|
19
|
+
const handleScroll = (0, react_1.useCallback)(() => {
|
|
20
|
+
var _a;
|
|
21
|
+
const containerScrollTop = (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.scrollTop;
|
|
22
|
+
if (typeof containerScrollTop !== 'undefined') {
|
|
23
|
+
onMenuScroll(containerScrollTop);
|
|
24
|
+
}
|
|
25
|
+
}, [onMenuScroll]);
|
|
26
|
+
(0, uikit_1.useBodyScrollLock)({ enabled: isOpened });
|
|
27
|
+
(0, react_1.useEffect)(() => {
|
|
28
|
+
setBody(document.body);
|
|
29
|
+
setContainerHeight((window === null || window === void 0 ? void 0 : window.innerHeight) - POPUP_MARGIN - HEADER_HEIGHT);
|
|
30
|
+
const element = ref.current;
|
|
31
|
+
if (element) {
|
|
32
|
+
element.addEventListener('scroll', handleScroll);
|
|
33
|
+
}
|
|
34
|
+
return () => {
|
|
35
|
+
if (element) {
|
|
36
|
+
element.removeEventListener('scroll', handleScroll);
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
}, [handleScroll, isOpened]);
|
|
40
|
+
if (!body) {
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
return react_dom_1.default.createPortal(react_1.default.createElement(react_transition_group_1.CSSTransition, { in: isOpened, classNames: b('transition'), unmountOnExit: true, timeout: TRANSITION_TIME },
|
|
44
|
+
react_1.default.createElement(gravity_ui_page_constructor_1.OutsideClick, { className: b(), onOutsideClick: onClose },
|
|
45
|
+
react_1.default.createElement("div", { ref: ref, className: b('container'), style: { maxHeight: `${containerHeight}px` } }, children))), body);
|
|
46
|
+
};
|
|
47
|
+
exports.MobileNavigationPopup = MobileNavigationPopup;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-addons-navigation {
|
|
4
|
+
margin: 0;
|
|
5
|
+
padding: 0;
|
|
6
|
+
list-style: none;
|
|
7
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
8
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
margin-left: 2px;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
@media (max-width: 768px) {
|
|
15
|
+
.pc-addons-navigation {
|
|
16
|
+
display: none;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
.pc-addons-navigation__popup_medium {
|
|
20
|
+
padding-left: 4px;
|
|
21
|
+
padding-right: 16px;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@media (max-width: 769px) {
|
|
25
|
+
.pc-addons-navigation {
|
|
26
|
+
display: none;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { NavigationSectionData, SetupRouteChangeHandler } from '../../models';
|
|
4
|
+
interface NavigationProps {
|
|
5
|
+
data: NavigationSectionData[];
|
|
6
|
+
withBackground: boolean;
|
|
7
|
+
handleOpenPopup: () => void;
|
|
8
|
+
handleClosePopup: () => void;
|
|
9
|
+
headerRef?: RefObject<HTMLDivElement>;
|
|
10
|
+
setupRouteChangeHandler?: SetupRouteChangeHandler;
|
|
11
|
+
}
|
|
12
|
+
export declare const Navigation: ({ data, headerRef, handleOpenPopup, handleClosePopup, withBackground, setupRouteChangeHandler, }: NavigationProps) => React.JSX.Element;
|
|
13
|
+
export {};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Navigation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const cn_1 = require("../../../../utils/cn");
|
|
7
|
+
const constants_1 = require("../../constants");
|
|
8
|
+
const navigation_section_1 = require("../../contexts/navigation-section");
|
|
9
|
+
const models_1 = require("../../models");
|
|
10
|
+
const LargePopup_1 = require("../popups/LargePopup/LargePopup");
|
|
11
|
+
const MediumPopup_1 = require("../popups/MediumPopup/MediumPopup");
|
|
12
|
+
const MediumPopupWithCategories_1 = require("../popups/MediumPopupWithCategories/MediumPopupWithCategories");
|
|
13
|
+
const MediumPopupWithFloors_1 = require("../popups/MediumPopupWithFloors/MediumPopupWithFloors");
|
|
14
|
+
const NavigationItem_1 = require("./NavigationItem/NavigationItem");
|
|
15
|
+
const NavigationPopup_1 = require("./NavigationPopup/NavigationPopup");
|
|
16
|
+
const b = (0, cn_1.block)('navigation');
|
|
17
|
+
const tooltipPrefixId = 'navigation-item-key';
|
|
18
|
+
const getPopupContent = (sectionData) => {
|
|
19
|
+
const { type, data } = sectionData;
|
|
20
|
+
switch (type) {
|
|
21
|
+
case models_1.NavigationItemType.LargePopup:
|
|
22
|
+
return react_1.default.createElement(LargePopup_1.LargePopup, Object.assign({}, sectionData));
|
|
23
|
+
case models_1.NavigationItemType.MediumPopup:
|
|
24
|
+
return react_1.default.createElement(MediumPopup_1.MediumPopup, { data: data });
|
|
25
|
+
case models_1.NavigationItemType.MediumPopupWithCategories:
|
|
26
|
+
return react_1.default.createElement(MediumPopupWithCategories_1.MediumPopupWithCategories, { data: data });
|
|
27
|
+
case models_1.NavigationItemType.MediumPopupWithFloors:
|
|
28
|
+
return react_1.default.createElement(MediumPopupWithFloors_1.MediumPopupWithFloors, { data: data });
|
|
29
|
+
default:
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
const Navigation = ({ data, headerRef, handleOpenPopup, handleClosePopup, withBackground, setupRouteChangeHandler, }) => {
|
|
34
|
+
const [activeTab, setActiveTab] = (0, react_1.useState)(constants_1.NO_MENU_TAB_SELECTED);
|
|
35
|
+
const [pretendentActiveTab, setPretendentAciveTab] = (0, react_1.useState)(constants_1.NO_MENU_TAB_SELECTED);
|
|
36
|
+
const [previouslyFocusedElement, setPreviouslyFocusedElement] = (0, react_1.useState)(null);
|
|
37
|
+
const handleActiveTab = (0, react_1.useCallback)((currentIndex) => {
|
|
38
|
+
setPreviouslyFocusedElement(document.activeElement);
|
|
39
|
+
setPretendentAciveTab(currentIndex);
|
|
40
|
+
}, []);
|
|
41
|
+
const onEscapeKeyDown = (0, react_1.useCallback)((event) => {
|
|
42
|
+
if (event.key === 'Escape') {
|
|
43
|
+
setActiveTab(constants_1.NO_MENU_TAB_SELECTED);
|
|
44
|
+
setPretendentAciveTab(constants_1.NO_MENU_TAB_SELECTED);
|
|
45
|
+
previouslyFocusedElement === null || previouslyFocusedElement === void 0 ? void 0 : previouslyFocusedElement.focus();
|
|
46
|
+
}
|
|
47
|
+
}, [previouslyFocusedElement]);
|
|
48
|
+
(0, react_1.useEffect)(() => setupRouteChangeHandler === null || setupRouteChangeHandler === void 0 ? void 0 : setupRouteChangeHandler(() => {
|
|
49
|
+
handleActiveTab(constants_1.NO_MENU_TAB_SELECTED);
|
|
50
|
+
}), [setupRouteChangeHandler, handleActiveTab]);
|
|
51
|
+
(0, react_1.useEffect)(() => {
|
|
52
|
+
const timerId = setTimeout(() => {
|
|
53
|
+
setActiveTab(pretendentActiveTab);
|
|
54
|
+
}, constants_1.SWITCH_MENU_TAB_TIMEOUT);
|
|
55
|
+
return () => clearTimeout(timerId);
|
|
56
|
+
}, [activeTab, pretendentActiveTab]);
|
|
57
|
+
(0, react_1.useEffect)(() => {
|
|
58
|
+
document.addEventListener('keydown', onEscapeKeyDown);
|
|
59
|
+
return () => {
|
|
60
|
+
document.removeEventListener('keydown', onEscapeKeyDown);
|
|
61
|
+
};
|
|
62
|
+
}, [onEscapeKeyDown]);
|
|
63
|
+
return (react_1.default.createElement("nav", null,
|
|
64
|
+
react_1.default.createElement("ul", { className: b() }, data.map((item, i) => {
|
|
65
|
+
const { type, section } = item;
|
|
66
|
+
const isMediumPopup = type === models_1.NavigationItemType.MediumPopup ||
|
|
67
|
+
type === models_1.NavigationItemType.MediumPopupWithCategories;
|
|
68
|
+
const popupClassName = isMediumPopup ? b('popup', { medium: true }) : undefined;
|
|
69
|
+
const uniqId = `${tooltipPrefixId}-${i}`;
|
|
70
|
+
return (react_1.default.createElement(navigation_section_1.NavigationSectionContext.Provider, { value: section, key: item.title },
|
|
71
|
+
react_1.default.createElement(NavigationItem_1.NavigationItem, { item: item, handleActiveTab: handleActiveTab, handleClosePopup: handleClosePopup, handleOpenPopup: handleOpenPopup, index: i, isActive: activeTab === i, tooltipId: uniqId }, activeTab === i && type !== models_1.NavigationItemType.Link && (react_1.default.createElement(NavigationPopup_1.NavigationPopup, { withBackground: withBackground, headerRef: headerRef, className: popupClassName, id: uniqId }, getPopupContent(item))))));
|
|
72
|
+
}))));
|
|
73
|
+
};
|
|
74
|
+
exports.Navigation = Navigation;
|
package/build/cjs/components/Navigation/components/Navigation/NavigationItem/NavigationItem.css
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-addons-navigation-item {
|
|
4
|
+
white-space: nowrap;
|
|
5
|
+
color: var(--g-color-text-primary);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
.pc-addons-navigation-item:hover .pc-addons-navigation-item__text {
|
|
9
|
+
color: var(--g-color-text-link);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
.pc-addons-navigation-item_disable {
|
|
13
|
+
pointer-events: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.pc-addons-navigation-item__popup {
|
|
17
|
+
--yc-popup-border-width: 0;
|
|
18
|
+
--yc-popup-border-color: none;
|
|
19
|
+
border-radius: var(--pc-addons-navigation-border-radius);
|
|
20
|
+
box-shadow: 0 3px 10px var(--g-color-base-generic-hover);
|
|
21
|
+
--yc-popover-max-width: 1296px;
|
|
22
|
+
--yc-popover-padding: 20px;
|
|
23
|
+
width: var(--yc-popover-max-width);
|
|
24
|
+
left: 0;
|
|
25
|
+
box-shadow: 0 4px 24px var(--g-color-base-generic-hover), 0 2px 8px var(--g-color-base-generic-hover);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.pc-addons-navigation-item__text {
|
|
29
|
+
display: inline-block;
|
|
30
|
+
margin: 0;
|
|
31
|
+
padding: 0;
|
|
32
|
+
font: inherit;
|
|
33
|
+
border: none;
|
|
34
|
+
outline: none;
|
|
35
|
+
color: inherit;
|
|
36
|
+
background: none;
|
|
37
|
+
cursor: pointer;
|
|
38
|
+
color: inherit;
|
|
39
|
+
text-decoration: none;
|
|
40
|
+
display: block;
|
|
41
|
+
margin: 0 12px;
|
|
42
|
+
padding-bottom: 12px;
|
|
43
|
+
border-bottom: 2px solid transparent;
|
|
44
|
+
color: var(--g-color-text-primary);
|
|
45
|
+
position: relative;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.pc-addons-navigation-item__text:focus::before {
|
|
49
|
+
content: "";
|
|
50
|
+
width: 100%;
|
|
51
|
+
height: calc(100% - 12px - 2px);
|
|
52
|
+
position: absolute;
|
|
53
|
+
outline: 2px solid var(--g-color-line-focus);
|
|
54
|
+
border-radius: var(--g-focus-border-radius);
|
|
55
|
+
left: 0;
|
|
56
|
+
right: 0;
|
|
57
|
+
top: 2px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.pc-addons-navigation-item__text:focus:not(:focus-visible)::before {
|
|
61
|
+
display: none;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.pc-addons-navigation-item__text_active {
|
|
65
|
+
color: var(--g-color-text-link);
|
|
66
|
+
border-color: var(--g-color-text-link);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.pc-addons-navigation-item__text_cursor_default {
|
|
70
|
+
cursor: default;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.pc-addons-navigation-item:first-child .pc-addons-navigation-item__text {
|
|
74
|
+
margin-left: 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
@media (max-width: 1296px) {
|
|
78
|
+
.pc-addons-navigation-item__popup {
|
|
79
|
+
--yc-popover-max-width: calc(100% - 32px);
|
|
80
|
+
}
|
|
81
|
+
}
|
package/build/cjs/components/Navigation/components/Navigation/NavigationItem/NavigationItem.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { FC, ReactNode } from 'react';
|
|
2
|
+
import { NavigationSectionData } from '../../../models';
|
|
3
|
+
interface NavigationItemOwnProps {
|
|
4
|
+
index: number;
|
|
5
|
+
item: NavigationSectionData;
|
|
6
|
+
isActive: boolean;
|
|
7
|
+
handleOpenPopup: () => void;
|
|
8
|
+
handleClosePopup: () => void;
|
|
9
|
+
handleActiveTab: (currentIndex: number) => void;
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
tooltipId?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const NavigationItem: FC<NavigationItemOwnProps>;
|
|
14
|
+
export {};
|
package/build/cjs/components/Navigation/components/Navigation/NavigationItem/NavigationItem.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavigationItem = 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 useIsCurrentPage_1 = require("../../../../../hooks/useIsCurrentPage");
|
|
8
|
+
const cn_1 = require("../../../../../utils/cn");
|
|
9
|
+
const constants_1 = require("../../../constants");
|
|
10
|
+
const analytics_1 = require("../../../contexts/analytics");
|
|
11
|
+
const location_1 = require("../../../contexts/location");
|
|
12
|
+
const route_change_1 = require("../../../contexts/route-change");
|
|
13
|
+
const models_1 = require("../../../models");
|
|
14
|
+
const b = (0, cn_1.block)('navigation-item');
|
|
15
|
+
const NavigationItem = ({ item, isActive, handleActiveTab, handleOpenPopup, handleClosePopup, index, children, tooltipId, }) => {
|
|
16
|
+
const { type, title, link, section } = item;
|
|
17
|
+
const setupRouteChangeHandler = (0, react_1.useContext)(route_change_1.RouteChangeHandlerContext);
|
|
18
|
+
const { hostname } = (0, react_1.useContext)(location_1.LocationContext);
|
|
19
|
+
const linkProps = link && (0, gravity_ui_page_constructor_1.getLinkProps)(link === null || link === void 0 ? void 0 : link.url, hostname, link === null || link === void 0 ? void 0 : link.target);
|
|
20
|
+
const isPopupExist = type === models_1.NavigationItemType.LargePopup ||
|
|
21
|
+
type === models_1.NavigationItemType.MediumPopup ||
|
|
22
|
+
type === models_1.NavigationItemType.MediumPopupWithCategories;
|
|
23
|
+
const { sendEvents } = (0, react_1.useContext)(analytics_1.AnalyticsContext) || {};
|
|
24
|
+
const handleMouseEnter = (0, react_1.useCallback)(() => {
|
|
25
|
+
handleActiveTab(index);
|
|
26
|
+
if (isPopupExist) {
|
|
27
|
+
handleOpenPopup();
|
|
28
|
+
}
|
|
29
|
+
}, [handleActiveTab, handleOpenPopup, index, isPopupExist]);
|
|
30
|
+
const handleMouseLeave = (0, react_1.useCallback)(() => {
|
|
31
|
+
if (isPopupExist) {
|
|
32
|
+
handleClosePopup();
|
|
33
|
+
}
|
|
34
|
+
handleActiveTab(constants_1.NO_MENU_TAB_SELECTED);
|
|
35
|
+
}, [handleActiveTab, handleClosePopup, isPopupExist]);
|
|
36
|
+
const handleOnClick = (0, react_1.useCallback)(() => {
|
|
37
|
+
sendEvents === null || sendEvents === void 0 ? void 0 : sendEvents([
|
|
38
|
+
{
|
|
39
|
+
name: models_1.AnalyticsEventType.PopupItemClick,
|
|
40
|
+
params: { url: link === null || link === void 0 ? void 0 : link.url, section },
|
|
41
|
+
},
|
|
42
|
+
]);
|
|
43
|
+
}, [link === null || link === void 0 ? void 0 : link.url, section, sendEvents]);
|
|
44
|
+
const isCurrentPage = (0, useIsCurrentPage_1.useIsCurrentPage)(link === null || link === void 0 ? void 0 : link.url);
|
|
45
|
+
(0, react_1.useEffect)(() => setupRouteChangeHandler === null || setupRouteChangeHandler === void 0 ? void 0 : setupRouteChangeHandler(() => {
|
|
46
|
+
handleMouseLeave();
|
|
47
|
+
}), [handleMouseLeave, setupRouteChangeHandler]);
|
|
48
|
+
if (type === models_1.NavigationItemType.Link) {
|
|
49
|
+
return (react_1.default.createElement("li", { key: title, className: b({ disable: !(link === null || link === void 0 ? void 0 : link.url) }), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
|
50
|
+
react_1.default.createElement("a", Object.assign({ className: b('text', { active: isActive }), href: link === null || link === void 0 ? void 0 : link.url }, linkProps, { onClick: handleOnClick, "aria-current": isCurrentPage ? 'page' : undefined }), title),
|
|
51
|
+
children));
|
|
52
|
+
}
|
|
53
|
+
return (react_1.default.createElement("li", { key: title, className: b({}), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
|
54
|
+
react_1.default.createElement("button", { className: b('text', { active: isActive, cursor: 'default' }), onClick: handleMouseEnter, "aria-expanded": isActive, "aria-controls": tooltipId }, title),
|
|
55
|
+
children));
|
|
56
|
+
};
|
|
57
|
+
exports.NavigationItem = NavigationItem;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { FC } from 'react';
|
|
2
|
+
import { GridColumnSizesType } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
+
import { NavigationItem } from '../../../models';
|
|
4
|
+
interface NavigationItemsListProps {
|
|
5
|
+
items: NavigationItem[];
|
|
6
|
+
section?: string;
|
|
7
|
+
sizes?: GridColumnSizesType;
|
|
8
|
+
itemClassName?: string;
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const NavigationItemsList: FC<NavigationItemsListProps>;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavigationItemsList = 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
|
+
const NavigationPopupItem_1 = require("../NavigationPopupItem/NavigationPopupItem");
|
|
8
|
+
const NavigationItemsList = ({ items, itemClassName, className, sizes, }) => {
|
|
9
|
+
return (react_1.default.createElement(gravity_ui_page_constructor_1.Row, { className: className }, items.map((item) => (react_1.default.createElement(NavigationPopupItem_1.NavigationPopupItem, Object.assign({}, item, { sizes: sizes, className: itemClassName, key: item.slug, hover: true }))))));
|
|
10
|
+
};
|
|
11
|
+
exports.NavigationItemsList = NavigationItemsList;
|
package/build/cjs/components/Navigation/components/Navigation/NavigationPopup/NavigationPopup.css
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
.pc-addons-navigation-popup {
|
|
2
|
+
width: calc(100% + 64px);
|
|
3
|
+
margin: 0 -32px;
|
|
4
|
+
padding: 20px 24px 24px 12px;
|
|
5
|
+
border-radius: var(--pc-addons-navigation-border-radius);
|
|
6
|
+
background: var(--g-color-base-float);
|
|
7
|
+
z-index: 10;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.pc-addons-navigation-popup:not(.pc-addons-navigation-popup_with-background) {
|
|
11
|
+
box-shadow: 0 4px 24px var(--g-color-base-generic), 0 2px 8px var(--g-color-base-generic);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.pc-addons-navigation-popup__grid-container {
|
|
15
|
+
padding: 0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.pc-addons-navigation-popup:focus {
|
|
19
|
+
outline: 0;
|
|
20
|
+
}
|
package/build/cjs/components/Navigation/components/Navigation/NavigationPopup/NavigationPopup.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface NavigationPopupProps {
|
|
4
|
+
withBackground: boolean;
|
|
5
|
+
headerRef?: RefObject<HTMLDivElement>;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
className?: string;
|
|
8
|
+
id?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare const NavigationPopup: ({ withBackground, headerRef, children, className, id, }: NavigationPopupProps) => React.ReactPortal | null;
|
|
11
|
+
export {};
|
package/build/cjs/components/Navigation/components/Navigation/NavigationPopup/NavigationPopup.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavigationPopup = 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
|
+
const react_dom_1 = tslib_1.__importDefault(require("react-dom"));
|
|
8
|
+
const FocusTrap_1 = require("../../../../../utils/FocusTrap");
|
|
9
|
+
const cn_1 = require("../../../../../utils/cn");
|
|
10
|
+
const b = (0, cn_1.block)('navigation-popup');
|
|
11
|
+
const NavigationPopup = ({ withBackground, headerRef, children, className, id, }) => {
|
|
12
|
+
return (headerRef === null || headerRef === void 0 ? void 0 : headerRef.current)
|
|
13
|
+
? react_dom_1.default.createPortal(react_1.default.createElement(FocusTrap_1.FocusTrap, { enabled: true },
|
|
14
|
+
react_1.default.createElement("div", {
|
|
15
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
16
|
+
tabIndex: 0, className: b({ ['with-background']: withBackground }, className), id: id },
|
|
17
|
+
react_1.default.createElement(gravity_ui_page_constructor_1.Grid, { containerClass: b('grid-container') }, children))), headerRef.current)
|
|
18
|
+
: null;
|
|
19
|
+
};
|
|
20
|
+
exports.NavigationPopup = NavigationPopup;
|