@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,89 @@
|
|
|
1
|
+
import { AnalyticsEvent as PCAnalyticsEvent } from '@doyourjob/gravity-ui-page-constructor';
|
|
2
|
+
import type { ButtonProps, LinkProps } from '@doyourjob/gravity-ui-page-constructor';
|
|
3
|
+
import { SVGIconData } from '@gravity-ui/uikit/build/esm/components/Icon/types';
|
|
4
|
+
export declare enum AnalyticsEventType {
|
|
5
|
+
ItemClick = "item-click",
|
|
6
|
+
PopupItemClick = "popup-item-click"
|
|
7
|
+
}
|
|
8
|
+
export declare enum NavigationItemType {
|
|
9
|
+
LargePopup = "large-popup",
|
|
10
|
+
MediumPopup = "medium-popup",
|
|
11
|
+
MediumPopupWithCategories = "medium-popup-with-categories",
|
|
12
|
+
MediumPopupWithFloors = "medium-popup-with-floors",
|
|
13
|
+
Link = "link"
|
|
14
|
+
}
|
|
15
|
+
export declare enum NavigationTagColor {
|
|
16
|
+
Green = "green",
|
|
17
|
+
Yellow = "yellow",
|
|
18
|
+
Blue = "blue"
|
|
19
|
+
}
|
|
20
|
+
export interface LogoData {
|
|
21
|
+
href?: string;
|
|
22
|
+
src?: string;
|
|
23
|
+
width?: number;
|
|
24
|
+
title?: string;
|
|
25
|
+
text?: string;
|
|
26
|
+
alt?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface LangSwitchItem {
|
|
29
|
+
title: string;
|
|
30
|
+
description?: string;
|
|
31
|
+
url?: string;
|
|
32
|
+
active?: boolean;
|
|
33
|
+
icon?: SVGIconData;
|
|
34
|
+
}
|
|
35
|
+
export interface NavigationData {
|
|
36
|
+
navigation: NavigationSectionData[];
|
|
37
|
+
logo: LogoData;
|
|
38
|
+
buttons: ButtonProps[];
|
|
39
|
+
langSwitchItems?: LangSwitchItem[];
|
|
40
|
+
}
|
|
41
|
+
export interface AnalyticsEvent extends PCAnalyticsEvent {
|
|
42
|
+
params?: Partial<Record<string, string>>;
|
|
43
|
+
}
|
|
44
|
+
export type SetupRouteChangeHandler = (handler: () => void) => void;
|
|
45
|
+
export interface NavigationTag {
|
|
46
|
+
text: string;
|
|
47
|
+
color?: string;
|
|
48
|
+
textColor?: string;
|
|
49
|
+
size?: 's' | 'm';
|
|
50
|
+
}
|
|
51
|
+
export interface NavigationItem {
|
|
52
|
+
title: string;
|
|
53
|
+
slug: string;
|
|
54
|
+
url: string;
|
|
55
|
+
description?: string;
|
|
56
|
+
icon?: string;
|
|
57
|
+
image?: string | null;
|
|
58
|
+
tag?: NavigationTag;
|
|
59
|
+
}
|
|
60
|
+
export interface CategoryGroupData {
|
|
61
|
+
title?: string;
|
|
62
|
+
items: NavigationItem[];
|
|
63
|
+
imageSize?: 's' | 'xm' | 'm';
|
|
64
|
+
url?: string;
|
|
65
|
+
showItemDescriptions?: 'yes' | 'no';
|
|
66
|
+
showItemIcons?: 'yes' | 'no';
|
|
67
|
+
backgroundColor?: string;
|
|
68
|
+
}
|
|
69
|
+
export interface CategoryData {
|
|
70
|
+
slug: string;
|
|
71
|
+
title: string;
|
|
72
|
+
description?: string;
|
|
73
|
+
groups: CategoryGroupData[];
|
|
74
|
+
}
|
|
75
|
+
export interface CategorizedPopupData {
|
|
76
|
+
categories: Record<string, CategoryData>;
|
|
77
|
+
}
|
|
78
|
+
export interface PopupData {
|
|
79
|
+
groups: CategoryGroupData[];
|
|
80
|
+
}
|
|
81
|
+
export interface NavigationSectionData {
|
|
82
|
+
title: string;
|
|
83
|
+
data?: PopupData | CategorizedPopupData;
|
|
84
|
+
type: NavigationItemType;
|
|
85
|
+
section?: string;
|
|
86
|
+
link?: LinkProps;
|
|
87
|
+
links?: LinkProps[];
|
|
88
|
+
placeholder?: string;
|
|
89
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NavigationTagColor = exports.NavigationItemType = exports.AnalyticsEventType = void 0;
|
|
4
|
+
var AnalyticsEventType;
|
|
5
|
+
(function (AnalyticsEventType) {
|
|
6
|
+
AnalyticsEventType["ItemClick"] = "item-click";
|
|
7
|
+
AnalyticsEventType["PopupItemClick"] = "popup-item-click";
|
|
8
|
+
})(AnalyticsEventType = exports.AnalyticsEventType || (exports.AnalyticsEventType = {}));
|
|
9
|
+
var NavigationItemType;
|
|
10
|
+
(function (NavigationItemType) {
|
|
11
|
+
NavigationItemType["LargePopup"] = "large-popup";
|
|
12
|
+
NavigationItemType["MediumPopup"] = "medium-popup";
|
|
13
|
+
NavigationItemType["MediumPopupWithCategories"] = "medium-popup-with-categories";
|
|
14
|
+
NavigationItemType["MediumPopupWithFloors"] = "medium-popup-with-floors";
|
|
15
|
+
NavigationItemType["Link"] = "link";
|
|
16
|
+
})(NavigationItemType = exports.NavigationItemType || (exports.NavigationItemType = {}));
|
|
17
|
+
var NavigationTagColor;
|
|
18
|
+
(function (NavigationTagColor) {
|
|
19
|
+
NavigationTagColor["Green"] = "green";
|
|
20
|
+
NavigationTagColor["Yellow"] = "yellow";
|
|
21
|
+
NavigationTagColor["Blue"] = "blue";
|
|
22
|
+
})(NavigationTagColor = exports.NavigationTagColor || (exports.NavigationTagColor = {}));
|
|
File without changes
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
:root {
|
|
2
|
+
--pc-addons-navigation-header-height: 64px;
|
|
3
|
+
--pc-addons-navigation-search-input-indent: 10px;
|
|
4
|
+
--pc-addons-navigation-popup-padding: 7px;
|
|
5
|
+
--pc-addons-navigation-popup-z-index: 99;
|
|
6
|
+
--pc-addons-arrow-size: 20px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.g-root {
|
|
10
|
+
--pc-addons-navigation-color-tag-yellow: var(--g-color-base-warning-light);
|
|
11
|
+
--pc-addons-navigation-color-tag-green: var(--g-color-base-positive-light);
|
|
12
|
+
--pc-addons-navigation-color-tag-blue: var(--g-color-base-info-light);
|
|
13
|
+
--pc-addons-navigation-border-radius: var(--pc-border-radius, 24px);
|
|
14
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { NavigationItem } from './models';
|
|
2
|
+
export declare const getIconSize: (isMobile?: boolean) => 16 | 24;
|
|
3
|
+
export declare const SERVICES_PREFIX = "services";
|
|
4
|
+
export declare const SOLUTIONS_PREFIX = "solutions";
|
|
5
|
+
export interface MobileLargePopupDataItem {
|
|
6
|
+
id: number;
|
|
7
|
+
description: string;
|
|
8
|
+
slug: string;
|
|
9
|
+
url: string;
|
|
10
|
+
title: string;
|
|
11
|
+
}
|
|
12
|
+
export interface MobileLargePopupData {
|
|
13
|
+
items: MobileLargePopupDataItem[];
|
|
14
|
+
}
|
|
15
|
+
export type NaviationItemsMap = Record<string, NavigationItem[]>;
|
|
16
|
+
export declare const getHeaderHeight: (isMobile: boolean) => 68 | 94;
|
|
17
|
+
export declare function getFlatList(dataByKeys: NaviationItemsMap, key?: keyof NavigationItem): NavigationItem[];
|
|
18
|
+
export declare function applySearch(searchRaw: string, navigationItems: NavigationItem[]): NavigationItem[];
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.applySearch = exports.getFlatList = exports.getHeaderHeight = exports.SOLUTIONS_PREFIX = exports.SERVICES_PREFIX = exports.getIconSize = void 0;
|
|
4
|
+
const getIconSize = (isMobile) => {
|
|
5
|
+
return isMobile ? 24 : 16;
|
|
6
|
+
};
|
|
7
|
+
exports.getIconSize = getIconSize;
|
|
8
|
+
exports.SERVICES_PREFIX = 'services';
|
|
9
|
+
exports.SOLUTIONS_PREFIX = 'solutions';
|
|
10
|
+
const getHeaderHeight = (isMobile) => {
|
|
11
|
+
return isMobile ? 68 : 94;
|
|
12
|
+
};
|
|
13
|
+
exports.getHeaderHeight = getHeaderHeight;
|
|
14
|
+
function getFlatList(dataByKeys, key = 'slug') {
|
|
15
|
+
const navigationItems = {};
|
|
16
|
+
Object.values(dataByKeys).forEach((dataByKey) => {
|
|
17
|
+
dataByKey.forEach((data) => {
|
|
18
|
+
if (data[key]) {
|
|
19
|
+
navigationItems[data[key]] = data;
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
return Object.values(navigationItems);
|
|
24
|
+
}
|
|
25
|
+
exports.getFlatList = getFlatList;
|
|
26
|
+
function applySearch(searchRaw, navigationItems) {
|
|
27
|
+
const search = searchRaw.toLowerCase();
|
|
28
|
+
return navigationItems.filter(({ title, slug, description }) => (title && title.toLowerCase().includes(search)) ||
|
|
29
|
+
slug.includes(search) ||
|
|
30
|
+
(description && description.toLowerCase().includes(search)));
|
|
31
|
+
}
|
|
32
|
+
exports.applySearch = applySearch;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UIKIT_ROOT_CLASS = exports.DEFAULT_THEME = void 0;
|
|
4
|
+
const gravity_ui_page_constructor_1 = require("@doyourjob/gravity-ui-page-constructor");
|
|
5
|
+
exports.DEFAULT_THEME = gravity_ui_page_constructor_1.Theme.Light;
|
|
6
|
+
exports.UIKIT_ROOT_CLASS = 'g-root';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MobileContext = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
exports.MobileContext = react_1.default.createContext(false);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MobileContext';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare enum Theme {
|
|
3
|
+
Light = "light",
|
|
4
|
+
Dark = "dark"
|
|
5
|
+
}
|
|
6
|
+
export interface ThemeContextProps {
|
|
7
|
+
theme: Theme;
|
|
8
|
+
}
|
|
9
|
+
export declare const initialValue: ThemeContextProps;
|
|
10
|
+
export declare const ThemeContext: React.Context<ThemeContextProps>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ThemeContext = exports.initialValue = exports.Theme = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
var Theme;
|
|
8
|
+
(function (Theme) {
|
|
9
|
+
Theme["Light"] = "light";
|
|
10
|
+
Theme["Dark"] = "dark";
|
|
11
|
+
})(Theme = exports.Theme || (exports.Theme = {}));
|
|
12
|
+
exports.initialValue = {
|
|
13
|
+
theme: constants_1.DEFAULT_THEME,
|
|
14
|
+
};
|
|
15
|
+
exports.ThemeContext = react_1.default.createContext(exports.initialValue);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./ThemeContext"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./useTheme"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./withTheme"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useTheme = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const ThemeContext_1 = require("./ThemeContext");
|
|
7
|
+
function useTheme() {
|
|
8
|
+
const { theme } = react_1.default.useContext(ThemeContext_1.ThemeContext);
|
|
9
|
+
return theme;
|
|
10
|
+
}
|
|
11
|
+
exports.useTheme = useTheme;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Subtract } from 'utility-types';
|
|
3
|
+
import { ThemeContextProps } from './ThemeContext';
|
|
4
|
+
export interface WithThemeProps extends ThemeContextProps {
|
|
5
|
+
}
|
|
6
|
+
export declare function withTheme<T extends WithThemeProps>(WrappedComponent: React.ComponentType<T>): React.ComponentType<Subtract<T, WithThemeProps>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.withTheme = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const ThemeContext_1 = require("./ThemeContext");
|
|
7
|
+
function withTheme(WrappedComponent) {
|
|
8
|
+
var _a;
|
|
9
|
+
const componentName = WrappedComponent.displayName || WrappedComponent.name || 'Component';
|
|
10
|
+
return _a = class WithThemeComponent extends react_1.default.Component {
|
|
11
|
+
render() {
|
|
12
|
+
return react_1.default.createElement(WrappedComponent, Object.assign({}, this.props, { theme: this.context.theme }));
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
_a.displayName = `withTheme(${componentName})`,
|
|
16
|
+
_a.contextType = ThemeContext_1.ThemeContext,
|
|
17
|
+
_a;
|
|
18
|
+
}
|
|
19
|
+
exports.withTheme = withTheme;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useIsCurrentPage: (url?: string) => boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useIsCurrentPage = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
6
|
+
const useIsCurrentPage = (url) => {
|
|
7
|
+
const [isCurrentPage, setIsCurrentPage] = react_1.default.useState(false);
|
|
8
|
+
(0, react_1.useEffect)(() => {
|
|
9
|
+
setIsCurrentPage(Boolean(url && location.href.includes(url)));
|
|
10
|
+
}, [url]);
|
|
11
|
+
return isCurrentPage;
|
|
12
|
+
};
|
|
13
|
+
exports.useIsCurrentPage = useIsCurrentPage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useIsIPhone(): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useIsIPhone = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const device_1 = require("../components/Navigation/contexts/device");
|
|
6
|
+
function useIsIPhone() {
|
|
7
|
+
const device = (0, react_1.useContext)(device_1.DeviceContext);
|
|
8
|
+
return (device === null || device === void 0 ? void 0 : device.model) === 'iPhone';
|
|
9
|
+
}
|
|
10
|
+
exports.useIsIPhone = useIsIPhone;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.i18n = void 0;
|
|
4
|
+
const i18n_1 = require("@gravity-ui/i18n");
|
|
5
|
+
const configure_1 = require("./utils/configure");
|
|
6
|
+
exports.i18n = new i18n_1.I18N();
|
|
7
|
+
exports.i18n.setLang((0, configure_1.getConfig)().lang || configure_1.Lang.En);
|
|
8
|
+
(0, configure_1.subscribeConfigure)((config) => {
|
|
9
|
+
if (config.lang) {
|
|
10
|
+
exports.i18n.setLang(config.lang);
|
|
11
|
+
}
|
|
12
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.configure = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
tslib_1.__exportStar(require("./components"), exports);
|
|
6
|
+
//i18n setup
|
|
7
|
+
var configure_1 = require("./utils/configure");
|
|
8
|
+
Object.defineProperty(exports, "configure", { enumerable: true, get: function () { return configure_1.configure; } });
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface FocusTrapProps {
|
|
3
|
+
enabled?: boolean;
|
|
4
|
+
/** @deprecated Use autoFocus instead */
|
|
5
|
+
disableAutoFocus?: boolean;
|
|
6
|
+
autoFocus?: boolean;
|
|
7
|
+
children: React.ReactElement;
|
|
8
|
+
}
|
|
9
|
+
export declare function FocusTrap({ children, enabled, disableAutoFocus, autoFocus, }: FocusTrapProps): React.JSX.Element;
|
|
10
|
+
export declare function useParentFocusTrap(): ((node: HTMLElement | null) => void) | undefined;
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useParentFocusTrap = exports.FocusTrap = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const uikit_1 = require("@gravity-ui/uikit");
|
|
7
|
+
const focus_trap_1 = require("focus-trap");
|
|
8
|
+
const focusTrapContext = react_1.default.createContext(undefined);
|
|
9
|
+
function FocusTrap({ children, enabled = true, disableAutoFocus, autoFocus = true, }) {
|
|
10
|
+
const nodeRef = react_1.default.useRef(null);
|
|
11
|
+
const setAutoFocusRef = react_1.default.useRef(!disableAutoFocus && autoFocus);
|
|
12
|
+
react_1.default.useEffect(() => {
|
|
13
|
+
setAutoFocusRef.current = !disableAutoFocus && autoFocus;
|
|
14
|
+
});
|
|
15
|
+
const focusTrapRef = react_1.default.useRef();
|
|
16
|
+
const containersRef = react_1.default.useRef({});
|
|
17
|
+
const updateContainerElements = react_1.default.useCallback(() => {
|
|
18
|
+
var _a;
|
|
19
|
+
(_a = focusTrapRef.current) === null || _a === void 0 ? void 0 : _a.updateContainerElements([
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
21
|
+
nodeRef.current,
|
|
22
|
+
...Object.values(containersRef.current),
|
|
23
|
+
]);
|
|
24
|
+
}, []);
|
|
25
|
+
const actions = react_1.default.useMemo(() => ({
|
|
26
|
+
addNode(id, node) {
|
|
27
|
+
var _a;
|
|
28
|
+
if (containersRef.current[id] !== node && !((_a = nodeRef.current) === null || _a === void 0 ? void 0 : _a.contains(node))) {
|
|
29
|
+
containersRef.current[id] = node;
|
|
30
|
+
updateContainerElements();
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
removeNode(id) {
|
|
34
|
+
if (containersRef.current[id]) {
|
|
35
|
+
delete containersRef.current[id];
|
|
36
|
+
updateContainerElements();
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
}), [updateContainerElements]);
|
|
40
|
+
const handleNodeRef = react_1.default.useCallback((node) => {
|
|
41
|
+
var _a;
|
|
42
|
+
if (enabled && node) {
|
|
43
|
+
nodeRef.current = node;
|
|
44
|
+
if (!focusTrapRef.current) {
|
|
45
|
+
focusTrapRef.current = (0, focus_trap_1.createFocusTrap)([], {
|
|
46
|
+
initialFocus: () => setAutoFocusRef.current && getFocusElement(node),
|
|
47
|
+
fallbackFocus: () => node,
|
|
48
|
+
returnFocusOnDeactivate: false,
|
|
49
|
+
escapeDeactivates: false,
|
|
50
|
+
clickOutsideDeactivates: false,
|
|
51
|
+
allowOutsideClick: true,
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
updateContainerElements();
|
|
55
|
+
focusTrapRef.current.activate();
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
(_a = focusTrapRef.current) === null || _a === void 0 ? void 0 : _a.deactivate();
|
|
59
|
+
nodeRef.current = null;
|
|
60
|
+
}
|
|
61
|
+
}, [enabled, updateContainerElements]);
|
|
62
|
+
const child = react_1.default.Children.only(children);
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
64
|
+
if (!react_1.default.isValidElement(child)) {
|
|
65
|
+
throw new Error('Children must contain only one valid element');
|
|
66
|
+
}
|
|
67
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
68
|
+
const childRef = child.ref;
|
|
69
|
+
const ref = (0, uikit_1.useForkRef)(handleNodeRef, childRef);
|
|
70
|
+
return (react_1.default.createElement(focusTrapContext.Provider, { value: actions }, react_1.default.cloneElement(child, { ref })));
|
|
71
|
+
}
|
|
72
|
+
exports.FocusTrap = FocusTrap;
|
|
73
|
+
function useParentFocusTrap() {
|
|
74
|
+
const actions = react_1.default.useContext(focusTrapContext);
|
|
75
|
+
const id = (0, uikit_1.useUniqId)();
|
|
76
|
+
return react_1.default.useMemo(() => {
|
|
77
|
+
if (!actions) {
|
|
78
|
+
return undefined;
|
|
79
|
+
}
|
|
80
|
+
return (node) => {
|
|
81
|
+
if (node) {
|
|
82
|
+
actions.addNode(id, node);
|
|
83
|
+
}
|
|
84
|
+
else {
|
|
85
|
+
actions.removeNode(id);
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
}, [actions, id]);
|
|
89
|
+
}
|
|
90
|
+
exports.useParentFocusTrap = useParentFocusTrap;
|
|
91
|
+
function getFocusElement(root) {
|
|
92
|
+
if (!(document.activeElement instanceof HTMLElement) ||
|
|
93
|
+
!root.contains(document.activeElement)) {
|
|
94
|
+
if (!root.hasAttribute('tabIndex')) {
|
|
95
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
96
|
+
// used only in dev build
|
|
97
|
+
// eslint-disable-next-line no-console
|
|
98
|
+
console.error('@gravity-ui/uikit: focus-trap content node does node accept focus.');
|
|
99
|
+
}
|
|
100
|
+
root.setAttribute('tabIndex', '-1');
|
|
101
|
+
}
|
|
102
|
+
return root;
|
|
103
|
+
}
|
|
104
|
+
return document.activeElement;
|
|
105
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const NAMESPACE = "pc-addons-";
|
|
2
|
+
export declare const cn: import("@bem-react/classname").ClassNameInitilizer;
|
|
3
|
+
export declare const block: import("@bem-react/classname").ClassNameInitilizer;
|
|
4
|
+
export declare const rootCn: import("@bem-react/classname").ClassNameFormatter;
|
|
5
|
+
export type CnBlock = ReturnType<typeof cn>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.rootCn = exports.block = exports.cn = exports.NAMESPACE = void 0;
|
|
4
|
+
const classname_1 = require("@bem-react/classname");
|
|
5
|
+
const constants_1 = require("../constants");
|
|
6
|
+
exports.NAMESPACE = 'pc-addons-';
|
|
7
|
+
exports.cn = (0, classname_1.withNaming)({ e: '__', m: '_' });
|
|
8
|
+
exports.block = (0, classname_1.withNaming)({ n: exports.NAMESPACE, e: '__', m: '_' });
|
|
9
|
+
exports.rootCn = (0, exports.cn)(constants_1.UIKIT_ROOT_CLASS);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare enum Lang {
|
|
2
|
+
Ru = "ru",
|
|
3
|
+
En = "en"
|
|
4
|
+
}
|
|
5
|
+
interface Config {
|
|
6
|
+
lang?: Lang;
|
|
7
|
+
}
|
|
8
|
+
type Subscriber = (config: Config) => void;
|
|
9
|
+
export declare const configure: (newConfig: Config) => void;
|
|
10
|
+
export declare const subscribeConfigure: (sub: Subscriber) => () => void;
|
|
11
|
+
export declare const getConfig: () => Config;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getConfig = exports.subscribeConfigure = exports.configure = exports.Lang = void 0;
|
|
4
|
+
var Lang;
|
|
5
|
+
(function (Lang) {
|
|
6
|
+
Lang["Ru"] = "ru";
|
|
7
|
+
Lang["En"] = "en";
|
|
8
|
+
})(Lang = exports.Lang || (exports.Lang = {}));
|
|
9
|
+
let subs = [];
|
|
10
|
+
const config = {};
|
|
11
|
+
const configure = (newConfig) => {
|
|
12
|
+
Object.assign(config, newConfig);
|
|
13
|
+
subs.forEach((sub) => {
|
|
14
|
+
sub(config);
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
exports.configure = configure;
|
|
18
|
+
const subscribeConfigure = (sub) => {
|
|
19
|
+
subs.push(sub);
|
|
20
|
+
return () => {
|
|
21
|
+
subs = subs.filter((item) => item !== sub);
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
exports.subscribeConfigure = subscribeConfigure;
|
|
25
|
+
const getConfig = () => config;
|
|
26
|
+
exports.getConfig = getConfig;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { i18n } from '../i18n';
|
|
2
|
+
import { Lang } from './configure';
|
|
3
|
+
type KeysData = Parameters<typeof i18n.registerKeyset>[2];
|
|
4
|
+
export declare function registerKeyset<T extends KeysData>(data: Record<Lang, T>, keysetName: string): (key: string, params?: import("@gravity-ui/i18n").Params | undefined) => string;
|
|
5
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.registerKeyset = void 0;
|
|
4
|
+
const i18n_1 = require("../i18n");
|
|
5
|
+
function registerKeyset(data, keysetName) {
|
|
6
|
+
Object.entries(data).forEach(([lang, keys]) => i18n_1.i18n.registerKeyset(lang, keysetName, keys));
|
|
7
|
+
return i18n_1.i18n.keyset(keysetName);
|
|
8
|
+
}
|
|
9
|
+
exports.registerKeyset = registerKeyset;
|