@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,41 @@
|
|
|
1
|
+
import React, { Fragment, useCallback, useContext, useMemo, useState } from 'react';
|
|
2
|
+
import { Foldable, ToggleArrow, getLinkProps } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
+
import { block } from '../../../../../utils/cn';
|
|
4
|
+
import { LocationContext } from '../../../contexts/location';
|
|
5
|
+
import { NavigationItemType, } from '../../../models';
|
|
6
|
+
import './MobileNavigationItem.css';
|
|
7
|
+
const b = block('mobile-navigation-item');
|
|
8
|
+
export const MobileNavigationItem = ({ data }) => {
|
|
9
|
+
const { hostname } = useContext(LocationContext) || {};
|
|
10
|
+
const { type, link, title, links } = data;
|
|
11
|
+
const linkProps = link && getLinkProps(link === null || link === void 0 ? void 0 : link.url, hostname, link === null || link === void 0 ? void 0 : link.target);
|
|
12
|
+
const [isOpened, setIsOpened] = useState(false);
|
|
13
|
+
const toggleOpen = useCallback(() => {
|
|
14
|
+
setIsOpened(!isOpened);
|
|
15
|
+
}, [isOpened]);
|
|
16
|
+
const sectionItemsData = useMemo(() => !link && pickData(data), [data, link]);
|
|
17
|
+
return link ? (React.createElement("a", Object.assign({}, linkProps, { href: link.url, className: b({ type }) }), title)) : (React.createElement(Fragment, null,
|
|
18
|
+
React.createElement("div", { className: b({ opened: isOpened }), onClick: toggleOpen },
|
|
19
|
+
React.createElement("div", { className: b('text') }, title),
|
|
20
|
+
React.createElement("div", { className: b('arrow') },
|
|
21
|
+
React.createElement(ToggleArrow, { size: 12, type: "vertical", open: isOpened, iconType: "navigation" }))),
|
|
22
|
+
React.createElement(Foldable, { isOpened: isOpened }, sectionItemsData &&
|
|
23
|
+
sectionItemsData.map(({ title: itemTitle, items }) => (React.createElement("div", { className: b('list'), key: items[0].title },
|
|
24
|
+
itemTitle && React.createElement("h5", { className: b('list-title') }, itemTitle),
|
|
25
|
+
React.createElement("ul", { className: b('list-items') }, items.map((linkItem) => (React.createElement("li", { className: b('li'), key: linkItem.title },
|
|
26
|
+
React.createElement("a", { href: linkItem.url, className: b('list-item') }, linkItem.title))))), links === null || links === void 0 ? void 0 :
|
|
27
|
+
links.map((itemLink) => (React.createElement("a", { href: itemLink.url, className: b('list-link'), key: itemLink.url }, itemLink.text)))))))));
|
|
28
|
+
};
|
|
29
|
+
function pickData({ type, data }) {
|
|
30
|
+
if (type === NavigationItemType.LargePopup) {
|
|
31
|
+
return [
|
|
32
|
+
{
|
|
33
|
+
items: Object.values(data.categories).map(({ groups }) => ({
|
|
34
|
+
title: groups[0].title,
|
|
35
|
+
url: groups[0].url,
|
|
36
|
+
})),
|
|
37
|
+
},
|
|
38
|
+
];
|
|
39
|
+
}
|
|
40
|
+
return data.groups;
|
|
41
|
+
}
|
|
@@ -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,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './MobileNavigationPopup.css';
|
|
3
|
+
interface MobileNavigationPopupProps {
|
|
4
|
+
isOpened: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
onMenuScroll: (scrollTop: number) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const MobileNavigationPopup: ({ isOpened, onClose, children, onMenuScroll, }: MobileNavigationPopupProps) => React.ReactPortal | null;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { OutsideClick } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
+
import { useBodyScrollLock } from '@gravity-ui/uikit';
|
|
4
|
+
import ReactDOM from 'react-dom';
|
|
5
|
+
import { CSSTransition } from 'react-transition-group';
|
|
6
|
+
import { block } from '../../../../../utils/cn';
|
|
7
|
+
import './MobileNavigationPopup.css';
|
|
8
|
+
const b = block('mobile-navigation-popup');
|
|
9
|
+
const TRANSITION_TIME = 400;
|
|
10
|
+
const POPUP_MARGIN = 80;
|
|
11
|
+
const HEADER_HEIGHT = 68;
|
|
12
|
+
export const MobileNavigationPopup = ({ isOpened, onClose, children, onMenuScroll, }) => {
|
|
13
|
+
const [body, setBody] = useState();
|
|
14
|
+
const ref = useRef(null);
|
|
15
|
+
const [containerHeight, setContainerHeight] = useState(0);
|
|
16
|
+
const handleScroll = useCallback(() => {
|
|
17
|
+
var _a;
|
|
18
|
+
const containerScrollTop = (_a = ref === null || ref === void 0 ? void 0 : ref.current) === null || _a === void 0 ? void 0 : _a.scrollTop;
|
|
19
|
+
if (typeof containerScrollTop !== 'undefined') {
|
|
20
|
+
onMenuScroll(containerScrollTop);
|
|
21
|
+
}
|
|
22
|
+
}, [onMenuScroll]);
|
|
23
|
+
useBodyScrollLock({ enabled: isOpened });
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
setBody(document.body);
|
|
26
|
+
setContainerHeight((window === null || window === void 0 ? void 0 : window.innerHeight) - POPUP_MARGIN - HEADER_HEIGHT);
|
|
27
|
+
const element = ref.current;
|
|
28
|
+
if (element) {
|
|
29
|
+
element.addEventListener('scroll', handleScroll);
|
|
30
|
+
}
|
|
31
|
+
return () => {
|
|
32
|
+
if (element) {
|
|
33
|
+
element.removeEventListener('scroll', handleScroll);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}, [handleScroll, isOpened]);
|
|
37
|
+
if (!body) {
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
return ReactDOM.createPortal(React.createElement(CSSTransition, { in: isOpened, classNames: b('transition'), unmountOnExit: true, timeout: TRANSITION_TIME },
|
|
41
|
+
React.createElement(OutsideClick, { className: b(), onOutsideClick: onClose },
|
|
42
|
+
React.createElement("div", { ref: ref, className: b('container'), style: { maxHeight: `${containerHeight}px` } }, children))), body);
|
|
43
|
+
};
|
|
@@ -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,14 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { NavigationSectionData, SetupRouteChangeHandler } from '../../models';
|
|
4
|
+
import './Navigation.css';
|
|
5
|
+
interface NavigationProps {
|
|
6
|
+
data: NavigationSectionData[];
|
|
7
|
+
withBackground: boolean;
|
|
8
|
+
handleOpenPopup: () => void;
|
|
9
|
+
handleClosePopup: () => void;
|
|
10
|
+
headerRef?: RefObject<HTMLDivElement>;
|
|
11
|
+
setupRouteChangeHandler?: SetupRouteChangeHandler;
|
|
12
|
+
}
|
|
13
|
+
export declare const Navigation: ({ data, headerRef, handleOpenPopup, handleClosePopup, withBackground, setupRouteChangeHandler, }: NavigationProps) => React.JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
2
|
+
import { block } from '../../../../utils/cn';
|
|
3
|
+
import { NO_MENU_TAB_SELECTED, SWITCH_MENU_TAB_TIMEOUT } from '../../constants';
|
|
4
|
+
import { NavigationSectionContext } from '../../contexts/navigation-section';
|
|
5
|
+
import { NavigationItemType, } from '../../models';
|
|
6
|
+
import { LargePopup } from '../popups/LargePopup/LargePopup';
|
|
7
|
+
import { MediumPopup } from '../popups/MediumPopup/MediumPopup';
|
|
8
|
+
import { MediumPopupWithCategories } from '../popups/MediumPopupWithCategories/MediumPopupWithCategories';
|
|
9
|
+
import { MediumPopupWithFloors } from '../popups/MediumPopupWithFloors/MediumPopupWithFloors';
|
|
10
|
+
import { NavigationItem } from './NavigationItem/NavigationItem';
|
|
11
|
+
import { NavigationPopup } from './NavigationPopup/NavigationPopup';
|
|
12
|
+
import './Navigation.css';
|
|
13
|
+
const b = block('navigation');
|
|
14
|
+
const tooltipPrefixId = 'navigation-item-key';
|
|
15
|
+
const getPopupContent = (sectionData) => {
|
|
16
|
+
const { type, data } = sectionData;
|
|
17
|
+
switch (type) {
|
|
18
|
+
case NavigationItemType.LargePopup:
|
|
19
|
+
return React.createElement(LargePopup, Object.assign({}, sectionData));
|
|
20
|
+
case NavigationItemType.MediumPopup:
|
|
21
|
+
return React.createElement(MediumPopup, { data: data });
|
|
22
|
+
case NavigationItemType.MediumPopupWithCategories:
|
|
23
|
+
return React.createElement(MediumPopupWithCategories, { data: data });
|
|
24
|
+
case NavigationItemType.MediumPopupWithFloors:
|
|
25
|
+
return React.createElement(MediumPopupWithFloors, { data: data });
|
|
26
|
+
default:
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
export const Navigation = ({ data, headerRef, handleOpenPopup, handleClosePopup, withBackground, setupRouteChangeHandler, }) => {
|
|
31
|
+
const [activeTab, setActiveTab] = useState(NO_MENU_TAB_SELECTED);
|
|
32
|
+
const [pretendentActiveTab, setPretendentAciveTab] = useState(NO_MENU_TAB_SELECTED);
|
|
33
|
+
const [previouslyFocusedElement, setPreviouslyFocusedElement] = useState(null);
|
|
34
|
+
const handleActiveTab = useCallback((currentIndex) => {
|
|
35
|
+
setPreviouslyFocusedElement(document.activeElement);
|
|
36
|
+
setPretendentAciveTab(currentIndex);
|
|
37
|
+
}, []);
|
|
38
|
+
const onEscapeKeyDown = useCallback((event) => {
|
|
39
|
+
if (event.key === 'Escape') {
|
|
40
|
+
setActiveTab(NO_MENU_TAB_SELECTED);
|
|
41
|
+
setPretendentAciveTab(NO_MENU_TAB_SELECTED);
|
|
42
|
+
previouslyFocusedElement === null || previouslyFocusedElement === void 0 ? void 0 : previouslyFocusedElement.focus();
|
|
43
|
+
}
|
|
44
|
+
}, [previouslyFocusedElement]);
|
|
45
|
+
useEffect(() => setupRouteChangeHandler === null || setupRouteChangeHandler === void 0 ? void 0 : setupRouteChangeHandler(() => {
|
|
46
|
+
handleActiveTab(NO_MENU_TAB_SELECTED);
|
|
47
|
+
}), [setupRouteChangeHandler, handleActiveTab]);
|
|
48
|
+
useEffect(() => {
|
|
49
|
+
const timerId = setTimeout(() => {
|
|
50
|
+
setActiveTab(pretendentActiveTab);
|
|
51
|
+
}, SWITCH_MENU_TAB_TIMEOUT);
|
|
52
|
+
return () => clearTimeout(timerId);
|
|
53
|
+
}, [activeTab, pretendentActiveTab]);
|
|
54
|
+
useEffect(() => {
|
|
55
|
+
document.addEventListener('keydown', onEscapeKeyDown);
|
|
56
|
+
return () => {
|
|
57
|
+
document.removeEventListener('keydown', onEscapeKeyDown);
|
|
58
|
+
};
|
|
59
|
+
}, [onEscapeKeyDown]);
|
|
60
|
+
return (React.createElement("nav", null,
|
|
61
|
+
React.createElement("ul", { className: b() }, data.map((item, i) => {
|
|
62
|
+
const { type, section } = item;
|
|
63
|
+
const isMediumPopup = type === NavigationItemType.MediumPopup ||
|
|
64
|
+
type === NavigationItemType.MediumPopupWithCategories;
|
|
65
|
+
const popupClassName = isMediumPopup ? b('popup', { medium: true }) : undefined;
|
|
66
|
+
const uniqId = `${tooltipPrefixId}-${i}`;
|
|
67
|
+
return (React.createElement(NavigationSectionContext.Provider, { value: section, key: item.title },
|
|
68
|
+
React.createElement(NavigationItem, { item: item, handleActiveTab: handleActiveTab, handleClosePopup: handleClosePopup, handleOpenPopup: handleOpenPopup, index: i, isActive: activeTab === i, tooltipId: uniqId }, activeTab === i && type !== NavigationItemType.Link && (React.createElement(NavigationPopup, { withBackground: withBackground, headerRef: headerRef, className: popupClassName, id: uniqId }, getPopupContent(item))))));
|
|
69
|
+
}))));
|
|
70
|
+
};
|
package/build/esm/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/esm/components/Navigation/components/Navigation/NavigationItem/NavigationItem.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FC, ReactNode } from 'react';
|
|
2
|
+
import { NavigationSectionData } from '../../../models';
|
|
3
|
+
import './NavigationItem.css';
|
|
4
|
+
interface NavigationItemOwnProps {
|
|
5
|
+
index: number;
|
|
6
|
+
item: NavigationSectionData;
|
|
7
|
+
isActive: boolean;
|
|
8
|
+
handleOpenPopup: () => void;
|
|
9
|
+
handleClosePopup: () => void;
|
|
10
|
+
handleActiveTab: (currentIndex: number) => void;
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
tooltipId?: string;
|
|
13
|
+
}
|
|
14
|
+
export declare const NavigationItem: FC<NavigationItemOwnProps>;
|
|
15
|
+
export {};
|
package/build/esm/components/Navigation/components/Navigation/NavigationItem/NavigationItem.js
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import React, { useCallback, useContext, useEffect } from 'react';
|
|
2
|
+
import { getLinkProps } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
+
import { useIsCurrentPage } from '../../../../../hooks/useIsCurrentPage';
|
|
4
|
+
import { block } from '../../../../../utils/cn';
|
|
5
|
+
import { NO_MENU_TAB_SELECTED } from '../../../constants';
|
|
6
|
+
import { AnalyticsContext } from '../../../contexts/analytics';
|
|
7
|
+
import { LocationContext } from '../../../contexts/location';
|
|
8
|
+
import { RouteChangeHandlerContext } from '../../../contexts/route-change';
|
|
9
|
+
import { AnalyticsEventType, NavigationItemType } from '../../../models';
|
|
10
|
+
import './NavigationItem.css';
|
|
11
|
+
const b = block('navigation-item');
|
|
12
|
+
export const NavigationItem = ({ item, isActive, handleActiveTab, handleOpenPopup, handleClosePopup, index, children, tooltipId, }) => {
|
|
13
|
+
const { type, title, link, section } = item;
|
|
14
|
+
const setupRouteChangeHandler = useContext(RouteChangeHandlerContext);
|
|
15
|
+
const { hostname } = useContext(LocationContext);
|
|
16
|
+
const linkProps = link && getLinkProps(link === null || link === void 0 ? void 0 : link.url, hostname, link === null || link === void 0 ? void 0 : link.target);
|
|
17
|
+
const isPopupExist = type === NavigationItemType.LargePopup ||
|
|
18
|
+
type === NavigationItemType.MediumPopup ||
|
|
19
|
+
type === NavigationItemType.MediumPopupWithCategories;
|
|
20
|
+
const { sendEvents } = useContext(AnalyticsContext) || {};
|
|
21
|
+
const handleMouseEnter = useCallback(() => {
|
|
22
|
+
handleActiveTab(index);
|
|
23
|
+
if (isPopupExist) {
|
|
24
|
+
handleOpenPopup();
|
|
25
|
+
}
|
|
26
|
+
}, [handleActiveTab, handleOpenPopup, index, isPopupExist]);
|
|
27
|
+
const handleMouseLeave = useCallback(() => {
|
|
28
|
+
if (isPopupExist) {
|
|
29
|
+
handleClosePopup();
|
|
30
|
+
}
|
|
31
|
+
handleActiveTab(NO_MENU_TAB_SELECTED);
|
|
32
|
+
}, [handleActiveTab, handleClosePopup, isPopupExist]);
|
|
33
|
+
const handleOnClick = useCallback(() => {
|
|
34
|
+
sendEvents === null || sendEvents === void 0 ? void 0 : sendEvents([
|
|
35
|
+
{
|
|
36
|
+
name: AnalyticsEventType.PopupItemClick,
|
|
37
|
+
params: { url: link === null || link === void 0 ? void 0 : link.url, section },
|
|
38
|
+
},
|
|
39
|
+
]);
|
|
40
|
+
}, [link === null || link === void 0 ? void 0 : link.url, section, sendEvents]);
|
|
41
|
+
const isCurrentPage = useIsCurrentPage(link === null || link === void 0 ? void 0 : link.url);
|
|
42
|
+
useEffect(() => setupRouteChangeHandler === null || setupRouteChangeHandler === void 0 ? void 0 : setupRouteChangeHandler(() => {
|
|
43
|
+
handleMouseLeave();
|
|
44
|
+
}), [handleMouseLeave, setupRouteChangeHandler]);
|
|
45
|
+
if (type === NavigationItemType.Link) {
|
|
46
|
+
return (React.createElement("li", { key: title, className: b({ disable: !(link === null || link === void 0 ? void 0 : link.url) }), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
|
47
|
+
React.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),
|
|
48
|
+
children));
|
|
49
|
+
}
|
|
50
|
+
return (React.createElement("li", { key: title, className: b({}), onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave },
|
|
51
|
+
React.createElement("button", { className: b('text', { active: isActive, cursor: 'default' }), onClick: handleMouseEnter, "aria-expanded": isActive, "aria-controls": tooltipId }, title),
|
|
52
|
+
children));
|
|
53
|
+
};
|
|
@@ -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,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Row } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
+
import { NavigationPopupItem } from '../NavigationPopupItem/NavigationPopupItem';
|
|
4
|
+
export const NavigationItemsList = ({ items, itemClassName, className, sizes, }) => {
|
|
5
|
+
return (React.createElement(Row, { className: className }, items.map((item) => (React.createElement(NavigationPopupItem, Object.assign({}, item, { sizes: sizes, className: itemClassName, key: item.slug, hover: true }))))));
|
|
6
|
+
};
|
package/build/esm/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/esm/components/Navigation/components/Navigation/NavigationPopup/NavigationPopup.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RefObject } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import './NavigationPopup.css';
|
|
4
|
+
interface NavigationPopupProps {
|
|
5
|
+
withBackground: boolean;
|
|
6
|
+
headerRef?: RefObject<HTMLDivElement>;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
className?: string;
|
|
9
|
+
id?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare const NavigationPopup: ({ withBackground, headerRef, children, className, id, }: NavigationPopupProps) => React.ReactPortal | null;
|
|
12
|
+
export {};
|
package/build/esm/components/Navigation/components/Navigation/NavigationPopup/NavigationPopup.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Grid } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
+
import ReactDOM from 'react-dom';
|
|
4
|
+
import { FocusTrap } from '../../../../../utils/FocusTrap';
|
|
5
|
+
import { block } from '../../../../../utils/cn';
|
|
6
|
+
import './NavigationPopup.css';
|
|
7
|
+
const b = block('navigation-popup');
|
|
8
|
+
export const NavigationPopup = ({ withBackground, headerRef, children, className, id, }) => {
|
|
9
|
+
return (headerRef === null || headerRef === void 0 ? void 0 : headerRef.current)
|
|
10
|
+
? ReactDOM.createPortal(React.createElement(FocusTrap, { enabled: true },
|
|
11
|
+
React.createElement("div", {
|
|
12
|
+
// eslint-disable-next-line jsx-a11y/no-noninteractive-tabindex
|
|
13
|
+
tabIndex: 0, className: b({ ['with-background']: withBackground }, className), id: id },
|
|
14
|
+
React.createElement(Grid, { containerClass: b('grid-container') }, children))), headerRef.current)
|
|
15
|
+
: null;
|
|
16
|
+
};
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
/* use this for style redefinitions to awoid problems with
|
|
2
|
+
unpredictable css rules order in build */
|
|
3
|
+
.pc-addons-navigation-popup-item {
|
|
4
|
+
font-size: var(--g-text-body-2-font-size, var(--pc-text-body-2-font-size));
|
|
5
|
+
line-height: var(--g-text-body-2-line-height, var(--pc-text-body-2-line-height));
|
|
6
|
+
margin-bottom: 2px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.pc-addons-navigation-popup-item__content {
|
|
10
|
+
outline: none;
|
|
11
|
+
color: inherit;
|
|
12
|
+
text-decoration: none;
|
|
13
|
+
display: flex;
|
|
14
|
+
border-radius: var(--g-border-radius-xl);
|
|
15
|
+
height: 100%;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.utilityfocus .pc-addons-navigation-popup-item__content:focus {
|
|
19
|
+
outline: 2px solid #ffdb4d;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.pc-addons-navigation-popup-item__content:focus {
|
|
23
|
+
outline: 2px solid var(--g-color-line-focus);
|
|
24
|
+
outline-offset: -2px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.pc-addons-navigation-popup-item__content:focus:not(:focus-visible) {
|
|
28
|
+
outline: 0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.pc-addons-navigation-popup-item__content_padding_default {
|
|
32
|
+
padding: 12px;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.pc-addons-navigation-popup-item__content_padding_s {
|
|
36
|
+
padding: 6px 12px;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.pc-addons-navigation-popup-item__content:hover, .pc-addons-navigation-popup-item__content:active {
|
|
40
|
+
color: var(--g-color-base-brand);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.pc-addons-navigation-popup-item__content_hover:hover, .pc-addons-navigation-popup-item__content_hover:active {
|
|
44
|
+
color: inherit;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.pc-addons-navigation-popup-item__content_hover:hover {
|
|
48
|
+
background-color: var(--g-color-base-simple-hover);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.pc-addons-navigation-popup-item__content_disable {
|
|
52
|
+
pointer-events: none;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.pc-addons-navigation-popup-item__icon {
|
|
56
|
+
color: var(--g-color-base-brand);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.pc-addons-navigation-popup-item__icon-container {
|
|
60
|
+
position: absolute;
|
|
61
|
+
width: 20px;
|
|
62
|
+
height: 20px;
|
|
63
|
+
display: flex;
|
|
64
|
+
justify-content: center;
|
|
65
|
+
align-items: center;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.pc-addons-navigation-popup-item__container_with-margin {
|
|
69
|
+
margin-left: 28px;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.pc-addons-navigation-popup-item__description {
|
|
73
|
+
font-size: var(--g-text-body-1-font-size, var(--pc-text-body-1-font-size));
|
|
74
|
+
line-height: var(--g-text-body-1-line-height, var(--pc-text-body-1-line-height));
|
|
75
|
+
display: block;
|
|
76
|
+
margin-top: 2px;
|
|
77
|
+
color: var(--g-color-text-secondary);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.pc-addons-navigation-popup-item__tag {
|
|
81
|
+
position: relative;
|
|
82
|
+
top: -2px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.pc-addons-navigation-popup-item__image {
|
|
86
|
+
display: block;
|
|
87
|
+
position: relative;
|
|
88
|
+
top: 2px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.pc-addons-navigation-popup-item__image_size_m {
|
|
92
|
+
width: 18px;
|
|
93
|
+
height: 18px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.pc-addons-navigation-popup-item__image_size_xm {
|
|
97
|
+
width: 16px;
|
|
98
|
+
height: 16px;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.pc-addons-navigation-popup-item__image_size_s {
|
|
102
|
+
width: 14px;
|
|
103
|
+
height: 14px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.pc-addons-navigation-popup-item__image-container {
|
|
107
|
+
display: flex;
|
|
108
|
+
justify-content: center;
|
|
109
|
+
min-width: 20px;
|
|
110
|
+
margin-right: 8px;
|
|
111
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { GridColumnSizesType } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
+
import { NavigationItem } from '../../../models';
|
|
4
|
+
import './NavigationPopupItem.css';
|
|
5
|
+
export interface NavigationPopupItemProps extends Partial<NavigationItem> {
|
|
6
|
+
hover?: boolean;
|
|
7
|
+
sizes?: GridColumnSizesType;
|
|
8
|
+
className?: string;
|
|
9
|
+
padding?: 'default' | 's';
|
|
10
|
+
imageSize?: 's' | 'xm' | 'm';
|
|
11
|
+
target?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare const NavigationPopupItem: (props: NavigationPopupItemProps) => React.JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React, { useCallback, useContext } from 'react';
|
|
2
|
+
import { Col, HTML, Image, getLinkProps } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
+
import { Icon } from '@gravity-ui/uikit';
|
|
4
|
+
import { useIsCurrentPage } from '../../../../../hooks/useIsCurrentPage';
|
|
5
|
+
import { block } from '../../../../../utils/cn';
|
|
6
|
+
import { DefaultCategorizedItemSizes } from '../../../constants';
|
|
7
|
+
import { AnalyticsContext } from '../../../contexts/analytics';
|
|
8
|
+
import { LocationContext } from '../../../contexts/location';
|
|
9
|
+
import { NavigationSectionContext } from '../../../contexts/navigation-section';
|
|
10
|
+
import { AnalyticsEventType } from '../../../models';
|
|
11
|
+
import { NavigationTag } from '../../Tag/Tag';
|
|
12
|
+
import './NavigationPopupItem.css';
|
|
13
|
+
const b = block('navigation-popup-item');
|
|
14
|
+
export const NavigationPopupItem = (props) => {
|
|
15
|
+
const { icon, url, target, title, tag, description, image, imageSize = 'm', hover, className, sizes = DefaultCategorizedItemSizes, padding = 'default', } = props;
|
|
16
|
+
const navigationSection = useContext(NavigationSectionContext);
|
|
17
|
+
const { sendEvents } = useContext(AnalyticsContext) || {};
|
|
18
|
+
const { hostname } = useContext(LocationContext) || {};
|
|
19
|
+
const linkProps = url ? getLinkProps(url, hostname, target) : {};
|
|
20
|
+
const handleOnClick = useCallback(() => {
|
|
21
|
+
sendEvents === null || sendEvents === void 0 ? void 0 : sendEvents([
|
|
22
|
+
{
|
|
23
|
+
name: AnalyticsEventType.PopupItemClick,
|
|
24
|
+
params: { url, section: navigationSection },
|
|
25
|
+
},
|
|
26
|
+
]);
|
|
27
|
+
}, [sendEvents, navigationSection, url]);
|
|
28
|
+
const navigationTag = tag && React.createElement(NavigationTag, Object.assign({ className: b('tag'), size: "s" }, tag));
|
|
29
|
+
const isCurrentPage = useIsCurrentPage(url);
|
|
30
|
+
return (React.createElement(Col, { className: b(null, className), sizes: sizes },
|
|
31
|
+
React.createElement("a", Object.assign({ className: b('content', { hover, padding, disable: !url }), href: url }, linkProps, { onClick: handleOnClick, "aria-current": isCurrentPage ? 'page' : undefined }),
|
|
32
|
+
icon && (React.createElement("div", { className: b('icon-container') },
|
|
33
|
+
React.createElement(Icon, { className: b('icon'), data: icon, size: 16 }))),
|
|
34
|
+
image && (React.createElement("div", { className: b('image-container') },
|
|
35
|
+
React.createElement(Image, { className: b('image', { size: imageSize }), src: image }))),
|
|
36
|
+
React.createElement("div", { className: b('container', { 'with-margin': Boolean(icon) }) },
|
|
37
|
+
React.createElement("div", { className: b('title-tag-wrapper') },
|
|
38
|
+
React.createElement("span", { className: b('title') }, title),
|
|
39
|
+
"\u00A0",
|
|
40
|
+
navigationTag),
|
|
41
|
+
description && React.createElement(HTML, { className: b('description') }, description)))));
|
|
42
|
+
};
|