@ubnt/store.core 9.64.0-beta.1 → 9.64.0-new-design
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/CHANGELOG.md +131 -615
- package/lib/_virtual/_virtual_multi-entry.js +15 -25
- package/lib/_virtual/_virtual_multi-entry.js.map +1 -1
- package/lib/_virtual/_virtual_multi-entry.mjs +13 -13
- package/lib/apis/smartcat.d.ts +12 -2
- package/lib/apis/smartcat.js +27 -4
- package/lib/apis/smartcat.js.map +1 -1
- package/lib/apis/smartcat.mjs +27 -4
- package/lib/apis/smartcat.mjs.map +1 -1
- package/lib/assets/arrow2.svg +3 -0
- package/lib/assets/cart-secondary.svg +5 -0
- package/lib/assets/close2.svg +2 -3
- package/lib/assets/close3.svg +3 -2
- package/lib/assets/express.jpg +0 -0
- package/lib/assets/express2.jpg +0 -0
- package/lib/assets/express7.jpg +0 -0
- package/lib/assets/express72.jpg +0 -0
- package/lib/assets/icon-location-pin.svg +5 -0
- package/lib/assets/icons/{menu/icon-globe.svg.js → cart-secondary.svg.js} +6 -6
- package/lib/assets/icons/cart-secondary.svg.js.map +1 -0
- package/lib/assets/icons/cart-secondary.svg.mjs +3 -0
- package/lib/assets/icons/cart-secondary.svg.mjs.map +1 -0
- package/lib/{components/ModelCompareV3/assets/crestron.svg.js → assets/icons/menu/icon-location-pin.svg.js} +6 -6
- package/lib/assets/icons/menu/icon-location-pin.svg.js.map +1 -0
- package/lib/assets/icons/menu/icon-location-pin.svg.mjs +3 -0
- package/lib/assets/icons/menu/icon-location-pin.svg.mjs.map +1 -0
- package/lib/assets/logoUnifi.svg +10 -2
- package/lib/assets/minus4.svg +8 -8
- package/lib/assets/minus5.svg +8 -8
- package/lib/assets/payment-apple-pay.svg +12 -1
- package/lib/assets/payment-card.svg +12 -1
- package/lib/assets/payment-google-pay.svg +1 -1
- package/lib/assets/plus5.svg +9 -9
- package/lib/assets/plus6.svg +9 -9
- package/lib/assets/udr2.jpg +0 -0
- package/lib/assets/udr3.jpg +0 -0
- package/lib/assets/udr7.jpg +0 -0
- package/lib/assets/udr72.jpg +0 -0
- package/lib/components/Accordion/Accordion.js +13 -13
- package/lib/components/Accordion/Accordion.js.map +1 -1
- package/lib/components/Accordion/Accordion.mjs +9 -9
- package/lib/components/Accordion/Accordion.mjs.map +1 -1
- package/lib/components/Accordion/Accordion.styles.d.ts +18 -18
- package/lib/components/Accordion/Accordion.styles.js +22 -28
- package/lib/components/Accordion/Accordion.styles.js.map +1 -1
- package/lib/components/Accordion/Accordion.styles.mjs +22 -28
- package/lib/components/Accordion/Accordion.styles.mjs.map +1 -1
- package/lib/components/AppDownloadBanner/AppDownloadBanner.styles.d.ts +21 -23
- package/lib/components/Avatar/Avatar.js +5 -6
- package/lib/components/Avatar/Avatar.js.map +1 -1
- package/lib/components/Avatar/Avatar.mjs +3 -4
- package/lib/components/Avatar/Avatar.mjs.map +1 -1
- package/lib/components/Avatar/Avatar.styles.d.ts +2 -2
- package/lib/components/BackInStock/BackInStock.styles.d.ts +7 -12
- package/lib/components/Badge/Badge.styles.d.ts +2 -2
- package/lib/components/Banner/Banner.js +4 -4
- package/lib/components/Banner/Banner.js.map +1 -1
- package/lib/components/Banner/Banner.mjs +4 -4
- package/lib/components/Banner/Banner.mjs.map +1 -1
- package/lib/components/Banner/Banner.styles.d.ts +16 -16
- package/lib/components/Banner/Banner.styles.js +9 -9
- package/lib/components/Banner/Banner.styles.js.map +1 -1
- package/lib/components/Banner/Banner.styles.mjs +9 -9
- package/lib/components/Banner/Banner.styles.mjs.map +1 -1
- package/lib/components/Breadcrumbs/Breadcrumbs.styles.d.ts +2 -2
- package/lib/components/BuiltFeaturesSection/BuiltFeaturesSection.styles.d.ts +9 -9
- package/lib/components/Button/Button.js +12 -5
- package/lib/components/Button/Button.js.map +1 -1
- package/lib/components/Button/Button.mjs +8 -1
- package/lib/components/Button/Button.mjs.map +1 -1
- package/lib/components/Button/Button.styles.d.ts +4 -4
- package/lib/components/Button/CartButton.d.ts +3 -1
- package/lib/components/Button/CartButton.js +11 -6
- package/lib/components/Button/CartButton.js.map +1 -1
- package/lib/components/Button/CartButton.mjs +8 -4
- package/lib/components/Button/CartButton.mjs.map +1 -1
- package/lib/components/ButtonGroup/ButtonGroup.d.ts +1 -1
- package/lib/components/ButtonGroup/ButtonGroup.js +11 -4
- package/lib/components/ButtonGroup/ButtonGroup.js.map +1 -1
- package/lib/components/ButtonGroup/ButtonGroup.mjs +11 -4
- package/lib/components/ButtonGroup/ButtonGroup.mjs.map +1 -1
- package/lib/components/ButtonGroup/ButtonGroup.styles.d.ts +12 -8
- package/lib/components/ButtonGroup/ButtonGroup.styles.js +46 -6
- package/lib/components/ButtonGroup/ButtonGroup.styles.js.map +1 -1
- package/lib/components/ButtonGroup/ButtonGroup.styles.mjs +46 -6
- package/lib/components/ButtonGroup/ButtonGroup.styles.mjs.map +1 -1
- package/lib/components/ButtonGroup/ButtonGroup.types.d.ts +5 -0
- package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.d.ts +5 -5
- package/lib/components/ButtonGroupBasic/index.stories.d.ts +6 -0
- package/lib/components/CardSection/Card/Card.js +16 -16
- package/lib/components/CardSection/Card/Card.js.map +1 -1
- package/lib/components/CardSection/Card/Card.mjs +10 -10
- package/lib/components/CardSection/Card/Card.mjs.map +1 -1
- package/lib/components/CardSection/Card/Card.styles.d.ts +21 -21
- package/lib/components/CardSection/Card/Card.styles.js +22 -22
- package/lib/components/CardSection/Card/Card.styles.js.map +1 -1
- package/lib/components/CardSection/Card/Card.styles.mjs +22 -22
- package/lib/components/CardSection/Card/Card.styles.mjs.map +1 -1
- package/lib/components/CardSection/CardSection.js +2 -2
- package/lib/components/CardSection/CardSection.styles.d.ts +4 -4
- package/lib/components/CarouselGallery/CarouselGallery.styles.d.ts +11 -11
- package/lib/components/CartIcon/CartIcon.js +4 -4
- package/lib/components/CartIcon/CartIcon.js.map +1 -1
- package/lib/components/CartIcon/CartIcon.mjs +2 -2
- package/lib/components/CartIcon/CartIcon.mjs.map +1 -1
- package/lib/components/CartIcon/CartIcon.styles.d.ts +5 -5
- package/lib/components/CartIcon/CartIcon.styles.js +4 -4
- package/lib/components/CartIcon/CartIcon.styles.js.map +1 -1
- package/lib/components/CartIcon/CartIcon.styles.mjs +4 -4
- package/lib/components/CartIcon/CartIcon.styles.mjs.map +1 -1
- package/lib/components/CartSummary/CartSummary.js +1 -1
- package/lib/components/CartSummary/CartSummary.js.map +1 -1
- package/lib/components/CartSummary/CartSummary.mjs +1 -1
- package/lib/components/CartSummary/CartSummary.mjs.map +1 -1
- package/lib/components/CartSummary/CartSummary.styles.d.ts +13 -19
- package/lib/components/CartSummary/CartSummary.styles.js +2 -2
- package/lib/components/CartSummary/CartSummary.styles.js.map +1 -1
- package/lib/components/CartSummary/CartSummary.styles.mjs +2 -2
- package/lib/components/CartSummary/CartSummary.styles.mjs.map +1 -1
- package/lib/components/CategoryTabs/CategoryTabs.styles.d.ts +8 -6
- package/lib/components/CategoryTabs/CategoryTabs.styles.js +9 -6
- package/lib/components/CategoryTabs/CategoryTabs.styles.js.map +1 -1
- package/lib/components/CategoryTabs/CategoryTabs.styles.mjs +8 -7
- package/lib/components/CategoryTabs/CategoryTabs.styles.mjs.map +1 -1
- package/lib/components/Checkbox/Checkbox.js +4 -7
- package/lib/components/Checkbox/Checkbox.js.map +1 -1
- package/lib/components/Checkbox/Checkbox.mjs +0 -3
- package/lib/components/Checkbox/Checkbox.mjs.map +1 -1
- package/lib/components/Checkbox/Checkbox.styles.d.ts +3 -3
- package/lib/components/CloserLookSection/CloserLookSection.js +11 -11
- package/lib/components/CloserLookSection/CloserLookSection.styles.d.ts +8 -8
- package/lib/components/CloserLookSection/RecommendedAddons/RecommendedAddons.js +5 -5
- package/lib/components/CloserLookSection/RecommendedAddons/RecommendedAddons.styles.d.ts +3 -3
- package/lib/components/Compare/Compare.styles.d.ts +34 -36
- package/lib/components/CompareChart/CompareChart.styles.d.ts +36 -40
- package/lib/components/CompareSection/CompareSection.styles.d.ts +16 -18
- package/lib/components/Container/Container.d.ts +1 -1
- package/lib/components/Container/Container.js +5 -4
- package/lib/components/Container/Container.js.map +1 -1
- package/lib/components/Container/Container.mjs +5 -4
- package/lib/components/Container/Container.mjs.map +1 -1
- package/lib/components/Container/Container.styles.d.ts +3 -3
- package/lib/components/Container/index.stories.d.ts +5 -5
- package/lib/components/CustomImage/CustomImage.js +12 -12
- package/lib/components/CustomImage/CustomImage.styles.d.ts +12 -12
- package/lib/components/DeploymentGallery/DeploymentGallery.styles.d.ts +4 -4
- package/lib/components/Explore/Explore.js +5 -5
- package/lib/components/Explore/Explore.styles.d.ts +28 -36
- package/lib/components/Explore/Explore.styles.js +6 -6
- package/lib/components/Explore/Explore.styles.js.map +1 -1
- package/lib/components/Explore/Explore.styles.mjs +6 -6
- package/lib/components/Explore/Explore.styles.mjs.map +1 -1
- package/lib/components/FeaturesSection_deprecated/AllFeaturesButton/AllFeaturesButton.styles.d.ts +3 -5
- package/lib/components/FeaturesSection_deprecated/Features/Features.js +2 -2
- package/lib/components/FeaturesSection_deprecated/Features/Features.styles.d.ts +15 -15
- package/lib/components/FeaturesSection_deprecated/FeaturesSection.js +23 -23
- package/lib/components/FeaturesSection_deprecated/FeaturesSection.mjs +1 -1
- package/lib/components/FeaturesSection_deprecated/FeaturesSection.styles.d.ts +22 -22
- package/lib/components/FeaturesSection_deprecated/assets/close.svg.js +1 -1
- package/lib/components/FeaturesSection_deprecated/assets/close.svg.mjs +2 -2
- package/lib/components/Footer/Footer.js +3 -2
- package/lib/components/Footer/Footer.js.map +1 -1
- package/lib/components/Footer/Footer.mjs +1 -0
- package/lib/components/Footer/Footer.mjs.map +1 -1
- package/lib/components/Footer/Footer.styles.d.ts +34 -39
- package/lib/components/Footer/Footer.styles.js +1 -1
- package/lib/components/Footer/Footer.styles.js.map +1 -1
- package/lib/components/Footer/Footer.styles.mjs +1 -1
- package/lib/components/Footer/Footer.styles.mjs.map +1 -1
- package/lib/components/Footer/hooks/useFooterContent.js +5 -5
- package/lib/components/Gallery/Gallery.context.js +17 -17
- package/lib/components/Gallery/Gallery.js +10 -10
- package/lib/components/Gallery/Gallery.js.map +1 -1
- package/lib/components/Gallery/Gallery.mjs +1 -1
- package/lib/components/Gallery/Gallery.mjs.map +1 -1
- package/lib/components/Gallery/Gallery.styles.d.ts +8 -12
- package/lib/components/Gallery/Gallery.styles.js +1 -3
- package/lib/components/Gallery/Gallery.styles.js.map +1 -1
- package/lib/components/Gallery/Gallery.styles.mjs +1 -3
- package/lib/components/Gallery/Gallery.styles.mjs.map +1 -1
- package/lib/components/Gallery/GalleryControls/GalleryControls.js +5 -5
- package/lib/components/Gallery/GalleryControls/GalleryControls.js.map +1 -1
- package/lib/components/Gallery/GalleryControls/GalleryControls.mjs +1 -1
- package/lib/components/Gallery/GalleryControls/GalleryControls.mjs.map +1 -1
- package/lib/components/Gallery/GalleryControls/GalleryControls.styles.d.ts +9 -9
- package/lib/components/Gallery/GalleryControls/GalleryControls.styles.js +2 -2
- package/lib/components/Gallery/GalleryControls/GalleryControls.styles.js.map +1 -1
- package/lib/components/Gallery/GalleryControls/GalleryControls.styles.mjs +2 -2
- package/lib/components/Gallery/GalleryControls/GalleryControls.styles.mjs.map +1 -1
- package/lib/components/Gallery/GalleryItem/GalleryItem.js +13 -13
- package/lib/components/Gallery/GalleryItem/GalleryItem.js.map +1 -1
- package/lib/components/Gallery/GalleryItem/GalleryItem.mjs +5 -5
- package/lib/components/Gallery/GalleryItem/GalleryItem.mjs.map +1 -1
- package/lib/components/Gallery/GalleryItem/GalleryItem.styles.d.ts +10 -10
- package/lib/components/Gallery/GalleryItem/GalleryItem.styles.js +11 -11
- package/lib/components/Gallery/GalleryItem/GalleryItem.styles.js.map +1 -1
- package/lib/components/Gallery/GalleryItem/GalleryItem.styles.mjs +11 -11
- package/lib/components/Gallery/GalleryItem/GalleryItem.styles.mjs.map +1 -1
- package/lib/components/Gallery/GalleryThumbnails/GalleryThumbnails.js +8 -8
- package/lib/components/Gallery/GalleryThumbnails/GalleryThumbnails.styles.d.ts +8 -8
- package/lib/components/GradientButton/GradientButton.d.ts +1 -1
- package/lib/components/GradientButton/GradientButton.js +0 -2
- package/lib/components/GradientButton/GradientButton.js.map +1 -1
- package/lib/components/GradientButton/GradientButton.mjs +0 -2
- package/lib/components/GradientButton/GradientButton.mjs.map +1 -1
- package/lib/components/GradientButton/GradientButton.styles.d.ts +4 -4
- package/lib/components/GradientButton/GradientButton.styles.js +6 -6
- package/lib/components/GradientButton/GradientButton.styles.js.map +1 -1
- package/lib/components/GradientButton/GradientButton.styles.mjs +6 -6
- package/lib/components/GradientButton/GradientButton.styles.mjs.map +1 -1
- package/lib/components/GridGallery/GridGallery.js +9 -9
- package/lib/components/GridGallery/GridGallery.js.map +1 -1
- package/lib/components/GridGallery/GridGallery.mjs +1 -1
- package/lib/components/GridGallery/GridGallery.mjs.map +1 -1
- package/lib/components/GridGallery/GridGallery.styles.d.ts +13 -13
- package/lib/components/GridGallery/GridGallery.styles.js +2 -2
- package/lib/components/GridGallery/GridGallery.styles.js.map +1 -1
- package/lib/components/GridGallery/GridGallery.styles.mjs +2 -2
- package/lib/components/GridGallery/GridGallery.styles.mjs.map +1 -1
- package/lib/components/GridGallery/GridModal/GridModal.js +7 -7
- package/lib/components/GridGallery/GridModal/GridModal.js.map +1 -1
- package/lib/components/GridGallery/GridModal/GridModal.mjs +1 -1
- package/lib/components/GridGallery/GridModal/GridModal.mjs.map +1 -1
- package/lib/components/GridGallery/GridModal/GridModal.styles.d.ts +7 -7
- package/lib/components/GridGallery/GridModal/GridModal.styles.js +4 -4
- package/lib/components/GridGallery/GridModal/GridModal.styles.js.map +1 -1
- package/lib/components/GridGallery/GridModal/GridModal.styles.mjs +4 -4
- package/lib/components/GridGallery/GridModal/GridModal.styles.mjs.map +1 -1
- package/lib/components/Header/AccountFrame/AccountFrame.js +12 -12
- package/lib/components/Header/AccountFrame/AccountFrame.js.map +1 -1
- package/lib/components/Header/AccountFrame/AccountFrame.mjs +1 -1
- package/lib/components/Header/AccountFrame/AccountFrame.mjs.map +1 -1
- package/lib/components/Header/AccountFrame/AccountFrame.styles.d.ts +15 -19
- package/lib/components/Header/AccountFrame/AccountFrame.styles.js +2 -2
- package/lib/components/Header/AccountFrame/AccountFrame.styles.js.map +1 -1
- package/lib/components/Header/AccountFrame/AccountFrame.styles.mjs +2 -2
- package/lib/components/Header/AccountFrame/AccountFrame.styles.mjs.map +1 -1
- package/lib/components/Header/AccountFrame/Mobile/Mobile.js +4 -4
- package/lib/components/Header/AccountFrame/Mobile/Mobile.styles.d.ts +3 -3
- package/lib/components/Header/AccountMenu/AccountMenu.js +30 -20
- package/lib/components/Header/AccountMenu/AccountMenu.js.map +1 -1
- package/lib/components/Header/AccountMenu/AccountMenu.mjs +13 -3
- package/lib/components/Header/AccountMenu/AccountMenu.mjs.map +1 -1
- package/lib/components/Header/AccountMenu/AccountMenu.styles.d.ts +12 -30
- package/lib/components/Header/CartModal/CartModal.styles.d.ts +13 -15
- package/lib/components/Header/CartModal/Empty/Empty.js +3 -3
- package/lib/components/Header/CartModal/Empty/Empty.styles.d.ts +1 -1
- package/lib/components/Header/CartModal/Item/Item.styles.d.ts +10 -10
- package/lib/components/Header/CartModalV2/CartModal.js +5 -5
- package/lib/components/Header/CartModalV2/CartModal.styles.d.ts +21 -23
- package/lib/components/Header/CartModalV2/Item/Item.js +4 -4
- package/lib/components/Header/CartModalV2/Item/Item.styles.d.ts +13 -13
- package/lib/components/Header/Header.js +40 -40
- package/lib/components/Header/Header.js.map +1 -1
- package/lib/components/Header/Header.mjs +6 -6
- package/lib/components/Header/Header.mjs.map +1 -1
- package/lib/components/Header/Header.stories.d.ts +111 -0
- package/lib/components/Header/Header.styles.d.ts +40 -49
- package/lib/components/Header/Header.styles.js +11 -33
- package/lib/components/Header/Header.styles.js.map +1 -1
- package/lib/components/Header/Header.styles.mjs +11 -32
- package/lib/components/Header/Header.styles.mjs.map +1 -1
- package/lib/components/Header/Header.types.d.ts +29 -5
- package/lib/components/Header/Header.types.js +2 -1
- package/lib/components/Header/Header.types.js.map +1 -1
- package/lib/components/Header/Header.types.mjs +2 -1
- package/lib/components/Header/Header.types.mjs.map +1 -1
- package/lib/components/Header/IsolatedHeader.d.ts +1 -0
- package/lib/components/Header/IsolatedHeader.js +50 -50
- package/lib/components/Header/IsolatedHeader.js.map +1 -1
- package/lib/components/Header/IsolatedHeader.mjs +47 -46
- package/lib/components/Header/IsolatedHeader.mjs.map +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.js +6 -6
- package/lib/components/Header/LanguageFrame/LanguageFrame.styles.d.ts +17 -14
- package/lib/components/Header/LanguageFrame/LanguageFrame.styles.js +51 -0
- package/lib/components/Header/LanguageFrame/LanguageFrame.styles.js.map +1 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.styles.mjs +47 -1
- package/lib/components/Header/LanguageFrame/LanguageFrame.styles.mjs.map +1 -1
- package/lib/components/Header/LanguageFrame/Mobile/Mobile.styles.d.ts +3 -3
- package/lib/components/Header/LinksModal/LinksModal.styles.d.ts +4 -4
- package/lib/components/Header/LogoIcon/LogoIcon.d.ts +7 -0
- package/lib/components/Header/LogoIcon/LogoIcon.js +46 -0
- package/lib/components/Header/LogoIcon/LogoIcon.js.map +1 -0
- package/lib/components/Header/LogoIcon/LogoIcon.mjs +36 -0
- package/lib/components/Header/LogoIcon/LogoIcon.mjs.map +1 -0
- package/lib/components/Header/LogoIcon/index.d.ts +1 -0
- package/lib/components/Header/LogoIcon/index.js +6 -0
- package/lib/components/Header/LogoIcon/index.js.map +1 -0
- package/lib/components/Header/LogoIcon/index.mjs +3 -0
- package/lib/components/Header/LogoIcon/index.mjs.map +1 -0
- package/lib/components/Header/MenuItem/MenuItem.js +5 -4
- package/lib/components/Header/MenuItem/MenuItem.js.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.mjs +5 -4
- package/lib/components/Header/MenuItem/MenuItem.mjs.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.styles.d.ts +15 -15
- package/lib/components/Header/MenuItem/MenuItem.styles.js +11 -11
- package/lib/components/Header/MenuItem/MenuItem.styles.js.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.styles.mjs +11 -11
- package/lib/components/Header/MenuItem/MenuItem.styles.mjs.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.types.d.ts +1 -0
- package/lib/components/Header/Navigation/Carousel/Carousel.js +11 -11
- package/lib/components/Header/Navigation/Carousel/Carousel.js.map +1 -1
- package/lib/components/Header/Navigation/Carousel/Carousel.mjs +6 -6
- package/lib/components/Header/Navigation/Carousel/Carousel.mjs.map +1 -1
- package/lib/components/Header/Navigation/Carousel/Carousel.styles.d.ts +20 -20
- package/lib/components/Header/Navigation/Carousel/Carousel.styles.js +16 -16
- package/lib/components/Header/Navigation/Carousel/Carousel.styles.js.map +1 -1
- package/lib/components/Header/Navigation/Carousel/Carousel.styles.mjs +16 -16
- package/lib/components/Header/Navigation/Carousel/Carousel.styles.mjs.map +1 -1
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.js +19 -19
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.js.map +1 -1
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.mjs +7 -7
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.mjs.map +1 -1
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.d.ts +23 -29
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.js +19 -19
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.js.map +1 -1
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.mjs +19 -19
- package/lib/components/Header/Navigation/MicrositeMenu/MicrositeMenu.styles.mjs.map +1 -1
- package/lib/components/Header/Navigation/MobileMenu/MobileMenu.js +15 -15
- package/lib/components/Header/Navigation/MobileMenu/MobileMenu.js.map +1 -1
- package/lib/components/Header/Navigation/MobileMenu/MobileMenu.mjs +9 -9
- package/lib/components/Header/Navigation/MobileMenu/MobileMenu.mjs.map +1 -1
- package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.d.ts +36 -40
- package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.js +18 -18
- package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.js.map +1 -1
- package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.mjs +18 -18
- package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.mjs.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.d.ts +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.js +124 -117
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.js.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.mjs +119 -112
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.mjs.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.d.ts +14 -7
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.js +15 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.js.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.mjs +13 -2
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.mjs.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.types.d.ts +12 -6
- package/lib/components/Header/Overlay/Overlay.js +3 -3
- package/lib/components/Header/Overlay/Overlay.styles.d.ts +2 -2
- package/lib/components/Header/ProHeader/ProHeader.d.ts +9 -5
- package/lib/components/Header/ProHeader/ProHeader.js +290 -189
- package/lib/components/Header/ProHeader/ProHeader.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.mjs +270 -171
- package/lib/components/Header/ProHeader/ProHeader.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.d.ts +49 -40
- package/lib/components/Header/ProHeader/ProHeader.styles.js +206 -68
- package/lib/components/Header/ProHeader/ProHeader.styles.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs +195 -67
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs.map +1 -1
- package/lib/components/Header/SearchTab/SearchTab.styles.d.ts +3 -3
- package/lib/components/Header/translations/ar.json.js +4 -1
- package/lib/components/Header/translations/ar.json.js.map +1 -1
- package/lib/components/Header/translations/ar.json.mjs +4 -2
- package/lib/components/Header/translations/ar.json.mjs.map +1 -1
- package/lib/components/Header/translations/de.json.js +4 -1
- package/lib/components/Header/translations/de.json.js.map +1 -1
- package/lib/components/Header/translations/de.json.mjs +4 -2
- package/lib/components/Header/translations/de.json.mjs.map +1 -1
- package/lib/components/Header/translations/el.json.js +4 -1
- package/lib/components/Header/translations/el.json.js.map +1 -1
- package/lib/components/Header/translations/el.json.mjs +4 -2
- package/lib/components/Header/translations/el.json.mjs.map +1 -1
- package/lib/components/Header/translations/en.json.js +7 -1
- package/lib/components/Header/translations/en.json.js.map +1 -1
- package/lib/components/Header/translations/en.json.mjs +6 -2
- package/lib/components/Header/translations/en.json.mjs.map +1 -1
- package/lib/components/Header/translations/es.json.js +4 -1
- package/lib/components/Header/translations/es.json.js.map +1 -1
- package/lib/components/Header/translations/es.json.mjs +4 -2
- package/lib/components/Header/translations/es.json.mjs.map +1 -1
- package/lib/components/Header/translations/fr.json.js +4 -1
- package/lib/components/Header/translations/fr.json.js.map +1 -1
- package/lib/components/Header/translations/fr.json.mjs +4 -2
- package/lib/components/Header/translations/fr.json.mjs.map +1 -1
- package/lib/components/Header/translations/it.json.js +4 -1
- package/lib/components/Header/translations/it.json.js.map +1 -1
- package/lib/components/Header/translations/it.json.mjs +4 -2
- package/lib/components/Header/translations/it.json.mjs.map +1 -1
- package/lib/components/Header/translations/ja.json.js +4 -1
- package/lib/components/Header/translations/ja.json.js.map +1 -1
- package/lib/components/Header/translations/ja.json.mjs +4 -2
- package/lib/components/Header/translations/ja.json.mjs.map +1 -1
- package/lib/components/Header/translations/pt-BR.json.js +4 -1
- package/lib/components/Header/translations/pt-BR.json.js.map +1 -1
- package/lib/components/Header/translations/pt-BR.json.mjs +4 -2
- package/lib/components/Header/translations/pt-BR.json.mjs.map +1 -1
- package/lib/components/Header/translations/zh-Hans.json.js +4 -1
- package/lib/components/Header/translations/zh-Hans.json.js.map +1 -1
- package/lib/components/Header/translations/zh-Hans.json.mjs +4 -2
- package/lib/components/Header/translations/zh-Hans.json.mjs.map +1 -1
- package/lib/components/Header/translations/zh-Hant-TW.json.js +4 -1
- package/lib/components/Header/translations/zh-Hant-TW.json.js.map +1 -1
- package/lib/components/Header/translations/zh-Hant-TW.json.mjs +4 -2
- package/lib/components/Header/translations/zh-Hant-TW.json.mjs.map +1 -1
- package/lib/components/Hero/Hero.js +5 -5
- package/lib/components/Hero/Hero.styles.d.ts +28 -28
- package/lib/components/HeroFadeGallery/HeroFadeGallery.styles.d.ts +12 -12
- package/lib/components/HeroVideo/HeroVideo.js +5 -5
- package/lib/components/HeroVideo/HeroVideo.styles.d.ts +7 -7
- package/lib/components/HowToUseSection/HowToUseSection.styles.d.ts +14 -14
- package/lib/components/ImageCarousel/ImageCarousel.js +30 -30
- package/lib/components/ImageCarousel/ImageCarousel.styles.d.ts +34 -38
- package/lib/components/ImageCarousel/ImageCarousel.styles.js +4 -5
- package/lib/components/ImageCarousel/ImageCarousel.styles.js.map +1 -1
- package/lib/components/ImageCarousel/ImageCarousel.styles.mjs +4 -5
- package/lib/components/ImageCarousel/ImageCarousel.styles.mjs.map +1 -1
- package/lib/components/ImageModal/ImageModal.styles.d.ts +6 -8
- package/lib/components/ImageSequence/ImageSequence.js +8 -8
- package/lib/components/ImageSequence/ImageSequence.styles.d.ts +8 -8
- package/lib/components/InputSelect/InputSelect.styles.d.ts +8 -4
- package/lib/components/LandingPage/Block/Block.styles.d.ts +4 -4
- package/lib/components/LandingPage/Cards/Card/Card.js +4 -4
- package/lib/components/LandingPage/Cards/Card/Card.styles.d.ts +17 -17
- package/lib/components/LandingPage/Cards/Cards.js +10 -10
- package/lib/components/LandingPage/Cards/Cards.styles.d.ts +9 -9
- package/lib/components/LandingPage/Cards/Cards.styles.js +1 -1
- package/lib/components/LandingPage/Cards/Cards.styles.js.map +1 -1
- package/lib/components/LandingPage/Cards/Cards.styles.mjs +1 -1
- package/lib/components/LandingPage/Cards/Cards.styles.mjs.map +1 -1
- package/lib/components/LandingPage/LandingPage.js +2 -2
- package/lib/components/LandingPage/LandingPage.styles.d.ts +5 -5
- package/lib/components/LandingPagePro/LandingPagePro.js +13 -13
- package/lib/components/LandingPagePro/LandingPagePro.styles.d.ts +3 -3
- package/lib/components/LandingPageSearch/LandingPageSearch.js +2 -2
- package/lib/components/LandingPageSearch/LandingPageSearch.styles.d.ts +2 -2
- package/lib/components/LandingPageSearch/Modal/Modal.js +9 -9
- package/lib/components/LandingPageSearch/Modal/Modal.styles.d.ts +22 -26
- package/lib/components/LandingPageSidebar/LandingPageSidebar.js +12 -12
- package/lib/components/LandingPageSidebar/LandingPageSidebar.styles.d.ts +22 -22
- package/lib/components/LayoutRenderer/LayoutRenderer.js +8 -8
- package/lib/components/LayoutRenderer/LayoutRenderer.styles.d.ts +21 -23
- package/lib/components/LayoutRendererV1/LayoutRenderer.styles.d.ts +54 -60
- package/lib/components/LayoutRendererV2/LayoutRenderer.styles.d.ts +49 -57
- package/lib/components/LearnMoreLink/LearnMoreLink.styles.d.ts +2 -2
- package/lib/components/Loader/Loader.styles.d.ts +4 -4
- package/lib/components/Loader/Spinner/Spinner.styles.d.ts +3 -3
- package/lib/components/LoaderDots/LoaderDots.d.ts +1 -1
- package/lib/components/LoaderDots/LoaderDots.js +3 -1
- package/lib/components/LoaderDots/LoaderDots.js.map +1 -1
- package/lib/components/LoaderDots/LoaderDots.mjs +3 -1
- package/lib/components/LoaderDots/LoaderDots.mjs.map +1 -1
- package/lib/components/LoaderDots/LoaderDots.styles.d.ts +4 -3
- package/lib/components/LoaderDots/LoaderDots.styles.js +11 -1
- package/lib/components/LoaderDots/LoaderDots.styles.js.map +1 -1
- package/lib/components/LoaderDots/LoaderDots.styles.mjs +11 -1
- package/lib/components/LoaderDots/LoaderDots.styles.mjs.map +1 -1
- package/lib/components/LoaderDots/LoaderDots.types.d.ts +2 -0
- package/lib/components/MeetUniFiVideoPlayer/EpisodeCard/EpisodeCard.js +7 -7
- package/lib/components/MeetUniFiVideoPlayer/EpisodeCard/EpisodeCard.styles.d.ts +9 -11
- package/lib/components/MeetUniFiVideoPlayer/MeetUniFiVideoPlayer.js +18 -18
- package/lib/components/MeetUniFiVideoPlayer/MeetUniFiVideoPlayer.styles.d.ts +25 -25
- package/lib/components/MicrositeBuyButton/MicrositeBuyButton.js +2 -2
- package/lib/components/MicrositeBuyButton/MicrositeBuyButton.js.map +1 -1
- package/lib/components/MicrositeBuyButton/MicrositeBuyButton.mjs +2 -2
- package/lib/components/MicrositeBuyButton/MicrositeBuyButton.mjs.map +1 -1
- package/lib/components/MicrositeColumnFeatureProgressBar/MicrositeColumnFeatureProgressBar.js +2 -2
- package/lib/components/MicrositeColumnFeatureProgressBar/MicrositeColumnFeatureProgressBar.styles.d.ts +6 -6
- package/lib/components/MicrositeExploreCards/MicrositeExploreCards.styles.d.ts +8 -8
- package/lib/components/MicrositeFeatureChecklist/MicrositeFeatureChecklist.js +3 -3
- package/lib/components/MicrositeFeatureChecklist/MicrositeFeatureChecklist.styles.d.ts +18 -20
- package/lib/components/MicrositeFeatureChecklist/MicrositeFeatureChecklist.styles.js +2 -2
- package/lib/components/MicrositeFeatureChecklist/MicrositeFeatureChecklist.styles.js.map +1 -1
- package/lib/components/MicrositeFeatureChecklist/MicrositeFeatureChecklist.styles.mjs +2 -2
- package/lib/components/MicrositeFeatureChecklist/MicrositeFeatureChecklist.styles.mjs.map +1 -1
- package/lib/components/MicrositeFeatureIcons/MicrositeFeatureIcons.styles.d.ts +11 -11
- package/lib/components/MicrositeFeatureList/MicrositeFeatureList.styles.d.ts +14 -14
- package/lib/components/MicrositeFeatureProgressBar/MicrositeFeatureProgressBar.js +3 -3
- package/lib/components/MicrositeFeatureProgressBar/MicrositeFeatureProgressBar.styles.d.ts +24 -28
- package/lib/components/MicrositeFeatureProgressBar/MicrositeFeatureProgressBar.styles.js +2 -2
- package/lib/components/MicrositeFeatureProgressBar/MicrositeFeatureProgressBar.styles.js.map +1 -1
- package/lib/components/MicrositeFeatureProgressBar/MicrositeFeatureProgressBar.styles.mjs +2 -2
- package/lib/components/MicrositeFeatureProgressBar/MicrositeFeatureProgressBar.styles.mjs.map +1 -1
- package/lib/components/MicrositeHero/MicrositeHero.js +18 -18
- package/lib/components/MicrositeHero/MicrositeHero.styles.d.ts +41 -41
- package/lib/components/MicrositeIntroductionBlock/MicrositeIntroductionBlock.js +4 -4
- package/lib/components/MicrositeIntroductionBlock/MicrositeIntroductionBlock.styles.d.ts +6 -6
- package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.js +9 -9
- package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.styles.d.ts +15 -15
- package/lib/components/MicrositeProductGrid/MicrositeProductGrid.js +8 -8
- package/lib/components/MicrositeProductGrid/MicrositeProductGrid.styles.d.ts +15 -15
- package/lib/components/MicrositeProductLearnMoreBlock/MicrositeProductLearnMoreBlock.styles.d.ts +12 -14
- package/lib/components/MicrositeProductLearnMoreBlock/MicrositeProductLearnMoreBlock.styles.js +2 -2
- package/lib/components/MicrositeProductLearnMoreBlock/MicrositeProductLearnMoreBlock.styles.js.map +1 -1
- package/lib/components/MicrositeProductLearnMoreBlock/MicrositeProductLearnMoreBlock.styles.mjs +2 -2
- package/lib/components/MicrositeProductLearnMoreBlock/MicrositeProductLearnMoreBlock.styles.mjs.map +1 -1
- package/lib/components/MicrositeProductLearnMoreBlock/MicrositeProductLearnMoreBlockWrap.js +2 -2
- package/lib/components/MicrositeSection/AllFeaturesButton/AllFeaturesButton.styles.d.ts +3 -5
- package/lib/components/MicrositeSection/Features/Features.styles.d.ts +15 -15
- package/lib/components/MicrositeSection/MicrositeSection.styles.d.ts +24 -24
- package/lib/components/MicrositeSectionWrap/MicrositeSectionWrap.styles.d.ts +6 -8
- package/lib/components/MicrositeSubSubNavigation/MicrositeSubSubNavigation.js +3 -3
- package/lib/components/MicrositeSubSubNavigation/MicrositeSubSubNavigation.styles.d.ts +2 -2
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.js +12 -12
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.styles.d.ts +17 -17
- package/lib/components/Microsites/MicrositePageContext.js +2 -2
- package/lib/components/Microsites/MicrositeProductPage.js +3 -3
- package/lib/components/Microsites/MicrositeProductPage.styles.d.ts +8 -16
- package/lib/components/Microsites/context/MicrositeProductPageContext.js +3 -3
- package/lib/components/MobileModal/MobileModal.js +4 -4
- package/lib/components/MobileModal/MobileModal.styles.d.ts +8 -8
- package/lib/components/Modal/Modal.js +3 -3
- package/lib/components/Modal/Modal.styles.d.ts +1 -1
- package/lib/components/ModelCompareV3/ModelCompareOverflowScrollButton.js +3 -3
- package/lib/components/ModelCompareV3/ModelComparePropertyValueGridItem.js +2 -2
- package/lib/components/ModelCompareV3/ModelCompareV3.js +14 -14
- package/lib/components/ModelCompareV3/ModelCompareV3.styles.d.ts +34 -84
- package/lib/components/ModelCompareV3/ModelCompareV3.styles.js +7 -8
- package/lib/components/ModelCompareV3/ModelCompareV3.styles.js.map +1 -1
- package/lib/components/ModelCompareV3/ModelCompareV3.styles.mjs +7 -8
- package/lib/components/ModelCompareV3/ModelCompareV3.styles.mjs.map +1 -1
- package/lib/components/ModelCompareV3/ModelCompareV3.types.d.ts +0 -1
- package/lib/components/ModelCompareV3/ProductGroupsGrid.js +3 -3
- package/lib/components/ModelCompareV3/ScrollGroup/ScrollGroup.js +5 -5
- package/lib/components/ModelCompareV3/ScrollGroup/context.js +3 -3
- package/lib/components/ModelCompareV3/ScrollGroup/useScrollGroupItem.js +8 -8
- package/lib/components/ModelCompareV3/ScrollGroup/useScrollGroupSetScroll.js +2 -2
- package/lib/components/ModelCompareV3/ScrollGroup/useScrollGroupTo.js +2 -2
- package/lib/components/ModelCompareV3/StickyGrid/StickyGrid.js +7 -7
- package/lib/components/ModelCompareV3/StickyGrid/StickyGridBody.js +2 -2
- package/lib/components/ModelCompareV3/StickyGrid/StickyGridHeader.js +5 -5
- package/lib/components/ModelCompareV3/StickyGrid/StickyGridItem.d.ts +2 -2
- package/lib/components/ModelCompareV3/StickyGrid/StickyGridItem.js +2 -2
- package/lib/components/ModelCompareV3/StickyGrid/StickyGridOverlay.d.ts +1 -1
- package/lib/components/ModelCompareV3/StickyGrid/context.js +3 -3
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/express.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/express.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/express7.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/express7.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udr.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udr.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udr7.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udr7.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/express.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/express.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/express7.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/express7.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/udr.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/udr.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/udr7.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/udr7.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/data/CloudGateways.js +6 -6
- package/lib/components/ModelCompareV3/data/CloudGateways.mjs +4 -4
- package/lib/components/ModelCompareV3/data/EnterpriseSwitching.js +2 -3
- package/lib/components/ModelCompareV3/data/EnterpriseSwitching.js.map +1 -1
- package/lib/components/ModelCompareV3/data/EnterpriseSwitching.mjs +2 -3
- package/lib/components/ModelCompareV3/data/EnterpriseSwitching.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/ProfessionalMaxSwitching.js +3 -10
- package/lib/components/ModelCompareV3/data/ProfessionalMaxSwitching.js.map +1 -1
- package/lib/components/ModelCompareV3/data/ProfessionalMaxSwitching.mjs +3 -10
- package/lib/components/ModelCompareV3/data/ProfessionalMaxSwitching.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/Switching.js +2 -3
- package/lib/components/ModelCompareV3/data/Switching.js.map +1 -1
- package/lib/components/ModelCompareV3/data/Switching.mjs +2 -3
- package/lib/components/ModelCompareV3/data/Switching.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/aggregation.js +0 -7
- package/lib/components/ModelCompareV3/data/products/aggregation.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/aggregation.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/aggregation.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.js +1 -1
- package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.js +0 -7
- package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.js +0 -7
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.js +0 -7
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/express.js +1 -1
- package/lib/components/ModelCompareV3/data/products/express.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/express7.js +1 -1
- package/lib/components/ModelCompareV3/data/products/express7.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.js +0 -7
- package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/missionCritical.js +0 -7
- package/lib/components/ModelCompareV3/data/products/missionCritical.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/missionCritical.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/missionCritical.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalHd24.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalHd24.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalHd24.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalHd24.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalHd24Poe.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalHd24Poe.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalHd24Poe.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalHd24Poe.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax16.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax16.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax16.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax16.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax24.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax24.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax24.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax24.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax48.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax48.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax48.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax48.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.js +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesEnterprise.js +0 -8
- package/lib/components/ModelCompareV3/data/products/switchesEnterprise.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesEnterprise.mjs +0 -8
- package/lib/components/ModelCompareV3/data/products/switchesEnterprise.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessional.js +0 -7
- package/lib/components/ModelCompareV3/data/products/switchesProfessional.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessional.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/switchesProfessional.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalHd.js +0 -7
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalHd.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalHd.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalHd.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.js +1 -10
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.mjs +1 -10
- package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesStandard.js +0 -7
- package/lib/components/ModelCompareV3/data/products/switchesStandard.js.map +1 -1
- package/lib/components/ModelCompareV3/data/products/switchesStandard.mjs +0 -7
- package/lib/components/ModelCompareV3/data/products/switchesStandard.mjs.map +1 -1
- package/lib/components/ModelCompareV3/data/products/udr.js +1 -1
- package/lib/components/ModelCompareV3/data/products/udr.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/udr7.js +1 -1
- package/lib/components/ModelCompareV3/data/products/udr7.mjs +1 -1
- package/lib/components/ModelCompareV3/data/properties/index.d.ts +0 -1
- package/lib/components/ModelCompareV3/data/properties/index.js +0 -2
- package/lib/components/ModelCompareV3/data/properties/index.js.map +1 -1
- package/lib/components/ModelCompareV3/data/properties/index.mjs +0 -1
- package/lib/components/ModelCompareV3/data/properties/index.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/ar.json.js +10 -10
- package/lib/components/ModelCompareV3/translations/ar.json.mjs +10 -10
- package/lib/components/ModelCompareV3/translations/de.json.js +2 -2
- package/lib/components/ModelCompareV3/translations/de.json.mjs +2 -2
- package/lib/components/ModelCompareV3/translations/el.json.js +1 -1
- package/lib/components/ModelCompareV3/translations/el.json.mjs +1 -1
- package/lib/components/ModelCompareV3/translations/en.json.js +0 -2
- package/lib/components/ModelCompareV3/translations/en.json.js.map +1 -1
- package/lib/components/ModelCompareV3/translations/en.json.mjs +0 -2
- package/lib/components/ModelCompareV3/translations/en.json.mjs.map +1 -1
- package/lib/components/ModelCompareV3/translations/es.json.js +2 -2
- package/lib/components/ModelCompareV3/translations/es.json.mjs +2 -2
- package/lib/components/ModelCompareV3/translations/fr.json.js +1 -1
- package/lib/components/ModelCompareV3/translations/fr.json.mjs +1 -1
- package/lib/components/ModelCompareV3/translations/it.json.js +1 -1
- package/lib/components/ModelCompareV3/translations/it.json.mjs +1 -1
- package/lib/components/ModelCompareV3/translations/ja.json.js +7 -7
- package/lib/components/ModelCompareV3/translations/ja.json.mjs +7 -7
- package/lib/components/ModelCompareV3/translations/pt-BR.json.js +1 -1
- package/lib/components/ModelCompareV3/translations/pt-BR.json.mjs +1 -1
- package/lib/components/ModelCompareV3/translations/useModelCompareTranslation.d.ts +2 -2
- package/lib/components/ModelCompareV3/translations/zh-Hans.json.js +5 -5
- package/lib/components/ModelCompareV3/translations/zh-Hans.json.mjs +5 -5
- package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.js +8 -8
- package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.mjs +8 -8
- package/lib/components/NewToUnifiBox/NewToUnifiBox.styles.d.ts +5 -5
- package/lib/components/Pagination/Pagination.js +3 -3
- package/lib/components/Pagination/Pagination.styles.d.ts +4 -4
- package/lib/components/Popover/Popover.styles.d.ts +7 -11
- package/lib/components/PriceRangeSlider/PriceRangeSlider.js +16 -16
- package/lib/components/PriceRangeSlider/PriceRangeSlider.styles.d.ts +7 -7
- package/lib/components/ProductCard/ProductCard.js +7 -7
- package/lib/components/ProductCard/ProductCard.styles.d.ts +16 -16
- package/lib/components/ProductCardPopup/ProductCardPopup.js +8 -8
- package/lib/components/ProductCardPopup/ProductCardPopup.styles.d.ts +37 -45
- package/lib/components/ProductCardPopup/ProductCardPopup.styles.js +3 -3
- package/lib/components/ProductCardPopup/ProductCardPopup.styles.js.map +1 -1
- package/lib/components/ProductCardPopup/ProductCardPopup.styles.mjs +3 -3
- package/lib/components/ProductCardPopup/ProductCardPopup.styles.mjs.map +1 -1
- package/lib/components/ProductCompare/ProductCompare.js +7 -7
- package/lib/components/ProductCompare/ProductCompare.styles.d.ts +18 -18
- package/lib/components/ProductDetails/ProductDetails.js +5 -5
- package/lib/components/ProductDetails/ProductDetails.styles.d.ts +2 -2
- package/lib/components/ProductGrid/ProductGrid.js +10 -10
- package/lib/components/ProductGrid/ProductGrid.styles.d.ts +13 -10
- package/lib/components/ProductKeyFeatures/ProductKeyFeatures.js +3 -3
- package/lib/components/ProductKeyFeatures/ProductKeyFeatures.styles.d.ts +6 -6
- package/lib/components/ProductRecommendedAccessories/ProductRecommendedAccessories.styles.d.ts +9 -11
- package/lib/components/ProductSectionNavigation/ProductSectionNavigation.styles.d.ts +6 -6
- package/lib/components/ProductSectionNavigationV2/ProductSectionNavigation.styles.d.ts +7 -7
- package/lib/components/ProductSectionTabs/ProductSectionTabs.js +2 -2
- package/lib/components/ProductSectionTabs/ProductSectionTabs.styles.d.ts +6 -6
- package/lib/components/ProductTechSpecs/ProductTechSpecs.styles.d.ts +14 -14
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.d.ts +2 -0
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.js +79 -0
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.js.map +1 -0
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.mjs +71 -0
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.mjs.map +1 -0
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.stories.d.ts +5 -0
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.styles.d.ts +11 -0
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.styles.js +86 -0
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.styles.js.map +1 -0
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.styles.mjs +72 -0
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.styles.mjs.map +1 -0
- package/lib/components/ProductTechSpecsV2/ProductTechSpecs.types.d.ts +12 -0
- package/lib/components/ProductTechSpecsV2/index.d.ts +1 -0
- package/lib/components/ProductTechSpecsV2/index.js +6 -0
- package/lib/components/ProductTechSpecsV2/index.js.map +1 -0
- package/lib/components/ProductTechSpecsV2/index.mjs +3 -0
- package/lib/components/ProductTechSpecsV2/index.mjs.map +1 -0
- package/lib/components/ProductUpsell/ProductUpsell.styles.d.ts +18 -20
- package/lib/components/ProductWizard/Options/Options.js +3 -3
- package/lib/components/ProductWizard/Options/Options.styles.d.ts +2 -2
- package/lib/components/ProductWizard/ProductWizard.js +2 -2
- package/lib/components/ProductWizard/ProductWizard.styles.d.ts +16 -22
- package/lib/components/ProductWizardFootnotes/ProductWizardFootnotes.js +10 -10
- package/lib/components/ProductWizardFootnotes/ProductWizardFootnotes.js.map +1 -1
- package/lib/components/ProductWizardFootnotes/ProductWizardFootnotes.mjs +5 -5
- package/lib/components/ProductWizardFootnotes/ProductWizardFootnotes.mjs.map +1 -1
- package/lib/components/ProductWizardFootnotes/ProductWizardFootnotes.styles.d.ts +9 -9
- package/lib/components/ProductWizardFootnotes/ProductWizardFootnotes.styles.js +1 -1
- package/lib/components/ProductWizardFootnotes/ProductWizardFootnotes.styles.js.map +1 -1
- package/lib/components/ProductWizardFootnotes/ProductWizardFootnotes.styles.mjs +1 -1
- package/lib/components/ProductWizardFootnotes/ProductWizardFootnotes.styles.mjs.map +1 -1
- package/lib/components/ProgressCircle/ProgressCircle.js +4 -4
- package/lib/components/QuantityControls/QuantityControls.js +6 -6
- package/lib/components/QuantityControls/QuantityControls.js.map +1 -1
- package/lib/components/QuantityControls/QuantityControls.mjs +2 -2
- package/lib/components/QuantityControls/QuantityControls.mjs.map +1 -1
- package/lib/components/QuantityControls/QuantityControls.styles.d.ts +2 -2
- package/lib/components/QuantityControls/QuantityControls.types.d.ts +1 -1
- package/lib/components/QuantityInput/QuantityInput.js +6 -1
- package/lib/components/QuantityInput/QuantityInput.js.map +1 -1
- package/lib/components/QuantityInput/QuantityInput.mjs +6 -1
- package/lib/components/QuantityInput/QuantityInput.mjs.map +1 -1
- package/lib/components/QuantityInput/QuantityInput.styles.d.ts +12 -16
- package/lib/components/RelatedProducts/RelatedProducts.js +5 -5
- package/lib/components/RelatedProducts/RelatedProducts.styles.d.ts +14 -14
- package/lib/components/RelatedProducts/RelatedProducts.styles.js +2 -2
- package/lib/components/RelatedProducts/RelatedProducts.styles.js.map +1 -1
- package/lib/components/RelatedProducts/RelatedProducts.styles.mjs +2 -2
- package/lib/components/RelatedProducts/RelatedProducts.styles.mjs.map +1 -1
- package/lib/components/RelatedProductsVariantSelector/RelatedProductsVariantSelector.styles.d.ts +21 -23
- package/lib/components/RelatedProductsVariantSelectorV1/RelatedProductsVariantSelector.styles.d.ts +16 -36
- package/lib/components/RelatedProductsVariantSelectorV2/RelatedProductsVariantSelector.styles.d.ts +16 -38
- package/lib/components/RelatedProductsVariantSelectorsV2/RelatedProductsVariantSelectors.styles.d.ts +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js +2 -602
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs +2 -598
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.js +36 -36
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.styles.d.ts +6 -6
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.d.ts +1 -5
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js +0 -4
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs +0 -4
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.js +12 -12
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.d.ts +13 -13
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +5 -5
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.d.ts +20 -20
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CheckboxSection.js +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.js +6 -6
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/Layout.styles.d.ts +6 -6
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/SliderSection.js +3 -3
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +7 -7
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.styles.d.ts +9 -9
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.js +6 -6
- package/lib/components/ResourceCalculatorV1/PoeCalculator/PoeCalculator.js +9 -9
- package/lib/components/ResourceCalculatorV1/PoeCalculator/PoeCalculator.styles.d.ts +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/DesignCenterBanner/DesignCenterBanner.styles.d.ts +5 -5
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerConfigurator.js +10 -10
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerConfigurator.styles.d.ts +10 -10
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +17 -17
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.styles.d.ts +17 -19
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/RecommendedPoeSwitches.js +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/RecommendedPoeSwitches.styles.d.ts +16 -16
- package/lib/components/ResourceCalculatorV1/ResourceCalculator.js +6 -6
- package/lib/components/ResourceCalculatorV1/ResourceCalculator.styles.d.ts +3 -3
- package/lib/components/ResourceCalculatorV1/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.d.ts +3 -3
- package/lib/components/ResourceCalculatorV1/translations/en.json.js +1 -5
- package/lib/components/ResourceCalculatorV1/translations/en.json.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/translations/en.json.mjs +1 -5
- package/lib/components/ResourceCalculatorV1/translations/en.json.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/translations/useResourceCalculatorTranslation.d.ts +2 -2
- package/lib/components/ReverseLoopingVideo/ReverseLoopingVideo.js +5 -5
- package/lib/components/ReverseLoopingVideo/ReverseLoopingVideo.styles.d.ts +3 -3
- package/lib/components/ScrollWrapper/ScrollWrapper.d.ts +1 -1
- package/lib/components/ScrollWrapper/ScrollWrapper.js +34 -26
- package/lib/components/ScrollWrapper/ScrollWrapper.js.map +1 -1
- package/lib/components/ScrollWrapper/ScrollWrapper.mjs +16 -8
- package/lib/components/ScrollWrapper/ScrollWrapper.mjs.map +1 -1
- package/lib/components/ScrollWrapper/ScrollWrapper.styles.d.ts +14 -18
- package/lib/components/ScrollWrapper/ScrollWrapper.types.d.ts +2 -0
- package/lib/components/Search/Input/Input.d.ts +1 -1
- package/lib/components/Search/Input/Input.js +8 -8
- package/lib/components/Search/Input/Input.js.map +1 -1
- package/lib/components/Search/Input/Input.mjs +4 -4
- package/lib/components/Search/Input/Input.mjs.map +1 -1
- package/lib/components/Search/Input/Input.styles.d.ts +11 -13
- package/lib/components/Search/Input/Input.styles.js +1 -2
- package/lib/components/Search/Input/Input.styles.js.map +1 -1
- package/lib/components/Search/Input/Input.styles.mjs +1 -2
- package/lib/components/Search/Input/Input.styles.mjs.map +1 -1
- package/lib/components/Search/Input/Input.types.d.ts +3 -2
- package/lib/components/Search/Modal/Modal.js +3 -3
- package/lib/components/Search/Modal/Modal.styles.d.ts +18 -20
- package/lib/components/SearchInput/Input.styles.d.ts +7 -9
- package/lib/components/SkeletonFootnote/SkeletonFootnote.d.ts +1 -1
- package/lib/components/SkeletonLoader/SkeletonCircleLoader/SkeletonCircleLoader.styles.d.ts +3 -3
- package/lib/components/SkeletonLoader/SkeletonLinearLoader/SkeletonLinearLoader.styles.d.ts +3 -3
- package/lib/components/SkeletonLoader/SkeletonLoaderTable/SkeletonLoaderTable.styles.d.ts +8 -8
- package/lib/components/StaticModal/StaticModal.styles.d.ts +2 -2
- package/lib/components/StorageSliders/Slider/Slider.js +3 -3
- package/lib/components/StorageSliders/Slider/Slider.styles.d.ts +5 -7
- package/lib/components/StorageSliders/StorageSliders.context.js +20 -20
- package/lib/components/StorageSliders/StorageSliders.js +4 -4
- package/lib/components/StorageSliders/StorageSliders.styles.d.ts +12 -12
- package/lib/components/StorybookUtils/StoryButtonColumn.d.ts +1 -1
- package/lib/components/StorybookUtils/StoryButtonRow.d.ts +1 -1
- package/lib/components/StorybookUtils/StoryWrapper.d.ts +2 -2
- package/lib/components/TabinationButtons/TabinationButtons.styles.d.ts +9 -9
- package/lib/components/Toggle/Toggle.styles.d.ts +3 -3
- package/lib/components/Toggle/Toggle.styles.js +1 -1
- package/lib/components/Toggle/Toggle.styles.js.map +1 -1
- package/lib/components/Toggle/Toggle.styles.mjs +1 -1
- package/lib/components/Toggle/Toggle.styles.mjs.map +1 -1
- package/lib/components/Tooltip/Tooltip.js +5 -5
- package/lib/components/Tooltip/Tooltip.styles.d.ts +3 -33
- package/lib/components/TopologyScheme/TopologyScheme.styles.d.ts +17 -17
- package/lib/components/UICare/UICare.styles.d.ts +16 -19
- package/lib/components/VariantSelector/CheckBox/CheckBox.styles.d.ts +6 -6
- package/lib/components/VariantSelector/Variant/BundleOffer/BundleOffer.styles.d.ts +7 -7
- package/lib/components/VariantSelector/Variant/Compatibility/Compatibility.js +7 -7
- package/lib/components/VariantSelector/Variant/Compatibility/Compatibility.styles.d.ts +18 -18
- package/lib/components/VariantSelector/Variant/Variant.js +40 -40
- package/lib/components/VariantSelector/Variant/Variant.styles.d.ts +65 -75
- package/lib/components/VariantSelector/VariantSelector.js +16 -16
- package/lib/components/VariantSelector/VariantSelector.styles.d.ts +13 -17
- package/lib/components/VariantSelectorItem/VariantSelectorItem.styles.d.ts +3 -3
- package/lib/components/VariantSelectorV1/VariantSelector.styles.d.ts +28 -32
- package/lib/components/VariantSelectorV2/VariantSelector.styles.d.ts +19 -23
- package/lib/components/VideoCookiesConsent/VideoCookiesConsent.styles.d.ts +6 -8
- package/lib/components/VideoPlayer/VideoPlayer.styles.d.ts +5 -5
- package/lib/components/VideoPlayerNew/VideoPlayer.js +20 -20
- package/lib/components/VideoPlayerNew/VideoPlayer.mjs +1 -1
- package/lib/components/VideoPlayerNew/VideoPlayer.styles.d.ts +28 -31
- package/lib/components/VideoPlayerNew/VideoPlayer.styles.js +2 -2
- package/lib/components/VideoPlayerNew/VideoPlayer.styles.js.map +1 -1
- package/lib/components/VideoPlayerNew/VideoPlayer.styles.mjs +2 -2
- package/lib/components/VideoPlayerNew/VideoPlayer.styles.mjs.map +1 -1
- package/lib/components/VideoPlayerNew/assets/close.svg.js +1 -1
- package/lib/components/VideoPlayerNew/assets/close.svg.mjs +2 -2
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +2 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/index.mjs +2 -0
- package/lib/components/index.mjs.map +1 -1
- package/lib/{components/ResourceCalculatorV1/assets/consoles/udr7.png.js → constants/icons/header/arrow.svg.js} +6 -6
- package/lib/constants/icons/header/arrow.svg.js.map +1 -0
- package/lib/constants/icons/header/arrow.svg.mjs +3 -0
- package/lib/constants/icons/header/arrow.svg.mjs.map +1 -0
- package/lib/constants/icons/header/index.d.ts +1 -0
- package/lib/constants/icons/header/index.js +9 -0
- package/lib/constants/icons/header/index.js.map +1 -1
- package/lib/constants/icons/header/index.mjs +2 -0
- package/lib/constants/icons/header/index.mjs.map +1 -1
- package/lib/constants/icons/options/colors/black.svg.js +5 -5
- package/lib/constants/icons/options/colors/index.js +3 -3
- package/lib/constants/icons/options/styles/black.svg.js +5 -5
- package/lib/constants/icons/options/styles/index.js +3 -3
- package/lib/constants/mixin.d.ts +3 -3
- package/lib/constants/optionIcons.js +6 -6
- package/lib/constants/optionIcons.mjs +4 -4
- package/lib/constants/proStoreCategories/mapping/filters.d.ts +17 -0
- package/lib/constants/proStoreCategories/mapping/filters.js +17 -0
- package/lib/constants/proStoreCategories/mapping/filters.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/filters.mjs +17 -0
- package/lib/constants/proStoreCategories/mapping/filters.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.d.ts +3 -0
- package/lib/constants/proStoreCategories/mapping/index.js +25 -6
- package/lib/constants/proStoreCategories/mapping/index.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.mjs +25 -6
- package/lib/constants/proStoreCategories/mapping/index.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/mapping.d.ts +5 -0
- package/lib/constants/proStoreCategories/mapping/unifi.d.ts +3 -0
- package/lib/constants/proStoreCategories/mapping/unifi.js +3 -0
- package/lib/constants/proStoreCategories/mapping/unifi.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.mjs +3 -0
- package/lib/constants/proStoreCategories/mapping/unifi.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/ar.json.js +9 -5
- package/lib/constants/proStoreCategories/translations/ar.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/ar.json.mjs +9 -5
- package/lib/constants/proStoreCategories/translations/ar.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/de.json.js +7 -3
- package/lib/constants/proStoreCategories/translations/de.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/de.json.mjs +7 -3
- package/lib/constants/proStoreCategories/translations/de.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/el.json.js +9 -5
- package/lib/constants/proStoreCategories/translations/el.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/el.json.mjs +9 -5
- package/lib/constants/proStoreCategories/translations/el.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/en.json.js +5 -0
- package/lib/constants/proStoreCategories/translations/en.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/en.json.mjs +5 -1
- package/lib/constants/proStoreCategories/translations/en.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/es.json.js +8 -4
- package/lib/constants/proStoreCategories/translations/es.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/es.json.mjs +8 -4
- package/lib/constants/proStoreCategories/translations/es.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/fr.json.js +8 -1
- package/lib/constants/proStoreCategories/translations/fr.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/fr.json.mjs +8 -2
- package/lib/constants/proStoreCategories/translations/fr.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/it.json.js +8 -4
- package/lib/constants/proStoreCategories/translations/it.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/it.json.mjs +8 -4
- package/lib/constants/proStoreCategories/translations/it.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/ja.json.js +8 -4
- package/lib/constants/proStoreCategories/translations/ja.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/ja.json.mjs +8 -4
- package/lib/constants/proStoreCategories/translations/ja.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/pt-BR.json.js +7 -3
- package/lib/constants/proStoreCategories/translations/pt-BR.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/pt-BR.json.mjs +7 -3
- package/lib/constants/proStoreCategories/translations/pt-BR.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.js +8 -1
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs +8 -2
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js +8 -1
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs +8 -2
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs.map +1 -1
- package/lib/constants/proStoreFilters/mapping.d.ts +44 -8
- package/lib/constants/proStoreFilters/mapping.js +130 -16
- package/lib/constants/proStoreFilters/mapping.js.map +1 -1
- package/lib/constants/proStoreFilters/mapping.mjs +130 -16
- package/lib/constants/proStoreFilters/mapping.mjs.map +1 -1
- package/lib/constants/theme.js +4 -0
- package/lib/constants/theme.js.map +1 -1
- package/lib/constants/theme.mjs +4 -0
- package/lib/constants/theme.mjs.map +1 -1
- package/lib/contexts/MenuContext/context.js +34 -34
- package/lib/contexts/MenuContext/context.js.map +1 -1
- package/lib/contexts/MenuContext/context.mjs +1 -1
- package/lib/contexts/MenuContext/context.mjs.map +1 -1
- package/lib/contexts/MenuContext/mapping.js.map +1 -1
- package/lib/contexts/MenuContext/mapping.mjs.map +1 -1
- package/lib/contexts/MenuContext/presets.d.ts +1 -1
- package/lib/contexts/MenuContext/presets.js +2 -4
- package/lib/contexts/MenuContext/presets.js.map +1 -1
- package/lib/contexts/MenuContext/presets.mjs +2 -4
- package/lib/contexts/MenuContext/presets.mjs.map +1 -1
- package/lib/helpers/index.d.ts +0 -1
- package/lib/helpers/index.js +1 -11
- package/lib/helpers/index.js.map +1 -1
- package/lib/helpers/index.mjs +1 -2
- package/lib/helpers/index.mjs.map +1 -1
- package/lib/helpers/proStoreCategories.js +2 -2
- package/lib/helpers/ux.d.ts +8 -0
- package/lib/helpers/ux.js +15 -0
- package/lib/helpers/ux.js.map +1 -1
- package/lib/helpers/ux.mjs +15 -1
- package/lib/helpers/ux.mjs.map +1 -1
- package/lib/hooks/useHasTouch.js +3 -3
- package/lib/hooks/useHddRetentionCalculator.js +5 -5
- package/lib/hooks/useHorizontalScroll.js +2 -2
- package/lib/hooks/useLockBodyScrollCustom.js +3 -3
- package/lib/hooks/useScrollToY.js +2 -2
- package/lib/hooks/useTestMediaElementVolumeSetter.js +3 -3
- package/lib/hooks/useTranslation.js +6 -6
- package/lib/types/generated.d.ts +1 -1
- package/lib/types/generated.js.map +1 -1
- package/lib/types/generated.mjs.map +1 -1
- package/lib/types/index.d.ts +0 -1
- package/lib/types/index.js +0 -2
- package/lib/types/index.js.map +1 -1
- package/lib/types/index.mjs +0 -1
- package/lib/types/index.mjs.map +1 -1
- package/lib/utils/address.d.ts +62 -278
- package/lib/utils/address.js +8 -11
- package/lib/utils/address.js.map +1 -1
- package/lib/utils/address.mjs +8 -11
- package/lib/utils/address.mjs.map +1 -1
- package/lib/utils/array.d.ts +0 -4
- package/lib/utils/array.js +0 -10
- package/lib/utils/array.js.map +1 -1
- package/lib/utils/array.mjs +1 -10
- package/lib/utils/array.mjs.map +1 -1
- package/lib/utils/nextjs/ssr/registry.js +2 -2
- package/package.json +43 -42
- package/lib/assets/crestron.svg +0 -3
- package/lib/assets/icons/menu/icon-globe.svg.js.map +0 -1
- package/lib/assets/icons/menu/icon-globe.svg.mjs +0 -3
- package/lib/assets/icons/menu/icon-globe.svg.mjs.map +0 -1
- package/lib/assets/ucg-fiber.png +0 -0
- package/lib/assets/udr7.png +0 -0
- package/lib/assets/ux.png +0 -0
- package/lib/assets/ux7.png +0 -0
- package/lib/components/ModelCompareV3/assets/crestron.svg.js.map +0 -1
- package/lib/components/ModelCompareV3/assets/crestron.svg.mjs +0 -3
- package/lib/components/ModelCompareV3/assets/crestron.svg.mjs.map +0 -1
- package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.d.ts +0 -2
- package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.js +0 -18
- package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.js.map +0 -1
- package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.mjs +0 -10
- package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.mjs.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-fiber.png.js +0 -27
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-fiber.png.js.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-fiber.png.mjs +0 -3
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-fiber.png.mjs.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/udr7.png.js.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/udr7.png.mjs +0 -3
- package/lib/components/ResourceCalculatorV1/assets/consoles/udr7.png.mjs.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/ux.png.js +0 -27
- package/lib/components/ResourceCalculatorV1/assets/consoles/ux.png.js.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/ux.png.mjs +0 -3
- package/lib/components/ResourceCalculatorV1/assets/consoles/ux.png.mjs.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/ux7.png.js +0 -27
- package/lib/components/ResourceCalculatorV1/assets/consoles/ux7.png.js.map +0 -1
- package/lib/components/ResourceCalculatorV1/assets/consoles/ux7.png.mjs +0 -3
- package/lib/components/ResourceCalculatorV1/assets/consoles/ux7.png.mjs.map +0 -1
- package/lib/helpers/product.d.ts +0 -87
- package/lib/helpers/product.js +0 -346
- package/lib/helpers/product.js.map +0 -1
- package/lib/helpers/product.mjs +0 -335
- package/lib/helpers/product.mjs.map +0 -1
- package/lib/helpers/product.test.d.ts +0 -1
- package/lib/types/product.d.ts +0 -87
- package/lib/types/product.js +0 -14
- package/lib/types/product.js.map +0 -1
- package/lib/types/product.mjs +0 -13
- package/lib/types/product.mjs.map +0 -1
- package/lib/utils/productSort.d.ts +0 -41
- package/lib/utils/productSort.js +0 -67
- package/lib/utils/productSort.js.map +0 -1
- package/lib/utils/productSort.mjs +0 -60
- package/lib/utils/productSort.mjs.map +0 -1
- package/lib/utils/validations/lastNameSuperRefinement.d.ts +0 -11
- package/lib/utils/validations/lastNameSuperRefinement.js +0 -25
- package/lib/utils/validations/lastNameSuperRefinement.js.map +0 -1
- package/lib/utils/validations/lastNameSuperRefinement.mjs +0 -21
- package/lib/utils/validations/lastNameSuperRefinement.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.js","sources":["../../../src/contexts/MenuContext/context.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport type { ReactNode } from \"react\";\nimport { useMedia } from \"react-use\";\n\nimport { BREAKPOINTS } from \"../../constants/layout\";\nimport { useLockBodyScrollCustom } from \"../../hooks/useLockBodyScrollCustom\";\nimport type { GlobalStoreId } from \"../../types\";\nimport { checkUnreachable } from \"../../utils/errors\";\nimport type {\n DeployedLanguages,\n Language,\n NavigationItem,\n NavigationSectionType,\n NavigationSubItem,\n NavigationSubSubItem,\n SiteUrl,\n} from \"./mapping\";\nimport {\n DEFAULT_LANGUAGE,\n DEFAULT_STORE_ID,\n GENERIC_SITE_IDS,\n LONG_LANGUAGES,\n NAVIGATION_MAPPING,\n SiteId,\n} from \"./mapping\";\nimport type {\n GlobalSiteConfig,\n MenuContextValue,\n ParsedNavigationItem,\n ParsedNavigationSection,\n ParsedNavigationSubItem,\n ParsedNavigationSubSubItem,\n} from \"./types\";\nimport { ModalId } from \"./types\";\nimport {\n findFirstPossibleDeepNestedItemUrl,\n getGlobalSiteConfig,\n getLanguageDirection,\n getSubItemUrl,\n isPartOfUrlPathname,\n parseSiteUrl,\n} from \"./utils\";\n\nexport const MenuContext = createContext<MenuContextValue | null>(null);\n\nexport const MenuContextProvider = ({\n context,\n pathname: currentPathname = \"/\",\n storeId = DEFAULT_STORE_ID,\n hasSsrCapability = false,\n hash: currentHash = \"\",\n language = DEFAULT_LANGUAGE,\n globalSiteConfig,\n children,\n}: {\n /**\n * Set how the navigation behave as - ui.com/store/uisp.com/...\n */\n context: SiteId;\n /**\n * Base url for menu item paths\n * e.g. https://ecomm.stg.ui.com/ca/en/\n * e.g. window.location.origin\n *\n * ! Not specified on microsites !\n */\n baseUrl?: string | URL;\n /**\n * Pathname of the current url\n * Used as a prop to be in sync with e.g. next\n */\n pathname?: string;\n /**\n * Hash of the current URL (the part of the URL that starts with #)\n */\n hash?: string;\n /**\n * Store context for determining which path to use\n * Will fall-back to US if not found\n * @example GlobalStoreId.Ca\n */\n storeId?: GlobalStoreId;\n /**\n * Indicates if consumer project has capability of doing SSR\n */\n hasSsrCapability?: boolean;\n /**\n * (optionally) Hints which language currently us currently in use\n */\n language?: Language;\n /**\n * Global Site Config that define available urls/languages/regions enabled for globally\n */\n globalSiteConfig: GlobalSiteConfig;\n\n children: ReactNode;\n}): JSX.Element => {\n const isMobile = useMedia(\n BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN,\n false, // Fallback value for SSR\n );\n\n // #############################################################################\n // Global site config\n // #############################################################################\n const getSiteConfig = useCallback(\n (siteId: SiteId, storeIdOverride?: GlobalStoreId) =>\n getGlobalSiteConfig(globalSiteConfig, siteId, storeIdOverride ?? storeId),\n [globalSiteConfig, storeId],\n );\n\n const currentSiteConfig = useMemo(\n // Generic site doesn't have a site config\n () => getSiteConfig(context),\n [context, getSiteConfig],\n );\n\n // #############################################################################\n // Language\n // #############################################################################\n const deployedLanguages = useMemo<DeployedLanguages | []>(() => {\n return (\n currentSiteConfig.languages ??\n [\n /** Left empty as that indicates given site doesn't implement multiple language AT ALL. For example store would\n * have single language for now, but UISP doesn't have at all.\n */\n ]\n );\n }, [currentSiteConfig.languages]);\n\n const isMultiLanguage = useMemo((): boolean => {\n return deployedLanguages.length > 1;\n }, [deployedLanguages]);\n\n const isLongLanguage = useMemo(\n () => LONG_LANGUAGES.includes(language),\n [language],\n );\n\n // #############################################################################\n // Track if is first render (SSR) to normalise first rendering between server <--> client for code that is shared\n // between microsites and store. To support both scenario's initial state is set by prop\n // #############################################################################\n const [isSsr, setIsSsr] = useState(hasSsrCapability);\n\n useEffect(() => {\n setIsSsr(false);\n }, []);\n\n // #############################################################################\n // Store base URL\n // #############################################################################\n const storeBaseUrl = useMemo(\n () => getSiteConfig(SiteId.Store).baseUrl,\n [getSiteConfig],\n );\n\n // #############################################################################\n // Menu motif\n // #############################################################################\n const [motif, setMotif] = useState<MenuContextValue[\"motif\"]>(\"light\");\n\n /**\n * Helper to ensure a correct motif is set\n * TODO: maybe check which parts uses it, can we maybe just consolidate the logic within the context itself?\n */\n const handleSetMotif = useCallback((motif: Motif) => {\n if ([\"light\", \"dark\"].includes(motif)) {\n setMotif(motif);\n }\n }, []);\n\n // #############################################################################\n // Nav context\n // #############################################################################\n const isMicrositeContext: MenuContextValue[\"isMicrositeContext\"] =\n useMemo(() => {\n // Type-safe detection for context\n switch (context) {\n case null:\n case undefined:\n case SiteId.Ui:\n case SiteId.Uisp:\n case SiteId.ExpertsUi:\n case SiteId.ExpertsUisp:\n case SiteId.Uwc:\n case SiteId.TechSpecs:\n case SiteId.Blog:\n case SiteId.Generic: {\n return true;\n }\n case SiteId.Amplifi:\n case SiteId.Store: {\n return false;\n }\n default: {\n // Fallback to true as well\n checkUnreachable(context);\n return true;\n }\n }\n }, [context]);\n\n // #############################################################################\n // Active modal\n // #############################################################################\n // eslint-disable-next-line react/hook-use-state\n const [{ activeModal, prevActiveModal }, _setActiveModal] = useState<{\n activeModal: MenuContextValue[\"activeModal\"];\n prevActiveModal: MenuContextValue[\"prevActiveModal\"];\n }>({\n activeModal: null,\n prevActiveModal: null,\n });\n\n const setActiveModal = useCallback<MenuContextValue[\"setActiveModal\"]>(\n (id) => {\n _setActiveModal({\n activeModal: id,\n prevActiveModal: activeModal,\n });\n },\n [activeModal],\n );\n\n // Reset modals on viewport change\n useEffect(() => {\n if (\n !isMobile &&\n activeModal &&\n [ModalId.MobileMenu, ModalId.ProMobileMenu, ModalId.Search].includes(\n activeModal,\n )\n ) {\n setActiveModal(null);\n }\n }, [activeModal, isMobile, setActiveModal]);\n\n // Body lock for specific modals\n useLockBodyScrollCustom(\n !!activeModal &&\n [ModalId.MobileMenu, ModalId.ProMobileMenu].includes(activeModal),\n );\n\n // #############################################################################\n // Parse router parameters\n // #############################################################################\n // Parse the collection slug as route path\n const currentCollectionPath = useMemo((): string | undefined => {\n const url = new URL(currentPathname, storeBaseUrl);\n const matches = /(\\/collections\\/[\\w-]+)/i.exec(url.pathname);\n\n return matches?.[1];\n }, [storeBaseUrl, currentPathname]);\n\n const currentProductPath = useMemo((): string | undefined => {\n const url = new URL(currentPathname, storeBaseUrl);\n const matches = /((\\/collections\\/.+)?\\/products\\/[\\w-]+)/i.exec(\n url.pathname,\n );\n\n return matches?.[1];\n }, [storeBaseUrl, currentPathname]);\n\n const isPathnameActive = useCallback(\n (pathname: string): boolean => {\n // Don't do matching for generic site contexts\n if (GENERIC_SITE_IDS.includes(context)) {\n return false;\n }\n\n if (isMicrositeContext) {\n // HACK microsites can have paths with and without regional prefixes\n const optional = pathname === \"/\" ? \"?\" : \"\";\n const micrositeRegExp = new RegExp(\n `^(?:/\\\\w{2})?${pathname}${optional}$`,\n );\n return micrositeRegExp.test(currentPathname);\n }\n\n return (\n (!!currentCollectionPath &&\n isPartOfUrlPathname(pathname, currentCollectionPath)) ||\n (!!currentProductPath &&\n isPartOfUrlPathname(pathname, currentProductPath))\n );\n },\n [\n context,\n isMicrositeContext,\n currentCollectionPath,\n currentProductPath,\n currentPathname,\n ],\n );\n\n const isSiteUrlActive = useCallback(\n (url: SiteUrl): boolean => {\n return (\n isMicrositeContext &&\n // While SiteId is considered a microsite we don't want url matching for it\n !GENERIC_SITE_IDS.includes(context) &&\n url &&\n url[0] !== SiteId.Store &&\n url[0] === context &&\n isPartOfUrlPathname(currentPathname, url[1]) &&\n // If there's a hash in the SiteUrl, it should match the current hash for the item to be active\n (!url[3] || currentHash.replace(/^#/, \"\") === url[3])\n );\n },\n [context, currentHash, currentPathname, isMicrositeContext],\n );\n\n // #############################################################################\n // Menu sections and items\n // #############################################################################\n const createSiteUrl = useCallback(\n (siteUrl: SiteUrl) => {\n // Don't add store and language search param for navigation with generic context\n const addSiteConfigReferenceSearchParams =\n !GENERIC_SITE_IDS.includes(context);\n\n const [siteId] = siteUrl;\n\n const targetSiteConfig = getSiteConfig(siteId);\n\n return parseSiteUrl({\n siteUrl,\n storeId,\n addSiteConfigReferenceSearchParams,\n language,\n targetSiteConfig,\n context,\n });\n },\n [context, getSiteConfig, storeId, language],\n );\n\n const parseSubSubRecursiveItems = useCallback(\n (subSubItem: NavigationSubSubItem): ParsedNavigationSubSubItem | null => {\n // Sub-sub-items\n const nestedSubSubItems =\n \"items\" in subSubItem && subSubItem.items\n ? subSubItem.items\n .map(parseSubSubRecursiveItems)\n .filter((el): el is ParsedNavigationSubSubItem => !!el)\n : [];\n\n const url =\n isMicrositeContext && subSubItem.url\n ? createSiteUrl(subSubItem.url)\n : // TODO: maybe need to improve to get first \"available\" child not the first form array, not sure if the\n // parseItemsFn filters them already out\n (findFirstPossibleDeepNestedItemUrl(nestedSubSubItems) ??\n (subSubItem.url && createSiteUrl(subSubItem.url)));\n\n if (!url) {\n return null;\n }\n\n const active =\n (subSubItem.url && isSiteUrlActive(subSubItem.url)) ||\n // Any child item is active\n nestedSubSubItems.some((el) => el.active);\n\n return {\n id: subSubItem.id,\n label: subSubItem.label,\n // subLabel: subSubItem.subLabel,\n icon: subSubItem.icon,\n mobileIcon: subSubItem.mobileIcon,\n isNew: subSubItem.isNew,\n active,\n url,\n possible:\n \"items\" in subSubItem\n ? nestedSubSubItems.some((item) => item.possible)\n : // If gotten this far fallback to true\n true,\n items: nestedSubSubItems,\n };\n },\n [isMicrositeContext, createSiteUrl, isSiteUrlActive],\n );\n\n const parseSubSubMenuItems = useCallback(\n (subItem: NavigationSubItem): ParsedNavigationSubSubItem[] => {\n return (\"items\" in subItem ? subItem.items : [])\n .map(parseSubSubRecursiveItems)\n .filter((el): el is ParsedNavigationSubSubItem => !!el);\n },\n [parseSubSubRecursiveItems],\n );\n\n const parseSubMenuItem = useCallback(\n (subItem: NavigationSubItem): ParsedNavigationSubItem | null => {\n const subItemUrl = getSubItemUrl(subItem, isSiteUrlActive);\n\n // Append the new pathname (e.g. when /ca/en already exists)\n const url = subItemUrl ? new URL(createSiteUrl(subItemUrl)) : null;\n\n if (!url) {\n return null;\n }\n\n // Sub-sub-items\n const subSubItems = parseSubSubMenuItems(subItem);\n\n // Parse item active state\n const subItemActive =\n // Site url is active\n (subItem.url && isSiteUrlActive(subItem.url)) ||\n // Any child item is active\n subSubItems.some((el) => el.active);\n\n return {\n id: subItem.id,\n label: subItem.label,\n subLabel: subItem.subLabel,\n subLabelTheme: subItem.subLabelTheme,\n subLabelCollapseMode: subItem.subLabelCollapseMode,\n isNew: subItem.isNew,\n icon: subItem.icon,\n mobileIcon: subItem.mobileIcon,\n invisible: subItem.invisible,\n\n url: url.toString(),\n active: subItemActive,\n\n possible:\n subSubItems.length === 0 || subSubItems.some((item) => item.possible),\n items: subSubItems,\n };\n },\n [isSiteUrlActive, createSiteUrl, parseSubSubMenuItems],\n );\n\n const parseMenuItem = useCallback(\n (item: NavigationItem): ParsedNavigationItem => {\n // Parse sub-items\n const subItems = item.items\n .map(parseSubMenuItem)\n .filter((subItem): subItem is ParsedNavigationSubItem => !!subItem);\n\n // Parse main item active state when in microsite context\n let itemActive = false;\n\n // Custom logic just for microsites to detect if we have to open the 2nd layer navigation\n if (\n isMicrositeContext &&\n // While SiteId is considered a microsite we don't want url matching for it\n !GENERIC_SITE_IDS.includes(context) &&\n item.url &&\n item.url[0] === context &&\n item.url[0] !== SiteId.Store &&\n isPartOfUrlPathname(currentPathname, item.url[1])\n ) {\n itemActive = true;\n }\n\n /**\n * Main item url\n * If it is a microsite context, we use the site url if available.\n * If not in microsite context we use the store url if available and\n * fallback to site URL, then fallback URL and lastly to base URL.\n */\n const url =\n isMicrositeContext && item.url\n ? createSiteUrl(item.url)\n : // TODO: maybe need to improve to get first \"available\" child not the first form array, not sure if the\n // parseItemsFn filters them already out\n (findFirstPossibleDeepNestedItemUrl(subItems) ??\n ((item.url && createSiteUrl(item.url)) ||\n (item.fallbackUrl && createSiteUrl(item.fallbackUrl)) ||\n storeBaseUrl.toString()));\n\n // Result\n return {\n ...item,\n items: subItems,\n url,\n active: itemActive || subItems.some((subItem) => subItem.active),\n possible:\n subItems.length === 0 || subItems.some((item) => item.possible),\n };\n },\n [\n parseSubMenuItem,\n isMicrositeContext,\n context,\n currentPathname,\n createSiteUrl,\n storeBaseUrl,\n ],\n );\n\n // Navigation parsing\n const navigation: MenuContextValue[\"navigation\"] = useMemo(() => {\n const parseItemsFn = (items: NavigationItem[]) => items.map(parseMenuItem);\n\n const parseSection = (\n sectionType: keyof typeof NAVIGATION_MAPPING,\n ): ParsedNavigationSection => {\n const section = NAVIGATION_MAPPING[sectionType];\n const parsedItems = parseItemsFn(section.items ?? []);\n\n const url = section.url ? createSiteUrl(section.url) : null;\n\n const finalUrl =\n url ||\n // TODO: maybe need to improve to get first \"available\" child not the first form array, not sure if the\n // parseItemsFn filters them already out\n findFirstPossibleDeepNestedItemUrl(parsedItems) ||\n (!section.url && createSiteUrl(section.fallbackUrl)) ||\n storeBaseUrl.toString();\n\n return {\n label: section.label,\n type: sectionType,\n url: finalUrl,\n active: parsedItems.some((el) => el.active),\n possible:\n parsedItems.length === 0 || parsedItems.some((item) => item.possible),\n items: parsedItems,\n };\n };\n\n const primary = parseSection(\"primary\");\n const secondary = parseSection(\"secondary\");\n\n // Active value - only one section can be active\n if (secondary.active) {\n primary.active = false;\n } else if (primary.active) {\n secondary.active = false;\n }\n\n return {\n primary,\n secondary,\n };\n }, [parseMenuItem, createSiteUrl, storeBaseUrl]);\n\n const activeNavigationSectionType = useMemo<NavigationSectionType>(() => {\n /**\n * First attempt to derive active section based on active navigation\n */\n if (navigation.primary.active) {\n return \"primary\";\n }\n if (navigation.secondary.active) {\n return \"secondary\";\n }\n\n /**\n * Fallback to check against context id if we can't match it on path\n * Only uisp.com and experts.uisp.com uses \"secondary\" as default\n * TODO: should move this logic into \"navigation\" memo fn so both states are in sync\n */\n return [SiteId.Uisp, SiteId.ExpertsUisp].includes(context)\n ? \"secondary\"\n : \"primary\";\n }, [context, navigation.primary.active, navigation.secondary.active]);\n\n // Define active sections\n const activeNavigationSection: MenuContextValue[\"activeNavigationSection\"] =\n useMemo(() => {\n return navigation[activeNavigationSectionType];\n }, [activeNavigationSectionType, navigation]);\n\n const inactiveNavigationSection: MenuContextValue[\"inactiveNavigationSection\"] =\n useMemo(() => {\n const inactiveType =\n activeNavigationSectionType === \"primary\" ? \"secondary\" : \"primary\";\n\n return navigation[inactiveType];\n }, [activeNavigationSectionType, navigation]);\n\n // #############################################################################\n // Override motif\n // #############################################################################\n const motifFinal = useMemo((): Motif => {\n // Active mobile menu forces dark motif\n if (activeModal === ModalId.MobileMenu) {\n return \"dark\";\n }\n\n // Update: Commented out as no longer - https://ui.slack.com/archives/G01B4G8GF2S/p1683011332500999?thread_ts=1683008828.124399&cid=G01B4G8GF2S\n // Optionally override motif scheme for some specific subitems based on active item\n // const navigationSubItemsWithDarkMotif = [\n // NavigationItemId.NewIntegrations,\n // NavigationItemId.Accessories,\n // ];\n // if (\n // activeNavigationSection.items.some(\n // (item) =>\n // navigationSubItemsWithDarkMotif.includes(item.id) && item.active\n // )\n // ) {\n // return \"dark\";\n // }\n\n // Return the active one\n return motif;\n }, [activeModal, motif]);\n\n // #############################################################################\n // Navigation visibility\n // #############################################################################\n const [navigationOutOfView, setNavigationOutOfView] = useState<\n MenuContextValue[\"navigationOutOfView\"]\n >(\n // Default ref.current is null so by default it's not visible\n true,\n );\n\n // #############################################################################\n // Result\n // #############################################################################\n const value = useMemo(\n () => ({\n // Unrelated util to help aid with SSR in various places in app\n isSsr,\n storeId,\n\n motif: motifFinal,\n setMotif: handleSetMotif,\n\n context,\n isMicrositeContext,\n\n activeModal,\n prevActiveModal,\n setActiveModal,\n\n deployedLanguages,\n isMultiLanguage,\n language,\n languageDirection: getLanguageDirection(language),\n isLongLanguage,\n\n navigation,\n activeNavigationSection,\n inactiveNavigationSection,\n isPathnameActive,\n\n navigationOutOfView,\n setNavigationOutOfView,\n\n createSiteUrl,\n }),\n [\n activeModal,\n activeNavigationSection,\n context,\n createSiteUrl,\n deployedLanguages,\n handleSetMotif,\n inactiveNavigationSection,\n isLongLanguage,\n isMicrositeContext,\n isMultiLanguage,\n isPathnameActive,\n isSsr,\n language,\n motifFinal,\n navigation,\n navigationOutOfView,\n prevActiveModal,\n setActiveModal,\n storeId,\n ],\n );\n return <MenuContext.Provider value={value}>{children}</MenuContext.Provider>;\n};\n\nexport function useMenu(): MenuContextValue {\n const context = useContext(MenuContext);\n if (context === null) {\n throw new Error(\"useMenu must be used within a MenuContextProvider\");\n }\n return context;\n}\n"],"names":["MenuContext","createContext","MenuContextProvider","context","pathname","currentPathname","storeId","DEFAULT_STORE_ID","hasSsrCapability","hash","currentHash","language","DEFAULT_LANGUAGE","globalSiteConfig","children","isMobile","useMedia","BREAKPOINTS","TOP_NAV_MOBILE_AND_DOWN","getSiteConfig","useCallback","siteId","storeIdOverride","getGlobalSiteConfig","currentSiteConfig","useMemo","deployedLanguages","languages","isMultiLanguage","length","isLongLanguage","LONG_LANGUAGES","includes","isSsr","setIsSsr","useState","useEffect","storeBaseUrl","SiteId","Store","baseUrl","motif","setMotif","handleSetMotif","isMicrositeContext","Ui","Uisp","ExpertsUi","ExpertsUisp","Uwc","TechSpecs","Blog","Generic","Amplifi","checkUnreachable","activeModal","prevActiveModal","_setActiveModal","setActiveModal","id","ModalId","MobileMenu","ProMobileMenu","Search","useLockBodyScrollCustom","currentCollectionPath","url","URL","matches","exec","currentProductPath","isPathnameActive","GENERIC_SITE_IDS","optional","micrositeRegExp","RegExp","test","isPartOfUrlPathname","isSiteUrlActive","replace","createSiteUrl","siteUrl","addSiteConfigReferenceSearchParams","targetSiteConfig","parseSiteUrl","parseSubSubRecursiveItems","subSubItem","nestedSubSubItems","items","map","filter","el","findFirstPossibleDeepNestedItemUrl","active","some","label","icon","mobileIcon","isNew","possible","item","parseSubSubMenuItems","subItem","parseSubMenuItem","subItemUrl","getSubItemUrl","subSubItems","subItemActive","subLabel","subLabelTheme","subLabelCollapseMode","invisible","toString","parseMenuItem","subItems","itemActive","fallbackUrl","navigation","parseItemsFn","parseSection","sectionType","section","NAVIGATION_MAPPING","parsedItems","finalUrl","type","primary","secondary","activeNavigationSectionType","activeNavigationSection","inactiveNavigationSection","inactiveType","motifFinal","navigationOutOfView","setNavigationOutOfView","value","languageDirection","getLanguageDirection","jsx","Provider","useMenu","useContext","Error"],"mappings":";;;;;;;;;;;;AAmDa,MAAAA,WAAA,GAAcC,oBAAuC,IAAI,CAAA;AAE/D,MAAMC,sBAAsBA,CAAC;EAClCC,OAAA;EACAC,UAAUC,eAAkB,GAAA,GAAA;EAC5BC,OAAU,GAAAC,OAAA,CAAAA,gBAAA;EACVC,gBAAmB,GAAA,KAAA;EACnBC,MAAMC,WAAc,GAAA,EAAA;EACpBC,QAAW,GAAAC,OAAA,CAAAA,gBAAA;EACXC,gBAAA;EACAC;AACF,CA0CmB,KAAA;EACjB,MAAMC,QAAW,GAAAC,QAAA,CAAAA,QAAA,CACfC,MAAAA,CAAAA,WAAY,CAAAC,uBAAA,EACZ;EAAA;EAAA,CACF;EAKA,MAAMC,aAAgB,GAAAC,KAAA,CAAAA,WAAA,CACpB,CAACC,MAAgB,EAAAC,eAAA,KACfC,0BAAoBV,gBAAkB,EAAAQ,MAAA,EAAQC,mBAAmBhB,OAAO,CAAA,EAC1E,CAACO,kBAAkB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AAA,CAAAA,GAAA,CAAA1I,WAAA,CAAY2I,QAAZ,EAAA;IAAqBJ;IAAezH;EAAS,CAAA,CAAA;AACvD,CAAA;AAEO,SAAS8H,OAA4BA,CAAA,EAAA;EACpC,MAAAzI,OAAA,GAAU0I,iBAAW7I,WAAW,CAAA;EACtC,IAAIG,YAAY,IAAM,EAAA;IACd,MAAA,IAAI2I,MAAM,mDAAmD,CAAA;EACrE;EACO,OAAA3I,OAAA;AACT;;;"}
|
|
1
|
+
{"version":3,"file":"context.js","sources":["../../../src/contexts/MenuContext/context.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport type { ReactNode } from \"react\";\nimport { useMedia } from \"react-use\";\n\nimport { BREAKPOINTS } from \"../../constants/layout\";\nimport { useLockBodyScrollCustom } from \"../../hooks/useLockBodyScrollCustom\";\nimport type { GlobalStoreId } from \"../../types\";\nimport { checkUnreachable } from \"../../utils/errors\";\nimport type {\n DeployedLanguages,\n Language,\n NavigationItem,\n NavigationSectionType,\n NavigationSubItem,\n NavigationSubSubItem,\n SiteUrl,\n} from \"./mapping\";\nimport {\n DEFAULT_LANGUAGE,\n DEFAULT_STORE_ID,\n GENERIC_SITE_IDS,\n LONG_LANGUAGES,\n NAVIGATION_MAPPING,\n SiteId,\n} from \"./mapping\";\nimport type {\n GlobalSiteConfig,\n MenuContextValue,\n ParsedNavigationItem,\n ParsedNavigationSection,\n ParsedNavigationSubItem,\n ParsedNavigationSubSubItem,\n} from \"./types\";\nimport { ModalId } from \"./types\";\nimport {\n findFirstPossibleDeepNestedItemUrl,\n getGlobalSiteConfig,\n getLanguageDirection,\n getSubItemUrl,\n isPartOfUrlPathname,\n parseSiteUrl,\n} from \"./utils\";\n\nexport const MenuContext = createContext<MenuContextValue | null>(null);\n\nexport const MenuContextProvider = ({\n context,\n pathname: currentPathname = \"/\",\n storeId = DEFAULT_STORE_ID,\n hasSsrCapability = false,\n hash: currentHash = \"\",\n language = DEFAULT_LANGUAGE,\n globalSiteConfig,\n children,\n}: {\n /**\n * Set how the navigation behave as - ui.com/store/uisp.com/...\n */\n context: SiteId;\n /**\n * Base url for menu item paths\n * e.g. https://ecomm.stg.ui.com/ca/en/\n * e.g. window.location.origin\n *\n * ! Not specified on microsites !\n */\n baseUrl?: string | URL;\n /**\n * Pathname of the current url\n * Used as a prop to be in sync with e.g. next\n */\n pathname?: string;\n /**\n * Hash of the current URL (the part of the URL that starts with #)\n */\n hash?: string;\n /**\n * Store context for determining which path to use\n * Will fall-back to US if not found\n * @example GlobalStoreId.Ca\n */\n storeId?: GlobalStoreId;\n /**\n * Indicates if consumer project has capability of doing SSR\n */\n hasSsrCapability?: boolean;\n /**\n * (optionally) Hints which language currently us currently in use\n */\n language?: Language;\n /**\n * Global Site Config that define available urls/languages/regions enabled for globally\n */\n globalSiteConfig: GlobalSiteConfig;\n\n children: ReactNode;\n}): JSX.Element => {\n const isMobile = useMedia(\n BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN,\n false, // Fallback value for SSR\n );\n\n // #############################################################################\n // Global site config\n // #############################################################################\n const getSiteConfig = useCallback(\n (siteId: SiteId, storeIdOverride?: GlobalStoreId) =>\n getGlobalSiteConfig(globalSiteConfig, siteId, storeIdOverride ?? storeId),\n [globalSiteConfig, storeId],\n );\n\n const currentSiteConfig = useMemo(\n // Generic site doesn't have a site config\n () => getSiteConfig(context),\n [context, getSiteConfig],\n );\n\n // #############################################################################\n // Language\n // #############################################################################\n const deployedLanguages = useMemo<DeployedLanguages | []>(() => {\n return (\n currentSiteConfig.languages ??\n [\n /** Left empty as that indicates given site doesn't implement multiple language AT ALL. For example store would\n * have single language for now, but UISP doesn't have at all.\n */\n ]\n );\n }, [currentSiteConfig.languages]);\n\n const isMultiLanguage = useMemo((): boolean => {\n return deployedLanguages.length > 1;\n }, [deployedLanguages]);\n\n const isLongLanguage = useMemo(\n () => LONG_LANGUAGES.includes(language),\n [language],\n );\n\n // #############################################################################\n // Track if is first render (SSR) to normalise first rendering between server <--> client for code that is shared\n // between microsites and store. To support both scenario's initial state is set by prop\n // #############################################################################\n const [isSsr, setIsSsr] = useState(hasSsrCapability);\n\n useEffect(() => {\n setIsSsr(false);\n }, []);\n\n // #############################################################################\n // Store base URL\n // #############################################################################\n const storeBaseUrl = useMemo(\n () => getSiteConfig(SiteId.Store).baseUrl,\n [getSiteConfig],\n );\n\n // #############################################################################\n // Menu motif\n // #############################################################################\n const [motif, setMotif] = useState<MenuContextValue[\"motif\"]>(\"light\");\n\n /**\n * Helper to ensure a correct motif is set\n * TODO: maybe check which parts uses it, can we maybe just consolidate the logic within the context itself?\n */\n const handleSetMotif = useCallback((motif: Motif) => {\n if ([\"light\", \"dark\"].includes(motif)) {\n setMotif(motif);\n }\n }, []);\n\n // #############################################################################\n // Nav context\n // #############################################################################\n const isMicrositeContext: MenuContextValue[\"isMicrositeContext\"] =\n useMemo(() => {\n // Type-safe detection for context\n switch (context) {\n case null:\n case undefined:\n case SiteId.Ui:\n case SiteId.Uisp:\n case SiteId.ExpertsUi:\n case SiteId.ExpertsUisp:\n case SiteId.Uwc:\n case SiteId.TechSpecs:\n case SiteId.Blog:\n case SiteId.Generic: {\n return true;\n }\n case SiteId.Amplifi:\n case SiteId.Store: {\n return false;\n }\n default: {\n // Fallback to true as well\n checkUnreachable(context);\n return true;\n }\n }\n }, [context]);\n\n // #############################################################################\n // Active modal\n // #############################################################################\n // eslint-disable-next-line react/hook-use-state\n const [{ activeModal, prevActiveModal }, _setActiveModal] = useState<{\n activeModal: MenuContextValue[\"activeModal\"];\n prevActiveModal: MenuContextValue[\"prevActiveModal\"];\n }>({\n activeModal: null,\n prevActiveModal: null,\n });\n\n const setActiveModal = useCallback<MenuContextValue[\"setActiveModal\"]>(\n (id) => {\n _setActiveModal({\n activeModal: id,\n prevActiveModal: activeModal,\n });\n },\n [activeModal],\n );\n\n // Reset modals on viewport change\n useEffect(() => {\n if (\n !isMobile &&\n activeModal &&\n [ModalId.MobileMenu, ModalId.ProMobileMenu].includes(activeModal)\n ) {\n setActiveModal(null);\n }\n }, [activeModal, isMobile, setActiveModal]);\n\n // Body lock for specific modals\n useLockBodyScrollCustom(\n !!activeModal &&\n [ModalId.MobileMenu, ModalId.ProMobileMenu].includes(activeModal),\n );\n\n // #############################################################################\n // Parse router parameters\n // #############################################################################\n // Parse the collection slug as route path\n const currentCollectionPath = useMemo((): string | undefined => {\n const url = new URL(currentPathname, storeBaseUrl);\n const matches = /(\\/collections\\/[\\w-]+)/i.exec(url.pathname);\n\n return matches?.[1];\n }, [storeBaseUrl, currentPathname]);\n\n const currentProductPath = useMemo((): string | undefined => {\n const url = new URL(currentPathname, storeBaseUrl);\n const matches = /((\\/collections\\/.+)?\\/products\\/[\\w-]+)/i.exec(\n url.pathname,\n );\n\n return matches?.[1];\n }, [storeBaseUrl, currentPathname]);\n\n const isPathnameActive = useCallback(\n (pathname: string): boolean => {\n // Don't do matching for generic site contexts\n if (GENERIC_SITE_IDS.includes(context)) {\n return false;\n }\n\n if (isMicrositeContext) {\n // HACK microsites can have paths with and without regional prefixes\n const optional = pathname === \"/\" ? \"?\" : \"\";\n const micrositeRegExp = new RegExp(\n `^(?:/\\\\w{2})?${pathname}${optional}$`,\n );\n return micrositeRegExp.test(currentPathname);\n }\n\n return (\n (!!currentCollectionPath &&\n isPartOfUrlPathname(pathname, currentCollectionPath)) ||\n (!!currentProductPath &&\n isPartOfUrlPathname(pathname, currentProductPath))\n );\n },\n [\n context,\n isMicrositeContext,\n currentCollectionPath,\n currentProductPath,\n currentPathname,\n ],\n );\n\n const isSiteUrlActive = useCallback(\n (url: SiteUrl): boolean => {\n return (\n isMicrositeContext &&\n // While SiteId is considered a microsite we don't want url matching for it\n !GENERIC_SITE_IDS.includes(context) &&\n url &&\n url[0] !== SiteId.Store &&\n url[0] === context &&\n isPartOfUrlPathname(currentPathname, url[1]) &&\n // If there's a hash in the SiteUrl, it should match the current hash for the item to be active\n (!url[3] || currentHash.replace(/^#/, \"\") === url[3])\n );\n },\n [context, currentHash, currentPathname, isMicrositeContext],\n );\n\n // #############################################################################\n // Menu sections and items\n // #############################################################################\n const createSiteUrl = useCallback(\n (siteUrl: SiteUrl) => {\n // Don't add store and language search param for navigation with generic context\n const addSiteConfigReferenceSearchParams =\n !GENERIC_SITE_IDS.includes(context);\n\n const [siteId] = siteUrl;\n\n const targetSiteConfig = getSiteConfig(siteId);\n\n return parseSiteUrl({\n siteUrl,\n storeId,\n addSiteConfigReferenceSearchParams,\n language,\n targetSiteConfig,\n context,\n });\n },\n [context, getSiteConfig, storeId, language],\n );\n\n const parseSubSubRecursiveItems = useCallback(\n (subSubItem: NavigationSubSubItem): ParsedNavigationSubSubItem | null => {\n // Sub-sub-items\n const nestedSubSubItems =\n \"items\" in subSubItem && subSubItem.items\n ? subSubItem.items\n .map(parseSubSubRecursiveItems)\n .filter((el): el is ParsedNavigationSubSubItem => !!el)\n : [];\n\n const url =\n isMicrositeContext && subSubItem.url\n ? createSiteUrl(subSubItem.url)\n : // TODO: maybe need to improve to get first \"available\" child not the first form array, not sure if the\n // parseItemsFn filters them already out\n (findFirstPossibleDeepNestedItemUrl(nestedSubSubItems) ??\n (subSubItem.url && createSiteUrl(subSubItem.url)));\n\n if (!url) {\n return null;\n }\n\n const active =\n (subSubItem.url && isSiteUrlActive(subSubItem.url)) ||\n // Any child item is active\n nestedSubSubItems.some((el) => el.active);\n\n return {\n id: subSubItem.id,\n label: subSubItem.label,\n // subLabel: subSubItem.subLabel,\n icon: subSubItem.icon,\n mobileIcon: subSubItem.mobileIcon,\n isNew: subSubItem.isNew,\n active,\n url,\n possible:\n \"items\" in subSubItem\n ? nestedSubSubItems.some((item) => item.possible)\n : // If gotten this far fallback to true\n true,\n items: nestedSubSubItems,\n };\n },\n [isMicrositeContext, createSiteUrl, isSiteUrlActive],\n );\n\n const parseSubSubMenuItems = useCallback(\n (subItem: NavigationSubItem): ParsedNavigationSubSubItem[] => {\n return (\"items\" in subItem ? subItem.items : [])\n .map(parseSubSubRecursiveItems)\n .filter((el): el is ParsedNavigationSubSubItem => !!el);\n },\n [parseSubSubRecursiveItems],\n );\n\n const parseSubMenuItem = useCallback(\n (subItem: NavigationSubItem): ParsedNavigationSubItem | null => {\n const subItemUrl = getSubItemUrl(subItem, isSiteUrlActive);\n\n // Append the new pathname (e.g. when /ca/en already exists)\n const url = subItemUrl ? new URL(createSiteUrl(subItemUrl)) : null;\n\n if (!url) {\n return null;\n }\n\n // Sub-sub-items\n const subSubItems = parseSubSubMenuItems(subItem);\n\n // Parse item active state\n const subItemActive =\n // Site url is active\n (subItem.url && isSiteUrlActive(subItem.url)) ||\n // Any child item is active\n subSubItems.some((el) => el.active);\n\n return {\n id: subItem.id,\n label: subItem.label,\n subLabel: subItem.subLabel,\n subLabelTheme: subItem.subLabelTheme,\n subLabelCollapseMode: subItem.subLabelCollapseMode,\n isNew: subItem.isNew,\n icon: subItem.icon,\n mobileIcon: subItem.mobileIcon,\n invisible: subItem.invisible,\n\n url: url.toString(),\n active: subItemActive,\n\n possible:\n subSubItems.length === 0 || subSubItems.some((item) => item.possible),\n items: subSubItems,\n };\n },\n [isSiteUrlActive, createSiteUrl, parseSubSubMenuItems],\n );\n\n const parseMenuItem = useCallback(\n (item: NavigationItem): ParsedNavigationItem => {\n // Parse sub-items\n const subItems = item.items\n .map(parseSubMenuItem)\n .filter((subItem): subItem is ParsedNavigationSubItem => !!subItem);\n\n // Parse main item active state when in microsite context\n let itemActive = false;\n\n // Custom logic just for microsites to detect if we have to open the 2nd layer navigation\n if (\n isMicrositeContext &&\n // While SiteId is considered a microsite we don't want url matching for it\n !GENERIC_SITE_IDS.includes(context) &&\n item.url &&\n item.url[0] === context &&\n item.url[0] !== SiteId.Store &&\n isPartOfUrlPathname(currentPathname, item.url[1])\n ) {\n itemActive = true;\n }\n\n /**\n * Main item url\n * If it is a microsite context, we use the site url if available.\n * If not in microsite context we use the store url if available and\n * fallback to site URL, then fallback URL and lastly to base URL.\n */\n const url =\n isMicrositeContext && item.url\n ? createSiteUrl(item.url)\n : // TODO: maybe need to improve to get first \"available\" child not the first form array, not sure if the\n // parseItemsFn filters them already out\n (findFirstPossibleDeepNestedItemUrl(subItems) ??\n ((item.url && createSiteUrl(item.url)) ||\n (item.fallbackUrl && createSiteUrl(item.fallbackUrl)) ||\n storeBaseUrl.toString()));\n\n // Result\n return {\n ...item,\n items: subItems,\n url,\n active: itemActive || subItems.some((subItem) => subItem.active),\n possible:\n subItems.length === 0 || subItems.some((item) => item.possible),\n };\n },\n [\n parseSubMenuItem,\n isMicrositeContext,\n context,\n currentPathname,\n createSiteUrl,\n storeBaseUrl,\n ],\n );\n\n // Navigation parsing\n const navigation: MenuContextValue[\"navigation\"] = useMemo(() => {\n const parseItemsFn = (items: NavigationItem[]) => items.map(parseMenuItem);\n\n const parseSection = (\n sectionType: keyof typeof NAVIGATION_MAPPING,\n ): ParsedNavigationSection => {\n const section = NAVIGATION_MAPPING[sectionType];\n const parsedItems = parseItemsFn(section.items ?? []);\n\n const url = section.url ? createSiteUrl(section.url) : null;\n\n const finalUrl =\n url ||\n // TODO: maybe need to improve to get first \"available\" child not the first form array, not sure if the\n // parseItemsFn filters them already out\n findFirstPossibleDeepNestedItemUrl(parsedItems) ||\n (!section.url && createSiteUrl(section.fallbackUrl)) ||\n storeBaseUrl.toString();\n\n return {\n label: section.label,\n type: sectionType,\n url: finalUrl,\n active: parsedItems.some((el) => el.active),\n possible:\n parsedItems.length === 0 || parsedItems.some((item) => item.possible),\n items: parsedItems,\n };\n };\n\n const primary = parseSection(\"primary\");\n const secondary = parseSection(\"secondary\");\n\n // Active value - only one section can be active\n if (secondary.active) {\n primary.active = false;\n } else if (primary.active) {\n secondary.active = false;\n }\n\n return {\n primary,\n secondary,\n };\n }, [parseMenuItem, createSiteUrl, storeBaseUrl]);\n\n const activeNavigationSectionType = useMemo<NavigationSectionType>(() => {\n /**\n * First attempt to derive active section based on active navigation\n */\n if (navigation.primary.active) {\n return \"primary\";\n }\n if (navigation.secondary.active) {\n return \"secondary\";\n }\n\n /**\n * Fallback to check against context id if we can't match it on path\n * Only uisp.com and experts.uisp.com uses \"secondary\" as default\n * TODO: should move this logic into \"navigation\" memo fn so both states are in sync\n */\n return [SiteId.Uisp, SiteId.ExpertsUisp].includes(context)\n ? \"secondary\"\n : \"primary\";\n }, [context, navigation.primary.active, navigation.secondary.active]);\n\n // Define active sections\n const activeNavigationSection: MenuContextValue[\"activeNavigationSection\"] =\n useMemo(() => {\n return navigation[activeNavigationSectionType];\n }, [activeNavigationSectionType, navigation]);\n\n const inactiveNavigationSection: MenuContextValue[\"inactiveNavigationSection\"] =\n useMemo(() => {\n const inactiveType =\n activeNavigationSectionType === \"primary\" ? \"secondary\" : \"primary\";\n\n return navigation[inactiveType];\n }, [activeNavigationSectionType, navigation]);\n\n // #############################################################################\n // Override motif\n // #############################################################################\n const motifFinal = useMemo((): Motif => {\n // Active mobile menu forces dark motif\n if (activeModal === ModalId.MobileMenu) {\n return \"dark\";\n }\n\n // Update: Commented out as no longer - https://ui.slack.com/archives/G01B4G8GF2S/p1683011332500999?thread_ts=1683008828.124399&cid=G01B4G8GF2S\n // Optionally override motif scheme for some specific subitems based on active item\n // const navigationSubItemsWithDarkMotif = [\n // NavigationItemId.NewIntegrations,\n // NavigationItemId.Accessories,\n // ];\n // if (\n // activeNavigationSection.items.some(\n // (item) =>\n // navigationSubItemsWithDarkMotif.includes(item.id) && item.active\n // )\n // ) {\n // return \"dark\";\n // }\n\n // Return the active one\n return motif;\n }, [activeModal, motif]);\n\n // #############################################################################\n // Navigation visibility\n // #############################################################################\n const [navigationOutOfView, setNavigationOutOfView] = useState<\n MenuContextValue[\"navigationOutOfView\"]\n >(\n // Default ref.current is null so by default it's not visible\n true,\n );\n\n // #############################################################################\n // Result\n // #############################################################################\n const value = useMemo(\n () => ({\n // Unrelated util to help aid with SSR in various places in app\n isSsr,\n storeId,\n\n motif: motifFinal,\n setMotif: handleSetMotif,\n\n context,\n isMicrositeContext,\n\n activeModal,\n prevActiveModal,\n setActiveModal,\n\n deployedLanguages,\n isMultiLanguage,\n language,\n languageDirection: getLanguageDirection(language),\n isLongLanguage,\n\n navigation,\n activeNavigationSection,\n inactiveNavigationSection,\n isPathnameActive,\n\n navigationOutOfView,\n setNavigationOutOfView,\n\n createSiteUrl,\n }),\n [\n activeModal,\n activeNavigationSection,\n context,\n createSiteUrl,\n deployedLanguages,\n handleSetMotif,\n inactiveNavigationSection,\n isLongLanguage,\n isMicrositeContext,\n isMultiLanguage,\n isPathnameActive,\n isSsr,\n language,\n motifFinal,\n navigation,\n navigationOutOfView,\n prevActiveModal,\n setActiveModal,\n storeId,\n ],\n );\n return <MenuContext.Provider value={value}>{children}</MenuContext.Provider>;\n};\n\nexport function useMenu(): MenuContextValue {\n const context = useContext(MenuContext);\n if (context === null) {\n throw new Error(\"useMenu must be used within a MenuContextProvider\");\n }\n return context;\n}\n"],"names":["MenuContext","createContext","MenuContextProvider","context","pathname","currentPathname","storeId","DEFAULT_STORE_ID","hasSsrCapability","hash","currentHash","language","DEFAULT_LANGUAGE","globalSiteConfig","children","isMobile","useMedia","BREAKPOINTS","TOP_NAV_MOBILE_AND_DOWN","getSiteConfig","useCallback","siteId","storeIdOverride","getGlobalSiteConfig","currentSiteConfig","useMemo","deployedLanguages","languages","isMultiLanguage","length","isLongLanguage","LONG_LANGUAGES","includes","isSsr","setIsSsr","useState","useEffect","storeBaseUrl","SiteId","Store","baseUrl","motif","setMotif","handleSetMotif","isMicrositeContext","Ui","Uisp","ExpertsUi","ExpertsUisp","Uwc","TechSpecs","Blog","Generic","Amplifi","checkUnreachable","activeModal","prevActiveModal","_setActiveModal","setActiveModal","id","ModalId","MobileMenu","ProMobileMenu","useLockBodyScrollCustom","currentCollectionPath","url","URL","matches","exec","currentProductPath","isPathnameActive","GENERIC_SITE_IDS","optional","micrositeRegExp","RegExp","test","isPartOfUrlPathname","isSiteUrlActive","replace","createSiteUrl","siteUrl","addSiteConfigReferenceSearchParams","targetSiteConfig","parseSiteUrl","parseSubSubRecursiveItems","subSubItem","nestedSubSubItems","items","map","filter","el","findFirstPossibleDeepNestedItemUrl","active","some","label","icon","mobileIcon","isNew","possible","item","parseSubSubMenuItems","subItem","parseSubMenuItem","subItemUrl","getSubItemUrl","subSubItems","subItemActive","subLabel","subLabelTheme","subLabelCollapseMode","invisible","toString","parseMenuItem","subItems","itemActive","fallbackUrl","navigation","parseItemsFn","parseSection","sectionType","section","NAVIGATION_MAPPING","parsedItems","finalUrl","type","primary","secondary","activeNavigationSectionType","activeNavigationSection","inactiveNavigationSection","inactiveType","motifFinal","navigationOutOfView","setNavigationOutOfView","value","languageDirection","getLanguageDirection","jsx","Provider","useMenu","useContext","Error"],"mappings":";;;;;;;;;;;;AAmDa,MAAAA,WAAA,GAAcC,oBAAuC,IAAI,CAAA;AAE/D,MAAMC,sBAAsBA,CAAC;EAClCC,OAAA;EACAC,UAAUC,eAAkB,GAAA,GAAA;EAC5BC,OAAU,GAAAC,OAAA,CAAAA,gBAAA;EACVC,gBAAmB,GAAA,KAAA;EACnBC,MAAMC,WAAc,GAAA,EAAA;EACpBC,QAAW,GAAAC,OAAA,CAAAA,gBAAA;EACXC,gBAAA;EACAC;AACF,CA0CmB,KAAA;EACjB,MAAMC,QAAW,GAAAC,QAAA,CAAAA,QAAA,CACfC,MAAAA,CAAAA,WAAY,CAAAC,uBAAA,EACZ;EAAA;EAAA,CACF;EAKA,MAAMC,aAAgB,GAAAC,KAAA,CAAAA,WAAA,CACpB,CAACC,MAAgB,EAAAC,eAAA,KACfC,0BAAoBV,gBAAkB,EAAAQ,MAAA,EAAQC,mBAAmBhB,OAAO,CAAA,EAC1E,CAACO,kBAAkBP,OAAO,CAAA,CAC5B;EAEA,MAAMkB,iBAAoB,GAAAC,KAAA,CAAAA,OAAA;EAAA;EAExB,MAAMN,cAAchB,OAAO,CAAA,EAC3B,CAACA,SAASgB,aAAa,CAAA,CACzB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C,IAAIG,YAAY,IAAM,EAAA;IACd,MAAA,IAAI0I,MAAM,mDAAmD,CAAA;EACrE;EACO,OAAA1I,OAAA;AACT;;;"}
|
|
@@ -89,7 +89,7 @@ const MenuContextProvider = ({
|
|
|
89
89
|
});
|
|
90
90
|
}, [activeModal]);
|
|
91
91
|
useEffect(() => {
|
|
92
|
-
if (!isMobile && activeModal && [ModalId.MobileMenu, ModalId.ProMobileMenu
|
|
92
|
+
if (!isMobile && activeModal && [ModalId.MobileMenu, ModalId.ProMobileMenu].includes(activeModal)) {
|
|
93
93
|
setActiveModal(null);
|
|
94
94
|
}
|
|
95
95
|
}, [activeModal, isMobile, setActiveModal]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.mjs","sources":["../../../src/contexts/MenuContext/context.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport type { ReactNode } from \"react\";\nimport { useMedia } from \"react-use\";\n\nimport { BREAKPOINTS } from \"../../constants/layout\";\nimport { useLockBodyScrollCustom } from \"../../hooks/useLockBodyScrollCustom\";\nimport type { GlobalStoreId } from \"../../types\";\nimport { checkUnreachable } from \"../../utils/errors\";\nimport type {\n DeployedLanguages,\n Language,\n NavigationItem,\n NavigationSectionType,\n NavigationSubItem,\n NavigationSubSubItem,\n SiteUrl,\n} from \"./mapping\";\nimport {\n DEFAULT_LANGUAGE,\n DEFAULT_STORE_ID,\n GENERIC_SITE_IDS,\n LONG_LANGUAGES,\n NAVIGATION_MAPPING,\n SiteId,\n} from \"./mapping\";\nimport type {\n GlobalSiteConfig,\n MenuContextValue,\n ParsedNavigationItem,\n ParsedNavigationSection,\n ParsedNavigationSubItem,\n ParsedNavigationSubSubItem,\n} from \"./types\";\nimport { ModalId } from \"./types\";\nimport {\n findFirstPossibleDeepNestedItemUrl,\n getGlobalSiteConfig,\n getLanguageDirection,\n getSubItemUrl,\n isPartOfUrlPathname,\n parseSiteUrl,\n} from \"./utils\";\n\nexport const MenuContext = createContext<MenuContextValue | null>(null);\n\nexport const MenuContextProvider = ({\n context,\n pathname: currentPathname = \"/\",\n storeId = DEFAULT_STORE_ID,\n hasSsrCapability = false,\n hash: currentHash = \"\",\n language = DEFAULT_LANGUAGE,\n globalSiteConfig,\n children,\n}: {\n /**\n * Set how the navigation behave as - ui.com/store/uisp.com/...\n */\n context: SiteId;\n /**\n * Base url for menu item paths\n * e.g. https://ecomm.stg.ui.com/ca/en/\n * e.g. window.location.origin\n *\n * ! Not specified on microsites !\n */\n baseUrl?: string | URL;\n /**\n * Pathname of the current url\n * Used as a prop to be in sync with e.g. next\n */\n pathname?: string;\n /**\n * Hash of the current URL (the part of the URL that starts with #)\n */\n hash?: string;\n /**\n * Store context for determining which path to use\n * Will fall-back to US if not found\n * @example GlobalStoreId.Ca\n */\n storeId?: GlobalStoreId;\n /**\n * Indicates if consumer project has capability of doing SSR\n */\n hasSsrCapability?: boolean;\n /**\n * (optionally) Hints which language currently us currently in use\n */\n language?: Language;\n /**\n * Global Site Config that define available urls/languages/regions enabled for globally\n */\n globalSiteConfig: GlobalSiteConfig;\n\n children: ReactNode;\n}): JSX.Element => {\n const isMobile = useMedia(\n BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN,\n false, // Fallback value for SSR\n );\n\n // #############################################################################\n // Global site config\n // #############################################################################\n const getSiteConfig = useCallback(\n (siteId: SiteId, storeIdOverride?: GlobalStoreId) =>\n getGlobalSiteConfig(globalSiteConfig, siteId, storeIdOverride ?? storeId),\n [globalSiteConfig, storeId],\n );\n\n const currentSiteConfig = useMemo(\n // Generic site doesn't have a site config\n () => getSiteConfig(context),\n [context, getSiteConfig],\n );\n\n // #############################################################################\n // Language\n // #############################################################################\n const deployedLanguages = useMemo<DeployedLanguages | []>(() => {\n return (\n currentSiteConfig.languages ??\n [\n /** Left empty as that indicates given site doesn't implement multiple language AT ALL. For example store would\n * have single language for now, but UISP doesn't have at all.\n */\n ]\n );\n }, [currentSiteConfig.languages]);\n\n const isMultiLanguage = useMemo((): boolean => {\n return deployedLanguages.length > 1;\n }, [deployedLanguages]);\n\n const isLongLanguage = useMemo(\n () => LONG_LANGUAGES.includes(language),\n [language],\n );\n\n // #############################################################################\n // Track if is first render (SSR) to normalise first rendering between server <--> client for code that is shared\n // between microsites and store. To support both scenario's initial state is set by prop\n // #############################################################################\n const [isSsr, setIsSsr] = useState(hasSsrCapability);\n\n useEffect(() => {\n setIsSsr(false);\n }, []);\n\n // #############################################################################\n // Store base URL\n // #############################################################################\n const storeBaseUrl = useMemo(\n () => getSiteConfig(SiteId.Store).baseUrl,\n [getSiteConfig],\n );\n\n // #############################################################################\n // Menu motif\n // #############################################################################\n const [motif, setMotif] = useState<MenuContextValue[\"motif\"]>(\"light\");\n\n /**\n * Helper to ensure a correct motif is set\n * TODO: maybe check which parts uses it, can we maybe just consolidate the logic within the context itself?\n */\n const handleSetMotif = useCallback((motif: Motif) => {\n if ([\"light\", \"dark\"].includes(motif)) {\n setMotif(motif);\n }\n }, []);\n\n // #############################################################################\n // Nav context\n // #############################################################################\n const isMicrositeContext: MenuContextValue[\"isMicrositeContext\"] =\n useMemo(() => {\n // Type-safe detection for context\n switch (context) {\n case null:\n case undefined:\n case SiteId.Ui:\n case SiteId.Uisp:\n case SiteId.ExpertsUi:\n case SiteId.ExpertsUisp:\n case SiteId.Uwc:\n case SiteId.TechSpecs:\n case SiteId.Blog:\n case SiteId.Generic: {\n return true;\n }\n case SiteId.Amplifi:\n case SiteId.Store: {\n return false;\n }\n default: {\n // Fallback to true as well\n checkUnreachable(context);\n return true;\n }\n }\n }, [context]);\n\n // #############################################################################\n // Active modal\n // #############################################################################\n // eslint-disable-next-line react/hook-use-state\n const [{ activeModal, prevActiveModal }, _setActiveModal] = useState<{\n activeModal: MenuContextValue[\"activeModal\"];\n prevActiveModal: MenuContextValue[\"prevActiveModal\"];\n }>({\n activeModal: null,\n prevActiveModal: null,\n });\n\n const setActiveModal = useCallback<MenuContextValue[\"setActiveModal\"]>(\n (id) => {\n _setActiveModal({\n activeModal: id,\n prevActiveModal: activeModal,\n });\n },\n [activeModal],\n );\n\n // Reset modals on viewport change\n useEffect(() => {\n if (\n !isMobile &&\n activeModal &&\n [ModalId.MobileMenu, ModalId.ProMobileMenu, ModalId.Search].includes(\n activeModal,\n )\n ) {\n setActiveModal(null);\n }\n }, [activeModal, isMobile, setActiveModal]);\n\n // Body lock for specific modals\n useLockBodyScrollCustom(\n !!activeModal &&\n [ModalId.MobileMenu, ModalId.ProMobileMenu].includes(activeModal),\n );\n\n // #############################################################################\n // Parse router parameters\n // #############################################################################\n // Parse the collection slug as route path\n const currentCollectionPath = useMemo((): string | undefined => {\n const url = new URL(currentPathname, storeBaseUrl);\n const matches = /(\\/collections\\/[\\w-]+)/i.exec(url.pathname);\n\n return matches?.[1];\n }, [storeBaseUrl, currentPathname]);\n\n const currentProductPath = useMemo((): string | undefined => {\n const url = new URL(currentPathname, storeBaseUrl);\n const matches = /((\\/collections\\/.+)?\\/products\\/[\\w-]+)/i.exec(\n url.pathname,\n );\n\n return matches?.[1];\n }, [storeBaseUrl, currentPathname]);\n\n const isPathnameActive = useCallback(\n (pathname: string): boolean => {\n // Don't do matching for generic site contexts\n if (GENERIC_SITE_IDS.includes(context)) {\n return false;\n }\n\n if (isMicrositeContext) {\n // HACK microsites can have paths with and without regional prefixes\n const optional = pathname === \"/\" ? \"?\" : \"\";\n const micrositeRegExp = new RegExp(\n `^(?:/\\\\w{2})?${pathname}${optional}$`,\n );\n return micrositeRegExp.test(currentPathname);\n }\n\n return (\n (!!currentCollectionPath &&\n isPartOfUrlPathname(pathname, currentCollectionPath)) ||\n (!!currentProductPath &&\n isPartOfUrlPathname(pathname, currentProductPath))\n );\n },\n [\n context,\n isMicrositeContext,\n currentCollectionPath,\n currentProductPath,\n currentPathname,\n ],\n );\n\n const isSiteUrlActive = useCallback(\n (url: SiteUrl): boolean => {\n return (\n isMicrositeContext &&\n // While SiteId is considered a microsite we don't want url matching for it\n !GENERIC_SITE_IDS.includes(context) &&\n url &&\n url[0] !== SiteId.Store &&\n url[0] === context &&\n isPartOfUrlPathname(currentPathname, url[1]) &&\n // If there's a hash in the SiteUrl, it should match the current hash for the item to be active\n (!url[3] || currentHash.replace(/^#/, \"\") === url[3])\n );\n },\n [context, currentHash, currentPathname, isMicrositeContext],\n );\n\n // #############################################################################\n // Menu sections and items\n // #############################################################################\n const createSiteUrl = useCallback(\n (siteUrl: SiteUrl) => {\n // Don't add store and language search param for navigation with generic context\n const addSiteConfigReferenceSearchParams =\n !GENERIC_SITE_IDS.includes(context);\n\n const [siteId] = siteUrl;\n\n const targetSiteConfig = getSiteConfig(siteId);\n\n return parseSiteUrl({\n siteUrl,\n storeId,\n addSiteConfigReferenceSearchParams,\n language,\n targetSiteConfig,\n context,\n });\n },\n [context, getSiteConfig, storeId, language],\n );\n\n const parseSubSubRecursiveItems = useCallback(\n (subSubItem: NavigationSubSubItem): ParsedNavigationSubSubItem | null => {\n // Sub-sub-items\n const nestedSubSubItems =\n \"items\" in subSubItem && subSubItem.items\n ? subSubItem.items\n .map(parseSubSubRecursiveItems)\n .filter((el): el is ParsedNavigationSubSubItem => !!el)\n : [];\n\n const url =\n isMicrositeContext && subSubItem.url\n ? createSiteUrl(subSubItem.url)\n : // TODO: maybe need to improve to get first \"available\" child not the first form array, not sure if the\n // parseItemsFn filters them already out\n (findFirstPossibleDeepNestedItemUrl(nestedSubSubItems) ??\n (subSubItem.url && createSiteUrl(subSubItem.url)));\n\n if (!url) {\n return null;\n }\n\n const active =\n (subSubItem.url && isSiteUrlActive(subSubItem.url)) ||\n // Any child item is active\n nestedSubSubItems.some((el) => el.active);\n\n return {\n id: subSubItem.id,\n label: subSubItem.label,\n // subLabel: subSubItem.subLabel,\n icon: subSubItem.icon,\n mobileIcon: subSubItem.mobileIcon,\n isNew: subSubItem.isNew,\n active,\n url,\n possible:\n \"items\" in subSubItem\n ? nestedSubSubItems.some((item) => item.possible)\n : // If gotten this far fallback to true\n true,\n items: nestedSubSubItems,\n };\n },\n [isMicrositeContext, createSiteUrl, isSiteUrlActive],\n );\n\n const parseSubSubMenuItems = useCallback(\n (subItem: NavigationSubItem): ParsedNavigationSubSubItem[] => {\n return (\"items\" in subItem ? subItem.items : [])\n .map(parseSubSubRecursiveItems)\n .filter((el): el is ParsedNavigationSubSubItem => !!el);\n },\n [parseSubSubRecursiveItems],\n );\n\n const parseSubMenuItem = useCallback(\n (subItem: NavigationSubItem): ParsedNavigationSubItem | null => {\n const subItemUrl = getSubItemUrl(subItem, isSiteUrlActive);\n\n // Append the new pathname (e.g. when /ca/en already exists)\n const url = subItemUrl ? new URL(createSiteUrl(subItemUrl)) : null;\n\n if (!url) {\n return null;\n }\n\n // Sub-sub-items\n const subSubItems = parseSubSubMenuItems(subItem);\n\n // Parse item active state\n const subItemActive =\n // Site url is active\n (subItem.url && isSiteUrlActive(subItem.url)) ||\n // Any child item is active\n subSubItems.some((el) => el.active);\n\n return {\n id: subItem.id,\n label: subItem.label,\n subLabel: subItem.subLabel,\n subLabelTheme: subItem.subLabelTheme,\n subLabelCollapseMode: subItem.subLabelCollapseMode,\n isNew: subItem.isNew,\n icon: subItem.icon,\n mobileIcon: subItem.mobileIcon,\n invisible: subItem.invisible,\n\n url: url.toString(),\n active: subItemActive,\n\n possible:\n subSubItems.length === 0 || subSubItems.some((item) => item.possible),\n items: subSubItems,\n };\n },\n [isSiteUrlActive, createSiteUrl, parseSubSubMenuItems],\n );\n\n const parseMenuItem = useCallback(\n (item: NavigationItem): ParsedNavigationItem => {\n // Parse sub-items\n const subItems = item.items\n .map(parseSubMenuItem)\n .filter((subItem): subItem is ParsedNavigationSubItem => !!subItem);\n\n // Parse main item active state when in microsite context\n let itemActive = false;\n\n // Custom logic just for microsites to detect if we have to open the 2nd layer navigation\n if (\n isMicrositeContext &&\n // While SiteId is considered a microsite we don't want url matching for it\n !GENERIC_SITE_IDS.includes(context) &&\n item.url &&\n item.url[0] === context &&\n item.url[0] !== SiteId.Store &&\n isPartOfUrlPathname(currentPathname, item.url[1])\n ) {\n itemActive = true;\n }\n\n /**\n * Main item url\n * If it is a microsite context, we use the site url if available.\n * If not in microsite context we use the store url if available and\n * fallback to site URL, then fallback URL and lastly to base URL.\n */\n const url =\n isMicrositeContext && item.url\n ? createSiteUrl(item.url)\n : // TODO: maybe need to improve to get first \"available\" child not the first form array, not sure if the\n // parseItemsFn filters them already out\n (findFirstPossibleDeepNestedItemUrl(subItems) ??\n ((item.url && createSiteUrl(item.url)) ||\n (item.fallbackUrl && createSiteUrl(item.fallbackUrl)) ||\n storeBaseUrl.toString()));\n\n // Result\n return {\n ...item,\n items: subItems,\n url,\n active: itemActive || subItems.some((subItem) => subItem.active),\n possible:\n subItems.length === 0 || subItems.some((item) => item.possible),\n };\n },\n [\n parseSubMenuItem,\n isMicrositeContext,\n context,\n currentPathname,\n createSiteUrl,\n storeBaseUrl,\n ],\n );\n\n // Navigation parsing\n const navigation: MenuContextValue[\"navigation\"] = useMemo(() => {\n const parseItemsFn = (items: NavigationItem[]) => items.map(parseMenuItem);\n\n const parseSection = (\n sectionType: keyof typeof NAVIGATION_MAPPING,\n ): ParsedNavigationSection => {\n const section = NAVIGATION_MAPPING[sectionType];\n const parsedItems = parseItemsFn(section.items ?? []);\n\n const url = section.url ? createSiteUrl(section.url) : null;\n\n const finalUrl =\n url ||\n // TODO: maybe need to improve to get first \"available\" child not the first form array, not sure if the\n // parseItemsFn filters them already out\n findFirstPossibleDeepNestedItemUrl(parsedItems) ||\n (!section.url && createSiteUrl(section.fallbackUrl)) ||\n storeBaseUrl.toString();\n\n return {\n label: section.label,\n type: sectionType,\n url: finalUrl,\n active: parsedItems.some((el) => el.active),\n possible:\n parsedItems.length === 0 || parsedItems.some((item) => item.possible),\n items: parsedItems,\n };\n };\n\n const primary = parseSection(\"primary\");\n const secondary = parseSection(\"secondary\");\n\n // Active value - only one section can be active\n if (secondary.active) {\n primary.active = false;\n } else if (primary.active) {\n secondary.active = false;\n }\n\n return {\n primary,\n secondary,\n };\n }, [parseMenuItem, createSiteUrl, storeBaseUrl]);\n\n const activeNavigationSectionType = useMemo<NavigationSectionType>(() => {\n /**\n * First attempt to derive active section based on active navigation\n */\n if (navigation.primary.active) {\n return \"primary\";\n }\n if (navigation.secondary.active) {\n return \"secondary\";\n }\n\n /**\n * Fallback to check against context id if we can't match it on path\n * Only uisp.com and experts.uisp.com uses \"secondary\" as default\n * TODO: should move this logic into \"navigation\" memo fn so both states are in sync\n */\n return [SiteId.Uisp, SiteId.ExpertsUisp].includes(context)\n ? \"secondary\"\n : \"primary\";\n }, [context, navigation.primary.active, navigation.secondary.active]);\n\n // Define active sections\n const activeNavigationSection: MenuContextValue[\"activeNavigationSection\"] =\n useMemo(() => {\n return navigation[activeNavigationSectionType];\n }, [activeNavigationSectionType, navigation]);\n\n const inactiveNavigationSection: MenuContextValue[\"inactiveNavigationSection\"] =\n useMemo(() => {\n const inactiveType =\n activeNavigationSectionType === \"primary\" ? \"secondary\" : \"primary\";\n\n return navigation[inactiveType];\n }, [activeNavigationSectionType, navigation]);\n\n // #############################################################################\n // Override motif\n // #############################################################################\n const motifFinal = useMemo((): Motif => {\n // Active mobile menu forces dark motif\n if (activeModal === ModalId.MobileMenu) {\n return \"dark\";\n }\n\n // Update: Commented out as no longer - https://ui.slack.com/archives/G01B4G8GF2S/p1683011332500999?thread_ts=1683008828.124399&cid=G01B4G8GF2S\n // Optionally override motif scheme for some specific subitems based on active item\n // const navigationSubItemsWithDarkMotif = [\n // NavigationItemId.NewIntegrations,\n // NavigationItemId.Accessories,\n // ];\n // if (\n // activeNavigationSection.items.some(\n // (item) =>\n // navigationSubItemsWithDarkMotif.includes(item.id) && item.active\n // )\n // ) {\n // return \"dark\";\n // }\n\n // Return the active one\n return motif;\n }, [activeModal, motif]);\n\n // #############################################################################\n // Navigation visibility\n // #############################################################################\n const [navigationOutOfView, setNavigationOutOfView] = useState<\n MenuContextValue[\"navigationOutOfView\"]\n >(\n // Default ref.current is null so by default it's not visible\n true,\n );\n\n // #############################################################################\n // Result\n // #############################################################################\n const value = useMemo(\n () => ({\n // Unrelated util to help aid with SSR in various places in app\n isSsr,\n storeId,\n\n motif: motifFinal,\n setMotif: handleSetMotif,\n\n context,\n isMicrositeContext,\n\n activeModal,\n prevActiveModal,\n setActiveModal,\n\n deployedLanguages,\n isMultiLanguage,\n language,\n languageDirection: getLanguageDirection(language),\n isLongLanguage,\n\n navigation,\n activeNavigationSection,\n inactiveNavigationSection,\n isPathnameActive,\n\n navigationOutOfView,\n setNavigationOutOfView,\n\n createSiteUrl,\n }),\n [\n activeModal,\n activeNavigationSection,\n context,\n createSiteUrl,\n deployedLanguages,\n handleSetMotif,\n inactiveNavigationSection,\n isLongLanguage,\n isMicrositeContext,\n isMultiLanguage,\n isPathnameActive,\n isSsr,\n language,\n motifFinal,\n navigation,\n navigationOutOfView,\n prevActiveModal,\n setActiveModal,\n storeId,\n ],\n );\n return <MenuContext.Provider value={value}>{children}</MenuContext.Provider>;\n};\n\nexport function useMenu(): MenuContextValue {\n const context = useContext(MenuContext);\n if (context === null) {\n throw new Error(\"useMenu must be used within a MenuContextProvider\");\n }\n return context;\n}\n"],"names":["MenuContext","createContext","MenuContextProvider","context","pathname","currentPathname","storeId","DEFAULT_STORE_ID","hasSsrCapability","hash","currentHash","language","DEFAULT_LANGUAGE","globalSiteConfig","children","isMobile","useMedia","BREAKPOINTS","TOP_NAV_MOBILE_AND_DOWN","getSiteConfig","useCallback","siteId","storeIdOverride","getGlobalSiteConfig","currentSiteConfig","useMemo","deployedLanguages","languages","isMultiLanguage","length","isLongLanguage","LONG_LANGUAGES","includes","isSsr","setIsSsr","useState","useEffect","storeBaseUrl","SiteId","Store","baseUrl","motif","setMotif","handleSetMotif","isMicrositeContext","Ui","Uisp","ExpertsUi","ExpertsUisp","Uwc","TechSpecs","Blog","Generic","Amplifi","checkUnreachable","activeModal","prevActiveModal","_setActiveModal","setActiveModal","id","ModalId","MobileMenu","ProMobileMenu","Search","useLockBodyScrollCustom","currentCollectionPath","url","URL","matches","exec","currentProductPath","isPathnameActive","GENERIC_SITE_IDS","optional","micrositeRegExp","RegExp","test","isPartOfUrlPathname","isSiteUrlActive","replace","createSiteUrl","siteUrl","addSiteConfigReferenceSearchParams","targetSiteConfig","parseSiteUrl","parseSubSubRecursiveItems","subSubItem","nestedSubSubItems","items","map","filter","el","findFirstPossibleDeepNestedItemUrl","active","some","label","icon","mobileIcon","isNew","possible","item","parseSubSubMenuItems","subItem","parseSubMenuItem","subItemUrl","getSubItemUrl","subSubItems","subItemActive","subLabel","subLabelTheme","subLabelCollapseMode","invisible","toString","parseMenuItem","subItems","itemActive","fallbackUrl","navigation","parseItemsFn","parseSection","sectionType","section","NAVIGATION_MAPPING","parsedItems","finalUrl","type","primary","secondary","activeNavigationSectionType","activeNavigationSection","inactiveNavigationSection","inactiveType","motifFinal","navigationOutOfView","setNavigationOutOfView","value","languageDirection","getLanguageDirection","jsx","Provider","useMenu","useContext","Error"],"mappings":";;;;;;;;;;AAmDa,MAAAA,WAAA,GAAcC,cAAuC,IAAI,CAAA;AAE/D,MAAMC,sBAAsBA,CAAC;EAClCC,OAAA;EACAC,UAAUC,eAAkB,GAAA,GAAA;EAC5BC,OAAU,GAAAC,gBAAA;EACVC,gBAAmB,GAAA,KAAA;EACnBC,MAAMC,WAAc,GAAA,EAAA;EACpBC,QAAW,GAAAC,gBAAA;EACXC,gBAAA;EACAC;AACF,CA0CmB,KAAA;EACjB,MAAMC,QAAW,GAAAC,QAAA,CACfC,WAAY,CAAAC,uBAAA,EACZ;EAAA;EAAA,CACF;EAKA,MAAMC,aAAgB,GAAAC,WAAA,CACpB,CAACC,MAAgB,EAAAC,eAAA,KACfC,oBAAoBV,gBAAkB,EAAAQ,MAAA,EAAQC,mBAAmBhB,OAAO,CAAA,EAC1E,CAACO,kBAAkBP,OAAO,CAAA,CAC5B;EAEA,MAAMkB,iBAAoB,GAAAC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Q,CAAA;IAChDmB,cAAA;IAEAuF,UAAA;IACAY,uBAAA;IACAC,yBAAA;IACA3D,gBAAA;IAEA8D,mBAAA;IACAC,sBAAA;IAEAtD;EAAA,CACF,CAAA,EACA,CACEzB,WAAA,EACA0E,uBAAA,EACA9H,OAAA,EACA6E,aAAA,EACAtD,iBAAA,EACAiB,cAAA,EACAuF,yBAAA,EACApG,cAAA,EACAc,kBAAA,EACAhB,eAAA,EACA2C,gBAAA,EACAtC,KAAA,EACAtB,QAAA,EACAyH,UAAA,EACAf,UAAA,EACAgB,mBAAA,EACA7E,eAAA,EACAE,cAAA,EACApD,OAAA,CACF,CACF;EACA,OAAQ,eAAAoI,GAAA,CAAA1I,WAAA,CAAY2I,QAAZ,EAAA;IAAqBJ;IAAezH;EAAS,CAAA,CAAA;AACvD,CAAA;AAEO,SAAS8H,OAA4BA,CAAA,EAAA;EACpC,MAAAzI,OAAA,GAAU0I,WAAW7I,WAAW,CAAA;EACtC,IAAIG,YAAY,IAAM,EAAA;IACd,MAAA,IAAI2I,MAAM,mDAAmD,CAAA;EACrE;EACO,OAAA3I,OAAA;AACT;"}
|
|
1
|
+
{"version":3,"file":"context.mjs","sources":["../../../src/contexts/MenuContext/context.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useMemo,\n useState,\n} from \"react\";\nimport type { ReactNode } from \"react\";\nimport { useMedia } from \"react-use\";\n\nimport { BREAKPOINTS } from \"../../constants/layout\";\nimport { useLockBodyScrollCustom } from \"../../hooks/useLockBodyScrollCustom\";\nimport type { GlobalStoreId } from \"../../types\";\nimport { checkUnreachable } from \"../../utils/errors\";\nimport type {\n DeployedLanguages,\n Language,\n NavigationItem,\n NavigationSectionType,\n NavigationSubItem,\n NavigationSubSubItem,\n SiteUrl,\n} from \"./mapping\";\nimport {\n DEFAULT_LANGUAGE,\n DEFAULT_STORE_ID,\n GENERIC_SITE_IDS,\n LONG_LANGUAGES,\n NAVIGATION_MAPPING,\n SiteId,\n} from \"./mapping\";\nimport type {\n GlobalSiteConfig,\n MenuContextValue,\n ParsedNavigationItem,\n ParsedNavigationSection,\n ParsedNavigationSubItem,\n ParsedNavigationSubSubItem,\n} from \"./types\";\nimport { ModalId } from \"./types\";\nimport {\n findFirstPossibleDeepNestedItemUrl,\n getGlobalSiteConfig,\n getLanguageDirection,\n getSubItemUrl,\n isPartOfUrlPathname,\n parseSiteUrl,\n} from \"./utils\";\n\nexport const MenuContext = createContext<MenuContextValue | null>(null);\n\nexport const MenuContextProvider = ({\n context,\n pathname: currentPathname = \"/\",\n storeId = DEFAULT_STORE_ID,\n hasSsrCapability = false,\n hash: currentHash = \"\",\n language = DEFAULT_LANGUAGE,\n globalSiteConfig,\n children,\n}: {\n /**\n * Set how the navigation behave as - ui.com/store/uisp.com/...\n */\n context: SiteId;\n /**\n * Base url for menu item paths\n * e.g. https://ecomm.stg.ui.com/ca/en/\n * e.g. window.location.origin\n *\n * ! Not specified on microsites !\n */\n baseUrl?: string | URL;\n /**\n * Pathname of the current url\n * Used as a prop to be in sync with e.g. next\n */\n pathname?: string;\n /**\n * Hash of the current URL (the part of the URL that starts with #)\n */\n hash?: string;\n /**\n * Store context for determining which path to use\n * Will fall-back to US if not found\n * @example GlobalStoreId.Ca\n */\n storeId?: GlobalStoreId;\n /**\n * Indicates if consumer project has capability of doing SSR\n */\n hasSsrCapability?: boolean;\n /**\n * (optionally) Hints which language currently us currently in use\n */\n language?: Language;\n /**\n * Global Site Config that define available urls/languages/regions enabled for globally\n */\n globalSiteConfig: GlobalSiteConfig;\n\n children: ReactNode;\n}): JSX.Element => {\n const isMobile = useMedia(\n BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN,\n false, // Fallback value for SSR\n );\n\n // #############################################################################\n // Global site config\n // #############################################################################\n const getSiteConfig = useCallback(\n (siteId: SiteId, storeIdOverride?: GlobalStoreId) =>\n getGlobalSiteConfig(globalSiteConfig, siteId, storeIdOverride ?? storeId),\n [globalSiteConfig, storeId],\n );\n\n const currentSiteConfig = useMemo(\n // Generic site doesn't have a site config\n () => getSiteConfig(context),\n [context, getSiteConfig],\n );\n\n // #############################################################################\n // Language\n // #############################################################################\n const deployedLanguages = useMemo<DeployedLanguages | []>(() => {\n return (\n currentSiteConfig.languages ??\n [\n /** Left empty as that indicates given site doesn't implement multiple language AT ALL. For example store would\n * have single language for now, but UISP doesn't have at all.\n */\n ]\n );\n }, [currentSiteConfig.languages]);\n\n const isMultiLanguage = useMemo((): boolean => {\n return deployedLanguages.length > 1;\n }, [deployedLanguages]);\n\n const isLongLanguage = useMemo(\n () => LONG_LANGUAGES.includes(language),\n [language],\n );\n\n // #############################################################################\n // Track if is first render (SSR) to normalise first rendering between server <--> client for code that is shared\n // between microsites and store. To support both scenario's initial state is set by prop\n // #############################################################################\n const [isSsr, setIsSsr] = useState(hasSsrCapability);\n\n useEffect(() => {\n setIsSsr(false);\n }, []);\n\n // #############################################################################\n // Store base URL\n // #############################################################################\n const storeBaseUrl = useMemo(\n () => getSiteConfig(SiteId.Store).baseUrl,\n [getSiteConfig],\n );\n\n // #############################################################################\n // Menu motif\n // #############################################################################\n const [motif, setMotif] = useState<MenuContextValue[\"motif\"]>(\"light\");\n\n /**\n * Helper to ensure a correct motif is set\n * TODO: maybe check which parts uses it, can we maybe just consolidate the logic within the context itself?\n */\n const handleSetMotif = useCallback((motif: Motif) => {\n if ([\"light\", \"dark\"].includes(motif)) {\n setMotif(motif);\n }\n }, []);\n\n // #############################################################################\n // Nav context\n // #############################################################################\n const isMicrositeContext: MenuContextValue[\"isMicrositeContext\"] =\n useMemo(() => {\n // Type-safe detection for context\n switch (context) {\n case null:\n case undefined:\n case SiteId.Ui:\n case SiteId.Uisp:\n case SiteId.ExpertsUi:\n case SiteId.ExpertsUisp:\n case SiteId.Uwc:\n case SiteId.TechSpecs:\n case SiteId.Blog:\n case SiteId.Generic: {\n return true;\n }\n case SiteId.Amplifi:\n case SiteId.Store: {\n return false;\n }\n default: {\n // Fallback to true as well\n checkUnreachable(context);\n return true;\n }\n }\n }, [context]);\n\n // #############################################################################\n // Active modal\n // #############################################################################\n // eslint-disable-next-line react/hook-use-state\n const [{ activeModal, prevActiveModal }, _setActiveModal] = useState<{\n activeModal: MenuContextValue[\"activeModal\"];\n prevActiveModal: MenuContextValue[\"prevActiveModal\"];\n }>({\n activeModal: null,\n prevActiveModal: null,\n });\n\n const setActiveModal = useCallback<MenuContextValue[\"setActiveModal\"]>(\n (id) => {\n _setActiveModal({\n activeModal: id,\n prevActiveModal: activeModal,\n });\n },\n [activeModal],\n );\n\n // Reset modals on viewport change\n useEffect(() => {\n if (\n !isMobile &&\n activeModal &&\n [ModalId.MobileMenu, ModalId.ProMobileMenu].includes(activeModal)\n ) {\n setActiveModal(null);\n }\n }, [activeModal, isMobile, setActiveModal]);\n\n // Body lock for specific modals\n useLockBodyScrollCustom(\n !!activeModal &&\n [ModalId.MobileMenu, ModalId.ProMobileMenu].includes(activeModal),\n );\n\n // #############################################################################\n // Parse router parameters\n // #############################################################################\n // Parse the collection slug as route path\n const currentCollectionPath = useMemo((): string | undefined => {\n const url = new URL(currentPathname, storeBaseUrl);\n const matches = /(\\/collections\\/[\\w-]+)/i.exec(url.pathname);\n\n return matches?.[1];\n }, [storeBaseUrl, currentPathname]);\n\n const currentProductPath = useMemo((): string | undefined => {\n const url = new URL(currentPathname, storeBaseUrl);\n const matches = /((\\/collections\\/.+)?\\/products\\/[\\w-]+)/i.exec(\n url.pathname,\n );\n\n return matches?.[1];\n }, [storeBaseUrl, currentPathname]);\n\n const isPathnameActive = useCallback(\n (pathname: string): boolean => {\n // Don't do matching for generic site contexts\n if (GENERIC_SITE_IDS.includes(context)) {\n return false;\n }\n\n if (isMicrositeContext) {\n // HACK microsites can have paths with and without regional prefixes\n const optional = pathname === \"/\" ? \"?\" : \"\";\n const micrositeRegExp = new RegExp(\n `^(?:/\\\\w{2})?${pathname}${optional}$`,\n );\n return micrositeRegExp.test(currentPathname);\n }\n\n return (\n (!!currentCollectionPath &&\n isPartOfUrlPathname(pathname, currentCollectionPath)) ||\n (!!currentProductPath &&\n isPartOfUrlPathname(pathname, currentProductPath))\n );\n },\n [\n context,\n isMicrositeContext,\n currentCollectionPath,\n currentProductPath,\n currentPathname,\n ],\n );\n\n const isSiteUrlActive = useCallback(\n (url: SiteUrl): boolean => {\n return (\n isMicrositeContext &&\n // While SiteId is considered a microsite we don't want url matching for it\n !GENERIC_SITE_IDS.includes(context) &&\n url &&\n url[0] !== SiteId.Store &&\n url[0] === context &&\n isPartOfUrlPathname(currentPathname, url[1]) &&\n // If there's a hash in the SiteUrl, it should match the current hash for the item to be active\n (!url[3] || currentHash.replace(/^#/, \"\") === url[3])\n );\n },\n [context, currentHash, currentPathname, isMicrositeContext],\n );\n\n // #############################################################################\n // Menu sections and items\n // #############################################################################\n const createSiteUrl = useCallback(\n (siteUrl: SiteUrl) => {\n // Don't add store and language search param for navigation with generic context\n const addSiteConfigReferenceSearchParams =\n !GENERIC_SITE_IDS.includes(context);\n\n const [siteId] = siteUrl;\n\n const targetSiteConfig = getSiteConfig(siteId);\n\n return parseSiteUrl({\n siteUrl,\n storeId,\n addSiteConfigReferenceSearchParams,\n language,\n targetSiteConfig,\n context,\n });\n },\n [context, getSiteConfig, storeId, language],\n );\n\n const parseSubSubRecursiveItems = useCallback(\n (subSubItem: NavigationSubSubItem): ParsedNavigationSubSubItem | null => {\n // Sub-sub-items\n const nestedSubSubItems =\n \"items\" in subSubItem && subSubItem.items\n ? subSubItem.items\n .map(parseSubSubRecursiveItems)\n .filter((el): el is ParsedNavigationSubSubItem => !!el)\n : [];\n\n const url =\n isMicrositeContext && subSubItem.url\n ? createSiteUrl(subSubItem.url)\n : // TODO: maybe need to improve to get first \"available\" child not the first form array, not sure if the\n // parseItemsFn filters them already out\n (findFirstPossibleDeepNestedItemUrl(nestedSubSubItems) ??\n (subSubItem.url && createSiteUrl(subSubItem.url)));\n\n if (!url) {\n return null;\n }\n\n const active =\n (subSubItem.url && isSiteUrlActive(subSubItem.url)) ||\n // Any child item is active\n nestedSubSubItems.some((el) => el.active);\n\n return {\n id: subSubItem.id,\n label: subSubItem.label,\n // subLabel: subSubItem.subLabel,\n icon: subSubItem.icon,\n mobileIcon: subSubItem.mobileIcon,\n isNew: subSubItem.isNew,\n active,\n url,\n possible:\n \"items\" in subSubItem\n ? nestedSubSubItems.some((item) => item.possible)\n : // If gotten this far fallback to true\n true,\n items: nestedSubSubItems,\n };\n },\n [isMicrositeContext, createSiteUrl, isSiteUrlActive],\n );\n\n const parseSubSubMenuItems = useCallback(\n (subItem: NavigationSubItem): ParsedNavigationSubSubItem[] => {\n return (\"items\" in subItem ? subItem.items : [])\n .map(parseSubSubRecursiveItems)\n .filter((el): el is ParsedNavigationSubSubItem => !!el);\n },\n [parseSubSubRecursiveItems],\n );\n\n const parseSubMenuItem = useCallback(\n (subItem: NavigationSubItem): ParsedNavigationSubItem | null => {\n const subItemUrl = getSubItemUrl(subItem, isSiteUrlActive);\n\n // Append the new pathname (e.g. when /ca/en already exists)\n const url = subItemUrl ? new URL(createSiteUrl(subItemUrl)) : null;\n\n if (!url) {\n return null;\n }\n\n // Sub-sub-items\n const subSubItems = parseSubSubMenuItems(subItem);\n\n // Parse item active state\n const subItemActive =\n // Site url is active\n (subItem.url && isSiteUrlActive(subItem.url)) ||\n // Any child item is active\n subSubItems.some((el) => el.active);\n\n return {\n id: subItem.id,\n label: subItem.label,\n subLabel: subItem.subLabel,\n subLabelTheme: subItem.subLabelTheme,\n subLabelCollapseMode: subItem.subLabelCollapseMode,\n isNew: subItem.isNew,\n icon: subItem.icon,\n mobileIcon: subItem.mobileIcon,\n invisible: subItem.invisible,\n\n url: url.toString(),\n active: subItemActive,\n\n possible:\n subSubItems.length === 0 || subSubItems.some((item) => item.possible),\n items: subSubItems,\n };\n },\n [isSiteUrlActive, createSiteUrl, parseSubSubMenuItems],\n );\n\n const parseMenuItem = useCallback(\n (item: NavigationItem): ParsedNavigationItem => {\n // Parse sub-items\n const subItems = item.items\n .map(parseSubMenuItem)\n .filter((subItem): subItem is ParsedNavigationSubItem => !!subItem);\n\n // Parse main item active state when in microsite context\n let itemActive = false;\n\n // Custom logic just for microsites to detect if we have to open the 2nd layer navigation\n if (\n isMicrositeContext &&\n // While SiteId is considered a microsite we don't want url matching for it\n !GENERIC_SITE_IDS.includes(context) &&\n item.url &&\n item.url[0] === context &&\n item.url[0] !== SiteId.Store &&\n isPartOfUrlPathname(currentPathname, item.url[1])\n ) {\n itemActive = true;\n }\n\n /**\n * Main item url\n * If it is a microsite context, we use the site url if available.\n * If not in microsite context we use the store url if available and\n * fallback to site URL, then fallback URL and lastly to base URL.\n */\n const url =\n isMicrositeContext && item.url\n ? createSiteUrl(item.url)\n : // TODO: maybe need to improve to get first \"available\" child not the first form array, not sure if the\n // parseItemsFn filters them already out\n (findFirstPossibleDeepNestedItemUrl(subItems) ??\n ((item.url && createSiteUrl(item.url)) ||\n (item.fallbackUrl && createSiteUrl(item.fallbackUrl)) ||\n storeBaseUrl.toString()));\n\n // Result\n return {\n ...item,\n items: subItems,\n url,\n active: itemActive || subItems.some((subItem) => subItem.active),\n possible:\n subItems.length === 0 || subItems.some((item) => item.possible),\n };\n },\n [\n parseSubMenuItem,\n isMicrositeContext,\n context,\n currentPathname,\n createSiteUrl,\n storeBaseUrl,\n ],\n );\n\n // Navigation parsing\n const navigation: MenuContextValue[\"navigation\"] = useMemo(() => {\n const parseItemsFn = (items: NavigationItem[]) => items.map(parseMenuItem);\n\n const parseSection = (\n sectionType: keyof typeof NAVIGATION_MAPPING,\n ): ParsedNavigationSection => {\n const section = NAVIGATION_MAPPING[sectionType];\n const parsedItems = parseItemsFn(section.items ?? []);\n\n const url = section.url ? createSiteUrl(section.url) : null;\n\n const finalUrl =\n url ||\n // TODO: maybe need to improve to get first \"available\" child not the first form array, not sure if the\n // parseItemsFn filters them already out\n findFirstPossibleDeepNestedItemUrl(parsedItems) ||\n (!section.url && createSiteUrl(section.fallbackUrl)) ||\n storeBaseUrl.toString();\n\n return {\n label: section.label,\n type: sectionType,\n url: finalUrl,\n active: parsedItems.some((el) => el.active),\n possible:\n parsedItems.length === 0 || parsedItems.some((item) => item.possible),\n items: parsedItems,\n };\n };\n\n const primary = parseSection(\"primary\");\n const secondary = parseSection(\"secondary\");\n\n // Active value - only one section can be active\n if (secondary.active) {\n primary.active = false;\n } else if (primary.active) {\n secondary.active = false;\n }\n\n return {\n primary,\n secondary,\n };\n }, [parseMenuItem, createSiteUrl, storeBaseUrl]);\n\n const activeNavigationSectionType = useMemo<NavigationSectionType>(() => {\n /**\n * First attempt to derive active section based on active navigation\n */\n if (navigation.primary.active) {\n return \"primary\";\n }\n if (navigation.secondary.active) {\n return \"secondary\";\n }\n\n /**\n * Fallback to check against context id if we can't match it on path\n * Only uisp.com and experts.uisp.com uses \"secondary\" as default\n * TODO: should move this logic into \"navigation\" memo fn so both states are in sync\n */\n return [SiteId.Uisp, SiteId.ExpertsUisp].includes(context)\n ? \"secondary\"\n : \"primary\";\n }, [context, navigation.primary.active, navigation.secondary.active]);\n\n // Define active sections\n const activeNavigationSection: MenuContextValue[\"activeNavigationSection\"] =\n useMemo(() => {\n return navigation[activeNavigationSectionType];\n }, [activeNavigationSectionType, navigation]);\n\n const inactiveNavigationSection: MenuContextValue[\"inactiveNavigationSection\"] =\n useMemo(() => {\n const inactiveType =\n activeNavigationSectionType === \"primary\" ? \"secondary\" : \"primary\";\n\n return navigation[inactiveType];\n }, [activeNavigationSectionType, navigation]);\n\n // #############################################################################\n // Override motif\n // #############################################################################\n const motifFinal = useMemo((): Motif => {\n // Active mobile menu forces dark motif\n if (activeModal === ModalId.MobileMenu) {\n return \"dark\";\n }\n\n // Update: Commented out as no longer - https://ui.slack.com/archives/G01B4G8GF2S/p1683011332500999?thread_ts=1683008828.124399&cid=G01B4G8GF2S\n // Optionally override motif scheme for some specific subitems based on active item\n // const navigationSubItemsWithDarkMotif = [\n // NavigationItemId.NewIntegrations,\n // NavigationItemId.Accessories,\n // ];\n // if (\n // activeNavigationSection.items.some(\n // (item) =>\n // navigationSubItemsWithDarkMotif.includes(item.id) && item.active\n // )\n // ) {\n // return \"dark\";\n // }\n\n // Return the active one\n return motif;\n }, [activeModal, motif]);\n\n // #############################################################################\n // Navigation visibility\n // #############################################################################\n const [navigationOutOfView, setNavigationOutOfView] = useState<\n MenuContextValue[\"navigationOutOfView\"]\n >(\n // Default ref.current is null so by default it's not visible\n true,\n );\n\n // #############################################################################\n // Result\n // #############################################################################\n const value = useMemo(\n () => ({\n // Unrelated util to help aid with SSR in various places in app\n isSsr,\n storeId,\n\n motif: motifFinal,\n setMotif: handleSetMotif,\n\n context,\n isMicrositeContext,\n\n activeModal,\n prevActiveModal,\n setActiveModal,\n\n deployedLanguages,\n isMultiLanguage,\n language,\n languageDirection: getLanguageDirection(language),\n isLongLanguage,\n\n navigation,\n activeNavigationSection,\n inactiveNavigationSection,\n isPathnameActive,\n\n navigationOutOfView,\n setNavigationOutOfView,\n\n createSiteUrl,\n }),\n [\n activeModal,\n activeNavigationSection,\n context,\n createSiteUrl,\n deployedLanguages,\n handleSetMotif,\n inactiveNavigationSection,\n isLongLanguage,\n isMicrositeContext,\n isMultiLanguage,\n isPathnameActive,\n isSsr,\n language,\n motifFinal,\n navigation,\n navigationOutOfView,\n prevActiveModal,\n setActiveModal,\n storeId,\n ],\n );\n return <MenuContext.Provider value={value}>{children}</MenuContext.Provider>;\n};\n\nexport function useMenu(): MenuContextValue {\n const context = useContext(MenuContext);\n if (context === null) {\n throw new Error(\"useMenu must be used within a MenuContextProvider\");\n }\n return context;\n}\n"],"names":["MenuContext","createContext","MenuContextProvider","context","pathname","currentPathname","storeId","DEFAULT_STORE_ID","hasSsrCapability","hash","currentHash","language","DEFAULT_LANGUAGE","globalSiteConfig","children","isMobile","useMedia","BREAKPOINTS","TOP_NAV_MOBILE_AND_DOWN","getSiteConfig","useCallback","siteId","storeIdOverride","getGlobalSiteConfig","currentSiteConfig","useMemo","deployedLanguages","languages","isMultiLanguage","length","isLongLanguage","LONG_LANGUAGES","includes","isSsr","setIsSsr","useState","useEffect","storeBaseUrl","SiteId","Store","baseUrl","motif","setMotif","handleSetMotif","isMicrositeContext","Ui","Uisp","ExpertsUi","ExpertsUisp","Uwc","TechSpecs","Blog","Generic","Amplifi","checkUnreachable","activeModal","prevActiveModal","_setActiveModal","setActiveModal","id","ModalId","MobileMenu","ProMobileMenu","useLockBodyScrollCustom","currentCollectionPath","url","URL","matches","exec","currentProductPath","isPathnameActive","GENERIC_SITE_IDS","optional","micrositeRegExp","RegExp","test","isPartOfUrlPathname","isSiteUrlActive","replace","createSiteUrl","siteUrl","addSiteConfigReferenceSearchParams","targetSiteConfig","parseSiteUrl","parseSubSubRecursiveItems","subSubItem","nestedSubSubItems","items","map","filter","el","findFirstPossibleDeepNestedItemUrl","active","some","label","icon","mobileIcon","isNew","possible","item","parseSubSubMenuItems","subItem","parseSubMenuItem","subItemUrl","getSubItemUrl","subSubItems","subItemActive","subLabel","subLabelTheme","subLabelCollapseMode","invisible","toString","parseMenuItem","subItems","itemActive","fallbackUrl","navigation","parseItemsFn","parseSection","sectionType","section","NAVIGATION_MAPPING","parsedItems","finalUrl","type","primary","secondary","activeNavigationSectionType","activeNavigationSection","inactiveNavigationSection","inactiveType","motifFinal","navigationOutOfView","setNavigationOutOfView","value","languageDirection","getLanguageDirection","jsx","Provider","useMenu","useContext","Error"],"mappings":";;;;;;;;;;AAmDa,MAAAA,WAAA,GAAcC,cAAuC,IAAI,CAAA;AAE/D,MAAMC,sBAAsBA,CAAC;EAClCC,OAAA;EACAC,UAAUC,eAAkB,GAAA,GAAA;EAC5BC,OAAU,GAAAC,gBAAA;EACVC,gBAAmB,GAAA,KAAA;EACnBC,MAAMC,WAAc,GAAA,EAAA;EACpBC,QAAW,GAAAC,gBAAA;EACXC,gBAAA;EACAC;AACF,CA0CmB,KAAA;EACjB,MAAMC,QAAW,GAAAC,QAAA,CACfC,WAAY,CA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