@anker-in/headless-ui 1.1.28-alpha.1768202456200 → 1.1.29
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 +3 -3
- package/dist/cjs/biz-components/AiuiProvider/index.d.ts +0 -7
- package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
- package/dist/cjs/biz-components/AiuiProvider/index.js.map +2 -2
- package/dist/cjs/biz-components/AplusDesc/index.d.ts +3 -3
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.d.ts +3 -3
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/cjs/biz-components/BrandEquity/BrandEquity.js.map +2 -2
- package/dist/cjs/biz-components/BrandEquity/types.d.ts +0 -1
- 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/index.d.ts +3 -3
- package/dist/cjs/biz-components/CreativeModule/index.d.ts +3 -3
- package/dist/cjs/biz-components/DownLoad/index.d.ts +3 -3
- package/dist/cjs/biz-components/Evaluate/index.d.ts +3 -3
- package/dist/cjs/biz-components/Evaluate/index.js +1 -1
- package/dist/cjs/biz-components/Evaluate/index.js.map +2 -2
- package/dist/cjs/biz-components/Faq/Faq.d.ts +3 -3
- package/dist/cjs/biz-components/FeatureCards/FeatureCards.d.ts +3 -3
- package/dist/cjs/biz-components/FeatureShowcase/FeatureShowcase.d.ts +3 -3
- package/dist/cjs/biz-components/Features/index.d.ts +3 -3
- package/dist/cjs/biz-components/FootCharger/index.d.ts +3 -3
- package/dist/cjs/biz-components/FooterNavigation/index.d.ts +3 -3
- package/dist/cjs/biz-components/GiftBox/index.d.ts +3 -3
- package/dist/cjs/biz-components/Graphic/index.d.ts +3 -3
- package/dist/cjs/biz-components/GraphicAttractionBlock/index.d.ts +3 -3
- package/dist/cjs/biz-components/GraphicMore/index.d.ts +3 -3
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.d.ts +3 -3
- package/dist/cjs/biz-components/HeaderNavigation/index.d.ts +3 -3
- package/dist/cjs/biz-components/HeroBanner/Countdown.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/Countdown.js.map +2 -2
- package/dist/cjs/biz-components/HeroBanner/HeroBanner.d.ts +3 -6
- 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/types.d.ts +0 -4
- 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/ImageTextFeature/ImageTextFeature.d.ts +3 -3
- package/dist/cjs/biz-components/ImageTextFeature/ImageTextFeature.js +1 -1
- package/dist/cjs/biz-components/ImageTextFeature/ImageTextFeature.js.map +3 -3
- package/dist/cjs/biz-components/ImageTextFeature/types.d.ts +0 -1
- package/dist/cjs/biz-components/ImageTextFeature/types.js +1 -1
- package/dist/cjs/biz-components/ImageTextFeature/types.js.map +1 -1
- package/dist/cjs/biz-components/ImageWithText/ImageWithText.d.ts +3 -3
- package/dist/cjs/biz-components/Ksp/index.d.ts +3 -3
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.d.ts +4 -4
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +3 -3
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +3 -3
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.d.ts +3 -3
- package/dist/cjs/biz-components/Marquee/Marquee.d.ts +3 -3
- 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/MarqueeReview/index.d.ts +3 -3
- package/dist/cjs/biz-components/MediaPlayerBase/index.d.ts +3 -3
- package/dist/cjs/biz-components/MediaPlayerMulti/index.d.ts +3 -3
- package/dist/cjs/biz-components/MediaPlayerSticky/index.d.ts +4 -4
- package/dist/cjs/biz-components/MediaPlayerSticky/types.d.ts +0 -1
- package/dist/cjs/biz-components/MediaPlayerSticky/types.js +1 -1
- package/dist/cjs/biz-components/MediaPlayerSticky/types.js.map +1 -1
- package/dist/cjs/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +3 -3
- package/dist/cjs/biz-components/MemberEquity/index.d.ts +3 -3
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +3 -3
- package/dist/cjs/biz-components/ProductCompare/index.d.ts +3 -3
- package/dist/cjs/biz-components/ProductHero/ProductHero.d.ts +3 -3
- package/dist/cjs/biz-components/ProductNav/ProductNav.d.ts +3 -3
- package/dist/cjs/biz-components/SelectStore/index.d.ts +3 -3
- package/dist/cjs/biz-components/ShelfDisplay/index.d.ts +3 -3
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.d.ts +11 -0
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js.map +3 -3
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +4 -4
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- package/dist/cjs/biz-components/Slogan/index.d.ts +3 -3
- package/dist/cjs/biz-components/Spacer/index.d.ts +3 -3
- package/dist/cjs/biz-components/Specs/index.d.ts +3 -3
- package/dist/cjs/biz-components/SpecsComparison/SpecsComparison.d.ts +3 -3
- package/dist/cjs/biz-components/TabWithImage/TabWithImage.d.ts +3 -3
- package/dist/cjs/biz-components/Tabs/Tabs.d.ts +3 -3
- 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 +0 -9
- 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 +3 -3
- package/dist/cjs/biz-components/TabsWithMedia/TabsWithMedia.d.ts +3 -3
- package/dist/cjs/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +3 -3
- package/dist/cjs/biz-components/Title/index.d.ts +3 -3
- 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 +0 -55
- 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 +3 -3
- package/dist/cjs/biz-components/WhyChoose/WhyChoose.d.ts +3 -3
- package/dist/cjs/biz-components/index.d.ts +0 -32
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/components/badge.d.ts +2 -5
- package/dist/cjs/components/badge.js +1 -1
- package/dist/cjs/components/badge.js.map +3 -3
- package/dist/cjs/components/index.d.ts +0 -2
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/tabs.d.ts +1 -2
- package/dist/cjs/components/tabs.js +1 -1
- package/dist/cjs/components/tabs.js.map +2 -2
- package/dist/cjs/helpers/index.d.ts +0 -1
- package/dist/cjs/helpers/index.js +1 -1
- package/dist/cjs/helpers/index.js.map +3 -3
- package/dist/cjs/shared/Styles.d.ts +4 -5
- package/dist/cjs/shared/Styles.js +1 -1
- package/dist/cjs/shared/Styles.js.map +3 -3
- package/dist/cjs/stories/HeroBanner.stories.d.ts +28 -0
- package/dist/cjs/stories/HeroBanner.stories.js +11 -0
- package/dist/cjs/stories/HeroBanner.stories.js.map +7 -0
- package/dist/cjs/stories/InlineVideo.stories.d.ts +37 -0
- package/dist/cjs/stories/InlineVideo.stories.js +164 -0
- package/dist/cjs/stories/InlineVideo.stories.js.map +7 -0
- package/dist/cjs/stories/MarqueeReview.stories.d.ts +72 -0
- package/dist/cjs/stories/MarqueeReview.stories.js +19 -0
- package/dist/cjs/stories/MarqueeReview.stories.js.map +7 -0
- package/dist/cjs/stories/MediaSceneSwitcher.stories.d.ts +47 -0
- package/dist/cjs/stories/MediaSceneSwitcher.stories.js +2 -0
- package/dist/cjs/stories/MediaSceneSwitcher.stories.js.map +7 -0
- package/dist/cjs/stories/MemberEquity.stories.d.ts +9 -0
- package/dist/cjs/stories/MemberEquity.stories.js +31 -0
- package/dist/cjs/stories/MemberEquity.stories.js.map +7 -0
- package/dist/cjs/stories/MultiLayoutGraphicBlock.stories.d.ts +9 -0
- package/dist/cjs/stories/MultiLayoutGraphicBlock.stories.js +2 -0
- package/dist/cjs/stories/MultiLayoutGraphicBlock.stories.js.map +7 -0
- package/dist/cjs/stories/ProductNav.stories.d.ts +55 -0
- package/dist/cjs/stories/ProductNav.stories.js +2 -0
- package/dist/cjs/stories/ProductNav.stories.js.map +7 -0
- package/dist/cjs/stories/ThreeDCarousel.stories.d.ts +27 -0
- package/dist/cjs/stories/ThreeDCarousel.stories.js +118 -0
- package/dist/cjs/stories/ThreeDCarousel.stories.js.map +7 -0
- package/dist/cjs/stories/accordionCards.stories.d.ts +38 -0
- package/dist/cjs/stories/accordionCards.stories.js +2 -0
- package/dist/cjs/stories/accordionCards.stories.js.map +7 -0
- package/dist/cjs/stories/alert.stories.d.ts +27 -0
- package/dist/cjs/stories/alert.stories.js +2 -0
- package/dist/cjs/stories/alert.stories.js.map +7 -0
- package/dist/cjs/stories/avatar.stories.d.ts +39 -0
- package/dist/cjs/stories/avatar.stories.js +2 -0
- package/dist/cjs/stories/avatar.stories.js.map +7 -0
- package/dist/cjs/stories/badge.stories.d.ts +31 -0
- package/dist/cjs/stories/badge.stories.js +2 -0
- package/dist/cjs/stories/badge.stories.js.map +7 -0
- package/dist/cjs/stories/bizTabs.stories.d.ts +7 -0
- package/dist/cjs/stories/bizTabs.stories.js +2 -0
- package/dist/cjs/stories/bizTabs.stories.js.map +7 -0
- package/dist/cjs/stories/board.stories.d.ts +6 -0
- package/dist/cjs/stories/board.stories.js +2 -0
- package/dist/cjs/stories/board.stories.js.map +7 -0
- package/dist/cjs/stories/brandEquity.stories.d.ts +16 -0
- package/dist/cjs/stories/brandEquity.stories.js +2 -0
- package/dist/cjs/stories/brandEquity.stories.js.map +7 -0
- package/dist/cjs/stories/brandStrip.stories.d.ts +12 -0
- package/dist/cjs/stories/brandStrip.stories.js +2 -0
- package/dist/cjs/stories/brandStrip.stories.js.map +7 -0
- package/dist/cjs/stories/button.stories.d.ts +56 -0
- package/dist/cjs/stories/button.stories.js +2 -0
- package/dist/cjs/stories/button.stories.js.map +7 -0
- package/dist/cjs/stories/card.stories.d.ts +27 -0
- package/dist/cjs/stories/card.stories.js +2 -0
- package/dist/cjs/stories/card.stories.js.map +7 -0
- package/dist/cjs/stories/carousel.stories.d.ts +8 -0
- package/dist/cjs/stories/carousel.stories.js +2 -0
- package/dist/cjs/stories/carousel.stories.js.map +7 -0
- package/dist/cjs/stories/category.stories.d.ts +17 -0
- package/dist/cjs/stories/category.stories.js +2 -0
- package/dist/cjs/stories/category.stories.js.map +7 -0
- package/dist/cjs/stories/checkbox.stories.d.ts +46 -0
- package/dist/cjs/stories/checkbox.stories.js +2 -0
- package/dist/cjs/stories/checkbox.stories.js.map +7 -0
- package/dist/cjs/stories/container.stories.d.ts +28 -0
- package/dist/cjs/stories/container.stories.js +15 -0
- package/dist/cjs/stories/container.stories.js.map +7 -0
- package/dist/cjs/stories/cpnBanner.stories.d.ts +14 -0
- package/dist/cjs/stories/cpnBanner.stories.js +2 -0
- package/dist/cjs/stories/cpnBanner.stories.js.map +7 -0
- package/dist/cjs/stories/cpnCountdown.stories.d.ts +12 -0
- package/dist/cjs/stories/cpnCountdown.stories.js +2 -0
- package/dist/cjs/stories/cpnCountdown.stories.js.map +7 -0
- package/dist/cjs/stories/cpnNavigation.stories.d.ts +14 -0
- package/dist/cjs/stories/cpnNavigation.stories.js +2 -0
- package/dist/cjs/stories/cpnNavigation.stories.js.map +7 -0
- package/dist/cjs/stories/cpnProductcard.stories.d.ts +14 -0
- package/dist/cjs/stories/cpnProductcard.stories.js +2 -0
- package/dist/cjs/stories/cpnProductcard.stories.js.map +7 -0
- package/dist/cjs/stories/cpnTitle.stories.d.ts +14 -0
- package/dist/cjs/stories/cpnTitle.stories.js +2 -0
- package/dist/cjs/stories/cpnTitle.stories.js.map +7 -0
- package/dist/cjs/stories/creativeModule.stories.d.ts +19 -0
- package/dist/cjs/stories/creativeModule.stories.js +2 -0
- package/dist/cjs/stories/creativeModule.stories.js.map +7 -0
- package/dist/cjs/stories/dialog.stories.d.ts +20 -0
- package/dist/cjs/stories/dialog.stories.js +2 -0
- package/dist/cjs/stories/dialog.stories.js.map +7 -0
- package/dist/cjs/stories/drawer.stories.d.ts +20 -0
- package/dist/cjs/stories/drawer.stories.js +2 -0
- package/dist/cjs/stories/drawer.stories.js.map +7 -0
- package/dist/cjs/stories/drop-down.stories.d.ts +16 -0
- package/dist/cjs/stories/drop-down.stories.js +2 -0
- package/dist/cjs/stories/drop-down.stories.js.map +7 -0
- package/dist/cjs/stories/evaluate.stories.d.ts +16 -0
- package/dist/cjs/stories/evaluate.stories.js +2 -0
- package/dist/cjs/stories/evaluate.stories.js.map +7 -0
- package/dist/cjs/stories/faq.stories.d.ts +21 -0
- package/dist/cjs/stories/faq.stories.js +2 -0
- package/dist/cjs/stories/faq.stories.js.map +7 -0
- package/dist/cjs/stories/featureCards.stories.d.ts +30 -0
- package/dist/cjs/stories/featureCards.stories.js +61 -0
- package/dist/cjs/stories/featureCards.stories.js.map +7 -0
- package/dist/cjs/stories/featureShowcase.stories.d.ts +29 -0
- package/dist/cjs/stories/featureShowcase.stories.js +44 -0
- package/dist/cjs/stories/featureShowcase.stories.js.map +7 -0
- package/dist/cjs/stories/graphic.stories.d.ts +64 -0
- package/dist/cjs/stories/graphic.stories.js +2 -0
- package/dist/cjs/stories/graphic.stories.js.map +7 -0
- package/dist/cjs/stories/graphicAttractionBlock.stories.d.ts +6 -0
- package/dist/cjs/stories/graphicAttractionBlock.stories.js +2 -0
- package/dist/cjs/stories/graphicAttractionBlock.stories.js.map +7 -0
- package/dist/cjs/stories/grid.stories.d.ts +22 -0
- package/dist/cjs/stories/grid.stories.js +13 -0
- package/dist/cjs/stories/grid.stories.js.map +7 -0
- package/dist/cjs/stories/heading.stories.d.ts +84 -0
- package/dist/cjs/stories/heading.stories.js +15 -0
- package/dist/cjs/stories/heading.stories.js.map +7 -0
- package/dist/cjs/stories/imageTextFeature.stories.d.ts +28 -0
- package/dist/cjs/stories/imageTextFeature.stories.js +50 -0
- package/dist/cjs/stories/imageTextFeature.stories.js.map +7 -0
- package/dist/cjs/stories/imageWithText.stories.d.ts +51 -0
- package/dist/cjs/stories/imageWithText.stories.js +84 -0
- package/dist/cjs/stories/imageWithText.stories.js.map +7 -0
- package/dist/cjs/stories/input-number.stories.d.ts +39 -0
- package/dist/cjs/stories/input-number.stories.js +2 -0
- package/dist/cjs/stories/input-number.stories.js.map +7 -0
- package/dist/cjs/stories/input.stories.d.ts +35 -0
- package/dist/cjs/stories/input.stories.js +2 -0
- package/dist/cjs/stories/input.stories.js.map +7 -0
- package/dist/cjs/stories/ksp.stories.d.ts +63 -0
- package/dist/cjs/stories/ksp.stories.js +128 -0
- package/dist/cjs/stories/ksp.stories.js.map +7 -0
- package/dist/cjs/stories/link.stories.d.ts +69 -0
- package/dist/cjs/stories/link.stories.js +2 -0
- package/dist/cjs/stories/link.stories.js.map +7 -0
- package/dist/cjs/stories/marquee.stories.d.ts +30 -0
- package/dist/cjs/stories/marquee.stories.js +2 -0
- package/dist/cjs/stories/marquee.stories.js.map +7 -0
- package/dist/cjs/stories/mediaplayerBase.stories.d.ts +6 -0
- package/dist/cjs/stories/mediaplayerBase.stories.js +2 -0
- package/dist/cjs/stories/mediaplayerBase.stories.js.map +7 -0
- package/dist/cjs/stories/mediaplayerMulti.stories.d.ts +16 -0
- package/dist/cjs/stories/mediaplayerMulti.stories.js +2 -0
- package/dist/cjs/stories/mediaplayerMulti.stories.js.map +7 -0
- package/dist/cjs/stories/picture.stories.d.ts +23 -0
- package/dist/cjs/stories/picture.stories.js +9 -0
- package/dist/cjs/stories/picture.stories.js.map +7 -0
- package/dist/cjs/stories/popover.stories.d.ts +17 -0
- package/dist/cjs/stories/popover.stories.js +2 -0
- package/dist/cjs/stories/popover.stories.js.map +7 -0
- package/dist/cjs/stories/productCompare.stories.d.ts +54 -0
- package/dist/cjs/stories/productCompare.stories.js +54 -0
- package/dist/cjs/stories/productCompare.stories.js.map +7 -0
- package/dist/cjs/stories/productHero.stories.d.ts +29 -0
- package/dist/cjs/stories/productHero.stories.js +50 -0
- package/dist/cjs/stories/productHero.stories.js.map +7 -0
- package/dist/cjs/stories/radio.stories.d.ts +39 -0
- package/dist/cjs/stories/radio.stories.js +2 -0
- package/dist/cjs/stories/radio.stories.js.map +7 -0
- package/dist/cjs/stories/shelfDisplay.stories.d.ts +16 -0
- package/dist/cjs/stories/shelfDisplay.stories.js +2 -0
- package/dist/cjs/stories/shelfDisplay.stories.js.map +7 -0
- package/dist/cjs/stories/skeleton.stories.d.ts +20 -0
- package/dist/cjs/stories/skeleton.stories.js +2 -0
- package/dist/cjs/stories/skeleton.stories.js.map +7 -0
- package/dist/cjs/stories/slogan.stories.d.ts +20 -0
- package/dist/cjs/stories/slogan.stories.js +6 -0
- package/dist/cjs/stories/slogan.stories.js.map +7 -0
- package/dist/cjs/stories/specs.stories.d.ts +13 -0
- package/dist/cjs/stories/specs.stories.js +57 -0
- package/dist/cjs/stories/specs.stories.js.map +7 -0
- package/dist/cjs/stories/specsComparison.stories.d.ts +28 -0
- package/dist/cjs/stories/specsComparison.stories.js +105 -0
- package/dist/cjs/stories/specsComparison.stories.js.map +7 -0
- package/dist/cjs/stories/tabWithImage.stories.d.ts +28 -0
- package/dist/cjs/stories/tabWithImage.stories.js +53 -0
- package/dist/cjs/stories/tabWithImage.stories.js.map +7 -0
- package/dist/cjs/stories/tabs.stories.d.ts +373 -0
- package/dist/cjs/stories/tabs.stories.js +2 -0
- package/dist/cjs/stories/tabs.stories.js.map +7 -0
- package/dist/cjs/stories/tabsWithMedia.stories.d.ts +28 -0
- package/dist/cjs/stories/tabsWithMedia.stories.js +68 -0
- package/dist/cjs/stories/tabsWithMedia.stories.js.map +7 -0
- package/dist/cjs/stories/text.stories.d.ts +86 -0
- package/dist/cjs/stories/text.stories.js +21 -0
- package/dist/cjs/stories/text.stories.js.map +7 -0
- package/dist/cjs/stories/videoFeature.stories.d.ts +29 -0
- package/dist/cjs/stories/videoFeature.stories.js +56 -0
- package/dist/cjs/stories/videoFeature.stories.js.map +7 -0
- package/dist/cjs/stories/whychoose.stories.d.ts +21 -0
- package/dist/cjs/stories/whychoose.stories.js +2 -0
- package/dist/cjs/stories/whychoose.stories.js.map +7 -0
- package/dist/cjs/types/props.d.ts +3 -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 +3 -3
- package/dist/esm/biz-components/AiuiProvider/index.d.ts +0 -7
- package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
- package/dist/esm/biz-components/AiuiProvider/index.js.map +2 -2
- package/dist/esm/biz-components/AplusDesc/index.d.ts +3 -3
- package/dist/esm/biz-components/BrandEquity/BrandEquity.d.ts +3 -3
- package/dist/esm/biz-components/BrandEquity/BrandEquity.js +1 -1
- package/dist/esm/biz-components/BrandEquity/BrandEquity.js.map +2 -2
- package/dist/esm/biz-components/BrandEquity/types.d.ts +0 -1
- package/dist/esm/biz-components/Category/index.d.ts +3 -3
- package/dist/esm/biz-components/CreativeModule/index.d.ts +3 -3
- package/dist/esm/biz-components/DownLoad/index.d.ts +3 -3
- package/dist/esm/biz-components/Evaluate/index.d.ts +3 -3
- package/dist/esm/biz-components/Evaluate/index.js +1 -1
- package/dist/esm/biz-components/Evaluate/index.js.map +2 -2
- package/dist/esm/biz-components/Faq/Faq.d.ts +3 -3
- package/dist/esm/biz-components/FeatureCards/FeatureCards.d.ts +3 -3
- package/dist/esm/biz-components/FeatureShowcase/FeatureShowcase.d.ts +3 -3
- package/dist/esm/biz-components/Features/index.d.ts +3 -3
- package/dist/esm/biz-components/FootCharger/index.d.ts +3 -3
- package/dist/esm/biz-components/FooterNavigation/index.d.ts +3 -3
- package/dist/esm/biz-components/GiftBox/index.d.ts +3 -3
- package/dist/esm/biz-components/Graphic/index.d.ts +3 -3
- package/dist/esm/biz-components/GraphicAttractionBlock/index.d.ts +3 -3
- package/dist/esm/biz-components/GraphicMore/index.d.ts +3 -3
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.d.ts +3 -3
- package/dist/esm/biz-components/HeaderNavigation/index.d.ts +3 -3
- package/dist/esm/biz-components/HeroBanner/Countdown.js +1 -1
- package/dist/esm/biz-components/HeroBanner/Countdown.js.map +2 -2
- package/dist/esm/biz-components/HeroBanner/HeroBanner.d.ts +3 -6
- 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/types.d.ts +0 -4
- package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.d.ts +3 -3
- package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.js +1 -1
- package/dist/esm/biz-components/ImageTextFeature/ImageTextFeature.js.map +3 -3
- package/dist/esm/biz-components/ImageTextFeature/types.d.ts +0 -1
- package/dist/esm/biz-components/ImageWithText/ImageWithText.d.ts +3 -3
- package/dist/esm/biz-components/Ksp/index.d.ts +3 -3
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.d.ts +4 -4
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +3 -3
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +3 -3
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.d.ts +3 -3
- package/dist/esm/biz-components/Marquee/Marquee.d.ts +3 -3
- 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/MarqueeReview/index.d.ts +3 -3
- package/dist/esm/biz-components/MediaPlayerBase/index.d.ts +3 -3
- package/dist/esm/biz-components/MediaPlayerMulti/index.d.ts +3 -3
- package/dist/esm/biz-components/MediaPlayerSticky/index.d.ts +4 -4
- package/dist/esm/biz-components/MediaPlayerSticky/types.d.ts +0 -1
- package/dist/esm/biz-components/MediaSceneSwitcher/MediaSceneSwitcher.d.ts +3 -3
- package/dist/esm/biz-components/MemberEquity/index.d.ts +3 -3
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.d.ts +3 -3
- package/dist/esm/biz-components/ProductCompare/index.d.ts +3 -3
- package/dist/esm/biz-components/ProductHero/ProductHero.d.ts +3 -3
- package/dist/esm/biz-components/ProductNav/ProductNav.d.ts +3 -3
- package/dist/esm/biz-components/SelectStore/index.d.ts +3 -3
- package/dist/esm/biz-components/ShelfDisplay/index.d.ts +3 -3
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.d.ts +11 -0
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js.map +3 -3
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +5 -5
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +3 -3
- package/dist/esm/biz-components/Slogan/index.d.ts +3 -3
- package/dist/esm/biz-components/Spacer/index.d.ts +3 -3
- package/dist/esm/biz-components/Specs/index.d.ts +3 -3
- package/dist/esm/biz-components/SpecsComparison/SpecsComparison.d.ts +3 -3
- package/dist/esm/biz-components/TabWithImage/TabWithImage.d.ts +3 -3
- package/dist/esm/biz-components/Tabs/Tabs.d.ts +3 -3
- 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 +0 -9
- package/dist/esm/biz-components/TabsGroup/index.d.ts +3 -3
- package/dist/esm/biz-components/TabsWithMedia/TabsWithMedia.d.ts +3 -3
- package/dist/esm/biz-components/ThreeDCarousel/ThreeDCarousel.d.ts +3 -3
- package/dist/esm/biz-components/Title/index.d.ts +3 -3
- 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 +0 -55
- package/dist/esm/biz-components/VideoFeature/VideoFeature.d.ts +3 -3
- package/dist/esm/biz-components/WhyChoose/WhyChoose.d.ts +3 -3
- package/dist/esm/biz-components/index.d.ts +0 -32
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +3 -3
- package/dist/esm/components/badge.d.ts +2 -5
- package/dist/esm/components/badge.js +1 -1
- package/dist/esm/components/badge.js.map +3 -3
- package/dist/esm/components/index.d.ts +0 -2
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +2 -2
- package/dist/esm/components/tabs.d.ts +1 -2
- package/dist/esm/components/tabs.js +1 -1
- package/dist/esm/components/tabs.js.map +2 -2
- package/dist/esm/helpers/index.d.ts +0 -1
- package/dist/esm/helpers/index.js +1 -1
- package/dist/esm/helpers/index.js.map +3 -3
- package/dist/esm/shared/Styles.d.ts +4 -5
- package/dist/esm/shared/Styles.js +1 -1
- package/dist/esm/shared/Styles.js.map +3 -3
- package/dist/esm/stories/HeroBanner.stories.d.ts +28 -0
- package/dist/esm/stories/HeroBanner.stories.js +11 -0
- package/dist/esm/stories/HeroBanner.stories.js.map +7 -0
- package/dist/esm/stories/InlineVideo.stories.d.ts +37 -0
- package/dist/esm/stories/InlineVideo.stories.js +164 -0
- package/dist/esm/stories/InlineVideo.stories.js.map +7 -0
- package/dist/esm/stories/MarqueeReview.stories.d.ts +72 -0
- package/dist/esm/stories/MarqueeReview.stories.js +19 -0
- package/dist/esm/stories/MarqueeReview.stories.js.map +7 -0
- package/dist/esm/stories/MediaSceneSwitcher.stories.d.ts +47 -0
- package/dist/esm/stories/MediaSceneSwitcher.stories.js +2 -0
- package/dist/esm/stories/MediaSceneSwitcher.stories.js.map +7 -0
- package/dist/esm/stories/MemberEquity.stories.d.ts +9 -0
- package/dist/esm/stories/MemberEquity.stories.js +31 -0
- package/dist/esm/stories/MemberEquity.stories.js.map +7 -0
- package/dist/esm/stories/MultiLayoutGraphicBlock.stories.d.ts +9 -0
- package/dist/esm/stories/MultiLayoutGraphicBlock.stories.js +2 -0
- package/dist/esm/stories/MultiLayoutGraphicBlock.stories.js.map +7 -0
- package/dist/esm/stories/ProductNav.stories.d.ts +55 -0
- package/dist/esm/stories/ProductNav.stories.js +2 -0
- package/dist/esm/stories/ProductNav.stories.js.map +7 -0
- package/dist/esm/stories/ThreeDCarousel.stories.d.ts +27 -0
- package/dist/esm/stories/ThreeDCarousel.stories.js +118 -0
- package/dist/esm/stories/ThreeDCarousel.stories.js.map +7 -0
- package/dist/esm/stories/accordionCards.stories.d.ts +38 -0
- package/dist/esm/stories/accordionCards.stories.js +2 -0
- package/dist/esm/stories/accordionCards.stories.js.map +7 -0
- package/dist/esm/stories/alert.stories.d.ts +27 -0
- package/dist/esm/stories/alert.stories.js +2 -0
- package/dist/esm/stories/alert.stories.js.map +7 -0
- package/dist/esm/stories/avatar.stories.d.ts +39 -0
- package/dist/esm/stories/avatar.stories.js +2 -0
- package/dist/esm/stories/avatar.stories.js.map +7 -0
- package/dist/esm/stories/badge.stories.d.ts +31 -0
- package/dist/esm/stories/badge.stories.js +2 -0
- package/dist/esm/stories/badge.stories.js.map +7 -0
- package/dist/esm/stories/bizTabs.stories.d.ts +7 -0
- package/dist/esm/stories/bizTabs.stories.js +2 -0
- package/dist/esm/stories/bizTabs.stories.js.map +7 -0
- package/dist/esm/stories/board.stories.d.ts +6 -0
- package/dist/esm/stories/board.stories.js +2 -0
- package/dist/esm/stories/board.stories.js.map +7 -0
- package/dist/esm/stories/brandEquity.stories.d.ts +16 -0
- package/dist/esm/stories/brandEquity.stories.js +2 -0
- package/dist/esm/stories/brandEquity.stories.js.map +7 -0
- package/dist/esm/stories/brandStrip.stories.d.ts +12 -0
- package/dist/esm/stories/brandStrip.stories.js +2 -0
- package/dist/esm/stories/brandStrip.stories.js.map +7 -0
- package/dist/esm/stories/button.stories.d.ts +56 -0
- package/dist/esm/stories/button.stories.js +2 -0
- package/dist/esm/stories/button.stories.js.map +7 -0
- package/dist/esm/stories/card.stories.d.ts +27 -0
- package/dist/esm/stories/card.stories.js +2 -0
- package/dist/esm/stories/card.stories.js.map +7 -0
- package/dist/esm/stories/carousel.stories.d.ts +8 -0
- package/dist/esm/stories/carousel.stories.js +2 -0
- package/dist/esm/stories/carousel.stories.js.map +7 -0
- package/dist/esm/stories/category.stories.d.ts +17 -0
- package/dist/esm/stories/category.stories.js +2 -0
- package/dist/esm/stories/category.stories.js.map +7 -0
- package/dist/esm/stories/checkbox.stories.d.ts +46 -0
- package/dist/esm/stories/checkbox.stories.js +2 -0
- package/dist/esm/stories/checkbox.stories.js.map +7 -0
- package/dist/esm/stories/container.stories.d.ts +28 -0
- package/dist/esm/stories/container.stories.js +15 -0
- package/dist/esm/stories/container.stories.js.map +7 -0
- package/dist/esm/stories/cpnBanner.stories.d.ts +14 -0
- package/dist/esm/stories/cpnBanner.stories.js +2 -0
- package/dist/esm/stories/cpnBanner.stories.js.map +7 -0
- package/dist/esm/stories/cpnCountdown.stories.d.ts +12 -0
- package/dist/esm/stories/cpnCountdown.stories.js +2 -0
- package/dist/esm/stories/cpnCountdown.stories.js.map +7 -0
- package/dist/esm/stories/cpnNavigation.stories.d.ts +14 -0
- package/dist/esm/stories/cpnNavigation.stories.js +2 -0
- package/dist/esm/stories/cpnNavigation.stories.js.map +7 -0
- package/dist/esm/stories/cpnProductcard.stories.d.ts +14 -0
- package/dist/esm/stories/cpnProductcard.stories.js +2 -0
- package/dist/esm/stories/cpnProductcard.stories.js.map +7 -0
- package/dist/esm/stories/cpnTitle.stories.d.ts +14 -0
- package/dist/esm/stories/cpnTitle.stories.js +2 -0
- package/dist/esm/stories/cpnTitle.stories.js.map +7 -0
- package/dist/esm/stories/creativeModule.stories.d.ts +19 -0
- package/dist/esm/stories/creativeModule.stories.js +2 -0
- package/dist/esm/stories/creativeModule.stories.js.map +7 -0
- package/dist/esm/stories/dialog.stories.d.ts +20 -0
- package/dist/esm/stories/dialog.stories.js +2 -0
- package/dist/esm/stories/dialog.stories.js.map +7 -0
- package/dist/esm/stories/drawer.stories.d.ts +20 -0
- package/dist/esm/stories/drawer.stories.js +2 -0
- package/dist/esm/stories/drawer.stories.js.map +7 -0
- package/dist/esm/stories/drop-down.stories.d.ts +16 -0
- package/dist/esm/stories/drop-down.stories.js +2 -0
- package/dist/esm/stories/drop-down.stories.js.map +7 -0
- package/dist/esm/stories/evaluate.stories.d.ts +16 -0
- package/dist/esm/stories/evaluate.stories.js +2 -0
- package/dist/esm/stories/evaluate.stories.js.map +7 -0
- package/dist/esm/stories/faq.stories.d.ts +21 -0
- package/dist/esm/stories/faq.stories.js +2 -0
- package/dist/esm/stories/faq.stories.js.map +7 -0
- package/dist/esm/stories/featureCards.stories.d.ts +30 -0
- package/dist/esm/stories/featureCards.stories.js +61 -0
- package/dist/esm/stories/featureCards.stories.js.map +7 -0
- package/dist/esm/stories/featureShowcase.stories.d.ts +29 -0
- package/dist/esm/stories/featureShowcase.stories.js +44 -0
- package/dist/esm/stories/featureShowcase.stories.js.map +7 -0
- package/dist/esm/stories/graphic.stories.d.ts +64 -0
- package/dist/esm/stories/graphic.stories.js +2 -0
- package/dist/esm/stories/graphic.stories.js.map +7 -0
- package/dist/esm/stories/graphicAttractionBlock.stories.d.ts +6 -0
- package/dist/esm/stories/graphicAttractionBlock.stories.js +2 -0
- package/dist/esm/stories/graphicAttractionBlock.stories.js.map +7 -0
- package/dist/esm/stories/grid.stories.d.ts +22 -0
- package/dist/esm/stories/grid.stories.js +13 -0
- package/dist/esm/stories/grid.stories.js.map +7 -0
- package/dist/esm/stories/heading.stories.d.ts +84 -0
- package/dist/esm/stories/heading.stories.js +15 -0
- package/dist/esm/stories/heading.stories.js.map +7 -0
- package/dist/esm/stories/imageTextFeature.stories.d.ts +28 -0
- package/dist/esm/stories/imageTextFeature.stories.js +50 -0
- package/dist/esm/stories/imageTextFeature.stories.js.map +7 -0
- package/dist/esm/stories/imageWithText.stories.d.ts +51 -0
- package/dist/esm/stories/imageWithText.stories.js +84 -0
- package/dist/esm/stories/imageWithText.stories.js.map +7 -0
- package/dist/esm/stories/input-number.stories.d.ts +39 -0
- package/dist/esm/stories/input-number.stories.js +2 -0
- package/dist/esm/stories/input-number.stories.js.map +7 -0
- package/dist/esm/stories/input.stories.d.ts +35 -0
- package/dist/esm/stories/input.stories.js +2 -0
- package/dist/esm/stories/input.stories.js.map +7 -0
- package/dist/esm/stories/ksp.stories.d.ts +63 -0
- package/dist/esm/stories/ksp.stories.js +128 -0
- package/dist/esm/stories/ksp.stories.js.map +7 -0
- package/dist/esm/stories/link.stories.d.ts +69 -0
- package/dist/esm/stories/link.stories.js +2 -0
- package/dist/esm/stories/link.stories.js.map +7 -0
- package/dist/esm/stories/marquee.stories.d.ts +30 -0
- package/dist/esm/stories/marquee.stories.js +2 -0
- package/dist/esm/stories/marquee.stories.js.map +7 -0
- package/dist/esm/stories/mediaplayerBase.stories.d.ts +6 -0
- package/dist/esm/stories/mediaplayerBase.stories.js +2 -0
- package/dist/esm/stories/mediaplayerBase.stories.js.map +7 -0
- package/dist/esm/stories/mediaplayerMulti.stories.d.ts +16 -0
- package/dist/esm/stories/mediaplayerMulti.stories.js +2 -0
- package/dist/esm/stories/mediaplayerMulti.stories.js.map +7 -0
- package/dist/esm/stories/picture.stories.d.ts +23 -0
- package/dist/esm/stories/picture.stories.js +9 -0
- package/dist/esm/stories/picture.stories.js.map +7 -0
- package/dist/esm/stories/popover.stories.d.ts +17 -0
- package/dist/esm/stories/popover.stories.js +2 -0
- package/dist/esm/stories/popover.stories.js.map +7 -0
- package/dist/esm/stories/productCompare.stories.d.ts +54 -0
- package/dist/esm/stories/productCompare.stories.js +54 -0
- package/dist/esm/stories/productCompare.stories.js.map +7 -0
- package/dist/esm/stories/productHero.stories.d.ts +29 -0
- package/dist/esm/stories/productHero.stories.js +50 -0
- package/dist/esm/stories/productHero.stories.js.map +7 -0
- package/dist/esm/stories/radio.stories.d.ts +39 -0
- package/dist/esm/stories/radio.stories.js +2 -0
- package/dist/esm/stories/radio.stories.js.map +7 -0
- package/dist/esm/stories/shelfDisplay.stories.d.ts +16 -0
- package/dist/esm/stories/shelfDisplay.stories.js +2 -0
- package/dist/esm/stories/shelfDisplay.stories.js.map +7 -0
- package/dist/esm/stories/skeleton.stories.d.ts +20 -0
- package/dist/esm/stories/skeleton.stories.js +2 -0
- package/dist/esm/stories/skeleton.stories.js.map +7 -0
- package/dist/esm/stories/slogan.stories.d.ts +20 -0
- package/dist/esm/stories/slogan.stories.js +6 -0
- package/dist/esm/stories/slogan.stories.js.map +7 -0
- package/dist/esm/stories/specs.stories.d.ts +13 -0
- package/dist/esm/stories/specs.stories.js +57 -0
- package/dist/esm/stories/specs.stories.js.map +7 -0
- package/dist/esm/stories/specsComparison.stories.d.ts +28 -0
- package/dist/esm/stories/specsComparison.stories.js +105 -0
- package/dist/esm/stories/specsComparison.stories.js.map +7 -0
- package/dist/esm/stories/tabWithImage.stories.d.ts +28 -0
- package/dist/esm/stories/tabWithImage.stories.js +53 -0
- package/dist/esm/stories/tabWithImage.stories.js.map +7 -0
- package/dist/esm/stories/tabs.stories.d.ts +373 -0
- package/dist/esm/stories/tabs.stories.js +2 -0
- package/dist/esm/stories/tabs.stories.js.map +7 -0
- package/dist/esm/stories/tabsWithMedia.stories.d.ts +28 -0
- package/dist/esm/stories/tabsWithMedia.stories.js +68 -0
- package/dist/esm/stories/tabsWithMedia.stories.js.map +7 -0
- package/dist/esm/stories/text.stories.d.ts +86 -0
- package/dist/esm/stories/text.stories.js +21 -0
- package/dist/esm/stories/text.stories.js.map +7 -0
- package/dist/esm/stories/videoFeature.stories.d.ts +29 -0
- package/dist/esm/stories/videoFeature.stories.js +56 -0
- package/dist/esm/stories/videoFeature.stories.js.map +7 -0
- package/dist/esm/stories/whychoose.stories.d.ts +21 -0
- package/dist/esm/stories/whychoose.stories.js +2 -0
- package/dist/esm/stories/whychoose.stories.js.map +7 -0
- package/dist/esm/types/props.d.ts +3 -0
- package/dist/tokens/base.css +3 -4
- package/dist/tokens/eufy.css +0 -1
- package/dist/tokens/soundcore.css +3 -4
- package/package.json +3 -8
- package/style.css +118 -4968
- package/tailwind.config.js +2 -19
- package/dist/cjs/biz-components/ActiveShelf/index.d.ts +0 -174
- package/dist/cjs/biz-components/ActiveShelf/index.js +0 -2
- package/dist/cjs/biz-components/ActiveShelf/index.js.map +0 -7
- package/dist/cjs/biz-components/ActiveShelf/types.d.ts +0 -89
- package/dist/cjs/biz-components/ActiveShelf/types.js +0 -2
- package/dist/cjs/biz-components/ActiveShelf/types.js.map +0 -7
- package/dist/cjs/biz-components/AnchorNavigation/index.d.ts +0 -42
- package/dist/cjs/biz-components/AnchorNavigation/index.js +0 -2
- package/dist/cjs/biz-components/AnchorNavigation/index.js.map +0 -7
- package/dist/cjs/biz-components/AnchorNavigation/useAnchorPosition.d.ts +0 -2
- package/dist/cjs/biz-components/AnchorNavigation/useAnchorPosition.js +0 -2
- package/dist/cjs/biz-components/AnchorNavigation/useAnchorPosition.js.map +0 -7
- package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.d.ts +0 -6
- package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js +0 -2
- package/dist/cjs/biz-components/BrandCardLink/BrandCardLink.js.map +0 -7
- package/dist/cjs/biz-components/BrandCardLink/index.d.ts +0 -1
- package/dist/cjs/biz-components/BrandCardLink/index.js +0 -2
- package/dist/cjs/biz-components/BrandCardLink/index.js.map +0 -7
- package/dist/cjs/biz-components/BrandCardLink/types.d.ts +0 -19
- package/dist/cjs/biz-components/BrandCardLink/types.js +0 -2
- package/dist/cjs/biz-components/BrandCardLink/types.js.map +0 -7
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +0 -74
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js +0 -2
- package/dist/cjs/biz-components/BuyOneGetOneShelf/ProductCard.js.map +0 -7
- package/dist/cjs/biz-components/BuyOneGetOneShelf/hooks/useBogoDataTransform.d.ts +0 -36
- package/dist/cjs/biz-components/BuyOneGetOneShelf/hooks/useBogoDataTransform.js +0 -2
- package/dist/cjs/biz-components/BuyOneGetOneShelf/hooks/useBogoDataTransform.js.map +0 -7
- package/dist/cjs/biz-components/BuyOneGetOneShelf/index.d.ts +0 -193
- package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js +0 -2
- package/dist/cjs/biz-components/BuyOneGetOneShelf/index.js.map +0 -7
- package/dist/cjs/biz-components/EventSchedule/index.d.ts +0 -63
- package/dist/cjs/biz-components/EventSchedule/index.js +0 -2
- package/dist/cjs/biz-components/EventSchedule/index.js.map +0 -7
- package/dist/cjs/biz-components/IPRedirect/RegionBanner.d.ts +0 -37
- package/dist/cjs/biz-components/IPRedirect/RegionBanner.js +0 -60
- package/dist/cjs/biz-components/IPRedirect/RegionBanner.js.map +0 -7
- package/dist/cjs/biz-components/IPRedirect/RegionSelectorModal.d.ts +0 -47
- package/dist/cjs/biz-components/IPRedirect/RegionSelectorModal.js +0 -33
- package/dist/cjs/biz-components/IPRedirect/RegionSelectorModal.js.map +0 -7
- package/dist/cjs/biz-components/IPRedirect/index.d.ts +0 -9
- package/dist/cjs/biz-components/IPRedirect/index.js +0 -2
- package/dist/cjs/biz-components/IPRedirect/index.js.map +0 -7
- package/dist/cjs/biz-components/IPRedirect/type.d.ts +0 -36
- package/dist/cjs/biz-components/IPRedirect/type.js +0 -2
- package/dist/cjs/biz-components/IPRedirect/type.js.map +0 -7
- package/dist/cjs/biz-components/IPRedirect/useAutoRedirect.d.ts +0 -66
- package/dist/cjs/biz-components/IPRedirect/useAutoRedirect.js +0 -2
- package/dist/cjs/biz-components/IPRedirect/useAutoRedirect.js.map +0 -7
- package/dist/cjs/biz-components/IPRedirect/useDetectedRegionRedirect.d.ts +0 -51
- package/dist/cjs/biz-components/IPRedirect/useDetectedRegionRedirect.js +0 -2
- package/dist/cjs/biz-components/IPRedirect/useDetectedRegionRedirect.js.map +0 -7
- package/dist/cjs/biz-components/IPRedirect/useIPRedirect.d.ts +0 -42
- package/dist/cjs/biz-components/IPRedirect/useIPRedirect.js +0 -2
- package/dist/cjs/biz-components/IPRedirect/useIPRedirect.js.map +0 -7
- package/dist/cjs/biz-components/IPRedirect/useRedirectBanner.d.ts +0 -108
- package/dist/cjs/biz-components/IPRedirect/useRedirectBanner.js +0 -2
- package/dist/cjs/biz-components/IPRedirect/useRedirectBanner.js.map +0 -7
- package/dist/cjs/biz-components/IPRedirect/useRegionRedirectManager.d.ts +0 -152
- package/dist/cjs/biz-components/IPRedirect/useRegionRedirectManager.js +0 -2
- package/dist/cjs/biz-components/IPRedirect/useRegionRedirectManager.js.map +0 -7
- package/dist/cjs/biz-components/IPRedirect/useSavedRegionRedirect.d.ts +0 -51
- package/dist/cjs/biz-components/IPRedirect/useSavedRegionRedirect.js +0 -2
- package/dist/cjs/biz-components/IPRedirect/useSavedRegionRedirect.js.map +0 -7
- package/dist/cjs/biz-components/IPRedirect/utils.d.ts +0 -222
- package/dist/cjs/biz-components/IPRedirect/utils.js +0 -2
- package/dist/cjs/biz-components/IPRedirect/utils.js.map +0 -7
- package/dist/cjs/biz-components/ImageOverlayShelf/index.d.ts +0 -114
- package/dist/cjs/biz-components/ImageOverlayShelf/index.js +0 -2
- package/dist/cjs/biz-components/ImageOverlayShelf/index.js.map +0 -7
- package/dist/cjs/biz-components/Media/index.d.ts +0 -32
- package/dist/cjs/biz-components/Media/index.js +0 -2
- package/dist/cjs/biz-components/Media/index.js.map +0 -7
- package/dist/cjs/biz-components/MediaShelf/index.d.ts +0 -231
- package/dist/cjs/biz-components/MediaShelf/index.js +0 -2
- package/dist/cjs/biz-components/MediaShelf/index.js.map +0 -7
- package/dist/cjs/biz-components/MediaShelf/types.d.ts +0 -37
- package/dist/cjs/biz-components/MediaShelf/types.js +0 -2
- package/dist/cjs/biz-components/MediaShelf/types.js.map +0 -7
- package/dist/cjs/biz-components/MiniCart/index.d.ts +0 -88
- package/dist/cjs/biz-components/MiniCart/index.js +0 -2
- package/dist/cjs/biz-components/MiniCart/index.js.map +0 -7
- package/dist/cjs/biz-components/PromotionalBar/index.d.ts +0 -49
- package/dist/cjs/biz-components/PromotionalBar/index.js +0 -2
- package/dist/cjs/biz-components/PromotionalBar/index.js.map +0 -7
- package/dist/cjs/biz-components/SecondaryBanner/index.d.ts +0 -69
- package/dist/cjs/biz-components/SecondaryBanner/index.js +0 -2
- package/dist/cjs/biz-components/SecondaryBanner/index.js.map +0 -7
- package/dist/cjs/biz-components/Title/Countdown.d.ts +0 -14
- package/dist/cjs/biz-components/Title/Countdown.js +0 -2
- package/dist/cjs/biz-components/Title/Countdown.js.map +0 -7
- package/dist/cjs/biz-components/WheelLottery/BaseModal.d.ts +0 -55
- package/dist/cjs/biz-components/WheelLottery/BaseModal.js +0 -12
- package/dist/cjs/biz-components/WheelLottery/BaseModal.js.map +0 -7
- package/dist/cjs/biz-components/WheelLottery/ChanceMethods.d.ts +0 -30
- package/dist/cjs/biz-components/WheelLottery/ChanceMethods.js +0 -2
- package/dist/cjs/biz-components/WheelLottery/ChanceMethods.js.map +0 -7
- package/dist/cjs/biz-components/WheelLottery/ErrorModal.d.ts +0 -42
- package/dist/cjs/biz-components/WheelLottery/ErrorModal.js +0 -2
- package/dist/cjs/biz-components/WheelLottery/ErrorModal.js.map +0 -7
- package/dist/cjs/biz-components/WheelLottery/MyRewardsModal.d.ts +0 -91
- package/dist/cjs/biz-components/WheelLottery/MyRewardsModal.js +0 -2
- package/dist/cjs/biz-components/WheelLottery/MyRewardsModal.js.map +0 -7
- package/dist/cjs/biz-components/WheelLottery/PrizePool.d.ts +0 -26
- package/dist/cjs/biz-components/WheelLottery/PrizePool.js +0 -2
- package/dist/cjs/biz-components/WheelLottery/PrizePool.js.map +0 -7
- package/dist/cjs/biz-components/WheelLottery/RulesModal.d.ts +0 -47
- package/dist/cjs/biz-components/WheelLottery/RulesModal.js +0 -2
- package/dist/cjs/biz-components/WheelLottery/RulesModal.js.map +0 -7
- package/dist/cjs/biz-components/WheelLottery/ShareModal.d.ts +0 -74
- package/dist/cjs/biz-components/WheelLottery/ShareModal.js +0 -2
- package/dist/cjs/biz-components/WheelLottery/ShareModal.js.map +0 -7
- package/dist/cjs/biz-components/WheelLottery/Wheel.d.ts +0 -27
- package/dist/cjs/biz-components/WheelLottery/Wheel.js +0 -2
- package/dist/cjs/biz-components/WheelLottery/Wheel.js.map +0 -7
- package/dist/cjs/biz-components/WheelLottery/WinnerModal.d.ts +0 -25
- package/dist/cjs/biz-components/WheelLottery/WinnerModal.js +0 -2
- package/dist/cjs/biz-components/WheelLottery/WinnerModal.js.map +0 -7
- package/dist/cjs/biz-components/WheelLottery/index.d.ts +0 -52
- package/dist/cjs/biz-components/WheelLottery/index.js +0 -2
- package/dist/cjs/biz-components/WheelLottery/index.js.map +0 -7
- package/dist/cjs/biz-components/WheelLottery/types.d.ts +0 -1219
- package/dist/cjs/biz-components/WheelLottery/types.js +0 -2
- package/dist/cjs/biz-components/WheelLottery/types.js.map +0 -7
- package/dist/cjs/components/paginator.d.ts +0 -12
- package/dist/cjs/components/paginator.js +0 -7
- package/dist/cjs/components/paginator.js.map +0 -7
- package/dist/cjs/components/progress.d.ts +0 -46
- package/dist/cjs/components/progress.js +0 -2
- package/dist/cjs/components/progress.js.map +0 -7
- package/dist/cjs/helpers/priceFormatting.d.ts +0 -11
- package/dist/cjs/helpers/priceFormatting.js +0 -2
- package/dist/cjs/helpers/priceFormatting.js.map +0 -7
- package/dist/cjs/hooks/index.d.ts +0 -2
- package/dist/cjs/hooks/index.js +0 -2
- package/dist/cjs/hooks/index.js.map +0 -7
- package/dist/cjs/hooks/useCoupon.d.ts +0 -111
- package/dist/cjs/hooks/useCoupon.js +0 -2
- package/dist/cjs/hooks/useCoupon.js.map +0 -7
- package/dist/cjs/hooks/useMemberPrice.d.ts +0 -155
- package/dist/cjs/hooks/useMemberPrice.js +0 -2
- package/dist/cjs/hooks/useMemberPrice.js.map +0 -7
- package/dist/esm/biz-components/ActiveShelf/index.d.ts +0 -174
- package/dist/esm/biz-components/ActiveShelf/index.js +0 -2
- package/dist/esm/biz-components/ActiveShelf/index.js.map +0 -7
- package/dist/esm/biz-components/ActiveShelf/types.d.ts +0 -89
- package/dist/esm/biz-components/ActiveShelf/types.js +0 -2
- package/dist/esm/biz-components/ActiveShelf/types.js.map +0 -7
- package/dist/esm/biz-components/AnchorNavigation/index.d.ts +0 -42
- package/dist/esm/biz-components/AnchorNavigation/index.js +0 -2
- package/dist/esm/biz-components/AnchorNavigation/index.js.map +0 -7
- package/dist/esm/biz-components/AnchorNavigation/useAnchorPosition.d.ts +0 -2
- package/dist/esm/biz-components/AnchorNavigation/useAnchorPosition.js +0 -2
- package/dist/esm/biz-components/AnchorNavigation/useAnchorPosition.js.map +0 -7
- package/dist/esm/biz-components/BrandCardLink/BrandCardLink.d.ts +0 -6
- package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js +0 -2
- package/dist/esm/biz-components/BrandCardLink/BrandCardLink.js.map +0 -7
- package/dist/esm/biz-components/BrandCardLink/index.d.ts +0 -1
- package/dist/esm/biz-components/BrandCardLink/index.js +0 -2
- package/dist/esm/biz-components/BrandCardLink/index.js.map +0 -7
- package/dist/esm/biz-components/BrandCardLink/types.d.ts +0 -19
- package/dist/esm/biz-components/BrandCardLink/types.js +0 -1
- package/dist/esm/biz-components/BrandCardLink/types.js.map +0 -7
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.d.ts +0 -74
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js +0 -2
- package/dist/esm/biz-components/BuyOneGetOneShelf/ProductCard.js.map +0 -7
- package/dist/esm/biz-components/BuyOneGetOneShelf/hooks/useBogoDataTransform.d.ts +0 -36
- package/dist/esm/biz-components/BuyOneGetOneShelf/hooks/useBogoDataTransform.js +0 -2
- package/dist/esm/biz-components/BuyOneGetOneShelf/hooks/useBogoDataTransform.js.map +0 -7
- package/dist/esm/biz-components/BuyOneGetOneShelf/index.d.ts +0 -193
- package/dist/esm/biz-components/BuyOneGetOneShelf/index.js +0 -2
- package/dist/esm/biz-components/BuyOneGetOneShelf/index.js.map +0 -7
- package/dist/esm/biz-components/EventSchedule/index.d.ts +0 -63
- package/dist/esm/biz-components/EventSchedule/index.js +0 -2
- package/dist/esm/biz-components/EventSchedule/index.js.map +0 -7
- package/dist/esm/biz-components/IPRedirect/RegionBanner.d.ts +0 -37
- package/dist/esm/biz-components/IPRedirect/RegionBanner.js +0 -60
- package/dist/esm/biz-components/IPRedirect/RegionBanner.js.map +0 -7
- package/dist/esm/biz-components/IPRedirect/RegionSelectorModal.d.ts +0 -47
- package/dist/esm/biz-components/IPRedirect/RegionSelectorModal.js +0 -33
- package/dist/esm/biz-components/IPRedirect/RegionSelectorModal.js.map +0 -7
- package/dist/esm/biz-components/IPRedirect/index.d.ts +0 -9
- package/dist/esm/biz-components/IPRedirect/index.js +0 -2
- package/dist/esm/biz-components/IPRedirect/index.js.map +0 -7
- package/dist/esm/biz-components/IPRedirect/type.d.ts +0 -36
- package/dist/esm/biz-components/IPRedirect/type.js +0 -1
- package/dist/esm/biz-components/IPRedirect/type.js.map +0 -7
- package/dist/esm/biz-components/IPRedirect/useAutoRedirect.d.ts +0 -66
- package/dist/esm/biz-components/IPRedirect/useAutoRedirect.js +0 -2
- package/dist/esm/biz-components/IPRedirect/useAutoRedirect.js.map +0 -7
- package/dist/esm/biz-components/IPRedirect/useDetectedRegionRedirect.d.ts +0 -51
- package/dist/esm/biz-components/IPRedirect/useDetectedRegionRedirect.js +0 -2
- package/dist/esm/biz-components/IPRedirect/useDetectedRegionRedirect.js.map +0 -7
- package/dist/esm/biz-components/IPRedirect/useIPRedirect.d.ts +0 -42
- package/dist/esm/biz-components/IPRedirect/useIPRedirect.js +0 -2
- package/dist/esm/biz-components/IPRedirect/useIPRedirect.js.map +0 -7
- package/dist/esm/biz-components/IPRedirect/useRedirectBanner.d.ts +0 -108
- package/dist/esm/biz-components/IPRedirect/useRedirectBanner.js +0 -2
- package/dist/esm/biz-components/IPRedirect/useRedirectBanner.js.map +0 -7
- package/dist/esm/biz-components/IPRedirect/useRegionRedirectManager.d.ts +0 -152
- package/dist/esm/biz-components/IPRedirect/useRegionRedirectManager.js +0 -2
- package/dist/esm/biz-components/IPRedirect/useRegionRedirectManager.js.map +0 -7
- package/dist/esm/biz-components/IPRedirect/useSavedRegionRedirect.d.ts +0 -51
- package/dist/esm/biz-components/IPRedirect/useSavedRegionRedirect.js +0 -2
- package/dist/esm/biz-components/IPRedirect/useSavedRegionRedirect.js.map +0 -7
- package/dist/esm/biz-components/IPRedirect/utils.d.ts +0 -222
- package/dist/esm/biz-components/IPRedirect/utils.js +0 -2
- package/dist/esm/biz-components/IPRedirect/utils.js.map +0 -7
- package/dist/esm/biz-components/ImageOverlayShelf/index.d.ts +0 -114
- package/dist/esm/biz-components/ImageOverlayShelf/index.js +0 -2
- package/dist/esm/biz-components/ImageOverlayShelf/index.js.map +0 -7
- package/dist/esm/biz-components/Media/index.d.ts +0 -32
- package/dist/esm/biz-components/Media/index.js +0 -2
- package/dist/esm/biz-components/Media/index.js.map +0 -7
- package/dist/esm/biz-components/MediaShelf/index.d.ts +0 -231
- package/dist/esm/biz-components/MediaShelf/index.js +0 -2
- package/dist/esm/biz-components/MediaShelf/index.js.map +0 -7
- package/dist/esm/biz-components/MediaShelf/types.d.ts +0 -37
- package/dist/esm/biz-components/MediaShelf/types.js +0 -2
- package/dist/esm/biz-components/MediaShelf/types.js.map +0 -7
- package/dist/esm/biz-components/MiniCart/index.d.ts +0 -88
- package/dist/esm/biz-components/MiniCart/index.js +0 -2
- package/dist/esm/biz-components/MiniCart/index.js.map +0 -7
- package/dist/esm/biz-components/PromotionalBar/index.d.ts +0 -49
- package/dist/esm/biz-components/PromotionalBar/index.js +0 -2
- package/dist/esm/biz-components/PromotionalBar/index.js.map +0 -7
- package/dist/esm/biz-components/SecondaryBanner/index.d.ts +0 -69
- package/dist/esm/biz-components/SecondaryBanner/index.js +0 -2
- package/dist/esm/biz-components/SecondaryBanner/index.js.map +0 -7
- package/dist/esm/biz-components/Title/Countdown.d.ts +0 -14
- package/dist/esm/biz-components/Title/Countdown.js +0 -2
- package/dist/esm/biz-components/Title/Countdown.js.map +0 -7
- package/dist/esm/biz-components/WheelLottery/BaseModal.d.ts +0 -55
- package/dist/esm/biz-components/WheelLottery/BaseModal.js +0 -12
- package/dist/esm/biz-components/WheelLottery/BaseModal.js.map +0 -7
- package/dist/esm/biz-components/WheelLottery/ChanceMethods.d.ts +0 -30
- package/dist/esm/biz-components/WheelLottery/ChanceMethods.js +0 -2
- package/dist/esm/biz-components/WheelLottery/ChanceMethods.js.map +0 -7
- package/dist/esm/biz-components/WheelLottery/ErrorModal.d.ts +0 -42
- package/dist/esm/biz-components/WheelLottery/ErrorModal.js +0 -2
- package/dist/esm/biz-components/WheelLottery/ErrorModal.js.map +0 -7
- package/dist/esm/biz-components/WheelLottery/MyRewardsModal.d.ts +0 -91
- package/dist/esm/biz-components/WheelLottery/MyRewardsModal.js +0 -2
- package/dist/esm/biz-components/WheelLottery/MyRewardsModal.js.map +0 -7
- package/dist/esm/biz-components/WheelLottery/PrizePool.d.ts +0 -26
- package/dist/esm/biz-components/WheelLottery/PrizePool.js +0 -2
- package/dist/esm/biz-components/WheelLottery/PrizePool.js.map +0 -7
- package/dist/esm/biz-components/WheelLottery/RulesModal.d.ts +0 -47
- package/dist/esm/biz-components/WheelLottery/RulesModal.js +0 -2
- package/dist/esm/biz-components/WheelLottery/RulesModal.js.map +0 -7
- package/dist/esm/biz-components/WheelLottery/ShareModal.d.ts +0 -74
- package/dist/esm/biz-components/WheelLottery/ShareModal.js +0 -2
- package/dist/esm/biz-components/WheelLottery/ShareModal.js.map +0 -7
- package/dist/esm/biz-components/WheelLottery/Wheel.d.ts +0 -27
- package/dist/esm/biz-components/WheelLottery/Wheel.js +0 -2
- package/dist/esm/biz-components/WheelLottery/Wheel.js.map +0 -7
- package/dist/esm/biz-components/WheelLottery/WinnerModal.d.ts +0 -25
- package/dist/esm/biz-components/WheelLottery/WinnerModal.js +0 -2
- package/dist/esm/biz-components/WheelLottery/WinnerModal.js.map +0 -7
- package/dist/esm/biz-components/WheelLottery/index.d.ts +0 -52
- package/dist/esm/biz-components/WheelLottery/index.js +0 -2
- package/dist/esm/biz-components/WheelLottery/index.js.map +0 -7
- package/dist/esm/biz-components/WheelLottery/types.d.ts +0 -1219
- package/dist/esm/biz-components/WheelLottery/types.js +0 -2
- package/dist/esm/biz-components/WheelLottery/types.js.map +0 -7
- package/dist/esm/components/paginator.d.ts +0 -12
- package/dist/esm/components/paginator.js +0 -7
- package/dist/esm/components/paginator.js.map +0 -7
- package/dist/esm/components/progress.d.ts +0 -46
- package/dist/esm/components/progress.js +0 -2
- package/dist/esm/components/progress.js.map +0 -7
- package/dist/esm/helpers/priceFormatting.d.ts +0 -11
- package/dist/esm/helpers/priceFormatting.js +0 -2
- package/dist/esm/helpers/priceFormatting.js.map +0 -7
- package/dist/esm/hooks/index.d.ts +0 -2
- package/dist/esm/hooks/index.js +0 -2
- package/dist/esm/hooks/index.js.map +0 -7
- package/dist/esm/hooks/useCoupon.d.ts +0 -111
- package/dist/esm/hooks/useCoupon.js +0 -2
- package/dist/esm/hooks/useCoupon.js.map +0 -7
- package/dist/esm/hooks/useMemberPrice.d.ts +0 -155
- package/dist/esm/hooks/useMemberPrice.js +0 -2
- package/dist/esm/hooks/useMemberPrice.js.map +0 -7
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";"use client";var P=Object.create;var h=Object.defineProperty;var V=Object.getOwnPropertyDescriptor;var y=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,A=Object.prototype.hasOwnProperty;var T=(e,t)=>{for(var s in t)h(e,s,{get:t[s],enumerable:!0})},b=(e,t,s,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of y(t))!A.call(e,a)&&a!==s&&h(e,a,{get:()=>t[a],enumerable:!(l=V(t,a))||l.enumerable});return e};var k=(e,t,s)=>(s=e!=null?P(B(e)):{},b(t||!e||!e.__esModule?h(s,"default",{value:e,enumerable:!0}):s,e)),D=e=>b(h({},"__esModule",{value:!0}),e);var H={};T(H,{default:()=>j});module.exports=D(H);var i=require("react/jsx-runtime"),o=k(require("react")),d=require("../../helpers/index.js"),p=require("../../components/index.js"),w=require("swiper/react"),f=k(require("dayjs")),u=require("class-variance-authority");const I=(e,t)=>{const s=(0,f.default)(),l=(0,f.default)(e).startOf("day"),a=(0,f.default)(t).endOf("day");return s.isAfter(l)&&s.isBefore(a)},x=e=>I(e.startDate,e.endDate),L=(0,u.cva)("h-2 w-full overflow-hidden",{variants:{state:{"active-light":"bg-[#F6CD4E]","inactive-light":"bg-[#EAEAEC]","active-dark":"bg-[#D79941]","inactive-dark":"bg-[#75787F]"}},defaultVariants:{state:"inactive-light"}}),M=(0,u.cva)("size-4 rounded-full transition-colors",{variants:{state:{"active-light":"bg-[#F6CD4E]","inactive-light":"bg-[#EAEAEC]","active-dark":"bg-[#D79941]","inactive-dark":"bg-[#75787F]"}},defaultVariants:{state:"inactive-light"}}),E=(0,u.cva)("font-bold leading-[1.2]",{variants:{state:{"active-light":"text-[#080A0F]","inactive-light":"text-[#4A4C56]","active-dark":"text-white","inactive-dark":"text-[#8A8D92]"}},defaultVariants:{state:"inactive-light"}}),C=(0,u.cva)("laptop:h-[160px] rounded-box relative flex h-[120px] min-w-0 flex-col justify-between gap-2 overflow-hidden",{variants:{state:{"active-light":"bg-[#F4E8BC]","inactive-light":"bg-[#EAEAEC]","active-dark":"bg-[#D79941]","inactive-dark":"bg-[#1E2024]"}},defaultVariants:{state:"inactive-light"}}),R=({active:e,theme:t="light",className:s,index:l,nodeLength:a})=>{const n=`${e?"active":"inactive"}-${t}`,r=l===0,v=l===a-1;return(0,i.jsxs)("div",{className:"relative flex h-2 w-full items-center justify-center",children:[(0,i.jsx)("div",{className:(0,d.cn)(L({state:n}),r&&"rounded-l-full",v&&"rounded-r-full",s)}),(0,i.jsx)("div",{className:"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2",children:(0,i.jsx)("div",{className:M({state:n})})})]})},F=(e,t)=>{if(e)return t?e.active:e.inactive},z=({active:e,item:t,theme:s="light",className:l})=>{const a=o.useMemo(()=>F(t.icon,e),[t.icon,e]),n=`${e?"active":"inactive"}-${s}`;return(0,i.jsxs)("div",{className:(0,d.cn)(C({state:n}),l),children:[a&&(0,i.jsx)("div",{className:"laptop:w-[128px] desktop:w-[160px] absolute bottom-0 right-0 z-10 w-[120px]",children:(0,i.jsx)(p.Picture,{source:a.url,alt:a.alt,className:"aspect-square"})}),(0,i.jsxs)("div",{className:"tablet:px-4 tablet:py-3 laptop:p-4 desktop:px-6 relative z-20 flex h-full flex-col justify-between px-6 py-4",children:[(0,i.jsx)(p.Heading,{html:t.title,className:(0,d.cn)("desktop:text-[32px] laptop:text-[24px] line-clamp-1 text-[20px]",E({state:n}))}),(0,i.jsx)("div",{className:"flex flex-col gap-0.5",children:t.items.map((r,v)=>(0,i.jsxs)("div",{className:"flex items-center gap-2",children:[r.icon&&(0,i.jsx)("div",{className:"desktop:size-6 size-5 shrink-0",children:(0,i.jsx)(p.Picture,{source:r.icon.url,alt:r.icon.alt,className:"size-full"})}),(0,i.jsx)(p.Text,{html:r.label,className:(0,d.cn)("lg-desktop:text-[18px] desktop:text-[16px] flex-1 text-[14px] leading-[1.4]",E({state:n}))})]},v))})]})]})},N=o.forwardRef(({classNames:e={},data:t},s)=>{const l=t.theme||"light",a=o.useRef(null),n=o.useMemo(()=>t?.scheduleList?.length||2,[t?.scheduleList]),r=o.useMemo(()=>t.scheduleList.findIndex(c=>x(c)),[t.scheduleList]),v=o.useMemo(()=>{switch(n){case 2:return{0:{slidesPerView:1.17,spaceBetween:12},768:{slidesPerView:2},1024:{spaceBetween:16},1440:{spaceBetween:16,slidesPerView:2}};case 3:return{0:{slidesPerView:1.17,spaceBetween:12},768:{slidesPerView:2.4},1024:{slidesPerView:n,spaceBetween:16},1440:{spaceBetween:16,slidesPerView:n}};case 4:return{0:{slidesPerView:1.17,spaceBetween:12},768:{slidesPerView:2.4},1024:{slidesPerView:3.2,spaceBetween:16},1440:{slidesPerView:n,spaceBetween:16}};default:return{0:{slidesPerView:1.17,spaceBetween:12},768:{slidesPerView:1,spaceBetween:12},1024:{slidesPerView:n,spaceBetween:16},1440:{slidesPerView:n,spaceBetween:16}}}},[n]),S=t.showTimeline!==!1;return o.useEffect(()=>{a.current&&r>=0&&setTimeout(()=>{a.current?.slideTo(r,500)},100)},[r]),(0,i.jsxs)("div",{ref:s,className:(0,d.cn)("tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] flex w-full flex-col gap-4 overflow-hidden px-4",e?.root),children:[S&&(0,i.jsx)("div",{className:"flex h-4 items-center overflow-hidden",children:t.scheduleList.map((c,m)=>{const g=x(c);return(0,i.jsx)(R,{className:e?.timeline,active:g,theme:l,index:m,nodeLength:t.scheduleList.length},"timelineNode"+m)})}),(0,i.jsx)(w.Swiper,{breakpoints:v,className:"w-full !overflow-visible",onSwiper:c=>{a.current=c},children:t.scheduleList.map((c,m)=>{const g=x(c);return(0,i.jsx)(w.SwiperSlide,{children:(0,i.jsx)(z,{active:g,className:(0,d.cn)(S?"mt-4":"",e?.eventScheduleCard),item:c,theme:l})},"SwiperSlideItem"+m)})})]})});N.displayName="EventSchedule";var j=N;
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/biz-components/EventSchedule/index.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport * as React from 'react'\nimport { cn } from '../../helpers/index.js'\nimport { Text, Picture, Heading } from '../../components/index.js'\nimport { Swiper, SwiperSlide } from 'swiper/react'\nimport type { Swiper as SwiperType } from 'swiper'\nimport dayjs from 'dayjs'\nimport { cva } from 'class-variance-authority'\nimport type { Media } from '../../types/props.js'\nexport type EventScheduleSemanticName = 'root' | 'timeline' | 'eventScheduleCard'\n\n/**\n * \u72B6\u6001\u5316\u56FE\u6807\u914D\u7F6E\n */\nexport interface StateIcon {\n /** \u6FC0\u6D3B\u72B6\u6001\u7684\u56FE\u6807 */\n active: Media\n /** \u975E\u6FC0\u6D3B\u72B6\u6001\u7684\u56FE\u6807 */\n inactive: Media\n}\n\n/**\n * \u6D3B\u52A8\u65E5\u7A0B\u9879\u6570\u636E\u63A5\u53E3\n */\nexport interface EventScheduleItem {\n /** \u6807\u9898 */\n title: string\n /** \u5F00\u59CB\u65E5\u671F\uFF08ISO 8601 \u683C\u5F0F\u6216\u4EFB\u4F55 dayjs \u652F\u6301\u7684\u683C\u5F0F\uFF0C\u5982 '2024-12-01'\uFF09 */\n startDate: string\n /** \u7ED3\u675F\u65E5\u671F\uFF08ISO 8601 \u683C\u5F0F\u6216\u4EFB\u4F55 dayjs \u652F\u6301\u7684\u683C\u5F0F\uFF0C\u5982 '2024-12-31'\uFF09 */\n endDate: string\n /**\n * \u5361\u7247\u80CC\u666F\u56FE\u6807\u914D\u7F6E\uFF0C\u72B6\u6001\u5316\u56FE\u6807\uFF08\u5FC5\u987B\u5305\u542B active \u548C inactive\uFF09\n *\n * @example\n * icon: {\n * active: { url: \"https://example.com/active-icon.svg\", alt: \"Active Icon\" },\n * inactive: { url: \"https://example.com/inactive-icon.svg\", alt: \"Inactive Icon\" }\n * }\n */\n icon?: StateIcon\n /** \u8BE6\u7EC6\u4FE1\u606F\u5217\u8868 */\n items: {\n /** \u56FE\u6807 (SVG \u5B57\u7B26\u4E32\u6216 URL) */\n icon?: Media\n /** \u6587\u672C\u5185\u5BB9 */\n label: string\n }[]\n}\n\n/**\n * EventSchedule \u4E1A\u52A1\u7EC4\u4EF6\u6570\u636E\u63A5\u53E3\n */\nexport interface EventScheduleData {\n /** \u65E5\u7A0B\u5217\u8868 */\n scheduleList: EventScheduleItem[]\n /** \u662F\u5426\u663E\u793A\u65F6\u95F4\u8F74\uFF0C\u9ED8\u8BA4\u4E3A true */\n showTimeline?: boolean\n /** \u4E3B\u9898\u6A21\u5F0F */\n theme?: 'light' | 'dark'\n}\n\nexport interface EventScheduleProps extends React.HTMLAttributes<HTMLDivElement> {\n /** \u4E1A\u52A1\u6570\u636E */\n data: EventScheduleData\n classNames?: Partial<Record<EventScheduleSemanticName, string>>\n}\n\n/**\n * \u5224\u65AD\u5F53\u524D\u65F6\u95F4\u662F\u5426\u5728\u6307\u5B9A\u7684\u65F6\u95F4\u533A\u95F4\u5185\n * @param startDate \u5F00\u59CB\u65E5\u671F\n * @param endDate \u7ED3\u675F\u65E5\u671F\n * @returns \u662F\u5426\u5728\u533A\u95F4\u5185\n */\nconst isInTimeRange = (startDate: string, endDate: string): boolean => {\n const now = dayjs()\n const start = dayjs(startDate).startOf('day')\n const end = dayjs(endDate).endOf('day')\n return now.isAfter(start) && now.isBefore(end)\n}\n\n/**\n * \u83B7\u53D6\u6D3B\u52A8\u9879\u7684\u6FC0\u6D3B\u72B6\u6001\n * @param item \u6D3B\u52A8\u9879\n * @returns \u662F\u5426\u6FC0\u6D3B\n */\nconst getItemActiveStatus = (item: EventScheduleItem): boolean => {\n // \u5426\u5219\u6839\u636E\u65F6\u95F4\u533A\u95F4\u81EA\u52A8\u5224\u65AD\n return isInTimeRange(item.startDate, item.endDate)\n}\n\n/**\n * \u65F6\u95F4\u8F74\u8FDB\u5EA6\u6761\u6FC0\u6D3B\u72B6\u6001\u6837\u5F0F\u53D8\u4F53\n */\nconst timelineProgressActiveVariants = cva('h-2 w-full overflow-hidden', {\n variants: {\n state: {\n 'active-light': 'bg-[#F6CD4E]',\n 'inactive-light': 'bg-[#EAEAEC]',\n 'active-dark': 'bg-[#D79941]',\n 'inactive-dark': 'bg-[#75787F]',\n },\n },\n defaultVariants: {\n state: 'inactive-light',\n },\n})\n\n/**\n * \u65F6\u95F4\u8F74\u8282\u70B9\u6FC0\u6D3B\u72B6\u6001\u6837\u5F0F\u53D8\u4F53\n */\nconst timelineNodeActiveVariants = cva('size-4 rounded-full transition-colors', {\n variants: {\n state: {\n 'active-light': 'bg-[#F6CD4E]',\n 'inactive-light': 'bg-[#EAEAEC]',\n 'active-dark': 'bg-[#D79941]',\n 'inactive-dark': 'bg-[#75787F]',\n },\n },\n defaultVariants: {\n state: 'inactive-light',\n },\n})\n\n/**\n * \u5361\u7247\u6587\u672C\u6837\u5F0F\u53D8\u4F53\n */\nconst cardTextVariants = cva('font-bold leading-[1.2]', {\n variants: {\n state: {\n 'active-light': 'text-[#080A0F]',\n 'inactive-light': 'text-[#4A4C56]',\n 'active-dark': 'text-white',\n 'inactive-dark': 'text-[#8A8D92]',\n },\n },\n defaultVariants: {\n state: 'inactive-light',\n },\n})\n\n/**\n * \u5361\u7247\u5BB9\u5668\u6837\u5F0F\u53D8\u4F53\n */\nconst eventScheduleCardVariants = cva(\n 'laptop:h-[160px] rounded-box relative flex h-[120px] min-w-0 flex-col justify-between gap-2 overflow-hidden',\n {\n variants: {\n state: {\n 'active-light': 'bg-[#F4E8BC]',\n 'inactive-light': 'bg-[#EAEAEC]',\n 'active-dark': 'bg-[#D79941]',\n 'inactive-dark': 'bg-[#1E2024]',\n },\n },\n defaultVariants: {\n state: 'inactive-light',\n },\n }\n)\n\n/**\n * \u65F6\u95F4\u8F74\u8282\u70B9\u7EC4\u4EF6 Props\n */\ninterface TimelineNodeProps {\n /** \u662F\u5426\u6FC0\u6D3B\u72B6\u6001 */\n active: boolean\n /** \u4E3B\u9898\u6A21\u5F0F */\n theme?: 'light' | 'dark'\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n /** \u5F53\u524D\u8282\u70B9\u7D22\u5F15 */\n index: number\n /** \u8282\u70B9\u603B\u6570 */\n nodeLength: number\n}\n\n/**\n * \u65F6\u95F4\u8F74\u8282\u70B9\u7EC4\u4EF6\n */\nconst TimelineNode = ({ active, theme = 'light', className, index, nodeLength }: TimelineNodeProps) => {\n // \u8BA1\u7B97\u7EC4\u5408\u72B6\u6001\n const state = `${active ? 'active' : 'inactive'}-${theme}` as\n | 'active-light'\n | 'inactive-light'\n | 'active-dark'\n | 'inactive-dark'\n\n // \u5224\u65AD\u9996\u5C3E\u4F4D\u7F6E\n const isFirst = index === 0\n const isLast = index === nodeLength - 1\n\n return (\n <div className=\"relative flex h-2 w-full items-center justify-center\">\n {/* \u8FDB\u5EA6\u6761\u80CC\u666F */}\n <div\n className={cn(\n timelineProgressActiveVariants({ state }),\n isFirst && 'rounded-l-full',\n isLast && 'rounded-r-full',\n className\n )}\n />\n {/* \u65F6\u95F4\u8282\u70B9\u5706\u70B9 */}\n <div className=\"absolute left-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2\">\n <div className={timelineNodeActiveVariants({ state })} />\n </div>\n </div>\n )\n}\n\n/**\n * \u6839\u636E\u6FC0\u6D3B\u72B6\u6001\u83B7\u53D6\u5BF9\u5E94\u7684\u56FE\u6807\n * @param icon \u72B6\u6001\u5316\u56FE\u6807\u914D\u7F6E\n * @param isActive \u662F\u5426\u6FC0\u6D3B\u72B6\u6001\n * @returns \u56FE\u6807 Media \u5BF9\u8C61\n */\nconst getIconByState = (icon: StateIcon | undefined, isActive: boolean): Media | undefined => {\n if (!icon) return undefined\n return isActive ? icon.active : icon.inactive\n}\n\n/**\n * \u6D3B\u52A8\u65E5\u7A0B\u5361\u7247\u7EC4\u4EF6\n */\nconst EventScheduleCard = ({\n active,\n item,\n theme = 'light',\n className,\n}: {\n active: boolean\n item: EventScheduleItem\n theme?: 'light' | 'dark'\n className?: string\n}) => {\n const currentIcon = React.useMemo(() => {\n return getIconByState(item.icon, active)\n }, [item.icon, active])\n\n // \u8BA1\u7B97\u7EC4\u5408\u72B6\u6001\n const cardState = `${active ? 'active' : 'inactive'}-${theme}` as\n | 'active-light'\n | 'inactive-light'\n | 'active-dark'\n | 'inactive-dark'\n\n return (\n <div className={cn(eventScheduleCardVariants({ state: cardState }), className)}>\n {/* \u80CC\u666F\u56FE\u6807 */}\n {currentIcon && (\n <div className=\"laptop:w-[128px] desktop:w-[160px] absolute bottom-0 right-0 z-10 w-[120px]\">\n <Picture source={currentIcon.url} alt={currentIcon.alt} className=\"aspect-square\" />\n </div>\n )}\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className=\"tablet:px-4 tablet:py-3 laptop:p-4 desktop:px-6 relative z-20 flex h-full flex-col justify-between px-6 py-4\">\n <Heading\n html={item.title}\n className={cn(\n 'desktop:text-[32px] laptop:text-[24px] line-clamp-1 text-[20px]',\n cardTextVariants({ state: cardState })\n )}\n />\n {/* \u8BE6\u7EC6\u4FE1\u606F\u5217\u8868 */}\n <div className=\"flex flex-col gap-0.5\">\n {item.items.map((detail, index) => (\n <div key={index} className=\"flex items-center gap-2\">\n {/* \u56FE\u6807 */}\n {detail.icon && (\n <div className=\"desktop:size-6 size-5 shrink-0\">\n <Picture source={detail.icon.url} alt={detail.icon.alt} className=\"size-full\" />\n </div>\n )}\n {/* \u6587\u672C */}\n <Text\n html={detail.label}\n className={cn(\n 'lg-desktop:text-[18px] desktop:text-[16px] flex-1 text-[14px] leading-[1.4]',\n cardTextVariants({ state: cardState })\n )}\n />\n </div>\n ))}\n </div>\n </div>\n </div>\n )\n}\n\n/**\n * EventSchedule - \u6D3B\u52A8\u65E5\u7A0B\u7EC4\u4EF6\n *\n * @description \u663E\u793A\u6D3B\u52A8\u65E5\u7A0B\u65F6\u95F4\u8F74\u548C\u6D3B\u52A8\u5361\u7247\u5217\u8868\n */\nconst EventSchedule = React.forwardRef<HTMLDivElement, EventScheduleProps>(({ classNames = {}, data }, ref) => {\n const theme = data.theme || 'light'\n const swiperRef = React.useRef<SwiperType | null>(null)\n const itemsPerRow = React.useMemo(() => {\n return data?.scheduleList?.length || 2\n }, [data?.scheduleList])\n\n // \u8BA1\u7B97 active item \u7684\u7D22\u5F15\n const activeIndex = React.useMemo(() => {\n return data.scheduleList.findIndex(item => getItemActiveStatus(item))\n }, [data.scheduleList])\n\n // \u6839\u636E itemsPerRow \u914D\u7F6E\u54CD\u5E94\u5F0F\u65AD\u70B9\n const swiperBreakpoints = React.useMemo(() => {\n switch (itemsPerRow) {\n case 2:\n return {\n 0: {\n slidesPerView: 1.17,\n spaceBetween: 12,\n },\n 768: {\n slidesPerView: 2,\n },\n 1024: {\n spaceBetween: 16,\n },\n 1440: {\n spaceBetween: 16,\n slidesPerView: 2,\n },\n }\n case 3:\n return {\n 0: {\n slidesPerView: 1.17,\n spaceBetween: 12,\n },\n 768: {\n slidesPerView: 2.4,\n },\n 1024: {\n slidesPerView: itemsPerRow,\n spaceBetween: 16,\n },\n 1440: {\n spaceBetween: 16,\n slidesPerView: itemsPerRow,\n },\n }\n case 4:\n return {\n 0: {\n slidesPerView: 1.17,\n spaceBetween: 12,\n },\n 768: {\n slidesPerView: 2.4,\n },\n 1024: {\n slidesPerView: 3.2,\n spaceBetween: 16,\n },\n 1440: {\n slidesPerView: itemsPerRow,\n spaceBetween: 16,\n },\n }\n default:\n return {\n 0: {\n slidesPerView: 1.17,\n spaceBetween: 12,\n },\n 768: {\n slidesPerView: 1,\n spaceBetween: 12,\n },\n 1024: {\n slidesPerView: itemsPerRow,\n spaceBetween: 16,\n },\n 1440: {\n slidesPerView: itemsPerRow,\n spaceBetween: 16,\n },\n }\n }\n }, [itemsPerRow])\n\n const showTimeline = data.showTimeline !== false // \u9ED8\u8BA4\u4E3A true\n\n // \u81EA\u52A8\u6EDA\u52A8\u5230 active item\n React.useEffect(() => {\n if (swiperRef.current && activeIndex >= 0) {\n // \u5EF6\u8FDF\u6267\u884C\uFF0C\u786E\u4FDD Swiper \u5DF2\u7ECF\u5B8C\u5168\u521D\u59CB\u5316\n setTimeout(() => {\n swiperRef.current?.slideTo(activeIndex, 500)\n }, 100)\n }\n }, [activeIndex])\n\n return (\n <div\n ref={ref}\n className={cn(\n 'tablet:px-8 laptop:px-16 desktop:px-16 lg-desktop:px-[calc(50%-832px)] flex w-full flex-col gap-4 overflow-hidden px-4',\n classNames?.root\n )}\n >\n {showTimeline && (\n <div className=\"flex h-4 items-center overflow-hidden\">\n {data.scheduleList.map((item, index) => {\n const isActive = getItemActiveStatus(item)\n return (\n <TimelineNode\n key={'timelineNode' + index}\n className={classNames?.timeline}\n active={isActive}\n theme={theme}\n index={index}\n nodeLength={data.scheduleList.length}\n />\n )\n })}\n </div>\n )}\n <Swiper\n breakpoints={swiperBreakpoints}\n className=\"w-full !overflow-visible\"\n onSwiper={swiper => {\n swiperRef.current = swiper\n }}\n >\n {data.scheduleList.map((item, index) => {\n const isActive = getItemActiveStatus(item)\n return (\n <SwiperSlide key={'SwiperSlideItem' + index}>\n <EventScheduleCard\n active={isActive}\n className={cn(showTimeline ? 'mt-4' : '', classNames?.eventScheduleCard)}\n item={item}\n theme={theme}\n />\n </SwiperSlide>\n )\n })}\n </Swiper>\n </div>\n )\n})\n\nEventSchedule.displayName = 'EventSchedule'\nexport default EventSchedule\n\n// \u5BFC\u51FA\u7C7B\u578B\u4F9B\u5916\u90E8\u4F7F\u7528\n// export type { StateIcon, EventScheduleItem, EventScheduleData, EventScheduleProps }\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["EventSchedule_exports", "__export", "EventSchedule_default", "__toCommonJS", "import_jsx_runtime", "React", "import_helpers", "import_components", "import_react", "import_dayjs", "import_class_variance_authority", "isInTimeRange", "startDate", "endDate", "now", "dayjs", "start", "end", "getItemActiveStatus", "item", "timelineProgressActiveVariants", "timelineNodeActiveVariants", "cardTextVariants", "eventScheduleCardVariants", "TimelineNode", "active", "theme", "className", "index", "nodeLength", "state", "isFirst", "isLast", "getIconByState", "icon", "isActive", "EventScheduleCard", "currentIcon", "cardState", "detail", "EventSchedule", "classNames", "data", "ref", "swiperRef", "itemsPerRow", "activeIndex", "swiperBreakpoints", "showTimeline", "swiper"]
|
|
7
|
-
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { RegionConfig, IPRedirectBannerCopy } from './type.js';
|
|
2
|
-
/** 横幅样式配置 */
|
|
3
|
-
export type RegionBannerStyles = {
|
|
4
|
-
/** 背景色,默认 #fff */
|
|
5
|
-
backgroundColor?: string;
|
|
6
|
-
/** 按钮圆角,默认 9999px */
|
|
7
|
-
buttonBorderRadius?: string;
|
|
8
|
-
/** 文案字号,默认 14px */
|
|
9
|
-
fontSize?: string;
|
|
10
|
-
/** Stay Here 按钮背景色,默认 #000 */
|
|
11
|
-
stayButtonBgColor?: string;
|
|
12
|
-
/** Stay Here 按钮文字颜色,默认 #fff */
|
|
13
|
-
stayButtonTextColor?: string;
|
|
14
|
-
/** Switch Site 按钮边框颜色,默认 #000 */
|
|
15
|
-
switchButtonBorderColor?: string;
|
|
16
|
-
/** Switch Site 按钮文字颜色,默认 #000 */
|
|
17
|
-
switchButtonTextColor?: string;
|
|
18
|
-
};
|
|
19
|
-
export type RegionBannerProps = {
|
|
20
|
-
/** 控制横幅显示/隐藏 */
|
|
21
|
-
visible: boolean;
|
|
22
|
-
/** 横幅状态变化回调 */
|
|
23
|
-
onVisibleChange: (visible: boolean) => void;
|
|
24
|
-
/** 文案配置 */
|
|
25
|
-
copy: IPRedirectBannerCopy;
|
|
26
|
-
/** 点击 Stay Here 按钮的回调 */
|
|
27
|
-
onStayHere: () => void;
|
|
28
|
-
/** 点击 Switch Site 按钮的回调 */
|
|
29
|
-
onSwitchSite: () => void;
|
|
30
|
-
/** 样式配置 */
|
|
31
|
-
styles?: RegionBannerStyles;
|
|
32
|
-
/** 当前站点地区配置(用于显示国旗图标) */
|
|
33
|
-
currentRegion?: RegionConfig;
|
|
34
|
-
/** 自定义类名 */
|
|
35
|
-
className?: string;
|
|
36
|
-
};
|
|
37
|
-
export declare function RegionBanner({ visible, onVisibleChange, copy, onStayHere, onSwitchSite, styles: customStyles, currentRegion, className, }: RegionBannerProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";"use client";var s=Object.defineProperty;var x=Object.getOwnPropertyDescriptor;var u=Object.getOwnPropertyNames;var C=Object.prototype.hasOwnProperty;var b=(n,t)=>{for(var r in t)s(n,r,{get:t[r],enumerable:!0})},h=(n,t,r,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of u(t))!C.call(n,i)&&i!==r&&s(n,i,{get:()=>t[i],enumerable:!(a=x(t,i))||a.enumerable});return n};var f=n=>h(s({},"__esModule",{value:!0}),n);var y={};b(y,{RegionBanner:()=>m});module.exports=f(y);var e=require("react/jsx-runtime");const w={backgroundColor:"#fff",buttonBorderRadius:"9999px",fontSize:"14px",stayButtonBgColor:"#000",stayButtonTextColor:"#fff",switchButtonBorderColor:"#000",switchButtonTextColor:"#000"};function m({visible:n,onVisibleChange:t,copy:r,onStayHere:a,onSwitchSite:i,styles:d,currentRegion:l,className:g}){const o={...w,...d};if(!n)return null;const p=()=>{a(),t(!1)},c=()=>{a(),t(!1)};return(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("style",{children:`
|
|
2
|
-
.region-banner-wrapper {
|
|
3
|
-
height: auto;
|
|
4
|
-
min-height: 74px;
|
|
5
|
-
}
|
|
6
|
-
@media (min-width: 1024px) {
|
|
7
|
-
.region-banner-wrapper {
|
|
8
|
-
height: 54px;
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
.region-banner-content {
|
|
12
|
-
padding: 0 12px;
|
|
13
|
-
flex-direction: column;
|
|
14
|
-
gap: 8px;
|
|
15
|
-
align-items: flex-start;
|
|
16
|
-
}
|
|
17
|
-
.region-banner-title-row {
|
|
18
|
-
display: flex;
|
|
19
|
-
align-items: center;
|
|
20
|
-
width: 100%;
|
|
21
|
-
gap: 8px;
|
|
22
|
-
height: 20px;
|
|
23
|
-
margin-top: 8px;
|
|
24
|
-
}
|
|
25
|
-
.region-banner-content h1 {
|
|
26
|
-
flex: 1;
|
|
27
|
-
min-width: 0;
|
|
28
|
-
}
|
|
29
|
-
.region-banner-close-btn {
|
|
30
|
-
position: static;
|
|
31
|
-
flex-shrink: 0;
|
|
32
|
-
}
|
|
33
|
-
@media (min-width: 1024px) {
|
|
34
|
-
.region-banner-content {
|
|
35
|
-
padding: 0 64px;
|
|
36
|
-
flex-direction: row;
|
|
37
|
-
align-items: center;
|
|
38
|
-
}
|
|
39
|
-
.region-banner-title-row {
|
|
40
|
-
flex: 1;
|
|
41
|
-
}
|
|
42
|
-
.region-banner-close-btn {
|
|
43
|
-
position: absolute;
|
|
44
|
-
right: 16px;
|
|
45
|
-
top: 50%;
|
|
46
|
-
transform: translateY(-50%);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
@media (min-width: 1920px) {
|
|
50
|
-
.region-banner-content {
|
|
51
|
-
padding: 0 128px;
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
@media (min-width: 1025px) and (max-width: 1440px) {
|
|
55
|
-
.region-banner-title {
|
|
56
|
-
max-width: 623px;
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
`}),(0,e.jsx)("div",{className:`region-banner-wrapper relative left-0 top-0 w-full ${g||""}`,style:{backgroundColor:o.backgroundColor,boxShadow:"0 2px 8px rgba(0,0,0,0.1)",zIndex:1e3},children:(0,e.jsxs)("div",{className:"region-banner-content flex h-full justify-between text-black",children:[(0,e.jsxs)("div",{className:"region-banner-title-row",children:[(0,e.jsx)("h1",{className:"region-banner-title truncate font-bold",style:{fontSize:o.fontSize,color:"#1F2021"},children:r.message}),(0,e.jsx)("button",{onClick:c,className:"region-banner-close-btn inline-flex size-[28px] items-center justify-center rounded-full hover:bg-[#f5f5f5] focus:outline-none",style:{color:"#767880"},"aria-label":"Close",children:(0,e.jsx)("svg",{width:"20",height:"20",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M13.5 4.5L4.5 13.5M4.5 4.5L13.5 13.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),(0,e.jsxs)("div",{className:"ml-4 flex gap-3",children:[(0,e.jsxs)("button",{onClick:p,className:"box-border flex h-[38px] items-center gap-1 whitespace-nowrap px-4 py-2 hover:opacity-80",style:{backgroundColor:o.stayButtonBgColor,color:o.stayButtonTextColor,fontWeight:"700",fontSize:o.fontSize,borderRadius:o.buttonBorderRadius,border:"none"},children:[l?.icon&&(0,e.jsx)("img",{src:l.icon,alt:"",style:{width:"16px",height:"16px",borderRadius:"100%"}}),r.stayButtonText]}),(0,e.jsxs)("button",{onClick:i,className:"box-border flex h-[38px] items-center gap-1 whitespace-nowrap px-4 py-2 hover:opacity-80",style:{backgroundColor:"transparent",color:o.switchButtonTextColor,border:`1.6px solid ${o.switchButtonBorderColor}`,fontWeight:"700",fontSize:o.fontSize,borderRadius:o.buttonBorderRadius},children:[(0,e.jsx)("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M8.29883 1.2041C12.216 1.20425 15.3923 4.37181 15.3926 8.28027C15.3926 12.189 12.2162 15.3563 8.29883 15.3564C4.38145 15.3563 1.2041 12.189 1.2041 8.28027C1.20439 4.37183 4.38163 1.20428 8.29883 1.2041ZM3.58105 11.4795C4.31053 12.5471 5.39411 13.3542 6.66406 13.7324C6.21155 13.0301 5.86128 12.2699 5.60938 11.4795H3.58105ZM11.0166 11.4795C10.7696 12.2779 10.4256 13.0347 9.98438 13.7178C11.2325 13.3333 12.2971 12.5331 13.0166 11.4795H11.0166ZM7.0791 11.4795C7.3755 12.2654 7.78717 12.9997 8.31445 13.6455C8.83791 13.0305 9.25428 12.2929 9.55273 11.4795H7.0791ZM2.85645 6.56738C2.6854 7.10801 2.59283 7.68338 2.59277 8.28027C2.59277 8.91383 2.69891 9.52251 2.89063 10.0918H5.27148C5.15636 9.42693 5.10277 8.75388 5.11133 8.08789C5.11789 7.57837 5.1619 7.06931 5.23926 6.56738L2.85645 6.56738ZM11.3447 6.56738C11.4483 7.20036 11.4944 7.84036 11.4863 8.47363C11.4793 9.01629 11.4291 9.55828 11.3418 10.0918H13.707C13.8986 9.52259 14.0039 8.91374 14.0039 8.28027C14.0039 7.68337 13.9112 7.10802 13.7402 6.56738H11.3447ZM6.64648 6.56738C6.55761 7.06802 6.50673 7.58339 6.5 8.10547C6.49143 8.7725 6.55341 9.44067 6.68359 10.0918L9.93457 10.0918C10.0348 9.56074 10.0905 9.01207 10.0977 8.45605C10.1058 7.82231 10.0497 7.18763 9.93262 6.56738L6.64648 6.56738ZM6.6123 2.84277C5.32602 3.23909 4.23535 4.07819 3.51563 5.17969L5.5498 5.17969C5.79857 4.34514 6.15294 3.55384 6.6123 2.84277ZM9.93262 2.8291C10.4039 3.56047 10.7656 4.35407 11.0195 5.17969H13.0811C12.3519 4.06343 11.2413 3.21866 9.93262 2.8291ZM8.28223 2.91504C7.73775 3.55467 7.30932 4.32752 7.00879 5.17969L9.55566 5.17969C9.25672 4.35642 8.83179 3.58782 8.28223 2.91504Z",fill:"currentColor"})}),r.switchButtonText]})]})]})})]})}
|
|
60
|
-
//# sourceMappingURL=RegionBanner.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/biz-components/IPRedirect/RegionBanner.tsx"],
|
|
4
|
-
"sourcesContent": ["'use client'\n\nimport type { RegionConfig, IPRedirectBannerCopy } from './type.js'\n\n/** \u6A2A\u5E45\u6837\u5F0F\u914D\u7F6E */\nexport type RegionBannerStyles = {\n /** \u80CC\u666F\u8272\uFF0C\u9ED8\u8BA4 #fff */\n backgroundColor?: string\n /** \u6309\u94AE\u5706\u89D2\uFF0C\u9ED8\u8BA4 9999px */\n buttonBorderRadius?: string\n /** \u6587\u6848\u5B57\u53F7\uFF0C\u9ED8\u8BA4 14px */\n fontSize?: string\n /** Stay Here \u6309\u94AE\u80CC\u666F\u8272\uFF0C\u9ED8\u8BA4 #000 */\n stayButtonBgColor?: string\n /** Stay Here \u6309\u94AE\u6587\u5B57\u989C\u8272\uFF0C\u9ED8\u8BA4 #fff */\n stayButtonTextColor?: string\n /** Switch Site \u6309\u94AE\u8FB9\u6846\u989C\u8272\uFF0C\u9ED8\u8BA4 #000 */\n switchButtonBorderColor?: string\n /** Switch Site \u6309\u94AE\u6587\u5B57\u989C\u8272\uFF0C\u9ED8\u8BA4 #000 */\n switchButtonTextColor?: string\n}\n\nexport type RegionBannerProps = {\n /** \u63A7\u5236\u6A2A\u5E45\u663E\u793A/\u9690\u85CF */\n visible: boolean\n /** \u6A2A\u5E45\u72B6\u6001\u53D8\u5316\u56DE\u8C03 */\n onVisibleChange: (visible: boolean) => void\n /** \u6587\u6848\u914D\u7F6E */\n copy: IPRedirectBannerCopy\n /** \u70B9\u51FB Stay Here \u6309\u94AE\u7684\u56DE\u8C03 */\n onStayHere: () => void\n /** \u70B9\u51FB Switch Site \u6309\u94AE\u7684\u56DE\u8C03 */\n onSwitchSite: () => void\n /** \u6837\u5F0F\u914D\u7F6E */\n styles?: RegionBannerStyles\n /** \u5F53\u524D\u7AD9\u70B9\u5730\u533A\u914D\u7F6E\uFF08\u7528\u4E8E\u663E\u793A\u56FD\u65D7\u56FE\u6807\uFF09 */\n currentRegion?: RegionConfig\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n}\n\n// \u9ED8\u8BA4\u6837\u5F0F\nconst defaultStyles: Required<RegionBannerStyles> = {\n backgroundColor: '#fff',\n buttonBorderRadius: '9999px',\n fontSize: '14px',\n stayButtonBgColor: '#000',\n stayButtonTextColor: '#fff',\n switchButtonBorderColor: '#000',\n switchButtonTextColor: '#000',\n}\n\nexport function RegionBanner({\n visible,\n onVisibleChange,\n copy,\n onStayHere,\n onSwitchSite,\n styles: customStyles,\n currentRegion,\n className,\n}: RegionBannerProps) {\n // \u5408\u5E76\u6837\u5F0F\n const styles = { ...defaultStyles, ...customStyles }\n\n if (!visible) return null\n\n const handleStayHere = () => {\n onStayHere()\n onVisibleChange(false)\n }\n\n const handleClose = () => {\n // \u5173\u95ED\u6309\u94AE\u548C Stay Here \u6309\u94AE\u884C\u4E3A\u4E00\u81F4\n onStayHere()\n onVisibleChange(false)\n }\n\n return (\n <>\n <style>{`\n .region-banner-wrapper {\n height: auto;\n min-height: 74px;\n }\n @media (min-width: 1024px) {\n .region-banner-wrapper {\n height: 54px;\n }\n }\n .region-banner-content {\n padding: 0 12px;\n flex-direction: column;\n gap: 8px;\n align-items: flex-start;\n }\n .region-banner-title-row {\n display: flex;\n align-items: center;\n width: 100%;\n gap: 8px;\n height: 20px;\n margin-top: 8px;\n }\n .region-banner-content h1 {\n flex: 1;\n min-width: 0;\n }\n .region-banner-close-btn {\n position: static;\n flex-shrink: 0;\n }\n @media (min-width: 1024px) {\n .region-banner-content {\n padding: 0 64px;\n flex-direction: row;\n align-items: center;\n }\n .region-banner-title-row {\n flex: 1;\n }\n .region-banner-close-btn {\n position: absolute;\n right: 16px;\n top: 50%;\n transform: translateY(-50%);\n }\n }\n @media (min-width: 1920px) {\n .region-banner-content {\n padding: 0 128px;\n }\n }\n @media (min-width: 1025px) and (max-width: 1440px) {\n .region-banner-title {\n max-width: 623px;\n }\n }\n `}</style>\n\n <div\n className={`region-banner-wrapper relative left-0 top-0 w-full ${className || ''}`}\n style={{ backgroundColor: styles.backgroundColor, boxShadow: '0 2px 8px rgba(0,0,0,0.1)', zIndex: 1000 }}\n >\n <div className=\"region-banner-content flex h-full justify-between text-black\">\n <div className=\"region-banner-title-row\">\n <h1\n className=\"region-banner-title truncate font-bold\"\n style={{ fontSize: styles.fontSize, color: '#1F2021' }}\n >\n {copy.message}\n </h1>\n\n {/* \u5173\u95ED\u6309\u94AE */}\n <button\n onClick={handleClose}\n className=\"region-banner-close-btn inline-flex size-[28px] items-center justify-center rounded-full hover:bg-[#f5f5f5] focus:outline-none\"\n style={{ color: '#767880' }}\n aria-label=\"Close\"\n >\n <svg width=\"20\" height=\"20\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M13.5 4.5L4.5 13.5M4.5 4.5L13.5 13.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </button>\n </div>\n\n <div className=\"ml-4 flex gap-3\">\n {/* Stay Here \u6309\u94AE */}\n <button\n onClick={handleStayHere}\n className=\"box-border flex h-[38px] items-center gap-1 whitespace-nowrap px-4 py-2 hover:opacity-80\"\n style={{\n backgroundColor: styles.stayButtonBgColor,\n color: styles.stayButtonTextColor,\n fontWeight: '700',\n fontSize: styles.fontSize,\n borderRadius: styles.buttonBorderRadius,\n border: 'none',\n }}\n >\n {currentRegion?.icon && (\n <img src={currentRegion.icon} alt=\"\" style={{ width: '16px', height: '16px', borderRadius: '100%' }} />\n )}\n {copy.stayButtonText}\n </button>\n\n {/* Switch Site \u6309\u94AE */}\n <button\n onClick={onSwitchSite}\n className=\"box-border flex h-[38px] items-center gap-1 whitespace-nowrap px-4 py-2 hover:opacity-80\"\n style={{\n backgroundColor: 'transparent',\n color: styles.switchButtonTextColor,\n border: `1.6px solid ${styles.switchButtonBorderColor}`,\n fontWeight: '700',\n fontSize: styles.fontSize,\n borderRadius: styles.buttonBorderRadius,\n }}\n >\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M8.29883 1.2041C12.216 1.20425 15.3923 4.37181 15.3926 8.28027C15.3926 12.189 12.2162 15.3563 8.29883 15.3564C4.38145 15.3563 1.2041 12.189 1.2041 8.28027C1.20439 4.37183 4.38163 1.20428 8.29883 1.2041ZM3.58105 11.4795C4.31053 12.5471 5.39411 13.3542 6.66406 13.7324C6.21155 13.0301 5.86128 12.2699 5.60938 11.4795H3.58105ZM11.0166 11.4795C10.7696 12.2779 10.4256 13.0347 9.98438 13.7178C11.2325 13.3333 12.2971 12.5331 13.0166 11.4795H11.0166ZM7.0791 11.4795C7.3755 12.2654 7.78717 12.9997 8.31445 13.6455C8.83791 13.0305 9.25428 12.2929 9.55273 11.4795H7.0791ZM2.85645 6.56738C2.6854 7.10801 2.59283 7.68338 2.59277 8.28027C2.59277 8.91383 2.69891 9.52251 2.89063 10.0918H5.27148C5.15636 9.42693 5.10277 8.75388 5.11133 8.08789C5.11789 7.57837 5.1619 7.06931 5.23926 6.56738L2.85645 6.56738ZM11.3447 6.56738C11.4483 7.20036 11.4944 7.84036 11.4863 8.47363C11.4793 9.01629 11.4291 9.55828 11.3418 10.0918H13.707C13.8986 9.52259 14.0039 8.91374 14.0039 8.28027C14.0039 7.68337 13.9112 7.10802 13.7402 6.56738H11.3447ZM6.64648 6.56738C6.55761 7.06802 6.50673 7.58339 6.5 8.10547C6.49143 8.7725 6.55341 9.44067 6.68359 10.0918L9.93457 10.0918C10.0348 9.56074 10.0905 9.01207 10.0977 8.45605C10.1058 7.82231 10.0497 7.18763 9.93262 6.56738L6.64648 6.56738ZM6.6123 2.84277C5.32602 3.23909 4.23535 4.07819 3.51563 5.17969L5.5498 5.17969C5.79857 4.34514 6.15294 3.55384 6.6123 2.84277ZM9.93262 2.8291C10.4039 3.56047 10.7656 4.35407 11.0195 5.17969H13.0811C12.3519 4.06343 11.2413 3.21866 9.93262 2.8291ZM8.28223 2.91504C7.73775 3.55467 7.30932 4.32752 7.00879 5.17969L9.55566 5.17969C9.25672 4.35642 8.83179 3.58782 8.28223 2.91504Z\"\n fill=\"currentColor\"\n />\n </svg>\n {copy.switchButtonText}\n </button>\n </div>\n </div>\n </div>\n </>\n )\n}\n"],
|
|
5
|
-
"mappings": "sbAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,kBAAAE,IAAA,eAAAC,EAAAH,GA+EI,IAAAI,EAAA,6BArCJ,MAAMC,EAA8C,CAClD,gBAAiB,OACjB,mBAAoB,SACpB,SAAU,OACV,kBAAmB,OACnB,oBAAqB,OACrB,wBAAyB,OACzB,sBAAuB,MACzB,EAEO,SAASH,EAAa,CAC3B,QAAAI,EACA,gBAAAC,EACA,KAAAC,EACA,WAAAC,EACA,aAAAC,EACA,OAAQC,EACR,cAAAC,EACA,UAAAC,CACF,EAAsB,CAEpB,MAAMC,EAAS,CAAE,GAAGT,EAAe,GAAGM,CAAa,EAEnD,GAAI,CAACL,EAAS,OAAO,KAErB,MAAMS,EAAiB,IAAM,CAC3BN,EAAW,EACXF,EAAgB,EAAK,CACvB,EAEMS,EAAc,IAAM,CAExBP,EAAW,EACXF,EAAgB,EAAK,CACvB,EAEA,SACE,oBACE,oBAAC,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QA0DN,KAEF,OAAC,OACC,UAAW,sDAAsDM,GAAa,EAAE,GAChF,MAAO,CAAE,gBAAiBC,EAAO,gBAAiB,UAAW,4BAA6B,OAAQ,GAAK,EAEvG,oBAAC,OAAI,UAAU,+DACb,qBAAC,OAAI,UAAU,0BACb,oBAAC,MACC,UAAU,yCACV,MAAO,CAAE,SAAUA,EAAO,SAAU,MAAO,SAAU,EAEpD,SAAAN,EAAK,QACR,KAGA,OAAC,UACC,QAASQ,EACT,UAAU,iIACV,MAAO,CAAE,MAAO,SAAU,EAC1B,aAAW,QAEX,mBAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAChE,mBAAC,QACC,EAAE,uCACF,OAAO,eACP,YAAY,MACZ,cAAc,QACd,eAAe,QACjB,EACF,EACF,GACF,KAEA,QAAC,OAAI,UAAU,kBAEb,qBAAC,UACC,QAASD,EACT,UAAU,2FACV,MAAO,CACL,gBAAiBD,EAAO,kBACxB,MAAOA,EAAO,oBACd,WAAY,MACZ,SAAUA,EAAO,SACjB,aAAcA,EAAO,mBACrB,OAAQ,MACV,EAEC,UAAAF,GAAe,SACd,OAAC,OAAI,IAAKA,EAAc,KAAM,IAAI,GAAG,MAAO,CAAE,MAAO,OAAQ,OAAQ,OAAQ,aAAc,MAAO,EAAG,EAEtGJ,EAAK,gBACR,KAGA,QAAC,UACC,QAASE,EACT,UAAU,2FACV,MAAO,CACL,gBAAiB,cACjB,MAAOI,EAAO,sBACd,OAAQ,eAAeA,EAAO,uBAAuB,GACrD,WAAY,MACZ,SAAUA,EAAO,SACjB,aAAcA,EAAO,kBACvB,EAEA,oBAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAChE,mBAAC,QACC,EAAE,8lDACF,KAAK,eACP,EACF,EACCN,EAAK,kBACR,GACF,GACF,EACF,GACF,CAEJ",
|
|
6
|
-
"names": ["RegionBanner_exports", "__export", "RegionBanner", "__toCommonJS", "import_jsx_runtime", "defaultStyles", "visible", "onVisibleChange", "copy", "onStayHere", "onSwitchSite", "customStyles", "currentRegion", "className", "styles", "handleStayHere", "handleClose"]
|
|
7
|
-
}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import type { RegionConfig, IPRedirectModalCopy } from './type.js';
|
|
2
|
-
/** 样式配置 */
|
|
3
|
-
export type RegionSelectorModalStyles = {
|
|
4
|
-
/** 弹窗宽度,默认 80% */
|
|
5
|
-
width?: string;
|
|
6
|
-
/** 弹窗最大宽度,默认 1000px */
|
|
7
|
-
maxWidth?: string;
|
|
8
|
-
/** 弹窗内边距,默认 '30px 32px' */
|
|
9
|
-
padding?: string;
|
|
10
|
-
/** 弹窗圆角,默认 16px */
|
|
11
|
-
borderRadius?: string;
|
|
12
|
-
/** 标题字号,默认 20px */
|
|
13
|
-
titleFontSize?: string;
|
|
14
|
-
/** 分组标题字号,默认 inherit */
|
|
15
|
-
groupTitleFontSize?: string;
|
|
16
|
-
/** 卡片高度,默认 56px */
|
|
17
|
-
itemHeight?: string;
|
|
18
|
-
/** 卡片背景色,默认 #f5f5f5 */
|
|
19
|
-
itemBgColor?: string;
|
|
20
|
-
/** 卡片圆角,默认 8px */
|
|
21
|
-
itemBorderRadius?: string;
|
|
22
|
-
/** 卡片间距,默认 8px */
|
|
23
|
-
itemGap?: string;
|
|
24
|
-
/** 每行卡片数量,默认 3 */
|
|
25
|
-
columns?: number;
|
|
26
|
-
};
|
|
27
|
-
export type RegionSelectorModalProps = {
|
|
28
|
-
/** 控制弹窗显示/隐藏 */
|
|
29
|
-
open: boolean;
|
|
30
|
-
/** 弹窗状态变化回调 */
|
|
31
|
-
onOpenChange: (open: boolean) => void;
|
|
32
|
-
/** 地区配置列表 */
|
|
33
|
-
regions: RegionConfig[];
|
|
34
|
-
/** 文案配置 */
|
|
35
|
-
copy: IPRedirectModalCopy;
|
|
36
|
-
/** 用户选择地区后的回调 */
|
|
37
|
-
onConfirm?: (region: RegionConfig) => void;
|
|
38
|
-
/** 是否自动跳转,默认 false */
|
|
39
|
-
autoRedirect?: boolean;
|
|
40
|
-
/** 是否跳转到首页(仅在 autoRedirect 为 true 时生效),默认 false(保留当前路径) */
|
|
41
|
-
redirectToHomepage?: boolean;
|
|
42
|
-
/** 样式配置 */
|
|
43
|
-
styles?: RegionSelectorModalStyles;
|
|
44
|
-
/** 自定义类名 */
|
|
45
|
-
className?: string;
|
|
46
|
-
};
|
|
47
|
-
export declare function RegionSelectorModal({ open, onOpenChange, regions, copy, onConfirm, autoRedirect, redirectToHomepage, styles: customStyles, className, }: RegionSelectorModalProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";var k=Object.create;var g=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var F=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var B=(o,a)=>{for(var l in a)g(o,l,{get:a[l],enumerable:!0})},h=(o,a,l,p)=>{if(a&&typeof a=="object"||typeof a=="function")for(let r of F(a))!$.call(o,r)&&r!==l&&g(o,r,{get:()=>a[r],enumerable:!(p=M(a,r))||p.enumerable});return o};var P=(o,a,l)=>(l=o!=null?k(T(o)):{},h(a||!o||!o.__esModule?g(l,"default",{value:o,enumerable:!0}):l,o)),W=o=>h(g({},"__esModule",{value:!0}),o);var U={};B(U,{RegionSelectorModal:()=>D});module.exports=W(U);var e=require("react/jsx-runtime"),m=require("../../components/index.js"),c=P(require("@radix-ui/react-dialog")),y=require("react"),s=require("./utils.js");const H={width:"80%",maxWidth:"1000px",padding:"0px",borderRadius:"12px",titleFontSize:"24px",groupTitleFontSize:"18px",itemHeight:"54px",itemBgColor:"#F5F6F7",itemBorderRadius:"0px",itemGap:"8px",columns:3};function D({open:o,onOpenChange:a,regions:l,copy:p,onConfirm:r,autoRedirect:w=!1,redirectToHomepage:R=!1,styles:b,className:v}){const i={...H,...b},C=n=>{if(r&&r(n),w){const d=window.location.search;if(R){let t=n.url;if((0,s.hasUtmParams)(d)){const f=(0,s.buildGeoRedirectRefManual)(n.code);t=(0,s.appendRefParam)(t,f)}window.location.href=t}else{const t=window.location.pathname,f=window.location.hash,x=`${n.url.replace(/\/$/,"")}${t}${d}`;let u=x;if((0,s.hasUtmParams)(d)){const N=(0,s.buildGeoRedirectRefManual)(n.code);u=(0,s.appendRefParam)(x,N)}u+=f,window.location.href=u}}a(!1)},S=`calc((100% - ${i.itemGap} * ${i.columns-1}) / ${i.columns})`,z=(0,y.useMemo)(()=>{const n={};return l.forEach(d=>{const t=d.group||"Other";n[t]||(n[t]=[]),n[t].push(d)}),n},[l]);return(0,e.jsx)(c.Root,{open:o,onOpenChange:a,children:(0,e.jsxs)(c.Portal,{children:[(0,e.jsx)("style",{children:`
|
|
2
|
-
.region-item {
|
|
3
|
-
width: 100%;
|
|
4
|
-
}
|
|
5
|
-
@media (min-width: 1024px) {
|
|
6
|
-
.region-item {
|
|
7
|
-
width: ${S};
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
.modal-content {
|
|
11
|
-
padding: 0 16px 32px 16px;
|
|
12
|
-
overflow-y: auto;
|
|
13
|
-
max-height: calc(90vh - 60px);
|
|
14
|
-
-webkit-overflow-scrolling: touch;
|
|
15
|
-
}
|
|
16
|
-
@media (min-width: 1024px) {
|
|
17
|
-
.modal-content {
|
|
18
|
-
padding: 0 32px 32px 32px;
|
|
19
|
-
max-height: none;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
.modal-dialog {
|
|
23
|
-
width: 100% !important;
|
|
24
|
-
max-width: 100% !important;
|
|
25
|
-
}
|
|
26
|
-
@media (min-width: 1024px) {
|
|
27
|
-
.modal-dialog {
|
|
28
|
-
width: ${i.width} !important;
|
|
29
|
-
max-width: ${i.maxWidth} !important;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
`}),(0,e.jsx)(c.Overlay,{className:"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[9998] bg-black/50"}),(0,e.jsx)(c.Content,{className:`modal-dialog data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed left-1/2 top-1/2 z-[9999] max-h-[90vh] -translate-x-1/2 -translate-y-1/2 overflow-y-auto bg-white shadow-lg duration-200 ${v||""}`,style:{padding:i.padding,borderRadius:i.borderRadius},children:(0,e.jsxs)("div",{className:"flex flex-col",children:[(0,e.jsx)("div",{className:"relative flex items-center justify-end p-[16px]",children:(0,e.jsx)(c.Close,{asChild:!0,children:(0,e.jsx)("button",{className:"inline-flex size-[28px] items-center justify-center rounded-full text-[#666] hover:bg-[#f5f5f5] focus:outline-none","aria-label":"Close",children:(0,e.jsx)("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,e.jsx)("path",{d:"M13.5 4.5L4.5 13.5M4.5 4.5L13.5 13.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})})}),(0,e.jsxs)("div",{className:"modal-content flex flex-col gap-[24px]",children:[(0,e.jsx)(c.Title,{asChild:!0,children:(0,e.jsx)(m.Heading,{as:"h2",className:"text-center text-[#1F2021]",style:{fontSize:i.titleFontSize,fontWeight:"700"},children:p.title})}),Object.entries(z).map(([n,d])=>(0,e.jsxs)("div",{className:"flex flex-col gap-[12px]",children:[(0,e.jsx)(m.Text,{size:3,className:"text-left font-semibold text-[#1F2021]",style:{fontSize:i.groupTitleFontSize,fontWeight:"700",marginBottom:"8px"},children:n}),(0,e.jsx)("div",{className:"flex flex-wrap justify-start",style:{gap:i.itemGap},children:d.map(t=>(0,e.jsxs)("button",{onClick:()=>C(t),className:"region-item flex items-center gap-[12px] px-[16px] transition-colors hover:opacity-80",style:{height:i.itemHeight,backgroundColor:i.itemBgColor,borderRadius:i.itemBorderRadius},children:[(0,e.jsx)(m.Text,{size:2,className:"flex-1 text-left font-medium",style:{color:"#000",fontWeight:"700"},children:t.name}),(t.language||t.currency)&&(0,e.jsxs)(m.Text,{size:2,className:"shrink-0 text-[16px]",style:{color:"#767880"},children:[t.language,t.language&&t.currency&&" / ",t.currency]})]},t.code))})]},n))]})]})})]})})}
|
|
33
|
-
//# sourceMappingURL=RegionSelectorModal.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/biz-components/IPRedirect/RegionSelectorModal.tsx"],
|
|
4
|
-
"sourcesContent": ["import { Heading, Text } from '../../components/index.js'\nimport * as Dialog from '@radix-ui/react-dialog'\nimport { useMemo } from 'react'\nimport type { RegionConfig, IPRedirectModalCopy } from './type.js'\nimport { hasUtmParams, buildGeoRedirectRefManual, appendRefParam } from './utils.js'\n\n/** \u6837\u5F0F\u914D\u7F6E */\nexport type RegionSelectorModalStyles = {\n /** \u5F39\u7A97\u5BBD\u5EA6\uFF0C\u9ED8\u8BA4 80% */\n width?: string\n /** \u5F39\u7A97\u6700\u5927\u5BBD\u5EA6\uFF0C\u9ED8\u8BA4 1000px */\n maxWidth?: string\n /** \u5F39\u7A97\u5185\u8FB9\u8DDD\uFF0C\u9ED8\u8BA4 '30px 32px' */\n padding?: string\n /** \u5F39\u7A97\u5706\u89D2\uFF0C\u9ED8\u8BA4 16px */\n borderRadius?: string\n /** \u6807\u9898\u5B57\u53F7\uFF0C\u9ED8\u8BA4 20px */\n titleFontSize?: string\n /** \u5206\u7EC4\u6807\u9898\u5B57\u53F7\uFF0C\u9ED8\u8BA4 inherit */\n groupTitleFontSize?: string\n /** \u5361\u7247\u9AD8\u5EA6\uFF0C\u9ED8\u8BA4 56px */\n itemHeight?: string\n /** \u5361\u7247\u80CC\u666F\u8272\uFF0C\u9ED8\u8BA4 #f5f5f5 */\n itemBgColor?: string\n /** \u5361\u7247\u5706\u89D2\uFF0C\u9ED8\u8BA4 8px */\n itemBorderRadius?: string\n /** \u5361\u7247\u95F4\u8DDD\uFF0C\u9ED8\u8BA4 8px */\n itemGap?: string\n /** \u6BCF\u884C\u5361\u7247\u6570\u91CF\uFF0C\u9ED8\u8BA4 3 */\n columns?: number\n}\n\nexport type RegionSelectorModalProps = {\n /** \u63A7\u5236\u5F39\u7A97\u663E\u793A/\u9690\u85CF */\n open: boolean\n /** \u5F39\u7A97\u72B6\u6001\u53D8\u5316\u56DE\u8C03 */\n onOpenChange: (open: boolean) => void\n /** \u5730\u533A\u914D\u7F6E\u5217\u8868 */\n regions: RegionConfig[]\n /** \u6587\u6848\u914D\u7F6E */\n copy: IPRedirectModalCopy\n /** \u7528\u6237\u9009\u62E9\u5730\u533A\u540E\u7684\u56DE\u8C03 */\n onConfirm?: (region: RegionConfig) => void\n /** \u662F\u5426\u81EA\u52A8\u8DF3\u8F6C\uFF0C\u9ED8\u8BA4 false */\n autoRedirect?: boolean\n /** \u662F\u5426\u8DF3\u8F6C\u5230\u9996\u9875\uFF08\u4EC5\u5728 autoRedirect \u4E3A true \u65F6\u751F\u6548\uFF09\uFF0C\u9ED8\u8BA4 false\uFF08\u4FDD\u7559\u5F53\u524D\u8DEF\u5F84\uFF09 */\n redirectToHomepage?: boolean\n /** \u6837\u5F0F\u914D\u7F6E */\n styles?: RegionSelectorModalStyles\n /** \u81EA\u5B9A\u4E49\u7C7B\u540D */\n className?: string\n}\n\n// \u9ED8\u8BA4\u6837\u5F0F\nconst defaultStyles: Required<RegionSelectorModalStyles> = {\n width: '80%',\n maxWidth: '1000px',\n padding: '0px',\n borderRadius: '12px',\n titleFontSize: '24px',\n groupTitleFontSize: '18px',\n itemHeight: '54px',\n itemBgColor: '#F5F6F7',\n itemBorderRadius: '0px',\n itemGap: '8px',\n columns: 3,\n}\n\nexport function RegionSelectorModal({\n open,\n onOpenChange,\n regions,\n copy,\n onConfirm,\n autoRedirect = false,\n redirectToHomepage = false,\n styles: customStyles,\n className,\n}: RegionSelectorModalProps) {\n // \u5408\u5E76\u9ED8\u8BA4\u6837\u5F0F\u548C\u81EA\u5B9A\u4E49\u6837\u5F0F\n const styles = { ...defaultStyles, ...customStyles }\n\n // \u5904\u7406\u5730\u533A\u9009\u62E9\n const handleRegionClick = (region: RegionConfig) => {\n // \u5982\u679C\u6709\u81EA\u5B9A\u4E49\u56DE\u8C03\uFF0C\u5148\u6267\u884C\u56DE\u8C03\n if (onConfirm) {\n onConfirm(region)\n }\n\n // \u5982\u679C\u5F00\u542F\u4E86\u81EA\u52A8\u8DF3\u8F6C\n if (autoRedirect) {\n const currentSearch = window.location.search\n\n if (redirectToHomepage) {\n // \u8DF3\u8F6C\u5230\u76EE\u6807\u5730\u533A\u9996\u9875\n let targetUrl = region.url\n\n // \u5982\u679C\u6709 UTM \u53C2\u6570\uFF0C\u6DFB\u52A0 ref \u53C2\u6570\n if (hasUtmParams(currentSearch)) {\n const refValue = buildGeoRedirectRefManual(region.code)\n targetUrl = appendRefParam(targetUrl, refValue)\n }\n\n window.location.href = targetUrl\n } else {\n // \u4FDD\u7559\u5F53\u524D\u8DEF\u5F84\u548C\u53C2\u6570\u8DF3\u8F6C\n const currentPath = window.location.pathname\n const currentHash = window.location.hash\n const targetBaseUrl = region.url.replace(/\\/$/, '')\n const baseUrl = `${targetBaseUrl}${currentPath}${currentSearch}`\n\n // \u5982\u679C\u6709 UTM \u53C2\u6570\uFF0C\u6DFB\u52A0 ref \u53C2\u6570\n let fullTargetUrl = baseUrl\n if (hasUtmParams(currentSearch)) {\n const refValue = buildGeoRedirectRefManual(region.code)\n fullTargetUrl = appendRefParam(baseUrl, refValue)\n }\n\n // \u6DFB\u52A0 hash\n fullTargetUrl += currentHash\n\n window.location.href = fullTargetUrl\n }\n }\n\n // \u5173\u95ED\u5F39\u7A97\n onOpenChange(false)\n }\n\n // \u8BA1\u7B97\u5361\u7247\u5BBD\u5EA6\n const itemWidth = `calc((100% - ${styles.itemGap} * ${styles.columns - 1}) / ${styles.columns})`\n\n // \u6309\u5206\u7EC4\u6574\u7406\u5730\u533A\n const groupedRegions = useMemo(() => {\n const groups: Record<string, RegionConfig[]> = {}\n regions.forEach(region => {\n const group = region.group || 'Other'\n if (!groups[group]) {\n groups[group] = []\n }\n groups[group].push(region)\n })\n return groups\n }, [regions])\n\n return (\n <Dialog.Root open={open} onOpenChange={onOpenChange}>\n <Dialog.Portal>\n <style>{`\n .region-item {\n width: 100%;\n }\n @media (min-width: 1024px) {\n .region-item {\n width: ${itemWidth};\n }\n }\n .modal-content {\n padding: 0 16px 32px 16px;\n overflow-y: auto;\n max-height: calc(90vh - 60px);\n -webkit-overflow-scrolling: touch;\n }\n @media (min-width: 1024px) {\n .modal-content {\n padding: 0 32px 32px 32px;\n max-height: none;\n }\n }\n .modal-dialog {\n width: 100% !important;\n max-width: 100% !important;\n }\n @media (min-width: 1024px) {\n .modal-dialog {\n width: ${styles.width} !important;\n max-width: ${styles.maxWidth} !important;\n }\n }\n `}</style>\n <Dialog.Overlay className=\"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-[9998] bg-black/50\" />\n <Dialog.Content\n className={`modal-dialog data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed left-1/2 top-1/2 z-[9999] max-h-[90vh] -translate-x-1/2 -translate-y-1/2 overflow-y-auto bg-white shadow-lg duration-200 ${className || ''}`}\n style={{\n padding: styles.padding,\n borderRadius: styles.borderRadius,\n }}\n >\n <div className=\"flex flex-col\">\n {/* \u5934\u90E8\uFF1A\u5173\u95ED\u6309\u94AE */}\n <div className=\"relative flex items-center justify-end p-[16px]\">\n <Dialog.Close asChild>\n <button\n className=\"inline-flex size-[28px] items-center justify-center rounded-full text-[#666] hover:bg-[#f5f5f5] focus:outline-none\"\n aria-label=\"Close\"\n >\n <svg width=\"18\" height=\"18\" viewBox=\"0 0 18 18\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path\n d=\"M13.5 4.5L4.5 13.5M4.5 4.5L13.5 13.5\"\n stroke=\"currentColor\"\n strokeWidth=\"1.5\"\n strokeLinecap=\"round\"\n strokeLinejoin=\"round\"\n />\n </svg>\n </button>\n </Dialog.Close>\n </div>\n\n {/* \u5185\u5BB9\u533A\u57DF */}\n <div className=\"modal-content flex flex-col gap-[24px]\">\n {/* \u6807\u9898 */}\n <Dialog.Title asChild>\n <Heading\n as=\"h2\"\n className=\"text-center text-[#1F2021]\"\n style={{ fontSize: styles.titleFontSize, fontWeight: '700' }}\n >\n {copy.title}\n </Heading>\n </Dialog.Title>\n {Object.entries(groupedRegions).map(([groupName, groupRegions]) => (\n <div key={groupName} className=\"flex flex-col gap-[12px]\">\n {/* \u5206\u7EC4\u6807\u9898 */}\n <Text\n size={3 as any}\n className=\"text-left font-semibold text-[#1F2021]\"\n style={{ fontSize: styles.groupTitleFontSize, fontWeight: '700', marginBottom: '8px' }}\n >\n {groupName}\n </Text>\n {/* \u5730\u533A\u5361\u7247\u7F51\u683C */}\n <div className=\"flex flex-wrap justify-start\" style={{ gap: styles.itemGap }}>\n {groupRegions.map(region => (\n <button\n key={region.code}\n onClick={() => handleRegionClick(region)}\n className=\"region-item flex items-center gap-[12px] px-[16px] transition-colors hover:opacity-80\"\n style={{\n height: styles.itemHeight,\n backgroundColor: styles.itemBgColor,\n borderRadius: styles.itemBorderRadius,\n }}\n >\n {/* \u56FD\u5BB6\u540D\u79F0 */}\n <Text\n size={2 as any}\n className=\"flex-1 text-left font-medium\"\n style={{ color: '#000', fontWeight: '700' }}\n >\n {region.name}\n </Text>\n {/* \u8BED\u8A00 / \u8D27\u5E01 */}\n {(region.language || region.currency) && (\n <Text size={2 as any} className=\"shrink-0 text-[16px]\" style={{ color: '#767880' }}>\n {region.language}\n {region.language && region.currency && ' / '}\n {region.currency}\n </Text>\n )}\n </button>\n ))}\n </div>\n </div>\n ))}\n </div>\n </div>\n </Dialog.Content>\n </Dialog.Portal>\n </Dialog.Root>\n )\n}\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["RegionSelectorModal_exports", "__export", "RegionSelectorModal", "__toCommonJS", "import_jsx_runtime", "import_components", "Dialog", "import_react", "import_utils", "defaultStyles", "open", "onOpenChange", "regions", "copy", "onConfirm", "autoRedirect", "redirectToHomepage", "customStyles", "className", "styles", "handleRegionClick", "region", "currentSearch", "targetUrl", "refValue", "currentPath", "currentHash", "baseUrl", "fullTargetUrl", "itemWidth", "groupedRegions", "groups", "group", "groupName", "groupRegions"]
|
|
7
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
export { RegionSelectorModal } from './RegionSelectorModal.js';
|
|
2
|
-
export { RegionBanner } from './RegionBanner.js';
|
|
3
|
-
export { RegionSelectorModal as default } from './RegionSelectorModal.js';
|
|
4
|
-
export { useRegionRedirectManager } from './useRegionRedirectManager.js';
|
|
5
|
-
export { generateRegionToPathMap, isPathInWhitelist, validateRegionConfig, localeToRegionCode, buildGeoRedirectRef, buildGeoRedirectRefManual, } from './utils.js';
|
|
6
|
-
export type { RegionSelectorModalProps, RegionSelectorModalStyles } from './RegionSelectorModal.js';
|
|
7
|
-
export type { RegionBannerProps, RegionBannerStyles } from './RegionBanner.js';
|
|
8
|
-
export type { UseRegionRedirectManagerOptions, UseRegionRedirectManagerReturn } from './useRegionRedirectManager.js';
|
|
9
|
-
export type { RegionConfig, IPRedirectModalCopy, IPRedirectBannerCopy, RegionToPathMap, CountryToRegionMap, } from './type.js';
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var i=Object.defineProperty;var d=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var c=Object.prototype.hasOwnProperty;var f=(r,o)=>{for(var t in o)i(r,t,{get:o[t],enumerable:!0})},M=(r,o,t,a)=>{if(o&&typeof o=="object"||typeof o=="function")for(let n of s(o))!c.call(r,n)&&n!==t&&i(r,n,{get:()=>o[n],enumerable:!(a=d(o,n))||a.enumerable});return r};var y=r=>M(i({},"__esModule",{value:!0}),r);var m={};f(m,{RegionBanner:()=>g.RegionBanner,RegionSelectorModal:()=>R.RegionSelectorModal,buildGeoRedirectRef:()=>e.buildGeoRedirectRef,buildGeoRedirectRefManual:()=>e.buildGeoRedirectRefManual,default:()=>p.RegionSelectorModal,generateRegionToPathMap:()=>e.generateRegionToPathMap,isPathInWhitelist:()=>e.isPathInWhitelist,localeToRegionCode:()=>e.localeToRegionCode,useRegionRedirectManager:()=>l.useRegionRedirectManager,validateRegionConfig:()=>e.validateRegionConfig});module.exports=y(m);var R=require("./RegionSelectorModal.js"),g=require("./RegionBanner.js"),p=require("./RegionSelectorModal.js"),l=require("./useRegionRedirectManager.js"),e=require("./utils.js");
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/biz-components/IPRedirect/index.ts"],
|
|
4
|
-
"sourcesContent": ["// ============================================\n// \u516C\u5171 API - UI \u7EC4\u4EF6\n// ============================================\nexport { RegionSelectorModal } from './RegionSelectorModal.js'\nexport { RegionBanner } from './RegionBanner.js'\nexport { RegionSelectorModal as default } from './RegionSelectorModal.js'\n\n// ============================================\n// \u516C\u5171 API - \u7EDF\u4E00 Hook\uFF08\u63A8\u8350\u4F7F\u7528\uFF09\n// ============================================\nexport { useRegionRedirectManager } from './useRegionRedirectManager.js'\n\n// ============================================\n// \u516C\u5171 API - \u5DE5\u5177\u51FD\u6570\n// ============================================\nexport {\n generateRegionToPathMap,\n isPathInWhitelist,\n validateRegionConfig,\n localeToRegionCode,\n buildGeoRedirectRef,\n buildGeoRedirectRefManual,\n} from './utils.js'\n\n// ============================================\n// \u516C\u5171 API - \u7C7B\u578B\u5B9A\u4E49\n// ============================================\nexport type { RegionSelectorModalProps, RegionSelectorModalStyles } from './RegionSelectorModal.js'\nexport type { RegionBannerProps, RegionBannerStyles } from './RegionBanner.js'\nexport type { UseRegionRedirectManagerOptions, UseRegionRedirectManagerReturn } from './useRegionRedirectManager.js'\nexport type {\n RegionConfig,\n IPRedirectModalCopy,\n IPRedirectBannerCopy,\n RegionToPathMap,\n CountryToRegionMap,\n} from './type.js'\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,8dAAAE,EAAAF,GAGA,IAAAG,EAAoC,oCACpCC,EAA6B,6BAC7BD,EAA+C,oCAK/CE,EAAyC,yCAKzCC,EAOO",
|
|
6
|
-
"names": ["IPRedirect_exports", "__export", "__toCommonJS", "import_RegionSelectorModal", "import_RegionBanner", "import_useRegionRedirectManager", "import_utils"]
|
|
7
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export type RegionConfig = {
|
|
2
|
-
code: string;
|
|
3
|
-
name: string;
|
|
4
|
-
url: string;
|
|
5
|
-
group?: string;
|
|
6
|
-
language?: string;
|
|
7
|
-
languageCode?: string;
|
|
8
|
-
currency?: string;
|
|
9
|
-
icon?: string;
|
|
10
|
-
};
|
|
11
|
-
export type IPRedirectModalCopy = {
|
|
12
|
-
title: string;
|
|
13
|
-
};
|
|
14
|
-
export type IPRedirectBannerCopy = {
|
|
15
|
-
message: string;
|
|
16
|
-
stayButtonText: string;
|
|
17
|
-
switchButtonText: string;
|
|
18
|
-
};
|
|
19
|
-
/**
|
|
20
|
-
* 地区代码到路径前缀的映射
|
|
21
|
-
* @example { US: '', CA: 'ca', DE: 'eu-de', UK: 'uk' }
|
|
22
|
-
*/
|
|
23
|
-
export type RegionToPathMap = Record<string, string>;
|
|
24
|
-
/**
|
|
25
|
-
* 国家代码到地区代码的映射
|
|
26
|
-
* @example { US: 'US', GB: 'UK', HK: 'DE' }
|
|
27
|
-
*/
|
|
28
|
-
export type CountryToRegionMap = Record<string, string>;
|
|
29
|
-
/**
|
|
30
|
-
* 配置验证结果
|
|
31
|
-
*/
|
|
32
|
-
export type ValidationResult = {
|
|
33
|
-
valid: boolean;
|
|
34
|
-
error?: string;
|
|
35
|
-
mappedRegion?: string;
|
|
36
|
-
};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var i=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var s=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var a=(e,t,g,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of s(t))!p.call(e,r)&&r!==g&&i(e,r,{get:()=>t[r],enumerable:!(n=o(t,r))||n.enumerable});return e};var y=e=>a(i({},"__esModule",{value:!0}),e);var d={};module.exports=y(d);
|
|
2
|
-
//# sourceMappingURL=type.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/biz-components/IPRedirect/type.ts"],
|
|
4
|
-
"sourcesContent": ["export type RegionConfig = {\n code: string // \u56FD\u5BB6/\u5730\u533A\u4EE3\u7801\uFF0C\u5982 'US', 'CN', 'DE'\n name: string // \u663E\u793A\u540D\u79F0\uFF0C\u5982 'United States', '\u4E2D\u56FD'\n url: string // \u8DF3\u8F6C\u76EE\u6807 URL\n group?: string // \u5206\u7EC4\u540D\u79F0\uFF0C\u5982 'North America', 'Europe', 'Asia-Pacific'\n language?: string // \u663E\u793A\u7684\u8BED\u8A00\u540D\u79F0\uFF0C\u5982 'English', 'Deutsch'\n languageCode?: string // \u8BED\u8A00\u4EE3\u7801\uFF0C\u5982 'EN', 'DE', 'FR'\uFF08\u7528\u4E8E\u4FDD\u5B58\u5230 cookie\uFF09\n currency?: string // \u8D27\u5E01\u7B26\u53F7\uFF0C\u5982 '$', '\u20AC', '\u00A5'\n icon?: string // \u56FD\u5BB6/\u5730\u533A\u56FE\u6807 URL\uFF0C\u5982 '/icons/us.png'\n}\n\nexport type IPRedirectModalCopy = {\n title: string // \u5F39\u7A97\u6807\u9898\n}\n\nexport type IPRedirectBannerCopy = {\n message: string // \u6A2A\u5E45\u63D0\u793A\u6587\u6848\n stayButtonText: string // \"Stay Here\" \u6309\u94AE\u6587\u6848\n switchButtonText: string // \"Switch Site\" \u6309\u94AE\u6587\u6848\n}\n\n/**\n * \u5730\u533A\u4EE3\u7801\u5230\u8DEF\u5F84\u524D\u7F00\u7684\u6620\u5C04\n * @example { US: '', CA: 'ca', DE: 'eu-de', UK: 'uk' }\n */\nexport type RegionToPathMap = Record<string, string>\n\n/**\n * \u56FD\u5BB6\u4EE3\u7801\u5230\u5730\u533A\u4EE3\u7801\u7684\u6620\u5C04\n * @example { US: 'US', GB: 'UK', HK: 'DE' }\n */\nexport type CountryToRegionMap = Record<string, string>\n\n/**\n * \u914D\u7F6E\u9A8C\u8BC1\u7ED3\u679C\n */\nexport type ValidationResult = {\n valid: boolean // \u662F\u5426\u901A\u8FC7\u9A8C\u8BC1\n error?: string // \u9519\u8BEF\u4FE1\u606F\uFF08\u9A8C\u8BC1\u5931\u8D25\u65F6\uFF09\n mappedRegion?: string // \u6620\u5C04\u7684\u5730\u533A\u4EE3\u7801\uFF08\u9A8C\u8BC1\u6210\u529F\u65F6\uFF09\n}\n"],
|
|
5
|
-
"mappings": "+WAAA,IAAAA,EAAA,kBAAAC,EAAAD",
|
|
6
|
-
"names": ["type_exports", "__toCommonJS"]
|
|
7
|
-
}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { RegionConfig } from './type.js';
|
|
2
|
-
export interface UseAutoRedirectOptions {
|
|
3
|
-
/**
|
|
4
|
-
* 地区配置列表
|
|
5
|
-
*/
|
|
6
|
-
regions: RegionConfig[];
|
|
7
|
-
/**
|
|
8
|
-
* 地区代码到路径前缀的映射
|
|
9
|
-
* @example { US: '', CA: 'ca', DE: 'eu-de' }
|
|
10
|
-
*/
|
|
11
|
-
regionToPathMap: Record<string, string>;
|
|
12
|
-
/**
|
|
13
|
-
* 地理位置信息(包含国家代码)
|
|
14
|
-
*/
|
|
15
|
-
geo?: {
|
|
16
|
-
country?: {
|
|
17
|
-
code?: string;
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
/**
|
|
21
|
-
* 当前站点的 locale
|
|
22
|
-
*/
|
|
23
|
-
locale?: string;
|
|
24
|
-
/**
|
|
25
|
-
* 是否检查目标站点页面存在(需要实现 /api/check-page-exists 接口)
|
|
26
|
-
* @default true
|
|
27
|
-
*/
|
|
28
|
-
checkPageExists?: boolean;
|
|
29
|
-
/**
|
|
30
|
-
* 页面存在检查的 API 端点
|
|
31
|
-
* @default '/api/check-page-exists'
|
|
32
|
-
*/
|
|
33
|
-
checkPageApiEndpoint?: string;
|
|
34
|
-
}
|
|
35
|
-
export interface UseAutoRedirectReturn {
|
|
36
|
-
/**
|
|
37
|
-
* 自动跳转到指定地区的函数
|
|
38
|
-
* @param region - 目标地区配置
|
|
39
|
-
* @param isCookieRedirect - 是否是通过 cookie 记忆触发的跳转
|
|
40
|
-
*/
|
|
41
|
-
handleAutoRedirect: (region: RegionConfig, isCookieRedirect?: boolean) => Promise<void>;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* 自动跳转 Hook
|
|
45
|
-
* 处理地区跳转的核心逻辑,包括:
|
|
46
|
-
* - 路径保留和转换
|
|
47
|
-
* - 页面存在检查(可选)
|
|
48
|
-
* - UTM 参数处理
|
|
49
|
-
* - sessionStorage 标记
|
|
50
|
-
*
|
|
51
|
-
* @example
|
|
52
|
-
* ```tsx
|
|
53
|
-
* const { handleAutoRedirect } = useAutoRedirect({
|
|
54
|
-
* regions,
|
|
55
|
-
* regionToPathMap,
|
|
56
|
-
* geo,
|
|
57
|
-
* locale,
|
|
58
|
-
* checkPageExists: true,
|
|
59
|
-
* })
|
|
60
|
-
*
|
|
61
|
-
* // 当检测到地区不匹配时
|
|
62
|
-
* const targetRegion = regions.find(r => r.code === 'DE')
|
|
63
|
-
* await handleAutoRedirect(targetRegion)
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
export declare function useAutoRedirect(options: UseAutoRedirectOptions): UseAutoRedirectReturn;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var h=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var P=Object.getOwnPropertyNames;var k=Object.prototype.hasOwnProperty;var x=(c,r)=>{for(var n in r)h(c,n,{get:r[n],enumerable:!0})},C=(c,r,n,o)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of P(r))!k.call(c,i)&&i!==n&&h(c,i,{get:()=>r[i],enumerable:!(o=U(r,i))||o.enumerable});return c};var b=c=>C(h({},"__esModule",{value:!0}),c);var L={};x(L,{useAutoRedirect:()=>E});module.exports=b(L);var R=require("react"),e=require("./utils.js");function E(c){const{regions:r,regionToPathMap:n,geo:o,locale:i,checkPageExists:g=!0,checkPageApiEndpoint:p="/api/check-page-exists"}=c;return{handleAutoRedirect:(0,R.useCallback)(async(s,$=!1)=>{if(typeof window>"u")return;$?sessionStorage.setItem("cookie_redirected","true"):(sessionStorage.setItem("auto_redirected","true"),sessionStorage.setItem("auto_redirect_from",i||"US"));const m=(0,e.generateAllLocales)(n),u=(0,e.removeLocalePrefix)(window.location.pathname,m);let t;if(g)try{const a=n[s.code]||s.code.toLowerCase(),d=await fetch(`${p}?locale=${encodeURIComponent(a)}&path=${encodeURIComponent(u)}`),{exists:f}=await d.json();if(f){const l=window.location.search,w=window.location.hash;if((0,e.hasUtmParams)(l)&&o?.country?.code){const y=(0,e.buildGeoRedirectRef)(o.country.code),A=`${s.url}${u}${l}`;t=`${(0,e.appendRefParam)(A,y)}${w}`}else t=`${s.url}${u}${l}${w}`}else if(t=s.url,(0,e.hasUtmParams)(window.location.search)&&o?.country?.code){const l=(0,e.buildGeoRedirectRef)(o.country.code);t=(0,e.appendRefParam)(t,l)}}catch(a){if(console.error("Error checking page during redirect:",a),t=s.url,(0,e.hasUtmParams)(window.location.search)&&o?.country?.code){const d=(0,e.buildGeoRedirectRef)(o.country.code);t=(0,e.appendRefParam)(t,d)}}else{const a=window.location.search,d=window.location.hash;if((0,e.hasUtmParams)(a)&&o?.country?.code){const f=(0,e.buildGeoRedirectRef)(o.country.code),l=`${s.url}${u}${a}`;t=`${(0,e.appendRefParam)(l,f)}${d}`}else t=`${s.url}${u}${a}${d}`}window.location.href=t},[i,n,o,g,p])}}
|
|
2
|
-
//# sourceMappingURL=useAutoRedirect.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/biz-components/IPRedirect/useAutoRedirect.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useCallback } from 'react'\nimport { generateAllLocales, removeLocalePrefix, hasUtmParams, buildGeoRedirectRef, appendRefParam } from './utils.js'\nimport type { RegionConfig } from './type.js'\n\nexport interface UseAutoRedirectOptions {\n /**\n * \u5730\u533A\u914D\u7F6E\u5217\u8868\n */\n regions: RegionConfig[]\n\n /**\n * \u5730\u533A\u4EE3\u7801\u5230\u8DEF\u5F84\u524D\u7F00\u7684\u6620\u5C04\n * @example { US: '', CA: 'ca', DE: 'eu-de' }\n */\n regionToPathMap: Record<string, string>\n\n /**\n * \u5730\u7406\u4F4D\u7F6E\u4FE1\u606F\uFF08\u5305\u542B\u56FD\u5BB6\u4EE3\u7801\uFF09\n */\n geo?: {\n country?: {\n code?: string\n }\n }\n\n /**\n * \u5F53\u524D\u7AD9\u70B9\u7684 locale\n */\n locale?: string\n\n /**\n * \u662F\u5426\u68C0\u67E5\u76EE\u6807\u7AD9\u70B9\u9875\u9762\u5B58\u5728\uFF08\u9700\u8981\u5B9E\u73B0 /api/check-page-exists \u63A5\u53E3\uFF09\n * @default true\n */\n checkPageExists?: boolean\n\n /**\n * \u9875\u9762\u5B58\u5728\u68C0\u67E5\u7684 API \u7AEF\u70B9\n * @default '/api/check-page-exists'\n */\n checkPageApiEndpoint?: string\n}\n\nexport interface UseAutoRedirectReturn {\n /**\n * \u81EA\u52A8\u8DF3\u8F6C\u5230\u6307\u5B9A\u5730\u533A\u7684\u51FD\u6570\n * @param region - \u76EE\u6807\u5730\u533A\u914D\u7F6E\n * @param isCookieRedirect - \u662F\u5426\u662F\u901A\u8FC7 cookie \u8BB0\u5FC6\u89E6\u53D1\u7684\u8DF3\u8F6C\n */\n handleAutoRedirect: (region: RegionConfig, isCookieRedirect?: boolean) => Promise<void>\n}\n\n/**\n * \u81EA\u52A8\u8DF3\u8F6C Hook\n * \u5904\u7406\u5730\u533A\u8DF3\u8F6C\u7684\u6838\u5FC3\u903B\u8F91\uFF0C\u5305\u62EC\uFF1A\n * - \u8DEF\u5F84\u4FDD\u7559\u548C\u8F6C\u6362\n * - \u9875\u9762\u5B58\u5728\u68C0\u67E5\uFF08\u53EF\u9009\uFF09\n * - UTM \u53C2\u6570\u5904\u7406\n * - sessionStorage \u6807\u8BB0\n *\n * @example\n * ```tsx\n * const { handleAutoRedirect } = useAutoRedirect({\n * regions,\n * regionToPathMap,\n * geo,\n * locale,\n * checkPageExists: true,\n * })\n *\n * // \u5F53\u68C0\u6D4B\u5230\u5730\u533A\u4E0D\u5339\u914D\u65F6\n * const targetRegion = regions.find(r => r.code === 'DE')\n * await handleAutoRedirect(targetRegion)\n * ```\n */\nexport function useAutoRedirect(options: UseAutoRedirectOptions): UseAutoRedirectReturn {\n const {\n regions,\n regionToPathMap,\n geo,\n locale,\n checkPageExists = true,\n checkPageApiEndpoint = '/api/check-page-exists',\n } = options\n\n const handleAutoRedirect = useCallback(\n async (region: RegionConfig, isCookieRedirect = false) => {\n if (typeof window === 'undefined') return\n\n // \u6807\u8BB0\u8DF3\u8F6C\u7C7B\u578B\n if (isCookieRedirect) {\n sessionStorage.setItem('cookie_redirected', 'true')\n } else {\n sessionStorage.setItem('auto_redirected', 'true')\n sessionStorage.setItem('auto_redirect_from', locale || 'US')\n }\n\n // \u53BB\u9664\u5F53\u524D\u8DEF\u5F84\u4E2D\u7684 locale \u524D\u7F00\n const allLocales = generateAllLocales(regionToPathMap)\n const pathWithoutLocale = removeLocalePrefix(window.location.pathname, allLocales)\n\n let targetUrl: string\n\n // \u68C0\u67E5\u76EE\u6807\u7AD9\u70B9\u662F\u5426\u6709\u5F53\u524D\u9875\u9762\n if (checkPageExists) {\n try {\n // \u5C06 region code \u8F6C\u6362\u4E3A locale (\u5982 DE -> eu-de, CA -> ca)\n const targetLocale = regionToPathMap[region.code] || region.code.toLowerCase()\n\n // \u8C03\u7528 API \u68C0\u67E5\u9875\u9762\u662F\u5426\u5B58\u5728\n const response = await fetch(\n `${checkPageApiEndpoint}?locale=${encodeURIComponent(\n targetLocale\n )}&path=${encodeURIComponent(pathWithoutLocale)}`\n )\n const { exists: pageExists } = await response.json()\n\n if (pageExists) {\n // \u9875\u9762\u5B58\u5728\uFF0C\u4FDD\u7559\u5F53\u524D\u8DEF\u5F84\n const currentSearch = window.location.search\n const currentHash = window.location.hash\n\n // \u5982\u679C\u6709 UTM \u53C2\u6570\uFF0C\u6DFB\u52A0 ref \u53C2\u6570\n if (hasUtmParams(currentSearch) && geo?.country?.code) {\n const refValue = buildGeoRedirectRef(geo.country.code)\n // \u5148\u62FC\u63A5\u57FA\u7840 URL\uFF08\u4E0D\u542B hash\uFF09\uFF0C\u7136\u540E\u6DFB\u52A0 ref\uFF0C\u6700\u540E\u52A0 hash\n const baseUrl = `${region.url}${pathWithoutLocale}${currentSearch}`\n targetUrl = `${appendRefParam(baseUrl, refValue)}${currentHash}`\n } else {\n targetUrl = `${region.url}${pathWithoutLocale}${currentSearch}${currentHash}`\n }\n } else {\n // \u9875\u9762\u4E0D\u5B58\u5728\uFF0C\u8DF3\u8F6C\u5230\u9996\u9875\n targetUrl = region.url\n\n // \u5982\u679C\u6709 UTM \u53C2\u6570\uFF0C\u6DFB\u52A0 ref \u53C2\u6570\n if (hasUtmParams(window.location.search) && geo?.country?.code) {\n const refValue = buildGeoRedirectRef(geo.country.code)\n targetUrl = appendRefParam(targetUrl, refValue)\n }\n }\n } catch (error) {\n // \u68C0\u67E5\u51FA\u9519\uFF0C\u8DF3\u8F6C\u5230\u9996\u9875\u66F4\u5B89\u5168\n console.error('Error checking page during redirect:', error)\n targetUrl = region.url\n\n // \u5982\u679C\u6709 UTM \u53C2\u6570\uFF0C\u6DFB\u52A0 ref \u53C2\u6570\n if (hasUtmParams(window.location.search) && geo?.country?.code) {\n const refValue = buildGeoRedirectRef(geo.country.code)\n targetUrl = appendRefParam(targetUrl, refValue)\n }\n }\n } else {\n // \u4E0D\u68C0\u67E5\u9875\u9762\u5B58\u5728\uFF0C\u76F4\u63A5\u6784\u5EFA URL\n const currentSearch = window.location.search\n const currentHash = window.location.hash\n\n // \u5982\u679C\u6709 UTM \u53C2\u6570\uFF0C\u6DFB\u52A0 ref \u53C2\u6570\n if (hasUtmParams(currentSearch) && geo?.country?.code) {\n const refValue = buildGeoRedirectRef(geo.country.code)\n const baseUrl = `${region.url}${pathWithoutLocale}${currentSearch}`\n targetUrl = `${appendRefParam(baseUrl, refValue)}${currentHash}`\n } else {\n targetUrl = `${region.url}${pathWithoutLocale}${currentSearch}${currentHash}`\n }\n }\n\n // \u6267\u884C\u8DF3\u8F6C\n window.location.href = targetUrl\n },\n [locale, regionToPathMap, geo, checkPageExists, checkPageApiEndpoint]\n )\n\n return { handleAutoRedirect }\n}\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,qBAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA4B,iBAC5BC,EAA0G,sBA0EnG,SAASH,EAAgBI,EAAwD,CACtF,KAAM,CACJ,QAAAC,EACA,gBAAAC,EACA,IAAAC,EACA,OAAAC,EACA,gBAAAC,EAAkB,GAClB,qBAAAC,EAAuB,wBACzB,EAAIN,EA0FJ,MAAO,CAAE,sBAxFkB,eACzB,MAAOO,EAAsBC,EAAmB,KAAU,CACxD,GAAI,OAAO,OAAW,IAAa,OAG/BA,EACF,eAAe,QAAQ,oBAAqB,MAAM,GAElD,eAAe,QAAQ,kBAAmB,MAAM,EAChD,eAAe,QAAQ,qBAAsBJ,GAAU,IAAI,GAI7D,MAAMK,KAAa,sBAAmBP,CAAe,EAC/CQ,KAAoB,sBAAmB,OAAO,SAAS,SAAUD,CAAU,EAEjF,IAAIE,EAGJ,GAAIN,EACF,GAAI,CAEF,MAAMO,EAAeV,EAAgBK,EAAO,IAAI,GAAKA,EAAO,KAAK,YAAY,EAGvEM,EAAW,MAAM,MACrB,GAAGP,CAAoB,WAAW,mBAChCM,CACF,CAAC,SAAS,mBAAmBF,CAAiB,CAAC,EACjD,EACM,CAAE,OAAQI,CAAW,EAAI,MAAMD,EAAS,KAAK,EAEnD,GAAIC,EAAY,CAEd,MAAMC,EAAgB,OAAO,SAAS,OAChCC,EAAc,OAAO,SAAS,KAGpC,MAAI,gBAAaD,CAAa,GAAKZ,GAAK,SAAS,KAAM,CACrD,MAAMc,KAAW,uBAAoBd,EAAI,QAAQ,IAAI,EAE/Ce,EAAU,GAAGX,EAAO,GAAG,GAAGG,CAAiB,GAAGK,CAAa,GACjEJ,EAAY,MAAG,kBAAeO,EAASD,CAAQ,CAAC,GAAGD,CAAW,EAChE,MACEL,EAAY,GAAGJ,EAAO,GAAG,GAAGG,CAAiB,GAAGK,CAAa,GAAGC,CAAW,EAE/E,SAEEL,EAAYJ,EAAO,OAGf,gBAAa,OAAO,SAAS,MAAM,GAAKJ,GAAK,SAAS,KAAM,CAC9D,MAAMc,KAAW,uBAAoBd,EAAI,QAAQ,IAAI,EACrDQ,KAAY,kBAAeA,EAAWM,CAAQ,CAChD,CAEJ,OAASE,EAAO,CAMd,GAJA,QAAQ,MAAM,uCAAwCA,CAAK,EAC3DR,EAAYJ,EAAO,OAGf,gBAAa,OAAO,SAAS,MAAM,GAAKJ,GAAK,SAAS,KAAM,CAC9D,MAAMc,KAAW,uBAAoBd,EAAI,QAAQ,IAAI,EACrDQ,KAAY,kBAAeA,EAAWM,CAAQ,CAChD,CACF,KACK,CAEL,MAAMF,EAAgB,OAAO,SAAS,OAChCC,EAAc,OAAO,SAAS,KAGpC,MAAI,gBAAaD,CAAa,GAAKZ,GAAK,SAAS,KAAM,CACrD,MAAMc,KAAW,uBAAoBd,EAAI,QAAQ,IAAI,EAC/Ce,EAAU,GAAGX,EAAO,GAAG,GAAGG,CAAiB,GAAGK,CAAa,GACjEJ,EAAY,MAAG,kBAAeO,EAASD,CAAQ,CAAC,GAAGD,CAAW,EAChE,MACEL,EAAY,GAAGJ,EAAO,GAAG,GAAGG,CAAiB,GAAGK,CAAa,GAAGC,CAAW,EAE/E,CAGA,OAAO,SAAS,KAAOL,CACzB,EACA,CAACP,EAAQF,EAAiBC,EAAKE,EAAiBC,CAAoB,CACtE,CAE4B,CAC9B",
|
|
6
|
-
"names": ["useAutoRedirect_exports", "__export", "useAutoRedirect", "__toCommonJS", "import_react", "import_utils", "options", "regions", "regionToPathMap", "geo", "locale", "checkPageExists", "checkPageApiEndpoint", "region", "isCookieRedirect", "allLocales", "pathWithoutLocale", "targetUrl", "targetLocale", "response", "pageExists", "currentSearch", "currentHash", "refValue", "baseUrl", "error"]
|
|
7
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import type { RegionConfig } from './type.js';
|
|
2
|
-
export interface UseDetectedRegionRedirectOptions {
|
|
3
|
-
/**
|
|
4
|
-
* 检测到的地区代码(从 useIPRedirect 的 onDetectRegion 返回)
|
|
5
|
-
*/
|
|
6
|
-
detectedRegion: string | null;
|
|
7
|
-
/**
|
|
8
|
-
* 当前站点的地区代码
|
|
9
|
-
*/
|
|
10
|
-
currentRegionCode: string;
|
|
11
|
-
/**
|
|
12
|
-
* 地区配置列表
|
|
13
|
-
*/
|
|
14
|
-
regions: RegionConfig[];
|
|
15
|
-
/**
|
|
16
|
-
* 白名单路径(在白名单中不执行跳转)
|
|
17
|
-
*/
|
|
18
|
-
excludePaths?: string[];
|
|
19
|
-
/**
|
|
20
|
-
* 当前路径
|
|
21
|
-
*/
|
|
22
|
-
pathname?: string;
|
|
23
|
-
/**
|
|
24
|
-
* 用户是否手动关闭了横幅(关闭横幅后不再自动跳转)
|
|
25
|
-
*/
|
|
26
|
-
userDismissedBanner?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* 自动跳转处理函数
|
|
29
|
-
*/
|
|
30
|
-
onRedirect: (region: RegionConfig, isCookieRedirect?: boolean) => void | Promise<void>;
|
|
31
|
-
}
|
|
32
|
-
/**
|
|
33
|
-
* IP 检测地区跳转监听 Hook
|
|
34
|
-
*
|
|
35
|
-
* 监听 IP 检测到的推荐地区(来自 useIPRedirect 的 detectedRegion),
|
|
36
|
-
* 如果检测到的地区与当前地区不匹配,自动跳转到推荐地区
|
|
37
|
-
*
|
|
38
|
-
* @example
|
|
39
|
-
* ```tsx
|
|
40
|
-
* useDetectedRegionRedirect({
|
|
41
|
-
* detectedRegion, // 从 useIPRedirect 获取
|
|
42
|
-
* currentRegionCode,
|
|
43
|
-
* regions,
|
|
44
|
-
* excludePaths,
|
|
45
|
-
* pathname,
|
|
46
|
-
* userDismissedBanner,
|
|
47
|
-
* onRedirect: handleAutoRedirect, // 从 useAutoRedirect 获取
|
|
48
|
-
* })
|
|
49
|
-
* ```
|
|
50
|
-
*/
|
|
51
|
-
export declare function useDetectedRegionRedirect(options: UseDetectedRegionRedirectOptions): void;
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";var r=Object.defineProperty;var u=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var l=(i,e)=>{for(var n in e)r(i,n,{get:e[n],enumerable:!0})},h=(i,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let t of m(e))!p.call(i,t)&&t!==n&&r(i,t,{get:()=>e[t],enumerable:!(o=u(e,t))||o.enumerable});return i};var C=i=>h(r({},"__esModule",{value:!0}),i);var x={};l(x,{useDetectedRegionRedirect:()=>D});module.exports=C(x);var R=require("react"),f=require("./utils.js");function D(i){const{detectedRegion:e,currentRegionCode:n,regions:o,excludePaths:t=[],pathname:s="",userDismissedBanner:d=!1,onRedirect:c}=i;(0,R.useEffect)(()=>{if((0,f.isPathInWhitelist)(s,t)||d||!e||e===n)return;const g=o.find(a=>a.code===e);g&&c(g)},[e,n,o,d,c,s,t])}
|
|
2
|
-
//# sourceMappingURL=useDetectedRegionRedirect.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/biz-components/IPRedirect/useDetectedRegionRedirect.tsx"],
|
|
4
|
-
"sourcesContent": ["import { useEffect } from 'react'\nimport { isPathInWhitelist } from './utils.js'\nimport type { RegionConfig } from './type.js'\n\nexport interface UseDetectedRegionRedirectOptions {\n /**\n * \u68C0\u6D4B\u5230\u7684\u5730\u533A\u4EE3\u7801\uFF08\u4ECE useIPRedirect \u7684 onDetectRegion \u8FD4\u56DE\uFF09\n */\n detectedRegion: string | null\n\n /**\n * \u5F53\u524D\u7AD9\u70B9\u7684\u5730\u533A\u4EE3\u7801\n */\n currentRegionCode: string\n\n /**\n * \u5730\u533A\u914D\u7F6E\u5217\u8868\n */\n regions: RegionConfig[]\n\n /**\n * \u767D\u540D\u5355\u8DEF\u5F84\uFF08\u5728\u767D\u540D\u5355\u4E2D\u4E0D\u6267\u884C\u8DF3\u8F6C\uFF09\n */\n excludePaths?: string[]\n\n /**\n * \u5F53\u524D\u8DEF\u5F84\n */\n pathname?: string\n\n /**\n * \u7528\u6237\u662F\u5426\u624B\u52A8\u5173\u95ED\u4E86\u6A2A\u5E45\uFF08\u5173\u95ED\u6A2A\u5E45\u540E\u4E0D\u518D\u81EA\u52A8\u8DF3\u8F6C\uFF09\n */\n userDismissedBanner?: boolean\n\n /**\n * \u81EA\u52A8\u8DF3\u8F6C\u5904\u7406\u51FD\u6570\n */\n onRedirect: (region: RegionConfig, isCookieRedirect?: boolean) => void | Promise<void>\n}\n\n/**\n * IP \u68C0\u6D4B\u5730\u533A\u8DF3\u8F6C\u76D1\u542C Hook\n *\n * \u76D1\u542C IP \u68C0\u6D4B\u5230\u7684\u63A8\u8350\u5730\u533A\uFF08\u6765\u81EA useIPRedirect \u7684 detectedRegion\uFF09\uFF0C\n * \u5982\u679C\u68C0\u6D4B\u5230\u7684\u5730\u533A\u4E0E\u5F53\u524D\u5730\u533A\u4E0D\u5339\u914D\uFF0C\u81EA\u52A8\u8DF3\u8F6C\u5230\u63A8\u8350\u5730\u533A\n *\n * @example\n * ```tsx\n * useDetectedRegionRedirect({\n * detectedRegion, // \u4ECE useIPRedirect \u83B7\u53D6\n * currentRegionCode,\n * regions,\n * excludePaths,\n * pathname,\n * userDismissedBanner,\n * onRedirect: handleAutoRedirect, // \u4ECE useAutoRedirect \u83B7\u53D6\n * })\n * ```\n */\nexport function useDetectedRegionRedirect(options: UseDetectedRegionRedirectOptions): void {\n const {\n detectedRegion,\n currentRegionCode,\n regions,\n excludePaths = [],\n pathname = '',\n userDismissedBanner = false,\n onRedirect,\n } = options\n\n useEffect(() => {\n // \u767D\u540D\u5355\u68C0\u67E5\uFF1A\u5982\u679C\u5F53\u524D URL/\u8DEF\u5F84\u5728\u767D\u540D\u5355\u4E2D\uFF0C\u4E0D\u6267\u884C\u81EA\u52A8\u8DF3\u8F6C\n const inWhitelist = isPathInWhitelist(pathname, excludePaths)\n\n if (inWhitelist) {\n return\n }\n\n // \u5982\u679C\u7528\u6237\u5DF2\u624B\u52A8\u5173\u95ED\u6A2A\u5E45\uFF0C\u4E0D\u518D\u81EA\u52A8\u8DF3\u8F6C\n if (userDismissedBanner) {\n return\n }\n\n // \u5982\u679C\u6CA1\u6709\u68C0\u6D4B\u5230\u5730\u533A\uFF0C\u6216\u5730\u533A\u5339\u914D\uFF0C\u4E0D\u5904\u7406\n if (!detectedRegion || detectedRegion === currentRegionCode) {\n return\n }\n\n // \u83B7\u53D6\u76EE\u6807\u5730\u533A\u4FE1\u606F\u5E76\u81EA\u52A8\u8DF3\u8F6C\n const targetRegion = regions.find(r => r.code === detectedRegion)\n\n if (targetRegion) {\n // \u8C03\u7528\u81EA\u52A8\u8DF3\u8F6C\u903B\u8F91\uFF08\u4FDD\u7559\u5F53\u524D\u8DEF\u5F84\uFF09\n onRedirect(targetRegion)\n }\n }, [detectedRegion, currentRegionCode, regions, userDismissedBanner, onRedirect, pathname, excludePaths])\n}\n"],
|
|
5
|
-
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,+BAAAE,IAAA,eAAAC,EAAAH,GAAA,IAAAI,EAA0B,iBAC1BC,EAAkC,sBA2D3B,SAASH,EAA0BI,EAAiD,CACzF,KAAM,CACJ,eAAAC,EACA,kBAAAC,EACA,QAAAC,EACA,aAAAC,EAAe,CAAC,EAChB,SAAAC,EAAW,GACX,oBAAAC,EAAsB,GACtB,WAAAC,CACF,EAAIP,KAEJ,aAAU,IAAM,CAcd,MAZoB,qBAAkBK,EAAUD,CAAY,GAOxDE,GAKA,CAACL,GAAkBA,IAAmBC,EACxC,OAIF,MAAMM,EAAeL,EAAQ,KAAKM,GAAKA,EAAE,OAASR,CAAc,EAE5DO,GAEFD,EAAWC,CAAY,CAE3B,EAAG,CAACP,EAAgBC,EAAmBC,EAASG,EAAqBC,EAAYF,EAAUD,CAAY,CAAC,CAC1G",
|
|
6
|
-
"names": ["useDetectedRegionRedirect_exports", "__export", "useDetectedRegionRedirect", "__toCommonJS", "import_react", "import_utils", "options", "detectedRegion", "currentRegionCode", "regions", "excludePaths", "pathname", "userDismissedBanner", "onRedirect", "targetRegion", "r"]
|
|
7
|
-
}
|