@anker-in/headless-ui 1.1.4 → 1.1.5
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/dist/cjs/biz-components/AccordionCards/index.js.map +2 -2
- package/dist/cjs/biz-components/AplusDesc/index.js +1 -1
- package/dist/cjs/biz-components/AplusDesc/index.js.map +2 -2
- package/dist/cjs/biz-components/Category/SwiperCategory.js.map +2 -2
- package/dist/cjs/biz-components/Category/index.js +1 -1
- package/dist/cjs/biz-components/Category/index.js.map +2 -2
- package/dist/cjs/biz-components/CreativeModule/index.js +1 -1
- package/dist/cjs/biz-components/CreativeModule/index.js.map +2 -2
- package/dist/cjs/biz-components/DownLoad/index.js +1 -1
- package/dist/cjs/biz-components/DownLoad/index.js.map +1 -1
- package/dist/cjs/biz-components/Evaluate/index.js +1 -1
- package/dist/cjs/biz-components/Evaluate/index.js.map +1 -1
- package/dist/cjs/biz-components/Faq/Faq.js.map +2 -2
- package/dist/cjs/biz-components/Features/index.js +1 -1
- package/dist/cjs/biz-components/Features/index.js.map +2 -2
- package/dist/cjs/biz-components/FootCharger/index.js +1 -1
- package/dist/cjs/biz-components/FootCharger/index.js.map +2 -2
- package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.js.map +2 -2
- package/dist/cjs/biz-components/GiftBox/index.js +1 -1
- package/dist/cjs/biz-components/GiftBox/index.js.map +1 -1
- package/dist/cjs/biz-components/Graphic/index.js +1 -1
- package/dist/cjs/biz-components/Graphic/index.js.map +2 -2
- package/dist/cjs/biz-components/GraphicMore/index.js +1 -1
- package/dist/cjs/biz-components/GraphicMore/index.js.map +2 -2
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js.map +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/icons/Polygon.js.map +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.d.ts +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.js.map +2 -2
- package/dist/cjs/biz-components/HeroBanner/Countdown.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/Countdown.js.map +1 -1
- package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.js.map +1 -1
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +3 -3
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +5 -6
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/ModalContainer.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/ModalContainer.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +1 -1
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/components/index.js.map +1 -1
- package/dist/cjs/biz-components/Listing/const.js.map +1 -1
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js +1 -1
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js.map +2 -2
- package/dist/cjs/biz-components/Listing/hooks/use-variant.js +1 -1
- package/dist/cjs/biz-components/Listing/hooks/use-variant.js.map +2 -2
- package/dist/cjs/biz-components/Listing/hooks/useBenefits.js +1 -1
- package/dist/cjs/biz-components/Listing/hooks/useBenefits.js.map +2 -2
- package/dist/cjs/biz-components/Listing/hooks/useDiscountEnable.js.map +2 -2
- package/dist/cjs/biz-components/Listing/index.js +1 -1
- package/dist/cjs/biz-components/Listing/index.js.map +1 -1
- package/dist/cjs/biz-components/Listing/types/product.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/types/product.js +1 -1
- package/dist/cjs/biz-components/Listing/types/product.js.map +1 -1
- package/dist/cjs/biz-components/Listing/types.js.map +1 -1
- package/dist/cjs/biz-components/Listing/utils/helper.js +1 -1
- package/dist/cjs/biz-components/Listing/utils/helper.js.map +2 -2
- package/dist/cjs/biz-components/Listing/utils/index.js +1 -1
- package/dist/cjs/biz-components/Listing/utils/index.js.map +2 -2
- package/dist/cjs/biz-components/Listing/utils/textFormat.js.map +2 -2
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.js +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.js.map +2 -2
- package/dist/cjs/biz-components/NavigationSearch/types.js.map +1 -1
- package/dist/cjs/biz-components/SearchPage/index.js +1 -1
- package/dist/cjs/biz-components/SearchPage/index.js.map +2 -2
- package/dist/cjs/biz-components/SearchPage/types.js.map +2 -2
- package/dist/cjs/biz-components/SelectStore/index.js +1 -1
- package/dist/cjs/biz-components/SelectStore/index.js.map +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/index.js.map +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js.map +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +1 -1
- package/dist/cjs/biz-components/Slogan/index.js.map +2 -2
- package/dist/cjs/biz-components/Specs/dropdown.js +1 -1
- package/dist/cjs/biz-components/Specs/dropdown.js.map +1 -1
- package/dist/cjs/biz-components/Specs/index.js +1 -1
- package/dist/cjs/biz-components/Specs/index.js.map +2 -2
- package/dist/cjs/biz-components/Subscribe/index.js +1 -1
- package/dist/cjs/biz-components/Subscribe/index.js.map +2 -2
- package/dist/cjs/biz-components/SwiperBox/index.js.map +2 -2
- package/dist/cjs/biz-components/Tabs/Tabs.js +1 -1
- package/dist/cjs/biz-components/Tabs/Tabs.js.map +2 -2
- package/dist/cjs/biz-components/Tabs/types.js.map +1 -1
- package/dist/cjs/biz-components/TextModal/index.js +1 -1
- package/dist/cjs/biz-components/TextModal/index.js.map +1 -1
- package/dist/cjs/biz-components/Title/index.js +1 -1
- package/dist/cjs/biz-components/Title/index.js.map +2 -2
- package/dist/cjs/biz-components/VideoModal/index.js +1 -1
- package/dist/cjs/biz-components/VideoModal/index.js.map +2 -2
- package/dist/cjs/biz-components/index.d.ts +1 -1
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +2 -2
- package/dist/cjs/components/ExposureDetector.js.map +1 -1
- package/dist/cjs/components/board.js +1 -1
- package/dist/cjs/components/board.js.map +3 -3
- package/dist/cjs/components/button.js.map +2 -2
- package/dist/cjs/components/checkbox.js.map +2 -2
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +1 -1
- package/dist/cjs/components/loadingDots.js +1 -1
- package/dist/cjs/components/loadingDots.js.map +2 -2
- package/dist/cjs/components/picture.js.map +2 -2
- package/dist/cjs/cpn-components/CpnNavigation/index.js +1 -1
- package/dist/cjs/cpn-components/CpnNavigation/index.js.map +3 -3
- package/dist/cjs/cpn-components/CpnNavigation/types.d.ts +1 -0
- package/dist/cjs/cpn-components/CpnNavigation/types.js +1 -1
- package/dist/cjs/cpn-components/CpnNavigation/types.js.map +3 -3
- package/dist/cjs/cpn-components/CpnProductCard/types.d.ts +1 -1
- package/dist/cjs/cpn-components/CpnProductCard/types.js.map +1 -1
- package/dist/cjs/helpers/utils.js.map +1 -1
- package/dist/cjs/hooks/useExposure.js.map +2 -2
- package/dist/cjs/hooks/useExposureDetection.js +1 -1
- package/dist/cjs/hooks/useExposureDetection.js.map +2 -2
- package/dist/cjs/hooks/useIntersectionObserver.js.map +2 -2
- package/dist/cjs/hooks/useRollout.js.map +2 -2
- package/dist/cjs/stories/board.stories.d.ts +1 -1
- package/dist/cjs/stories/board.stories.js +1 -1
- package/dist/cjs/stories/board.stories.js.map +2 -2
- package/dist/cjs/stories/specs.stories.js.map +2 -2
- package/dist/esm/biz-components/AccordionCards/index.js.map +2 -2
- package/dist/esm/biz-components/AplusDesc/index.js +1 -1
- package/dist/esm/biz-components/AplusDesc/index.js.map +2 -2
- package/dist/esm/biz-components/Category/SwiperCategory.js.map +2 -2
- package/dist/esm/biz-components/Category/index.js +1 -1
- package/dist/esm/biz-components/Category/index.js.map +2 -2
- package/dist/esm/biz-components/CreativeModule/index.js +1 -1
- package/dist/esm/biz-components/CreativeModule/index.js.map +2 -2
- package/dist/esm/biz-components/DownLoad/index.js +1 -1
- package/dist/esm/biz-components/DownLoad/index.js.map +1 -1
- package/dist/esm/biz-components/Evaluate/index.js +1 -1
- package/dist/esm/biz-components/Evaluate/index.js.map +1 -1
- package/dist/esm/biz-components/Faq/Faq.js.map +2 -2
- package/dist/esm/biz-components/Features/index.js +1 -1
- package/dist/esm/biz-components/Features/index.js.map +2 -2
- package/dist/esm/biz-components/FootCharger/index.js +1 -1
- package/dist/esm/biz-components/FootCharger/index.js.map +2 -2
- package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.js.map +2 -2
- package/dist/esm/biz-components/GiftBox/index.js +1 -1
- package/dist/esm/biz-components/GiftBox/index.js.map +1 -1
- package/dist/esm/biz-components/Graphic/index.js +1 -1
- package/dist/esm/biz-components/Graphic/index.js.map +2 -2
- package/dist/esm/biz-components/GraphicMore/index.js +1 -1
- package/dist/esm/biz-components/GraphicMore/index.js.map +2 -2
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js.map +1 -1
- package/dist/esm/biz-components/HeaderNavigation/NavProvider.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/icons/Polygon.js.map +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/withCategory.d.ts +1 -1
- package/dist/esm/biz-components/HeaderNavigation/withCategory.js.map +2 -2
- package/dist/esm/biz-components/HeroBanner/Countdown.js +1 -1
- package/dist/esm/biz-components/HeroBanner/Countdown.js.map +1 -1
- package/dist/esm/biz-components/Listing/BizProductProvider.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.js +1 -1
- package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.js.map +1 -1
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js +1 -1
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +1 -1
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +5 -6
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/ModalContainer.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/ModalContainer.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/ProductCard/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +1 -1
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/components/index.js.map +1 -1
- package/dist/esm/biz-components/Listing/const.js.map +1 -1
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.d.ts +1 -1
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.js +1 -1
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.js.map +2 -2
- package/dist/esm/biz-components/Listing/hooks/use-variant.js +1 -1
- package/dist/esm/biz-components/Listing/hooks/use-variant.js.map +2 -2
- package/dist/esm/biz-components/Listing/hooks/useBenefits.js +1 -1
- package/dist/esm/biz-components/Listing/hooks/useBenefits.js.map +2 -2
- package/dist/esm/biz-components/Listing/hooks/useDiscountEnable.js.map +2 -2
- package/dist/esm/biz-components/Listing/index.js +1 -1
- package/dist/esm/biz-components/Listing/index.js.map +1 -1
- package/dist/esm/biz-components/Listing/types/product.d.ts +1 -1
- package/dist/esm/biz-components/Listing/types/product.js +1 -1
- package/dist/esm/biz-components/Listing/types/product.js.map +1 -1
- package/dist/esm/biz-components/Listing/utils/helper.js +1 -1
- package/dist/esm/biz-components/Listing/utils/helper.js.map +2 -2
- package/dist/esm/biz-components/Listing/utils/index.js +1 -1
- package/dist/esm/biz-components/Listing/utils/index.js.map +2 -2
- package/dist/esm/biz-components/Listing/utils/textFormat.js.map +2 -2
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.js +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.js.map +2 -2
- package/dist/esm/biz-components/NavigationSearch/types.js.map +1 -1
- package/dist/esm/biz-components/SearchPage/index.js +1 -1
- package/dist/esm/biz-components/SearchPage/index.js.map +2 -2
- package/dist/esm/biz-components/SearchPage/types.js.map +2 -2
- package/dist/esm/biz-components/SelectStore/index.js +1 -1
- package/dist/esm/biz-components/SelectStore/index.js.map +1 -1
- package/dist/esm/biz-components/ShelfDisplay/index.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/index.js.map +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js.map +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +1 -1
- package/dist/esm/biz-components/Slogan/index.js.map +2 -2
- package/dist/esm/biz-components/Specs/dropdown.js +1 -1
- package/dist/esm/biz-components/Specs/dropdown.js.map +1 -1
- package/dist/esm/biz-components/Specs/index.js +1 -1
- package/dist/esm/biz-components/Specs/index.js.map +2 -2
- package/dist/esm/biz-components/Subscribe/index.js +1 -1
- package/dist/esm/biz-components/Subscribe/index.js.map +2 -2
- package/dist/esm/biz-components/SwiperBox/index.js.map +2 -2
- package/dist/esm/biz-components/Tabs/Tabs.js +1 -1
- package/dist/esm/biz-components/Tabs/Tabs.js.map +2 -2
- package/dist/esm/biz-components/TextModal/index.js +1 -1
- package/dist/esm/biz-components/TextModal/index.js.map +1 -1
- package/dist/esm/biz-components/Title/index.js +1 -1
- package/dist/esm/biz-components/Title/index.js.map +2 -2
- package/dist/esm/biz-components/VideoModal/index.js +1 -1
- package/dist/esm/biz-components/VideoModal/index.js.map +2 -2
- package/dist/esm/biz-components/index.d.ts +1 -1
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +2 -2
- package/dist/esm/components/ExposureDetector.js.map +1 -1
- package/dist/esm/components/board.js +1 -1
- package/dist/esm/components/board.js.map +2 -2
- package/dist/esm/components/button.js.map +2 -2
- package/dist/esm/components/checkbox.js.map +2 -2
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dialog.js.map +1 -1
- package/dist/esm/components/loadingDots.js +1 -1
- package/dist/esm/components/loadingDots.js.map +2 -2
- package/dist/esm/components/picture.js.map +2 -2
- package/dist/esm/cpn-components/CpnNavigation/index.js +1 -1
- package/dist/esm/cpn-components/CpnNavigation/index.js.map +2 -2
- package/dist/esm/cpn-components/CpnNavigation/types.d.ts +1 -0
- package/dist/esm/cpn-components/CpnNavigation/types.js +1 -0
- package/dist/esm/cpn-components/CpnNavigation/types.js.map +3 -3
- package/dist/esm/cpn-components/CpnProductCard/types.d.ts +1 -1
- package/dist/esm/helpers/utils.js.map +1 -1
- package/dist/esm/hooks/useExposure.js.map +2 -2
- package/dist/esm/hooks/useExposureDetection.js +1 -1
- package/dist/esm/hooks/useExposureDetection.js.map +2 -2
- package/dist/esm/hooks/useIntersectionObserver.js.map +2 -2
- package/dist/esm/hooks/useRollout.js.map +2 -2
- package/dist/esm/stories/board.stories.d.ts +1 -1
- package/dist/esm/stories/board.stories.js +1 -1
- package/dist/esm/stories/board.stories.js.map +2 -2
- package/dist/esm/stories/specs.stories.js.map +2 -2
- package/package.json +6 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/biz-components/Listing/utils/textFormat.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * \u5B57\u7B26\u4E32\u6A21\u677F\u66FF\u6362\u5DE5\u5177\u51FD\u6570\n * \u4F7F\u7528\u5355\u6B21\u904D\u5386\u548C\u6B63\u5219\u8868\u8FBE\u5F0F\u7F13\u5B58\u6765\u63D0\u9AD8\u6027\u80FD\n */\n\ntype ReplacementMap = Record<string, string>\n\n// \u7F13\u5B58\u6B63\u5219\u8868\u8FBE\u5F0F\u4EE5\u63D0\u9AD8\u6027\u80FD\nconst regexCache = new Map<string, RegExp>()\n\n/**\n * \u8F6C\u4E49\u6B63\u5219\u8868\u8FBE\u5F0F\u7279\u6B8A\u5B57\u7B26\n * @param str \u9700\u8981\u8F6C\u4E49\u7684\u5B57\u7B26\u4E32\n * @returns \u8F6C\u4E49\u540E\u7684\u5B57\u7B26\u4E32\n */\nfunction escapeRegExp(str: string): string {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\n/**\n * \u83B7\u53D6\u6216\u521B\u5EFA\u6B63\u5219\u8868\u8FBE\u5F0F\uFF08\u5E26\u7F13\u5B58\uFF09\n * @param beginSeg \u5360\u4F4D\u7B26\u5F00\u59CB\u7B26\u53F7\uFF0C\u5982 \"{\"\n * @param endSeg \u5360\u4F4D\u7B26\u7ED3\u675F\u7B26\u53F7\uFF0C\u5982 \"}\"\n * @returns \u7F16\u8BD1\u540E\u7684\u6B63\u5219\u8868\u8FBE\u5F0F\n */\nfunction getRegex(beginSeg: string, endSeg: string): RegExp {\n const cacheKey = `${beginSeg}|${endSeg}`\n\n if (regexCache.has(cacheKey)) {\n return regexCache.get(cacheKey)!\n }\n\n // \u8F6C\u4E49\u7279\u6B8A\u5B57\u7B26\uFF0C\u6784\u5EFA\u6B63\u5219\u8868\u8FBE\u5F0F\n // \u5339\u914D beginSeg + key + endSeg\uFF0Ckey \u53EF\u4EE5\u662F\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF\u3001\u8FDE\u5B57\u7B26\n const escapedBegin = escapeRegExp(beginSeg)\n const escapedEnd = escapeRegExp(endSeg)\n const regex = new RegExp(`${escapedBegin}([a-zA-Z0-9_-]+)${escapedEnd}`, 'g')\n\n regexCache.set(cacheKey, regex)\n return regex\n}\n\n/**\n * \u5B57\u7B26\u4E32\u6A21\u677F\u66FF\u6362\u51FD\u6570\n * @param template \u6A21\u677F\u5B57\u7B26\u4E32\uFF0C\u5982 \"Hello {name}, you have {count} messages\"\n * @param replacements \u66FF\u6362\u5BF9\u8C61\uFF0C\u5982 { name: \"John\", count: \"5\" }\n * @param beginSeg \u5360\u4F4D\u7B26\u5F00\u59CB\u7B26\u53F7\uFF0C\u9ED8\u8BA4\u4E3A \"{\"\n * @param endSeg \u5360\u4F4D\u7B26\u7ED3\u675F\u7B26\u53F7\uFF0C\u9ED8\u8BA4\u4E3A \"}\"\n * @returns \u66FF\u6362\u540E\u7684\u5B57\u7B26\u4E32\n *\n * @example\n * ```ts\n * replaceTemplate(\"Hello {name}!\", { name: \"World\" })\n * // => \"Hello World!\"\n *\n * replaceTemplate(\"Price: {{amount}}\", { amount: \"$100\" }, \"{{\", \"}}\")\n * // => \"Price: $100\"\n *\n * replaceTemplate(\"You have {count} items\", { count: \"5\", unused: \"test\" })\n * // => \"You have 5 items\" (unused \u952E\u4F1A\u88AB\u5FFD\u7565)\n *\n * replaceTemplate(\"Hello ${name}!\", { name: \"World\" }, \"${\", \"}\")\n * // => \"Hello World!\"\n * ```\n */\nexport function replaceTemplate(\n template: string,\n replacements: ReplacementMap,\n beginSeg: string = '{',\n endSeg: string = '}'
|
|
5
|
-
"mappings": "AAQA,MAAMA,EAAa,IAAI,IAOvB,SAASC,EAAaC,EAAqB,CACzC,OAAOA,EAAI,QAAQ,sBAAuB,MAAM,CAClD,CAQA,SAASC,EAASC,EAAkBC,EAAwB,CAC1D,MAAMC,EAAW,GAAGF,CAAQ,IAAIC,CAAM,GAEtC,GAAIL,EAAW,IAAIM,CAAQ,EACzB,OAAON,EAAW,IAAIM,CAAQ,EAKhC,MAAMC,EAAeN,EAAaG,CAAQ,EACpCI,EAAaP,EAAaI,CAAM,EAChCI,EAAQ,IAAI,OAAO,GAAGF,CAAY,mBAAmBC,CAAU,GAAI,GAAG,EAE5E,OAAAR,EAAW,IAAIM,EAAUG,CAAK,EACvBA,CACT,CAyBO,SAASC,EACdC,EACAC,EACAR,EAAmB,IACnBC,EAAiB,IACT,CAER,GADI,CAACM,GACD,CAACC,GAAgB,OAAO,KAAKA,CAAY,EAAE,SAAW,EAAG,OAAOD,EAEpE,MAAMF,EAAQN,EAASC,EAAUC,CAAM,EAGvC,OAAOM,EAAS,QAAQF,EAAO,CAACI,EAAOC,IAG9BF,EAAaE,CAAG,IAAM,OAAYF,EAAaE,CAAG,EAAID,CAC9D,CACH,CA2BO,SAASE,EACdC,EACAJ,EACAR,EAAmB,IACnBC,EAAiB,IACP,CACV,OAAOW,EAAU,
|
|
4
|
+
"sourcesContent": ["/**\n * \u5B57\u7B26\u4E32\u6A21\u677F\u66FF\u6362\u5DE5\u5177\u51FD\u6570\n * \u4F7F\u7528\u5355\u6B21\u904D\u5386\u548C\u6B63\u5219\u8868\u8FBE\u5F0F\u7F13\u5B58\u6765\u63D0\u9AD8\u6027\u80FD\n */\n\ntype ReplacementMap = Record<string, string>\n\n// \u7F13\u5B58\u6B63\u5219\u8868\u8FBE\u5F0F\u4EE5\u63D0\u9AD8\u6027\u80FD\nconst regexCache = new Map<string, RegExp>()\n\n/**\n * \u8F6C\u4E49\u6B63\u5219\u8868\u8FBE\u5F0F\u7279\u6B8A\u5B57\u7B26\n * @param str \u9700\u8981\u8F6C\u4E49\u7684\u5B57\u7B26\u4E32\n * @returns \u8F6C\u4E49\u540E\u7684\u5B57\u7B26\u4E32\n */\nfunction escapeRegExp(str: string): string {\n return str.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\$&')\n}\n\n/**\n * \u83B7\u53D6\u6216\u521B\u5EFA\u6B63\u5219\u8868\u8FBE\u5F0F\uFF08\u5E26\u7F13\u5B58\uFF09\n * @param beginSeg \u5360\u4F4D\u7B26\u5F00\u59CB\u7B26\u53F7\uFF0C\u5982 \"{\"\n * @param endSeg \u5360\u4F4D\u7B26\u7ED3\u675F\u7B26\u53F7\uFF0C\u5982 \"}\"\n * @returns \u7F16\u8BD1\u540E\u7684\u6B63\u5219\u8868\u8FBE\u5F0F\n */\nfunction getRegex(beginSeg: string, endSeg: string): RegExp {\n const cacheKey = `${beginSeg}|${endSeg}`\n\n if (regexCache.has(cacheKey)) {\n return regexCache.get(cacheKey)!\n }\n\n // \u8F6C\u4E49\u7279\u6B8A\u5B57\u7B26\uFF0C\u6784\u5EFA\u6B63\u5219\u8868\u8FBE\u5F0F\n // \u5339\u914D beginSeg + key + endSeg\uFF0Ckey \u53EF\u4EE5\u662F\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF\u3001\u8FDE\u5B57\u7B26\n const escapedBegin = escapeRegExp(beginSeg)\n const escapedEnd = escapeRegExp(endSeg)\n const regex = new RegExp(`${escapedBegin}([a-zA-Z0-9_-]+)${escapedEnd}`, 'g')\n\n regexCache.set(cacheKey, regex)\n return regex\n}\n\n/**\n * \u5B57\u7B26\u4E32\u6A21\u677F\u66FF\u6362\u51FD\u6570\n * @param template \u6A21\u677F\u5B57\u7B26\u4E32\uFF0C\u5982 \"Hello {name}, you have {count} messages\"\n * @param replacements \u66FF\u6362\u5BF9\u8C61\uFF0C\u5982 { name: \"John\", count: \"5\" }\n * @param beginSeg \u5360\u4F4D\u7B26\u5F00\u59CB\u7B26\u53F7\uFF0C\u9ED8\u8BA4\u4E3A \"{\"\n * @param endSeg \u5360\u4F4D\u7B26\u7ED3\u675F\u7B26\u53F7\uFF0C\u9ED8\u8BA4\u4E3A \"}\"\n * @returns \u66FF\u6362\u540E\u7684\u5B57\u7B26\u4E32\n *\n * @example\n * ```ts\n * replaceTemplate(\"Hello {name}!\", { name: \"World\" })\n * // => \"Hello World!\"\n *\n * replaceTemplate(\"Price: {{amount}}\", { amount: \"$100\" }, \"{{\", \"}}\")\n * // => \"Price: $100\"\n *\n * replaceTemplate(\"You have {count} items\", { count: \"5\", unused: \"test\" })\n * // => \"You have 5 items\" (unused \u952E\u4F1A\u88AB\u5FFD\u7565)\n *\n * replaceTemplate(\"Hello ${name}!\", { name: \"World\" }, \"${\", \"}\")\n * // => \"Hello World!\"\n * ```\n */\nexport function replaceTemplate(\n template: string,\n replacements: ReplacementMap,\n beginSeg: string = '{',\n endSeg: string = '}'\n): string {\n if (!template) return template\n if (!replacements || Object.keys(replacements).length === 0) return template\n\n const regex = getRegex(beginSeg, endSeg)\n\n // \u4F7F\u7528 replace \u65B9\u6CD5\u8FDB\u884C\u66FF\u6362\uFF0C\u6027\u80FD\u4F18\u4E8E\u624B\u52A8\u904D\u5386\n return template.replace(regex, (match, key) => {\n // \u5982\u679C key \u5B58\u5728\u4E8E replacements \u4E2D\uFF0C\u5219\u8FD4\u56DE\u5BF9\u5E94\u7684\u503C\n // \u5426\u5219\u4FDD\u6301\u539F\u6837\uFF08\u8FD4\u56DE\u6574\u4E2A\u5339\u914D\u5185\u5BB9\uFF09\n return replacements[key] !== undefined ? replacements[key] : match\n })\n}\n\n/**\n * \u6279\u91CF\u5B57\u7B26\u4E32\u6A21\u677F\u66FF\u6362\u51FD\u6570\uFF08\u7528\u4E8E\u4E00\u6B21\u6027\u66FF\u6362\u591A\u4E2A\u6A21\u677F\uFF09\n * @param templates \u6A21\u677F\u5B57\u7B26\u4E32\u6570\u7EC4\n * @param replacements \u66FF\u6362\u5BF9\u8C61\n * @param beginSeg \u5360\u4F4D\u7B26\u5F00\u59CB\u7B26\u53F7\uFF0C\u9ED8\u8BA4\u4E3A \"{\"\n * @param endSeg \u5360\u4F4D\u7B26\u7ED3\u675F\u7B26\u53F7\uFF0C\u9ED8\u8BA4\u4E3A \"}\"\n * @returns \u66FF\u6362\u540E\u7684\u5B57\u7B26\u4E32\u6570\u7EC4\n *\n * @example\n * ```ts\n * replaceTemplates(\n * [\"Hello {name}!\", \"You have {count} items\"],\n * { name: \"John\", count: \"5\" }\n * )\n * // => [\"Hello John!\", \"You have 5 items\"]\n *\n * replaceTemplates(\n * [\"Hello {{name}}!\", \"Price: {{amount}}\"],\n * { name: \"John\", amount: \"$100\" },\n * \"{{\",\n * \"}}\"\n * )\n * // => [\"Hello John!\", \"Price: $100\"]\n * ```\n */\nexport function replaceTemplates(\n templates: string[],\n replacements: ReplacementMap,\n beginSeg: string = '{',\n endSeg: string = '}'\n): string[] {\n return templates.map(template => replaceTemplate(template, replacements, beginSeg, endSeg))\n}\n\n/**\n * \u4ECE\u6A21\u677F\u5B57\u7B26\u4E32\u4E2D\u63D0\u53D6\u6240\u6709\u5360\u4F4D\u7B26\u952E\u540D\n * @param template \u6A21\u677F\u5B57\u7B26\u4E32\n * @param beginSeg \u5360\u4F4D\u7B26\u5F00\u59CB\u7B26\u53F7\uFF0C\u9ED8\u8BA4\u4E3A \"{\"\n * @param endSeg \u5360\u4F4D\u7B26\u7ED3\u675F\u7B26\u53F7\uFF0C\u9ED8\u8BA4\u4E3A \"}\"\n * @returns \u5360\u4F4D\u7B26\u952E\u540D\u6570\u7EC4\uFF08\u53BB\u91CD\uFF09\n *\n * @example\n * ```ts\n * extractPlaceholders(\"Hello {name}, you have {count} new {count} messages\")\n * // => [\"name\", \"count\"]\n *\n * extractPlaceholders(\"Hello {{name}}, price is {{amount}}\", \"{{\", \"}}\")\n * // => [\"name\", \"amount\"]\n * ```\n */\nexport function extractPlaceholders(template: string, beginSeg: string = '{', endSeg: string = '}'): string[] {\n if (!template) return []\n\n const regex = getRegex(beginSeg, endSeg)\n const keys = new Set<string>()\n let match: RegExpExecArray | null\n\n // \u4F7F\u7528 exec \u5FAA\u73AF\u66FF\u4EE3 matchAll \u4EE5\u4FDD\u8BC1\u517C\u5BB9\u6027\n while ((match = regex.exec(template)) !== null) {\n keys.add(match[1])\n }\n\n return Array.from(keys)\n}\n"],
|
|
5
|
+
"mappings": "AAQA,MAAMA,EAAa,IAAI,IAOvB,SAASC,EAAaC,EAAqB,CACzC,OAAOA,EAAI,QAAQ,sBAAuB,MAAM,CAClD,CAQA,SAASC,EAASC,EAAkBC,EAAwB,CAC1D,MAAMC,EAAW,GAAGF,CAAQ,IAAIC,CAAM,GAEtC,GAAIL,EAAW,IAAIM,CAAQ,EACzB,OAAON,EAAW,IAAIM,CAAQ,EAKhC,MAAMC,EAAeN,EAAaG,CAAQ,EACpCI,EAAaP,EAAaI,CAAM,EAChCI,EAAQ,IAAI,OAAO,GAAGF,CAAY,mBAAmBC,CAAU,GAAI,GAAG,EAE5E,OAAAR,EAAW,IAAIM,EAAUG,CAAK,EACvBA,CACT,CAyBO,SAASC,EACdC,EACAC,EACAR,EAAmB,IACnBC,EAAiB,IACT,CAER,GADI,CAACM,GACD,CAACC,GAAgB,OAAO,KAAKA,CAAY,EAAE,SAAW,EAAG,OAAOD,EAEpE,MAAMF,EAAQN,EAASC,EAAUC,CAAM,EAGvC,OAAOM,EAAS,QAAQF,EAAO,CAACI,EAAOC,IAG9BF,EAAaE,CAAG,IAAM,OAAYF,EAAaE,CAAG,EAAID,CAC9D,CACH,CA2BO,SAASE,EACdC,EACAJ,EACAR,EAAmB,IACnBC,EAAiB,IACP,CACV,OAAOW,EAAU,IAAIL,GAAYD,EAAgBC,EAAUC,EAAcR,EAAUC,CAAM,CAAC,CAC5F,CAkBO,SAASY,EAAoBN,EAAkBP,EAAmB,IAAKC,EAAiB,IAAe,CAC5G,GAAI,CAACM,EAAU,MAAO,CAAC,EAEvB,MAAMF,EAAQN,EAASC,EAAUC,CAAM,EACjCa,EAAO,IAAI,IACjB,IAAIL,EAGJ,MAAQA,EAAQJ,EAAM,KAAKE,CAAQ,KAAO,MACxCO,EAAK,IAAIL,EAAM,CAAC,CAAC,EAGnB,OAAO,MAAM,KAAKK,CAAI,CACxB",
|
|
6
6
|
"names": ["regexCache", "escapeRegExp", "str", "getRegex", "beginSeg", "endSeg", "cacheKey", "escapedBegin", "escapedEnd", "regex", "replaceTemplate", "template", "replacements", "match", "key", "replaceTemplates", "templates", "extractPlaceholders", "keys"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as H,jsx as t,jsxs as o}from"react/jsx-runtime";import j,{useState as P,useEffect as D,useRef as Q}from"react";import{useMediaQuery as Y}from"react-responsive";import{withLayout as q}from"../../shared/Styles.js";import _ from"../../components/picture.js";import S from"../../components/button.js";import{Heading as z}from"../../components/heading.js";import{VideoModal as A}from"../VideoModal/index.js";import{Grid as O,GridItem as R}from"../../components/gird.js";import Z from"../Title/index.js";import{cn as T,spaceToHyphen as C}from"../../helpers/utils.js";import L from"../SwiperBox/index.js";import{isVideo as U}from"../../shared/mimeType.js";import{Tabs as F,TabsList as J,TabsTrigger as K,TabsContent as W}from"../../components/tabs.js";import{useExposure as X}from"../../hooks/useExposure.js";import{trackUrlRef as I}from"../../shared/trackUrlRef.js";import{gaTrack as ee}from"../../shared/track.js";const h="image",f="p1_banner",M=({data:i,configuration:r,jIndex:c,spanType:k,title:
|
|
1
|
+
import{Fragment as H,jsx as t,jsxs as o}from"react/jsx-runtime";import j,{useState as P,useEffect as D,useRef as Q}from"react";import{useMediaQuery as Y}from"react-responsive";import{withLayout as q}from"../../shared/Styles.js";import _ from"../../components/picture.js";import S from"../../components/button.js";import{Heading as z}from"../../components/heading.js";import{VideoModal as A}from"../VideoModal/index.js";import{Grid as O,GridItem as R}from"../../components/gird.js";import Z from"../Title/index.js";import{cn as T,spaceToHyphen as C}from"../../helpers/utils.js";import L from"../SwiperBox/index.js";import{isVideo as U}from"../../shared/mimeType.js";import{Tabs as F,TabsList as J,TabsTrigger as K,TabsContent as W}from"../../components/tabs.js";import{useExposure as X}from"../../hooks/useExposure.js";import{trackUrlRef as I}from"../../shared/trackUrlRef.js";import{gaTrack as ee}from"../../shared/track.js";const h="image",f="p1_banner",M=({data:i,configuration:r,jIndex:c,spanType:k,title:b,onSecondaryButtonClick:p,onPrimaryButtonClick:v})=>{const[y,m]=P(!1),B=Y({query:"(max-width: 768px)"}),x=Q(null),$=()=>{if(k)switch(k){case"full":return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case"half":return"tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case"one-third":return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}else switch(r?.num){case 1:return"tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]";case 2:return"tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]";case 3:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]";default:return"tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]"}};X(x,{componentType:h,componentName:f,position:c,componentTitle:i.title,componentDescription:i.description,navigation:r?.activeTab}),D(()=>{m(B)},[B]);const{theme:N="light",title:d,description:u,imageUrl:l,primaryButton:n,secondaryButton:s,imageMobileUrl:w,blockLink:g,video:e,youtubeId:a,isYouTube:V}=i,G="lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]";return o("div",{className:T("item-wrapper cursor-pointer","text-info-primary group relative box-border w-full overflow-hidden",$(),{"rounded-2xl":r?.shape==="rounded","aiui-dark":N==="dark","h-[400px]":y},"text-info-primary"),ref:x,children:[(g||s.link)&&t("a",{className:"absolute inset-0 z-10",href:I(g||s.link,`${h}_${f}`),"data-headless-type-name":`${h}#${f}`,"data-headless-title-desc-button":`${d}#${u}`,"data-headless-nav-postion":`${r?.activeTab}#${c}`,"aria-hidden":"true",tabIndex:-1}),o("div",{className:"absolute inset-0",children:[U(l?.mimeType)?t("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:block hidden size-full overflow-hidden object-cover",children:t("source",{src:l?.url,type:"video/mp4"})}):t(_,{source:l?.url,alt:l?.alt||"",className:"tablet:block hidden h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 group-hover:scale-105 object-cover",style:{aspectRatio:`${l?.width}/${l?.height}`}}),U(w?.mimeType)?t("video",{autoPlay:!0,muted:!0,playsInline:!0,loop:!0,className:"tablet:hidden block size-full overflow-hidden object-cover",children:t("source",{src:w?.url,type:"video/mp4"})}):t(_,{source:w?.url||l?.url,alt:w?.alt||l?.alt||"",className:"tablet:hidden block h-full overflow-hidden",imgClassName:"h-full transition-all duration-300 object-cover"}),o("div",{className:T("absolutestyle laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4",{"fullstyle laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto":i?.width==="full"}),children:[o("div",{className:"flex flex-col gap-1",children:[t(z,{size:3,as:"h3",className:"item-title",html:d}),t(z,{as:"h4",className:"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1 text-[14px]",html:u})]}),o("div",{className:"lg-desktop:gap-3 flex gap-2",children:[s&&s.text&&o(S,{"aria-label":d??u,className:T(G,"link-left"),variant:"secondary",as:"a",onClick:()=>{p?.(i)},href:I(s.link,`${h}_${f}`),"data-headless-type-name":`${h}#${f}`,"data-headless-title-desc-button":`${d}#${u}#${s.text}`,"data-headless-nav-postion":`${r?.activeTab}#${c}`,children:[s.text,t("span",{className:"sr-only",children:d??u})]}),n&&n.text&&t(S,{"aria-label":d??u,className:T(G,"link-right"),variant:"primary",as:"a",onClick:()=>{v?.(i)},href:I(n.link,`${h}_${f}`),"data-headless-type-name":`${h}#${f}`,"data-headless-title-desc-button":`${d}#${u}#${n.text}`,"data-headless-nav-postion":`${r?.activeTab}#${c}`,children:n.text})]})]})]}),t("div",{children:t("div",{className:"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4 z-20",children:(e?.url||a)&&t("button",{onClick:()=>{r?.onVideoPlayBtnClick?.(e?.url||a,V)},className:"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75",children:t("svg",{width:"12",height:"14",viewBox:"0 0 12 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t("path",{d:"M12 7L0 14L0 0L12 7Z",fill:"white"})})})})})]})},E=j.forwardRef((i,r)=>{const{onSecondaryButtonClick:c,onPrimaryButtonClick:k}=i,{shape:b,sectionTitle:p,groupByTab:v=!1,items:y=[],carousel:m}=i.data,[B,x]=P(!1),[$,N]=P(""),[d,u]=P(""),l=e=>{switch(e){case"full":return 12;case"half":return 6;case"one-third":return 4}},n=y.map(e=>e.tabName).filter(Boolean).filter((e,a,V)=>V.indexOf(e)===a),s=(e,a)=>{x(!0),a?u?.(e||""):N?.(e||"")},w=(e,a)=>{switch(e){case 1:return 1;case 2:return 2;default:return a?2.3:3}},g=n.map(e=>({tabName:e,items:y.filter(a=>a.tabName===e)})).reduce((e,a)=>(e[a.tabName]=a.items,e),{});return o("section",{"data-ui-component-id":"MultiLayoutGraphicBlock",ref:r,className:T("multiLayoutGraphicBlock","text-info-primary",i.className),children:[p&&t(Z,{data:{title:p},className:"section-title"}),v?o(F,{shape:b,align:"left",defaultValue:C(n[0]),children:[t(J,{children:n.map((e,a)=>t(K,{value:C(e),onClick:()=>{ee({event:"ga4Event",event_name:"component_click",event_parameters:{page_group:"Home Page",component_type:h,component_name:f,component_title:p,component_position:1,navigation:e,button_name:e}})},children:e},a))}),n.map((e,a)=>t(W,{value:C(e),className:"desktop:mt-[36px] mt-[24px] w-full",children:o(H,{children:[t(L,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock1",data:{list:g?.[e]||[],configuration:{shape:b,isTab:v,activeTab:e,title:p,num:g?.[e]?.length||0,onVideoPlayBtnClick:s,onSecondaryButtonClick:c,onPrimaryButtonClick:k}},Slide:M,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:w(g?.[e]?.length||0,!0)},1024:{spaceBetween:16,freeMode:!1,slidesPerView:w(g?.[e]?.length||0)}}}),m&&m?.items.length>0?t(L,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock2",data:{list:m?.items||[],configuration:{shape:b,isTab:v,onVideoPlayBtnClick:s,title:p,onSecondaryButtonClick:c,onPrimaryButtonClick:k}},Slide:M,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3.1},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}}):null]})},a))]}):o(H,{children:[o(O,{className:"w-full",children:[y.map((e,a)=>t(R,{span:l(e.width??"full"),className:"laptop:block hidden",children:t(M,{data:e,configuration:{shape:b,onVideoPlayBtnClick:s,title:p},jIndex:a,spanType:e.width,onSecondaryButtonClick:c,onPrimaryButtonClick:k})},`${e?.title||""}${a}`)),y.map((e,a)=>t(R,{span:l("full"),className:"laptop:hidden block",children:t(M,{data:e,configuration:{shape:b,onVideoPlayBtnClick:s,title:p},jIndex:a,spanType:"full"})},`${e?.title||""}${a}`))]}),m&&m?.items.length>0?t(L,{className:"!overflow-visible",id:"MultiLayoutGraphicBlock3",data:{list:m?.items||[],configuration:{shape:b,onVideoPlayBtnClick:s,title:p,onSecondaryButtonClick:c,onPrimaryButtonClick:k}},Slide:M,breakpoints:{0:{spaceBetween:12,freeMode:!1,slidesPerView:1},374:{spaceBetween:12,freeMode:!1,slidesPerView:1.2},768:{spaceBetween:16,freeMode:!1,slidesPerView:2.3},1024:{spaceBetween:16,freeMode:!1,slidesPerView:3.1},1440:{spaceBetween:16,freeMode:!1,slidesPerView:4}}}):null]}),B&&t(A,{visible:B,youTubeId:d,videoUrl:$,onCloseModal:()=>x(!1)})]})});E.displayName="MultiLayoutGraphicBlock";var be=q(E);export{be as default};
|
|
2
2
|
//# sourceMappingURL=MultiLayoutGraphicBlock.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.tsx"],
|
|
4
|
-
"sourcesContent": ["import React, { useState, useEffect, useRef } from 'react'\nimport { useMediaQuery } from 'react-responsive'\nimport type { MultiLayoutGraphicBlockProps, Item } from './types'\nimport { withLayout } from '../../shared/Styles.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport { Heading } from '../../components/heading.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport Title from '../Title/index.js'\nimport { cn, spaceToHyphen } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { isVideo } from '../../shared/mimeType.js'\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from '../../components/tabs.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { gaTrack } from '../../shared/track.js'\n\nconst componentType = 'image'\nconst componentName = 'p1_banner'\n\nconst ItemBlock = ({\n data: item,\n configuration,\n jIndex,\n spanType,\n title: titleProp,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n}: {\n data: Item\n configuration?: any\n jIndex?: number\n spanType?: string\n title?: string\n onSecondaryButtonClick?: (data: Item) => void\n onPrimaryButtonClick?: (data: Item) => void\n}) => {\n const [isMobile, setIsMobile] = useState<boolean>(false)\n const mediaQuery = useMediaQuery({ query: '(max-width: 768px)' })\n\n const ref = useRef<HTMLDivElement>(null)\n\n const handleAspect = () => {\n if (spanType) {\n switch (spanType) {\n case 'full':\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 'half':\n return 'tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]'\n case 'one-third':\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n }\n } else {\n switch (configuration?.num) {\n case 1:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 2:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]'\n case 3:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n }\n }\n }\n\n useExposure(ref, {\n componentType: componentType,\n componentName: componentName,\n position: jIndex,\n componentTitle: item.title,\n componentDescription: item.description,\n navigation: configuration?.activeTab,\n })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const {\n theme = 'light',\n title,\n description,\n imageUrl,\n primaryButton,\n secondaryButton,\n imageMobileUrl,\n blockLink,\n video,\n youtubeId,\n isYouTube,\n } = item\n const lgButtonSize = 'lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]'\n\n return (\n <div\n className={cn(\n 'item-wrapper cursor-pointer',\n 'text-info-primary group relative box-border w-full overflow-hidden',\n handleAspect(),\n {\n 'rounded-2xl': configuration?.shape === 'rounded',\n 'aiui-dark': theme === 'dark',\n 'h-[400px]': isMobile,\n },\n `text-info-primary`\n )}\n ref={ref}\n >\n {(blockLink || secondaryButton.link) && (\n <a\n className=\"absolute inset-0 z-10\"\n href={trackUrlRef(blockLink || secondaryButton.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}`}\n data-headless-nav-postion={`${configuration?.activeTab}#${jIndex}`}\n aria-hidden=\"true\"\n tabIndex={-1}\n />\n )}\n <div className=\"absolute inset-0\">\n {isVideo(imageUrl?.mimeType) ? (\n <video\n autoPlay\n muted\n playsInline\n loop\n className=\"tablet:block hidden overflow-hidden w-full h-full object-cover\"\n >\n <source src={imageUrl?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={imageUrl?.url}\n alt={imageUrl?.alt || ''}\n className=\"tablet:block hidden h-full overflow-hidden\"\n imgClassName=\"h-full transition-all duration-300 group-hover:scale-105 object-cover\"\n style={{ aspectRatio: `${imageUrl?.width}/${imageUrl?.height}` }}\n />\n )}\n {isVideo(imageMobileUrl?.mimeType) ? (\n <video\n autoPlay\n muted\n playsInline\n loop\n className=\"tablet:hidden block overflow-hidden w-full h-full object-cover\"\n >\n <source src={imageMobileUrl?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={imageMobileUrl?.url || imageUrl?.url}\n alt={imageMobileUrl?.alt || imageUrl?.alt || ''}\n className=\"tablet:hidden block h-full overflow-hidden\"\n imgClassName=\"h-full transition-all duration-300 object-cover\"\n />\n )}\n <div\n className={cn(\n 'absolutestyle laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4',\n {\n 'fullstyle laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto': item?.width === 'full',\n }\n )}\n >\n <div className=\"flex flex-col gap-1\">\n <Heading size={3} as=\"h3\" className=\"item-title\" html={title} />\n <Heading\n as=\"h4\"\n className=\"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1 text-[14px]\"\n html={description}\n />\n </div>\n <div className=\"lg-desktop:gap-3 flex gap-2\">\n {secondaryButton && secondaryButton.text && (\n <Button\n aria-label={title ?? description}\n className={cn(lgButtonSize, 'link-left')}\n variant=\"secondary\"\n as=\"a\"\n onClick={() => {\n onSecondaryButtonClick?.(item)\n }}\n href={trackUrlRef(secondaryButton.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}#${secondaryButton.text}`}\n data-headless-nav-postion={`${configuration?.activeTab}#${jIndex}`}\n >\n {secondaryButton.text}\n <span className=\"sr-only\">{title ?? description}</span>\n </Button>\n )}\n {primaryButton && primaryButton.text && (\n <Button\n aria-label={title ?? description}\n className={cn(lgButtonSize, 'link-right')}\n variant=\"primary\"\n as=\"a\"\n onClick={() => {\n onPrimaryButtonClick?.(item)\n }}\n href={trackUrlRef(primaryButton.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}#${primaryButton.text}`}\n data-headless-nav-postion={`${configuration?.activeTab}#${jIndex}`}\n >\n {primaryButton.text}\n </Button>\n )}\n </div>\n </div>\n </div>\n <div>\n <div className=\"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4 z-20\">\n {(video?.url || youtubeId) && (\n <button\n onClick={() => {\n configuration?.onVideoPlayBtnClick?.(video?.url || youtubeId, isYouTube)\n }}\n className=\"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst MultiLayoutGraphicBlock = React.forwardRef<HTMLDivElement, MultiLayoutGraphicBlockProps>((props, ref) => {\n const { onSecondaryButtonClick, onPrimaryButtonClick } = props\n const { shape, sectionTitle, groupByTab = false, items = [], carousel } = props.data\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n\n const getSpan = (width: 'full' | 'half' | 'one-third') => {\n switch (width) {\n case 'full':\n return 12\n case 'half':\n return 6\n case 'one-third':\n return 4\n }\n }\n\n const tabNames = items\n .map(item => item.tabName)\n .filter(Boolean)\n .filter((item, index, arr) => arr.indexOf(item) === index) as string[]\n\n const handleVideoPlayBtnClick = (url: string, isYouTube: boolean) => {\n setVisible(true)\n if (isYouTube) {\n setYouTubeId?.(url || '')\n } else {\n setVideoUrl?.(url || '')\n }\n }\n const handleTabNumber = (num: Number, flag?: boolean) => {\n switch (num) {\n case 1:\n return 1\n case 2:\n return 2\n default:\n return flag ? 2.3 : 3\n }\n }\n\n const tabItemsMaps = tabNames\n .map(tabName => ({\n tabName,\n items: items.filter(item => item.tabName === tabName),\n }))\n .reduce(\n (acc, cur) => {\n acc[cur.tabName] = cur.items\n return acc\n },\n {} as Record<string, (Item & { width?: 'full' | 'half' | 'one-third' })[]>\n )\n\n return (\n <section\n data-ui-component-id=\"MultiLayoutGraphicBlock\"\n ref={ref}\n className={cn('multiLayoutGraphicBlock', 'text-info-primary', props.className)}\n >\n {sectionTitle && <Title data={{ title: sectionTitle }} className=\"section-title\" />}\n\n {groupByTab ? (\n <Tabs shape={shape} align=\"left\" defaultValue={spaceToHyphen(tabNames[0]!)}>\n <TabsList>\n {tabNames.map((tabName, index) => (\n <TabsTrigger\n key={index}\n value={spaceToHyphen(tabName!)}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: sectionTitle,\n component_position: 1,\n navigation: tabName,\n button_name: tabName,\n },\n })\n }}\n >\n {tabName}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabNames.map((tabName, index) => (\n <TabsContent key={index} value={spaceToHyphen(tabName!)} className=\"desktop:mt-[36px] mt-[24px] w-full\">\n <>\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock1'}\n data={{\n list: tabItemsMaps?.[tabName] || [],\n configuration: {\n shape: shape,\n isTab: groupByTab,\n activeTab: tabName,\n title: sectionTitle,\n num: tabItemsMaps?.[tabName]?.length || 0,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleTabNumber(tabItemsMaps?.[tabName]?.length || 0, true),\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleTabNumber(tabItemsMaps?.[tabName]?.length || 0),\n },\n }}\n />\n {carousel && carousel?.items.length > 0 ? (\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock2'}\n data={{\n list: carousel?.items || [],\n configuration: {\n shape: shape,\n isTab: groupByTab,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n title: sectionTitle,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3.1,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n ) : null}\n </>\n </TabsContent>\n ))}\n </Tabs>\n ) : (\n <>\n <Grid className=\"w-full\">\n {items.map((item, index) => {\n return (\n <GridItem\n key={`${item?.title || ''}${index}`}\n span={getSpan(item.width ?? 'full')}\n className=\"laptop:block hidden\"\n >\n <ItemBlock\n data={item}\n configuration={{ shape: shape, onVideoPlayBtnClick: handleVideoPlayBtnClick, title: sectionTitle }}\n jIndex={index}\n spanType={item.width}\n onSecondaryButtonClick={onSecondaryButtonClick}\n onPrimaryButtonClick={onPrimaryButtonClick}\n />\n </GridItem>\n )\n })}\n {items.map((item, index) => (\n <GridItem key={`${item?.title || ''}${index}`} span={getSpan('full')} className=\"laptop:hidden block\">\n <ItemBlock\n data={item}\n configuration={{ shape: shape, onVideoPlayBtnClick: handleVideoPlayBtnClick, title: sectionTitle }}\n jIndex={index}\n spanType={'full'}\n />\n </GridItem>\n ))}\n </Grid>\n {carousel && carousel?.items.length > 0 ? (\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock3'}\n data={{\n list: carousel?.items || [],\n configuration: {\n shape: shape,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n title: sectionTitle,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3.1,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n ) : null}\n </>\n )}\n {visible && (\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n videoUrl={videoUrl}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </section>\n )\n})\n\nMultiLayoutGraphicBlock.displayName = 'MultiLayoutGraphicBlock'\n\nexport default withLayout(MultiLayoutGraphicBlock)\nexport type { MultiLayoutGraphicBlockProps }\n"],
|
|
5
|
-
"mappings": "AAiHQ,
|
|
4
|
+
"sourcesContent": ["import React, { useState, useEffect, useRef } from 'react'\nimport { useMediaQuery } from 'react-responsive'\nimport type { MultiLayoutGraphicBlockProps, Item } from './types'\nimport { withLayout } from '../../shared/Styles.js'\nimport Picture from '../../components/picture.js'\nimport Button from '../../components/button.js'\nimport { Heading } from '../../components/heading.js'\nimport { VideoModal } from '../VideoModal/index.js'\nimport { Grid, GridItem } from '../../components/gird.js'\nimport Title from '../Title/index.js'\nimport { cn, spaceToHyphen } from '../../helpers/utils.js'\nimport SwiperBox from '../SwiperBox/index.js'\nimport { isVideo } from '../../shared/mimeType.js'\nimport { Tabs, TabsList, TabsTrigger, TabsContent } from '../../components/tabs.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { trackUrlRef } from '../../shared/trackUrlRef.js'\nimport { gaTrack } from '../../shared/track.js'\n\nconst componentType = 'image'\nconst componentName = 'p1_banner'\n\nconst ItemBlock = ({\n data: item,\n configuration,\n jIndex,\n spanType,\n title: titleProp,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n}: {\n data: Item\n configuration?: any\n jIndex?: number\n spanType?: string\n title?: string\n onSecondaryButtonClick?: (data: Item) => void\n onPrimaryButtonClick?: (data: Item) => void\n}) => {\n const [isMobile, setIsMobile] = useState<boolean>(false)\n const mediaQuery = useMediaQuery({ query: '(max-width: 768px)' })\n\n const ref = useRef<HTMLDivElement>(null)\n\n const handleAspect = () => {\n if (spanType) {\n switch (spanType) {\n case 'full':\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 'half':\n return 'tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]'\n case 'one-third':\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n }\n } else {\n switch (configuration?.num) {\n case 1:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[400] laptop:aspect-w-[896] laptop:aspect-h-[384] desktop:aspect-w-[1312] desktop:aspect-h-[512] lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[640]'\n case 2:\n return 'tablet:aspect-w-[704] tablet:aspect-h-[480] laptop:aspect-w-[440] laptop:aspect-h-[384] desktop:aspect-w-[648] desktop:aspect-h-[512] lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[640]'\n case 3:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n default:\n return 'tablet:aspect-w-[296] tablet:aspect-h-[400] laptop:aspect-w-[288] laptop:aspect-h-[384] desktop:aspect-w-[427] desktop:aspect-h-[512] lg-desktop:aspect-w-[544] lg-desktop:aspect-h-[640]'\n }\n }\n }\n\n useExposure(ref, {\n componentType: componentType,\n componentName: componentName,\n position: jIndex,\n componentTitle: item.title,\n componentDescription: item.description,\n navigation: configuration?.activeTab,\n })\n\n useEffect(() => {\n setIsMobile(mediaQuery)\n }, [mediaQuery])\n\n const {\n theme = 'light',\n title,\n description,\n imageUrl,\n primaryButton,\n secondaryButton,\n imageMobileUrl,\n blockLink,\n video,\n youtubeId,\n isYouTube,\n } = item\n const lgButtonSize = 'lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px]'\n\n return (\n <div\n className={cn(\n 'item-wrapper cursor-pointer',\n 'text-info-primary group relative box-border w-full overflow-hidden',\n handleAspect(),\n {\n 'rounded-2xl': configuration?.shape === 'rounded',\n 'aiui-dark': theme === 'dark',\n 'h-[400px]': isMobile,\n },\n `text-info-primary`\n )}\n ref={ref}\n >\n {(blockLink || secondaryButton.link) && (\n <a\n className=\"absolute inset-0 z-10\"\n href={trackUrlRef(blockLink || secondaryButton.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}`}\n data-headless-nav-postion={`${configuration?.activeTab}#${jIndex}`}\n aria-hidden=\"true\"\n tabIndex={-1}\n />\n )}\n <div className=\"absolute inset-0\">\n {isVideo(imageUrl?.mimeType) ? (\n <video autoPlay muted playsInline loop className=\"tablet:block hidden size-full overflow-hidden object-cover\">\n <source src={imageUrl?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={imageUrl?.url}\n alt={imageUrl?.alt || ''}\n className=\"tablet:block hidden h-full overflow-hidden\"\n imgClassName=\"h-full transition-all duration-300 group-hover:scale-105 object-cover\"\n style={{ aspectRatio: `${imageUrl?.width}/${imageUrl?.height}` }}\n />\n )}\n {isVideo(imageMobileUrl?.mimeType) ? (\n <video autoPlay muted playsInline loop className=\"tablet:hidden block size-full overflow-hidden object-cover\">\n <source src={imageMobileUrl?.url} type=\"video/mp4\" />\n </video>\n ) : (\n <Picture\n source={imageMobileUrl?.url || imageUrl?.url}\n alt={imageMobileUrl?.alt || imageUrl?.alt || ''}\n className=\"tablet:hidden block h-full overflow-hidden\"\n imgClassName=\"h-full transition-all duration-300 object-cover\"\n />\n )}\n <div\n className={cn(\n 'absolutestyle laptop:p-6 desktop:p-[32px] laptop:gap-4 desktop:gap-6 absolute inset-x-0 bottom-0 z-20 flex w-fit flex-col gap-6 p-4',\n {\n 'fullstyle laptop:top-1/2 laptop:-translate-y-1/2 laptop:bottom-auto': item?.width === 'full',\n }\n )}\n >\n <div className=\"flex flex-col gap-1\">\n <Heading size={3} as=\"h3\" className=\"item-title\" html={title} />\n <Heading\n as=\"h4\"\n className=\"item-description desktop:text-[16px] lg-desktop:text-[18px] line-clamp-1 text-[14px]\"\n html={description}\n />\n </div>\n <div className=\"lg-desktop:gap-3 flex gap-2\">\n {secondaryButton && secondaryButton.text && (\n <Button\n aria-label={title ?? description}\n className={cn(lgButtonSize, 'link-left')}\n variant=\"secondary\"\n as=\"a\"\n onClick={() => {\n onSecondaryButtonClick?.(item)\n }}\n href={trackUrlRef(secondaryButton.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}#${secondaryButton.text}`}\n data-headless-nav-postion={`${configuration?.activeTab}#${jIndex}`}\n >\n {secondaryButton.text}\n <span className=\"sr-only\">{title ?? description}</span>\n </Button>\n )}\n {primaryButton && primaryButton.text && (\n <Button\n aria-label={title ?? description}\n className={cn(lgButtonSize, 'link-right')}\n variant=\"primary\"\n as=\"a\"\n onClick={() => {\n onPrimaryButtonClick?.(item)\n }}\n href={trackUrlRef(primaryButton.link, `${componentType}_${componentName}`)}\n data-headless-type-name={`${componentType}#${componentName}`}\n data-headless-title-desc-button={`${title}#${description}#${primaryButton.text}`}\n data-headless-nav-postion={`${configuration?.activeTab}#${jIndex}`}\n >\n {primaryButton.text}\n </Button>\n )}\n </div>\n </div>\n </div>\n <div>\n <div className=\"laptop:bottom-6 laptop:right-6 absolute bottom-4 right-4 z-20\">\n {(video?.url || youtubeId) && (\n <button\n onClick={() => {\n configuration?.onVideoPlayBtnClick?.(video?.url || youtubeId, isYouTube)\n }}\n className=\"laptop:size-12 flex size-8 items-center justify-center rounded-full bg-white bg-opacity-20 hover:bg-black/75\"\n >\n <svg width=\"12\" height=\"14\" viewBox=\"0 0 12 14\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M12 7L0 14L0 0L12 7Z\" fill=\"white\" />\n </svg>\n </button>\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst MultiLayoutGraphicBlock = React.forwardRef<HTMLDivElement, MultiLayoutGraphicBlockProps>((props, ref) => {\n const { onSecondaryButtonClick, onPrimaryButtonClick } = props\n const { shape, sectionTitle, groupByTab = false, items = [], carousel } = props.data\n const [visible, setVisible] = useState<boolean>(false)\n const [videoUrl, setVideoUrl] = useState<string>('')\n const [youTubeId, setYouTubeId] = useState<string>('')\n\n const getSpan = (width: 'full' | 'half' | 'one-third') => {\n switch (width) {\n case 'full':\n return 12\n case 'half':\n return 6\n case 'one-third':\n return 4\n }\n }\n\n const tabNames = items\n .map(item => item.tabName)\n .filter(Boolean)\n .filter((item, index, arr) => arr.indexOf(item) === index) as string[]\n\n const handleVideoPlayBtnClick = (url: string, isYouTube: boolean) => {\n setVisible(true)\n if (isYouTube) {\n setYouTubeId?.(url || '')\n } else {\n setVideoUrl?.(url || '')\n }\n }\n const handleTabNumber = (num: Number, flag?: boolean) => {\n switch (num) {\n case 1:\n return 1\n case 2:\n return 2\n default:\n return flag ? 2.3 : 3\n }\n }\n\n const tabItemsMaps = tabNames\n .map(tabName => ({\n tabName,\n items: items.filter(item => item.tabName === tabName),\n }))\n .reduce(\n (acc, cur) => {\n acc[cur.tabName] = cur.items\n return acc\n },\n {} as Record<string, (Item & { width?: 'full' | 'half' | 'one-third' })[]>\n )\n\n return (\n <section\n data-ui-component-id=\"MultiLayoutGraphicBlock\"\n ref={ref}\n className={cn('multiLayoutGraphicBlock', 'text-info-primary', props.className)}\n >\n {sectionTitle && <Title data={{ title: sectionTitle }} className=\"section-title\" />}\n\n {groupByTab ? (\n <Tabs shape={shape} align=\"left\" defaultValue={spaceToHyphen(tabNames[0]!)}>\n <TabsList>\n {tabNames.map((tabName, index) => (\n <TabsTrigger\n key={index}\n value={spaceToHyphen(tabName!)}\n onClick={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_click',\n event_parameters: {\n page_group: 'Home Page',\n component_type: componentType,\n component_name: componentName,\n component_title: sectionTitle,\n component_position: 1,\n navigation: tabName,\n button_name: tabName,\n },\n })\n }}\n >\n {tabName}\n </TabsTrigger>\n ))}\n </TabsList>\n {tabNames.map((tabName, index) => (\n <TabsContent key={index} value={spaceToHyphen(tabName!)} className=\"desktop:mt-[36px] mt-[24px] w-full\">\n <>\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock1'}\n data={{\n list: tabItemsMaps?.[tabName] || [],\n configuration: {\n shape: shape,\n isTab: groupByTab,\n activeTab: tabName,\n title: sectionTitle,\n num: tabItemsMaps?.[tabName]?.length || 0,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleTabNumber(tabItemsMaps?.[tabName]?.length || 0, true),\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: handleTabNumber(tabItemsMaps?.[tabName]?.length || 0),\n },\n }}\n />\n {carousel && carousel?.items.length > 0 ? (\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock2'}\n data={{\n list: carousel?.items || [],\n configuration: {\n shape: shape,\n isTab: groupByTab,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n title: sectionTitle,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3.1,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n ) : null}\n </>\n </TabsContent>\n ))}\n </Tabs>\n ) : (\n <>\n <Grid className=\"w-full\">\n {items.map((item, index) => {\n return (\n <GridItem\n key={`${item?.title || ''}${index}`}\n span={getSpan(item.width ?? 'full')}\n className=\"laptop:block hidden\"\n >\n <ItemBlock\n data={item}\n configuration={{ shape: shape, onVideoPlayBtnClick: handleVideoPlayBtnClick, title: sectionTitle }}\n jIndex={index}\n spanType={item.width}\n onSecondaryButtonClick={onSecondaryButtonClick}\n onPrimaryButtonClick={onPrimaryButtonClick}\n />\n </GridItem>\n )\n })}\n {items.map((item, index) => (\n <GridItem key={`${item?.title || ''}${index}`} span={getSpan('full')} className=\"laptop:hidden block\">\n <ItemBlock\n data={item}\n configuration={{ shape: shape, onVideoPlayBtnClick: handleVideoPlayBtnClick, title: sectionTitle }}\n jIndex={index}\n spanType={'full'}\n />\n </GridItem>\n ))}\n </Grid>\n {carousel && carousel?.items.length > 0 ? (\n <SwiperBox\n className=\"!overflow-visible\"\n id={'MultiLayoutGraphicBlock3'}\n data={{\n list: carousel?.items || [],\n configuration: {\n shape: shape,\n onVideoPlayBtnClick: handleVideoPlayBtnClick,\n title: sectionTitle,\n onSecondaryButtonClick,\n onPrimaryButtonClick,\n },\n }}\n Slide={ItemBlock}\n breakpoints={{\n 0: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1,\n },\n 374: {\n spaceBetween: 12,\n freeMode: false,\n slidesPerView: 1.2,\n },\n 768: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 2.3,\n },\n 1024: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 3.1,\n },\n 1440: {\n spaceBetween: 16,\n freeMode: false,\n slidesPerView: 4,\n },\n }}\n />\n ) : null}\n </>\n )}\n {visible && (\n <VideoModal\n visible={visible}\n youTubeId={youTubeId}\n videoUrl={videoUrl}\n onCloseModal={() => setVisible(false)}\n />\n )}\n </section>\n )\n})\n\nMultiLayoutGraphicBlock.displayName = 'MultiLayoutGraphicBlock'\n\nexport default withLayout(MultiLayoutGraphicBlock)\nexport type { MultiLayoutGraphicBlockProps }\n"],
|
|
5
|
+
"mappings": "AAiHQ,OA2MM,YAAAA,EA3MN,OAAAC,EA4CE,QAAAC,MA5CF,oBAjHR,OAAOC,GAAS,YAAAC,EAAU,aAAAC,EAAW,UAAAC,MAAc,QACnD,OAAS,iBAAAC,MAAqB,mBAE9B,OAAS,cAAAC,MAAkB,yBAC3B,OAAOC,MAAa,8BACpB,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G,UAAU,sBAC9E,SAAAlE,EAAC4B,EAAA,CACC,KAAMC,EACN,cAAe,CAAE,MAAO0B,EAAO,oBAAqBgB,EAAyB,MAAOf,CAAa,EACjG,OAAQa,EACR,SAAU,OACZ,GANa,GAAGxC,GAAM,OAAS,EAAE,GAAGwC,CAAK,EAO3C,CACD,GACH,EACCV,GAAYA,GAAU,MAAM,OAAS,EACpC3D,EAACiB,EAAA,CACC,UAAU,oBACV,GAAI,2BACJ,KAAM,CACJ,KAAM0C,GAAU,OAAS,CAAC,EAC1B,cAAe,CACb,MAAOJ,EACP,oBAAqBgB,EACrB,MAAOf,EACP,uBAAAtB,EACA,qBAAAC,CACF,CACF,EACA,MAAOP,EACP,YAAa,CACX,EAAG,CACD,aAAc,GACd,SAAU,GACV,cAAe,CACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,IAAK,CACH,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,GACjB,EACA,KAAM,CACJ,aAAc,GACd,SAAU,GACV,cAAe,CACjB,CACF,EACF,EACE,MACN,EAEDgC,GACC5D,EAACW,EAAA,CACC,QAASiD,EACT,UAAWI,EACX,SAAUF,EACV,aAAc,IAAMD,EAAW,EAAK,EACtC,GAEJ,CAEJ,CAAC,EAEDR,EAAwB,YAAc,0BAEtC,IAAO2B,GAAQzE,EAAW8C,CAAuB",
|
|
6
6
|
"names": ["Fragment", "jsx", "jsxs", "React", "useState", "useEffect", "useRef", "useMediaQuery", "withLayout", "Picture", "Button", "Heading", "VideoModal", "Grid", "GridItem", "Title", "cn", "spaceToHyphen", "SwiperBox", "isVideo", "Tabs", "TabsList", "TabsTrigger", "TabsContent", "useExposure", "trackUrlRef", "gaTrack", "componentType", "componentName", "ItemBlock", "item", "configuration", "jIndex", "spanType", "titleProp", "onSecondaryButtonClick", "onPrimaryButtonClick", "isMobile", "setIsMobile", "mediaQuery", "ref", "handleAspect", "theme", "title", "description", "imageUrl", "primaryButton", "secondaryButton", "imageMobileUrl", "blockLink", "video", "youtubeId", "isYouTube", "lgButtonSize", "MultiLayoutGraphicBlock", "props", "shape", "sectionTitle", "groupByTab", "items", "carousel", "visible", "setVisible", "videoUrl", "setVideoUrl", "youTubeId", "setYouTubeId", "getSpan", "width", "tabNames", "index", "arr", "handleVideoPlayBtnClick", "url", "handleTabNumber", "num", "flag", "tabItemsMaps", "tabName", "acc", "cur", "MultiLayoutGraphicBlock_default"]
|
|
7
7
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{Fragment as $,jsx as
|
|
1
|
+
import{Fragment as $,jsx as s,jsxs as a}from"react/jsx-runtime";import{Picture as x,Text as r,Button as G,Container as j,Link as u,Heading as y,Grid as q,GridItem as z}from"../../components/index.js";import{Search as K,Close as H}from"../HeaderNavigation/icons/index.js";import{forwardRef as M,useCallback as w,useMemo as C,useState as L}from"react";import{useAiuiContext as V}from"../AiuiProvider/index.js";import{SearchStatus as m}from"./types.js";import{debounce as J}from"es-toolkit";import{cn as b,atobID as D,highlightSearchWord as O}from"../../helpers/utils.js";const Q=t=>!(t.metafields?.global?.HideSearch||t.metafields?.seo?.hidden||t.metafields?.seo?.setting?.noindex),U=M(({data:t,onSearch:l,onClose:n,searchResult:o,isSearching:c,keywords:p},P)=>{const{locale:d="us",copyWriting:Y}=V(),[i,S]=L(""),[f,N]=L(!1),E=J(e=>{l(e)},300),I=w(e=>{e.key==="Enter"&&!f&&l(i)},[f,i,l]),T=C(()=>Array.isArray(p)&&p?.length?p.map(e=>e.search_term):Array.isArray(t?.popularWords)&&t?.popularWords?.length?t?.popularWords.map(e=>e.popularWord):[],[p,t?.popularWords]),A=w(e=>{switch(e.type){case"Product":return`/products${e.path}?q=${i.toLowerCase()}`;case"Article":return`/blogs/${e.blog.handle}/${e.handle.replace("storefront-","")}?q=${i.toLowerCase()}`;default:break}},[i]),k=C(()=>{if(i){if(o?.totalCount)return m.Predict;if(!c)return m.Empty}else return m.Default},[o?.totalCount,i]);return a(j,{childClassName:"!bg-white",className:"relative",ref:P,children:[s("style",{jsx:!0,global:!0,children:`
|
|
2
2
|
.navigation-search-component input:-webkit-autofill,
|
|
3
3
|
.navigation-search-component input:-webkit-autofill:hover,
|
|
4
4
|
.navigation-search-component input:-webkit-autofill:focus {
|
|
@@ -7,5 +7,5 @@ import{Fragment as $,jsx as a,jsxs as s}from"react/jsx-runtime";import{Picture a
|
|
|
7
7
|
transition: background-color 9999s ease-in-out 0s !important;
|
|
8
8
|
caret-color: #000;
|
|
9
9
|
}
|
|
10
|
-
`}),
|
|
10
|
+
`}),a("div",{className:"navigation-search-component laptop:h-[52px] desktop:h-[60px] desktop:pt-6 flex items-center justify-between border-b border-b-gray-200 py-4 text-black",children:[s("input",{value:i,onCompositionStart:()=>N(!0),onCompositionEnd:()=>N(!1),onKeyDown:I,onChange:e=>{S(e.target.value),e.target.value&&E(e.target.value)},type:"text",className:"basis-[200px] bg-white text-sm font-bold leading-[1.4] outline-none focus-visible:!outline-none",placeholder:t?.placeholder}),a("div",{className:"flex items-center gap-3",children:[s(K,{className:"size-5 cursor-pointer",onClick:()=>l(i)}),s("div",{className:"h-[20px] w-px bg-[#E4E5E6]"}),s(H,{className:"size-5 cursor-pointer",onClick:n})]})]}),s("div",{className:"desktop:gap-12 desktop:py-6 flex flex-col gap-6 py-4 text-black",children:k===m.Predict?a($,{children:[a("div",{children:[a("div",{className:"flex items-center gap-2",children:[s(r,{html:t?.suggestText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),o?.items?.length>6&&s(G,{as:"a",href:`${d==="us"?"":d}${t?.moreLink}?q=${i.toLowerCase()}`,className:"!p-0 !text-sm font-bold leading-[1.2]",variant:"link",children:t?.moreText})]}),s("div",{className:"mt-2 flex flex-col",children:o?.items?.filter(e=>Q(e)).slice(0,6)?.map(e=>s(u,{className:"w-full p-4 no-underline hover:bg-[#F5F5F7] hover:text-current",href:A(e),children:s(r,{html:O(e.title,i),className:"cursor-pointer text-sm font-bold leading-[1.4]"})},e.id))})]}),a("div",{children:[s(r,{html:t?.hotProductsText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),a("div",{className:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2",children:[s(u,{asChild:!t?.advertisingLink,href:t?.advertisingLink,children:a("div",{className:"relative",children:[s(x,{source:t?.advertisingBgImg?.url,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),a("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[s(y,{size:2,html:t?.advertisingTitle||"Buy in Guide",className:b("font-bold text-white",{"text-black":t?.advertisingTheme==="dark"})}),s(r,{html:t?.advertisingSubtitle||"20.000mAh",className:b("text-sm font-bold text-white",{"text-black":t?.advertisingTheme==="dark"})})]})]})}),o?.items?.filter(e=>e.type.toLowerCase()==="product").slice(0,7)?.map(e=>{const g=e?.variants?.[0],h=`${g?.image?.url||e?.images?.[0]?.url}`,v=e?.title||e?.name,B=e?.description,W=e?.badge||"",_=`/products/${e?.handle}?variant=${D(g?.id)}`;return s(F,{productImage:h,productName:v,productDesc:B,productBadge:W,listingLink:_},e.id)})]})]})]}):a($,{children:[k===m.Empty&&s(r,{html:t?.noResultText,as:"p",className:"border-b border-[#E4E5E6] pb-6 text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),a("div",{children:[s(r,{html:t?.popularText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),a("div",{className:"mt-2",children:[s(X,{data:t,keywords:T,locale:d}),Array.isArray(t?.popularPages)&&!!t?.popularPages?.length&&s(q,{className:"laptop:gap-4 laptop:mt-4 mt-3 gap-3",children:t?.popularPages?.map(e=>s(z,{className:"tablet:col-span-6 laptop:p-3 desktop:p-4 laptop:col-span-3 col-span-12 p-2 hover:bg-[#F5F5F7]",children:s("a",{href:`${d==="us"?"":d}${t?.moreLink}?q=${e?.popularPage.toLowerCase()}`,className:"line-clamp-1 cursor-pointer text-sm font-bold leading-[1.4]",children:e?.popularPage})},e?.id))})]})]}),a("div",{children:[s(r,{html:t?.hotProductsText,className:"text-sm font-bold leading-[1.4] text-[#6D6D6F]"}),a("div",{className:"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2",children:[s(u,{asChild:!t?.advertisingLink,href:t?.advertisingLink,children:a("div",{className:"[&_img]:hover:duration-600 relative [&_img]:hover:scale-110 [&_img]:hover:transition-all",children:[s(x,{source:t?.advertisingBgImg?.url,className:"laptop:h-[120px] h-[114px]",imgClassName:"object-cover h-full"}),a("div",{className:"absolute inset-x-0 bottom-0 p-4",children:[s(y,{size:2,html:t?.advertisingTitle||"Buy in Guide",className:"font-bold text-white"}),s(r,{html:t?.advertisingSubtitle||"20.000mAh",className:"text-sm font-bold text-white"})]})]})}),t?.hotProducts?.slice(0,7)?.map(e=>{const g=e?.custom_description,h=e?.badge||"",v=`/products/${e?.handle}?variant=${D(e?.shopify_id)}`;return s(F,{productImage:e?.image,productName:e?.name,productDesc:g,productBadge:h,listingLink:v},e.id)})]})]})]})})]})}),F=({productImage:t,productName:l,productDesc:n,productBadge:o,className:c,listingLink:p})=>a("div",{className:b("flex shrink-0 gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110",c),children:[s("div",{className:"shrink-0",children:s(x,{source:t,width:90,height:90,className:"size-[96px]",imgClassName:"object-contain h-full"})}),a("div",{className:"relative",children:[s("div",{className:" h-[24px] ",children:o&&s(r,{as:"p",html:o,className:"text-brand-0 mb-1 inline-block h-full rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[24px]"})}),a("div",{children:[s(u,{href:p,className:"no-underline hover:text-current",children:s(r,{className:"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]",html:l})}),n&&s(r,{as:"p",html:n,className:"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]"})]})]})]}),X=({data:t,keywords:l,locale:n})=>s("div",{className:"laptop:gap-4 flex flex-wrap gap-3",children:l?.map((o,c)=>s("a",{href:`${n==="us"?"":n}${t?.moreLink}?q=${o?.toLowerCase()}`,className:"laptop:p-3 desktop:p-4 cursor-pointer p-2 text-sm font-bold leading-[1.4] hover:bg-[#F5F5F7]",children:o},c))});var ie=U;export{Q as canSearch,ie as default};
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/NavigationSearch/index.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Picture, Text, Button, Container, Link, Heading, Grid, GridItem } from '../../components/index.js'\nimport { Search as SearchIcon, Close as CloseIcon } from '../HeaderNavigation/icons/index.js'\nimport { forwardRef, useCallback, useMemo, useState } from 'react'\nimport type { NavigationSearchProps } from './types.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\nimport { SearchStatus } from './types.js'\n\nimport { debounce } from 'es-toolkit'\nimport { cn, atobID, highlightSearchWord } from '../../helpers/utils.js'\n\nexport const canSearch = (target: any) => {\n return !(\n target.metafields?.global?.HideSearch ||\n target.metafields?.seo?.hidden ||\n target.metafields?.seo?.setting?.noindex\n )\n}\n\nconst NavigationSearch = forwardRef<HTMLDivElement, NavigationSearchProps>(\n ({ data, onSearch, onClose, searchResult, isSearching, keywords }, ref) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n\n const [searchValue, setSearchValue] = useState('')\n const [isComposing, setIsComposing] = useState(false)\n\n const debouncedFunction = debounce((value: string) => {\n onSearch(value)\n }, 300)\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && !isComposing) {\n onSearch(searchValue)\n }\n },\n [isComposing, searchValue, onSearch]\n )\n\n const searchKeywords = useMemo(() => {\n if (Array.isArray(keywords) && keywords?.length) {\n return keywords.map((keyword: any) => keyword.search_term)\n }\n if (Array.isArray(data?.popularWords) && data?.popularWords?.length) {\n return data?.popularWords.map((word: any) => word.popularWord)\n }\n return []\n }, [keywords, data?.popularWords])\n\n const getLink = useCallback(\n (item: any) => {\n switch (item.type) {\n case 'Product':\n return `/products${item.path}?q=${searchValue.toLowerCase()}`\n case 'Article':\n return `/blogs/${item.blog.handle}/${item.handle.replace('storefront-', '')}?q=${searchValue.toLowerCase()}`\n default:\n break\n }\n },\n [searchValue]\n )\n\n const searchStatus = useMemo(() => {\n if (!searchValue) {\n // \u6CA1\u6709\u641C\u7D22\u503C\n return SearchStatus.Default\n } else if (searchResult?.totalCount) {\n // \u6709\u641C\u7D22\u7ED3\u679C\n return SearchStatus.Predict\n } else if (!isSearching) {\n // \u6CA1\u6709\u641C\u7D22\u7ED3\u679C\n return SearchStatus.Empty\n }\n }, [searchResult?.totalCount, searchValue])\n\n return (\n <Container childClassName=\"!bg-white\" className=\"relative\" ref={ref}>\n <style jsx global>\n {`\n .navigation-search-component input:-webkit-autofill,\n .navigation-search-component input:-webkit-autofill:hover,\n .navigation-search-component input:-webkit-autofill:focus {\n -webkit-box-shadow: 0 0 0 1000px transparent inset !important; /* \u80CC\u666F\u900F\u660E */\n -webkit-text-fill-color: #000 !important;\n transition: background-color 9999s ease-in-out 0s !important;\n caret-color: #000;\n }\n `}\n </style>\n <div className=\"navigation-search-component laptop:h-[52px] text-black desktop:h-[60px] flex items-center pt-4 desktop:pt-6 pb-4 justify-between border-b border-b-gray-200\">\n <input\n value={searchValue}\n onCompositionStart={() => setIsComposing(true)}\n onCompositionEnd={() => setIsComposing(false)}\n onKeyDown={handleKeyDown}\n onChange={e => {\n setSearchValue(e.target.value)\n if (e.target.value) {\n debouncedFunction(e.target.value)\n }\n }}\n type=\"text\"\n className=\"text-sm bg-white basis-[200px] focus-visible:!outline-none outline-none leading-[1.4] font-bold\"\n placeholder={data?.placeholder}\n />\n <div className=\"flex items-center gap-3\">\n <SearchIcon className=\"size-5 cursor-pointer\" onClick={() => onSearch(searchValue)} />\n <div className=\"w-[1px] h-[20px] bg-[#E4E5E6]\" />\n <CloseIcon className=\"size-5 cursor-pointer\" onClick={onClose} />\n </div>\n </div>\n\n <div className=\"flex flex-col gap-6 desktop:gap-12 text-black desktop:py-6 py-4\">\n {searchStatus === SearchStatus.Predict ? (\n <>\n <div>\n <div className=\"flex items-center gap-2\">\n <Text html={data?.suggestText} className=\"text-sm text-[#6D6D6F] leading-[1.4] font-bold\" />\n {searchResult?.items?.length > 6 && (\n <Button\n as=\"a\"\n href={`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${searchValue.toLowerCase()}`}\n className=\"!text-sm leading-[1.2] font-bold !p-0\"\n variant=\"link\"\n >\n {data?.moreText}\n </Button>\n )}\n </div>\n <div className=\"flex flex-col mt-2\">\n {searchResult?.items\n ?.filter((item: any) => canSearch(item))\n .slice(0, 6)\n ?.map((item: any) => (\n <Link\n className=\"hover:bg-[#F5F5F7] hover:text-current no-underline w-full p-4\"\n href={getLink(item)}\n key={item.id}\n >\n <Text\n html={highlightSearchWord(item.title, searchValue)}\n className=\"text-sm cursor-pointer leading-[1.4] font-bold\"\n />\n </Link>\n ))}\n </div>\n </div>\n <div>\n <Text html={data?.hotProductsText} className=\"text-sm text-[#6D6D6F] leading-[1.4] font-bold\" />\n <div className=\"grid grid-cols-1 tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 gap-2 mt-2 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4\">\n <Link asChild={!data?.advertisingLink} href={data?.advertisingLink}>\n <div className=\"relative\">\n <Picture\n source={data?.advertisingBgImg?.url}\n className=\"h-[114px] laptop:h-[120px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute bottom-0 left-0 right-0 p-4\">\n <Heading\n size={2}\n html={data?.advertisingTitle || 'Buy in Guide'}\n className={cn('font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n <Text\n html={data?.advertisingSubtitle || '20.000mAh'}\n className={cn('text-sm text-white font-bold', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n </div>\n </div>\n </Link>\n {searchResult?.items\n ?.filter((item: any) => item.type.toLowerCase() === 'product')\n .slice(0, 7)\n ?.map((item: any) => {\n const variant = item?.variants?.[0]\n const productImage = `${variant?.image?.url || item?.images?.[0]?.url}`\n const productName = item?.title || item?.name\n const productDesc = item?.description\n const productBadge = item?.badge || ''\n const listingLink = `/products/${item?.handle}?variant=${atobID(variant?.id as string)}`\n return (\n <SearchProduct\n productImage={productImage}\n productName={productName}\n productDesc={productDesc}\n productBadge={productBadge}\n listingLink={listingLink}\n key={item.id}\n />\n )\n })}\n </div>\n </div>\n </>\n ) : (\n <>\n {searchStatus === SearchStatus.Empty && (\n <Text\n html={data?.noResultText}\n as=\"p\"\n className=\"text-sm pb-6 border-[#E4E5E6] border-b text-[#6D6D6F] leading-[1.4] font-bold\"\n />\n )}\n <div>\n <Text html={data?.popularText} className=\"text-sm text-[#6D6D6F] leading-[1.4] font-bold\" />\n <div className=\"mt-2\">\n <SearchKeyword data={data} keywords={searchKeywords} locale={locale} />\n {Array.isArray(data?.popularPages) && !!data?.popularPages?.length && (\n <Grid className=\"gap-3 laptop:gap-4 mt-3 laptop:mt-4\">\n {data?.popularPages?.map((item: any) => (\n <GridItem\n key={item?.id}\n className=\"col-span-12 tablet:col-span-6 p-2 hover:bg-[#F5F5F7] laptop:p-3 desktop:p-4 laptop:col-span-3\"\n >\n <a\n href={`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${item?.popularPage.toLowerCase()}`}\n className=\"text-sm cursor-pointer line-clamp-1 leading-[1.4] font-bold\"\n >\n {item?.popularPage}\n </a>\n </GridItem>\n ))}\n </Grid>\n )}\n </div>\n </div>\n <div>\n <Text html={data?.hotProductsText} className=\"text-sm text-[#6D6D6F] leading-[1.4] font-bold\" />\n <div className=\"grid grid-cols-1 tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 gap-2 mt-2 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4\">\n <Link asChild={!data?.advertisingLink} href={data?.advertisingLink}>\n <div className=\"relative [&_img]:hover:scale-110 [&_img]:hover:transition-all [&_img]:hover:duration-600\">\n <Picture\n source={data?.advertisingBgImg?.url}\n className=\"h-[114px] laptop:h-[120px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute bottom-0 left-0 right-0 p-4\">\n <Heading\n size={2}\n html={data?.advertisingTitle || 'Buy in Guide'}\n className=\"font-bold text-white\"\n />\n <Text\n html={data?.advertisingSubtitle || '20.000mAh'}\n className=\"text-sm text-white font-bold\"\n />\n </div>\n </div>\n </Link>\n {data?.hotProducts?.slice(0, 7)?.map((item: any) => {\n const productDesc = item?.custom_description\n const productBadge = item?.badge || ''\n const listingLink = `/products/${item?.handle}?variant=${atobID(item?.shopify_id as string)}`\n return (\n <SearchProduct\n productImage={item?.image}\n productName={item?.name}\n productDesc={productDesc}\n productBadge={productBadge}\n listingLink={listingLink}\n key={item.id}\n />\n )\n })}\n </div>\n </div>\n </>\n )}\n </div>\n </Container>\n )\n }\n)\n\nconst SearchProduct = ({\n productImage,\n productName,\n productDesc,\n productBadge,\n className,\n listingLink,\n}: {\n productImage: string\n productName: string\n productDesc: string\n productBadge: string\n className?: string\n listingLink: string\n}) => {\n return (\n <div className={cn('flex shrink-0 gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110', className)}>\n <div className=\"shrink-0\">\n <Picture\n source={productImage}\n width={90}\n height={90}\n className=\"size-[96px]\"\n imgClassName=\"object-contain h-full\"\n />\n </div>\n <div className=\"relative\">\n <div className=\" h-[24px] \">\n {productBadge && (\n <Text\n as=\"p\"\n html={productBadge}\n className=\"text-brand-0 mb-1 inline-block rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold h-full !leading-[24px]\"\n />\n )}\n </div>\n <div>\n <Link href={listingLink} className=\"no-underline hover:text-current\">\n <Text\n className=\"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]\"\n html={productName}\n />\n </Link>\n {productDesc && (\n <Text\n as=\"p\"\n html={productDesc}\n className=\"lg-desktop:text-sm line-clamp-1 mt-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst SearchKeyword = ({ data, keywords, locale }: { data: any; keywords: any[]; locale: string }) => {\n return (\n <div className=\"flex flex-wrap gap-3 laptop:gap-4\">\n {keywords?.map((keyword: any, index) => (\n <a\n href={`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${keyword?.toLowerCase()}`}\n key={index}\n className=\"text-sm cursor-pointer hover:bg-[#F5F5F7] p-2 laptop:p-3 desktop:p-4 leading-[1.4] font-bold\"\n >\n {keyword}\n </a>\n ))}\n </div>\n )\n}\n\nexport default NavigationSearch\n"],
|
|
5
|
-
"mappings": "AA8EQ,OAqCI,YAAAA,EArCJ,OAAAC,EA4BE,QAAAC,MA5BF,oBA9ER,OAAS,WAAAC,EAAS,QAAAC,EAAM,UAAAC,EAAQ,aAAAC,EAAW,QAAAC,EAAM,WAAAC,EAAS,QAAAC,EAAM,YAAAC,MAAgB,4BAChF,OAAS,UAAUC,EAAY,SAASC,MAAiB,qCACzD,OAAS,cAAAC,EAAY,eAAAC,EAAa,WAAAC,EAAS,YAAAC,MAAgB,QAE3D,OAAS,kBAAAC,MAAsB,2BAE/B,OAAS,gBAAAC,MAAoB,aAE7B,OAAS,YAAAC,MAAgB,aACzB,OAAS,MAAAC,EAAI,UAAAC,EAAQ,uBAAAC,MAA2B,yBAEzC,MAAMC,EAAaC,GACjB,EACLA,EAAO,YAAY,QAAQ,YAC3BA,EAAO,YAAY,KAAK,QACxBA,EAAO,YAAY,KAAK,SAAS,SAI/BC,EAA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U,eAAe,YAAY,UAAU,WAAW,IAAK0B,EAC9D,UAAA/B,EAAC,SAAM,IAAG,GAAC,OAAM,GACd;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAUH,EACAC,EAAC,OAAI,UAAU,
|
|
4
|
+
"sourcesContent": ["import { Picture, Text, Button, Container, Link, Heading, Grid, GridItem } from '../../components/index.js'\nimport { Search as SearchIcon, Close as CloseIcon } from '../HeaderNavigation/icons/index.js'\nimport { forwardRef, useCallback, useMemo, useState } from 'react'\nimport type { NavigationSearchProps } from './types.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\n\nimport { SearchStatus } from './types.js'\n\nimport { debounce } from 'es-toolkit'\nimport { cn, atobID, highlightSearchWord } from '../../helpers/utils.js'\n\nexport const canSearch = (target: any) => {\n return !(\n target.metafields?.global?.HideSearch ||\n target.metafields?.seo?.hidden ||\n target.metafields?.seo?.setting?.noindex\n )\n}\n\nconst NavigationSearch = forwardRef<HTMLDivElement, NavigationSearchProps>(\n ({ data, onSearch, onClose, searchResult, isSearching, keywords }, ref) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n\n const [searchValue, setSearchValue] = useState('')\n const [isComposing, setIsComposing] = useState(false)\n\n const debouncedFunction = debounce((value: string) => {\n onSearch(value)\n }, 300)\n\n const handleKeyDown = useCallback(\n (e: React.KeyboardEvent<HTMLInputElement>) => {\n if (e.key === 'Enter' && !isComposing) {\n onSearch(searchValue)\n }\n },\n [isComposing, searchValue, onSearch]\n )\n\n const searchKeywords = useMemo(() => {\n if (Array.isArray(keywords) && keywords?.length) {\n return keywords.map((keyword: any) => keyword.search_term)\n }\n if (Array.isArray(data?.popularWords) && data?.popularWords?.length) {\n return data?.popularWords.map((word: any) => word.popularWord)\n }\n return []\n }, [keywords, data?.popularWords])\n\n const getLink = useCallback(\n (item: any) => {\n switch (item.type) {\n case 'Product':\n return `/products${item.path}?q=${searchValue.toLowerCase()}`\n case 'Article':\n return `/blogs/${item.blog.handle}/${item.handle.replace('storefront-', '')}?q=${searchValue.toLowerCase()}`\n default:\n break\n }\n },\n [searchValue]\n )\n\n const searchStatus = useMemo(() => {\n if (!searchValue) {\n // \u6CA1\u6709\u641C\u7D22\u503C\n return SearchStatus.Default\n } else if (searchResult?.totalCount) {\n // \u6709\u641C\u7D22\u7ED3\u679C\n return SearchStatus.Predict\n } else if (!isSearching) {\n // \u6CA1\u6709\u641C\u7D22\u7ED3\u679C\n return SearchStatus.Empty\n }\n }, [searchResult?.totalCount, searchValue])\n\n return (\n <Container childClassName=\"!bg-white\" className=\"relative\" ref={ref}>\n <style jsx global>\n {`\n .navigation-search-component input:-webkit-autofill,\n .navigation-search-component input:-webkit-autofill:hover,\n .navigation-search-component input:-webkit-autofill:focus {\n -webkit-box-shadow: 0 0 0 1000px transparent inset !important; /* \u80CC\u666F\u900F\u660E */\n -webkit-text-fill-color: #000 !important;\n transition: background-color 9999s ease-in-out 0s !important;\n caret-color: #000;\n }\n `}\n </style>\n <div className=\"navigation-search-component laptop:h-[52px] desktop:h-[60px] desktop:pt-6 flex items-center justify-between border-b border-b-gray-200 py-4 text-black\">\n <input\n value={searchValue}\n onCompositionStart={() => setIsComposing(true)}\n onCompositionEnd={() => setIsComposing(false)}\n onKeyDown={handleKeyDown}\n onChange={e => {\n setSearchValue(e.target.value)\n if (e.target.value) {\n debouncedFunction(e.target.value)\n }\n }}\n type=\"text\"\n className=\"basis-[200px] bg-white text-sm font-bold leading-[1.4] outline-none focus-visible:!outline-none\"\n placeholder={data?.placeholder}\n />\n <div className=\"flex items-center gap-3\">\n <SearchIcon className=\"size-5 cursor-pointer\" onClick={() => onSearch(searchValue)} />\n <div className=\"h-[20px] w-px bg-[#E4E5E6]\" />\n <CloseIcon className=\"size-5 cursor-pointer\" onClick={onClose} />\n </div>\n </div>\n\n <div className=\"desktop:gap-12 desktop:py-6 flex flex-col gap-6 py-4 text-black\">\n {searchStatus === SearchStatus.Predict ? (\n <>\n <div>\n <div className=\"flex items-center gap-2\">\n <Text html={data?.suggestText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n {searchResult?.items?.length > 6 && (\n <Button\n as=\"a\"\n href={`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${searchValue.toLowerCase()}`}\n className=\"!p-0 !text-sm font-bold leading-[1.2]\"\n variant=\"link\"\n >\n {data?.moreText}\n </Button>\n )}\n </div>\n <div className=\"mt-2 flex flex-col\">\n {searchResult?.items\n ?.filter((item: any) => canSearch(item))\n .slice(0, 6)\n ?.map((item: any) => (\n <Link\n className=\"w-full p-4 no-underline hover:bg-[#F5F5F7] hover:text-current\"\n href={getLink(item)}\n key={item.id}\n >\n <Text\n html={highlightSearchWord(item.title, searchValue)}\n className=\"cursor-pointer text-sm font-bold leading-[1.4]\"\n />\n </Link>\n ))}\n </div>\n </div>\n <div>\n <Text html={data?.hotProductsText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2\">\n <Link asChild={!data?.advertisingLink} href={data?.advertisingLink}>\n <div className=\"relative\">\n <Picture\n source={data?.advertisingBgImg?.url}\n className=\"laptop:h-[120px] h-[114px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-4\">\n <Heading\n size={2}\n html={data?.advertisingTitle || 'Buy in Guide'}\n className={cn('font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n <Text\n html={data?.advertisingSubtitle || '20.000mAh'}\n className={cn('text-sm font-bold text-white', {\n 'text-black': data?.advertisingTheme === 'dark',\n })}\n />\n </div>\n </div>\n </Link>\n {searchResult?.items\n ?.filter((item: any) => item.type.toLowerCase() === 'product')\n .slice(0, 7)\n ?.map((item: any) => {\n const variant = item?.variants?.[0]\n const productImage = `${variant?.image?.url || item?.images?.[0]?.url}`\n const productName = item?.title || item?.name\n const productDesc = item?.description\n const productBadge = item?.badge || ''\n const listingLink = `/products/${item?.handle}?variant=${atobID(variant?.id as string)}`\n return (\n <SearchProduct\n productImage={productImage}\n productName={productName}\n productDesc={productDesc}\n productBadge={productBadge}\n listingLink={listingLink}\n key={item.id}\n />\n )\n })}\n </div>\n </div>\n </>\n ) : (\n <>\n {searchStatus === SearchStatus.Empty && (\n <Text\n html={data?.noResultText}\n as=\"p\"\n className=\"border-b border-[#E4E5E6] pb-6 text-sm font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n <div>\n <Text html={data?.popularText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"mt-2\">\n <SearchKeyword data={data} keywords={searchKeywords} locale={locale} />\n {Array.isArray(data?.popularPages) && !!data?.popularPages?.length && (\n <Grid className=\"laptop:gap-4 laptop:mt-4 mt-3 gap-3\">\n {data?.popularPages?.map((item: any) => (\n <GridItem\n key={item?.id}\n className=\"tablet:col-span-6 laptop:p-3 desktop:p-4 laptop:col-span-3 col-span-12 p-2 hover:bg-[#F5F5F7]\"\n >\n <a\n href={`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${item?.popularPage.toLowerCase()}`}\n className=\"line-clamp-1 cursor-pointer text-sm font-bold leading-[1.4]\"\n >\n {item?.popularPage}\n </a>\n </GridItem>\n ))}\n </Grid>\n )}\n </div>\n </div>\n <div>\n <Text html={data?.hotProductsText} className=\"text-sm font-bold leading-[1.4] text-[#6D6D6F]\" />\n <div className=\"tablet:grid-cols-2 laptop:grid-cols-3 desktop:grid-cols-4 tablet:gap-x-3 tablet:gap-y-4 laptop:gap-4 mt-2 grid grid-cols-1 gap-2\">\n <Link asChild={!data?.advertisingLink} href={data?.advertisingLink}>\n <div className=\"[&_img]:hover:duration-600 relative [&_img]:hover:scale-110 [&_img]:hover:transition-all\">\n <Picture\n source={data?.advertisingBgImg?.url}\n className=\"laptop:h-[120px] h-[114px]\"\n imgClassName=\"object-cover h-full\"\n />\n <div className=\"absolute inset-x-0 bottom-0 p-4\">\n <Heading\n size={2}\n html={data?.advertisingTitle || 'Buy in Guide'}\n className=\"font-bold text-white\"\n />\n <Text\n html={data?.advertisingSubtitle || '20.000mAh'}\n className=\"text-sm font-bold text-white\"\n />\n </div>\n </div>\n </Link>\n {data?.hotProducts?.slice(0, 7)?.map((item: any) => {\n const productDesc = item?.custom_description\n const productBadge = item?.badge || ''\n const listingLink = `/products/${item?.handle}?variant=${atobID(item?.shopify_id as string)}`\n return (\n <SearchProduct\n productImage={item?.image}\n productName={item?.name}\n productDesc={productDesc}\n productBadge={productBadge}\n listingLink={listingLink}\n key={item.id}\n />\n )\n })}\n </div>\n </div>\n </>\n )}\n </div>\n </Container>\n )\n }\n)\n\nconst SearchProduct = ({\n productImage,\n productName,\n productDesc,\n productBadge,\n className,\n listingLink,\n}: {\n productImage: string\n productName: string\n productDesc: string\n productBadge: string\n className?: string\n listingLink: string\n}) => {\n return (\n <div className={cn('flex shrink-0 gap-4 bg-[#F5F5F7] px-4 py-3 [&_img]:hover:scale-110', className)}>\n <div className=\"shrink-0\">\n <Picture\n source={productImage}\n width={90}\n height={90}\n className=\"size-[96px]\"\n imgClassName=\"object-contain h-full\"\n />\n </div>\n <div className=\"relative\">\n <div className=\" h-[24px] \">\n {productBadge && (\n <Text\n as=\"p\"\n html={productBadge}\n className=\"text-brand-0 mb-1 inline-block h-full rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[24px]\"\n />\n )}\n </div>\n <div>\n <Link href={listingLink} className=\"no-underline hover:text-current\">\n <Text\n className=\"lg-desktop:h-[44px] lg-desktop:text-base line-clamp-2 h-[40px] text-sm font-bold leading-[1.4]\"\n html={productName}\n />\n </Link>\n {productDesc && (\n <Text\n as=\"p\"\n html={productDesc}\n className=\"lg-desktop:text-sm mt-1 line-clamp-1 text-xs font-bold leading-[1.4] text-[#6D6D6F]\"\n />\n )}\n </div>\n </div>\n </div>\n )\n}\n\nconst SearchKeyword = ({ data, keywords, locale }: { data: any; keywords: any[]; locale: string }) => {\n return (\n <div className=\"laptop:gap-4 flex flex-wrap gap-3\">\n {keywords?.map((keyword: any, index) => (\n <a\n href={`${locale === 'us' ? '' : locale}${data?.moreLink}?q=${keyword?.toLowerCase()}`}\n key={index}\n className=\"laptop:p-3 desktop:p-4 cursor-pointer p-2 text-sm font-bold leading-[1.4] hover:bg-[#F5F5F7]\"\n >\n {keyword}\n </a>\n ))}\n </div>\n )\n}\n\nexport default NavigationSearch\n"],
|
|
5
|
+
"mappings": "AA8EQ,OAqCI,YAAAA,EArCJ,OAAAC,EA4BE,QAAAC,MA5BF,oBA9ER,OAAS,WAAAC,EAAS,QAAAC,EAAM,UAAAC,EAAQ,aAAAC,EAAW,QAAAC,EAAM,WAAAC,EAAS,QAAAC,EAAM,YAAAC,MAAgB,4BAChF,OAAS,UAAUC,EAAY,SAASC,MAAiB,qCACzD,OAAS,cAAAC,EAAY,eAAAC,EAAa,WAAAC,EAAS,YAAAC,MAAgB,QAE3D,OAAS,kBAAAC,MAAsB,2BAE/B,OAAS,gBAAAC,MAAoB,aAE7B,OAAS,YAAAC,MAAgB,aACzB,OAAS,MAAAC,EAAI,UAAAC,EAAQ,uBAAAC,MAA2B,yBAEzC,MAAMC,EAAaC,GACjB,EACLA,EAAO,YAAY,QAAQ,YAC3BA,EAAO,YAAY,KAAK,QACxBA,EAAO,YAAY,KAAK,SAAS,SAI/BC,EAAmBZ,EACvB,CAAC,CAAE,KAAAa,EAAM,SAAAC,EAAU,QAAAC,EAAS,aAAAC,EAAc,YAAAC,EAAa,SAAAC,CAAS,EAAGC,IAAQ,CACzE,KAAM,CAAE,OAAAC,EAAS,KAAM,YAAAC,CAAY,EAAIjB,EAAe,EAEhD,CAACkB,EAAaC,CAAc,EAAIpB,EAAS,EAAE,EAC3C,CAACqB,EAAaC,CAAc,EAAItB,EAAS,EAAK,EAE9CuB,EAAoBpB,EAAUqB,GAAkB,CACpDb,EAASa,C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AAAH,CACF,IASInD,EAAC,OAAI,UAAWkB,EAAG,qEAAsEoC,CAAS,EAChG,UAAAvD,EAAC,OAAI,UAAU,WACb,SAAAA,EAACE,EAAA,CACC,OAAQ8C,EACR,MAAO,GACP,OAAQ,GACR,UAAU,cACV,aAAa,wBACf,EACF,EACA/C,EAAC,OAAI,UAAU,WACb,UAAAD,EAAC,OAAI,UAAU,aACZ,SAAAmD,GACCnD,EAACG,EAAA,CACC,GAAG,IACH,KAAMgD,EACN,UAAU,gIACZ,EAEJ,EACAlD,EAAC,OACC,UAAAD,EAACM,EAAA,CAAK,KAAM8C,EAAa,UAAU,kCACjC,SAAApD,EAACG,EAAA,CACC,UAAU,iGACV,KAAM8C,EACR,EACF,EACCC,GACClD,EAACG,EAAA,CACC,GAAG,IACH,KAAM+C,EACN,UAAU,sFACZ,GAEJ,GACF,GACF,EAIEI,EAAgB,CAAC,CAAE,KAAA7B,EAAM,SAAAK,EAAU,OAAAE,CAAO,IAE5ChC,EAAC,OAAI,UAAU,oCACZ,SAAA8B,GAAU,IAAI,CAACY,EAAcc,IAC5BxD,EAAC,KACC,KAAM,GAAGgC,IAAW,KAAO,GAAKA,CAAM,GAAGP,GAAM,QAAQ,MAAMiB,GAAS,YAAY,CAAC,GAEnF,UAAU,+FAET,SAAAA,GAHIc,CAIP,CACD,EACH,EAIJ,IAAOC,GAAQjC",
|
|
6
6
|
"names": ["Fragment", "jsx", "jsxs", "Picture", "Text", "Button", "Container", "Link", "Heading", "Grid", "GridItem", "SearchIcon", "CloseIcon", "forwardRef", "useCallback", "useMemo", "useState", "useAiuiContext", "SearchStatus", "debounce", "cn", "atobID", "highlightSearchWord", "canSearch", "target", "NavigationSearch", "data", "onSearch", "onClose", "searchResult", "isSearching", "keywords", "ref", "locale", "copyWriting", "searchValue", "setSearchValue", "isComposing", "setIsComposing", "debouncedFunction", "value", "handleKeyDown", "searchKeywords", "keyword", "word", "getLink", "item", "searchStatus", "variant", "productImage", "productName", "productDesc", "productBadge", "listingLink", "SearchProduct", "SearchKeyword", "className", "index", "NavigationSearch_default"]
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/NavigationSearch/types.ts"],
|
|
4
|
-
"sourcesContent": ["export interface NavigationSearchProps {\n data: any\n onSearch: (value: string) => void\n onClose: () => void\n keywords?: {\n search_term: string\n search_date: string\n shopify_domain: string\n counts: number\n }[]\n searchResult: any\n isSearching?: boolean\n}\n\nexport enum SearchStatus {\n Default = 'default',\n Predict = 'predict',\n Empty = 'empty',\n}"],
|
|
4
|
+
"sourcesContent": ["export interface NavigationSearchProps {\n data: any\n onSearch: (value: string) => void\n onClose: () => void\n keywords?: {\n search_term: string\n search_date: string\n shopify_domain: string\n counts: number\n }[]\n searchResult: any\n isSearching?: boolean\n}\n\nexport enum SearchStatus {\n Default = 'default',\n Predict = 'predict',\n Empty = 'empty',\n}\n"],
|
|
5
5
|
"mappings": "AAcO,IAAKA,OACVA,EAAA,QAAU,UACVA,EAAA,QAAU,UACVA,EAAA,MAAQ,QAHEA,OAAA",
|
|
6
6
|
"names": ["SearchStatus"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as P,jsx as e,jsxs as l}from"react/jsx-runtime";import{Heading as N,Tabs as G,TabsList as W,TabsTrigger as K,TabsContent as w,Text as f,Picture as _,Link as U,Button as S,DropdownMenu as H,DropdownMenuTrigger as V,DropdownMenuContent as q,DropdownMenuItem as J,LoadingDots as C}from"../../components";import{DownArrow as Q}from"../HeaderNavigation/icons";import{useMemo as c,useRef as X,useState as L}from"react";import{cn as B,atobID as Y,highlightSearchWord as k}from"../../helpers/utils.js";import{useAiuiContext as I}from"../AiuiProvider/index.js";import{formatVariantPrice as Z}from"../ShelfDisplay/shelfDisplay";import{SearchPageTabType as u}from"./types";const O=({product:t,onSecondaryButton:o,onPrimaryButton:a,searchValue:n,variantData:g})=>{const i=c(()=>g||t?.variants?.[0],[t,g]),{locale:d="us",copyWriting:p}=I(),h=c(()=>`/products/${t?.handle}?variant=${Y(i?.id)}`,[t?.handle,i?.id]),m=i?.coupons?.[0],{price:r,basePrice:T}=Z({locale:d,amount:m?m.variant_price4wscode:i?.price,baseAmount:m?i?.price:0,currencyCode:t?.price?.currencyCode||"USD"}),y=c(()=>t?.tags?.filter?.(x=>x?.startsWith?.("CLtag"))?.map?.(x=>x?.replace?.("CLtag:",""))?.slice?.(0,2),[t?.tags]);return e("div",{className:"ipc_search_product_item lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] h-auto
|
|
1
|
+
import{Fragment as P,jsx as e,jsxs as l}from"react/jsx-runtime";import{Heading as N,Tabs as G,TabsList as W,TabsTrigger as K,TabsContent as w,Text as f,Picture as _,Link as U,Button as S,DropdownMenu as H,DropdownMenuTrigger as V,DropdownMenuContent as q,DropdownMenuItem as J,LoadingDots as C}from"../../components/index.js";import{DownArrow as Q}from"../HeaderNavigation/icons/index.js";import{useMemo as c,useRef as X,useState as L}from"react";import{cn as B,atobID as Y,highlightSearchWord as k}from"../../helpers/utils.js";import{useAiuiContext as I}from"../AiuiProvider/index.js";import{formatVariantPrice as Z}from"../ShelfDisplay/shelfDisplay.js";import{SearchPageTabType as u}from"./types.js";const O=({product:t,onSecondaryButton:o,onPrimaryButton:a,searchValue:n,variantData:g})=>{const i=c(()=>g||t?.variants?.[0],[t,g]),{locale:d="us",copyWriting:p}=I(),h=c(()=>`/products/${t?.handle}?variant=${Y(i?.id)}`,[t?.handle,i?.id]),m=i?.coupons?.[0],{price:r,basePrice:T}=Z({locale:d,amount:m?m.variant_price4wscode:i?.price,baseAmount:m?i?.price:0,currencyCode:t?.price?.currencyCode||"USD"}),y=c(()=>t?.tags?.filter?.(x=>x?.startsWith?.("CLtag"))?.map?.(x=>x?.replace?.("CLtag:",""))?.slice?.(0,2),[t?.tags]);return e("div",{className:"ipc_search_product_item lg-desktop:h-[480px] desktop:h-[384px] laptop:h-[360px] relative h-auto",children:t?.type==="advertising"?l(U,{href:t?.advertisingLink,className:"h-full",children:[e(_,{source:t?.advertisingBgImg?.url,className:"size-full",imgClassName:"size-full object-cover"}),l("div",{className:"desktop:p-6 [&_img]:hover:duration-600 absolute inset-0 z-[2] p-4 [&_img]:hover:scale-110 [&_img]:hover:transition-all",children:[e(f,{html:t?.advertisingTitle,className:"desktop:text-[18px] text-sm font-bold text-white"}),e(N,{size:3,html:t?.advertisingSubtitle,className:"laptop:line-clamp-3 mt-2 line-clamp-4 font-bold text-white"})]})]}):l("a",{href:h,className:" tablet:hover:bg-info-white desktop:p-6 desktop:pt-4 tablet:p-4 flex h-full flex-col bg-[#EAEAEC] px-2 py-4 no-underline duration-300",children:[e("div",{className:"ipc_search_product_item_image",children:e(_,{className:"lg-desktop:size-[196px] mx-auto size-[138px]",source:`${i?.image?.url||t?.images?.[0]?.url}}`,alt:t.title,imgClassName:"object-cover size-full"})}),l("div",{className:"ipc_search_product_item_content desktop:mt-2 lg-desktop:mt-3 desktop:gap-6 mt-1 flex flex-1 flex-col justify-between gap-4",children:[l("div",{className:"flex-1",children:[e("div",{className:"lg-desktop:h-[28px] mb-2 flex h-[24px] gap-2",children:y?.map(x=>e(f,{as:"p",html:x,className:"text-brand-0 lg-desktop:px-2 lg-desktop:!leading-[28px] h-full rounded-full border-[1.6px] border-[#00BEFA] px-[6px] text-sm font-bold !leading-[24px]"}))}),e(f,{className:"desktop:text-2xl tablet:line-clamp-2 line-clamp-3 text-xl font-bold !leading-[1.2]",weight:"bold",html:k(t?.title||"",n||"")}),e(f,{as:"p",className:"lg-desktop:text-[18px] tablet:line-clamp-1 mt-1 line-clamp-2 text-sm font-bold",html:k(t.description,n||"")})]}),l("div",{children:[e("div",{className:"mb-2 flex items-center",children:i?.availableForSale?l(P,{children:[e("div",{className:"final-price text-info-primary tablet:text-xl lg-desktop:text-2xl text-[18px] font-bold",children:i?.availableForSale&&r||""}),e("div",{className:"origin-price tablet:text-xl lg-desktop:text-2xl text-info-secondary ml-1 text-[18px] font-bold line-through",children:i?.availableForSale&&T||""})]}):e("div",{className:"text-info-primary tablet:text-xl lg-desktop:text-2xl text-[18px] font-bold",children:p?.soldOutText||"Sold Out"})}),l("div",{className:B("ipc_search_product_item_button_group","lg-desktop:gap-3 laptop:flex-row flex flex-col items-center gap-2"),children:[p?.learnMoreText&&e(S,{variant:"secondary",className:"laptop:w-auto w-full",size:"lg",disabled:!i?.availableForSale,onClick:()=>o?.(),children:p?.learnMoreText}),p?.shopNowText&&e(S,{variant:"primary",className:"laptop:w-auto w-full",size:"lg",disabled:!i?.availableForSale,onClick:()=>a?.(),children:p?.shopNowText})]})]})]})]})})},ee=({blog:t,searchValue:o})=>{const{copyWriting:a}=I(),n=c(()=>`blogs/${t?.handle}/${t?.handle.replace("storefront-","")}`,[t]);return e("div",{className:"ipc_search_blog_item border-b border-[#E4E5E6] py-6",children:l("div",{className:"ipc_search_blog_item_content laptop:flex-row-reverse laptop:gap-8 desktop:gap-16 flex flex-col gap-4",children:[e("div",{className:"laptop:flex-[440] desktop:flex-[540] desktop:h-[280px] h-[240px]",children:e(_,{source:t?.image?.url,className:"size-full",imgClassName:"size-full object-cover",alt:t?.title})}),l("div",{className:"laptop:flex-[424] desktop:flex-[704] lg-desktop:flex-[1056] flex flex-col justify-center",children:[e(N,{size:3,html:k(t?.title,o)}),e(f,{html:k(t?.content,o),className:"lg-desktop:text-[18px] desktop:text-[16px] mt-1 line-clamp-2 text-sm font-bold leading-[1.4]"}),e("div",{className:"desktop:mt-6 mt-4",children:e(S,{as:"a",href:n,variant:"secondary",size:"lg",children:a?.learnMoreText||"Learn More"})})]})]})})},te=({searchValue:t,page:o})=>{const{copyWriting:a,locale:n="us"}=I(),g=c(()=>`${n==="us"?"":`/${n}`}/${o?.handle}`,[o,n]);return l("div",{className:"ipc_search_page_items border-b border-[#E4E5E6] py-6",children:[e(N,{size:3,html:k(o?.name,t)}),e(f,{as:"p",html:k(o?.bodySummary||"",t),className:"lg-desktop:text-[18px] desktop:text-[16px] mt-1 text-sm font-bold leading-[1.4]"}),e(S,{as:"a",href:g,variant:"secondary",size:"lg",className:"desktop:mt-6 mt-4",children:a?.learnMoreText||"Learn More"})]})},z=({url:t,label:o})=>l("div",{className:"flex flex-col items-center justify-center gap-4",children:[e(_,{source:t,className:"h-[180px] w-[240px]",imgClassName:"object-cover"}),e(f,{html:o,className:"desktop:text-[18px] text-sm font-bold leading-[1.4]"})]}),D=({products:t,title:o,buildProps:a,onSecondaryButton:n,onPrimaryButton:g})=>{const{products:i}=a||{};return l("div",{className:"ipc_search_recommend_product tablet:pt-[80px] laptop:pt-[96px] desktop:pt-[112px] lg-desktop:pt-[128px] pt-[64px]",children:[e(N,{size:4,weight:"bold",html:o}),e("div",{className:" tablet:grid-cols-3 desktop:grid-cols-4 desktop:gap-4 mt-6 grid grid-cols-2 gap-x-3 gap-y-4",children:t?.map((d,p)=>{const h=i?.find(r=>r.handle===d.handle),m=h?.variants?.find(r=>r.sku===d.sku);return e(O,{product:h,variantData:m,onSecondaryButton:()=>n?.(),onPrimaryButton:()=>g?.()},d.id+p)})})]})},se=({searchResult:t,searchValue:o,data:a,onSecondaryButton:n,onPrimaryButton:g,onChangeSort:i,loading:d,searchResultCount:p,onChangeTab:h,buildProps:m})=>{const[r,T]=L(a?.tabs?.[0]),y=X(!1),[x,R]=L(!1),[E,j]=L({[u.PRODUCTS]:a?.tabs?.find(s=>s.tabType===u.PRODUCTS)?.sortKeys?.[0],[u.BLOGS]:a?.tabs?.find(s=>s.tabType===u.BLOGS)?.sortKeys?.[0],[u.PAGES]:a?.tabs?.find(s=>s.tabType===u.PAGES)?.sortKeys?.[0]}),b=c(()=>t?.products||[],[t]),M=c(()=>t?.blogs||[],[t]),A=c(()=>t?.pages||[],[t]),$=c(()=>Object.values(p||{}).reduce((s,v)=>s+v,0),[p]),F=c(()=>{const s={advertisingBgImg:r?.advertisingBgImg,advertisingTitle:r?.advertisingTitle,advertisingSubtitle:r?.advertisingSubtitle,advertisingLink:r?.advertisingLink,type:"advertising"};return!y.current&&b?.length&&(b?.length>=8?(b?.splice(7,0,s),y.current=!0):(b?.push(s),y.current=!0)),b},[r,b]);return l("div",{className:"ipc_search_page desktop:py-[128px] tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] px-4 py-16",children:[e(N,{size:4,weight:"bold",html:a?.title?.replace("$totalCount",$?.toString())?.replace("$inputValue",`"${o}"`)}),e("div",{className:"mt-6",children:l(G,{className:"ipc_search_page_tabs",defaultValue:"products",children:[l("div",{className:"desktop:flex desktop:items-center desktop:flex-row desktop:gap-6 desktop:justify-between",children:[e(W,{children:a?.tabs?.map(s=>l(K,{onClick:()=>{T(s),h?.(s?.tabType)},defaultValue:"products",value:s.tabType,children:[s.label," (",p?.[s.tabType],")"]},s.id))}),l(H,{onOpenChange:R,children:[e(V,{asChild:!0,children:l("button",{className:"desktop:mt-0 mt-6 flex items-center text-base font-bold leading-[1.2]",children:[r?.sortLabel," ",E?.[r?.tabType]?.label," ",e(Q,{className:B("inline-block size-4",{"rotate-180":x})})]})}),e(q,{align:"start",sideOffset:8,className:"rounded-none bg-white !px-0 py-2",children:r?.sortKeys?.map(s=>e(J,{className:B("laptop:px-4 laptop:text-base px-3 py-4 text-sm font-bold hover:bg-[#EAEAEC] hover:text-current",{"font-bold":E?.[r?.tabType]?.value===s.value}),onClick:()=>{y.current=!1,i?.(r?.tabType,s),j(v=>({...v,[r?.tabType]:s}))},children:s.label},s.id))})]})]}),l(w,{value:u.PRODUCTS,className:"ipc_search_page_tabs_products_content mt-6",children:[e("div",{className:"tablet:grid-cols-3 desktop:grid-cols-4 desktop:gap-4 grid grid-cols-2 gap-x-3 gap-y-4",children:F?.map((s,v)=>e(O,{searchValue:o,product:s,onSecondaryButton:()=>n?.(s),onPrimaryButton:()=>g?.(s)},s.id+v))}),d?e("div",{className:"mt-6 flex w-full justify-center",children:e(C,{})}):!b?.length&&l(P,{children:[e(z,{url:a?.noResultImage?.url,label:a?.noResultLabel}),e(D,{products:a?.recommendProducts||[],buildProps:m,title:a?.recommendProductsTitle})]})]}),e(w,{value:u.BLOGS,className:"ipc_search_page_tabs_blogs_content",children:l("div",{children:[M?.map(s=>e(ee,{blog:s,searchValue:o},s.id)),d?e("div",{className:"mt-6 flex justify-center",children:e(C,{})}):!M?.length&&l(P,{children:[e(z,{url:a?.noResultImage?.url,label:a?.noResultLabel}),e(D,{products:a?.recommendProducts||[],buildProps:m,title:a?.recommendProductsTitle})]})]})}),l(w,{value:u.PAGES,className:"ipc_search_page_tabs_pages_content",children:[e("div",{children:A?.map((s,v)=>e(te,{page:s,searchValue:o},s.global_id+v))}),d?e("div",{className:"mt-6 flex justify-center",children:e(C,{})}):!A?.length&&l(P,{children:[e(z,{url:a?.noResultImage?.url,label:a?.noResultLabel}),e(D,{products:a?.recommendProducts||[],buildProps:m,title:a?.recommendProductsTitle})]})]})]})})]})};var me=se;export{me as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|