@anker-in/headless-ui 1.1.85 → 1.1.87-alpha.1776830922550
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.d.ts +38 -1
- package/dist/cjs/biz-components/AccordionCards/index.js +1 -1
- package/dist/cjs/biz-components/AccordionCards/index.js.map +3 -3
- package/dist/cjs/biz-components/ActiveShelf/index.d.ts +4 -1
- package/dist/cjs/biz-components/ActivityMechanism/index.js +1 -1
- package/dist/cjs/biz-components/ActivityMechanism/index.js.map +3 -3
- package/dist/cjs/biz-components/ActivitySchedule/index.d.ts +5 -1
- package/dist/cjs/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/cjs/biz-components/ActivitySchedule/index.js.map +3 -3
- package/dist/cjs/biz-components/AnchorNavigation/index.d.ts +3 -1
- package/dist/cjs/biz-components/AnchorNavigation/index.js +1 -1
- package/dist/cjs/biz-components/AnchorNavigation/index.js.map +3 -3
- package/dist/cjs/biz-components/AplusDesc/index.d.ts +17 -1
- package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.d.ts +4 -1
- package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js +1 -1
- package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js.map +3 -3
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.d.ts +4 -1
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.js.map +3 -3
- package/dist/cjs/biz-components/BrandEquity/types.d.ts +8 -0
- package/dist/cjs/biz-components/BrandEquity/types.js +1 -1
- package/dist/cjs/biz-components/BrandEquity/types.js.map +1 -1
- package/dist/cjs/biz-components/Category/SwiperCategory.js +1 -1
- package/dist/cjs/biz-components/Category/SwiperCategory.js.map +3 -3
- package/dist/cjs/biz-components/Category/index.d.ts +3 -1
- package/dist/cjs/biz-components/Category/index.js +1 -1
- package/dist/cjs/biz-components/Category/index.js.map +3 -3
- package/dist/cjs/biz-components/CreativeModule/index.d.ts +7 -1
- package/dist/cjs/biz-components/DownLoad/index.d.ts +6 -1
- package/dist/cjs/biz-components/Evaluate/index.d.ts +3 -1
- package/dist/cjs/biz-components/Evaluate/index.js +1 -1
- package/dist/cjs/biz-components/Evaluate/index.js.map +3 -3
- package/dist/cjs/biz-components/EventSchedule/index.d.ts +3 -1
- package/dist/cjs/biz-components/EventSchedule/index.js +1 -1
- package/dist/cjs/biz-components/EventSchedule/index.js.map +3 -3
- package/dist/cjs/biz-components/Faq/Faq.d.ts +5 -2
- package/dist/cjs/biz-components/Faq/Faq.js +1 -1
- package/dist/cjs/biz-components/Faq/Faq.js.map +2 -2
- package/dist/cjs/biz-components/Faq/types.d.ts +1 -0
- package/dist/cjs/biz-components/Faq/types.js +1 -1
- package/dist/cjs/biz-components/Faq/types.js.map +1 -1
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.d.ts +5 -1
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.js +1 -1
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.js.map +3 -3
- package/dist/cjs/biz-components/FeatureShowcase/FeatureShowcase.d.ts +5 -1
- package/dist/cjs/biz-components/FeaturedBlogPosts/index.d.ts +3 -1
- package/dist/cjs/biz-components/Features/index.d.ts +8 -1
- package/dist/cjs/biz-components/FootCharger/index.d.ts +7 -1
- package/dist/cjs/biz-components/FooterNavigation/index.d.ts +2 -1
- package/dist/cjs/biz-components/GiftBox/index.d.ts +3 -1
- package/dist/cjs/biz-components/GiftBox/index.js +1 -1
- package/dist/cjs/biz-components/GiftBox/index.js.map +2 -2
- package/dist/cjs/biz-components/GiftShelf/index.d.ts +5 -1
- package/dist/cjs/biz-components/GiftShelf/index.js +1 -1
- package/dist/cjs/biz-components/GiftShelf/index.js.map +3 -3
- package/dist/cjs/biz-components/GiftTierShelf/index.d.ts +5 -1
- package/dist/cjs/biz-components/GiftTierShelf/index.js +1 -1
- package/dist/cjs/biz-components/GiftTierShelf/index.js.map +3 -3
- package/dist/cjs/biz-components/Graphic/index.d.ts +3 -1
- package/dist/cjs/biz-components/Graphic/index.js +1 -1
- package/dist/cjs/biz-components/Graphic/index.js.map +3 -3
- package/dist/cjs/biz-components/GraphicAttractionBlock/index.d.ts +3 -1
- package/dist/cjs/biz-components/GraphicMore/index.d.ts +7 -1
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.d.ts +12 -2
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/MobileTextLinksMenu.d.ts +12 -0
- package/dist/cjs/biz-components/HeaderNavigation/MobileTextLinksMenu.js +2 -0
- package/dist/cjs/biz-components/HeaderNavigation/MobileTextLinksMenu.js.map +7 -0
- package/dist/cjs/biz-components/HeaderNavigation/TextLinksDropdown.d.ts +10 -0
- package/dist/cjs/biz-components/HeaderNavigation/TextLinksDropdown.js +2 -0
- package/dist/cjs/biz-components/HeaderNavigation/TextLinksDropdown.js.map +7 -0
- package/dist/cjs/biz-components/HeaderNavigation/index.d.ts +5 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js.map +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/types.d.ts +8 -1
- package/dist/cjs/biz-components/HeaderNavigation/types.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/types.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.d.ts +1 -0
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.js.map +3 -3
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.d.ts +27 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.js.map +3 -3
- package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.d.ts +23 -0
- package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js +2 -0
- package/dist/cjs/biz-components/HeroBanner/HeroBannerCarousel.js.map +7 -0
- package/dist/cjs/biz-components/HeroBanner/index.d.ts +1 -0
- package/dist/cjs/biz-components/HeroBanner/index.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/index.js.map +1 -1
- package/dist/cjs/biz-components/HeroBanner/types.d.ts +73 -0
- package/dist/cjs/biz-components/HeroBanner/types.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/types.js.map +1 -1
- package/dist/cjs/biz-components/ImageOverlayShelf/index.d.ts +5 -2
- package/dist/cjs/biz-components/ImageOverlayShelf/index.js +1 -1
- package/dist/cjs/biz-components/ImageOverlayShelf/index.js.map +3 -3
- package/dist/cjs/biz-components/ImageTextFeature/ImageTextFeature.d.ts +5 -1
- package/dist/cjs/biz-components/ImageTextOverlay/index.d.ts +7 -0
- package/dist/cjs/biz-components/ImageTextOverlay/index.js +2 -0
- package/dist/cjs/biz-components/ImageTextOverlay/index.js.map +7 -0
- package/dist/cjs/biz-components/ImageTextOverlay/types.d.ts +58 -0
- package/dist/cjs/biz-components/ImageTextOverlay/types.js +2 -0
- package/dist/cjs/biz-components/ImageTextOverlay/types.js.map +7 -0
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.d.ts +5 -1
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.js.map +3 -3
- package/dist/cjs/biz-components/Ksp/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.d.ts +11 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +26 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +1 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +1 -1
- 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 +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.d.ts +11 -1
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +1 -1
- 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 +3 -3
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.d.ts +2 -1
- package/dist/cjs/biz-components/LotteryShared/BaseModal.js +1 -1
- package/dist/cjs/biz-components/LotteryShared/BaseModal.js.map +2 -2
- package/dist/cjs/biz-components/LotteryShared/ChanceMethods.js +1 -1
- package/dist/cjs/biz-components/LotteryShared/ChanceMethods.js.map +3 -3
- package/dist/cjs/biz-components/LotteryShared/ErrorModal.d.ts +19 -0
- package/dist/cjs/biz-components/LotteryShared/ErrorModal.js +1 -1
- package/dist/cjs/biz-components/LotteryShared/ErrorModal.js.map +3 -3
- package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.d.ts +33 -0
- package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.js +1 -1
- package/dist/cjs/biz-components/LotteryShared/MyRewardsModal.js.map +3 -3
- package/dist/cjs/biz-components/LotteryShared/PrizePool.js +1 -1
- package/dist/cjs/biz-components/LotteryShared/PrizePool.js.map +3 -3
- package/dist/cjs/biz-components/LotteryShared/WinnerModal.d.ts +1 -1
- package/dist/cjs/biz-components/LotteryShared/WinnerModal.js +1 -1
- package/dist/cjs/biz-components/LotteryShared/WinnerModal.js.map +3 -3
- package/dist/cjs/biz-components/LotteryShared/types.d.ts +138 -0
- package/dist/cjs/biz-components/LotteryShared/types.js +1 -1
- package/dist/cjs/biz-components/LotteryShared/types.js.map +2 -2
- package/dist/cjs/biz-components/Marquee/Marquee.d.ts +4 -2
- package/dist/cjs/biz-components/Marquee/Marquee.js +1 -1
- package/dist/cjs/biz-components/Marquee/Marquee.js.map +3 -3
- package/dist/cjs/biz-components/Marquee/type.d.ts +5 -2
- package/dist/cjs/biz-components/Marquee/type.js.map +1 -1
- package/dist/cjs/biz-components/MarqueeReview/index.d.ts +1 -1
- package/dist/cjs/biz-components/Media/index.d.ts +15 -3
- package/dist/cjs/biz-components/Media/index.js +1 -1
- package/dist/cjs/biz-components/Media/index.js.map +3 -3
- package/dist/cjs/biz-components/MediaEndorsement/index.d.ts +4 -1
- package/dist/cjs/biz-components/MediaEndorsement/index.js +2 -2
- package/dist/cjs/biz-components/MediaEndorsement/index.js.map +2 -2
- package/dist/cjs/biz-components/MediaPlayerBase/index.d.ts +4 -1
- package/dist/cjs/biz-components/MediaPlayerMulti/index.d.ts +4 -1
- package/dist/cjs/biz-components/MediaPlayerMulti/index.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerMulti/index.js.map +3 -3
- package/dist/cjs/biz-components/MediaPlayerSticky/index.d.ts +7 -1
- package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +4 -1
- package/dist/cjs/biz-components/MediaSceneSwitcherV2/index.d.ts +3 -1
- package/dist/cjs/biz-components/MediaShelf/index.d.ts +4 -1
- package/dist/cjs/biz-components/MemberEquity/index.d.ts +3 -1
- package/dist/cjs/biz-components/MemberEquity/index.js +2 -2
- package/dist/cjs/biz-components/MemberEquity/index.js.map +3 -3
- package/dist/cjs/biz-components/MiniCart/index.js +1 -1
- package/dist/cjs/biz-components/MiniCart/index.js.map +2 -2
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +19 -2
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
- package/dist/cjs/biz-components/NavigationSearch/index.d.ts +4 -1
- 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/ProductCompare/index.d.ts +1 -1
- package/dist/cjs/biz-components/ProductHero/ProductHero.d.ts +5 -1
- package/dist/cjs/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/cjs/biz-components/ProductHero/ProductHero.js.map +3 -3
- package/dist/cjs/biz-components/ProductLottery/MediaDrawArea.js +1 -1
- package/dist/cjs/biz-components/ProductLottery/MediaDrawArea.js.map +3 -3
- package/dist/cjs/biz-components/ProductLottery/index.d.ts +10 -2
- package/dist/cjs/biz-components/ProductLottery/index.js +1 -1
- package/dist/cjs/biz-components/ProductLottery/index.js.map +3 -3
- package/dist/cjs/biz-components/ProductLottery/types.d.ts +210 -96
- package/dist/cjs/biz-components/ProductLottery/types.js +1 -1
- package/dist/cjs/biz-components/ProductLottery/types.js.map +2 -2
- package/dist/cjs/biz-components/ProductNav/ProductNav.d.ts +4 -1
- package/dist/cjs/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/cjs/biz-components/ProductNav/ProductNav.js.map +3 -3
- package/dist/cjs/biz-components/PromotionalBar/index.d.ts +3 -1
- package/dist/cjs/biz-components/PromotionalBar/index.js +1 -1
- package/dist/cjs/biz-components/PromotionalBar/index.js.map +3 -3
- package/dist/cjs/biz-components/SceneShelfV2/index.d.ts +104 -0
- package/dist/cjs/biz-components/SceneShelfV2/index.js +2 -0
- package/dist/cjs/biz-components/SceneShelfV2/index.js.map +7 -0
- package/dist/cjs/biz-components/SceneShelfV3/ProductCard.d.ts +83 -0
- package/dist/cjs/biz-components/SceneShelfV3/ProductCard.js +2 -0
- package/dist/cjs/biz-components/SceneShelfV3/ProductCard.js.map +7 -0
- package/dist/cjs/biz-components/SceneShelfV3/index.d.ts +79 -0
- package/dist/cjs/biz-components/SceneShelfV3/index.js +2 -0
- package/dist/cjs/biz-components/SceneShelfV3/index.js.map +7 -0
- package/dist/cjs/biz-components/SceneShelfV3/types.d.ts +19 -0
- package/dist/cjs/biz-components/SceneShelfV3/types.js +2 -0
- package/dist/cjs/biz-components/SceneShelfV3/types.js.map +7 -0
- package/dist/cjs/biz-components/SecondaryBanner/SecondaryBannerCarousel.d.ts +21 -0
- package/dist/cjs/biz-components/SecondaryBanner/SecondaryBannerCarousel.js +2 -0
- package/dist/cjs/biz-components/SecondaryBanner/SecondaryBannerCarousel.js.map +7 -0
- package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +67 -1
- package/dist/cjs/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/cjs/biz-components/SecondaryBanner/index.js.map +3 -3
- package/dist/cjs/biz-components/SelectStore/index.d.ts +7 -1
- package/dist/cjs/biz-components/ShelfDisplay/index.d.ts +5 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- package/dist/cjs/biz-components/Slogan/index.d.ts +5 -1
- package/dist/cjs/biz-components/Spacer/index.d.ts +5 -1
- package/dist/cjs/biz-components/Specs/index.d.ts +3 -1
- package/dist/cjs/biz-components/SpecsComparison/SpecsComparison.d.ts +5 -1
- package/dist/cjs/biz-components/Subscribe/index.js +2 -2
- package/dist/cjs/biz-components/Subscribe/index.js.map +2 -2
- package/dist/cjs/biz-components/SwiperBox/index.js +1 -1
- package/dist/cjs/biz-components/SwiperBox/index.js.map +3 -3
- package/dist/cjs/biz-components/TabWithImage/TabWithImage.d.ts +5 -1
- package/dist/cjs/biz-components/Tabs/Tabs.d.ts +5 -1
- package/dist/cjs/biz-components/Tabs/Tabs.js +1 -1
- package/dist/cjs/biz-components/Tabs/Tabs.js.map +3 -3
- package/dist/cjs/biz-components/Tabs/types.d.ts +3 -0
- package/dist/cjs/biz-components/Tabs/types.js +1 -1
- package/dist/cjs/biz-components/Tabs/types.js.map +1 -1
- package/dist/cjs/biz-components/TabsGroup/index.d.ts +5 -1
- package/dist/cjs/biz-components/TabsWithMedia/TabsWithMedia.d.ts +5 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +5 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +3 -3
- package/dist/cjs/biz-components/Title/index.d.ts +3 -1
- package/dist/cjs/biz-components/Title/index.js +1 -1
- package/dist/cjs/biz-components/Title/index.js.map +3 -3
- package/dist/cjs/biz-components/Title/types.d.ts +53 -1
- package/dist/cjs/biz-components/Title/types.js +1 -1
- package/dist/cjs/biz-components/Title/types.js.map +1 -1
- package/dist/cjs/biz-components/VideoFeature/VideoFeature.d.ts +5 -1
- package/dist/cjs/biz-components/WebPushPopup/index.d.ts +44 -0
- package/dist/cjs/biz-components/WebPushPopup/index.js +2 -0
- package/dist/cjs/biz-components/WebPushPopup/index.js.map +7 -0
- package/dist/cjs/biz-components/WheelLottery/BaseModal.js +1 -1
- package/dist/cjs/biz-components/WheelLottery/BaseModal.js.map +2 -2
- package/dist/cjs/biz-components/WheelLottery/ErrorModal.js +1 -1
- package/dist/cjs/biz-components/WheelLottery/ErrorModal.js.map +2 -2
- package/dist/cjs/biz-components/WheelLottery/MyRewardsModal.js +1 -1
- package/dist/cjs/biz-components/WheelLottery/MyRewardsModal.js.map +2 -2
- package/dist/cjs/biz-components/WheelLottery/index.d.ts +4 -1
- package/dist/cjs/biz-components/WheelLottery/index.js +1 -1
- package/dist/cjs/biz-components/WheelLottery/index.js.map +3 -3
- package/dist/cjs/biz-components/WheelLottery/types.d.ts +6 -0
- package/dist/cjs/biz-components/WheelLottery/types.js.map +2 -2
- package/dist/cjs/biz-components/WhyChoose/WhyChoose.d.ts +5 -2
- package/dist/cjs/biz-components/index.d.ts +11 -0
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/components/Countdown.js +1 -1
- package/dist/cjs/components/Countdown.js.map +3 -3
- package/dist/cjs/components/link.js +1 -1
- package/dist/cjs/components/link.js.map +2 -2
- package/dist/cjs/helpers/index.d.ts +1 -1
- package/dist/cjs/helpers/index.js +1 -1
- package/dist/cjs/helpers/index.js.map +2 -2
- package/dist/cjs/helpers/isLexicalEmpty.d.ts +5 -0
- package/dist/cjs/helpers/isLexicalEmpty.js +1 -1
- package/dist/cjs/helpers/isLexicalEmpty.js.map +3 -3
- package/dist/cjs/hooks/useEmarsysWebPush.d.ts +111 -0
- package/dist/cjs/hooks/useEmarsysWebPush.js +2 -0
- package/dist/cjs/hooks/useEmarsysWebPush.js.map +7 -0
- package/dist/cjs/hooks/useGridRowCount.d.ts +16 -0
- package/dist/cjs/hooks/useGridRowCount.js +2 -0
- package/dist/cjs/hooks/useGridRowCount.js.map +7 -0
- package/dist/cjs/hooks/useProductListTrack.d.ts +43 -0
- package/dist/cjs/hooks/useProductListTrack.js +2 -0
- package/dist/cjs/hooks/useProductListTrack.js.map +7 -0
- package/dist/cjs/shared/Styles.d.ts +7 -21
- package/dist/cjs/shared/Styles.js +1 -1
- package/dist/cjs/shared/Styles.js.map +3 -3
- package/dist/cjs/types/props.d.ts +16 -0
- package/dist/cjs/types/props.js +1 -1
- package/dist/cjs/types/props.js.map +1 -1
- package/dist/esm/biz-components/AccordionCards/index.d.ts +38 -1
- package/dist/esm/biz-components/AccordionCards/index.js +1 -1
- package/dist/esm/biz-components/AccordionCards/index.js.map +3 -3
- package/dist/esm/biz-components/ActiveShelf/index.d.ts +4 -1
- package/dist/esm/biz-components/ActivityMechanism/index.js +1 -1
- package/dist/esm/biz-components/ActivityMechanism/index.js.map +3 -3
- package/dist/esm/biz-components/ActivitySchedule/index.d.ts +5 -1
- package/dist/esm/biz-components/ActivitySchedule/index.js +1 -1
- package/dist/esm/biz-components/ActivitySchedule/index.js.map +3 -3
- package/dist/esm/biz-components/AnchorNavigation/index.d.ts +3 -1
- package/dist/esm/biz-components/AnchorNavigation/index.js +1 -1
- package/dist/esm/biz-components/AnchorNavigation/index.js.map +3 -3
- package/dist/esm/biz-components/AplusDesc/index.d.ts +17 -1
- package/dist/esm/biz-components/BrandCardLink/BrandCardLink.d.ts +4 -1
- package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js +1 -1
- package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js.map +3 -3
- package/dist/esm/biz-components/BrandEquity/BrandEquity.d.ts +4 -1
- package/dist/esm/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/esm/biz-components/BrandEquity/BrandEquity.js.map +3 -3
- package/dist/esm/biz-components/BrandEquity/types.d.ts +8 -0
- package/dist/esm/biz-components/Category/SwiperCategory.js +1 -1
- package/dist/esm/biz-components/Category/SwiperCategory.js.map +3 -3
- package/dist/esm/biz-components/Category/index.d.ts +3 -1
- package/dist/esm/biz-components/Category/index.js +1 -1
- package/dist/esm/biz-components/Category/index.js.map +3 -3
- package/dist/esm/biz-components/CreativeModule/index.d.ts +7 -1
- package/dist/esm/biz-components/DownLoad/index.d.ts +6 -1
- package/dist/esm/biz-components/Evaluate/index.d.ts +3 -1
- package/dist/esm/biz-components/Evaluate/index.js +1 -1
- package/dist/esm/biz-components/Evaluate/index.js.map +3 -3
- package/dist/esm/biz-components/EventSchedule/index.d.ts +3 -1
- package/dist/esm/biz-components/EventSchedule/index.js +1 -1
- package/dist/esm/biz-components/EventSchedule/index.js.map +3 -3
- package/dist/esm/biz-components/Faq/Faq.d.ts +5 -2
- package/dist/esm/biz-components/Faq/Faq.js +1 -1
- package/dist/esm/biz-components/Faq/Faq.js.map +2 -2
- package/dist/esm/biz-components/Faq/types.d.ts +1 -0
- package/dist/esm/biz-components/FeatureCards/FeatureCards.d.ts +5 -1
- package/dist/esm/biz-components/FeatureCards/FeatureCards.js +1 -1
- package/dist/esm/biz-components/FeatureCards/FeatureCards.js.map +3 -3
- package/dist/esm/biz-components/FeatureShowcase/FeatureShowcase.d.ts +5 -1
- package/dist/esm/biz-components/FeaturedBlogPosts/index.d.ts +3 -1
- package/dist/esm/biz-components/Features/index.d.ts +8 -1
- package/dist/esm/biz-components/FootCharger/index.d.ts +7 -1
- package/dist/esm/biz-components/FooterNavigation/index.d.ts +2 -1
- package/dist/esm/biz-components/GiftBox/index.d.ts +3 -1
- package/dist/esm/biz-components/GiftBox/index.js +1 -1
- package/dist/esm/biz-components/GiftBox/index.js.map +2 -2
- package/dist/esm/biz-components/GiftShelf/index.d.ts +5 -1
- package/dist/esm/biz-components/GiftShelf/index.js +1 -1
- package/dist/esm/biz-components/GiftShelf/index.js.map +3 -3
- package/dist/esm/biz-components/GiftTierShelf/index.d.ts +5 -1
- package/dist/esm/biz-components/GiftTierShelf/index.js +1 -1
- package/dist/esm/biz-components/GiftTierShelf/index.js.map +3 -3
- package/dist/esm/biz-components/Graphic/index.d.ts +3 -1
- package/dist/esm/biz-components/Graphic/index.js +1 -1
- package/dist/esm/biz-components/Graphic/index.js.map +3 -3
- package/dist/esm/biz-components/GraphicAttractionBlock/index.d.ts +3 -1
- package/dist/esm/biz-components/GraphicMore/index.d.ts +7 -1
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.d.ts +12 -2
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js +1 -1
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/MobileTextLinksMenu.d.ts +12 -0
- package/dist/esm/biz-components/HeaderNavigation/MobileTextLinksMenu.js +2 -0
- package/dist/esm/biz-components/HeaderNavigation/MobileTextLinksMenu.js.map +7 -0
- package/dist/esm/biz-components/HeaderNavigation/TextLinksDropdown.d.ts +10 -0
- package/dist/esm/biz-components/HeaderNavigation/TextLinksDropdown.js +2 -0
- package/dist/esm/biz-components/HeaderNavigation/TextLinksDropdown.js.map +7 -0
- package/dist/esm/biz-components/HeaderNavigation/index.d.ts +5 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js.map +3 -3
- package/dist/esm/biz-components/HeaderNavigation/types.d.ts +8 -1
- package/dist/esm/biz-components/HeaderNavigation/types.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/types.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/withCategory.d.ts +1 -0
- package/dist/esm/biz-components/HeaderNavigation/withCategory.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/withCategory.js.map +3 -3
- package/dist/esm/biz-components/HeroBanner/HeroBanner.d.ts +27 -1
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js +1 -1
- package/dist/esm/biz-components/HeroBanner/HeroBanner.js.map +3 -3
- package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.d.ts +23 -0
- package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js +2 -0
- package/dist/esm/biz-components/HeroBanner/HeroBannerCarousel.js.map +7 -0
- package/dist/esm/biz-components/HeroBanner/index.d.ts +1 -0
- package/dist/esm/biz-components/HeroBanner/index.js +1 -1
- package/dist/esm/biz-components/HeroBanner/index.js.map +1 -1
- package/dist/esm/biz-components/HeroBanner/types.d.ts +73 -0
- package/dist/esm/biz-components/ImageOverlayShelf/index.d.ts +5 -2
- package/dist/esm/biz-components/ImageOverlayShelf/index.js +1 -1
- package/dist/esm/biz-components/ImageOverlayShelf/index.js.map +3 -3
- package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.d.ts +5 -1
- package/dist/esm/biz-components/ImageTextOverlay/index.d.ts +7 -0
- package/dist/esm/biz-components/ImageTextOverlay/index.js +2 -0
- package/dist/esm/biz-components/ImageTextOverlay/index.js.map +7 -0
- package/dist/esm/biz-components/ImageTextOverlay/types.d.ts +58 -0
- package/dist/esm/biz-components/ImageTextOverlay/types.js +1 -0
- package/dist/esm/biz-components/ImageTextOverlay/types.js.map +7 -0
- package/dist/esm/biz-components/ImageWithText/ImageWithText.d.ts +5 -1
- package/dist/esm/biz-components/ImageWithText/ImageWithText.js +1 -1
- package/dist/esm/biz-components/ImageWithText/ImageWithText.js.map +3 -3
- package/dist/esm/biz-components/Ksp/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.d.ts +11 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +26 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +1 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +1 -1
- 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 +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductPaidShipping/index.d.ts +11 -1
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +1 -1
- 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 +3 -3
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.d.ts +2 -1
- package/dist/esm/biz-components/LotteryShared/BaseModal.js +1 -1
- package/dist/esm/biz-components/LotteryShared/BaseModal.js.map +2 -2
- package/dist/esm/biz-components/LotteryShared/ChanceMethods.js +1 -1
- package/dist/esm/biz-components/LotteryShared/ChanceMethods.js.map +3 -3
- package/dist/esm/biz-components/LotteryShared/ErrorModal.d.ts +19 -0
- package/dist/esm/biz-components/LotteryShared/ErrorModal.js +1 -1
- package/dist/esm/biz-components/LotteryShared/ErrorModal.js.map +3 -3
- package/dist/esm/biz-components/LotteryShared/MyRewardsModal.d.ts +33 -0
- package/dist/esm/biz-components/LotteryShared/MyRewardsModal.js +1 -1
- package/dist/esm/biz-components/LotteryShared/MyRewardsModal.js.map +3 -3
- package/dist/esm/biz-components/LotteryShared/PrizePool.js +1 -1
- package/dist/esm/biz-components/LotteryShared/PrizePool.js.map +3 -3
- package/dist/esm/biz-components/LotteryShared/WinnerModal.d.ts +1 -1
- package/dist/esm/biz-components/LotteryShared/WinnerModal.js +1 -1
- package/dist/esm/biz-components/LotteryShared/WinnerModal.js.map +3 -3
- package/dist/esm/biz-components/LotteryShared/types.d.ts +138 -0
- package/dist/esm/biz-components/LotteryShared/types.js +1 -1
- package/dist/esm/biz-components/LotteryShared/types.js.map +2 -2
- package/dist/esm/biz-components/Marquee/Marquee.d.ts +4 -2
- package/dist/esm/biz-components/Marquee/Marquee.js +1 -1
- package/dist/esm/biz-components/Marquee/Marquee.js.map +3 -3
- package/dist/esm/biz-components/Marquee/type.d.ts +5 -2
- package/dist/esm/biz-components/MarqueeReview/index.d.ts +1 -1
- package/dist/esm/biz-components/Media/index.d.ts +15 -3
- package/dist/esm/biz-components/Media/index.js +1 -1
- package/dist/esm/biz-components/Media/index.js.map +3 -3
- package/dist/esm/biz-components/MediaEndorsement/index.d.ts +4 -1
- package/dist/esm/biz-components/MediaEndorsement/index.js +2 -2
- package/dist/esm/biz-components/MediaEndorsement/index.js.map +2 -2
- package/dist/esm/biz-components/MediaPlayerBase/index.d.ts +4 -1
- package/dist/esm/biz-components/MediaPlayerMulti/index.d.ts +4 -1
- package/dist/esm/biz-components/MediaPlayerMulti/index.js +1 -1
- package/dist/esm/biz-components/MediaPlayerMulti/index.js.map +3 -3
- package/dist/esm/biz-components/MediaPlayerSticky/index.d.ts +7 -1
- package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +4 -1
- package/dist/esm/biz-components/MediaSceneSwitcherV2/index.d.ts +3 -1
- package/dist/esm/biz-components/MediaShelf/index.d.ts +4 -1
- package/dist/esm/biz-components/MemberEquity/index.d.ts +3 -1
- package/dist/esm/biz-components/MemberEquity/index.js +2 -2
- package/dist/esm/biz-components/MemberEquity/index.js.map +3 -3
- package/dist/esm/biz-components/MiniCart/index.js +1 -1
- package/dist/esm/biz-components/MiniCart/index.js.map +2 -2
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +19 -2
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
- package/dist/esm/biz-components/NavigationSearch/index.d.ts +4 -1
- package/dist/esm/biz-components/NavigationSearch/index.js +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.js.map +3 -3
- package/dist/esm/biz-components/ProductCompare/index.d.ts +1 -1
- package/dist/esm/biz-components/ProductHero/ProductHero.d.ts +5 -1
- package/dist/esm/biz-components/ProductHero/ProductHero.js +1 -1
- package/dist/esm/biz-components/ProductHero/ProductHero.js.map +3 -3
- package/dist/esm/biz-components/ProductLottery/MediaDrawArea.js +1 -1
- package/dist/esm/biz-components/ProductLottery/MediaDrawArea.js.map +3 -3
- package/dist/esm/biz-components/ProductLottery/index.d.ts +10 -2
- package/dist/esm/biz-components/ProductLottery/index.js +1 -1
- package/dist/esm/biz-components/ProductLottery/index.js.map +3 -3
- package/dist/esm/biz-components/ProductLottery/types.d.ts +210 -96
- package/dist/esm/biz-components/ProductLottery/types.js +1 -1
- package/dist/esm/biz-components/ProductLottery/types.js.map +2 -2
- package/dist/esm/biz-components/ProductNav/ProductNav.d.ts +4 -1
- package/dist/esm/biz-components/ProductNav/ProductNav.js +1 -1
- package/dist/esm/biz-components/ProductNav/ProductNav.js.map +3 -3
- package/dist/esm/biz-components/PromotionalBar/index.d.ts +3 -1
- package/dist/esm/biz-components/PromotionalBar/index.js +1 -1
- package/dist/esm/biz-components/PromotionalBar/index.js.map +3 -3
- package/dist/esm/biz-components/SceneShelfV2/index.d.ts +104 -0
- package/dist/esm/biz-components/SceneShelfV2/index.js +2 -0
- package/dist/esm/biz-components/SceneShelfV2/index.js.map +7 -0
- package/dist/esm/biz-components/SceneShelfV3/ProductCard.d.ts +83 -0
- package/dist/esm/biz-components/SceneShelfV3/ProductCard.js +2 -0
- package/dist/esm/biz-components/SceneShelfV3/ProductCard.js.map +7 -0
- package/dist/esm/biz-components/SceneShelfV3/index.d.ts +79 -0
- package/dist/esm/biz-components/SceneShelfV3/index.js +2 -0
- package/dist/esm/biz-components/SceneShelfV3/index.js.map +7 -0
- package/dist/esm/biz-components/SceneShelfV3/types.d.ts +19 -0
- package/dist/esm/biz-components/SceneShelfV3/types.js +1 -0
- package/dist/esm/biz-components/SceneShelfV3/types.js.map +7 -0
- package/dist/esm/biz-components/SecondaryBanner/SecondaryBannerCarousel.d.ts +21 -0
- package/dist/esm/biz-components/SecondaryBanner/SecondaryBannerCarousel.js +2 -0
- package/dist/esm/biz-components/SecondaryBanner/SecondaryBannerCarousel.js.map +7 -0
- package/dist/esm/biz-components/SecondaryBanner/index.d.ts +67 -1
- package/dist/esm/biz-components/SecondaryBanner/index.js +1 -1
- package/dist/esm/biz-components/SecondaryBanner/index.js.map +3 -3
- package/dist/esm/biz-components/SelectStore/index.d.ts +7 -1
- package/dist/esm/biz-components/ShelfDisplay/index.d.ts +5 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- package/dist/esm/biz-components/Slogan/index.d.ts +5 -1
- package/dist/esm/biz-components/Spacer/index.d.ts +5 -1
- package/dist/esm/biz-components/Specs/index.d.ts +3 -1
- package/dist/esm/biz-components/SpecsComparison/SpecsComparison.d.ts +5 -1
- package/dist/esm/biz-components/Subscribe/index.js +2 -2
- package/dist/esm/biz-components/Subscribe/index.js.map +2 -2
- package/dist/esm/biz-components/SwiperBox/index.js +1 -1
- package/dist/esm/biz-components/SwiperBox/index.js.map +3 -3
- package/dist/esm/biz-components/TabWithImage/TabWithImage.d.ts +5 -1
- package/dist/esm/biz-components/Tabs/Tabs.d.ts +5 -1
- package/dist/esm/biz-components/Tabs/Tabs.js +1 -1
- package/dist/esm/biz-components/Tabs/Tabs.js.map +3 -3
- package/dist/esm/biz-components/Tabs/types.d.ts +3 -0
- package/dist/esm/biz-components/TabsGroup/index.d.ts +5 -1
- package/dist/esm/biz-components/TabsWithMedia/TabsWithMedia.d.ts +5 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +5 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js +1 -1
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.js.map +3 -3
- package/dist/esm/biz-components/Title/index.d.ts +3 -1
- package/dist/esm/biz-components/Title/index.js +1 -1
- package/dist/esm/biz-components/Title/index.js.map +3 -3
- package/dist/esm/biz-components/Title/types.d.ts +53 -1
- package/dist/esm/biz-components/VideoFeature/VideoFeature.d.ts +5 -1
- package/dist/esm/biz-components/WebPushPopup/index.d.ts +44 -0
- package/dist/esm/biz-components/WebPushPopup/index.js +2 -0
- package/dist/esm/biz-components/WebPushPopup/index.js.map +7 -0
- package/dist/esm/biz-components/WheelLottery/BaseModal.js +1 -1
- package/dist/esm/biz-components/WheelLottery/BaseModal.js.map +2 -2
- package/dist/esm/biz-components/WheelLottery/ErrorModal.js +1 -1
- package/dist/esm/biz-components/WheelLottery/ErrorModal.js.map +2 -2
- package/dist/esm/biz-components/WheelLottery/MyRewardsModal.js +1 -1
- package/dist/esm/biz-components/WheelLottery/MyRewardsModal.js.map +2 -2
- package/dist/esm/biz-components/WheelLottery/index.d.ts +4 -1
- package/dist/esm/biz-components/WheelLottery/index.js +1 -1
- package/dist/esm/biz-components/WheelLottery/index.js.map +3 -3
- package/dist/esm/biz-components/WheelLottery/types.d.ts +6 -0
- package/dist/esm/biz-components/WheelLottery/types.js.map +2 -2
- package/dist/esm/biz-components/WhyChoose/WhyChoose.d.ts +5 -2
- package/dist/esm/biz-components/index.d.ts +11 -0
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +3 -3
- package/dist/esm/components/Countdown.js +1 -1
- package/dist/esm/components/Countdown.js.map +3 -3
- package/dist/esm/components/link.js +1 -1
- package/dist/esm/components/link.js.map +2 -2
- package/dist/esm/helpers/index.d.ts +1 -1
- package/dist/esm/helpers/index.js +1 -1
- package/dist/esm/helpers/index.js.map +3 -3
- package/dist/esm/helpers/isLexicalEmpty.d.ts +5 -0
- package/dist/esm/helpers/isLexicalEmpty.js +1 -1
- package/dist/esm/helpers/isLexicalEmpty.js.map +3 -3
- package/dist/esm/hooks/useEmarsysWebPush.d.ts +111 -0
- package/dist/esm/hooks/useEmarsysWebPush.js +2 -0
- package/dist/esm/hooks/useEmarsysWebPush.js.map +7 -0
- package/dist/esm/hooks/useGridRowCount.d.ts +16 -0
- package/dist/esm/hooks/useGridRowCount.js +2 -0
- package/dist/esm/hooks/useGridRowCount.js.map +7 -0
- package/dist/esm/hooks/useProductListTrack.d.ts +43 -0
- package/dist/esm/hooks/useProductListTrack.js +2 -0
- package/dist/esm/hooks/useProductListTrack.js.map +7 -0
- package/dist/esm/shared/Styles.d.ts +7 -21
- package/dist/esm/shared/Styles.js +1 -1
- package/dist/esm/shared/Styles.js.map +3 -3
- package/dist/esm/types/props.d.ts +16 -0
- package/package.json +4 -2
- package/static/emarsys-service-worker.js +31 -0
- package/style.css +306 -30
- package/tailwind.config.js +23 -1
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type PromotionalBarProps } from '../PromotionalBar/index.js';
|
|
3
|
+
import { ProductCard, type ProductCardData, type SceneShelfV3SemanticName, type StockDisplayMode } from './ProductCard.js';
|
|
4
|
+
import type { ButtonFunctionType, CopyConfig } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* 场景 Tab 数据接口(匹配 mock.json.sceneTabs 结构)
|
|
7
|
+
*/
|
|
8
|
+
export interface ProductTab {
|
|
9
|
+
/** Tab 唯一 ID */
|
|
10
|
+
id: string;
|
|
11
|
+
/** Tab 标签文本 */
|
|
12
|
+
label: string;
|
|
13
|
+
/** 产品列表 */
|
|
14
|
+
products: ProductCardData[];
|
|
15
|
+
/** 资源块(如 PromotionalBar) */
|
|
16
|
+
resourceBlocks?: Array<PromotionalBarProps['data'] & {
|
|
17
|
+
blockType: string;
|
|
18
|
+
display: 'visible' | 'hidden';
|
|
19
|
+
}>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* SceneShelfV3 数据接口(直接匹配 mock.json 结构)
|
|
23
|
+
*/
|
|
24
|
+
export interface SceneShelfV3Data {
|
|
25
|
+
/** 组件实例 ID */
|
|
26
|
+
id: string;
|
|
27
|
+
/** 主题 */
|
|
28
|
+
theme?: 'light' | 'dark';
|
|
29
|
+
/** 显示状态 */
|
|
30
|
+
display?: 'visible' | 'hidden';
|
|
31
|
+
/** 组件类型标识 */
|
|
32
|
+
blockType: 'ipc-scene-shelf-v3';
|
|
33
|
+
/** 场景 Tab 列表(每个 Tab 包含产品和 resourceBlocks) */
|
|
34
|
+
sceneTabs: ProductTab[];
|
|
35
|
+
copy?: CopyConfig;
|
|
36
|
+
/** 是否显示标签 */
|
|
37
|
+
showTags?: boolean;
|
|
38
|
+
/** 查看更多限制数 */
|
|
39
|
+
viewMoreLimit?: number;
|
|
40
|
+
/** 主按钮文本 */
|
|
41
|
+
primaryButtonText?: string;
|
|
42
|
+
/** 主按钮功能 */
|
|
43
|
+
primaryButtonFun?: ButtonFunctionType;
|
|
44
|
+
/** 次按钮文本 */
|
|
45
|
+
secondaryButtonText?: string;
|
|
46
|
+
/** 次按钮功能 */
|
|
47
|
+
secondaryButtonFun?: ButtonFunctionType;
|
|
48
|
+
/** 组件标题(可选,非 mock 必需) */
|
|
49
|
+
title?: string;
|
|
50
|
+
/** 组件描述(可选,非 mock 必需) */
|
|
51
|
+
description?: string;
|
|
52
|
+
/** 库存展示模式(可选) */
|
|
53
|
+
stockDisplayMode?: StockDisplayMode;
|
|
54
|
+
/** 库存阈值(可选) */
|
|
55
|
+
stockThresholdValue?: number;
|
|
56
|
+
/** 是否显示原价(可选) */
|
|
57
|
+
showOriginalPrice?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface SceneShelfV3Props extends React.HTMLAttributes<HTMLDivElement> {
|
|
60
|
+
/** 业务数据 */
|
|
61
|
+
data: SceneShelfV3Data;
|
|
62
|
+
/** 点击了解更多回调 */
|
|
63
|
+
onLearnMore?: (link: string) => void;
|
|
64
|
+
/** 点击立即购买回调 */
|
|
65
|
+
onShopNow?: (product: ProductCardData) => void;
|
|
66
|
+
/** 点击加入购物车回调 */
|
|
67
|
+
onAddToCart?: (product: ProductCardData) => void;
|
|
68
|
+
/** 语义化类名 */
|
|
69
|
+
classNames?: Partial<Record<SceneShelfV3SemanticName, string>>;
|
|
70
|
+
}
|
|
71
|
+
export interface SceneShelfV3Component extends React.ForwardRefExoticComponent<SceneShelfV3Props & React.RefAttributes<HTMLDivElement>> {
|
|
72
|
+
ProductCard: typeof ProductCard;
|
|
73
|
+
}
|
|
74
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<SceneShelfV3Props & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../WheelLottery/index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
75
|
+
readonly $$typeof: symbol;
|
|
76
|
+
ProductCard: typeof ProductCard;
|
|
77
|
+
};
|
|
78
|
+
export default _default;
|
|
79
|
+
export type { StockDisplayMode, SceneShelfV3SemanticName, ProductCardData };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{Fragment as K,jsx as o,jsxs as m}from"react/jsx-runtime";import*as u from"react";import{cn as n}from"../../helpers/index.js";import{Text as R,Heading as E,Tabs as G,TabsList as H,TabsTrigger as A,TabsContent as O}from"../../components/index.js";import z from"../PromotionalBar/index.js";import{useExposure as j}from"../../hooks/useExposure.js";import{useGridRowCount as I}from"../../hooks/useGridRowCount.js";import{ProductCard as V}from"./ProductCard.js";import{withLayout as W}from"../../shared/Styles.js";const _="shelf",q="scene_shelf_v3";function J({products:a,copy:e,showTags:h,stockDisplayMode:g,stockThresholdValue:T,onLearnMore:r,onShopNow:S,onAddToCart:b,classNames:i,secondaryButtonText:l,secondaryButtonFun:s,primaryButtonText:P,primaryButtonFun:k,showOriginalPrice:C,viewMoreLimit:p,theme:v="light"}){const[d,x]=u.useState(!1),y=I({rows:p??0,mobileCols:2,tabletCols:3,desktopCols:4});if(!a?.length)return null;const f=p!==void 0&&p>0&&a.length>y,B=f&&!d?a.slice(0,y):a,w=()=>{x(c=>!c)};return m(K,{children:[o("div",{className:n("lg-desktop:gap-4 tablet:grid-cols-3 text-info-primary laptop:grid-cols-3 desktop:grid-cols-4 laptop:gap-3 grid grid-cols-2 gap-3",i?.productGrid),children:B.map((c,t)=>o(V,{product:c,showTags:h,stockDisplayMode:g,stockThresholdValue:T,onLearnMore:r,onShopNow:S,onAddToCart:b,classNames:i,secondaryButtonText:l,secondaryButtonFun:s,primaryButtonText:P,primaryButtonFun:k,showOriginalPrice:C,copy:e,theme:v},c.id||t))}),f&&o("div",{className:n("mt-6 flex justify-center",i?.viewMore),children:m("button",{onClick:w,className:"text-info-primary hover:text-brand-0 flex items-center gap-2 font-bold transition-colors","aria-expanded":d,children:[d?e?.viewLessLabel:e?.viewMoreLabel,o("svg",{className:n("size-4 transition-transform",d&&"rotate-180"),fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:o("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M19 9l-7 7-7-7"})})]})})]})}const L=u.memo(J);L.displayName="SceneShelfV3.ProductsGrid";const N=u.forwardRef(({className:a,data:e,onLearnMore:h,onShopNow:g,onAddToCart:T,classNames:r,...S},b)=>{const i=u.useRef(null);j(i,{componentType:_,componentName:q,componentTitle:e.title,componentDescription:e.description}),u.useImperativeHandle(b,()=>i.current);const{theme:l="light",sceneTabs:s=[],showTags:P=!0,stockDisplayMode:k,stockThresholdValue:C,showOriginalPrice:p=!0,secondaryButtonText:v,primaryButtonText:d,secondaryButtonFun:x="learnMore",primaryButtonFun:y="buyNow",copy:f,viewMoreLimit:B}=e,w=s.length>1,c={copy:f,showTags:P,stockDisplayMode:k,stockThresholdValue:C,onLearnMore:h,onShopNow:g,onAddToCart:T,classNames:r,secondaryButtonText:v,secondaryButtonFun:x,primaryButtonText:d,primaryButtonFun:y,showOriginalPrice:p,viewMoreLimit:B,theme:l};return m("div",{ref:i,className:n("w-full",{"aiui-dark":l==="dark"},a,r?.root),style:{"--progress-track-bg":l==="dark"?"rgba(255, 255, 255, 0.2)":"rgba(0, 0, 0, 0.2)"},...S,children:[e.title&&o(E,{as:"h2",html:e.title,size:4,className:n("text-info-primary mb-4",r?.title)}),e.description&&o(R,{size:3,as:"p",html:e.description,className:n("text-info-primary mb-6",r?.description)}),m(G,{defaultValue:s[0]?.id,className:"w-full",children:[w&&o(H,{className:n("mb-6",r?.tabsList),children:s.map(t=>o(A,{value:t.id,children:t.label},t.id))}),s.map(t=>{const D=t.resourceBlocks?.find(M=>M.blockType==="PromotionalBar"&&M.display==="visible");return m(O,{value:t.id,children:[D&&o(z,{data:D,className:n("mb-6",r?.promotionalBar)}),o(L,{products:t.products,...c})]},t.id)})]})]})});N.displayName="SceneShelfV3";const F=N;F.ProductCard=V;var oe=W(F);export{oe as default};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/SceneShelfV3/index.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { Text, Heading, Tabs, TabsList, TabsTrigger, TabsContent } from '../../components/index.js'\nimport PromotionalBar, { type PromotionalBarProps } from '../PromotionalBar/index.js'\nimport { useExposure } from '../../hooks/useExposure.js'\nimport { useGridRowCount } from '../../hooks/useGridRowCount.js'\nimport {\n ProductCard,\n type ProductCardData,\n type SceneShelfV3SemanticName,\n type StockDisplayMode,\n} from './ProductCard.js'\nimport type { ButtonFunctionType, CopyConfig } from './types.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nconst componentType = 'shelf'\nconst componentName = 'scene_shelf_v3'\n\n/**\n * \u573A\u666F Tab \u6570\u636E\u63A5\u53E3\uFF08\u5339\u914D mock.json.sceneTabs \u7ED3\u6784\uFF09\n */\nexport interface ProductTab {\n /** Tab \u552F\u4E00 ID */\n id: string\n /** Tab \u6807\u7B7E\u6587\u672C */\n label: string\n /** \u4EA7\u54C1\u5217\u8868 */\n products: ProductCardData[]\n /** \u8D44\u6E90\u5757\uFF08\u5982 PromotionalBar\uFF09 */\n resourceBlocks?: Array<PromotionalBarProps['data'] & { blockType: string; display: 'visible' | 'hidden' }>\n}\n\n/**\n * SceneShelfV3 \u6570\u636E\u63A5\u53E3\uFF08\u76F4\u63A5\u5339\u914D mock.json \u7ED3\u6784\uFF09\n */\nexport interface SceneShelfV3Data {\n // ===== \u9876\u5C42\u914D\u7F6E\u5B57\u6BB5 =====\n /** \u7EC4\u4EF6\u5B9E\u4F8B ID */\n id: string\n /** \u4E3B\u9898 */\n theme?: 'light' | 'dark'\n /** \u663E\u793A\u72B6\u6001 */\n display?: 'visible' | 'hidden'\n /** \u7EC4\u4EF6\u7C7B\u578B\u6807\u8BC6 */\n blockType: 'ipc-scene-shelf-v3'\n\n // ===== \u573A\u666F Tab \u5217\u8868 =====\n /** \u573A\u666F Tab \u5217\u8868\uFF08\u6BCF\u4E2A Tab \u5305\u542B\u4EA7\u54C1\u548C resourceBlocks\uFF09 */\n sceneTabs: ProductTab[]\n\n // ===== \u6587\u6848\u914D\u7F6E =====\n copy?: CopyConfig\n\n // ===== \u663E\u793A\u914D\u7F6E =====\n /** \u662F\u5426\u663E\u793A\u6807\u7B7E */\n showTags?: boolean\n /** \u67E5\u770B\u66F4\u591A\u9650\u5236\u6570 */\n viewMoreLimit?: number\n\n // ===== \u6309\u94AE\u914D\u7F6E =====\n /** \u4E3B\u6309\u94AE\u6587\u672C */\n primaryButtonText?: string\n /** \u4E3B\u6309\u94AE\u529F\u80FD */\n primaryButtonFun?: ButtonFunctionType\n /** \u6B21\u6309\u94AE\u6587\u672C */\n secondaryButtonText?: string\n /** \u6B21\u6309\u94AE\u529F\u80FD */\n secondaryButtonFun?: ButtonFunctionType\n\n // ===== \u53EF\u9009\u5B57\u6BB5\uFF08\u7EC4\u4EF6\u5185\u90E8\u53EF\u80FD\u4F7F\u7528\uFF09 =====\n /** \u7EC4\u4EF6\u6807\u9898\uFF08\u53EF\u9009\uFF0C\u975E mock \u5FC5\u9700\uFF09 */\n title?: string\n /** \u7EC4\u4EF6\u63CF\u8FF0\uFF08\u53EF\u9009\uFF0C\u975E mock \u5FC5\u9700\uFF09 */\n description?: string\n /** \u5E93\u5B58\u5C55\u793A\u6A21\u5F0F\uFF08\u53EF\u9009\uFF09 */\n stockDisplayMode?: StockDisplayMode\n /** \u5E93\u5B58\u9608\u503C\uFF08\u53EF\u9009\uFF09 */\n stockThresholdValue?: number\n /** \u662F\u5426\u663E\u793A\u539F\u4EF7\uFF08\u53EF\u9009\uFF09 */\n showOriginalPrice?: boolean\n}\n\nexport interface SceneShelfV3Props extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: SceneShelfV3Data\n /** \u70B9\u51FB\u4E86\u89E3\u66F4\u591A\u56DE\u8C03 */\n onLearnMore?: (link: string) => void\n /** \u70B9\u51FB\u7ACB\u5373\u8D2D\u4E70\u56DE\u8C03 */\n onShopNow?: (product: ProductCardData) => void\n /** \u70B9\u51FB\u52A0\u5165\u8D2D\u7269\u8F66\u56DE\u8C03 */\n onAddToCart?: (product: ProductCardData) => void\n /** \u8BED\u4E49\u5316\u7C7B\u540D */\n classNames?: Partial<Record<SceneShelfV3SemanticName, string>>\n}\n\nexport interface SceneShelfV3Component extends React.ForwardRefExoticComponent<\n SceneShelfV3Props & React.RefAttributes<HTMLDivElement>\n> {\n ProductCard: typeof ProductCard\n}\n\n/**\n * \u4EA7\u54C1\u7F51\u683C\u7EC4\u4EF6 Props\n */\ninterface ProductsGridProps {\n products: ProductCardData[]\n copy?: CopyConfig\n showTags?: boolean\n stockDisplayMode?: StockDisplayMode\n stockThresholdValue?: number\n onLearnMore?: (link: string) => void\n onShopNow?: (product: ProductCardData) => void\n onAddToCart?: (product: ProductCardData) => void\n classNames?: Partial<Record<SceneShelfV3SemanticName, string>>\n secondaryButtonText?: string\n secondaryButtonFun?: ButtonFunctionType\n primaryButtonText?: string\n primaryButtonFun?: ButtonFunctionType\n showOriginalPrice?: boolean\n viewMoreLimit?: number\n theme?: 'light' | 'dark'\n}\n\n/**\n * \u4EA7\u54C1\u7F51\u683C\u7EC4\u4EF6 - \u4EC5\u652F\u6301\u5E73\u94FA\u7F51\u683C\u5E03\u5C40\uFF08\u65E0\u8F6E\u64AD\uFF09\n */\nfunction ProductsGridComponent({\n products,\n copy,\n showTags,\n stockDisplayMode,\n stockThresholdValue,\n onLearnMore,\n onShopNow,\n onAddToCart,\n classNames,\n secondaryButtonText,\n secondaryButtonFun,\n primaryButtonText,\n primaryButtonFun,\n showOriginalPrice,\n viewMoreLimit,\n theme = 'light',\n}: ProductsGridProps) {\n const [isExpanded, setIsExpanded] = React.useState(false)\n\n const visibleLimit = useGridRowCount({\n rows: viewMoreLimit ?? 0,\n mobileCols: 2,\n tabletCols: 3,\n desktopCols: 4,\n })\n\n if (!products?.length) return null\n\n const shouldShowViewMore = viewMoreLimit !== undefined && viewMoreLimit > 0 && products.length > visibleLimit\n\n const displayedProducts = shouldShowViewMore && !isExpanded ? products.slice(0, visibleLimit) : products\n\n // \u5207\u6362\u5C55\u5F00\u72B6\u6001\n const toggleExpanded = () => {\n setIsExpanded(prev => !prev)\n }\n\n return (\n <>\n <div\n className={cn(\n 'lg-desktop:gap-4 tablet:grid-cols-3 text-info-primary laptop:grid-cols-3 desktop:grid-cols-4 laptop:gap-3 grid grid-cols-2 gap-3',\n classNames?.productGrid\n )}\n >\n {displayedProducts.map((product, index) => (\n <ProductCard\n key={product.id || index}\n product={product}\n showTags={showTags}\n stockDisplayMode={stockDisplayMode}\n stockThresholdValue={stockThresholdValue}\n onLearnMore={onLearnMore}\n onShopNow={onShopNow}\n onAddToCart={onAddToCart}\n classNames={classNames}\n secondaryButtonText={secondaryButtonText}\n secondaryButtonFun={secondaryButtonFun}\n primaryButtonText={primaryButtonText}\n primaryButtonFun={primaryButtonFun}\n showOriginalPrice={showOriginalPrice}\n copy={copy}\n theme={theme}\n />\n ))}\n </div>\n\n {/* \u67E5\u770B\u66F4\u591A\u6309\u94AE */}\n {shouldShowViewMore && (\n <div className={cn('mt-6 flex justify-center', classNames?.viewMore)}>\n <button\n onClick={toggleExpanded}\n className=\"text-info-primary hover:text-brand-0 flex items-center gap-2 font-bold transition-colors\"\n aria-expanded={isExpanded}\n >\n {isExpanded ? copy?.viewLessLabel : copy?.viewMoreLabel}\n <svg\n className={cn('size-4 transition-transform', isExpanded && 'rotate-180')}\n fill=\"none\"\n stroke=\"currentColor\"\n viewBox=\"0 0 24 24\"\n >\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M19 9l-7 7-7-7\" />\n </svg>\n </button>\n </div>\n )}\n </>\n )\n}\n\nconst ProductsGrid = React.memo(ProductsGridComponent)\nProductsGrid.displayName = 'SceneShelfV3.ProductsGrid'\n\n/**\n * SceneShelfV3 - \u573A\u666F\u63A8\u8350\u8D27\u67B6 V3\n *\n * @description \u5E73\u94FA\u7F51\u683C\u5E03\u5C40\u7684\u8D27\u67B6\u7EC4\u4EF6\uFF0C\u652F\u6301 Tab \u5206\u7EC4\u3001\u6BCF\u4E2A Tab \u72EC\u7ACB\u914D\u7F6E PromotionalBar \u548C\u67E5\u770B\u66F4\u591A\u529F\u80FD\n */\nconst SceneShelfV3 = React.forwardRef<HTMLDivElement, SceneShelfV3Props>(\n ({ className, data, onLearnMore, onShopNow, onAddToCart, classNames, ...props }, ref) => {\n const boxRef = React.useRef<HTMLDivElement>(null)\n\n useExposure(boxRef, {\n componentType,\n componentName,\n componentTitle: data.title,\n componentDescription: data.description,\n })\n\n React.useImperativeHandle(ref, () => boxRef.current as HTMLDivElement)\n\n const {\n theme = 'light',\n sceneTabs = [],\n showTags = true,\n stockDisplayMode,\n stockThresholdValue,\n showOriginalPrice = true,\n secondaryButtonText,\n primaryButtonText,\n secondaryButtonFun = 'learnMore',\n primaryButtonFun = 'buyNow',\n copy,\n viewMoreLimit,\n } = data\n\n // \u5224\u65AD\u662F\u5426\u663E\u793A Tab\uFF08\u591A\u4E8E 1 \u4E2A Tab \u65F6\u663E\u793A\uFF09\n const shouldShowTab = sceneTabs.length > 1\n\n const gridProps: Omit<ProductsGridProps, 'products'> = {\n copy,\n showTags,\n stockDisplayMode,\n stockThresholdValue,\n onLearnMore,\n onShopNow,\n onAddToCart,\n classNames,\n secondaryButtonText,\n secondaryButtonFun,\n primaryButtonText,\n primaryButtonFun,\n showOriginalPrice,\n viewMoreLimit,\n theme,\n }\n\n return (\n <div\n ref={boxRef}\n className={cn('w-full', { 'aiui-dark': theme === 'dark' }, className, classNames?.root)}\n style={\n {\n '--progress-track-bg': theme === 'dark' ? 'rgba(255, 255, 255, 0.2)' : 'rgba(0, 0, 0, 0.2)',\n } as React.CSSProperties\n }\n {...props}\n >\n {/* \u6807\u9898\u533A\u57DF */}\n {data.title && (\n <Heading as=\"h2\" html={data.title} size={4} className={cn('text-info-primary mb-4', classNames?.title)} />\n )}\n {data.description && (\n <Text\n size={3}\n as=\"p\"\n html={data.description}\n className={cn('text-info-primary mb-6', classNames?.description)}\n />\n )}\n\n {/* \u4EA7\u54C1\u5C55\u793A\u533A\u57DF */}\n <Tabs defaultValue={sceneTabs[0]?.id} className=\"w-full\">\n {/* Tab \u5217\u8868 */}\n {shouldShowTab && (\n <TabsList className={cn('mb-6', classNames?.tabsList)}>\n {sceneTabs.map(tab => (\n <TabsTrigger key={tab.id} value={tab.id}>\n {tab.label}\n </TabsTrigger>\n ))}\n </TabsList>\n )}\n\n {/* \u4EA7\u54C1\u5185\u5BB9\u533A\u57DF */}\n {sceneTabs.map(tab => {\n // \u4ECE resourceBlocks \u4E2D\u63D0\u53D6 PromotionalBar \u6570\u636E\n const promotionalBarBlock: any = tab.resourceBlocks?.find(\n block => block.blockType === 'PromotionalBar' && block.display === 'visible'\n )\n\n return (\n <TabsContent key={tab.id} value={tab.id}>\n {/* \u6BCF\u4E2A Tab \u72EC\u7ACB\u7684 PromotionalBar\uFF08\u53EF\u9009\uFF09 */}\n {promotionalBarBlock && (\n <PromotionalBar data={promotionalBarBlock} className={cn('mb-6', classNames?.promotionalBar)} />\n )}\n <ProductsGrid products={tab.products} {...gridProps} />\n </TabsContent>\n )\n })}\n </Tabs>\n </div>\n )\n }\n)\n\nSceneShelfV3.displayName = 'SceneShelfV3'\n\n// \u521B\u5EFA\u590D\u5408\u7EC4\u4EF6\nconst SceneShelfV3WithProductCard = SceneShelfV3 as SceneShelfV3Component\nSceneShelfV3WithProductCard.ProductCard = ProductCard\n\nexport default withLayout(SceneShelfV3WithProductCard)\nexport type { StockDisplayMode, SceneShelfV3SemanticName, ProductCardData }\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Fragment", "jsx", "jsxs", "React", "cn", "Text", "Heading", "Tabs", "TabsList", "TabsTrigger", "TabsContent", "PromotionalBar", "useExposure", "useGridRowCount", "ProductCard", "withLayout", "componentType", "componentName", "ProductsGridComponent", "products", "copy", "showTags", "stockDisplayMode", "stockThresholdValue", "onLearnMore", "onShopNow", "onAddToCart", "classNames", "secondaryButtonText", "secondaryButtonFun", "primaryButtonText", "primaryButtonFun", "showOriginalPrice", "viewMoreLimit", "theme", "isExpanded", "setIsExpanded", "visibleLimit", "shouldShowViewMore", "displayedProducts", "toggleExpanded", "prev", "product", "index", "ProductsGrid", "SceneShelfV3", "className", "data", "props", "ref", "boxRef", "sceneTabs", "shouldShowTab", "gridProps", "tab", "promotionalBarBlock", "block", "SceneShelfV3WithProductCard", "SceneShelfV3_default"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 按钮功能类型
|
|
3
|
+
*/
|
|
4
|
+
export type ButtonFunctionType = 'buyNow' | 'addCart' | 'learnMore';
|
|
5
|
+
/**
|
|
6
|
+
* SceneShelfV3 文案配置
|
|
7
|
+
*/
|
|
8
|
+
export interface CopyConfig {
|
|
9
|
+
/** 售罄标签文本 */
|
|
10
|
+
outOfStockLabel?: string;
|
|
11
|
+
/** 库存紧张文本(超卖时使用) */
|
|
12
|
+
limitedStock?: string;
|
|
13
|
+
/** 库存显示文案模板,支持 {count} 占位符 */
|
|
14
|
+
stockDisplayText?: string;
|
|
15
|
+
/** 查看更多按钮文本 */
|
|
16
|
+
viewMoreLabel?: string;
|
|
17
|
+
/** 收起按钮文本 */
|
|
18
|
+
viewLessLabel?: string;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SecondaryBannerData, SecondaryBannerSemanticName, JumpOptions } from './index.js';
|
|
3
|
+
import 'swiper/css';
|
|
4
|
+
import 'swiper/css/navigation';
|
|
5
|
+
import 'swiper/css/pagination';
|
|
6
|
+
interface SecondaryBannerCarouselProps extends React.HTMLAttributes<HTMLElement> {
|
|
7
|
+
data: SecondaryBannerData;
|
|
8
|
+
classNames?: Partial<Record<SecondaryBannerSemanticName, string>>;
|
|
9
|
+
jumpOptions?: JumpOptions;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* SecondaryBannerCarousel — arrows-only Navigation Swiper wrapping SecondaryBanner slides.
|
|
13
|
+
*
|
|
14
|
+
* Architecture:
|
|
15
|
+
* - DECISION-A007: Navigation only, loop=false, slidesPerView=1
|
|
16
|
+
* - DECISION-A005: isActive pass-through to SecondaryBanner; querySelectorAll for video pause
|
|
17
|
+
* - DECISION-008: SecondaryBanner.isActive => autoPlay={isActive ?? true}
|
|
18
|
+
* - DECISION-A006: arrow buttons at z-[20], above any overlay
|
|
19
|
+
*/
|
|
20
|
+
declare const SecondaryBannerCarousel: React.ForwardRefExoticComponent<SecondaryBannerCarouselProps & React.RefAttributes<HTMLElement>>;
|
|
21
|
+
export default SecondaryBannerCarousel;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";import{jsx as e,jsxs as o}from"react/jsx-runtime";import m,{useRef as w,useCallback as R,useState as T}from"react";import{Swiper as j,SwiperSlide as M}from"swiper/react";import{Navigation as b,Pagination as f,Autoplay as A}from"swiper/modules";import{cn as O}from"../../helpers/index.js";import P from"./index.js";import"swiper/css";import"swiper/css/navigation";import"swiper/css/pagination";const D=()=>o("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e("circle",{cx:"20",cy:"20",r:"20",fill:"currentColor",fillOpacity:"0.2"}),e("path",{d:"M23 13L16 20L23 27",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),E=()=>o("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",children:[e("circle",{cx:"20",cy:"20",r:"20",fill:"currentColor",fillOpacity:"0.2"}),e("path",{d:"M17 13L24 20L17 27",stroke:"white",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})]}),y=m.forwardRef(({data:c,className:h,classNames:g,jumpOptions:v,...S},x)=>{const i=c.items||[],r=c.carousel,s=w(null),[H,C]=T(0),d=w(i.map(()=>m.createRef())),_=(r?.showArrows??!0)&&i.length>1,p=r?.showDots??!0,l=r?.autoplaySeconds,k=l!==void 0?[b,f,A]:[b,f],L=l!==void 0?{delay:l*1e3,disableOnInteraction:!1}:!1,N=R(n=>{const t=n.realIndex;d.current.forEach((a,B)=>{B!==t&&a.current&&a.current.querySelectorAll("video").forEach(u=>{u.pause(),u.currentTime=0})}),C(t)},[]);return o("section",{ref:x,className:O("secondary-banner-carousel relative w-full overflow-hidden",h),...S,children:[e(j,{onSwiper:n=>s.current=n,onSlideChange:N,modules:k,slidesPerView:1,loop:r?.loop??!0,initialSlide:0,allowTouchMove:!0,autoplay:L,pagination:p?{clickable:!0,el:".secondary-banner-pagination",renderBullet:(n,t)=>`<span class="${t} banner-dot"></span>`}:!1,children:i.map((n,t)=>e(M,{children:({isActive:a})=>e("div",{ref:d.current[t],children:e(P,{data:n,isActive:a,classNames:g,jumpOptions:v})})},t))}),_&&o("div",{className:"pointer-events-none absolute inset-0 z-20 flex items-center justify-between px-4",children:[e("button",{type:"button",className:"tablet:flex pointer-events-auto hidden items-center justify-center",onClick:()=>s.current?.slidePrev(),"aria-label":"Previous banner",children:e(D,{})}),e("button",{type:"button",className:"tablet:flex pointer-events-auto hidden items-center justify-center",onClick:()=>s.current?.slideNext(),"aria-label":"Next banner",children:e(E,{})})]}),p&&e("div",{className:"secondary-banner-pagination swiper-pagination tablet:bottom-6 absolute bottom-5 left-1/2 z-20 flex -translate-x-1/2 items-center justify-center gap-2 [&_.banner-dot.swiper-pagination-bullet-active]:h-2 [&_.banner-dot.swiper-pagination-bullet-active]:w-8 [&_.banner-dot.swiper-pagination-bullet-active]:rounded-full [&_.banner-dot.swiper-pagination-bullet-active]:bg-[#080A0F] [&_.banner-dot]:size-2 [&_.banner-dot]:rounded-full [&_.banner-dot]:bg-[#767880] [&_.banner-dot]:transition-all [&_.banner-dot]:duration-300 [&_.banner-dot]:ease-out [&_.swiper-pagination-bullet]:m-0 [&_.swiper-pagination-bullet]:shrink-0 [&_.swiper-pagination-bullet]:opacity-100"})]})});y.displayName="SecondaryBannerCarousel";var G=y;export{G as default};
|
|
2
|
+
//# sourceMappingURL=SecondaryBannerCarousel.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/biz-components/SecondaryBanner/SecondaryBannerCarousel.tsx"],
|
|
4
|
+
"sourcesContent": ["'use client'\nimport React, { useRef, useCallback, useState } from 'react'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport { Navigation, Pagination, Autoplay } from 'swiper/modules'\nimport type { Swiper as SwiperType } from 'swiper'\nimport { cn } from '../../helpers/index.js'\nimport SecondaryBanner from './index.js'\nimport type { SecondaryBannerData, SecondaryBannerSemanticName, JumpOptions } from './index.js'\n\nimport 'swiper/css'\nimport 'swiper/css/navigation'\nimport 'swiper/css/pagination'\n\n// \u2500\u2500 Arrow icons \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\nconst ChevronLeft = () => (\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <circle cx=\"20\" cy=\"20\" r=\"20\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M23 13L16 20L23 27\" stroke=\"white\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\nconst ChevronRight = () => (\n <svg width=\"40\" height=\"40\" viewBox=\"0 0 40 40\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" aria-hidden=\"true\">\n <circle cx=\"20\" cy=\"20\" r=\"20\" fill=\"currentColor\" fillOpacity=\"0.2\" />\n <path d=\"M17 13L24 20L17 27\" stroke=\"white\" strokeWidth=\"2\" strokeLinecap=\"round\" strokeLinejoin=\"round\" />\n </svg>\n)\n\n// \u2500\u2500 Props \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\n\ninterface SecondaryBannerCarouselProps extends React.HTMLAttributes<HTMLElement> {\n data: SecondaryBannerData\n classNames?: Partial<Record<SecondaryBannerSemanticName, string>>\n jumpOptions?: JumpOptions\n}\n\n/**\n * SecondaryBannerCarousel \u2014 arrows-only Navigation Swiper wrapping SecondaryBanner slides.\n *\n * Architecture:\n * - DECISION-A007: Navigation only, loop=false, slidesPerView=1\n * - DECISION-A005: isActive pass-through to SecondaryBanner; querySelectorAll for video pause\n * - DECISION-008: SecondaryBanner.isActive => autoPlay={isActive ?? true}\n * - DECISION-A006: arrow buttons at z-[20], above any overlay\n */\nconst SecondaryBannerCarousel = React.forwardRef<HTMLElement, SecondaryBannerCarouselProps>(\n ({ data, className, classNames, jumpOptions, ...rest }, ref) => {\n const items = data.items || []\n const carousel = data.carousel\n\n const swiperRef = useRef<SwiperType | null>(null)\n const [_activeIndex, setActiveIndex] = useState(0)\n\n // Slide container refs for imperative video pause via querySelectorAll (DECISION-A005)\n // Used as defense-in-depth; isActive prop is the primary control mechanism.\n const slideContainerRefs = useRef<React.RefObject<HTMLDivElement>[]>(\n items.map(() => React.createRef<HTMLDivElement>())\n )\n\n // Arrow visibility formula \u2014 DECISION-011\n const showArrowControls = (carousel?.showArrows ?? true) && items.length > 1\n\n // Pagination dots visibility formula \u2014 DECISION-006\n const showDots = carousel?.showDots ?? true\n\n // Autoplay module configuration \u2014 DECISION-006\n const autoplaySeconds = carousel?.autoplaySeconds\n const swiperModules = autoplaySeconds !== undefined ? [Navigation, Pagination, Autoplay] : [Navigation, Pagination]\n const autoplayConfig =\n autoplaySeconds !== undefined ? { delay: autoplaySeconds * 1000, disableOnInteraction: false } : false\n\n // Slide transition handler \u2014 pause inactive slide videos via querySelectorAll (DECISION-A005)\n const handleSlideChange = useCallback((swiper: SwiperType) => {\n const newIndex = swiper.realIndex\n // Defense-in-depth: imperatively pause videos in inactive slides\n slideContainerRefs.current.forEach((cRef, i) => {\n if (i !== newIndex && cRef.current) {\n cRef.current.querySelectorAll('video').forEach(v => {\n v.pause()\n v.currentTime = 0\n })\n }\n })\n setActiveIndex(newIndex)\n }, [])\n\n return (\n <section\n ref={ref}\n className={cn('secondary-banner-carousel relative w-full overflow-hidden', className)}\n {...rest}\n >\n <Swiper\n onSwiper={s => (swiperRef.current = s)}\n onSlideChange={handleSlideChange}\n modules={swiperModules}\n slidesPerView={1}\n loop={carousel?.loop ?? true}\n initialSlide={0}\n allowTouchMove={true}\n autoplay={autoplayConfig}\n pagination={\n showDots\n ? {\n clickable: true,\n el: '.secondary-banner-pagination',\n renderBullet: (_index: number, className: string) => `<span class=\"${className} banner-dot\"></span>`,\n }\n : false\n }\n >\n {items.map((slideData, index) => (\n <SwiperSlide key={index}>\n {({ isActive }) => (\n <div ref={slideContainerRefs.current[index]}>\n <SecondaryBanner\n data={slideData}\n isActive={isActive}\n classNames={classNames}\n jumpOptions={jumpOptions}\n />\n </div>\n )}\n </SwiperSlide>\n ))}\n </Swiper>\n\n {/* Arrow navigation \u2014 z-[20] for consistency with HeroBannerCarousel \u2014 DECISION-A006 */}\n {showArrowControls && (\n <div className=\"pointer-events-none absolute inset-0 z-20 flex items-center justify-between px-4\">\n <button\n type=\"button\"\n className=\"tablet:flex pointer-events-auto hidden items-center justify-center\"\n onClick={() => swiperRef.current?.slidePrev()}\n aria-label=\"Previous banner\"\n >\n <ChevronLeft />\n </button>\n <button\n type=\"button\"\n className=\"tablet:flex pointer-events-auto hidden items-center justify-center\"\n onClick={() => swiperRef.current?.slideNext()}\n aria-label=\"Next banner\"\n >\n <ChevronRight />\n </button>\n </div>\n )}\n\n {/* Pagination dots \u2014 visible on all devices */}\n {showDots && (\n <div className=\"secondary-banner-pagination swiper-pagination tablet:bottom-6 absolute bottom-5 left-1/2 z-20 flex -translate-x-1/2 items-center justify-center gap-2 [&_.banner-dot.swiper-pagination-bullet-active]:h-2 [&_.banner-dot.swiper-pagination-bullet-active]:w-8 [&_.banner-dot.swiper-pagination-bullet-active]:rounded-full [&_.banner-dot.swiper-pagination-bullet-active]:bg-[#080A0F] [&_.banner-dot]:size-2 [&_.banner-dot]:rounded-full [&_.banner-dot]:bg-[#767880] [&_.banner-dot]:transition-all [&_.banner-dot]:duration-300 [&_.banner-dot]:ease-out [&_.swiper-pagination-bullet]:m-0 [&_.swiper-pagination-bullet]:shrink-0 [&_.swiper-pagination-bullet]:opacity-100\" />\n )}\n </section>\n )\n }\n)\n\nSecondaryBannerCarousel.displayName = 'SecondaryBannerCarousel'\n\nexport default SecondaryBannerCarousel\n"],
|
|
5
|
+
"mappings": "aAgBE,OACE,OAAAA,EADF,QAAAC,MAAA,oBAfF,OAAOC,GAAS,UAAAC,EAAQ,eAAAC,EAAa,YAAAC,MAAgB,QACrD,OAAS,UAAAC,EAAQ,eAAAC,MAAmB,eACpC,OAAS,cAAAC,EAAY,cAAAC,EAAY,YAAAC,MAAgB,iBAEjD,OAAS,MAAAC,MAAU,yBACnB,OAAOC,MAAqB,aAG5B,MAAO,aACP,MAAO,wBACP,MAAO,wBAIP,MAAMC,EAAc,IAClBZ,EAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA6B,cAAY,OACzG,UAAAD,EAAC,UAAO,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,KAAK,eAAe,YAAY,MAAM,EACrEA,EAAC,QAAK,EAAE,qBAAqB,OAAO,QAAQ,YAAY,IAAI,cAAc,QAAQ,eAAe,QAAQ,GAC3G,EAGIc,EAAe,IACnBb,EAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA6B,cAAY,OACzG,UAAAD,EAAC,UAAO,GAAG,KAAK,GAAG,KAAK,EAAE,KAAK,KAAK,eAAe,YAAY,MAAM,EACrEA,EAAC,QAAK,EAAE,qBAAqB,OAAO,QAAQ,YAAY,IAAI,cAAc,QAAQ,eAAe,QAAQ,GAC3G,EAoBIe,EAA0Bb,EAAM,WACpC,CAAC,CAAE,KAAAc,EAAM,UAAAC,EAAW,WAAAC,EAAY,YAAAC,EAAa,GAAGC,CAAK,EAAGC,IAAQ,CAC9D,MAAMC,EAAQN,EAAK,OAAS,CAAC,EACvBO,EAAWP,EAAK,SAEhBQ,EAAYrB,EAA0B,IAAI,EAC1C,CAACsB,EAAcC,CAAc,EAAIrB,EAAS,CAAC,EAI3CsB,EAAqBxB,EACzBmB,EAAM,IAAI,IAAMpB,EAAM,UAA0B,CAAC,CACnD,EAGM0B,GAAqBL,GAAU,YAAc,KAASD,EAAM,OAAS,EAGrEO,EAAWN,GAAU,UAAY,GAGjCO,EAAkBP,GAAU,gBAC5BQ,EAAgBD,IAAoB,OAAY,CAACtB,EAAYC,EAAYC,CAAQ,EAAI,CAACF,EAAYC,CAAU,EAC5GuB,EACJF,IAAoB,OAAY,CAAE,MAAOA,EAAkB,IAAM,qBAAsB,EAAM,EAAI,GAG7FG,EAAoB7B,EAAa8B,GAAuB,CAC5D,MAAMC,EAAWD,EAAO,UAExBP,EAAmB,QAAQ,QAAQ,CAACS,EAAMC,IAAM,CAC1CA,IAAMF,GAAYC,EAAK,SACzBA,EAAK,QAAQ,iBAAiB,OAAO,EAAE,QAAQE,GAAK,CAClDA,EAAE,MAAM,EACRA,EAAE,YAAc,CAClB,CAAC,CAEL,CAAC,EACDZ,EAAeS,CAAQ,CACzB,EAAG,CAAC,CAAC,EAEL,OACElC,EAAC,WACC,IAAKoB,EACL,UAAWV,EAAG,4DAA6DM,CAAS,EACnF,GAAGG,EAEJ,UAAApB,EAACM,EAAA,CACC,SAAUiC,GAAMf,EAAU,QAAUe,EACpC,cAAeN,EACf,QAASF,EACT,cAAe,EACf,KAAMR,GAAU,MAAQ,GACxB,aAAc,EACd,eAAgB,GAChB,SAAUS,EACV,WACEH,EACI,CACE,UAAW,GACX,GAAI,+BACJ,aAAc,CAACW,EAAgBvB,IAAsB,gBAAgBA,CAAS,sBAChF,EACA,GAGL,SAAAK,EAAM,IAAI,CAACmB,EAAWC,IACrB1C,EAACO,EAAA,CACE,UAAC,CAAE,SAAAoC,CAAS,IACX3C,EAAC,OAAI,IAAK2B,EAAmB,QAAQe,CAAK,EACxC,SAAA1C,EAACY,EAAA,CACC,KAAM6B,EACN,SAAUE,EACV,WAAYzB,EACZ,YAAaC,EACf,EACF,GATcuB,CAWlB,CACD,EACH,EAGCd,GACC3B,EAAC,OAAI,UAAU,mFACb,UAAAD,EAAC,UACC,KAAK,SACL,UAAU,qEACV,QAAS,IAAMwB,EAAU,SAAS,UAAU,EAC5C,aAAW,kBAEX,SAAAxB,EAACa,EAAA,EAAY,EACf,EACAb,EAAC,UACC,KAAK,SACL,UAAU,qEACV,QAAS,IAAMwB,EAAU,SAAS,UAAU,EAC5C,aAAW,cAEX,SAAAxB,EAACc,EAAA,EAAa,EAChB,GACF,EAIDe,GACC7B,EAAC,OAAI,UAAU,mpBAAmpB,GAEtqB,CAEJ,CACF,EAEAe,EAAwB,YAAc,0BAEtC,IAAO6B,EAAQ7B",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "useRef", "useCallback", "useState", "Swiper", "SwiperSlide", "Navigation", "Pagination", "Autoplay", "cn", "SecondaryBanner", "ChevronLeft", "ChevronRight", "SecondaryBannerCarousel", "data", "className", "classNames", "jumpOptions", "rest", "ref", "items", "carousel", "swiperRef", "_activeIndex", "setActiveIndex", "slideContainerRefs", "showArrowControls", "showDots", "autoplaySeconds", "swiperModules", "autoplayConfig", "handleSlideChange", "swiper", "newIndex", "cRef", "i", "v", "s", "_index", "slideData", "index", "isActive", "SecondaryBannerCarousel_default"]
|
|
7
|
+
}
|
|
@@ -2,6 +2,53 @@ import * as React from 'react';
|
|
|
2
2
|
import type { Media as MediaType, Theme } from '../../types/props.js';
|
|
3
3
|
import type { ButtonProps } from '../../components/button.js';
|
|
4
4
|
export type SecondaryBannerSemanticName = 'root' | 'title' | 'superTitle' | 'subtitle' | 'content' | 'buttonGroup' | 'primaryButton' | 'secondaryButton';
|
|
5
|
+
/**
|
|
6
|
+
* Carousel navigation configuration for SecondaryBanner. v1: arrows only.
|
|
7
|
+
* autoplay, dots, and progress are intentionally EXCLUDED from v1.
|
|
8
|
+
*/
|
|
9
|
+
export interface SecondaryBannerCarouselConfig {
|
|
10
|
+
/**
|
|
11
|
+
* Show prev/next arrow navigation controls.
|
|
12
|
+
* Only used when data.items has 2+ slides.
|
|
13
|
+
* @default true
|
|
14
|
+
*/
|
|
15
|
+
showArrows?: boolean;
|
|
16
|
+
showDots?: boolean;
|
|
17
|
+
loop?: boolean;
|
|
18
|
+
autoplaySeconds?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Per-slide data for SecondaryBanner carousel mode.
|
|
22
|
+
* All fields optional (mirrors SecondaryBannerData permissiveness).
|
|
23
|
+
*/
|
|
24
|
+
export interface SecondaryBannerSlideData {
|
|
25
|
+
title?: string;
|
|
26
|
+
titleTag?: 'h1' | 'h2';
|
|
27
|
+
superTitle?: string;
|
|
28
|
+
subtitle?: string;
|
|
29
|
+
size?: 'sm' | 'base' | 'lg' | 'xlg';
|
|
30
|
+
pcImage?: MediaType;
|
|
31
|
+
padImage?: MediaType;
|
|
32
|
+
mobileImage?: MediaType;
|
|
33
|
+
isVideoLoop?: boolean;
|
|
34
|
+
endDate?: string;
|
|
35
|
+
endDate_tz?: string;
|
|
36
|
+
dateFormat?: string;
|
|
37
|
+
primaryButton?: {
|
|
38
|
+
text: string;
|
|
39
|
+
link?: string;
|
|
40
|
+
onClick?: () => void;
|
|
41
|
+
} & Omit<ButtonProps, 'children'>;
|
|
42
|
+
secondaryButton?: {
|
|
43
|
+
text: string;
|
|
44
|
+
link?: string;
|
|
45
|
+
onClick?: () => void;
|
|
46
|
+
} & Omit<ButtonProps, 'children'>;
|
|
47
|
+
iconArray?: Array<{
|
|
48
|
+
pcImage: MediaType;
|
|
49
|
+
}>;
|
|
50
|
+
theme?: Theme;
|
|
51
|
+
}
|
|
5
52
|
/**
|
|
6
53
|
* jump.js 配置选项
|
|
7
54
|
*/
|
|
@@ -76,6 +123,16 @@ export interface SecondaryBannerData {
|
|
|
76
123
|
pcImage: MediaType;
|
|
77
124
|
}>;
|
|
78
125
|
theme?: Theme;
|
|
126
|
+
/**
|
|
127
|
+
* Carousel slide items. When present and non-empty, activates carousel mode.
|
|
128
|
+
* Single-banner mode is used when absent or empty (DECISION-002).
|
|
129
|
+
*/
|
|
130
|
+
items?: SecondaryBannerSlideData[];
|
|
131
|
+
/**
|
|
132
|
+
* Carousel navigation configuration.
|
|
133
|
+
* Only meaningful when data.items is present and has 2+ items.
|
|
134
|
+
*/
|
|
135
|
+
carousel?: SecondaryBannerCarouselConfig;
|
|
79
136
|
}
|
|
80
137
|
export interface SecondaryBannerProps extends React.HTMLAttributes<HTMLElement> {
|
|
81
138
|
/** 业务数据 */
|
|
@@ -86,6 +143,15 @@ export interface SecondaryBannerProps extends React.HTMLAttributes<HTMLElement>
|
|
|
86
143
|
* @default { duration: 500, offset: 0 }
|
|
87
144
|
*/
|
|
88
145
|
jumpOptions?: JumpOptions;
|
|
146
|
+
/**
|
|
147
|
+
* Whether this banner is the active slide in a carousel.
|
|
148
|
+
* Controls video autoPlay: autoPlay={isActive ?? true}.
|
|
149
|
+
* When absent (legacy single-banner), defaults to true (DECISION-008).
|
|
150
|
+
* @default true
|
|
151
|
+
*/
|
|
152
|
+
isActive?: boolean;
|
|
89
153
|
}
|
|
90
|
-
declare const _default:
|
|
154
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<SecondaryBannerProps & React.RefAttributes<HTMLElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../WheelLottery/index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
155
|
+
readonly $$typeof: symbol;
|
|
156
|
+
};
|
|
91
157
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use client";import{jsx as
|
|
1
|
+
"use client";import{jsx as t,jsxs as c}from"react/jsx-runtime";import*as v from"react";import{cva as E}from"class-variance-authority";import T from"jump.js";import{cn as n,getLocalizedPath as I}from"../../helpers/index.js";import{Text as S,Button as C,Heading as J,Picture as $,Countdown as R}from"../../components/index.js";import V from"../Media/index.js";import{useAiuiContext as F}from"../AiuiProvider/index.js";import{withLayout as W}from"../../shared/Styles.js";import q from"./SecondaryBannerCarousel.js";const G=E("text-info-primary relative w-full",{variants:{size:{sm:"tablet:aspect-[768/480] laptop:aspect-[1024/400] desktop:aspect-[1440/384] lg-desktop:aspect-[1920/480] aspect-[390/480]",base:"tablet:aspect-[768/660] laptop:aspect-[1024/432] desktop:aspect-[1440/576] lg-desktop:aspect-[1920/720] aspect-[390/660]",lg:"tablet:aspect-[768/660] laptop:aspect-[1024/520] desktop:aspect-[1440/700] lg-desktop:aspect-[1920/930] aspect-[390/660]",xlg:"tablet:aspect-[768/660] laptop:aspect-[1024/520] desktop:aspect-[1440/700] lg-desktop:aspect-[1920/930] aspect-[390/660] overflow-visible"}},defaultVariants:{size:"base"}}),M=v.forwardRef(({className:g,classNames:a={},data:e,jumpOptions:b={},isActive:z,...l},y)=>{const{pcImage:_,padImage:D,mobileImage:N,isVideoLoop:A=!0,endDate:f,endDate_tz:L,dateFormat:O,size:d="base",iconArray:m,theme:P="light",primaryButton:o,secondaryButton:i,title:w,titleTag:j="h1"}=e,{locale:k="us"}=F(),x={...{duration:500,offset:0},...b},u=v.useId(),p=w?`${u}-title`:void 0,B=e.subtitle?`${u}-subtitle`:void 0,h=e.superTitle?`${u}-super-title`:void 0,H=[h,B].filter(Boolean).join(" ")||void 0;return e.items&&e.items.length>0?t(q,{data:e,className:g,classNames:a,jumpOptions:b,ref:y,...l}):c("section",{ref:y,role:"banner","aria-labelledby":p,"aria-describedby":H,className:n({"aiui-dark":P==="dark"},G({size:d}),g,a?.root),...l,children:[t(V,{pcImage:_,padImage:D,mobileImage:N,className:n("absolute inset-0 size-full object-cover",{"h-fit":d==="xlg"}),imgClassName:"object-cover",videoClassName:"object-cover",muted:!0,loop:A,playsInline:!0,autoPlay:z??!0}),c("div",{className:n("banner-content laptop:top-1/2 laptop:-translate-y-1/2 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] absolute top-12 z-10 flex flex-col items-start justify-center px-[16px] text-left",a?.content),children:[c("div",{className:"banner-inner-title desktop:gap-2 flex flex-col items-start gap-1",children:[e.superTitle&&t(S,{as:"p",size:2,id:h,className:n("banner-super-title desktop:text-[16px] lg-desktop:text-[18px]",a?.superTitle),html:e.superTitle}),e.title&&t(J,{as:j,size:["xlg","lg"].includes(d)?5:4,id:p,className:n("banner-title ",a?.title),html:e.title}),e.subtitle&&t(S,{as:"p",size:3,id:B,className:n("banner-subtitle desktop:text-[16px] lg-desktop:text-[18px]",a?.subtitle),html:e.subtitle})]}),f&&t("div",{className:"banner-countdown",children:t(R,{endDate:f,endDate_tz:L,dateFormat:O,variant:"spacious",className:"lg-desktop:mt-8 mt-6"})}),c("div",{className:n("banner-cta-group lg-desktop:mt-[32px] lg-desktop:gap-3 mt-6 flex gap-2",a?.buttonGroup),children:[i?.text&&t(C,{variant:"secondary","data-track":l.id?`${l.id}_secondary_button_click`:"SecondaryBanner_secondary_button_click",onClick:s=>{if(i.link?.startsWith("#")){s.preventDefault();const r=document.querySelector(i.link);r&&T(r,x)}i.onClick?.()},className:n("",a?.secondaryButton),"aria-describedby":p,...i.link&&!i.link.startsWith("#")?{as:"a",href:I(i.link,k)}:{},children:i.text}),o?.text&&t(C,{"data-track":l.id?`${l.id}_primary_button_click`:"SecondaryBanner_primary_button_click",onClick:s=>{if(o.link?.startsWith("#")){s.preventDefault();const r=document.querySelector(o.link);r&&T(r,x)}o.onClick?.()},className:n("",a?.primaryButton),"aria-describedby":p,...o.link&&!o.link.startsWith("#")?{as:"a",href:I(o.link,k)}:{},children:o.text})]}),Array.isArray(m)&&m.length>0&&t("div",{className:"banner-icons desktop:mt-3 lg-desktop:mt-4 mt-2 flex items-center gap-2",role:"group","aria-label":"brand icons",children:m.map((s,r)=>s.pcImage?t($,{source:s.pcImage.url,alt:s.pcImage.alt||`icon ${r+1}`,role:"img",className:"laptop:h-auto h-[48px] max-w-none",imgClassName:"h-full"},r):null)})]})]})});M.displayName="SecondaryBanner";var ne=W(M);export{ne as default};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/biz-components/SecondaryBanner/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cva } from 'class-variance-authority'\nimport jump from 'jump.js'\nimport { cn, getLocalizedPath } from '../../helpers/index.js'\nimport type { Media as MediaType, Theme } from '../../types/props.js'\nimport { Text, Button, Heading, Picture, Countdown } from '../../components/index.js'\nimport Media from '../Media/index.js'\nimport type { ButtonProps } from '../../components/button.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { withLayout } from '../../shared/Styles.js'\n\nexport type SecondaryBannerSemanticName =\n | 'root'\n | 'title'\n | 'superTitle'\n | 'subtitle'\n | 'content'\n | 'buttonGroup'\n | 'primaryButton'\n | 'secondaryButton'\n\n/**\n * jump.js \u914D\u7F6E\u9009\u9879\n */\nexport interface JumpOptions {\n /** \u52A8\u753B\u6301\u7EED\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09 @default 500 */\n duration?: number\n /** \u504F\u79FB\u91CF\uFF08\u50CF\u7D20\uFF09 @default 0 */\n offset?: number\n /** \u52A8\u753B\u5B8C\u6210\u56DE\u8C03 */\n callback?: () => void\n /** \u7F13\u52A8\u51FD\u6570 */\n easing?: (t: number, b: number, c: number, d: number) => number\n /** \u662F\u5426\u8003\u8651 a11y @default false */\n a11y?: boolean\n}\n\nconst secondaryBannerVariants = cva(\n // \u57FA\u7840\u6837\u5F0F\n 'text-info-primary relative w-full',\n {\n variants: {\n size: {\n sm: 'tablet:aspect-[768/480] laptop:aspect-[1024/400] desktop:aspect-[1440/384] lg-desktop:aspect-[1920/480] aspect-[390/480]',\n base: 'tablet:aspect-[768/660] laptop:aspect-[1024/432] desktop:aspect-[1440/576] lg-desktop:aspect-[1920/720] aspect-[390/660]',\n lg: 'tablet:aspect-[768/660] laptop:aspect-[1024/520] desktop:aspect-[1440/700] lg-desktop:aspect-[1920/930] aspect-[390/660]',\n xlg: 'tablet:aspect-[768/660] laptop:aspect-[1024/520] desktop:aspect-[1440/700] lg-desktop:aspect-[1920/930] aspect-[390/660] overflow-visible',\n },\n },\n defaultVariants: {\n size: 'base',\n },\n }\n)\n\n/**\n * SecondaryBanner \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface SecondaryBannerData {\n /** \u4E3B\u6807\u9898*/\n title?: string\n /**\n * \u4E3B\u6807\u9898\u6807\u7B7E\n * @default 'h1'\n */\n titleTag?: 'h1' | 'h2'\n /**\n * \u4E0A\u6807\u9898/\u5F15\u5BFC\u6807\u9898\n * \u901A\u5E38\u7528\u4E8E\u5206\u7C7B\u3001\u5F15\u5BFC\u6027\u6587\u5B57\n */\n superTitle?: string\n /**\n * \u526F\u6807\u9898/\u63CF\u8FF0\u6587\u5B57\n * \u901A\u5E38\u7528\u4E8E\u8865\u5145\u8BF4\u660E\u3001\u8BE6\u7EC6\u63CF\u8FF0\n */\n subtitle?: string\n /**\n * \u5C3A\u5BF8:\n * sm: \u5C0F\u5C3A\u5BF8\u7528\u4E8E\u7B5B\u9009\u9875\u9762\n * base: \u57FA\u7840\u5C3A\u5BF8\u7528\u4E8E\n * lg: \u5927\u5C3A\u5BF8\u7528\u4E8E\u4E13\u9898\u9875\n * xlg: \u6D3B\u52A8\u9875\uFF08\u901A\u680F\uFF09\n */\n size?: 'sm' | 'base' | 'lg' | 'xlg'\n pcImage?: MediaType\n padImage?: MediaType\n mobileImage?: MediaType\n /** \u89C6\u9891\u662F\u5426\u5FAA\u73AF\u64AD\u653E */\n isVideoLoop?: boolean\n /** \u7ED3\u675F\u65F6\u95F4\uFF08ISO \u5B57\u7B26\u4E32\uFF09 */\n endDate?: string\n /** \u7ED3\u675F\u65F6\u95F4\u65F6\u533A\uFF08\u5982: America/Los_Angeles\uFF09 */\n endDate_tz?: string\n /**\n * \u65F6\u95F4\u683C\u5F0F\u5316\u914D\u7F6E\uFF08JSON \u5B57\u7B26\u4E32\uFF09\n * {\"day\":\"\u65E5\",\"hour\":\"\u65F6\",\"minute\":\"\u5206\",\"second\":\"\u79D2\"}\n */\n dateFormat?: string\n\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: {\n text: string\n link?: string\n onClick?: () => void\n } & Omit<ButtonProps, 'children'>\n /** \u6B21\u7EA7\u6309\u94AE\u914D\u7F6E */\n secondaryButton?: {\n text: string\n link?: string\n onClick?: () => void\n } & Omit<ButtonProps, 'children'>\n\n iconArray?: Array<{ pcImage: MediaType }>\n theme?: Theme\n}\n\nexport interface SecondaryBannerProps extends React.HTMLAttributes<HTMLElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: SecondaryBannerData\n classNames?: Partial<Record<SecondaryBannerSemanticName, string>>\n /**\n * \u951A\u70B9\u8DF3\u8F6C\u914D\u7F6E\uFF08\u7528\u4E8E # \u5F00\u5934\u7684\u94FE\u63A5\uFF09\n * @default { duration: 500, offset: 0 }\n */\n jumpOptions?: JumpOptions\n}\n\n/**\n * SecondaryBanner - \u6B21\u7EA7\u6A2A\u5E45banner\n *\n * @description \u662F\u6307\u7528\u6237\u8FDB\u5165\u4E8C\u7EA7\u9875\u9762\u540E\uFF0C\u65E0\u9700\u6EDA\u52A8\u9875\u9762\u5C31\u80FD\u5728\u7B2C\u4E00\u5C4F\uFF08\u5373\"\u9996\u5C4F\"\uFF09\u770B\u5230\u7684\u3001\u901A\u5E38\u6A2A\u8DE8\u6574\u4E2A\u6D4F\u89C8\u5668\u7A97\u53E3\u5BBD\u5EA6\u7684\u6838\u5FC3\u89C6\u89C9\u533A\u57DF\u3002\n */\nconst SecondaryBanner = React.forwardRef<HTMLElement, SecondaryBannerProps>(\n ({ className, classNames = {}, data, jumpOptions = {}, ...props }, ref) => {\n const {\n pcImage,\n padImage,\n mobileImage,\n isVideoLoop = true,\n endDate,\n endDate_tz,\n dateFormat,\n size = 'base',\n iconArray: icons,\n theme = 'light',\n primaryButton,\n secondaryButton,\n title,\n titleTag = 'h1',\n } = data\n\n const { locale = 'us' } = useAiuiContext()\n\n // \u9ED8\u8BA4 jump \u914D\u7F6E\n const defaultJumpOptions: JumpOptions = { duration: 500, offset: 0 }\n const mergedJumpOptions = { ...defaultJumpOptions, ...jumpOptions }\n\n // \u751F\u6210\u552F\u4E00ID\u7528\u4E8E\u53EF\u8BBF\u95EE\u6027\n const bannerId = React.useId()\n const titleId = title ? `${bannerId}-title` : undefined\n const subtitleId = data.subtitle ? `${bannerId}-subtitle` : undefined\n const superTitleId = data.superTitle ? `${bannerId}-super-title` : undefined\n\n // \u6784\u5EFAaria-describedby\n const describedBy = [superTitleId, subtitleId].filter(Boolean).join(' ') || undefined\n\n return (\n <section\n ref={ref}\n role=\"banner\"\n aria-labelledby={titleId}\n aria-describedby={describedBy}\n className={cn(\n {\n 'aiui-dark': theme === 'dark',\n },\n secondaryBannerVariants({ size: size }),\n className,\n classNames?.root\n )}\n {...props}\n >\n <Media\n pcImage={pcImage}\n padImage={padImage}\n mobileImage={mobileImage}\n className={cn('absolute inset-0 size-full object-cover', {\n 'h-fit': size === 'xlg',\n })}\n imgClassName=\"object-cover\"\n videoClassName=\"object-cover\"\n muted={true}\n loop={isVideoLoop}\n playsInline={true}\n autoPlay={true}\n />\n <div\n className={cn(\n 'banner-content laptop:top-1/2 laptop:-translate-y-1/2 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] absolute top-12 z-10 flex flex-col items-start justify-center px-[16px] text-left',\n classNames?.content\n )}\n >\n <div className=\"banner-inner-title desktop:gap-2 flex flex-col items-start gap-1\">\n {data.superTitle && (\n <Text\n as=\"p\"\n size={2}\n id={superTitleId}\n className={cn('banner-super-title desktop:text-[16px] lg-desktop:text-[18px]', classNames?.superTitle)}\n html={data.superTitle}\n />\n )}\n\n {data.title && (\n <Heading\n as={titleTag}\n size={['xlg', 'lg'].includes(size) ? 5 : 4}\n id={titleId}\n className={cn('banner-title ', classNames?.title)}\n html={data.title}\n />\n )}\n\n {data.subtitle && (\n <Text\n as=\"p\"\n size={3}\n id={subtitleId}\n className={cn('banner-subtitle desktop:text-[16px] lg-desktop:text-[18px]', classNames?.subtitle)}\n html={data.subtitle}\n />\n )}\n </div>\n\n {endDate && (\n <div className=\"banner-countdown\">\n <Countdown\n endDate={endDate}\n endDate_tz={endDate_tz}\n dateFormat={dateFormat}\n variant=\"spacious\"\n className=\"lg-desktop:mt-8 mt-6\"\n />\n </div>\n )}\n\n <div\n className={cn(\n 'banner-cta-group lg-desktop:mt-[32px] lg-desktop:gap-3 mt-6 flex gap-2',\n classNames?.buttonGroup\n )}\n >\n {secondaryButton?.text && (\n <Button\n variant=\"secondary\"\n onClick={(e: React.MouseEvent<HTMLButtonElement>) => {\n if (secondaryButton.link?.startsWith('#')) {\n e.preventDefault()\n const element = document.querySelector(secondaryButton.link)\n if (element) {\n jump(element as HTMLElement, mergedJumpOptions)\n }\n }\n secondaryButton.onClick?.()\n }}\n className={cn('', classNames?.secondaryButton)}\n aria-describedby={titleId}\n {...(secondaryButton.link && !secondaryButton.link.startsWith('#')\n ? { as: 'a', href: getLocalizedPath(secondaryButton.link, locale) }\n : {})}\n >\n {secondaryButton.text}\n </Button>\n )}\n {primaryButton?.text && (\n <Button\n onClick={e => {\n if (primaryButton.link?.startsWith('#')) {\n e.preventDefault()\n const element = document.querySelector(primaryButton.link)\n if (element) {\n jump(element as HTMLElement, mergedJumpOptions)\n }\n }\n primaryButton.onClick?.()\n }}\n className={cn('', classNames?.primaryButton)}\n aria-describedby={titleId}\n {...(primaryButton.link && !primaryButton.link.startsWith('#')\n ? { as: 'a', href: getLocalizedPath(primaryButton.link, locale) }\n : {})}\n >\n {primaryButton.text}\n </Button>\n )}\n </div>\n\n {Array.isArray(icons) && icons.length > 0 && (\n <div\n className=\"banner-icons desktop:mt-3 lg-desktop:mt-4 mt-2 flex items-center gap-2\"\n role=\"group\"\n aria-label=\"brand icons\"\n >\n {icons.map((icon, index) =>\n icon.pcImage ? (\n <Picture\n key={index}\n source={icon.pcImage.url}\n alt={icon.pcImage.alt || `icon ${index + 1}`}\n role=\"img\"\n className=\"laptop:h-auto h-[48px] max-w-none\"\n imgClassName=\"h-full\"\n />\n ) : null\n )}\n </div>\n )}\n </div>\n </section>\n )\n }\n)\n\nSecondaryBanner.displayName = 'SecondaryBanner'\nexport default withLayout(SecondaryBanner)\n"],
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["jsx", "jsxs", "React", "cva", "jump", "cn", "getLocalizedPath", "Text", "Button", "Heading", "Picture", "Countdown", "Media", "useAiuiContext", "withLayout", "secondaryBannerVariants", "SecondaryBanner", "className", "classNames", "data", "jumpOptions", "props", "ref", "pcImage", "padImage", "mobileImage", "isVideoLoop", "endDate", "endDate_tz", "dateFormat", "size", "icons", "theme", "primaryButton", "secondaryButton", "title", "titleTag", "locale", "mergedJumpOptions", "bannerId", "titleId", "subtitleId", "superTitleId", "describedBy", "e", "element", "icon", "index", "SecondaryBanner_default"]
|
|
4
|
+
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cva } from 'class-variance-authority'\nimport jump from 'jump.js'\nimport { cn, getLocalizedPath } from '../../helpers/index.js'\nimport type { Media as MediaType, Theme } from '../../types/props.js'\nimport { Text, Button, Heading, Picture, Countdown } from '../../components/index.js'\nimport Media from '../Media/index.js'\nimport type { ButtonProps } from '../../components/button.js'\nimport { useAiuiContext } from '../AiuiProvider/index.js'\nimport { withLayout } from '../../shared/Styles.js'\nimport SecondaryBannerCarouselImpl from './SecondaryBannerCarousel.js'\n\nexport type SecondaryBannerSemanticName =\n | 'root'\n | 'title'\n | 'superTitle'\n | 'subtitle'\n | 'content'\n | 'buttonGroup'\n | 'primaryButton'\n | 'secondaryButton'\n\n/**\n * Carousel navigation configuration for SecondaryBanner. v1: arrows only.\n * autoplay, dots, and progress are intentionally EXCLUDED from v1.\n */\nexport interface SecondaryBannerCarouselConfig {\n /**\n * Show prev/next arrow navigation controls.\n * Only used when data.items has 2+ slides.\n * @default true\n */\n showArrows?: boolean\n showDots?: boolean\n loop?: boolean\n autoplaySeconds?: number\n}\n\n/**\n * Per-slide data for SecondaryBanner carousel mode.\n * All fields optional (mirrors SecondaryBannerData permissiveness).\n */\nexport interface SecondaryBannerSlideData {\n title?: string\n titleTag?: 'h1' | 'h2'\n superTitle?: string\n subtitle?: string\n size?: 'sm' | 'base' | 'lg' | 'xlg'\n pcImage?: MediaType\n padImage?: MediaType\n mobileImage?: MediaType\n isVideoLoop?: boolean\n endDate?: string\n endDate_tz?: string\n dateFormat?: string\n primaryButton?: {\n text: string\n link?: string\n onClick?: () => void\n } & Omit<ButtonProps, 'children'>\n secondaryButton?: {\n text: string\n link?: string\n onClick?: () => void\n } & Omit<ButtonProps, 'children'>\n iconArray?: Array<{ pcImage: MediaType }>\n theme?: Theme\n}\n/**\n * jump.js \u914D\u7F6E\u9009\u9879\n */\nexport interface JumpOptions {\n /** \u52A8\u753B\u6301\u7EED\u65F6\u95F4\uFF08\u6BEB\u79D2\uFF09 @default 500 */\n duration?: number\n /** \u504F\u79FB\u91CF\uFF08\u50CF\u7D20\uFF09 @default 0 */\n offset?: number\n /** \u52A8\u753B\u5B8C\u6210\u56DE\u8C03 */\n callback?: () => void\n /** \u7F13\u52A8\u51FD\u6570 */\n easing?: (t: number, b: number, c: number, d: number) => number\n /** \u662F\u5426\u8003\u8651 a11y @default false */\n a11y?: boolean\n}\n\nconst secondaryBannerVariants = cva(\n // \u57FA\u7840\u6837\u5F0F\n 'text-info-primary relative w-full',\n {\n variants: {\n size: {\n sm: 'tablet:aspect-[768/480] laptop:aspect-[1024/400] desktop:aspect-[1440/384] lg-desktop:aspect-[1920/480] aspect-[390/480]',\n base: 'tablet:aspect-[768/660] laptop:aspect-[1024/432] desktop:aspect-[1440/576] lg-desktop:aspect-[1920/720] aspect-[390/660]',\n lg: 'tablet:aspect-[768/660] laptop:aspect-[1024/520] desktop:aspect-[1440/700] lg-desktop:aspect-[1920/930] aspect-[390/660]',\n xlg: 'tablet:aspect-[768/660] laptop:aspect-[1024/520] desktop:aspect-[1440/700] lg-desktop:aspect-[1920/930] aspect-[390/660] overflow-visible',\n },\n },\n defaultVariants: {\n size: 'base',\n },\n }\n)\n\n/**\n * SecondaryBanner \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface SecondaryBannerData {\n /** \u4E3B\u6807\u9898*/\n title?: string\n /**\n * \u4E3B\u6807\u9898\u6807\u7B7E\n * @default 'h1'\n */\n titleTag?: 'h1' | 'h2'\n /**\n * \u4E0A\u6807\u9898/\u5F15\u5BFC\u6807\u9898\n * \u901A\u5E38\u7528\u4E8E\u5206\u7C7B\u3001\u5F15\u5BFC\u6027\u6587\u5B57\n */\n superTitle?: string\n /**\n * \u526F\u6807\u9898/\u63CF\u8FF0\u6587\u5B57\n * \u901A\u5E38\u7528\u4E8E\u8865\u5145\u8BF4\u660E\u3001\u8BE6\u7EC6\u63CF\u8FF0\n */\n subtitle?: string\n /**\n * \u5C3A\u5BF8:\n * sm: \u5C0F\u5C3A\u5BF8\u7528\u4E8E\u7B5B\u9009\u9875\u9762\n * base: \u57FA\u7840\u5C3A\u5BF8\u7528\u4E8E\n * lg: \u5927\u5C3A\u5BF8\u7528\u4E8E\u4E13\u9898\u9875\n * xlg: \u6D3B\u52A8\u9875\uFF08\u901A\u680F\uFF09\n */\n size?: 'sm' | 'base' | 'lg' | 'xlg'\n pcImage?: MediaType\n padImage?: MediaType\n mobileImage?: MediaType\n /** \u89C6\u9891\u662F\u5426\u5FAA\u73AF\u64AD\u653E */\n isVideoLoop?: boolean\n /** \u7ED3\u675F\u65F6\u95F4\uFF08ISO \u5B57\u7B26\u4E32\uFF09 */\n endDate?: string\n /** \u7ED3\u675F\u65F6\u95F4\u65F6\u533A\uFF08\u5982: America/Los_Angeles\uFF09 */\n endDate_tz?: string\n /**\n * \u65F6\u95F4\u683C\u5F0F\u5316\u914D\u7F6E\uFF08JSON \u5B57\u7B26\u4E32\uFF09\n * {\"day\":\"\u65E5\",\"hour\":\"\u65F6\",\"minute\":\"\u5206\",\"second\":\"\u79D2\"}\n */\n dateFormat?: string\n\n /** \u4E3B\u6309\u94AE\u914D\u7F6E */\n primaryButton?: {\n text: string\n link?: string\n onClick?: () => void\n } & Omit<ButtonProps, 'children'>\n /** \u6B21\u7EA7\u6309\u94AE\u914D\u7F6E */\n secondaryButton?: {\n text: string\n link?: string\n onClick?: () => void\n } & Omit<ButtonProps, 'children'>\n\n iconArray?: Array<{ pcImage: MediaType }>\n theme?: Theme\n /**\n * Carousel slide items. When present and non-empty, activates carousel mode.\n * Single-banner mode is used when absent or empty (DECISION-002).\n */\n items?: SecondaryBannerSlideData[]\n /**\n * Carousel navigation configuration.\n * Only meaningful when data.items is present and has 2+ items.\n */\n carousel?: SecondaryBannerCarouselConfig\n}\n\nexport interface SecondaryBannerProps extends React.HTMLAttributes<HTMLElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: SecondaryBannerData\n classNames?: Partial<Record<SecondaryBannerSemanticName, string>>\n /**\n * \u951A\u70B9\u8DF3\u8F6C\u914D\u7F6E\uFF08\u7528\u4E8E # \u5F00\u5934\u7684\u94FE\u63A5\uFF09\n * @default { duration: 500, offset: 0 }\n */\n jumpOptions?: JumpOptions\n /**\n * Whether this banner is the active slide in a carousel.\n * Controls video autoPlay: autoPlay={isActive ?? true}.\n * When absent (legacy single-banner), defaults to true (DECISION-008).\n * @default true\n */\n isActive?: boolean\n}\n\n/**\n * SecondaryBanner - \u6B21\u7EA7\u6A2A\u5E45banner\n *\n * @description \u662F\u6307\u7528\u6237\u8FDB\u5165\u4E8C\u7EA7\u9875\u9762\u540E\uFF0C\u65E0\u9700\u6EDA\u52A8\u9875\u9762\u5C31\u80FD\u5728\u7B2C\u4E00\u5C4F\uFF08\u5373\"\u9996\u5C4F\"\uFF09\u770B\u5230\u7684\u3001\u901A\u5E38\u6A2A\u8DE8\u6574\u4E2A\u6D4F\u89C8\u5668\u7A97\u53E3\u5BBD\u5EA6\u7684\u6838\u5FC3\u89C6\u89C9\u533A\u57DF\u3002\n */\nconst SecondaryBanner = React.forwardRef<HTMLElement, SecondaryBannerProps>(\n ({ className, classNames = {}, data, jumpOptions = {}, isActive, ...props }, ref) => {\n const {\n pcImage,\n padImage,\n mobileImage,\n isVideoLoop = true,\n endDate,\n endDate_tz,\n dateFormat,\n size = 'base',\n iconArray: icons,\n theme = 'light',\n primaryButton,\n secondaryButton,\n title,\n titleTag = 'h1',\n } = data\n\n // Hooks must be called unconditionally before any early return (React rules)\n const { locale = 'us' } = useAiuiContext()\n\n const defaultJumpOptions: JumpOptions = { duration: 500, offset: 0 }\n const mergedJumpOptions = { ...defaultJumpOptions, ...jumpOptions }\n\n const bannerId = React.useId()\n const titleId = title ? `${bannerId}-title` : undefined\n const subtitleId = data.subtitle ? `${bannerId}-subtitle` : undefined\n const superTitleId = data.superTitle ? `${bannerId}-super-title` : undefined\n const describedBy = [superTitleId, subtitleId].filter(Boolean).join(' ') || undefined\n\n // Task 15: Carousel mode early return AFTER all hooks (DECISION-002 / DECISION-A008)\n if (data.items && data.items.length > 0) {\n return (\n <SecondaryBannerCarouselImpl\n data={data}\n className={className}\n classNames={classNames}\n jumpOptions={jumpOptions}\n ref={ref}\n {...props}\n />\n )\n }\n\n return (\n <section\n ref={ref}\n role=\"banner\"\n aria-labelledby={titleId}\n aria-describedby={describedBy}\n className={cn(\n {\n 'aiui-dark': theme === 'dark',\n },\n secondaryBannerVariants({ size: size }),\n className,\n classNames?.root\n )}\n {...props}\n >\n <Media\n pcImage={pcImage}\n padImage={padImage}\n mobileImage={mobileImage}\n className={cn('absolute inset-0 size-full object-cover', {\n 'h-fit': size === 'xlg',\n })}\n imgClassName=\"object-cover\"\n videoClassName=\"object-cover\"\n muted={true}\n loop={isVideoLoop}\n playsInline={true}\n autoPlay={isActive ?? true}\n />\n <div\n className={cn(\n 'banner-content laptop:top-1/2 laptop:-translate-y-1/2 tablet:px-[32px] laptop:px-[64px] lg-desktop:px-[calc(50%-832px)] absolute top-12 z-10 flex flex-col items-start justify-center px-[16px] text-left',\n classNames?.content\n )}\n >\n <div className=\"banner-inner-title desktop:gap-2 flex flex-col items-start gap-1\">\n {data.superTitle && (\n <Text\n as=\"p\"\n size={2}\n id={superTitleId}\n className={cn('banner-super-title desktop:text-[16px] lg-desktop:text-[18px]', classNames?.superTitle)}\n html={data.superTitle}\n />\n )}\n\n {data.title && (\n <Heading\n as={titleTag}\n size={['xlg', 'lg'].includes(size) ? 5 : 4}\n id={titleId}\n className={cn('banner-title ', classNames?.title)}\n html={data.title}\n />\n )}\n\n {data.subtitle && (\n <Text\n as=\"p\"\n size={3}\n id={subtitleId}\n className={cn('banner-subtitle desktop:text-[16px] lg-desktop:text-[18px]', classNames?.subtitle)}\n html={data.subtitle}\n />\n )}\n </div>\n\n {endDate && (\n <div className=\"banner-countdown\">\n <Countdown\n endDate={endDate}\n endDate_tz={endDate_tz}\n dateFormat={dateFormat}\n variant=\"spacious\"\n className=\"lg-desktop:mt-8 mt-6\"\n />\n </div>\n )}\n\n <div\n className={cn(\n 'banner-cta-group lg-desktop:mt-[32px] lg-desktop:gap-3 mt-6 flex gap-2',\n classNames?.buttonGroup\n )}\n >\n {secondaryButton?.text && (\n <Button\n variant=\"secondary\"\n data-track={props.id ? `${props.id}_secondary_button_click` : 'SecondaryBanner_secondary_button_click'}\n onClick={(e: React.MouseEvent<HTMLButtonElement>) => {\n if (secondaryButton.link?.startsWith('#')) {\n e.preventDefault()\n const element = document.querySelector(secondaryButton.link)\n if (element) {\n jump(element as HTMLElement, mergedJumpOptions)\n }\n }\n secondaryButton.onClick?.()\n }}\n className={cn('', classNames?.secondaryButton)}\n aria-describedby={titleId}\n {...(secondaryButton.link && !secondaryButton.link.startsWith('#')\n ? { as: 'a', href: getLocalizedPath(secondaryButton.link, locale) }\n : {})}\n >\n {secondaryButton.text}\n </Button>\n )}\n {primaryButton?.text && (\n <Button\n data-track={props.id ? `${props.id}_primary_button_click` : 'SecondaryBanner_primary_button_click'}\n onClick={e => {\n if (primaryButton.link?.startsWith('#')) {\n e.preventDefault()\n const element = document.querySelector(primaryButton.link)\n if (element) {\n jump(element as HTMLElement, mergedJumpOptions)\n }\n }\n primaryButton.onClick?.()\n }}\n className={cn('', classNames?.primaryButton)}\n aria-describedby={titleId}\n {...(primaryButton.link && !primaryButton.link.startsWith('#')\n ? { as: 'a', href: getLocalizedPath(primaryButton.link, locale) }\n : {})}\n >\n {primaryButton.text}\n </Button>\n )}\n </div>\n\n {Array.isArray(icons) && icons.length > 0 && (\n <div\n className=\"banner-icons desktop:mt-3 lg-desktop:mt-4 mt-2 flex items-center gap-2\"\n role=\"group\"\n aria-label=\"brand icons\"\n >\n {icons.map((icon, index) =>\n icon.pcImage ? (\n <Picture\n key={index}\n source={icon.pcImage.url}\n alt={icon.pcImage.alt || `icon ${index + 1}`}\n role=\"img\"\n className=\"laptop:h-auto h-[48px] max-w-none\"\n imgClassName=\"h-full\"\n />\n ) : null\n )}\n </div>\n )}\n </div>\n </section>\n )\n }\n)\n\nSecondaryBanner.displayName = 'SecondaryBanner'\nexport default withLayout(SecondaryBanner)\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["jsx", "jsxs", "React", "cva", "jump", "cn", "getLocalizedPath", "Text", "Button", "Heading", "Picture", "Countdown", "Media", "useAiuiContext", "withLayout", "SecondaryBannerCarouselImpl", "secondaryBannerVariants", "SecondaryBanner", "className", "classNames", "data", "jumpOptions", "isActive", "props", "ref", "pcImage", "padImage", "mobileImage", "isVideoLoop", "endDate", "endDate_tz", "dateFormat", "size", "icons", "theme", "primaryButton", "secondaryButton", "title", "titleTag", "locale", "mergedJumpOptions", "bannerId", "titleId", "subtitleId", "superTitleId", "describedBy", "e", "element", "icon", "index", "SecondaryBanner_default"]
|
|
7
7
|
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
1
2
|
import type { Img } from '../../types/props.js';
|
|
2
3
|
export type SelectStoreDataType = {
|
|
3
4
|
title: string;
|
|
@@ -7,5 +8,10 @@ export type SelectStoreDataType = {
|
|
|
7
8
|
padImg: Img;
|
|
8
9
|
miniImg: Img;
|
|
9
10
|
};
|
|
10
|
-
|
|
11
|
+
interface SelectStoreType extends React.HTMLAttributes<HTMLDivElement> {
|
|
12
|
+
data: {
|
|
13
|
+
list: SelectStoreDataType[];
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<SelectStoreType, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../WheelLottery/index.js").ContainerProps & React.RefAttributes<unknown>> & {};
|
|
11
17
|
export default _default;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ShelfDisplayProps } from './shelfDisplay.js';
|
|
3
|
+
declare const _default: React.ForwardRefExoticComponent<Omit<ShelfDisplayProps & React.RefAttributes<HTMLDivElement>, "container" | keyof import("../../shared/Styles.js").StylesProps> & import("../../shared/Styles.js").StylesProps & import("../WheelLottery/index.js").ContainerProps & React.RefAttributes<unknown>> & {
|
|
4
|
+
readonly $$typeof: symbol;
|
|
5
|
+
};
|
|
2
6
|
export default _default;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Fragment as ie,jsx as r,jsxs as h}from"react/jsx-runtime";import{useAiuiContext as ne}from"../AiuiProvider/index.js";import{formatVariantPrice as ae}from"./shelfDisplay.js";import oe from"../../components/picture.js";import re from"../../components/badge.js";import{cn as g}from"../../helpers/utils.js";import{Text as ce}from"../../components/text.js";import G from"../../components/button.js";import{gaTrack as pe}from"../../shared/track.js";import{trackUrlRef as me}from"../../shared/trackUrlRef.js";import{Heading as de}from"../../components/heading.js";import{useExposure as ue}from"../../hooks/useExposure.js";import{useRef as fe,useEffect as he,useMemo as J,useState as le}from"react";const K="image",Q="product_shelf",X=999999999e-2,xe=e=>{const t=e?.sku,b=e?.variants,k=b?.find(N=>N?.sku===t),D=k?.image?.url||b?.[0]?.image?.url||"",I=k?.image?.altText||b?.[0]?.image?.altText||e?.custom_name||e?.title||"";return{imageUrl:D,altText:I}},$e=({data:e,configuration:t})=>{const{isDisplayBackImage:b=!1,itemShape:k,metafields:D,isTopTag:I=!1,isShowTag:N,isShowOriginalPrice:O,isShowShortTitle:w=!1}=t||{},{locale:_="es",copyWriting:Y,currencyDisplay:U}=ne(),{discounts:z,discountsCopy:P}=D||{},H=fe(null),[E,p]=le([]),[L,Z]=le(""),R=(s,o,l,i)=>{const{primaryFun:c,onAddCart:d,onBuyNow:f,onLearnMore:W,event:se}=t||{};if(c){if(c==="AddCart"&&d)return d(s,o+1,l,i);if(c==="BuyNow"&&f)return f(s,o+1,l,i);if(c==="LearnMore"&&W)return W(s,o+1,l,i)}se?.primaryButton?.(s,o+1,l,i)},ee=(s,o,l,i)=>{const{secondaryFun:c,onAddCart:d,onBuyNow:f,onLearnMore:W,event:se}=t||{};if(c){if(c==="AddCart"&&d)return d(s,o+1,l,i);if(c==="BuyNow"&&f)return f(s,o+1,l,i);if(c==="LearnMore"&&W)return W(s,o+1,l,i)}se?.secondaryButton?.(s,o+1,l,i)},m=J(()=>{const s=e?.variants||[];if(s.length)return e?.sku?s?.find?.(o=>o?.sku===e?.sku)||s[0]:s?.[0]},[e?.sku,e?.variants]),u=m?.id?.split?.("/")||[],A=u?.[u?.length-1],S=!m?.availableForSale||m?.price?.amount===X||m?.price===X,x=m?.coupons?.[0],M=!!(O&&x),V=e?.price?.currencyCode||"USD",T=J(()=>ae({locale:_,amount:M?x?.variant_price4wscode:m?.price,baseAmount:M?m?.price:0,currencyCode:V,currencyDisplay:U}),[V,_,M,x?.variant_price4wscode,m]),{price:F,basePrice:te,discount:B,discountAmount:y}=T,{imageUrl:C,altText:$}=xe(e),v=e?.custom_name||e?.title,j=w&&m?.metafields?.infos?.page_short_title||v,q=e?.custom_description||e?.description,n=()=>{if(x?.value_type==="fixed_amount"){const s=y||"",o=s.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(o){const[,l,i,c]=o;let d=i;return i.endsWith(".00")?d=i.replace(/\.00$/,""):i.endsWith(",00")&&(d=i.replace(/,00$/,"")),`${l}${d}${c}`}return s}return B||""};he(()=>{let s=[];if(B||y){const l=`${n()} ${z?.off||P?.off||""}`;Z(l),s.push(l)}const o=e?.tags?.filter?.(l=>l?.startsWith?.("CLtag"))?.map?.(l=>l?.replace?.("CLtag:",""))?.slice?.(0,B?1:2);p(s.concat(o))},[e?.tags,B,y,z?.off,P?.off]),ue(H,{componentType:K,componentName:Q,componentTitle:v,componentDescription:q,position:t?.index+1});const a=()=>h(ie,{children:[N&&E?.length>0?r("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:E?.map?.((s,o)=>r(re,{className:"shelf-items-tag",children:s},o))}):null,j?r(de,{as:"h3",title:j||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] line-clamp-2 h-12",html:j||""}):null,r(ce,{size:2,className:"lg-desktop:text-lg desktop:h-[24px] lg-desktop:h-[28px] desktop:text-base shelf-display-product-description line-clamp-1 h-[20px] text-sm",html:q||""}),r("div",{className:"mb-2 mt-4 flex items-center",children:S?r("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:Y?.soldOutText}):h(ie,{children:[r("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:m?.availableForSale&&F||""}),r("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:m?.availableForSale&&te||""})]})}),h("div",{className:g("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?r(G,{disabled:S&&t?.secondaryFun!=="LearnMore",variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:()=>!e?.custom_secondary_link&&ee(e,t?.index,t,x),className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?r(G,{disabled:S&&t?.primaryFun!=="LearnMore",variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:()=>!e?.custom_primary_link&&R(e,t?.index,t,x),className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]});return r("div",{ref:H,className:g("bg-background tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300",k==="round"?"rounded-2xl":"rounded-none","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative","md-tablet:h-[360px] shelf-display-item"),children:b?r("div",{className:"absolute inset-0 box-border overflow-hidden",children:h("div",{className:"relative inset-0 size-full",children:[r(oe,{source:C,alt:$,className:"flex h-full justify-center object-cover [&_img]:w-auto"}),r("div",{className:"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4",children:a()})]})}):h("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4",children:[L&&I&&r(re,{className:"shelf-prices-tag absolute left-4 top-4 z-10",children:L||""}),r("div",{className:g("lg-desktop:h-[195px] shelf-display-item-image relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden"),children:r("a",{"aria-label":v,target:t?.target,href:me(`${_==="us"||!_?"":`/${_}`}/products/${e?.handle}?variant=${A}`,`${K}_${Q}`),onClick:()=>{pe({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||m?.sku,item_name:e?.name,item_variant:m?.name,price:m?.price,index:t?.index+1}]}})},children:r(oe,{source:C,alt:$,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),a()]})},e?.id||e?.handle)},De=({data:e,configuration:t})=>{const{itemShape:b,itemLength:k,metafields:D,isShowShortTitle:I}=t||{},{discounts:N,discountsCopy:O}=D||{},{locale:w="us",copyWriting:_,currencyDisplay:Y}=ne(),[U,z]=le([]),P=fe(null),H=(n,a,s,o)=>{const{primaryFun:l,onAddCart:i,onBuyNow:c,onLearnMore:d,event:f}=t||{};if(l){if(l==="AddCart"&&i)return i(n,a+1,s,o);if(l==="BuyNow"&&c)return c(n,a+1,s,o);if(l==="LearnMore"&&d)return d(n,a+1,s,o)}f?.primaryButton?.(n,a+1,s,o)},E=(n,a,s,o)=>{const{secondaryFun:l,onAddCart:i,onBuyNow:c,onLearnMore:d,event:f}=t||{};if(l){if(l==="AddCart"&&i)return i(n,a+1,s,o);if(l==="BuyNow"&&c)return c(n,a+1,s,o);if(l==="LearnMore"&&d)return d(n,a+1,s,o)}f?.secondaryButton?.(n,a+1,s,o)},p=J(()=>{const n=e?.variants||[];if(n.length)return e?.sku&&n.find(a=>a?.sku===e?.sku)||n[0]},[e?.sku,e?.variants]),L=p?.id?.split?.("/")||[],Z=L?.[L?.length-1],R=!p?.availableForSale||p?.price?.amount===X||p?.price===X,ee=t?.isShowTag,m=t?.isShowOriginalPrice,u=p?.coupons?.[0],A=!!(m&&u),S=e?.price?.currencyCode||"USD",x=J(()=>ae({locale:w,amount:A?u?.variant_price4wscode:p?.price,baseAmount:A?p?.price:0,currencyCode:S,currencyDisplay:Y}),[S,w,A,u?.variant_price4wscode,p]),{price:M,basePrice:V,discount:T,discountAmount:F}=x,{imageUrl:te,altText:B}=xe(e),y=e?.custom_name||e?.title,C=I&&p?.metafields?.infos?.page_short_title||y,$=e?.custom_description||e?.description;ue(P,{componentType:K,componentName:Q,componentTitle:y,componentDescription:$,position:t?.index+1});const v=()=>k>=2?{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full",imgItem:"m-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]",wrap:"lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full"}:{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]",imgItem:"md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]",wrap:"lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full"},j=()=>k>=2?"flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center":"flex justify-center items-center gap-6 md-tablet:flex-col",q=()=>{if(u?.value_type==="fixed_amount"){const n=F||"",a=n.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(a){const[,s,o,l]=a;let i=o;return o.endsWith(".00")?i=o.replace(/\.00$/,""):o.endsWith(",00")&&(i=o.replace(/,00$/,"")),`${s}${i}${l}`}return n}return T||""};return he(()=>{let n=[];if(T||F){const s=`${q()} ${N?.off||O?.off||""}`;n.push(s)}const a=e?.tags?.filter?.(s=>s?.startsWith?.("CLtag"))?.map?.(s=>s?.replace?.("CLtag:",""))?.slice?.(0,T?1:2);z(n.concat(a))},[e?.tags,T,F,N?.off,O?.off]),r("div",{ref:P,className:g(v().wrap,b==="round"?"rounded-2xl":"rounded-none","shelf-display-item","bg-container-secondary-1 tablet:hover:bg-info-white gap-6 duration-300","md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden"),children:h("div",{className:g(j(),"desktop:p-6 absolute inset-0 box-border overflow-hidden p-4"),children:[r("div",{className:g(v().imgItem,"desktop:mb-0 relative mb-1 overflow-hidden"),children:r("a",{"aria-label":y,target:t?.target,href:me(`${w==="us"||!w?"":`/${w}`}/products/${e?.handle}?variant=${Z}`,`${K}_${Q}`),onClick:()=>{pe({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||p?.sku,item_name:e?.name,item_variant:p?.name,price:p?.price,index:t?.index+1}]}})},children:r(oe,{source:te,alt:B,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),h("div",{className:g("flex flex-col items-start justify-center",v().boxItem),children:[ee&&r("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:U?.length>0&&U?.map?.((n,a)=>r(re,{className:"shelf-items-tag",children:n},a))}),C?r(de,{as:"h3",title:C||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] mb-1 line-clamp-2 h-[48px]",html:C||""}):null,$?r(ce,{size:2,className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm",html:$||""}):null,r("div",{className:"mb-2 mt-5 flex items-center",children:R?r("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:_?.soldOutText}):h(ie,{children:[r("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:p?.availableForSale&&M||""}),r("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:p?.availableForSale&&V||""})]})}),h("div",{className:g("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?r(G,{variant:"secondary",href:e?.custom_secondary_link,as:e?.custom_secondary_link?"a":"button",onClick:()=>!e?.custom_secondary_link&&E(e,t?.index,t,u),className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?r(G,{disabled:R,variant:"primary",href:e?.custom_primary_link,as:e?.custom_primary_link?"a":"button",onClick:()=>!e?.custom_primary_link&&H(e,t?.index,t,u),className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]})]})},e?.id||e?.handle)};export{De as ShelfDisplayHorizontalItem,$e as ShelfDisplayWrapItem,xe as getProductImage};
|
|
1
|
+
import{Fragment as ae,jsx as r,jsxs as x}from"react/jsx-runtime";import{useAiuiContext as ce}from"../AiuiProvider/index.js";import{formatVariantPrice as pe}from"./shelfDisplay.js";import ne from"../../components/picture.js";import le from"../../components/badge.js";import{cn as g}from"../../helpers/utils.js";import{Text as me}from"../../components/text.js";import X from"../../components/button.js";import{gaTrack as de}from"../../shared/track.js";import{trackUrlRef as L}from"../../shared/trackUrlRef.js";import{Heading as ue}from"../../components/heading.js";import{useExposure as fe}from"../../hooks/useExposure.js";import{useRef as xe,useEffect as he,useMemo as Y,useState as ie}from"react";const b="image",k="product_shelf",Z=999999999e-2,ye=e=>{const t=e?.sku,_=e?.variants,w=_?.find(T=>T?.sku===t),A=w?.image?.url||_?.[0]?.image?.url||"",H=w?.image?.altText||_?.[0]?.image?.altText||e?.custom_name||e?.title||"";return{imageUrl:A,altText:H}},De=({data:e,configuration:t})=>{const{isDisplayBackImage:_=!1,itemShape:w,metafields:A,isTopTag:H=!1,isShowTag:T,isShowOriginalPrice:R,isShowShortTitle:N=!1}=t||{},{locale:S="es",copyWriting:ee,currencyDisplay:M,trackingData:$}=ce(),{discounts:V,discountsCopy:F}=A||{},q=xe(null),[G,p]=ie([]),[j,te]=ie(""),J=(s,o,n,l)=>{const{primaryFun:c,onAddCart:d,onBuyNow:f,onLearnMore:E,event:re}=t||{};if(c){if(c==="AddCart"&&d)return d(s,o+1,n,l);if(c==="BuyNow"&&f)return f(s,o+1,n,l);if(c==="LearnMore"&&E)return E(s,o+1,n,l)}re?.primaryButton?.(s,o+1,n,l)},se=(s,o,n,l)=>{const{secondaryFun:c,onAddCart:d,onBuyNow:f,onLearnMore:E,event:re}=t||{};if(c){if(c==="AddCart"&&d)return d(s,o+1,n,l);if(c==="BuyNow"&&f)return f(s,o+1,n,l);if(c==="LearnMore"&&E)return E(s,o+1,n,l)}re?.secondaryButton?.(s,o+1,n,l)},m=Y(()=>{const s=e?.variants||[];if(s.length)return e?.sku?s?.find?.(o=>o?.sku===e?.sku)||s[0]:s?.[0]},[e?.sku,e?.variants]),u=m?.id?.split?.("/")||[],W=u?.[u?.length-1],B=!m?.availableForSale||m?.price?.amount===Z||m?.price===Z,h=m?.coupons?.[0],O=!!(R&&h),K=e?.price?.currencyCode||"USD",C=Y(()=>pe({locale:S,amount:O?h?.variant_price4wscode:m?.price,baseAmount:O?m?.price:0,currencyCode:K,currencyDisplay:M}),[K,S,O,h?.variant_price4wscode,m]),{price:U,basePrice:oe,discount:D,discountAmount:y}=C,{imageUrl:I,altText:P}=ye(e),v=e?.custom_name||e?.title,z=N&&m?.metafields?.infos?.page_short_title||v,Q=e?.custom_description||e?.description,i=()=>{if(h?.value_type==="fixed_amount"){const s=y||"",o=s.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(o){const[,n,l,c]=o;let d=l;return l.endsWith(".00")?d=l.replace(/\.00$/,""):l.endsWith(",00")&&(d=l.replace(/,00$/,"")),`${n}${d}${c}`}return s}return D||""};he(()=>{let s=[];if(D||y){const n=`${i()} ${V?.off||F?.off||""}`;te(n),s.push(n)}const o=e?.tags?.filter?.(n=>n?.startsWith?.("CLtag"))?.map?.(n=>n?.replace?.("CLtag:",""))?.slice?.(0,D?1:2);p(s.concat(o))},[e?.tags,D,y,V?.off,F?.off]),fe(q,{componentType:b,componentName:k,componentTitle:v,componentDescription:Q,position:t?.index+1});const a=()=>x(ae,{children:[T&&G?.length>0?r("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:G?.map?.((s,o)=>r(le,{className:"shelf-items-tag",children:s},o))}):null,z?r(ue,{as:"h3",title:z||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] line-clamp-2 h-12",html:z||""}):null,r(me,{size:2,className:"lg-desktop:text-lg desktop:h-[24px] lg-desktop:h-[28px] desktop:text-base shelf-display-product-description line-clamp-1 h-[20px] text-sm",html:Q||""}),r("div",{className:"mb-2 mt-4 flex items-center",children:B?r("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:ee?.soldOutText}):x(ae,{children:[r("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:m?.availableForSale&&U||""}),r("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:m?.availableForSale&&oe||""})]})}),x("div",{className:g("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?r(X,{disabled:B&&t?.secondaryFun!=="LearnMore",variant:"secondary",href:e?.custom_secondary_link?L(e?.custom_secondary_link,`${$?.contextHandle||""}_${b}_${k}`):void 0,as:e?.custom_secondary_link?"a":"button",onClick:()=>!e?.custom_secondary_link&&se(e,t?.index,t,h),className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?r(X,{disabled:B&&t?.primaryFun!=="LearnMore",variant:"primary",href:e?.custom_primary_link?L(e?.custom_primary_link,`${$?.contextHandle||""}_${b}_${k}`):void 0,as:e?.custom_primary_link?"a":"button",onClick:()=>!e?.custom_primary_link&&J(e,t?.index,t,h),className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]});return r("div",{ref:q,className:g("bg-background tablet:hover:bg-info-white box-border w-full cursor-pointer overflow-hidden duration-300",w==="round"?"rounded-2xl":"rounded-none","lg-desktop:aspect-w-[404] lg-desktop:aspect-h-[480] desktop:aspect-w-[316] desktop:aspect-h-[384]","laptop:aspect-w-[288] laptop:aspect-h-[360] aspect-w-[296] aspect-h-[360] relative","md-tablet:h-[360px] shelf-display-item"),children:_?r("div",{className:"absolute inset-0 box-border overflow-hidden",children:x("div",{className:"relative inset-0 size-full",children:[r(ne,{source:I,alt:P,className:"flex h-full justify-center object-cover [&_img]:w-auto"}),r("div",{className:"desktop:p-6 absolute inset-x-0 bottom-0 box-border overflow-hidden p-4",children:a()})]})}):x("div",{className:"desktop:p-6 absolute inset-0 box-border flex flex-col justify-between overflow-hidden p-4",children:[j&&H&&r(le,{className:"shelf-prices-tag absolute left-4 top-4 z-10",children:j||""}),r("div",{className:g("lg-desktop:h-[195px] shelf-display-item-image relative mb-2 inline-block h-[140px] w-full flex-1 overflow-hidden"),children:r("a",{"aria-label":v,target:t?.target,href:L(`${S==="us"||!S?"":`/${S}`}/products/${e?.handle}?variant=${W}`,`${$?.contextHandle||""}_${b}_${k}`),onClick:()=>{de({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||m?.sku,item_name:e?.name,item_variant:m?.name,price:m?.price,index:t?.index+1}]}})},children:r(ne,{source:I,alt:P,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),a()]})},e?.id||e?.handle)},Ie=({data:e,configuration:t})=>{const{itemShape:_,itemLength:w,metafields:A,isShowShortTitle:H}=t||{},{discounts:T,discountsCopy:R}=A||{},{locale:N="us",copyWriting:S,currencyDisplay:ee,trackingData:M}=ce(),[$,V]=ie([]),F=xe(null),q=(i,a,s,o)=>{const{primaryFun:n,onAddCart:l,onBuyNow:c,onLearnMore:d,event:f}=t||{};if(n){if(n==="AddCart"&&l)return l(i,a+1,s,o);if(n==="BuyNow"&&c)return c(i,a+1,s,o);if(n==="LearnMore"&&d)return d(i,a+1,s,o)}f?.primaryButton?.(i,a+1,s,o)},G=(i,a,s,o)=>{const{secondaryFun:n,onAddCart:l,onBuyNow:c,onLearnMore:d,event:f}=t||{};if(n){if(n==="AddCart"&&l)return l(i,a+1,s,o);if(n==="BuyNow"&&c)return c(i,a+1,s,o);if(n==="LearnMore"&&d)return d(i,a+1,s,o)}f?.secondaryButton?.(i,a+1,s,o)},p=Y(()=>{const i=e?.variants||[];if(i.length)return e?.sku&&i.find(a=>a?.sku===e?.sku)||i[0]},[e?.sku,e?.variants]),j=p?.id?.split?.("/")||[],te=j?.[j?.length-1],J=!p?.availableForSale||p?.price?.amount===Z||p?.price===Z,se=t?.isShowTag,m=t?.isShowOriginalPrice,u=p?.coupons?.[0],W=!!(m&&u),B=e?.price?.currencyCode||"USD",h=Y(()=>pe({locale:N,amount:W?u?.variant_price4wscode:p?.price,baseAmount:W?p?.price:0,currencyCode:B,currencyDisplay:ee}),[B,N,W,u?.variant_price4wscode,p]),{price:O,basePrice:K,discount:C,discountAmount:U}=h,{imageUrl:oe,altText:D}=ye(e),y=e?.custom_name||e?.title,I=H&&p?.metafields?.infos?.page_short_title||y,P=e?.custom_description||e?.description;fe(F,{componentType:b,componentName:k,componentTitle:y,componentDescription:P,position:t?.index+1});const v=()=>w>=2?{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] max-w-full",imgItem:"m-tablet:m-auto lg-desktop:max-w-[330px] lg-desktop:max-h-[330px] desktop:max-w-[260px] desktop:max-h-[260px] max-w-[138px] max-h-[138px]",wrap:"lg-desktop:aspect-w-[824] lg-desktop:aspect-h-[480] desktop:aspect-w-[648] desktop:aspect-h-[380] laptop:aspect-w-[440] laptop:aspect-h-[356] tablet:aspect-w-[346] tablet:aspect-h-[360] md-tablet:w-full"}:{boxItem:"lg-desktop:max-w-[401px] desktop:max-w-[292px] laptop:max-w-[289px] max-w-[262px]",imgItem:"md-tablet:m-auto lg-desktop:max-w-[450px] lg-desktop:max-h-[450px] desktop:max-w-[332px] desktop:max-h-[332px] max-w-[312px] max-h-[312px]",wrap:"lg-desktop:aspect-w-[1664] lg-desktop:aspect-h-[480] desktop:aspect-w-[1312] desktop:aspect-h-[380] laptop:aspect-w-[896] laptop:aspect-h-[356] tablet:aspect-w-[704] tablet:aspect-h-[360] md-tablet:w-full"},z=()=>w>=2?"flex flex-col justify-between desktop:gap-12 desktop:flex-row desktop:justify-center desktop:items-center":"flex justify-center items-center gap-6 md-tablet:flex-col",Q=()=>{if(u?.value_type==="fixed_amount"){const i=U||"",a=i.match(/^(.*?)(\d[\d.,]*)(.*)$/);if(a){const[,s,o,n]=a;let l=o;return o.endsWith(".00")?l=o.replace(/\.00$/,""):o.endsWith(",00")&&(l=o.replace(/,00$/,"")),`${s}${l}${n}`}return i}return C||""};return he(()=>{let i=[];if(C||U){const s=`${Q()} ${T?.off||R?.off||""}`;i.push(s)}const a=e?.tags?.filter?.(s=>s?.startsWith?.("CLtag"))?.map?.(s=>s?.replace?.("CLtag:",""))?.slice?.(0,C?1:2);V(i.concat(a))},[e?.tags,C,U,T?.off,R?.off]),r("div",{ref:F,className:g(v().wrap,_==="round"?"rounded-2xl":"rounded-none","shelf-display-item","bg-container-secondary-1 tablet:hover:bg-info-white gap-6 duration-300","md-tablet:h-[360px] relative box-border w-full cursor-pointer overflow-hidden"),children:x("div",{className:g(z(),"desktop:p-6 absolute inset-0 box-border overflow-hidden p-4"),children:[r("div",{className:g(v().imgItem,"desktop:mb-0 relative mb-1 overflow-hidden"),children:r("a",{"aria-label":y,target:t?.target,href:L(`${N==="us"||!N?"":`/${N}`}/products/${e?.handle}?variant=${te}`,`${M?.contextHandle||""}_${b}_${k}`),onClick:()=>{de({event:"ga4Event",event_name:"select_item",event_parameters:{page_group:"Home Page",item_list_name:"Home_Page_Bundle",items:[{item_id:e?.sku||p?.sku,item_name:e?.name,item_variant:p?.name,price:p?.price,index:t?.index+1}]}})},children:r(ne,{source:oe,alt:D,className:"flex h-full justify-center object-cover [&_img]:w-auto"})})}),x("div",{className:g("flex flex-col items-start justify-center",v().boxItem),children:[se&&r("div",{className:"mb-1 box-border flex h-8 flex-wrap gap-1 overflow-hidden",children:$?.length>0&&$?.map?.((i,a)=>r(le,{className:"shelf-items-tag",children:i},a))}),I?r(ue,{as:"h3",title:I||"",size:2,className:"shelf-display-product-title lg-desktop:h-[58px] mb-1 line-clamp-2 h-[48px]",html:I||""}):null,P?r(me,{size:2,className:"lg-desktop:text-lg lg-desktop:h-[26px] desktop:text-base desktop:h-6 shelf-display-product-description line-clamp-1 h-5 text-sm",html:P||""}):null,r("div",{className:"mb-2 mt-5 flex items-center",children:J?r("div",{className:"tablet:text-2xl text-info-primary text-xl font-bold",children:S?.soldOutText}):x(ae,{children:[r("div",{className:"final-price tablet:text-2xl text-info-primary text-xl font-bold",children:p?.availableForSale&&O||""}),r("div",{className:"origin-price tablet:text-xl text-info-secondary ml-1 text-lg font-bold line-through",children:p?.availableForSale&&K||""})]})}),x("div",{className:g("shelf-flex-button-group","lg-desktop:gap-3 flex items-center gap-2",t.direction==="vertical"?"flex-col":""),children:[t?.secondaryButton?r(X,{variant:"secondary",href:e?.custom_secondary_link?L(e?.custom_secondary_link,`${M?.contextHandle||""}_${b}_${k}`):void 0,as:e?.custom_secondary_link?"a":"button",onClick:()=>!e?.custom_secondary_link&&G(e,t?.index,t,u),className:t.direction==="vertical"?"w-full":"",children:t?.secondaryButton||""}):null,t?.primaryButton?r(X,{disabled:J,variant:"primary",href:e?.custom_primary_link?L(e?.custom_primary_link,`${M?.contextHandle||""}_${b}_${k}`):void 0,as:e?.custom_primary_link?"a":"button",onClick:()=>!e?.custom_primary_link&&q(e,t?.index,t,u),className:t.direction==="vertical"?"w-full":"",children:t?.primaryButton||""}):null]})]})]})},e?.id||e?.handle)};export{Ie as ShelfDisplayHorizontalItem,De as ShelfDisplayWrapItem,ye as getProductImage};
|
|
2
2
|
//# sourceMappingURL=shelfDisplayItem.js.map
|