@ubnt/store.core 9.19.1 → 9.20.0-alpha.1
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 +205 -1
- package/lib/_virtual/_virtual_multi-entry.js +27 -12
- package/lib/_virtual/_virtual_multi-entry.js.map +1 -1
- package/lib/_virtual/_virtual_multi-entry.mjs +14 -10
- package/lib/_virtual/_virtual_multi-entry.mjs.map +1 -1
- package/lib/assets/attention.svg +5 -5
- package/lib/assets/attention2.svg +5 -5
- package/lib/assets/close2.svg +2 -3
- package/lib/assets/close3.svg +3 -2
- package/lib/assets/efg.png +0 -0
- package/lib/assets/icon-location-pin.svg +5 -0
- package/lib/assets/icons/menu/icon-location-pin.svg.js +27 -0
- 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/pause.svg +3 -3
- package/lib/assets/pause2.svg +3 -3
- package/lib/assets/ucg-max.png +0 -0
- package/lib/assets/udmProMax.jpg +0 -0
- package/lib/assets/udmProMax2.jpg +0 -0
- package/lib/assets/udmProSpecial.jpg +0 -0
- package/lib/assets/udmProSpecial2.jpg +0 -0
- package/lib/components/CategoryTabs/CategoryTabs.styles.d.ts +1 -1
- package/lib/components/CategoryTabs/CategoryTabs.styles.js +2 -3
- package/lib/components/CategoryTabs/CategoryTabs.styles.js.map +1 -1
- package/lib/components/CategoryTabs/CategoryTabs.styles.mjs +2 -3
- package/lib/components/CategoryTabs/CategoryTabs.styles.mjs.map +1 -1
- package/lib/components/Compare/Compare.styles.d.ts +5 -5
- package/lib/components/Container/Container.d.ts +1 -1
- package/lib/components/Container/Container.js +4 -3
- 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/FeaturesSection_deprecated/FeaturesSection.js +1 -1
- package/lib/components/FeaturesSection_deprecated/FeaturesSection.mjs +1 -1
- 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/Header/AccountMenu/AccountMenu.js +11 -1
- 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/Header.js +6 -6
- 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.styles.d.ts +2 -2
- package/lib/components/Header/Header.types.d.ts +12 -4
- 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/MenuItem/MenuItem.styles.d.ts +1 -1
- package/lib/components/Header/MenuItem/MenuItem.styles.js +3 -3
- package/lib/components/Header/MenuItem/MenuItem.styles.js.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.styles.mjs +3 -3
- 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/MicrositeMenu/MicrositeMenu.styles.d.ts +1 -1
- package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.d.ts +1 -1
- package/lib/components/Header/Navigation/ProMenu/ProMenu.d.ts +2 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.js +103 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.js.map +1 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.mjs +81 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.mjs.map +1 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.d.ts +23 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.js +121 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.js.map +1 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.mjs +106 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.mjs.map +1 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.types.d.ts +12 -0
- package/lib/components/Header/Navigation/ProMenu/index.d.ts +1 -0
- package/lib/components/Header/Navigation/ProMenu/index.js +6 -0
- package/lib/components/{ResourceCalculatorV1/components → Header/Navigation/ProMenu}/index.js.map +1 -1
- package/lib/components/Header/Navigation/ProMenu/index.mjs +3 -0
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.d.ts +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.js +92 -95
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.js.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.mjs +92 -95
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.mjs.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.d.ts +9 -0
- 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 +10 -4
- package/lib/components/Header/ProHeader/ProHeader.d.ts +3 -4
- package/lib/components/Header/ProHeader/ProHeader.js +247 -120
- package/lib/components/Header/ProHeader/ProHeader.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.mjs +249 -124
- package/lib/components/Header/ProHeader/ProHeader.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.d.ts +4 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.js +23 -17
- package/lib/components/Header/ProHeader/ProHeader.styles.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs +21 -18
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs.map +1 -1
- 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 +4 -1
- package/lib/components/Header/translations/en.json.js.map +1 -1
- package/lib/components/Header/translations/en.json.mjs +4 -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.styles.d.ts +2 -2
- package/lib/components/HeroFadeGallery/HeroFadeGallery.styles.d.ts +1 -1
- package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/HorizontalOptionSelect.d.ts +1 -1
- package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/HorizontalOptionSelect.js +3 -1
- package/lib/components/HorizontalOptionSelect/HorizontalOptionSelect.js.map +1 -0
- package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/HorizontalOptionSelect.mjs +3 -1
- package/lib/components/HorizontalOptionSelect/HorizontalOptionSelect.mjs.map +1 -0
- package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/HorizontalOptionSelect.styles.d.ts +1 -0
- package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/HorizontalOptionSelect.styles.js +10 -7
- package/lib/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.js.map +1 -0
- package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/HorizontalOptionSelect.styles.mjs +10 -7
- package/lib/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.mjs.map +1 -0
- package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/HorizontalOptionSelect.types.d.ts +1 -0
- package/lib/components/HowToUseSection/HowToUseSection.styles.d.ts +2 -2
- package/lib/components/LandingPagePro/LandingPagePro.d.ts +3 -0
- package/lib/components/LandingPagePro/LandingPagePro.js +3 -3
- package/lib/components/LandingPagePro/LandingPagePro.js.map +1 -1
- package/lib/components/LandingPagePro/LandingPagePro.mjs +2 -2
- package/lib/components/LandingPagePro/LandingPagePro.mjs.map +1 -1
- package/lib/components/LandingPagePro/LandingPagePro.styles.d.ts +1 -1
- package/lib/components/LayoutRenderer/LayoutRenderer.styles.d.ts +1 -1
- package/lib/components/LayoutRendererV1/LayoutRenderer.styles.d.ts +3 -3
- package/lib/components/LayoutRendererV2/LayoutRenderer.styles.d.ts +3 -3
- package/lib/components/MicrositeSectionWrap/MicrositeSectionWrap.styles.d.ts +1 -1
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.js +1 -1
- package/lib/components/MicrositeVideoSlideshow/MicrositeVideoSlideshow.mjs +1 -1
- package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.js +1 -1
- package/lib/components/MicrositeVideoSlideshow/assets/pause.svg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.js +5 -5
- package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.mjs +2 -2
- package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.js +1 -1
- package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.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/products/udmProMax.js +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProMax.mjs +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.js +1 -1
- package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs +1 -1
- package/lib/components/ProductSectionNavigation/ProductSectionNavigation.styles.d.ts +1 -1
- package/lib/components/ProductSectionNavigationV2/ProductSectionNavigation.styles.d.ts +1 -1
- package/lib/components/ProductTechSpecs/ProductTechSpecs.styles.d.ts +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js +313 -17
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs +311 -17
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.constants.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.d.ts +3 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js +2 -0
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs +2 -0
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.types.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.js +120 -34
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.mjs +120 -34
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.d.ts +16 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.js +54 -12
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.mjs +50 -11
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/DeviceSelect.styles.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/assets/ArrowLeftPrimary.svg.js +5 -5
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/DeviceSelect/assets/ArrowRightPrimary.svg.js +5 -5
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.js +2 -0
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.mjs +2 -0
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/attention.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/assets/attention.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.mjs +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/useComputeResourceCalculator.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/ResourceCalculator.js +1 -2
- package/lib/components/ResourceCalculatorV1/ResourceCalculator.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/ResourceCalculator.mjs +1 -2
- package/lib/components/ResourceCalculatorV1/ResourceCalculator.mjs.map +1 -1
- package/lib/{assets/icons/menu/icon-globe.svg.js → components/ResourceCalculatorV1/assets/consoles/efg.png.js} +6 -6
- package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.js.map +1 -0
- package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.mjs +3 -0
- package/lib/components/ResourceCalculatorV1/assets/consoles/efg.png.mjs.map +1 -0
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.js +27 -0
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.js.map +1 -0
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.mjs +3 -0
- package/lib/components/ResourceCalculatorV1/assets/consoles/ucg-max.png.mjs.map +1 -0
- package/lib/components/ResourceCalculatorV1/translations/en.json.js +6 -4
- package/lib/components/ResourceCalculatorV1/translations/en.json.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/translations/en.json.mjs +6 -4
- package/lib/components/ResourceCalculatorV1/translations/en.json.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/translations/useResourceCalculatorTranslation.d.ts +2 -2
- package/lib/components/VideoPlayerNew/VideoPlayer.js +2 -2
- package/lib/components/VideoPlayerNew/VideoPlayer.mjs +2 -2
- package/lib/components/VideoPlayerNew/assets/close.svg.js +1 -1
- package/lib/components/VideoPlayerNew/assets/close.svg.mjs +2 -2
- package/lib/components/VideoPlayerNew/assets/pause.svg.js +1 -1
- package/lib/components/VideoPlayerNew/assets/pause.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/constants/proStoreCategories/mapping/index.d.ts +1 -0
- package/lib/constants/proStoreCategories/mapping/index.js +15 -10
- package/lib/constants/proStoreCategories/mapping/index.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/index.mjs +15 -10
- package/lib/constants/proStoreCategories/mapping/index.mjs.map +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.d.ts +2 -1
- package/lib/constants/proStoreCategories/mapping/unifi.js +1 -0
- package/lib/constants/proStoreCategories/mapping/unifi.js.map +1 -1
- package/lib/constants/proStoreCategories/mapping/unifi.mjs +1 -0
- package/lib/constants/proStoreCategories/mapping/unifi.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/en.json.js +3 -0
- package/lib/constants/proStoreCategories/translations/en.json.js.map +1 -1
- package/lib/constants/proStoreCategories/translations/en.json.mjs +3 -1
- package/lib/constants/proStoreCategories/translations/en.json.mjs.map +1 -1
- package/lib/constants/proStoreCategories/translations/fr.json.js +1 -1
- package/lib/constants/proStoreCategories/translations/fr.json.mjs +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.js +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js +1 -1
- package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs +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 +1 -1
- 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/helpers/index.d.ts +1 -0
- package/lib/helpers/index.js +11 -0
- package/lib/helpers/index.js.map +1 -1
- package/lib/helpers/index.mjs +1 -0
- package/lib/helpers/index.mjs.map +1 -1
- package/lib/helpers/product.d.ts +87 -0
- package/lib/helpers/product.js +346 -0
- package/lib/helpers/product.js.map +1 -0
- package/lib/helpers/product.mjs +335 -0
- package/lib/helpers/product.mjs.map +1 -0
- package/lib/helpers/ux.d.ts +9 -1
- 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/types/index.d.ts +1 -0
- package/lib/types/index.js +2 -0
- package/lib/types/index.js.map +1 -1
- package/lib/types/index.mjs +1 -0
- package/lib/types/index.mjs.map +1 -1
- package/lib/types/product.d.ts +87 -0
- package/lib/types/product.js +14 -0
- package/lib/types/product.js.map +1 -0
- package/lib/types/product.mjs +13 -0
- package/lib/types/product.mjs.map +1 -0
- package/lib/utils/array.d.ts +4 -0
- package/lib/utils/array.js +10 -0
- package/lib/utils/array.js.map +1 -1
- package/lib/utils/array.mjs +10 -1
- package/lib/utils/array.mjs.map +1 -1
- package/lib/utils/money/allocators/fixedAmount.d.ts +26 -0
- package/lib/utils/money/allocators/fixedAmount.js +52 -0
- package/lib/utils/money/allocators/fixedAmount.js.map +1 -0
- package/lib/utils/money/allocators/fixedAmount.mjs +50 -0
- package/lib/utils/money/allocators/fixedAmount.mjs.map +1 -0
- package/lib/utils/money/allocators/index.d.ts +2 -0
- package/lib/utils/money/allocators/index.js +8 -0
- package/lib/utils/money/allocators/index.js.map +1 -0
- package/lib/utils/money/allocators/index.mjs +4 -0
- package/lib/utils/money/allocators/index.mjs.map +1 -0
- package/lib/utils/money/allocators/productAmount.d.ts +13 -0
- package/lib/utils/money/allocators/productAmount.js +98 -0
- package/lib/utils/money/allocators/productAmount.js.map +1 -0
- package/lib/utils/money/allocators/productAmount.mjs +96 -0
- package/lib/utils/money/allocators/productAmount.mjs.map +1 -0
- package/lib/utils/money/constants.d.ts +56 -25
- package/lib/utils/money/constants.js +72 -7
- package/lib/utils/money/constants.js.map +1 -1
- package/lib/utils/money/constants.mjs +70 -7
- package/lib/utils/money/constants.mjs.map +1 -1
- package/lib/utils/money/exchangeRate.d.ts +31 -0
- package/lib/utils/money/exchangeRate.js +27 -0
- package/lib/utils/money/exchangeRate.js.map +1 -0
- package/lib/utils/money/exchangeRate.mjs +23 -0
- package/lib/utils/money/exchangeRate.mjs.map +1 -0
- package/lib/utils/money/format.d.ts +10 -5
- package/lib/utils/money/format.js +22 -14
- package/lib/utils/money/format.js.map +1 -1
- package/lib/utils/money/format.mjs +23 -16
- package/lib/utils/money/format.mjs.map +1 -1
- package/lib/utils/money/index.d.ts +4 -1
- package/lib/utils/money/index.js +26 -8
- package/lib/utils/money/index.js.map +1 -1
- package/lib/utils/money/index.mjs +8 -4
- package/lib/utils/money/index.mjs.map +1 -1
- package/lib/utils/money/misc.d.ts +68 -28
- package/lib/utils/money/misc.js +35 -64
- package/lib/utils/money/misc.js.map +1 -1
- package/lib/utils/money/misc.mjs +32 -43
- package/lib/utils/money/misc.mjs.map +1 -1
- package/lib/utils/money/misc.private.d.ts +23 -0
- package/lib/utils/money/misc.private.js +46 -0
- package/lib/utils/money/misc.private.js.map +1 -0
- package/lib/utils/money/misc.private.mjs +21 -0
- package/lib/utils/money/misc.private.mjs.map +1 -0
- package/lib/utils/money/shipping.d.ts +5 -0
- package/lib/utils/money/shipping.js +8 -0
- package/lib/utils/money/shipping.js.map +1 -0
- package/lib/utils/money/shipping.mjs +6 -0
- package/lib/utils/money/shipping.mjs.map +1 -0
- package/lib/utils/money/tax.d.ts +38 -2
- package/lib/utils/money/tax.js +46 -10
- package/lib/utils/money/tax.js.map +1 -1
- package/lib/utils/money/tax.mjs +42 -11
- package/lib/utils/money/tax.mjs.map +1 -1
- package/lib/utils/money/tax.private.d.ts +17 -0
- package/lib/utils/money/tax.private.js +65 -0
- package/lib/utils/money/tax.private.js.map +1 -0
- package/lib/utils/money/tax.private.mjs +60 -0
- package/lib/utils/money/tax.private.mjs.map +1 -0
- package/lib/utils/money/types.d.ts +78 -3
- package/lib/utils/number.d.ts +1 -1
- package/lib/utils/number.js +1 -1
- package/lib/utils/number.js.map +1 -1
- package/lib/utils/number.mjs +1 -1
- package/lib/utils/number.mjs.map +1 -1
- package/lib/utils/productSort.d.ts +41 -0
- package/lib/utils/productSort.js +67 -0
- package/lib/utils/productSort.js.map +1 -0
- package/lib/utils/productSort.mjs +60 -0
- package/lib/utils/productSort.mjs.map +1 -0
- package/package.json +1 -1
- 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/components/ResourceCalculatorV1/components/HorizontalOptionSelect/HorizontalOptionSelect.js.map +0 -1
- package/lib/components/ResourceCalculatorV1/components/HorizontalOptionSelect/HorizontalOptionSelect.mjs.map +0 -1
- package/lib/components/ResourceCalculatorV1/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.js.map +0 -1
- package/lib/components/ResourceCalculatorV1/components/HorizontalOptionSelect/HorizontalOptionSelect.styles.mjs.map +0 -1
- package/lib/components/ResourceCalculatorV1/components/index.d.ts +0 -1
- package/lib/components/ResourceCalculatorV1/components/index.js +0 -5
- package/lib/components/ResourceCalculatorV1/components/index.mjs +0 -3
- package/lib/utils/validations.d.ts +0 -15
- package/lib/utils/validations.js +0 -23
- package/lib/utils/validations.js.map +0 -1
- package/lib/utils/validations.mjs +0 -21
- package/lib/utils/validations.mjs.map +0 -1
- /package/lib/components/{ResourceCalculatorV1/components → Header/Navigation/ProMenu}/index.mjs.map +0 -0
- /package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/index.d.ts +0 -0
- /package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/index.js +0 -0
- /package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/index.js.map +0 -0
- /package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/index.mjs +0 -0
- /package/lib/components/{ResourceCalculatorV1/components/HorizontalOptionSelect → HorizontalOptionSelect}/index.mjs.map +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProMobileMenu.js","sources":["../../../../../src/components/Header/Navigation/ProMobileMenu/ProMobileMenu.tsx"],"sourcesContent":["/* eslint-disable @next/next/no-img-element */\nimport type { Motif } from \"@ubnt/ui-components/utils\";\nimport { useCallback, useMemo, useState } from \"react\";\n\n// import EAIcon from \"../../../../assets/icons/menu/icon-ea.svg\";\nimport GlobeIcon from \"../../../../assets/icons/menu/icon-globe.svg\";\nimport HistoryIcon from \"../../../../assets/icons/menu/icon-history.svg\";\nimport * as icons from \"../../../../constants/icons\";\nimport { useMenu } from \"../../../../contexts/MenuContext\";\nimport { useFooterContent } from \"../../../Footer/hooks/useFooterContent\";\nimport { StyleableSvgImage } from \"../../../StyleableSvgImage\";\nimport { getSupportLinkMapping } from \"../../LinksModal/mapping\";\nimport * as S from \"../MobileMenu/MobileMenu.styles\";\nimport * as S2 from \"./ProMobileMenu.styles\";\nimport type {\n NavigationProMobileMenuProps,\n ProMobileMenuSection,\n ProMobileMenuSectionItem,\n ProMobileMenuSectionSubItem,\n} from \"./ProMobileMenu.types\";\n\nexport const NavigationProMobileMenu = function NavigationProMobileMenu({\n translations,\n onClose,\n currentCountryName,\n handleStorePickerClick,\n // handleEarlyAccessClick,\n handleOrderHistoryClick,\n handlePurchaseHistoryClick,\n handleProductLineChange,\n productLineValue,\n productLineOptions,\n extraSectionItems,\n}: NavigationProMobileMenuProps) {\n const motif: Motif = \"light\";\n\n const { footerContent, socialContent } = useFooterContent();\n const { context } = useMenu();\n\n // #############################################################################\n // Section toggling\n // #############################################################################\n const [expandedSectionItemId, setExpandedSectionItemId] = useState<\n string | null\n >(null);\n\n const toggleExpandedSectionItemId = useCallback(\n (itemId: string) => {\n setExpandedSectionItemId(\n expandedSectionItemId === itemId ? null : itemId,\n );\n },\n [expandedSectionItemId],\n );\n\n // #############################################################################\n // Menu sections\n // #############################################################################\n const sections = useMemo((): ProMobileMenuSection[] => {\n const _sections: Array<ProMobileMenuSection | null> = [\n {\n id: \"store-link-stuff\",\n items: [\n ...(handleOrderHistoryClick\n ? [\n {\n id: \"order-history\",\n label: translations.orderHistory,\n icon: {\n src:\n typeof HistoryIcon === \"string\"\n ? HistoryIcon\n : HistoryIcon.src,\n width: 16,\n height: 16,\n },\n url: () => {\n handleOrderHistoryClick?.();\n },\n subItems: [],\n },\n ]\n : []),\n ...(handlePurchaseHistoryClick\n ? [\n {\n id: \"purchased-product-history\",\n label: translations.purchasedProductHistory,\n icon: {\n src:\n typeof HistoryIcon === \"string\"\n ? HistoryIcon\n : HistoryIcon.src,\n width: 16,\n height: 16,\n },\n url: () => {\n handlePurchaseHistoryClick?.();\n },\n subItems: [],\n },\n ]\n : []),\n /**\n * NOTE: Disabled per Kaspars request (09.06.)\n * @see https://ui.slack.com/archives/C050CTJSE80/p1686331781297389\n */\n // {\n // id: \"early-access\",\n // label: translations.earlyAccess,\n // icon: {\n // src: typeof EAIcon === \"string\" ? EAIcon : EAIcon.src,\n // width: 20,\n // height: 16,\n // },\n // url: () => {\n // handleEarlyAccessClick?.();\n // },\n // subItems: [],\n // },\n ],\n },\n {\n id: \"extra\",\n items: extraSectionItems ?? [\n {\n id: \"support\",\n label: translations.support,\n url: null,\n subItems: getSupportLinkMapping(context).map((item) => ({\n id: item.id,\n label: item.name,\n url: item.url,\n })),\n },\n {\n id: \"social\",\n label: translations.social,\n url: null,\n subItems: socialContent.items.map((item) => ({\n id: item.id,\n label: item.label,\n url: item.src,\n })),\n },\n ...(\n [\n { key: \"company\", label: translations.company },\n { key: \"training\", label: translations.training },\n { key: \"tools\", label: translations.tools },\n ] as const\n ).map(({ key, label }) => ({\n id: key,\n label,\n url: null,\n subItems: footerContent[key].items.map((item) => ({\n id: item.id,\n label: item.label,\n url: item.src,\n })),\n })),\n ],\n },\n currentCountryName\n ? {\n id: \"country-selector\",\n items: [\n {\n id: \"current-country-name\",\n label: currentCountryName,\n icon: {\n src:\n typeof GlobeIcon === \"string\" ? GlobeIcon : GlobeIcon.src,\n width: 17,\n height: 17,\n },\n url: () => {\n handleStorePickerClick?.();\n },\n subItems: [],\n },\n ],\n }\n : null,\n ];\n\n return _sections.filter((el): el is ProMobileMenuSection => !!el);\n }, [\n context,\n currentCountryName,\n extraSectionItems,\n footerContent,\n handleOrderHistoryClick,\n handlePurchaseHistoryClick,\n handleStorePickerClick,\n socialContent.items,\n translations.company,\n translations.orderHistory,\n translations.purchasedProductHistory,\n translations.social,\n translations.support,\n translations.tools,\n translations.training,\n ]);\n\n // #############################################################################\n // Render helpers\n // #############################################################################\n const renderSectionItemIcon = useCallback(\n (item: ProMobileMenuSection[\"items\"][number]): React.ReactNode => {\n return (\n item.icon && (\n <S2.SectionItemIcon>\n <StyleableSvgImage\n src={item.icon.src}\n width={item.icon.width}\n height={item.icon.height}\n />\n </S2.SectionItemIcon>\n )\n );\n },\n [],\n );\n\n const renderSectionItemButton = useCallback(\n (\n item: ProMobileMenuSectionItem | ProMobileMenuSectionSubItem,\n ): React.ReactNode => {\n const IconNode = \"subItems\" in item && renderSectionItemIcon(item);\n const NewLabelNode =\n \"isNew\" in item && item.isNew ? (\n <S.NewLabel>{translations.new}</S.NewLabel>\n ) : null;\n const target =\n \"targetBlank\" in item && item.targetBlank ? \"_blank\" : undefined;\n const url = item.url;\n\n if (!url) {\n return (\n <S.SectionItemButton\n motif={motif}\n onClick={() => toggleExpandedSectionItemId(item.id)}\n >\n {IconNode}\n {item.label}\n </S.SectionItemButton>\n );\n }\n\n if (typeof url === \"string\") {\n return (\n <S.SectionItemButton\n motif={motif}\n as=\"a\"\n href={url}\n onClick={onClose}\n target={target}\n >\n {IconNode}\n {item.label}\n {NewLabelNode}\n </S.SectionItemButton>\n );\n }\n\n return (\n <S.SectionItemButton\n motif={motif}\n onClick={() => {\n url();\n onClose();\n }}\n >\n {IconNode}\n {item.label}\n </S.SectionItemButton>\n );\n },\n [\n onClose,\n renderSectionItemIcon,\n toggleExpandedSectionItemId,\n translations.new,\n ],\n );\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <S.Wrap motif={motif}>\n <S.Container size=\"mobile\" noVerticalMargin>\n <S.InnerWrap>\n {/* Product line */}\n {!!productLineOptions?.length && (\n <S2.ButtonGroup>\n {productLineOptions.map((option) => (\n <S2.CustomButton\n full\n key={option.value}\n variant=\"gray\"\n $active={option.value === productLineValue}\n onClick={() => {\n handleProductLineChange?.(option.value);\n onClose();\n }}\n >\n {option.label}\n </S2.CustomButton>\n ))}\n </S2.ButtonGroup>\n )}\n\n {/* Sections */}\n {sections.map((section) => (\n <S.Section motif={motif} key={section.id}>\n {section.items.map((item) => (\n <S.SectionItemsGroup\n motif={motif}\n key={item.id}\n $active={item.id === expandedSectionItemId}\n >\n <S.SectionItem motif={motif}>\n {renderSectionItemButton(item)}\n\n {item.subItems.length > 0 && (\n <S.SectionItemArrowButton\n motif={motif}\n onClick={() => toggleExpandedSectionItemId(item.id)}\n >\n <S.ButtonIcon>\n <StyleableSvgImage\n src={icons.generic.collapseArrow}\n width={13}\n height={8}\n />\n </S.ButtonIcon>\n </S.SectionItemArrowButton>\n )}\n </S.SectionItem>\n\n {item.id === expandedSectionItemId &&\n item.subItems.length > 0 &&\n item.subItems.map((subItem) => (\n <S.SectionItem key={subItem.id} motif={motif} $secondary>\n {renderSectionItemButton(subItem)}\n </S.SectionItem>\n ))}\n </S.SectionItemsGroup>\n ))}\n </S.Section>\n ))}\n </S.InnerWrap>\n </S.Container>\n </S.Wrap>\n );\n};\n"],"names":["NavigationProMobileMenu","NavigationProMobileMenu2","translations","onClose","currentCountryName","handleStorePickerClick","handleOrderHistoryClick","handlePurchaseHistoryClick","handleProductLineChange","productLineValue","productLineOptions","extraSectionItems","motif","footerContent","socialContent","useFooterContent","context","useMenu","expandedSectionItemId","setExpandedSectionItemId","useState","toggleExpandedSectionItemId","useCallback","itemId","sections","useMemo","_sections","id","items","label","orderHistory","icon","src","HistoryIcon","width","height","url","subItems","purchasedProductHistory","support","getSupportLinkMapping","map","item","name","social","key","company","training","tools","GlobeIcon","filter","el","renderSectionItemIcon","jsx","S2.SectionItemIcon","children","StyleableSvgImage","renderSectionItemButton","IconNode","NewLabelNode","isNew","S.NewLabel","NewLabel","new","target","targetBlank","jsxs","S.SectionItemButton","SectionItemButton","onClick","as","href","S.Wrap","S.Container","size","noVerticalMargin","S.InnerWrap","length","S2.ButtonGroup","option","S2.CustomButton","CustomButton","full","variant","$active","value","section","S.Section","S.SectionItemsGroup","SectionItemsGroup","S.SectionItem","SectionItem","S.SectionItemArrowButton","SectionItemArrowButton","S.ButtonIcon","icons.generic.collapseArrow","subItem","$secondary"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAqBa,MAAAA,uBAAA,GAA0B,SAASA,wBAAwBC,CAAA;EACtEC,YAAA;EACAC,OAAA;EACAC,kBAAA;EACAC,sBAAA;EAAA;EAEAC,uBAAA;EACAC,0BAAA;EACAC,uBAAA;EACAC,gBAAA;EACAC,kBAAA;EACAC;AACF,CAAiC,EAAA;EAC/B,MAAMC,KAAe,GAAA,OAAA;EAErB,MAAM;IAAEC,aAAA;IAAeC;EAAc,CAAA,GAAIC,gBAAiB,CAAAA,gBAAA,CAAA,CAAA;EACpD,MAAA;IAAEC,OAAAA,EAAAA;GAAQ,GAAIC,OAAAA,CAAAA,OAAQ,EAAA;EAK5B,MAAM,CAACC,qBAAA,EAAuBC,wBAAwB,CAAA,GAAIC,eAExD,IAAI,CAAA;EAEN,MAAMC,2BAA8B,GAAAC,KAAA,CAAAA,WAAA,CACjCC,MAAmB,IAAA;IAClBJ,wBAAA,CACED,qBAAA,KAA0BK,SAAS,IAAO,GAAAA,MAAA,CAC5C;EACF,CAAA,EACA,CAACL,qBAAqB,CAAA,CACxB;EAKM,MAAAM,QAAA,GAAWC,KAAAA,CAAAA,QAAQ,MAA8B;IACrD,MAAMC,SAAgD,GAAA,CACpD;MACEC,EAAI,EAAA,kBAAA;MACJC,KAAO,EAAA,CACL,IAAItB,uBACA,GAAA,CACE;QACEqB,EAAI,EAAA,eAAA;QACJE,OAAO3B,YAAa,CAAA4B,YAAA;QACpBC,IAAM,EAAA;UACJC,GACE,EAAA,OAAOC,oBAAgB,CAAA,SAAA,CAAA,KAAA,QAAA,GACnBA,kCACAA,oBAAY,CAAA,SAAA,CAAA,CAAAD,GAAA;UAClBE,KAAO,EAAA,EAAA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D,iCAAc,CAAA,SAAA,CAAA;oBACnB7D,KAAO,EAAA,EAAA;oBACPC,MAAQ,EAAA;kBAAA,CAAA;iBAEZ;cAAA,CACF,CAAA;aAEJ,CAAA,EAECO,IAAA,CAAKf,EAAO,KAAAT,qBAAA,IACXwB,IAAK,CAAAL,QAAA,CAASwC,SAAS,CACvB,IAAAnC,IAAA,CAAKL,QAAS,CAAAI,GAAA,CAAKuD,OAAA,IAAA,8BAChBN,iBAAAA,CAAAA,WAAE,EAAF;cAA+B9E,KAAA;cAAcqF,UAAU,EAAA,IAAA;cACrD1C,kCAAwByC,OAAO;YAAA,CAAA,EADdA,OAAQ,CAAArE,EAE5B,CACD,CAAA;UAAA,CAAA,EA5BEe,IAAK,CAAAf,EAAA,CA8Bb;QAAA,CAAA,EAlC2B2D,OAAQ,CAAA3D,EAmCtC,CACD,CAAA;OACH;KACF;EACF,CAAA,CAAA;AAEJ,CAAA;"}
|
|
1
|
+
{"version":3,"file":"ProMobileMenu.js","sources":["../../../../../src/components/Header/Navigation/ProMobileMenu/ProMobileMenu.tsx"],"sourcesContent":["/* eslint-disable @next/next/no-img-element */\nimport type { Motif } from \"@ubnt/ui-components/utils\";\nimport { useCallback, useMemo, useState } from \"react\";\n\nimport HistoryIcon from \"../../../../assets/icons/menu/icon-history.svg\";\nimport LocationPinIcon from \"../../../../assets/icons/menu/icon-location-pin.svg\";\nimport * as icons from \"../../../../constants/icons\";\nimport { useMenu } from \"../../../../contexts/MenuContext\";\nimport { imageSrc } from \"../../../../utils/asset\";\nimport { isNonNullish } from \"../../../../utils/typeGuards\";\nimport { useFooterContent } from \"../../../Footer/hooks/useFooterContent\";\nimport { StyleableSvgImage } from \"../../../StyleableSvgImage\";\nimport { getSupportLinkMapping } from \"../../LinksModal/mapping\";\nimport * as S from \"../MobileMenu/MobileMenu.styles\";\nimport * as S2 from \"./ProMobileMenu.styles\";\nimport type {\n NavigationProMobileMenuProps,\n ProMobileMenuSection,\n ProMobileMenuSectionItem,\n ProMobileMenuSectionSubItem,\n} from \"./ProMobileMenu.types\";\n\nconst motif: Motif = \"light\";\n\nexport const NavigationProMobileMenu = function NavigationProMobileMenu({\n translations,\n onClose,\n currentCountryName,\n handleStorePickerClick,\n // handleEarlyAccessClick,\n handleOrderHistoryClick,\n handlePurchaseHistoryClick,\n handleProductLineChange,\n productLineValue,\n productLineOptions,\n categories,\n hideExtraSection,\n}: NavigationProMobileMenuProps) {\n const { footerContent, socialContent } = useFooterContent();\n const { context } = useMenu();\n\n // #############################################################################\n // Section toggling\n // #############################################################################\n const [expandedSectionItemId, setExpandedSectionItemId] = useState<\n string | null\n >(null);\n\n const toggleExpandedSectionItemId = useCallback(\n (itemId: string) => {\n setExpandedSectionItemId(\n expandedSectionItemId === itemId ? null : itemId,\n );\n },\n [expandedSectionItemId],\n );\n\n // #############################################################################\n // Menu sections\n // #############################################################################\n const sections = useMemo((): ProMobileMenuSection[] => {\n const extraSectionItems: ProMobileMenuSectionItem[] = [\n {\n id: \"support\",\n label: translations.support,\n url: null,\n subItems: getSupportLinkMapping(context).map((item) => ({\n id: item.id,\n label: item.name,\n url: item.url,\n })),\n },\n {\n id: \"social\",\n label: translations.social,\n url: null,\n subItems: socialContent.items.map((item) => ({\n id: item.id,\n label: item.label,\n url: item.src,\n })),\n },\n ...(\n [\n { key: \"company\", label: translations.company },\n { key: \"training\", label: translations.training },\n { key: \"tools\", label: translations.tools },\n ] as const\n ).map(({ key, label }) => ({\n id: key,\n label,\n url: null,\n subItems: footerContent[key].items.map((item) => ({\n id: item.id,\n label: item.label,\n url: item.src,\n })),\n })),\n ];\n\n return [\n {\n id: \"store-link-stuff\",\n items: [\n handleOrderHistoryClick\n ? ({\n id: \"order-history\",\n label: translations.orderHistory,\n icon: {\n src: imageSrc(HistoryIcon),\n width: 16,\n height: 16,\n },\n url: null,\n onClick: () => {\n handleOrderHistoryClick?.();\n },\n subItems: [],\n } satisfies ProMobileMenuSectionItem)\n : null,\n handlePurchaseHistoryClick\n ? ({\n id: \"purchased-product-history\",\n label: translations.purchasedProductHistory,\n icon: {\n src: imageSrc(HistoryIcon),\n width: 16,\n height: 16,\n },\n url: null,\n onClick: () => {\n handlePurchaseHistoryClick?.();\n },\n subItems: [],\n } satisfies ProMobileMenuSectionItem)\n : null,\n ].filter(isNonNullish),\n },\n\n {\n id: \"categories\",\n items: categories.items,\n },\n\n currentCountryName\n ? {\n id: \"country-selector\",\n items: [\n {\n id: \"current-country-name\",\n label: translations.region,\n value: currentCountryName,\n icon: {\n src: imageSrc(LocationPinIcon),\n width: 17,\n height: 17,\n },\n url: null,\n onClick: () => {\n handleStorePickerClick?.();\n },\n subItems: [],\n },\n ],\n }\n : null,\n\n ...(!hideExtraSection\n ? extraSectionItems.map((item) => ({\n id: `extra-${item.id}`,\n items: [item],\n }))\n : []),\n ].filter(isNonNullish);\n }, [\n translations.support,\n translations.social,\n translations.company,\n translations.training,\n translations.tools,\n translations.orderHistory,\n translations.purchasedProductHistory,\n translations.region,\n context,\n socialContent.items,\n handleOrderHistoryClick,\n handlePurchaseHistoryClick,\n categories.items,\n currentCountryName,\n handleStorePickerClick,\n hideExtraSection,\n footerContent,\n ]);\n\n // #############################################################################\n // Render helpers\n // #############################################################################\n const renderSectionItemIcon = useCallback(\n (item: ProMobileMenuSection[\"items\"][number]): React.ReactNode => {\n return (\n item.icon && (\n <S2.SectionItemIcon>\n <StyleableSvgImage\n src={item.icon.src}\n width={item.icon.width}\n height={item.icon.height}\n />\n </S2.SectionItemIcon>\n )\n );\n },\n [],\n );\n\n const renderSectionItemButton = useCallback(\n (\n item: ProMobileMenuSectionItem | ProMobileMenuSectionSubItem,\n ): React.ReactNode => {\n const IconNode = \"subItems\" in item && renderSectionItemIcon(item);\n const NewLabelNode =\n \"isNew\" in item && item.isNew ? (\n <S.NewLabel>{translations.new}</S.NewLabel>\n ) : null;\n const ValueNode = !!item.value && <div>{item.value}</div>;\n\n const target =\n \"targetBlank\" in item && item.targetBlank ? \"_blank\" : undefined;\n const url = item.url;\n\n if (!url) {\n return (\n <S2.ProSectionItemButton\n motif={motif}\n onClick={(e) => {\n item.onClick?.(e, url);\n toggleExpandedSectionItemId(item.id);\n }}\n >\n <S2.ButtonContent>\n {IconNode}\n {item.label}\n {NewLabelNode}\n </S2.ButtonContent>\n {ValueNode}\n </S2.ProSectionItemButton>\n );\n }\n\n return (\n <S.SectionItemButton\n motif={motif}\n onClick={(e) => {\n item.onClick?.(e, url);\n onClose();\n }}\n {...(typeof url === \"string\"\n ? {\n as: \"a\",\n href: url,\n target,\n }\n : {})}\n >\n <S2.ButtonContent>\n {IconNode}\n {item.label}\n {NewLabelNode}\n </S2.ButtonContent>\n {ValueNode}\n </S.SectionItemButton>\n );\n },\n [\n onClose,\n renderSectionItemIcon,\n toggleExpandedSectionItemId,\n translations.new,\n ],\n );\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <S2.Wrap motif={motif}>\n <S.Container size=\"mobile\" noVerticalMargin>\n <S.InnerWrap>\n {/* Product line */}\n {!!productLineOptions?.length && (\n <S2.ButtonGroup>\n {productLineOptions.map((option) => (\n <S2.CustomButton\n full\n key={option.value}\n variant=\"gray\"\n $active={option.value === productLineValue}\n onClick={() => {\n handleProductLineChange?.(option.value);\n onClose();\n }}\n >\n {option.label}\n </S2.CustomButton>\n ))}\n </S2.ButtonGroup>\n )}\n\n {/* Sections */}\n {sections.map((section) => (\n <S.Section motif={motif} key={section.id}>\n {section.items.map((item) => (\n <S.SectionItemsGroup\n motif={motif}\n key={item.id}\n $active={item.id === expandedSectionItemId}\n >\n <S.SectionItem motif={motif}>\n {renderSectionItemButton(item)}\n\n {item.subItems.length > 0 && (\n <S.SectionItemArrowButton\n motif={motif}\n onClick={() => toggleExpandedSectionItemId(item.id)}\n >\n <S.ButtonIcon>\n <StyleableSvgImage\n src={icons.generic.collapseArrow}\n width={13}\n height={8}\n />\n </S.ButtonIcon>\n </S.SectionItemArrowButton>\n )}\n </S.SectionItem>\n\n {item.id === expandedSectionItemId &&\n item.subItems.length > 0 &&\n item.subItems.map((subItem) => (\n <S.SectionItem key={subItem.id} motif={motif} $secondary>\n {renderSectionItemButton(subItem)}\n </S.SectionItem>\n ))}\n </S.SectionItemsGroup>\n ))}\n </S.Section>\n ))}\n </S.InnerWrap>\n </S.Container>\n </S2.Wrap>\n );\n};\n"],"names":["motif","NavigationProMobileMenu","NavigationProMobileMenu2","translations","onClose","currentCountryName","handleStorePickerClick","handleOrderHistoryClick","handlePurchaseHistoryClick","handleProductLineChange","productLineValue","productLineOptions","categories","hideExtraSection","footerContent","socialContent","useFooterContent","context","useMenu","expandedSectionItemId","setExpandedSectionItemId","useState","toggleExpandedSectionItemId","useCallback","itemId","sections","useMemo","extraSectionItems","id","label","support","url","subItems","getSupportLinkMapping","map","item","name","social","items","src","key","company","training","tools","orderHistory","icon","imageSrc","HistoryIcon","width","height","onClick","purchasedProductHistory","filter","isNonNullish","region","value","LocationPinIcon","renderSectionItemIcon","jsx","S2.SectionItemIcon","children","StyleableSvgImage","renderSectionItemButton","IconNode","NewLabelNode","isNew","S.NewLabel","NewLabel","new","ValueNode","target","targetBlank","jsxs","S2.ProSectionItemButton","ProSectionItemButton","e","S2.ButtonContent","S.SectionItemButton","SectionItemButton","as","href","S2.Wrap","S.Container","size","noVerticalMargin","S.InnerWrap","length","S2.ButtonGroup","option","S2.CustomButton","CustomButton","full","variant","$active","section","S.Section","S.SectionItemsGroup","SectionItemsGroup","S.SectionItem","SectionItem","S.SectionItemArrowButton","SectionItemArrowButton","S.ButtonIcon","icons.generic.collapseArrow","subItem","$secondary"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAsBA,MAAMA,KAAe,GAAA,OAAA;AAER,MAAAC,uBAAA,GAA0B,SAASA,wBAAwBC,CAAA;EACtEC,YAAA;EACAC,OAAA;EACAC,kBAAA;EACAC,sBAAA;EAAA;EAEAC,uBAAA;EACAC,0BAAA;EACAC,uBAAA;EACAC,gBAAA;EACAC,kBAAA;EACAC,UAAA;EACAC;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,EAECd,IAAA,CAAKP,EAAO,KAAAT,qBAAA,IACXgB,IAAK,CAAAH,QAAA,CAASsD,SAAS,CACvB,IAAAnD,IAAA,CAAKH,QAAS,CAAAE,GAAA,CAAKsE,OAAA,IAAA,8BAChBN,iBAAAA,CAAAA,WAAE,EAAF;cAA+BlG,KAAA;cAAcyG,UAAU,EAAA,IAAA;cACrD7C,kCAAwB4C,OAAO;YAAA,CAAA,EADdA,OAAQ,CAAA5E,EAE5B,CACD,CAAA;UAAA,CAAA,EA5BEO,IAAK,CAAAP,EAAA,CA8Bb;QAAA,CAAA,EAlC2BkE,OAAQ,CAAAlE,EAmCtC,CACD,CAAA;OACH;KACF;EACF,CAAA,CAAA;AAEJ,CAAA;"}
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { useState, useCallback, useMemo } from 'react';
|
|
3
|
-
import '../../../../assets/icons/menu/icon-globe.svg.mjs';
|
|
4
3
|
import '../../../../assets/icons/menu/icon-history.svg.mjs';
|
|
4
|
+
import '../../../../assets/icons/menu/icon-location-pin.svg.mjs';
|
|
5
5
|
import '../../../../constants/icons/index.mjs';
|
|
6
6
|
import '../../../../contexts/MenuContext/index.mjs';
|
|
7
|
+
import { imageSrc } from '../../../../utils/asset.mjs';
|
|
8
|
+
import { isNonNullish } from '../../../../utils/typeGuards.mjs';
|
|
7
9
|
import { useFooterContent } from '../../../Footer/hooks/useFooterContent.mjs';
|
|
8
10
|
import '../../../StyleableSvgImage/index.mjs';
|
|
9
11
|
import { getSupportLinkMapping } from '../../LinksModal/mapping.mjs';
|
|
10
|
-
import { NewLabel, SectionItemButton,
|
|
11
|
-
import { SectionItemIcon, ButtonGroup, CustomButton } from './ProMobileMenu.styles.mjs';
|
|
12
|
+
import { NewLabel, SectionItemButton, Container, InnerWrap, Section, SectionItemsGroup, SectionItem, SectionItemArrowButton, ButtonIcon } from '../MobileMenu/MobileMenu.styles.mjs';
|
|
13
|
+
import { SectionItemIcon, ProSectionItemButton, ButtonContent, Wrap, ButtonGroup, CustomButton } from './ProMobileMenu.styles.mjs';
|
|
12
14
|
import { useMenu } from '../../../../contexts/MenuContext/context.mjs';
|
|
13
15
|
import HistoryIcon__default from "../../../../assets/icon-history.svg";
|
|
14
|
-
import
|
|
16
|
+
import LocationPinIcon__default from "../../../../assets/icon-location-pin.svg";
|
|
15
17
|
import { StyleableSvgImage } from '../../../StyleableSvgImage/StyleableSvgImage.mjs';
|
|
16
18
|
import _externalAssets_BAXELvSy__default from "../../../../assets/collapseArrow.svg";
|
|
17
19
|
"use strict";
|
|
20
|
+
const motif = "light";
|
|
18
21
|
const NavigationProMobileMenu = function NavigationProMobileMenu2({
|
|
19
22
|
translations,
|
|
20
23
|
onClose,
|
|
@@ -26,9 +29,9 @@ const NavigationProMobileMenu = function NavigationProMobileMenu2({
|
|
|
26
29
|
handleProductLineChange,
|
|
27
30
|
productLineValue,
|
|
28
31
|
productLineOptions,
|
|
29
|
-
|
|
32
|
+
categories,
|
|
33
|
+
hideExtraSection
|
|
30
34
|
}) {
|
|
31
|
-
const motif = "light";
|
|
32
35
|
const {
|
|
33
36
|
footerContent,
|
|
34
37
|
socialContent
|
|
@@ -41,111 +44,100 @@ const NavigationProMobileMenu = function NavigationProMobileMenu2({
|
|
|
41
44
|
setExpandedSectionItemId(expandedSectionItemId === itemId ? null : itemId);
|
|
42
45
|
}, [expandedSectionItemId]);
|
|
43
46
|
const sections = useMemo(() => {
|
|
44
|
-
const
|
|
47
|
+
const extraSectionItems = [{
|
|
48
|
+
id: "support",
|
|
49
|
+
label: translations.support,
|
|
50
|
+
url: null,
|
|
51
|
+
subItems: getSupportLinkMapping(context).map(item => ({
|
|
52
|
+
id: item.id,
|
|
53
|
+
label: item.name,
|
|
54
|
+
url: item.url
|
|
55
|
+
}))
|
|
56
|
+
}, {
|
|
57
|
+
id: "social",
|
|
58
|
+
label: translations.social,
|
|
59
|
+
url: null,
|
|
60
|
+
subItems: socialContent.items.map(item => ({
|
|
61
|
+
id: item.id,
|
|
62
|
+
label: item.label,
|
|
63
|
+
url: item.src
|
|
64
|
+
}))
|
|
65
|
+
}, ...[{
|
|
66
|
+
key: "company",
|
|
67
|
+
label: translations.company
|
|
68
|
+
}, {
|
|
69
|
+
key: "training",
|
|
70
|
+
label: translations.training
|
|
71
|
+
}, {
|
|
72
|
+
key: "tools",
|
|
73
|
+
label: translations.tools
|
|
74
|
+
}].map(({
|
|
75
|
+
key,
|
|
76
|
+
label
|
|
77
|
+
}) => ({
|
|
78
|
+
id: key,
|
|
79
|
+
label,
|
|
80
|
+
url: null,
|
|
81
|
+
subItems: footerContent[key].items.map(item => ({
|
|
82
|
+
id: item.id,
|
|
83
|
+
label: item.label,
|
|
84
|
+
url: item.src
|
|
85
|
+
}))
|
|
86
|
+
}))];
|
|
87
|
+
return [{
|
|
45
88
|
id: "store-link-stuff",
|
|
46
|
-
items: [
|
|
89
|
+
items: [handleOrderHistoryClick ? {
|
|
47
90
|
id: "order-history",
|
|
48
91
|
label: translations.orderHistory,
|
|
49
92
|
icon: {
|
|
50
|
-
src:
|
|
93
|
+
src: imageSrc(HistoryIcon__default),
|
|
51
94
|
width: 16,
|
|
52
95
|
height: 16
|
|
53
96
|
},
|
|
54
|
-
url:
|
|
97
|
+
url: null,
|
|
98
|
+
onClick: () => {
|
|
55
99
|
handleOrderHistoryClick?.();
|
|
56
100
|
},
|
|
57
101
|
subItems: []
|
|
58
|
-
}
|
|
102
|
+
} : null, handlePurchaseHistoryClick ? {
|
|
59
103
|
id: "purchased-product-history",
|
|
60
104
|
label: translations.purchasedProductHistory,
|
|
61
105
|
icon: {
|
|
62
|
-
src:
|
|
106
|
+
src: imageSrc(HistoryIcon__default),
|
|
63
107
|
width: 16,
|
|
64
108
|
height: 16
|
|
65
109
|
},
|
|
66
|
-
url:
|
|
110
|
+
url: null,
|
|
111
|
+
onClick: () => {
|
|
67
112
|
handlePurchaseHistoryClick?.();
|
|
68
113
|
},
|
|
69
114
|
subItems: []
|
|
70
|
-
}
|
|
71
|
-
/**
|
|
72
|
-
* NOTE: Disabled per Kaspars request (09.06.)
|
|
73
|
-
* @see https://ui.slack.com/archives/C050CTJSE80/p1686331781297389
|
|
74
|
-
*/
|
|
75
|
-
// {
|
|
76
|
-
// id: "early-access",
|
|
77
|
-
// label: translations.earlyAccess,
|
|
78
|
-
// icon: {
|
|
79
|
-
// src: typeof EAIcon === "string" ? EAIcon : EAIcon.src,
|
|
80
|
-
// width: 20,
|
|
81
|
-
// height: 16,
|
|
82
|
-
// },
|
|
83
|
-
// url: () => {
|
|
84
|
-
// handleEarlyAccessClick?.();
|
|
85
|
-
// },
|
|
86
|
-
// subItems: [],
|
|
87
|
-
// },
|
|
88
|
-
]
|
|
115
|
+
} : null].filter(isNonNullish)
|
|
89
116
|
}, {
|
|
90
|
-
id: "
|
|
91
|
-
items:
|
|
92
|
-
id: "support",
|
|
93
|
-
label: translations.support,
|
|
94
|
-
url: null,
|
|
95
|
-
subItems: getSupportLinkMapping(context).map(item => ({
|
|
96
|
-
id: item.id,
|
|
97
|
-
label: item.name,
|
|
98
|
-
url: item.url
|
|
99
|
-
}))
|
|
100
|
-
}, {
|
|
101
|
-
id: "social",
|
|
102
|
-
label: translations.social,
|
|
103
|
-
url: null,
|
|
104
|
-
subItems: socialContent.items.map(item => ({
|
|
105
|
-
id: item.id,
|
|
106
|
-
label: item.label,
|
|
107
|
-
url: item.src
|
|
108
|
-
}))
|
|
109
|
-
}, ...[{
|
|
110
|
-
key: "company",
|
|
111
|
-
label: translations.company
|
|
112
|
-
}, {
|
|
113
|
-
key: "training",
|
|
114
|
-
label: translations.training
|
|
115
|
-
}, {
|
|
116
|
-
key: "tools",
|
|
117
|
-
label: translations.tools
|
|
118
|
-
}].map(({
|
|
119
|
-
key,
|
|
120
|
-
label
|
|
121
|
-
}) => ({
|
|
122
|
-
id: key,
|
|
123
|
-
label,
|
|
124
|
-
url: null,
|
|
125
|
-
subItems: footerContent[key].items.map(item => ({
|
|
126
|
-
id: item.id,
|
|
127
|
-
label: item.label,
|
|
128
|
-
url: item.src
|
|
129
|
-
}))
|
|
130
|
-
}))]
|
|
117
|
+
id: "categories",
|
|
118
|
+
items: categories.items
|
|
131
119
|
}, currentCountryName ? {
|
|
132
120
|
id: "country-selector",
|
|
133
121
|
items: [{
|
|
134
122
|
id: "current-country-name",
|
|
135
|
-
label:
|
|
123
|
+
label: translations.region,
|
|
124
|
+
value: currentCountryName,
|
|
136
125
|
icon: {
|
|
137
|
-
src:
|
|
126
|
+
src: imageSrc(LocationPinIcon__default),
|
|
138
127
|
width: 17,
|
|
139
128
|
height: 17
|
|
140
129
|
},
|
|
141
|
-
url:
|
|
130
|
+
url: null,
|
|
131
|
+
onClick: () => {
|
|
142
132
|
handleStorePickerClick?.();
|
|
143
133
|
},
|
|
144
134
|
subItems: []
|
|
145
135
|
}]
|
|
146
|
-
} : null
|
|
147
|
-
|
|
148
|
-
|
|
136
|
+
} : null, ...(!hideExtraSection ? extraSectionItems.map(item => ({
|
|
137
|
+
id: `extra-${item.id}`,
|
|
138
|
+
items: [item]
|
|
139
|
+
})) : [])].filter(isNonNullish);
|
|
140
|
+
}, [translations.support, translations.social, translations.company, translations.training, translations.tools, translations.orderHistory, translations.purchasedProductHistory, translations.region, context, socialContent.items, handleOrderHistoryClick, handlePurchaseHistoryClick, categories.items, currentCountryName, handleStorePickerClick, hideExtraSection, footerContent]);
|
|
149
141
|
const renderSectionItemIcon = useCallback(item => {
|
|
150
142
|
return item.icon && /* @__PURE__ */jsx(SectionItemIcon, {
|
|
151
143
|
children: /* @__PURE__ */jsx(StyleableSvgImage, {
|
|
@@ -160,32 +152,37 @@ const NavigationProMobileMenu = function NavigationProMobileMenu2({
|
|
|
160
152
|
const NewLabelNode = "isNew" in item && item.isNew ? /* @__PURE__ */jsx(NewLabel, {
|
|
161
153
|
children: translations.new
|
|
162
154
|
}) : null;
|
|
155
|
+
const ValueNode = !!item.value && /* @__PURE__ */jsx("div", {
|
|
156
|
+
children: item.value
|
|
157
|
+
});
|
|
163
158
|
const target = "targetBlank" in item && item.targetBlank ? "_blank" : void 0;
|
|
164
159
|
const url = item.url;
|
|
165
160
|
if (!url) {
|
|
166
|
-
return /* @__PURE__ */jsxs(
|
|
161
|
+
return /* @__PURE__ */jsxs(ProSectionItemButton, {
|
|
167
162
|
motif,
|
|
168
|
-
onClick:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
as: "a",
|
|
176
|
-
href: url,
|
|
177
|
-
onClick: onClose,
|
|
178
|
-
target,
|
|
179
|
-
children: [IconNode, item.label, NewLabelNode]
|
|
163
|
+
onClick: e => {
|
|
164
|
+
item.onClick?.(e, url);
|
|
165
|
+
toggleExpandedSectionItemId(item.id);
|
|
166
|
+
},
|
|
167
|
+
children: [/* @__PURE__ */jsxs(ButtonContent, {
|
|
168
|
+
children: [IconNode, item.label, NewLabelNode]
|
|
169
|
+
}), ValueNode]
|
|
180
170
|
});
|
|
181
171
|
}
|
|
182
172
|
return /* @__PURE__ */jsxs(SectionItemButton, {
|
|
183
173
|
motif,
|
|
184
|
-
onClick:
|
|
185
|
-
url
|
|
174
|
+
onClick: e => {
|
|
175
|
+
item.onClick?.(e, url);
|
|
186
176
|
onClose();
|
|
187
177
|
},
|
|
188
|
-
|
|
178
|
+
...(typeof url === "string" ? {
|
|
179
|
+
as: "a",
|
|
180
|
+
href: url,
|
|
181
|
+
target
|
|
182
|
+
} : {}),
|
|
183
|
+
children: [/* @__PURE__ */jsxs(ButtonContent, {
|
|
184
|
+
children: [IconNode, item.label, NewLabelNode]
|
|
185
|
+
}), ValueNode]
|
|
189
186
|
});
|
|
190
187
|
}, [onClose, renderSectionItemIcon, toggleExpandedSectionItemId, translations.new]);
|
|
191
188
|
return /* @__PURE__ */jsx(Wrap, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProMobileMenu.mjs","sources":["../../../../../src/components/Header/Navigation/ProMobileMenu/ProMobileMenu.tsx"],"sourcesContent":["/* eslint-disable @next/next/no-img-element */\nimport type { Motif } from \"@ubnt/ui-components/utils\";\nimport { useCallback, useMemo, useState } from \"react\";\n\n// import EAIcon from \"../../../../assets/icons/menu/icon-ea.svg\";\nimport GlobeIcon from \"../../../../assets/icons/menu/icon-globe.svg\";\nimport HistoryIcon from \"../../../../assets/icons/menu/icon-history.svg\";\nimport * as icons from \"../../../../constants/icons\";\nimport { useMenu } from \"../../../../contexts/MenuContext\";\nimport { useFooterContent } from \"../../../Footer/hooks/useFooterContent\";\nimport { StyleableSvgImage } from \"../../../StyleableSvgImage\";\nimport { getSupportLinkMapping } from \"../../LinksModal/mapping\";\nimport * as S from \"../MobileMenu/MobileMenu.styles\";\nimport * as S2 from \"./ProMobileMenu.styles\";\nimport type {\n NavigationProMobileMenuProps,\n ProMobileMenuSection,\n ProMobileMenuSectionItem,\n ProMobileMenuSectionSubItem,\n} from \"./ProMobileMenu.types\";\n\nexport const NavigationProMobileMenu = function NavigationProMobileMenu({\n translations,\n onClose,\n currentCountryName,\n handleStorePickerClick,\n // handleEarlyAccessClick,\n handleOrderHistoryClick,\n handlePurchaseHistoryClick,\n handleProductLineChange,\n productLineValue,\n productLineOptions,\n extraSectionItems,\n}: NavigationProMobileMenuProps) {\n const motif: Motif = \"light\";\n\n const { footerContent, socialContent } = useFooterContent();\n const { context } = useMenu();\n\n // #############################################################################\n // Section toggling\n // #############################################################################\n const [expandedSectionItemId, setExpandedSectionItemId] = useState<\n string | null\n >(null);\n\n const toggleExpandedSectionItemId = useCallback(\n (itemId: string) => {\n setExpandedSectionItemId(\n expandedSectionItemId === itemId ? null : itemId,\n );\n },\n [expandedSectionItemId],\n );\n\n // #############################################################################\n // Menu sections\n // #############################################################################\n const sections = useMemo((): ProMobileMenuSection[] => {\n const _sections: Array<ProMobileMenuSection | null> = [\n {\n id: \"store-link-stuff\",\n items: [\n ...(handleOrderHistoryClick\n ? [\n {\n id: \"order-history\",\n label: translations.orderHistory,\n icon: {\n src:\n typeof HistoryIcon === \"string\"\n ? HistoryIcon\n : HistoryIcon.src,\n width: 16,\n height: 16,\n },\n url: () => {\n handleOrderHistoryClick?.();\n },\n subItems: [],\n },\n ]\n : []),\n ...(handlePurchaseHistoryClick\n ? [\n {\n id: \"purchased-product-history\",\n label: translations.purchasedProductHistory,\n icon: {\n src:\n typeof HistoryIcon === \"string\"\n ? HistoryIcon\n : HistoryIcon.src,\n width: 16,\n height: 16,\n },\n url: () => {\n handlePurchaseHistoryClick?.();\n },\n subItems: [],\n },\n ]\n : []),\n /**\n * NOTE: Disabled per Kaspars request (09.06.)\n * @see https://ui.slack.com/archives/C050CTJSE80/p1686331781297389\n */\n // {\n // id: \"early-access\",\n // label: translations.earlyAccess,\n // icon: {\n // src: typeof EAIcon === \"string\" ? EAIcon : EAIcon.src,\n // width: 20,\n // height: 16,\n // },\n // url: () => {\n // handleEarlyAccessClick?.();\n // },\n // subItems: [],\n // },\n ],\n },\n {\n id: \"extra\",\n items: extraSectionItems ?? [\n {\n id: \"support\",\n label: translations.support,\n url: null,\n subItems: getSupportLinkMapping(context).map((item) => ({\n id: item.id,\n label: item.name,\n url: item.url,\n })),\n },\n {\n id: \"social\",\n label: translations.social,\n url: null,\n subItems: socialContent.items.map((item) => ({\n id: item.id,\n label: item.label,\n url: item.src,\n })),\n },\n ...(\n [\n { key: \"company\", label: translations.company },\n { key: \"training\", label: translations.training },\n { key: \"tools\", label: translations.tools },\n ] as const\n ).map(({ key, label }) => ({\n id: key,\n label,\n url: null,\n subItems: footerContent[key].items.map((item) => ({\n id: item.id,\n label: item.label,\n url: item.src,\n })),\n })),\n ],\n },\n currentCountryName\n ? {\n id: \"country-selector\",\n items: [\n {\n id: \"current-country-name\",\n label: currentCountryName,\n icon: {\n src:\n typeof GlobeIcon === \"string\" ? GlobeIcon : GlobeIcon.src,\n width: 17,\n height: 17,\n },\n url: () => {\n handleStorePickerClick?.();\n },\n subItems: [],\n },\n ],\n }\n : null,\n ];\n\n return _sections.filter((el): el is ProMobileMenuSection => !!el);\n }, [\n context,\n currentCountryName,\n extraSectionItems,\n footerContent,\n handleOrderHistoryClick,\n handlePurchaseHistoryClick,\n handleStorePickerClick,\n socialContent.items,\n translations.company,\n translations.orderHistory,\n translations.purchasedProductHistory,\n translations.social,\n translations.support,\n translations.tools,\n translations.training,\n ]);\n\n // #############################################################################\n // Render helpers\n // #############################################################################\n const renderSectionItemIcon = useCallback(\n (item: ProMobileMenuSection[\"items\"][number]): React.ReactNode => {\n return (\n item.icon && (\n <S2.SectionItemIcon>\n <StyleableSvgImage\n src={item.icon.src}\n width={item.icon.width}\n height={item.icon.height}\n />\n </S2.SectionItemIcon>\n )\n );\n },\n [],\n );\n\n const renderSectionItemButton = useCallback(\n (\n item: ProMobileMenuSectionItem | ProMobileMenuSectionSubItem,\n ): React.ReactNode => {\n const IconNode = \"subItems\" in item && renderSectionItemIcon(item);\n const NewLabelNode =\n \"isNew\" in item && item.isNew ? (\n <S.NewLabel>{translations.new}</S.NewLabel>\n ) : null;\n const target =\n \"targetBlank\" in item && item.targetBlank ? \"_blank\" : undefined;\n const url = item.url;\n\n if (!url) {\n return (\n <S.SectionItemButton\n motif={motif}\n onClick={() => toggleExpandedSectionItemId(item.id)}\n >\n {IconNode}\n {item.label}\n </S.SectionItemButton>\n );\n }\n\n if (typeof url === \"string\") {\n return (\n <S.SectionItemButton\n motif={motif}\n as=\"a\"\n href={url}\n onClick={onClose}\n target={target}\n >\n {IconNode}\n {item.label}\n {NewLabelNode}\n </S.SectionItemButton>\n );\n }\n\n return (\n <S.SectionItemButton\n motif={motif}\n onClick={() => {\n url();\n onClose();\n }}\n >\n {IconNode}\n {item.label}\n </S.SectionItemButton>\n );\n },\n [\n onClose,\n renderSectionItemIcon,\n toggleExpandedSectionItemId,\n translations.new,\n ],\n );\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <S.Wrap motif={motif}>\n <S.Container size=\"mobile\" noVerticalMargin>\n <S.InnerWrap>\n {/* Product line */}\n {!!productLineOptions?.length && (\n <S2.ButtonGroup>\n {productLineOptions.map((option) => (\n <S2.CustomButton\n full\n key={option.value}\n variant=\"gray\"\n $active={option.value === productLineValue}\n onClick={() => {\n handleProductLineChange?.(option.value);\n onClose();\n }}\n >\n {option.label}\n </S2.CustomButton>\n ))}\n </S2.ButtonGroup>\n )}\n\n {/* Sections */}\n {sections.map((section) => (\n <S.Section motif={motif} key={section.id}>\n {section.items.map((item) => (\n <S.SectionItemsGroup\n motif={motif}\n key={item.id}\n $active={item.id === expandedSectionItemId}\n >\n <S.SectionItem motif={motif}>\n {renderSectionItemButton(item)}\n\n {item.subItems.length > 0 && (\n <S.SectionItemArrowButton\n motif={motif}\n onClick={() => toggleExpandedSectionItemId(item.id)}\n >\n <S.ButtonIcon>\n <StyleableSvgImage\n src={icons.generic.collapseArrow}\n width={13}\n height={8}\n />\n </S.ButtonIcon>\n </S.SectionItemArrowButton>\n )}\n </S.SectionItem>\n\n {item.id === expandedSectionItemId &&\n item.subItems.length > 0 &&\n item.subItems.map((subItem) => (\n <S.SectionItem key={subItem.id} motif={motif} $secondary>\n {renderSectionItemButton(subItem)}\n </S.SectionItem>\n ))}\n </S.SectionItemsGroup>\n ))}\n </S.Section>\n ))}\n </S.InnerWrap>\n </S.Container>\n </S.Wrap>\n );\n};\n"],"names":["NavigationProMobileMenu","NavigationProMobileMenu2","translations","onClose","currentCountryName","handleStorePickerClick","handleOrderHistoryClick","handlePurchaseHistoryClick","handleProductLineChange","productLineValue","productLineOptions","extraSectionItems","motif","footerContent","socialContent","useFooterContent","context","useMenu","expandedSectionItemId","setExpandedSectionItemId","useState","toggleExpandedSectionItemId","useCallback","itemId","sections","useMemo","_sections","id","items","label","orderHistory","icon","src","HistoryIcon","width","height","url","subItems","purchasedProductHistory","support","getSupportLinkMapping","map","item","name","social","key","company","training","tools","GlobeIcon","filter","el","renderSectionItemIcon","jsx","S2.SectionItemIcon","children","StyleableSvgImage","renderSectionItemButton","IconNode","NewLabelNode","isNew","S.NewLabel","new","target","targetBlank","jsxs","S.SectionItemButton","onClick","as","href","S.Wrap","S.Container","size","noVerticalMargin","S.InnerWrap","length","S2.ButtonGroup","option","S2.CustomButton","full","variant","$active","value","section","S.Section","S.SectionItemsGroup","S.SectionItem","S.SectionItemArrowButton","S.ButtonIcon","icons.generic.collapseArrow","subItem","$secondary"],"mappings":";;;;;;;;;;;;;;;;;AAqBa,MAAAA,uBAAA,GAA0B,SAASA,wBAAwBC,CAAA;EACtEC,YAAA;EACAC,OAAA;EACAC,kBAAA;EACAC,sBAAA;EAAA;EAEAC,uBAAA;EACAC,0BAAA;EACAC,uBAAA;EACAC,gBAAA;EACAC,kBAAA;EACAC;AACF,CAAiC,EAAA;EAC/B,MAAMC,KAAe,GAAA,OAAA;EAErB,MAAM;IAAEC,aAAA;IAAeC;EAAc,CAAA,GAAIC,gBAAiB,CAAA,CAAA;EACpD,MAAA;IAAEC;GAAQ,GAAIC,OAAQ,EAAA;EAK5B,MAAM,CAACC,qBAAA,EAAuBC,wBAAwB,CAAA,GAAIC,SAExD,IAAI,CAAA;EAEN,MAAMC,2BAA8B,GAAAC,WAAA,CACjCC,MAAmB,IAAA;IAClBJ,wBAAA,CACED,qBAAA,KAA0BK,SAAS,IAAO,GAAAA,MAAA,CAC5C;EACF,CAAA,EACA,CAACL,qBAAqB,CAAA,CACxB;EAKM,MAAAM,QAAA,GAAWC,QAAQ,MAA8B;IACrD,MAAMC,SAAgD,GAAA,CACpD;MACEC,EAAI,EAAA,kBAAA;MACJC,KAAO,EAAA,CACL,IAAItB,uBACA,GAAA,CACE;QACEqB,EAAI,EAAA,eAAA;QACJE,OAAO3B,YAAa,CAAA4B,YAAA;QACpBC,IAAM,EAAA;UACJC,GACE,EAAA,OAAOC,oBAAgB,KAAA,QAAA,GACnBA,uBACAA,oBAAY,CAAAD,GAAA;UAClBE,KAAO,EAAA,EAAA;UACPC,MAAQ,EAAA;QACV,CAA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"file":"ProMobileMenu.mjs","sources":["../../../../../src/components/Header/Navigation/ProMobileMenu/ProMobileMenu.tsx"],"sourcesContent":["/* eslint-disable @next/next/no-img-element */\nimport type { Motif } from \"@ubnt/ui-components/utils\";\nimport { useCallback, useMemo, useState } from \"react\";\n\nimport HistoryIcon from \"../../../../assets/icons/menu/icon-history.svg\";\nimport LocationPinIcon from \"../../../../assets/icons/menu/icon-location-pin.svg\";\nimport * as icons from \"../../../../constants/icons\";\nimport { useMenu } from \"../../../../contexts/MenuContext\";\nimport { imageSrc } from \"../../../../utils/asset\";\nimport { isNonNullish } from \"../../../../utils/typeGuards\";\nimport { useFooterContent } from \"../../../Footer/hooks/useFooterContent\";\nimport { StyleableSvgImage } from \"../../../StyleableSvgImage\";\nimport { getSupportLinkMapping } from \"../../LinksModal/mapping\";\nimport * as S from \"../MobileMenu/MobileMenu.styles\";\nimport * as S2 from \"./ProMobileMenu.styles\";\nimport type {\n NavigationProMobileMenuProps,\n ProMobileMenuSection,\n ProMobileMenuSectionItem,\n ProMobileMenuSectionSubItem,\n} from \"./ProMobileMenu.types\";\n\nconst motif: Motif = \"light\";\n\nexport const NavigationProMobileMenu = function NavigationProMobileMenu({\n translations,\n onClose,\n currentCountryName,\n handleStorePickerClick,\n // handleEarlyAccessClick,\n handleOrderHistoryClick,\n handlePurchaseHistoryClick,\n handleProductLineChange,\n productLineValue,\n productLineOptions,\n categories,\n hideExtraSection,\n}: NavigationProMobileMenuProps) {\n const { footerContent, socialContent } = useFooterContent();\n const { context } = useMenu();\n\n // #############################################################################\n // Section toggling\n // #############################################################################\n const [expandedSectionItemId, setExpandedSectionItemId] = useState<\n string | null\n >(null);\n\n const toggleExpandedSectionItemId = useCallback(\n (itemId: string) => {\n setExpandedSectionItemId(\n expandedSectionItemId === itemId ? null : itemId,\n );\n },\n [expandedSectionItemId],\n );\n\n // #############################################################################\n // Menu sections\n // #############################################################################\n const sections = useMemo((): ProMobileMenuSection[] => {\n const extraSectionItems: ProMobileMenuSectionItem[] = [\n {\n id: \"support\",\n label: translations.support,\n url: null,\n subItems: getSupportLinkMapping(context).map((item) => ({\n id: item.id,\n label: item.name,\n url: item.url,\n })),\n },\n {\n id: \"social\",\n label: translations.social,\n url: null,\n subItems: socialContent.items.map((item) => ({\n id: item.id,\n label: item.label,\n url: item.src,\n })),\n },\n ...(\n [\n { key: \"company\", label: translations.company },\n { key: \"training\", label: translations.training },\n { key: \"tools\", label: translations.tools },\n ] as const\n ).map(({ key, label }) => ({\n id: key,\n label,\n url: null,\n subItems: footerContent[key].items.map((item) => ({\n id: item.id,\n label: item.label,\n url: item.src,\n })),\n })),\n ];\n\n return [\n {\n id: \"store-link-stuff\",\n items: [\n handleOrderHistoryClick\n ? ({\n id: \"order-history\",\n label: translations.orderHistory,\n icon: {\n src: imageSrc(HistoryIcon),\n width: 16,\n height: 16,\n },\n url: null,\n onClick: () => {\n handleOrderHistoryClick?.();\n },\n subItems: [],\n } satisfies ProMobileMenuSectionItem)\n : null,\n handlePurchaseHistoryClick\n ? ({\n id: \"purchased-product-history\",\n label: translations.purchasedProductHistory,\n icon: {\n src: imageSrc(HistoryIcon),\n width: 16,\n height: 16,\n },\n url: null,\n onClick: () => {\n handlePurchaseHistoryClick?.();\n },\n subItems: [],\n } satisfies ProMobileMenuSectionItem)\n : null,\n ].filter(isNonNullish),\n },\n\n {\n id: \"categories\",\n items: categories.items,\n },\n\n currentCountryName\n ? {\n id: \"country-selector\",\n items: [\n {\n id: \"current-country-name\",\n label: translations.region,\n value: currentCountryName,\n icon: {\n src: imageSrc(LocationPinIcon),\n width: 17,\n height: 17,\n },\n url: null,\n onClick: () => {\n handleStorePickerClick?.();\n },\n subItems: [],\n },\n ],\n }\n : null,\n\n ...(!hideExtraSection\n ? extraSectionItems.map((item) => ({\n id: `extra-${item.id}`,\n items: [item],\n }))\n : []),\n ].filter(isNonNullish);\n }, [\n translations.support,\n translations.social,\n translations.company,\n translations.training,\n translations.tools,\n translations.orderHistory,\n translations.purchasedProductHistory,\n translations.region,\n context,\n socialContent.items,\n handleOrderHistoryClick,\n handlePurchaseHistoryClick,\n categories.items,\n currentCountryName,\n handleStorePickerClick,\n hideExtraSection,\n footerContent,\n ]);\n\n // #############################################################################\n // Render helpers\n // #############################################################################\n const renderSectionItemIcon = useCallback(\n (item: ProMobileMenuSection[\"items\"][number]): React.ReactNode => {\n return (\n item.icon && (\n <S2.SectionItemIcon>\n <StyleableSvgImage\n src={item.icon.src}\n width={item.icon.width}\n height={item.icon.height}\n />\n </S2.SectionItemIcon>\n )\n );\n },\n [],\n );\n\n const renderSectionItemButton = useCallback(\n (\n item: ProMobileMenuSectionItem | ProMobileMenuSectionSubItem,\n ): React.ReactNode => {\n const IconNode = \"subItems\" in item && renderSectionItemIcon(item);\n const NewLabelNode =\n \"isNew\" in item && item.isNew ? (\n <S.NewLabel>{translations.new}</S.NewLabel>\n ) : null;\n const ValueNode = !!item.value && <div>{item.value}</div>;\n\n const target =\n \"targetBlank\" in item && item.targetBlank ? \"_blank\" : undefined;\n const url = item.url;\n\n if (!url) {\n return (\n <S2.ProSectionItemButton\n motif={motif}\n onClick={(e) => {\n item.onClick?.(e, url);\n toggleExpandedSectionItemId(item.id);\n }}\n >\n <S2.ButtonContent>\n {IconNode}\n {item.label}\n {NewLabelNode}\n </S2.ButtonContent>\n {ValueNode}\n </S2.ProSectionItemButton>\n );\n }\n\n return (\n <S.SectionItemButton\n motif={motif}\n onClick={(e) => {\n item.onClick?.(e, url);\n onClose();\n }}\n {...(typeof url === \"string\"\n ? {\n as: \"a\",\n href: url,\n target,\n }\n : {})}\n >\n <S2.ButtonContent>\n {IconNode}\n {item.label}\n {NewLabelNode}\n </S2.ButtonContent>\n {ValueNode}\n </S.SectionItemButton>\n );\n },\n [\n onClose,\n renderSectionItemIcon,\n toggleExpandedSectionItemId,\n translations.new,\n ],\n );\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <S2.Wrap motif={motif}>\n <S.Container size=\"mobile\" noVerticalMargin>\n <S.InnerWrap>\n {/* Product line */}\n {!!productLineOptions?.length && (\n <S2.ButtonGroup>\n {productLineOptions.map((option) => (\n <S2.CustomButton\n full\n key={option.value}\n variant=\"gray\"\n $active={option.value === productLineValue}\n onClick={() => {\n handleProductLineChange?.(option.value);\n onClose();\n }}\n >\n {option.label}\n </S2.CustomButton>\n ))}\n </S2.ButtonGroup>\n )}\n\n {/* Sections */}\n {sections.map((section) => (\n <S.Section motif={motif} key={section.id}>\n {section.items.map((item) => (\n <S.SectionItemsGroup\n motif={motif}\n key={item.id}\n $active={item.id === expandedSectionItemId}\n >\n <S.SectionItem motif={motif}>\n {renderSectionItemButton(item)}\n\n {item.subItems.length > 0 && (\n <S.SectionItemArrowButton\n motif={motif}\n onClick={() => toggleExpandedSectionItemId(item.id)}\n >\n <S.ButtonIcon>\n <StyleableSvgImage\n src={icons.generic.collapseArrow}\n width={13}\n height={8}\n />\n </S.ButtonIcon>\n </S.SectionItemArrowButton>\n )}\n </S.SectionItem>\n\n {item.id === expandedSectionItemId &&\n item.subItems.length > 0 &&\n item.subItems.map((subItem) => (\n <S.SectionItem key={subItem.id} motif={motif} $secondary>\n {renderSectionItemButton(subItem)}\n </S.SectionItem>\n ))}\n </S.SectionItemsGroup>\n ))}\n </S.Section>\n ))}\n </S.InnerWrap>\n </S.Container>\n </S2.Wrap>\n );\n};\n"],"names":["motif","NavigationProMobileMenu","NavigationProMobileMenu2","translations","onClose","currentCountryName","handleStorePickerClick","handleOrderHistoryClick","handlePurchaseHistoryClick","handleProductLineChange","productLineValue","productLineOptions","categories","hideExtraSection","footerContent","socialContent","useFooterContent","context","useMenu","expandedSectionItemId","setExpandedSectionItemId","useState","toggleExpandedSectionItemId","useCallback","itemId","sections","useMemo","extraSectionItems","id","label","support","url","subItems","getSupportLinkMapping","map","item","name","social","items","src","key","company","training","tools","orderHistory","icon","imageSrc","HistoryIcon","width","height","onClick","purchasedProductHistory","filter","isNonNullish","region","value","LocationPinIcon","renderSectionItemIcon","jsx","S2.SectionItemIcon","children","StyleableSvgImage","renderSectionItemButton","IconNode","NewLabelNode","isNew","S.NewLabel","new","ValueNode","target","targetBlank","jsxs","S2.ProSectionItemButton","e","S2.ButtonContent","S.SectionItemButton","as","href","S2.Wrap","S.Container","size","noVerticalMargin","S.InnerWrap","length","S2.ButtonGroup","option","S2.CustomButton","full","variant","$active","section","S.Section","S.SectionItemsGroup","S.SectionItem","S.SectionItemArrowButton","S.ButtonIcon","icons.generic.collapseArrow","subItem","$secondary"],"mappings":";;;;;;;;;;;;;;;;;;;AAsBA,MAAMA,KAAe,GAAA,OAAA;AAER,MAAAC,uBAAA,GAA0B,SAASA,wBAAwBC,CAAA;EACtEC,YAAA;EACAC,OAAA;EACAC,kBAAA;EACAC,sBAAA;EAAA;EAEAC,uBAAA;EACAC,0BAAA;EACAC,uBAAA;EACAC,gBAAA;EACAC,kBAAA;EACAC,UAAA;EACAC;AACF,CAAiC,EAAA;EAC/B,MAAM;IAAEC,aAAA;IAAeC;EAAc,CAAA,GAAIC,gBAAiB,CAAA,CAAA;EACpD,MAAA;IAAEC;GAAQ,GAAIC,OAAQ,EAAA;EAK5B,MAAM,CAACC,qBAAA,EAAuBC,wBAAwB,CAAA,GAAIC,SAExD,IAAI,CAAA;EAEN,MAAMC,2BAA8B,GAAAC,WAAA,CACjCC,MAAmB,IAAA;IAClBJ,wBAAA,CACED,qBAAA,KAA0BK,SAAS,IAAO,GAAAA,MAAA,CAC5C;EACF,CAAA,EACA,CAACL,qBAAqB,CAAA,CACxB;EAKM,MAAAM,QAAA,GAAWC,QAAQ,MAA8B;IACrD,MAAMC,iBAAgD,GAAA,CACpD;MACEC,EAAI,EAAA,SAAA;MACJC,OAAO1B,YAAa,CAAA2B,OAAA;MACpBC,GAAK,EAAA,IAAA;MACLC,UAAUC,qBAAsB,CAAAhB,OAAO,CAAE,CAAAiB,GAAA,CAAKC,IAAU,KAAA;QACtDP,IAAIO,IAAK,CAAAP,EAAA;QACTC,OAAOM,IAAK,CAAAC,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B,IAAK,CAAAH,QAAA,CAASmD,SAAS,CACvB,IAAAhD,IAAA,CAAKH,QAAS,CAAAE,GAAA,CAAK+D,OAAA,IAAA,mBAChBJ,WAAE,EAAF;cAA+B7F,KAAA;cAAckG,UAAU,EAAA,IAAA;cACrDtC,kCAAwBqC,OAAO;YAAA,CAAA,EADdA,OAAQ,CAAArE,EAE5B,CACD,CAAA;UAAA,CAAA,EA5BEO,IAAK,CAAAP,EAAA,CA8Bb;QAAA,CAAA,EAlC2B8D,OAAQ,CAAA9D,EAmCtC,CACD,CAAA;OACH;KACF;EACF,CAAA,CAAA;AAEJ,CAAA;"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export declare const Wrap: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
2
|
+
motif: import("@ubnt/ui-components").Motif;
|
|
3
|
+
}, never>;
|
|
1
4
|
export declare const SectionItemIcon: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
2
5
|
export declare const CustomButton: import("styled-components").StyledComponent<import("react").ForwardRefExoticComponent<import("../../../Button/Button.types").ButtonProps & {
|
|
3
6
|
children?: import("react").ReactNode;
|
|
@@ -5,3 +8,9 @@ export declare const CustomButton: import("styled-components").StyledComponent<i
|
|
|
5
8
|
$active?: boolean;
|
|
6
9
|
}, never>;
|
|
7
10
|
export declare const ButtonGroup: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
11
|
+
export declare const ButtonContent: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
12
|
+
export declare const ProSectionItemButton: import("styled-components").StyledComponent<"button", import("styled-components").DefaultTheme, {
|
|
13
|
+
motif: import("@ubnt/ui-components").Motif;
|
|
14
|
+
$link?: boolean;
|
|
15
|
+
$bold?: boolean;
|
|
16
|
+
}, never>;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
var styled = require('styled-components');
|
|
4
4
|
var theme = require('../../../../constants/theme.js');
|
|
5
5
|
require('../../../Button/index.js');
|
|
6
|
+
var MobileMenu_styles = require('../MobileMenu/MobileMenu.styles.js');
|
|
6
7
|
var Button = require('../../../Button/Button.js');
|
|
7
8
|
function _interopDefault(e) {
|
|
8
9
|
return e && e.__esModule ? e : {
|
|
@@ -11,10 +12,12 @@ function _interopDefault(e) {
|
|
|
11
12
|
}
|
|
12
13
|
var styled__default = /*#__PURE__*/_interopDefault(styled);
|
|
13
14
|
"use strict";
|
|
15
|
+
const Wrap = styled__default["default"](MobileMenu_styles.Wrap)`
|
|
16
|
+
padding-top: 8px;
|
|
17
|
+
`;
|
|
14
18
|
const SectionItemIcon = styled__default["default"].div`
|
|
15
19
|
width: 20px;
|
|
16
20
|
height: 20px;
|
|
17
|
-
margin-right: 10px;
|
|
18
21
|
color: ${theme.theme.colors.black};
|
|
19
22
|
|
|
20
23
|
display: flex;
|
|
@@ -39,7 +42,18 @@ const ButtonGroup = styled__default["default"].div`
|
|
|
39
42
|
display: flex;
|
|
40
43
|
gap: 8px;
|
|
41
44
|
`;
|
|
45
|
+
const ButtonContent = styled__default["default"].div`
|
|
46
|
+
display: flex;
|
|
47
|
+
align-items: center;
|
|
48
|
+
gap: 10px;
|
|
49
|
+
`;
|
|
50
|
+
const ProSectionItemButton = styled__default["default"](MobileMenu_styles.SectionItemButton)`
|
|
51
|
+
justify-content: space-between;
|
|
52
|
+
`;
|
|
53
|
+
exports.ButtonContent = ButtonContent;
|
|
42
54
|
exports.ButtonGroup = ButtonGroup;
|
|
43
55
|
exports.CustomButton = CustomButton;
|
|
56
|
+
exports.ProSectionItemButton = ProSectionItemButton;
|
|
44
57
|
exports.SectionItemIcon = SectionItemIcon;
|
|
58
|
+
exports.Wrap = Wrap;
|
|
45
59
|
//# sourceMappingURL=ProMobileMenu.styles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProMobileMenu.styles.js","sources":["../../../../../src/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.tsx"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { theme } from \"../../../../constants/theme\";\nimport { Button } from \"../../../Button\";\n\nexport const SectionItemIcon = styled.div`\n width: 20px;\n height: 20px;\n
|
|
1
|
+
{"version":3,"file":"ProMobileMenu.styles.js","sources":["../../../../../src/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.tsx"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { theme } from \"../../../../constants/theme\";\nimport { Button } from \"../../../Button\";\nimport {\n SectionItemButton,\n Wrap as WrapBase,\n} from \"../MobileMenu/MobileMenu.styles\";\n\nexport const Wrap = styled(WrapBase)`\n padding-top: 8px;\n`;\n\nexport const SectionItemIcon = styled.div`\n width: 20px;\n height: 20px;\n color: ${theme.colors.black};\n\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\n// FIXME i should be using Motif here but...\nexport const CustomButton = styled(Button)<{ $active?: boolean }>`\n height: 46px;\n font-size: ${theme.font.size14};\n line-height: 1;\n border-radius: 6px;\n\n ${({ $active }) =>\n $active &&\n css`\n background: ${theme.colors.white} !important;\n border-width: 4px;\n color: ${theme.colors.primaryBlue};\n `}\n`;\n\nexport const ButtonGroup = styled.div`\n display: flex;\n gap: 8px;\n`;\n\nexport const ButtonContent = styled.div`\n display: flex;\n align-items: center;\n gap: 10px;\n`;\n\nexport const ProSectionItemButton = styled(SectionItemButton)`\n justify-content: space-between;\n`;\n"],"names":["Wrap","styled","WrapBase","SectionItemIcon","div","theme","colors","black","CustomButton","Button","font","size14","$active","css","white","primaryBlue","ButtonGroup","ButtonContent","ProSectionItemButton","SectionItemButton"],"mappings":";;;;;;;;;;;;;;AASa,MAAAA,IAAA,GAAOC,eAAAA,CAAAA,SAAAA,EAAOC,iBAAAA,CAAAA,IAAQ,CAAA;AAAA;AAAA,CAAA;AAI5B,MAAMC,kBAAkBF,eAAO,CAAA,SAAA,CAAA,CAAAG,GAAA;AAAA;AAAA;AAAA,WAG3BC,KAAA,CAAAA,KAAA,CAAMC,OAAOC,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAQhB,MAAAC,YAAA,GAAeP,eAAAA,CAAAA,SAAAA,EAAOQ,MAAAA,CAAAA,MAAM,CAAA;AAAA;AAAA,eAE1BJ,KAAA,CAAAA,KAAA,CAAMK,KAAKC,MAAM;AAAA;AAAA;AAAA;AAAA,IAI5B,CAAC;EAAEC;CAAQ,KACXA,OACA,IAAAC,MAAAA,CAAAA,GAAA;AAAA,oBACgBR,KAAA,CAAAA,KAAA,CAAMC,OAAOQ,KAAK;AAAA;AAAA,eAEvBT,KAAA,CAAAA,KAAA,CAAMC,OAAOS,WAAW;AAAA,KAClC;AAAA,CAAA;AAGE,MAAMC,cAAcf,eAAO,CAAA,SAAA,CAAA,CAAAG,GAAA;AAAA;AAAA;AAAA,CAAA;AAK3B,MAAMa,gBAAgBhB,eAAO,CAAA,SAAA,CAAA,CAAAG,GAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAMvB,MAAAc,oBAAA,GAAuBjB,eAAAA,CAAAA,SAAAA,EAAOkB,iBAAAA,CAAAA,iBAAiB,CAAA;AAAA;AAAA,CAAA;;;;;;"}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import styled, { css } from 'styled-components';
|
|
2
2
|
import { theme } from '../../../../constants/theme.mjs';
|
|
3
3
|
import '../../../Button/index.mjs';
|
|
4
|
+
import { Wrap as Wrap$1, SectionItemButton } from '../MobileMenu/MobileMenu.styles.mjs';
|
|
4
5
|
import { Button } from '../../../Button/Button.mjs';
|
|
5
6
|
"use strict";
|
|
7
|
+
const Wrap = styled(Wrap$1)`
|
|
8
|
+
padding-top: 8px;
|
|
9
|
+
`;
|
|
6
10
|
const SectionItemIcon = styled.div`
|
|
7
11
|
width: 20px;
|
|
8
12
|
height: 20px;
|
|
9
|
-
margin-right: 10px;
|
|
10
13
|
color: ${theme.colors.black};
|
|
11
14
|
|
|
12
15
|
display: flex;
|
|
@@ -31,5 +34,13 @@ const ButtonGroup = styled.div`
|
|
|
31
34
|
display: flex;
|
|
32
35
|
gap: 8px;
|
|
33
36
|
`;
|
|
34
|
-
|
|
37
|
+
const ButtonContent = styled.div`
|
|
38
|
+
display: flex;
|
|
39
|
+
align-items: center;
|
|
40
|
+
gap: 10px;
|
|
41
|
+
`;
|
|
42
|
+
const ProSectionItemButton = styled(SectionItemButton)`
|
|
43
|
+
justify-content: space-between;
|
|
44
|
+
`;
|
|
45
|
+
export { ButtonContent, ButtonGroup, CustomButton, ProSectionItemButton, SectionItemIcon, Wrap };
|
|
35
46
|
//# sourceMappingURL=ProMobileMenu.styles.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProMobileMenu.styles.mjs","sources":["../../../../../src/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.tsx"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { theme } from \"../../../../constants/theme\";\nimport { Button } from \"../../../Button\";\n\nexport const SectionItemIcon = styled.div`\n width: 20px;\n height: 20px;\n
|
|
1
|
+
{"version":3,"file":"ProMobileMenu.styles.mjs","sources":["../../../../../src/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.tsx"],"sourcesContent":["import styled, { css } from \"styled-components\";\n\nimport { theme } from \"../../../../constants/theme\";\nimport { Button } from \"../../../Button\";\nimport {\n SectionItemButton,\n Wrap as WrapBase,\n} from \"../MobileMenu/MobileMenu.styles\";\n\nexport const Wrap = styled(WrapBase)`\n padding-top: 8px;\n`;\n\nexport const SectionItemIcon = styled.div`\n width: 20px;\n height: 20px;\n color: ${theme.colors.black};\n\n display: flex;\n align-items: center;\n justify-content: center;\n`;\n\n// FIXME i should be using Motif here but...\nexport const CustomButton = styled(Button)<{ $active?: boolean }>`\n height: 46px;\n font-size: ${theme.font.size14};\n line-height: 1;\n border-radius: 6px;\n\n ${({ $active }) =>\n $active &&\n css`\n background: ${theme.colors.white} !important;\n border-width: 4px;\n color: ${theme.colors.primaryBlue};\n `}\n`;\n\nexport const ButtonGroup = styled.div`\n display: flex;\n gap: 8px;\n`;\n\nexport const ButtonContent = styled.div`\n display: flex;\n align-items: center;\n gap: 10px;\n`;\n\nexport const ProSectionItemButton = styled(SectionItemButton)`\n justify-content: space-between;\n`;\n"],"names":["Wrap","styled","WrapBase","SectionItemIcon","div","theme","colors","black","CustomButton","Button","font","size14","$active","css","white","primaryBlue","ButtonGroup","ButtonContent","ProSectionItemButton","SectionItemButton"],"mappings":";;;;;;AASa,MAAAA,IAAA,GAAOC,OAAOC,MAAQ,CAAA;AAAA;AAAA,CAAA;AAI5B,MAAMC,kBAAkBF,MAAO,CAAAG,GAAA;AAAA;AAAA;AAAA,WAG3BC,KAAA,CAAMC,OAAOC,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAQhB,MAAAC,YAAA,GAAeP,OAAOQ,MAAM,CAAA;AAAA;AAAA,eAE1BJ,KAAA,CAAMK,KAAKC,MAAM;AAAA;AAAA;AAAA;AAAA,IAI5B,CAAC;EAAEC;CAAQ,KACXA,OACA,IAAAC,GAAA;AAAA,oBACgBR,KAAA,CAAMC,OAAOQ,KAAK;AAAA;AAAA,eAEvBT,KAAA,CAAMC,OAAOS,WAAW;AAAA,KAClC;AAAA,CAAA;AAGE,MAAMC,cAAcf,MAAO,CAAAG,GAAA;AAAA;AAAA;AAAA,CAAA;AAK3B,MAAMa,gBAAgBhB,MAAO,CAAAG,GAAA;AAAA;AAAA;AAAA;AAAA,CAAA;AAMvB,MAAAc,oBAAA,GAAuBjB,OAAOkB,iBAAiB,CAAA;AAAA;AAAA,CAAA;"}
|
|
@@ -1,26 +1,32 @@
|
|
|
1
|
+
import type { MouseEvent } from "react";
|
|
1
2
|
import type { ProductLine } from "../../../../types";
|
|
2
3
|
import type { HeaderTranslations, ProHeaderProps } from "../../Header.types";
|
|
4
|
+
export type ProMobileMenuOnClickFn = (e: MouseEvent, url: string | null) => void;
|
|
3
5
|
export type ProMobileMenuSectionSubItem = {
|
|
4
6
|
id: string;
|
|
5
7
|
label: string;
|
|
6
|
-
|
|
8
|
+
value?: string;
|
|
9
|
+
url: string;
|
|
10
|
+
onClick?: ProMobileMenuOnClickFn;
|
|
7
11
|
isNew?: boolean;
|
|
8
12
|
targetBlank?: boolean;
|
|
9
13
|
};
|
|
10
14
|
export type ProMobileMenuSectionItem = {
|
|
11
15
|
id: string;
|
|
12
16
|
label: string;
|
|
17
|
+
value?: string;
|
|
13
18
|
icon?: {
|
|
14
19
|
src: string;
|
|
15
20
|
width: number;
|
|
16
21
|
height: number;
|
|
17
22
|
};
|
|
18
|
-
url: string |
|
|
23
|
+
url: string | null;
|
|
24
|
+
onClick?: ProMobileMenuOnClickFn;
|
|
19
25
|
subItems: Array<ProMobileMenuSectionSubItem>;
|
|
20
26
|
};
|
|
21
27
|
export interface ProMobileMenuSection {
|
|
22
28
|
id: string;
|
|
23
|
-
items:
|
|
29
|
+
items: ProMobileMenuSectionItem[];
|
|
24
30
|
}
|
|
25
31
|
export interface NavigationProMobileMenuProps {
|
|
26
32
|
translations: HeaderTranslations;
|
|
@@ -35,6 +41,6 @@ export interface NavigationProMobileMenuProps {
|
|
|
35
41
|
value: ProductLine;
|
|
36
42
|
label: string;
|
|
37
43
|
}>;
|
|
44
|
+
categories: ProHeaderProps["categories"];
|
|
38
45
|
hideExtraSection?: boolean;
|
|
39
|
-
extraSectionItems?: Array<ProMobileMenuSectionItem>;
|
|
40
46
|
}
|