@ubnt/store.core 9.16.0 → 9.17.0-alpha.0
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 +140 -0
- 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 +3 -2
- package/lib/assets/close3.svg +2 -3
- 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/minus4.svg +8 -8
- package/lib/assets/minus5.svg +8 -8
- package/lib/assets/plus5.svg +9 -9
- package/lib/assets/plus6.svg +9 -9
- package/lib/assets/ucg-max.png +0 -0
- package/lib/components/CategoryTabs/CategoryTabs.types.d.ts +1 -1
- package/lib/components/CustomImage/CustomImage.js.map +1 -1
- package/lib/components/CustomImage/CustomImage.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/megaphone.http.service.js +1 -1
- package/lib/components/Header/AccountMenu/megaphone.http.service.js.map +1 -1
- package/lib/components/Header/AccountMenu/megaphone.http.service.mjs +1 -1
- package/lib/components/Header/AccountMenu/megaphone.http.service.mjs.map +1 -1
- package/lib/components/Header/Header.types.d.ts +8 -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 +1 -1
- package/lib/components/Header/MenuItem/MenuItem.styles.js.map +1 -1
- package/lib/components/Header/MenuItem/MenuItem.styles.mjs +1 -1
- package/lib/components/Header/MenuItem/MenuItem.styles.mjs.map +1 -1
- package/lib/components/Header/Navigation/ProMenu/ProMenu.d.ts +2 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.js +109 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.js.map +1 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.mjs +87 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.mjs.map +1 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.d.ts +24 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.js +154 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.js.map +1 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.mjs +138 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.styles.mjs.map +1 -0
- package/lib/components/Header/Navigation/ProMenu/ProMenu.types.d.ts +13 -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 +130 -63
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.js.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.mjs +111 -64
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.mjs.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.d.ts +6 -0
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.js +11 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.js.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.mjs +10 -2
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.styles.mjs.map +1 -1
- package/lib/components/Header/Navigation/ProMobileMenu/ProMobileMenu.types.d.ts +5 -1
- package/lib/components/Header/ProHeader/ProHeader.d.ts +2 -4
- package/lib/components/Header/ProHeader/ProHeader.js +142 -36
- package/lib/components/Header/ProHeader/ProHeader.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.mjs +143 -39
- package/lib/components/Header/ProHeader/ProHeader.mjs.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.d.ts +3 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.js +18 -13
- package/lib/components/Header/ProHeader/ProHeader.styles.js.map +1 -1
- package/lib/components/Header/ProHeader/ProHeader.styles.mjs +17 -14
- package/lib/components/Header/ProHeader/ProHeader.styles.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/{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/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/NormalisedImage/NormalisedImage.js.map +1 -1
- package/lib/components/NormalisedImage/NormalisedImage.mjs.map +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/InputSections/CounterSection.js +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/CounterSection.mjs +2 -2
- 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/InputCard/assets/minus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/minus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/assets/plus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +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 +4 -4
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js.map +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs +4 -4
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs.map +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/minus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.js +1 -1
- package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/assets/plus.svg.mjs +2 -2
- package/lib/components/ResourceCalculatorV1/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/StyleableSvgImage/StyleableSvgImage.js.map +1 -1
- package/lib/components/StyleableSvgImage/StyleableSvgImage.mjs.map +1 -1
- package/lib/components/VideoPlayerNew/VideoPlayer.js +1 -1
- package/lib/components/VideoPlayerNew/VideoPlayer.mjs +1 -1
- package/lib/components/VideoPlayerNew/assets/close.svg.js +1 -1
- package/lib/components/VideoPlayerNew/assets/close.svg.mjs +2 -2
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +2 -0
- package/lib/components/index.js.map +1 -1
- package/lib/components/index.mjs +2 -0
- package/lib/components/index.mjs.map +1 -1
- package/lib/constants/icons/options/colors/black.svg.js +5 -5
- package/lib/constants/icons/options/colors/index.js +3 -3
- package/lib/constants/icons/options/styles/black.svg.js +5 -5
- package/lib/constants/icons/options/styles/index.js +3 -3
- package/lib/constants/optionIcons.js +6 -6
- package/lib/constants/optionIcons.mjs +4 -4
- 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/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 +1 -1
- package/lib/helpers/ux.js.map +1 -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 +55 -0
- package/lib/utils/money/allocators/fixedAmount.js.map +1 -0
- package/lib/utils/money/allocators/fixedAmount.mjs +53 -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 +110 -0
- package/lib/utils/money/allocators/productAmount.js.map +1 -0
- package/lib/utils/money/allocators/productAmount.mjs +108 -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 +66 -0
- package/lib/utils/productSort.js.map +1 -0
- package/lib/utils/productSort.mjs +59 -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":"CustomImage.js","sources":["../../../src/components/CustomImage/CustomImage.tsx"],"sourcesContent":["/* eslint-disable @next/next/no-img-element */\n/**\n * Creates a centered optimized image with a skeleton loader and\n * fallback image if galleryImage undefined or onError\n */\n\nimport type { StaticImageData } from \"next/image\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { useLockBodyScroll } from \"react-use\";\n\nimport FallbackImageIcon from \"../../assets/icons/fallbackImage.svg\";\nimport ZoomInIcon from \"../../assets/icons/zoom-in.svg\";\nimport CloseIcon from \"../../constants/icons/generic/close.svg\";\nimport { DEFAULT_MOTIF } from \"../../constants/theme\";\nimport { StyleableSvgImage } from \"../StyleableSvgImage\";\nimport * as S from \"./CustomImage.styles\";\nimport type { CustomImageProps, RenderImageProps } from \"./CustomImage.types\";\n\nconst isNextImageLoading = (imageEl: HTMLImageElement) => {\n return (\n // Loading if no src found\n !imageEl.src ||\n // Loading if next placeholder is found\n /** @see https://github.com/vercel/next.js/issues/18398#issuecomment-850251992 */\n imageEl.src.includes(\"data:image/gif;base64\") ||\n // Loading if somehow the replaced actual image is not completely loaded\n !imageEl.complete\n );\n};\n\n// Get asset object for CustomImage from image imports\nexport const asset = (\n asset: string | StaticImageData,\n width: number,\n height: number,\n) => ({\n src: typeof asset === \"string\" ? asset : asset.src,\n width,\n height,\n});\n\nexport const renderNativeImage = ({\n src,\n height,\n width,\n alt,\n onLoad,\n onError,\n}: RenderImageProps) => (\n <img\n src={src}\n height={height}\n width={width}\n alt={alt ?? \"\"}\n onLoad={onLoad}\n onError={onError}\n />\n);\n\nexport const CustomImage = function CustomImage({\n motif = DEFAULT_MOTIF,\n asset,\n sizes,\n className,\n margin,\n priority = false,\n fallbackImageSize = \"medium\",\n responsive,\n layout = \"responsive\",\n renderImage,\n disableSkeleton,\n objectFit,\n disableBorderRadius,\n canFullscreen,\n onFullscreenChange,\n}: CustomImageProps) {\n // #############################################################################\n // States\n // #############################################################################\n const [loading, setLoading] = useState(\n // Set as loading by default, handle not loading in the effect\n true,\n );\n const [error, setError] = useState(false);\n const [isFullscreen, setFullscreen] = useState(false);\n\n // #############################################################################\n // Lock body when fullscreen is open\n // #############################################################################\n useLockBodyScroll(isFullscreen);\n\n // #############################################################################\n // Call onFullscreenChange callback when isFullscreen changes\n // #############################################################################\n useEffect(() => {\n if (canFullscreen && onFullscreenChange) {\n onFullscreenChange(isFullscreen);\n }\n }, [canFullscreen, isFullscreen, onFullscreenChange]);\n\n // #############################################################################\n // Element refs and handling\n // #############################################################################\n const wrapRef = useRef<HTMLDivElement>(null);\n\n // Set initial loading based on the asset\n useEffect(() => {\n // Skip if not set\n if (!wrapRef.current) return;\n\n // Find image\n const imageEl = wrapRef.current.querySelector(\"img\");\n\n // Skip if not found\n if (!imageEl) return;\n\n // Set state based on complete status\n const loadingInitial = isNextImageLoading(imageEl);\n\n setLoading(loadingInitial);\n setError(false);\n }, []);\n\n // #############################################################################\n // Handle error\n // #############################################################################\n const handleOnError = useCallback(() => {\n setError(true);\n }, []);\n\n // #############################################################################\n // Handle loading complete\n // Used for NextJS images\n // #############################################################################\n const handleOnLoadingComplete = useCallback(() => {\n setLoading(false);\n setError(false);\n }, []);\n\n // #############################################################################\n // Handle load complete\n // #############################################################################\n const handleOnLoadComplete = useCallback(\n (event) => {\n // Remove loading for specific image if loaded src and provided src matches\n // Fallback - if no event or src provided, then set to loading=false\n if (\n !event?.currentTarget?.src ||\n event.currentTarget.src === asset?.src\n ) {\n setLoading(false);\n setError(false);\n }\n },\n [asset?.src],\n );\n\n // #############################################################################\n // Handle click on image for fullscreen\n // #############################################################################\n const handleFullscreenClick = useCallback(() => {\n if (canFullscreen && asset && !error && !loading && !isFullscreen) {\n setFullscreen(true);\n }\n }, [asset, canFullscreen, error, isFullscreen, loading]);\n\n // #############################################################################\n // Handle Escape button press to close fullscreen\n // #############################################################################\n useEffect(() => {\n if (!canFullscreen) {\n return;\n }\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n setFullscreen(false);\n }\n };\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown);\n };\n }, [canFullscreen]);\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <S.ImageWrapOuter className={className} $responsive={responsive}>\n <S.ImageWrap\n margin={margin}\n layout={layout}\n $sizes={sizes}\n $objectFit={objectFit}\n ref={wrapRef}\n $clickable={\n canFullscreen && asset && !error && !loading && !isFullscreen\n }\n onClick={handleFullscreenClick}\n >\n {asset && !error ? (\n renderImage?.({\n src: asset.src,\n alt: asset.alt,\n // Don't pass width and height to next/image if layout is \"fill\"\n height: layout !== \"fill\" ? asset.height : undefined,\n width: layout !== \"fill\" ? asset.width : undefined,\n onLoadingComplete: handleOnLoadingComplete,\n onLoad: handleOnLoadComplete,\n onError: handleOnError,\n sizes,\n layout,\n priority,\n objectFit,\n }) ??\n renderNativeImage({\n ...asset,\n onLoad: handleOnLoadingComplete,\n onError: handleOnError,\n })\n ) : (\n <S.FallbackImageWrap\n margin={margin}\n fallbackImageSize={fallbackImageSize}\n >\n <img\n src={\n typeof FallbackImageIcon === \"string\"\n ? FallbackImageIcon\n : FallbackImageIcon.src\n }\n alt=\"Fallback\"\n />\n </S.FallbackImageWrap>\n )}\n </S.ImageWrap>\n\n {!disableSkeleton && loading && asset && !error && (\n <S.ImageSkeletonLoader\n $responsive={responsive}\n motif={motif}\n disableBorderRadius={disableBorderRadius}\n />\n )}\n\n {canFullscreen &&\n isFullscreen &&\n asset &&\n !error &&\n createPortal(\n <S.FullscreenImageWrap>\n {renderImage?.({\n src: asset.src,\n alt: asset.alt,\n height: layout !== \"fill\" ? asset.height : undefined,\n width: layout !== \"fill\" ? asset.width : undefined,\n sizes,\n layout,\n priority,\n objectFit,\n }) ?? renderNativeImage(asset)}\n <S.FullscreenCloseButton onClick={() => setFullscreen(false)}>\n <StyleableSvgImage src={CloseIcon} width={14} height={14} />\n </S.FullscreenCloseButton>\n </S.FullscreenImageWrap>,\n document.body,\n )}\n {canFullscreen && asset && !error && !loading && !isFullscreen && (\n <S.FullscreenButton onClick={handleFullscreenClick}>\n <S.ZoomIcon src={ZoomInIcon} width={32} height={32} />\n </S.FullscreenButton>\n )}\n </S.ImageWrapOuter>\n );\n};\n"],"names":["isNextImageLoading","imageEl","src","includes","complete","asset","width","height","renderNativeImage","alt","onLoad","onError","jsx","CustomImage","CustomImage2","motif","DEFAULT_MOTIF","sizes","className","margin","priority","fallbackImageSize","responsive","layout","renderImage","disableSkeleton","objectFit","disableBorderRadius","canFullscreen","onFullscreenChange","loading","setLoading","useState","error","setError","isFullscreen","setFullscreen","useLockBodyScroll","useEffect","wrapRef","useRef","current","querySelector","loadingInitial","handleOnError","useCallback","handleOnLoadingComplete","handleOnLoadComplete","event","currentTarget","handleFullscreenClick","handleKeyDown","e","key","document","addEventListener","removeEventListener","S.ImageWrapOuter","$responsive","children","S.ImageWrap","ImageWrap","$sizes","$objectFit","ref","$clickable","onClick","onLoadingComplete","S.FallbackImageWrap","FallbackImageWrap","FallbackImageIcon","S.ImageSkeletonLoader","ImageSkeletonLoader","createPortal","jsxs","S.FullscreenImageWrap","S.FullscreenCloseButton","FullscreenCloseButton","StyleableSvgImage","CloseIcon","body","S.FullscreenButton","S.ZoomIcon","ZoomInIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAMA,kBAAA,GAAsBC,OAA8B,IAAA;EACxD;IAAA;IAEE,CAACA,OAAQ,CAAAC,GAAA;IAAA;IAAA;IAGTD,OAAA,CAAQC,GAAI,CAAAC,QAAA,CAAS,uBAAuB,CAAA;IAAA;IAE5C,CAACF,OAAQ,CAAAG;EAAA;AAEb,CAAA;AAGO,MAAMC,KAAQ,GAAAA,CACnBA,MACA,EAAAC,KAAA,EACAC,MACI,MAAA;EACJL,GAAK,EAAA,OAAOG,MAAU,KAAA,QAAA,GAAWA,SAAQA,MAAM,CAAAH,GAAA;EAC/CI,KAAA;EACAC;AACF,CAAA,CAAA;AAEO,MAAMC,oBAAoBA,CAAC;EAChCN,GAAA;EACAK,MAAA;EACAD,KAAA;EACAG,GAAA;EACAC,MAAA;EACAC;AACF,CACE,oBAAAC,UAAA,CAAAA,GAAA,CAAC,KAAA,EAAA;EACCV,GAAA;EACAK,MAAA;EACAD,KAAA;EACAG,KAAKA,GAAO,IAAA,EAAA;EACZC,MAAA;EACAC;AAAA,CACF,CAAA;AAGW,MAAAE,WAAA,GAAc,SAASA,YAAYC,CAAA;EAC9CC,KAAQ,GAAAC,KAAA,CAAA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AA;QAAIC,MAAQ,EAAA;MAAI,CAAA;KACtD,CAAA;EAEJ,CAAA,CAAA;AAEJ,CAAA;;;"}
|
|
1
|
+
{"version":3,"file":"CustomImage.js","sources":["../../../src/components/CustomImage/CustomImage.tsx"],"sourcesContent":["/* eslint-disable @next/next/no-img-element */\n/**\n * Creates a centered optimized image with a skeleton loader and\n * fallback image if galleryImage undefined or onError\n */\n\nimport type { StaticImageData } from \"next/image\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { useLockBodyScroll } from \"react-use\";\n\nimport FallbackImageIcon from \"../../assets/icons/fallbackImage.svg\";\nimport ZoomInIcon from \"../../assets/icons/zoom-in.svg\";\nimport CloseIcon from \"../../constants/icons/generic/close.svg\";\nimport { DEFAULT_MOTIF } from \"../../constants/theme\";\nimport { StyleableSvgImage } from \"../StyleableSvgImage\";\nimport * as S from \"./CustomImage.styles\";\nimport type { CustomImageProps, RenderImageProps } from \"./CustomImage.types\";\n\nconst isNextImageLoading = (imageEl: HTMLImageElement) => {\n return (\n // Loading if no src found\n !imageEl.src ||\n // Loading if next placeholder is found\n /** @see https://github.com/vercel/next.js/issues/18398#issuecomment-850251992 */\n imageEl.src.includes(\"data:image/gif;base64\") ||\n // Loading if somehow the replaced actual image is not completely loaded\n !imageEl.complete\n );\n};\n\n// Get asset object for CustomImage from image imports\nexport const asset = (\n asset: string | StaticImageData,\n width: number,\n height: number,\n) => ({\n src: typeof asset === \"string\" ? asset : asset.src,\n width,\n height,\n});\n\nexport const renderNativeImage = ({\n src,\n height,\n width,\n alt,\n onLoad,\n onError,\n}: RenderImageProps) => (\n <img\n src={src}\n height={height}\n width={width}\n alt={alt ?? \"\"}\n onLoad={onLoad}\n onError={onError}\n />\n);\n\nexport const CustomImage = function CustomImage({\n motif = DEFAULT_MOTIF,\n asset,\n sizes,\n className,\n margin,\n priority = false,\n fallbackImageSize = \"medium\",\n responsive,\n layout = \"responsive\",\n renderImage,\n disableSkeleton,\n objectFit,\n disableBorderRadius,\n canFullscreen,\n onFullscreenChange,\n}: CustomImageProps) {\n // #############################################################################\n // States\n // #############################################################################\n const [loading, setLoading] = useState(\n // Set as loading by default, handle not loading in the effect\n true,\n );\n const [error, setError] = useState(false);\n const [isFullscreen, setFullscreen] = useState(false);\n\n // #############################################################################\n // Lock body when fullscreen is open\n // #############################################################################\n useLockBodyScroll(isFullscreen);\n\n // #############################################################################\n // Call onFullscreenChange callback when isFullscreen changes\n // #############################################################################\n useEffect(() => {\n if (canFullscreen && onFullscreenChange) {\n onFullscreenChange(isFullscreen);\n }\n }, [canFullscreen, isFullscreen, onFullscreenChange]);\n\n // #############################################################################\n // Element refs and handling\n // #############################################################################\n const wrapRef = useRef<HTMLDivElement>(null);\n\n // Set initial loading based on the asset\n useEffect(() => {\n // Skip if not set\n if (!wrapRef.current) return;\n\n // Find image\n const imageEl = wrapRef.current.querySelector(\"img\");\n\n // Skip if not found\n if (!imageEl) return;\n\n // Set state based on complete status\n const loadingInitial = isNextImageLoading(imageEl);\n\n setLoading(loadingInitial);\n setError(false);\n }, []);\n\n // #############################################################################\n // Handle error\n // #############################################################################\n const handleOnError = useCallback(() => {\n setError(true);\n }, []);\n\n // #############################################################################\n // Handle loading complete\n // Used for NextJS images\n // #############################################################################\n const handleOnLoadingComplete = useCallback(() => {\n setLoading(false);\n setError(false);\n }, []);\n\n // #############################################################################\n // Handle load complete\n // #############################################################################\n const handleOnLoadComplete = useCallback(\n (event) => {\n // Remove loading for specific image if loaded src and provided src matches\n // Fallback - if no event or src provided, then set to loading=false\n if (\n !event?.currentTarget?.src ||\n event.currentTarget.src === asset?.src\n ) {\n setLoading(false);\n setError(false);\n }\n },\n [asset?.src],\n );\n\n // #############################################################################\n // Handle click on image for fullscreen\n // #############################################################################\n const handleFullscreenClick = useCallback(() => {\n if (canFullscreen && asset && !error && !loading && !isFullscreen) {\n setFullscreen(true);\n }\n }, [asset, canFullscreen, error, isFullscreen, loading]);\n\n // #############################################################################\n // Handle Escape button press to close fullscreen\n // #############################################################################\n useEffect(() => {\n if (!canFullscreen) {\n return;\n }\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n setFullscreen(false);\n }\n };\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown);\n };\n }, [canFullscreen]);\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <S.ImageWrapOuter className={className} $responsive={responsive}>\n <S.ImageWrap\n margin={margin}\n layout={layout}\n $sizes={sizes}\n $objectFit={objectFit}\n ref={wrapRef}\n $clickable={\n canFullscreen && asset && !error && !loading && !isFullscreen\n }\n onClick={handleFullscreenClick}\n >\n {asset && !error ? (\n (renderImage?.({\n src: asset.src,\n alt: asset.alt,\n // Don't pass width and height to next/image if layout is \"fill\"\n height: layout !== \"fill\" ? asset.height : undefined,\n width: layout !== \"fill\" ? asset.width : undefined,\n onLoadingComplete: handleOnLoadingComplete,\n onLoad: handleOnLoadComplete,\n onError: handleOnError,\n sizes,\n layout,\n priority,\n objectFit,\n }) ??\n renderNativeImage({\n ...asset,\n onLoad: handleOnLoadingComplete,\n onError: handleOnError,\n }))\n ) : (\n <S.FallbackImageWrap\n margin={margin}\n fallbackImageSize={fallbackImageSize}\n >\n <img\n src={\n typeof FallbackImageIcon === \"string\"\n ? FallbackImageIcon\n : FallbackImageIcon.src\n }\n alt=\"Fallback\"\n />\n </S.FallbackImageWrap>\n )}\n </S.ImageWrap>\n\n {!disableSkeleton && loading && asset && !error && (\n <S.ImageSkeletonLoader\n $responsive={responsive}\n motif={motif}\n disableBorderRadius={disableBorderRadius}\n />\n )}\n\n {canFullscreen &&\n isFullscreen &&\n asset &&\n !error &&\n createPortal(\n <S.FullscreenImageWrap>\n {renderImage?.({\n src: asset.src,\n alt: asset.alt,\n height: layout !== \"fill\" ? asset.height : undefined,\n width: layout !== \"fill\" ? asset.width : undefined,\n sizes,\n layout,\n priority,\n objectFit,\n }) ?? renderNativeImage(asset)}\n <S.FullscreenCloseButton onClick={() => setFullscreen(false)}>\n <StyleableSvgImage src={CloseIcon} width={14} height={14} />\n </S.FullscreenCloseButton>\n </S.FullscreenImageWrap>,\n document.body,\n )}\n {canFullscreen && asset && !error && !loading && !isFullscreen && (\n <S.FullscreenButton onClick={handleFullscreenClick}>\n <S.ZoomIcon src={ZoomInIcon} width={32} height={32} />\n </S.FullscreenButton>\n )}\n </S.ImageWrapOuter>\n );\n};\n"],"names":["isNextImageLoading","imageEl","src","includes","complete","asset","width","height","renderNativeImage","alt","onLoad","onError","jsx","CustomImage","CustomImage2","motif","DEFAULT_MOTIF","sizes","className","margin","priority","fallbackImageSize","responsive","layout","renderImage","disableSkeleton","objectFit","disableBorderRadius","canFullscreen","onFullscreenChange","loading","setLoading","useState","error","setError","isFullscreen","setFullscreen","useLockBodyScroll","useEffect","wrapRef","useRef","current","querySelector","loadingInitial","handleOnError","useCallback","handleOnLoadingComplete","handleOnLoadComplete","event","currentTarget","handleFullscreenClick","handleKeyDown","e","key","document","addEventListener","removeEventListener","S.ImageWrapOuter","$responsive","children","S.ImageWrap","ImageWrap","$sizes","$objectFit","ref","$clickable","onClick","onLoadingComplete","S.FallbackImageWrap","FallbackImageWrap","FallbackImageIcon","S.ImageSkeletonLoader","ImageSkeletonLoader","createPortal","jsxs","S.FullscreenImageWrap","S.FullscreenCloseButton","FullscreenCloseButton","StyleableSvgImage","CloseIcon","body","S.FullscreenButton","S.ZoomIcon","ZoomInIcon"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAMA,kBAAA,GAAsBC,OAA8B,IAAA;EACxD;IAAA;IAEE,CAACA,OAAQ,CAAAC,GAAA;IAAA;IAAA;IAGTD,OAAA,CAAQC,GAAI,CAAAC,QAAA,CAAS,uBAAuB,CAAA;IAAA;IAE5C,CAACF,OAAQ,CAAAG;EAAA;AAEb,CAAA;AAGO,MAAMC,KAAQ,GAAAA,CACnBA,MACA,EAAAC,KAAA,EACAC,MACI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,CAAAA,GAAA,CAACkE;UAAkB5E,GAAK,EAAA6E,kBAAAA,CAAAA,SAAAA,CAAA;UAAWzE,OAAO,EAAI;UAAAC,MAAA,EAAQ;QAAI,CAAA;OAC5D,CAAA;KACF,CAAA,EACA+C,QAAS,CAAA0B,IACX,CAAA,EACDpD,aAAA,IAAiBvB,MAAS,IAAA,CAAC4B,KAAS,IAAA,CAACH,WAAW,CAACK,YAAA,mBAC/CvB,UAAA,CAAAA,GAAA,CAAAqE,mCAAA,EAAA;MAAmBf,SAAShB,qBAC3B;MAAAS,QAAA,EAAA,eAAA/C,cAAA,CAACsE,kBAAAA,CAAAA,QAAE,EAAF;QAAWhF,GAAA,EAAKiF;QAAY7E,KAAO,EAAA,EAAA;QAAIC,MAAQ,EAAA;MAAI,CAAA;KACtD,CAAA;EAEJ,CAAA,CAAA;AAEJ,CAAA;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CustomImage.mjs","sources":["../../../src/components/CustomImage/CustomImage.tsx"],"sourcesContent":["/* eslint-disable @next/next/no-img-element */\n/**\n * Creates a centered optimized image with a skeleton loader and\n * fallback image if galleryImage undefined or onError\n */\n\nimport type { StaticImageData } from \"next/image\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { useLockBodyScroll } from \"react-use\";\n\nimport FallbackImageIcon from \"../../assets/icons/fallbackImage.svg\";\nimport ZoomInIcon from \"../../assets/icons/zoom-in.svg\";\nimport CloseIcon from \"../../constants/icons/generic/close.svg\";\nimport { DEFAULT_MOTIF } from \"../../constants/theme\";\nimport { StyleableSvgImage } from \"../StyleableSvgImage\";\nimport * as S from \"./CustomImage.styles\";\nimport type { CustomImageProps, RenderImageProps } from \"./CustomImage.types\";\n\nconst isNextImageLoading = (imageEl: HTMLImageElement) => {\n return (\n // Loading if no src found\n !imageEl.src ||\n // Loading if next placeholder is found\n /** @see https://github.com/vercel/next.js/issues/18398#issuecomment-850251992 */\n imageEl.src.includes(\"data:image/gif;base64\") ||\n // Loading if somehow the replaced actual image is not completely loaded\n !imageEl.complete\n );\n};\n\n// Get asset object for CustomImage from image imports\nexport const asset = (\n asset: string | StaticImageData,\n width: number,\n height: number,\n) => ({\n src: typeof asset === \"string\" ? asset : asset.src,\n width,\n height,\n});\n\nexport const renderNativeImage = ({\n src,\n height,\n width,\n alt,\n onLoad,\n onError,\n}: RenderImageProps) => (\n <img\n src={src}\n height={height}\n width={width}\n alt={alt ?? \"\"}\n onLoad={onLoad}\n onError={onError}\n />\n);\n\nexport const CustomImage = function CustomImage({\n motif = DEFAULT_MOTIF,\n asset,\n sizes,\n className,\n margin,\n priority = false,\n fallbackImageSize = \"medium\",\n responsive,\n layout = \"responsive\",\n renderImage,\n disableSkeleton,\n objectFit,\n disableBorderRadius,\n canFullscreen,\n onFullscreenChange,\n}: CustomImageProps) {\n // #############################################################################\n // States\n // #############################################################################\n const [loading, setLoading] = useState(\n // Set as loading by default, handle not loading in the effect\n true,\n );\n const [error, setError] = useState(false);\n const [isFullscreen, setFullscreen] = useState(false);\n\n // #############################################################################\n // Lock body when fullscreen is open\n // #############################################################################\n useLockBodyScroll(isFullscreen);\n\n // #############################################################################\n // Call onFullscreenChange callback when isFullscreen changes\n // #############################################################################\n useEffect(() => {\n if (canFullscreen && onFullscreenChange) {\n onFullscreenChange(isFullscreen);\n }\n }, [canFullscreen, isFullscreen, onFullscreenChange]);\n\n // #############################################################################\n // Element refs and handling\n // #############################################################################\n const wrapRef = useRef<HTMLDivElement>(null);\n\n // Set initial loading based on the asset\n useEffect(() => {\n // Skip if not set\n if (!wrapRef.current) return;\n\n // Find image\n const imageEl = wrapRef.current.querySelector(\"img\");\n\n // Skip if not found\n if (!imageEl) return;\n\n // Set state based on complete status\n const loadingInitial = isNextImageLoading(imageEl);\n\n setLoading(loadingInitial);\n setError(false);\n }, []);\n\n // #############################################################################\n // Handle error\n // #############################################################################\n const handleOnError = useCallback(() => {\n setError(true);\n }, []);\n\n // #############################################################################\n // Handle loading complete\n // Used for NextJS images\n // #############################################################################\n const handleOnLoadingComplete = useCallback(() => {\n setLoading(false);\n setError(false);\n }, []);\n\n // #############################################################################\n // Handle load complete\n // #############################################################################\n const handleOnLoadComplete = useCallback(\n (event) => {\n // Remove loading for specific image if loaded src and provided src matches\n // Fallback - if no event or src provided, then set to loading=false\n if (\n !event?.currentTarget?.src ||\n event.currentTarget.src === asset?.src\n ) {\n setLoading(false);\n setError(false);\n }\n },\n [asset?.src],\n );\n\n // #############################################################################\n // Handle click on image for fullscreen\n // #############################################################################\n const handleFullscreenClick = useCallback(() => {\n if (canFullscreen && asset && !error && !loading && !isFullscreen) {\n setFullscreen(true);\n }\n }, [asset, canFullscreen, error, isFullscreen, loading]);\n\n // #############################################################################\n // Handle Escape button press to close fullscreen\n // #############################################################################\n useEffect(() => {\n if (!canFullscreen) {\n return;\n }\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n setFullscreen(false);\n }\n };\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown);\n };\n }, [canFullscreen]);\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <S.ImageWrapOuter className={className} $responsive={responsive}>\n <S.ImageWrap\n margin={margin}\n layout={layout}\n $sizes={sizes}\n $objectFit={objectFit}\n ref={wrapRef}\n $clickable={\n canFullscreen && asset && !error && !loading && !isFullscreen\n }\n onClick={handleFullscreenClick}\n >\n {asset && !error ? (\n renderImage?.({\n src: asset.src,\n alt: asset.alt,\n // Don't pass width and height to next/image if layout is \"fill\"\n height: layout !== \"fill\" ? asset.height : undefined,\n width: layout !== \"fill\" ? asset.width : undefined,\n onLoadingComplete: handleOnLoadingComplete,\n onLoad: handleOnLoadComplete,\n onError: handleOnError,\n sizes,\n layout,\n priority,\n objectFit,\n }) ??\n renderNativeImage({\n ...asset,\n onLoad: handleOnLoadingComplete,\n onError: handleOnError,\n })\n ) : (\n <S.FallbackImageWrap\n margin={margin}\n fallbackImageSize={fallbackImageSize}\n >\n <img\n src={\n typeof FallbackImageIcon === \"string\"\n ? FallbackImageIcon\n : FallbackImageIcon.src\n }\n alt=\"Fallback\"\n />\n </S.FallbackImageWrap>\n )}\n </S.ImageWrap>\n\n {!disableSkeleton && loading && asset && !error && (\n <S.ImageSkeletonLoader\n $responsive={responsive}\n motif={motif}\n disableBorderRadius={disableBorderRadius}\n />\n )}\n\n {canFullscreen &&\n isFullscreen &&\n asset &&\n !error &&\n createPortal(\n <S.FullscreenImageWrap>\n {renderImage?.({\n src: asset.src,\n alt: asset.alt,\n height: layout !== \"fill\" ? asset.height : undefined,\n width: layout !== \"fill\" ? asset.width : undefined,\n sizes,\n layout,\n priority,\n objectFit,\n }) ?? renderNativeImage(asset)}\n <S.FullscreenCloseButton onClick={() => setFullscreen(false)}>\n <StyleableSvgImage src={CloseIcon} width={14} height={14} />\n </S.FullscreenCloseButton>\n </S.FullscreenImageWrap>,\n document.body,\n )}\n {canFullscreen && asset && !error && !loading && !isFullscreen && (\n <S.FullscreenButton onClick={handleFullscreenClick}>\n <S.ZoomIcon src={ZoomInIcon} width={32} height={32} />\n </S.FullscreenButton>\n )}\n </S.ImageWrapOuter>\n );\n};\n"],"names":["isNextImageLoading","imageEl","src","includes","complete","asset","width","height","renderNativeImage","alt","onLoad","onError","jsx","CustomImage","CustomImage2","motif","DEFAULT_MOTIF","sizes","className","margin","priority","fallbackImageSize","responsive","layout","renderImage","disableSkeleton","objectFit","disableBorderRadius","canFullscreen","onFullscreenChange","loading","setLoading","useState","error","setError","isFullscreen","setFullscreen","useLockBodyScroll","useEffect","wrapRef","useRef","current","querySelector","loadingInitial","handleOnError","useCallback","handleOnLoadingComplete","handleOnLoadComplete","event","currentTarget","handleFullscreenClick","handleKeyDown","e","key","document","addEventListener","removeEventListener","S.ImageWrapOuter","$responsive","children","S.ImageWrap","$sizes","$objectFit","ref","$clickable","onClick","onLoadingComplete","S.FallbackImageWrap","FallbackImageIcon","S.ImageSkeletonLoader","createPortal","jsxs","S.FullscreenImageWrap","S.FullscreenCloseButton","StyleableSvgImage","CloseIcon","body","S.FullscreenButton","S.ZoomIcon","ZoomInIcon"],"mappings":";;;;;;;;;;;;;;;AAmBA,MAAMA,kBAAA,GAAsBC,OAA8B,IAAA;EACxD;IAAA;IAEE,CAACA,OAAQ,CAAAC,GAAA;IAAA;IAAA;IAGTD,OAAA,CAAQC,GAAI,CAAAC,QAAA,CAAS,uBAAuB,CAAA;IAAA;IAE5C,CAACF,OAAQ,CAAAG;EAAA;AAEb,CAAA;AAGO,MAAMC,KAAQ,GAAAA,CACnBA,MACA,EAAAC,KAAA,EACAC,MACI,MAAA;EACJL,GAAK,EAAA,OAAOG,MAAU,KAAA,QAAA,GAAWA,SAAQA,MAAM,CAAAH,GAAA;EAC/CI,KAAA;EACAC;AACF,CAAA,CAAA;AAEO,MAAMC,oBAAoBA,CAAC;EAChCN,GAAA;EACAK,MAAA;EACAD,KAAA;EACAG,GAAA;EACAC,MAAA;EACAC;AACF,CACE,oBAAAC,GAAA,CAAC,KAAA,EAAA;EACCV,GAAA;EACAK,MAAA;EACAD,KAAA;EACAG,KAAKA,GAAO,IAAA,EAAA;EACZC,MAAA;EACAC;AAAA,CACF,CAAA;AAGW,MAAAE,WAAA,GAAc,SAASA,YAAYC,CAAA;EAC9CC,KAAQ,GAAAC,aAAA;EACRX,KAAAA,EAAAA,MAAAA;EACAY,KAAA;EACAC,SAAA;EACAC,MAAA;EACAC,QAAW,GAAA,KAAA;EACXC,iBAAoB,GAAA,QAAA;EACpBC,UAAA;EACAC,MAAS,GAAA,YAAA;EACTC,WAAA;EACAC,eAAA;EACAC,SAAA;EACAC,mBAAA;EACAC,aAAA;EACAC;AACF,CAAqB,EAAA;EAIb,MAAA,CAACC,OAAS,EAAAC,UAAU,CAAI,GAAAC,QAAA;EAAA;EAE5B,IAAA,CACF;EACA,MAAM,CAACC,KAAA,EAAOC,QAAQ,CAAA,GAAIF,SAAS,KAAK,C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A,CAAA,KAAM7B,aAAc,CAAA,KAAK,CACzD;QAAAuB,QAAA,iBAAA/C,GAAA,CAAC8D;UAAkBxE,GAAK,EAAAyE,kBAAA;UAAWrE,OAAO,EAAI;UAAAC,MAAA,EAAQ;QAAI,CAAA;OAC5D,CAAA;KACF,CAAA,EACA+C,QAAS,CAAAsB,IACX,CAAA,EACDhD,aAAA,IAAiBvB,MAAS,IAAA,CAAC4B,KAAS,IAAA,CAACH,WAAW,CAACK,YAAA,mBAC/CvB,GAAA,CAAAiE,gBAAA,EAAA;MAAmBZ,SAASf,qBAC3B;MAAAS,QAAA,EAAA,eAAA/C,GAAA,CAACkE,QAAE,EAAF;QAAW5E,GAAA,EAAK6E;QAAYzE,KAAO,EAAA,EAAA;QAAIC,MAAQ,EAAA;MAAI,CAAA;KACtD,CAAA;EAEJ,CAAA,CAAA;AAEJ,CAAA;"}
|
|
1
|
+
{"version":3,"file":"CustomImage.mjs","sources":["../../../src/components/CustomImage/CustomImage.tsx"],"sourcesContent":["/* eslint-disable @next/next/no-img-element */\n/**\n * Creates a centered optimized image with a skeleton loader and\n * fallback image if galleryImage undefined or onError\n */\n\nimport type { StaticImageData } from \"next/image\";\nimport { useCallback, useEffect, useRef, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { useLockBodyScroll } from \"react-use\";\n\nimport FallbackImageIcon from \"../../assets/icons/fallbackImage.svg\";\nimport ZoomInIcon from \"../../assets/icons/zoom-in.svg\";\nimport CloseIcon from \"../../constants/icons/generic/close.svg\";\nimport { DEFAULT_MOTIF } from \"../../constants/theme\";\nimport { StyleableSvgImage } from \"../StyleableSvgImage\";\nimport * as S from \"./CustomImage.styles\";\nimport type { CustomImageProps, RenderImageProps } from \"./CustomImage.types\";\n\nconst isNextImageLoading = (imageEl: HTMLImageElement) => {\n return (\n // Loading if no src found\n !imageEl.src ||\n // Loading if next placeholder is found\n /** @see https://github.com/vercel/next.js/issues/18398#issuecomment-850251992 */\n imageEl.src.includes(\"data:image/gif;base64\") ||\n // Loading if somehow the replaced actual image is not completely loaded\n !imageEl.complete\n );\n};\n\n// Get asset object for CustomImage from image imports\nexport const asset = (\n asset: string | StaticImageData,\n width: number,\n height: number,\n) => ({\n src: typeof asset === \"string\" ? asset : asset.src,\n width,\n height,\n});\n\nexport const renderNativeImage = ({\n src,\n height,\n width,\n alt,\n onLoad,\n onError,\n}: RenderImageProps) => (\n <img\n src={src}\n height={height}\n width={width}\n alt={alt ?? \"\"}\n onLoad={onLoad}\n onError={onError}\n />\n);\n\nexport const CustomImage = function CustomImage({\n motif = DEFAULT_MOTIF,\n asset,\n sizes,\n className,\n margin,\n priority = false,\n fallbackImageSize = \"medium\",\n responsive,\n layout = \"responsive\",\n renderImage,\n disableSkeleton,\n objectFit,\n disableBorderRadius,\n canFullscreen,\n onFullscreenChange,\n}: CustomImageProps) {\n // #############################################################################\n // States\n // #############################################################################\n const [loading, setLoading] = useState(\n // Set as loading by default, handle not loading in the effect\n true,\n );\n const [error, setError] = useState(false);\n const [isFullscreen, setFullscreen] = useState(false);\n\n // #############################################################################\n // Lock body when fullscreen is open\n // #############################################################################\n useLockBodyScroll(isFullscreen);\n\n // #############################################################################\n // Call onFullscreenChange callback when isFullscreen changes\n // #############################################################################\n useEffect(() => {\n if (canFullscreen && onFullscreenChange) {\n onFullscreenChange(isFullscreen);\n }\n }, [canFullscreen, isFullscreen, onFullscreenChange]);\n\n // #############################################################################\n // Element refs and handling\n // #############################################################################\n const wrapRef = useRef<HTMLDivElement>(null);\n\n // Set initial loading based on the asset\n useEffect(() => {\n // Skip if not set\n if (!wrapRef.current) return;\n\n // Find image\n const imageEl = wrapRef.current.querySelector(\"img\");\n\n // Skip if not found\n if (!imageEl) return;\n\n // Set state based on complete status\n const loadingInitial = isNextImageLoading(imageEl);\n\n setLoading(loadingInitial);\n setError(false);\n }, []);\n\n // #############################################################################\n // Handle error\n // #############################################################################\n const handleOnError = useCallback(() => {\n setError(true);\n }, []);\n\n // #############################################################################\n // Handle loading complete\n // Used for NextJS images\n // #############################################################################\n const handleOnLoadingComplete = useCallback(() => {\n setLoading(false);\n setError(false);\n }, []);\n\n // #############################################################################\n // Handle load complete\n // #############################################################################\n const handleOnLoadComplete = useCallback(\n (event) => {\n // Remove loading for specific image if loaded src and provided src matches\n // Fallback - if no event or src provided, then set to loading=false\n if (\n !event?.currentTarget?.src ||\n event.currentTarget.src === asset?.src\n ) {\n setLoading(false);\n setError(false);\n }\n },\n [asset?.src],\n );\n\n // #############################################################################\n // Handle click on image for fullscreen\n // #############################################################################\n const handleFullscreenClick = useCallback(() => {\n if (canFullscreen && asset && !error && !loading && !isFullscreen) {\n setFullscreen(true);\n }\n }, [asset, canFullscreen, error, isFullscreen, loading]);\n\n // #############################################################################\n // Handle Escape button press to close fullscreen\n // #############################################################################\n useEffect(() => {\n if (!canFullscreen) {\n return;\n }\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === \"Escape\") {\n setFullscreen(false);\n }\n };\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown);\n };\n }, [canFullscreen]);\n\n // #############################################################################\n // Render\n // #############################################################################\n return (\n <S.ImageWrapOuter className={className} $responsive={responsive}>\n <S.ImageWrap\n margin={margin}\n layout={layout}\n $sizes={sizes}\n $objectFit={objectFit}\n ref={wrapRef}\n $clickable={\n canFullscreen && asset && !error && !loading && !isFullscreen\n }\n onClick={handleFullscreenClick}\n >\n {asset && !error ? (\n (renderImage?.({\n src: asset.src,\n alt: asset.alt,\n // Don't pass width and height to next/image if layout is \"fill\"\n height: layout !== \"fill\" ? asset.height : undefined,\n width: layout !== \"fill\" ? asset.width : undefined,\n onLoadingComplete: handleOnLoadingComplete,\n onLoad: handleOnLoadComplete,\n onError: handleOnError,\n sizes,\n layout,\n priority,\n objectFit,\n }) ??\n renderNativeImage({\n ...asset,\n onLoad: handleOnLoadingComplete,\n onError: handleOnError,\n }))\n ) : (\n <S.FallbackImageWrap\n margin={margin}\n fallbackImageSize={fallbackImageSize}\n >\n <img\n src={\n typeof FallbackImageIcon === \"string\"\n ? FallbackImageIcon\n : FallbackImageIcon.src\n }\n alt=\"Fallback\"\n />\n </S.FallbackImageWrap>\n )}\n </S.ImageWrap>\n\n {!disableSkeleton && loading && asset && !error && (\n <S.ImageSkeletonLoader\n $responsive={responsive}\n motif={motif}\n disableBorderRadius={disableBorderRadius}\n />\n )}\n\n {canFullscreen &&\n isFullscreen &&\n asset &&\n !error &&\n createPortal(\n <S.FullscreenImageWrap>\n {renderImage?.({\n src: asset.src,\n alt: asset.alt,\n height: layout !== \"fill\" ? asset.height : undefined,\n width: layout !== \"fill\" ? asset.width : undefined,\n sizes,\n layout,\n priority,\n objectFit,\n }) ?? renderNativeImage(asset)}\n <S.FullscreenCloseButton onClick={() => setFullscreen(false)}>\n <StyleableSvgImage src={CloseIcon} width={14} height={14} />\n </S.FullscreenCloseButton>\n </S.FullscreenImageWrap>,\n document.body,\n )}\n {canFullscreen && asset && !error && !loading && !isFullscreen && (\n <S.FullscreenButton onClick={handleFullscreenClick}>\n <S.ZoomIcon src={ZoomInIcon} width={32} height={32} />\n </S.FullscreenButton>\n )}\n </S.ImageWrapOuter>\n );\n};\n"],"names":["isNextImageLoading","imageEl","src","includes","complete","asset","width","height","renderNativeImage","alt","onLoad","onError","jsx","CustomImage","CustomImage2","motif","DEFAULT_MOTIF","sizes","className","margin","priority","fallbackImageSize","responsive","layout","renderImage","disableSkeleton","objectFit","disableBorderRadius","canFullscreen","onFullscreenChange","loading","setLoading","useState","error","setError","isFullscreen","setFullscreen","useLockBodyScroll","useEffect","wrapRef","useRef","current","querySelector","loadingInitial","handleOnError","useCallback","handleOnLoadingComplete","handleOnLoadComplete","event","currentTarget","handleFullscreenClick","handleKeyDown","e","key","document","addEventListener","removeEventListener","S.ImageWrapOuter","$responsive","children","S.ImageWrap","$sizes","$objectFit","ref","$clickable","onClick","onLoadingComplete","S.FallbackImageWrap","FallbackImageIcon","S.ImageSkeletonLoader","createPortal","jsxs","S.FullscreenImageWrap","S.FullscreenCloseButton","StyleableSvgImage","CloseIcon","body","S.FullscreenButton","S.ZoomIcon","ZoomInIcon"],"mappings":";;;;;;;;;;;;;;;AAmBA,MAAMA,kBAAA,GAAsBC,OAA8B,IAAA;EACxD;IAAA;IAEE,CAACA,OAAQ,CAAAC,GAAA;IAAA;IAAA;IAGTD,OAAA,CAAQC,GAAI,CAAAC,QAAA,CAAS,uBAAuB,CAAA;IAAA;IAE5C,CAACF,OAAQ,CAAAG;EAAA;AAEb,CAAA;AAGO,MAAMC,KAAQ,GAAAA,CACnBA,MACA,EAAAC,KAAA,EACAC,MACI,MAAA;EACJL,GAAK,EAAA,OAAOG,MAAU,KAAA,QAAA,GAAWA,SAAQA,MAAM,CAAAH,GAAA;EAC/CI,KAAA;EACAC;AACF,CAAA,CAAA;AAEO,MAAMC,oBAAoBA,CAAC;EAChCN,GAAA;EACAK,MAAA;EACAD,KAAA;EACAG,GAAA;EACAC,MAAA;EACAC;AACF,CACE,oBAAAC,GAAA,CAAC,KAAA,EAAA;EACCV,GAAA;EACAK,MAAA;EACAD,KAAA;EACAG,KAAKA,GAAO,IAAA,EAAA;EACZC,MAAA;EACAC;AAAA,CACF,CAAA;AAGW,MAAAE,WAAA,GAAc,SAASA,YAAYC,CAAA;EAC9CC,KAAQ,GAAAC,aAAA;EACRX,KAAAA,EAAAA,MAAAA;EACAY,KAAA;EACAC,SAAA;EACAC,MAAA;EACAC,QAAW,GAAA,KAAA;EACXC,iBAAoB,GAAA,QAAA;EACpBC,UAAA;EACAC,MAAS,GAAA,YAAA;EACTC,WAAA;EACAC,eAAA;EACAC,SAAA;EACAC,mBAAA;EACAC,aAAA;EACAC;AACF,CAAqB,EAAA;EAIb,MAAA,CAACC,OAAS,EAAAC,UAAU,CAAI,GAAAC,QAAA;EAAA;EAE5B,IAAA,CACF;EACA,MAAM,CAACC,KAAA,EAAOC,QAAQ,CAAA,GAAIF,SAAS,KAAK,CAAA;EACxC,MAA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B,aAAc,CAAA,KAAK,CACzD;QAAAuB,QAAA,iBAAA/C,GAAA,CAAC8D;UAAkBxE,GAAK,EAAAyE,kBAAA;UAAWrE,OAAO,EAAI;UAAAC,MAAA,EAAQ;QAAI,CAAA;OAC5D,CAAA;KACF,CAAA,EACA+C,QAAS,CAAAsB,IACX,CAAA,EACDhD,aAAA,IAAiBvB,MAAS,IAAA,CAAC4B,KAAS,IAAA,CAACH,WAAW,CAACK,YAAA,mBAC/CvB,GAAA,CAAAiE,gBAAA,EAAA;MAAmBZ,SAASf,qBAC3B;MAAAS,QAAA,EAAA,eAAA/C,GAAA,CAACkE,QAAE,EAAF;QAAW5E,GAAA,EAAK6E;QAAYzE,KAAO,EAAA,EAAA;QAAIC,MAAQ,EAAA;MAAI,CAAA;KACtD,CAAA;EAEJ,CAAA,CAAA;AAEJ,CAAA;"}
|
|
@@ -14,7 +14,7 @@ var FeaturesSection_styles = require('./FeaturesSection.styles.js');
|
|
|
14
14
|
var useLockBodyScrollCustom = require('../../hooks/useLockBodyScrollCustom.js');
|
|
15
15
|
var Container = require('../Container/Container.js');
|
|
16
16
|
var StyleableSvgImage = require('../StyleableSvgImage/StyleableSvgImage.js');
|
|
17
|
-
var CloseSvg = require("../../assets/
|
|
17
|
+
var CloseSvg = require("../../assets/close2.svg");
|
|
18
18
|
function _interopDefault(e) {
|
|
19
19
|
return e && e.__esModule ? e : {
|
|
20
20
|
default: e
|
|
@@ -12,7 +12,7 @@ import { WrapOuter, OverlayWrap, OverlayClose, Wrap, MetaWrap, SubHeading, Headi
|
|
|
12
12
|
import { useLockBodyScrollCustom } from '../../hooks/useLockBodyScrollCustom.mjs';
|
|
13
13
|
import { Container } from '../Container/Container.mjs';
|
|
14
14
|
import { StyleableSvgImage } from '../StyleableSvgImage/StyleableSvgImage.mjs';
|
|
15
|
-
import CloseSvg__default from "../../assets/
|
|
15
|
+
import CloseSvg__default from "../../assets/close2.svg";
|
|
16
16
|
"use strict";
|
|
17
17
|
const FEATURES_DEFAULT_PLAYBACK = 500;
|
|
18
18
|
const parseTime = time => parseFloat(time.toFixed(3));
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from "../../../assets/
|
|
2
|
-
export { default } from "../../../assets/
|
|
1
|
+
export * from "../../../assets/close2.svg";
|
|
2
|
+
export { default } from "../../../assets/close2.svg";
|
|
3
3
|
//# sourceMappingURL=close.svg.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"megaphone.http.service.js","sources":["../../../../src/components/Header/AccountMenu/megaphone.http.service.ts"],"sourcesContent":["export interface AnnouncementsResponse {\n data: Announcement[];\n pagination: BasePagination;\n}\n\nexport interface Announcement {\n announcementId: string;\n description: string;\n externalLink: string;\n isRead: boolean;\n title: string;\n media?: {\n image?: string;\n };\n}\n\nexport interface BasePagination {\n hasMore: boolean;\n offset: number;\n total: number;\n}\n\nexport default class MegaphoneHttpService {\n protected baseUrl: string;\n protected announcementsBasePath: string;\n\n constructor(baseUrl: string) {\n this.baseUrl = baseUrl;\n this.announcementsBasePath = \"/v1/announcements\";\n }\n\n private get announcementsUrl() {\n return `${this.baseUrl}${this.announcementsBasePath}`;\n }\n\n public getAnnouncements = async (): Promise<AnnouncementsResponse> => {\n try {\n const response = await fetch(this.announcementsUrl, {\n credentials: \"include\",\n });\n\n return response.json();\n } catch {\n return { data: [], pagination: { total: 0, offset: 0, hasMore: false } };\n }\n };\n\n public markAsRead = async (id: string) => {\n try {\n const response = await fetch(`${this.announcementsUrl}/${id}/read`, {\n credentials: \"include\",\n method: \"PATCH\",\n });\n\n if (!response?.ok) {\n throw new Error(response.statusText);\n }\n\n return await Promise.resolve();\n } catch (error) {\n throw new Error(\"Failed to mark announcement as read\");\n }\n };\n}\n"],"names":["MegaphoneHttpService","constructor","baseUrl","__publicField","response","fetch","announcementsUrl","credentials","json","data","pagination","total","offset","hasMore","id","method","ok","Error","statusText","Promise","resolve","error","announcementsBasePath"],"mappings":";;;;;;;;;;;;;;;;;AAsBA,MAAqBA,oBAAqB,CAAA;EAIxCC,YAAYC,OAAiB,EAAA;IAHnBC,aAAA,CAAA,IAAA,EAAA,SAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,uBAAA,CAAA;IAWVA,aAAA,CAAA,IAAA,EAAO,oBAAmB,YAA4C;MAChE,IAAA;QACF,MAAMC,QAAW,GAAA,MAAMC,KAAM,CAAA,IAAA,CAAKC,gBAAkB,EAAA;UAClDC,WAAa,EAAA;QAAA,CACd,CAAA;
|
|
1
|
+
{"version":3,"file":"megaphone.http.service.js","sources":["../../../../src/components/Header/AccountMenu/megaphone.http.service.ts"],"sourcesContent":["export interface AnnouncementsResponse {\n data: Announcement[];\n pagination: BasePagination;\n}\n\nexport interface Announcement {\n announcementId: string;\n description: string;\n externalLink: string;\n isRead: boolean;\n title: string;\n media?: {\n image?: string;\n };\n}\n\nexport interface BasePagination {\n hasMore: boolean;\n offset: number;\n total: number;\n}\n\nexport default class MegaphoneHttpService {\n protected baseUrl: string;\n protected announcementsBasePath: string;\n\n constructor(baseUrl: string) {\n this.baseUrl = baseUrl;\n this.announcementsBasePath = \"/v1/announcements\";\n }\n\n private get announcementsUrl() {\n return `${this.baseUrl}${this.announcementsBasePath}`;\n }\n\n public getAnnouncements = async (): Promise<AnnouncementsResponse> => {\n try {\n const response = await fetch(this.announcementsUrl, {\n credentials: \"include\",\n });\n\n return await response.json();\n } catch {\n return { data: [], pagination: { total: 0, offset: 0, hasMore: false } };\n }\n };\n\n public markAsRead = async (id: string) => {\n try {\n const response = await fetch(`${this.announcementsUrl}/${id}/read`, {\n credentials: \"include\",\n method: \"PATCH\",\n });\n\n if (!response?.ok) {\n throw new Error(response.statusText);\n }\n\n return await Promise.resolve();\n } catch (error) {\n throw new Error(\"Failed to mark announcement as read\");\n }\n };\n}\n"],"names":["MegaphoneHttpService","constructor","baseUrl","__publicField","response","fetch","announcementsUrl","credentials","json","data","pagination","total","offset","hasMore","id","method","ok","Error","statusText","Promise","resolve","error","announcements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}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"megaphone.http.service.mjs","sources":["../../../../src/components/Header/AccountMenu/megaphone.http.service.ts"],"sourcesContent":["export interface AnnouncementsResponse {\n data: Announcement[];\n pagination: BasePagination;\n}\n\nexport interface Announcement {\n announcementId: string;\n description: string;\n externalLink: string;\n isRead: boolean;\n title: string;\n media?: {\n image?: string;\n };\n}\n\nexport interface BasePagination {\n hasMore: boolean;\n offset: number;\n total: number;\n}\n\nexport default class MegaphoneHttpService {\n protected baseUrl: string;\n protected announcementsBasePath: string;\n\n constructor(baseUrl: string) {\n this.baseUrl = baseUrl;\n this.announcementsBasePath = \"/v1/announcements\";\n }\n\n private get announcementsUrl() {\n return `${this.baseUrl}${this.announcementsBasePath}`;\n }\n\n public getAnnouncements = async (): Promise<AnnouncementsResponse> => {\n try {\n const response = await fetch(this.announcementsUrl, {\n credentials: \"include\",\n });\n\n return response.json();\n } catch {\n return { data: [], pagination: { total: 0, offset: 0, hasMore: false } };\n }\n };\n\n public markAsRead = async (id: string) => {\n try {\n const response = await fetch(`${this.announcementsUrl}/${id}/read`, {\n credentials: \"include\",\n method: \"PATCH\",\n });\n\n if (!response?.ok) {\n throw new Error(response.statusText);\n }\n\n return await Promise.resolve();\n } catch (error) {\n throw new Error(\"Failed to mark announcement as read\");\n }\n };\n}\n"],"names":["MegaphoneHttpService","constructor","baseUrl","__publicField","response","fetch","announcementsUrl","credentials","json","data","pagination","total","offset","hasMore","id","method","ok","Error","statusText","Promise","resolve","error","announcementsBasePath"],"mappings":";;;;;;;;;;;;;AAsBA,MAAqBA,oBAAqB,CAAA;EAIxCC,YAAYC,OAAiB,EAAA;IAHnBC,aAAA,CAAA,IAAA,EAAA,SAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,uBAAA,CAAA;IAWVA,aAAA,CAAA,IAAA,EAAO,oBAAmB,YAA4C;MAChE,IAAA;QACF,MAAMC,QAAW,GAAA,MAAMC,KAAM,CAAA,IAAA,CAAKC,gBAAkB,EAAA;UAClDC,WAAa,EAAA;QAAA,CACd,CAAA;
|
|
1
|
+
{"version":3,"file":"megaphone.http.service.mjs","sources":["../../../../src/components/Header/AccountMenu/megaphone.http.service.ts"],"sourcesContent":["export interface AnnouncementsResponse {\n data: Announcement[];\n pagination: BasePagination;\n}\n\nexport interface Announcement {\n announcementId: string;\n description: string;\n externalLink: string;\n isRead: boolean;\n title: string;\n media?: {\n image?: string;\n };\n}\n\nexport interface BasePagination {\n hasMore: boolean;\n offset: number;\n total: number;\n}\n\nexport default class MegaphoneHttpService {\n protected baseUrl: string;\n protected announcementsBasePath: string;\n\n constructor(baseUrl: string) {\n this.baseUrl = baseUrl;\n this.announcementsBasePath = \"/v1/announcements\";\n }\n\n private get announcementsUrl() {\n return `${this.baseUrl}${this.announcementsBasePath}`;\n }\n\n public getAnnouncements = async (): Promise<AnnouncementsResponse> => {\n try {\n const response = await fetch(this.announcementsUrl, {\n credentials: \"include\",\n });\n\n return await response.json();\n } catch {\n return { data: [], pagination: { total: 0, offset: 0, hasMore: false } };\n }\n };\n\n public markAsRead = async (id: string) => {\n try {\n const response = await fetch(`${this.announcementsUrl}/${id}/read`, {\n credentials: \"include\",\n method: \"PATCH\",\n });\n\n if (!response?.ok) {\n throw new Error(response.statusText);\n }\n\n return await Promise.resolve();\n } catch (error) {\n throw new Error(\"Failed to mark announcement as read\");\n }\n };\n}\n"],"names":["MegaphoneHttpService","constructor","baseUrl","__publicField","response","fetch","announcementsUrl","credentials","json","data","pagination","total","offset","hasMore","id","method","ok","Error","statusText","Promise","resolve","error","announcementsBasePath"],"mappings":";;;;;;;;;;;;;AAsBA,MAAqBA,oBAAqB,CAAA;EAIxCC,YAAYC,OAAiB,EAAA;IAHnBC,aAAA,CAAA,IAAA,EAAA,SAAA,CAAA;IACAA,aAAA,CAAA,IAAA,EAAA,uBAAA,CAAA;IAWVA,aAAA,CAAA,IAAA,EAAO,oBAAmB,YAA4C;MAChE,IAAA;QACF,MAAMC,QAAW,GAAA,MAAMC,KAAM,CAAA,IAAA,CAAKC,gBAAkB,EAAA;UAClDC,WAAa,EAAA;QAAA,CACd,CAAA;QAEM,OAAA,MAAMH,SAASI,IAAK,EAAA;MAAA,CACrB,CAAA,MAAA;QACN,OAAO;UAAEC,IAAA,EAAM,EAAC;UAAGC,UAAY,EAAA;YAAEC,KAAO,EAAA,CAAA;YAAGC,MAAQ,EAAA,CAAA;YAAGC,OAAS,EAAA;UAAQ;QAAA,CAAA;MACzE;IAAA,CACF,CAAA;IAEOV,aAAA,CAAA,IAAA,EAAA,YAAA,EAAa,MAAOW,EAAe,IAAA;MACpC,IAAA;QACI,MAAAV,QAAA,GAAW,MAAMC,KAAM,CAAA,GAAG,KAAKC,gBAAgB,IAAIQ,EAAW,OAAA,EAAA;UAClEP,WAAa,EAAA,SAAA;UACbQ,MAAQ,EAAA;QAAA,CACT,CAAA;QAEG,IAAA,CAACX,UAAUY,EAAI,EAAA;UACX,MAAA,IAAIC,KAAM,CAAAb,QAAA,CAASc,UAAU,CAAA;QACrC;QAEO,OAAA,MAAMC,QAAQC,OAAQ,EAAA;eACtBC,KAAO,EAAA;QACR,MAAA,IAAIJ,MAAM,qCAAqC,CAAA;MACvD;IAAA,CACF,CAAA;IAnCE,IAAA,CAAKf,OAAU,GAAAA,OAAA;IACf,IAAA,CAAKoB,qBAAwB,GAAA,mBAAA;EAC/B;EAEA,IAAYhB,gBAAmBA,CAAA,EAAA;IAC7B,OAAU,GAAA,IAAA,CAAKJ,OAAO,GAAG,KAAKoB,qBAAqB,EAAA;EACrD;AA8BF;"}
|
|
@@ -2,6 +2,7 @@ import type { Motif } from "@ubnt/ui-components/utils";
|
|
|
2
2
|
import type { Language } from "../../contexts/MenuContext/mapping";
|
|
3
3
|
import type { ModalId, ParsedNavigationItem, ParsedNavigationSubItem, ParsedNavigationSubSubItem } from "../../contexts/MenuContext/types";
|
|
4
4
|
import type { Nullish, ProductLine } from "../../types";
|
|
5
|
+
import type { CategoryTabsProps } from "../CategoryTabs/CategoryTabs.types";
|
|
5
6
|
import type { CustomImageAsset, RenderImageFn } from "../CustomImage/CustomImage.types";
|
|
6
7
|
import type { NavigationMicrositeMenuProps } from "./Navigation/MicrositeMenu/MicrositeMenu.types";
|
|
7
8
|
import type { ProMobileMenuSectionItem } from "./Navigation/ProMobileMenu/ProMobileMenu.types";
|
|
@@ -48,6 +49,7 @@ export declare const defaultHeaderTranslations: {
|
|
|
48
49
|
upsellTitle: string;
|
|
49
50
|
};
|
|
50
51
|
language: {};
|
|
52
|
+
region: string;
|
|
51
53
|
};
|
|
52
54
|
export interface HeaderAccountCustomer {
|
|
53
55
|
id: string;
|
|
@@ -213,6 +215,10 @@ export interface ProHeaderEarlyAccess {
|
|
|
213
215
|
loading?: boolean;
|
|
214
216
|
onClick: () => void;
|
|
215
217
|
}
|
|
218
|
+
export interface HeaderProductLineOption {
|
|
219
|
+
value: ProductLine;
|
|
220
|
+
label: string;
|
|
221
|
+
}
|
|
216
222
|
export type ProHeaderProps = Pick<HeaderProps, "className" | "motif" | "cart" | "account" | "translations" | "onModalOpen" | "onCartClick" | "showLineLoader" | "accountMenu"> & {
|
|
217
223
|
/**
|
|
218
224
|
* Header customizations for embed context like WebView
|
|
@@ -223,10 +229,7 @@ export type ProHeaderProps = Pick<HeaderProps, "className" | "motif" | "cart" |
|
|
|
223
229
|
earlyAccess?: ProHeaderEarlyAccess;
|
|
224
230
|
handlePurchaseHistoryClick?: () => void;
|
|
225
231
|
handleOrderHistoryClick?: () => void;
|
|
226
|
-
productLineOptions?:
|
|
227
|
-
value: ProductLine;
|
|
228
|
-
label: string;
|
|
229
|
-
}[];
|
|
232
|
+
productLineOptions?: HeaderProductLineOption[];
|
|
230
233
|
productLineValue?: ProductLine;
|
|
231
234
|
handleProductLineChange?: (type: ProductLine) => void;
|
|
232
235
|
handleMobileMenuClick?: () => void;
|
|
@@ -236,4 +239,5 @@ export type ProHeaderProps = Pick<HeaderProps, "className" | "motif" | "cart" |
|
|
|
236
239
|
onSearchFocus?: () => void;
|
|
237
240
|
onSearchBlur?: () => void;
|
|
238
241
|
onSearchClick?: () => void;
|
|
242
|
+
inlineCategoryTabs?: CategoryTabsProps;
|
|
239
243
|
};
|
|
@@ -43,7 +43,8 @@ const defaultHeaderTranslations = {
|
|
|
43
43
|
itemsTitle: "Your Cart",
|
|
44
44
|
upsellTitle: "Usually bought together"
|
|
45
45
|
},
|
|
46
|
-
language: {}
|
|
46
|
+
language: {},
|
|
47
|
+
region: "Region"
|
|
47
48
|
};
|
|
48
49
|
exports.defaultHeaderTranslations = defaultHeaderTranslations;
|
|
49
50
|
//# sourceMappingURL=Header.types.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.types.js","sources":["../../../src/components/Header/Header.types.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\n\nimport type { Language } from \"../../contexts/MenuContext/mapping\";\nimport type {\n ModalId,\n ParsedNavigationItem,\n ParsedNavigationSubItem,\n ParsedNavigationSubSubItem,\n} from \"../../contexts/MenuContext/types\";\nimport type { Nullish, ProductLine } from \"../../types\";\nimport type {\n CustomImageAsset,\n RenderImageFn,\n} from \"../CustomImage/CustomImage.types\";\nimport type { NavigationMicrositeMenuProps } from \"./Navigation/MicrositeMenu/MicrositeMenu.types\";\nimport type { ProMobileMenuSectionItem } from \"./Navigation/ProMobileMenu/ProMobileMenu.types\";\n\nexport const defaultHeaderTranslations = {\n new: \"New\",\n support: \"Support\",\n purchasedProductHistory: \"Purchased Product History\",\n orderHistory: \"Order History\",\n earlyAccess: \"Early Access\",\n store: \"Store\",\n links: \"Links\",\n company: \"Company\",\n social: \"Social\",\n tools: \"Tools\",\n training: \"Training\",\n continueShopping: \"Continue Shopping\",\n search: {\n placeholder: \"Search...\",\n noMatchesFound: \"Sorry, we couldn't find any matches.\",\n seeAllResults: \"See all results\",\n searchUniFiProducts: \"Search UniFi products\",\n searchUISPProducts: \"Search UISP products\",\n searchAmpliFiProducts: \"Search AmpliFi products\",\n },\n account: {\n login: \"Log In\",\n signUp: \"Sign Up\",\n signOut: \"Sign Out\",\n uiAccount: \"UI Account\",\n unifiSiteManager: \"UniFi Site Manager\",\n manageAccount: \"Manage Account\",\n orderHistory: \"Orders & Addresses\",\n },\n cart: {\n VATincluded: \"VAT Incl.\",\n includesVat: \"Includes VAT of\",\n discount: \"Discount\",\n empty: \"Your cart is empty\",\n review: \"Checkout\",\n shipping: \"Shipping\",\n subtotal: \"Subtotal\",\n total: \"Total price:\",\n itemsTitle: \"Your Cart\",\n upsellTitle: \"Usually bought together\",\n },\n language: {},\n};\n\nexport interface HeaderAccountCustomer {\n id: string;\n email: string;\n displayName: string;\n picture?: string | null;\n}\n\nexport interface HeaderAccount {\n loading?: boolean;\n customer?: Nullish<HeaderAccountCustomer>;\n handleLogin?: () => void;\n handleLogout?: () => void;\n handleRegister?: () => void;\n handleManageAccount?: () => void;\n handleOrderHistory?: () => void;\n renderStorePicker?: (onClose: () => void) => JSX.Element;\n}\n\nexport interface HeaderSearch {\n /** Trigger search */\n onSearch: (formattedQuerySearchTerm: string) => void;\n loading?: boolean;\n totalItemsCount: number;\n items: Array<{\n id: string;\n url: string;\n image?: CustomImageAsset | null;\n title: string;\n family?: string | null;\n }>;\n}\n\nexport interface HeaderCartItemControls {\n loading?: boolean;\n quantityMax?: number;\n onQuantityChange: (newQuantity: number) => void;\n}\n\nexport interface HeaderCartItem {\n id: string;\n url: string;\n image: Nullish<CustomImageAsset>;\n quantity: number;\n title: string;\n controls: HeaderCartItemControls;\n price: string;\n priceIncludingVAT?: string;\n}\n\nexport interface HeaderCart {\n onReview: () => void;\n loading?: boolean;\n items: HeaderCartItem[];\n upsellItems?: HeaderCartItem[];\n totals: Nullish<{\n shipping: Nullish<string>;\n discount: Nullish<string>;\n finalTax: Nullish<string>;\n total: string;\n totalIncludingVAT?: string;\n }>;\n}\n\nexport type HeaderTranslations = typeof defaultHeaderTranslations;\n\nexport type HeaderEmbedConfig = {\n /**\n * Allows to configure custom callback on home link click\n */\n homeLinkClickHandler?: () => void;\n\n /**\n * Allows to render custom extra section items in Pro Mobile Menu\n */\n mobileMenuExtraSectionItems?: Array<ProMobileMenuSectionItem>;\n\n /**\n * Moves Avatar icon to the left side of the header\n */\n moveAvatarIconToLeft?: boolean;\n\n /**\n * Allows to display avatar as image instead of icon\n */\n displayAvatarAsImage?: boolean;\n\n /**\n * Allows to configure custom callback on avatar click\n */\n avatarClickHandler?: () => void;\n\n /**\n * Allows to hide logo / site title\n */\n hideLogo?: boolean;\n\n /**\n * Allows to hide Avatar icon from the header\n */\n hideAvatarIcon?: boolean;\n\n /**\n * Hide language picker\n */\n hideLanguagePicker?: boolean;\n\n fullWidthHeader?: boolean;\n\n /**\n * Renders site title instead of UI logo\n */\n siteTitle?: string;\n\n /**\n * Blurs search input and dismissed virtual keyboard on touchmove\n */\n /** @deprecated Use blurSearchOnTouchmove */\n hideSearchOnTouchmove?: boolean;\n blurSearchOnTouchmove?: boolean;\n};\n\nexport interface HeaderProps {\n className?: string;\n motif: Motif;\n /**\n * Main header bar becomes fixed position at the top\n */\n sticky?: boolean;\n /**\n * Navigation carousel becomes fixed position at the top\n */\n stickyCarousel?: boolean;\n translations?: HeaderTranslations;\n renderImage: RenderImageFn;\n showLineLoader?: boolean;\n onModalOpen?: () => void;\n onMenuItemLinkClick?: (\n e: React.MouseEvent<HTMLElement>,\n item: ParsedNavigationItem,\n ) => void;\n onMenuSubItemLinkClick?: (\n e: React.MouseEvent<HTMLElement>,\n item: ParsedNavigationSubItem | ParsedNavigationSubSubItem,\n ) => void;\n\n onLanguageChange?: (\n e: React.MouseEvent<HTMLElement>,\n link: string,\n language: Language,\n ) => void;\n\n // Account\n account?: HeaderAccount;\n\n // Search\n onSearchResultsAction?: (searchTerm: string) => void;\n search?: HeaderSearch;\n\n // Cart\n onCartClick?: () => void;\n cart?: HeaderCart;\n\n // Set specific modal to be open initially\n initialActiveModal?: Nullish<ModalId>;\n /**\n * Triggers on active modal change\n */\n onActiveModal?: (id: ModalId | null, prevModalId: ModalId | null) => void;\n\n /**\n * Will be called before navigating to store search, the tracking request in this callback will only\n * finish if called from store side as microsites are not using next router.\n */\n trackStoreSearchClick?: () => void;\n\n transparentHeader?: boolean;\n\n /**\n * Sub-menu used for microsites\n */\n micrositeMenu?: NavigationMicrositeMenuProps;\n\n /**\n * Header customizations for embed context like WebView\n */\n embedConfig?: HeaderEmbedConfig;\n\n accountMenu?: React.ReactNode;\n}\n\nexport type IsolatedHeaderProps = {\n className?: string;\n motif: Motif;\n translations?: HeaderTranslations;\n handleContinueShopping: () => void;\n showLineLoader?: boolean;\n account?: {\n loading?: HeaderAccount[\"loading\"];\n customer?: {\n picture?: HeaderAccountCustomer[\"picture\"];\n };\n };\n} & Pick<HeaderProps, \"embedConfig\">;\n\nexport interface ProHeaderEarlyAccess {\n loading?: boolean;\n onClick: () => void;\n}\n\nexport type ProHeaderProps = Pick<\n HeaderProps,\n | \"className\"\n | \"motif\"\n | \"cart\"\n | \"account\"\n | \"translations\"\n | \"onModalOpen\"\n | \"onCartClick\"\n | \"showLineLoader\"\n | \"accountMenu\"\n> & {\n /**\n * Header customizations for embed context like WebView\n */\n embedConfig?: HeaderEmbedConfig;\n\n // Country picker\n currentCountryName?: string;\n handleStorePickerClick?: () => void;\n\n // Early access button\n earlyAccess?: ProHeaderEarlyAccess;\n\n // Purchase History button\n handlePurchaseHistoryClick?: () => void;\n\n // Order button\n handleOrderHistoryClick?: () => void;\n\n // Product line picker\n productLineOptions?:
|
|
1
|
+
{"version":3,"file":"Header.types.js","sources":["../../../src/components/Header/Header.types.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\n\nimport type { Language } from \"../../contexts/MenuContext/mapping\";\nimport type {\n ModalId,\n ParsedNavigationItem,\n ParsedNavigationSubItem,\n ParsedNavigationSubSubItem,\n} from \"../../contexts/MenuContext/types\";\nimport type { Nullish, ProductLine } from \"../../types\";\nimport type { CategoryTabsProps } from \"../CategoryTabs/CategoryTabs.types\";\nimport type {\n CustomImageAsset,\n RenderImageFn,\n} from \"../CustomImage/CustomImage.types\";\nimport type { NavigationMicrositeMenuProps } from \"./Navigation/MicrositeMenu/MicrositeMenu.types\";\nimport type { ProMobileMenuSectionItem } from \"./Navigation/ProMobileMenu/ProMobileMenu.types\";\n\nexport const defaultHeaderTranslations = {\n new: \"New\",\n support: \"Support\",\n purchasedProductHistory: \"Purchased Product History\",\n orderHistory: \"Order History\",\n earlyAccess: \"Early Access\",\n store: \"Store\",\n links: \"Links\",\n company: \"Company\",\n social: \"Social\",\n tools: \"Tools\",\n training: \"Training\",\n continueShopping: \"Continue Shopping\",\n search: {\n placeholder: \"Search...\",\n noMatchesFound: \"Sorry, we couldn't find any matches.\",\n seeAllResults: \"See all results\",\n searchUniFiProducts: \"Search UniFi products\",\n searchUISPProducts: \"Search UISP products\",\n searchAmpliFiProducts: \"Search AmpliFi products\",\n },\n account: {\n login: \"Log In\",\n signUp: \"Sign Up\",\n signOut: \"Sign Out\",\n uiAccount: \"UI Account\",\n unifiSiteManager: \"UniFi Site Manager\",\n manageAccount: \"Manage Account\",\n orderHistory: \"Orders & Addresses\",\n },\n cart: {\n VATincluded: \"VAT Incl.\",\n includesVat: \"Includes VAT of\",\n discount: \"Discount\",\n empty: \"Your cart is empty\",\n review: \"Checkout\",\n shipping: \"Shipping\",\n subtotal: \"Subtotal\",\n total: \"Total price:\",\n itemsTitle: \"Your Cart\",\n upsellTitle: \"Usually bought together\",\n },\n language: {},\n region: \"Region\",\n};\n\nexport interface HeaderAccountCustomer {\n id: string;\n email: string;\n displayName: string;\n picture?: string | null;\n}\n\nexport interface HeaderAccount {\n loading?: boolean;\n customer?: Nullish<HeaderAccountCustomer>;\n handleLogin?: () => void;\n handleLogout?: () => void;\n handleRegister?: () => void;\n handleManageAccount?: () => void;\n handleOrderHistory?: () => void;\n renderStorePicker?: (onClose: () => void) => JSX.Element;\n}\n\nexport interface HeaderSearch {\n /** Trigger search */\n onSearch: (formattedQuerySearchTerm: string) => void;\n loading?: boolean;\n totalItemsCount: number;\n items: Array<{\n id: string;\n url: string;\n image?: CustomImageAsset | null;\n title: string;\n family?: string | null;\n }>;\n}\n\nexport interface HeaderCartItemControls {\n loading?: boolean;\n quantityMax?: number;\n onQuantityChange: (newQuantity: number) => void;\n}\n\nexport interface HeaderCartItem {\n id: string;\n url: string;\n image: Nullish<CustomImageAsset>;\n quantity: number;\n title: string;\n controls: HeaderCartItemControls;\n price: string;\n priceIncludingVAT?: string;\n}\n\nexport interface HeaderCart {\n onReview: () => void;\n loading?: boolean;\n items: HeaderCartItem[];\n upsellItems?: HeaderCartItem[];\n totals: Nullish<{\n shipping: Nullish<string>;\n discount: Nullish<string>;\n finalTax: Nullish<string>;\n total: string;\n totalIncludingVAT?: string;\n }>;\n}\n\nexport type HeaderTranslations = typeof defaultHeaderTranslations;\n\nexport type HeaderEmbedConfig = {\n /**\n * Allows to configure custom callback on home link click\n */\n homeLinkClickHandler?: () => void;\n\n /**\n * Allows to render custom extra section items in Pro Mobile Menu\n */\n mobileMenuExtraSectionItems?: Array<ProMobileMenuSectionItem>;\n\n /**\n * Moves Avatar icon to the left side of the header\n */\n moveAvatarIconToLeft?: boolean;\n\n /**\n * Allows to display avatar as image instead of icon\n */\n displayAvatarAsImage?: boolean;\n\n /**\n * Allows to configure custom callback on avatar click\n */\n avatarClickHandler?: () => void;\n\n /**\n * Allows to hide logo / site title\n */\n hideLogo?: boolean;\n\n /**\n * Allows to hide Avatar icon from the header\n */\n hideAvatarIcon?: boolean;\n\n /**\n * Hide language picker\n */\n hideLanguagePicker?: boolean;\n\n fullWidthHeader?: boolean;\n\n /**\n * Renders site title instead of UI logo\n */\n siteTitle?: string;\n\n /**\n * Blurs search input and dismissed virtual keyboard on touchmove\n */\n /** @deprecated Use blurSearchOnTouchmove */\n hideSearchOnTouchmove?: boolean;\n blurSearchOnTouchmove?: boolean;\n};\n\nexport interface HeaderProps {\n className?: string;\n motif: Motif;\n /**\n * Main header bar becomes fixed position at the top\n */\n sticky?: boolean;\n /**\n * Navigation carousel becomes fixed position at the top\n */\n stickyCarousel?: boolean;\n translations?: HeaderTranslations;\n renderImage: RenderImageFn;\n showLineLoader?: boolean;\n onModalOpen?: () => void;\n onMenuItemLinkClick?: (\n e: React.MouseEvent<HTMLElement>,\n item: ParsedNavigationItem,\n ) => void;\n onMenuSubItemLinkClick?: (\n e: React.MouseEvent<HTMLElement>,\n item: ParsedNavigationSubItem | ParsedNavigationSubSubItem,\n ) => void;\n\n onLanguageChange?: (\n e: React.MouseEvent<HTMLElement>,\n link: string,\n language: Language,\n ) => void;\n\n // Account\n account?: HeaderAccount;\n\n // Search\n onSearchResultsAction?: (searchTerm: string) => void;\n search?: HeaderSearch;\n\n // Cart\n onCartClick?: () => void;\n cart?: HeaderCart;\n\n // Set specific modal to be open initially\n initialActiveModal?: Nullish<ModalId>;\n /**\n * Triggers on active modal change\n */\n onActiveModal?: (id: ModalId | null, prevModalId: ModalId | null) => void;\n\n /**\n * Will be called before navigating to store search, the tracking request in this callback will only\n * finish if called from store side as microsites are not using next router.\n */\n trackStoreSearchClick?: () => void;\n\n transparentHeader?: boolean;\n\n /**\n * Sub-menu used for microsites\n */\n micrositeMenu?: NavigationMicrositeMenuProps;\n\n /**\n * Header customizations for embed context like WebView\n */\n embedConfig?: HeaderEmbedConfig;\n\n accountMenu?: React.ReactNode;\n}\n\nexport type IsolatedHeaderProps = {\n className?: string;\n motif: Motif;\n translations?: HeaderTranslations;\n handleContinueShopping: () => void;\n showLineLoader?: boolean;\n account?: {\n loading?: HeaderAccount[\"loading\"];\n customer?: {\n picture?: HeaderAccountCustomer[\"picture\"];\n };\n };\n} & Pick<HeaderProps, \"embedConfig\">;\n\nexport interface ProHeaderEarlyAccess {\n loading?: boolean;\n onClick: () => void;\n}\n\nexport interface HeaderProductLineOption {\n value: ProductLine;\n label: string;\n}\n\nexport type ProHeaderProps = Pick<\n HeaderProps,\n | \"className\"\n | \"motif\"\n | \"cart\"\n | \"account\"\n | \"translations\"\n | \"onModalOpen\"\n | \"onCartClick\"\n | \"showLineLoader\"\n | \"accountMenu\"\n> & {\n /**\n * Header customizations for embed context like WebView\n */\n embedConfig?: HeaderEmbedConfig;\n\n // Country picker\n currentCountryName?: string;\n handleStorePickerClick?: () => void;\n\n // Early access button\n earlyAccess?: ProHeaderEarlyAccess;\n\n // Purchase History button\n handlePurchaseHistoryClick?: () => void;\n\n // Order button\n handleOrderHistoryClick?: () => void;\n\n // Product line picker\n productLineOptions?: HeaderProductLineOption[];\n productLineValue?: ProductLine;\n handleProductLineChange?: (type: ProductLine) => void;\n\n // Mobile menu aka \"hamburger\" button click\n handleMobileMenuClick?: () => void;\n\n onLanguageChange?: (\n e: React.MouseEvent<HTMLElement>,\n link: string,\n language: Language,\n ) => void;\n\n // Search\n searchValue?: string;\n onSearch?: (searchTerm: string) => void;\n\n onSearchFocus?: () => void;\n onSearchBlur?: () => void;\n onSearchClick?: () => void;\n\n // Display categories within the header\n inlineCategoryTabs?: CategoryTabsProps;\n};\n"],"names":["defaultHeaderTranslations","new","support","purchasedProductHistory","orderHistory","earlyAccess","store","links","company","social","tools","training","continueShopping","search","placeholder","noMatchesFound","seeAllResults","searchUniFiProducts","searchUISPProducts","searchAmpliFiProducts","account","login","signUp","signOut","uiAccount","unifiSiteManager","manageAccount","cart","VATincluded","includesVat","discount","empty","review","shipping","subtotal","total","itemsTitle","upsellTitle","language","region"],"mappings":";;;AAkBO,MAAMA,yBAA4B,GAAA;EACvCC,GAAK,EAAA,KAAA;EACLC,OAAS,EAAA,SAAA;EACTC,uBAAyB,EAAA,2BAAA;EACzBC,YAAc,EAAA,eAAA;EACdC,WAAa,EAAA,cAAA;EACbC,KAAO,EAAA,OAAA;EACPC,KAAO,EAAA,OAAA;EACPC,OAAS,EAAA,SAAA;EACTC,MAAQ,EAAA,QAAA;EACRC,KAAO,EAAA,OAAA;EACPC,QAAU,EAAA,UAAA;EACVC,gBAAkB,EAAA,mBAAA;EAClBC,MAAQ,EAAA;IACNC,WAAa,EAAA,WAAA;IACbC,cAAgB,EAAA,sCAAA;IAChBC,aAAe,EAAA,iBAAA;IACfC,mBAAqB,EAAA,uBAAA;IACrBC,kBAAoB,EAAA,sBAAA;IACpBC,qBAAuB,EAAA;EACzB,CAAA;EACAC,OAAS,EAAA;IACPC,KAAO,EAAA,QAAA;IACPC,MAAQ,EAAA,SAAA;IACRC,OAAS,EAAA,UAAA;IACTC,SAAW,EAAA,YAAA;IACXC,gBAAkB,EAAA,oBAAA;IAClBC,aAAe,EAAA,gBAAA;IACftB,YAAc,EAAA;EAChB,CAAA;EACAuB,IAAM,EAAA;IACJC,WAAa,EAAA,WAAA;IACbC,WAAa,EAAA,iBAAA;IACbC,QAAU,EAAA,UAAA;IACVC,KAAO,EAAA,oBAAA;IACPC,MAAQ,EAAA,UAAA;IACRC,QAAU,EAAA,UAAA;IACVC,QAAU,EAAA,UAAA;IACVC,KAAO,EAAA,cAAA;IACPC,UAAY,EAAA,WAAA;IACZC,WAAa,EAAA;EACf,CAAA;EACAC,UAAU,CAAC,CAAA;EACXC,MAAQ,EAAA;AACV,CAAA;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.types.mjs","sources":["../../../src/components/Header/Header.types.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\n\nimport type { Language } from \"../../contexts/MenuContext/mapping\";\nimport type {\n ModalId,\n ParsedNavigationItem,\n ParsedNavigationSubItem,\n ParsedNavigationSubSubItem,\n} from \"../../contexts/MenuContext/types\";\nimport type { Nullish, ProductLine } from \"../../types\";\nimport type {\n CustomImageAsset,\n RenderImageFn,\n} from \"../CustomImage/CustomImage.types\";\nimport type { NavigationMicrositeMenuProps } from \"./Navigation/MicrositeMenu/MicrositeMenu.types\";\nimport type { ProMobileMenuSectionItem } from \"./Navigation/ProMobileMenu/ProMobileMenu.types\";\n\nexport const defaultHeaderTranslations = {\n new: \"New\",\n support: \"Support\",\n purchasedProductHistory: \"Purchased Product History\",\n orderHistory: \"Order History\",\n earlyAccess: \"Early Access\",\n store: \"Store\",\n links: \"Links\",\n company: \"Company\",\n social: \"Social\",\n tools: \"Tools\",\n training: \"Training\",\n continueShopping: \"Continue Shopping\",\n search: {\n placeholder: \"Search...\",\n noMatchesFound: \"Sorry, we couldn't find any matches.\",\n seeAllResults: \"See all results\",\n searchUniFiProducts: \"Search UniFi products\",\n searchUISPProducts: \"Search UISP products\",\n searchAmpliFiProducts: \"Search AmpliFi products\",\n },\n account: {\n login: \"Log In\",\n signUp: \"Sign Up\",\n signOut: \"Sign Out\",\n uiAccount: \"UI Account\",\n unifiSiteManager: \"UniFi Site Manager\",\n manageAccount: \"Manage Account\",\n orderHistory: \"Orders & Addresses\",\n },\n cart: {\n VATincluded: \"VAT Incl.\",\n includesVat: \"Includes VAT of\",\n discount: \"Discount\",\n empty: \"Your cart is empty\",\n review: \"Checkout\",\n shipping: \"Shipping\",\n subtotal: \"Subtotal\",\n total: \"Total price:\",\n itemsTitle: \"Your Cart\",\n upsellTitle: \"Usually bought together\",\n },\n language: {},\n};\n\nexport interface HeaderAccountCustomer {\n id: string;\n email: string;\n displayName: string;\n picture?: string | null;\n}\n\nexport interface HeaderAccount {\n loading?: boolean;\n customer?: Nullish<HeaderAccountCustomer>;\n handleLogin?: () => void;\n handleLogout?: () => void;\n handleRegister?: () => void;\n handleManageAccount?: () => void;\n handleOrderHistory?: () => void;\n renderStorePicker?: (onClose: () => void) => JSX.Element;\n}\n\nexport interface HeaderSearch {\n /** Trigger search */\n onSearch: (formattedQuerySearchTerm: string) => void;\n loading?: boolean;\n totalItemsCount: number;\n items: Array<{\n id: string;\n url: string;\n image?: CustomImageAsset | null;\n title: string;\n family?: string | null;\n }>;\n}\n\nexport interface HeaderCartItemControls {\n loading?: boolean;\n quantityMax?: number;\n onQuantityChange: (newQuantity: number) => void;\n}\n\nexport interface HeaderCartItem {\n id: string;\n url: string;\n image: Nullish<CustomImageAsset>;\n quantity: number;\n title: string;\n controls: HeaderCartItemControls;\n price: string;\n priceIncludingVAT?: string;\n}\n\nexport interface HeaderCart {\n onReview: () => void;\n loading?: boolean;\n items: HeaderCartItem[];\n upsellItems?: HeaderCartItem[];\n totals: Nullish<{\n shipping: Nullish<string>;\n discount: Nullish<string>;\n finalTax: Nullish<string>;\n total: string;\n totalIncludingVAT?: string;\n }>;\n}\n\nexport type HeaderTranslations = typeof defaultHeaderTranslations;\n\nexport type HeaderEmbedConfig = {\n /**\n * Allows to configure custom callback on home link click\n */\n homeLinkClickHandler?: () => void;\n\n /**\n * Allows to render custom extra section items in Pro Mobile Menu\n */\n mobileMenuExtraSectionItems?: Array<ProMobileMenuSectionItem>;\n\n /**\n * Moves Avatar icon to the left side of the header\n */\n moveAvatarIconToLeft?: boolean;\n\n /**\n * Allows to display avatar as image instead of icon\n */\n displayAvatarAsImage?: boolean;\n\n /**\n * Allows to configure custom callback on avatar click\n */\n avatarClickHandler?: () => void;\n\n /**\n * Allows to hide logo / site title\n */\n hideLogo?: boolean;\n\n /**\n * Allows to hide Avatar icon from the header\n */\n hideAvatarIcon?: boolean;\n\n /**\n * Hide language picker\n */\n hideLanguagePicker?: boolean;\n\n fullWidthHeader?: boolean;\n\n /**\n * Renders site title instead of UI logo\n */\n siteTitle?: string;\n\n /**\n * Blurs search input and dismissed virtual keyboard on touchmove\n */\n /** @deprecated Use blurSearchOnTouchmove */\n hideSearchOnTouchmove?: boolean;\n blurSearchOnTouchmove?: boolean;\n};\n\nexport interface HeaderProps {\n className?: string;\n motif: Motif;\n /**\n * Main header bar becomes fixed position at the top\n */\n sticky?: boolean;\n /**\n * Navigation carousel becomes fixed position at the top\n */\n stickyCarousel?: boolean;\n translations?: HeaderTranslations;\n renderImage: RenderImageFn;\n showLineLoader?: boolean;\n onModalOpen?: () => void;\n onMenuItemLinkClick?: (\n e: React.MouseEvent<HTMLElement>,\n item: ParsedNavigationItem,\n ) => void;\n onMenuSubItemLinkClick?: (\n e: React.MouseEvent<HTMLElement>,\n item: ParsedNavigationSubItem | ParsedNavigationSubSubItem,\n ) => void;\n\n onLanguageChange?: (\n e: React.MouseEvent<HTMLElement>,\n link: string,\n language: Language,\n ) => void;\n\n // Account\n account?: HeaderAccount;\n\n // Search\n onSearchResultsAction?: (searchTerm: string) => void;\n search?: HeaderSearch;\n\n // Cart\n onCartClick?: () => void;\n cart?: HeaderCart;\n\n // Set specific modal to be open initially\n initialActiveModal?: Nullish<ModalId>;\n /**\n * Triggers on active modal change\n */\n onActiveModal?: (id: ModalId | null, prevModalId: ModalId | null) => void;\n\n /**\n * Will be called before navigating to store search, the tracking request in this callback will only\n * finish if called from store side as microsites are not using next router.\n */\n trackStoreSearchClick?: () => void;\n\n transparentHeader?: boolean;\n\n /**\n * Sub-menu used for microsites\n */\n micrositeMenu?: NavigationMicrositeMenuProps;\n\n /**\n * Header customizations for embed context like WebView\n */\n embedConfig?: HeaderEmbedConfig;\n\n accountMenu?: React.ReactNode;\n}\n\nexport type IsolatedHeaderProps = {\n className?: string;\n motif: Motif;\n translations?: HeaderTranslations;\n handleContinueShopping: () => void;\n showLineLoader?: boolean;\n account?: {\n loading?: HeaderAccount[\"loading\"];\n customer?: {\n picture?: HeaderAccountCustomer[\"picture\"];\n };\n };\n} & Pick<HeaderProps, \"embedConfig\">;\n\nexport interface ProHeaderEarlyAccess {\n loading?: boolean;\n onClick: () => void;\n}\n\nexport type ProHeaderProps = Pick<\n HeaderProps,\n | \"className\"\n | \"motif\"\n | \"cart\"\n | \"account\"\n | \"translations\"\n | \"onModalOpen\"\n | \"onCartClick\"\n | \"showLineLoader\"\n | \"accountMenu\"\n> & {\n /**\n * Header customizations for embed context like WebView\n */\n embedConfig?: HeaderEmbedConfig;\n\n // Country picker\n currentCountryName?: string;\n handleStorePickerClick?: () => void;\n\n // Early access button\n earlyAccess?: ProHeaderEarlyAccess;\n\n // Purchase History button\n handlePurchaseHistoryClick?: () => void;\n\n // Order button\n handleOrderHistoryClick?: () => void;\n\n // Product line picker\n productLineOptions?:
|
|
1
|
+
{"version":3,"file":"Header.types.mjs","sources":["../../../src/components/Header/Header.types.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\n\nimport type { Language } from \"../../contexts/MenuContext/mapping\";\nimport type {\n ModalId,\n ParsedNavigationItem,\n ParsedNavigationSubItem,\n ParsedNavigationSubSubItem,\n} from \"../../contexts/MenuContext/types\";\nimport type { Nullish, ProductLine } from \"../../types\";\nimport type { CategoryTabsProps } from \"../CategoryTabs/CategoryTabs.types\";\nimport type {\n CustomImageAsset,\n RenderImageFn,\n} from \"../CustomImage/CustomImage.types\";\nimport type { NavigationMicrositeMenuProps } from \"./Navigation/MicrositeMenu/MicrositeMenu.types\";\nimport type { ProMobileMenuSectionItem } from \"./Navigation/ProMobileMenu/ProMobileMenu.types\";\n\nexport const defaultHeaderTranslations = {\n new: \"New\",\n support: \"Support\",\n purchasedProductHistory: \"Purchased Product History\",\n orderHistory: \"Order History\",\n earlyAccess: \"Early Access\",\n store: \"Store\",\n links: \"Links\",\n company: \"Company\",\n social: \"Social\",\n tools: \"Tools\",\n training: \"Training\",\n continueShopping: \"Continue Shopping\",\n search: {\n placeholder: \"Search...\",\n noMatchesFound: \"Sorry, we couldn't find any matches.\",\n seeAllResults: \"See all results\",\n searchUniFiProducts: \"Search UniFi products\",\n searchUISPProducts: \"Search UISP products\",\n searchAmpliFiProducts: \"Search AmpliFi products\",\n },\n account: {\n login: \"Log In\",\n signUp: \"Sign Up\",\n signOut: \"Sign Out\",\n uiAccount: \"UI Account\",\n unifiSiteManager: \"UniFi Site Manager\",\n manageAccount: \"Manage Account\",\n orderHistory: \"Orders & Addresses\",\n },\n cart: {\n VATincluded: \"VAT Incl.\",\n includesVat: \"Includes VAT of\",\n discount: \"Discount\",\n empty: \"Your cart is empty\",\n review: \"Checkout\",\n shipping: \"Shipping\",\n subtotal: \"Subtotal\",\n total: \"Total price:\",\n itemsTitle: \"Your Cart\",\n upsellTitle: \"Usually bought together\",\n },\n language: {},\n region: \"Region\",\n};\n\nexport interface HeaderAccountCustomer {\n id: string;\n email: string;\n displayName: string;\n picture?: string | null;\n}\n\nexport interface HeaderAccount {\n loading?: boolean;\n customer?: Nullish<HeaderAccountCustomer>;\n handleLogin?: () => void;\n handleLogout?: () => void;\n handleRegister?: () => void;\n handleManageAccount?: () => void;\n handleOrderHistory?: () => void;\n renderStorePicker?: (onClose: () => void) => JSX.Element;\n}\n\nexport interface HeaderSearch {\n /** Trigger search */\n onSearch: (formattedQuerySearchTerm: string) => void;\n loading?: boolean;\n totalItemsCount: number;\n items: Array<{\n id: string;\n url: string;\n image?: CustomImageAsset | null;\n title: string;\n family?: string | null;\n }>;\n}\n\nexport interface HeaderCartItemControls {\n loading?: boolean;\n quantityMax?: number;\n onQuantityChange: (newQuantity: number) => void;\n}\n\nexport interface HeaderCartItem {\n id: string;\n url: string;\n image: Nullish<CustomImageAsset>;\n quantity: number;\n title: string;\n controls: HeaderCartItemControls;\n price: string;\n priceIncludingVAT?: string;\n}\n\nexport interface HeaderCart {\n onReview: () => void;\n loading?: boolean;\n items: HeaderCartItem[];\n upsellItems?: HeaderCartItem[];\n totals: Nullish<{\n shipping: Nullish<string>;\n discount: Nullish<string>;\n finalTax: Nullish<string>;\n total: string;\n totalIncludingVAT?: string;\n }>;\n}\n\nexport type HeaderTranslations = typeof defaultHeaderTranslations;\n\nexport type HeaderEmbedConfig = {\n /**\n * Allows to configure custom callback on home link click\n */\n homeLinkClickHandler?: () => void;\n\n /**\n * Allows to render custom extra section items in Pro Mobile Menu\n */\n mobileMenuExtraSectionItems?: Array<ProMobileMenuSectionItem>;\n\n /**\n * Moves Avatar icon to the left side of the header\n */\n moveAvatarIconToLeft?: boolean;\n\n /**\n * Allows to display avatar as image instead of icon\n */\n displayAvatarAsImage?: boolean;\n\n /**\n * Allows to configure custom callback on avatar click\n */\n avatarClickHandler?: () => void;\n\n /**\n * Allows to hide logo / site title\n */\n hideLogo?: boolean;\n\n /**\n * Allows to hide Avatar icon from the header\n */\n hideAvatarIcon?: boolean;\n\n /**\n * Hide language picker\n */\n hideLanguagePicker?: boolean;\n\n fullWidthHeader?: boolean;\n\n /**\n * Renders site title instead of UI logo\n */\n siteTitle?: string;\n\n /**\n * Blurs search input and dismissed virtual keyboard on touchmove\n */\n /** @deprecated Use blurSearchOnTouchmove */\n hideSearchOnTouchmove?: boolean;\n blurSearchOnTouchmove?: boolean;\n};\n\nexport interface HeaderProps {\n className?: string;\n motif: Motif;\n /**\n * Main header bar becomes fixed position at the top\n */\n sticky?: boolean;\n /**\n * Navigation carousel becomes fixed position at the top\n */\n stickyCarousel?: boolean;\n translations?: HeaderTranslations;\n renderImage: RenderImageFn;\n showLineLoader?: boolean;\n onModalOpen?: () => void;\n onMenuItemLinkClick?: (\n e: React.MouseEvent<HTMLElement>,\n item: ParsedNavigationItem,\n ) => void;\n onMenuSubItemLinkClick?: (\n e: React.MouseEvent<HTMLElement>,\n item: ParsedNavigationSubItem | ParsedNavigationSubSubItem,\n ) => void;\n\n onLanguageChange?: (\n e: React.MouseEvent<HTMLElement>,\n link: string,\n language: Language,\n ) => void;\n\n // Account\n account?: HeaderAccount;\n\n // Search\n onSearchResultsAction?: (searchTerm: string) => void;\n search?: HeaderSearch;\n\n // Cart\n onCartClick?: () => void;\n cart?: HeaderCart;\n\n // Set specific modal to be open initially\n initialActiveModal?: Nullish<ModalId>;\n /**\n * Triggers on active modal change\n */\n onActiveModal?: (id: ModalId | null, prevModalId: ModalId | null) => void;\n\n /**\n * Will be called before navigating to store search, the tracking request in this callback will only\n * finish if called from store side as microsites are not using next router.\n */\n trackStoreSearchClick?: () => void;\n\n transparentHeader?: boolean;\n\n /**\n * Sub-menu used for microsites\n */\n micrositeMenu?: NavigationMicrositeMenuProps;\n\n /**\n * Header customizations for embed context like WebView\n */\n embedConfig?: HeaderEmbedConfig;\n\n accountMenu?: React.ReactNode;\n}\n\nexport type IsolatedHeaderProps = {\n className?: string;\n motif: Motif;\n translations?: HeaderTranslations;\n handleContinueShopping: () => void;\n showLineLoader?: boolean;\n account?: {\n loading?: HeaderAccount[\"loading\"];\n customer?: {\n picture?: HeaderAccountCustomer[\"picture\"];\n };\n };\n} & Pick<HeaderProps, \"embedConfig\">;\n\nexport interface ProHeaderEarlyAccess {\n loading?: boolean;\n onClick: () => void;\n}\n\nexport interface HeaderProductLineOption {\n value: ProductLine;\n label: string;\n}\n\nexport type ProHeaderProps = Pick<\n HeaderProps,\n | \"className\"\n | \"motif\"\n | \"cart\"\n | \"account\"\n | \"translations\"\n | \"onModalOpen\"\n | \"onCartClick\"\n | \"showLineLoader\"\n | \"accountMenu\"\n> & {\n /**\n * Header customizations for embed context like WebView\n */\n embedConfig?: HeaderEmbedConfig;\n\n // Country picker\n currentCountryName?: string;\n handleStorePickerClick?: () => void;\n\n // Early access button\n earlyAccess?: ProHeaderEarlyAccess;\n\n // Purchase History button\n handlePurchaseHistoryClick?: () => void;\n\n // Order button\n handleOrderHistoryClick?: () => void;\n\n // Product line picker\n productLineOptions?: HeaderProductLineOption[];\n productLineValue?: ProductLine;\n handleProductLineChange?: (type: ProductLine) => void;\n\n // Mobile menu aka \"hamburger\" button click\n handleMobileMenuClick?: () => void;\n\n onLanguageChange?: (\n e: React.MouseEvent<HTMLElement>,\n link: string,\n language: Language,\n ) => void;\n\n // Search\n searchValue?: string;\n onSearch?: (searchTerm: string) => void;\n\n onSearchFocus?: () => void;\n onSearchBlur?: () => void;\n onSearchClick?: () => void;\n\n // Display categories within the header\n inlineCategoryTabs?: CategoryTabsProps;\n};\n"],"names":["defaultHeaderTranslations","new","support","purchasedProductHistory","orderHistory","earlyAccess","store","links","company","social","tools","training","continueShopping","search","placeholder","noMatchesFound","seeAllResults","searchUniFiProducts","searchUISPProducts","searchAmpliFiProducts","account","login","signUp","signOut","uiAccount","unifiSiteManager","manageAccount","cart","VATincluded","includesVat","discount","empty","review","shipping","subtotal","total","itemsTitle","upsellTitle","language","region"],"mappings":";;AAkBO,MAAMA,yBAA4B,GAAA;EACvCC,GAAK,EAAA,KAAA;EACLC,OAAS,EAAA,SAAA;EACTC,uBAAyB,EAAA,2BAAA;EACzBC,YAAc,EAAA,eAAA;EACdC,WAAa,EAAA,cAAA;EACbC,KAAO,EAAA,OAAA;EACPC,KAAO,EAAA,OAAA;EACPC,OAAS,EAAA,SAAA;EACTC,MAAQ,EAAA,QAAA;EACRC,KAAO,EAAA,OAAA;EACPC,QAAU,EAAA,UAAA;EACVC,gBAAkB,EAAA,mBAAA;EAClBC,MAAQ,EAAA;IACNC,WAAa,EAAA,WAAA;IACbC,cAAgB,EAAA,sCAAA;IAChBC,aAAe,EAAA,iBAAA;IACfC,mBAAqB,EAAA,uBAAA;IACrBC,kBAAoB,EAAA,sBAAA;IACpBC,qBAAuB,EAAA;EACzB,CAAA;EACAC,OAAS,EAAA;IACPC,KAAO,EAAA,QAAA;IACPC,MAAQ,EAAA,SAAA;IACRC,OAAS,EAAA,UAAA;IACTC,SAAW,EAAA,YAAA;IACXC,gBAAkB,EAAA,oBAAA;IAClBC,aAAe,EAAA,gBAAA;IACftB,YAAc,EAAA;EAChB,CAAA;EACAuB,IAAM,EAAA;IACJC,WAAa,EAAA,WAAA;IACbC,WAAa,EAAA,iBAAA;IACbC,QAAU,EAAA,UAAA;IACVC,KAAO,EAAA,oBAAA;IACPC,MAAQ,EAAA,UAAA;IACRC,QAAU,EAAA,UAAA;IACVC,QAAU,EAAA,UAAA;IACVC,KAAO,EAAA,cAAA;IACPC,UAAY,EAAA,WAAA;IACZC,WAAa,EAAA;EACf,CAAA;EACAC,UAAU,CAAC,CAAA;EACXC,MAAQ,EAAA;AACV,CAAA;"}
|
|
@@ -9,7 +9,7 @@ export declare const MenuButtonLink: import("styled-components").StyledComponent
|
|
|
9
9
|
secondary?: boolean;
|
|
10
10
|
}, never>;
|
|
11
11
|
export declare const TextWrap: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
12
|
-
export declare const Text: import("styled-components").StyledComponent<"
|
|
12
|
+
export declare const Text: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {}, never>;
|
|
13
13
|
export declare const Arrow: import("styled-components").StyledComponent<"div", import("styled-components").DefaultTheme, {
|
|
14
14
|
motif: Motif;
|
|
15
15
|
}, never>;
|
|
@@ -108,7 +108,7 @@ const TextWrap = styled__default["default"].div`
|
|
|
108
108
|
position: relative;
|
|
109
109
|
height: 100%;
|
|
110
110
|
`;
|
|
111
|
-
const Text = styled__default["default"].
|
|
111
|
+
const Text = styled__default["default"].div`
|
|
112
112
|
white-space: nowrap;
|
|
113
113
|
text-overflow: ellipsis;
|
|
114
114
|
overflow: hidden;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.styles.js","sources":["../../../../src/components/Header/MenuItem/MenuItem.styles.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\nimport styled, { css } from \"styled-components\";\n\nimport { BREAKPOINTS } from \"../../../constants/layout\";\nimport { theme } from \"../../../constants/theme\";\nimport { Button as ButtonBase } from \"../../Button\";\n\n// #############################################################################\n// Shared\n// #############################################################################\ntype VisibilityProps = { hideOnMobile?: boolean; hideOnDesktop?: boolean };\n\nconst visbility = css<{ hideOnMobile?: boolean; hideOnDesktop?: boolean }>`\n ${({ hideOnMobile }) =>\n hideOnMobile &&\n css`\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN} {\n display: none;\n }\n `}\n\n ${({ hideOnDesktop }) =>\n hideOnDesktop &&\n css`\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_UP} {\n display: none;\n }\n `}\n`;\n\n// #############################################################################\n// MenuButton\n// #############################################################################\nexport const MenuButtonWrap = styled.div<VisibilityProps>`\n display: flex;\n align-items: center;\n\n ${visbility}\n`;\n\nexport const MenuButtonLink = styled.a<{ motif: Motif; secondary?: boolean }>`\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n padding: 8px 12px;\n border-radius: 4px;\n font-size: 13px;\n line-height: 1;\n letter-spacing: -0.02em;\n\n transition: background-color 0.3s ease 0s;\n\n ${({ motif }) => {\n switch (motif) {\n case \"dark\":\n return css`\n color: ${theme.colors.white};\n background-color: #005ed9;\n\n &:focus,\n &:hover {\n color: ${theme.colors.white};\n background-color: #004cad;\n }\n `;\n case \"light\":\n default:\n return css`\n color: ${theme.colors.white};\n background-color: ${theme.colors.primaryBlue};\n\n &:focus,\n &:hover {\n color: ${theme.colors.white};\n background-color: ${theme.colors.dodgerblue};\n }\n `;\n }\n }}\n\n ${({ secondary, motif }) =>\n secondary &&\n css`\n border: 1px solid #595959;\n background-color: transparent;\n\n ${motif === \"light\" &&\n css`\n color: ${theme.colors.menu.text.light};\n\n &:focus,\n &:hover {\n color: ${theme.colors.primaryBlue};\n }\n `}\n\n &:focus,\n &:hover {\n background-color: transparent;\n border-color: ${theme.colors.primaryBlue};\n }\n `}\n`;\n\n// #############################################################################\n// MenuItem\n// #############################################################################\n\nexport const TextWrap = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n height: 100%;\n`;\n\nexport const Text = styled.
|
|
1
|
+
{"version":3,"file":"MenuItem.styles.js","sources":["../../../../src/components/Header/MenuItem/MenuItem.styles.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\nimport styled, { css } from \"styled-components\";\n\nimport { BREAKPOINTS } from \"../../../constants/layout\";\nimport { theme } from \"../../../constants/theme\";\nimport { Button as ButtonBase } from \"../../Button\";\n\n// #############################################################################\n// Shared\n// #############################################################################\ntype VisibilityProps = { hideOnMobile?: boolean; hideOnDesktop?: boolean };\n\nconst visbility = css<{ hideOnMobile?: boolean; hideOnDesktop?: boolean }>`\n ${({ hideOnMobile }) =>\n hideOnMobile &&\n css`\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN} {\n display: none;\n }\n `}\n\n ${({ hideOnDesktop }) =>\n hideOnDesktop &&\n css`\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_UP} {\n display: none;\n }\n `}\n`;\n\n// #############################################################################\n// MenuButton\n// #############################################################################\nexport const MenuButtonWrap = styled.div<VisibilityProps>`\n display: flex;\n align-items: center;\n\n ${visbility}\n`;\n\nexport const MenuButtonLink = styled.a<{ motif: Motif; secondary?: boolean }>`\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n padding: 8px 12px;\n border-radius: 4px;\n font-size: 13px;\n line-height: 1;\n letter-spacing: -0.02em;\n\n transition: background-color 0.3s ease 0s;\n\n ${({ motif }) => {\n switch (motif) {\n case \"dark\":\n return css`\n color: ${theme.colors.white};\n background-color: #005ed9;\n\n &:focus,\n &:hover {\n color: ${theme.colors.white};\n background-color: #004cad;\n }\n `;\n case \"light\":\n default:\n return css`\n color: ${theme.colors.white};\n background-color: ${theme.colors.primaryBlue};\n\n &:focus,\n &:hover {\n color: ${theme.colors.white};\n background-color: ${theme.colors.dodgerblue};\n }\n `;\n }\n }}\n\n ${({ secondary, motif }) =>\n secondary &&\n css`\n border: 1px solid #595959;\n background-color: transparent;\n\n ${motif === \"light\" &&\n css`\n color: ${theme.colors.menu.text.light};\n\n &:focus,\n &:hover {\n color: ${theme.colors.primaryBlue};\n }\n `}\n\n &:focus,\n &:hover {\n background-color: transparent;\n border-color: ${theme.colors.primaryBlue};\n }\n `}\n`;\n\n// #############################################################################\n// MenuItem\n// #############################################################################\n\nexport const TextWrap = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n height: 100%;\n`;\n\nexport const Text = styled.div`\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n transition: color 0.2s linear;\n font-size: ${theme.font.size13};\n line-height: ${theme.lineHeight.header};\n`;\n\nexport const Arrow = styled.div<{\n motif: Motif;\n}>`\n border: 3px solid transparent;\n border-bottom: none;\n border-top: 5px solid currentcolor;\n transition: color 0.2s linear;\n`;\n\nexport const ArrowIconWrap = styled.div<{ $flip?: boolean }>`\n position: absolute;\n top: 50%;\n left: 100%;\n transform: translateY(-50%);\n display: flex;\n margin: 1px 0 0 4px;\n\n ${({ $flip }) =>\n $flip &&\n css`\n margin-top: 0;\n\n ${Arrow} {\n transform: rotate(180deg);\n }\n `}\n`;\n\nexport const Button = styled(ButtonBase)<\n {\n motif: Motif;\n $minWidth?: number;\n $active?: boolean;\n $showArrow?: boolean;\n } & VisibilityProps\n>`\n display: flex;\n border: none;\n background: none;\n align-items: center;\n justify-content: center;\n outline: none;\n white-space: nowrap;\n height: 100%;\n cursor: pointer;\n padding: 0;\n color: ${({ motif }) => theme.colors.menu.text[motif]};\n position: relative;\n\n :hover,\n :focus {\n ${Text},\n ${ArrowIconWrap} {\n color: ${({ motif }) => theme.colors.menu.active[motif]};\n }\n }\n\n ${({ $showArrow }) =>\n $showArrow &&\n css`\n margin-right: 5px;\n `}\n\n ${({ $minWidth }) =>\n $minWidth != null &&\n css`\n min-width: ${$minWidth}px;\n `};\n\n ${({ $active, motif }) =>\n $active &&\n css`\n ${Text} {\n color: ${theme.colors.menu.active[motif]};\n }\n\n ${ArrowIconWrap} {\n color: ${theme.colors.menu.active[motif]};\n }\n `}\n\n ${visbility}\n`;\n"],"names":["visbility","css","hideOnMobile","BREAKPOINTS","TOP_NAV_MOBILE_AND_DOWN","hideOnDesktop","TOP_NAV_MOBILE_UP","MenuButtonWrap","styled","div","MenuButtonLink","a","motif","theme","colors","white","primaryBlue","dodgerblue","secondary","menu","text","light","TextWrap","Text","font","size13","lineHeight","header","Arrow","ArrowIconWrap","$flip","Button","ButtonBase","active","$showArrow","$minWidth","$active"],"mappings":";;;;;;;;;;;;;;AAYA,MAAMA,SAAY,GAAAC,MAAAA,CAAAA,GAAA;AAAA,IACd,CAAC;EAAEC;CAAa,KAChBA,YACA,IAAAD,MAAAA,CAAAA,GAAA;AAAA,eACWE,MAAAA,CAAAA,YAAYC,uBAAuB;AAAA;AAAA;AAAA,KAG7C;AAAA;AAAA,IAED,CAAC;EAAEC;CAAc,KACjBA,aACA,IA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A,IAAAjC,MAAAA,CAAAA,GAAA;AAAA;AAAA,KAEC;AAAA;AAAA,IAED,CAAC;EAAEkC;AAAU,CAAA,KACbA,aAAa,IACb,IAAAlC,MAAAA,CAAAA,GAAA;AAAA,mBACekC,SAAS;AAAA,KACvB;AAAA;AAAA,IAED,CAAC;EAAEC,OAAS;EAAAxB;AAAA,MACZwB,OACA,IAAAnC,MAAAA,CAAAA,GAAA;AAAA,QACIsB,IAAI;AAAA,iBACKV,KAAM,CAAAA,KAAA,CAAAC,MAAA,CAAOK,IAAK,CAAAc,MAAA,CAAOrB,KAAK,CAAC;AAAA;AAAA;AAAA,QAGxCiB,aAAa;AAAA,iBACJhB,KAAM,CAAAA,KAAA,CAAAC,MAAA,CAAOK,IAAK,CAAAc,MAAA,CAAOrB,KAAK,CAAC;AAAA;AAAA,KAE3C;AAAA;AAAA,IAEDZ,SAAS;AAAA,CAAA;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.styles.mjs","sources":["../../../../src/components/Header/MenuItem/MenuItem.styles.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\nimport styled, { css } from \"styled-components\";\n\nimport { BREAKPOINTS } from \"../../../constants/layout\";\nimport { theme } from \"../../../constants/theme\";\nimport { Button as ButtonBase } from \"../../Button\";\n\n// #############################################################################\n// Shared\n// #############################################################################\ntype VisibilityProps = { hideOnMobile?: boolean; hideOnDesktop?: boolean };\n\nconst visbility = css<{ hideOnMobile?: boolean; hideOnDesktop?: boolean }>`\n ${({ hideOnMobile }) =>\n hideOnMobile &&\n css`\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN} {\n display: none;\n }\n `}\n\n ${({ hideOnDesktop }) =>\n hideOnDesktop &&\n css`\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_UP} {\n display: none;\n }\n `}\n`;\n\n// #############################################################################\n// MenuButton\n// #############################################################################\nexport const MenuButtonWrap = styled.div<VisibilityProps>`\n display: flex;\n align-items: center;\n\n ${visbility}\n`;\n\nexport const MenuButtonLink = styled.a<{ motif: Motif; secondary?: boolean }>`\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n padding: 8px 12px;\n border-radius: 4px;\n font-size: 13px;\n line-height: 1;\n letter-spacing: -0.02em;\n\n transition: background-color 0.3s ease 0s;\n\n ${({ motif }) => {\n switch (motif) {\n case \"dark\":\n return css`\n color: ${theme.colors.white};\n background-color: #005ed9;\n\n &:focus,\n &:hover {\n color: ${theme.colors.white};\n background-color: #004cad;\n }\n `;\n case \"light\":\n default:\n return css`\n color: ${theme.colors.white};\n background-color: ${theme.colors.primaryBlue};\n\n &:focus,\n &:hover {\n color: ${theme.colors.white};\n background-color: ${theme.colors.dodgerblue};\n }\n `;\n }\n }}\n\n ${({ secondary, motif }) =>\n secondary &&\n css`\n border: 1px solid #595959;\n background-color: transparent;\n\n ${motif === \"light\" &&\n css`\n color: ${theme.colors.menu.text.light};\n\n &:focus,\n &:hover {\n color: ${theme.colors.primaryBlue};\n }\n `}\n\n &:focus,\n &:hover {\n background-color: transparent;\n border-color: ${theme.colors.primaryBlue};\n }\n `}\n`;\n\n// #############################################################################\n// MenuItem\n// #############################################################################\n\nexport const TextWrap = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n height: 100%;\n`;\n\nexport const Text = styled.
|
|
1
|
+
{"version":3,"file":"MenuItem.styles.mjs","sources":["../../../../src/components/Header/MenuItem/MenuItem.styles.tsx"],"sourcesContent":["import type { Motif } from \"@ubnt/ui-components/utils\";\nimport styled, { css } from \"styled-components\";\n\nimport { BREAKPOINTS } from \"../../../constants/layout\";\nimport { theme } from \"../../../constants/theme\";\nimport { Button as ButtonBase } from \"../../Button\";\n\n// #############################################################################\n// Shared\n// #############################################################################\ntype VisibilityProps = { hideOnMobile?: boolean; hideOnDesktop?: boolean };\n\nconst visbility = css<{ hideOnMobile?: boolean; hideOnDesktop?: boolean }>`\n ${({ hideOnMobile }) =>\n hideOnMobile &&\n css`\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_AND_DOWN} {\n display: none;\n }\n `}\n\n ${({ hideOnDesktop }) =>\n hideOnDesktop &&\n css`\n @media ${BREAKPOINTS.TOP_NAV_MOBILE_UP} {\n display: none;\n }\n `}\n`;\n\n// #############################################################################\n// MenuButton\n// #############################################################################\nexport const MenuButtonWrap = styled.div<VisibilityProps>`\n display: flex;\n align-items: center;\n\n ${visbility}\n`;\n\nexport const MenuButtonLink = styled.a<{ motif: Motif; secondary?: boolean }>`\n display: flex;\n flex-direction: row;\n align-items: center;\n gap: 8px;\n padding: 8px 12px;\n border-radius: 4px;\n font-size: 13px;\n line-height: 1;\n letter-spacing: -0.02em;\n\n transition: background-color 0.3s ease 0s;\n\n ${({ motif }) => {\n switch (motif) {\n case \"dark\":\n return css`\n color: ${theme.colors.white};\n background-color: #005ed9;\n\n &:focus,\n &:hover {\n color: ${theme.colors.white};\n background-color: #004cad;\n }\n `;\n case \"light\":\n default:\n return css`\n color: ${theme.colors.white};\n background-color: ${theme.colors.primaryBlue};\n\n &:focus,\n &:hover {\n color: ${theme.colors.white};\n background-color: ${theme.colors.dodgerblue};\n }\n `;\n }\n }}\n\n ${({ secondary, motif }) =>\n secondary &&\n css`\n border: 1px solid #595959;\n background-color: transparent;\n\n ${motif === \"light\" &&\n css`\n color: ${theme.colors.menu.text.light};\n\n &:focus,\n &:hover {\n color: ${theme.colors.primaryBlue};\n }\n `}\n\n &:focus,\n &:hover {\n background-color: transparent;\n border-color: ${theme.colors.primaryBlue};\n }\n `}\n`;\n\n// #############################################################################\n// MenuItem\n// #############################################################################\n\nexport const TextWrap = styled.div`\n display: flex;\n align-items: center;\n justify-content: center;\n position: relative;\n height: 100%;\n`;\n\nexport const Text = styled.div`\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n transition: color 0.2s linear;\n font-size: ${theme.font.size13};\n line-height: ${theme.lineHeight.header};\n`;\n\nexport const Arrow = styled.div<{\n motif: Motif;\n}>`\n border: 3px solid transparent;\n border-bottom: none;\n border-top: 5px solid currentcolor;\n transition: color 0.2s linear;\n`;\n\nexport const ArrowIconWrap = styled.div<{ $flip?: boolean }>`\n position: absolute;\n top: 50%;\n left: 100%;\n transform: translateY(-50%);\n display: flex;\n margin: 1px 0 0 4px;\n\n ${({ $flip }) =>\n $flip &&\n css`\n margin-top: 0;\n\n ${Arrow} {\n transform: rotate(180deg);\n }\n `}\n`;\n\nexport const Button = styled(ButtonBase)<\n {\n motif: Motif;\n $minWidth?: number;\n $active?: boolean;\n $showArrow?: boolean;\n } & VisibilityProps\n>`\n display: flex;\n border: none;\n background: none;\n align-items: center;\n justify-content: center;\n outline: none;\n white-space: nowrap;\n height: 100%;\n cursor: pointer;\n padding: 0;\n color: ${({ motif }) => theme.colors.menu.text[motif]};\n position: relative;\n\n :hover,\n :focus {\n ${Text},\n ${ArrowIconWrap} {\n color: ${({ motif }) => theme.colors.menu.active[motif]};\n }\n }\n\n ${({ $showArrow }) =>\n $showArrow &&\n css`\n margin-right: 5px;\n `}\n\n ${({ $minWidth }) =>\n $minWidth != null &&\n css`\n min-width: ${$minWidth}px;\n `};\n\n ${({ $active, motif }) =>\n $active &&\n css`\n ${Text} {\n color: ${theme.colors.menu.active[motif]};\n }\n\n ${ArrowIconWrap} {\n color: ${theme.colors.menu.active[motif]};\n }\n `}\n\n ${visbility}\n`;\n"],"names":["visbility","css","hideOnMobile","BREAKPOINTS","TOP_NAV_MOBILE_AND_DOWN","hideOnDesktop","TOP_NAV_MOBILE_UP","MenuButtonWrap","styled","div","MenuButtonLink","a","motif","theme","colors","white","primaryBlue","dodgerblue","secondary","menu","text","light","TextWrap","Text","font","size13","lineHeight","header","Arrow","ArrowIconWrap","$flip","Button","ButtonBase","active","$showArrow","$minWidth","$active"],"mappings":";;;;;;AAYA,MAAMA,SAAY,GAAAC,GAAA;AAAA,IACd,CAAC;EAAEC;CAAa,KAChBA,YACA,IAAAD,GAAA;AAAA,eACW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M,CAAAC,MAAA,CAAOK,IAAK,CAAAc,MAAA,CAAOrB,KAAK,CAAC;AAAA;AAAA;AAAA,QAGxCiB,aAAa;AAAA,iBACJhB,KAAM,CAAAC,MAAA,CAAOK,IAAK,CAAAc,MAAA,CAAOrB,KAAK,CAAC;AAAA;AAAA,KAE3C;AAAA;AAAA,IAEDZ,SAAS;AAAA,CAAA;"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { NavigationProMenuPrivateProps } from "./ProMenu.types";
|
|
2
|
+
export declare const NavigationProMenu: ({ show, onClose, currentCountryName, handleStorePickerClick, productLineValue, productLineOptions, onProductLineChange, }: NavigationProMenuPrivateProps) => JSX.Element;
|